diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 15af40cbe7..20214d49df 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -437,6 +437,7 @@ void RegisterAllModules() { Register_sceAmctrl_driver(); Register_InitForKernel(); Register_PopsBootCalls(); + Register_sceVaudio_driver(); // Not ready to enable this due to apparent softlocks in Patapon 3. // Register_sceNpMatching2(); diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 96b5948401..d4ea955bf7 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -1201,6 +1201,13 @@ static u32 sceDisplaySetHoldMode(u32 hMode) { return hleLogWarning(Log::sceDisplay, 0, "UNIMPL"); } +// 6.61's display_02g.prx returns a global its init sets from the LCD panel type in IdStorage: +// 0x0103000B for type 1, 0x0103020F for type 2 (sceDisplay_driver_206276C2), never 0. The VSH's +// video player polls it through vshbridge.prx, and with 0 never sets up its picture output. +static u32 sceDisplay_driver_996881D2() { + return hleLogDebug(Log::sceDisplay, 0x0103000B); +} + const HLEFunction sceDisplay[] = { {0X0E20F177, &WrapU_III, "sceDisplaySetMode", 'x', "iii" }, {0X289D82FE, &WrapI_UIII, "sceDisplaySetFrameBuf", 'i', "xiii"}, @@ -1225,6 +1232,7 @@ const HLEFunction sceDisplay[] = { {0X9E3C6DC6, &WrapU_II, "sceDisplaySetBrightness", 'x', "ii" }, {0X4D4E10EC, &WrapU_V, "sceDisplayIsVblank", 'x', "" }, {0X21038913, &WrapU_V, "sceDisplayIsVsync", 'x', "" }, + {0X996881D2, &WrapU_V, "sceDisplay_driver_996881D2", 'x', "" }, }; void Register_sceDisplay() { diff --git a/Core/HLE/sceVaudio.cpp b/Core/HLE/sceVaudio.cpp index 4876c57f83..d825639bac 100644 --- a/Core/HLE/sceVaudio.cpp +++ b/Core/HLE/sceVaudio.cpp @@ -132,6 +132,12 @@ static u32 sceVaudioSetAlcMode(int alcMode) { return 0; } +// In vaudio.prx this is sceVaudioChReserve with a flag set (a3 = 1 into the shared reserve, 0 for +// ChReserve), which presumably buffers deeper. Not modelled. The VSH's UMD Video player uses it. +static u32 sceVaudioChReserveBuffering(int sampleCount, int freq, int format) { + return sceVaudioChReserve(sampleCount, freq, format); +} + const HLEFunction sceVaudio[] = { {0X8986295E, &WrapU_IU, "sceVaudioOutputBlocking", 'x', "ix" }, {0X03B6807D, &WrapU_III, "sceVaudioChReserve", 'x', "iii"}, @@ -139,10 +145,15 @@ const HLEFunction sceVaudio[] = { {0X346FBE94, &WrapU_II, "sceVaudioSetEffectType", 'x', "ii" }, {0XCBD4AC51, &WrapU_I, "sceVaudioSetAlcMode", 'x', "i" }, {0X504E4745, nullptr, "sceVaudio_504E4745", '?', "" }, - {0X27ACC20B, nullptr, "sceVaudioChReserveBuffering", '?', "" }, + {0X27ACC20B, &WrapU_III, "sceVaudioChReserveBuffering", 'x', "iii"}, {0XE8E78DC8, nullptr, "sceVaudio_E8E78DC8", '?', "" }, }; void Register_sceVaudio() { RegisterHLEModule("sceVaudio",ARRAY_SIZE(sceVaudio), sceVaudio ); } + +void Register_sceVaudio_driver() { + // The same functions; vshbridge.prx imports them under the driver name for the VSH's video player. + RegisterHLEModule("sceVaudio_driver", ARRAY_SIZE(sceVaudio), sceVaudio); +} diff --git a/Core/HLE/sceVaudio.h b/Core/HLE/sceVaudio.h index d0fce8685f..46e1e351e1 100644 --- a/Core/HLE/sceVaudio.h +++ b/Core/HLE/sceVaudio.h @@ -20,6 +20,7 @@ class PointerWrap; void Register_sceVaudio(); +void Register_sceVaudio_driver(); void __VaudioInit(); void __VaudioDoState(PointerWrap &p);