diff --git a/include/dolphin/gx/GXManage.h b/include/dolphin/gx/GXManage.h index ab3a72c8..f027d4ad 100644 --- a/include/dolphin/gx/GXManage.h +++ b/include/dolphin/gx/GXManage.h @@ -8,9 +8,13 @@ extern "C" { #endif typedef void (*GXDrawDoneCallback)(void); +typedef void (*GXDrawSyncCallback)(u16 token); GXFifoObj* GXInit(void* base, u32 size); GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb); +void GXSetDrawSync(u16 token); +GXDrawSyncCallback GXSetDrawSyncCallback(GXDrawSyncCallback callback); + void GXDrawDone(void); void GXSetDrawDone(void); void GXFlush(void); diff --git a/include/dolphin/gx/GXPerf.h b/include/dolphin/gx/GXPerf.h index c3850dc3..7f232fa6 100644 --- a/include/dolphin/gx/GXPerf.h +++ b/include/dolphin/gx/GXPerf.h @@ -2,12 +2,31 @@ #define _DOLPHIN_GXPERF #include +#include #ifdef __cplusplus extern "C" { #endif -void GXReadXfRasMetric(u32* xf_wait_in, u32* xf_wait_out, u32* ras_busy, u32* clocks); +extern void GXSetGPMetric(GXPerf0 perf0, GXPerf1 perf1); +extern void GXClearGPMetric(); +extern void GXReadXfRasMetric(u32* xfWaitIn, u32* xfWaitOut, u32* rasBusy, u32* clocks); + +// Unused/inlined in P2. +extern void GXReadGPMetric(u32* count0, u32* count1); +extern u32 GXReadGP0Metric(); +extern u32 GXReadGP1Metric(); +extern void GXReadMemMetric(u32* cpReq, u32* tcReq, u32* cpuReadReq, u32* cpuWriteReq, u32* dspReq, u32* ioReq, u32* viReq, u32* peReq, + u32* rfReq, u32* fiReq); +extern void GXClearMemMetric(); +extern void GXReadPixMetric(u32* topIn, u32* topOut, u32* bottomIn, u32* bottomOut, u32* clearIn, u32* copyClocks); +extern void GXClearPixMetric(); +extern void GXSetVCacheMetric(GXVCachePerf attr); +extern void GXReadVCacheMetric(u32* check, u32* miss, u32* stall); +extern void GXClearVCacheMetric(); +extern void GXInitXfRasMetric(); +extern u32 GXReadClksPerVtx(); + #ifdef __cplusplus } diff --git a/src/game/perf.c b/src/game/perf.c index a10efa7a..39918db8 100644 --- a/src/game/perf.c +++ b/src/game/perf.c @@ -21,41 +21,31 @@ void OSStartStopwatch(void*); u64 OSCheckStopwatch(void*); void OSResetStopwatch(void*); void OSStopStopwatch(void*); -void GXSetDrawSync(s32); -void GXSetDrawSyncCallback(void*); -void GXReadGPMetric(s32*, s32*); -void GXReadMemMetric(s32*, s32*, s32*, s32*, s32*, s32*, s32*, s32*, s32*, s32*); -void GXReadPixMetric(s32*, s32*, s32*, s32*, s32*, s32*); -void GXReadVCacheMetric(s32*, s32*, s32*); -void GXClearGPMetric(void); -void GXClearMemMetric(void); -void GXClearPixMetric(void); -void GXClearVCacheMetric(void); static u8 Ssw[56]; static UnknownPerfStruct perf[10]; -static s32 met0; -static s32 met1; -static s32 vcheck; -static s32 vmiss; -static s32 vstall; -static s32 cp_req; -static s32 tc_req; -static s32 cpu_rd_req; -static s32 cpu_wr_req; -static s32 dsp_req; -static s32 io_req; -static s32 vi_req; -static s32 pe_req; -static s32 rf_req; -static s32 fi_req; -static s32 top_pixels_in; -static s32 top_pixels_out; -static s32 bot_pixels_in; -static s32 bot_pixels_out; -static s32 clr_pixels_in; -static s32 total_copy_clks; +static u32 met0; +static u32 met1; +static u32 vcheck; +static u32 vmiss; +static u32 vstall; +static u32 cp_req; +static u32 tc_req; +static u32 cpu_rd_req; +static u32 cpu_wr_req; +static u32 dsp_req; +static u32 io_req; +static u32 vi_req; +static u32 pe_req; +static u32 rf_req; +static u32 fi_req; +static u32 top_pixels_in; +static u32 top_pixels_out; +static u32 bot_pixels_in; +static u32 bot_pixels_out; +static u32 clr_pixels_in; +static u32 total_copy_clks; static s16 tokenEndF; static u8 metf;