Skip to content

Commit

Permalink
Move some iSystem functions from 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 a52165a commit 3185e06
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 71 deletions.
71 changes: 71 additions & 0 deletions src/SB/Core/gc/iSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,74 @@ void _rwDolphinHeapFree(void* __ptr)
}
}
}

int32 iGetMinute()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.min;
}

int32 iGetHour()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.hour;
}

int32 iGetDay()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.mday;
}

int32 iGetMonth()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.mon + 1;
}

#if 0
// Template for future use.
char* iGetCurrFormattedDate(char* input)
{
}

#endif

#if 0
// WIP.
char* iGetCurrFormattedTime(char* input)
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
bool pm = false;
// STUFF.
char* ret = input;
// STUFF.
if (pm)
{
ret[8] = 'P';
ret[9] = '.';
ret[10] = 'M';
ret[11] = '.';
}
else
{
ret[8] = 'A';
ret[9] = '.';
ret[10] = 'M';
ret[11] = '.';
}
ret[12] = '\0';
return ret + (0xd - (int32)input);
}

#endif
71 changes: 0 additions & 71 deletions src/SB/Core/gc/iTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,77 +7,6 @@ extern iTime sStartupTime;
extern float32 sGameTime;
extern float32 lbl_803CE1D8;

int32 iGetMinute()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.min;
}

int32 iGetHour()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.hour;
}

int32 iGetDay()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.mday;
}

int32 iGetMonth()
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
return td.mon + 1;
}

#if 0
// Template for future use.
char* iGetCurrFormattedDate(char* input)
{
}

#endif

#if 0
// WIP.
char* iGetCurrFormattedTime(char* input)
{
OSTime ticks = OSGetTime();
OSCalendarTime td;
OSTicksToCalendarTime(ticks, &td);
bool pm = false;
// STUFF.
char* ret = input;
// STUFF.
if (pm)
{
ret[8] = 'P';
ret[9] = '.';
ret[10] = 'M';
ret[11] = '.';
}
else
{
ret[8] = 'A';
ret[9] = '.';
ret[10] = 'M';
ret[11] = '.';
}
ret[12] = '\0';
return ret + (0xd - (int32)input);
}

#endif

void iTimeInit()
{
sStartupTime = OSGetTime();
Expand Down

0 comments on commit 3185e06

Please sign in to comment.