42 Commits
Author SHA1 Message Date
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
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
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
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 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 bbc1087888 GB: Fixed crash in Super Mario Land 2 in GBC mode
When entering Wario's castle, the game frequently crashed in GBC mode.  This was caused by the different timing for the rendering idle cycles - making the GBC timing identical to the GB fixed the crash (and other minor adjustments fixed the couple of GBC test roms that broke as a result)
2024-05-13 20:41:15 +09:00
Sour 0ea8d88a05 GB: Implemented GBC LCDC glitch required to pass cgb-acid-hell test 2024-01-30 22:23:12 +09:00
Sour 36d23cc47d GB: Performance tweaks 2024-01-23 22:26:01 +09:00
Sour bc3b265e3e GB: Improve BGP mid-scanline writes behavior + tweak halt timing for CGB
ppu_scanline_bgp and m3_bgp_change tests display the correct result
2024-01-23 22:26:01 +09:00
Sour 7af69362e8 GB: Tweak halt IRQ detection timing, change ppu vs cpu order of operation 2024-01-23 22:26:01 +09:00
Sour 79915cc557 GB: Remove unnecessary data from save states 2023-12-27 23:27:07 +09:00
Sour d9ae147639 GBC: Fixed read/write behavior for some registers
Fixes "OR mask for GBC registers" test
2023-05-12 23:25:23 -04:00
Sour 5ff7d29ffe GB: Added CGB speed change delay
Matches speed_switch_timing_stat (but not speed_switch_timing_ly) - probably not quite accurate but better than no delay at all
2023-03-10 20:32:09 -05:00
Sour a9081985b5 GB: Reset DIV when CPU speed is toggled on CGB
Fixes speed_switch_timing_div test
2023-03-10 18:10:30 -05:00
Sour b147bc67d3 GB: Implemented OAM corruption bug 2023-02-26 23:47:27 -05:00
Sour cbd90e5309 GB: Fixed OAM DMA behavior when reading from >= $FE00
Fixes sources-GS test
2023-02-25 23:50:50 -05:00
Sour 176451ffbb GB: Improved DMA conflict handling, passes "bully" test 2023-02-25 22:35:13 -05:00
Sour d765f3f37c SGB: Trigger joypad interrupt when SGB updates the GB's input 2023-01-26 19:14:51 -05:00
Sour 1df7d9aeac Debugger: Added freeze address option in memory viewer 2022-09-25 19:56:02 -04:00
Sour 135cab16d2 Debugger: Trace logger - Fixed missing cpu cycle counter for GB 2022-09-19 18:15:12 -04:00
Sour c90181c1a2 Refactoring - Moved some GB/PCE files into subfolders 2022-09-08 22:23:30 -04:00
Sour 7108bdde36 Refactoring - Moved some leftover files out of the root folder 2022-09-08 21:48:49 -04:00
Sour 152abf690b Rename stdafx.h to pch.h 2022-09-08 21:29:52 -04:00
Sour c8a10c8991 Debugger: Fixed issues with label tooltips for cpu registers 2022-08-30 13:45:08 -04:00
Sour b456170551 Save states: Serializer rework/rewrite 2022-07-20 00:40:32 -04:00
Sour e855d0466e PCE: Add support for cheat codes 2022-05-09 18:16:16 -04:00
Sour a79a13eca2 Cheats: Added UI and implemented cheats in core 2022-03-30 12:28:53 -04:00
Sour 50cdababc0 Debugger: Implemented predictive breakpoints for GB 2022-02-20 22:25:35 -05:00
Sour d754364b26 Debugger: Memory mappings (NES/GB) 2022-01-31 23:20:48 -05:00
Sour 8b142de54a Input: Gameboy input config (core & UI) 2022-01-29 14:43:41 -05:00
Sour dffbd4921a Refactoring: Renamed SnesMemoryType 2022-01-22 12:16:10 -05:00
Sour 0b228f5951 Refactoring: Added Snes prefix to files/classes 2022-01-22 11:55:17 -05:00
Sour 0d78c064f3 Core: Reduce shared_ptr usage, refactor netplay code to remove static instances 2022-01-21 21:25:33 -05:00
Sour 811696f06f Tile viewer refactoring/improvements 2021-06-21 14:56:41 -04:00
Sour 12bf5c5e1b NES/GB/SNES config, audio filters 2021-04-11 18:50:31 -04:00
Sour e27e511558 File reorganization 2021-04-09 21:45:04 -04:00
Sour c7ef756b3f Code reorganization (GB) 2021-04-09 19:13:47 -04:00
Sour 62efa091a8 Gameboy 2021-04-05 00:05:06 -04:00
Sour 70c9a39f3d Step 3 - compiles 2021-04-04 10:53:17 -04:00
Sour 86eb84cce0 Step 2 - fix includes, etc. 2021-04-03 23:16:13 -04:00
Sour 6cee666602 Step 1 - Move files 2021-04-03 21:09:05 -04:00