From b251d81065d8b8903afe8db8cfc643a803efe456 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 26 Jun 2024 22:11:58 +0200 Subject: [PATCH] input: fix minimum turntable input DJ Hero does not register input if the turntable is 0, so force it to 1. This will happen if you map it to the left stick and push it all the way down, or if you use a keyboard, which sends the max value on key press. --- rpcs3/Emu/Io/Turntable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Io/Turntable.cpp b/rpcs3/Emu/Io/Turntable.cpp index 07908fd784..af5648d40b 100644 --- a/rpcs3/Emu/Io/Turntable.cpp +++ b/rpcs3/Emu/Io/Turntable.cpp @@ -264,7 +264,8 @@ void usb_device_turntable::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpo buf[1] |= 0x01; // Select break; case turntable_btn::right_turntable: - buf[6] = 255 - value; // Right Turntable + // DJ Hero does not register input if the turntable is 0, so force it to 1. + buf[6] = std::max(1, 255 - value); // Right Turntable // DJ Hero requires turntables to be centered at 128. // If this axis ends up centered at 127, force it to 128. if (buf[6] == 127)