It is currently Mon Sep 24, 2018 4:58 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Rogue pixels
PostPosted: Wed Mar 21, 2018 2:26 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10815
Location: Rio de Janeiro - Brazil
sailense wrote:
Right now I'm resetting scoll values in all my subroutines where I write to $2006. Is that the best way to go?

If you're not doing any raster effects, you only need to reset the scroll once per frame, before rendering starts. Normally that'd be at the end of your NMI handler, after all PPU operations have already been done.

Quote:
And when is the best time to read from controller? Every NMI or during the main loop?

Doing it in the NMI can actually cause bugs during lag frames, because the same logic frame may end up using 2 different states of the same button if an NMI happens between two checks. Better do it in the main loop, once for each logic frame.


Top
 Profile  
 
 Post subject: Re: Rogue pixels
PostPosted: Wed Mar 21, 2018 6:30 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20569
Location: NE Indiana, USA (NTSC)
tokumaru wrote:
[Reading the controller] in the NMI can actually cause bugs during lag frames, because the same logic frame may end up using 2 different states of the same button if an NMI happens between two checks. Better do it in the main loop, once for each logic frame.

That's a good idea in many cases. The other way to handle it, especially if you're playing DPCM samples, is to have the main loop request that the NMI handler perform the reread immediately after uploading a display list to OAM, as Rahsennor discovered.


Top
 Profile  
 
 Post subject: Re: Rogue pixels
PostPosted: Wed Mar 21, 2018 7:13 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10815
Location: Rio de Janeiro - Brazil
Oh yeah, I forgot about that. Yes, if you read the controllers in the NMI only when a logic frame isn't interrupted, you can avoid that button inconsistency issue I mentioned before and still make use of this technique to avoid DPCM input glitches.


Top
 Profile  
 
 Post subject: Re: Rogue pixels
PostPosted: Wed Mar 21, 2018 4:54 pm 
Offline
User avatar

Joined: Wed Mar 14, 2018 6:23 pm
Posts: 9
tepples wrote:
tokumaru wrote:
[Reading the controller] in the NMI can actually cause bugs during lag frames, because the same logic frame may end up using 2 different states of the same button if an NMI happens between two checks. Better do it in the main loop, once for each logic frame.

That's a good idea in many cases. The other way to handle it, especially if you're playing DPCM samples, is to have the main loop request that the NMI handler perform the reread immediately after uploading a display list to OAM, as Rahsennor discovered.


That's a great link. The ring counter technique is awesome.

I'm purposely avoiding DPCM samples in the music specifically so I don't have to worry about it.


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

All times are UTC - 7 hours


Who is online

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