src/mess/drivers/fidelz80.c
| r9728 | r9729 | |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | * |
| 3 | 3 | * Fidelity Electronics Z80 based board driver |
| 4 | | * By Kevin 'kevtris' Horton and Jonathan Gevaryahu AKA Lord Nightmare |
| 4 | * By Kevin 'kevtris' Horton, Jonathan Gevaryahu AKA Lord Nightmare and Sandro Ronco |
| 5 | 5 | * |
| 6 | 6 | * All detailed RE work done by Kevin 'kevtris' Horton |
| 7 | 7 | * |
| r9728 | r9729 | |
| 115 | 115 | |
| 116 | 116 | ******************************************************************************/ |
| 117 | 117 | |
| 118 | #define ADDRESS_MAP_MODERN |
| 119 | |
| 118 | 120 | /* Core includes */ |
| 119 | 121 | #include "emu.h" |
| 120 | 122 | #include "cpu/z80/z80.h" |
| 123 | #include "cpu/mcs48/mcs48.h" |
| 121 | 124 | #include "machine/i8255a.h" |
| 125 | #include "machine/i8243.h" |
| 122 | 126 | #include "sound/beep.h" |
| 123 | 127 | #include "sound/s14001a.h" |
| 128 | #include "includes/fidelz80.h" |
| 124 | 129 | #include "fidelz80.lh" |
| 130 | #include "abc.lh" |
| 125 | 131 | |
| 126 | | //#include "debugger.h" |
| 132 | #include "debugger.h" |
| 127 | 133 | |
| 128 | | /* Defines */ |
| 129 | | |
| 130 | | class fidelz80_state : public driver_device |
| 131 | | { |
| 132 | | public: |
| 133 | | fidelz80_state(running_machine &machine, const driver_device_config_base &config) |
| 134 | | : driver_device(machine, config) { } |
| 135 | | |
| 136 | | UINT8 kp_matrix; // keypad matrix |
| 137 | | UINT8 led_7seg_data[4]; // data for the 4x 7seg leds, bits are 0bxABCDEFG |
| 138 | | UINT8 led_data; // data for the two individual leds, in 0bxxxx12xx format |
| 139 | | 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 |
| 140 | | UINT8 digit_data; // data for 7 seg leds |
| 141 | | |
| 142 | | device_t *beep; |
| 143 | | device_t *speech; |
| 144 | | }; |
| 145 | | |
| 146 | 134 | /* Devices */ |
| 147 | 135 | |
| 148 | 136 | /****************************************************************************** |
| 149 | 137 | I8255 Device |
| 150 | 138 | ******************************************************************************/ |
| 151 | 139 | |
| 152 | | static void update_display(running_machine *machine) |
| 140 | void fidelz80_state::update_display(running_machine *machine) |
| 153 | 141 | { |
| 154 | | fidelz80_state *state = machine->driver_data<fidelz80_state>(); |
| 155 | | UINT8 digit_data = BITSWAP8( state->digit_data,7,0,1,2,3,4,5,6 ) & 0x7f; |
| 142 | // data for the 4x 7seg leds, bits are 0bxABCDEFG |
| 143 | UINT8 out_digit = BITSWAP8( m_digit_data,7,0,1,2,3,4,5,6 ) & 0x7f; |
| 156 | 144 | |
| 157 | | if (state->led_selected&0x04) |
| 145 | if (m_led_selected&0x04) |
| 158 | 146 | { |
| 159 | | output_set_digit_value(0, digit_data); |
| 160 | | state->led_7seg_data[0] = digit_data; |
| 147 | output_set_digit_value(0, out_digit); |
| 161 | 148 | |
| 162 | | output_set_led_value(1, state->led_selected & 0x01); |
| 149 | output_set_led_value(1, m_led_selected & 0x01); |
| 163 | 150 | } |
| 164 | | if (state->led_selected&0x08) |
| 151 | if (m_led_selected&0x08) |
| 165 | 152 | { |
| 166 | | output_set_digit_value(1, digit_data); |
| 167 | | state->led_7seg_data[1] = digit_data; |
| 153 | output_set_digit_value(1, out_digit); |
| 168 | 154 | |
| 169 | | output_set_led_value(0, state->led_selected & 0x01); |
| 155 | output_set_led_value(0, m_led_selected & 0x01); |
| 170 | 156 | } |
| 171 | | if (state->led_selected&0x10) |
| 157 | if (m_led_selected&0x10) |
| 172 | 158 | { |
| 173 | | output_set_digit_value(2, digit_data); |
| 174 | | state->led_7seg_data[2] = digit_data; |
| 159 | output_set_digit_value(2, out_digit); |
| 175 | 160 | } |
| 176 | | if (state->led_selected&0x20) |
| 161 | if (m_led_selected&0x20) |
| 177 | 162 | { |
| 178 | | output_set_digit_value(3, digit_data); |
| 179 | | state->led_7seg_data[3] = digit_data; |
| 163 | output_set_digit_value(3, out_digit); |
| 180 | 164 | } |
| 181 | 165 | } |
| 182 | 166 | |
| 183 | | static READ8_DEVICE_HANDLER( fidelz80_portc_r ) |
| 167 | READ8_MEMBER( fidelz80_state::fidelz80_portc_r ) |
| 184 | 168 | { |
| 185 | | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 186 | | |
| 187 | 169 | UINT8 data = 0xff; |
| 188 | 170 | |
| 189 | | switch (state->kp_matrix & 0xf0) |
| 171 | switch (m_kp_matrix & 0xf0) |
| 190 | 172 | { |
| 191 | 173 | case 0xe0: |
| 192 | | data = input_port_read(device->machine, "LINE1"); |
| 174 | data = input_port_read(space.machine, "LINE1"); |
| 193 | 175 | break; |
| 194 | 176 | case 0xd0: |
| 195 | | data = input_port_read(device->machine, "LINE2"); |
| 177 | data = input_port_read(space.machine, "LINE2"); |
| 196 | 178 | break; |
| 197 | 179 | case 0xb0: |
| 198 | | data = input_port_read(device->machine, "LINE3"); |
| 180 | data = input_port_read(space.machine, "LINE3"); |
| 199 | 181 | break; |
| 200 | 182 | case 0x70: |
| 201 | | data = input_port_read(device->machine, "LINE4"); |
| 183 | data = input_port_read(space.machine, "LINE4"); |
| 202 | 184 | break; |
| 203 | 185 | } |
| 204 | 186 | |
| 205 | 187 | return data; |
| 206 | 188 | } |
| 207 | 189 | |
| 208 | | static WRITE8_DEVICE_HANDLER( fidelz80_portb_w ) |
| 190 | WRITE8_MEMBER( fidelz80_state::fidelz80_portb_w ) |
| 209 | 191 | { |
| 210 | | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 211 | | |
| 212 | 192 | if (!(data & 0x80)) |
| 213 | 193 | { |
| 214 | 194 | if (data&0x1) // common for two leds |
| 215 | | state->led_data = (data&0xc); |
| 195 | m_led_data = (data&0xc); |
| 216 | 196 | |
| 217 | | state->led_selected = data; |
| 197 | m_led_selected = data; |
| 218 | 198 | |
| 219 | | update_display(device->machine); |
| 199 | update_display(space.machine); |
| 220 | 200 | } |
| 221 | 201 | |
| 222 | 202 | // ignoring the language switch enable for now, is bit 0x40 |
| 223 | 203 | }; |
| 224 | 204 | |
| 225 | | static WRITE8_DEVICE_HANDLER( fidelz80_portc_w ) |
| 205 | WRITE8_MEMBER( fidelz80_state::fidelz80_portc_w ) |
| 226 | 206 | { |
| 227 | | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 228 | | |
| 229 | | state->kp_matrix = data; |
| 207 | m_kp_matrix = data; |
| 230 | 208 | }; |
| 231 | 209 | |
| 232 | | static READ8_DEVICE_HANDLER( cc10_portb_r ) |
| 210 | READ8_MEMBER( fidelz80_state::cc10_portb_r ) |
| 233 | 211 | { |
| 234 | 212 | /* |
| 235 | | x--- ---- level select |
| 236 | | -xxx xxxx ?? |
| 237 | | */ |
| 213 | x--- ---- level select |
| 214 | -xxx xxxx ?? |
| 215 | */ |
| 238 | 216 | |
| 239 | | return input_port_read(device->machine, "LEVEL"); |
| 217 | return input_port_read(space.machine, "LEVEL"); |
| 240 | 218 | } |
| 241 | 219 | |
| 242 | | static WRITE8_DEVICE_HANDLER( cc10_porta_w ) |
| 220 | WRITE8_MEMBER( fidelz80_state::cc10_porta_w ) |
| 243 | 221 | { |
| 244 | | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 222 | beep_set_state(m_beep, (data & 0x80) ? 0 : 1); |
| 245 | 223 | |
| 246 | | beep_set_state(state->beep, (data & 0x80) ? 0 : 1); |
| 224 | m_digit_data = data; |
| 247 | 225 | |
| 248 | | state->digit_data = data; |
| 249 | | |
| 250 | | update_display(device->machine); |
| 226 | update_display(space.machine); |
| 251 | 227 | } |
| 252 | 228 | |
| 253 | | static READ8_DEVICE_HANDLER( vcc_portb_r ) |
| 229 | READ8_MEMBER( fidelz80_state::vcc_portb_r ) |
| 254 | 230 | { |
| 255 | | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 256 | | |
| 257 | | if (s14001a_bsy_r(state->speech) != 0) |
| 231 | if (s14001a_bsy_r(m_speech) != 0) |
| 258 | 232 | return 0x80; |
| 259 | 233 | else |
| 260 | 234 | return 0x00; |
| 261 | 235 | } |
| 262 | 236 | |
| 263 | | static WRITE8_DEVICE_HANDLER( vcc_porta_w ) |
| 237 | WRITE8_MEMBER( fidelz80_state::vcc_porta_w ) |
| 264 | 238 | { |
| 265 | | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 239 | s14001a_set_volume(m_speech, 15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 240 | s14001a_reg_w(m_speech, data & 0x3f); |
| 241 | s14001a_rst_w(m_speech, (data & 0x80)>>7); |
| 266 | 242 | |
| 267 | | s14001a_set_volume(state->speech, 15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 268 | | s14001a_reg_w(state->speech, data & 0x3f); |
| 269 | | s14001a_rst_w(state->speech, (data & 0x80)>>7); |
| 270 | | |
| 271 | 243 | if (!(data & 0x80)) |
| 272 | 244 | { |
| 273 | | state->digit_data = data; |
| 245 | m_digit_data = data; |
| 274 | 246 | |
| 275 | | update_display(device->machine); |
| 247 | update_display(space.machine); |
| 276 | 248 | } |
| 277 | 249 | } |
| 278 | 250 | |
| 279 | 251 | static I8255A_INTERFACE( cc10_ppi8255_intf ) |
| 280 | 252 | { |
| 281 | 253 | DEVCB_NULL, |
| 282 | | DEVCB_HANDLER(cc10_portb_r), |
| 283 | | DEVCB_HANDLER(fidelz80_portc_r), |
| 284 | | DEVCB_HANDLER(cc10_porta_w), |
| 285 | | DEVCB_HANDLER(fidelz80_portb_w), |
| 286 | | DEVCB_HANDLER(fidelz80_portc_w) |
| 254 | DEVCB_DRIVER_MEMBER(fidelz80_state, cc10_portb_r), |
| 255 | DEVCB_DRIVER_MEMBER(fidelz80_state, fidelz80_portc_r), |
| 256 | DEVCB_DRIVER_MEMBER(fidelz80_state, cc10_porta_w), |
| 257 | DEVCB_DRIVER_MEMBER(fidelz80_state, fidelz80_portb_w), |
| 258 | DEVCB_DRIVER_MEMBER(fidelz80_state, fidelz80_portc_w) |
| 287 | 259 | }; |
| 288 | 260 | |
| 289 | 261 | static I8255A_INTERFACE( vcc_ppi8255_intf ) |
| 290 | 262 | { |
| 291 | 263 | DEVCB_NULL, // only bit 6 is readable (and only sometimes) and I'm not emulating the language latch unless needed |
| 292 | | DEVCB_HANDLER(vcc_portb_r), // bit 7 is readable and is the done line from the s14001a |
| 293 | | DEVCB_HANDLER(fidelz80_portc_r), // bits 0,1,2,3 are readable, have to do with input |
| 294 | | DEVCB_HANDLER(vcc_porta_w), // display segments and s14001a lines |
| 295 | | DEVCB_HANDLER(fidelz80_portb_w), // display digits and led dots |
| 296 | | DEVCB_HANDLER(fidelz80_portc_w), // bits 4,5,6,7 are writable, have to do with input |
| 264 | DEVCB_DRIVER_MEMBER(fidelz80_state, vcc_portb_r), // bit 7 is readable and is the done line from the s14001a |
| 265 | DEVCB_DRIVER_MEMBER(fidelz80_state, fidelz80_portc_r), // bits 0,1,2,3 are readable, have to do with input |
| 266 | DEVCB_DRIVER_MEMBER(fidelz80_state, vcc_porta_w), // display segments and s14001a lines |
| 267 | DEVCB_DRIVER_MEMBER(fidelz80_state, fidelz80_portb_w), // display digits and led dots |
| 268 | DEVCB_DRIVER_MEMBER(fidelz80_state, fidelz80_portc_w), // bits 4,5,6,7 are writable, have to do with input |
| 297 | 269 | }; |
| 298 | 270 | |
| 299 | 271 | /****************************************************************************** |
| 300 | | basic machine |
| 272 | I8041 MCU |
| 301 | 273 | ******************************************************************************/ |
| 302 | 274 | |
| 303 | | static MACHINE_START(cc10) |
| 275 | WRITE8_MEMBER(fidelz80_state::kp_matrix_w) |
| 304 | 276 | { |
| 305 | | fidelz80_state *state = machine->driver_data<fidelz80_state>(); |
| 277 | if (m_kp_matrix) |
| 278 | { |
| 279 | UINT16 out_data = BITSWAP16(m_digit_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8); |
| 280 | UINT16 out_digit = out_data & 0x3fff; |
| 281 | //UINT8 out_led = BIT(out_data, 15); |
| 306 | 282 | |
| 307 | | state->beep = machine->device("beep"); |
| 283 | beep_set_state(m_beep, BIT(out_data, 14)); |
| 284 | |
| 285 | // output the digit before update the matrix |
| 286 | switch (m_kp_matrix) |
| 287 | { |
| 288 | case 0x01: |
| 289 | output_set_digit_value(1, out_digit); |
| 290 | break; |
| 291 | case 0x02: |
| 292 | output_set_digit_value(2, out_digit); |
| 293 | break; |
| 294 | case 0x04: |
| 295 | output_set_digit_value(3, out_digit); |
| 296 | break; |
| 297 | case 0x08: |
| 298 | output_set_digit_value(4, out_digit); |
| 299 | break; |
| 300 | case 0x10: |
| 301 | output_set_digit_value(5, out_digit); |
| 302 | break; |
| 303 | case 0x20: |
| 304 | output_set_digit_value(6, out_digit); |
| 305 | break; |
| 306 | case 0x40: |
| 307 | output_set_digit_value(7, out_digit); |
| 308 | break; |
| 309 | case 0x80: |
| 310 | output_set_digit_value(8, out_digit); |
| 311 | break; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | m_digit_data = 0; |
| 316 | memset(m_digit_line_status, 0, ARRAY_LENGTH(m_digit_line_status)); |
| 317 | |
| 318 | m_kp_matrix = data; |
| 308 | 319 | } |
| 309 | 320 | |
| 310 | | static MACHINE_START(vcc) |
| 321 | READ8_MEMBER(fidelz80_state::exp_i8243_p2_r) |
| 311 | 322 | { |
| 312 | | fidelz80_state *state = machine->driver_data<fidelz80_state>(); |
| 323 | UINT8 data = 0; |
| 313 | 324 | |
| 314 | | state->speech = machine->device("speech"); |
| 325 | switch (m_kp_matrix) |
| 326 | { |
| 327 | case 0x01: |
| 328 | data = input_port_read(space.machine, "LINE1"); |
| 329 | break; |
| 330 | case 0x02: |
| 331 | data = input_port_read(space.machine, "LINE2"); |
| 332 | break; |
| 333 | case 0x04: |
| 334 | data = input_port_read(space.machine, "LINE3"); |
| 335 | break; |
| 336 | case 0x08: |
| 337 | data = input_port_read(space.machine, "LINE4"); |
| 338 | break; |
| 339 | case 0x10: |
| 340 | data = input_port_read(space.machine, "LINE5"); |
| 341 | break; |
| 342 | case 0x20: |
| 343 | data = input_port_read(space.machine, "LINE6"); |
| 344 | break; |
| 345 | case 0x40: |
| 346 | data = input_port_read(space.machine, "LINE7"); |
| 347 | break; |
| 348 | case 0x80: |
| 349 | data = input_port_read(space.machine, "LINE8"); |
| 350 | break; |
| 351 | default: |
| 352 | data = 0xf0; |
| 353 | } |
| 354 | return (m_i8243->i8243_p2_r(offset)&0x0f) | (data&0xf0); |
| 315 | 355 | } |
| 316 | 356 | |
| 317 | | static MACHINE_RESET( fidelz80 ) |
| 357 | WRITE8_MEMBER(fidelz80_state::exp_i8243_p2_w) |
| 318 | 358 | { |
| 319 | | fidelz80_state *state = machine->driver_data<fidelz80_state>(); |
| 359 | m_i8243->i8243_p2_w(offset, data&0x0f); |
| 360 | } |
| 320 | 361 | |
| 321 | | // data for the 4x 7seg leds, bits are 0bxABCDEFG |
| 322 | | memset(state->led_7seg_data, 0, ARRAY_LENGTH(state->led_7seg_data)); |
| 323 | | state->led_data = 0; |
| 324 | | state->led_selected = 0; |
| 325 | | state->kp_matrix = 0; |
| 326 | | state->digit_data = 0; |
| 362 | // probably related to the card scanner |
| 363 | READ8_MEMBER(fidelz80_state::unknown_r) |
| 364 | { |
| 365 | return 0; |
| 327 | 366 | } |
| 328 | 367 | |
| 368 | READ8_MEMBER(fidelz80_state::rand_r) |
| 369 | { |
| 370 | return mame_rand(space.machine); |
| 371 | } |
| 372 | |
| 329 | 373 | /****************************************************************************** |
| 374 | I8243 expander |
| 375 | ******************************************************************************/ |
| 376 | |
| 377 | static WRITE8_DEVICE_HANDLER( digit_w ) |
| 378 | { |
| 379 | fidelz80_state *state = device->machine->driver_data<fidelz80_state>(); |
| 380 | |
| 381 | if (state->m_kp_matrix) |
| 382 | switch (offset) |
| 383 | { |
| 384 | case 0: |
| 385 | if (state->m_digit_line_status[0] == 0) |
| 386 | { |
| 387 | state->m_digit_line_status[0] = 1; |
| 388 | state->m_digit_data = (state->m_digit_data&(~0x000f)) | ((data<<0)&0x000f); |
| 389 | } |
| 390 | break; |
| 391 | case 1: |
| 392 | if (state->m_digit_line_status[1] == 0) |
| 393 | { |
| 394 | state->m_digit_line_status[1] = 1; |
| 395 | state->m_digit_data = (state->m_digit_data&(~0x00f0)) | ((data<<4)&0x00f0); |
| 396 | } |
| 397 | break; |
| 398 | case 2: |
| 399 | if (state->m_digit_line_status[2] == 0) |
| 400 | { |
| 401 | state->m_digit_line_status[2] = 1; |
| 402 | state->m_digit_data = (state->m_digit_data&(~0x0f00)) | ((data<<8)&0x0f00); |
| 403 | } |
| 404 | break; |
| 405 | case 3: |
| 406 | if (state->m_digit_line_status[3] == 0) |
| 407 | { |
| 408 | state->m_digit_line_status[3] = 1; |
| 409 | state->m_digit_data = (state->m_digit_data&(~0xf000)) | ((data<<12)&0xf000); |
| 410 | } |
| 411 | break; |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | /****************************************************************************** |
| 416 | basic machine |
| 417 | ******************************************************************************/ |
| 418 | |
| 419 | WRITE8_MEMBER(fidelz80_state::mcu_data_w) |
| 420 | { |
| 421 | upi41_master_w(m_i8041, 0, data); |
| 422 | } |
| 423 | |
| 424 | WRITE8_MEMBER(fidelz80_state::mcu_command_w) |
| 425 | { |
| 426 | upi41_master_w(m_i8041, 1, data); |
| 427 | } |
| 428 | |
| 429 | READ8_MEMBER(fidelz80_state::mcu_data_r) |
| 430 | { |
| 431 | return upi41_master_r(m_i8041, 0); |
| 432 | } |
| 433 | |
| 434 | READ8_MEMBER(fidelz80_state::mcu_status_r) |
| 435 | { |
| 436 | return upi41_master_r(m_i8041, 1); |
| 437 | } |
| 438 | |
| 439 | void fidelz80_state::machine_reset() |
| 440 | { |
| 441 | m_led_selected = 0; |
| 442 | m_kp_matrix = 0; |
| 443 | m_digit_data = 0; |
| 444 | memset(m_digit_line_status, 0, ARRAY_LENGTH(m_digit_line_status)); |
| 445 | } |
| 446 | |
| 447 | /****************************************************************************** |
| 330 | 448 | Address Maps |
| 331 | 449 | ******************************************************************************/ |
| 332 | 450 | |
| 333 | | static ADDRESS_MAP_START(cc10_z80_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 451 | static ADDRESS_MAP_START(cc10_z80_mem, ADDRESS_SPACE_PROGRAM, 8, fidelz80_state) |
| 334 | 452 | ADDRESS_MAP_UNMAP_HIGH |
| 335 | 453 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 336 | 454 | AM_RANGE(0x3000, 0x31ff) AM_RAM |
| 337 | 455 | ADDRESS_MAP_END |
| 338 | 456 | |
| 339 | | static ADDRESS_MAP_START(vcc_z80_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 457 | static ADDRESS_MAP_START(vcc_z80_mem, ADDRESS_SPACE_PROGRAM, 8, fidelz80_state) |
| 340 | 458 | ADDRESS_MAP_UNMAP_HIGH |
| 341 | 459 | AM_RANGE(0x0000, 0x0fff) AM_ROM // 4k rom |
| 342 | 460 | AM_RANGE(0x1000, 0x1fff) AM_ROM // 4k rom |
| r9728 | r9729 | |
| 344 | 462 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_MIRROR(0x1c00) // 1k ram (2114*2) mirrored 8 times |
| 345 | 463 | ADDRESS_MAP_END |
| 346 | 464 | |
| 347 | | static ADDRESS_MAP_START(fidel_z80_io, ADDRESS_SPACE_IO, 8) |
| 465 | static ADDRESS_MAP_START(abc_z80_mem, ADDRESS_SPACE_PROGRAM, 8, fidelz80_state) |
| 466 | ADDRESS_MAP_UNMAP_HIGH |
| 467 | AM_RANGE(0x0000, 0x1fff) AM_ROM // 8k rom |
| 468 | AM_RANGE(0x2000, 0x3fff) AM_ROM // 8k rom |
| 469 | AM_RANGE(0x4000, 0x5fff) AM_ROM // 8k rom |
| 470 | AM_RANGE(0x6000, 0x67ff) AM_RAM // probably mirrored |
| 471 | ADDRESS_MAP_END |
| 472 | |
| 473 | static ADDRESS_MAP_START(fidel_z80_io, ADDRESS_SPACE_IO, 8, fidelz80_state) |
| 348 | 474 | ADDRESS_MAP_UNMAP_HIGH |
| 349 | 475 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 350 | | AM_RANGE(0x00, 0x03) AM_MIRROR(0xFC) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w) // 8255 i/o chip |
| 476 | AM_RANGE(0x00, 0x03) AM_MIRROR(0xFC) AM_DEVREADWRITE_LEGACY("ppi8255", i8255a_r, i8255a_w) // 8255 i/o chip |
| 351 | 477 | ADDRESS_MAP_END |
| 352 | 478 | |
| 479 | static ADDRESS_MAP_START(abc_z80_io, ADDRESS_SPACE_IO, 8, fidelz80_state) |
| 480 | ADDRESS_MAP_UNMAP_HIGH |
| 481 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 482 | AM_RANGE(0x00, 0x00) AM_READWRITE(mcu_data_r, mcu_data_w) |
| 483 | AM_RANGE(0x01, 0x01) AM_READWRITE(mcu_status_r, mcu_command_w) |
| 484 | ADDRESS_MAP_END |
| 353 | 485 | |
| 486 | static ADDRESS_MAP_START(abc_mcu_io, ADDRESS_SPACE_IO, 8, fidelz80_state) |
| 487 | ADDRESS_MAP_UNMAP_LOW |
| 488 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(kp_matrix_w) |
| 489 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(exp_i8243_p2_r, exp_i8243_p2_w) |
| 490 | AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE_LEGACY("i8243", i8243_prog_w) |
| 491 | |
| 492 | // probably related to the card scanner |
| 493 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(unknown_r) |
| 494 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(rand_r) |
| 495 | ADDRESS_MAP_END |
| 496 | |
| 354 | 497 | /****************************************************************************** |
| 355 | 498 | Input Ports |
| 356 | 499 | ******************************************************************************/ |
| r9728 | r9729 | |
| 386 | 529 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("H8") PORT_CODE(KEYCODE_8) |
| 387 | 530 | INPUT_PORTS_END |
| 388 | 531 | |
| 532 | static INPUT_PORTS_START( abc ) |
| 533 | PORT_START("LINE1") |
| 534 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 535 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 536 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("10") PORT_CODE(KEYCODE_0) |
| 537 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 538 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 539 | |
| 540 | PORT_START("LINE2") |
| 541 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 542 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("K") PORT_CODE(KEYCODE_K) |
| 543 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 544 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 545 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 546 | |
| 547 | PORT_START("LINE3") |
| 548 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 549 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) |
| 550 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 551 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 552 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_P) |
| 553 | |
| 554 | PORT_START("LINE4") |
| 555 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 556 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("J") PORT_CODE(KEYCODE_J) |
| 557 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 558 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 559 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("NT") PORT_CODE(KEYCODE_N) |
| 560 | |
| 561 | PORT_START("LINE5") |
| 562 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 563 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("EN") PORT_CODE(KEYCODE_E) |
| 564 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("SC") PORT_CODE(KEYCODE_S) |
| 565 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PL") PORT_CODE(KEYCODE_P) |
| 566 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Spades") PORT_CODE(KEYCODE_1_PAD) |
| 567 | |
| 568 | PORT_START("LINE6") |
| 569 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 570 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_C) |
| 571 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("DB") PORT_CODE(KEYCODE_D) |
| 572 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("VL") PORT_CODE(KEYCODE_V) |
| 573 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Hearts") PORT_CODE(KEYCODE_2_PAD) |
| 574 | |
| 575 | PORT_START("LINE7") |
| 576 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 577 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Beep on/off") PORT_CODE(KEYCODE_SPACE) |
| 578 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_B) |
| 579 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CV") PORT_CODE(KEYCODE_G) |
| 580 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Diamonds") PORT_CODE(KEYCODE_3_PAD) |
| 581 | |
| 582 | PORT_START("LINE8") |
| 583 | PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED |
| 584 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R) |
| 585 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("BR") PORT_CODE(KEYCODE_T) |
| 586 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("DL") PORT_CODE(KEYCODE_L) |
| 587 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Clubs") PORT_CODE(KEYCODE_4_PAD) |
| 588 | INPUT_PORTS_END |
| 589 | |
| 389 | 590 | /****************************************************************************** |
| 390 | 591 | Machine Drivers |
| 391 | 592 | ******************************************************************************/ |
| r9728 | r9729 | |
| 397 | 598 | MDRV_CPU_IO_MAP(fidel_z80_io) |
| 398 | 599 | MDRV_QUANTUM_TIME(HZ(60)) |
| 399 | 600 | |
| 400 | | MDRV_MACHINE_START(cc10) |
| 401 | | MDRV_MACHINE_RESET(fidelz80) |
| 402 | | |
| 403 | 601 | /* video hardware */ |
| 404 | 602 | MDRV_DEFAULT_LAYOUT(layout_fidelz80) |
| 405 | 603 | |
| r9728 | r9729 | |
| 419 | 617 | MDRV_CPU_IO_MAP(fidel_z80_io) |
| 420 | 618 | MDRV_QUANTUM_TIME(HZ(60)) |
| 421 | 619 | |
| 422 | | MDRV_MACHINE_START(vcc) |
| 423 | | MDRV_MACHINE_RESET(fidelz80) |
| 424 | | |
| 425 | 620 | /* video hardware */ |
| 426 | 621 | MDRV_DEFAULT_LAYOUT(layout_fidelz80) |
| 427 | 622 | |
| r9728 | r9729 | |
| 434 | 629 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 435 | 630 | MACHINE_CONFIG_END |
| 436 | 631 | |
| 632 | static MACHINE_CONFIG_START( abc, fidelz80_state ) |
| 633 | /* basic machine hardware */ |
| 634 | MDRV_CPU_ADD("maincpu", Z80, XTAL_4MHz) // unknown clock/divider |
| 635 | MDRV_CPU_PROGRAM_MAP(abc_z80_mem) |
| 636 | MDRV_CPU_IO_MAP(abc_z80_io) |
| 637 | MDRV_QUANTUM_TIME(HZ(60)) |
| 437 | 638 | |
| 639 | /* video hardware */ |
| 640 | MDRV_DEFAULT_LAYOUT(layout_abc) |
| 641 | |
| 642 | /* other hardware */ |
| 643 | MDRV_CPU_ADD("mcu", I8041, XTAL_4MHz) // unknown clock/divider |
| 644 | MDRV_CPU_IO_MAP(abc_mcu_io) |
| 645 | |
| 646 | MDRV_I8243_ADD("i8243", NULL, digit_w) |
| 647 | |
| 648 | /* sound hardware */ |
| 649 | MDRV_SPEAKER_STANDARD_MONO( "mono" ) |
| 650 | MDRV_SOUND_ADD( "beep", BEEP, 0 ) |
| 651 | MDRV_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 652 | MACHINE_CONFIG_END |
| 653 | |
| 654 | |
| 438 | 655 | /****************************************************************************** |
| 439 | 656 | ROM Definitions |
| 440 | 657 | ******************************************************************************/ |
| r9728 | r9729 | |
| 463 | 680 | ROM_LOAD("101-32107.c4", 0x0000, 0x1000, CRC(F35784F9) SHA1(348E54A7FA1E8091F89AC656B4DA22F28CA2E44D)) // "NEC P9Y019 // D2332C 229 // 101-32107", == vcc-engl.bin on vcc |
| 464 | 681 | ROM_END |
| 465 | 682 | |
| 683 | ROM_START(abc) |
| 684 | ROM_REGION(0x10000, "maincpu", 0) |
| 685 | ROM_LOAD("bridge_w.bin", 0x0000, 0x2000, CRC(eb1620ef) SHA1(987a9abc8c685f1a68678ea4ee65ec4a99419179)) |
| 686 | ROM_LOAD("bridge_r.bin", 0x2000, 0x2000, CRC(74af0019) SHA1(8dc05950c254ca050b95b93e5d0cf48f913a6d49)) |
| 687 | ROM_LOAD("bridge_b.bin", 0x4000, 0x2000, CRC(341d9ca6) SHA1(370876573bb9408e75f4fc797304b6c64af0590a)) |
| 466 | 688 | |
| 689 | ROM_REGION(0x1000, "mcu", 0) |
| 690 | ROM_LOAD("100-1009.bin", 0x0000, 0x0400, CRC(60eb343f) SHA1(8a63e95ebd62e123bdecc330c0484a47c354bd1a)) |
| 691 | ROM_END |
| 467 | 692 | |
| 468 | 693 | /****************************************************************************** |
| 469 | 694 | Drivers |
| r9728 | r9729 | |
| 473 | 698 | COMP( 1978, cc10, 0, 0, cc10, fidelz80, 0, "Fidelity Electronics", "Chess Challenger 10", GAME_NOT_WORKING ) |
| 474 | 699 | COMP( 1979, vcc, 0, 0, vcc, fidelz80, 0, "Fidelity Electronics", "Talking Chess Challenger (model VCC)", GAME_NOT_WORKING ) |
| 475 | 700 | COMP( 1980, uvc, vcc, 0, vcc, fidelz80, 0, "Fidelity Electronics", "Advanced Talking Chess Challenger (model UVC)", GAME_NOT_WORKING ) |
| 701 | COMP( 1980, abc, 0, 0, abc, abc, 0, "Fidelity Electronics", "Advanced Bridge Challenger (model ABC)", GAME_NOT_WORKING ) |
| 476 | 702 | |