From 6adddacc8cd45eb2bc3bd9ace9613f43d6e66890 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 1 Oct 2024 15:07:22 -0400 Subject: [PATCH] d_lib OK --- configure.py | 2 +- src/d/d_lib.cpp | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure.py b/configure.py index 2e70d46d..2aac6974 100644 --- a/configure.py +++ b/configure.py @@ -426,7 +426,7 @@ def JSystemLib(lib_name, objects, progress_category="third_party"): Object(Matching, "d/d_com_inf_game.cpp", extra_cflags=['-sym off']), Object(Matching, "d/d_com_lib_game.cpp"), Object(Matching, "d/d_com_static.cpp", extra_cflags=['-sym off']), - Object(NonMatching, "d/d_lib.cpp"), + Object(Matching, "d/d_lib.cpp"), Object(Matching, "d/d_save.cpp", extra_cflags=['-pragma "nosyminline on"']), Object(Matching, "d/d_save_init.cpp"), Object(Matching, "d/d_shop.cpp", extra_cflags=['-pragma "nosyminline on"']), diff --git a/src/d/d_lib.cpp b/src/d/d_lib.cpp index dcf2520f..a83362d3 100644 --- a/src/d/d_lib.cpp +++ b/src/d/d_lib.cpp @@ -199,9 +199,13 @@ bool dLib_pathInfo(dPath** dst, u8 no) { /* 80057AA4-80057D1C .text dLib_pathMove__FP4cXyzPScP5dPathfPFP4cXyzP4cXyzP4cXyzPv_iPv */ void dLib_pathMove(cXyz* pos, s8* pPntNo, dPath* pPath, f32 speed, int (*pCallBack)(cXyz*, cXyz*, cXyz*, void*), void* pCallBackData) { - /* Nonmatching */ s8 pnt_no = *pPntNo; - s8 pnt_next_no = pnt_no > (pPath->m_num - 1) ? 0 : pnt_no + 1; + s8 pnt_next_no; + if (pnt_no < (pPath->m_num - 1)) { + pnt_next_no = pnt_no + 1; + } else { + pnt_next_no = 0; + } cXyz pnt_pos = pPath->mpPnt[pnt_no].mPos; cXyz pnt_next_pos = pPath->mpPnt[pnt_next_no].mPos; @@ -486,14 +490,16 @@ bool STControl::checkDownTrigger() { /* 80058780-80058834 .text dLib_getIplDaysFromSaveTime__Fv */ u32 dLib_getIplDaysFromSaveTime() { - /* Nonmatching */ OSTime dateIpl = dComIfGs_getDateIpl(); if (dateIpl == 0) return 0; OSTime curTime = OSGetTime(); - u32 seconds = OSTicksToSeconds(curTime - dateIpl); - return seconds; + OSTime temp2 = curTime - dateIpl; + // TODO: below line might be a macro + OSTime temp = (OSTime)((OSTime)(OS_TIMER_CLOCK * (OSTime)60) * (OSTime)60) * (OSTime)24; + u32 days = temp2 / temp; + return days; } /* 80058834-80058910 .text dLib_get_QuatFromTriangle__FP4cXyzP4cXyzP4cXyz */