It is currently Wed Oct 17, 2018 8:47 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Jul 21, 2018 12:39 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7657
Location: Seattle
mitch3a wrote:
Is this just expected behavior?
You're kinda getting into the esoterica of how scrolling works on the NES. nesdevwiki:PPU scrolling.

But ... no, simply disabling then reenabling rendering wouldn't obviously cause a jump of a single scanline. Re-enabling rendering in the middle of a field should cause it to randomly start rendering with a random weird scroll, but I'd be surprised if it was consistently one scanline.


Top
 Profile  
 
PostPosted: Sat Jul 21, 2018 1:21 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10897
Location: Rio de Janeiro - Brazil
To avoid screen jumps of any kind, the recommendation is to only turn rendering on from the vblank handler, after having set the scroll, so that the first rendered frame starts correctly from the top of the screen and with the correct scroll settings.

If you enable rendering whenever, you'll most likely get a partial picture offset from the top of the screen. Turning rendering of should also be done during vblank, so you don't get a frame with the picture particularly cut off.

The approach many people use is to have the main code simply signal the intent to turn rendering on and off, and the NMI handler is responsible for committing those changes.


Top
 Profile  
 
PostPosted: Mon Jul 23, 2018 6:00 am 
Offline
User avatar

Joined: Mon Jan 23, 2017 8:08 pm
Posts: 30
Location: Boston, MA
Thanks for all the help. I DEFINITELY plan on taking a lot of this feedback (especially rainwarrior's post) and building a better framework for my next game. In this case, it works and I don't want to do any major rewriting cos I want to move on, but I'll probably put a big disclaimer in the code and the readme so that others don't fall into the same issues.


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: No registered users and 6 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