src/mame/drivers/saturn.c
| r12223 | r12224 | |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /* test pending irqs */ |
| 521 | | static void scu_test_irq(running_machine &machine) |
| 521 | static void scu_test_pending_irq(running_machine &machine) |
| 522 | 522 | { |
| 523 | 523 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 524 | 524 | int i; |
| r12223 | r12224 | |
| 533 | 533 | |
| 534 | 534 | for(i=0;i<31;i++) |
| 535 | 535 | { |
| 536 | | if((state->m_scu_regs[0xa0/4] & 1 << i) && (state->m_scu.ist & 1 << i)) |
| 536 | if((!(state->m_scu_regs[0xa0/4] & 1 << i)) && (state->m_scu.ist & 1 << i)) |
| 537 | 537 | { |
| 538 | 538 | if(irq_level[i] != -1) /* TODO: cheap check for undefined irqs */ |
| 539 | 539 | device_set_input_line_and_vector(state->m_maincpu, irq_level[i], HOLD_LINE, 0x40 + i); |
| r12223 | r12224 | |
| 665 | 665 | state->m_scu_irq.vdp1_end = (((state->m_scu_regs[0xa0/4] & 0x2000)>>13) ^ 1); |
| 666 | 666 | state->m_scu_irq.abus = (((state->m_scu_regs[0xa0/4] & 0x8000)>>15) ^ 1); |
| 667 | 667 | |
| 668 | | scu_test_irq(space->machine()); |
| 668 | scu_test_pending_irq(space->machine()); |
| 669 | 669 | |
| 670 | 670 | if(state->m_scu_irq.dsp_end || state->m_scu_irq.pad) |
| 671 | | if(state->m_scu_regs[0xa0/4] != 0x80) |
| 671 | if(state->m_scu_regs[0xa0/4] != 0x80 || state->m_scu_regs[0xa0/4] != 0xacbab8be) |
| 672 | 672 | popmessage("Enabled funky IRQ %08x, contact MAMEdev",state->m_scu_regs[0xa0/4] ^ 0xffffffff); |
| 673 | 673 | |
| 674 | 674 | break; |
| r12223 | r12224 | |
| 676 | 676 | case 0xa4/4: |
| 677 | 677 | if(LOG_SCU) logerror("PC=%08x IRQ status reg set:%08x %08x\n",cpu_get_pc(&space->device()),state->m_scu_regs[41],mem_mask); |
| 678 | 678 | |
| 679 | | state->m_scu.ist &= state->m_scu_regs[offset]; |
| 679 | state->m_scu.ist = state->m_scu_regs[offset]; |
| 680 | 680 | break; |
| 681 | 681 | case 0xa8/4: if(LOG_SCU) logerror("A-Bus IRQ ACK %08x\n",state->m_scu_regs[42]); break; |
| 682 | 682 | case 0xc4/4: if(LOG_SCU) logerror("SCU SDRAM set: %02x\n",state->m_scu_regs[49]); break; |