mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-08-09 09:25:27 +00:00
fixed debugging w/ input events
This commit is contained in:
@@ -266,21 +266,21 @@ export abstract class BaseDebugPlatform extends BasePlatform {
|
||||
this.resume();
|
||||
}
|
||||
preFrame() {
|
||||
}
|
||||
postFrame() {
|
||||
if (this.debugCallback) {
|
||||
if (this.debugBreakState) {
|
||||
// reload debug state at end of frame after breakpoint
|
||||
this.loadState(this.debugBreakState);
|
||||
} else {
|
||||
// save state every frame and rewind debug clocks
|
||||
this.debugSavedState = this.saveState();
|
||||
this.debugTargetClock -= this.debugClock;
|
||||
this.debugClock = 0;
|
||||
}
|
||||
// save state before frame, to record any inputs that happened pre-frame
|
||||
if (this.debugCallback && !this.debugBreakState) {
|
||||
// save state every frame and rewind debug clocks
|
||||
this.debugSavedState = this.saveState();
|
||||
this.debugTargetClock -= this.debugClock;
|
||||
this.debugClock = 0;
|
||||
}
|
||||
this.frameCount++;
|
||||
}
|
||||
postFrame() {
|
||||
// reload debug state at end of frame after breakpoint
|
||||
if (this.debugCallback && this.debugBreakState) {
|
||||
this.loadState(this.debugBreakState);
|
||||
}
|
||||
}
|
||||
pollControls() {
|
||||
}
|
||||
nextFrame(novideo : boolean) {
|
||||
|
@@ -248,7 +248,7 @@ export class AnimationTimer {
|
||||
} catch (e) {
|
||||
this.running = false;
|
||||
this.pulsing = false;
|
||||
throw new EmuHalt(e);
|
||||
throw e; // TODO: throw EmuHalt hides stack trace
|
||||
}
|
||||
}
|
||||
if (this.useReqAnimFrame)
|
||||
|
@@ -1693,7 +1693,7 @@ function installErrorHandler() {
|
||||
var msgstr = msgevent+"";
|
||||
console.log(msgevent, url, line, col, error);
|
||||
// emulation threw EmuHalt
|
||||
if (error instanceof EmuHalt || msgstr.indexOf("CPU STOP") >= 0) {
|
||||
if (error instanceof EmuHalt || msgstr.indexOf("CPU STOP") >= 0) { // TODO
|
||||
showErrorAlert([ {msg:msgstr, line:0} ]);
|
||||
uiDebugCallback(platform.saveState && platform.saveState());
|
||||
setDebugButtonState("pause", "stopped");
|
||||
|
Reference in New Issue
Block a user