VDP DMA

From MegaDrive Development Wiki
Jump to: navigation, search

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.