Commit graph

78 commits

Author SHA1 Message Date
sergystepanov
1d5bae0c62 Add analog triggers and pack axes into atomic int64
- Pack 4 analog axes (LX, LY, RX, RY) into single int64 for atomic access
- Pack L2/R2 analog triggers into single int32
- Reduce memory per port from 20 to 16 bytes
- Reduce atomic stores per SetInput from 5 to 3
- Add RETRO_DEVICE_INDEX_ANALOG_BUTTON support for analog trigger queries
- Fallback to digital (0/0x7FFF) for non-trigger analog button queries

Wire format: [BTN:2][LX:2][LY:2][RX:2][RY:2][L2:2][R2:2] (14 bytes)
2025-12-29 20:20:55 +03:00
sergystepanov
368bae8c07 Swap mutex to atomics in keyboard input 2025-12-28 21:25:33 +03:00
sergystepanov
58a19affcb Clean SDL/OpenGL functions 2025-12-27 01:58:14 +03:00
sergystepanov
8754a5edfa Tweak OpenGL framebuffer
Force alignment for GL ReadPixels and skip unbinding last framebuffer which makes it a bit faster.
2025-12-26 16:17:37 +03:00
sergystepanov
c800dd4bf9 Fix with go fix 2025-12-22 15:08:50 +03:00
sergystepanov
671e875f12 Add input cache for retropad, keyboard and mouse 2025-12-14 13:53:21 +03:00
sergystepanov
f708fce112 Revert "Try atomic-based locks in the same thread execution loop instead of a bunch of mutexes."
This reverts commit 460c466053.
2025-12-14 13:30:45 +03:00
sergystepanov
460c466053 Try atomic-based locks in the same thread execution loop instead of a bunch of mutexes. 2025-12-14 13:18:34 +03:00
sergystepanov
c05e42f597 Cleanup nanoarch.go 2025-11-22 21:20:16 +03:00
sergystepanov
09a0c9c3f2 Revert "Add user input caching"
This reverts commit 859d0c8f1a.
2025-11-22 17:46:07 +03:00
sergystepanov
859d0c8f1a Add user input caching 2025-11-22 17:22:40 +03:00
sergystepanov
baaeaf43b1 Add config option for logging dropped frames 2025-11-22 12:32:56 +03:00
sergystepanov
76b376aef7 Add config option for skipping late video frames 2025-11-22 11:59:08 +03:00
sergystepanov
3df6a24a0a Skip video frames when they are late 2025-11-21 22:35:33 +03:00
sergystepanov
5c6406c1e7 Implemented a busy loop for the emulation ticker.
This replaces the low-precision, OS-dependent time ticker with a CPU spin loop that performs continuous target frame time checks and corrections.
2025-11-21 20:13:27 +03:00
sergystepanov
bbad4539b1 Update libretro.h 2025-11-20 00:33:03 +03:00
sergystepanov
42b003db62 Verifies during startup if the system can run the emulator
This check can be disabled with the emulator.failFast = false config option. Right now it checks SDL2 video context creation.
2025-06-20 18:30:17 +03:00
sergystepanov
02210f1f8d Remove unnecessary C bridge functions 2025-05-18 12:46:32 +03:00
sergystepanov
36da07f277 Use the actual state size when loading ROMs 2025-05-03 16:35:21 +03:00
sergystepanov
37a4a80996 Use the save state size before each save/load call 2025-05-03 15:55:26 +03:00
Sergey Stepanov
0c768bb3d6
Add some notes on recording in regards to ffconcat 2024-12-21 01:37:42 +03:00
Sergey Stepanov
f78bcf3e4b
Allow config for the remote Libretro core repos 2024-12-20 01:32:20 +03:00
Sergey Stepanov
535e725618
Panic when dlib functions are missing 2024-12-19 21:40:14 +03:00
Sergey Stepanov
4aaeda3fbb
Move some RETRO_ENVIRONMENT vars into C 2024-12-16 23:28:14 +03:00
Sergey Stepanov
954bb23bb8
Add Reset with 0 key 2024-12-03 00:38:15 +03:00
Sergey Stepanov
1831e44eef Add new saveStateFs config param
Used when you need a copy of FS for new game sessions (i.e. DOSBox uniqueSaveDir=true).
2024-11-26 19:35:31 +03:00
Sergey Stepanov
45cc9e8245 Move library config to the top level 2024-11-17 12:59:43 +03:00
Sergey Stepanov
795771e3d6 Add custom file lock 2024-11-17 12:59:43 +03:00
Sergey Stepanov
b9d35fa626
Fix save dir string freeing order 2024-08-27 14:30:49 +03:00
Sergey Stepanov
7da993a4c7 Add the uniqueSaveDir option
This option allows for the safe use of distinct filesystem snapshots of games with some cores (e.g., DosBox). Keep in mind that with this option enabled, game changes won't be saved (the unique save folder will be deleted on exit) until you explicitly call the save (or share) function. Thus, you will need files like dosbox.conf along with the games to use some default behaviors with each new game session.
2024-08-21 18:52:26 +03:00
Sergey Stepanov
7873631613
Add skip_same_thread_save hack 2024-08-09 00:54:08 +03:00
Sergey Stepanov
466257d3be
Add NonBlockingSave option for background saving
This feature introduces a new configuration option, `NonBlockingSave`, which allows background saving for large files. With this param the saving process will not block the main thread with all network sockets.
By default, it's enabled for the DosBox core.
2024-08-07 20:31:14 +03:00
Sergey Stepanov
34a947ac6d
Update libretro.h 2024-08-06 19:57:45 +03:00
Sergey Stepanov
7ee98c1b03 Add keyboard and mouse support
Keyboard and mouse controls will now work if you use the kbMouseSupport parameter in the config for Libretro cores. Be aware that capturing mouse and keyboard controls properly is only possible in fullscreen mode.

Note: In the case of DOSBox, a virtual filesystem handler is not yet implemented, thus each game state will be shared between all rooms (DOS game instances) of CloudRetro.
2024-08-02 11:04:44 +03:00
sergystepanov
d6199c9598
Use ROM folders
Libretro cores are selected based on the file extensions of the ROMs. However, ROM file extensions are not unique across cores (e.g., .zip is used in both DosBox and MAME). To load a specific core correctly, it's necessary to place the corresponding ROMs in designated folders specified in the configuration. By default, you can use the keys from cores.list as the folder names, or you can specify your own custom folder names using the 'folder' parameter for each core.
2024-07-24 20:31:12 +03:00
Sergey Stepanov
ba7db72093
Increase buffers that use max dimensions from the Libretro geometry
Some cores may render frames bigger that reported max dimensions. This may help a bit.
2024-07-15 12:10:18 +03:00
Sergey Stepanov
83b040b39f
Change GL framebuffer if max geometry is different 2024-07-14 19:33:32 +03:00
Sergey Stepanov
c40f9c9127 Resize GL buffer when geometry changes 2024-07-13 11:28:20 +03:00
sergystepanov
7e612458a0
Fix crash when loading games too early (also for mac) 2024-07-10 00:36:20 +03:00
Sergey Stepanov
72b791cc5e
Revert shutdown locks for now (deadlock on macOS) 2024-07-09 23:17:44 +03:00
Sergey Stepanov
e46b739311
Fix crash when loading games too early 2024-07-09 21:21:08 +03:00
sergystepanov
ba45936d77
Add another workaround for g0 stack in Go 1.22.5 (#460) 2024-07-05 22:56:28 +03:00
Sergey Stepanov
b93eb4911c
Fix conf loading for the emulator mocks 2024-05-21 22:26:20 +03:00
Sergey Stepanov
c5c2578d0f
Switch Trace to Debug in Libretro logging 2024-05-07 23:05:03 +03:00
Sergey Stepanov
9b56ffc87c
Fix macOS tests
Main thread locking hangs OpenGL emulators.
2024-05-07 21:05:12 +03:00
sergystepanov
421e9115cc
Add new options4rom config param (#452)
* Add new options4rom config param

Allows changing core options depending on the ROM name.
2024-04-24 16:38:33 +03:00
Sergey Stepanov
b3f677d32f Use for range 2024-04-22 18:10:35 +03:00
Sergey Stepanov
8d79680b81 Migrate to rand/v2 2024-04-22 18:10:35 +03:00
Sergey Stepanov
84f55691eb
Check if dup frame didn't exist
FBNeo can return dup frame flag before its first frame.
2024-03-21 23:02:02 +03:00
Sergey Stepanov
4d5033f03c Allow duplicate frames
Some cores for performance reasons may return duplicate frames (i.e. previous frames) instead of rendering them again.
2024-03-21 16:10:09 +03:00