src/mess/machine/intv.c
| r3611 | r3612 | |
| 20 | 20 | COMBINE_DATA(&intvkbd_dualport_ram[offset]); |
| 21 | 21 | |
| 22 | 22 | /* copy the LSB over to the 6502 OP RAM, in case they are opcodes */ |
| 23 | | RAM = memory_region(machine, "keyboard"); |
| 23 | RAM = memory_region(space->machine, "keyboard"); |
| 24 | 24 | RAM[offset] = (UINT8) (data >> 0); |
| 25 | 25 | } |
| 26 | 26 | |
| r3611 | r3612 | |
| 37 | 37 | intvkbd_dualport_ram[offset] |= ((UINT16) data) << 0; |
| 38 | 38 | |
| 39 | 39 | /* copy over to the 6502 OP RAM, in case they are opcodes */ |
| 40 | | RAM = memory_region(machine, "keyboard"); |
| 40 | RAM = memory_region(space->machine, "keyboard"); |
| 41 | 41 | RAM[offset] = data; |
| 42 | 42 | } |
| 43 | 43 | |
| r3611 | r3612 | |
| 56 | 56 | switch (offset) |
| 57 | 57 | { |
| 58 | 58 | case 0x000: |
| 59 | | rv = input_port_read(machine, "TEST") & 0x80; |
| 59 | rv = input_port_read(space->machine, "TEST") & 0x80; |
| 60 | 60 | logerror("TAPE: Read %02x from 0x40%02x - XOR Data?\n",rv,offset); |
| 61 | 61 | break; |
| 62 | 62 | case 0x001: |
| 63 | | rv = (input_port_read(machine, "TEST") & 0x40) << 1; |
| 63 | rv = (input_port_read(space->machine, "TEST") & 0x40) << 1; |
| 64 | 64 | logerror("TAPE: Read %02x from 0x40%02x - Sense 1?\n",rv,offset); |
| 65 | 65 | break; |
| 66 | 66 | case 0x002: |
| 67 | | rv = (input_port_read(machine, "TEST") & 0x20) << 2; |
| 67 | rv = (input_port_read(space->machine, "TEST") & 0x20) << 2; |
| 68 | 68 | logerror("TAPE: Read %02x from 0x40%02x - Sense 2?\n",rv,offset); |
| 69 | 69 | break; |
| 70 | 70 | case 0x003: |
| 71 | | rv = (input_port_read(machine, "TEST") & 0x10) << 3; |
| 71 | rv = (input_port_read(space->machine, "TEST") & 0x10) << 3; |
| 72 | 72 | logerror("TAPE: Read %02x from 0x40%02x - Tape Present\n",rv,offset); |
| 73 | 73 | break; |
| 74 | 74 | case 0x004: |
| 75 | | rv = (input_port_read(machine, "TEST") & 0x08) << 4; |
| 75 | rv = (input_port_read(space->machine, "TEST") & 0x08) << 4; |
| 76 | 76 | logerror("TAPE: Read %02x from 0x40%02x - Comp (339/1)\n",rv,offset); |
| 77 | 77 | break; |
| 78 | 78 | case 0x005: |
| 79 | | rv = (input_port_read(machine, "TEST") & 0x04) << 5; |
| 79 | rv = (input_port_read(space->machine, "TEST") & 0x04) << 5; |
| 80 | 80 | logerror("TAPE: Read %02x from 0x40%02x - Clocked Comp (339/13)\n",rv,offset); |
| 81 | 81 | break; |
| 82 | 82 | case 0x006: |
| r3611 | r3612 | |
| 96 | 96 | case 0x060: /* Keyboard Read */ |
| 97 | 97 | rv = 0xff; |
| 98 | 98 | if (intvkbd_keyboard_col == 0) |
| 99 | | rv = input_port_read(machine, "ROW0"); |
| 99 | rv = input_port_read(space->machine, "ROW0"); |
| 100 | 100 | if (intvkbd_keyboard_col == 1) |
| 101 | | rv = input_port_read(machine, "ROW1"); |
| 101 | rv = input_port_read(space->machine, "ROW1"); |
| 102 | 102 | if (intvkbd_keyboard_col == 2) |
| 103 | | rv = input_port_read(machine, "ROW2"); |
| 103 | rv = input_port_read(space->machine, "ROW2"); |
| 104 | 104 | if (intvkbd_keyboard_col == 3) |
| 105 | | rv = input_port_read(machine, "ROW3"); |
| 105 | rv = input_port_read(space->machine, "ROW3"); |
| 106 | 106 | if (intvkbd_keyboard_col == 4) |
| 107 | | rv = input_port_read(machine, "ROW4"); |
| 107 | rv = input_port_read(space->machine, "ROW4"); |
| 108 | 108 | if (intvkbd_keyboard_col == 5) |
| 109 | | rv = input_port_read(machine, "ROW5"); |
| 109 | rv = input_port_read(space->machine, "ROW5"); |
| 110 | 110 | if (intvkbd_keyboard_col == 6) |
| 111 | | rv = input_port_read(machine, "ROW6"); |
| 111 | rv = input_port_read(space->machine, "ROW6"); |
| 112 | 112 | if (intvkbd_keyboard_col == 7) |
| 113 | | rv = input_port_read(machine, "ROW7"); |
| 113 | rv = input_port_read(space->machine, "ROW7"); |
| 114 | 114 | if (intvkbd_keyboard_col == 8) |
| 115 | | rv = input_port_read(machine, "ROW8"); |
| 115 | rv = input_port_read(space->machine, "ROW8"); |
| 116 | 116 | if (intvkbd_keyboard_col == 9) |
| 117 | | rv = input_port_read(machine, "ROW9"); |
| 117 | rv = input_port_read(space->machine, "ROW9"); |
| 118 | 118 | break; |
| 119 | 119 | case 0x80: |
| 120 | 120 | rv = 0x00; |
| r3611 | r3612 | |
| 143 | 143 | case 0xce: |
| 144 | 144 | case 0xcf: |
| 145 | 145 | /* TMS9927 regs */ |
| 146 | | rv = intvkbd_tms9927_r(machine, offset-0xc0); |
| 146 | rv = intvkbd_tms9927_r(space, offset-0xc0); |
| 147 | 147 | break; |
| 148 | 148 | default: |
| 149 | 149 | rv = (intvkbd_dualport_ram[offset]&0x0300)>>8; |
| r3611 | r3612 | |
| 261 | 261 | case 0xce: |
| 262 | 262 | case 0xcf: |
| 263 | 263 | /* TMS9927 regs */ |
| 264 | | intvkbd_tms9927_w(machine, offset-0xc0, data); |
| 264 | intvkbd_tms9927_w(space, offset-0xc0, data); |
| 265 | 265 | break; |
| 266 | 266 | default: |
| 267 | | logerror("%04X: Unknown write %02x to 0x40%02x\n",activecpu_get_pc(),data,offset); |
| 267 | logerror("%04X: Unknown write %02x to 0x40%02x\n",cpu_get_pc(space->cpu),data,offset); |
| 268 | 268 | break; |
| 269 | 269 | } |
| 270 | 270 | } |
| r3611 | r3612 | |
| 507 | 507 | /* Set Reset and INTR/INTRM Vector */ |
| 508 | 508 | MACHINE_RESET( intv ) |
| 509 | 509 | { |
| 510 | | cpunum_set_input_line_vector(0, CP1610_RESET, 0x1000); |
| 510 | cpu_set_input_line_vector(machine->cpu[0], CP1610_RESET, 0x1000); |
| 511 | 511 | |
| 512 | 512 | /* These are actually the same vector, and INTR is unused */ |
| 513 | | cpunum_set_input_line_vector(0, CP1610_INT_INTRM, 0x1004); |
| 514 | | cpunum_set_input_line_vector(0, CP1610_INT_INTR, 0x1004); |
| 513 | cpu_set_input_line_vector(machine->cpu[0], CP1610_INT_INTRM, 0x1004); |
| 514 | cpu_set_input_line_vector(machine->cpu[0], CP1610_INT_INTR, 0x1004); |
| 515 | 515 | |
| 516 | 516 | return; |
| 517 | 517 | } |
| r3611 | r3612 | |
| 524 | 524 | |
| 525 | 525 | INTERRUPT_GEN( intv_interrupt ) |
| 526 | 526 | { |
| 527 | | cpu_set_input_line(machine->cpu[0], CP1610_INT_INTRM, ASSERT_LINE); |
| 527 | cpu_set_input_line(device->machine->cpu[0], CP1610_INT_INTRM, ASSERT_LINE); |
| 528 | 528 | sr1_int_pending = 1; |
| 529 | 529 | timer_set(ATTOTIME_IN_CYCLES(3791, 0), NULL, 0, intv_interrupt_complete); |
| 530 | | stic_screenrefresh(machine); |
| 530 | stic_screenrefresh(device->machine); |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | static const UINT8 controller_table[] = |
| r3611 | r3612 | |
| 549 | 549 | switch(byte) |
| 550 | 550 | { |
| 551 | 551 | case 0: |
| 552 | | value = input_port_read(machine, "IN0"); |
| 552 | value = input_port_read(space->machine, "IN0"); |
| 553 | 553 | break; |
| 554 | 554 | case 1: |
| 555 | | value = input_port_read(machine, "IN1"); |
| 555 | value = input_port_read(space->machine, "IN1"); |
| 556 | 556 | break; |
| 557 | 557 | case 2: |
| 558 | | value = input_port_read(machine, "IN2"); |
| 558 | value = input_port_read(space->machine, "IN2"); |
| 559 | 559 | break; |
| 560 | 560 | } |
| 561 | 561 | for(bit=7; bit>=0; bit--) |