Memory mapped registers

=Address decode masks=

Decode masks aren't verified !

Decode masks are used to know which register will be mapped to a given address, they can be seen as a sort of mirroring range notation.

A "1" bit means that the corresponding address bit is involved in decoding, a "0" means it's ignored.

For example, 's base is $300000 and its mask is $FE0001: BASE 00110000 00000000 00000000 MASK 11111110 00000000 00000001 0011000x xxxxxxxx xxxxxxx0

This means that it's also accessible at $300002, $300004, $300006... up to $31FFFE. The highest address is BASE OR (NOT MASK).

Mirror guesser
=Register descriptions=

REG_P1CNT

 * Address: $300000
 * Decode mask: $FE0001
 * Handled by:

REG_DIPSW

 * Address: $300001
 * Decode mask: $FE0081 (not sure for write)
 * Handled by: (read),  (write)

REG_SYSTYPE
Reads the unused DSW2 on boards. Used for system ID on other boards.


 * Address: $300081
 * Decode mask: $FE0081
 * Handled by:

REG_SOUND

 * Address: $320000
 * Decode mask: $FE0001
 * Handled by:

REG_STATUS_A

 * Address: $320001
 * Decode mask: $FE0001
 * Handled by:

REG_P2CNT

 * Address: $340000
 * Decode mask: $FE0001
 * Handled by:

REG_STATUS_B

 * Address: $380000
 * Decode mask: $FE0001
 * Handled by:

REG_POUTPUT

 * Address: $380001
 * Decode mask: $FE0071
 * Handled by:

REG_CRDBANK

 * Address: $380011
 * Decode mask: $FE0071
 * Handled by:

REG_SLOT

 * Address: $380021
 * Decode mask: $FE00F1
 * Handled by:

REG_LEDLATCHES

 * Address: $380031
 * Decode mask: $FE00F1
 * Handled by:

REG_LEDDATA

 * Address: $380041
 * Decode mask: $FE00F1
 * Handled by:

REG_RTCCTRL

 * Address: $380051
 * Decode mask: $FE00F1
 * Handled by:

REG_RESETCC1

 * Address: $380061
 * Decode mask: $FE00F1
 * Handled by:

REG_RESETCC2

 * Address: $380063
 * Decode mask: $FE00F1
 * Handled by:

REG_RESETCL1

 * Address: $380065
 * Decode mask: $FE00F1
 * Handled by:

REG_RESETCL2

 * Address: $380067
 * Decode mask: $FE00F1
 * Handled by:

REG_SETCC1

 * Address: $3800E1
 * Decode mask: $FE00F1
 * Handled by:

REG_SETCC2

 * Address: $3800E3
 * Decode mask: $FE00F1
 * Handled by:

REG_SETCL1

 * Address: $3800E5
 * Decode mask: $FE00F1
 * Handled by:

REG_SETCL2

 * Address: $3800E7
 * Decode mask: $FE00F1
 * Handled by:

System registers
Data written doesn't matter. Odd byte writes only. Decode mask: $FE0001.

Registers go in pairs, bit 4 of the address is actually the data bit.

Handled by a 74HC259 addressable latch on cart systems.

Video registers
Handled by the LSPC. Byte writes are only effective on even addresses and they store the same data in both bytes. Odd addresses aren't mapped ? Decode mask: $FE0001.

NeoGeo CD registers
NEO-MGA / LC8953 / LC98000 ?