1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-10-31 23:09:49 +00:00

debug views track stack pointer

This commit is contained in:
Steven Hugg 2022-08-21 21:08:11 -05:00
parent 2555798b11
commit 1f17baf88e

View File

@ -310,6 +310,7 @@ export abstract class ProbeViewBaseBase {
cumulativeData : boolean = false;
cyclesPerLine : number;
totalScanlines : number;
sp : number; // stack pointer
abstract tick() : void;
@ -378,6 +379,9 @@ export abstract class ProbeViewBaseBase {
case ProbeFlags.SCANLINE: row++; col=0; break;
case ProbeFlags.FRAME: row=0; col=0; break;
case ProbeFlags.CLOCKS: col += addr; clk += addr; break;
case ProbeFlags.SP_PUSH:
case ProbeFlags.SP_POP:
this.sp = addr;
default:
eventfn(op, addr, col, row, clk, value);
break;
@ -598,6 +602,19 @@ export class RasterPCHeatMapView extends ProbeBitmapViewBase implements ProjectV
}
}
export class RasterStackMapView extends ProbeBitmapViewBase implements ProjectView {
drawEvent(op, addr, col, row) {
var iofs = col + row * this.canvas.width;
var rgb = this.getOpRGB(op);
rgb = (0x1f3f7f << (this.sp & 15)) & 0xffffff;
if (!rgb) return;
var data = this.datau32[iofs];
data = data | rgb | 0xff000000;
this.datau32[iofs] = data;
}
}
export class ProbeLogView extends ProbeViewBaseBase {
vlist : VirtualTextScroller;
maindiv : HTMLElement;