forked from n64decomp/sm64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofiler.h
48 lines (41 loc) · 1.05 KB
/
profiler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _PROFILER_H
#define _PROFILER_H
#include "types.h"
extern u64 osClockRate;
struct ProfilerFrameData {
/* 0x00 */ s16 numSoundTimes;
/* 0x02 */ s16 numVblankTimes;
// gameTimes:
// 0: thread 5 start
// 1: level script execution
// 2: render
// 3: display lists
// 4: thread 4 end (0 terminated)
/* 0x08 */ OSTime gameTimes[5];
// gfxTimes:
// 0: processors queued
// 1: rsp completed
// 2: rdp completed
/* 0x30 */ OSTime gfxTimes[3];
/* 0x48 */ OSTime soundTimes[8];
/* 0x88 */ OSTime vblankTimes[8];
};
// thread event IDs
enum ProfilerGameEvent {
THREAD5_START,
LEVEL_SCRIPT_EXECUTE,
BEFORE_DISPLAY_LISTS,
AFTER_DISPLAY_LISTS,
THREAD5_END
};
enum ProfilerGfxEvent {
TASKS_QUEUED,
RSP_COMPLETE,
RDP_COMPLETE
};
void profiler_log_thread5_time(enum ProfilerGameEvent eventID);
void profiler_log_thread4_time(void);
void profiler_log_gfx_time(enum ProfilerGfxEvent eventID);
void profiler_log_vblank_time(void);
void draw_profiler(void);
#endif /* _PROFILER_H */