Register Overview

From Snesdev wiki
Jump to navigation Jump to search

Address Bus B Registers

TODO: note on fast access time

Register Address Name Style Access Timing
Screen Display Register $2100 INIDISP single write any time
Object Size and Character Size Register $2101 OBSEL single write f-blank, v-blank
OAM Address Registers (Low) $2102 OAMADDL single write f-blank, v-blank
OAM Address Registers (High) $2103 OAMADDH single write f-blank, v-blank
OAM Data Write Register $2104 OAMDATA single write f-blank, v-blank
BG Mode and Character Size Register $2105 BGMODE single write f-blank, v-blank, h-blank
Mosaic Register $2106 MOSAIC single write f-blank, v-blank, h-blank
BG Tilemap Address Registers (BG1) $2107 BG1SC single write f-blank, v-blank
BG Tilemap Address Registers (BG2) $2108 BG2SC single write f-blank, v-blank
BG Tilemap Address Registers (BG3) $2109 BG3SC single write f-blank, v-blank
BG Tilemap Address Registers (BG4) $210A BG3SC single write f-blank, v-blank
BG Character Address Registers (BG1&2) $210B BG12NBA single write f-blank, v-blank
BG Character Address Registers (BG3&4) $210C BG34NBA single write f-blank, v-blank
BG Scroll Registers (BG1) $210D BG1HOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG1) $210E BG1VOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG2) $210F BG2HOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG2) $2110 BG2VOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG3) $2111 BG3HOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG3) $2112 BG3VOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG4) $2113 BG4HOFS dual write f-blank, v-blank, h-blank
BG Scroll Registers (BG4) $2114 BG4VOFS dual write f-blank, v-blank, h-blank
Video Port Control Register $2115 VMAIN single write f-blank, v-blank
VRAM Address Registers (Low) $2116 VMADDL single write f-blank, v-blank
VRAM Address Registers (High) $2117 VMADDH single write f-blank, v-blank
VRAM Data Write Registers (Low) $2118 VMDATAL single write f-blank, v-blank
VRAM Data Write Registers (High) $2119 VMDATAH single write f-blank, v-blank
Mode 7 Settings Register $211A M7SEL single write f-blank, v-blank
Mode 7 Matrix Registers $211B M7A dual write f-blank, v-blank, h-blank
Mode 7 Matrix Registers $211C M7B dual write f-blank, v-blank, h-blank
Mode 7 Matrix Registers $211D M7C dual write f-blank, v-blank, h-blank
Mode 7 Matrix Registers $211E M7D dual write f-blank, v-blank, h-blank
Mode 7 Matrix Registers $211F M7X dual write f-blank, v-blank, h-blank
Mode 7 Matrix Registers $2120 M7Y dual write f-blank, v-blank, h-blank
CGRAM Address Register $2121 CGADD single write f-blank, v-blank, h-blank
CGRAM Data Write Register $2122 CGDATA dual write f-blank, v-blank, h-blank
Window Mask Settings Registers $2123 W12SEL single write f-blank, v-blank, h-blank
Window Mask Settings Registers $2124 W34SEL single write f-blank, v-blank, h-blank
Window Mask Settings Registers $2125 WOBJSEL single write f-blank, v-blank, h-blank
Window Position Registers (WH0) $2126 WH0 single write f-blank, v-blank, h-blank
Window Position Registers (WH1) $2127 WH1 single write f-blank, v-blank, h-blank
Window Position Registers (WH2) $2128 WH2 single write f-blank, v-blank, h-blank
Window Position Registers (WH3) $2129 WH3 single write f-blank, v-blank, h-blank
Window Mask Logic registers (BG) $212A WBGLOG single write f-blank, v-blank, h-blank
Window Mask Logic registers (OBJ) $212B WOBJLOG single write f-blank, v-blank, h-blank
Screen Destination Registers $212C TM single write f-blank, v-blank, h-blank
Screen Destination Registers $212D TS single write f-blank, v-blank, h-blank
Window Mask Destination Registers $212E TMW single write f-blank, v-blank, h-blank
Window Mask Destination Registers $212F TSW single write f-blank, v-blank, h-blank
Color Math Registers $2130 CGWSEL single write f-blank, v-blank, h-blank
Color Math Registers $2131 CGADSUB single write f-blank, v-blank, h-blank
Color Math Registers $2132 COLDATA single write f-blank, v-blank, h-blank
Screen Mode Select Register $2133 SETINI single write f-blank, v-blank, h-blank
Multiplication Result Registers $2134 MPYL single read f-blank, v-blank, h-blank
Multiplication Result Registers $2135 MPYM single read f-blank, v-blank, h-blank
Multiplication Result Registers $2136 MPYH single read f-blank, v-blank, h-blank
Software Latch Register $2137 SLHV single any time
OAM Data Read Register $2138 OAMDATAREAD dual read f-blank, v-blank
VRAM Data Read Register (Low) $2139 VMDATALREAD single read f-blank, v-blank
VRAM Data Read Register (High) $213A VMDATAHREAD single read f-blank, v-blank
CGRAM Data Read Register $213B CGDATAREAD dual read f-blank, v-blank
Scanline Location Registers (Horizontal) $213C OPHCT dual read any time
Scanline Location Registers (Vertical) $213D OPVCT dual read any time
PPU Status Register $213E STAT77 single read any time
PPU Status Register $213F STAT78 single read any time
APU IO Registers $2140 APUIO0 single both any time
APU IO Registers $2141 APUIO1 single both any time
APU IO Registers $2142 APUIO2 single both any time
APU IO Registers $2143 APUIO3 single both any time
WRAM Data Register $2180 WMDATA single both any time
WRAM Address Registers $2181 WMADDL single write any time
WRAM Address Registers $2182 WMADDM single write any time
WRAM Address Registers $2183 WMADDH single write any time

