257 Commits

Author SHA1 Message Date
Sorgelig
07bce89a1c fix a warning. 2026-03-25 19:24:41 +08:00
tonytoon
b897349052 screenshot optimizations to remove stalls in inputs / cd based cores (#1126)
* increase allowed autofire rates from 5 to 30. add autofire_on_directions option to mister.ini (defaults to 0/off)

* simd rewrite of scaler memcopy

* optimize screenshots / scaler copies

* optimize screenshots; simd memcopy for scaler_read, add frame timer callback handler

* tweaks

* restore .png save functionality.

* screenshot optimizations

* fix double free, guard against NULL

* fixing merge

* add mister.ini for screenshot_image_format

* correct file extension handling.

* slightly tweak bmp routine

* consolide screenshot code back into scaler.cpp, remove custom resize/bmp code.
2026-03-24 14:55:00 +08:00
zakk4223
23e5f77988 input: Fix F12 and F12+modifier for OSD (#1129) 2026-03-19 14:05:15 +08:00
tonytoon
36af7f7b46 input: increase allowed autofire rates from 5 to 30. add autofire_on_directions option to mister.ini (defaults to 0/off) (#1120) 2026-03-16 01:17:54 +08:00
zakk4223
3380931329 input: advmap:use input_cb instead of user_io_kbd (#1112)
This allows HPS-side modifier keys to work properly
2026-03-09 23:14:08 +08:00
José Manuel Barroso Galindo
7a7bef3d06 Add video_mode FIFO command for CRT video mode switching (#1107)
* Add video_mode FIFO command for CRT video mode switching

- video.cpp: Add video_mode_cmd() that parses custom modelines and
  applies them via video_set_mode(), with hfreq safety check blocking
  modes outside 15625-16500Hz to protect 15kHz CRT monitors
- video.h: Declare video_mode_cmd()
- input.cpp: Dispatch "video_mode" commands from MiSTer_cmd FIFO
  to video_mode_cmd()

* Remove hfreq guard from video_mode_cmd

The horizontal frequency check was limiting the command to 15kHz modes only. Removing it allows custom modelines with any frequency to be applied. Software at the other end must take care of not calling this API with unsafe frequencies.
2026-03-04 14:39:07 +08:00
zakk4223
1bc3356df5 Extend Button/Key remap to support chording (#1063)
* Extend Button/Key remap to support chording

* Add saved autofire setting to 'advanced/chord' dialog
2026-03-02 13:42:55 +08:00
Tony Toon
5ea051dcea input: switch autofire to tracking frames per key (#1094) 2026-02-02 14:42:10 +08:00
Tony Toon
4d1a9fc2d3 input: autofire overhaul (#1091)
* frame-synchronized autofire, per-button rates, custom rates via mister.ini
* frame timer using core frame counter, fallback to timerfd
* improved button reference counting (previously limited to 2)
2026-01-22 13:07:44 +08:00
Bemjo
c46f248b58 input: Fixed QUIRK_WIIMOTE from being applied to Wii U Pro Controllers. (#1031) 2025-08-31 17:00:31 +08:00
Koston-0xDEADBEEF
5201df3b44 input: Optimise autofire handling (#970)
Rearrange autofire logic to avoid unnecessary clock_gettime() syscalls.
2025-02-20 16:07:49 +08:00
terminator2k2
6bca8265c1 input: Add Sinden Light Gun (#968) 2025-02-18 16:25:23 +08:00
That One Seong
e484d703f7 input: Add support for OpenFIRE lightguns (#964)
* Add OpenFIRE lightguns to guns whitelist

* Add preliminary OpenFIRE support

Guns are detected as light guns based on static VID and OpenFIRE name prefix, as the PID can be any number of different values depending on the user.

Because OpenFIRE guns can be polled through serial devices, a basic (read: hacky) heuristic is used to poll for serial port paths and send a signal to compatible guns to enable their MiSTer compatible mode.

* Tabbbbbs

* Directly open and write to file rather than rely on system echo
2025-02-05 21:07:13 +08:00
Martin Donlon
5f9b703ae0 Adds support for Retroshooter lightguns operating in mouse mode. (#955)
Gun sends a mix of keyboard presses, mouse button presses and EV_ABS position data.
Added a QUIRK_LIGHTGUN_MOUSE quirk which passes the mouse button presses through the input system like other EV_KEY events instead of using them for mouse updates. This allows the mouse buttons to be mapped like regular joystick or keyboard buttons.
Added the left mouse button as a keycode that is accepted by the lightgun calibration menu.
Assign player if mouse button is pressed.
2025-01-19 15:48:41 +08:00
oddx2k
6b9b65bbdf Update input.cpp (#945)
Add support for Blamcon Lightguns
2024-12-30 20:18:02 +08:00
Matheus Fraguas
a5a50c528a Support for Thrustmaster T300RS (#931)
Support for Thrustmaster T300RS Racing Wheel. Must be in PC/PS3 mode.
2024-11-18 13:33:41 +08:00
Matheus Fraguas
81dae66a70 Support for Thrustmaster Wheels (#918)
Added support for 2 Thrustmaster Wheels:
FGT Rumble 3-in-1
F430 Cockpit Wireless
Wheel must be in PC MODE.
2024-09-16 23:11:05 +08:00
deepthaw
03f62ded4c Change in handling overlapping button presses (fixes issue #824) (#907)
* Modifications to input handling to prevent held inputs from being
overridden by an alternate input mapped to the same button.
i.e. R-Type holding fire to charge special shot will not be
disrupted if a secondary fire button is pressed, autofire
or not.

* Modifications to input handling to prevent held inputs from being overridden by an alternate input mapped to the same button.
i.e. R-Type holding fire to charge special shot will not be
disrupted if a secondary fire button is pressed, autofire
or not.

* Prevent held inputs from being disrupted by alternate inputs.

i.e. in R-Type, if holding the fire button to charge a special shot,
tapping an alternately assigned fire button will not cause the charge
to stop.
2024-06-30 15:02:49 +08:00
zakk4223
30e53d381b Set rumble direction to x-axis on wheel devices. (#906)
(Rumble has no direction, but many drivers convert this to a FF_SINE)
2024-06-26 13:55:10 +08:00
deepthaw
92441b319e adding approximate autofire rate in hz to OSD display (#905) 2024-06-24 12:56:51 +08:00
Sorgelig
1850ec3a5d Revert some changes. 2024-01-18 01:03:18 +08:00
Rikard Bengtsson
09e2f4fd03 Fix bug in dead zone code affecting DS3/DS4 (#866)
A small bug was introduced with the new dead zone code that made it ignore "quirks" regarding DS3/DS4. These devices should automatically be given a dead zone of 10, as it was before.
2024-01-15 13:00:13 +08:00
Matheus Fraguas
490c99dd6f Retrozord pid (#860)
* RetroZord VID:PID

Added the VID;PID to make_unique, and to the two special input modes.
Removed the Arduino Leonardo specific PID, leaving only he main arduino VID. So any DIY adapter using an arduino will work.

* Use UNIQ field on RetroZord Adapter
2023-12-09 22:12:53 +08:00
Rikard Bengtsson
542b6f4d73 Added dead zone configuration (#857)
User can define dead zone by device identifier and a radius.
2023-12-01 17:51:05 +08:00
trbocode
78edf5f58c Added controller handling for new N64 options (#838)
* Added controller handling for new N64 options

* Move to N64 folder and add per stick ranges

* Improve latency
2023-10-16 07:08:44 +08:00
Patrick Pollock
22834acc98 Scale N64 analog optimally for different gate shapes (#834)
* Scale N64 analog optimally wrt gate shapes

* Limit max_range to near diagonals

* Make magic numbers adjustable constants
2023-10-11 03:05:52 +08:00
Marcoen Hirschberg
d53a998eac N64 joystick emulation (#828)
* input.cpp: pass dev nr to joy_analog

This allows for per-controller behavior

* N64: add emulation for the analog joystick

This applies the reduced-range octagonal gate of the N64 analog stick to
regular analog sticks.

The code was mostly written by Patrick Pollock with small optimizations
by Martin Donlon and myself.
2023-09-24 17:22:02 +08:00
Sorgelig
a1c64c955c input: fix mapping. 2023-09-12 04:04:37 +08:00
Sorgelig
ce9daf6de9 input: make keyboard remap system-wide. 2023-09-12 02:55:36 +08:00
Sorgelig
f1cdcd5c46 input: improve keyboard remap dialog. 2023-09-10 14:41:00 +08:00
Sorgelig
1d36e3472f input: fix broken button skip in buttons definition. 2023-09-10 00:16:46 +08:00
Sorgelig
3bfadb39e8 input: make button/key remap permanent. 2023-09-07 22:09:54 +08:00
Javier Rodas
4236d70433 Add a second JAMMA quirk to support 4-player JAMMA-VERSUS with two JammaSD/J-PAC (or similar USB JAMMA) controller interfaces. (#811) 2023-09-05 05:44:00 +08:00
Martin Donlon
cdec51b121 Add two-player and per-controller type mapping support for the Reflex Adapt USB adaptor. Similar to other arduino leonardo based devices. (#803) 2023-08-17 02:07:36 +08:00
Dominic Evans
ab7fad101c input: support Thrustmaster Force Feedback Wheel (#801)
- add Thrustmaster Guillemot Force Feedback Racing Wheel (06f8:0004)
  case to setup_wheel for axis 8 (wheel), 9 (accel) and 10 (brake) with
  FF_AUTOCENTER support. This wheel uses the built-in `iforce` kernel
  module
- prevent input_cb from skipping axis 7 and 8 (previously assumed to be
  both paddle axis) if QUIRK_WHEEL is set on the device
- add wh_pedal_invert field to indicate that the pedal range needs to be
  inverted after normalization as the device input goes from minimum (0)
  offset to maximum (255) offset on pedal depression rather than maximum
  to minimum (like the existing supported wheels)
- comment the existing wh_ fields in setup_wheel to indicate their
  function

Fixes #799

Co-authored-by: Dominic Evans <oldmanuk@gmail.com>
2023-08-16 20:49:39 +08:00
Sorgelig
d5f41db979 input: support for multiple input devices mapping per player. 2023-05-28 21:41:58 +08:00
Sorgelig
872b433ed5 input: add selective unique mapping. 2023-05-22 20:18:24 +08:00
Sorgelig
a43d1a58c8 input: add vidpid as a clear text in unique mapping. 2023-05-21 16:05:39 +08:00
Sorgelig
51470c27cc input: remove sysfs from unique mapping. 2023-05-21 06:25:24 +08:00
Sorgelig
d6eefdcbdc input: make unique mapping per port. 2023-05-21 02:28:34 +08:00
Alexey Melnikov
0ebf137532 input: Controller unique mapping (preliminary)
Add ini option `unique_mapping` which makes controller mappings unique to the physical port the controller is connected to.
Calculates a uint32_t unique_hash for each device during enumeration.

Co-authored-by: Martin Donlon <github-martin@donlons.com>
2023-05-21 02:14:27 +08:00
Matheus Fraguas
0c03e569a8 Support to use mouse wheel as spinner. (#744) 2023-02-22 04:13:20 +08:00
Sorgelig
2d40444af0 ini option to disable autofire. 2022-11-28 20:46:42 +08:00
Sorgelig
7913771888 input: add pageup/pagedown buttons to controller in linux console. 2022-11-11 19:37:42 +08:00
Sorgelig
19594babaf input: permanent controller assignment now searches in Sysfs as well. 2022-11-01 02:05:27 +08:00
Sorgelig
631276d59d Add MiSTer_cmd command: volume mute/unmute/0-7. 2022-10-31 23:05:20 +08:00
Sorgelig
6bda023db8 Add INI option for permanent controller assignment to specific player. 2022-10-31 19:53:50 +08:00
zakk4223
b1d6ee2f52 Support "guide2" in gamecontrollerdb for OSD button chords. Support the +/- analog axis notation for mapping analog to digital buttons (#692)
Co-authored-by: Zakk <zakk@rsdio.com>
2022-09-09 18:39:24 +08:00
zakk4223
e28c6616b6 input: Use sub_dev to find controller db entries: fixes some multifunctional devices (#689)
Co-authored-by: Zakk <zakk@rsdio.com>
2022-08-30 14:07:23 +08:00
zakk4223
5b4acd3c7b input: add support for sdl gamecontrollerdb to setup default mappings for controllers
* Add support for sdl style gamecontrollerdb to setup default mappings for controllers

* Do not cache game controller entries, find them dynamically in the file when needed

Co-authored-by: Zakk <zakk@rsdio.com>
2022-08-22 21:46:16 +08:00