c64: updated help, clock freq

This commit is contained in:
Steven Hugg 2020-05-25 13:04:04 -05:00
parent ec62b97868
commit c360b065f9
5 changed files with 28 additions and 4 deletions

View File

@ -197,6 +197,7 @@ TODO:
- emu doesn't reset properly (after gotoxy() BIOS call) - emu doesn't reset properly (after gotoxy() BIOS call)
- disk image support - disk image support
- https://github.com/cc65/cc65/issues/946 - https://github.com/cc65/cc65/issues/946
- sample buffer skips
WEB WORKER FORMAT WEB WORKER FORMAT
@ -395,3 +396,13 @@ Markdown (showdown) interface
- cursor shows current state/errors (must map markdown->src lines) - cursor shows current state/errors (must map markdown->src lines)
- show preview emulator at each step (play button? run when viewed?) - 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

View File

@ -300,7 +300,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<div id="javatari-console-panel" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div> <div id="javatari-console-panel" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
</div> </div>
<!-- control instructions --> <!-- control instructions -->
<div class="emucontrols-vcs text-center small control-insns" style="display:none"> <div class="emucontrols-vcs emucontrols-c64 text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">&#x2190;&#x2191;&#x2193;&#x2192;</span> Joystick</span> <span class="control-def"><span class="control-key">&#x2190;&#x2191;&#x2193;&#x2192;</span> Joystick</span>
<span class="control-def"><span class="control-key small">Space</span> Button</span> <span class="control-def"><span class="control-key small">Space</span> Button</span>
</div> </div>

View File

@ -18,8 +18,6 @@ typedef unsigned short word;
static byte** BASL = (byte**) 0xD1; static byte** BASL = (byte**) 0xD1;
byte getchar(byte x, byte y) { byte getchar(byte x, byte y) {
// JSR VTABZ
// LDA (BASL) ($28)
gotoxy(x,y); // set cursor position gotoxy(x,y); // set cursor position
return (*BASL)[x]; // lookup value @ cursor address return (*BASL)[x]; // lookup value @ cursor address
} }
@ -183,8 +181,11 @@ void make_move() {
ai_control(&players[0]); ai_control(&players[0]);
ai_control(&players[1]); ai_control(&players[1]);
// if players collide, 2nd player gets the point // if players collide, 2nd player gets the point
textcolor(COLOR_CYAN);
move_player(&players[1]); move_player(&players[1]);
textcolor(COLOR_YELLOW);
move_player(&players[0]); move_player(&players[0]);
textcolor(COLOR_WHITE);
} }
void declare_winner(byte winner) { void declare_winner(byte winner) {
@ -204,6 +205,7 @@ void declare_winner(byte winner) {
void play_round() { void play_round() {
reset_players(); reset_players();
clrscr(); clrscr();
textcolor(COLOR_WHITE);
draw_playfield(); draw_playfield();
while (1) { while (1) {
make_move(); make_move();

View File

@ -10,6 +10,8 @@ import { lzgmini, stringToByteArray, hex, rgb2bgr } from "../common/util";
// http://sta.c64.org/cbm64mem.html // http://sta.c64.org/cbm64mem.html
// http://hitmen.c02.at/temp/palstuff/ // http://hitmen.c02.at/temp/palstuff/
// native JS emulator (NOT USED)
const KEYBOARD_ROW_0 = 0; const KEYBOARD_ROW_0 = 0;
const SWCHA = 8; const SWCHA = 8;
const SWCHB = 9; const SWCHB = 9;
@ -594,7 +596,7 @@ export class C64_WASMMachine extends BaseWASMMachine implements Machine {
} }
advanceFrame(trap: TrapCondition) : number { advanceFrame(trap: TrapCondition) : number {
this.typeInitString(); // type init string into console (TODO: doesnt work during debug) 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() { typeInitString() {
if (this.initstring) { if (this.initstring) {

View File

@ -17,6 +17,7 @@ const C64_PRESETS = [
{id:'scroll4.c', name:'Scrolling 4 (C)'}, {id:'scroll4.c', name:'Scrolling 4 (C)'},
{id:'scroll5.c', name:'Scrolling 5 (C)'}, {id:'scroll5.c', name:'Scrolling 5 (C)'},
{id:'climber.c', name:'Climber Game (C)'}, {id:'climber.c', name:'Climber Game (C)'},
{id:'musicplayer.c', name:'Music Player (C)'},
]; ];
const C64_MEMORY_MAP = { main:[ const C64_MEMORY_MAP = { main:[
@ -26,12 +27,16 @@ const C64_MEMORY_MAP = { main:[
{name:'BASIC ROM', start:0xa000,size:0x2000,type:'rom'}, {name:'BASIC ROM', start:0xa000,size:0x2000,type:'rom'},
{name:'RAM', start:0xc000,size:0x1000,type:'ram'}, {name:'RAM', start:0xc000,size:0x1000,type:'ram'},
{name:'VIC-II I/O', start:0xd000,size:0x0400,type:'io'}, {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:'Color RAM', start:0xd800,size:0x0400,type:'io'},
{name:'CIA 1', start:0xdc00,size:0x0100,type:'io'}, {name:'CIA 1', start:0xdc00,size:0x0100,type:'io'},
{name:'CIA 2', start:0xdd00,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'}, {name:'KERNAL ROM', start:0xe000,size:0x2000,type:'rom'},
] } ] }
// native C64 platform (NOT USED)
class C64Platform extends Base6502MachinePlatform<C64> implements Platform { class C64Platform extends Base6502MachinePlatform<C64> implements Platform {
newMachine() { return new C64(); } newMachine() { return new C64(); }
@ -42,6 +47,7 @@ class C64Platform extends Base6502MachinePlatform<C64> implements Platform {
getMemoryMap() { return C64_MEMORY_MAP; } getMemoryMap() { return C64_MEMORY_MAP; }
} }
// WASM C64 platform
class C64WASMPlatform extends Base6502MachinePlatform<C64_WASMMachine> implements Platform { class C64WASMPlatform extends Base6502MachinePlatform<C64_WASMMachine> implements Platform {
newMachine() { return new C64_WASMMachine('c64'); } newMachine() { return new C64_WASMMachine('c64'); }
@ -55,6 +61,9 @@ class C64WASMPlatform extends Base6502MachinePlatform<C64_WASMMachine> implement
getDefaultExtension() { return ".c"; }; getDefaultExtension() { return ".c"; };
readAddress(a) { return this.machine.readConst(a); } readAddress(a) { return this.machine.readConst(a); }
getMemoryMap() { return C64_MEMORY_MAP; } getMemoryMap() { return C64_MEMORY_MAP; }
showHelp() {
window.open("https://sta.c64.org/cbm64mem.html", "_help");
}
} }
PLATFORMS['c64'] = C64WASMPlatform; PLATFORMS['c64'] = C64WASMPlatform;