Skip to main content

Module cgb

Module cgb 

Source
Available on crate feature cgb only.
Expand description

Game Boy Color hardware registers.

The accessors are safe but take effect only on CGB hardware. The undocumented registers 0xFF72..=0xFF75 are omitted; they have no defined function.

Structs§

BgAttr
Per-cell tilemap attributes, in VRAM bank 1 at the tilemap addresses.
HdmaCtrl
VRAM DMA length, mode, and start (HDMA5).
Infrared
Infrared communications port (RP).
PaletteIndex
Color palette index (BCPS / OCPS).
PcmAmplitudes
Packed PCM amplitudes (PCM12 / PCM34). Read-only.
SpeedSwitch
CPU speed switch (KEY1).

Constants§

BCPD
Background color palette data at the current BCPS index.
BCPS
Background color palette index.
HDMA1
VRAM DMA source, high byte. Write-only.
HDMA2
VRAM DMA source, low byte. Write-only.
HDMA3
VRAM DMA destination, high byte. Write-only.
HDMA4
VRAM DMA destination, low byte. Write-only.
HDMA5
VRAM DMA length/mode/start.
KEY0
CPU mode select. Mostly a boot-ROM / DMG-compatibility register, locked once the boot ROM hands off.
KEY1
Prepare speed switch (CGB double speed mode).
OCPD
Object color palette data at the current OCPS index.
OCPS
Object color palette index.
OPRI
Object priority mode: 0 = CGB-style (by OAM index), 1 = DMG-style (by X).
PCM12
PCM amplitudes for sound channels 1 and 2. Read-only.
PCM34
PCM amplitudes for sound channels 3 and 4. Read-only.
RP
Infrared communications port.
SVBK
WRAM bank select (bits 0-2) for the 0xD000..=0xDFFF window.
VBK
VRAM bank select (bit 0).