mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
feat(voiceqos): accept app type 0x10000000 in sceVoiceQoSInit
sceVoiceQoSInit accepted only app type 0x20000000 and threw for every other value. PPSA26344 v1.008 passes 0x10000000 at both of its call sites, so its initialization threw. Accept 0x10000000 as a second known app type. Its meaning is unknown, so the constant is named after the value, and it is handled like 0x20000000; the block stays unused. A null or empty block, a second initialization and every other app type still throw. guest_voice_qos_tests now takes the app type as its argument and runs in ctest once per accepted value, because sceVoiceQoSEnd still throws and one process can initialize only once.
This commit is contained in:
@@ -13,9 +13,10 @@ if(BUILD_TESTING)
|
||||
target_include_directories(guest_voice_qos_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(guest_voice_qos_tests PRIVATE libSceVoiceQoS libc)
|
||||
configure_windows_unwind(guest_voice_qos_tests)
|
||||
add_test(NAME guest_voice_qos COMMAND guest_voice_qos_tests)
|
||||
add_test(NAME guest_voice_qos COMMAND guest_voice_qos_tests 0x20000000)
|
||||
add_test(NAME guest_voice_qos_app_type_0x10000000 COMMAND guest_voice_qos_tests 0x10000000)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_voice_qos PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
set_tests_properties(guest_voice_qos guest_voice_qos_app_type_0x10000000 PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceVoiceQoS>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace {
|
||||
|
||||
constexpr std::int32_t VOICE_QOS_APP_TYPE_GAME = 0x20000000;
|
||||
constexpr std::int32_t VOICE_QOS_APP_TYPE_10000000 = 0x10000000;
|
||||
|
||||
std::mutex g_mutex;
|
||||
bool g_initialized = false;
|
||||
@@ -19,7 +20,7 @@ extern "C" {
|
||||
|
||||
int APS5_VABI sceVoiceQoSInit(void* mem_block, uint32_t mem_size, int32_t app_type) {
|
||||
if (!mem_block || mem_size == 0) throw std::invalid_argument("sceVoiceQoSInit: null or empty memory block");
|
||||
if (app_type != VOICE_QOS_APP_TYPE_GAME) throw std::invalid_argument("sceVoiceQoSInit: unsupported app type " + std::to_string(app_type));
|
||||
if (app_type != VOICE_QOS_APP_TYPE_GAME && app_type != VOICE_QOS_APP_TYPE_10000000) throw std::invalid_argument("sceVoiceQoSInit: unsupported app type " + std::to_string(app_type));
|
||||
std::lock_guard lock(g_mutex);
|
||||
if (g_initialized) throw std::runtime_error("sceVoiceQoSInit: already initialized");
|
||||
g_initialized = true;
|
||||
|
||||
@@ -20,11 +20,14 @@ static bool Throws(TFunction function) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int main(int argc, char** argv) {
|
||||
Require(argc == 2);
|
||||
const auto appType = static_cast<std::int32_t>(std::strtoul(argv[1], nullptr, 16));
|
||||
std::vector<std::uint8_t> memory(0x40000);
|
||||
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(nullptr, 0x40000, 0x20000000); }));
|
||||
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0, 0x20000000); }));
|
||||
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(nullptr, 0x40000, appType); }));
|
||||
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0, appType); }));
|
||||
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0x40000, 0); }));
|
||||
Require(sceVoiceQoSInit(memory.data(), 0x40000, 0x20000000) == 0);
|
||||
Require(Throws<std::runtime_error>([&] { sceVoiceQoSInit(memory.data(), 0x40000, 0x20000000); }));
|
||||
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0x40000, 0x30000000); }));
|
||||
Require(sceVoiceQoSInit(memory.data(), 0x40000, appType) == 0);
|
||||
Require(Throws<std::runtime_error>([&] { sceVoiceQoSInit(memory.data(), 0x40000, appType); }));
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ Throughout the project, every function at every stage either **does exactly what
|
||||
- [scePsmlMfsrGetContextBufferRequirement1100, scePsmlMfsrCreateContext1100, scePsmlMfsrGetDispatchMfsrPacket1100](../../core/libs/prx/libScePsml_debug/Export.cpp) (libScePsml_debug) - argument layouts unknown; only 0x8A810001 (not initialized) is returned
|
||||
- [BnMAMrsfVWo](../../core/libs/prx/libc/src/HeapDiagnostics.cpp) (libc) - unknown name, signature
|
||||
- [scePngEncEncode](../../core/libs/prx/libScePngEnc/Export.cpp) (libScePngEnc) - whether rows may stay unfiltered when `filter_type` names a subset of the filters is unknown; as in shadPS4, they may only for 0 and for the all-filters mask
|
||||
- [sceVoiceQoSInit](../../core/libs/prx/libSceVoiceQoS/Export.cpp) (libSceVoiceQoS) - the error codes are unknown: a null or empty memory block, an app type other than 0x20000000 (the value PPSA14632 passes) and a second initialization throw. The minimum memory size is unknown and the block is not used, as no endpoint is implemented
|
||||
- [sceVoiceQoSInit](../../core/libs/prx/libSceVoiceQoS/Export.cpp) (libSceVoiceQoS) - the error codes are unknown: a null or empty memory block, an app type other than 0x20000000 (PPSA14632) or 0x10000000 (PPSA26344) and a second initialization throw. The minimum memory size is unknown; the app type and the block are not used, as no endpoint is implemented
|
||||
- AudioIn, NpSessionSignaling and PlayerInvitationDialog exports added without an implementation have assumed signatures
|
||||
- [vieBRwlh1Lw](../../core/libs/prx/libSceAgc/Unimplemented.cpp) (libSceAgc) - unknown name, signature
|
||||
- [fCWdlnmB1Ks](../../core/libs/prx/libScePad/Export.cpp) (libScePad) - unknown name, signature
|
||||
|
||||
Reference in New Issue
Block a user