#include #include #define DEBUG #include "debug.h" static int Frame; /* frame number */ static int MaxPackets; static int StartVsync; /* starting value for VSync register */ /* Display critical debugging/profiling information */ void dbgDisplay( void ) { int vMissed, vAll; vAll = VSync(-1) - StartVsync; /* number of VSyncs since start of program */ vMissed = vAll - Frame + 1; FntPrint( "Frame: %d\nHsync: %d\nVsync: %d\nVsync Missed: %d\n", Frame, VSync(1), vAll, vMissed ); } /* Initialise debugging system */ void dbgInit( void ) { Frame = 0; MaxPackets = 0; StartVsync = VSync(-1); } /* Report critical debugging/profiling information to debugging ** console. */ void dbgReport( void ) { int vAll, vMissed; vAll = VSync(-1) - StartVsync; /* number of VSyncs since start of program */ vMissed = vAll - Frame; printf( "Frame: %d\nVsync: %d\nVsync Missed: %d\n", Frame, vAll, vMissed ); } /* Clean up debugging system */ void dbgTerm( void ) { dbgReport(); } /* Increment the frame counter */ int dbgIncFrame( void ) { return ++Frame; } void dbgDumpImage( GsIMAGE *im ) { printf( "Image Info:\n" "pmode=%ld\n" "px=%d, py=%d, pw=%d, ph=%d, pixel=%p\n" "cx=%d, cy=%d, cw+%d, ch=%d, clut=%p\n", im->pmode, im->px, im->py, im->pw, im->ph, im->pixel, im->cx, im->cy, im->cw, im->ch, im->clut ); }