m6502: IRQ fixes [O. Galibert]

This commit is contained in:
Olivier Galibert 2012-11-06 21:04:49 +00:00
parent 8543c4a3b2
commit 87526c456a
3 changed files with 9 additions and 1 deletions

View File

@ -46,7 +46,9 @@
class m6502_device : public cpu_device {
public:
enum {
IRQ_LINE, NMI_LINE, V_LINE
IRQ_LINE = INPUT_LINE_IRQ0,
NMI_LINE = INPUT_LINE_NMI,
V_LINE = 10
};
m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

View File

@ -273,9 +273,12 @@ brk_imp
PC = read_direct(0xfffa);
PC = set_h(PC, read_direct(0xfffb));
nmi_state = false;
standard_irq_callback(NMI_LINE);
} else {
PC = read_direct(0xfffe);
PC = set_h(PC, read_direct(0xffff));
if(irq_taken)
standard_irq_callback(IRQ_LINE);
}
irq_taken = false;
P |= F_I; // Do *not* move after the prefetch

View File

@ -202,9 +202,12 @@ brk_c_imp
PC = read_direct(0xfffa);
PC = set_h(PC, read_direct(0xfffb));
nmi_state = false;
standard_irq_callback(NMI_LINE);
} else {
PC = read_direct(0xfffe);
PC = set_h(PC, read_direct(0xffff));
if(irq_taken)
standard_irq_callback(IRQ_LINE);
}
irq_taken = false;
P = (P | F_I) & ~F_D; // Do *not* move after the prefetch