It is currently Mon Feb 18, 2019 10:40 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Jan 29, 2019 10:49 am 
Offline
User avatar

Joined: Mon Jul 16, 2018 2:57 pm
Posts: 38
Right, name tables get written by $2007. I can see incorrect tiles being written there right before the crash.


Top
 Profile  
 
PostPosted: Wed Jan 30, 2019 11:08 pm 
Offline
User avatar

Joined: Mon Jul 16, 2018 2:57 pm
Posts: 38
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:
Attachment:
File comment: Before the crash screenshot.
before.png
before.png [ 132.84 KiB | Viewed 575 times ]


Then you will find an "after the crash" screenshot here:
Attachment:
File comment: After the crash screenshot.
after.png
after.png [ 142.69 KiB | Viewed 575 times ]


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.


Top
 Profile  
 
PostPosted: Thu Jan 31, 2019 12:25 am 
Offline
User avatar

Joined: Mon Jul 16, 2018 2:57 pm
Posts: 38
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:
Code:
address = (0x2000 + NAME_TABLE_ADDRESS) | (V & 0x0FFF);


Where NAME_TABLE_ADDRESS was
Code:
((((word)PPU_CONTROL1) & 0b00000011) * 0x400)


But I noticed in Fogleman's emulator that actually I just needed the simpler:
Code:
address = 0x2000 | (V & 0x0FFF);


I guess V already encodes the specific nametable... okay SMB is working now. Thanks everyone.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: Gilbert, Google [Bot], Nicole and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group