I haven't touched the NES for several months again, so bear with me if I seem forgetful.
zeroone wrote:@ArsonIzer
I ran into exactly the same problem that you are experiencing with MMC1 with my experimental NES emulator. The images generated by my emulator look identical to yours.
I managed to solve the problem doing 2 things: 1) I reversed horizontal and vertical mapping. I currently have no mapper and MMC1 doing the opposite things at least according to the documentation. 2) I discovered that timing greatly affected things. I suggest introducing a longer delay within the vertical blanking period to enable the processor to run more cycles. See if that helps. If more CPU cycles within the vblank solves the problem, then you'll know that you have to improve the timing code.
Could you elaborate on those points?
1. What do you mean by reversing horizontal and vertical mapping? If you mean that I should set mapping to horizontal when the MMC1 control bit is indicating vertical and vice versa, then no luck. It also seems weird that that would work perfectly.
2. I especially don't get this one. I can't assume that timing is the problem when all tested mapper 0, 2, 3, and 7 games work fine.
For those who are still interested in this error, I found out that there is something wrong with the pattern tables. I looked at FCEUX and my emulator side by side, running the same game, and when the game selects data from the pattern tables, the game running in FCEUX seems to have access to 2 different tables, while mine has access to one (so 0x0000 and 0x1000 are always the same). This means that it's probably either the data being extracted wrong from the ROM, or the mapping always causes the same pattern table to be mapped to the 2 PPU "slots". I hope to figure out quickly which one it is, when I get back to it. If someone has any suggestions until then, that would definitely be appreciated.
EDIT: It seems like I might have 2 separate issues. One is that the pattern tables are accessed wrong SOMEHOW. The other one is that the nametables are wrong. There are games that seem fine-ish and just have peculiar graphic anomalies, while others are completely scrambled. The only MMC1 game that functions fine is Bionic Commando. It has no CHR banks though, maybe that's it. That being said, Mega Man 2 has no CHR banks either and as seen on the first page of this thread, it doesn't work fine at all.
EDIT 2: Bionic commando 2 and Mega Man 2 have no CHR banks yet they (exclusively) use 8K banking. These 2 work, but Mega Man 2 has strange nametable deformities. Addams Family, Adventures in the Magic Kingdom, Darkwing Duck, and Double Dragon have 16 CHR banks, exclusively use 4K banking and all 4 suffer from incorrect pattern tables. What's going on here?