DMA Reload

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
Oziphantom
Posts: 826
Joined: Tue Feb 07, 2017 2:03 am

DMA Reload

Post by Oziphantom » Sat Mar 14, 2020 8:57 am

Is there a trick to getting DMA set up so you just "fire it" each time.

The OAM pointer latches and restores it self on VBlank. But the DMA's don't? You have to set up the length and Start address each time you want to fire one?

User avatar
koitsu
Posts: 4217
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: DMA Reload

Post by koitsu » Sun Mar 15, 2020 12:25 am

For general-purpose DMA, that's correct -- you should set $43x2-43x7 every time, followed by $420b (to induce the transfer). And this is assuming you've set $43x0-43x1 sometime prior (in other words, AFAIK, you should only have to set $43x1-43x1 once).

calima
Posts: 1125
Joined: Tue Oct 06, 2015 10:16 am

Re: DMA Reload

Post by calima » Sun Mar 15, 2020 1:31 am

Unrelated, but I think they are only lost upon actual DMAing. There was that interview were a commercial SNES title used the ten bytes to get fastrom execution for a loop, on an otherwise slowrom cart.

Myself086
Posts: 21
Joined: Sat Nov 10, 2018 2:49 pm

Re: DMA Reload

Post by Myself086 » Sun Mar 15, 2020 6:47 pm

The DMA's data only changes when used for either DMA or HDMA.

According to the notes I have on my private SNES emulator, the start address changes based on the last transferred address+1 and counter is reset to 0. There are some DMA where I could get away with only writing 8-bit to the byte counter instead of 16-bit. So you only need to change $43x2-43x3 and $43x5-43x6.

For HDMA, I only change $43x2-43x3. I use 5 triple buffered HDMA in my current project.

93143
Posts: 1146
Joined: Fri Jul 04, 2014 9:31 pm

Re: DMA Reload

Post by 93143 » Sun Mar 15, 2020 9:56 pm

Myself086 wrote:
Sun Mar 15, 2020 6:47 pm
According to the notes I have on my private SNES emulator, the start address changes based on the last transferred address+1 and counter is reset to 0.
In other words, exactly as if the input registers are the registers actually used by the DMA controller to keep track of what it's doing, and not a façade or buffer like the CGRAM and OAM addresses.

Post Reply