ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/CPU1541_SC.cpp
(Generate patch)

Comparing Frodo4/Src/CPU1541_SC.cpp (file contents):
Revision 1.4 by cebix, 2005-06-27T19:55:48Z vs.
Revision 1.5 by cebix, 2010-04-22T15:08:18Z

# Line 1 | Line 1
1   /*
2   *  CPU1541_SC.cpp - Single-cycle 6502 (1541) emulation
3   *
4 < *  Frodo (C) 1994-1997,2002-2005 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
# Line 99 | Line 99 | MOS6502_1541::MOS6502_1541(C64 *c64, Job
99          via2_sr = 0;
100  
101          first_irq_cycle = 0;
102 +        opflags = 0;
103          Idle = false;
104   }
105  
# Line 577 | Line 578 | void MOS6502_1541::Reset(void)
578  
579          // Clear all interrupt lines
580          interrupt.intr_any = 0;
581 +        opflags = 0;
582  
583          // Read reset vector
584          pc = read_word(0xfffc);
# Line 620 | Line 622 | void MOS6502_1541::EmulateCycle(void)
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines