Skip to content
Prev Previous commit
Next Next commit
32X GDB stub commit
  • Loading branch information
Genos3 committed May 21, 2025
commit 703966fbd7ae37e650ef4cd5d32143867d01d809
10 changes: 6 additions & 4 deletions ares/md/m32x/sh7604.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ auto M32X::SH7604::unload() -> void {

auto M32X::SH7604::main() -> void {
if (GDB::server.hasActiveClient && m32x.shm.active()) {
if (m32x.vdp.vblank != vblank_state) {
if (!GDB::server.reportPC(regs.PC)) {
GDB::server.updateLoop();
return;
} else if (m32x.vdp.vblank && !vblank_state) {
GDB::server.updateLoop();
vblank_state = m32x.vdp.vblank;
}

if (!GDB::server.reportPC(regs.PC)) return;
}

if(!m32x.io.adapterReset) return step(1000);
Expand Down Expand Up @@ -76,6 +76,8 @@ auto M32X::SH7604::step(u32 clocks) -> void {
cyclesUntilM68kSync -= clocks;

m32x.vdp.framebufferWait -= min(clocks, m32x.vdp.framebufferWait);

vblank_state = m32x.vdp.vblank;

if(cyclesUntilSh2Sync <= 0) {
cyclesUntilSh2Sync = minCyclesBetweenSh2Syncs;
Expand Down