z80 illegal opcode breakpoint

This commit is contained in:
Steven Hugg 2018-09-15 15:27:12 -04:00
parent 00621bdf16
commit a8fbddaee2
3 changed files with 22 additions and 16 deletions

View File

@ -6,8 +6,6 @@ TODO:
- confuse code/data in listing
- show memory locations hovering over lines
- don't check against ROM signatures
- better errors when ROM format wrong
- debugging inside of bank switching??? relocated segs?
- support 6502 test cases
- DASM: macro forward refs
- asm: support macro expansion
@ -24,7 +22,7 @@ TODO:
- MAME single step (?)
- step over
- slowdown beam for all platforms?
- kbd shortcuts
- more kbd shortcuts
- PC x86 support
- show errors in list (maybe window list?)
- can't see 1st line in editor sometimes (when scrolling cursor past bottom of screen)
@ -34,7 +32,6 @@ TODO:
- update Javatari version? (and others?)
- unify versioning
- disassembler for uploaded ROMs
- show tool-specific (readonly) include files
- verilog debugging/reloading makes it slow
- remove FPS and play controls when Verilog scope paused
- compile stuck when errors unchanged
@ -61,7 +58,6 @@ TODO:
- restructure folders
- update memory browser window if view before 1st compile, update symbols
- spinner disappears sometimes (and compiles even when not spinning...) (undo?)
- z80 illegal opcode kills platform
- quantify verilog "graph iterations"
- debug bankswitching for funky formats
- "invalid ROM" error should show up better

View File

@ -426,16 +426,21 @@ export abstract class BaseZ80Platform extends BaseDebugPlatform {
return 0;
var debugCond = this.getDebugCallback();
var targetTstates = cpu.getTstates() + cycles;
if (debugCond) { // || trace) {
while (cpu.getTstates() < targetTstates) {
if (debugCond && debugCond()) {
debugCond = null;
break;
try {
if (debugCond) { // || trace) {
while (cpu.getTstates() < targetTstates) {
if (debugCond && debugCond()) {
debugCond = null;
break;
}
cpu.runFrame(cpu.getTstates() + 1);
}
cpu.runFrame(cpu.getTstates() + 1);
} else {
cpu.runFrame(targetTstates);
}
} else {
cpu.runFrame(targetTstates);
} catch (e) {
// TODO: show alert w/ error msg
this.breakpointHit(cpu.getTstates());
}
return cpu.getTstates() - targetTstates;
}

View File

@ -562,14 +562,18 @@ function setDebugButtonState(btnid:string, btnstate:string) {
$("#dbg_"+btnid).addClass("btn_"+btnstate);
}
function setupBreakpoint(btnid? : string) {
_disableRecording();
function setupDebugCallback(btnid? : string) {
platform.setupDebug(function(state) {
lastDebugState = state;
showDebugInfo(state);
projectWindows.refresh(true);
if (btnid) setDebugButtonState(btnid, "stopped");
setDebugButtonState(btnid||"pause", "stopped");
});
}
function setupBreakpoint(btnid? : string) {
_disableRecording();
setupDebugCallback(btnid);
if (btnid) setDebugButtonState(btnid, "active");
}
@ -654,6 +658,7 @@ function runStepBackwards() {
function clearBreakpoint() {
lastDebugState = null;
if (platform.clearDebug) platform.clearDebug();
setupDebugCallback(); // in case of BRK/trap
showDebugInfo();
}