Fix perf GX functions

This commit is contained in:
gamemasterplc 2023-12-27 21:34:30 -06:00
parent d72aee82d6
commit 2db537cf19
3 changed files with 45 additions and 32 deletions

View file

@ -8,9 +8,13 @@ extern "C" {
#endif #endif
typedef void (*GXDrawDoneCallback)(void); typedef void (*GXDrawDoneCallback)(void);
typedef void (*GXDrawSyncCallback)(u16 token);
GXFifoObj* GXInit(void* base, u32 size); GXFifoObj* GXInit(void* base, u32 size);
GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb); GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb);
void GXSetDrawSync(u16 token);
GXDrawSyncCallback GXSetDrawSyncCallback(GXDrawSyncCallback callback);
void GXDrawDone(void); void GXDrawDone(void);
void GXSetDrawDone(void); void GXSetDrawDone(void);
void GXFlush(void); void GXFlush(void);

View file

@ -2,12 +2,31 @@
#define _DOLPHIN_GXPERF #define _DOLPHIN_GXPERF
#include <dolphin/types.h> #include <dolphin/types.h>
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #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 #ifdef __cplusplus
} }

View file

@ -21,41 +21,31 @@ void OSStartStopwatch(void*);
u64 OSCheckStopwatch(void*); u64 OSCheckStopwatch(void*);
void OSResetStopwatch(void*); void OSResetStopwatch(void*);
void OSStopStopwatch(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 u8 Ssw[56];
static UnknownPerfStruct perf[10]; static UnknownPerfStruct perf[10];
static s32 met0; static u32 met0;
static s32 met1; static u32 met1;
static s32 vcheck; static u32 vcheck;
static s32 vmiss; static u32 vmiss;
static s32 vstall; static u32 vstall;
static s32 cp_req; static u32 cp_req;
static s32 tc_req; static u32 tc_req;
static s32 cpu_rd_req; static u32 cpu_rd_req;
static s32 cpu_wr_req; static u32 cpu_wr_req;
static s32 dsp_req; static u32 dsp_req;
static s32 io_req; static u32 io_req;
static s32 vi_req; static u32 vi_req;
static s32 pe_req; static u32 pe_req;
static s32 rf_req; static u32 rf_req;
static s32 fi_req; static u32 fi_req;
static s32 top_pixels_in; static u32 top_pixels_in;
static s32 top_pixels_out; static u32 top_pixels_out;
static s32 bot_pixels_in; static u32 bot_pixels_in;
static s32 bot_pixels_out; static u32 bot_pixels_out;
static s32 clr_pixels_in; static u32 clr_pixels_in;
static s32 total_copy_clks; static u32 total_copy_clks;
static s16 tokenEndF; static s16 tokenEndF;
static u8 metf; static u8 metf;