It is currently Thu Nov 23, 2017 11:52 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Jul 26, 2017 2:58 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 146
There are a couple things related to the HDMA timeframe that I'd like to see cleared up from a developer's perspective, regarding how HDMA terminates at the end of the frame. Two questions, but they may or may not actually be the same question:

First, is it valid to have an HDMA table that extends outside the active area? More specifically, does the zero terminator in the table have to occur before VBlank? I imagine this would likely simplify HDMA offsetting logic if it is something you can indeed get away with, since you could just change the step size at the top of the table without having to replace any entries in the table with zeroes further down.

Secondly, as far as the DMA crash goes, would it be a good idea to disable HDMA when entering the VBlank routine? Or would this be a waste of VBlank time?

_________________
SNES NTSC 2/1/3 1CHIP | serial number UN318588627


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 3:15 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6449
Location: UK (temporarily)
HihiDanni wrote:
First, is it valid to have an HDMA table that extends outside the active area? More specifically, does the zero terminator in the table have to occur before VBlank?
Yes and no, respectively. The HDMA tables are copied from $43x[23] to $43x[89] at the beginning of rendering. Not clear about specific timing, it's probably somewhere in Anomie's docs.

Quote:
Secondly, as far as the DMA crash goes, would it be a good idea to disable HDMA when entering the VBlank routine? Or would this be a waste of VBlank time?
Not clear it would help you? Maybe it would give you a glitched out screen instead of a crash...

It's probably just a better idea to make sure there's no chance of DMA running over into the active frame anyway.


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 3:19 pm 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 75
anomie wrote:
If HDMA (init or transfer) occurs while a DMA is in progress, the DMA
will be paused for the duration. If the HDMA happens to involve the
current DMA channel, the DMA will be immediately terminated and the
HDMA will progress using the then-current values of the registers.
Other DMA channels will be unaffected.

[...]

HDMA does not occur during V-Blank, as any writes it might perform are
likely have no visible effect anyway. The start-of-frame processing then resets
all active channels at the end of V-Blank. This allows updating of the HDMA
registers during V-Blank without worrying about the transfer beginning
immediately and scribbling on the PPU state.

Does that help?


Top
 Profile  
 
PostPosted: Thu Jul 27, 2017 2:05 am 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 431
HihiDanni wrote:
There are a couple things related to the HDMA timeframe that I'd like to see cleared up from a developer's perspective, regarding how HDMA terminates at the end of the frame. Two questions, but they may or may not actually be the same question:

First, is it valid to have an HDMA table that extends outside the active area? More specifically, does the zero terminator in the table have to occur before VBlank? I imagine this would likely simplify HDMA offsetting logic if it is something you can indeed get away with, since you could just change the step size at the top of the table without having to replace any entries in the table with zeroes further down.

Secondly, as far as the DMA crash goes, would it be a good idea to disable HDMA when entering the VBlank routine? Or would this be a waste of VBlank time?


HDMA isn't processed during VBlank, and at the end of VBlank the HDMA engine is completely reset. As a result, table entries that extend past the bottom of the active display are effectively ignored.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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