1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-05-28 08:41:30 +00:00

Deploying to gh-pages from @ sehugg/8bitworkshop@20954fd5ce 🚀

This commit is contained in:
sehugg 2022-09-11 15:31:58 +00:00
parent 3a9d387146
commit 2f7cf18d7c
24 changed files with 45 additions and 290 deletions

10
gen/atari8-BXZX7PWE.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-A3GHABOL.js";import"./chunk-YT7MMFDW.js";import"./chunk-5SHCNQ2O.js";import"./chunk-D6UER3F3.js";import{I as m,o as u,t as h}from"./chunk-VFG63MRQ.js";import{$ as i,B as o,J as l,m as n}from"./chunk-JC7DT6V7.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new h;this.ram=new Uint8Array(16384);this.read=i([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=i([[0,16383,16383,(e,t)=>{this.ram[e]=t}],[16387,16387,65535,(e,t)=>this.serial.sendByte(t)],[16399,16399,65535,(e,t)=>{this.inputs[s]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var t=0;t<this.cpuFrequency/60&&!(e&&e());)t+=this.advanceCPU();return t}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[s]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[s]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],f=class{constructor(e){e.style.overflowY="auto";var t=$('<div id="gameport"/>').appendTo(e);$('<p class="transcript-header">Serial Output</p>').appendTo(t);var y=$('<div id="windowport" class="transcript"/>').appendTo(t);this.div=y[0]}start(){this.tty=new d(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(e){this.tty.loadState(e)}};function p(r){return r==10?"":r<32?String.fromCharCode(r+9216):String.fromCharCode(r)}var v=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(e){this.clearToSend()&&(this.outputBytes.push(e),this.viewer.tty.addtext(p(e),2|32),e==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var e=this.readIndex();this.inputIndex=e;var t=(this.inputBytes&&this.inputBytes[e])|0;return this.viewer.tty.addtext(p(t),2|16),t==10&&this.viewer.tty.newline(),t}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(e){this.clk+=e}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(e){this.clk=e.clk,this.inputIndex=e.idx,this.outputBytes=e.out.slice()}},x=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new f(e)}async start(){super.start(),this.serial=new v,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=o(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=n(this.serial.outputBytes),c(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new a}getPresets(){return S}getDefaultExtension(){return".dasm"}readAddress(e){return this.machine.readConst(e)}};l["devel-6502"]=x;export{v as SerialTestHarness};
//# sourceMappingURL=devel-MFYS7JYI.js.map
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-DIFYM43T.js";import"./chunk-YT7MMFDW.js";import"./chunk-5SHCNQ2O.js";import"./chunk-U2ELWADC.js";import{I as m,o as u,t as h}from"./chunk-VFG63MRQ.js";import{$ as i,B as o,J as l,m as n}from"./chunk-JC7DT6V7.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new h;this.ram=new Uint8Array(16384);this.read=i([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=i([[0,16383,16383,(e,t)=>{this.ram[e]=t}],[16387,16387,65535,(e,t)=>this.serial.sendByte(t)],[16399,16399,65535,(e,t)=>{this.inputs[s]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var t=0;t<this.cpuFrequency/60&&!(e&&e());)t+=this.advanceCPU();return t}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[s]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[s]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],f=class{constructor(e){e.style.overflowY="auto";var t=$('<div id="gameport"/>').appendTo(e);$('<p class="transcript-header">Serial Output</p>').appendTo(t);var y=$('<div id="windowport" class="transcript"/>').appendTo(t);this.div=y[0]}start(){this.tty=new d(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(e){this.tty.loadState(e)}};function p(r){return r==10?"":r<32?String.fromCharCode(r+9216):String.fromCharCode(r)}var v=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(e){this.clearToSend()&&(this.outputBytes.push(e),this.viewer.tty.addtext(p(e),2|32),e==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var e=this.readIndex();this.inputIndex=e;var t=(this.inputBytes&&this.inputBytes[e])|0;return this.viewer.tty.addtext(p(t),2|16),t==10&&this.viewer.tty.newline(),t}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(e){this.clk+=e}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(e){this.clk=e.clk,this.inputIndex=e.idx,this.outputBytes=e.out.slice()}},x=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new f(e)}async start(){super.start(),this.serial=new v,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=o(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=n(this.serial.outputBytes),c(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new a}getPresets(){return S}getDefaultExtension(){return".dasm"}readAddress(e){return this.machine.readConst(e)}};l["devel-6502"]=x;export{v as SerialTestHarness};
//# sourceMappingURL=devel-ZWVINNQH.js.map

View File

@ -1,2 +1,2 @@
import{b as w,c as x}from"./chunk-D6UER3F3.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-JC7DT6V7.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
import{b as w,c as x}from"./chunk-U2ELWADC.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-JC7DT6V7.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
//# sourceMappingURL=embedui.js.map

View File

@ -1,12 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Atari8_WASMMachine = exports.Atari5200 = exports.Atari800 = void 0;
exports.Atari5200 = exports.Atari800 = void 0;
const audio_1 = require("../common/audio");
const MOS6502_1 = require("../common/cpu/MOS6502");
const devices_1 = require("../common/devices");
const emu_1 = require("../common/emu");
const util_1 = require("../common/util");
const wasmplatform_1 = require("../common/wasmplatform");
const antic_1 = require("./chips/antic");
const gtia_1 = require("./chips/gtia");
const pokey_1 = require("./chips/pokey");
@ -423,127 +422,4 @@ class Atari5200 extends Atari800 {
}
}
exports.Atari5200 = Atari5200;
///
class Atari8_WASMMachine extends wasmplatform_1.BaseWASIMachine {
constructor() {
super(...arguments);
this.numTotalScanlines = 312;
this.cpuCyclesPerLine = 63;
this.joymask0 = 0;
this.joymask1 = 0;
}
loadROM(rom) {
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) {
super.loadBIOS(srcArray);
}
reset() {
this.reloadROM();
}
advanceFrame(trap) {
// 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) {
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, code, flags) {
// modifier flags
if (flags & emu_1.KeyFlags.Shift)
key |= 0x100;
if (flags & emu_1.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 & emu_1.KeyFlags.KeyDown) {
this.exports.machine_key_down(this.sys, key);
this.joymask0 |= mask;
}
else if (flags & emu_1.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, mask) {
this.exports.machine_joy_set(this.sys, joy, mask);
}
setPaddleInput(controller, value) {
this.exports.machine_paddle_set(this.sys, controller, value);
}
}
exports.Atari8_WASMMachine = Atari8_WASMMachine;
//# sourceMappingURL=atari8.js.map

File diff suppressed because one or more lines are too long

View File

@ -77,16 +77,11 @@ class Atari8MAMEPlatform extends mameplatform_1.BaseMAME6502Platform {
super(...arguments);
this.getToolForFilename = getToolForFilename_Atari8;
this.getOpcodeMetadata = baseplatform_1.getOpcodeMetadata_6502;
this.showHelp = atari8_showHelp;
}
getPresets() { return Atari8_PRESETS; }
getDefaultExtension() { return ".asm"; }
;
showHelp(tool, ident) {
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
}
}
class Atari800MAMEPlatform extends Atari8MAMEPlatform {
constructor() {
@ -165,8 +160,11 @@ function atari8_getROMExtension(rom) {
else
return ".rom";
}
function atari8_showHelp() {
return "https://8bitworkshop.com/docs/platforms/atari8/";
function atari8_showHelp(tool, ident) {
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");
}
///
emu_1.PLATFORMS['atari8-800.xlmame'] = Atari800MAMEPlatform;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w}from"./chunk-A3GHABOL.js";import"./chunk-YT7MMFDW.js";import"./chunk-5SHCNQ2O.js";import"./chunk-D6UER3F3.js";import"./chunk-VFG63MRQ.js";import"./chunk-JC7DT6V7.js";import"./chunk-5XVCUSSZ.js";export{l as clearBreakpoint,h as compparams,f as current_project,u as emulationHalted,p as getPlatformAndRepo,t as getSaveState,s as getTestOutput,n as haltEmulation,w as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,v as reloadWorkspaceFile,d as repo_id,k as runToPC,m as setFrameRateUI,r as setTestInput,j as setupBreakpoint,o as setupSplits,q as startUI,c as store_id};
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w}from"./chunk-DIFYM43T.js";import"./chunk-YT7MMFDW.js";import"./chunk-5SHCNQ2O.js";import"./chunk-U2ELWADC.js";import"./chunk-VFG63MRQ.js";import"./chunk-JC7DT6V7.js";import"./chunk-5XVCUSSZ.js";export{l as clearBreakpoint,h as compparams,f as current_project,u as emulationHalted,p as getPlatformAndRepo,t as getSaveState,s as getTestOutput,n as haltEmulation,w as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,v as reloadWorkspaceFile,d as repo_id,k as runToPC,m as setFrameRateUI,r as setTestInput,j as setupBreakpoint,o as setupSplits,q as startUI,c as store_id};
//# sourceMappingURL=ui.js.map

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");
}
///