MiSTer-devel / NES_MiSTer

GNU General Public License v3.0
169 stars 73 forks source link

Problems with MMC3 FOUR SCREEN mirroring, 512Kb of PRG-ROM (32 x 16kb pages), 8kb of CHR-RAM and 8kb of WRAM. #391

Closed Azicuetano closed 1 week ago

Azicuetano commented 1 week ago

Dear NES core development team for MISTer,

In 4MHz, homebrew development team for NES, we are developing a videogame with the name MALASOMBRA. We have been working on it for the last 5 years, although we think we are already in the final stretch (4-6 months to finish).

Our beta version works well on FAMICOM and NES, both on NES PAL and NES NTSC, using as support an original Everdrive cartridge, as well as a chinese clone cartridge. It also works well in all kind of emulators like MESEN, FCEUX, RetroArch cores, etc. Finally, it already works fine on a cartridge we have developed as a prototype.

Our development uses the MMC3 mapper, with FOUR SCREEN mirroring, 512Kb of PRG-ROM (32 x 16kb pages), 8kb of CHR-RAM and 8kb of WRAM.

To the best of our knowledge, there is no other video game that uses exactly these specifications, but we understand that they are allowed and correct, since in our prototype cartridge everything works fine.

Recently we have had the opportunity to test it in MISTer, but in this case it does not have the expected behavior. Everything seems to work correctly, but it does not display the correct tiles. We think it is a problem identifying the type of CHR that the cartridge has.

Below I include a link to a rom that we have developed as a test to check this unexpected operation. This test performs a bank change, painting consecutively the whole screen with the characters 0123456789ABCDEFGDEFGHIJKLMNOPQRSTUV (to check the 32 banks of PRG-ROM). After that it shows a screen with our logo, composed by background tiles and some sprite tiles, and starts playing a melody.

In MISTer, everything related to tiles, shows tiles from previous ROMs loaded in memory, even if we have a specific code to initialize the CHR-RAM. As I said before, this works fine in emulators and different with NES / FAMICOM consoles, etc.

Many thanks in advance to all the development team of this core for attending this request!!!

Additional info and material: Link to test rom: https://www.4mhz.es/pub/test-mmc3-4screen-512prgrom-8chrram-8wram-v01.nes test-rom-nes-mapper-reader test-rom-emu test-rom-MISTer-after-load-mario

paulb-nl commented 1 week ago

Hi,

To be clear, your prototype cartridge has a 8KB CHR RAM chip for tiles and 2 or 4KB RAM chip for Name tables?

socram8888 commented 1 week ago

@paulb-nl the actual physical cartridge has 16KiB permanently mapped in the entire PPU memory space, which would be the equivalent of 8KiB for pattern tables and 4KiB for nametables.

paulb-nl commented 1 week ago

CHR-RAM was not working together with 4-screen. I have fixed it with commit c3f0e67dc38dd385a18bd959390de4cee4ebb8b2

Azicuetano commented 1 week ago

CHR-RAM was not working together with 4-screen. I have fixed it with commit c3f0e67

Thank you very much @paulb-nl!!!!

@socram8888 has compiled the latest version with that fix, and now everything works perfectly :) Again, thank you very much for your help and I hope that soon all of you will be able to enjoy this new development for NES.