Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong palettes and tiles with Donkey Kong hack #318

Closed
mrfpga opened this issue Jun 4, 2022 · 5 comments
Closed

wrong palettes and tiles with Donkey Kong hack #318

mrfpga opened this issue Jun 4, 2022 · 5 comments

Comments

@mrfpga
Copy link

mrfpga commented Jun 4, 2022

I have created a custom Donkey Kong hack which has scrambled graphics on MiSTer's NES core (NES_20220326). I believe this is not a problem with my hack, but with the core. The hack works on PC emulators (Mesen v0.9.9, FCEUX v2.6.4), on my Analogue NT Mini FPGA system and on MiSTer's SNES core when converted to a SNES rom using Nested (https://github.com/Myself086/Project-Nested/releases/). The problem with the wrong palettes and tiles on the Pie Factory stage only occurs on MiSTer's NES core:

dkpiefactory

These are the changes I did to the Donkey Kong Original Edition rom:

3FE0: change FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
             FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
             FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          to EA EA EA EA EA EA EA EA EA EA EA EA EA EA EA EA
             EA EA EA EA EA EA EA EA EA EA EA A5 18 29 02 60
             A5 15 29 08 0A 0A 6D 00 02 60 00 00 00 00 00 00

4953: change 20
          to 2C

497A: change AD 00 02
          to 20 F0 BF

4982: change D0 02 A9 7F
          to 90 02 E9 40

74FD: change A5 18 29 02
          to 20 D0 BF EA

What do these changes do?

Donkey Kong (USA) (GameCube Edition) is the only version of Donkey Kong where it is possible to press Up and Down to switch between options at the title screen. I took the responsible code from this version and inserted it into Donkey Kong Original Edition which is the only version of Donkey Kong to feature the Pie Factory stage.

To save you the hassle with the hex editor, I have created a patch to recreate my hack. Just apply it to Donkey Kong (USA) (GameCube Edition) (CRC32: 63AABE94): Donkey Kong Original Edition (USA) (GameCube Edition).zip

@paulb-nl
Copy link
Contributor

paulb-nl commented Jun 4, 2022

Does the Original Edition without your hack work correctly?

@mrfpga
Copy link
Author

mrfpga commented Jun 4, 2022

@paulb-nl: Yes, it works correctly without the hack.

@paulb-nl
Copy link
Contributor

paulb-nl commented Jun 4, 2022

There are also some other changes in your hack related to bus conflicts at rom addresses 3A6, A4D and B5A. Two of those are the issue causing the wrong chr bank to be selected.

3A6: Here either chr bank 0 or 1 is written but $8001 contains 0 so only bank 0 will be selected.
dk_wr8001

B5A: Here bank 2 or 3 is written but $80F7 contains 2 so only bank 2 will be selected.
dk_wr80F7

Your hack would need some more changes if you want to prevent bus conflicts properly. You could also use NES2.0 submapper 1 which specifies No bus conflicts for CNROM: https://www.nesdev.org/wiki/NES_2.0_submappers#003:_0,_1,_2_CNROM

@mrfpga
Copy link
Author

mrfpga commented Jun 5, 2022

Dank u wel, Paul, I completly forgot about the other changes to the rom, which I applied in 2018 after reading a blog post about bus conflicts: http://nerdlypleasures.blogspot.com/2018/09/exciting-developments-for-nes-roms.html

These changes never were a problem, but apparently together with my hack they messed something up. I will now discard those changes and opt for NES2.0 submapper 1 instead, as you suggested.

I will now close this issue, as it is not core related.

@mrfpga mrfpga closed this as completed Jun 5, 2022
@paulb-nl
Copy link
Contributor

paulb-nl commented Jun 8, 2022

The bus conflict changes from Nerdly pleasures are incomplete. Even without your hack it will not work on original hardware (CNROM boards) or emulators that emulate bus conflicts with mapper 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants