diff --git a/include/dolphin/os.h b/include/dolphin/os.h index e9d30f4b..d231c662 100644 --- a/include/dolphin/os.h +++ b/include/dolphin/os.h @@ -90,6 +90,23 @@ typedef struct OSCalendarTime { OSTime OSCalendarTimeToTicks(OSCalendarTime* td); void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* td); +typedef struct OSStopwatch { + char* name; + OSTime total; + u32 hits; + OSTime min; + OSTime max; + OSTime last; + BOOL running; +} OSStopwatch; + +void OSInitStopwatch(OSStopwatch* sw, char* name); +void OSStartStopwatch(OSStopwatch* sw); +void OSStopStopwatch(OSStopwatch* sw); +OSTime OSCheckStopwatch(OSStopwatch* sw); +void OSResetStopwatch(OSStopwatch* sw); +void OSDumpStopwatch(OSStopwatch* sw); + #define OS_CONSOLE_MASK 0xf0000000 #define OS_CONSOLE_RETAIL 0x00000000 #define OS_CONSOLE_DEVELOPMENT 0x10000000 diff --git a/src/game/perf.c b/src/game/perf.c index 39918db8..09c40370 100644 --- a/src/game/perf.c +++ b/src/game/perf.c @@ -8,21 +8,14 @@ typedef struct { /* 0x04 */ char unk04[4]; /* 0x08 */ s64 unk08; /* 0x10 */ s64 unk10; - /* 0x18 */ s32 unk18; - /* 0x1C */ char unk1C[0x34]; + /* 0x18 */ OSStopwatch unk18; /* 0x50 */ s16 unk50; /* 0x52 */ char unk52[6]; } UnknownPerfStruct; // Size 0x58 static void DSCallbackFunc(u16 arg0); -void OSInitStopwatch(void*, char*); -void OSStartStopwatch(void*); -u64 OSCheckStopwatch(void*); -void OSResetStopwatch(void*); -void OSStopStopwatch(void*); - -static u8 Ssw[56]; +static OSStopwatch Ssw; static UnknownPerfStruct perf[10]; static u32 met0;