67 Commits
Author SHA1 Message Date
hunterk f049089880 initial libretro-ization. Some things partial/nonexistent
fix linking, rename lib, prep for GB/C

get more consoles working. PCE still not there

fix PCE hucard loading; CD still broken

fix PCE CD loading and firmware. SGB still not quite there

get SGB working

add gitlab recipe for libretro buildbot
2026-08-29 10:21:13 -05:00
SourMesen 6c54ae1989 Video: Support for VRR in borderless fullscreen (Windows only) and improved frame pacing (#178)
* Video: Add support for VRR when in borderless fullscreen mode (Windows only) and improve frame pacing

* Fixed debug stats not disappearing when unchecking option in some scenarios

* Changed frame pacing graph scale/logic to show the gap between the ideal pacing and the current pacing (within +/- 2ms)
2026-06-21 01:29:30 -07:00
SourMesen 37de357b75 NES: FDS - Performance improvements (#143)
-ProcessCpuClock was used to check for events that don't need to be checked that often (auto-switch disk + auto fast-forward options). This has been moved to an EndFrame callback.
-This was even slower than intended because of the call to _emu->GetFrameCount() which was, relatively speaking, fairly slow. To improve its performance (since it's used rarely for some things like turbo button processing), a separate GetFrameCount function was added on all console classes, and Emulator::GetFrameCount was also optimized to be faster when called from the emulation thread.

When the auto-switch disk option is enabled, this can improve performance by about 25-30%. When the option is not enabled, this still improves performance by 4-5%.
2026-05-27 04:02:54 -07:00
NovaSquirrelandSour 325c78fcbd GB: Link cable support with two local consoles (#77)
* GB: Link cable support with two local consoles

* GB: Fix crash when color blending is enabled

* GB: Fix formatting

* GB: Link UI fixes, control fixes, audio fixes

Copied from Sour's branch. Also a separate change to use separate savefiles.

* GB: Try to avoid crashes from buffer overflows

* GB: Separate savefiles with linked multiplayer

* GB: Add support for faster link speed

* GB: Move enum to correct file

* GB: Refactor, move serial transfer to function

* -Fixed secondary console sometimes running far ahead of the main console when frame counters did not match (e.g because one console had their LCD disabled longer, etc.) This would cause buffer overflows in the audio buffer.
-Fixed screen tearing when both consoles are not perfectly in sync (because of the LCD being disabled for a different amount of time, etc.)
-Fixed main console not calling PlayQueuedAudio properly mid-frame
-Reuse VS Dualsystem code to merge audio/video when possible/simple and moved that to AvMergeUtilities

Some visual glitches can appear on the secondary screen (for GB) while rewinding, but this can't really be fixed.

* Fixed warning (unused local variable)

* Prevent loading single-console save states when in dual-console modes

* Disable debugger for VS DualSystem's subconsole. Fixes issues when debugging VS DualSystem games

* Code cleanup

* Rework solution to disable debugger on second console to improve performance
Added InternalRunFrame for nes & gb to avoid checking for the presence of the second console after each cpu instruction

* Don't enable the linked GB option by default

* Removed unused function

* Netplay: Force game to reload after updating emulation settings when connecting to the server (or when the host changes game)
This ensures that e.g the GB link cable setting is applied and that the game loads correctly, regardless of the client's link cable settings (otherwise the game could load without the link mode enabled, etc.)

---------

Co-authored-by: Sour <[email protected]>
2026-05-15 02:35:27 -07:00
SourMesen e9f48e23e8 Netplay: Fixed game crashing when connecting to server (#113)
The server would send a save state taken inside the PpuFrameDone event when a config change was detected, which is not safe. PpuFrameDone runs in the middle of CPU instructions, which could easily cause game crashes or desyncs.
2026-05-14 15:54:57 -07:00
SourMesen 893c0d4a2c Movies: Fixed missing input recording/playback for the first frame after power cycle (#90)
* Movies: Fixed missing input recording/playback for the first frame after power cycle
This didn't cause any obvious issues, because it would only matter if a significant button was pressed during the first frame. But when exporting a movie from the history viewer, the first frame's input was actually part of the .mmo file, causing every input to be offset by 1 frame when the movie was played back (which caused desyncs). The movie recording/playback was initialized too late, after the first frame's input was initialized, causing it to be skipped entirely. Using the new "AfterInitConsole" notification, which is triggered slightly earlier, instead of "GameLoaded" allows the first frame's input to be recorded/played properly

This also fixes a rare emulator crash that could occur when you power cycle while letting go of the rewind button at the same time (that I triggered by rewinding while the movie was playing a frame that had a power cycle input)

* Fixed more desync issues (when recording movies from "current state", and when exporting movies from the history viewer)

* Fixed warning

* Fixed backward-compatibility with movies recorded before these fixes
2026-05-10 17:58:21 -07:00
SourMesen e391fd8f9a Code: Add auto-formatting rules for C++ (clang-format) and enforce in CI via "clang-format" and "dotnet format" (#78)
* Code: Add auto-formatting rules for C++ projects (clang-format) and enforce code style via "clang-format" and "dotnet format"

* fix ui format warnings
2026-04-30 06:03:55 -07:00
Sour 5350959230 SNES: Added new controller type that supports rumble 2025-06-23 10:26:31 +09:00
Sour 18269da46b SNES: Add support for Sufami Turbo games 2025-01-03 09:18:59 +09:00
Sour c5406773a0 Added WonderSwan support 2024-09-19 21:19:43 +09:00
Sour 640a215cbb GB: Added support for MBC5 rumble feature 2024-07-13 20:50:57 +09:00
Sour 8f94cbe64f GB: MBC7 - Accelerometer and eeprom support 2024-07-07 20:36:45 +09:00
Sour 226a87d92c Input: Allow "pause" shortcut and gamepad shortcuts to work when a keyboard device is plugged in 2024-07-06 10:25:26 +09:00
Angelo d82cd8a2c4 UI: Move mouse handling to core and add MacOS mouse support (#55) 2024-05-24 16:31:44 +09:00
Sour 9af571cac8 Linux: Fixed video freezing after power cycle/reload rom 2024-01-11 17:51:28 +09:00
Sour c4743c3cc0 Video: Fixed HUD elements (i.e fps counter) temporarily not appearing properly after changing the overscan settings, etc. 2024-01-09 16:36:31 +09:00
Sour af2afc4cf7 Reduced CPU usage for HUDs and when paused 2023-10-14 22:15:27 +09:00
Sour 2761a5814e UI: Fixed broken screenshots in load/save state menus on NES when a hd pack is loaded 2023-04-22 20:44:25 -04:00
Sour 63bac5d462 macOS: Replace SDL renderer with Avalonia
Avoids SDL-related issues until a better solution can be found
2023-02-02 21:33:48 -05:00
Sour b4618eb47a GB: Allow loading GB/GBC/SGB save states on any of the 3 models 2023-01-30 19:50:05 -05:00
Sour 7fa572777c Cheats: Added cheat database 2023-01-05 12:28:30 +09:00
Sour e96d6f3ca5 NES: Added HD pack builder tool 2022-12-29 18:28:33 +09:00
Sour 9494aec10b Debugger: Don't reload debugger workspace from disk when power cycling 2022-10-20 22:45:47 -04:00
Sour 152abf690b Rename stdafx.h to pch.h 2022-09-08 21:29:52 -04:00
Sour d7a8de8208 Removed unnecessary stdafx.h files 2022-09-08 21:15:56 -04:00
Sour 91ab4bd814 Input: Stop calling ShortcutKeyHandler::ProcessKeys constantly (because of periodic mouse button updates) 2022-09-04 14:12:08 -04:00
Sour ca602a4749 NES: Added UI to configure dip switches 2022-08-28 15:52:42 -04:00
Sour 991052f8bc Debugger: Lua - getDrawSurfaceSize api, added relative pos to getMouseState 2022-08-03 19:35:18 -04:00
Sour 240e045f99 Debugger: Lua - Added selectDrawSurface API (+ Linux compilation fixes) 2022-08-02 23:25:41 -04:00
Sour 84da5cdcd3 Debugger: Make GetTimingInfo return GB timing info when called in SGB mode if the caller is bound to the Gameboy cpu 2022-07-27 23:35:02 -04:00
Sour fe7dfbb11b Input: Allow mapping buttons/shortcuts to mouse buttons + refactoring (16-bit keycodes, make mouse buttons behave like all other keys) 2022-07-22 17:00:00 -04:00
Sour a15c9421a8 NES: Implement auto-configure inputs option 2022-07-21 19:47:50 -04:00
Sour 77692f323d Fixed behavior when loading an invalid rom while a rom is loaded, fixed battery save behavior when switching between games, fix/cleanup some TODOs 2022-07-21 16:12:24 -04:00
Sour 4d9c4f76a9 Save states: Fixed crashes when loading invalid states, fixed load/save state menus not working properly, fixed crash when loading PCE states 2022-07-20 14:28:19 -04:00
Sour 467de93af5 Video: Implement exclusive fullscreen & integer scale in fullscreen options 2022-07-02 15:12:26 -04:00
Sour eb80802d3a UI: Keep emulation paused when using reset/power cycle, prevent game from running when debugger is opened while paused 2022-05-29 12:17:51 -04:00
Sour ed2c5fa0ba wip 2022-04-14 19:15:46 -04:00
Sour 64cd81adcd Code cleanup (removed TODOs) 2022-03-30 19:56:45 -04:00
Sour a79a13eca2 Cheats: Added UI and implemented cheats in core 2022-03-30 12:28:53 -04:00
Sour a31eb671ac Input: Support for barcode readers and tape recorders (NES) 2022-03-15 22:39:30 -04:00
Sour 616465181c NES: Disable shortcuts when keyboard is plugged in 2022-03-13 19:28:46 -04:00
Sour aa6a9699fb UI: Added global input options (deadzone, display inputs on screen, etc.) 2022-03-04 22:08:29 -05:00
Sour cab9d16606 UI: Refactor game menu 2022-02-04 21:32:50 -05:00
Sour eeee9fbd95 Debugger: Fixed crashes when switching between games while debug tools are opened 2022-01-25 22:45:24 -05:00
Sour a99ff82c88 Video: Prevent window resize when switching between normal and high res modes on SNES 2022-01-23 20:33:50 -05:00
Sour 76af4a9824 Fixed console not being destructed (mem leak) 2022-01-23 00:58:07 -05:00
Sour 69f0e5ff4f HUD: Rework hud to be separate from the console's output (and not saved in videos) 2022-01-22 16:16:38 -05:00
Sour 5a48373781 Core: Refactoring - removed GetFrameDelay, GetFps contains the same info 2022-01-22 10:33:39 -05:00
Sour 0d78c064f3 Core: Reduce shared_ptr usage, refactor netplay code to remove static instances 2022-01-21 21:25:33 -05:00
Sour ba73872ed7 Debugger: Tooltips for disassembly + minor refresh tweaks/refactoring 2022-01-07 21:05:13 -05:00