diff --git a/core/libs/prx/libSceMove/Export.cpp b/core/libs/prx/libSceMove/Export.cpp index 3df5bcf873..fbec093672 100644 --- a/core/libs/prx/libSceMove/Export.cpp +++ b/core/libs/prx/libSceMove/Export.cpp @@ -14,6 +14,7 @@ constexpr int MOVE_ERROR_NOT_INIT = static_cast(0x80EE0001); constexpr int MOVE_ERROR_ALREADY_INIT = static_cast(0x80EE0002); constexpr int MOVE_ERROR_INVALID_ARG = static_cast(0x80EE0003); constexpr int MOVE_ERROR_INVALID_HANDLE = static_cast(0x80EE0004); +constexpr int MOVE_ERROR_ALREADY_OPENED = static_cast(0x80EE0007); constexpr int32_t MOVE_FIRST_HANDLE = 0x30B0100; constexpr int32_t MOVE_HANDLE_STEP = 0x100; @@ -57,7 +58,7 @@ int APS5_VABI sceMoveOpen(int32_t userId, int32_t type, int32_t index) { if (!initialized) return MOVE_ERROR_NOT_INIT; if (userId != USER_SERVICE_INITIAL_USER_ID) NotImplemented_nid_no_patch(__func__); for (const auto& [openHandle, slot] : openHandles) { - if (slot.type == type && slot.index == index) NotImplemented_nid_no_patch(__func__); + if (slot.type == type && slot.index == index) return MOVE_ERROR_ALREADY_OPENED; } const int32_t handle = nextHandle; nextHandle += MOVE_HANDLE_STEP; diff --git a/core/libs/tests/GuestMove.cpp b/core/libs/tests/GuestMove.cpp index dff61dbc68..b114030e35 100644 --- a/core/libs/tests/GuestMove.cpp +++ b/core/libs/tests/GuestMove.cpp @@ -28,6 +28,7 @@ constexpr int kNotInit = static_cast(0x80EE0001); constexpr int kAlreadyInit = static_cast(0x80EE0002); constexpr int kInvalidArg = static_cast(0x80EE0003); constexpr int kInvalidHandle = static_cast(0x80EE0004); +constexpr int kAlreadyOpened = static_cast(0x80EE0007); constexpr std::int32_t kUserId = 0x10000000; constexpr std::int32_t kFirstHandle = 0x30B0100; constexpr std::int32_t kHandleStep = 0x100; @@ -104,7 +105,8 @@ int main() { const std::int32_t second = sceMoveOpen(kUserId, 0, 1); Require(first == kFirstHandle); Require(second == kFirstHandle + kHandleStep); - Require(Throws([] { sceMoveOpen(kUserId, 0, 0); })); + Require(sceMoveOpen(kUserId, 0, 0) == kAlreadyOpened); + Require(sceMoveOpen(kUserId, 0, 1) == kAlreadyOpened); Require(Throws([] { sceMoveOpen(kUserId + 1, 0, 2); })); Require(sceMoveGetDeviceInfo(first, nullptr) == kInvalidArg);