From 4f05ea487b7f799c83af92a3688d4a3e1e66073e Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Mon, 14 Feb 2022 20:35:42 -0600 Subject: [PATCH] 6809: updated lwasm for raw targets (.asm extension) --- src/worker/lib/williams-defender | 1 + src/worker/tools/m6809.ts | 9 ++++++++- src/worker/workermain.ts | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 120000 src/worker/lib/williams-defender diff --git a/src/worker/lib/williams-defender b/src/worker/lib/williams-defender new file mode 120000 index 00000000..561450fe --- /dev/null +++ b/src/worker/lib/williams-defender @@ -0,0 +1 @@ +williams \ No newline at end of file diff --git a/src/worker/tools/m6809.ts b/src/worker/tools/m6809.ts index 2e7eefc7..538fa8c4 100644 --- a/src/worker/tools/m6809.ts +++ b/src/worker/tools/m6809.ts @@ -132,9 +132,11 @@ export function assembleLWASM(step: BuildStep): BuildStepResult { gatherFiles(step, { mainFilePath: "main.s" }); var objpath = step.prefix + ".o"; var lstpath = step.prefix + ".lst"; + const isRaw = step.path.endsWith('.asm'); if (staleFiles(step, [objpath, lstpath])) { var objout, lstout; - var args = ['-9', '--obj', '-I/share/asminc', '-o' + objpath, '-l' + lstpath, step.path]; + var args = ['-9', '-I/share/asminc', '-o' + objpath, '-l' + lstpath, step.path]; + args.push(isRaw ? '-r' : '--obj'); var LWASM: EmscriptenModule = emglobal.lwasm({ instantiateWasm: moduleInstFn('lwasm'), noInitialRun: true, @@ -153,6 +155,11 @@ export function assembleLWASM(step: BuildStep): BuildStepResult { lstout = FS.readFile(lstpath, { encoding: 'utf8' }); putWorkFile(objpath, objout); putWorkFile(lstpath, lstout); + if (isRaw) { + return { + output: objout + }; + } } return { linktool: "lwlink", diff --git a/src/worker/workermain.ts b/src/worker/workermain.ts index ffde5d72..3c2d07ac 100644 --- a/src/worker/workermain.ts +++ b/src/worker/workermain.ts @@ -127,9 +127,17 @@ var PLATFORM_PARAMS = { data_start: 0x9800, data_size: 0x2800, stack_end: 0xc000, - //extra_compile_args: ['--vectrex'], extra_link_files: ['williams.scr', 'libcmoc-crt-vec.a', 'libcmoc-std-vec.a'], extra_link_args: ['-swilliams.scr', '-lcmoc-crt-vec', '-lcmoc-std-vec'], + extra_compile_files: ['assert.h','cmoc.h','stdarg.h','vectrex.h','stdlib.h','bios.h'], + }, + 'williams-defender': { + arch: '6809', + code_start: 0x0, + rom_size: 0xc000, + data_start: 0x9800, + data_size: 0x2800, + stack_end: 0xc000, }, 'williams-z80': { arch: 'z80',