320 Commits

Author SHA1 Message Date
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
Autechre
80e0114ccf
Move collect_system_input to input_driver.c (#13183) 2021-11-03 16:48:57 +01:00
gblues
1ef78d3e3d
Any pad can control the menu (#13173)
* Any pad can control the menu

== DETAILS
I am not sure I've quite got it so that any pad can *open* the
menu, but I do have it so any pad can control it.

- split out the input processing into a separate method
- track down and squish some hairy bugs that boiled down to
  bad pointer math
- it looks like `menu_driver.c` has a mix of line endings, so I
  ran it through `dos2unix` so it has consistent line endings
  again.
- verified that this change did not impact actual cores

* optimize out cumulative_bits

* Incorporate PR feedback

Many thanks to @jdgleaver for providing these optimizations.

* apply one more optimization
2021-11-03 16:32:15 +01:00
Autechre
514534f99b
Move more state to runloop_state (#13124)
* Move more state to runloop state

* remove unused variable

* Cleanup

* Move more state to runloop_state

* Remove unused variable

* Cleanups

* move input_remapping functions over to input_driver.c

* Some buildfixes
2021-10-18 15:23:22 +02:00
twinaphex
9184d0e114 Move hid_data to input_st 2021-10-15 16:31:31 +02:00
twinaphex
f070da6dfc Move code to menu_driver.c and input_driver.c 2021-10-13 15:40:01 +02:00
twinaphex
3d710db798 input_state_wrapper symbol name was causing collisions with certain
cores on statically linked platforms
2021-10-08 12:50:45 +02:00
twinaphex
61ee2274e6 Move more code over to input_driver.c - BSV code in particular but
also input state function callbacks - retroarch.c code size reduced
to 874Kb
2021-10-06 05:57:39 +02:00
Nathan Strong
5da1cd08ff Unify the HID driver architecture
== DETAILS
When I first implemented the Wii U HID architecture, I ended up
having to design my own implementation because, at the time, I did
not have a way to read the HID device string to allow the existing
code to successfully detect the gamepad.

After spending some time experimenting, I've figured out how to
do this. And that means I can better align the HID driver with other
platforms.

change summary:

- create a single state structure for all three sub-types of wiiu pads
  (kpad, wpad, and hid)
- eliminate confusing duplicate pad lists
- eliminate confusing duplicate HID pad drivers (ds3, gamecube
  adapter, etc)
- ensure the ds3 driver still works
2021-10-05 09:23:08 -07:00
Nathan Strong
9edb449471 wip commit 2021-10-05 09:10:41 -07:00
Autechre
8807e2957e
Input refactors pt3 (#13053)
* Move more internal state over to input_driver.c and menu_driver.c -
retroarch.c now down to 893kb
- Remove now unused p_rarch pointers in functions
2021-10-01 07:18:30 +02:00
twinaphex
e9a4e811ac Move more code and variables from rarch_state out to input_driver
and menu_driver
2021-10-01 00:41:50 +02:00
twinaphex
49fbed2423 Get rid of input_mouse_grabbed - move retroarch types to
retroarch_types.h
2021-09-30 23:22:50 +02:00
twinaphex
dbe414e1e1 move input_poll_overlay to input_driver.c 2021-09-30 21:29:35 +02:00
twinaphex
ddceb51f89 Get rid of some needless getters/setters 2021-09-30 21:10:12 +02:00