atari8: fixed help links

This commit is contained in:
Steven Hugg 2022-09-07 18:11:43 -05:00
parent 162113b915
commit 20954fd5ce
5 changed files with 12 additions and 131 deletions

View File

@ -165,13 +165,13 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<a tabindex="-1" href="#">Computers</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="?platform=c64">Commodore 64</a></li>
<li><a class="dropdown-item" href="?platform=atari8-800">Atari 800</a></li>
<li><a class="dropdown-item" href="?platform=msx">MSX (BIOS)</a></li>
<li><a class="dropdown-item" href="?platform=msx-libcv">MSX (libCV)</a></li>
<li><a class="dropdown-item" href="?platform=apple2">Apple ][+</a></li>
<li><a class="dropdown-item" href="?platform=zx">ZX Spectrum</a></li>
<li><a class="dropdown-item" href="?platform=x86">x86 (FreeDOS)</a></li>
<li><a class="dropdown-item" href="?platform=cpc.6128">Amstrad CPC6128</a></li>
<li><a class="dropdown-item" href="?platform=atari8-800">Atari 800</a></li>
</ul>
</li>
<li class="dropdown dropdown-submenu">

View File

@ -369,17 +369,17 @@ x................... .. .. ..
const activity = Standing
decode vcs_sprite
---
..xxx... f8
.xxxxx.. f8
..xxx... f4
.xxxxx.. f6
x.xxxx.. f8
.xxx.x.. f8
.xxx.x.. 0c
x.xxxxx. f8
x.xxxx.. f8
..xx.... f8
..xxxx.. f8
...xxx.. f8
...xx... f8
...xx... f8
...xx... f6
...xx... f6
..xxx... 38
..xxx... 48
.x.xxx.. 58

View File

@ -42,14 +42,6 @@ system MusicPlayer
{{!musicpulse}} ; update song
{{!musicframe}} ; update registers
---
on prekernel do once
---
{{!musicframe}} ; update registers
---
on postkernel do once
---
{{!musicframe}} ; update registers
---
on postframe do once
---
{{!musicframe}} ; update registers

View File

@ -430,112 +430,3 @@ export class Atari5200 extends Atari800 {
}
}
///
export class Atari8_WASMMachine extends BaseWASIMachine
implements Machine, Probeable, VideoSource, AcceptsROM, FrameBased, AcceptsKeyInput, AcceptsPaddleInput {
numTotalScanlines = 312;
cpuCyclesPerLine = 63;
prgstart: number;
joymask0 = 0;
joymask1 = 0;
loadROM(rom: Uint8Array) {
super.loadROM(rom);
this.reloadROM();
}
reloadROM() {
if (this.sys) {
var result = this.exports.machine_load_rom(this.sys, this.romptr, this.romlen);
console.log('machine_load_rom', result);
//console.log(this.wasmFs.fs.existsSync('atari8.img'), result);
}
}
loadBIOS(srcArray: Uint8Array) {
super.loadBIOS(srcArray);
}
reset() {
this.reloadROM();
}
advanceFrame(trap: TrapCondition): number {
// TODO
this.exports.machine_start_frame(this.sys);
if (trap) {
this.advanceFrameClock(trap, 999999); // TODO?
} else {
this.exports.machine_advance_frame(this.sys);
}
this.syncVideo();
this.syncAudio();
return 1;
}
getCPUState() {
this.exports.machine_save_cpu_state(this.sys, this.stateptr);
var s = this.statearr;
var pc = s[6] + (s[7] << 8);
return {
PC: pc,
SP: s[2],
A: s[0],
X: s[3],
Y: s[4],
C: s[1] & 1,
Z: s[1] & 2,
I: s[1] & 4,
D: s[1] & 8,
V: s[1] & 64,
N: s[1] & 128,
o: this.readConst(pc),
}
}
saveState() {
var cpu = this.getCPUState();
this.exports.machine_save_state(this.sys, this.stateptr);
return {
c: cpu,
state: this.statearr.slice(0),
//ram:this.statearr.slice(18640, 18640+0x200), // ZP and stack
};
}
loadState(state): void {
this.statearr.set(state.state);
this.exports.machine_load_state(this.sys, this.stateptr);
}
getVideoParams() {
return { width: 384, height: 240, overscan: true, videoFrequency: 60 };
}
pollControls() {
}
setKeyInput(key: number, code: number, flags: number): void {
// modifier flags
if (flags & KeyFlags.Shift) key |= 0x100;
if (flags & KeyFlags.Ctrl) key |= 0x200;
// keyboard -> joystick
var mask = 0;
if (key == 37) { key = 0x8; mask = 0x4; } // LEFT
if (key == 38) { key = 0xb; mask = 0x1; } // UP
if (key == 39) { key = 0x9; mask = 0x8; } // RIGHT
if (key == 40) { key = 0xa; mask = 0x2; } // DOWN
if (key == 32) { mask = 0x100; } // FIRE
// set machine inputs
if (flags & KeyFlags.KeyDown) {
this.exports.machine_key_down(this.sys, key);
this.joymask0 |= mask;
} else if (flags & KeyFlags.KeyUp) {
this.exports.machine_key_up(this.sys, key);
this.joymask0 &= ~mask;
}
this.setJoyInput(0, this.joymask0);
this.setJoyInput(1, this.joymask1);
}
setJoyInput(joy: number, mask: number) {
this.exports.machine_joy_set(this.sys, joy, mask);
}
setPaddleInput(controller: number, value: number): void {
this.exports.machine_paddle_set(this.sys, controller, value);
}
}

View File

@ -77,12 +77,7 @@ abstract class Atari8MAMEPlatform extends BaseMAME6502Platform {
getToolForFilename = getToolForFilename_Atari8;
getOpcodeMetadata = getOpcodeMetadata_6502;
getDefaultExtension() { return ".asm"; };
showHelp(tool:string, ident:string) {
if (tool == 'fastbasic')
window.open("https://github.com/dmsc/fastbasic/blob/master/manual.md", "_help");
else
window.open("https://atariwiki.org/wiki/Wiki.jsp?page=Assembler", "_help"); // TODO
}
showHelp = atari8_showHelp;
}
class Atari800MAMEPlatform extends Atari8MAMEPlatform implements Platform {
@ -152,8 +147,11 @@ function atari8_getROMExtension(rom: Uint8Array) {
else return ".rom";
}
function atari8_showHelp() {
return "https://8bitworkshop.com/docs/platforms/atari8/";
function atari8_showHelp(tool: string, ident: string) {
if (tool == 'fastbasic')
window.open("https://github.com/dmsc/fastbasic/blob/master/manual.md", "_help");
else
window.open("https://8bitworkshop.com/docs/platforms/atari8/", "_help");
}
///