Introduction
The disassembly of a ROM is full of constants such as lui $t0, 0xA404 followed by a load or store; they are
addresses of hardware. This page gives the map they refer to and the register names the explorer puts in the notes. The names and
addresses are those of the N64brew wiki; the one-line roles are written for this page from the names.
Segments
The VR4300 sees 32-bit virtual addresses. Two segments are mapped directly, without the TLB, to the lowest 512 MiB of physical addresses:
| Segment | Virtual addresses | Physical address | Cache |
|---|---|---|---|
| KSEG0 | $80000000–$9FFFFFFF | virtual − $80000000 | cached |
| KSEG1 | $A0000000–$BFFFFFFF | virtual − $A0000000 | uncached |
Hardware registers are used through KSEG1 (a cached access to most of them freezes the processor, per N64brew), so the addresses on
this page are written $A4040010 and so on; the explorer names the same register through KSEG0 too.
Physical memory map
| Physical addresses | Name | What is there |
|---|---|---|
$00000000–$03EFFFFF | RDRAM | Main memory (4 MiB, or 8 MiB with the Expansion Pak, of the 63 MiB the map reserves). |
$03F00000–$03F7FFFF | RDRAM registers | Per-chip RDRAM registers. |
$03F80000–$03FFFFFF | RDRAM broadcast | Write-only: every RDRAM chip answers. |
$04000000–$04000FFF | SP DMEM | RSP data memory (4 KiB). |
$04001000–$04001FFF | SP IMEM | RSP instruction memory (4 KiB). |
$04040000–$040BFFFF | SP registers | RSP DMA, status, semaphore and program counter. |
$04100000–$041FFFFF | DP command | RDP command DMA and counters. |
$04200000–$042FFFFF | DP span | RDP span and texture memory test registers. |
$04300000–$043FFFFF | MI | MIPS interface: mode, version, interrupts and masks. |
$04400000–$044FFFFF | VI | Video interface. |
$04500000–$045FFFFF | AI | Audio interface. |
$04600000–$046FFFFF | PI | Peripheral interface: cartridge DMA and bus timing. |
$04700000–$047FFFFF | RI | RDRAM interface. |
$04800000–$048FFFFF | SI | Serial interface: DMA to the PIF. |
$08000000–$0FFFFFFF | Cartridge domain 2 | Save memory (SRAM, FlashRAM), slower bus timing. |
$10000000–$1FBFFFFF | Cartridge domain 1 | Cartridge ROM, read through the PI. |
$1FC00000–$1FC007BF | PIF ROM | Boot code of the PIF (IPL1 and IPL2). |
$1FC007C0–$1FC007FF | PIF RAM | Controller and EEPROM communication and boot data (64 bytes). |
The 64DD’s registers ($05000000 range) and IPL ROM ($06000000 range) are also reached through the PI; the rest of the space is
unmapped or unused.
Registers the viewer names
Addresses are given in KSEG1. “Meaning” is a short role from the register’s name; the bit fields are not described here.
RSP (SP)
| Address | Name | Meaning |
|---|---|---|
$A4040000 | SP_MEM_ADDR | RSP DMA: address in DMEM or IMEM |
$A4040004 | SP_DRAM_ADDR | RSP DMA: address in RDRAM |
$A4040008 | SP_RD_LEN | RSP DMA: length, RDRAM to RSP, starts the copy |
$A404000C | SP_WR_LEN | RSP DMA: length, RSP to RDRAM, starts the copy |
$A4040010 | SP_STATUS | RSP status and control (halt, break, signals) |
$A4040014 | SP_DMA_FULL | RSP DMA queue full |
$A4040018 | SP_DMA_BUSY | RSP DMA busy |
$A404001C | SP_SEMAPHORE | RSP semaphore |
$A4080000 | SP_PC | RSP program counter |
RDP (DP command and span)
| Address | Name | Meaning |
|---|---|---|
$A4100000 | DPC_START | RDP command list start |
$A4100004 | DPC_END | RDP command list end |
$A4100008 | DPC_CURRENT | RDP command pointer |
$A410000C | DPC_STATUS | RDP status and control |
$A4100010 | DPC_CLOCK | RDP clock counter |
$A4100014 | DPC_CMD_BUSY | RDP command busy counter (the wiki’s summary table calls it DPC_BUF_BUSY) |
$A4100018 | DPC_PIPE_BUSY | RDP pipe busy counter |
$A410001C | DPC_TMEM_BUSY | RDP texture memory busy counter |
$A4200000 | DPS_TBIST | RDP texture memory built-in self test |
$A4200004 | DPS_TEST_MODE | RDP span test mode |
$A4200008 | DPS_BUFTEST_ADDR | RDP span buffer test address |
$A420000C | DPS_BUFTEST_DATA | RDP span buffer test data |
MIPS interface (MI)
| Address | Name | Meaning |
|---|---|---|
$A4300000 | MI_MODE | MI mode (init, repeat, ebus test) |
$A4300004 | MI_VERSION | MI version |
$A4300008 | MI_INTERRUPT | Pending RCP interrupts (SP, SI, AI, VI, PI, DP) |
$A430000C | MI_MASK | RCP interrupt mask |
Video interface (VI)
| Address | Name | Meaning |
|---|---|---|
$A4400000 | VI_CTRL | Video control: pixel size, anti-aliasing, filters |
$A4400004 | VI_ORIGIN | Framebuffer address in RDRAM |
$A4400008 | VI_WIDTH | Framebuffer width in pixels |
$A440000C | VI_V_INTR | Half-line that raises the video interrupt |
$A4400010 | VI_V_CURRENT | Current half-line |
$A4400014 | VI_BURST | Colour burst timing |
$A4400018 | VI_V_TOTAL | Total half-lines per field |
$A440001C | VI_H_TOTAL | Total video clocks per line |
$A4400020 | VI_H_TOTAL_LEAP | Line length leap pattern |
$A4400024 | VI_H_VIDEO | Active horizontal range |
$A4400028 | VI_V_VIDEO | Active vertical range |
$A440002C | VI_V_BURST | Colour burst vertical range |
$A4400030 | VI_X_SCALE | Horizontal scale |
$A4400034 | VI_Y_SCALE | Vertical scale |
$A4400038 | VI_TEST_ADDR | Test address |
$A440003C | VI_STAGED_DATA | Staged test data |
Audio interface (AI)
| Address | Name | Meaning |
|---|---|---|
$A4500000 | AI_DRAM_ADDR | Audio DMA: address in RDRAM |
$A4500004 | AI_LENGTH | Audio DMA: length in bytes, starts or queues the transfer |
$A4500008 | AI_CONTROL | Audio DMA enable |
$A450000C | AI_STATUS | Audio status |
$A4500010 | AI_DACRATE | DAC sample period |
$A4500014 | AI_BITRATE | Audio bit clock rate |
Peripheral interface (PI)
| Address | Name | Meaning |
|---|---|---|
$A4600000 | PI_DRAM_ADDR | Cartridge DMA: address in RDRAM |
$A4600004 | PI_CART_ADDR | Cartridge DMA: address on the cartridge bus |
$A4600008 | PI_RD_LEN | Cartridge DMA: length, RDRAM to cartridge |
$A460000C | PI_WR_LEN | Cartridge DMA: length, cartridge to RDRAM |
$A4600010 | PI_STATUS | PI status and control |
$A4600014 | PI_BSD_DOM1_LAT | Domain 1 latency |
$A4600018 | PI_BSD_DOM1_PWD | Domain 1 pulse width |
$A460001C | PI_BSD_DOM1_PGS | Domain 1 page size |
$A4600020 | PI_BSD_DOM1_RLS | Domain 1 release |
$A4600024 | PI_BSD_DOM2_LAT | Domain 2 latency |
$A4600028 | PI_BSD_DOM2_PWD | Domain 2 pulse width |
$A460002C | PI_BSD_DOM2_PGS | Domain 2 page size |
$A4600030 | PI_BSD_DOM2_RLS | Domain 2 release |
RDRAM interface (RI)
| Address | Name | Meaning |
|---|---|---|
$A4700000 | RI_MODE | RDRAM interface mode |
$A4700004 | RI_CONFIG | RDRAM interface configuration |
$A4700008 | RI_CURRENT_LOAD | Current control load |
$A470000C | RI_SELECT | Select |
$A4700010 | RI_REFRESH | Refresh |
$A4700014 | RI_LATENCY | Latency |
$A4700018 | RI_ERROR | Error |
$A470001C | RI_BANK_STATUS | Bank status |
Serial interface (SI)
| Address | Name | Meaning |
|---|---|---|
$A4800000 | SI_DRAM_ADDR | PIF DMA: address in RDRAM |
$A4800004 | SI_PIF_AD_RD64B | PIF DMA: read 64 bytes from PIF RAM |
$A4800008 | SI_PIF_AD_WR4B | Write 4 bytes to PIF RAM |
$A4800010 | SI_PIF_AD_WR64B | PIF DMA: write 64 bytes to PIF RAM |
$A4800014 | SI_PIF_AD_RD4B | Read 4 bytes from PIF RAM |
$A4800018 | SI_STATUS | SI status |
The disassembly also names RSP memory (SP_DMEM+n, SP_IMEM+n) and PIF RAM (PIF_RAM+n) offsets. The RSP’s
SP_IBIST register and the iQue Player’s extra registers (MI_BB_*, PI_BB_*) are not named: the wiki gives no address for the first,
and the second are specific to another console.
How the viewer finds a register
A disassembler sees lui $t0, 0xA404 and, a few instructions later, lw $t1, 0x10($t0); it cannot know the register held the
constant. The explorer looks back up to 16 instructions for the lui that set the base register, adds the offsets it can see
(ori, addiu, the load or store offset) and names the address when it is on the list above. It stops at a jump and
does not follow branches, so the note is a guess about the run time value, marked “from the LUI above”; it never changes the instruction text.
Not described
Known, not yet covered
- Reference: the bit fields of every register, the RDRAM chip registers, the 64DD registers, the iQue Player registers, the PIF’s command protocol and the TLB mappings games set up.
Links
Reference
- Memory map – N64brew wiki: the physical map and the KSEG0 and KSEG1 segments
- MIPS Interface – N64brew wiki: MI registers
- Video Interface – N64brew wiki: VI registers
- Peripheral Interface – N64brew wiki: PI registers
- Audio Interface – N64brew wiki: AI registers
- Serial Interface – N64brew wiki: SI registers
- RDRAM Interface – N64brew wiki: RI registers
- RSP Interface – N64brew wiki: SP registers
- RDP Interface – N64brew wiki: DPC and DPS registers