Skip to content

Commit

Permalink
profiler vsync/drawsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko committed Feb 17, 2025
1 parent be035e0 commit 01fe166
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
27 changes: 27 additions & 0 deletions decompile/General/AltMods/Mods9.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,33 @@ void DebugProfiler_SectionStart(char* name, char r, char g, char b)
ptrOpenSect->timeStart = Debug_GetPreciseTime();
}

void DebugProfiler_Subsection(int flag)
{
if(ptrOpenSect == 0)
return;

ptrOpenSect->flagsVDT |= flag;

int time = Debug_GetPreciseTime();

if((flag & 1) != 0)
{
ptrOpenSect->posV = time;
}

if((flag & 2) != 0)
{
ptrOpenSect->posD = time;
}

#if 0
if((flag & 2) != 0)
{
ptrOpenSect->posT = time;
}
#endif
}

void DebugProfiler_SectionRestart(int time)
{
if(ptrOpenSect == 0)
Expand Down
8 changes: 8 additions & 0 deletions decompile/General/GAMEPAD/GAMEPAD_03_PollVsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ void DECOMP_GAMEPAD_PollVsync(struct GamepadSystem *gGamepads)
pad->gamepadType = 0;
pad++;
}

// here for byte budget
#if 1
#ifdef USE_PROFILER
void DebugProfiler_Subsection(int flag);
DebugProfiler_Subsection(1);
#endif
#endif
}
5 changes: 5 additions & 0 deletions decompile/General/MAIN/MainDrawCb_00_DrawSync.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ void DECOMP_MainDrawCb_DrawSync()
if (gGT->bool_DrawOTag_InProgress == 1)
gGT->bool_DrawOTag_InProgress = 0;

#ifdef USE_PROFILER
void DebugProfiler_Subsection(int flag);
DebugProfiler_Subsection(2);
#endif

return;
}
12 changes: 11 additions & 1 deletion decompile/General/MAIN/MainDrawCb_01_Vsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ void DECOMP_MainDrawCb_Vsync()
PsyX_UpdateInput();
#endif

DECOMP_GAMEPAD_PollVsync(sdata->gGamepads);
DECOMP_GAMEPAD_PollVsync(sdata->gGamepads);

// wont fit here cause of byte budget,
// called in gamepad poll instead
#if 0
#ifdef USE_PROFILER
void DebugProfiler_Subsection(int flag);
DebugProfiler_Subsection(1);
#endif
#endif

return;
}

0 comments on commit 01fe166

Please sign in to comment.