Skip to content

Commit

Permalink
d_lib OK
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Oct 1, 2024
1 parent 7105660 commit 6adddac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"']),
Expand Down
16 changes: 11 additions & 5 deletions src/d/d_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 6adddac

Please sign in to comment.