mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-24 09:28:58 +00:00
signal names on top, remove clk/reset from video, wave numbers at high zoom
This commit is contained in:
parent
ba55a35325
commit
8ad8d0e88c
3247
lib/w2ui-1.5.rc1.css
Normal file
3247
lib/w2ui-1.5.rc1.css
Normal file
File diff suppressed because one or more lines are too long
18953
lib/w2ui-1.5.rc1.js
Normal file
18953
lib/w2ui-1.5.rc1.js
Normal file
File diff suppressed because it is too large
Load Diff
2
lib/w2ui-1.5.rc1.min.css
vendored
Normal file
2
lib/w2ui-1.5.rc1.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
14
lib/w2ui-1.5.rc1.min.js
vendored
Normal file
14
lib/w2ui-1.5.rc1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -585,6 +585,10 @@ var VerilogPlatform = function(mainElement, options) {
|
||||
this.poweron();
|
||||
// query output
|
||||
this.hasvideo = gen.vsync !== undefined && gen.hsync !== undefined && gen.rgb !== undefined;
|
||||
if (this.hasvideo) {
|
||||
const IGNORE_SIGNALS = ['clk','reset'];
|
||||
trace_signals = trace_signals.filter((v) => { return IGNORE_SIGNALS.indexOf(v.name)<0; }); // remove clk, reset
|
||||
}
|
||||
}
|
||||
}
|
||||
// replace program ROM, if using the assembler
|
||||
|
@ -156,7 +156,7 @@ export class WaveformView {
|
||||
}
|
||||
|
||||
setZoom(zoom : number) {
|
||||
this.zoom = Math.max(1, zoom);
|
||||
this.zoom = Math.max(1, Math.min(64, zoom));
|
||||
this.clocksPerPage = Math.ceil(this.pageWidth/this.zoom); // TODO: refactor into other one
|
||||
this.refresh();
|
||||
}
|
||||
@ -181,19 +181,30 @@ export class WaveformView {
|
||||
// clear to black
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
// draw waveform
|
||||
ctx.strokeStyle = "#66ff66";
|
||||
var b = 4;
|
||||
var h2 = h-16-b;
|
||||
ctx.strokeStyle = ctx.fillStyle = "#66ff66";
|
||||
var fh = 12;
|
||||
var b1 = fh+4;
|
||||
var b2 = 4;
|
||||
var h2 = h-b1-b2;
|
||||
var yrange = ((1<<meta.len)-1) || 0;
|
||||
var data = this.wfp.getSignalData(row, this.t0, Math.ceil(w/this.zoom));
|
||||
this.clockMax = Math.max(this.clockMax, this.t0 + data.length);
|
||||
var printvals = meta.len > 1 && this.zoom >= 32;
|
||||
var ycen = b1+h2-1;
|
||||
// draw waveform
|
||||
ctx.beginPath();
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var lastval = -1;
|
||||
for (var i=0; i<data.length; i++) {
|
||||
var val = data[i];
|
||||
if (printvals && val != lastval) {
|
||||
ctx.fillText(val.toString(), x+this.zoom/4, ycen);
|
||||
}
|
||||
lastval = val;
|
||||
if (i>0)
|
||||
ctx.lineTo(x,y);
|
||||
y = b + (1.0 - data[i]/yrange) * h2;
|
||||
y = b1 + (1.0 - val/yrange) * h2;
|
||||
if (!isclk) x += this.zoom*(1/8);
|
||||
if (i==0)
|
||||
ctx.moveTo(x,y);
|
||||
@ -217,7 +228,7 @@ export class WaveformView {
|
||||
var val = data[this.tsel - this.t0];
|
||||
ctx.textAlign = 'right';
|
||||
if (val !== undefined) {
|
||||
ctx.fillText(val.toString(), w-b*2, h);
|
||||
ctx.fillText(val.toString(), w-fh, ycen);
|
||||
}
|
||||
}
|
||||
// draw labels
|
||||
@ -225,7 +236,7 @@ export class WaveformView {
|
||||
ctx.textAlign = "left";
|
||||
var name = meta.name;
|
||||
name = name.replace(/__DOT__/g, "."); // make nicer name
|
||||
ctx.fillText(name, 5, h-b);
|
||||
ctx.fillText(name, 5, fh);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user