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

DMA and dram refresh cycle
http://forums.nesdev.com/viewtopic.php?f=12&t=17209
Page 1 of 1

Author:  srg320 [ Fri Mar 30, 2018 1:32 am ]
Post subject:  DMA and dram refresh cycle

I create a SNES on FPGA. And now I tested several small games with simple LoROM mapper (Dr.Mario, Super Mario World 1, Tetris Attack, Battletoads, Tom and Jerry, Daffy Duck, Sim Sity). All tested games works well. But one game (Sim Sity) works with damaged sprites (and backgrounds, and objects).

I found that the problem disappears if I temporarily remove dram refresh mode in SCPU module. I'm thinking the problem in DMA. I can't understand how DMA should work during dram refresh cycle.

Author:  creaothceann [ Fri Mar 30, 2018 3:04 am ]
Post subject:  Re: DMA and dram refresh cycle

(Afaik) DMA can't work during DRAM refresh; for each cycle of the 21MHz clock the 5A22 has these priorities:

Code:
1. [if DRAM refresh] step the DRAM refresh state machine
2. [if DMA]          if DMA      delay counter = 0 then step the DMA engine;  increment the DMA      delay counter (reset at 8)
3.                   if bus hold delay counter = 0 then step the 65c816 core; increment the bus hold delay counter (reset at 6, 8 or 12, depending on the value on the 65c816 core's address bus)

Author:  srg320 [ Fri Mar 30, 2018 11:23 pm ]
Post subject:  Re: DMA and dram refresh cycle

You're right, and I did the same in my project, active REFRESH signal disable CPU core and DMA, only delay counter I have one (common for DMA and 65c816). I'll rewrite the code DMA/HDMA.

creaothceann wrote:
2. [if DMA]          if DMA      delay counter = 0 then step the DMA engine;  increment the DMA      delay counter (reset at 12)

In my opinion: for DMA reset at 8.

Author:  creaothceann [ Sat Mar 31, 2018 5:10 am ]
Post subject:  Re: DMA and dram refresh cycle

Yeah... fixed.

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