sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

profiler.h (1118B)


      1 #ifndef PROFILER_H
      2 #define PROFILER_H
      3 
      4 #include <PR/ultratypes.h>
      5 #include <PR/os_time.h>
      6 
      7 #include "types.h"
      8 
      9 extern u64 osClockRate;
     10 
     11 struct ProfilerFrameData {
     12     /* 0x00 */ s16 numSoundTimes;
     13     /* 0x02 */ s16 numVblankTimes;
     14     // gameTimes:
     15     // 0: thread 5 start
     16     // 1: level script execution
     17     // 2: render
     18     // 3: display lists
     19     // 4: thread 4 end (0 terminated)
     20     /* 0x08 */ OSTime gameTimes[5];
     21     // gfxTimes:
     22     // 0: processors queued
     23     // 1: rsp completed
     24     // 2: rdp completed
     25     /* 0x30 */ OSTime gfxTimes[3];
     26     /* 0x48 */ OSTime soundTimes[8];
     27     /* 0x88 */ OSTime vblankTimes[8];
     28 };
     29 
     30 // thread event IDs
     31 enum ProfilerGameEvent {
     32     THREAD5_START,
     33     LEVEL_SCRIPT_EXECUTE,
     34     BEFORE_DISPLAY_LISTS,
     35     AFTER_DISPLAY_LISTS,
     36     THREAD5_END
     37 };
     38 
     39 enum ProfilerGfxEvent {
     40     TASKS_QUEUED,
     41     RSP_COMPLETE,
     42     RDP_COMPLETE
     43 };
     44 
     45 void profiler_log_thread5_time(enum ProfilerGameEvent eventID);
     46 void profiler_log_thread4_time(void);
     47 void profiler_log_gfx_time(enum ProfilerGfxEvent eventID);
     48 void profiler_log_vblank_time(void);
     49 void draw_profiler(void);
     50 
     51 #endif // PROFILER_H