fixed memory browser before 1st compile / no syms

This commit is contained in:
Steven Hugg 2018-09-15 18:47:40 -04:00
parent a8fbddaee2
commit d1d761406c
6 changed files with 25 additions and 11 deletions

View File

@ -55,12 +55,10 @@ TODO:
- figure out folders for projects for real - figure out folders for projects for real
- why loadState() on verilog kill perf? - why loadState() on verilog kill perf?
- click to break on raster position - click to break on raster position
- restructure folders - restructure src/ folders
- update memory browser window if view before 1st compile, update symbols
- spinner disappears sometimes (and compiles even when not spinning...) (undo?) - spinner disappears sometimes (and compiles even when not spinning...) (undo?)
- quantify verilog "graph iterations" - quantify verilog "graph iterations"
- debug bankswitching for funky formats - debug bankswitching for funky formats
- "invalid ROM" error should show up better
- spaces in filename don't parse code listing (DASM, maybe more) - spaces in filename don't parse code listing (DASM, maybe more)
- zmac: item_lookup needs better hash function - zmac: item_lookup needs better hash function
- 'undefined' for bitmap replacer - 'undefined' for bitmap replacer

View File

@ -202,7 +202,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
</div> </div>
</div> </div>
<div id="error_alert" class="alert alert-danger alert-dismissable" style="position:absolute;right:0;top:0;display:none"> <div id="error_alert" class="alert alert-danger alert-dismissable" style="position:absolute;right:0;top:0;display:none">
<!--<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>--> <button type="button" class="close" onclick="$('.alert').hide()" aria-hidden="true">&times;</button>
<div id="error_alert_msg"></div> <div id="error_alert_msg"></div>
</div> </div>
</div> </div>

View File

@ -12,8 +12,6 @@
#define EXIT_CLIPY(y) if (((unsigned char)y)>=VHEIGHT) return #define EXIT_CLIPY(y) if (((unsigned char)y)>=VHEIGHT) return
#define EXIT_CLIPDEST(addr) if ((((word)addr)&0xfff) >= 0xe10) return #define EXIT_CLIPDEST(addr) if ((((word)addr)&0xfff) >= 0xe10) return
//#link "acheader.s"
typedef unsigned char byte; typedef unsigned char byte;
typedef signed char sbyte; typedef signed char sbyte;
typedef unsigned short word; typedef unsigned short word;

View File

@ -513,7 +513,7 @@ function setCompileOutput(data: WorkerResult) {
} catch (e) { } catch (e) {
console.log(e); console.log(e);
toolbar.addClass("has-errors"); toolbar.addClass("has-errors");
projectWindows.setErrors([{line:1,msg:e+""}]); // TODO: doesn't work (use alert?) showErrorAlert([{msg:e+"",line:0}]);
current_output = null; current_output = null;
return; return;
} }

View File

@ -602,7 +602,9 @@ export class MemoryView implements ProjectView {
} }
refresh() { refresh() {
this.tick(); this.dumplines = null;
this.memorylist.clear();
//this.tick();
} }
tick() { tick() {
@ -656,13 +658,17 @@ export class MemoryView implements ProjectView {
// TODO: addr2symbol for ca65; and make it work without symbols // TODO: addr2symbol for ca65; and make it work without symbols
getDumpLines() { getDumpLines() {
if (!this.dumplines && addr2symbol) { var addr2sym = addr2symbol;
if (!addr2sym) addr2sym = {};
if (!addr2sym[0x0]) addr2sym[0x0] = '__START__';
addr2sym[0x10000] = '__END__';
if (!this.dumplines) {
this.dumplines = []; this.dumplines = [];
var ofs = 0; var ofs = 0;
var sym; var sym;
for (const _nextofs of Object.keys(addr2symbol)) { for (const _nextofs of Object.keys(addr2sym)) {
var nextofs = parseInt(_nextofs); // convert from string (stupid JS) var nextofs = parseInt(_nextofs); // convert from string (stupid JS)
var nextsym = addr2symbol[nextofs]; var nextsym = addr2sym[nextofs];
if (sym) { if (sym) {
if (MemoryView.IGNORE_SYMS[sym]) { if (MemoryView.IGNORE_SYMS[sym]) {
ofs = nextofs; ofs = nextofs;

View File

@ -160,3 +160,15 @@ VirtualList.createScroller = function(h) {
VirtualList.prototype.scrollToItem = function(index) { VirtualList.prototype.scrollToItem = function(index) {
this.container.scrollTop = this.itemHeight * index; this.container.scrollTop = this.itemHeight * index;
}; };
VirtualList.prototype.clear = function() {
var badNodes = document.querySelectorAll('[data-index]');
for (var i = 0, l = badNodes.length; i < l; i++) {
try {
this.container.removeChild(badNodes[i]);
} catch (e) {
//
}
}
this._renderChunk(this.container, 0);
};