From d2fa215aa90404e09e55909c1196d1d3bcdff424 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Thu, 5 Nov 2020 22:03:03 +0100 Subject: [PATCH] USB: fix singstar & tangling if/comments --- pcsx2/USB/qemu-usb/usb-ohci.cpp | 1 - pcsx2/USB/usb-mic/audiodev-pulse.cpp | 10 ---------- pcsx2/USB/usb-mic/audiodev-wasapi.cpp | 2 -- pcsx2/USB/usb-pad/evdev/evdev-ff.cpp | 2 ++ 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pcsx2/USB/qemu-usb/usb-ohci.cpp b/pcsx2/USB/qemu-usb/usb-ohci.cpp index da4bec8e65..6ed34fb0f8 100644 --- a/pcsx2/USB/qemu-usb/usb-ohci.cpp +++ b/pcsx2/USB/qemu-usb/usb-ohci.cpp @@ -1186,7 +1186,6 @@ void ohci_frame_boundary(void* opaque) /* if reset bit was set, don't process possibly invalid descriptors */ /* TODO intr_status is interrupts that driver wants, so not quite right to us it here */ bool hack = false; // ohci->intr_status & ohci->intr & OHCI_INTR_RHSC; - if (hack) /* Process all the lists at the end of the frame */ if ((ohci->ctl & OHCI_CTL_PLE) && !hack) diff --git a/pcsx2/USB/usb-mic/audiodev-pulse.cpp b/pcsx2/USB/usb-mic/audiodev-pulse.cpp index fa586e3b5c..1885b896bb 100644 --- a/pcsx2/USB/usb-mic/audiodev-pulse.cpp +++ b/pcsx2/USB/usb-mic/audiodev-pulse.cpp @@ -747,8 +747,6 @@ namespace usb_mic return; } - if (padev->mInBuffer.capacity() < nbytes) - padev->mInBuffer.write((uint8_t*)padata, nbytes); //if copy succeeded, drop samples at pulse's side @@ -783,14 +781,6 @@ namespace usb_mic break; //TODO happens? padev->mInBuffer.read(samples); } - - /* - nbytes, - nbytes / sizeof(float) / padev->GetChannels(), - input_frames_used, - padev->mInBuffer.peek_read(), - output_frames_gen);*/ - std::lock_guard lock(padev->mMutex); size_t output_samples = output_frames_gen * padev->GetChannels(); diff --git a/pcsx2/USB/usb-mic/audiodev-wasapi.cpp b/pcsx2/USB/usb-mic/audiodev-wasapi.cpp index ea4e58d5b8..fe772ea94e 100644 --- a/pcsx2/USB/usb-mic/audiodev-wasapi.cpp +++ b/pcsx2/USB/usb-mic/audiodev-wasapi.cpp @@ -76,8 +76,6 @@ namespace usb_mic LARGE_INTEGER currentTime; QueryPerformanceCounter(¤tTime); - if (currentTime.QuadPart < lastQPCTime) - lastQPCTime = currentTime.QuadPart; double timeVal = double(currentTime.QuadPart); diff --git a/pcsx2/USB/usb-pad/evdev/evdev-ff.cpp b/pcsx2/USB/usb-pad/evdev/evdev-ff.cpp index 47231b794d..aaeb84bad5 100644 --- a/pcsx2/USB/usb-pad/evdev/evdev-ff.cpp +++ b/pcsx2/USB/usb-pad/evdev/evdev-ff.cpp @@ -274,6 +274,7 @@ namespace usb_pad ie.code = FF_AUTOCENTER; ie.value = value * 0xFFFFUL / 100; + write(mHandle, &ie, sizeof(ie)); } void EvdevFF::SetGain(int gain /* between 0 and 100 */) @@ -284,6 +285,7 @@ namespace usb_pad ie.code = FF_GAIN; ie.value = 0xFFFFUL * gain / 100; + write(mHandle, &ie, sizeof(ie)); } } // namespace evdev