Pin 1 : D0 Pin 2 : D1 Pin 3 : D2 Pin 4 : D3 Pin 5 : +5V Pin 6 : TL Pin 7 : TH Pin 8 : Ground Pin 9 : TR
; Does nothing, byte writes to even addresses are ignored move.b #$40, $A10002 ; Returns contents of version register, reading even addresses is the same as reading odd ones move.b $A10000, d0 ; Same as writing #$40 to $A10007, the MSB is ignored move.w #$C040, $A10006
Address | Description |
$A10001 | Version |
$A10003 | Port A data |
$A10005 | Port B data |
$A10007 | Port C data |
$A10009 | Port A control |
$A1000B | Port B control |
$A1000D | Port C control |
$A1000F | Port A TxData |
$A10011 | Port A RxData |
$A10013 | Port A serial control |
$A10015 | Port B TxData |
$A10017 | Port B RxData |
$A10019 | Port B serial control |
$A1001B | Port C TxData |
$A1001D | Port C RxData |
$A1001F | Port C serial control |
D7 : Console is 1= Export (USA, Europe, etc.) 0= Domestic (Japan) D6 : Video type is 1= PAL, 0= NTSC D5 : Sega CD unit is 1= not present, 0= connected. D4 : Unused (always returns zero) D3 : Bit 3 of version number D2 : Bit 2 of version number D1 : Bit 1 of version number D0 : Bit 0 of version numberBit 5 is used by the Sega CD, returning '0' when it is attached and '1' when it is not.
Bit 7 | Bit 6 | TV type | Region | Comments |
0 | 0 | NTSC | Japan, Korea, Taiwan | 262 lines, 60 FPS |
0 | 1 | PAL | Japan | No hardware actually uses this setting |
1 | 0 | NTSC | USA, Canada | 262 lines, 60 FPS |
1 | 0 | PAL-M | Brazil | 262 lines, 60 FPS |
1 | 1 | PAL | Europe, Hong Kong | 313 lines, 50 FPS |
$A10001 | Main Sales Territories | Hardware Enable Code (numbers from 0 to F below) | |||||||||||||||||
Bit 7 | Bit 6 | Hardware Type | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
0 | 0 | Japan, NTSC | Japan, S. Korea, Taiwan | X | O | X | O | X | O | X | O | X | O | X | O | X | O | X | O |
0 | 1 | Japan, PAL | X | X | O | O | X | X | O | O | X | X | O | O | X | X | O | O | |
1 | 0 | Overseas, NTSC | N. America, Brazil | X | X | X | X | O | O | O | O | X | X | X | X | O | O | O | O |
1 | 1 | Overseas, PAL | Europe, Hong Kong | X | X | X | X | X | X | X | X | O | O | O | O | O | O | O | O |
D7 : Unused. This bit will return any value written to it D6 : TH pin D5 : TR pin D4 : TL pin D3 : D3 pin D2 : D2 pin D1 : D1 pin D0 : D0 pinIf a pin is configured as an input, reading it returns the true logic state of whatever the pin is connected to (e.g. 0 for ground, 1 for +5V). If nothing is connected to it, the pin returns '1', maybe due to internal pull-up resistors.
The control register determines which pins are inputs and outputs.
D7 : /HL output control (see description) D6 : TH pin is 1=output, 0=input D5 : TR pin is 1=output, 0=input D4 : TL pin is 1=output, 0=input D3 : D3 pin is 1=output, 0=input D2 : D2 pin is 1=output, 0=input D1 : D1 pin is 1=output, 0=input D0 : D0 pin is 1=output, 0=inputIf bit 7 of this register is set, and TH is configured as an input, then whenever external hardware makes high to low transition on TH the I/O chip will strobe it's /HL output pin low. This pin connects to the VDP, which can be set up to latch the HV counter and/or cause a level 2 interrupt upon /HL going low.
D7 : Serial baud rate bit 1 D6 : Serial baud rate bit 0 D5 : TR pin functions as 1= serial input pin, 0= normal D4 : TL pin functions as 1= serial output pin, 0= normal D3 : 1= Make I/O chip strobe /HL low when a byte has been received, 0= Do nothing D2 : 1= Error receiving current byte, 0= No error D1 : 1= Rxd buffer is ready to read, 0= Rxd buffer isn't ready D0 : 1= Txd buffer is full, 0= Can write to Txd bufferThe available baud rates are:
D7 | D6 | Baud rate |
0 | 0 | 4800 bps |
0 | 1 | 2400 bps |
1 | 0 | 1200 bps |
1 | 1 | 300 bps |
D6 : (TH) Not used D5 : (TR) Button 2 D4 : (TL) Button 1 D3 : (D3) D-pad Right D2 : (D2) D-pad Left D1 : (D1) D-pad Down D0 : (D0) D-pad UpAll buttons are active-low logic, so they return '0' when pressed and '1' when released.
When TH=0 When TH=1 D6 : (TH) 0 1 D5 : (TR) Start button Button C D4 : (TL) Button A Button B D3 : (D3) 0 D-pad Right D2 : (D2) 0 D-pad Left D1 : (D1) D-pad Down D-pad Down D0 : (D0) D-pad Up D-pad UpAll buttons are active-low logic, so they return '0' when pressed and '1' when released.
; Returns D0 with the button states: 'SACBRLDU' _read_joypad: move.l d1, -(a7) move.b #$40, $A10003 nop nop move.b $A10003, d0 andi.b #$3F, d0 move.b #$00, $A10003 nop nop move.b $A10003, d1 lsl.b #2, d1 andi.b #$C0, d1 or.b d1, d0 eori.b #$FF, d0 move.l (a7)+, d1 rts |
; Returns D0 == 0 if the multitap is present, or D0 != 0 if it isn't _detect_4wayplay: move.b #$40, $A10009 nop move.b #$7F, $A1000B nop move.b #$7C, $A10005 nop moveq #0, d0 move.b $A10003, d0 andi.b #$03, d0 rts ; Returns the state of all four 3-button gamepads in D0 _read_4wayplay: move.l d1-d3/a0, -(a7) lea $A10000, a0 move.l #$0C1C2C3C, d2 moveq #$03, d3 poll: move.b d2, $05(a0) nop nop move.b #$40, $03(a0) nop nop move.b $A10003, d0 andi.b #$3F, d0 move.b #$00, $03(a0) nop nop move.b $03(a0), d1 lsl.b #2, d1 andi.b #$C0, d1 or.b d1, d0 lsl.l #8, d0 lsr.l #8, d2 dbra d3, poll eori.l #-1, d0 move.l (a7)+, d2-d3/a0 rts |
EXTRA - All four ports are enabled. This is the setting used by EA 4-Way Play compatible games. A - Routes the peripheral in port A to port A of the Genesis. B - Routes the peripheral in port B to port A of the Genesis. C - Routes the peripheral in port C to port A of the Genesis. D - Routes the peripheral in port D to port A of the Genesis. MULTI - All four ports are enabled. This is the setting used by Team Player compatible games.Sega made two versions of the Team Player. The first one was not compatible with the EA 4-Way Play and only had one cable to connect it to port A. The second one added the "EXTRA" setting for EA 4-Way Play compatibility and provides a second cable to connect it to port B as well. Both seem to function identically with the exception of EXTRA mode.
Write | TH | TR | TL | D3 | D2 | D1 | D0 | Description |
$60 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | Request data |
$20 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | ID #0 ($0) |
$00 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | ID #1 ($B) |
$20 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | ID #2 ($F) |
$00 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | ID #3 ($F) |
$20 | 0 | 1 | 0 | Y Over | X Over | Y Sign | X Sign | Axis sign and overflow |
$00 | 0 | 0 | 1 | Start | Middle | Right | Left | Button state |
$20 | 0 | 1 | 0 | X7 | X6 | X5 | X4 | X axis MSN |
$00 | 0 | 0 | 1 | X3 | X2 | X1 | X0 | X axis LSN |
$20 | 0 | 1 | 0 | Y7 | Y6 | Y5 | Y4 | Y axis MSN |
$00 | 0 | 0 | 1 | Y3 | Y2 | Y1 | Y0 | Y axis LSN |
After power-up, the default state of the I/O chip are as follows:
$A10001 = $80 (Bits 7,6,5 depend on the domestic/export, PAL/NTSC jumpers and having a Sega CD or not) $A10003 = $7F $A10005 = $7F $A10007 = $7F $A10009 = $00 $A1000B = $00 $A1000D = $00 $A1000F = $FF $A10011 = $00 $A10013 = $00 $A10015 = $FF $A10017 = $00 $A10019 = $00 $A1001B = $FB $A1001D = $00 $A1001F = $00
If you use any information from this document, please credit me (Charles MacDonald) and optionally provide a link to my webpage (http://cgfm2.emuviews.com/) so interested parties can access it. The credit text should be present in the accompanying documentation of whatever project which used the information, or even in the program itself (e.g. an about box) Regarding distribution, you cannot put this document on another website, nor link directly to it.