diff --git a/doc/notes.txt b/doc/notes.txt
index 40b55f56..502cd8fd 100644
--- a/doc/notes.txt
+++ b/doc/notes.txt
@@ -197,6 +197,7 @@ TODO:
- emu doesn't reset properly (after gotoxy() BIOS call)
- disk image support
- https://github.com/cc65/cc65/issues/946
+ - sample buffer skips
WEB WORKER FORMAT
@@ -395,3 +396,13 @@ Markdown (showdown) interface
- cursor shows current state/errors (must map markdown->src lines)
- show preview emulator at each step (play button? run when viewed?)
+
+DOCUMENTATION
+
+memory map
+BIOS routines
+cc65 standard libs
+cc65 headers
+example headers (presets/*/*.h)
+libcv headers (src/worker/lib)
+ASM includes
diff --git a/index.html b/index.html
index 99ad439b..923881e9 100644
--- a/index.html
+++ b/index.html
@@ -300,7 +300,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
+
←↑↓→ Joystick
Space Button
diff --git a/presets/c64/siegegame.c b/presets/c64/siegegame.c
index bb2b8b81..8ab98d55 100644
--- a/presets/c64/siegegame.c
+++ b/presets/c64/siegegame.c
@@ -18,8 +18,6 @@ typedef unsigned short word;
static byte** BASL = (byte**) 0xD1;
byte getchar(byte x, byte y) {
- // JSR VTABZ
- // LDA (BASL) ($28)
gotoxy(x,y); // set cursor position
return (*BASL)[x]; // lookup value @ cursor address
}
@@ -183,8 +181,11 @@ void make_move() {
ai_control(&players[0]);
ai_control(&players[1]);
// if players collide, 2nd player gets the point
+ textcolor(COLOR_CYAN);
move_player(&players[1]);
+ textcolor(COLOR_YELLOW);
move_player(&players[0]);
+ textcolor(COLOR_WHITE);
}
void declare_winner(byte winner) {
@@ -204,6 +205,7 @@ void declare_winner(byte winner) {
void play_round() {
reset_players();
clrscr();
+ textcolor(COLOR_WHITE);
draw_playfield();
while (1) {
make_move();
diff --git a/src/machine/c64.ts b/src/machine/c64.ts
index 8d5ab187..0b5219af 100644
--- a/src/machine/c64.ts
+++ b/src/machine/c64.ts
@@ -10,6 +10,8 @@ import { lzgmini, stringToByteArray, hex, rgb2bgr } from "../common/util";
// http://sta.c64.org/cbm64mem.html
// http://hitmen.c02.at/temp/palstuff/
+// native JS emulator (NOT USED)
+
const KEYBOARD_ROW_0 = 0;
const SWCHA = 8;
const SWCHB = 9;
@@ -594,7 +596,7 @@ export class C64_WASMMachine extends BaseWASMMachine implements Machine {
}
advanceFrame(trap: TrapCondition) : number {
this.typeInitString(); // type init string into console (TODO: doesnt work during debug)
- return super.advanceFrameClock(trap, 19656); // TODO: NTSC?
+ return super.advanceFrameClock(trap, 19656); // TODO: 985248 / 50 = 19705? music skips
}
typeInitString() {
if (this.initstring) {
diff --git a/src/platform/c64.ts b/src/platform/c64.ts
index 310abf3c..cb0ab57d 100644
--- a/src/platform/c64.ts
+++ b/src/platform/c64.ts
@@ -17,6 +17,7 @@ const C64_PRESETS = [
{id:'scroll4.c', name:'Scrolling 4 (C)'},
{id:'scroll5.c', name:'Scrolling 5 (C)'},
{id:'climber.c', name:'Climber Game (C)'},
+ {id:'musicplayer.c', name:'Music Player (C)'},
];
const C64_MEMORY_MAP = { main:[
@@ -26,12 +27,16 @@ const C64_MEMORY_MAP = { main:[
{name:'BASIC ROM', start:0xa000,size:0x2000,type:'rom'},
{name:'RAM', start:0xc000,size:0x1000,type:'ram'},
{name:'VIC-II I/O', start:0xd000,size:0x0400,type:'io'},
+ {name:'SID', start:0xd400,size:0x0400,type:'io'},
{name:'Color RAM', start:0xd800,size:0x0400,type:'io'},
{name:'CIA 1', start:0xdc00,size:0x0100,type:'io'},
{name:'CIA 2', start:0xdd00,size:0x0100,type:'io'},
+ {name:'I/O 1', start:0xde00,size:0x0100,type:'io'},
+ {name:'I/O 2', start:0xdf00,size:0x0100,type:'io'},
{name:'KERNAL ROM', start:0xe000,size:0x2000,type:'rom'},
] }
+// native C64 platform (NOT USED)
class C64Platform extends Base6502MachinePlatform
implements Platform {
newMachine() { return new C64(); }
@@ -42,6 +47,7 @@ class C64Platform extends Base6502MachinePlatform implements Platform {
getMemoryMap() { return C64_MEMORY_MAP; }
}
+// WASM C64 platform
class C64WASMPlatform extends Base6502MachinePlatform implements Platform {
newMachine() { return new C64_WASMMachine('c64'); }
@@ -55,6 +61,9 @@ class C64WASMPlatform extends Base6502MachinePlatform implement
getDefaultExtension() { return ".c"; };
readAddress(a) { return this.machine.readConst(a); }
getMemoryMap() { return C64_MEMORY_MAP; }
+ showHelp() {
+ window.open("https://sta.c64.org/cbm64mem.html", "_help");
+ }
}
PLATFORMS['c64'] = C64WASMPlatform;