fixed tests, removed listings from parseCA65Listing

This commit is contained in:
Steven Hugg 2022-06-22 12:22:47 -05:00
parent 0fc860f524
commit b284fc694d
4 changed files with 9 additions and 8 deletions

View File

@ -225,7 +225,7 @@ export abstract class BasePlatform {
getDebugTree() : {} {
var o : any = { };
o.state = this.saveState();
if (this.debugSymbols.debuginfo) o.debuginfo = this.debugSymbols.debuginfo;
if (this.debugSymbols?.debuginfo) o.debuginfo = this.debugSymbols.debuginfo;
return o;
}
readFile(path: string) : FileData {

View File

@ -15,7 +15,7 @@ var WilliamsPlatform = function(mainElement, proto, options) {
var self = this;
this.__proto__ = new (proto ? proto : Base6809Platform)();
var isDefender = options.isDefender;
var isDefender = options?.isDefender;
var SCREEN_HEIGHT = 304;
var SCREEN_WIDTH = 256;
@ -303,7 +303,7 @@ var WilliamsPlatform = function(mainElement, proto, options) {
workerchannel = new WorkerSoundChannel(worker);
audio.master.addChannel(workerchannel);
let rotate = options.rotate == null ? -90 : parseFloat(options.rotate);
let rotate = options?.rotate == null ? -90 : parseFloat(options.rotate);
video = new RasterVideo(mainElement, SCREEN_WIDTH, SCREEN_HEIGHT, { rotate });
video.create();
$(video.canvas).click(function(e) {

View File

@ -230,11 +230,12 @@ export function linkLD65(step: BuildStep): BuildStepResult {
if (fn.endsWith('.lst')) {
var lstout = FS.readFile(fn, { encoding: 'utf8' });
lstout = lstout.split('\n\n')[1] || lstout; // remove header
var asmlines = []; // TODO: parseCA65Listing(lstout, symbolmap, params, false);
var srclines = parseCA65Listing(lstout, symbolmap, params, true, listings);
var asmlines = parseCA65Listing(lstout, symbolmap, params, false);
var srclines = parseCA65Listing(lstout, symbolmap, params, true); // TODO: listings param for ecs
putWorkFile(fn, lstout);
listings[fn] = {
lines: [],
asmlines: srclines.length ? asmlines : null,
lines: srclines.length ? srclines : asmlines,
text: lstout
};
}

View File

@ -196,9 +196,9 @@ async function testPlatform(platid, romname, maxframes, callback) {
assert.equal(clks, proberec.countClocks());
}
// debug tree
if (platform.getDebugTree) {
if (platform.getDebugTree != null) {
var dbgtree = platform.getDebugTree();
JSON.stringify(dbgtree);
if (dbgtree != null) JSON.stringify(dbgtree);
}
// misc
assert.ok(platform.getDefaultExtension().startsWith('.'));