From 19fef7e068a4e35707e5ce14f0848e95e4f528bb Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 8 Dec 2009 15:45:45 +0000 Subject: [PATCH] core: handle 32bit divcnt and sqrtcnt --- desmume/src/MMU.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index b1b63ff2e..4de77a8ac 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -2953,8 +2953,8 @@ void FASTCALL _MMU_ARM9_write32(u32 adr, u32 val) switch(adr) { - case REG_SQRTCNT: printf("ERROR 32bit SQRTCNT WRITE\n"); return; - case REG_DIVCNT: printf("ERROR 32bit DIVCNT WRITE\n"); return; + case REG_SQRTCNT: MMU_new.sqrt.write16((u16)val); return; + case REG_DIVCNT: MMU_new.div.write16((u16)val); return; //ensata handshaking port? case 0x04FFF010: @@ -3422,8 +3422,10 @@ u32 FASTCALL _MMU_ARM9_read32(u32 adr) switch(adr) { - case REG_SQRTCNT: printf("ERROR 32bit SQRTCNT READ\n"); return 0; - case REG_DIVCNT: printf("ERROR 32bit DIVCNT READ\n"); return 0; + //Dolphin Island Underwater Adventures uses this amidst seemingly reasonable divs so we're going to emulate it. + case REG_DIVCNT: return MMU_new.div.read16(); + //I guess we'll do this also + case REG_SQRTCNT: return MMU_new.sqrt.read16(); case eng_3D_CLIPMTX_RESULT: case eng_3D_CLIPMTX_RESULT+4: