input: read only the requested port on NAOMI/Atomiswave

UpdateInputState(port) ignored its argument for NAOMI/Atomiswave and updated
all four ports on every call. CaptureInput() already loops the ports and calls
UpdateInputState once per port, so every frame read each NAOMI port four times
-- 16 UpdateInputStateNaomi passes instead of 4, each issuing the frontend
input_cb calls for lightgun/analog axes (which are not covered by the joypad
bitmask). The non-threaded live path (maple GetInput/GetMouse) was worse: it
re-read all four ports on every per-device maple poll.

Honor the port argument so each call updates one port. CaptureInput still
covers all ports via its loop, and the maple path samples exactly the device
being polled. The Dreamcast path was already correct and is untouched;
per-button joypad reads already use RETRO_DEVICE_ID_JOYPAD_MASK when the
frontend supports bitmasks, reading the mask once and decoding all buttons
from it.

Verified: builds clean; Dreamcast content unaffected (VF3tb 300 frames).
This commit is contained in:
libretroadmin authored and libretroadmin committed 2026-07-04 20:12:24 +02:00
1 parent cbaecdbcf6
commit a129477ccb
1 file changed
+5 -4
+5 -4
View File
@@ -2939,10 +2939,11 @@ void UpdateInputState(u32 port)
if (settings.System == DC_PLATFORM_NAOMI || settings.System == DC_PLATFORM_ATOMISWAVE)
{
UpdateInputStateNaomi(0);
UpdateInputStateNaomi(1);
UpdateInputStateNaomi(2);
UpdateInputStateNaomi(3);
/* Update only this port. CaptureInput already iterates all ports; the
* previous code updated all four on every call, so a 4-port loop read
* each NAOMI/Atomiswave port -- and hit the frontend's input_cb for every
* lightgun/analog axis -- 4 times per frame. */
UpdateInputStateNaomi(port);
return;
}
if (rumble.set_rumble_state != NULL && vib_stop_time[port] > 0)