464 Commits
Author SHA1 Message Date
hizzlekizzle d2e771806a Rename .gitlab-ci.yaml to .gitlab-ci.yml
this was breaking the CI process -_-

simplify libretro makefile (#1)

only build the components needed by libretro

default to building with GCC

see if this can clear some CI hurdles

let runners override toolchain

libretro: build fixes (#2)

libretro: more apple build fixes (#4)

libretro: apple build fixes (#5)

buildfix for iOS/tvOS

libretro: frontend VFS support + Android/Windows/libnx build fixes (#3)

* libretro: route all file access through the frontend VFS

RetroArch can hand the core paths that don't exist on the real
filesystem - the common case being Android SAF content:// URIs, which
only the frontend can open. The core sets need_fullpath, so it opens the
content itself and every one of those loads currently fails.

All of the core's file I/O goes through utf8::ifstream/utf8::ofstream, so
routing those two through a VFS-backed streambuf covers ROMs, patches,
firmware, battery saves, save states, screenshots and recordings:

 - Utilities/VfsFile.{h,cpp}: VfsStreamBuf, a std::streambuf on top of
   retro_vfs_interface with a stdio fallback for when no frontend VFS is
   available, plus VfsIo helpers for stat/mkdir/opendir/remove/rename.
   Note that RetroArch's seek() returns 0 rather than the new offset, so
   the position is always read back with tell().
 - UTF8Util.h: in LIBRETRO builds utf8::ifstream/ofstream are backed by
   VfsStreamBuf (the _WIN32 wide-path classes stay for other builds).
 - retro_set_environment asks for VFS v3 and falls back to v2, so the
   directory calls are used when the frontend has them.
 - FolderUtilities uses the VFS for CreateFolder/GetFolders/
   GetFilesInFolder when v3 is available, std::filesystem otherwise.
 - ZipWriter builds archives in memory and writes them out through the
   stream layer - miniz's file API goes straight to stdio.
 - The remaining direct std::ifstream/std::ofstream/rename/remove calls
   in libretro.cpp and sha1.cpp now go through the same layer.

Verified with a harness that only accepts saf://-prefixed paths (a core
still on stdio fails to load): GB and SNES content loads, and the
RecentGames archive is written back through the VFS. A second harness
that refuses GET_VFS_INTERFACE checks the stdio fallback.

* libretro: fix the Android, Windows and libnx builds

Android (No rule to make target '.../Core/APU.cpp'): Libretro/jni/
Android.mk pulled its file list from Libretro/Makefile.common, a
leftover from the Mesen 1 libretro port that lists sources this tree
doesn't have. Android.mk now derives the sources the same way
Makefile.libretro does (and builds as C++17, not C++11); the two stale
Mesen 1 makefiles are removed.

Windows x64: two failures.
 - Lua/unixdgram.c needs sys/un.h. The unix-domain luasocket modules
   (unix.c, unixdgram.c, unixstream.c, serial.c) aren't registered by the
   core and aren't in the MSVC project either, so they're excluded.
 - The core is cross-compiled from Linux, so uname reported Linux and the
   build produced a .so with ELF-only link flags. The OS is now taken
   from the target triple, and the Windows build gets --no-undefined plus
   the winsock/UPnP import libraries.

libnx: the job builds with platform=libnx and then moves
mesen2_libretro_libnx.a, but Makefile.libretro had no such target, so it
built a host .so and the job died on the move. It now includes
switch_rules, compiles with the devkitA64 flags and archives a static
library. Untested - this needs a CI run on the libnx image to confirm the
core itself builds for the Switch.

Also fixes the compiler detection: `$(CXX) --version` matched 'gcc|g++'
by name, so a plain `make -f Makefile.libretro` (CXX=c++) took the clang
path and passed -flto=thin to GCC. It now looks for clang instead.

* libretro: use _wfopen_s in the MSVC build

The Mesen solution compiles with C4996 as an error, so the deprecated
_wfopen broke the standalone Windows build. The stdio fallback now has a
single open helper that uses _wfopen_s on MSVC.

* libretro: keep the core changes behind LIBRETRO, restore the old makefiles

Review feedback on libretro/MesenCE#3: the changes outside the libretro
glue should be conditional so this stays a soft fork, and the deleted
files should come back.

Everything the VFS work touches in shared code is now behind #ifdef
LIBRETRO - the WaveRecorder stream member, sha1's file hash, ZipWriter's
archive writing and FolderUtilities' directory calls all build exactly as
before without it. VfsFile.{h,cpp} is a libretro-only translation unit now
(empty otherwise), so it is out of Utilities.vcxproj again; Makefile.libretro
and Android.mk pick it up by globbing.

The macro is LIBRETRO, which is what Makefile.libretro and Android.mk
define, rather than __LIBRETRO__.

Libretro/Makefile and Libretro/Makefile.common are restored. Android.mk no
longer includes Makefile.common, so the stale Mesen 1 file list is only
dead weight rather than a broken build.

Re-verified after the change: linux-x64 core builds, the saf:// harness
loads GB and SNES content and writes the RecentGames archive through the
VFS, and the no-VFS harness still loads content through stdio.

* libretro: confine the VFS to the libretro layer

Review feedback on libretro/MesenCE#3: keep the VFS out of the core and
wrap the core's existing file access instead.

VfsFile.{h,cpp} moves to Libretro/, so it is not part of Utilities at all
any more. The interception point is utf8::ifstream/ofstream in
UTF8Util.h - the one place the core already routes file access through -
which is the only file in Core/ or Utilities/ that mentions the VFS.

The four sites that used to bypass utf8:: now go through it, which drops
their #ifdef LIBRETRO entirely (and incidentally fixes non-ASCII paths on
Windows, where utf8:: is what the rest of the codebase already uses):

- sha1.cpp opened a raw std::ifstream
- WaveRecorder held a std::ofstream, now a utf8::ofstream opened in place
  rather than move-assigned
- ZipWriter used miniz's stdio API; it now drives mz_zip_writer_init with
  a write callback backed by an ofstream, and reads added files through
  an ifstream. Still streamed, so no in-memory archive
- FolderUtilities keeps three guarded early-returns; the directory walk
  itself moved to VfsIo::GetEntries/CreateFolderIfSupported, which return
  false when the frontend has no v3 folder calls so the core falls back
  to std::filesystem

Makefile.libretro and Android.mk compile Libretro/VfsFile.cpp explicitly.

libretro: fix the Windows and libnx buildbot jobs (#6)

* libretro: lowercase the Windows headers for the MinGW cross-build

The buildbot's libretro-build-windows-x64 job is an MXE MinGW cross-build
running on Linux, where the include lookup is case-sensitive. mingw-w64
ships these headers all-lowercase, so <Windows.h> and <Ws2tcpip.h> are not
found and the job dies on Utilities/PlatformUtilities.cpp:

  fatal error: Windows.h: No such file or directory

MSVC is unaffected either way, since the Windows filesystem matches the
name regardless of case.

UTF8Util.cpp keeps its <Windows.h>: that include sits behind #ifdef
_MSC_VER, so the MinGW build never reaches it.

* libretro: don't require IN6ADDR_ANY_INIT on libnx

libretro-build-libnx-aarch64 dies on luasocket:

  Lua/inet.c:374:39: error: 'IN6ADDR_ANY_INIT' undeclared

devkitA64's newlib declares in6_addr, sockaddr_in6 and AF_INET6 - the
rest of the IPv6 code around it compiles - but not that macro. Fall back
to zeroing the address, which is what the wildcard address is by
definition and does not depend on how in6_addr is laid out.

libretro doesn't need upnp mapping

hopefully fix win64 builds

remove LUAOBJ from libnx

hopefully get it building on CI

fix typo in ifdef

libretro: fix the remaining Windows and libnx buildbot failures (#7)

* libretro: link winmm on Windows

PlatformUtilities asks for a 1ms timer resolution while a game runs, and
nothing in LIBS provides timeBeginPeriod/timeEndPeriod, so the MXE link ends
on __imp_timeBeginPeriod / __imp_timeEndPeriod. Those two are the only
symbols left unresolved in the buildbot's windows-x64 job.

* libretro: define _DEFAULT_SOURCE on libnx

Utilities/Socket.cpp does not compile there: u_long, fd_set, FD_ZERO,
FD_SET, select and struct timeval are all undeclared. They are all in
newlib, behind __MISC_VISIBLE and __BSD_VISIBLE - and newlib sets both from
_DEFAULT_SOURCE alone, which it auto-defines only when __STRICT_ANSI__ is
absent. CXXFLAGS passes --std=c++17, which defines it.

glibc turns _DEFAULT_SOURCE on whatever the dialect, so the same source
builds everywhere else and only the Switch job sees this.

re-add LUAOBJ to libnx

libretro: fix the windows-x64 link and get libnx past Lua (#8)

* libretro: give the VFS streams a key function

The windows-x64 job links with -flto and stops on multiple definitions of
the vtable, VTT and construction vtables for utf8::ifstream and
utf8::ofstream, one pair per translation unit that includes UTF8Util.h:

  BsxCart.o: multiple definition of `vtable for utf8::ifstream';
  libretro.o: first defined here

std::istream and std::ostream inherit virtually, so a class derived from
them gets construction vtables and a VTT as well as its own vtable. With no
key function all of it is emitted everywhere into .gnu.linkonce comdats, and
on PE/COFF the group keys come out inconsistent between objects - the same
section is keyed on the vtable in one and on the construction vtable in
another - so the linker keeps both instead of folding them.

Declaring the destructors in the header and defining them in the .cpp makes
those the key functions, so one object emits the lot. The VFS streams are the
only classes here that derive from a virtual base, which is why this is the
job that noticed.

* libretro: build libnx as gnu++17 instead of patching around __STRICT_ANSI__

declarations back for Utilities/Socket.cpp. That was the narrower of the two
options and it only covered newlib: the job now reaches Lua and stops there,
because gcc's own limits.h leaves LLONG_MAX undefined in C++ mode when
__STRICT_ANSI__ is set, and luaconf.h reads that as "no long long":

  Lua/luaconf.h:572: error: #error "Compiler does not support 'long long'.
    Use option '-DLUA_32BITS' or '-DLUA_C89_NUMBERS'"

Both come from the same place, so take the other option instead. MESENFLAGS
lands after the global --std=c++17 in CXXFLAGS, so this stays scoped to
libnx; every other target keeps the dialect it had.

* Delete mesen2_libretro.so

libretro: give libnx the ipv6_mreq luasocket needs (#9)

libretro-build-libnx-aarch64 is the last red job on the buildbot, and it
dies in luasocket:

  Lua/options.c: In function 'opt_ip6_setmembership':
  Lua/options.c:399:22: error: storage size of 'val' isn't known
    399 |     struct ipv6_mreq val;

devkitA64's newlib declares in6_addr, sockaddr_in6 and the
IPV6_ADD_MEMBERSHIP / IPV6_DROP_MEMBERSHIP constants - the two callers a
few lines up compile, and the IN6ADDR_ANY_INIT fallback in inet.c already
leans on in6_addr being there - but it never declares the struct those
two options take.

There is no macro to test a struct tag for, so the shim keys off
__SWITCH__, and it declares luasocket_ipv6_mreq rather than filling in
struct ipv6_mreq so that a devkitA64 that grows the real one later cannot
collide with it. socket.h is where it goes because options.c is built on
every platform and only reaches usocket.h off Windows.

The layout is the one RFC 3493 fixes; checked against glibc, both are 20
bytes with the fields at 0 and 16, so the buffer handed to setsockopt()
is unchanged. Whether the Switch network stack honours IPv6 multicast
joins at runtime is a separate question - this only stops the option from
breaking the build for every other libnx user.

set core option to default to 44.1 khz

this was making everything 55 FPS instead of 60

libretro: give libnx the LLONG_MAX luaconf.h expects (#10)

With the ipv6_mreq shim from #9 in, the libnx job gets past Lua/options.c
and dies further along, in the first C++ translation unit that pulls in
lua.hpp:

  In file included from Lua/lua.h:16,
                   from Lua/lua.hpp:6,
                   from Core/Debugger/LuaCallHelper.h:3,
                   from Core/Debugger/LuaCallHelper.cpp:2:
  Lua/luaconf.h:572:2: error: #error "Compiler does not support 'long long'."

luaconf.h includes <limits.h> itself and then gates its LUA_INT_LONGLONG
branch on LLONG_MAX. devkitA64's newlib does not make that macro visible to
C++ translation units, so the branch falls through to the #error - while the
C files in the same build, which the -std=gnu++17 in CFLAGS does not apply
to, see it and compile.

The error suggests LUA_32BITS or LUA_C89_NUMBERS, but both change Lua's
integer type, and only on the Switch. GCC always predefines
__LONG_LONG_MAX__, so fill LLONG_MAX, LLONG_MIN and ULLONG_MAX from it
instead, guarded on __SWITCH__ and on the macro actually being absent.

Checked against glibc's limits.h: all three expressions compare equal to the
real LLONG_MAX, LLONG_MIN and ULLONG_MAX, and luaconf.h still parses from
both C and C++ with the block inert off-Switch.
2026-08-29 10:21:13 -05:00
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 ad0a1b9849 Lua: Misc. fixes & improvements (#250)
-Fixed getAccessCounters documentation (swapped param order)
-Fixed file watcher not being disabled properly when closing the script window, causing the script to run if changed on the disk, even if the script window is closed
-Prevent file watcher from triggering from writes done by the script window itself (which caused the script to be reloaded 2 or 3 times in a row)
-Fixed UI freezes when using emu.log() on a large table
-Fixed crash when 100k character limit (in the last 500 lines) for script log was reached (out of bounds read/write)
-Added "fps" value to "getState"
-Slightly improved getAccessCounters/getCdlData performance
-Added a new drawPixels API to improve performance when a script needs to draw a lot of individual pixels
2026-08-10 22:42:34 +09:00
SourMesen 7f418e352a Clang: Fixed all compilation warnings (#241)
-Some warnings were suppressed (undefined-inline and return-type-c-linkage)
-Warnings as errors was enabled to make CI builds fail when warnings are introduced
-Slightly altered the behavior of SnesCpu::IdleOrRead, but this should match what ares does
2026-08-01 13:40:07 +09:00
SourMesen 9219fab3ed Debugger: Profiler - Keep track of cycles executed while the CPU is halted (#243)
Also adds a "cpu usage" meter in the debugger window which appears when software makes uses of halt/wai/etc.
2026-08-01 12:10:12 +09:00
SourMesen e055ddee35 SNES: Added deinterlacing options (#224) 2026-07-24 14:50:15 +09:00
SourMesen 2d0fd5f1ac Movies: Added support to load BizHawk/GBAHawk movies (#228)
Supports NES, SNES and GBA (only default controllers, etc.). Most movies will likely not sync properly, but some do.
2026-07-19 01:30:07 -07:00
SourMesen 1c38575013 UI: Allow binding the numpad enter key separately from the left enter key (#223) 2026-07-17 17:47:52 -07:00
SourMesen 1489d34441 SNES: Added support for BlueRetro controller (#220)
This controller/adapter supports rumble as well as reading the state of both analog sticks and the L/R triggers.

Code by @RandalLinden
2026-07-16 05:10:26 -07:00
SourMesen e5075abe29 Runahead: Fixed issue causing runahead X to behave like runahead X-1 for all cores (except NES) (#219)
An additional frame's worth of input lag was added by runahead because of the timing at which it loads/saves the state vs when the inputs are polled (NES core was not affected due to the timing at which it polls controllers compared to other cores)

Also fixed a SNES-specific runahead issue when the game starts a very long DMA before vblank that ends after vblank, causing some frames to not be rendered at all and showing older frames instead (this is a rare scenario, but caused issues in Star Fox)
2026-07-15 05:09:22 -07:00
SourMesen 49c9a3a4ba GB: Added overclock and remove sprite limit options (#216) 2026-07-11 17:47:41 +09:00
SourMesen 5b71c4e072 SNES: Added "Remove sprite limit" option (#207) 2026-07-11 16:43:58 +09:00
SourMesen c660425d48 SNES: Added color correction options (#205) 2026-07-11 15:34:36 +09:00
SourMesen 8a7971397e GBA: Added support for MRC/MCR for CP14 (#196) 2026-07-02 15:54:24 +09: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 0532a2ec98 NES: Fixed issues with 2/4 player adapters (#194)
-The pachinko/subor mouse/ntt/virtual boy controllers could be selected in the UI for 2p/4p adapters, but did not work at all
-Keybindings for the "custom keys" for some controllers were not working when connected to a 2p/4p adapter
-Pachinko controller did not allow the user to configure the keybindings for NES-style buttons
2026-06-26 20:40:09 -07:00
SourMesen 142884b598 NES: Ignore consecutive reads to 4016/4017 (#185)
The NES (and AV Famicom) both ignore consecutive reads to 4016/4017 (when the reads on 2 consecutive CPU cycles). This implements that behavior when the corresponding console type is selected.
These changes also simplify the DMA code, because a lot of extra code was in the DMA logic to simulate the same result. Moving this logic to the 4016/4017 reads makes the code simpler and allows it to work properly when a regular instruction reads from 4016/4017 twice in a row, too.
2026-06-21 19:17:51 -07: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 c28dc969bd NES: Fixed screen size when loading a PAL game using the "Auto" aspect ratio (#168)
On the NES, loading a PAL game with the "auto" aspect ratio, powering off the console, and then loading a PAL game again would result in the screen being the incorrect aspect ratio/ratio, until the user's mouse goes over the menu, or the window is resized, etc. This was caused by the region being reset to NTSC when the game is unloaded, despite the screen keeping the PAL aspect ratio's dimensions,.
2026-06-06 11:16:56 -07:00
SourMesen 708edb9f8c Debugger: Fixed crash in debug builds when loading a save state while the debugger is opened (#167)
This only happened for NES games and only if the "integer fps" option was enabled.
2026-06-06 11:06:48 -07:00
Fiskbit 20ba206cef Version Update: 2.2.1 (#166) 2026-06-05 02:30:28 -07:00
SourMesen 317f89dbb2 Version Update: 2.2.0 (#164) 2026-06-03 23:29:37 -07:00
SourMesen 27da83d457 CI: Automatically run recorded tests to validate PRs and commits (#151) 2026-05-30 05:20:34 -07:00
SourMesen 8de35838d5 PCE: Support homebrew CD-ROM marker to automatically select SuperGrafx mode (#150) 2026-05-29 21:41:15 -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
SourMesen a13ae9a461 Code: Added naming style CI checks for C#/UI code (#132) 2026-05-22 20:43:13 +09:00
Adrian "asie" SiekierkaandSour 22424d7412 WS: Initial cartridge RTC implementation (#98)
* GBA: Separate S3511A RTC emulation code from GBA interface emulation code.

* WS: Initial cartridge RTC implementation.

* WS: Expose cartridge RTC state to register viewer.

* Code: Fix formatting.

* WS: Update Core.vcxproj.

* Fix compilation error, remove unused method

---------

Co-authored-by: Sour <[email protected]>
2026-05-19 05:50:19 -07:00
SourMesen 830ffc3b04 Video: Fixed "merge fields" issues (#129)
Phase should be 0 when this option is enabled, otherwise there's still jitter from one frame to another (though less obvious jitter)
Also made the GB/GBA/WS filters alternate between the 2 phases (SNES filter is used), which makes the colors look much better, even without merge fields enabled.
2026-05-19 00:02:25 -07:00
SourMesen 5314f4b699 CI: Update workflows, projects and tests (#125)
-Update workflow actions to latest version (to remove deprecation warnings) and fixed all other CI warnings
-Update MSVC projects to VS2026
-Update workflow to run on VS2026
-Update tests to include screenshot and use SHA1 hashes (instead of MD5)
2026-05-17 22:18:01 +09:00
Adrian "asie" Siekierka 5bb64aacf0 WS: Initial Pocket Challenge V2 support (#95)
The Pocket Challenge V2 is an education handheld based on the ASWAN SoC, as used in the WonderSwan. It uses the same boot ROM (with an early exit), but has some implementation changes:

    The LCD icon segment area is not present (on the display panel only).
    There is no onboard internal EEPROM.
    The input keypad layout differs.
    The headphone output is always used with a custom onboard DAC, as opposed to relying on the SoC's own PWM DAC for the internal speaker.

This PR implements support for all of this. Support for the PCv2-exclusive cartridge mapper (KARNAK) will be added by a separate PR.
2026-05-17 01:11:02 +09: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 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 d1cfdeb8ea PCE: Fixed CD-ROM playback for WAV files incorrectly interpreting the WAV header as audio samples (#107) 2026-05-12 22:14:50 -07:00
SourMesen 8b4f65dd16 PCE: Fixed PREGAP handling in .cue files, especially when a rom is split across multiple files (#108) 2026-05-12 21:58:08 -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
NovaSquirrel 4380777010 GB: Add GBC palette to memory viewer (#93) 2026-05-10 10:29:18 +09:00
NovaSquirrel 1e2b4b5755 SNES: Add support for NTT Data Keypad (#86)
* SNES: Add support for NTT Data Keypad

Also make it available on NES

* SNES: Disable Multitap for NTT Data Keypad for now
2026-05-05 19:23:29 -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 d5ed53d430 Tests: Ensure runahead is disabled for tests. (#76)
Recording a test with runahead enabled would record a somewhat broken test. This forces the runahead setting to 0 for test recording and playback.

Written by Sour.
2026-04-27 08:40:07 -07:00
SourMesen f3e124212f SNES: Added alternative blend mode option for high resolution modes (#63)
Blending even/odd columns only allows fake transparency effects to work while avoiding a blur effect on the picture. This however does not work well in all scenarios (e.g high resolution text in Secret of Mana menus)
2026-04-26 16:57:37 -07:00
Fiskbit a9f7c64e41 GB: Use correct BIOS when switching between GB and SGB. (#40)
When switching between GB and SGB models and then power cycling, the old BIOS would continue being used for the new model. This fixes that for GB and any other firmware where a similar problem may have come up.

Thanks to Sour for this fix.
2026-04-18 19:08:23 -07:00
Fiskbit 48e4cd469b Adds a new, default GB option to prefer the best model the game supports.
There was previously no auto option that would select the best model a game has any support for and which falls back to the original Game Boy if that's all the game can do. The "Auto (prefer Game Boy)" option would select Game Boy except when given a GBC-exclusive game. The new "Auto (prefer best)" option selects GBC if the game has any GBC support, SGB if it has any SGB support, and GB otherwise. This option is now selected by default.
2026-04-08 18:51:44 -07:00
Sour 5f6c362a93 WS: EEPROM - Add delay when processing read/write/erase commands 2025-07-13 20:58:09 +09:00
Sour 137ae7ce3b Version Update: 2.1.1 2025-07-06 15:37:59 +09:00
Sour 15afaae652 UI: Preserve aspect ratio in game selection previews 2025-07-06 08:17:15 +09:00
Sour 9808b0f2ca WS: Fixed regression for SDMA Control port
According to sound_dma, bit 7 can be read as set, but WSHSTest expects bit 7 to be clear after setting it. WSHSTest attempts to start the sound dma while length is 0, which might immediately clear the enable flag.
2025-06-25 22:19:16 +09:00
Sour 186e112c36 BPS: Fixed potential crashes when applying BPS patches 2025-06-24 20:56:40 +09:00
Sour 5350959230 SNES: Added new controller type that supports rumble 2025-06-23 10:26:31 +09:00
Sour aeed6e0693 PCE: Added support for CD+G discs
Adds support for subcode reads via 1807 (when a .sub file is provided) and implements the subcode irq
2025-06-15 19:32:44 +09:00