trunk/src/emu/cpu/i86/i186.c
| r31262 | r31263 | |
| 5 | 5 | #include "debugger.h" |
| 6 | 6 | #include "i86inline.h" |
| 7 | 7 | |
| 8 | | #define LATCH_INTS 1 |
| 9 | 8 | #define LOG_PORTS 0 |
| 10 | 9 | #define LOG_INTERRUPTS 0 |
| 11 | 10 | #define LOG_INTERRUPTS_EXT 0 |
| r31262 | r31263 | |
| 561 | 560 | save_item(NAME(m_timer[0].maxB)); |
| 562 | 561 | save_item(NAME(m_timer[0].active_count)); |
| 563 | 562 | save_item(NAME(m_timer[0].count)); |
| 564 | | save_item(NAME(m_timer[0].time_timer_active)); |
| 565 | | save_item(NAME(m_timer[0].last_time)); |
| 566 | 563 | save_item(NAME(m_timer[1].control)); |
| 567 | 564 | save_item(NAME(m_timer[1].maxA)); |
| 568 | 565 | save_item(NAME(m_timer[1].maxB)); |
| 569 | 566 | save_item(NAME(m_timer[1].active_count)); |
| 570 | 567 | save_item(NAME(m_timer[1].count)); |
| 571 | | save_item(NAME(m_timer[1].time_timer_active)); |
| 572 | | save_item(NAME(m_timer[1].last_time)); |
| 573 | 568 | save_item(NAME(m_timer[2].control)); |
| 574 | 569 | save_item(NAME(m_timer[2].maxA)); |
| 575 | 570 | save_item(NAME(m_timer[2].count)); |
| 576 | | save_item(NAME(m_timer[2].time_timer_active)); |
| 577 | | save_item(NAME(m_timer[2].last_time)); |
| 578 | 571 | save_item(NAME(m_dma[0].source)); |
| 579 | 572 | save_item(NAME(m_dma[0].dest)); |
| 580 | 573 | save_item(NAME(m_dma[0].count)); |
| r31262 | r31263 | |
| 593 | 586 | save_item(NAME(m_intr.timer)); |
| 594 | 587 | save_item(NAME(m_intr.dma)); |
| 595 | 588 | save_item(NAME(m_intr.ext)); |
| 589 | save_item(NAME(m_intr.ext_state)); |
| 596 | 590 | save_item(NAME(m_mem.lower)); |
| 597 | 591 | save_item(NAME(m_mem.upper)); |
| 598 | 592 | save_item(NAME(m_mem.middle)); |
| r31262 | r31263 | |
| 603 | 597 | m_timer[0].int_timer = timer_alloc(TIMER_INT0); |
| 604 | 598 | m_timer[1].int_timer = timer_alloc(TIMER_INT1); |
| 605 | 599 | m_timer[2].int_timer = timer_alloc(TIMER_INT2); |
| 606 | | m_timer[0].time_timer = timer_alloc(TIMER_TIME0); |
| 607 | | m_timer[1].time_timer = timer_alloc(TIMER_TIME1); |
| 608 | | m_timer[2].time_timer = timer_alloc(TIMER_TIME2); |
| 609 | 600 | |
| 610 | 601 | m_out_tmrout0_func.resolve_safe(); |
| 611 | 602 | m_out_tmrout1_func.resolve_safe(); |
| r31262 | r31263 | |
| 632 | 623 | m_intr.request = 0x0000; |
| 633 | 624 | m_intr.status = 0x0000; |
| 634 | 625 | m_intr.poll_status = 0x0000; |
| 626 | m_intr.ext_state = 0x00; |
| 635 | 627 | m_reloc = 0x20ff; |
| 636 | 628 | m_dma[0].drq_state = false; |
| 637 | 629 | m_dma[1].drq_state = false; |
| 638 | 630 | for(int i = 0; i < ARRAY_LENGTH(m_timer); ++i) |
| 639 | 631 | { |
| 640 | 632 | m_timer[i].control = 0; |
| 641 | | m_timer[i].time_timer_active = 0; |
| 642 | 633 | m_timer[i].maxA = 0; |
| 643 | 634 | m_timer[i].maxB = 0; |
| 644 | 635 | m_timer[i].count = 0; |
| r31262 | r31263 | |
| 714 | 705 | oldreq=m_intr.request; |
| 715 | 706 | |
| 716 | 707 | /* clear the request and set the in-service bit */ |
| 717 | | #if LATCH_INTS |
| 718 | | m_intr.request &= ~m_intr.ack_mask; |
| 719 | | #else |
| 720 | | m_intr.request &= ~(m_intr.ack_mask & 0x0f); |
| 721 | | #endif |
| 708 | if(m_intr.ack_mask & 0xf0) |
| 709 | { |
| 710 | int i; |
| 711 | for(i = 0; i < 4; i++) |
| 712 | if((m_intr.ack_mask >> (i + 4)) & 1) |
| 713 | break; |
| 714 | if(!(m_intr.ext[i] & EXTINT_CTRL_LTM)) |
| 715 | m_intr.request &= ~m_intr.ack_mask; |
| 716 | } |
| 717 | else |
| 718 | m_intr.request &= ~m_intr.ack_mask; |
| 722 | 719 | |
| 723 | 720 | if((LOG_INTERRUPTS) && (m_intr.request!=oldreq)) |
| 724 | 721 | logerror("intr.request changed from %02X to %02X\n",oldreq,m_intr.request); |
| r31262 | r31263 | |
| 927 | 924 | } |
| 928 | 925 | |
| 929 | 926 | /* Trigger an external interrupt, optionally supplying the vector to take */ |
| 930 | | void i80186_cpu_device::external_int(UINT16 intno, int state, UINT8 vector) |
| 927 | void i80186_cpu_device::external_int(UINT16 intno, int state) |
| 931 | 928 | { |
| 932 | | if (LOG_INTERRUPTS_EXT) logerror("generating external int %02X, vector %02X\n",intno,vector); |
| 929 | if(!(m_intr.ext_state & (1 << intno)) == !state) |
| 930 | return; |
| 933 | 931 | |
| 932 | if (LOG_INTERRUPTS_EXT) logerror("generating external int %02X\n",intno); |
| 933 | |
| 934 | 934 | if(!state) |
| 935 | 935 | { |
| 936 | 936 | m_intr.request &= ~(0x010 << intno); |
| 937 | 937 | m_intr.ack_mask &= ~(0x0010 << intno); |
| 938 | m_intr.ext_state &= ~(1 << intno); |
| 938 | 939 | } |
| 939 | 940 | else // Turn on the requested request bit and handle interrupt |
| 941 | { |
| 940 | 942 | m_intr.request |= (0x010 << intno); |
| 941 | | |
| 943 | m_intr.ext_state |= (1 << intno); |
| 944 | } |
| 942 | 945 | update_interrupt_state(); |
| 943 | 946 | } |
| 944 | 947 | |
| r31262 | r31263 | |
| 1014 | 1017 | count = t->maxA; |
| 1015 | 1018 | |
| 1016 | 1019 | count = count ? count : 0x10000; |
| 1017 | | t->int_timer->adjust((attotime::from_hz(clock()/8) * count), which); |
| 1020 | if(!(t->control & 4)) |
| 1021 | t->int_timer->adjust((attotime::from_hz(clock()/8) * count), which); |
| 1018 | 1022 | t->count = 0; |
| 1019 | 1023 | if (LOG_TIMER) logerror(" Repriming interrupt\n"); |
| 1020 | 1024 | } |
| r31262 | r31263 | |
| 1022 | 1026 | t->int_timer->adjust(attotime::never, which); |
| 1023 | 1027 | break; |
| 1024 | 1028 | } |
| 1025 | | case TIMER_TIME0: |
| 1026 | | case TIMER_TIME1: |
| 1027 | | case TIMER_TIME2: |
| 1028 | 1029 | default: |
| 1029 | 1030 | break; |
| 1030 | 1031 | } |
| r31262 | r31263 | |
| 1036 | 1037 | struct timer_state *t = &m_timer[which]; |
| 1037 | 1038 | |
| 1038 | 1039 | /* if we have a timing timer running, adjust the count */ |
| 1039 | | if (t->time_timer_active && !(t->control & 0x0c)) |
| 1040 | | { |
| 1041 | | attotime current_time = t->time_timer->elapsed(); |
| 1042 | | int net_clocks = ((current_time - t->last_time) * (clock()/8)).seconds; |
| 1043 | | t->last_time = current_time; |
| 1044 | | |
| 1045 | | t->count = t->count + net_clocks; |
| 1046 | | } |
| 1040 | if ((t->control & 0x8000) && !(t->control & 0x0c)) |
| 1041 | t->count = (((which != 2) && t->active_count) ? t->maxB : t->maxA) - t->int_timer->remaining().as_ticks(clock() / 8); |
| 1047 | 1042 | } |
| 1048 | 1043 | |
| 1049 | 1044 | void i80186_cpu_device::inc_timer(int which) |
| r31262 | r31263 | |
| 1139 | 1134 | { |
| 1140 | 1135 | /* compute the final count */ |
| 1141 | 1136 | internal_timer_sync(which); |
| 1142 | | |
| 1143 | | /* nuke the timer and force the interrupt timer to be recomputed */ |
| 1144 | | t->time_timer->adjust(attotime::never, which); |
| 1145 | | t->time_timer_active = 0; |
| 1146 | 1137 | update_int_timer = 1; |
| 1147 | 1138 | } |
| 1148 | 1139 | |
| 1149 | 1140 | /* if we're going on, start the timers running except with external clock or prescale */ |
| 1150 | 1141 | else if ((diff & 0x8000) && (new_control & 0x8000) && !(new_control & 0xc)) |
| 1151 | 1142 | { |
| 1152 | | /* start the timing */ |
| 1153 | | t->time_timer->adjust(attotime::never, which); |
| 1154 | | t->time_timer_active = 1; |
| 1155 | 1143 | update_int_timer = 1; |
| 1156 | 1144 | } |
| 1157 | 1145 | |
| r31262 | r31263 | |
| 1528 | 1516 | case 0x19: |
| 1529 | 1517 | if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X\n", pc(), data); |
| 1530 | 1518 | m_intr.timer = data & 0x000f; |
| 1519 | update_interrupt_state(); |
| 1531 | 1520 | break; |
| 1532 | 1521 | |
| 1533 | 1522 | case 0x1a: |
| 1534 | 1523 | if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X\n", pc(), data); |
| 1535 | 1524 | m_intr.dma[0] = data & 0x000f; |
| 1525 | update_interrupt_state(); |
| 1536 | 1526 | break; |
| 1537 | 1527 | |
| 1538 | 1528 | case 0x1b: |
| 1539 | 1529 | if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X\n", pc(), data); |
| 1540 | 1530 | m_intr.dma[1] = data & 0x000f; |
| 1531 | update_interrupt_state(); |
| 1541 | 1532 | break; |
| 1542 | 1533 | |
| 1543 | 1534 | case 0x1c: |
| 1544 | 1535 | if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X\n", pc(), data); |
| 1545 | 1536 | m_intr.ext[0] = data & 0x007f; |
| 1537 | update_interrupt_state(); |
| 1546 | 1538 | break; |
| 1547 | 1539 | |
| 1548 | 1540 | case 0x1d: |
| 1549 | 1541 | if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X\n", pc(), data); |
| 1550 | 1542 | m_intr.ext[1] = data & 0x007f; |
| 1543 | update_interrupt_state(); |
| 1551 | 1544 | break; |
| 1552 | 1545 | |
| 1553 | 1546 | case 0x1e: |
| 1554 | 1547 | if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X\n", pc(), data); |
| 1555 | 1548 | m_intr.ext[2] = data & 0x001f; |
| 1549 | update_interrupt_state(); |
| 1556 | 1550 | break; |
| 1557 | 1551 | |
| 1558 | 1552 | case 0x1f: |
| 1559 | 1553 | if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X\n", pc(), data); |
| 1560 | 1554 | m_intr.ext[3] = data & 0x001f; |
| 1555 | update_interrupt_state(); |
| 1561 | 1556 | break; |
| 1562 | 1557 | |
| 1563 | 1558 | case 0x28: |
trunk/src/mess/machine/rmnimbus.c
| r31262 | r31263 | |
| 108 | 108 | |
| 109 | 109 | #define MOUSE_INT_ENABLED(state) (((state)->m_iou_reg092 & MOUSE_INT_ENABLE) ? 1 : 0) |
| 110 | 110 | |
| 111 | | #define VIA_INT 0x03 |
| 112 | | |
| 113 | 111 | #define LINEAR_ADDR(seg,ofs) ((seg<<4)+ofs) |
| 114 | 112 | |
| 115 | 113 | #define OUTPUT_SEGOFS(mess,seg,ofs) logerror("%s=%04X:%04X [%08X]\n",mess,seg,ofs,((seg<<4)+ofs)) |
| r31262 | r31263 | |
| 168 | 166 | }; |
| 169 | 167 | |
| 170 | 168 | |
| 171 | | static void execute_debug_irq(running_machine &machine, int ref, int params, const char *param[]); |
| 172 | 169 | static void nimbus_debug(running_machine &machine, int ref, int params, const char *param[]); |
| 173 | 170 | |
| 174 | 171 | static int instruction_hook(device_t &device, offs_t curpc); |
| r31262 | r31263 | |
| 181 | 178 | static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); |
| 182 | 179 | static void decode_dssi_f_rw_sectors(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); |
| 183 | 180 | |
| 184 | | void rmnimbus_state::external_int(UINT16 intno, UINT8 vector) |
| 181 | void rmnimbus_state::external_int(UINT8 vector, bool state) |
| 185 | 182 | { |
| 183 | |
| 184 | if(!state && (vector != m_vector)) |
| 185 | return; |
| 186 | |
| 186 | 187 | m_vector = vector; |
| 187 | | switch(intno) |
| 188 | | { |
| 189 | | case 0: |
| 190 | | m_maincpu->int0_w(1); |
| 191 | | break; |
| 192 | | case 1: |
| 193 | | m_maincpu->int1_w(1); |
| 194 | | break; |
| 195 | | case 2: |
| 196 | | m_maincpu->int2_w(1); |
| 197 | | break; |
| 198 | | case 3: |
| 199 | | m_maincpu->int3_w(1); |
| 200 | | break; |
| 201 | | default: |
| 202 | | return; |
| 203 | | } |
| 188 | |
| 189 | m_maincpu->int0_w(state); |
| 204 | 190 | } |
| 205 | 191 | |
| 206 | 192 | READ8_MEMBER(rmnimbus_state::cascade_callback) |
| 207 | 193 | { |
| 194 | m_maincpu->int0_w(0); |
| 208 | 195 | return m_vector; |
| 209 | 196 | } |
| 210 | 197 | |
| r31262 | r31263 | |
| 237 | 224 | /* setup debug commands */ |
| 238 | 225 | if (machine().debug_flags & DEBUG_FLAG_ENABLED) |
| 239 | 226 | { |
| 240 | | debug_console_register_command(machine(), "nimbus_irq", CMDFLAG_NONE, 0, 0, 2, execute_debug_irq); |
| 241 | 227 | debug_console_register_command(machine(), "nimbus_debug", CMDFLAG_NONE, 0, 0, 1, nimbus_debug); |
| 242 | 228 | |
| 243 | 229 | /* set up the instruction hook */ |
| r31262 | r31263 | |
| 248 | 234 | m_fdc->dden_w(0); |
| 249 | 235 | } |
| 250 | 236 | |
| 251 | | static void execute_debug_irq(running_machine &machine, int ref, int params, const char *param[]) |
| 252 | | { |
| 253 | | rmnimbus_state *state = machine.driver_data<rmnimbus_state>(); |
| 254 | | int IntNo; |
| 255 | | int Vector; |
| 256 | | |
| 257 | | if(params>1) |
| 258 | | { |
| 259 | | sscanf(param[0],"%X",&IntNo); |
| 260 | | sscanf(param[1],"%X",&Vector); |
| 261 | | |
| 262 | | debug_console_printf(machine,"triggering IRQ%d, Vector=%02X\n",IntNo,Vector); |
| 263 | | state->external_int(IntNo,Vector); |
| 264 | | } |
| 265 | | else |
| 266 | | { |
| 267 | | debug_console_printf(machine,"Error, you must supply an intno and vector to trigger\n"); |
| 268 | | } |
| 269 | | } |
| 270 | | |
| 271 | 237 | static void nimbus_debug(running_machine &machine, int ref, int params, const char *param[]) |
| 272 | 238 | { |
| 273 | 239 | rmnimbus_state *state = machine.driver_data<rmnimbus_state>(); |
| r31262 | r31263 | |
| 655 | 621 | } |
| 656 | 622 | } |
| 657 | 623 | |
| 658 | | void *rmnimbus_state::get_dssi_ptr(address_space &space, UINT16 ds, UINT16 si) |
| 624 | static inline void *get_dssi_ptr(address_space &space, UINT16 ds, UINT16 si) |
| 659 | 625 | { |
| 660 | 626 | int addr; |
| 661 | 627 | |
| r31262 | r31263 | |
| 675 | 641 | if(raw_flag) |
| 676 | 642 | return; |
| 677 | 643 | |
| 678 | | params=(UINT16 *)state->get_dssi_ptr(space,ds,si); |
| 644 | params=(UINT16 *)get_dssi_ptr(space,ds,si); |
| 679 | 645 | |
| 680 | 646 | for(count=0; count<10; count++) |
| 681 | 647 | logerror("%04X ",params[count]); |
| r31262 | r31263 | |
| 694 | 660 | t_nimbus_brush *brush; |
| 695 | 661 | int cocount; |
| 696 | 662 | |
| 697 | | area_params = (t_area_params *)state->get_dssi_ptr(space,ds,si); |
| 663 | area_params = (t_area_params *)get_dssi_ptr(space,ds,si); |
| 698 | 664 | |
| 699 | 665 | if (!raw_flag) |
| 700 | 666 | OUTPUT_SEGOFS("SegBrush:OfsBrush",area_params->seg_brush,area_params->ofs_brush); |
| r31262 | r31263 | |
| 750 | 716 | if(raw_flag) |
| 751 | 717 | return; |
| 752 | 718 | |
| 753 | | plot_string_params=(t_plot_string_params *)state->get_dssi_ptr(space,ds,si); |
| 719 | plot_string_params=(t_plot_string_params *)get_dssi_ptr(space,ds,si); |
| 754 | 720 | |
| 755 | 721 | OUTPUT_SEGOFS("SegFont:OfsFont",plot_string_params->seg_font,plot_string_params->ofs_font); |
| 756 | 722 | OUTPUT_SEGOFS("SegData:OfsData",plot_string_params->seg_data,plot_string_params->ofs_data); |
| r31262 | r31263 | |
| 774 | 740 | address_space &space = state->m_maincpu->space(AS_PROGRAM); |
| 775 | 741 | UINT16 *new_colours; |
| 776 | 742 | int colour; |
| 777 | | new_colours=(UINT16 *)state->get_dssi_ptr(space,ds,si); |
| 743 | new_colours=(UINT16 *)get_dssi_ptr(space,ds,si); |
| 778 | 744 | |
| 779 | 745 | if(raw_flag) |
| 780 | 746 | return; |
| r31262 | r31263 | |
| 791 | 757 | rmnimbus_state *state = device->machine().driver_data<rmnimbus_state>(); |
| 792 | 758 | address_space &space = state->m_maincpu->space(AS_PROGRAM); |
| 793 | 759 | UINT16 *params; |
| 794 | | params=(UINT16 *)state->get_dssi_ptr(space,ds,si); |
| 760 | params=(UINT16 *)get_dssi_ptr(space,ds,si); |
| 795 | 761 | |
| 796 | 762 | if(raw_flag) |
| 797 | 763 | return; |
| r31262 | r31263 | |
| 811 | 777 | if(raw_flag) |
| 812 | 778 | return; |
| 813 | 779 | |
| 814 | | params=(UINT16 *)state->get_dssi_ptr(space,ds,si); |
| 780 | params=(UINT16 *)get_dssi_ptr(space,ds,si); |
| 815 | 781 | |
| 816 | 782 | for(param_no=0;param_no<16;param_no++) |
| 817 | 783 | logerror("%04X ",params[param_no]); |
| r31262 | r31263 | |
| 1035 | 1001 | if(LOG_SIO) |
| 1036 | 1002 | logerror("SIO Interrupt state=%02X\n",state); |
| 1037 | 1003 | |
| 1038 | | // Don't re-trigger if already active ! |
| 1039 | | if(state!=m_sio_int_state) |
| 1040 | | { |
| 1041 | | m_sio_int_state=state; |
| 1042 | | |
| 1043 | | if(state) |
| 1044 | | external_int(0, m_z80sio->m1_r()); |
| 1045 | | } |
| 1004 | external_int(m_z80sio->m1_r(), state); |
| 1046 | 1005 | } |
| 1047 | 1006 | |
| 1048 | 1007 | /* Floppy disk */ |
| r31262 | r31263 | |
| 1051 | 1010 | { |
| 1052 | 1011 | m_nimbus_drives.reg400=0; |
| 1053 | 1012 | m_scsi_ctrl_out->write(0); |
| 1054 | | m_nimbus_drives.int_ff=0; |
| 1055 | 1013 | } |
| 1056 | 1014 | |
| 1057 | 1015 | WRITE_LINE_MEMBER(rmnimbus_state::nimbus_fdc_intrq_w) |
| r31262 | r31263 | |
| 1061 | 1019 | |
| 1062 | 1020 | if(m_iou_reg092 & DISK_INT_ENABLE) |
| 1063 | 1021 | { |
| 1064 | | m_nimbus_drives.int_ff=state; |
| 1065 | | |
| 1066 | | if(state) |
| 1067 | | external_int(0,EXTERNAL_INT_DISK); |
| 1022 | external_int(EXTERNAL_INT_DISK,state); |
| 1068 | 1023 | } |
| 1069 | 1024 | } |
| 1070 | 1025 | |
| r31262 | r31263 | |
| 1119 | 1074 | switch(offset*2) |
| 1120 | 1075 | { |
| 1121 | 1076 | case 0x00 : |
| 1122 | | result |= !m_scsi_req << 7; |
| 1123 | | result |= !m_scsi_cd << 6; |
| 1124 | | result |= !m_scsi_io << 5; |
| 1125 | | result |= !m_scsi_bsy << 4; |
| 1077 | result |= m_scsi_req << 7; |
| 1078 | result |= m_scsi_cd << 6; |
| 1079 | result |= m_scsi_io << 5; |
| 1080 | result |= m_scsi_bsy << 4; |
| 1126 | 1081 | result |= m_scsi_msg << 3; |
| 1127 | 1082 | if(floppy) |
| 1128 | 1083 | { |
| r31262 | r31263 | |
| 1196 | 1151 | |
| 1197 | 1152 | switch(offset*2) |
| 1198 | 1153 | { |
| 1199 | | case 0x10 : |
| 1154 | case 0x00 : |
| 1200 | 1155 | m_scsi_ctrl_out->write(data); |
| 1201 | 1156 | break; |
| 1202 | 1157 | |
| 1203 | | case 0x18 : |
| 1158 | case 0x08 : |
| 1204 | 1159 | m_scsi_data_out->write(data); |
| 1205 | 1160 | hdc_post_rw(); |
| 1206 | 1161 | break; |
| r31262 | r31263 | |
| 1210 | 1165 | void rmnimbus_state::hdc_reset() |
| 1211 | 1166 | { |
| 1212 | 1167 | m_nimbus_drives.drq_ff=0; |
| 1168 | m_scsi_iena = 0; |
| 1169 | m_scsi_msg = 0; |
| 1170 | m_scsi_bsy = 0; |
| 1171 | m_scsi_io = 0; |
| 1172 | m_scsi_cd = 0; |
| 1173 | m_scsi_req = 0; |
| 1213 | 1174 | } |
| 1214 | 1175 | |
| 1176 | void rmnimbus_state::check_scsi_irq() |
| 1177 | { |
| 1178 | nimbus_fdc_intrq_w(m_scsi_io && m_scsi_cd && m_scsi_req && m_scsi_iena); |
| 1179 | } |
| 1180 | |
| 1215 | 1181 | WRITE_LINE_MEMBER(rmnimbus_state::write_scsi_iena) |
| 1216 | 1182 | { |
| 1217 | | int last = m_scsi_iena; |
| 1218 | 1183 | m_scsi_iena = state; |
| 1219 | | |
| 1220 | | // If we enable the HDC interupt, and an interrupt is pending, go deal with it. |
| 1221 | | if (m_scsi_iena && !last && !m_scsi_io && !m_scsi_cd && !m_scsi_req) |
| 1222 | | nimbus_fdc_intrq_w(1); |
| 1184 | check_scsi_irq(); |
| 1223 | 1185 | } |
| 1224 | 1186 | |
| 1225 | 1187 | void rmnimbus_state::hdc_post_rw() |
| 1226 | 1188 | { |
| 1227 | | if(!m_scsi_req) |
| 1189 | if(m_scsi_req) |
| 1228 | 1190 | m_scsibus->write_ack(1); |
| 1229 | 1191 | |
| 1230 | 1192 | m_nimbus_drives.drq_ff=0; |
| r31262 | r31263 | |
| 1246 | 1208 | WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_cd ) |
| 1247 | 1209 | { |
| 1248 | 1210 | m_scsi_cd = state; |
| 1211 | check_scsi_irq(); |
| 1249 | 1212 | } |
| 1250 | 1213 | |
| 1251 | 1214 | WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_io ) |
| r31262 | r31263 | |
| 1256 | 1219 | { |
| 1257 | 1220 | m_scsi_data_out->write(0); |
| 1258 | 1221 | } |
| 1222 | check_scsi_irq(); |
| 1259 | 1223 | } |
| 1260 | 1224 | |
| 1261 | 1225 | WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_msg ) |
| r31262 | r31263 | |
| 1280 | 1244 | { |
| 1281 | 1245 | m_scsibus->write_ack(0); |
| 1282 | 1246 | } |
| 1247 | check_scsi_irq(); |
| 1283 | 1248 | } |
| 1284 | 1249 | |
| 1285 | 1250 | /* 8031/8051 Peripheral controler 80186 side */ |
| r31262 | r31263 | |
| 1369 | 1334 | } |
| 1370 | 1335 | |
| 1371 | 1336 | if(((offset==2) || (offset==3)) && (m_iou_reg092 & PC8031_INT_ENABLE)) |
| 1372 | | external_int(0,EXTERNAL_INT_PC8031_8C); |
| 1337 | external_int(EXTERNAL_INT_PC8031_8C, true); |
| 1373 | 1338 | |
| 1374 | 1339 | if(LOG_PC8031) |
| 1375 | 1340 | logerror("8031: PCIOR %04X read of %04X returns %02X\n",pc,offset,result); |
| r31262 | r31263 | |
| 1403 | 1368 | m_ipc_interface.status_out &= ~IPC_OUT_ADDR; |
| 1404 | 1369 | m_ipc_interface.status_in |= IPC_IN_READ_PEND; |
| 1405 | 1370 | if(m_iou_reg092 & PC8031_INT_ENABLE) |
| 1406 | | external_int(0,EXTERNAL_INT_PC8031_8F); |
| 1371 | external_int(EXTERNAL_INT_PC8031_8F, true); |
| 1407 | 1372 | break; |
| 1408 | 1373 | |
| 1409 | 1374 | case 0x03 : m_ipc_interface.ipc_out=data; |
| r31262 | r31263 | |
| 1411 | 1376 | m_ipc_interface.status_out |= IPC_OUT_ADDR; |
| 1412 | 1377 | m_ipc_interface.status_in |= IPC_IN_READ_PEND; |
| 1413 | 1378 | if(m_iou_reg092 & PC8031_INT_ENABLE) |
| 1414 | | external_int(0,EXTERNAL_INT_PC8031_8E); |
| 1379 | external_int(EXTERNAL_INT_PC8031_8E, true); |
| 1415 | 1380 | break; |
| 1416 | 1381 | } |
| 1417 | 1382 | } |
| r31262 | r31263 | |
| 1545 | 1510 | WRITE_LINE_MEMBER(rmnimbus_state::nimbus_msm5205_vck) |
| 1546 | 1511 | { |
| 1547 | 1512 | if(m_iou_reg092 & MSM5205_INT_ENABLE) |
| 1548 | | external_int(0,EXTERNAL_INT_MSM5205); |
| 1513 | external_int(EXTERNAL_INT_MSM5205,state); |
| 1549 | 1514 | } |
| 1550 | 1515 | |
| 1551 | 1516 | static const int MOUSE_XYA[3][4] = { { 0, 0, 0, 0 }, { 1, 1, 0, 0 }, { 0, 1, 1, 0 } }; |
| r31262 | r31263 | |
| 1663 | 1628 | { |
| 1664 | 1629 | xint=mxa ? EXTERNAL_INT_MOUSE_XR : EXTERNAL_INT_MOUSE_XL; |
| 1665 | 1630 | |
| 1666 | | external_int(0,xint); |
| 1631 | external_int(xint, true); |
| 1667 | 1632 | |
| 1668 | 1633 | // logerror("Xint:%02X, mxb=%02X\n",xint,mxb); |
| 1669 | 1634 | } |
| r31262 | r31263 | |
| 1673 | 1638 | { |
| 1674 | 1639 | yint=myb ? EXTERNAL_INT_MOUSE_YU : EXTERNAL_INT_MOUSE_YD; |
| 1675 | 1640 | |
| 1676 | | external_int(0,yint); |
| 1641 | external_int(yint, true); |
| 1677 | 1642 | // logerror("Yint:%02X, myb=%02X\n",yint,myb); |
| 1678 | 1643 | } |
| 1679 | 1644 | } |
| r31262 | r31263 | |
| 1751 | 1716 | WRITE8_MEMBER(rmnimbus_state::nimbus_via_write_portb) |
| 1752 | 1717 | { |
| 1753 | 1718 | } |
| 1754 | | |
| 1755 | | WRITE_LINE_MEMBER(rmnimbus_state::nimbus_via_irq_w) |
| 1756 | | { |
| 1757 | | if(state) |
| 1758 | | external_int(VIA_INT,0x00); |
| 1759 | | } |