vcs: fixed instant replay, KIL ($02) instruction
This commit is contained in:
parent
8af418fca4
commit
5b7e0a6330
|
@ -203,6 +203,7 @@ can't modify/delete an include file if project doesn't compile
|
||||||
Probing
|
Probing
|
||||||
- probe log doesn't start @ reset
|
- probe log doesn't start @ reset
|
||||||
Debug, play then halt cpu doesn't highlight final line
|
Debug, play then halt cpu doesn't highlight final line
|
||||||
|
vcs: input not preserved when replaying frames?
|
||||||
|
|
||||||
|
|
||||||
WEB WORKER FORMAT
|
WEB WORKER FORMAT
|
||||||
|
|
|
@ -36,7 +36,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||||
<!-- firebase libs -->
|
<!-- firebase libs -->
|
||||||
<script defer src="https://www.gstatic.com/firebasejs/8.3.2/firebase-app.js"></script>
|
<script defer src="https://www.gstatic.com/firebasejs/8.3.2/firebase-app.js"></script>
|
||||||
<script defer src="https://www.gstatic.com/firebasejs/8.3.2/firebase-auth.js"></script>
|
<script defer src="https://www.gstatic.com/firebasejs/8.3.2/firebase-auth.js"></script>
|
||||||
<script defer src="https://www.gstatic.com/firebasejs/8.3.2/firebase-database.js"></script>
|
<!--<script defer src="https://www.gstatic.com/firebasejs/8.3.2/firebase-database.js"></script>-->
|
||||||
<script defer src="config.js"></script>
|
<script defer src="config.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 977bf9ca6c284dc27a3c4e27cc1ee49f22c934de
|
Subproject commit 9d124f087e1f0c7f74f9244b9679cc62e71fa524
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { Platform, BasePlatform, cpuStateToLongString_6502, BaseMAMEPlatform, EmuRecorder, dumpStackToString, DisasmLine, CpuState } from "../common/baseplatform";
|
import { Platform, BasePlatform, cpuStateToLongString_6502, BaseMAMEPlatform, EmuRecorder, dumpStackToString, DisasmLine, CpuState, DebugCondition } from "../common/baseplatform";
|
||||||
import { PLATFORMS, RAM, newAddressDecoder, dumpRAM } from "../common/emu";
|
import { PLATFORMS, RAM, newAddressDecoder, dumpRAM, EmuHalt } from "../common/emu";
|
||||||
import { hex, lpad, tobin, byte2signed } from "../common/util";
|
import { hex, lpad, tobin, byte2signed } from "../common/util";
|
||||||
import { CodeAnalyzer_vcs } from "../common/analysis";
|
import { CodeAnalyzer_vcs } from "../common/analysis";
|
||||||
import { disassemble6502 } from "../common/cpu/disasm6502";
|
import { disassemble6502 } from "../common/cpu/disasm6502";
|
||||||
|
@ -84,6 +84,11 @@ class VCSPlatform extends BasePlatform {
|
||||||
self.updateRecorder();
|
self.updateRecorder();
|
||||||
self.probe.logNewFrame();
|
self.probe.logNewFrame();
|
||||||
this.oldClockPulse();
|
this.oldClockPulse();
|
||||||
|
// look for KIL instruction
|
||||||
|
if (Javatari.room.console.getCPUState().o == 0x02) {
|
||||||
|
Javatari.room.console.onBreakpointHit(Javatari.room.console.saveState());
|
||||||
|
throw new EmuHalt("CPU STOPPED");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// intercept TIA end of line
|
// intercept TIA end of line
|
||||||
var videoSignal = console.tia.getVideoOutput();
|
var videoSignal = console.tia.getVideoOutput();
|
||||||
|
@ -100,7 +105,7 @@ class VCSPlatform extends BasePlatform {
|
||||||
var x = e.pageX - vcanvas.offset().left;
|
var x = e.pageX - vcanvas.offset().left;
|
||||||
var y = e.pageY - vcanvas.offset().top;
|
var y = e.pageY - vcanvas.offset().top;
|
||||||
var new_x = Math.floor(x * 152 / vcanvas.width());
|
var new_x = Math.floor(x * 152 / vcanvas.width());
|
||||||
var new_y = Math.floor((y-37) * (210+37) / vcanvas.height());
|
var new_y = Math.floor((y-10) * (192+37+30) / vcanvas.height());
|
||||||
this.runEval( (c) => {
|
this.runEval( (c) => {
|
||||||
var pos = this.getRasterPosition();
|
var pos = this.getRasterPosition();
|
||||||
return (pos.x >= new_x) && (pos.y >= new_y);
|
return (pos.x >= new_x) && (pos.y >= new_y);
|
||||||
|
@ -155,8 +160,17 @@ class VCSPlatform extends BasePlatform {
|
||||||
}
|
}
|
||||||
advance() : number {
|
advance() : number {
|
||||||
Javatari.room.console.clockPulse();
|
Javatari.room.console.clockPulse();
|
||||||
return 0; //TODO
|
return 0; // TODO: advanceFrameClock() and return 76*262 (or PAL)
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
advanceFrameClock?(trap: DebugCondition, step: number) : number {
|
||||||
|
this.runEval( (c) => {
|
||||||
|
var clkfs = Javatari.room.console.getClocksFromFrameStart() - 1;
|
||||||
|
return clkfs >= step;
|
||||||
|
});
|
||||||
|
return step;
|
||||||
|
}
|
||||||
|
*/
|
||||||
// for unit test
|
// for unit test
|
||||||
nextFrame() {
|
nextFrame() {
|
||||||
Javatari.room.console.clockPulse();
|
Javatari.room.console.clockPulse();
|
||||||
|
@ -216,7 +230,7 @@ class VCSPlatform extends BasePlatform {
|
||||||
return Javatari.room.console.loadState(state);
|
return Javatari.room.console.loadState(state);
|
||||||
}
|
}
|
||||||
getCPUState() : CpuState {
|
getCPUState() : CpuState {
|
||||||
return Javatari.room.console.saveState().c;
|
return Javatari.room.console.getCPUState();
|
||||||
}
|
}
|
||||||
saveControlsState() {
|
saveControlsState() {
|
||||||
return Javatari.room.console.saveControlsState();
|
return Javatari.room.console.saveControlsState();
|
||||||
|
|
Loading…
Reference in New Issue