Old Style Joypad Registers

TODO: note on extra slow access time

Register Address Name Style Access Timing
Old Style Joypad Registers $4016 JOYSER0 single (write) read/write any time that is not auto-joypad
Old Style Joypad Registers $4017 JOYSER1 many (read) read any time that is not auto-joypad

Internal CPU Registers

TODO: note on fast access time

Register Address Name Style Access Timing
Interrupt Enable Register $4200 NMITIMEN single write any time
IO Port Write Register $4201 WRIO single write any time
Multiplicand Registers $4202 WRMPYA single write any time
Multiplicand Registers $4203 WRMPYB single write any time
Divisor & Dividend Registers $4204 WRDIVL single write any time
Divisor & Dividend Registers $4205 WRDIVH single write any time
Divisor & Dividend Registers $4206 WRDIVB single write any time
IRQ Timer Registers (Horizontal - Low) $4207 HTIMEL single write any time
IRQ Timer Registers (Horizontal - High) $4208 HTIMEH single write any time
IRQ Timer Registers (Vertical - Low) $4209 VTIMEL single write any time
IRQ Timer Registers (Vertical - High) $420A VTIMEH single write any time
DMA Enable Register $420B MDMAEN single write any time
HDMA Enable Register $420C HDMAEN single write any time
ROM Speed Register $420D MEMSEL single write any time
Interrupt Flag Registers $4210 RDNMI single read any time
Interrupt Flag Registers $4211 TIMEUP single read any time
PPU Status Register $4212 HVBJOY single read any time
IO Port Read Register $4213 RDIO single read any time
Multiplication Or Divide Result Registers (Low) $4214 RDDIVL single read any time
Multiplication Or Divide Result Registers (High) $4215 RDDIVH single read any time
Multiplication Or Divide Result Registers (Low) $4216 RDMPYL single read any time
Multiplication Or Divide Result Registers (High) $4217 RDMPYH single read any time
Controller Port Data Registers (Pad 1 - Low) $4218 JOY1L single read any time that is not auto-joypad
Controller Port Data Registers (Pad 1 - High) $4219 JOY1H single read any time that is not auto-joypad
Controller Port Data Registers (Pad 2 - Low) $421A JOY2L single read any time that is not auto-joypad
Controller Port Data Registers (Pad 2 - High) $421B JOY2H single read any time that is not auto-joypad
Controller Port Data Registers (Pad 3 - Low) $421C JOY3L single read any time that is not auto-joypad
Controller Port Data Registers (Pad 3 - High) $421D JOY3H single read any time that is not auto-joypad
Controller Port Data Registers (Pad 4 - Low) $421E JOY4L single read any time that is not auto-joypad
Controller Port Data Registers (Pad 4 - High) $421F JOY4H single read any time that is not auto-joypad

DMA Registers

These registers can be read or written at any time. TODO: write something about fast access time. TODO: write something about x here.

Register Address Name
DMA Control Register $43x0 DMAPx
DMA Destination Register $43x1 BBADx
DMA Source Address Registers $43x2 A1TxL
DMA Source Address Registers $43x3 A1TxH
DMA Source Address Registers $43x4 A1Bx
DMA Size Registers (Low) $43x5 DASxL
DMA Size Registers (High) $43x6 DASxH

HDMA Registers

These registers can be read or written at any time. TODO: write something about fast access time. TODO: write something about x here.

Register Address Name
HDMA Control Register $43x0 DMAPx
HDMA Destination Register $43x1 BBADx
HDMA Table Address Registers $43x2 A1TxL
HDMA Table Address Registers $43x3 A1TxH
HDMA Table Address Registers $43x4 A1Bx
HDMA Indirect Address Registers $43x5 DASxL
HDMA Indirect Address Registers $43x6 DASxH
HDMA Indirect Address Registers $43x7 DASBx
HDMA Mid Frame Table Address Registers (Low) $43x8 A2AxL
HDMA Mid Frame Table Address Registers (High) $43x9 A2AxH
HDMA Line Counter Register $43xA NTLRX

Register Explanations

The flags are:

rw?fvha
||||||+--> '+' if it can be read/written at any time, '-' otherwise
|||||+---> '+' if it can be read/written during H-Blank
||||+----> '+' if it can be read/written during V-Blank
|||+-----> '+' if it can be read/written during force-blank
||+------> Read/Write style: 'b'     => byte
||                           'h'/'l' => read/write high/low byte of a word
||                           'w'     => word read/write twice low then high
|+-------> 'w' if the register is writable for an effect
+--------> 'r' if the register is readable for a value or effect (i.e. not [open bus](/open-bus)).

To find the entry for a particular register, search for the register number (i.e. ‘2100’) at the very beginning of the line. Note that the DMA registers are combined, so e.g. to find $4300, $4310, $4320, $4330, $4340, $4350, $4360, or $4370 you’d search for ‘43x0’.

For most registers (and most undefined bits of readable registers), the returned value is Open Bus, that is the last value read over the main bus from the ROM (typically part of the opcode arguments or the indirect base address).

Registers matching $21x4-6 or $21x8-A (where x is 0-2) return the last value read from any of the PPU1 registers $2134-6, $2138-A, or $213E. This is known as PPU1 Open Bus. Similarly, PPU2 Open Bus involves reading registers $213B-D or $213F (NOT $21xB-D though).

Note that it may be possible to write registers anytime even if marked ‘-’, but until we have proof ‘-’ is a better guess.