170 Commits
Author SHA1 Message Date
SourMesen a33b8b2712 Debugger: GSU - Added profiler support (#261)
This is implemented by pretending every 16 bytes in ROM is a different function, allowing the profiler to display cycle counts for each individual "function" in the UI
Also fixes a missing call to ResetFlags for the merge opcode for FX3
2026-08-27 19:00:55 +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 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 d7ad2aab8a SNES: Added support for FX3 (new release of Doom) (#222)
Also fixed a crash in the SNES event viewer when overclocked and slightly improved performance for GSU games

FX3 code by @RandalLinden
2026-07-18 12:01:33 +09:00
SourMesen 46be3cc430 Debugger: SNES - Fixed DSP-n trace logger not logging the correct instructions (#186)
Also fixes missing "exec" highlight for "DSP-n Program ROM" in the memory viewer
2026-06-21 20:33:41 +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
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
Sour 0ae5f26d0c Debugger: GBA - Realign disassembly to multiples of 4 bytes when disassembling unknown blocks in ARM mode 2025-06-17 21:20:22 +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 acbe931ba0 Debugger: SNES - Added break on options for SPC
Break on BRK, STOP/SLEEP
2025-03-27 23:46:36 +09:00
Sour 0dbe874fa4 Debugger: Sprite Viewer - SNES - Fixed crash when EnableOamPriority flag was set
startIndex could be set to 128+, depending on the oam address, which caused memory corruption
2025-03-21 23:31:07 +09:00
Sour f359b80eb5 Debugger: Assembler - Allow using #label syntax on NES/SNES/PCE
This used to be allowed in Mesen-S
2025-03-13 18:32:46 +09:00
Sour 09cd8b7cec Debugger: GSU - Fixed trace log not logging the correct instructions in some scenarios 2025-02-15 20:09:02 +09:00
Sour 031cb7058c Debugger: Fixed issues with NES/SNES/PCE assemblers
-Labels defined within the assembler that were referred to before their definition did not work properly and ended up being assigned the wrong value (when the label's address wasn't a value between 0x100 and 0xFFFF) - this is fixed by running multiple passes until the resulting byte code stops changing.
-Fixed issues where e.g EOR $00, Y would be assembled as a 2-byte instruction, which is invalid.
2025-02-06 21:20:24 +09:00
Sour 8d6830a70a SNES: Add support for ST018 coprocessor
Used by a single game: Hayazashi Nidan Morita Shougi 2
2024-12-29 23:41:52 +09:00
Sour 8ad34343ba Debugger: Prevent UI freeze when viewer updates pile up and end up taking up 100% of the UI thread's time
Prevent queueing another update while the previous update is still running, which should prevent most issues.
Also slightly improves performance for the SNES tilemap viewer (which was causing the freeze when displaying an 8bpp 1024x1024 tilemap)
2024-12-10 18:59:13 +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 3873078053 Debugger: SNES - Fixed crash when resetting console with debugger active 2024-11-07 18:46:20 +09:00
Sour d751502a58 NES: Added Rainbow support (mapper 682) 2024-10-08 21:37:44 +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 14123a1884 Debugger: Sprite Viewer - Added option to dim offscreen sprites in the left-hand grid
+ Added "Visible" column to sprite list
+ Fixed some layout issues in > 100% dpi modes
2024-07-14 14:33:10 +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 d9f1d486a3 Debugger: SNES - Fixed palette display for mode 0 layers in tilemap viewer 2024-04-27 12:14:45 +09:00
Sour 13acb3fe42 Added GBA support 2024-03-30 11:42:31 +09:00
Sour aa9c459630 Debugger: Step Back - Allow stepping back 1 scanline/frame at a time + remove restriction that caused step back to only work for up to 30 frames 2024-01-26 23:39:31 +09:00
Sour 5308983ebb Added SMS/GG/SG-1000 support 2023-12-14 22:23:27 +09:00
Sour 3c94fe6245 Debugger: SNES - Fixed effective address display for indirect JMP
Effective address always had the upper 8 bits of the address as 0 instead of using the current value of K
2023-11-29 17:56:25 +09:00
Sour 13be4e8d99 Debugger: SNES - Fixed crash in GSU debugger when negative jump target wraps past 0 2023-11-16 17:11:15 +09:00
Sour 9751fbdf06 Debugger: SNES - Fixed jump address in disassembly for DBNZ Y,[...] 2023-11-14 21:05:10 +09:00
Sour eb17aab85d Debugger: Sprite viewer - Added option to change background color 2023-09-26 18:58:50 +09:00
Yuri Kunde Schlesner 9538c90698 Debugger: SNES - Treat BRL as an unconditional jump (#29) 2023-08-18 11:51:43 +09:00
Sour 2822ca5dd0 SNES: Implement broken vertical mirroring for rectangular sprites (same as hardware) 2023-07-23 13:38:15 +09:00
Sour 0a6814d881 Debugger: Assembler - Fixed assembler issues for NES/SNES/PCE when using "edit selected code"
Original byte code did not match the assembler's code based on the assembly code in some scenarios
2023-07-10 18:45:46 +09:00
Sour 4580c667a8 Debugger: Lua - Fixed memory callbacks for GB and snes coprocessors 2023-06-19 21:06:08 +09:00
Quinton Miller a4d3d30755 Debugger: Lua - Fixed memory callbacks for SPC 2023-06-19 20:36:15 +09:00
KungFuFurby 8a08187d6c Debugger: SPC - Add TCALL and PCALL opcodes to list of subroutine opcodes in SPC debugger (#20) 2023-05-12 21:26:20 -04:00
Sour 01384245ba Debugger: Fixed assembler issues when using labels with relative jumps
Affects NES, SNES, PCE
2023-04-18 20:53:32 -04:00
Sour 4119de9e9c Debugger: Event viewer - Added right-click menu options for viewer/list 2023-04-16 22:30:47 -04:00
Sour 44233413a1 Debugger: Prevent load state/reset counters from triggering uninit ram read break on all reads 2023-04-15 15:34:24 -04:00
Sour 7090fcdb71 Debugger: Warn when "save rom as" fails 2023-04-11 22:33:02 -04:00
Sour 28b03d8434 Debugger: SNES - Fixed RMW instructions not displaying the correct address/value in 16-bit mode 2023-04-04 17:46:57 -04:00
Sour 7ca3ae781e Debugger: SPC - Invalidate instruction cache on writes even when option to ignore read/writes is turned on 2023-01-29 18:59:46 -05:00
Sour ef1023ed1f SNES: SPC - Fixed issues with STOP/SLEEP instructions
-Fixed execution not stopping right after stop/sleep until the spc finished catching up to the main cpu
-Force dummy spc to running state when used to get effective addreses, etc.
2023-01-29 18:59:46 -05:00
Sour 174e31cd5a Debugger: Fixed pause/break freezes/issues when CPU is halted 2023-01-27 16:14:58 -05:00
Sour 2e2d6b8db3 Debugger: SNES - Fixed crash when opening the debugger on some SA-1 games
Crashed whenever the SA-1 processed an interrupt
2023-01-26 17:27:48 -05:00
Sour 1cfaaaae98 Debugger: Fixed NEC DSP TODOs 2023-01-24 19:45:08 -05:00
Sour fe90b4571d Fixed misc code TODOs 2023-01-24 18:05:50 -05:00