mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-01-02 23:30:21 +00:00
verilog: new hex format for value labels
This commit is contained in:
parent
bb818c34f8
commit
d388bc84b8
@ -210,6 +210,8 @@ TODO:
|
|||||||
- download non-text incbin source file
|
- download non-text incbin source file
|
||||||
- show hidden header files that only exist in Emscripten FS
|
- show hidden header files that only exist in Emscripten FS
|
||||||
- WASI modules: https://docs.wasmer.io/integrations/js/wasi/browser
|
- WASI modules: https://docs.wasmer.io/integrations/js/wasi/browser
|
||||||
|
- FS Access: https://web.dev/file-system-access/
|
||||||
|
- https://wicg.github.io/file-system-access/#api-showdirectorypicker
|
||||||
|
|
||||||
Probing
|
Probing
|
||||||
- probe log doesn't start @ reset
|
- probe log doesn't start @ reset
|
||||||
|
@ -229,6 +229,16 @@ export class WaveformView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value2str(val: number, meta: WaveformMeta) {
|
||||||
|
var radix = this.hexformat ? 16 : 10;
|
||||||
|
var txt = val.toString(radix);
|
||||||
|
if (radix == 16 && meta && meta.len > 3)
|
||||||
|
txt = `${meta.len}'h${txt}`;
|
||||||
|
//else if (radix == 10 && meta.len > 3)
|
||||||
|
//txt = `${meta.len}'d${txt}`;
|
||||||
|
return txt;
|
||||||
|
}
|
||||||
|
|
||||||
refreshRow(row : number) {
|
refreshRow(row : number) {
|
||||||
var canvas = this.lines[row];
|
var canvas = this.lines[row];
|
||||||
var meta = this.meta[row];
|
var meta = this.meta[row];
|
||||||
@ -266,12 +276,11 @@ export class WaveformView {
|
|||||||
var x = 0;
|
var x = 0;
|
||||||
var y = 0;
|
var y = 0;
|
||||||
var lastval = -1;
|
var lastval = -1;
|
||||||
var radix = this.hexformat ? 16 : 10;
|
|
||||||
for (var i=0; i<data.length; i++) {
|
for (var i=0; i<data.length; i++) {
|
||||||
var val = data[i];
|
var val = data[i];
|
||||||
if (printvals && val != lastval && x < w-100) { // close to right edge? omit
|
if (printvals && val != lastval && x < w-100) { // close to right edge? omit
|
||||||
var ytext = ycen;
|
var ytext = ycen;
|
||||||
var txt = val.toString(radix);
|
var txt = this.value2str(val, null);
|
||||||
if (txt.length > 4)
|
if (txt.length > 4)
|
||||||
ctx.font = fontsml;
|
ctx.font = fontsml;
|
||||||
ctx.fillText(txt, x+this.zoom/4, ytext);
|
ctx.fillText(txt, x+this.zoom/4, ytext);
|
||||||
@ -307,7 +316,7 @@ export class WaveformView {
|
|||||||
var val = data[this.tsel - this.t0];
|
var val = data[this.tsel - this.t0];
|
||||||
ctx.textAlign = 'right';
|
ctx.textAlign = 'right';
|
||||||
if (val !== undefined) {
|
if (val !== undefined) {
|
||||||
var s = val.toString(radix);
|
var s = this.value2str(val, meta);
|
||||||
var x = w-fh;
|
var x = w-fh;
|
||||||
var dims = ctx.measureText(s);
|
var dims = ctx.measureText(s);
|
||||||
ctx.fillStyle = 'black';
|
ctx.fillStyle = 'black';
|
||||||
|
Loading…
Reference in New Issue
Block a user