diff --git a/presets/vic20/hellocart.dasm b/presets/vic20/hellocart.dasm new file mode 100644 index 00000000..b95d6f9c --- /dev/null +++ b/presets/vic20/hellocart.dasm @@ -0,0 +1,16 @@ + processor 6502 + + org $a000-2 ; so we can write the ... + .word $a000 ; cartridge 2-byte header + .word Start ; start vector + .word Start ; RESTORE vector + .byte $41, $30, $c3, $c2, $cd ; "A0CBM" + +Start: + lda $9004 +WaitLine; + cmp $9004 + beq WaitLine + sta $900f + jmp Start + diff --git a/presets/vic20/siegegame.c b/presets/vic20/siegegame.c index 8c3014fc..756d6936 100644 --- a/presets/vic20/siegegame.c +++ b/presets/vic20/siegegame.c @@ -205,6 +205,7 @@ void declare_winner(byte winner) { void play_round() { reset_players(); clrscr(); + bgcolor(COLOR_BLUE); textcolor(COLOR_WHITE); draw_playfield(); while (1) { diff --git a/res/c64.wasm b/res/c64.wasm index 12cbb44d..98d16f4e 100755 Binary files a/res/c64.wasm and b/res/c64.wasm differ diff --git a/res/vic20.wasm b/res/vic20.wasm index c6ec2fc8..34d9f1aa 100755 Binary files a/res/vic20.wasm and b/res/vic20.wasm differ diff --git a/src/machine/vic20.ts b/src/machine/vic20.ts index 2e7d6c40..465ba4f3 100644 --- a/src/machine/vic20.ts +++ b/src/machine/vic20.ts @@ -1,6 +1,10 @@ //// WASM Machine +// http://www.zimmers.net/anonftp/pub/cbm/documents/chipdata/VIC-I.txt +// http://www.zimmers.net/anonftp/pub/cbm/maps/Vic20.MemoryMap.txt +// http://sleepingelephant.com/denial/wiki/index.php/Autostart + import { Machine } from "../common/baseplatform"; import { Probeable, TrapCondition } from "../common/devices"; import { KeyFlags } from "../common/emu"; @@ -10,7 +14,7 @@ import { BaseWASMMachine } from "../common/wasmplatform"; export class VIC20_WASMMachine extends BaseWASMMachine implements Machine, Probeable { numTotalScanlines = 312; - cpuCyclesPerLine = 63; + cpuCyclesPerLine = 71; videoOffsetBytes = -24 * 4; prgstart : number; @@ -30,42 +34,47 @@ export class VIC20_WASMMachine extends BaseWASMMachine implements Machine, Probe } // load rom if (this.romptr && this.romlen) { + let rom = this.romarr; this.exports.machine_load_rom(this.sys, this.romptr, this.romlen); - this.prgstart = this.romarr[0] + (this.romarr[1]<<8); // get load address - // look for BASIC program start - if (this.prgstart == 0x1001) { - this.prgstart = this.romarr[2] + (this.romarr[3]<<8) + 2; // point to after BASIC program - console.log("prgstart", hex(this.prgstart)); - } - // is program loaded into RAM? - if (this.prgstart < 0x8000) { - // advance BIOS a few frames - this.exports.machine_exec(this.sys, 400000); - // type in command (SYS 2061) - var cmd = "SYS "+this.prgstart+"\r"; - console.log(cmd); - for (var i=0; i