cleaned up Memory Map view

apple2: no logIOWrite for reads
This commit is contained in:
Steven Hugg 2023-11-24 17:50:34 -06:00
parent c5bcd8ad9b
commit 43d844fa79
8 changed files with 34 additions and 23 deletions

View File

@ -120,7 +120,14 @@ export type CodeListingMap = {[path:string]:CodeListing};
export type VerilogOutput =
{program_rom_variable:string, program_rom:Uint8Array, code:string, name:string, ports:any[], signals:any[]};
export type Segment = {name:string, start:number, size:number, last?:number, type?:string};
export type Segment = {
name:string,
start:number,
size:number,
last?:number,
type?:string,
source?:'native'|'linker'
};
export type WorkerResult = WorkerErrorResult | WorkerOutputResult<any> | WorkerUnchangedResult;

View File

@ -409,8 +409,12 @@ export class CodeProject {
processBuildSegments(data: WorkerOutputResult<any>) {
// save and sort segment list
var segs = (this.platform.getMemoryMap && this.platform.getMemoryMap()["main"]) || [];
if (data.segments) { segs = segs.concat(data.segments || []); }
var segs : Segment[] = (this.platform.getMemoryMap && this.platform.getMemoryMap()["main"]) || [];
if (segs?.length) { segs.forEach(seg => seg.source = 'native'); }
if (data.segments) {
data.segments.forEach(seg => seg.source = 'linker');
segs = segs.concat(data.segments || []);
}
segs.sort((a,b) => {return a.start-b.start});
this.segments = segs;
}

View File

@ -245,6 +245,8 @@ export class MemoryMapView implements ProjectView {
this.maindiv = newDiv(parent, 'vertical-scroll');
this.maindiv.css('display', 'grid');
this.maindiv.css('grid-template-columns', '5em 40% 40%');
//this.maindiv.css('grid-template-rows', '2em auto auto');
this.maindiv.css('align-content', 'start');
return this.maindiv[0];
}
@ -256,17 +258,15 @@ export class MemoryMapView implements ProjectView {
this.maindiv.append(offset);
}
var segdiv = $('<div class="segment"/>');
if (!newrow)
segdiv.text(seg.name);
let alttext = `$${hex(seg.start)} - $${hex(seg.last || seg.start+seg.size-1)}`
alttext += ` (${seg.size} bytes)`;
// set alttext of div
segdiv.attr('title', alttext);
if (!newrow || seg.source == 'linker')
segdiv.css('grid-column-start', 3); // make sure it's on right side
if (seg.last)
segdiv.text(seg.name+" ("+(seg.last-seg.start)+" / "+seg.size+" bytes used)");
else
segdiv.text(seg.name+" ("+seg.size+" bytes)");
if (seg.size >= 256) {
var pad = (Math.log(seg.size) - Math.log(256)) * 0.5;
segdiv.css('padding-top', pad+'em');
segdiv.css('padding-bottom', pad+'em');
}
var pad = Math.max(3.0, Math.log(seg.size+1)) * 0.5;
segdiv.css('height', pad+'em');
if (seg.type) {
segdiv.addClass('segment-'+seg.type);
}
@ -288,9 +288,10 @@ export class MemoryMapView implements ProjectView {
var curofs = 0;
var laststart = -1;
for (var seg of segments) {
//var used = seg.last ? (seg.last-seg.start) : seg.size;
if (seg.start > curofs)
this.addSegment({name:'',start:curofs, size:seg.start-curofs}, true);
// add free space
if (seg.start > curofs) {
this.addSegment({ name: '', start: curofs, size: seg.start - curofs }, true);
}
this.addSegment(seg, laststart != seg.start);
laststart = seg.start;
curofs = seg.start + seg.size;

View File

@ -309,12 +309,12 @@ export class AppleII extends BasicScanlineMachine implements AcceptsBIOS {
if (address < 0xc000) {
this.ram[address] = val;
this.grdirty[address>>7] = 1;
this.probe.logIOWrite(address, val);
} else if (address < 0xc080) {
this.read(address); // strobe address, discard result
} else if (address < 0xc100) {
var slot = (address >> 4) & 0x0f;
this.slots[slot-8] && this.slots[slot-8].write(address & 0xf, val);
this.probe.logIOWrite(address, val);
} else if (address >= 0xd000 && !this.writeinhibit) {
if (address >= 0xe000)
this.ram[address] = val;

View File

@ -77,7 +77,7 @@ class NewApple2Platform extends Base6502MachinePlatform<AppleII> implements Plat
{name:'Hires Page 2',start:0x4000,size:0x2000,type:'ram'},
{name:'RAM',start:0x6000,size:0x6000,type:'ram'},
{name:'I/O',start:0xc000,size:0x1000,type:'io'},
{name:'ROM',start:0xd000,size:0x3000-6,type:'rom'},
{name:'ROM',start:0xd000,size:0x3000,type:'rom'},
] } };
getROMExtension(rom:Uint8Array) {
if (rom && rom.length == 35*16*256) return ".dsk"; // DSK image

View File

@ -24,7 +24,8 @@ class Atari7800Platform extends Base6502MachinePlatform<Atari7800> implements Pl
{name:'RAM (6166 Block 1)',start:0x140,size:0xc0,type:'ram'},
{name:'PIA',start:0x280,size:0x18,type:'io'},
{name:'RAM',start:0x1800,size:0x1000,type:'ram'}, // TODO: shadow ram
{name:'Cartridge ROM',start:0x4000,size:0xc000,type:'rom'},
{name:'Cartridge ROM',start:0x4000,size:0xc000-6,type:'rom'},
{name:'CPU Vectors',start:0xfffa,size:0x6,type:'rom'},
] } };
getROMExtension() { return ".a78"; }
getDebugTree() {

View File

@ -363,7 +363,8 @@ class VCSPlatform extends BasePlatform {
{name:'TIA Registers',start:0x00,size:0x80,type:'io'},
{name:'PIA RAM',start:0x80,size:0x80,type:'ram'},
{name:'PIA Ports and Timer',start:0x280,size:0x18,type:'io'},
{name:'Cartridge ROM',start:0xf000,size:0x1000,type:'rom'},
{name:'Cartridge ROM',start:0xf000,size:0x1000-6,type:'rom'},
{name:'CPU Vectors',start:0xfffa,size:0x6,type:'rom'},
]}};
// probing

View File

@ -213,10 +213,7 @@ export function linkLD65(step: BuildStep): BuildStepResult {
}
}
}
// TODO: move to Platform class
var segments = [];
segments.push({ name: 'CPU Stack', start: 0x100, size: 0x100, type: 'ram' });
segments.push({ name: 'CPU Vectors', start: 0xfffa, size: 0x6, type: 'rom' });
// TODO: CHR, banks, etc
let re_seglist = /(\w+)\s+([0-9A-F]+)\s+([0-9A-F]+)\s+([0-9A-F]+)\s+([0-9A-F]+)/;
let parseseglist = false;