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.
(I wonder if some of those extra power/ground pins can actually configure whether certain ports are inputs or outputs? but it would be very difficult to test this)
1 VCC
2 GND
3 VCC
4 ??? VCC (through JP1)
5 GND
6 bit 0 port $04
(output)
7 bit 1
8 bit 2
9 bit 3
10 GND
11 bit 0 port $02
12 bit 1
13 bit 2
14 bit 3
15 GND
16 bit 4 port $02
17 bit 5
18 bit 6
19 bit 7
20 bit 0 port $07
(input + dials)
21 bit 1
22 bit 2
23 bit 3
24 bit 4
25 bit 5
26 bit 6
27 bit 7
28 GND
29 bit 0 port $03 (i/o)
30 VCC
31 GND
32 bit 1 port $03
(i/o)
33 bit 2
34 bit 3
35 GND
36 bit 4 port $03
(i/o)
37 bit 5
38 bit 6
39 bit 7
40 GND
41 bit 0 port $12
42 bit 1
43 bit 2
44 bit 3
45 bit 4
46 bit 5
47 bit 6
48 bit 7
49 bit 0 port $17
(input + dials)
50 bit 1
51 bit 2
52 bit 3
53 bit 4
54 bit 5
55 bit 6
56 bit 7
57 GND
58 bit 0 port $13
(i/o)
59 bit 1
60 GND
61 VCC
62 bit 2 port $13
(i/o)
63 bit 3
64 bit 4
65 bit 5
66 bit 6
67 bit 7
68 GND
69 bit 0 port $14
(output)
70 bit 1
71 bit 2
72 bit 3
73 GND
74 bit 7 port $01
75 GND
76 bit 6 port $01
77 bit 5
78 bit 4
79 bit 3
80 bit 2
81 bit 1
82 bit 0
83 bit 7 port $00
84 bit 6
85 bit 5
86 bit 4
87 bit 3
88 bit 2
89 bit 1
90 VCC
91 GND
92 bit 0 port $00
93 GND
94 cpu reset
95 cpu halt
96 GND
97 D0 cpu data
98 D1
99 D2
100 D3
101 GND
102 D4 cpu data
103 D5
104 D6
105 D7
106 GND
107 clock input (1 MHz)
108 GND
109 A4 cpu address
110 A3
111 A2
112 A1
113 A0
114 GND
115 116 read/ 117 118 chip select ? (FCM.106)
119 GND
120 GND