diff --git a/doc/notes.txt b/doc/notes.txt index 10ff4113..893e85ba 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -154,6 +154,7 @@ TODO: - support projects with subdirectories, file list? - emulator needs reset shortcut for nes - switching platform of a repo? + - what to load if no main file? WEB WORKER FORMAT diff --git a/index.html b/index.html index 7e05fb87..5ab73cf5 100644 --- a/index.html +++ b/index.html @@ -359,6 +359,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {

Enter the GitHub repository URL:

If the project is compatible with 8bitworkshop, it should build automatically.

+

Otherwise, some work may be required -- make sure you've selected the correct platform.

Source files must be in the root folder of the repository.

diff --git a/src/project.ts b/src/project.ts index dd208baa..b8ae7fa4 100644 --- a/src/project.ts +++ b/src/project.ts @@ -98,8 +98,8 @@ export class CodeProject { while (m = re2.exec(text)) { this.pushAllFiles(files, m[2]); } - // for .c -- //#link "file" (or ;link or #link) - let re3 = /^\s*([;#]|[/][/][#])resource\s+"(.+?)"/gm; + // for .c -- //#resource "file" (or ;resource or #resource) + let re3 = /^\s*([;]|[/][/])#resource\s+"(.+?)"/gm; while (m = re3.exec(text)) { this.pushAllFiles(files, m[2]); } @@ -114,7 +114,7 @@ export class CodeProject { // } else { // for .c -- //#link "file" (or ;link or #link) - let re = /^\s*([;#]|[/][/][#])link\s+"(.+?)"/gm; + let re = /^\s*([;]|[/][/])#link\s+"(.+?)"/gm; while (m = re.exec(text)) { this.pushAllFiles(files, m[2]); } diff --git a/src/ui.ts b/src/ui.ts index 8b7def59..c2c199f3 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -572,13 +572,11 @@ function pushChangesToGithub(message:string) { files.push({path:newpath, data:data}); } } - // TODO: include built ROM file in bin/[mainfile].rom - /* + // include built ROM file in bin/[mainfile].rom if (current_output instanceof Uint8Array) { let binpath = "bin/"+getCurrentMainFilename()+".rom"; files.push({path:binpath, data:current_output}); } - */ // push files setWaitDialog(true); return getGithubService().login().then( () => { diff --git a/src/worker/workermain.ts b/src/worker/workermain.ts index 24a77246..fcf79b49 100644 --- a/src/worker/workermain.ts +++ b/src/worker/workermain.ts @@ -197,11 +197,6 @@ var PLATFORM_PARAMS = { {name:'Cartridge RAM',start:0x6000,size:0x2000,type:'ram'}, ], }, - 'nes-asm': { - cfgfile: 'nes.cfg', - define: '__NES__', - libargs: ['nes.lib'], - }, 'apple2': { define: '__APPLE2__', cfgfile: 'apple2-hgr.cfg', @@ -776,6 +771,9 @@ function assembleDASM(step:BuildStep) { listings[path] = {lines:[]}; } parseDASMListing(alst, listings, errors, unresolved); + if (errors.length) { + return {errors:errors}; + } // read binary rom output and symbols var aout, asym; aout = FS.readFile(binpath); @@ -914,6 +912,7 @@ function assembleCA65(step:BuildStep) { var FS = CA65['FS']; setupFS(FS, '65-'+getRootBasePlatform(step.platform)); populateFiles(step, FS); + fixParamsWithDefines(step.path, step.params); execMain(step, CA65, ['-v', '-g', '-I', '/share/asminc', '-o', objpath, '-l', lstpath, step.path]); if (errors.length) return {errors:errors}; @@ -947,6 +946,10 @@ function linkLD65(step:BuildStep) { setupFS(FS, '65-'+getRootBasePlatform(step.platform)); populateFiles(step, FS); populateExtraFiles(step, FS, params.extra_link_files); + // populate .cfg file, if it is a custom one + if (workfs[params.cfgfile]) { + populateEntry(FS, params.cfgfile, workfs[params.cfgfile], null); + } var libargs = params.libargs; var cfgfile = params.cfgfile; var args = ['--cfg-path', '/share/cfg', @@ -1034,6 +1037,7 @@ function fixParamsWithDefines(path:string, params){ if (path && libargs) { var code = getWorkFileAsString(path); if (code) { + var oldcfgfile = params.cfgfile; var ident2index = {}; // find all lib args "IDENT=VALUE" for (var i=0; i { return s!=''; }); + console.log('Using libargs', params.libargs); } } } diff --git a/test/cli/testworker.js b/test/cli/testworker.js index 7548a9db..58d54e8b 100644 --- a/test/cli/testworker.js +++ b/test/cli/testworker.js @@ -110,7 +110,7 @@ describe('Worker', function() { compile('cc65', '#include "NOSUCH.file"\n', 'nes', done, 0, 0, 1, {ignoreErrorPath:true}); }); it('should assemble CA65', function(done) { - compile('ca65', '\t.segment "HEADER"\n\t.segment "STARTUP"\n\t.segment "CHARS"\n\t.segment "VECTORS"\n\tlda #0\n\tsta $1\n', 'nes-asm', done, 40976, 2); + compile('ca65', ';#define LIBARGS ,\n\t.segment "HEADER"\n\t.segment "STARTUP"\n\t.segment "CHARS"\n\t.segment "VECTORS"\n\t.segment "SAMPLES"\n\t.segment "CODE"\n\tlda #0\n\tsta $1\n', 'nes', done, 40976, 2); }); /* it('should assemble Z80ASM', function(done) {