From b274a054a919b5edbe8ca2d8391023e2b99ac0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 2 May 2019 18:31:32 +0200 Subject: [PATCH] IOS/VEN: Read cancel endpoint correctly Fixes an embarrassing bug that made the implementation utterly useless. This fixes Your Shape hanging on shutdown. The game was waiting for an interrupt transfer to be cancelled, and Dolphin wasn't cancelling transfers on the correct endpoint. --- Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp b/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp index e969417839..008ab464b3 100644 --- a/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp +++ b/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp @@ -104,7 +104,7 @@ s32 USB_VEN::SubmitTransfer(USB::Device& device, const IOCtlVRequest& ioctlv) IPCCommandResult USB_VEN::CancelEndpoint(USBV5Device& device, const IOCtlRequest& request) { - const u8 endpoint = static_cast(Memory::Read_U32(request.buffer_in + 8)); + const u8 endpoint = Memory::Read_U8(request.buffer_in + 8); // IPC_EINVAL (-4) is returned when no transfer was cancelled. if (GetDeviceById(device.host_id)->CancelTransfer(endpoint) < 0) return GetDefaultReply(IPC_EINVAL);