From 1b9f65904adc852a58279feb5b9e726c5a78ad2a Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Fri, 16 Aug 2019 18:07:24 +0100 Subject: [PATCH] LR35902: No need for an intermediate timer counter. Signed-off-by: Adrian Conlon --- LR35902/IoRegisters.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LR35902/IoRegisters.cs b/LR35902/IoRegisters.cs index abea716..f95e213 100644 --- a/LR35902/IoRegisters.cs +++ b/LR35902/IoRegisters.cs @@ -72,7 +72,6 @@ namespace EightBit.GameBoy private readonly Register16 dmaAddress = new Register16(); private int timerCounter = 0; - private int timerRate = 0; private bool dmaTransferActive = false; @@ -263,7 +262,7 @@ namespace EightBit.GameBoy this.timerCounter -= cycles; if (this.timerCounter <= 0) { - this.timerCounter += this.timerRate; + this.timerCounter += this.TimerClockTicks; this.IncrementTIMA(); } } @@ -299,7 +298,6 @@ namespace EightBit.GameBoy case TMA: // R/W break; case TAC: // R/W - this.timerRate = this.TimerClockTicks; break; case IF: // R/W