src/mess/machine/a7800.c
| r14802 | r14803 | |
| 48 | 48 | return input_port_read(device->machine(), "console_buttons"); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | static WRITE8_DEVICE_HANDLER( riot_button_pullup_w ) |
| 52 | { |
| 53 | a7800_state *state = device->machine().driver_data<a7800_state>(); |
| 54 | state->m_p1_one_button = data & 0x04; // pin 6 of the controller port is held high by the riot chip when reading two-button controllers (from schematic) |
| 55 | state->m_p2_one_button = data & 0x10; |
| 56 | } |
| 57 | |
| 51 | 58 | const riot6532_interface a7800_r6532_interface = |
| 52 | 59 | { |
| 53 | 60 | DEVCB_HANDLER(riot_joystick_r), |
| 54 | 61 | DEVCB_HANDLER(riot_console_button_r), |
| 55 | 62 | DEVCB_NULL, |
| 63 | DEVCB_HANDLER(riot_button_pullup_w), |
| 56 | 64 | DEVCB_NULL |
| 57 | 65 | }; |
| 58 | 66 | |
| r14802 | r14803 | |
| 68 | 76 | state->m_ROM = machine.region("maincpu")->base(); |
| 69 | 77 | state->m_ispal = ispal; |
| 70 | 78 | state->m_lines = lines; |
| 79 | state->m_p1_one_button = 1; |
| 80 | state->m_p2_one_button = 1; |
| 71 | 81 | |
| 72 | 82 | /* standard banks */ |
| 73 | 83 | memory_set_bankptr(machine, "bank5", &state->m_ROM[0x2040]); /* RAM0 */ |
| r14802 | r14803 | |
| 460 | 470 | |
| 461 | 471 | READ8_HANDLER( a7800_TIA_r ) |
| 462 | 472 | { |
| 463 | | switch(offset) |
| 473 | a7800_state *state = space->machine().driver_data<a7800_state>(); |
| 474 | switch(offset & 0x0f) |
| 464 | 475 | { |
| 465 | 476 | case 0x00: |
| 466 | 477 | case 0x01: |
| r14802 | r14803 | |
| 482 | 493 | case 0x0B: |
| 483 | 494 | return((input_port_read(space->machine(), "buttons") & 0x04) << 5); |
| 484 | 495 | case 0x0c: |
| 485 | | if((input_port_read(space->machine(), "buttons") & 0x08) ||(input_port_read(space->machine(), "buttons") & 0x02)) |
| 496 | if(((input_port_read(space->machine(), "buttons") & 0x08) ||(input_port_read(space->machine(), "buttons") & 0x02)) && state->m_p1_one_button) |
| 486 | 497 | return 0x00; |
| 487 | 498 | else |
| 488 | 499 | return 0x80; |
| 489 | 500 | case 0x0d: |
| 490 | | if((input_port_read(space->machine(), "buttons") & 0x01) ||(input_port_read(space->machine(), "buttons") & 0x04)) |
| 501 | if(((input_port_read(space->machine(), "buttons") & 0x01) ||(input_port_read(space->machine(), "buttons") & 0x04)) && state->m_p2_one_button) |
| 491 | 502 | return 0x00; |
| 492 | 503 | else |
| 493 | 504 | return 0x80; |