It is currently Sat Dec 16, 2017 11: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:
PostPosted: Mon Jul 12, 2010 7:36 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10166
Location: Rio de Janeiro - Brazil
tepples wrote:
and it's not even really wasting if you defer computation of some of the written values until that line.

The code I use takes significantly less than a scanline:

Code:
   ;start setting the scroll before the horizontal blank (48 cycles)
   lda ScrollX+1
   lsr
   lda ScrollY+1
   rol
   asl
   asl
   sta PPUADDR
   lda ScrollY+0
   sta PPUSCROLL
   asl
   asl
   and #%11100000
   ldx ScrollX+0
   sta ScrollX+0
   txa
   lsr
   lsr
   lsr
   ora ScrollX+0

   ;finish setting the scroll during HBlank (11 cycles)
   stx PPUSCROLL
   sta PPUADDR
   stx ScrollX+0

But yeah, it makes sense to do these operations as the scanline is rendered, and have the final writes fall within HBlank. That way only a portion of the time will be wasted.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 12, 2010 7:42 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1519
Location: Fukuoka, Japan
I see. I will need to check what was the issue in details once I can remember the code since I didn't touch for 7 months. I was just prototyping at the time so the code is not stable yet.

As for wasting time, this is not much an issue in my case since I only need to do this during screen transition so nothing intensive happen during that phase.


Top
 Profile  
 
PostPosted: Thu Jul 23, 2015 12:31 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
Broken link in the original post, can somebody repost in an attachment? (Preferably a mod or blargg should edit the original post to include the attachment...)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Jul 23, 2015 12:50 am 
Offline
User avatar

Joined: Mon Oct 01, 2012 3:47 pm
Posts: 153
Location: freemland (NTSC-U)
this link appears to still work: http://slack.net/~ant/old/nes-code/nmi_sync.zip

I've attached it to this post so it won't get lost in the future.


Attachments:
nmi_sync.zip [8.34 KiB]
Downloaded 94 times
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 5 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