Neo Geo
Memory Mapped Registers
參考資訊:
1. wiki
I/O registers
Name | Address | Mask | Description | Read | Write |
---|---|---|---|---|---|
REG_P1CNT | 0x300000 | 0xfe0001 | Joypad port 1 inputs (active low) |
b7: D b6: C b5: B b4: A b3: RIGHT b2: LEFT b1: DOWN b0: UP |
|
REG_DIPSW | 0x300001 | 0xfe0081 | Hardware DIPs (active low) |
b7: Freeze b6: Freeplay b5: Enable Multiplayer b4~b3: Comm. ID code b2: [0]Normal controller, [1]Mahjong keyboard b1: [0]1 chute, [1]2 chutes b0: Settings mode |
Kick watchdog |
REG_SYSTYPE | 0x300081 | 0xfe0081 | Reads the unused DSW2 on MV4 boards. Used for system ID on other boards. |
b7: Test Button b6: Type [0]2 slots, [1]4 or 6 slots |
|
REG_SOUND | 0x320000 | 0xfe0001 | Read Z80 reply code | Send command to Z80 | |
REG_STATUS_A | 0x320001 | 0xfe0001 | Switch inputs are active low |
b7: RTC data bit b6: RTC time pulse b5: [0]4-SLOT, [1]6-SLOT b4: Coin-in 4 b3: Coin-in 3 b2: Service button b1: Coin-in 2 b0: Coin-in 1 |
|
REG_P2CNT | 0x340000 | 0xfe0001 | Joypad port 2 inputs (active low) |
b7: D b6: C b5: B b4: A b3: RIGHT b2: LEFT b1: DOWN b0: UP |
|
REG_STATUS_B | 0x380000 | 0xfe0001 | Aux inputs (lower bits active low) |
b7: [0]AES, [1]MVS b6: Memory card write protected if 1 b5~b4: Memory card inserted if 00 b3: Select P2 b2: Start P2 b1: Select P1 b0: Start P1 |
|
REG_POUTPUT | 0x380001 | 0xfe0071 | Joypad ports outputs |
b5~b3: P2 outputs b2~b0: P1 outputs |
|
REG_CRDBANK | 0x380011 | 0xfe0071 | b2~b0: Memory card bank selection | ||
REG_SLOT | 0x380021 | 0xfe00f1 | Mirror of REG_POUTPUT on the AES | b2~b0: Slot # | |
REG_LEDLATCHES | 0x380031 | 0xfe00f1 | LED data is latched on 1 to 0 transition. |
b5: Latch LED2 data b4: Latch LED1 data b3: Latch marquee data |
|
REG_LEDDATA | 0x380041 | 0xfe00f1 | 8-bit data for credits displays and the marquee. | ||
REG_RTCCTRL | 0x380051 | 0xfe00f1 | MAME upd4990a_control_16_w |
b2: RTC Strobe b1: RTC Clock b0: RTC DIN |
|
REG_RESETCC1 | 0x380061 | 0xfe00f1 | Any, coin counter 1 floats | ||
REG_RESETCC2 | 0x380063 | 0xfe00f1 | Any, coin counter 2 floats | ||
REG_RESETCL1 | 0x380065 | 0xfe00f1 | Any, coin lockout 1 floats | ||
REG_RESETCL2 | 0x380067 | 0xfe00f1 | Any, coin lockout 2 floats | ||
REG_SETCC1 | 0x3800e1 | 0xfe00f1 | Any, coin counter 1 sinks current | ||
REG_SETCC2 | 0x3800e3 | 0xfe00f1 | Any, coin counter 2 sinks current | ||
REG_SETCL1 | 0x3800e5 | 0xfe00f1 | Any, coin lockout 1 sinks current | ||
REG_SETCL2 | 0x3800e7 | 0xfe00f1 | Any, coin lockout 2 sinks current |
System registers
Name | Address | Mask | Write |
---|---|---|---|
REG_NOSHADOW | 0x3a0001 | 0xfe0001 | Normal video output |
REG_SHADOW | 0x3a0011 | 0xfe0001 | Darken video output |
REG_SWPBIOS | 0x3a0003 | 0xfe0001 | BIOS vector table |
REG_SWPROM | 0x3a0013 | 0xfe0001 | Use the cart's vector table |
REG_CRDUNLOCK1 | 0x3a0005 | 0xfe0001 | Enable writes to memory card (unused in CD systems) |
REG_CRDLOCK1 | 0x3a0015 | 0xfe0001 | Disable writes to memory card (unused in CD systems) |
REG_CRDLOCK2 | 0x3a0007 | 0xfe0001 | Disable writes to memory card (unused in CD systems) |
REG_CRDUNLOCK2 | 0x3a0017 | 0xfe0001 | Enable writes to memory card (unused in CD systems) |
REG_CRDREGSEL | 0x3a0009 | 0xfe0001 | Enable "Register select" for memory card |
REG_CRDNORMAL | 0x3a0019 | 0xfe0001 | Disable "Register select" for memory card |
REG_BRDFIX | 0x3a000b | 0xfe0001 | Use the embedded SFIX ROM and SM1 ROM |
REG_CRTFIX | 0x3a001b | 0xfe0001 | Use the cart's S ROM and M1 ROM |
REG_SRAMLOCK | 0x3a000d | 0xfe0001 | Write-protects backup RAM (MVS) |
REG_SRAMUNLOCK | 0x3a001d | 0xfe0001 | Unprotects backup RAM (MVS) |
REG_PALBANK1 | 0x3a000f | 0xfe0001 | Use palette bank 1 |
REG_PALBANK0 | 0x3a001f | 0xfe0001 | Use palette bank 0 |
Video registers
Name | Address | Mask | Read | Write |
---|---|---|---|---|
REG_VRAMADDR | 0x3c0000 | 0xfe0001 | Read from VRAM (address doesn't change) | Sets VRAM address |
REG_VRAMRW | 0x3c0002 | 0xfe0001 | Read from VRAM (address doesn't change) | Write to VRAM (modulo is applied after) |
REG_VRAMMOD | 0x3c0004 | 0xfe0001 | Reads VRAM address modulo | Sets VRAM address modulo |
REG_LSPCMODE | 0x3c0006 | 0xfe0001 |
b15~b7: Raster line counter b6~b4: 0 b3: [1]50Hz, [0]60Hz (LSPC2 only) b2~b0: Auto animation counter |
b15~b8: Auto animation speed (in frames) b7~b5: Timer interrupt mode b4: Timer interrupt enable b3: Disable auto animation b2~b0: Unused |
REG_TIMERHIGH | 0x3c0008 | 0xfe0001 | Like REG_VRAMADDR. | 16 highest bits of the timer reload value. |
REG_TIMERLOW | 0x3c000a | 0xfe0001 | Like REG_VRAMRW. | 16 lowest bits of the timer reload value. |
REG_IRQACK | 0x3c000c | 0xfe0001 | Like REG_VRAMMOD. |
Interrupt acknowledge b7~b3: Unused b2: Ack VBlank b1: Ack HBlank b0: Ack IRQ3 |
REG_TIMERSTOP | 0x3c000e | 0xfe0001 | Like REG_LSPCMODE. | b0: [1]Stops timer counter during first and last 16 lines (32 total) when in PAL mode. |