Skip to content

Commit

Permalink
Finish matching iTime
Browse files Browse the repository at this point in the history
  • Loading branch information
tgsm authored and SquareMan committed Jun 22, 2024
1 parent 3185e06 commit f9feef7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def Rel(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
Object(NonMatching, "SB/Core/gc/iScrFX.cpp"),
Object(NonMatching, "SB/Core/gc/iSnd.cpp"),
Object(NonMatching, "SB/Core/gc/iSystem.cpp"),
Object(NonMatching, "SB/Core/gc/iTime.cpp"),
Object(Matching, "SB/Core/gc/iTime.cpp"),
Object(NonMatching, "SB/Core/gc/ngcrad3d.c"),
Object(Matching, "SB/Game/zNPCGoals.cpp"),
Object(NonMatching, "SB/Game/zNPCGoalCommon.cpp"), # wrong function order
Expand Down
12 changes: 4 additions & 8 deletions src/SB/Core/gc/iTime.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "iTime.h"
#include "iSystem.h"

#include <types.h>
#include <dolphin.h>

extern iTime sStartupTime;
extern float32 sGameTime;
extern float32 lbl_803CE1D8;
static iTime sStartupTime;
static float32 sGameTime;

void iTimeInit()
{
Expand All @@ -21,15 +21,11 @@ iTime iTimeGet()
return OSGetTime() - sStartupTime;
}

#if 0
// I can't seem to figure out the float operations going on here. It looks the setup is fairly right though?
float32 iTimeDiffSec(iTime time)
{
return (float32)time / (176 - lbl_803CE1D8);
return (float32)time / (GET_BUS_FREQUENCY() / 4);
}

#endif

float32 iTimeDiffSec(iTime t0, iTime t1)
{
return iTimeDiffSec(t1 - t0);
Expand Down

0 comments on commit f9feef7

Please sign in to comment.