From 9e688eaa7c0bfdce039deee707dde1588a66d814 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 26 Jan 2022 00:34:31 -0800 Subject: [PATCH] Rtc: Fix day of week stack bounds issue. Also, add a couple other tests showing as passing now. --- Core/HLE/sceRtc.cpp | 5 +++-- pspautotests | 2 +- test.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Core/HLE/sceRtc.cpp b/Core/HLE/sceRtc.cpp index f2f317f7e4..5ec9690300 100644 --- a/Core/HLE/sceRtc.cpp +++ b/Core/HLE/sceRtc.cpp @@ -408,7 +408,8 @@ static u32 sceRtcGetDayOfWeek(u32 year, u32 month, u32 day) restMonth = restMonth % 5; day += grp5 * (31*3+30*2); static u32 t[] = { 31, 31*2, 31*2+30, 31*3+30, 31*3+30*2 }; - day += t[restMonth-1]; + if (restMonth > 0) + day += t[restMonth-1]; month = 12; } @@ -426,7 +427,7 @@ static u32 sceRtcGetDayOfWeek(u32 year, u32 month, u32 day) local.tm_hour = 0; local.tm_min = 0; local.tm_sec = 0; - local.tm_isdst = -1; + local.tm_isdst = 0; mktime(&local); return local.tm_wday; diff --git a/pspautotests b/pspautotests index 2351bb1abd..8b5da5710a 160000 --- a/pspautotests +++ b/pspautotests @@ -1 +1 @@ -Subproject commit 2351bb1abde22ea5d3e68d1f242dc947434e3753 +Subproject commit 8b5da5710a965d48f685e7c9dbfaeeae32d4c4d8 diff --git a/test.py b/test.py index b603a38705..9c80ab400e 100755 --- a/test.py +++ b/test.py @@ -127,6 +127,7 @@ tests_good = [ "font/fontinfobyindex", "font/fontlist", "font/optimum", + "font/resolution", "font/shadowimagerect", "gpu/callbacks/ge_callbacks", "gpu/clut/address", @@ -191,6 +192,7 @@ tests_good = [ "power/volatile/unlock", "rtc/rtc", "rtc/arithmetic", + "rtc/lookup", "string/string", "sysmem/freesize", "sysmem/memblock", @@ -311,6 +313,7 @@ tests_good = [ "threads/vtimers/start", "threads/vtimers/stop", "threads/wakeup/wakeup", + "utility/msgdialog/abort", "utility/savedata/autosave", "utility/savedata/filelist", "utility/savedata/makedata", @@ -375,7 +378,6 @@ tests_next = [ "font/open", "font/openfile", "font/openmem", - "font/resolution", "font/shadowglyphimage", "font/shadowglyphimageclip", "font/shadowinfo", @@ -422,7 +424,6 @@ tests_next = [ "net/primary/ether", "power/freq", "rtc/convert", - "rtc/lookup", "sysmem/partition", "threads/callbacks/cancel", "threads/callbacks/count", @@ -436,7 +437,6 @@ tests_next = [ "umd/io/umd_io", "umd/raw_access/raw_access", "umd/wait/wait", - "utility/msgdialog/abort", "utility/msgdialog/dialog", "utility/savedata/getsize", "utility/savedata/idlist",