99 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
Takumi Grainger c8f8bc31c3 NES: Add FCNS controller (#193)
Also fixes presets/clear buttons for NTT, Pachinko & Hypershot, and improves layout for all controller config popups (buttons/borders are aligned, etc.)
2026-06-28 13:34:30 +09:00
SourMesen f5f790d6e1 NES: Improve CPU read performance for most common case (#145)
Modified NesMemoryManager & BaseMapper to allow inlining the read logic when the CPU is e.g executing code from ROM. This speeds up execution by around 5%.
2026-05-27 21:59:12 -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
NovaSquirrel 6312748563 SNES: Add Turbo File Twin support (#109)
* SNES: Add Turbo File Twin support

* SNES: Try to make write mode flag more accurate

Hardware tests on Turbo File Twin seem to be showing that if you write data then it stops reporting that the write flag is on, despite letting you write more data

* SNES: Move bit array access to a utility

Also add note about how bit 26 in STF report is not fully verified

* SNES: Add behavior seen when reading without read command

When you turn the strobe on and off outside of a read command, the shift register gets reloaded with the most recently read or written byte

* NES, SNES: Emulator::SaveBattery() for saving console and controller

* Fix range limit in SetBitInArray

* Add notes about unknown aspects of TFII mode

* Add comments to make it clear what's unknown

* STF mode ignores out-of-range addresses

Also allocate _data instead of putting it in the class
2026-05-15 00:05:31 -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
Fiskbit 211ef1d09b NES: Make Vs. System games default to 8 DIP switches. (#50)
Previously, Vs. System games weren't getting DIP switches unless they were in the DIP switch database.
2026-04-22 20:57:12 -07:00
Fiskbit 963f9f2e45 Fixes EPSM so that it works correctly after reset.
Resetting the emulator would cause the EPSM to not function for a while. This was because the EPSM implementation was not reset-aware. While the console clock it's comparing against would be reset to 0, its own internal clock would not, and so it would have to wait for the console clock to catch back up.

Thanks to Sour for finding the cause and suggesting the fix.
2026-04-08 09:30:29 -07:00
Sour b8a12138ed NES: Fixed behavior/label for the double arkanoid controller option in the NES 2.0 header 2025-06-05 16:26:34 +09:00
Sour d0b1a9d6f5 NES: Fixed crash when changing region while playing VS Dualsystem games 2025-02-11 20:49:15 +09:00
Sour 7ed5fd5562 NES: Added EPSM support 2024-10-01 20:57:06 +09:00
Sour 4c1579d8fd NES: Small performance improvements 2024-09-26 22:41:57 +09:00
Sour 6a16f729a3 NES: Improve CPU OUT pins emulation
OUT pins are only updated on the GET->PUT cycle transition
2024-09-26 21:19:10 +09:00
Sour c77415581f NES: Disable Game Genie bus conflicts emulation when running an unknown iNES 1.0 ROM
Otherwise, Game Genie codes that could have worked on hardware did not work as expected because of the bus conflicts. This could occur when e.g trying to use cheats on a romhack, etc.
2024-07-20 21:39:16 +09:00
Sour 642106991a Debugger: Lua - Fixed writing to nesMemory not triggering side effects as intended 2023-10-06 21:02:39 +09:00
Sour a3aedd2f2a NES: HD Packs - Fixed crash when starting/stopping hd pack recorder 2023-06-30 16:01:24 +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 afbaaed564 NES: HD Packs - Fixed blank/corrupted screen when hd pack doesn't contain any <tile> tags 2023-03-18 18:13:47 -04:00
Sour 11dbb90732 NES: HD Packs - Performance tweaks
Keep BGs in separate arrays based on their priority to avoid having to scan thousands of background entries for layers that have no backgrounds at all on each frame
2023-03-18 11:16:13 -04:00
Sour 8ec81f0e18 NES: HD Packs - Added "fallback tiles" feature 2023-03-05 18:42:32 -05:00
Sour 88c0c76cbd NES: Fixed OAM decay bug when PPU reset is disabled
Also changed 'v' to be preserved on reset and vblank flag to be random if random power on state option is on
2023-03-03 23:09:02 -05:00
Sour d1360f408f NES: Fixed crash when loading game that doesn't have a HD pack 2023-03-02 22:40:22 -05:00
Sour e9a940657d NES: HD Packs - Load PNG files in a separate thread to prevent stuttering in some packs that use huge PNG files 2023-03-02 19:13:30 -05:00
Sour 9504973e7c Video: Split fullscreen refresh rate option into 2 (ntsc/pal) 2023-02-18 22:38:38 -05:00
Sour c363474035 Rewind: Reduce memory usage, increase save state frequency (which reduces delay when rewind starts) 2023-02-16 22:18:56 -05:00
Sour dea1a2fd58 NES: Fixed NSF playback issues due to incorrect state at power on/reset 2023-02-04 15:34:16 -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 152abf690b Rename stdafx.h to pch.h 2022-09-08 21:29:52 -04:00
Sour aca122dde0 Debugger: NES - Fixed issues with famicombox's bigger system ram 2022-08-29 21:03:44 -04:00
Sour ca602a4749 NES: Added UI to configure dip switches 2022-08-28 15:52:42 -04:00
Sour 32900dfbac NES: Fixed audio issues with runahead 2022-08-17 23:08:20 -04:00
Sour bcf4e5e17e Debugger: Lua - Fixed NES sound issues when using setState 2022-08-03 23:28:00 -04:00
Sour 8d7f12efb9 Debugger: Lua - Performance fixes, naming fixes/changes 2022-07-31 19:41:57 -04:00
Sour aaf240c070 Movies: Save/load settings and cheats, fixed bugs/crashes, fixed todos 2022-07-26 23:36:38 -04:00
Sour 623892d6c3 Fixed ram init logic to ensure the correct config option is used when loading a game 2022-07-25 22:04:44 -04:00
Sour 8354f48357 NES: Rename some functions/variables to match nomenclature used in the rest of the code 2022-07-24 20:31:19 -04:00
Sour 3fbd18e237 NES: Rename MiscUnlicensed to Unlicensed, move some other mappers to folders 2022-07-24 20:09:09 -04:00
Sour 42a1753198 NES: Updated game database 2022-07-21 22:07:41 -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 b456170551 Save states: Serializer rework/rewrite 2022-07-20 00:40:32 -04:00
Sour abe3e62fe9 NES: Implement option to not reset PPU when resetting console 2022-07-14 20:58:12 -04:00
Sour 6e62782a2e Video: Fixed integer fps mode option 2022-07-02 16:13:24 -04:00
Sour 437a88d0c3 Debugger: Memory Tools - Added "view in [mem type]" action 2022-06-25 11:44:18 -04:00
Sour 0a6a8e92b2 PCE: SuperGrafx support 2022-05-15 20:35:56 -04:00
Sour b4c56e0cfb Linux: Fixed struct size differences between clang & msvc caused by empty base class 2022-05-10 18:15:57 -04:00
Sour 1c055bb4af Save States: Load/save emulation settings for netplay/rewind states, fixes some TODOs, fixes some NES issues when loading a state taken in a different region 2022-03-31 14:36:15 -04:00