From 31356a7b5f2f55ef57883a99bb2715601e421bfd Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Tue, 21 May 2019 13:06:48 -0400 Subject: [PATCH 1/7] use #emuscreen to place emulator video --- doc/notes.txt | 1 + embed.html | 3 ++ index.html | 3 ++ presets/nes/attributes.c | 4 +- src/embedui.ts | 2 +- src/profileview.js | 112 --------------------------------------- src/ui.ts | 3 +- 7 files changed, 11 insertions(+), 117 deletions(-) delete mode 100644 src/profileview.js diff --git a/doc/notes.txt b/doc/notes.txt index 56cd4611..10ff4113 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -122,6 +122,7 @@ TODO: - toolbar overlaps scope - CPU debugging - use $readmem for inline asm programs? + - can't add control instructions b/c of split - single-stepping vector games makes screen fade - break on stack overflow, bad op, bad access, etc - PPU/TIA register write visualization diff --git a/embed.html b/embed.html index 92431fbf..2b0a4fd7 100644 --- a/embed.html +++ b/embed.html @@ -35,6 +35,9 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
+ +
+
+ +
+
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) { From fb3d3430da2fe954897c76004ec8480ecee33bb8 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Tue, 21 May 2019 22:36:56 -0400 Subject: [PATCH 6/7] changed pulldown menus; css why do you hate me --- css/ui.css | 14 +++++----- index.html | 78 ++++++++++++++++++++++++++++-------------------------- src/ui.ts | 2 +- 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/css/ui.css b/css/ui.css index be3c9b1d..aedd07db 100644 --- a/css/ui.css +++ b/css/ui.css @@ -283,14 +283,16 @@ canvas.pixelated { font-family: TinyFont; src: url(04B_03__.TTF); } -#booksMenuButton { - border-width:3px; - border-color:#99ff99; - background-color:#006600; +.toolbarMenuButton { + background-color:#666; border-style:solid; font-family: "Andale Mono", "Menlo", "Lucida Console", monospace; position:relative; - top:-0.25em; + margin-left:0.5em; + margin-right:0.5em; +} +a.toolbarMenuButton { + padding:0.3em; } a.dropdown-toggle { } @@ -540,5 +542,5 @@ div.asset_toolbar { color: #ccc; } .book-title { - font-size:14pt; + font-size:12pt; } diff --git a/index.html b/index.html index 5ab73cf5..57e52b10 100644 --- a/index.html +++ b/index.html @@ -44,12 +44,12 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
- - - - - - - - - - - - - -   - -
diff --git a/src/ui.ts b/src/ui.ts index c2c199f3..5aed755e 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -472,7 +472,7 @@ function _publishProjectToGithub(e) { } var modal = $("#publishGithubModal"); var btn = $("#publishGithubButton"); - $("#githubRepoName").val(getFilenamePrefix(current_project.mainPath)); + $("#githubRepoName").val(getFilenamePrefix(getFilenameForPath(current_project.mainPath))); modal.modal('show'); btn.off('click').on('click', () => { var name = $("#githubRepoName").val()+""; From ff9764b86b2422c131f7ed7782428bf67d05e642 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Wed, 22 May 2019 09:32:29 -0400 Subject: [PATCH 7/7] top bar has flexbox --- css/ui.css | 7 ++++--- index.html | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/css/ui.css b/css/ui.css index aedd07db..0a67aa25 100644 --- a/css/ui.css +++ b/css/ui.css @@ -49,11 +49,12 @@ background-color:#000066; } #controls_top { - position: absolute; - padding: 0.5em; + position:absolute; + padding:0.5em; height:3em; width:100%; background-color:#999; + display:flex; } #notebook { position:absolute; @@ -111,7 +112,7 @@ div.mem_info a.selected { text-align:right; } .btn_group { - border-radius:6px; + border-radius:8px; padding:8px; margin-left:8px; background-color: #666; diff --git a/index.html b/index.html index 57e52b10..a388de07 100644 --- a/index.html +++ b/index.html @@ -119,10 +119,10 @@ if (window.location.host.endsWith('8bitworkshop.com')) { - - + - +