From 026bbe304dbedf81ce65d0bc2d820a0eff8590e6 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Fri, 26 Dec 2008 17:35:28 +0000 Subject: [PATCH] Oops, I forgot that the div/sqrt cycles are in 33 mhz units, not 66mhz units... --- desmume/src/MMU.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 1593e7fa4..1cac13c52 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -730,7 +730,7 @@ void execsqrt() { T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B4, 0); T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x2B0, cnt | 0x8000); - MMU.sqrtCycles = (nds.cycles + 26); + MMU.sqrtCycles = (nds.cycles + 13); MMU.sqrtResult = ret; MMU.sqrtCnt = (cnt & 0x7FFF); MMU.sqrtRunning = TRUE; @@ -746,18 +746,18 @@ void execdiv() { case 0: num = (s64) (s32) T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x290); den = (s64) (s32) T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x298); - MMU.divCycles = (nds.cycles + 34); + MMU.divCycles = (nds.cycles + 18); break; case 3: //gbatek says this is same as mode 1 case 1: num = (s64) T1ReadQuad(MMU.MMU_MEM[proc][0x40], 0x290); den = (s64) (s32) T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x298); - MMU.divCycles = (nds.cycles + 68); + MMU.divCycles = (nds.cycles + 34); break; case 2: num = (s64) T1ReadQuad(MMU.MMU_MEM[proc][0x40], 0x290); den = (s64) T1ReadQuad(MMU.MMU_MEM[proc][0x40], 0x298); - MMU.divCycles = (nds.cycles + 68); + MMU.divCycles = (nds.cycles + 34); break; }