We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

HDMA: Difference between revisions

From SnesLab
Jump to: navigation, search
(Created page with "'''HDMA''' also known as H-Blank Direct Memory Access or Horizontal Direct Memory Access is a type of DMA that does consecutive small transfers of 1-4 bytes instead of an...")
 
Line 5: Line 5:
Although it's used most of the time to update PPU registers, since HDMA is just a variation of the DMA, you can do any kind of transfer between the [[address bus]] A and B, including but not limited to [[APU]] I/O ports, [[WRAM]] registers and even do a backwards transfer (read from PPU and write to RAM).
Although it's used most of the time to update PPU registers, since HDMA is just a variation of the DMA, you can do any kind of transfer between the [[address bus]] A and B, including but not limited to [[APU]] I/O ports, [[WRAM]] registers and even do a backwards transfer (read from PPU and write to RAM).


== Address registers that can be used with HDMA ==
== Registers that can be used with HDMA ==
 
{| class="wikitable"
! Address !! Code !! Name !! Example Usage
|-
|| $2100 || INIDISP || Screen Display Register || Darkness effect, Brightness control, [[F-Blank HDMA]]
|-
|| $2105 || BGMODE || BG Mode and Character Size Register || Multiple screen modes at same time, Screen split
|-
|| $2106 || MOSAIC || Mosaic Register || Partial censorship, Pseudo-3D projection
|-
|| $210D || BG1HOFS || BG1 Horizontal Scroll Registers || Parallax backgrounds, Horizontal waves (water), Pseudo-3D projection, Shape modelation, Mirror effect, Progress bar, Laser projection
|-
|| $210E || BG1VOFS || BG1 Vertical Scroll Registers || Vertical stretching, Vertical rotation, Vertical waves (fire), Screen split, Dissolving effect
|-
|| $210F || BG2HOFS || BG2 Horizontal Scroll Registers || '''See $210D'''
|-
|| $2110 || BG2VOFS || BG2 Vertical Scroll Registers || '''See $210E'''
|-
|| $2111 || BG3HOFS || BG3 Horizontal Scroll Registers || '''See $210D''', OAM-like per tile mode 2 manipulation
|-
|| $2112 || BG3VOFS || BG3 Vertical Scroll Registers || '''See $210E''', OAM-like per tile mode 2 manipulation
|-
|| $2113 || BG4HOFS || BG4 Horizontal Scroll Registers || '''See $210D'''
|-
|| $2114 || BG4VOFS || BG4 Vertical Scroll Registers || '''See $210E'''
|-
|| $211B || M7A || Mode 7 Matrix Registers || Pseudo-3D projection, DSP-1 projection, Linear algebra calculation, Screen looping, Pipeline effect, Optical illusions
|-
|| $211C || M7B || Mode 7 Matrix Registers || '''See $211B'''
|-
|| $211D || M7C || Mode 7 Matrix Registers || '''See $211B'''
|-
|| $211E || M7D || Mode 7 Matrix Registers || '''See $211B'''
|-
|| $211F || M7X || Mode 7 Matrix Registers || '''See $211B''', Screen distortion
|-
|| $2120 || M7Y || Mode 7 Matrix Registers || '''See $211F'''
|-
|| $2121 || CGADD || CGRAM Address Register || Palette manipulation, Color gradients
|-
|| $2122 || CGDATA || CGRAM Data Write Register || '''See $211B'''
|-
|| $2126 || WH0 || Window Position Registers (WH0) || Screen masking, Single-color screen shape/polygon rendering, Optical illusions, Black holes
|-
|| $2127 || WH1 || Window Position Registers (WH1) || '''See $2126'''
|-
|| $2128 || WH2 || Window Position Registers (WH2) || '''See $2126'''
|-
|| $2129 || WH3 || Window Position Registers (WH3) || '''See $2126'''
|-
|| $212C || TM || Screen Destination Registers || Screen masking, Hires rendering, Transparency effects, Blending effects
|-
|| $212D || TS || Screen Destination Registers || '''See $212C'''
|-
|| $2132 || COLDATA || Color Math Registers || Color gradients, transparency effects, brightness control
|}


=== Unusual cases ===
=== Unusual cases ===

Revision as of 01:35, 20 May 2019

HDMA also known as H-Blank Direct Memory Access or Horizontal Direct Memory Access is a type of DMA that does consecutive small transfers of 1-4 bytes instead of an entire block transfer at once. It's a hardware feature present on the SNES made mostly for manipulating certain PPU registers while the screen is being rendered for giving different rendering effects per scanline basis. It's executed during the H-blank period, which is when the PPU is preparing to render the next scanline of the screen output and some registers can be modified during the small pause.

It's a feature extensively used in games for creating different effects of all types and combined with several PPU registers it allows for bypassing several limitations of the 4th generation consoles. Similar approaches are done as well in systems other than Super Nintendo, by using other timing tricks such as IRQ.

Although it's used most of the time to update PPU registers, since HDMA is just a variation of the DMA, you can do any kind of transfer between the address bus A and B, including but not limited to APU I/O ports, WRAM registers and even do a backwards transfer (read from PPU and write to RAM).

Registers that can be used with HDMA

Address Code Name Example Usage
$2100 INIDISP Screen Display Register Darkness effect, Brightness control, F-Blank HDMA
$2105 BGMODE BG Mode and Character Size Register Multiple screen modes at same time, Screen split
$2106 MOSAIC Mosaic Register Partial censorship, Pseudo-3D projection
$210D BG1HOFS BG1 Horizontal Scroll Registers Parallax backgrounds, Horizontal waves (water), Pseudo-3D projection, Shape modelation, Mirror effect, Progress bar, Laser projection
$210E BG1VOFS BG1 Vertical Scroll Registers Vertical stretching, Vertical rotation, Vertical waves (fire), Screen split, Dissolving effect
$210F BG2HOFS BG2 Horizontal Scroll Registers See $210D
$2110 BG2VOFS BG2 Vertical Scroll Registers See $210E
$2111 BG3HOFS BG3 Horizontal Scroll Registers See $210D, OAM-like per tile mode 2 manipulation
$2112 BG3VOFS BG3 Vertical Scroll Registers See $210E, OAM-like per tile mode 2 manipulation
$2113 BG4HOFS BG4 Horizontal Scroll Registers See $210D
$2114 BG4VOFS BG4 Vertical Scroll Registers See $210E
$211B M7A Mode 7 Matrix Registers Pseudo-3D projection, DSP-1 projection, Linear algebra calculation, Screen looping, Pipeline effect, Optical illusions
$211C M7B Mode 7 Matrix Registers See $211B
$211D M7C Mode 7 Matrix Registers See $211B
$211E M7D Mode 7 Matrix Registers See $211B
$211F M7X Mode 7 Matrix Registers See $211B, Screen distortion
$2120 M7Y Mode 7 Matrix Registers See $211F
$2121 CGADD CGRAM Address Register Palette manipulation, Color gradients
$2122 CGDATA CGRAM Data Write Register See $211B
$2126 WH0 Window Position Registers (WH0) Screen masking, Single-color screen shape/polygon rendering, Optical illusions, Black holes
$2127 WH1 Window Position Registers (WH1) See $2126
$2128 WH2 Window Position Registers (WH2) See $2126
$2129 WH3 Window Position Registers (WH3) See $2126
$212C TM Screen Destination Registers Screen masking, Hires rendering, Transparency effects, Blending effects
$212D TS Screen Destination Registers See $212C
$2132 COLDATA Color Math Registers Color gradients, transparency effects, brightness control

Unusual cases