mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-01-11 08:30:02 +00:00
c64: debug info raster x/y
This commit is contained in:
parent
fcad9abcd9
commit
f8985e3858
@ -15,7 +15,7 @@ import { GHSession, GithubService, getRepos, parseGithubURL } from "./services";
|
||||
import Split = require('split.js');
|
||||
import { importPlatform } from "../platform/_index";
|
||||
import { DisassemblerView, ListingView, PC_LINE_LOOKAHEAD, SourceEditor } from "./views/editors";
|
||||
import { AddressHeatMapView, BinaryFileView, MemoryMapView, MemoryView, ProbeLogView, ProbeSymbolView, RasterPCHeatMapView, ScanlineIOView, VRAMMemoryView } from "./views/debugviews";
|
||||
import { AddressHeatMapView, BinaryFileView, MemoryMapView, MemoryView, ProbeLogView, ProbeSymbolView, RasterPCHeatMapView, RasterStackMapView, ScanlineIOView, VRAMMemoryView } from "./views/debugviews";
|
||||
import { AssetEditorView } from "./views/asseteditor";
|
||||
import { isMobileDevice } from "./views/baseviews";
|
||||
import { CallStackView, DebugBrowserView } from "./views/treeviews";
|
||||
@ -367,6 +367,9 @@ function refreshWindowList() {
|
||||
addWindowItem("#crtheatmap", "CRT Probe", () => {
|
||||
return new RasterPCHeatMapView();
|
||||
});
|
||||
addWindowItem("#stackheatmap", "Stack Activity", () => {
|
||||
return new RasterStackMapView();
|
||||
});
|
||||
addWindowItem("#probelog", "Probe Log", () => {
|
||||
return new ProbeLogView();
|
||||
});
|
||||
|
@ -370,6 +370,7 @@ export abstract class ProbeViewBaseBase {
|
||||
var row=0;
|
||||
var col=0;
|
||||
var clk=0;
|
||||
this.sp = 0;
|
||||
for (var i=0; i<p.idx; i++) {
|
||||
var word = p.buf[i];
|
||||
var addr = word & 0xffff;
|
||||
@ -410,7 +411,7 @@ export abstract class ProbeViewBaseBase {
|
||||
return s;
|
||||
}
|
||||
|
||||
getOpRGB(op:number) : number {
|
||||
getOpRGB(op:number, addr:number) : number {
|
||||
switch (op) {
|
||||
case ProbeFlags.EXECUTE: return 0x018001;
|
||||
case ProbeFlags.MEM_READ: return 0x800101;
|
||||
@ -550,7 +551,7 @@ export class AddressHeatMapView extends ProbeBitmapViewBase implements ProjectVi
|
||||
}
|
||||
|
||||
drawEvent(op, addr, col, row) {
|
||||
var rgb = this.getOpRGB(op);
|
||||
var rgb = this.getOpRGB(op, addr);
|
||||
if (!rgb) return;
|
||||
var x = addr & 0xff;
|
||||
var y = (addr >> 8) & 0xff;
|
||||
@ -593,25 +594,32 @@ export class AddressHeatMapView extends ProbeBitmapViewBase implements ProjectVi
|
||||
export class RasterPCHeatMapView extends ProbeBitmapViewBase implements ProjectView {
|
||||
|
||||
drawEvent(op, addr, col, row) {
|
||||
var iofs = col + row * this.canvas.width;
|
||||
var rgb = this.getOpRGB(op);
|
||||
var rgb = this.getOpRGB(op, addr);
|
||||
if (!rgb) return;
|
||||
var data = this.datau32[iofs];
|
||||
data = data | rgb | 0xff000000;
|
||||
this.datau32[iofs] = data;
|
||||
var iofs = col + row * this.canvas.width;
|
||||
var data = rgb | 0xff000000;
|
||||
this.datau32[iofs] |= data;
|
||||
}
|
||||
}
|
||||
|
||||
export class RasterStackMapView extends ProbeBitmapViewBase implements ProjectView {
|
||||
|
||||
interrupt: number;
|
||||
|
||||
drawEvent(op, addr, col, row) {
|
||||
var rgb;
|
||||
rgb = (0x030609 * (this.sp & 7)) | 0x404040;
|
||||
if (op == ProbeFlags.INTERRUPT) this.interrupt = 1;
|
||||
if (this.interrupt == 1 && op == ProbeFlags.SP_PUSH) this.interrupt = addr;
|
||||
if (this.interrupt > 1 && this.sp > this.interrupt) this.interrupt = 0;
|
||||
if (this.interrupt) rgb |= 0x800000;
|
||||
if (op == ProbeFlags.EXECUTE) {
|
||||
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;
|
||||
var data = rgb | 0xff000000;
|
||||
while (iofs >= 0 && !(this.datau32[iofs] & 0xffffff)) {
|
||||
this.datau32[iofs--] = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,17 +226,21 @@ export class C64_WASMMachine extends BaseWASMMachine implements Machine, Probeab
|
||||
let screen = vicbank + (state.vic[0x18] >> 4) * 0x400;
|
||||
let isbitmap = state.vic[0x11] & 0x20;
|
||||
let ischar = (state.cia2[0]&1)==1 && (state.vic[0x18]&12)==4;
|
||||
s += `Scanline: ${lpad(this.getRasterY(),3)} `;
|
||||
let rasterX = state.state[0xf4];
|
||||
let rasterY = this.getRasterY();
|
||||
s += 'Mode:';
|
||||
if (state.vic[0x11] & 0x20) s += ' BITMAP'; else s += ' CHAR';
|
||||
if (state.vic[0x16] & 0x10) s += ' MULTICOLOR';
|
||||
if (state.vic[0x11] & 0x40) s += ' EXTENDED';
|
||||
s += "\n";
|
||||
s += `Raster: (${lpad(rasterX,3)}, ${lpad(rasterY,3)}) `;
|
||||
s += `Scroll: (${state.vic[0x16] & 7}, ${state.vic[0x11] & 7})`;
|
||||
s += "\n";
|
||||
s += `VIC Bank: $${hex(vicbank,4)} Scrn: $${hex(screen,4)} `;
|
||||
if (isbitmap) s += `Bitmap: $${hex(charmem&0xe000,4)}`
|
||||
else if (ischar) s += `Char: ROM $${hex(charmem,4)}`;
|
||||
else s += `Char: $${hex(charmem,4)}`;
|
||||
s += "\n";
|
||||
s += `Scroll X:${state.vic[0x16] & 7} Y:${state.vic[0x11] & 7}\n`;
|
||||
s += dumpRAM(m, 0xd000, 64);
|
||||
return s;
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ const C64_PRESETS = [
|
||||
{id:'scroll5.c', name:'Scrolling (Camera Following)'},
|
||||
{id:'side_scroller.c', name:'Side-Scrolling Game'},
|
||||
{id:'fullscrollgame.c', name:'Full-Scrolling Game'},
|
||||
{id:'test_multiplex.c', name:'Sprite Multiplexing (Simple)'},
|
||||
{id:'test_multispritelib.c', name:'Sprite Multiplexing (Library)'},
|
||||
{id:'mcbitmap.c', name:'Multicolor Lines+Flood Fill'},
|
||||
{id:'test_multiplex.c', name:'Sprite Retriggering'},
|
||||
{id:'test_multispritelib.c', name:'Sprite Multiplexing Library'},
|
||||
{id:'mcbitmap.c', name:'Multicolor Bitmap Mode'},
|
||||
//{id:'mandel.c', name:'Mandelbrot Fractal'},
|
||||
{id:'musicplayer.c', name:'Music Player'},
|
||||
{id:'sidtune.dasm', name:'Tiny SID Tune (ASM)'},
|
||||
//{id:'sidtune.dasm', name:'Tiny SID Tune (ASM)'},
|
||||
{id:'siddemo.c', name:'SID Player Demo'},
|
||||
{id:'climber.c', name:'Climber Game'},
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user