From ea943088e5b1b6de0d37468c8c7d64e170219b40 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Mon, 2 Jun 2025 18:00:40 +0100 Subject: [PATCH] usbds only set zlt on write --- sphaira/source/usb/usbds.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sphaira/source/usb/usbds.cpp b/sphaira/source/usb/usbds.cpp index 5427ec3..13aff7e 100644 --- a/sphaira/source/usb/usbds.cpp +++ b/sphaira/source/usb/usbds.cpp @@ -293,11 +293,13 @@ Result UsbDs::WaitTransferCompletion(UsbSessionEndpoint ep, u64 timeout) { } Result UsbDs::TransferAsync(UsbSessionEndpoint ep, void *buffer, u32 remaining, u32 size, u32 *out_urb_id) { - if (remaining == size && !(size % (u32)m_max_packet_size)) { - log_write("[USBDS] SetZlt(true)\n"); - R_TRY(usbDsEndpoint_SetZlt(m_endpoints[ep], true)); - } else { - R_TRY(usbDsEndpoint_SetZlt(m_endpoints[ep], false)); + if (ep == UsbSessionEndpoint_In) { + if (remaining == size && !(size % (u32)m_max_packet_size)) { + log_write("[USBDS] SetZlt(true)\n"); + R_TRY(usbDsEndpoint_SetZlt(m_endpoints[ep], true)); + } else { + R_TRY(usbDsEndpoint_SetZlt(m_endpoints[ep], false)); + } } return usbDsEndpoint_PostBufferAsync(m_endpoints[ep], buffer, size, out_urb_id);