332 Commits
Author SHA1 Message Date
SourMesen 8ac7e1df7d Lua: Fixed address value in memory callbacks when using memory types other than the default cpu memory type (#265)
Also fixed a few scenarios where the PPU memory write callbacks did not allow the Lua script to change the value about to be written (because the callback was called too late)
2026-08-27 19:00:22 +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 918379b7a7 Debugger: Tilemap viewer - Added option to pick background color (#238)
Also, minor bug fixes for WS:
-Fixed tilemap viewer for sometimes using the wrong background color
-Fixed the 4-bit RGB color values in the palette viewer having the R and B values swapped
2026-07-28 19:55:12 +09:00
SourMesen 8fc682325c Debugger: Lua - Added getPressedKeys API (#236)
Also:
-Improved emu.log() to support tables/array and numeric values, instead of only strings.
-Fixed duplicate save state key name for GB
-Fixed TrimRight logic not working properly when the string had a single non-space character followed by spaces (e.g TrimRight("A ") returned "A ")
2026-07-28 19:54:00 +09:00
SourMesen e055ddee35 SNES: Added deinterlacing options (#224) 2026-07-24 14:50:15 +09:00
SourMesen 49c9a3a4ba GB: Added overclock and remove sprite limit options (#216) 2026-07-11 17:47:41 +09: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 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 a7910b9766 Windows: Fixed build error after latest MSVC update (VS2026 May update) (#127)
Also fixed GB PPU problem caused by the compiler changing how it builds this particular bit of code (which has been a problem in the past for the same code in the GB debug tools)
2026-05-18 21:15:29 +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 4380777010 GB: Add GBC palette to memory viewer (#93) 2026-05-10 10:29:18 +09:00
lidnariq ca54ec72c7 Remove Windows-1252 smart quotes in Game Boy APU comments (#87)
* GbNoiseChannel.cpp remove cp1252

* GbSquareChannel.cpp remove cp1252

* GbWaveChannel.cpp remove cp1252
2026-05-06 02:08:11 -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
SourMesen 4b8669d34b Debugger: Tilemap viewer - Fixed "edit tile" behavior on SNES when the tilemap is using 16x16 (or 16x8) tiles (#72)
Also, added support for horizontal/vertical mirroring when editing the mirrored tiles from the tilemap.
2026-04-27 09:18:53 -07:00
SourMesen 8e4dd329ac Debugger: Lua - Added new APIs: getCpuState, setCpuState, getMasterClock, getCpuCycleCount (#58)
getCpuState/setCpuState allow the same functionality as getState/setState, but limited to only the CPU's state, making them much faster (some performance optimizations to the serialization & Lua code were also done)
getMasterClock/getCpuCycleCount are very fast alternatives to getState when all the script needs is a cycle count.
2026-04-26 18:00:08 -07:00
Takumi Grainger 0d31d782a7 Clear GBC HDMA pending flag before processing DMA block (#34)
Fixes Championship Motocross 2001 Featuring Ricky Carmicheal
2026-04-14 13:48:18 -07:00
Fiskbit 8ff4b132d3 GB: Fix serial clocking regression. (#30)
Commit 36d23cc inverted the condition for calling ExecTimerDmaSerial, swapping the cycle parity so that ExecTimerDmaSerial could no longer handle serial data. This broke Shin Megami Tensei: Devil Children: Kuro no Sho in GB and SGB modes.

Tested with automated tests (no change) and Shin Megami Tensei: Devil Children: Kuro no Sho (no longer broken).

Thanks to paulb_nl for finding the cause of this issue and Sour for reviewing the commit that introduced the issue.
2026-04-12 17:42:36 -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 7d7b8e81fe Debugger: GB - Fixed tilemap viewer issue in Windows builds
Unsure why the resulting code is wrong with MSVC, but this appears to make it work.
2025-07-10 21:57:48 +09:00
Sour f5a957abf0 GBC: Fixed HDMA behavior when CPU is halted and then resumes
Fixes regression caused by the fix done for the hblank_vram_dma test rom.
HDMA should run immediately after the CPU resumes - fixes the menu in Nascar 2000
2025-07-02 21:49:20 +09:00
Sour 18e1aeabbd GB: MBC3 - Fixed some MBC3 RTC issues
-Reloading the ROM would incorrectly reload the old .rtc file and reset the time to what it used to be
-The day counter was never incremented when rolling over from 23:59:59 to 00:00:00
2025-05-06 18:39:37 +09:00
Sour de8a0819d6 Debugger: SNES - Fixed stack overflow crash when hitting a SPC breakpoint 2025-05-06 12:29:55 +09:00
Sour 36bd1611c6 Debugger: Catch up APU for all consoles when breaking, to allow register viewer/etc. to display up-to-date values 2025-04-03 22:41:27 +09:00
Sour 2e8ca044ec GB: Fixed HDMA not running on scanline 143
This fixes graphical issues in Warau Inu no Bouken (because some tiles were not being transferred to VRAM)
2025-03-23 13:33:45 +09:00
Sour 8c04e1ad6c GB: HDMA shouldn't run if CPU is halted
Fixes MagenTests/hblank_vram_dma test rom
2025-03-23 13:32:00 +09:00
Sour b844642866 Debugger: GB - Fixed tilemap viewer displaying incorrect tiles when the tile index is above 127
Seems to only happen in release builds in MSVC (unsure if other compilers were affected)
+ Also added missing member in GbCpuState in the UI
2025-03-23 13:16:31 +09:00
Sour 929d4dcc20 GB: Fixed APU emulation issues
-Super Mario Land 2 - Pops in menu are fixed by immediately updating APU output after a write
-Perfect Dark - Low voice volume is fixed by having the correct output when the channels are disabled (but DAC is still enabled)
-Daiku no Gen - Low voice volume is fixed by keeping square channel output to digital 0 (= analog 1) until its first tick after being enabled (the game does not let the channel tick at all while the voice sample is playing)
2025-03-21 23:03:01 +09:00
Sour 6334ef2a6a Debugger: GBC - Fixed crashes when memory viewer was opened and addresses FF76/FF77 were visible
This was causing the APU to run inside the UI thread, causing memory corruption/crashes
2025-03-11 17:50:19 +09:00
Sour e9a0e7aaa5 SGB: Improved logic to select row/bank to write pixels to
Uses hblank/vblank (when mode changes) to move to the next row/reset to the top of the screen
2025-03-02 13:23:07 +09:00
Sour 53f17745d7 SGB: Prevent freeze/lock up when resetting a MBC3 game that has a RTC clock 2025-03-02 11:25:21 +09:00
Sour 6f68db5c4b GB: Improved behavior when changing SCX in the middle of a scanline
Improves the results for the m3_scx_high_5_bits and m3_scx_low_3_bits tests, and fixes the effect in one of the scenes in the "Mental respirator" demo
2025-01-20 13:11:54 +09:00
Sour fd2c3fa46e GBC: Initialize palette RAM based on power on ram option
The "Vila Caldan Color" homebrew demo (?) doesn't initialize the OBJ palette and would likely get non-deterministic OBJ colors on hardware
2025-01-20 13:04:41 +09:00
Sour be66075519 GB: Fixed freeze during Batman - The Video Game's title screen animation 2025-01-20 12:59:27 +09:00
Sour 614e61a2d1 Debugger: Fixed issues with step over/out in some scenarios (bank swapping, recursive functions, etc.)
Only break when both the stack pointer and the return address match what the debugger was expecting, instead of just the return address
2024-12-07 17:46:28 +09:00
Sour 0f08c71c5a GB: Improved header detection for MMM01 games to avoid misdetecting other roms 2024-10-23 17:29:10 +09:00
Sour af78010bc2 GB: Fixed white pixels appearing on screen in CGB mode when writing to $FF47 2024-10-23 16:27:21 +09:00
Sour d751502a58 NES: Added Rainbow support (mapper 682) 2024-10-08 21:37:44 +09:00
Sour c5406773a0 Added WonderSwan support 2024-09-19 21:19:43 +09:00
Sour e79e655d3b Debugger: Event Viewer - Added missing address/value for some event types (marked breakpoints, etc.) 2024-09-12 17:11:56 +09:00
Sour 485c20492b GB: M161 support 2024-07-20 19:37:48 +09:00
Sour 00a592cade GB: MMM01 support 2024-07-20 19:22:36 +09:00
Sour 640a215cbb GB: Added support for MBC5 rumble feature 2024-07-13 20:50:57 +09:00
Sour 0056e59149 Debugger: GB - Fixed screen sometimes turning black when STOP instruction was shown in the disassembly 2024-07-07 20:57:11 +09:00
Sour 8f94cbe64f GB: MBC7 - Accelerometer and eeprom support 2024-07-07 20:36:45 +09:00
Sour caaf8ed8e8 GB: Added basic support for gbx files 2024-07-06 17:54:34 +09:00
Sour 074034aa66 Debugger: Use cpu-specific cycle counts for profiler data
Fixed SNES co-processors (including the SPC) reporting their profiling data based on SNES master clocks, which wasn't accurate/reliable
2024-06-23 16:21:49 +09:00
Sour ff2708d72c Debugger: SGB - Hide step back button in SGB mode
Step back on the GB core while running inside the SNES core is not supported
2024-06-01 14:47:09 +09:00
Sour f80ee42c73 GB: Fixed BG color when BG layer is disabled and BGP doesn't set index 0 as color 0
Fixes title screen in Megami Tensei Gaiden
2024-05-24 16:34:13 +09:00
Sour e1eaaf71ef GB: Fixed SGB issue when GB is powered off and then back on
Some state was not being reset properly, causing an issue with the GB logo in Akumajou Dracula in SGB mode
2024-05-13 23:22:10 +09:00