From 06d53a106a7134704a47567617c143b5d397fddf Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Fri, 11 Oct 2019 09:31:21 -0400 Subject: [PATCH] GBHawk: RTC update --- .../Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs index 2cf79faa8c..18fb03e603 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs @@ -75,6 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if ((RAM_bank >= 8) && (RAM_bank <= 0xC)) { + //Console.WriteLine("reg: " + (RAM_bank - 8) + " value: " + RTC_regs_latch[RAM_bank - 8] + " cpu: " + Core.cpu.TotalExecutedCycles); return RTC_regs_latch[RAM_bank - 8]; } else @@ -216,7 +217,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk RTC_low_clock++; - if (RTC_low_clock == 32768) + if (RTC_low_clock == 32767) // the RTC appears to be off by one cycle (would be 32768) { RTC_low_clock = 0; @@ -228,6 +229,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk RTC_regs[1]++; if (RTC_regs[1] > 59) { + RTC_regs[1] = 0; RTC_regs[2]++; if (RTC_regs[2] > 23) {