1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-22 14:33:51 +00:00

runToVsync()

This commit is contained in:
Steven Hugg 2019-08-26 23:31:39 -04:00
parent 657303a1f6
commit 00b91acae3
2 changed files with 12 additions and 1 deletions

View File

@ -89,6 +89,7 @@ export interface Platform {
disassemble?(addr:number, readfn:(addr:number)=>number) : DisasmLine;
readAddress?(addr:number) : number;
readVRAMAddress?(addr:number) : number;
setFrameRate?(fps:number) : void;
getFrameRate?() : number;
@ -108,7 +109,6 @@ export interface Platform {
getOriginPC?() : number;
newCodeAnalyzer?() : CodeAnalyzer;
setRecorder?(recorder : EmuRecorder) : void;
advance?(novideo? : boolean) : void;
showHelp?(tool:string, ident?:string) : void;
@ -218,6 +218,7 @@ export abstract class BaseDebugPlatform extends BasePlatform {
debugTargetClock : number = 0;
debugClock : number = 0;
breakpoints : BreakpointList = new BreakpointList();
frameCount : number = 0;
abstract getCPUState() : CpuState;
abstract readAddress(addr:number) : number;
@ -246,6 +247,7 @@ export abstract class BaseDebugPlatform extends BasePlatform {
this.debugClock = 0;
this.onBreakpointHit = null;
this.clearBreakpoint('debug');
this.frameCount = 0;
}
setDebugCondition(debugCond : DebugCondition) {
this.setBreakpoint('debug', debugCond);
@ -275,6 +277,7 @@ export abstract class BaseDebugPlatform extends BasePlatform {
this.debugClock = 0;
}
}
this.frameCount++;
}
pollControls() {
}
@ -355,6 +358,12 @@ export abstract class BaseDebugPlatform extends BasePlatform {
}
});
}
runToVsync() {
var frame0 = this.frameCount;
this.runEval( () : boolean => {
return this.frameCount > frame0;
});
}
}
////// 6502

View File

@ -288,3 +288,5 @@ export class ProbeRecorder implements ProbeAll {
}
// TODO: handle runToVsync() without erasing entire frame