From c8e5ac9bd5c1f279499de20ac3dd000977076f78 Mon Sep 17 00:00:00 2001 From: Chloe <228616821+akiramusic000@users.noreply.github.com> Date: Wed, 25 Feb 2026 21:02:38 -0600 Subject: [PATCH 1/3] Match revolution/NET/nettime.c --- config/RSPE01_01/symbols.txt | 7 ++--- configure.py | 2 +- include/revolution/NWC24/NWC24DateParser.h | 5 ++++ src/revolution/NET/NETVersion.c | 5 ++++ src/revolution/NET/nettime.c | 35 ++++++++++++++++++++++ 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 src/revolution/NET/NETVersion.c create mode 100644 src/revolution/NET/nettime.c diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index 9ca1934f..3d222f0a 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -18286,7 +18286,7 @@ XYPAL = .data:0x803B7230; // type:object size:0x30 scope:local align:8 @1049 = .data:0x803B7298; // type:object size:0x2B scope:local align:4 data:string lbl_803B72C8 = .data:0x803B72C8; // type:object size:0x31 data:string lbl_803B7300 = .data:0x803B7300; // type:object size:0x278 data:4byte -lbl_803B7578 = .data:0x803B7578; // type:object size:0x39 data:string +@1 = .data:0x803B7578; // type:object size:0x39 scope:local data:string jumptable_803B75B8 = .data:0x803B75B8; // type:object size:0x84 scope:local gap_08_803B763C_data = .data:0x803B763C; // type:object size:0x4 scope:global @1838 = .data:0x803B7640; // type:object size:0x2C scope:local align:4 @@ -20365,7 +20365,7 @@ __SIVersion = .sdata:0x804BD9A0; // type:object size:0x4 scope:global data:4byte gap_10_804BD9A4_sdata = .sdata:0x804BD9A4; // type:object size:0x4 scope:global @1048 = .sdata:0x804BD9A8; // type:object size:0x6 scope:local align:4 data:string __esFd = .sdata:0x804BD9B0; // type:object size:0x4 scope:local data:4byte -NETRexPPCVersionPrintableString = .sdata:0x804BD9B8; // type:object size:0x8 scope:global data:4byte +NETRexPPCVersionPrintableString = .sdata:0x804BD9B8; // type:object size:0x4 scope:global data:4byte @1856 = .sdata:0x804BD9C0; // type:object size:0x2 scope:local align:4 data:byte @1857 = .sdata:0x804BD9C4; // type:object size:0x2 scope:local align:4 data:string @1858 = .sdata:0x804BD9C8; // type:object size:0x4 scope:local align:4 data:string @@ -21828,8 +21828,7 @@ Initialized$694 = .sbss:0x804BF3DC; // type:object size:0x4 scope:local data:4by cmdTypeAndStatus$877 = .sbss:0x804BF3E0; // type:object size:0x4 scope:local __PADFixBits = .sbss:0x804BF3E4; // type:object size:0x4 scope:global data:4byte SamplingRate = .sbss:0x804BF3E8; // type:object size:0x4 scope:local data:4byte -whenCached$690 = .sbss:0x804BF3F0; // type:object size:0x4 scope:global data:4byte -lbl_804BF3F4 = .sbss:0x804BF3F4; // type:object size:0x4 data:4byte +whenCached$690 = .sbss:0x804BF3F0; // type:object size:0x8 scope:global data:4byte RdBufferMutex = .sbss:0x804BF3F8; // type:object size:0x4 scope:local data:4byte WrBufferMutex = .sbss:0x804BF3FC; // type:object size:0x4 scope:local data:4byte InstanceIdGen = .sbss:0x804BF400; // type:object size:0x4 scope:local data:4byte diff --git a/configure.py b/configure.py index 6995d778..a2a262f2 100755 --- a/configure.py +++ b/configure.py @@ -1027,7 +1027,7 @@ def MatchingFor(*versions): Object(Matching, "revolution/WENC/wenc.c"), Object(NonMatching, "revolution/CNT/cnt.c"), Object(Matching, "revolution/ESP/esp.c"), - Object(NonMatching, "revolution/NET/nettime.c"), + Object(Matching, "revolution/NET/nettime.c"), Object(NonMatching, "revolution/NET/NETVersion.c"), Object(NonMatching, "revolution/NWC24/NWC24StdApi.c"), Object(Matching, "revolution/NWC24/NWC24FileApi.c"), diff --git a/include/revolution/NWC24/NWC24DateParser.h b/include/revolution/NWC24/NWC24DateParser.h index 8bdfc699..59f164c2 100644 --- a/include/revolution/NWC24/NWC24DateParser.h +++ b/include/revolution/NWC24/NWC24DateParser.h @@ -3,11 +3,16 @@ #include #include +#include +#include #ifdef __cplusplus extern "C" { #endif NWC24Err NWC24iIsValidDate(u16 year, u8 month, u8 day); +NWC24Err NWC24iEpochSecondsToDate(NWC24Date* date, s64 timestamp); +NWC24Err NWC24iDateToOSCalendarTime(OSCalendarTime* time, + const NWC24Date* date); #ifdef __cplusplus } diff --git a/src/revolution/NET/NETVersion.c b/src/revolution/NET/NETVersion.c new file mode 100644 index 00000000..8864a864 --- /dev/null +++ b/src/revolution/NET/NETVersion.c @@ -0,0 +1,5 @@ +char* NETRexPPCVersionPrintableString = "<< REX-PPC 1.0.0.2 (RevoEX-1.0plus2) REL 070510173628 >>"; + +char* NETGetRexPPCVersionPrintable() { + return NETRexPPCVersionPrintableString; +} diff --git a/src/revolution/NET/nettime.c b/src/revolution/NET/nettime.c new file mode 100644 index 00000000..2e02393c --- /dev/null +++ b/src/revolution/NET/nettime.c @@ -0,0 +1,35 @@ +#include +#include + +BOOL NETGetUniversalCalendar(OSCalendarTime* time) { + static s64 whenCached = 0; + NWC24Date date; + s64 universalTime; + s64 now; + + if (whenCached == 0) { + goto update; + } + now = __OSGetSystemTime(); + if (whenCached + OS_SEC_TO_TICKS(60) >= now) { + goto use_cache; + } +update: + NWC24iSynchronizeRtcCounter(FALSE); + now = __OSGetSystemTime(); + whenCached = now; +use_cache: + if (NWC24iGetUniversalTime(&universalTime) < 0) { + goto error; + } + if (NWC24iEpochSecondsToDate(&date, universalTime) < 0) { + goto error; + } + if (NWC24iDateToOSCalendarTime(time, &date) < 0) { + goto error; + } + return TRUE; +error: + OSTicksToCalendarTime(OSGetTime(), time); + return FALSE; +} From 7a32b107e23c88ff4f4e4191ec2039a7226555d7 Mon Sep 17 00:00:00 2001 From: Chloe <228616821+akiramusic000@users.noreply.github.com> Date: Wed, 25 Feb 2026 21:05:43 -0600 Subject: [PATCH 2/3] Matched revolution/NWC24/NWC24DateParser.c --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index a2a262f2..4a088e03 100755 --- a/configure.py +++ b/configure.py @@ -1040,7 +1040,7 @@ def MatchingFor(*versions): Object(Matching, "revolution/NWC24/NWC24Parser.c"), Object(NonMatching, "revolution/NWC24/NWC24MsgCommit.c"), Object(Matching, "revolution/NWC24/NWC24Schedule.c"), - Object(NonMatching, "revolution/NWC24/NWC24DateParser.c"), + Object(Matching, "revolution/NWC24/NWC24DateParser.c"), Object(Matching, "revolution/NWC24/NWC24FriendList.c"), Object(Matching, "revolution/NWC24/NWC24SecretFList.c"), Object(Matching, "revolution/NWC24/NWC24Time.c"), From b0d1bf50a32651eb2a1c628c8ff5bb1f5797764a Mon Sep 17 00:00:00 2001 From: Chloe <228616821+akiramusic000@users.noreply.github.com> Date: Fri, 27 Feb 2026 21:49:40 -0600 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Kiwi <49212064+kiwi515@users.noreply.github.com> --- include/revolution/NWC24/NWC24DateParser.h | 2 +- src/revolution/NET/NETVersion.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/revolution/NWC24/NWC24DateParser.h b/include/revolution/NWC24/NWC24DateParser.h index 59f164c2..4cf95cd4 100644 --- a/include/revolution/NWC24/NWC24DateParser.h +++ b/include/revolution/NWC24/NWC24DateParser.h @@ -4,7 +4,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { #endif diff --git a/src/revolution/NET/NETVersion.c b/src/revolution/NET/NETVersion.c index 8864a864..ee6f6f19 100644 --- a/src/revolution/NET/NETVersion.c +++ b/src/revolution/NET/NETVersion.c @@ -1,4 +1,4 @@ -char* NETRexPPCVersionPrintableString = "<< REX-PPC 1.0.0.2 (RevoEX-1.0plus2) REL 070510173628 >>"; +static char* NETRexPPCVersionPrintableString = "<< REX-PPC 1.0.0.2 (RevoEX-1.0plus2) REL 070510173628 >>"; char* NETGetRexPPCVersionPrintable() { return NETRexPPCVersionPrintableString;