diff --git a/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp b/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp index 438931e052..470f1b23db 100644 --- a/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp +++ b/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp @@ -24,6 +24,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef DEBUGGER void __cdecl DebuggerAppendMsg(const char * Message, ...) {} +#ifdef WANT_LOG_UCODE +#include +#include +void __cdecl LOG_UCODE(const char* szFormat, ...) +{ + { + char Msg[400]; + va_list va; + va_start(va, szFormat); + vsprintf( Msg, szFormat, va ); + va_end(va); + printf("%s\n", Msg); + } +} +#endif + #else void DumpMatrix2(const Matrix &mtx, const char* prompt); diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h index bf28e04ad2..21ddba3fa4 100644 --- a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h @@ -39,6 +39,7 @@ void RSP_GBI0_Mtx(Gfx *gfx) uint32 addr = RSPSegmentAddr((gfx->gbi0matrix.addr)); + LOG_UCODE(" Command: %s %s %s Length %d Address 0x%08x", gfx->gbi0matrix.projection == 1 ? "Projection" : "ModelView", gfx->gbi0matrix.load == 1 ? "Load" : "Mul", @@ -55,6 +56,7 @@ void RSP_GBI0_Mtx(Gfx *gfx) if (gfx->gbi0matrix.projection) { + //__asm int 3; CRender::g_pRender->SetProjection(matToLoad, gfx->gbi0matrix.push, gfx->gbi0matrix.load); } else diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp index d3a69d308c..cf5dec0464 100644 --- a/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp @@ -1772,7 +1772,7 @@ void LoadMatrix(uint32 addr) } -#ifdef DEBUGGER + LOG_UCODE( " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" @@ -1782,6 +1782,6 @@ void LoadMatrix(uint32 addr) matToLoad.m[1][0], matToLoad.m[1][1], matToLoad.m[1][2], matToLoad.m[1][3], matToLoad.m[2][0], matToLoad.m[2][1], matToLoad.m[2][2], matToLoad.m[2][3], matToLoad.m[3][0], matToLoad.m[3][1], matToLoad.m[3][2], matToLoad.m[3][3]); -#endif // DEBUGGER + } diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h index 2e4b6ae624..4e17205bdb 100644 --- a/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h @@ -620,7 +620,7 @@ uint32 DLParser_CheckUcode(uint32 ucStart, uint32 ucDStart, uint32 ucSize, uint3 bool IsUsedAsDI(uint32 addr); -#if defined(DEBUGGER) +#if defined(DEBUGGER) || defined(WANT_LOG_UCODE) void __cdecl LOG_UCODE(const char* szFormat, ...); #else inline void LOG_UCODE(...) {}