1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-01 20:41:36 +00:00

Deploying to gh-pages from @ sehugg/8bitworkshop@1d3b8ab99c 🚀

This commit is contained in:
sehugg 2022-02-21 15:42:49 +00:00
parent c2cec1701e
commit 96a9df95aa
15 changed files with 18 additions and 18 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

View File

@ -1,2 +1,2 @@
import{c as x}from"./chunk-5XVCUSSZ.js";var E=x((f,d)=>{(function(c,i){typeof define=="function"&&define.amd?define([],i):typeof f!="undefined"?i():(i(),c.FileSaver={})})(f,function(){"use strict";function c(e,t){return typeof t=="undefined"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){p(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,w=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(e,t,n){var r=a.URL||a.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?l(o):v(o.href)?i(e,t,n):l(o,o.target="_blank")):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){l(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(c(e,n),t);else if(v(e))i(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){l(r)})}}:function(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,n);var o=e.type==="application/octet-stream",b=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&b||w)&&typeof FileReader!="undefined"){var m=new FileReader;m.onloadend=function(){var s=m.result;s=y?s:s.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=s:location=s,r=null},m.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,u=h.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){h.revokeObjectURL(u)},4e4)}});a.saveAs=p.saveAs=p,typeof d!="undefined"&&(d.exports=p)})});function g(c){switch(c){case"apple2":return import("./apple2-H3VAZWAL.js");case"arm32":return import("./arm32-ZRA7RYPW.js");case"astrocade":return import("./astrocade-H6LXE4BP.js");case"atari7800":return import("./atari7800-VCM7ACKD.js");case"atari8":return import("./atari8-JGD7NFGO.js");case"basic":return import("./basic-CFE5GHR2.js");case"c64":return import("./c64-MYAENQCH.js");case"coleco":return import("./coleco-PTL4GMXR.js");case"cpc":return import("./cpc-OKPYJFVT.js");case"devel":return import("./devel-ODB3RZWR.js");case"galaxian":return import("./galaxian-JEBM42HD.js");case"kim1":return import("./kim1-GYAFONAE.js");case"markdown":return import("./markdown-3OKXF7BI.js");case"msx":return import("./msx-RLGWOHMY.js");case"mw8080bw":return import("./mw8080bw-5GBF2IO7.js");case"nes":return import("./nes-XTO35F6C.js");case"script":return import("./script-DLP7LHCT.js");case"sms":return import("./sms-3522WDYJ.js");case"sound_konami":return import("./sound_konami-SZBYF6TE.js");case"sound_williams":return import("./sound_williams-MOJJVPNX.js");case"vcs":return import("./vcs-GEEOAUPL.js");case"vector":return import("./vector-4VYMUDY7.js");case"vectrex":return import("./vectrex-DREMSPCQ.js");case"verilog":return import("./verilog-I5D7NR5E.js");case"vicdual":return import("./vicdual-NJSH6KY3.js");case"williams":return import("./williams-COVM7SRF.js");case"x86":return import("./x86-VPTP6IV2.js");case"zmachine":return import("./zmachine-YJOCLJGR.js");case"zx":return import("./zx-RRR4VYRO.js");default:throw new Error(`Platform not recognized: '${c}'`)}}export{g as a,E as b};
//# sourceMappingURL=chunk-4YU4ZZQD.js.map
import{c as x}from"./chunk-5XVCUSSZ.js";var E=x((f,d)=>{(function(c,i){typeof define=="function"&&define.amd?define([],i):typeof f!="undefined"?i():(i(),c.FileSaver={})})(f,function(){"use strict";function c(e,t){return typeof t=="undefined"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){p(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,w=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(e,t,n){var r=a.URL||a.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?l(o):v(o.href)?i(e,t,n):l(o,o.target="_blank")):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){l(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(c(e,n),t);else if(v(e))i(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){l(r)})}}:function(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,n);var o=e.type==="application/octet-stream",b=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&b||w)&&typeof FileReader!="undefined"){var m=new FileReader;m.onloadend=function(){var s=m.result;s=y?s:s.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=s:location=s,r=null},m.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,u=h.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){h.revokeObjectURL(u)},4e4)}});a.saveAs=p.saveAs=p,typeof d!="undefined"&&(d.exports=p)})});function g(c){switch(c){case"apple2":return import("./apple2-H3VAZWAL.js");case"arm32":return import("./arm32-ZRA7RYPW.js");case"astrocade":return import("./astrocade-H6LXE4BP.js");case"atari7800":return import("./atari7800-VCM7ACKD.js");case"atari8":return import("./atari8-JGD7NFGO.js");case"basic":return import("./basic-6MCWYLNK.js");case"c64":return import("./c64-MYAENQCH.js");case"coleco":return import("./coleco-PTL4GMXR.js");case"cpc":return import("./cpc-OKPYJFVT.js");case"devel":return import("./devel-WRMMI5KI.js");case"galaxian":return import("./galaxian-JEBM42HD.js");case"kim1":return import("./kim1-GYAFONAE.js");case"markdown":return import("./markdown-3OKXF7BI.js");case"msx":return import("./msx-RLGWOHMY.js");case"mw8080bw":return import("./mw8080bw-5GBF2IO7.js");case"nes":return import("./nes-XTO35F6C.js");case"script":return import("./script-QRWYCKBD.js");case"sms":return import("./sms-3522WDYJ.js");case"sound_konami":return import("./sound_konami-SZBYF6TE.js");case"sound_williams":return import("./sound_williams-MOJJVPNX.js");case"vcs":return import("./vcs-GEEOAUPL.js");case"vector":return import("./vector-4VYMUDY7.js");case"vectrex":return import("./vectrex-DREMSPCQ.js");case"verilog":return import("./verilog-I5D7NR5E.js");case"vicdual":return import("./vicdual-NJSH6KY3.js");case"williams":return import("./williams-COVM7SRF.js");case"x86":return import("./x86-VPTP6IV2.js");case"zmachine":return import("./zmachine-YJOCLJGR.js");case"zx":return import("./zx-RRR4VYRO.js");default:throw new Error(`Platform not recognized: '${c}'`)}}export{g as a,E as b};
//# sourceMappingURL=chunk-JOVIKINE.js.map

