TC0640 FIO(labels are based on F3 usage because that's what we've tested)
| input bit fio pin
|
| output bit fio pin
|
| input or output bit fio pin
|
| bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 | |
|---|---|---|---|---|---|---|---|---|
| $00 | cartridge pin B4? pin 83?
| cartridge pin B3? pin 84?
| cartridge pin B2? pin 85?
| cartridge pin B1? pin 86?
| test (jamma) pin 87
| 1p button 5* pin 88?
| 2p button 4 pin 89
| 1p button 4 pin 92
|
| $01 | coin 4 pin 74
| coin 3 pin 76
| coin 2 pin 77
| coin 1 pin 78
| (unused) pin 79?
| cartridge pin B5? pin 80?
| test (board) pin 81
| eeprom DO pin 82
|
| $02 | 4p start pin 19
| 3p start pin 18
| 2p start pin 17
| 1p start pin 16
| service (4p) pin 14
| service (3p) pin 13
| service (jamma) pin 12
| tilt pin 11
|
| $03 | (unused) pin 39?
| 2p button 3 pin 38
| 2p button 2 pin 37
| 2p button 1 pin 36
| (unused) pin 34?
| 1p button 3 pin 33
| 1p button 2 pin 32
| 1p button 1 pin 29
|
| $04 | ? | coin 2 counter pin 9
| coin 1 counter pin 8
| coin 2 lockout pin 7
| coin 1 lockout pin 6
| |||
| $05 | ? | |||||||
| $06 | port $03 direction controls (0=input, 1=output) | |||||||
| $07 | 2p stick right pin 27
| 2p stick left pin 26
| 2p stick down pin 25
| 2p stick up pin 24
| 1p stick right pin 23
| 1p stick left pin 22
| 1p stick down pin 21
| 1p stick up pin 20
|
| $08 | 1p up/down dial counter | |||||||
| $09 | ||||||||
| $0A | 1p left/right dial counter | |||||||
| $0B | ||||||||
| $0C | 2p up/down dial counter | |||||||
| $0D | ||||||||
| $0E | 2p left/right dial counter | |||||||
| $0F | ||||||||
| $10 | ? | |||||||
| $11 | ? | |||||||
| $12 | (unused) pin 48?
| 4p button 3 pin 47
| 4p button 2 pin 46
| 4p button 1 pin 45
| (unused) pin 44?
| 3p button 3 pin 43
| 3p button 2 pin 42
| 3p button 1 pin 41
|
| $13 | (unused) pin 67?
| (unused) pin 66?
| (unused) pin 65?
| eeprom CS pin 64
| eeprom CLK pin 63
| eeprom DI pin 62
| Z pin 4 pin 59
| Z pin 3 pin 58
|
| $14 | ? | coin 4 counter pin 72
| coin 3 counter pin 71
| coin 4 lockout pin 70
| coin 3 lockout pin 69
| |||
| $15 | ? | |||||||
| $16 | port $13 direction controls (0=input, 1=output) | |||||||
| $17 | 4p stick right pin 56
| 4p stick left pin 55
| 4p stick down pin 54
| 4p stick up pin 53
| 3p stick right pin 52
| 3p stick left pin 51
| 3p stick down pin 50
| 3p stick up pin 49
|
| $18 | 3p up/down dial counter | |||||||
| $19 | ||||||||
| $1A | 3p left/right dial counter | |||||||
| $1B | ||||||||
| $1C | 4p up/down dial counter | |||||||
| $1D | ||||||||
| $1E | 4p left/right dial counter | |||||||
| $1F | ||||||||
Each joystick axis (8 total, 2 per player) can also be used as input for a rotary encoder (by connecting it to the up/down or left/right joystick input pins).
The fio has a 16-bit (little endian) counter for each axis, which increments/decrements by 1 on each step (i.e. a full cycle (00 01 11 10) would increment/decrement the counter by 4)
(Note: both input modes are always enabled; the game chooses whether to read the joystick bits or the dial counter registers. The F3 has a jumper switch for "joystick/sensor" mode, but this just configures pull-up/down resistors on some input lines)
afaik, F3 games have only used two dials (connected to the 1p and 2p left/right axes), but i've tested all 8 and they are real.
todo: which address do you have to write to? MAME just checks for any writes to the first 4 bytes, but this is probably wrong.
| 1 | VCC | ||
|---|---|---|---|
| 2 | i | ? GND | |
| 3 | i | ? VCC | |
| 4 | i | ? VCC (through JP1) | |
| 5 | GND | ||
| 6 | o | bit 0 | Port $04 (output) |
| 7 | o | bit 1 | |
| 8 | o | bit 2 | |
| 9 | o | bit 3 | |
| 10 | GND | ||
| 11 | i | bit 0 | Port $02 (input) |
| 12 | i | bit 1 | |
| 13 | i | bit 2 | |
| 14 | i | bit 3 | |
| 15 | GND | ||
| 16 | i | bit 4 | |
| 17 | i | bit 5 | |
| 18 | i | bit 6 | |
| 19 | i | bit 7 | |
| 20 | i | bit 0 | Port $07 (input + dials) |
| 21 | i | bit 1 | |
| 22 | i | bit 2 | |
| 23 | i | bit 3 | |
| 24 | i | bit 4 | |
| 25 | i | bit 5 | |
| 26 | i | bit 6 | |
| 27 | i | bit 7 | |
| 28 | GND | ||
| 29 | io | bit 0 | Port $03 (i/o) |
| 30 | VCC |
| 31 | GND | ||
|---|---|---|---|
| 32 | io | bit 1 | Port $03 (i/o) |
| 33 | io | bit 2 | |
| 34 | io | bit 3 | |
| 35 | GND | ||
| 36 | io | bit 4 | |
| 37 | io | bit 5 | |
| 38 | io | bit 6 | |
| 39 | io | bit 7 | |
| 40 | GND | ||
| 41 | i | bit 0 | Port $12 (input) |
| 42 | i | bit 1 | |
| 43 | i | bit 2 | |
| 44 | i | bit 3 | |
| 45 | i | bit 4 | |
| 46 | i | bit 5 | |
| 47 | i | bit 6 | |
| 48 | i | bit 7 | |
| 49 | i | bit 0 | Port $17 (input + dials) |
| 50 | i | bit 1 | |
| 51 | i | bit 2 | |
| 52 | i | bit 3 | |
| 53 | i | bit 4 | |
| 54 | i | bit 5 | |
| 55 | i | bit 6 | |
| 56 | i | bit 7 | |
| 57 | GND | ||
| 58 | io | bit 0 | Port $13 (i/o) |
| 59 | io | bit 1 | |
| 60 | GND |
| 61 | VCC | ||
|---|---|---|---|
| 62 | io | bit 2 | Port $13 (i/o) |
| 63 | io | bit 3 | |
| 64 | io | bit 4 | |
| 65 | io | bit 5 | |
| 66 | io | bit 6 | |
| 67 | io | bit 7 | |
| 68 | GND | ||
| 69 | o | bit 0 | Port $14 (output) |
| 70 | o | bit 1 | |
| 71 | o | bit 2 | |
| 72 | o | bit 3 | |
| 73 | GND | ||
| 74 | i | bit 7 | Port $01 (input) |
| 75 | GND | ||
| 76 | i | bit 6 | |
| 77 | i | bit 5 | |
| 78 | i | bit 4 | |
| 79 | i | bit 3 | |
| 80 | i | bit 2 | |
| 81 | i | bit 1 | |
| 82 | i | bit 0 | |
| 83 | i | bit 7 | Port $00 (input) |
| 84 | i | bit 6 | |
| 85 | i | bit 5 | |
| 86 | i | bit 4 | |
| 87 | i | bit 3 | |
| 88 | i | bit 2 | |
| 89 | i | bit 1 | |
| 90 | VCC |
| 91 | GND | ||
|---|---|---|---|
| 92 | i | bit 0 | Port $00 (input) |
| 93 | GND? | ||
| 94 | o | Watchdog Output | |
| 95 | o | ||
| 96 | GND | ||
| 97 | io | D24 | Cpu Data (8-bit) |
| 98 | io | D25 | |
| 99 | io | D26 | |
| 100 | io | D27 | |
| 101 | GND | ||
| 102 | io | D28 | |
| 103 | io | D29 | |
| 104 | io | D30 | |
| 105 | io | D31 | |
| 106 | GND | ||
| 107 | i | clock input (1 MHz) | |
| 108 | GND | ||
| 109 | i | A4 | Cpu Address |
| 110 | i | A3 | |
| 111 | i | A2 | |
| 112 | i | A1 | |
| 113 | i | A0 | |
| 114 | GND | ||
| 115 | i | ||
| 116 | i | R/ | |
| 117 | i | ||
| 118 | i | chip select ? (FCM.106) | |
| 119 | VCC | ||
| 120 | GND | ||
Pins 2-4 are data inputs connected to vcc/gnd. (they probably control some settings which are hardwired on the F3).
Note that pins 94 and 115 connect to separate nets on the F3 (115 connects to the power supply monitor's reset output, and 94 connects to the reset inputs on most other chips)