diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index e72bece28..3d731d455 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -2809,6 +2809,10 @@ static u16 FASTCALL _MMU_ARM9_read16(u32 adr) return (gfx3d_GetNumPolys()&2047); case 0x04000606: return (gfx3d_GetNumVertex()&8191); + case 0x04000630: + case 0x04000632: + case 0x04000634: + return gfx3d_glGetVecRes((adr & 0xF) >> 1); // ============================================= 3D end case REG_IME : return (u16)MMU.reg_IME[ARMCPU_ARM9]; @@ -2925,6 +2929,14 @@ static u32 FASTCALL _MMU_ARM9_read32(u32 adr) return (gfx3d_GetNumPolys()&2047) & ((gfx3d_GetNumVertex()&8191) << 16); //LOG ("read32 - RAM_COUNT -> 0x%X", ((u32 *)(MMU.MMU_MEM[ARMCPU_ARM9][(adr>>20)&0xFF]))[(adr&MMU.MMU_MASK[ARMCPU_ARM9][(adr>>20)&0xFF])>>2]); } + + case 0x04000620: + case 0x04000624: + case 0x04000628: + case 0x0400062C: + { + return gfx3d_glGetPosRes((adr & 0xF) >> 2); + } // ======================================== 3D end case REG_IME : diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index 4955e3b5f..5796b0a6c 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -999,16 +999,16 @@ void gfx3d_glVecTest(unsigned long v) //INFO("NDS_glVecTest\n"); } -void gfx3d_glGetPosRes(unsigned int index) +unsigned int gfx3d_glGetPosRes(unsigned int index) { //INFO("NDS_glGetPosRes\n"); - //return 0; + return 0; } -void gfx3d_glGetVecRes(unsigned int index) +unsigned short gfx3d_glGetVecRes(unsigned int index) { //INFO("NDS_glGetVecRes\n"); - //return 0; + return 0; } #if 0 diff --git a/desmume/src/gfx3d.h b/desmume/src/gfx3d.h index 110788436..f1f19622d 100644 --- a/desmume/src/gfx3d.h +++ b/desmume/src/gfx3d.h @@ -199,8 +199,8 @@ void gfx3d_glAlphaFunc(unsigned long v); BOOL gfx3d_glBoxTest(unsigned long v); BOOL gfx3d_glPosTest(unsigned long v); void gfx3d_glVecTest(unsigned long v); -void gfx3d_glGetPosRes(unsigned int index); -void gfx3d_glGetVecRes(unsigned int index); +unsigned int gfx3d_glGetPosRes(unsigned int index); +unsigned short gfx3d_glGetVecRes(unsigned int index); void gfx3d_glFlush(unsigned long v); void gfx3d_VBlankSignal(); void gfx3d_VBlankEndSignal();