View File

@ -1,2 +1,2 @@
import{a as d}from"./chunk-3XE5YOCV.js";import{m as c}from"./chunk-BPLU3NYG.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-4YU4ZZQD.js";import{a as m}from"./chunk-LFTGHW2G.js";import{F as h,m as u}from"./chunk-NAQO23MV.js";import"./chunk-JM5NHRL4.js";import{A as o,I as l,_ as i,m as n}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new m;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 h{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-ODB3RZWR.js.map
import{a as d}from"./chunk-3XE5YOCV.js";import{m as c}from"./chunk-INEYEY2Q.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-JOVIKINE.js";import{a as m}from"./chunk-LFTGHW2G.js";import{F as h,m as u}from"./chunk-NAQO23MV.js";import"./chunk-JM5NHRL4.js";import{A as o,I as l,_ as i,m as n}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new m;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 h{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-WRMMI5KI.js.map

View File

@ -1,2 +1,2 @@
import{a as w,b as x}from"./chunk-4YU4ZZQD.js";import"./chunk-JM5NHRL4.js";import{C as v,I as c,k as m,l as u,w as g,y as p}from"./chunk-VOKPYVET.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{a as w,b as x}from"./chunk-JOVIKINE.js";import"./chunk-JM5NHRL4.js";import{C as v,I as c,k as m,l as u,w as g,y as p}from"./chunk-VOKPYVET.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

@ -594,7 +594,7 @@ async function getGithubService() {
// load firebase
await (0, util_1.loadScript)('https://www.gstatic.com/firebasejs/8.8.1/firebase-app.js');
await (0, util_1.loadScript)('https://www.gstatic.com/firebasejs/8.8.1/firebase-auth.js');
await (0, util_1.loadScript)('./config.js');
await (0, util_1.loadScript)('https://8bitworkshop.com/config.js');
// get github API key from cookie
// TODO: move to service?
var ghkey = getCookie('__github_key');

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}from"./chunk-BPLU3NYG.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-4YU4ZZQD.js";import"./chunk-NAQO23MV.js";import"./chunk-JM5NHRL4.js";import"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";export{h as compparams,f as current_project,s as emulationHalted,n as getPlatformAndRepo,r as getSaveState,q as getTestOutput,l as haltEmulation,u as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,t as reloadWorkspaceFile,d as repo_id,j as runToPC,k as setFrameRateUI,p as setTestInput,m as setupSplits,o 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}from"./chunk-INEYEY2Q.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-JOVIKINE.js";import"./chunk-NAQO23MV.js";import"./chunk-JM5NHRL4.js";import"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";export{h as compparams,f as current_project,s as emulationHalted,n as getPlatformAndRepo,r as getSaveState,q as getTestOutput,l as haltEmulation,u as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,t as reloadWorkspaceFile,d as repo_id,j as runToPC,k as setFrameRateUI,p as setTestInput,m as setupSplits,o as startUI,c as store_id};
//# sourceMappingURL=ui.js.map

View File

@ -642,7 +642,7 @@ async function getGithubService() {
// load firebase
await loadScript('https://www.gstatic.com/firebasejs/8.8.1/firebase-app.js');
await loadScript('https://www.gstatic.com/firebasejs/8.8.1/firebase-auth.js');
await loadScript('./config.js');
await loadScript('https://8bitworkshop.com/config.js');
// get github API key from cookie
// TODO: move to service?
var ghkey = getCookie('__github_key');