VDP DMA: Difference between revisions

From MegaDrive Development Wiki
Jump to navigation Jump to search
 
Line 45: Line 45:
* Set the Fill data by writing the desired value to the [[VDP_Ports#Data_port|data port]]
* Set the Fill data by writing the desired value to the [[VDP_Ports#Data_port|data port]]


* As soon as you set the destination address, the VDP halt the 68k and DMA operation starts.
* As soon as you set the data, the DMA operation starts.


* Disable DMA in [[VDP_Registers#0x1_-_Mode_set_2|VDP register 0x1]]
* Disable DMA in [[VDP_Registers#0x1_-_Mode_set_2|VDP register 0x1]]

Latest revision as of 16:39, 4 February 2013

Description

The VDP can perform DMA actions for copying data from ROM/RAM to its RAM, filling its RAM with a value or even copying from its RAM to its RAM.

It's quite useful cause DMA transfer is faster than doing direct access (in VBLANK only, during active scan it's the same).

During DMA the VDP stop the 68k as it's using it bus to access the data.

DMA Operations

Memory to VRAM

Step to perform a memory (ROM or RAM) to one of the VDP RAMs :

  • Set DMA length (VDP registers 0x13 and 0x14)
  • As soon as you set the destination address, the VDP halt the 68k and DMA operation starts.

VRAM Fill

VRAM Fill is a DMA operation that allows you to fill the VRAM with one 16 bits value (a word).

Step to perform a VRAM Fill :

  • Set DMA length (VDP registers 0x13 and 0x14)
  • Set the Fill data by writing the desired value to the data port
  • As soon as you set the data, the DMA operation starts.

VRAM Copy

VRAM Copy is a DMA operation that allows you to duplicate a region of the VRAM to another one.

Steps to perform a VRAM Copy :

  • Set DMA length (VDP registers 0x13 and 0x14)
  • Set DMA source address (VDP registers 0x15 and 0x16)
  • As soon as you set the destination address, the VDP halt the 68k and DMA operation starts.

DMA Transfer capacity

Note: This information is from SEGA and hasn't been verified

DMA Mode Display Mode Bytes per lines
Memory to VRAM H32 During active scan : 16

During VBLANK : 167

H40 During active scan : 18

During VBLANK : 205

VRAM Fill H32 During active scan : 15

During VBLANK : 166

H40 During active scan : 17

During VBLANK : 204

VRAM Copy H32 During active scan : 8

During VBLANK : 83

H40 During active scan : 9

During VBLANK : 102

When display is disable (See VDP register 0x1), transfer capacity is the same as in VBLANK.