src/mess/machine/compis.c
| r4570 | r4571 | |
| 190 | 190 | #ifdef UNUSED_FUNCTION |
| 191 | 191 | void compis_irq_set(UINT8 irq) |
| 192 | 192 | { |
| 193 | | cpu_set_input_line_vector(machine->cpu[0], 0, irq); |
| 194 | | cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE); |
| 193 | cputag_set_input_line_vector(machine, "maincpu", 0, irq); |
| 194 | cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE); |
| 195 | 195 | } |
| 196 | 196 | #endif |
| 197 | 197 | |
| r4570 | r4571 | |
| 634 | 634 | /* generate the appropriate interrupt */ |
| 635 | 635 | i186.intr.poll_status = 0x8000 | new_vector; |
| 636 | 636 | if (!i186.intr.pending) |
| 637 | | cpu_set_input_line(machine->cpu[2], 0, ASSERT_LINE); |
| 637 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 638 | 638 | i186.intr.pending = 1; |
| 639 | 639 | cpuexec_trigger(machine, CPU_RESUME_TRIGGER); |
| 640 | 640 | if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); |
| r4570 | r4571 | |
| 661 | 661 | case 0x0d: i186.intr.in_service &= ~0x20; break; |
| 662 | 662 | case 0x0e: i186.intr.in_service &= ~0x40; break; |
| 663 | 663 | case 0x0f: i186.intr.in_service &= ~0x80; break; |
| 664 | | default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(machine->cpu[0]), data & 0x1f); |
| 664 | default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(cputag_get_cpu(machine, "maincpu")), data & 0x1f); |
| 665 | 665 | } |
| 666 | 666 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", attotime_to_double(timer_get_time(machine)), data & 0x1f); |
| 667 | 667 | } |
| r4570 | r4571 | |
| 833 | 833 | diff = new_control ^ t->control; |
| 834 | 834 | if (diff & 0x001c) |
| 835 | 835 | logerror("%05X:ERROR! -unsupported timer mode %04X\n", |
| 836 | | cpu_get_pc(machine->cpu[0]), |
| 837 | | new_control); |
| 836 | cpu_get_pc(cputag_get_cpu(machine, "maincpu")), new_control); |
| 838 | 837 | |
| 839 | 838 | /* if we have real changes, update things */ |
| 840 | 839 | if (diff != 0) |
| r4570 | r4571 | |
| 935 | 934 | diff = new_control ^ d->control; |
| 936 | 935 | if (diff & 0x6811) |
| 937 | 936 | logerror("%05X:ERROR! - unsupported DMA mode %04X\n", |
| 938 | | cpu_get_pc(machine->cpu[0]), |
| 939 | | new_control); |
| 937 | cpu_get_pc(cputag_get_cpu(machine, "maincpu")), new_control); |
| 940 | 938 | |
| 941 | 939 | /* if we're going live, set a timer */ |
| 942 | 940 | if ((diff & 0x0002) && (new_control & 0x0002)) |
| r4570 | r4571 | |
| 997 | 995 | case 0x12: |
| 998 | 996 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", cpu_get_pc(space->cpu)); |
| 999 | 997 | if (i186.intr.poll_status & 0x8000) |
| 1000 | | int_callback(space->machine->cpu[0],0); |
| 998 | int_callback(cputag_get_cpu(space->machine, "maincpu"), 0); |
| 1001 | 999 | return i186.intr.poll_status; |
| 1002 | 1000 | |
| 1003 | 1001 | case 0x13: |
| r4570 | r4571 | |
| 1388 | 1386 | temp = (data16 & 0x0fff) << 8; |
| 1389 | 1387 | if (data16 & 0x1000) |
| 1390 | 1388 | { |
| 1391 | | memory_install_read16_handler(cpu_get_address_space(space->machine->cpu[2], ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1392 | | memory_install_write16_handler(cpu_get_address_space(space->machine->cpu[2], ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1389 | memory_install_read16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1390 | memory_install_write16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1393 | 1391 | } |
| 1394 | 1392 | else |
| 1395 | 1393 | { |
| 1396 | 1394 | temp &= 0xffff; |
| 1397 | | memory_install_read16_handler(cpu_get_address_space(space->machine->cpu[2], ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1398 | | memory_install_write16_handler(cpu_get_address_space(space->machine->cpu[2], ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1395 | memory_install_read16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1396 | memory_install_write16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1399 | 1397 | } |
| 1400 | 1398 | /* popmessage("Sound CPU reset");*/ |
| 1401 | 1399 | break; |
| r4570 | r4571 | |
| 1434 | 1432 | * |
| 1435 | 1433 | *************************************************************/ |
| 1436 | 1434 | |
| 1437 | | static PIC8259_SET_INT_LINE( compis_pic8259_master_set_int_line ) { |
| 1438 | | cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 1435 | static PIC8259_SET_INT_LINE( compis_pic8259_master_set_int_line ) |
| 1436 | { |
| 1437 | cputag_set_input_line(device->machine, "maincpu", 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 1439 | 1438 | } |
| 1440 | 1439 | |
| 1441 | 1440 | |
| 1442 | | static PIC8259_SET_INT_LINE( compis_pic8259_slave_set_int_line ) { |
| 1443 | | if ( compis_devices.pic8259_master ) { |
| 1444 | | pic8259_set_irq_line( compis_devices.pic8259_master, 2, interrupt); |
| 1441 | static PIC8259_SET_INT_LINE( compis_pic8259_slave_set_int_line ) |
| 1442 | { |
| 1443 | if ( compis_devices.pic8259_master ) |
| 1444 | { |
| 1445 | pic8259_set_irq_line(compis_devices.pic8259_master, 2, interrupt); |
| 1445 | 1446 | } |
| 1446 | 1447 | } |
| 1447 | 1448 | |
| r4570 | r4571 | |
| 1471 | 1472 | DRIVER_INIT( compis ) |
| 1472 | 1473 | { |
| 1473 | 1474 | compis_init( &i82720_interface ); |
| 1474 | | cpu_set_irq_callback(machine->cpu[0], compis_irq_callback); |
| 1475 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), compis_irq_callback); |
| 1475 | 1476 | memset (&compis, 0, sizeof (compis) ); |
| 1476 | 1477 | } |
| 1477 | 1478 | |
| r4570 | r4571 | |
| 1491 | 1492 | compis_keyb_init(); |
| 1492 | 1493 | |
| 1493 | 1494 | /* OSP PIC 8259 */ |
| 1494 | | cpu_set_irq_callback(machine->cpu[0], compis_irq_callback); |
| 1495 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), compis_irq_callback); |
| 1495 | 1496 | |
| 1496 | 1497 | compis_devices.pic8259_master = devtag_get_device(machine, "pic8259_master"); |
| 1497 | 1498 | compis_devices.pic8259_slave = devtag_get_device(machine, "pic8259_slave"); |