Introduction
A PlayStation program is full of constants such as lui $t0, 0x1F80 followed by a load or store of an offset such as
0x1070: that is the interrupt status register at $1F801070. This page gives the map and the names the explorer puts in the notes of
the disassembly. Names and addresses are those of the Nocash PSX-SPX “Memory Map” and “I/O Map” tables; the one-line roles are written here from the names.
Segments
The same memory appears at three addresses (the processor has no TLB):
| Segment | Addresses | Physical address | Use |
|---|---|---|---|
| KUSEG | $00000000–$7FFFFFFF | the address | the user segment (the PlayStation maps only the low part) |
| KSEG0 | $80000000–$9FFFFFFF | address − $80000000 | cached; where programs run |
| KSEG1 | $A0000000–$BFFFFFFF | address − $A0000000 | uncached; used for hardware registers and the BIOS ROM |
| KSEG2 | $C0000000 and up | — | the cache control register at $FFFE0130 |
Memory map
| KUSEG | KSEG0 | KSEG1 | Size | What is there |
|---|---|---|---|---|
$00000000 | $80000000 | $A0000000 | 2 MiB | Main RAM; the first 64 KiB are reserved for the BIOS; mirrored across the first 8 MiB by default. |
$1F000000 | $9F000000 | $BF000000 | 8 MiB | Expansion region 1 (ROM or RAM on the expansion port). |
$1F800000 | $9F800000 | — | 1 KiB | Scratchpad (fast data cache RAM). |
$1F801000 | $9F801000 | $BF801000 | 8 KiB | I/O ports. |
$1F802000 | $9F802000 | $BF802000 | 8 KiB | Expansion region 2 (I/O of the expansion port). |
$1FA00000 | $9FA00000 | $BFA00000 | 2 MiB | Expansion region 3. |
$1FC00000 | $9FC00000 | $BFC00000 | 512 KiB | BIOS ROM (up to 4 MiB). |
Registers the viewer names
Addresses are the physical ones; the viewer names the same register through KUSEG, KSEG0 and KSEG1. “Meaning” is a short role from the register’s name; the bit fields are not described.
| Address | Name | Meaning |
|---|---|---|
$1F801000 | EXP1_BASE | Expansion 1 base address |
$1F801004 | EXP2_BASE | Expansion 2 base address |
$1F801008 | EXP1_DELAY | Expansion 1 delay and size |
$1F80100C | EXP3_DELAY | Expansion 3 delay and size |
$1F801010 | BIOS_DELAY | BIOS ROM delay and size |
$1F801014 | SPU_DELAY | SPU delay and size |
$1F801018 | CDROM_DELAY | CD-ROM delay and size |
$1F80101C | EXP2_DELAY | Expansion 2 delay and size |
$1F801020 | COM_DELAY | Common delay |
$1F801040 | JOY_DATA | Joypad and memory card data |
$1F801044 | JOY_STAT | Joypad and memory card status |
$1F801048 | JOY_MODE | Joypad and memory card mode |
$1F80104A | JOY_CTRL | Joypad and memory card control |
$1F80104E | JOY_BAUD | Joypad and memory card baud rate |
$1F801050 | SIO_DATA | Serial port data |
$1F801054 | SIO_STAT | Serial port status |
$1F801058 | SIO_MODE | Serial port mode |
$1F80105A | SIO_CTRL | Serial port control |
$1F80105C | SIO_MISC | Serial port miscellaneous |
$1F80105E | SIO_BAUD | Serial port baud rate |
$1F801060 | RAM_SIZE | RAM size configuration |
$1F801070 | I_STAT | Interrupt status (bits cleared by writing 0) |
$1F801074 | I_MASK | Interrupt mask |
$1F801080–$1F8010EF | DMAn_MADR, _BCR, _CHCR | Seven DMA channels of 16 bytes: base address, block control and channel control at +0, +4 and +8. Channels: 0 MDEC in, 1 MDEC out, 2 GPU, 3 CD-ROM, 4 SPU, 5 expansion port (PIO), 6 OTC (clears an ordering table) |
$1F8010F0 | DPCR | DMA control register |
$1F8010F4 | DICR | DMA interrupt register |
$1F801100 | TIMER0_COUNT | Timer 0 current counter value |
$1F801104 | TIMER0_MODE | Timer 0 counter mode |
$1F801108 | TIMER0_TARGET | Timer 0 counter target value |
$1F801110 | TIMER1_COUNT | Timer 1 current counter value |
$1F801114 | TIMER1_MODE | Timer 1 counter mode |
$1F801118 | TIMER1_TARGET | Timer 1 counter target value |
$1F801120 | TIMER2_COUNT | Timer 2 current counter value |
$1F801124 | TIMER2_MODE | Timer 2 counter mode |
$1F801128 | TIMER2_TARGET | Timer 2 counter target value |
$1F801800 | CD_INDEX_STATUS | CD-ROM index and status |
$1F801801 | CD_RESPONSE_COMMAND | CD-ROM response FIFO (read) or command (write) |
$1F801802 | CD_DATA_PARAMETER | CD-ROM data FIFO (read) or parameter FIFO (write) |
$1F801803 | CD_IRQ_REQUEST | CD-ROM interrupt enable (read) or request (write) |
$1F801810 | GP0 | GPU drawing and data port (write), GPUREAD (read) |
$1F801814 | GP1 | GPU control port (write), GPUSTAT (read) |
$1F801820 | MDEC_COMMAND | MDEC command or parameter (write), data or response (read) |
$1F801824 | MDEC_CONTROL | MDEC control or reset (write), status (read) |
$1F801C00–$1F801D7F | SPU_Vn_VOL_L, _VOL_R, _PITCH, _START, _ADSR_LO, _ADSR_HI, _CUR_VOL, _REPEAT | The 24 SPU voices, 16 bytes each: volume left and right, ADPCM sample rate, ADPCM start address, ADSR (two halves), current volume, ADPCM repeat address |
$1F801D80 | SPU_MAIN_VOL_L | SPU main volume left |
$1F801D82 | SPU_MAIN_VOL_R | SPU main volume right |
$1F801D84 | SPU_REVERB_VOL | SPU reverb output volume left and right |
$1F801D88 | SPU_KEY_ON | SPU voices 0-23 key on (start attack, decay, sustain) |
$1F801D8C | SPU_KEY_OFF | SPU voices 0-23 key off (start release) |
$1F801D90 | SPU_FM_MODE | SPU voices 0-23 frequency modulation mode |
$1F801D94 | SPU_NOISE_MODE | SPU voices 0-23 noise mode |
$1F801D98 | SPU_REVERB_MODE | SPU voices 0-23 reverb mode |
$1F801D9C | SPU_VOICE_STATUS | SPU voices 0-23 on or off status |
$1F801DA2 | SPU_REVERB_START | SPU sound RAM reverb work area start |
$1F801DA4 | SPU_IRQ_ADDR | SPU sound RAM interrupt address |
$1F801DA6 | SPU_TRANSFER_ADDR | SPU sound RAM data transfer address |
$1F801DA8 | SPU_TRANSFER_FIFO | SPU sound RAM data transfer FIFO |
$1F801DAA | SPUCNT | SPU control register |
$1F801DAC | SPU_TRANSFER_CTRL | SPU sound RAM data transfer control |
$1F801DAE | SPUSTAT | SPU status register |
$1F801DB0 | SPU_CD_VOL | SPU CD volume left and right |
$1F801DB4 | SPU_EXT_VOL | SPU external volume left and right |
$1F801DB8 | SPU_CURRENT_VOL | SPU current main volume left and right |
$1F802020 | DUART | Expansion 2 DUART (debug TTY), $1F802020–$1F80202F |
$1F802040 | DIP_POST | Expansion 2 DIP switches and POST, $1F802040–$1F802042 |
$FFFE0130 | CACHE_CONTROL | Cache control (KSEG2) |
The names are the ones the explorer uses in the notes; they are not Sony’s. The DMA channel register names (MADR, BCR, CHCR) and the order within a channel are the usual ones; the I/O map the names are taken from lists the channels only by their 16-byte blocks.
How the viewer finds a register
The explorer looks back up to 16 instructions from a load, a store, an ori or an addiu for the lui that set the base register
(lui $t0, 0x1F80 or 0xBF80), adds the offsets it can see and names the address when it is on the list. It stops at a jump and does not follow branches, so
the note is a guess about the value at run time, 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 GPU command set, the CD-ROM commands, the SPU reverb registers (
$1F801DC0and up) and internal registers ($1F801E00and up), the exception vectors and the BIOS memory allocation.
Links
Reference
- Nocash PSX-SPX – “Memory Map” and “I/O Map”