Skip to content

Commit

Permalink
timer progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko committed Feb 16, 2025
1 parent 439ed10 commit 2110e50
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
27 changes: 9 additions & 18 deletions decompile/General/MAIN/MainFrame_08_RenderFrame.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,10 @@ void DECOMP_MainFrame_RenderFrame(struct GameTracker* gGT, struct GamepadSystem*

RenderDispEnv_UI(gGT);

#if 1
// leftover debug unused
gGT->countTotalTime =
#if 0
// leftover debug unused,
// clockDurationStall = sysclock (do NOT print)
gGT->clockDurationStall =
Timer_GetTime_Total();
#endif

Expand All @@ -398,10 +399,11 @@ void DECOMP_MainFrame_RenderFrame(struct GameTracker* gGT, struct GamepadSystem*
RenderFMV();
#endif

#if 1
// leftover debug unused
gGT->countTotalTime =
Timer_GetTime_Elapsed(gGT->countTotalTime,0);
#if 0
// leftover debug unused,
// clockDurationStall = time since stall started (NOW print)
gGT->clockDurationStall =
Timer_GetTime_Elapsed(gGT->clockDurationStall,0);
#endif

RenderSubmit(gGT);
Expand Down Expand Up @@ -1702,10 +1704,6 @@ void RenderVSYNC(struct GameTracker* gGT)
VSync(0);
}

#ifdef USE_ONLINE
int boolFirstFrame = 1;
#endif

while(1)
{

Expand All @@ -1721,13 +1719,6 @@ void RenderVSYNC(struct GameTracker* gGT)
return;
}

#ifdef USE_ONLINE
// gpu submission is not too late,
// we got to this while() loop before
// the flip was ready, so we're on-time
boolFirstFrame = 0;
#endif

#ifndef REBUILD_PC
if(ReadyToBreak(gGT))
{
Expand Down
16 changes: 16 additions & 0 deletions ghidra/MAIN.c
Original file line number Diff line number Diff line change
Expand Up @@ -3801,10 +3801,17 @@ void FUN_80035e70(uint *param_1)
// 0x51f = 0x147c = pushBuffer_UI + 0xf4 (ptrOT)
FUN_80042a8c(param_1[0x51f] + 0x10,param_1 + 0x4e2,param_1[4],0,0);


#if 0
// leftover debug unused,
// clockDurationStall = sysclock (do NOT print)

// Timer_GetTime_Total
uVar7 = FUN_8004b3a4();
puVar14 = PTR_DAT_8008d2ac;
param_1[0x737] = uVar7;
#endif


// gGT->256c & checkered flag
if ((*(uint *)(puVar14 + 0x256c) & 0x1000) != 0) {
Expand Down Expand Up @@ -3849,12 +3856,21 @@ void FUN_80035e70(uint *param_1)
DrawSync(0);
}



#if 0
// leftover debug unused,
// clockDurationStall = time since stall started (NOW print)

// param1 is PTR_DAT_8008d2ac

// 737 -> 1cdc
// Timer_GetTime_Elapsed
uVar7 = FUN_8004b41c(param_1[0x737],0);
param_1[0x737] = uVar7;
#endif



// if frontBuffer exists
if (param_1[5] != 0)
Expand Down
2 changes: 1 addition & 1 deletion include/namespace_Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ struct GameTracker
int unk1cc4[6];

// 1cdc
int countTotalTime;
int clockDurationStall;

// 1ce0
int vSync_between_drawSync;
Expand Down

0 comments on commit 2110e50

Please sign in to comment.