diff --git a/source/CPU.cpp b/source/CPU.cpp index bcdff14..2d070d1 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -133,9 +133,9 @@ static ULONG g_nCyclesExecuted; // # of cycles executed up to last IO access //static signed long g_uInternalExecutedCycles; // Use IRQ_CHECK_TIMEOUT=128 when running at full-speed; else use IRQ_CHECK_TIMEOUT=1 (GH#651) -static const int IRQ_CHECK_TIMEOUT_FULL_SPEED = 128; -static const int IRQ_CHECK_TIMEOUT_NORMAL_SPEED = 1; -static signed int g_nIrqCheckTimeout = IRQ_CHECK_TIMEOUT_NORMAL_SPEED; +//static const int IRQ_CHECK_TIMEOUT_FULL_SPEED = 128; +//static const int IRQ_CHECK_TIMEOUT_NORMAL_SPEED = 1; +//static signed int g_nIrqCheckTimeout = IRQ_CHECK_TIMEOUT_NORMAL_SPEED; // @@ -417,21 +417,21 @@ static __forceinline void IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, } } -static __forceinline void CheckInterruptSources(ULONG uExecutedCycles, const bool bVideoUpdate) +static __forceinline void CheckInterruptSources(ULONG uExecutedCycles/*, const bool bVideoUpdate*/) { - if (g_nIrqCheckTimeout < 0) +// if (g_nIrqCheckTimeout < 0) { MB_UpdateCycles(uExecutedCycles); sg_Mouse.SetVBlank( !VideoGetVblBar(uExecutedCycles) ); - g_nIrqCheckTimeout = bVideoUpdate ? IRQ_CHECK_TIMEOUT_NORMAL_SPEED : IRQ_CHECK_TIMEOUT_FULL_SPEED; +// g_nIrqCheckTimeout = bVideoUpdate ? IRQ_CHECK_TIMEOUT_NORMAL_SPEED : IRQ_CHECK_TIMEOUT_FULL_SPEED; } } // GH#608: IRQ needs to occur within 17 cycles (6 opcodes) of configuring the timer interrupt void CpuAdjustIrqCheck(UINT uCyclesUntilInterrupt) { - if (g_bFullSpeed && uCyclesUntilInterrupt < IRQ_CHECK_TIMEOUT_FULL_SPEED) - g_nIrqCheckTimeout = uCyclesUntilInterrupt; +// if (g_bFullSpeed && uCyclesUntilInterrupt < IRQ_CHECK_TIMEOUT_FULL_SPEED) +// g_nIrqCheckTimeout = uCyclesUntilInterrupt; } //=========================================================================== diff --git a/source/CPU/cpu6502.h b/source/CPU/cpu6502.h index 29b8452..2b58bf5 100644 --- a/source/CPU/cpu6502.h +++ b/source/CPU/cpu6502.h @@ -318,7 +318,7 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate) #undef $ } - CheckInterruptSources(uExecutedCycles, bVideoUpdate); + CheckInterruptSources(uExecutedCycles/*, bVideoUpdate*/); NMI(uExecutedCycles, flagc, flagn, flagv, flagz); IRQ(uExecutedCycles, flagc, flagn, flagv, flagz); diff --git a/source/CPU/cpu65C02.h b/source/CPU/cpu65C02.h index 1dc0622..9bf37a6 100644 --- a/source/CPU/cpu65C02.h +++ b/source/CPU/cpu65C02.h @@ -321,7 +321,7 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate) #undef $ } - CheckInterruptSources(uExecutedCycles, bVideoUpdate); + CheckInterruptSources(uExecutedCycles/*, bVideoUpdate*/); NMI(uExecutedCycles, flagc, flagn, flagv, flagz); IRQ(uExecutedCycles, flagc, flagn, flagv, flagz); diff --git a/source/CPU/cpu65d02.h b/source/CPU/cpu65d02.h index bdb7863..21bad4d 100644 --- a/source/CPU/cpu65d02.h +++ b/source/CPU/cpu65d02.h @@ -406,7 +406,7 @@ static DWORD Cpu65D02(DWORD uTotalCycles, const bool bVideoUpdate) } #undef $ - CheckInterruptSources(uExecutedCycles, bVideoUpdate); + CheckInterruptSources(uExecutedCycles/*, bVideoUpdate*/); NMI(uExecutedCycles, flagc, flagn, flagv, flagz); IRQ(uExecutedCycles, flagc, flagn, flagv, flagz); diff --git a/source/CPU/cpu_general.inl b/source/CPU/cpu_general.inl index 4d565ef..9ee2a71 100644 --- a/source/CPU/cpu_general.inl +++ b/source/CPU/cpu_general.inl @@ -49,7 +49,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | (flagz ? AF_ZERO : 0) \ | AF_RESERVED | AF_BREAK; // CYC(a): This can be optimised, as only certain opcodes will affect uExtraCycles -#define CYC(a) uExecutedCycles += (a)+uExtraCycles; g_nIrqCheckTimeout -= (a)+uExtraCycles; +#define CYC(a) uExecutedCycles += (a)+uExtraCycles; /*g_nIrqCheckTimeout -= (a)+uExtraCycles;*/ #define POP (*(mem+((regs.sp >= 0x1FF) ? (regs.sp = 0x100) : ++regs.sp))) #define PUSH(a) *(mem+regs.sp--) = (a); \ if (regs.sp < 0x100) \ diff --git a/test/TestCPU6502/TestCPU6502.cpp b/test/TestCPU6502/TestCPU6502.cpp index 2e86946..f013edb 100644 --- a/test/TestCPU6502/TestCPU6502.cpp +++ b/test/TestCPU6502/TestCPU6502.cpp @@ -54,7 +54,7 @@ static __forceinline void DoIrqProfiling(DWORD uCycles) { } -static __forceinline void CheckInterruptSources(ULONG uExecutedCycles, const bool bVideoUpdate) +static __forceinline void CheckInterruptSources(ULONG uExecutedCycles/*, const bool bVideoUpdate*/) { }