SMB Crash at End of Second NameTable
Moderator: Moderators
Re: SMB Crash at End of Second NameTable
Right, name tables get written by $2007. I can see incorrect tiles being written there right before the crash.
Re: SMB Crash at End of Second NameTable
Okay I finished building my nametables debugger. You can find a "just before the crash" screenshot of both the game (small window) and the 4 nametables (big window) here:
EDIT: Originally was failing a timing test ROM. I have since fixed that—I wasn't counting the +1 ticks for successful branches. Fixed. SMB still crashing.
Then you will find an "after the crash" screenshot here:
As you can see from the screenshots, the text and coin on the top actually appears to be okay in the nametables! The mystery deepens. EDIT: Originally was failing a timing test ROM. I have since fixed that—I wasn't counting the +1 ticks for successful branches. Fixed. SMB still crashing.
Re: SMB Crash at End of Second NameTable
Okay I solved it!
As I suspected it did have to do with pulling from the wrong nametable address and it also was a one liner!
For nametable byte address fetch I was using:
Where NAME_TABLE_ADDRESS was
But I noticed in Fogleman's emulator that actually I just needed the simpler:
I guess V already encodes the specific nametable... okay SMB is working now. Thanks everyone.
As I suspected it did have to do with pulling from the wrong nametable address and it also was a one liner!
For nametable byte address fetch I was using:
Code: Select all
address = (0x2000 + NAME_TABLE_ADDRESS) | (V & 0x0FFF);
Code: Select all
((((word)PPU_CONTROL1) & 0b00000011) * 0x400)
Code: Select all
address = 0x2000 | (V & 0x0FFF);