VDP DMA

From MegaDrive Development Wiki
Revision as of 18:45, 20 March 2012 by ElBarto (talk | contribs) (Created page with "=Description= The VDP can perform [http://en.wikipedia.org/wiki/Direct_memory_access|DMA] actions for copying data from ROM/RAM to its RAM, filling its RAM with a value or ev...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

The VDP can perform [1] 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 destination address, the VDP halt the 68k and 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.