Emulator (InfoNES/pNESx) in microcontroller issues

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Emulator (InfoNES/pNESx) in microcontroller issues
by on (#197570)
Hey there,

I have ported the emulator code from the STM32 to the PIC32, and the code is in the mBed repository:
https://developer.mbed.org/users/beaglescout007/code/Nucleo_Ex06_EMU/file/3dac1f1bc9e0/pNesX.h

The emulator is not written by me, it was by that author in the mBed repository and it is based on the earlier InfoNES/pNESx ones. I just ported the whole thing to another microcontroller.

The system is running well, but with a major issue which is in certain games like "Battle City" and "Nuts and Milk", some of the tiles in the games are misplaced or messed up (the sprites are correct). The games work normally, but some of the tiles are missing, or placed wrongly and with wrong colors. Only some levels in the mentioned games exhibit such problems.

As I've read from the earlier posts in the nesdev forums: https://forums.nesdev.com/viewtopic.php?f=3&t=3585, the problem happened due to the minor errors in the read/write portions in the PPU memory.

Any opinions on that problem? Currently I'm looking into the tile memory in the system during the debug (I can see the correct and the wrong one, that's much about it), but I can't seem to get how they fetch or grab the tiles in the memory.

The same problem actually happened in the actual InfoNES binary in PC too and it is the latest revision.