1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-03-12 19:41:40 +00:00

Deploying to gh-pages from @ sehugg/8bitworkshop@752d333839 🚀

This commit is contained in:
sehugg
2026-03-09 09:53:41 +00:00
parent 3fba646402
commit 555d83d192
13 changed files with 48 additions and 36 deletions

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 x}from"./chunk-3FIVEUG2.js";import{t as y}from"./chunk-EBT7EABD.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-NKJJZ6HQ.js";import{I as m,m as c,p}from"./chunk-GTDJ7CMC.js";import{C as d,K as f,aa as a,n as h}from"./chunk-MZ4MJULD.js";import"./chunk-KT7KMEQC.js";var n=31,s=class extends p{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new c;this.ram=new Uint8Array(16384);this.read=a([[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=a([[0,16383,16383,(e,r)=>{this.ram[e]=r}],[16387,16387,65535,(e,r)=>this.serial.sendByte(r)],[16399,16399,65535,(e,r)=>{this.inputs[n]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var r=0;r<this.cpuFrequency/60&&!(e&&e());)r+=this.advanceCPU();return r}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[n]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[n]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],l=class{constructor(t){t.style.overflowY="auto";var e=$('<div id="gameport"/>').appendTo(t);$('<p class="transcript-header">Serial Output</p>').appendTo(e);var r=$('<div id="windowport" class="transcript"/>').appendTo(e);this.div=r[0]}start(){this.tty=new x(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(t){this.tty.loadState(t)}};function v(i){return i==10?"":i<32?String.fromCharCode(i+9216):String.fromCharCode(i)}var u=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(t){this.clearToSend()&&(this.outputBytes.push(t),this.viewer.tty.addtext(v(t),34),t==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 t=this.readIndex();this.inputIndex=t;var e=(this.inputBytes&&this.inputBytes[t])|0;return this.viewer.tty.addtext(v(e),18),e==10&&this.viewer.tty.newline(),e}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(t){this.clk+=t}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(t){this.clk=t.clk,this.inputIndex=t.idx,this.outputBytes=t.out.slice()}},o=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 l(e)}async start(){super.start(),this.serial=new u,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=d(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=h(this.serial.outputBytes),y(),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 s}getPresets(){return S}readAddress(e){return this.machine.readConst(e)}};f["devel-6502"]=o;export{u as SerialTestHarness};
//# sourceMappingURL=devel-IAYKVKKM.js.map
import{a as x}from"./chunk-3FIVEUG2.js";import{t as y}from"./chunk-Z4MD5WNA.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-KEJM2AHE.js";import{I as m,m as c,p}from"./chunk-GTDJ7CMC.js";import{C as d,K as f,aa as a,n as h}from"./chunk-MZ4MJULD.js";import"./chunk-KT7KMEQC.js";var n=31,s=class extends p{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new c;this.ram=new Uint8Array(16384);this.read=a([[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=a([[0,16383,16383,(e,r)=>{this.ram[e]=r}],[16387,16387,65535,(e,r)=>this.serial.sendByte(r)],[16399,16399,65535,(e,r)=>{this.inputs[n]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var r=0;r<this.cpuFrequency/60&&!(e&&e());)r+=this.advanceCPU();return r}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[n]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[n]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],l=class{constructor(t){t.style.overflowY="auto";var e=$('<div id="gameport"/>').appendTo(t);$('<p class="transcript-header">Serial Output</p>').appendTo(e);var r=$('<div id="windowport" class="transcript"/>').appendTo(e);this.div=r[0]}start(){this.tty=new x(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(t){this.tty.loadState(t)}};function v(i){return i==10?"":i<32?String.fromCharCode(i+9216):String.fromCharCode(i)}var u=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(t){this.clearToSend()&&(this.outputBytes.push(t),this.viewer.tty.addtext(v(t),34),t==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 t=this.readIndex();this.inputIndex=t;var e=(this.inputBytes&&this.inputBytes[t])|0;return this.viewer.tty.addtext(v(e),18),e==10&&this.viewer.tty.newline(),e}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(t){this.clk+=t}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(t){this.clk=t.clk,this.inputIndex=t.idx,this.outputBytes=t.out.slice()}},o=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 l(e)}async start(){super.start(),this.serial=new u,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=d(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=h(this.serial.outputBytes),y(),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 s}getPresets(){return S}readAddress(e){return this.machine.readConst(e)}};f["devel-6502"]=o;export{u as SerialTestHarness};
//# sourceMappingURL=devel-HPEZJQH2.js.map

View File

@@ -1,2 +1,2 @@
import{b as v,c as P}from"./chunk-NKJJZ6HQ.js";import{A as p,E as w,K as c,l as u,m,y as g}from"./chunk-MZ4MJULD.js";import{e as I}from"./chunk-KT7KMEQC.js";var k=I(P()),i,a,l,h=(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 x(){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 y(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){w("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=>{y(r,f)},"arraybuffer"),!0;if(n){var s=m(atob(n));t=new u().decode(s)}return M(),y(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 v(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){x(),h.p&&b(h)}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,k.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 v,c as P}from"./chunk-KEJM2AHE.js";import{A as p,E as w,K as c,l as u,m,y as g}from"./chunk-MZ4MJULD.js";import{e as I}from"./chunk-KT7KMEQC.js";var k=I(P()),i,a,l,h=(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 x(){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 y(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){w("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=>{y(r,f)},"arraybuffer"),!0;if(n){var s=m(atob(n));t=new u().decode(s)}return M(),y(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 v(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){x(),h.p&&b(h)}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,k.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

@@ -443,17 +443,24 @@ async function loadProject(preset_id) {
await loadMainWindow(preset_id);
}
else {
// file not found, look for skeleton file
var tool = exports.platform.getToolForFilename(preset_id);
var skel = await getSkeletonFile(preset_id);
exports.current_project.filedata[preset_id] = skel || "\n";
await loadMainWindow(preset_id);
// don't alert if we selected "new file"
// don't alert if we selected "new file" unless there's a problem
if (!exports.qs.newfile) {
var tool = exports.platform.getToolForFilename(preset_id);
(0, dialogs_1.alertInfo)("Could not find file \"" + preset_id + "\"<br><br>" +
"Creating new " + (skel ? tool : "blank") + " file.");
}
else if (!skel && !tool) {
(0, dialogs_1.alertError)("No build tool for \"" + preset_id + "\" on this platform; project will not build.");
}
else if (!skel) {
(0, dialogs_1.alertInfo)("No skeleton file for " + tool + " on this platform; using blank file.");
}
else {
requestPersistPermission(true, true);
requestPersistPermission(true, true); // ask for persist permissions
}
delete exports.qs.newfile;
replaceURLState();
@@ -482,7 +489,7 @@ async function getSkeletonFile(fileid) {
return await $.get("presets/" + (0, util_1.getBasePlatform)(exports.platform_id) + "/skeleton." + ext, 'text');
}
catch (e) {
// alertError("Could not load skeleton for " + platform_id + "/" + ext + "; using blank file");
console.log(e + "");
return null;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
import{A as z,B as A,C as B,D as C,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,y as x,z as y}from"./chunk-EBT7EABD.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-NKJJZ6HQ.js";import"./chunk-GTDJ7CMC.js";import"./chunk-MZ4MJULD.js";import"./chunk-KT7KMEQC.js";export{q as clearBreakpoint,f as current_project,A as emulationHalted,n as getCurrentEditorFilename,m as getCurrentMainFilename,k as getCurrentOutput,j as getCurrentProject,v as getPlatformAndRepo,i as getPlatformStore,z as getSaveState,y as getTestOutput,l as getWorkerParams,t as gotoNewLocation,s as haltEmulation,C as highlightSearch,h as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,B as reloadWorkspaceFile,d as repo_id,p as runToPC,r as setFrameRateUI,x as setTestInput,o as setupBreakpoint,u as setupSplits,w as startUI,c as store_id};
import{A as z,B as A,C as B,D as C,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,y as x,z as y}from"./chunk-Z4MD5WNA.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-KEJM2AHE.js";import"./chunk-GTDJ7CMC.js";import"./chunk-MZ4MJULD.js";import"./chunk-KT7KMEQC.js";export{q as clearBreakpoint,f as current_project,A as emulationHalted,n as getCurrentEditorFilename,m as getCurrentMainFilename,k as getCurrentOutput,j as getCurrentProject,v as getPlatformAndRepo,i as getPlatformStore,z as getSaveState,y as getTestOutput,l as getWorkerParams,t as gotoNewLocation,s as haltEmulation,C as highlightSearch,h as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,B as reloadWorkspaceFile,d as repo_id,p as runToPC,r as setFrameRateUI,x as setTestInput,o as setupBreakpoint,u as setupSplits,w as startUI,c as store_id};
//# sourceMappingURL=ui.js.map

View File

@@ -453,16 +453,21 @@ async function loadProject(preset_id: string) {
// file found; continue
await loadMainWindow(preset_id);
} else {
// file not found, look for skeleton file
var tool = platform.getToolForFilename(preset_id);
var skel = await getSkeletonFile(preset_id);
current_project.filedata[preset_id] = skel || "\n";
await loadMainWindow(preset_id);
// don't alert if we selected "new file"
// don't alert if we selected "new file" unless there's a problem
if (!qs.newfile) {
var tool = platform.getToolForFilename(preset_id);
alertInfo("Could not find file \"" + preset_id + "\"<br><br>" +
"Creating new " + (skel ? tool : "blank") + " file.");
} else if (!skel && !tool) {
alertError("No build tool for \"" + preset_id + "\" on this platform; project will not build.");
} else if (!skel) {
alertInfo("No skeleton file for " + tool + " on this platform; using blank file.");
} else {
requestPersistPermission(true, true);
requestPersistPermission(true, true); // ask for persist permissions
}
delete qs.newfile;
replaceURLState();
@@ -490,7 +495,7 @@ async function getSkeletonFile(fileid: string): Promise<string> {
try {
return await $.get("presets/" + getBasePlatform(platform_id) + "/skeleton." + ext, 'text');
} catch (e) {
// alertError("Could not load skeleton for " + platform_id + "/" + ext + "; using blank file");
console.log(e+"");
return null;
}
}