VDP DMA: Difference between revisions
(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...") |
m (→VRAM Fill) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Description= | =Description= | ||
The VDP can perform | 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). | It's quite useful cause DMA transfer is faster than doing direct access (in VBLANK only, during active scan it's the same). | ||
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 | * 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]] | ||
Line 68: | Line 68: | ||
* Disable DMA in [[VDP_Registers#0x1_-_Mode_set_2|VDP register 0x1]] | * Disable DMA in [[VDP_Registers#0x1_-_Mode_set_2|VDP register 0x1]] | ||
==DMA Transfer capacity== | |||
''Note: This information is from SEGA and hasn't been verified'' | |||
{|class="regdef" | |||
|'''DMA Mode''' | |||
|'''Display Mode''' | |||
|'''Bytes per lines''' | |||
|- | |||
|rowspan="2"|Memory to VRAM | |||
|H32 | |||
|During active scan : 16 | |||
During VBLANK : 167 | |||
|- | |||
|H40 | |||
|During active scan : 18 | |||
During VBLANK : 205 | |||
|- | |||
|rowspan="2"|VRAM Fill | |||
|H32 | |||
|During active scan : 15 | |||
During VBLANK : 166 | |||
|- | |||
|H40 | |||
|During active scan : 17 | |||
During VBLANK : 204 | |||
|- | |||
|rowspan="2"|VRAM Copy | |||
|H32 | |||
|During active scan : 8 | |||
During VBLANK : 83 | |||
|- | |||
|H40 | |||
|During active scan : 9 | |||
During VBLANK : 102 | |||
|} | |||
When display is disable (See [[VDP_Registers#0x1_-_Mode_set_2|VDP register 0x1]]), transfer capacity is the same as in VBLANK. | |||
[[Category:Video_system]] |
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 :
- Enable DMA in VDP register 0x1
- Set VDP auto-increment register (Usually 2 because source address in is increased by 2)
- Set the destination address (See setting RAM address) (Don't forget to set CD5 to 1)
- As soon as you set the destination address, the VDP halt the 68k and DMA operation starts.
- Disable DMA in VDP register 0x1
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 :
- Enable DMA in VDP register 0x1
- Set VDP auto-increment register (Usually 1)
- Set VDP register 0x17 to 0x80 (Enable VRAM Fill)
- Set the destination address (See setting RAM address) (Don't forget to set CD5 to 1)
- Set the Fill data by writing the desired value to the data port
- As soon as you set the data, the DMA operation starts.
- Disable DMA in VDP register 0x1
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 :
- Enable DMA in VDP register 0x1
- Set VDP register 0x17 to 0xC0
- Set the destination address (See setting RAM address) (Don't forget to set CD5 and CD4 to 1)
- As soon as you set the destination address, the VDP halt the 68k and DMA operation starts.
- Disable DMA in VDP register 0x1
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.