nesdev.com
http://forums.nesdev.com/

PPU synchronization from NMI
http://forums.nesdev.com/viewtopic.php?f=2&t=6589
Page 2 of 2

Author:  tokumaru [ Mon Jul 12, 2010 7:36 pm ]
Post subject: 

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.

Author:  Banshaku [ Mon Jul 12, 2010 7:42 pm ]
Post subject: 

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.

Author:  thefox [ Thu Jul 23, 2015 12:31 am ]
Post subject:  Re: PPU synchronization from NMI

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...)

Author:  freem [ Thu Jul 23, 2015 12:50 am ]
Post subject:  Re: PPU synchronization from NMI

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 153 times

Page 2 of 2 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/