diff --git a/index.html b/index.html
index 52be4dc6..cf234db9 100644
--- a/index.html
+++ b/index.html
@@ -278,6 +278,9 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
A W S D Move
←↑↓→ Fire
+ \ Coin
+ Enter Start
+ 6 7 8 9 Extra
←↑↓→ Joystick
diff --git a/presets/williams/test.xasm b/presets/williams/test.xasm
new file mode 100644
index 00000000..19db0727
--- /dev/null
+++ b/presets/williams/test.xasm
@@ -0,0 +1,28 @@
+
+palette equ $c000
+vidmem equ $0
+wdogx39 equ $cbff
+
+Start:
+ ldx #0
+Loop:
+ lda >PALCONST,x
+ sta palette,x
+ leax 1,x
+ cpx #16
+ bne Loop
+
+ ldx #0
+Loop2:
+ lda #$39
+ sta wdogx39
+ stx ,x
+ leax 1,x
+ cpx #$9800
+ bne Loop2
+
+ jmp Loop ; endless loop
+
+PALCONST:
+ fcb $1,$2,$4,$8,$10,$20,$40,$80
+ fcb $88,$c0,$e0,$f0,$f8,$fc,$fe,$ff
diff --git a/src/worker/workermain.ts b/src/worker/workermain.ts
index 7407615f..bfede6cf 100644
--- a/src/worker/workermain.ts
+++ b/src/worker/workermain.ts
@@ -104,6 +104,17 @@ var PLATFORM_PARAMS = {
{name:'I/O Registers',start:0x6000,size:0x2000,type:'io'},
],
},
+ 'williams': {
+ code_start: 0x0,
+ rom_size: 0xc000,
+ data_start: 0x9800,
+ data_size: 0x2800,
+ stack_end: 0xc000,
+ extra_segments:[
+ {name:'Video RAM',start:0x0000,size:0xc000,type:'ram'},
+ {name:'I/O Registers',start:0xc000,size:0x1000,type:'io'},
+ ],
+ },
'williams-z80': {
code_start: 0x0,
rom_size: 0x9800,
@@ -1908,10 +1919,9 @@ function translateShowdown(step:BuildStep) {
};
}
-// TODO
+// http://datapipe-blackbeltsystems.com/windows/flex/asm09.html
function assembleXASM6809(step:BuildStep) {
load("xasm6809");
- var origin = 0; // TODO: configurable
var alst = "";
var lasterror = null;
var errors = [];
@@ -1938,21 +1948,37 @@ function assembleXASM6809(step:BuildStep) {
});
var FS = Module['FS'];
//setupFS(FS);
- var code = getWorkFileAsString(step.path);
- FS.writeFile("main.asm", code);
- Module.callMain(["-c", "-l", "-s", "-y", "-o=main.bin", "main.asm"]);
+ populateFiles(step, FS, {
+ mainFilePath:'main.asm'
+ });
+ var binpath = step.prefix + '.bin';
+ var lstpath = step.prefix + '.lst'; // in stdout
+ Module.callMain(["-c", "-l", "-s", "-y", "-o="+binpath, step.path]);
if (errors.length)
return {errors:errors};
- var aout = FS.readFile("main.bin", {encoding:'binary'});
- putWorkFile('main.bin', aout);
- // 00001 0000 [ 2] 1048 asld
- var asmlines = parseListing(alst, /^\s*([0-9A-F]+)\s+([0-9A-F]+)\s+\[([0-9 ]+)\]\s+(\d+) (.*)/i, 1, 2, 4);
- // TODO
+ var aout = FS.readFile(binpath, {encoding:'binary'});
+ if (aout.length == 0) {
+ console.log(alst);
+ errors.push({line:0, msg:"Empty output file"});
+ return {errors:errors};
+ }
+ putWorkFile(binpath, aout);
+ putWorkFile(lstpath, alst);
+ // TODO: symbol map
+ //mond09 0000
+ var symbolmap = {};
+ //00005 W 0003 [ 8] A6890011 lda >PALETTE,x
+ //00012 0011 0C0203 fcb 12,2,3
+ var asmlines = parseListing(alst, /^\s*([0-9]+) .+ ([0-9A-F]+)\s+\[([0-9 ]+)\]\s+([0-9A-F]+) (.*)/i, 1, 2, 4, 3);
+ var listings = {};
+ listings[step.prefix+'.lst'] = {lines:asmlines, text:alst};
+ var segments = step.params.extra_segments;
return {
- output:aout,
- errors:errors,
- lines:asmlines,
- intermediate:{listing:alst},
+ output:aout,
+ listings:listings,
+ errors:errors,
+ symbolmap:symbolmap,
+ segments:segments
};
}
diff --git a/test/cli/testworker.js b/test/cli/testworker.js
index 5b1dfe90..6ef97a61 100644
--- a/test/cli/testworker.js
+++ b/test/cli/testworker.js
@@ -217,11 +217,9 @@ describe('Worker', function() {
it('should NOT preprocess SDCC', function(done) {
compile('sdcc', 'int x=0\n#bah\n', 'mw8080bw', done, 0, 0, 1);
});
- /*
it('should compile XASM6809', function(done) {
compile('xasm6809', '\tasld\n\tasld\n', 'williams', done, 4, 2, 0);
});
- */
it('should link two files with SDCC', function(done) {
var msgs = [
{