VSH: sceVaudio_driver, sceVaudioChReserveBuffering and the display panel ID

The VSH's video player outputs sound through vshbridge.prx, which imports
sceVaudio under its driver name, so every sceVaudioOutputBlocking went
nowhere. Register the same functions as sceVaudio_driver. The player
reserves its channel with sceVaudioChReserveBuffering, which in vaudio.prx
is sceVaudioChReserve with a flag set; treat it as that.

It also polls sceDisplay_driver_996881D2 through vshbridge.prx, and skips
setting up its picture output when it's 0. display_02g.prx's init sets
that from the LCD panel type in IdStorage (0x0103000B for type 1,
0x0103020F for type 2), so it's never 0 on a PSP.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-21 17:32:44 +02:00
1 parent 9f5d074a0e
commit add84fb36f
4 files changed
+22 -1

No files matched your search

+1
View File
@@ -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();
+8
View File
@@ -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>, "sceDisplaySetMode", 'x', "iii" },
{0X289D82FE, &WrapI_UIII<sceDisplaySetFramebuf>, "sceDisplaySetFrameBuf", 'i', "xiii"},
@@ -1225,6 +1232,7 @@ const HLEFunction sceDisplay[] = {
{0X9E3C6DC6, &WrapU_II<sceDisplaySetBrightness>, "sceDisplaySetBrightness", 'x', "ii" },
{0X4D4E10EC, &WrapU_V<sceDisplayIsVblank>, "sceDisplayIsVblank", 'x', "" },
{0X21038913, &WrapU_V<sceDisplayIsVsync>, "sceDisplayIsVsync", 'x', "" },
{0X996881D2, &WrapU_V<sceDisplay_driver_996881D2>, "sceDisplay_driver_996881D2", 'x', "" },
};
void Register_sceDisplay() {
+12 -1
View File
@@ -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>, "sceVaudioOutputBlocking", 'x', "ix" },
{0X03B6807D, &WrapU_III<sceVaudioChReserve>, "sceVaudioChReserve", 'x', "iii"},
@@ -139,10 +145,15 @@ const HLEFunction sceVaudio[] = {
{0X346FBE94, &WrapU_II<sceVaudioSetEffectType>, "sceVaudioSetEffectType", 'x', "ii" },
{0XCBD4AC51, &WrapU_I<sceVaudioSetAlcMode>, "sceVaudioSetAlcMode", 'x', "i" },
{0X504E4745, nullptr, "sceVaudio_504E4745", '?', "" },
{0X27ACC20B, nullptr, "sceVaudioChReserveBuffering", '?', "" },
{0X27ACC20B, &WrapU_III<sceVaudioChReserveBuffering>, "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);
}
+1
View File
@@ -20,6 +20,7 @@
class PointerWrap;
void Register_sceVaudio();
void Register_sceVaudio_driver();
void __VaudioInit();
void __VaudioDoState(PointerWrap &p);