mupen rice core: define WANT_LOG_UCODE to get ucode prints to stdout

This commit is contained in:
zeromus 2015-01-22 01:31:39 +00:00
parent 2a1f40982c
commit 308b6ec256
4 changed files with 21 additions and 3 deletions

View File

@ -24,6 +24,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef DEBUGGER #ifndef DEBUGGER
void __cdecl DebuggerAppendMsg(const char * Message, ...) {} void __cdecl DebuggerAppendMsg(const char * Message, ...) {}
#ifdef WANT_LOG_UCODE
#include <varargs.h>
#include <stdio.h>
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 #else
void DumpMatrix2(const Matrix &mtx, const char* prompt); void DumpMatrix2(const Matrix &mtx, const char* prompt);

View File

@ -39,6 +39,7 @@ void RSP_GBI0_Mtx(Gfx *gfx)
uint32 addr = RSPSegmentAddr((gfx->gbi0matrix.addr)); uint32 addr = RSPSegmentAddr((gfx->gbi0matrix.addr));
LOG_UCODE(" Command: %s %s %s Length %d Address 0x%08x", LOG_UCODE(" Command: %s %s %s Length %d Address 0x%08x",
gfx->gbi0matrix.projection == 1 ? "Projection" : "ModelView", gfx->gbi0matrix.projection == 1 ? "Projection" : "ModelView",
gfx->gbi0matrix.load == 1 ? "Load" : "Mul", gfx->gbi0matrix.load == 1 ? "Load" : "Mul",
@ -55,6 +56,7 @@ void RSP_GBI0_Mtx(Gfx *gfx)
if (gfx->gbi0matrix.projection) if (gfx->gbi0matrix.projection)
{ {
//__asm int 3;
CRender::g_pRender->SetProjection(matToLoad, gfx->gbi0matrix.push, gfx->gbi0matrix.load); CRender::g_pRender->SetProjection(matToLoad, gfx->gbi0matrix.push, gfx->gbi0matrix.load);
} }
else else

View File

@ -1772,7 +1772,7 @@ void LoadMatrix(uint32 addr)
} }
#ifdef DEBUGGER
LOG_UCODE( LOG_UCODE(
" %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n"
" %#+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[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[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]); matToLoad.m[3][0], matToLoad.m[3][1], matToLoad.m[3][2], matToLoad.m[3][3]);
#endif // DEBUGGER
} }

View File

@ -620,7 +620,7 @@ uint32 DLParser_CheckUcode(uint32 ucStart, uint32 ucDStart, uint32 ucSize, uint3
bool IsUsedAsDI(uint32 addr); bool IsUsedAsDI(uint32 addr);
#if defined(DEBUGGER) #if defined(DEBUGGER) || defined(WANT_LOG_UCODE)
void __cdecl LOG_UCODE(const char* szFormat, ...); void __cdecl LOG_UCODE(const char* szFormat, ...);
#else #else
inline void LOG_UCODE(...) {} inline void LOG_UCODE(...) {}