Commit Graph

726 Commits

Author SHA1 Message Date
Joseph C. Osborn 6104a9ad86 change some replay file seeks to seek+truncates in record mode 2024-06-18 13:13:59 -05:00
libretroadmin 54a24dc9d5 input_config_get_bind_string - do proper character
counting now, avoid strlcats, and have functions return
size_t value indicating how many chars were written
2024-06-16 18:07:30 +02:00
libretroadmin 3e2e53ba7f snprintf - if no formatting is required then use strlcpy 2024-06-13 06:48:50 +02:00
zoltanvb 28189a04a4
Analog button and keyboard tester. (#16390)
Added analog button indication for those buttons that may have use for it
- primarily L2/R2, but support was added for all buttons where at least
one controller is known to support it. Added also core option to hide
mismatching inputs where analog value is not sent (like keyboard
hotkeys assigned to retropad buttons). Analog button inputs are not
set up for remote transmission, only for local test.

Analog axes have now also dynamic coloring.

Added a keyboard tester screen which includes a standard 102-key PC
keyboard + extra blocks for all RETROK_ values present in the code.
Screen adapted from DOSBox-Pure onscreen keyboard with permission.
Keyboard button A+B switches between the two screens. Keyboard
inputs are not set up for remote transmission, only for local test.
Core option added to select start screen.

Other small improvements: core reset will take new option values,
input driver applies received values more carefully.
2024-05-04 00:33:25 -07:00
Barry Rowe 26a824caff
Revert of AI service changes (#16428) 2024-04-12 16:17:24 -07:00
zoltanvb b27233b3b8
Test input joypad driver (#16370)
* Test driver for joypad inputs

Add a new joypad input driver:
- hide driver behind #ifdef and enable it in config_params.sh
- add a new config parameter to specify the test input file
- add aux files: additional config files that cancel out any binds
  that may be present in RA config, autoconfig profile for
  test joypads, test input file that matches controller test
  sequence

* Fixes and comments for test input driver.
2024-03-18 12:07:36 -07:00
neil4 5306da72ce
Minor updates to Overlay Mouse and Lightgun (#16366) 2024-03-17 09:40:50 -07:00
neil4 cc97df732c
Add Overlay Mouse, Lightgun, and Pointer (#16343)
- When enabled, any touch inputs not in a hitbox are used to create pointing device input for the core.
- Mouse: 1-, 2-, 3-touch inputs are LMB, RMB, and MMB
- Lightgun: allows input from overlay buttons or multi-touch mappings
2024-03-16 01:56:30 -07:00
Bobby Smith e1cc4fb14d
Add a new "Classic (Toggle)" turbo mode (#16239) 2024-02-18 08:24:05 -08:00
sonninnos 6e6a4d8b6d
RETROK_UNKNOWN fixes and cleanups (#16250) 2024-02-18 08:23:05 -08:00
sonninnos e8956418a8
Fix input state combos and empty binds (#16233) 2024-02-13 16:16:39 -08:00
Viačasłaŭ Chalikin 997c7453a8
Fix narrator modes (#16179)
* Fix narrator

* Refactor accessibility
2024-02-08 21:14:23 -08:00
Bobby Smith 7c3d07bf6d
Tweaks to how the "Analog to Digital Type" setting is saved (#16187) 2024-02-02 12:53:24 -08:00
sonninnos 8ad8b6bdad
Input state overflow band-aid (#16168) 2024-01-26 09:44:48 -08:00
sonninnos 8f77938767
Fix ghost input when setting RETROK_UNKNOWN (#16163) 2024-01-25 02:46:48 -08:00
sonninnos 266d3ed150
Add option for merging 'Hotkey Enable' device types (#16152) 2024-01-21 18:13:17 -08:00
Eric Warmenhoven e6eadecabd
Disable mFI secondary_joypad behavior (#16129)
Some controllers show up as both HID and mFI. In that case we probably
want to let the user pick which driver to use, rather than balance
across them.

This fixes issues with the analog stick moving in the wrong direction
on the y axis.
2024-01-18 09:33:16 -08:00
hunterk 6513a023b8
Add a setting to allow turbo d-pad directions (#16006)
* Add option to allow turbo d-pad inputs

* fix macro tab and update comment
2023-12-13 18:36:09 -08:00
Joe Osborn 2baf9ec7e0
Enqueue replay record/playback until next frame (#15751)
* Enqueue replay record/playback until next frame

This fixes a bug where stdin commands activated via polling would
trigger replay record/playback in the middle of a frame, then input
checking would pull from them before the next frame came around---it
only makes sense to change the active replay in between frames, not
during them.

* fix comment syntax
2023-10-04 00:53:51 -07:00
sonninnos ea86be0a2b
Fix menu analog stick navigation (#15740) 2023-09-26 05:30:15 -07:00
sonninnos cf2ee94c9f
Correction for not showing mouse cursor with overlay (#15687) 2023-09-11 17:28:33 -07:00
sonninnos ea1bdade61
Allow more keyboard actions with menu osk (#15662) 2023-09-01 15:48:55 -07:00
libretroadmin c82401dcb4 input_device_info - slim down - we don't need config_path and some of
the char arrays can be much smaller
2023-08-30 08:34:21 +02:00
sonninnos c708187cd2
Search box usability improvements (#15617) 2023-08-18 12:38:29 -07:00
libretroadmin e5ef309b58 get_bind_string_joyaxis - small simplification 2023-08-16 20:29:40 +02:00
libretroadmin d6ae25d980 Don't add to len variable if not used 2023-08-16 20:26:15 +02:00
sonninnos de45fc2f5f
Input binding rework (#15603)
* Input binding rework

* Controller info logging cleanup
2023-08-16 11:13:14 -07:00
libretroadmin f51b49f213 More explicit typecasts to bools 2023-08-16 03:22:02 +02:00
libretroadmin bd7a0f7f0a Explicit typecast to bool for some flag to bool conversions 2023-08-16 00:16:03 +02:00
libretroadmin c8e6506687 Fix --disable-menu errors 2023-08-14 23:36:19 +02:00
neil4 fbd8498686
Overlays: Apply range_mod only for the touch inputs that trigger it (#15534) 2023-07-30 09:49:59 +02:00
libretroadmin aeff636a0f Minor cleanups to config_file.c 2023-07-17 09:45:52 +02:00
libretroadmin 98ee9a753c Cut down on some implicit strlens 2023-07-15 09:10:16 +02:00
sonninnos ab4debec01 All Users Control Menu fixes 2023-07-15 06:28:51 +02:00
Eric Warmenhoven e943ea71e7 Fix #15459 - add HAVE_STDIN_CMD to macos 2023-07-09 09:31:08 +02:00
nfore bf0de45ec4 Build fix 2023-07-09 09:30:48 +02:00
nfore 9ca5c5e623 Revive/rewrite Keyboard Overlay and OSK Toggle
Add keyboard overlay preset, keyboard submenu, and osk_toggle hotkey. Use overlay caching for osk_toggle.

For now, keyboard menu has only preset path, auto-scale toggle, and opacity.

Related fixes:
- input_keyboard_event: Don't check hotkey binds when device is RETRO_DEVICE_POINTER
- Add input_keymaps_translate_rk_to_ascii() for correct character input to input_keyboard_event
- input_overlay_poll: Delay clearing INPUT_OVERLAY_BLOCKED flag until there is no overlay input (Avoids stray input after osk_toggle)
- Send keyboard events for modifiers before other keys (for correct modifier+key input if hitboxes overlap)
2023-07-09 04:42:49 +02:00
nfore 8a81d39437 Overlay Caching
Adds overlay_cache_ptr to keep a disabled overlay in memory when it's expected to be shown again.

Most input_overlay_deinit calls are replaced with input_overlay_unload, which caches the overlay unless initing/deiniting core or disabling overlays.

Loading a cached overlay is done as a swap, intended for osk_toggle.

Related updates:
- Fewer parameters for the overlay loading task. Use current settings when enabling an overlay
- Add input_overlay_check_mouse_cursor() to preserve show/hide mouse behavior
- Don't apply input_overlay_show_mouse_cursor in windowed mode (controlled by mouse grab only)
- Remove some dead code
2023-07-09 04:42:49 +02:00
sonninnos 7922e45607 Combo hold + 'enable_hotkey' correction 2023-07-01 20:12:13 +02:00
libretroadmin 22dc6aff5a Rework some snprintf/strlcat calls 2023-06-21 09:25:04 +02:00
libretroadmin bdc398d79f - Safer code - use strlcpy where possible instead of manual character
assignments for strings longer than 2 chars
- Use strlcpy concatenation instead of strlcat
- Make sure that what remains of iteration of the '_len' variable
for manual char assignment
is done in a safer way so mistakes are less possible
2023-06-20 16:33:55 +02:00
libretroadmin 97deec44f4 Remove unused variable warning 2023-06-18 13:55:39 +02:00
sonninnos 8a862bf20e
Keyboard mapping bit fix (#15392) 2023-06-18 08:09:34 +02:00
libretroadmin fc06e2f84f Simplify core_serialize_size and core_serialize_size_special 2023-06-16 17:20:27 +02:00
libretroadmin 410242c164 (input_driver.c) Don't keep regrabbing the same pointers in input_state_internal function 2023-06-15 14:26:41 +02:00
libretroadmin 426ba5382c C89 buildfix and other small cleanup 2023-06-15 01:58:23 +02:00
libretroadmin 975d613fbb (input_driver.c) Small cleanups - input_driver_state_internal
return type is int16_t so don't use float value for analog_x/analog_y
variables
2023-06-15 01:52:24 +02:00
libretroadmin 246cceeb27 Silence more signedness warnings 2023-06-14 19:51:31 +02:00
Grisly Glee 4202f8650d
Fix trivial signedness warnings (#15377)
* Fix trivial signedness warnings

* Followup on trivial signedness warnings
2023-06-14 04:43:11 +02:00
libretroadmin f66a8dc538 Cleanup unused variable warnings 2023-06-01 22:34:16 +02:00
libretroadmin c0ba738f0d Header uniformity - enums on top, then structs, then public declarations 2023-05-30 21:03:36 +02:00
libretroadmin c24744eae5 Remove video_driver_show_mouse/hide_mouse 2023-05-29 18:58:23 +02:00
libretroadmin 07cb5f4e98 Remove MENU_ENTRIES_CTL_SET_REFRESH 2023-05-11 01:58:30 +02:00
sonninnos 47d71646c9 Add menu scroll home+end actions 2023-05-08 15:25:51 +02:00
libretroadmin 099f33e0b3 (Menu) Simplifications 2023-05-06 22:10:55 +02:00
libretroadmin c087b044c2 * Add TODO/FIXME localize notes
* More snprintf optimizations
2023-04-30 19:30:07 +02:00
sonninnos ad079538a4
Fix menu toggle combo hold with same 'enable_hotkey' (#15226) 2023-04-26 01:54:44 +02:00
warmenhoven 54055558f1
Fix several warnings (#15153) 2023-04-04 15:06:34 +01:00
Valentin b0b5a40d44
add overlay parameter to control x/y separation in auto-scale mode (#15106) 2023-03-31 01:33:39 +01:00
zoltanvb c996fe7070
Add wayland to input driver list. (#15133)
Wayland input driver was not selectable from menu. It could still be enforced by
context driver, or enabled in config file, but I saw no reason why it would be
better to skip it from here.
2023-03-25 22:42:03 +01:00
libretroadmin 2902d11b1a Rewinding code should not be a forced built-in dependency 2023-03-17 16:08:41 +01:00
sonninnos 92dfc80327
Check for 'enable_hotkey' also from autoconf binds (#15095) 2023-03-14 18:16:53 +01:00
libretroadmin 5c51232731 Style nit 2023-03-13 02:23:52 +01:00
libretroadmin 60dc768f78 (Replay/BSV) Fix issue #15083, and some other style nits 2023-03-13 01:34:27 +01:00
Joe Osborn be5b198692
Replay rewind fix (#15079)
* Rewind during recording isn't visibly busted anymore but it doesn't rewind the replay properly during playback or record, inputs get clobbered; check frame pos/ptr stuff.

* Fix rewinding during movie recording and playback?
2023-03-11 18:37:48 +01:00
Joe Osborn 81b3e128ac
Add checkpointing feature for replay recordings. (#15072)
If cores are not deterministic, or if they only have bounded
determinism, we can obtain less drift if replay files also contain
periodic checkpoint states.  These are configured by the new retroarch
stting replay_checkpoint_interval (measured in seconds).  States are
inserted into the replay file in between frames.

This patch also fixes the settings display for the replay
autoincrement max keep setting.
2023-03-09 23:14:02 +01:00
Joe Osborn 807640fed3
Associate states with replays (#15070)
* change bsv file suffix to replay, update strings

* add trivial RPLY block to save states

* WIP rerecording support, doesn't load states properly yet--issue with checking identifiers?

* Fixed a type error to get time identifiers working right, ready for testing

* handle case where state without replay data is loaded during replay

* cleanups

* whitespace cleanup

* Cleanups, change replay file format magic, fix logic around future states

* Remove failed future message

* Add play-replay-from-slot command, fix load-state-from-slot to use given slot

* build fixes

* Fix race conditions in emscripten build and incorrect replay state incrementing

* Style fix for single line if

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-08 00:10:59 +01:00
Joe Osborn 4d81f70f00
Replay nomenclature (#15054)
* change bsv file suffix to replay, update strings

* Fix bsv cli args

* Fix help whitespace

* Fix another message

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-03 23:16:48 +01:00
libretroadmin 7ebab640d7 Cleanups/style nits 2023-02-23 13:15:14 +01:00
Joe Osborn 155e99b92c
add keyboard recording support to bsv (#14933)
* add keyboard recording support to bsv

BSV movies recorded in older RA *WILL NOT* replay properly after this
patch.  While looking to see if the core actually uses a keyboard
device could mitigate this, it is an unavoidable consequence of using
BSV, a format which carries no metadata whatsoever.

* Fix for loop declarations and some whitespace

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-02-01 00:22:00 +01:00
Joe Osborn 5dbdde4316
BSV ergonomics improvements (#14929)
* BSV ergonomics improvements

- Date stamp toggled recordings instead of overwriting or using save
slot number
- Properly stop movie on playback EOF; also pause emulation
- Add recording flag to match playback flag in bsv state enum
- Rename bsv "movie path" to "movie auto path" to clarify role
- Allow stopping movie playback before EOF using record toggle hotkey
---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-31 05:34:26 +01:00
sonninnos a055bcd16b
Do not block input overlay hotkeys (#14923) 2023-01-29 14:52:03 +01:00
Joe Osborn f149519351
Allow for both -e and -R to start a BSV file recording at a state (#14898)
* Allow for both -e and -R to start a BSV file recording at a state

The key issue is that loading a state takes some time, and the BSV
recording shouldn't start until that's done.

The minimal patch for this would just be a change to runloop.c which
moves movie initialization after entry state loading, throwing in a
task_queue_wait().  This makes for some awkward repeated autoload OSD
messages and doesn't solve the underlying issue.

Most of this change puts BSV recording start/stop into tasks, like
saving and loading are tasks; this was important to centralize BSV
operations a bit more and is the first part of a refactoring towards
more robust input recording.  The necessary wait is introduced in the
begin-recording callback.

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-25 07:15:32 +01:00
libretroadmin a8c43daef6 Addendum - no additional whitespace - already done beforehand 2023-01-22 17:35:49 +01:00
libretroadmin 610194e805 input_config_get_bind_string_hotkey - snprintf concatenation
so we don't repeat the same formatting for every switch case
statement
2023-01-22 17:34:12 +01:00
Joe Osborn baa14ae213
Fix #14870 (#14871)
* Don't start video recording when BSV recording starts

* Don't double-record inputs in BSV recording

- Will this work properly with the part of input handling outside of
input_state_wrap? Who knows?

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-20 18:20:10 +01:00
sonninnos b8bcce98c3
(WIN32) Restore zero key event characters (#14848) 2023-01-15 09:00:47 +01:00
reallibretroadmin 3b6aef23e1 Silence 'value stored to variable is never read' warning 2023-01-13 16:18:20 +01:00
sonninnos 2f1a03523b
Hotkey blocking correction (#14831) 2023-01-13 04:56:14 +01:00
libretroadmin daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00
reallibretroadmin adee2dbe72 * Use strlcat instead of strcat
* Silence implicit conversion warnings detected in Xcode
2023-01-07 07:12:25 +01:00
libretroadmin b59a13771c Move input LUT table to input_driver.h 2023-01-05 19:30:51 +01:00
sonninnos 883e88fa73
Keyboard event blocking corrections (#14728) 2022-12-18 18:36:24 +01:00
sonninnos 5024809c85
Device Index menu refactor (#14691) 2022-12-02 17:47:53 +01:00
LibretroAdmin c75af6194b
Extended IME and Korean OSK (#14676) 2022-11-29 04:45:55 +01:00
libretroadmin f062b74e26 Overlays/Input: Turn a bunch more functions static 2022-11-23 19:54:15 +01:00
libretroadmin 0cf1d86a3a (input_driver.c) Turn bunch of functions static that are never accessed outside
* Turn some variable / parameter names like 'joypad_driver_name' into 'joypad_drv_name'
so they are less likely to conflict with symbol names
2022-11-23 19:14:24 +01:00
libretroadmin aa0ae2cd3e Silence warnings 2022-11-22 18:34:04 +01:00
neil4 3b0db75782
Overlay cleanups; replace bools with flags (#14661) 2022-11-22 18:29:11 +01:00
sonninnos 9bc7bebf51
More hotkey cleanups (#14657) 2022-11-22 14:45:30 +01:00
libretroadmin 1c9d3ad0bf Silence some warnings 2022-11-21 20:56:28 +01:00
libretroadmin 6b71214ed7 Silence some signed/unsigned mismatch warnings 2022-11-21 19:34:43 +01:00
neil4 e71a5ff921
Overlay animation-related fixes (#14651)
- Fix analog drift blocking touch input (could occur on overlay_next if physical inputs shown on overlay)
- Fix overlay_next buttons lighting up in unison
- Skip meta keys in input_overlay_add_inputs (not supported by input_state_internal)
2022-11-21 04:48:34 +01:00
sonninnos 3377fd55ab
Driver + hotkey list reorder (#14646)
* Reorder driver menu and lists

* Reorder hotkey list
2022-11-20 07:26:34 +01:00
neil4 3de186e374
Overlays: Ignore hitboxes with zero area (#14619)
I.e. Set 'reach_x' or 'reach_y' to zero to ensure no hitbox math is done

nits
2022-11-13 10:46:41 +01:00
sonninnos 954d1bf605
Driver independent disconnection notification (#14600) 2022-11-07 05:51:37 -08:00
neil4 217fba48c5
minor overlay-related fixes (#14594)
input_overlay_loaded: Only update menu entries if changed

input_overlay_add_inputs: Set 'updated' for analogs when touched
2022-11-06 17:25:44 +01:00
neil4 b47fb0b807
Overlays: Add 'reach' and 'exclusive' for hitboxes (#14591)
Allows stretching hitboxes and handling their overlap

reach_up, reach_down, reach_left, reach_right:
- Stretches in one direction:
reach_x, reach_y
- Stretches symmetrically

exclusive:
- If true, blocks input from overlapped hitboxes
range_mod_exclusive:
- Similar, but only applies when this hitbox is extended by range_mod
- After range_mod takes effect, has priority over 'exclusive'

E.g. This creates a D-Pad area and extends its hitbox left & right 50%, up 15%, and down 30%. Then applies range_mod_exclusive:
overlay0_desc0 = "dpad_area,0.15,0.57,rect,0.166228,0.295516"
overlay0_desc0_reach_x = 1.5
overlay0_desc0_reach_up = 1.15
overlay0_desc0_reach_down = 1.3
overlay0_desc0_range_mod = 2.0
overlay0_desc0_range_mod_exclusive = true
2022-11-05 21:32:22 +01:00
sonninnos d4eef18f18
Addition to analog stick menu navigation (#14584) 2022-11-03 20:28:24 +01:00
LibretroAdmin 1263b53dae Silence warning 2022-11-03 00:34:33 +01:00