From afbd9b882f7d89c7b3c926a3caf8e84e8d778146 Mon Sep 17 00:00:00 2001 From: hypermist Date: Tue, 20 Oct 2026 22:36:53 +1300 Subject: [PATCH 1/2] fix(libs): return what the firmware returns from 24 utility calls it does not implement ContentBinder, CompanionUtil, ErrorDialog OpenDetail/OpenWithReport, ImeDialog ForTestFunction, HttpCache SystemTerm/SendStatistics, MoveTracker GetVersion/RecordStop, BluetoothHid and SystemGesture debug versions and Mbus Term/AcquireControlList are a single constant return in the firmware modules; these exports now return the same value. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK --- core/libs/prx/libSceBluetoothHid/Export.cpp | 3 +-- core/libs/prx/libSceCompanionUtil/Export.cpp | 7 +----- core/libs/prx/libSceContentSearch/Export.cpp | 24 +++++++------------- core/libs/prx/libSceErrorDialog/Export.cpp | 7 +++--- core/libs/prx/libSceHttpCache/Export.cpp | 2 -- core/libs/prx/libSceImeDialog/Export.cpp | 4 ++-- core/libs/prx/libSceMbus/PendingExports.cpp | 4 +--- core/libs/prx/libSceMoveTracker/Export.cpp | 4 +--- core/libs/prx/libSceSystemGesture/Export.cpp | 3 +-- 9 files changed, 18 insertions(+), 40 deletions(-) diff --git a/core/libs/prx/libSceBluetoothHid/Export.cpp b/core/libs/prx/libSceBluetoothHid/Export.cpp index 98a466cddf..5b7a222827 100644 --- a/core/libs/prx/libSceBluetoothHid/Export.cpp +++ b/core/libs/prx/libSceBluetoothHid/Export.cpp @@ -50,8 +50,7 @@ int APS5_VABI sceBluetoothHidSetOutputReport() { } int APS5_VABI sceBluetoothHidDebugGetVersion() { - NotImplemented_nid_no_patch(__func__); - return 0; + return 0x1e; } int APS5_VABI sceBluetoothHidDisconnectDevice() { diff --git a/core/libs/prx/libSceCompanionUtil/Export.cpp b/core/libs/prx/libSceCompanionUtil/Export.cpp index 791221033d..7a208122da 100644 --- a/core/libs/prx/libSceCompanionUtil/Export.cpp +++ b/core/libs/prx/libSceCompanionUtil/Export.cpp @@ -6,27 +6,22 @@ extern "C" { int APS5_VABI sceCompanionUtilGetEvent() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x80AD0008); } int APS5_VABI sceCompanionUtilGetRemoteOskEvent() { - NotImplemented_nid_no_patch(__func__); return 0; } int APS5_VABI sceCompanionUtilInitialize() { - NotImplemented_nid_no_patch(__func__); return 0; } int APS5_VABI sceCompanionUtilOptParamInitialize() { - NotImplemented_nid_no_patch(__func__); return 0; } int APS5_VABI sceCompanionUtilTerminate() { - NotImplemented_nid_no_patch(__func__); return 0; } diff --git a/core/libs/prx/libSceContentSearch/Export.cpp b/core/libs/prx/libSceContentSearch/Export.cpp index a0a7553444..2c9b8a5777 100644 --- a/core/libs/prx/libSceContentSearch/Export.cpp +++ b/core/libs/prx/libSceContentSearch/Export.cpp @@ -142,36 +142,28 @@ int APS5_VABI sceContentSearchTerm(void) { } int APS5_VABI sceContentBinderEnd() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderGetNumOfDifference() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderInitialize() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderIsUpdated() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderReset() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderSearchDifference() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderStart() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentBinderTerminate() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809D000F); } int APS5_VABI sceContentSearchGetApplicationLastUpdateId() { NotImplemented_nid_no_patch(__func__); diff --git a/core/libs/prx/libSceErrorDialog/Export.cpp b/core/libs/prx/libSceErrorDialog/Export.cpp index 4f17a4e50d..d3c922f2b1 100644 --- a/core/libs/prx/libSceErrorDialog/Export.cpp +++ b/core/libs/prx/libSceErrorDialog/Export.cpp @@ -21,6 +21,7 @@ constexpr int kErrOk = 0; constexpr int kErrNotInitialized = static_cast(0x80ED0001u); constexpr int kErrAlreadyInitialized = static_cast(0x80ED0002u); constexpr int kErrParam = static_cast(0x80ED0003u); +constexpr int kErrUnexpectedFatal = static_cast(0x80ED0004u); constexpr int kErrInvalidState = static_cast(0x80ED0005u); constexpr std::size_t kParamSize = 16; @@ -93,13 +94,11 @@ int APS5_VABI sceErrorDialogTerminate(void) { } int APS5_VABI sceErrorDialogOpenDetail() { - NotImplemented_nid_no_patch(__func__); - return 0; + return kErrUnexpectedFatal; } int APS5_VABI sceErrorDialogOpenWithReport() { - NotImplemented_nid_no_patch(__func__); - return 0; + return kErrUnexpectedFatal; } } diff --git a/core/libs/prx/libSceHttpCache/Export.cpp b/core/libs/prx/libSceHttpCache/Export.cpp index f76492fc41..5c78ba9644 100644 --- a/core/libs/prx/libSceHttpCache/Export.cpp +++ b/core/libs/prx/libSceHttpCache/Export.cpp @@ -96,7 +96,6 @@ int APS5_VABI sceHttpCacheSystemInit() { } int APS5_VABI sceHttpCacheSystemSendStatistics() { - NotImplemented_nid_no_patch(__func__); return 0; } @@ -106,7 +105,6 @@ int APS5_VABI sceHttpCacheSystemShutdown() { } int APS5_VABI sceHttpCacheSystemTerm() { - NotImplemented_nid_no_patch(__func__); return 0; } diff --git a/core/libs/prx/libSceImeDialog/Export.cpp b/core/libs/prx/libSceImeDialog/Export.cpp index 9eea28ac6d..9ae59933e2 100644 --- a/core/libs/prx/libSceImeDialog/Export.cpp +++ b/core/libs/prx/libSceImeDialog/Export.cpp @@ -21,6 +21,7 @@ constexpr int ErrorNotOpened = static_cast(0x80bc0002u); constexpr int ErrorInvalidMaxTextLength = static_cast(0x80bc0016u); constexpr int ErrorInvalidInputTextBuffer = static_cast(0x80bc0017u); constexpr int ErrorInvalidAddress = static_cast(0x80bc0031u); +constexpr int ErrorInternal = static_cast(0x80bc00ffu); struct Dialog { int status = StatusNone; @@ -176,8 +177,7 @@ int APS5_VABI sceImeDialogTerm(void) { } int APS5_VABI sceImeDialogForTestFunction() { - NotImplemented_nid_no_patch(__func__); - return 0; + return ErrorInternal; } int APS5_VABI sceImeDialogForceClose() { diff --git a/core/libs/prx/libSceMbus/PendingExports.cpp b/core/libs/prx/libSceMbus/PendingExports.cpp index c9296ae891..907eeb12c0 100644 --- a/core/libs/prx/libSceMbus/PendingExports.cpp +++ b/core/libs/prx/libSceMbus/PendingExports.cpp @@ -8,8 +8,7 @@ int APS5_VABI sceMbusAcquireControl() { } int APS5_VABI sceMbusAcquireControlList() { - NotImplemented_nid_no_patch(__func__); - return 0; + return static_cast(0x809B00FF); } int APS5_VABI sceMbusAcquireControlWithState() { @@ -558,7 +557,6 @@ int APS5_VABI sceMbusStopAudioOutSharePlay() { } int APS5_VABI sceMbusTerm() { - NotImplemented_nid_no_patch(__func__); return 0; } diff --git a/core/libs/prx/libSceMoveTracker/Export.cpp b/core/libs/prx/libSceMoveTracker/Export.cpp index 6c660b9787..8b2c497e09 100644 --- a/core/libs/prx/libSceMoveTracker/Export.cpp +++ b/core/libs/prx/libSceMoveTracker/Export.cpp @@ -41,8 +41,7 @@ int APS5_VABI sceMoveTrackerGetState() { } int APS5_VABI sceMoveTrackerGetVersion() { - NotImplemented_nid_no_patch(__func__); - return 0; + return 2; } int APS5_VABI sceMoveTrackerGetWorkingMemorySize() { @@ -86,7 +85,6 @@ int APS5_VABI sceMoveTrackerRecordStart() { } int APS5_VABI sceMoveTrackerRecordStop() { - NotImplemented_nid_no_patch(__func__); return 0; } diff --git a/core/libs/prx/libSceSystemGesture/Export.cpp b/core/libs/prx/libSceSystemGesture/Export.cpp index 516982e980..4d74061f67 100644 --- a/core/libs/prx/libSceSystemGesture/Export.cpp +++ b/core/libs/prx/libSceSystemGesture/Export.cpp @@ -311,8 +311,7 @@ int APS5_VABI sceSystemGestureUpdateTouchRecognizerRectangle(int32_t gesture_han } int APS5_VABI sceSystemGestureDebugGetVersion() { - NotImplemented_nid_no_patch(__func__); - return 0; + return 0x6a00; } } From ad12ca0066f5d52aebb3f8d232cc74dc4ded352e Mon Sep 17 00:00:00 2001 From: hypermist Date: Wed, 21 Oct 2026 20:03:59 +1300 Subject: [PATCH 2/2] test(libSceBluetoothHid): expect the firmware version from sceBluetoothHidDebugGetVersion The call now returns 0x1e as the firmware does instead of throwing, so guest_bluetooth_hid checks that value. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK --- core/libs/tests/GuestBluetoothHid.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/libs/tests/GuestBluetoothHid.cpp b/core/libs/tests/GuestBluetoothHid.cpp index 67b25d22c6..e118532944 100644 --- a/core/libs/tests/GuestBluetoothHid.cpp +++ b/core/libs/tests/GuestBluetoothHid.cpp @@ -56,13 +56,7 @@ int main() { threw = true; } Require(threw, "an input report without a device did not throw"); - threw = false; - try { - sceBluetoothHidDebugGetVersion(); - } catch (const std::runtime_error&) { - threw = true; - } - Require(threw, "debug get version did not throw"); + Require(sceBluetoothHidDebugGetVersion() == 0x1e, "debug get version did not return the firmware version"); threw = false; try { sceBluetoothHidGetDeviceInfo();