160 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 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 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 05d74e7e40 Debugger: GBA - Show byte code as a single 16/32-bit value (#242)
Misc fixes:
-Fixed issues with the opcode tooltip not appearing for some GBA instructions (esp. when the condition code ends with an 's', e.g: rsbcs, movls, subcs)
-Fixed byte code not being lower case when the "use lower case" option is enabled
2026-08-01 12:09:15 +09:00
SourMesen fd32321313 Debugger: Added "copy to clipboard" option for tilemap, tile, sprite and event viewer (#240) 2026-08-01 12:08:49 +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 40335ce735 UI: Update to Avalonia 12, .NET 10 and replace ReactiveUI with MVVM community toolkit (#142)
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
2026-07-03 16:04:42 +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 95ceb59d48 Debugger: Enforce 64kb maximum length for labels in all scenarios (#177)
When importing labels via .dbg/.elf/etc. files, the 64kb length limit for labels was ignored.
This prevents several performance problems when a label is defined as having a length of e.g 1+mb
2026-06-16 22:35:17 +09:00
SourMesen dc2cda6c51 Debugger: Memory search usability improvements (#173)
-Removed the confusing/hard-to-use "previous refresh value" "compare to" option
-The "last value" column now shows the values that "previous search value" will compare against
-Added "update values" button to apply an empty filter that does not hide any addresses, but updates the "last value" that will be used for subsequent filters
2026-06-15 17:47:49 -07:00
SourMesen 7c29fb4006 Debugger: Tilemap viewer - NES - Fixed the "Changes" highlight mode for NT/AT data (#159)
Did not work at all following a change done ~3 years ago to improve the tilemap viewer's performance
2026-06-02 23:11:49 -07:00
Fiskbit e222f0fcad NES: Fix header editor units bugs. (#157)
The header editor was treating MB units as KB, and its error checking was showing errors for MB sizes between 8 and 59 that were not a multiple of 4 because it was treating them as KB sizes.
2026-06-02 23:02:39 -07:00
SourMesen c3e4a3e77b Debugger: Find all occurrences - Fixed duplicated results when searching a function label that contains a multi-line comment (#134) 2026-05-24 19:36:50 -07:00
SourMesen a13ae9a461 Code: Added naming style CI checks for C#/UI code (#132) 2026-05-22 20:43:13 +09: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 9616f36f89 Debugger: Console-specific scanline/cycle refresh values (#65)
* Debugger: Console-specific scanline/cycle refresh values

* Fixed some issues with min/max values when switching console types
2026-04-26 17:06:01 -07:00
SourMesen 6dcd959e76 Debugger: NES - Header editor - Support PRG/CHR sizes below 1 KB (#52)
+Fixed some incorrect/missing validations
+Disable save button when an error message is shown
+Fixed .nes load logic ignoring PRG/CHR sizes from NES 2.0 headers (was getting overriden by game DB)
2026-04-26 03:27:13 -07:00
Fiskbit 0d65cfc770 Tool: Makes header editor work with archived/soft-patched ROMs. (#31)
The NES header editor is currently unable to save a ROM if it was loaded from an archive (such as .zip) or if the ROM was soft-patched. This is because the editor reloads the ROM from disk to then apply the new header and save a copy, but the C# compnent is not able to open archives or apply patches. If the ROM file is in an archive, it throws an Unexpected Error and fails.

This change instead makes the editor use the current PRG and CHR ROM. This means it doesn't need to reload the ROM, so it can save it regardless of how it was loaded. It also means that it saves any changes that have been made to the ROM in the session, either by self-flashing or by editing them via tools, which could be seen as a pro or a con. Also, because Mesen does not currently use misc ROM, it is unable to include that in the saved ROM, but this is something we could feasibly add later.

This change was written by Sour.
2026-04-14 19:51:02 -07:00
NovaSquirrel 2ea2ed729c Debugger: Add "Vertical" tile layout option 2026-02-26 23:20:18 -05:00
Sour 4db2004745 Debugger: NES - Keep emulation paused when opening the header editor if no other debug tools are opened 2025-07-12 08:54:35 +09:00
Sour a59caeec90 Debugger: Event Viewer - Fixed missing labels for port reads/writes on WS/SMS 2025-07-01 22:37:51 +09:00
Sour e2043a8b09 Debugger: GBA - Fixed BG preset numbering to match other tools 2025-05-14 20:09:31 +09:00
Sour 88910e7f7d Debugger: Fixed crash/incorrect options when opening Tile Viewer via "View in Tile Viewer" when a preset was selected in the tile viewer the last time it was opened 2025-05-06 14:58:40 +09:00
Sour 176f14ae33 GBA: Fixed missing sprites in Guranbo's character name screen
The game sets the sprites to obj mode 3 (by mistake?), which is an unused "stereoscopic" mode for sprites. Mode 3 seems to behave like mode 0 when the global "stereoscopic" flag is not set (previously "green swap"), so the sprites are meant to display normally in this scenario (instead of being hidden like they were before)
2025-04-26 18:20:47 +09:00
Sour 537f042d86 Debugger: Viewers - Fixed context menu keybindings not working
Caused by the fix for scrollbars getting reset to 0, 0
2025-04-09 18:51:34 +09:00
Sour 1975ab958c Debugger: Fixed crashes when switching between games from different consoles (in AOT build)
Caused by what looks like slight differences between how AOT treats an empty array (vs JIT builds) when it marshals the array (AOT sends a null pointer, JIT sends a pointer to an empty array)
This was causing issues in both builds (AOT crashed immediately because of the null pointer, JIT read from out-of-bounds memory)
2025-03-28 18:03:30 +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 c4472f3a4d Debugger: Make shift+home/end select rows in disassembly/source view and trace logger 2025-03-23 15:36:51 +09:00
Sour e79db8fcac Debugger: Sprite viewer - Fixed rare crash when reloading rom that could happen because debugger is being reinitialized while the sprite list is being fetched by the UI 2025-03-21 23:29:28 +09:00
Sour e12f40ae3b Fixed compilation warning 2025-03-19 22:29:07 +09:00
Sour d324582c6f Debugger: Script window - Added option to show line numbers 2025-03-18 21:48:09 +09:00
Sour 9fcfc1ecde Debugger: SNES - Fixed incorrect addresses for HDMA reads/writes on the event viewer 2025-03-11 19:28:14 +09:00
Sour 5823761791 SMS: Implemented fairly accurate sprite eval+fetch timings, for all modes
+ Fixed VRAM read to wait until next available CPU access slot
+ Fixed NMI triggering on the wrong scanline on SMS
+ Fixed NMI issues on ColecoVision
+ Fixed random ram option not working properly on SG-1000
+ Added "Mem access" tab to tilemap viewer to see fetch patterns
2025-03-01 00:09:36 +09:00
Sour 081ae70167 Debugger: NES header editor - Fixed blank VS PPU Type value when VS System Type was not the default value 2025-02-12 17:06:38 +09:00
Sour a574032c8f Debugger: Fixed crash when trying to use the "Edit selected code" on a block start/end header 2025-02-05 17:36: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 1e3422b69e Debugger: Profiler - Show [irq]/[nmi] markers on functions 2024-12-17 18:51:01 +09:00
Sour 86cac326d7 Debugger: Tile editor - Improved behavior when editing tiles from a tilemap in games that bankswitch vram in the middle of the screen
-Also allows cropping the edit window when the size doesn't fit (e.g using 4x4 near the bottom of the screen can result in a 4x2 edit window, etc.)
-Fixed a display issue when the number of edited columns & rows didn't match
2024-12-14 23:19:02 +09:00
Sour e2ea8438f2 Debugger: Added edit 8x8 tile option in tilemap/tile viewers 2024-12-14 22:38:12 +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 8d49d0ea54 Debugger: Label list - Toggle breakpoint on ram labels should create RWX breakpoints 2024-12-08 17:22:51 +09:00
Sour d94646590d Debugger: Source View - Fix selected file/scroll position being incorrect after manually loading a symbol file when the source view tab was already visible 2024-12-08 16:48:01 +09:00
Sour 962a1445c7 Debugger: Source View - Auto-switch to disassembly when no source mapping is found for the current statement
Auto-switch back to source view once a mapping is found again
2024-12-07 21:11:38 +09:00
Sour e52fa70944 Debugger: Source View - Improve active row behavior when multiple mirrors exist
+ Automatically move to current address when clicking on the source view tab (so that the active row is shown after manually loading a symbol file, etc.)
2024-12-07 20:00:24 +09:00
Sour be41cdeaeb Debugger: Update CDL stats while running when "refresh while running" is enabled
+ Optimize CDL stats calculation
2024-12-01 14:51:56 +09:00
Sour 21a279e1fe Debugger: Event Viewer - Fixed incorrect breakpoint information for marked breakpoints for multi-cpu consoles/games 2024-11-28 16:40:07 +09:00
Sour a91f8ecf73 Debugger: Source View - Added tab size option 2024-11-14 19:38:52 +09:00
Sour da6ff36c2a Debugger: Memory viewer - Fixed issues with search window caused by recent memory leak-related fixes 2024-11-12 18:43:51 +09:00
Sour 25825df619 Debugger: Fixed source view not updating correctly in some scenarios when debugger hits a breakpoint
Specifically, this happened if the breakpoint was already visible on screen and was associated to an address that wasn't mapped when the source view was last updated
2024-11-07 19:04:49 +09:00