1 |
|
/* |
2 |
|
* CPU1541_SC.cpp - Single-cycle 6502 (1541) emulation |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002-2004 Christian Bauer |
4 |
> |
* Frodo Copyright (C) Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
99 |
|
via2_sr = 0; |
100 |
|
|
101 |
|
first_irq_cycle = 0; |
102 |
+ |
opflags = 0; |
103 |
|
Idle = false; |
104 |
|
} |
105 |
|
|
578 |
|
|
579 |
|
// Clear all interrupt lines |
580 |
|
interrupt.intr_any = 0; |
581 |
+ |
opflags = 0; |
582 |
|
|
583 |
|
// Read reset vector |
584 |
|
pc = read_word(0xfffc); |
622 |
|
|
623 |
|
// Any pending interrupts in state 0 (opcode fetch)? |
624 |
|
if (!state && interrupt.intr_any) { |
625 |
< |
if (interrupt.intr[INT_RESET]) |
625 |
> |
if (interrupt.intr[INT_RESET]) { |
626 |
|
Reset(); |
627 |
< |
else if ((interrupt.intr[INT_VIA1IRQ] || interrupt.intr[INT_VIA2IRQ] || interrupt.intr[INT_IECIRQ]) && (the_c64->CycleCounter-first_irq_cycle >= 2) && !i_flag) |
628 |
< |
state = 0x0008; |
627 |
> |
} else if ((interrupt.intr[INT_VIA1IRQ] || interrupt.intr[INT_VIA2IRQ] || interrupt.intr[INT_IECIRQ]) && |
628 |
> |
(!i_flag || (opflags & OPFLAG_IRQ_DISABLED)) && !(opflags & OPFLAG_IRQ_ENABLED)) { |
629 |
> |
uint32 int_delay = (opflags & OPFLAG_INT_DELAYED) ? 1 : 0; // Taken branches to the same page delay the IRQ |
630 |
> |
if (the_c64->CycleCounter - first_irq_cycle - int_delay >= 2) { |
631 |
> |
state = 0x0008; |
632 |
> |
opflags = 0; |
633 |
> |
} |
634 |
> |
} |
635 |
|
} |
636 |
|
|
637 |
|
#define IS_CPU_1541 |