From 5a77ed14bf2e6d7ea97a55e596bc9f691704f5ea Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Wed, 18 Nov 2020 16:01:39 +0000 Subject: [PATCH] BIOSHLE: Implement GetOSDParamConfig2 for DST/24h/Format settings --- pcsx2/R5900OpcodeImpl.cpp | 18 ++++++++++++++++-- pcsx2/R5900OpcodeTables.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pcsx2/R5900OpcodeImpl.cpp b/pcsx2/R5900OpcodeImpl.cpp index a76a376e68..5b9563b263 100644 --- a/pcsx2/R5900OpcodeImpl.cpp +++ b/pcsx2/R5900OpcodeImpl.cpp @@ -132,7 +132,7 @@ const char * const R5900::bios[256]= "KSeg0", "EnableCache", "DisableCache", "GetCop0", "FlushCache", "RFU101", "CpuConfig", "iGetCop0", "iFlushCache", "RFU105", "iCpuConfig", "sceSifStopDma", - "SetCPUTimerHandler", "SetCPUTimer", "SetOsdConfigParam2", "SetOsdConfigParam2", + "SetCPUTimerHandler", "SetCPUTimer", "SetOsdConfigParam2", "GetOsdConfigParam2", //0x70 "GsGetIMR_iGsGetIMR", "GsGetIMR_iGsPutIMR", "SetPgifHandler", "SetVSyncFlag", "RFU116", "print", "sceSifDmaStat_isceSifDmaStat", "sceSifSetDma_isceSifSetDma", @@ -950,6 +950,7 @@ void SYSCALL() u8 params[16]; cdvdReadLanguageParams(params); + u32 osdconf = 0; u32 timezone = params[4] | ((u32)(params[3] & 0x7) << 8); @@ -962,8 +963,21 @@ void SYSCALL() memcpy(pointer, &osdconf, 4); return; } - break; + break; + case Syscall::GetOSParamConfig2: + if (g_SkipBiosHack) + { + u8* pointer = (u8*)PSM(cpuRegs.GPR.n.a0.UL[0]); + u8 params[16]; + cdvdReadLanguageParams(params); + + u32 osdconf2 = (u32)((params[3] & 0x78) << 1); // Daylight Savings, 24hr clock, Date format + + memcpy(pointer, &osdconf2, 4); + return; + } + break; case Syscall::SetVTLBRefillHandler: DevCon.Warning("A tlb refill handler is set. New handler %x", (u32*)PSM(cpuRegs.GPR.n.a1.UL[0])); break; diff --git a/pcsx2/R5900OpcodeTables.h b/pcsx2/R5900OpcodeTables.h index ba9c0fc881..95db746c69 100644 --- a/pcsx2/R5900OpcodeTables.h +++ b/pcsx2/R5900OpcodeTables.h @@ -22,6 +22,7 @@ enum Syscall : u8 SetGsCrt = 2, SetVTLBRefillHandler = 13, GetOSParamConfig = 75, + GetOSParamConfig2 = 111, sysPrintOut = 117, sceSifSetDma = 119, Deci2Call = 124