Research / Megadrive Programming / I/O ports I/O Registers
Reading even addresses returns the same as odd ones so you can use both $A10000 and $A10001. $a10001 - version register Reading version register returns a byte: Bit 7 - Export bit. 1 if export (USA, Europe, etc.), 0 if domestic (Japan) Bit 6 - Video type. 1 if PAL, 0 if NTSC Bit 5 - 0 if Sega CD connected, 1 if not connected Bit 4 - Unused (always 0) Bits 3-0 - 0 - MegaDrive 1 / Genesis 1, 1 - newer. Newer have additional security hardware. $a10003-7 - data registers Reading a data register returns the state of all pins: Bit 7 - Unused Bit 6 - TH pin Bit 5 - TR pin Bit 4 - TL pin Bit 3 - Data 3 pin Bit 2 - Data 2 pin Bit 1 - Data 1 pin Bit 0 - Data 0 pin Reading joypads Here's the code: pads_read: After executing that code you will have: $FFFFF0 - Current pressed state of joypad 1 $FFFFF1 - Current holded state of joypad 1 $FFFFF2 - Current pressed state of joypad 2 $FFFFF3 - Current holded state of joypad 2 The joypad output format: Bit 7 - Start Bit 6 - A button Bit 5 - C button Bit 4 - B button Bit 3 - Right Bit 2 - Left Bit 1 - Down Bit 0 - Up Back | Printer friendly << 3. Genesis security | 5. VDP >> |