diff --git a/src/ide/ui.ts b/src/ide/ui.ts index 9f3b2994..093b05fc 100644 --- a/src/ide/ui.ts +++ b/src/ide/ui.ts @@ -1521,8 +1521,8 @@ function _recordVideo() { _resume(); $("#videoPreviewModal").modal('show'); }); - var intervalMsec = 33; - var maxFrames = 200; + var intervalMsec = 20; + var maxFrames = 300; var nframes = 0; console.log("Recording video", canvas); $("#emulator").css('backgroundColor', '#cc3333'); diff --git a/src/ide/views.ts b/src/ide/views.ts index 6504c320..829db018 100644 --- a/src/ide/views.ts +++ b/src/ide/views.ts @@ -977,9 +977,23 @@ abstract class ProbeViewBaseBase { probe : ProbeRecorder; tooldiv : HTMLElement; cumulativeData : boolean = false; + cyclesPerLine : number; + totalScanlines : number; abstract tick() : void; + constructor() { + var width = 160; + var height = 262; // TODO: PAL? + try { + width = Math.ceil(platform['machine']['cpuCyclesPerLine']) || width; // TODO + height = Math.ceil(platform['machine']['numTotalScanlines']) || height; // TODO + } catch (e) { + } + this.cyclesPerLine = width; + this.totalScanlines = height; + } + addr2symbol(addr : number) : string { var _addr2sym = (platform.debugSymbols && platform.debugSymbols.addr2symbol) || {}; return _addr2sym[addr]; @@ -1128,8 +1142,6 @@ abstract class ProbeViewBase extends ProbeViewBaseBase { } } -// TODO: remove all 160/262 constants (in case of PAL) - abstract class ProbeBitmapViewBase extends ProbeViewBase { imageData : ImageData; @@ -1137,14 +1149,7 @@ abstract class ProbeBitmapViewBase extends ProbeViewBase { recreateOnResize = false; createDiv(parent : HTMLElement) { - var width = 160; - var height = 262; - try { - width = Math.ceil(platform['machine']['cpuCyclesPerLine']) || 256; // TODO - height = Math.ceil(platform['machine']['numTotalScanlines']) || 262; // TODO - } catch (e) { - } - return this.createCanvas(parent, width, height); + return this.createCanvas(parent, this.cyclesPerLine, this.totalScanlines); } initCanvas() { this.imageData = this.ctx.createImageData(this.canvas.width, this.canvas.height); @@ -1270,7 +1275,7 @@ export class ProbeLogView extends ProbeViewBaseBase { createDiv(parent : HTMLElement) { this.vlist = new VirtualTextScroller(parent); - this.vlist.create(parent, 160*262, this.getMemoryLineAt.bind(this)); + this.vlist.create(parent, this.cyclesPerLine*this.totalScanlines, this.getMemoryLineAt.bind(this)); return this.vlist.maindiv; } getMemoryLineAt(row : number) : VirtualTextLine { @@ -1324,14 +1329,15 @@ export class ScanlineIOView extends ProbeViewBaseBase { createDiv(parent : HTMLElement) { this.vlist = new VirtualTextScroller(parent); - this.vlist.create(parent, 262, this.getMemoryLineAt.bind(this)); + this.vlist.create(parent, this.totalScanlines, this.getMemoryLineAt.bind(this)); return this.vlist.maindiv; } getMemoryLineAt(row : number) : VirtualTextLine { var s = lpad(row+"",3) + ' '; var c = 'seg_code'; var line = (this.dumplines && this.dumplines[row]) || []; - for (var i=0; i<76; i++) { + var hblankCycle = Math.round(this.cyclesPerLine/3.3); + for (var i=0; i= 0) { - var cmt = l.indexOf(';'); + let cmt = l.indexOf(';'); if (cmt < 0 || cmt > pos) { // make sure identifier is flanked by non-word chars if (/\w+/.test(key) && new RegExp("\\b"+key+"\\b").test(key)) { @@ -817,7 +818,7 @@ function parseDASMListing(lstpath:string, lsttext:string, listings:CodeListingMa } } } - var errm = re_msvc.exec(line); + let errm = re_msvc.exec(line); if (errm) { errors.push({ path:errm[1], @@ -834,7 +835,7 @@ function assembleDASM(step:BuildStep) { var unresolved = {}; var errors = []; var errorMatcher = msvcErrorMatcher(errors); - function match_fn(s) { + function match_fn(s:string) { // TODO: what if s is not string? (startsWith is not a function) var matches = re_usl.exec(s); if (matches) { @@ -846,6 +847,10 @@ function assembleDASM(step:BuildStep) { errors.push({line:0, msg:s.substr(9)}); } else if (s.startsWith("unable ")) { errors.push({line:0, msg:s}); + } else if (s.startsWith("segment: ")) { + errors.push({line:0, msg:"Segment overflow: "+s.substring(9)}); + } else if (s.toLowerCase().indexOf('error:') >= 0) { + errors.push({line:0, msg:s.trim()}); } else { errorMatcher(s); }