1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-04-20 00:17:04 +00:00

reload debug break state before resuming, fixes frame de-sync problem

This commit is contained in:
Steven Hugg
2022-09-06 19:32:02 -05:00
parent 58e3f3f9fb
commit 162113b915
3 changed files with 20 additions and 2 deletions
+15
View File
@@ -194,6 +194,21 @@ async function testPlatform(platid, romname, maxframes, callback) {
}
assert.equal(clks, proberec.countClocks());
}
// debugging
let bpState = null;
if (platform.setupDebug) {
let stated1 = platform.saveState();
platform.setupDebug((state,msg) => {
bpState = state;
});
if (platform.step) platform.step();
platform.nextFrame();
platform.clearDebug();
let stated3 = platform.saveState();
assert.ok(bpState);
console.log(stated1.c.PC, bpState.c.PC, stated3.c.PC);
assert.equal(stated1.c.PC, stated3.c.PC);
}
// debug tree
if (platform.getDebugTree != null) {
var dbgtree = platform.getDebugTree();