src/mess/drivers/fidelz80.c
| r0 | r7181 | |
| 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Fidelity Electronics Z80 based board driver |
| 4 | * By Kevin 'kevtris' Horton and Jonathan Gevaryahu AKA Lord Nightmare |
| 5 | * |
| 6 | * All detailed RE work done by Kevin 'kevtris' Horton |
| 7 | * |
| 8 | * TODO: |
| 9 | * * Inputs: 4x4 keypad matrix |
| 10 | * * LED displays (four 7seg, two leds, currently is using terminal as a hack so it doesn't crash due to the screenless system bug) |
| 11 | The four arrays are populated with the proper data, all thats needed is a callback to draw said data to screen or to artwork |
| 12 | * * Figure out why it says the first speech line twice; it shouldn't. |
| 13 | * * Get rom locations from pcb |
| 14 | * * Add sensory chess challenger to driver, similar hardware. |
| 15 | * |
| 16 | *********************************************************************** |
| 17 | |
| 18 | Voice Chess Challenger |
| 19 | ---------------------- |
| 20 | |
| 21 | The CPU is a Z80 running at 4MHz. The TSI chip runs at around 25KHz, using a |
| 22 | 470K / 100pf RC network. This system is very very basic, and is composed of just |
| 23 | the Z80, 4 ROMs, the TSI chip, and an 8255. |
| 24 | |
| 25 | |
| 26 | The Z80's interrupt inputs are all pulled to VCC, so no interrupts are used. |
| 27 | |
| 28 | Reset is connected to a power-on reset circuit and a button on the keypad (marked RE). |
| 29 | |
| 30 | The TSI chip connects to a 4K ROM marked VCC-ENGL. All of the Voice Chess Challengers |
| 31 | use this same ROM (three). The later chess boards use a slightly different part |
| 32 | number, but the contents are identical. |
| 33 | |
| 34 | Memory map: |
| 35 | ----------- |
| 36 | 0000-0FFF: 4K ROM 101-32103 |
| 37 | 1000-1FFF: 4K ROM VCC2 |
| 38 | 2000-3FFF: 4K ROM VCC3 [LN edit: should be 2000-2FFF] |
| 39 | 4000-5FFF: 1K RAM (2114 * 2) |
| 40 | 6000-FFFF: empty |
| 41 | |
| 42 | I/O map: |
| 43 | -------- |
| 44 | 00-FF: 8255 port chip [LN edit: 00-03, mirrored over the 00-FF range; program accesses F4-F7] |
| 45 | |
| 46 | |
| 47 | 8255 connections: |
| 48 | ----------------- |
| 49 | |
| 50 | PA.0 - segment G, TSI A0 |
| 51 | PA.1 - segment F, TSI A1 |
| 52 | PA.2 - segment E, TSI A2 |
| 53 | PA.3 - segment D, TSI A3 |
| 54 | PA.4 - segment C, TSI A4 |
| 55 | PA.5 - segment B, TSI A5 |
| 56 | PA.6 - segment A, language latch Data |
| 57 | PA.7 - TSI START line, language latch clock (see below) |
| 58 | |
| 59 | PB.0 - dot commons |
| 60 | PB.1 - NC |
| 61 | PB.2 - digit 0, bottom dot |
| 62 | PB.3 - digit 1, top dot |
| 63 | PB.4 - digit 2 |
| 64 | PB.5 - digit 3 |
| 65 | PB.6 - enable language switches (see below) |
| 66 | PB.7 - TSI DONE line |
| 67 | |
| 68 | (button rows pulled up to 5V thru 2.2K resistors) |
| 69 | PC.0 - button row 0, german language jumper |
| 70 | PC.1 - button row 1, french language jumper |
| 71 | PC.2 - button row 2, spanish language jumper |
| 72 | PC.3 - button row 3, special language jumper |
| 73 | PC.4 - button column A |
| 74 | PC.5 - button column B |
| 75 | PC.6 - button column C |
| 76 | PC.7 - button column D |
| 77 | |
| 78 | |
| 79 | language switches: |
| 80 | ------------------ |
| 81 | |
| 82 | When PB.6 is pulled low, the language switches can be read. There are four. |
| 83 | They connect to the button rows. When enabled, the row(s) will read low if |
| 84 | the jumper is present. English only VCC's do not have the 367 or any pads stuffed. |
| 85 | The jumpers are labelled: french, german, spanish, and special. |
| 86 | |
| 87 | |
| 88 | language latch: |
| 89 | --------------- |
| 90 | |
| 91 | There's an unstuffed 7474 on the board that connects to PA.6 and PA.7. It allows |
| 92 | one to latch the state of A12 to the speech ROM. The english version has the chip |
| 93 | missing, and a jumper pulling "A12" to ground. This line is really a negative |
| 94 | enable. |
| 95 | |
| 96 | To make the VCC multi-language, one would install the 74367 (note: it must be a 74367 |
| 97 | or possibly a 74LS367. A 74HC367 would not work since they rely on the input current |
| 98 | to keep the inputs pulled up), solder a piggybacked ROM to the existing english |
| 99 | speech ROM, and finally install a 7474 dual flipflop. |
| 100 | |
| 101 | This way, the game can then detect which secondary language is present, and then it can |
| 102 | automatically select the correct ROM(s). I have to test wether it will do automatic |
| 103 | determination and give you a language option on power up or something. |
| 104 | |
| 105 | *********************************************************************** |
| 106 | |
| 107 | Sensory Chess Challenger |
| 108 | add me |
| 109 | |
| 110 | ******************************************************************************/ |
| 111 | |
| 112 | /* Core includes */ |
| 113 | #include "emu.h" |
| 114 | #include "cpu/z80/z80.h" |
| 115 | #include "machine/i8255a.h" |
| 116 | #include "sound/s14001a.h" |
| 117 | //#include "dectalk.lh" // hack to avoid screenless system crash |
| 118 | #include "machine/terminal.h" |
| 119 | |
| 120 | /* Defines */ |
| 121 | |
| 122 | /* Components */ |
| 123 | |
| 124 | static struct |
| 125 | { |
| 126 | UINT8 data[8]; // what is this for? to suppress the scalar initializer warning? |
| 127 | UINT8 led_7seg_data[4]; // data for the 4x 7seg leds, bits are 0bxABCDEFG |
| 128 | UINT8 led_data; // data for the two individual leds, in 0bxxxx12xx format |
| 129 | UINT8 led_selected; // 5 bit selects for 7 seg leds and for common other leds, bits are (7seg leds are 0 1 2 3, common other leds are C) 0bxx3210xc |
| 130 | UINT8 columnlatch; |
| 131 | } fidelz80={ {0}}; |
| 132 | |
| 133 | /* Devices */ |
| 134 | |
| 135 | /* I8255 Device */ |
| 136 | |
| 137 | /*static READ8_DEVICE_HANDLER( vcc_porta_r ) |
| 138 | { |
| 139 | return 0; |
| 140 | };*/ |
| 141 | |
| 142 | static READ8_DEVICE_HANDLER( vcc_portb_r ) |
| 143 | { |
| 144 | device = devtag_get_device(device->machine, "speech"); |
| 145 | if (s14001a_bsy_r(device) == 0) |
| 146 | return 0; |
| 147 | else |
| 148 | return 0xFF; |
| 149 | }; |
| 150 | |
| 151 | static READ8_DEVICE_HANDLER( vcc_portc_r ) |
| 152 | { |
| 153 | return 0xFF; // TODO: emulate button input |
| 154 | }; |
| 155 | |
| 156 | static WRITE8_DEVICE_HANDLER( vcc_porta_w ) |
| 157 | { |
| 158 | device = devtag_get_device(device->machine, "speech"); |
| 159 | s14001a_set_volume(device, 15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 160 | s14001a_reg_w(device, data & 0x3f); |
| 161 | s14001a_rst_w(device, (data & 0x80)>>7); |
| 162 | /* handle digits below */ |
| 163 | if (fidelz80.led_selected & 0x4) |
| 164 | fidelz80.led_7seg_data[0] = data&0x7F; |
| 165 | if (fidelz80.led_selected & 0x8) |
| 166 | fidelz80.led_7seg_data[1] = data&0x7F; |
| 167 | if (fidelz80.led_selected & 0x10) |
| 168 | fidelz80.led_7seg_data[2] = data&0x7F; |
| 169 | if (fidelz80.led_selected & 0x20) |
| 170 | fidelz80.led_7seg_data[3] = data&0x7F; |
| 171 | }; |
| 172 | |
| 173 | static WRITE8_DEVICE_HANDLER( vcc_portb_w ) |
| 174 | { |
| 175 | if (data&0x1) // common for two leds |
| 176 | { |
| 177 | fidelz80.led_data = (data&0xc); |
| 178 | } |
| 179 | fidelz80.led_selected = (data&0x3d); |
| 180 | // ignoring the language switch enable for now, is bit 0x40 |
| 181 | }; |
| 182 | |
| 183 | static WRITE8_DEVICE_HANDLER( vcc_portc_w ) |
| 184 | { |
| 185 | fidelz80.columnlatch = (data&0x80); |
| 186 | }; |
| 187 | |
| 188 | static I8255A_INTERFACE( vcc_ppi8255_intf ) |
| 189 | { |
| 190 | DEVCB_NULL, // only bit 6 is readable (and only sometimes) and I'm not emulating the language latch unless needed |
| 191 | DEVCB_HANDLER(vcc_portb_r), // bit 7 is readable and is the done line from the s14001a |
| 192 | DEVCB_HANDLER(vcc_portc_r), // bits 0,1,2,3 are readable, have to do with input |
| 193 | DEVCB_HANDLER(vcc_porta_w), // display segments and s14001a lines |
| 194 | DEVCB_HANDLER(vcc_portb_w), // display digits and led dots |
| 195 | DEVCB_HANDLER(vcc_portc_w), // bits 4,5,6,7 are writable, have to do with input |
| 196 | }; |
| 197 | |
| 198 | static MACHINE_RESET( fidelz80 ) |
| 199 | { |
| 200 | // data for the 4x 7seg leds, bits are 0bxABCDEFG |
| 201 | fidelz80.led_7seg_data[0] = 0; |
| 202 | fidelz80.led_7seg_data[1] = 0; |
| 203 | fidelz80.led_7seg_data[2] = 0; |
| 204 | fidelz80.led_7seg_data[3] = 0; |
| 205 | fidelz80.led_data = 0; |
| 206 | fidelz80.led_selected = 0; |
| 207 | fidelz80.columnlatch = 0; |
| 208 | } |
| 209 | |
| 210 | |
| 211 | |
| 212 | /****************************************************************************** |
| 213 | Address Maps |
| 214 | ******************************************************************************/ |
| 215 | |
| 216 | static ADDRESS_MAP_START(vcc_z80_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 217 | ADDRESS_MAP_UNMAP_HIGH |
| 218 | AM_RANGE(0x0000, 0x0fff) AM_ROM // 4k rom |
| 219 | AM_RANGE(0x1000, 0x1fff) AM_ROM // 4k rom |
| 220 | AM_RANGE(0x2000, 0x2fff) AM_ROM // 4k rom |
| 221 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_MIRROR(0x1c00) // 1k ram (2114*2) mirrored 8 times |
| 222 | ADDRESS_MAP_END |
| 223 | |
| 224 | static ADDRESS_MAP_START(vcc_z80_io, ADDRESS_SPACE_IO, 8) |
| 225 | ADDRESS_MAP_UNMAP_HIGH |
| 226 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 227 | AM_RANGE(0x00, 0x03) AM_MIRROR(0xFC) AM_DEVREADWRITE("vcc_ppi8255", i8255a_r, i8255a_w) // 8255 i/o chip |
| 228 | ADDRESS_MAP_END |
| 229 | |
| 230 | |
| 231 | /****************************************************************************** |
| 232 | Input Ports |
| 233 | ******************************************************************************/ |
| 234 | INPUT_PORTS_START( fidelz80 ) |
| 235 | PORT_INCLUDE(generic_terminal) |
| 236 | INPUT_PORTS_END |
| 237 | |
| 238 | /****************************************************************************** |
| 239 | Machine Drivers |
| 240 | ******************************************************************************/ |
| 241 | |
| 242 | static WRITE8_DEVICE_HANDLER( null_kbd_put ) |
| 243 | { |
| 244 | } |
| 245 | |
| 246 | static GENERIC_TERMINAL_INTERFACE( dectalk_terminal_intf ) |
| 247 | { |
| 248 | DEVCB_HANDLER(null_kbd_put) |
| 249 | }; |
| 250 | |
| 251 | static MACHINE_DRIVER_START(vcc) |
| 252 | /* basic machine hardware */ |
| 253 | MDRV_CPU_ADD("maincpu", Z80, XTAL_4MHz) |
| 254 | MDRV_CPU_PROGRAM_MAP(vcc_z80_mem) |
| 255 | MDRV_CPU_IO_MAP(vcc_z80_io) |
| 256 | MDRV_QUANTUM_TIME(HZ(60)) |
| 257 | MDRV_MACHINE_RESET(fidelz80) |
| 258 | |
| 259 | /* video hardware */ |
| 260 | //MDRV_DEFAULT_LAYOUT(layout_dectalk) // hack to avoid screenless system crash |
| 261 | MDRV_IMPORT_FROM( generic_terminal ) |
| 262 | MDRV_GENERIC_TERMINAL_ADD(TERMINAL_TAG,dectalk_terminal_intf) |
| 263 | |
| 264 | /* other hardware */ |
| 265 | MDRV_I8255A_ADD("vcc_ppi8255", vcc_ppi8255_intf) |
| 266 | |
| 267 | /* sound hardware */ |
| 268 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 269 | MDRV_SOUND_ADD("speech", S14001A, 25000) // around 25khz |
| 270 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 271 | |
| 272 | MACHINE_DRIVER_END |
| 273 | |
| 274 | |
| 275 | |
| 276 | /****************************************************************************** |
| 277 | ROM Definitions |
| 278 | ******************************************************************************/ |
| 279 | |
| 280 | ROM_START(vcc) |
| 281 | |
| 282 | ROM_REGION(0x10000, "maincpu", 0) |
| 283 | ROM_LOAD("101-32103.bin", 0x0000, 0x1000, CRC(257BB5AB) SHA1(F7589225BB8E5F3EAC55F23E2BD526BE780B38B5)) // 32014.VCC??? |
| 284 | ROM_LOAD("vcc2.bin", 0x1000, 0x1000, CRC(F33095E7) SHA1(692FCAB1B88C910B74D04FE4D0660367AEE3F4F0)) |
| 285 | ROM_LOAD("vcc3.bin", 0x2000, 0x1000, CRC(624F0CD5) SHA1(7C1A4F4497FE5882904DE1D6FECF510C07EE6FC6)) |
| 286 | |
| 287 | ROM_REGION(0x2000, "speech", 0) |
| 288 | ROM_LOAD("vcc-engl.bin", 0x0000, 0x1000, CRC(F35784F9) SHA1(348E54A7FA1E8091F89AC656B4DA22F28CA2E44D)) |
| 289 | ROM_END |
| 290 | |
| 291 | |
| 292 | |
| 293 | /****************************************************************************** |
| 294 | Drivers |
| 295 | ******************************************************************************/ |
| 296 | |
| 297 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 298 | COMP( 1982, vcc, 0, 0, vcc, fidelz80, 0, "Fidelity Electronics", "Talking Chess Challenger (model VCC)", GAME_NOT_WORKING ) |
| 299 | |