334 Commits

Author SHA1 Message Date
Joe Osborn
fbf2c70e0d
replay format extended to support external tools (#17042)
- replays now start each frame with the number of key events (8 bit
unsigned int, then key events) and the number of input events (16 bit
unsigned int, then the input events)
- this makes it possible to parse replay files without any core
loaded, and makes replays more portable if cores change their polling
strategies
- external tools can now parse replay files
- old (vsn 0) replays will still play back, but new (vsn 1) replays
will not play on old RA
- replay files grow faster now, with each input poll now taking 8
bytes instead of 2
2024-10-04 12:47:34 -07:00
Viačasłaŭ
3019b926c2
Fix typos (#17068) 2024-10-01 17:36:33 -07:00
Joe Osborn
abe7d01e74
Report replay frame number for active_replay stdout api (#17039)
This changes the replay movie's frame_ptr (a 20-bit number used to
point to a log of file offsets) into a frame counter, which is masked
against the 20-bit pattern for use in the file offset log but also
functions as a time index into the replay.  Right now that is reported
in `GET_CONFIG_PARAM active_replay` but in the future it could be used
to show how far into the replay we are during playback or how long the
replay is during recording.
2024-09-27 14:37:31 -07:00
libretroadmin
b8391e233f * PATH_MAX_LENGTH redefined from 4096 to 2048
* Massive reduction in heap space allocation, going from settings struct
264kb to 119Kb
* Use NAME_MAX_LENGTH for base paths/names, etc
* Use DIR_MAX_LENGTH for directory sizes
2024-09-09 05:47:32 +02:00
zoltanvb
e5e7e66199
Add sensor function placeholders for all joypad drivers. (#16812)
In some cases, set_sensor_state and get_sensor_input are
more related to the joypad driver, e.g. in desktop platforms
where sensors are associated rather with the joypad.

If input driver supports the sensors, it is still preferred.
Placeholder inserted for all input drivers, no functionality
added yet.
2024-07-24 15:13:16 -07:00
zoltanvb
7db9a2de60 Test input driver and sensor test screen
A new input driver (test_input), similar to test joypad driver.
Takes its inputs from a json file provided in options. Supports
keyboard input and sensor input (accelerometer, gyroscope,
illuminance).

Remote Retropad extended with a sensor test screen.
2024-07-06 13:55:55 -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
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
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
libretroadmin
b5887d9857 change bsv_key_data back in case struct layout matters 2023-08-30 18:20:58 +02:00
libretroadmin
712b821f78 Reorder 2023-08-30 11:11:04 +02: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
sonninnos
de45fc2f5f
Input binding rework (#15603)
* Input binding rework

* Controller info logging cleanup
2023-08-16 11:13:14 -07:00
neil4
fbd8498686
Overlays: Apply range_mod only for the touch inputs that trigger it (#15534) 2023-07-30 09:49:59 +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
libretroadmin
246cceeb27 Silence more signedness warnings 2023-06-14 19:51:31 +02:00
sonninnos
c4f43ff28b
Linux input driver fix 8+ joypads (#15374) 2023-06-14 04:43:45 +02:00
libretroadmin
37190f8036 Header uniformity cleanups 2023-05-30 21:21:05 +02:00
libretroadmin
c0ba738f0d Header uniformity - enums on top, then structs, then public declarations 2023-05-30 21:03:36 +02: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
2125770236
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle

see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.

bsv files are also now stored with states, not saves.

* Compilation fixes

* Added command impls for play and record replay, and some code in load state to do the right thing there

* Guard some parts of the new code with HAVE_BSV_MOVIE

* wip, menu fixes

* more menu fixes, osd for movie errors, halt recording properly

* Menu and label fixes

* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks

* Fix replay autoincrement

* fix endif placement, whoops

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-03 00:52:22 +01:00
libretroadmin
32962dfc99 Fix function declaration movie_stop_playback 2023-02-23 17:05:31 +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
Joe Osborn
951f5a76a5
Add bsv to emscripten builds (#14905)
* Add bsv to emscripten builds

BSV has no external dependencies so this addition should be fine.

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-26 05:46:39 +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
sonninnos
2f1a03523b
Hotkey blocking correction (#14831) 2023-01-13 04:56:14 +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
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
neil4
2de52baf74
Overlays: Add eightway area types (#14565)
- New descriptors: 'dpad_area' and 'abxy_area'
- Each has a diagonal sensitivity setting, 100% being 8-way symmetry
- Buttons can be redefined in the cfg file

E.g. This would create a d-pad area, then redefine it to use analog directions:
overlay0_desc0 = "dpad_area,0.85,0.57,rect,0.166228,0.295516"
overlay0_desc0_up = "r_y_minus"
overlay0_desc0_down = "r_y_plus"
overlay0_desc0_left = "r_x_minus"
overlay0_desc0_right = "r_x_plus"
2022-10-30 06:31:27 +01:00
LibretroAdmin
4854643ead (input_driver.c) Small cleanups 2022-10-29 18:52:10 +02:00
neil4
b98c53ddb7
Improve haptic feedback for input overlays (#14517)
Repurpose vibrate_on_keypress to enable device's standard keypress feedback on overlay key/button state changes

- Add keypress_vibrate function ptr to input_driver_t (only implemented on Android for now)
- (Android) Remove APP_CMD_VIBRATE_KEYPRESS
- (Android) Add doHapticFeedback, called directly to avoid latency
2022-10-16 09:58:09 +02:00
LibretroAdmin
fcbd72dbf3
Use flags pt4 (#14497)
* * Use flags for rarch_state
* Get rid of ^M linebreaks in retroarch_types.h

* Buildfixes for consoles

* (audio driver) use flags instead of bools

* (video) Use flags instead of bools

* Rewrite input driver state bools into flags
2022-10-08 10:39:15 +02:00
LibretroAdmin
25b76fdb54 input_keyboard_osk_event_append and others: don't call strlen
implicitly, always leave it up to caller
font_driver_get_message_width - try to avoid scenario where 'len'
is 0
2022-08-27 15:13:56 +02:00
LibretroAdmin
4c7e316aa2 Turn functions static 2022-08-17 16:47:44 +02:00
libretroadmin
4b1766cf61 Silence more -Wdocumentation warnings 2022-07-15 01:12:04 +02:00
libretroadmin
eb2c3e35d4 Silence some of the warnings being generated by Objective-C 2022-07-15 00:33:08 +02:00
aldebaran27
58decac935
Increase DEFAULT_MAX_PADS to 8 for ODROIDGO2, since that impacts the RG351[X] consoles. The RG351[X] have a USB host controller and can have an arbitrary number of USB gamepads. (#14122) 2022-07-02 01:06:46 +02:00
LibretroAdmin
4a38831c47
Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes (#14062)
* Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes
2022-06-18 19:07:15 +02:00
sonninnos
53be17aee2 Block pointer input when overlay is pressed 2022-06-16 16:49:51 +03:00
OsirizX
c6d51fdb32 [ORBIS] Initial changes for PS4 2022-05-21 16:31:10 +02:00
twinaphex
86f899c844 Revert "Shorten character arrays that are passed to fill_pathname_base_noext"
This reverts commit 318108ac82859a166f45cd081d6b58bc3f844db9.
2021-11-10 08:22:19 +01:00
twinaphex
318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex
f4c5852cfa Move state from global_t to input_state_t 2021-11-09 06:27:43 +01:00
twinaphex
61d30cdc31 Move input code from retroarch.c to input_driver.c 2021-11-06 04:34:54 +01:00
Jamiras
088aa7dcb9
add github action for c89 build (#13186)
* add retroarch.yml

* fix c89 errors

* attempt to add dependencies

* update comments
2021-11-05 00:05:13 +01:00