It is currently Wed Nov 14, 2018 4:59 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Jul 03, 2018 6:31 am 
Offline

Joined: Tue Jul 01, 2014 4:02 pm
Posts: 321
Obviously, attempting to cram in some potential scrolling functionality into an engine not set up for it has proved to be a bit of a trial. But so far so good.

I went to add a sprite 0 hit to maintain the hud at the top of the screen. It's an easy enough concept, I get it. I had to add in a few caveats for the engine, so that it only does sprite 0 check if a flag is ticked, and tick and untick that, but other than that, everything seems like it should work.

And it *is* working, except the draw is getting corrupted. Where there should be a HUD, it seems to be overwritten with some junk graphic data (which remains static, as expected, while the level scrolls). It's absolutely the wait for the sprite 0 hit that is causing the issue, and I checked to see if I was gobbling up too much NMI time, but that doesn't seem to be the problem. What else might I check here to find what's being corrupted to end up causing this? Any thoughts, just based on what is described?

Thanks!


Top
 Profile  
 
PostPosted: Tue Jul 03, 2018 7:03 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2329
Location: DIGDUG
Use a debugger.

Get a list of symbols, and find the address of just past the Sprite zero hit. Set a breakpoint for that. Then, set a breakpoint for writes to 2006 or 2007, which is probably causing the corruption (writes to PPU during rendering).

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Tue Jul 03, 2018 7:11 am 
Offline

Joined: Tue Jul 01, 2014 4:02 pm
Posts: 321
Yeah - that was my instinct. That rogue 2006 writes without 2005 writes were the problem. But...simply disabling the zero sprite hit wait dismissed the problem. Curious.

I'll try that, though!


Top
 Profile  
 
PostPosted: Tue Jul 03, 2018 9:28 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10962
Location: Rio de Janeiro - Brazil
When waiting for the sprite hit, are you first waiting for it to be cleared, and then set? Since the flag remains set all throughout vblank, you may end up prematurely triggering a split if you don't wait for the flag to be cleared first, which happens at the end of vblank.


Top
 Profile  
 
PostPosted: Tue Jul 03, 2018 4:24 pm 
Offline

Joined: Tue Jul 01, 2014 4:02 pm
Posts: 321
Ah - fixed it. Something stupid. Trying to read the sprite 0 check with drawing $2000 still set to 0 (at least, pretty sure that was it). Seems fixed now other than NOPing to get the timing so I don't get the flicker pixels. Thanks for the help - I think I just need to look at it with a cup of coffee. Love you guys!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users 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