Files
AnyPS5/core/libs/prx/libSceAudioOut/tests/AudioOutEx.cpp
T
Get-fix f2b4bf3b5b fix(audio): export the sceAudioOutEx bitstream port functions
Jelly5 (PPSA99505) imports sceAudioOutExGetMonitorInfo (PhnNN0UEV6Y),
sceAudioOutExConfigureOutput (VcE+gXSwFXI), sceAudioOutExOpen
(6X6dp+07h4U) and sceAudioOutExClose (0TfjSulCV2A) from libSceAudioOut
and fails to load because no library exports them. It calls them only
for its optional HDMI bitstream output, and their signatures are
unconfirmed, so they are exported without an implementation and throw
if they are called, like sceSaveDataCancel.
2026-10-10 16:12:11 +03:00

35 lines
1.2 KiB
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdio>
#include <stdexcept>
#include <string>
extern "C" {
int APS5_VABI sceAudioOutExClose();
int APS5_VABI sceAudioOutExConfigureOutput();
int APS5_VABI sceAudioOutExGetMonitorInfo();
int APS5_VABI sceAudioOutExOpen();
}
using ExFunction = int (APS5_VABI *)();
static bool ReportsNotImplemented(ExFunction function, const char* name) {
try {
function();
} catch (const std::runtime_error& error) {
if (std::string(error.what()) == std::string(name) + " not implemented") return true;
std::fprintf(stderr, "%s threw: %s\n", name, error.what());
return false;
}
std::fprintf(stderr, "%s returned instead of reporting that it is not implemented\n", name);
return false;
}
int main() {
bool passed = ReportsNotImplemented(sceAudioOutExClose, "sceAudioOutExClose");
passed = ReportsNotImplemented(sceAudioOutExConfigureOutput, "sceAudioOutExConfigureOutput") && passed;
passed = ReportsNotImplemented(sceAudioOutExGetMonitorInfo, "sceAudioOutExGetMonitorInfo") && passed;
passed = ReportsNotImplemented(sceAudioOutExOpen, "sceAudioOutExOpen") && passed;
return passed ? 0 : 1;
}