import{a as f}from"./chunk-ZYQJTLXH.js";import{B as l,I as C,r as F,y as p}from"./chunk-42IVW2OL.js";import{J as i,O as o,g as n}from"./chunk-S4FPTY4A.js";import"./chunk-RQFURXHW.js";var m=class extends F{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=71;this.videoOffsetBytes=-24*4;this.joymask0=0;this.joymask1=0}getBIOSLength(){return 20480}loadBIOS(t){super.loadBIOS(t)}async fetchBIOS(){let t=new Uint8Array(20480);t.set(u,t.length-u.length),this.allocateBIOS(t),this.loadBIOS(new Uint8Array(t))}reset(){super.reset();for(var t=0;t<128;t++)this.setKeyInput(t,0,o.KeyUp);if(this.romptr&&this.romlen){let r=this.romarr;if(this.exports.machine_load_rom(this.sys,this.romptr,this.romlen),r[4+2]==65&&r[5+2]==48&&r[6+2]==195&&r[7+2]==194&&r[8+2]==205){for(var a=this.romarr[2+2]+this.romarr[3+2]*256,e=0;e<1e4&&this.getPC()!=a;e++)this.exports.machine_tick(this.sys);console.log("cart",e,n(a))}else if(this.prgstart=r[0]+(r[1]<<8),this.prgstart==4097&&(this.prgstart=r[2]+(r[3]<<8)+2,console.log("prgstart",n(this.prgstart))),this.prgstart<32768){this.exports.machine_exec(this.sys,5e5);var x="SYS "+this.prgstart+"\r";console.log(x);for(var e=0;e