static void check_irq(device_t *device) { lh5801_state *cpustate = get_safe_token(device); if (cpustate->ir_flipflop[0]) { //NMI interrupt cpustate->ir_flipflop[0] = 0; lh5801_push(cpustate,cpustate->t); cpustate->t&=~IE; lh5801_push_word(cpustate,P); P = (cpustate->program->read_byte(0xfffc)<<8) | cpustate->program->read_byte(0xfffd); } else if (cpustate->ir_flipflop[1] && (cpustate->t & IE)) { //counter interrupt (counter not yet implemented) cpustate->ir_flipflop[1] = 0; lh5801_push(cpustate,cpustate->t); cpustate->t&=~IE; lh5801_push_word(cpustate,P); P = (cpustate->program->read_byte(0xfffa)<<8) | cpustate->program->read_byte(0xfffb); } else if (cpustate->ir_flipflop[2] && (cpustate->t & IE)) { //MI interrupt cpustate->ir_flipflop[2] = 0; lh5801_push(cpustate, cpustate->t); cpustate->t&=~IE; lh5801_push_word(cpustate, P); P = (cpustate->program->read_byte(0xfff8)<<8) | cpustate->program->read_byte(0xfff9); } }
void lh5801_cpu_device::check_irq() { if (m_ir_flipflop[0]) { //NMI interrupt m_ir_flipflop[0] = 0; lh5801_push(m_t); m_t&=~IE; lh5801_push_word(P); P = (m_program->read_byte(0xfffc)<<8) | m_program->read_byte(0xfffd); } else if (m_ir_flipflop[1] && (m_t & IE)) { //counter interrupt (counter not yet implemented) m_ir_flipflop[1] = 0; lh5801_push(m_t); m_t&=~IE; lh5801_push_word(P); P = (m_program->read_byte(0xfffa)<<8) | m_program->read_byte(0xfffb); } else if (m_ir_flipflop[2] && (m_t & IE)) { //MI interrupt m_ir_flipflop[2] = 0; lh5801_push(m_t); m_t&=~IE; lh5801_push_word(P); P = (m_program->read_byte(0xfff8)<<8) | m_program->read_byte(0xfff9); } }