mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-04-02 23:29:48 +00:00
Deploying to gh-pages from @ sehugg/8bitworkshop@19c2032545 🚀
This commit is contained in:
parent
debfa9ec3e
commit
686be02a7f
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
@ -1,7 +1,7 @@
|
||||
import{I as $,h as H,k as z,p as Y,t as K,y as V}from"./chunk-ULPRULB6.js";import{$ as W,J as O,V as L,W as o,X as F,Z as E,aa as T,ea as N,g as p}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var g=0,R=2,v=8,Z=E([[o.A,v+0,128],[o.B,v+1,128],[o.GP_A,v+0,128],[o.GP_B,v+1,128],[o.SELECT,R,-2],[o.START,R,-1],[o.UP,g,-16],[o.DOWN,g,-32],[o.LEFT,g,-64],[o.RIGHT,g,-128],[o.P2_A,v+2,128],[o.P2_B,v+3,128],[o.P2_UP,g,-1],[o.P2_DOWN,g,-2],[o.P2_LEFT,g,-4],[o.P2_RIGHT,g,-8]]);var D=263,j=258-16,y=451,tt=28,et=16,rt=24,G=2,X=D*60*G,B=class{constructor(){this.regs=new Uint8Array(32)}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e}saveState(){return{regs:this.regs.slice(0)}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e])}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e}},_=class{constructor(){this.cycles=0;this.regs=new Uint8Array(32);this.offset=-1;this.dll=0;this.dlstart=0;this.dli=!1;this.h16=!1;this.h8=!1;this.writemode=0;this.indirect=!1;this.pixels=new Uint8Array(320);this.WSYNC=0}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e,t==4&&this.WSYNC++}saveState(){return{regs:this.regs.slice(0),offset:this.offset,dll:this.dll,dlstart:this.dlstart,dli:this.dli,h16:this.h16,h8:this.h8,indirect:this.indirect,writemode:this.writemode}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e]|0);this.offset=t.offset|0,this.dll=t.dll|0,this.dlstart=t.dlstart|0,this.dli=!!t.dli,this.h16=!!t.h16,this.h8=!!t.h8,this.indirect=!!t.indirect,this.writemode=t.writemode|0}isDMAEnabled(){return(this.regs[28]&96)==64}getDLLStart(){return(this.regs[12]<<8)+this.regs[16]}getCharBaseAddress(){return(this.regs[20]<<8)+this.offset}setVBLANK(t){t?(this.regs[8]|=128,this.offset=-1,this.dll=this.getDLLStart(),this.dli=this.bus&&(this.bus.read(this.dll)&128)!=0):this.regs[8]&=~128}readDLLEntry(t){if(this.dll>=16384)return;let e=t.read(this.dll);this.offset=e&15,this.h16=(e&64)!=0,this.h8=(e&32)!=0,this.dlstart=(t.read(this.dll+1)<<8)+t.read(this.dll+2),this.dll=this.dll+3&65535,this.dli=(t.read(this.dll)&128)!=0}isHoley(t){return this.indirect?!1:!!(t&32768&&(this.h16&&t&4096||this.h8&&t&2048))}readDMA(t){return this.isHoley(t)?0:(this.cycles+=3,this.bus.read(t))}doDMA(t){this.bus=t,this.cycles=0;let e=this.pixels;if(e.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=this.offset==0?rt:et,this.offset<0&&this.readDLLEntry(t);let c=this.dlstart&65280,a=this.dlstart&255;do{let u=t.read(c+(a+0&511)),s=t.read(c+(a+1&511));if(s==0||c>=16384)break;let S=t.read(c+(a+2&511)),b=t.read(c+(a+3&511)),d=!1;if((s&31)==0){var i=b>>5,f=32-(b&31),r=t.read(c+(a+4&511));d=(s&32)!=0,a+=5,this.cycles+=10,this.writemode=s&128}else{var r=b,i=s>>5,f=32-(s&31);a+=4,this.cycles+=8}this.indirect=d;let x=u+((S+(d?0:this.offset)&255)<<8);r*=2;let C=this.regs[28],M=(C&3)+(this.writemode?4:0),A=(C&4)!=0,I=d&&(C&16)!=0;I&&(f*=2);for(var m=0;m<f;m++){let h=this.readDMA(I?x+(m>>1):x+m);if(d){let w=(this.regs[20]+this.offset<<8)+h;I&&m&1&&(w++,this.cycles-=3),h=this.readDMA(w)}switch(M){case 0:for(let n=0;n<4;n++){let l=h>>6&3;(l||A)&&(e[r]=e[r+1]=this.regs[(i<<2)+l]),h<<=2,r=r+2&511}break;case 3:for(let n=0;n<8;n++){let l=(h&128)>>6;(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 4:for(let n=0;n<2;n++){let l=(h>>6&3)+(h&12);(l&3||A)&&(e[r]=e[r+1]=e[r+2]=e[r+3]=this.regs[((i&4)<<2)+l]),h<<=2,r=r+2&511}break;case 6:for(let n=0;n<4;n++){let l=(h&128)>>6|(h&8)>>3;(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 2:for(let n=0;n<8;n++){let l=(h&128)>>6;l+=n&1?i&1:i>>1&1,(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 7:let w=h;for(let n=0;n<4;n++){n==2&&(w<<=2);let l=(h&128)>>6,Q=i&4|w>>2&3;(l||A)&&(e[r]=this.regs[(Q<<2)+l]),h<<=1,r=r+1&511}break}}}while(this.cycles<y);this.offset-=1}return this.cycles}doInterrupt(){return this.dli&&this.offset<0?(this.dli=!1,!0):!1}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e+=`
|
||||
import{I as $,h as H,k as z,p as Y,t as K,y as V}from"./chunk-ARTNMEGN.js";import{$ as W,J as O,V as L,W as o,X as F,Z as E,aa as T,ea as N,g as p}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var g=0,R=2,v=8,Z=E([[o.A,v+0,128],[o.B,v+1,128],[o.GP_A,v+0,128],[o.GP_B,v+1,128],[o.SELECT,R,-2],[o.START,R,-1],[o.UP,g,-16],[o.DOWN,g,-32],[o.LEFT,g,-64],[o.RIGHT,g,-128],[o.P2_A,v+2,128],[o.P2_B,v+3,128],[o.P2_UP,g,-1],[o.P2_DOWN,g,-2],[o.P2_LEFT,g,-4],[o.P2_RIGHT,g,-8]]);var D=263,j=258-16,y=451,tt=28,et=16,rt=24,G=2,X=D*60*G,B=class{constructor(){this.regs=new Uint8Array(32)}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e}saveState(){return{regs:this.regs.slice(0)}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e])}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e}},_=class{constructor(){this.cycles=0;this.regs=new Uint8Array(32);this.offset=-1;this.dll=0;this.dlstart=0;this.dli=!1;this.h16=!1;this.h8=!1;this.writemode=0;this.indirect=!1;this.pixels=new Uint8Array(320);this.WSYNC=0}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e,t==4&&this.WSYNC++}saveState(){return{regs:this.regs.slice(0),offset:this.offset,dll:this.dll,dlstart:this.dlstart,dli:this.dli,h16:this.h16,h8:this.h8,indirect:this.indirect,writemode:this.writemode}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e]|0);this.offset=t.offset|0,this.dll=t.dll|0,this.dlstart=t.dlstart|0,this.dli=!!t.dli,this.h16=!!t.h16,this.h8=!!t.h8,this.indirect=!!t.indirect,this.writemode=t.writemode|0}isDMAEnabled(){return(this.regs[28]&96)==64}getDLLStart(){return(this.regs[12]<<8)+this.regs[16]}getCharBaseAddress(){return(this.regs[20]<<8)+this.offset}setVBLANK(t){t?(this.regs[8]|=128,this.offset=-1,this.dll=this.getDLLStart(),this.dli=this.bus&&(this.bus.read(this.dll)&128)!=0):this.regs[8]&=~128}readDLLEntry(t){if(this.dll>=16384)return;let e=t.read(this.dll);this.offset=e&15,this.h16=(e&64)!=0,this.h8=(e&32)!=0,this.dlstart=(t.read(this.dll+1)<<8)+t.read(this.dll+2),this.dll=this.dll+3&65535,this.dli=(t.read(this.dll)&128)!=0}isHoley(t){return this.indirect?!1:!!(t&32768&&(this.h16&&t&4096||this.h8&&t&2048))}readDMA(t){return this.isHoley(t)?0:(this.cycles+=3,this.bus.read(t))}doDMA(t){this.bus=t,this.cycles=0;let e=this.pixels;if(e.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=this.offset==0?rt:et,this.offset<0&&this.readDLLEntry(t);let c=this.dlstart&65280,a=this.dlstart&255;do{let u=t.read(c+(a+0&511)),s=t.read(c+(a+1&511));if(s==0||c>=16384)break;let S=t.read(c+(a+2&511)),b=t.read(c+(a+3&511)),d=!1;if((s&31)==0){var i=b>>5,f=32-(b&31),r=t.read(c+(a+4&511));d=(s&32)!=0,a+=5,this.cycles+=10,this.writemode=s&128}else{var r=b,i=s>>5,f=32-(s&31);a+=4,this.cycles+=8}this.indirect=d;let x=u+((S+(d?0:this.offset)&255)<<8);r*=2;let C=this.regs[28],M=(C&3)+(this.writemode?4:0),A=(C&4)!=0,I=d&&(C&16)!=0;I&&(f*=2);for(var m=0;m<f;m++){let h=this.readDMA(I?x+(m>>1):x+m);if(d){let w=(this.regs[20]+this.offset<<8)+h;I&&m&1&&(w++,this.cycles-=3),h=this.readDMA(w)}switch(M){case 0:for(let n=0;n<4;n++){let l=h>>6&3;(l||A)&&(e[r]=e[r+1]=this.regs[(i<<2)+l]),h<<=2,r=r+2&511}break;case 3:for(let n=0;n<8;n++){let l=(h&128)>>6;(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 4:for(let n=0;n<2;n++){let l=(h>>6&3)+(h&12);(l&3||A)&&(e[r]=e[r+1]=e[r+2]=e[r+3]=this.regs[((i&4)<<2)+l]),h<<=2,r=r+2&511}break;case 6:for(let n=0;n<4;n++){let l=(h&128)>>6|(h&8)>>3;(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 2:for(let n=0;n<8;n++){let l=(h&128)>>6;l+=n&1?i&1:i>>1&1,(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 7:let w=h;for(let n=0;n<4;n++){n==2&&(w<<=2);let l=(h&128)>>6,Q=i&4|w>>2&3;(l||A)&&(e[r]=this.regs[(Q<<2)+l]),h<<=1,r=r+1&511}break}}}while(this.cycles<y);this.offset-=1}return this.cycles}doInterrupt(){return this.dli&&this.offset<0?(this.dli=!1,!0):!1}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e+=`
|
||||
DLL: $`+p((t.regs[12]<<8)+t.regs[16],4)+" @ $"+p(t.dll,4),e+=`
|
||||
DL: $`+p(t.dlstart,4),e+=`
|
||||
Offset: `+t.offset,e+=`
|
||||
DLI? `+t.dli,e}},U=class extends Y{constructor(){super();this.cpuFrequency=1789772;this.canvasWidth=320;this.numTotalScanlines=D;this.numVisibleScanlines=j;this.defaultROMSize=49152;this.cpuCyclesPerLine=113.5;this.sampleRate=X;this.ram=new Uint8Array(4096);this.regs6532=new Uint8Array(4);this.piatimer=0;this.timerinterval=1;this.tia=new B;this.maria=new _;this.lastFrameCycles=0;this.xtracyc=0;this.cpu=new K,this.read=T([[8,13,15,t=>(this.xtracyc++,this.readInput(t))],[0,31,31,t=>(this.xtracyc++,this.tia.read(t))],[32,63,31,t=>this.maria.read(t)],[64,255,255,t=>this.ram[t+2048]],[256,319,255,t=>this.read(t)],[320,511,511,t=>this.ram[t+2048]],[640,767,127,t=>(this.xtracyc++,this.readPIA(t))],[6144,10239,65535,t=>this.ram[t-6144]],[10240,16383,2047,t=>this.read(t|8192)],[16384,65535,65535,t=>this.rom?this.rom[t-16384]:0],[0,65535,65535,t=>this.probe&&this.probe.logIllegal(t)]]),this.write=T([[21,26,31,(t,e)=>{this.xtracyc++,this.pokey1.setTIARegister(t,e)}],[0,31,31,(t,e)=>{this.xtracyc++,this.tia.write(t,e)}],[32,63,31,(t,e)=>{this.maria.write(t,e)}],[64,255,255,(t,e)=>{this.ram[t+2048]=e}],[256,319,255,(t,e)=>{this.write(t,e)}],[320,511,511,(t,e)=>{this.ram[t+2048]=e}],[640,767,127,(t,e)=>{this.xtracyc++,this.writePIA(t,e)}],[6144,10239,65535,(t,e)=>{this.ram[t-6144]=e}],[10240,16383,2047,(t,e)=>{this.write(t|8192,e)}],[49151,49151,65535,(t,e)=>{}],[0,65535,65535,(t,e)=>{this.probe&&this.probe.logIllegal(t)}]]),this.connectCPUMemoryBus(this),this.dmaBus=this.probeDMABus(this),this.handler=F(this.inputs,Z),this.pokey1=new H,this.audioadapter=new z(this.pokey1,G,X)}readConst(t){let e=this.probe;this.probe=null;let i=this.read(t);return this.probe=e,i}readInput(t){switch(t){case 12:return~this.inputs[8]&128;case 13:return~this.inputs[9]&128;default:return this.inputs[t]|0}}readPIA(t){switch(t){case 0:case 2:return this.inputs[t];case 1:case 3:return this.regs6532[t];case 4:return this.getPIATimerValue();default:return 0}}writePIA(t,e){switch(t){case 0:case 1:case 2:case 3:this.regs6532[t]=e;return;case 20:this.setPIATimer(e,0);return;case 21:this.setPIATimer(e,3);return;case 22:this.setPIATimer(e,6);return;case 23:this.setPIATimer(e,10);return;case 24:this.setPIATimer(e,6);return}}setPIATimer(t,e){this.piatimer=t+1<<e,this.timerinterval=e}getPIATimerValue(){let t=this.piatimer;return t>0?t>>this.timerinterval:t&255}advanceCPU(){var t=super.advanceCPU();return this.tickPIATimer(t),this.xtracyc&&(t+=this.xtracyc,this.tickClocks(this.xtracyc),this.xtracyc=0),t}tickClocks(t){this.probe.logClocks(t),this.tickPIATimer(t)}tickPIATimer(t){this.piatimer=Math.max(-256,this.piatimer-t)}advanceFrame(t){var e=this.pixels,i=0,f,r=0,m=0,c=0;this.lastFrameCycles=-1,this.probe.logNewFrame();for(var a=0;a<D;a++){this.scanline=a;var u=a<j;for(this.maria.setVBLANK(!u),this.maria.WSYNC=0;r<tt&&!this.maria.WSYNC;){if(t&&t()){t=null,a=999,this.lastFrameCycles=r;break}r+=this.advanceCPU()<<2,c++}if(u){let S=this.maria.doDMA(this.dmaBus);if(this.tickClocks(S>>2),r+=S,e){let x=(this.maria.regs[28]&128)!=0?15:255;for(var s=0;s<320;s++)e[i++]=q[this.maria.pixels[s]&x]}}for((u||a==D-1)&&this.maria.doInterrupt()&&(this.probe.logInterrupt(0),this.cpu.NMI());r<y;){if(this.maria.WSYNC){this.probe.logWait(0),this.tickClocks(y-r>>2),r=y;break}if(t&&t()){t=null,a=999,this.lastFrameCycles=r;break}r+=this.advanceCPU()<<2,c++}this.audio&&this.audioadapter.generate(this.audio),r-=y,m+=r,this.probe.logNewScanline()}return c}getRasterX(){return(this.lastFrameCycles+y)%y}getRasterY(){return this.scanline}getRasterCanvasPosition(){return{x:this.getRasterX(),y:this.getRasterY()}}loadROM(t){t.length==49280&&(t=t.slice(128)),this.rom=W(t,this.defaultROMSize,!0)}reset(){super.reset(),this.tia.reset(),this.maria.reset(),this.inputs.fill(0),this.inputs[g]=255,this.inputs[R]=1+2+8,this.setPIATimer(0,0)}readAddress(t){return this.read(t)|0}loadState(t){this.cpu.loadState(t.c),this.ram.set(t.ram),this.tia.loadState(t.tia),this.maria.loadState(t.maria),this.regs6532.set(t.regs6532),this.piatimer=t.pia.timer,this.timerinterval=t.pia.interval,this.loadControlsState(t)}saveState(){return{c:this.cpu.saveState(),ram:this.ram.slice(0),tia:this.tia.saveState(),maria:this.maria.saveState(),regs6532:this.regs6532.slice(0),inputs:this.inputs.slice(0),pia:{timer:this.piatimer,interval:this.timerinterval}}}loadControlsState(t){this.inputs.set(t.inputs)}saveControlsState(){return{inputs:this.inputs.slice(0)}}getDebugCategories(){return["CPU","Stack","TIA","MARIA"]}getDebugInfo(t,e){switch(t){case"TIA":return B.stateToLongString(e.tia);case"MARIA":return _.stateToLongString(e.maria)+`
|
||||
Scanline: `+this.scanline}}getDebugDisplayLists(){let t={},e=this.maria.getDLLStart(),i=0;for(;i<240;){let f=this.readConst(e),r=f&15,m=(f&64)!=0,c=(f&32)!=0,a=(this.readConst(e+1)<<8)+this.readConst(e+2);e=e+3&65535;let u=(this.readConst(e)&128)!=0,s="DL $"+p(a,4)+" "+i+"-"+(i+r);m&&(s+=" H16"),c&&(s+=" H8"),u&&(s+=" DLI"),t[s]={$$:this._readDebugDisplayList(a)},i+=r+1}return t}_readDebugDisplayList(t){return()=>this.readDebugDisplayList(t)}readDebugDisplayList(t){let e=[],i=t&65280,f=t&255;do{let a=this.maria.regs[28],u=this.readConst(i+(f+0&511)),s=this.readConst(i+(f+1&511));if(s==0)break;let S=this.readConst(i+(f+2&511)),b=this.readConst(i+(f+3&511)),d=!1,x="",C,M=(a&3)+(s&128?4:0);if((s&31)==0){var r=b>>5,m=32-(b&31),c=this.readConst(i+(f+4&511));d=(s&32)!=0,C=s&128,f+=5}else{var c=b,r=s>>5,m=32-(s&31);f+=4}x+="X="+c+" W="+m+" P="+r,C&&(x+=" WM=1"),d&&(x+=" CHR=$"+p(this.maria.regs[20]+this.maria.offset&255)+"xx");let A=u+((S+(d?0:this.maria.offset)&255)<<8);x=" $"+p(A,4)+" "+x,x=["160A","?","320D","320A","160B","?","320B","320C"][M]+" "+x,e.push(x)}while(f<512);return e}},q=new Uint32Array(256);for(P=0;P<256;P++)q[P]=N(P);var P;var it=[{id:"sprites.dasm",name:"Sprites (ASM)",category:"Assembler"},{id:"wsync.c",name:"WSYNC",category:"CC65"},{id:"sprites.c",name:"Double Buffering"},{id:"scroll.c",name:"Scrolling"},{id:"test_conio.c78",name:"Conio Test",category:"cc7800"},{id:"example_small_sprites.c78",name:"Small Sprites"},{id:"example_vertical_scrolling.c78",name:"Vertical Scrolling"}],J=class extends ${constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"TIA",start:0,size:32,type:"io"},{name:"MARIA",start:32,size:32,type:"io"},{name:"RAM (6166 Block 0)",start:64,size:192,type:"ram"},{name:"RAM (6166 Block 1)",start:320,size:192,type:"ram"},{name:"PIA",start:640,size:24,type:"io"},{name:"RAM",start:6144,size:4096,type:"ram"},{name:"Cartridge ROM",start:16384,size:49152-6,type:"rom"},{name:"CPU Vectors",start:65530,size:6,type:"rom"}]}}}newMachine(){return new U}getPresets(){return it}getDefaultExtension(){return".c"}readAddress(t){return this.machine.readConst(t)}getROMExtension(){return".a78"}getDebugTree(){let t=super.getDebugTree();return t.display_list=this.machine.getDebugDisplayLists(),t}getToolForFilename(t){return t.endsWith(".cc7800")||t.endsWith(".c78")?"cc7800":V(t)}};O.atari7800=J;
|
||||
//# sourceMappingURL=atari7800-QWAA5553.js.map
|
||||
//# sourceMappingURL=atari7800-4NT625KZ.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
import{a as M}from"./chunk-ZE6LZV4I.js";import{B as S,I as _,r as g,y as b}from"./chunk-ULPRULB6.js";import{J as c,O as a,V as x,a as l,g as o,v as p}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var d=class extends g{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=63;this.joymask0=0;this.joymask1=0;this.lightpen_x=0;this.lightpen_y=0}loadBIOS(e){var s=59940-57344+12288;e[s]==196&&(e[s]=96),super.loadBIOS(e)}reset(){super.reset();for(var e=0;e<128;e++)this.exports.machine_key_up(this.sys,e);if(this.romptr&&this.romlen){if(this.exports.machine_load_rom(this.sys,this.romptr,this.romlen),this.prgstart=this.romarr[0]+(this.romarr[1]<<8),this.prgstart==2049)if(this.romarr[6]==158){for(var s=0,t=0;t<5;t++){var e=this.romarr[7+t];if(e==155||e==0)break;s=s*10+(e&15)}this.prgstart=s,console.log("SYS",s,o(s))}else this.prgstart=this.romarr[2]+(this.romarr[3]<<8)+2,console.log("RUN",this.prgstart,o(this.prgstart));if(this.prgstart<32768){this.exports.machine_exec(this.sys,25e4);for(var i="\rSYS "+this.prgstart,t=0;t<i.length;t++){var r=i.charCodeAt(t);this.exports.machine_exec(this.sys,3e4),this.exports.machine_key_down(this.sys,r),this.exports.machine_exec(this.sys,3e4),this.exports.machine_key_up(this.sys,r),this.exports.machine_exec(this.sys,1)}this.exports.machine_key_down(this.sys,13),this.exports.machine_exec(this.sys,1);for(var t=0;t<1e5&&this.getPC()!=this.prgstart;t++)this.exports.machine_tick(this.sys)}else{this.exports.machine_exec(this.sys,100);for(var n=this.romarr[4]+this.romarr[5]*256,t=0;t<15e4&&this.getPC()!=n;t++)this.exports.machine_tick(this.sys)}}}advanceFrame(e){var s=this.getRasterY(),t=Math.floor((this.numTotalScanlines-s)*19656/this.numTotalScanlines),i=this.probe!=null;return i&&this.exports.machine_reset_probe_buffer(),t=super.advanceFrameClock(e,t),i&&this.copyProbeData(),t}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var e=this.cpustatearr,s=e[2]+(e[3]<<8);return{PC:s,SP:e[9],A:e[6],X:e[7],Y:e[8],C:e[10]&1,Z:e[10]&2,I:e[10]&4,D:e[10]&8,V:e[10]&64,N:e[10]&128,o:this.readConst(s),R:e[19]!=55}}saveState(){this.exports.machine_save_state(this.sys,this.stateptr);let e=this.getDebugStateOffset(1),s=this.getDebugStateOffset(2),t=this.getDebugStateOffset(3),i=this.getDebugStateOffset(4),r=this.getDebugStateOffset(5),n=this.getDebugStateOffset(9);return{c:this.getCPUState(),state:this.statearr.slice(0),ram:this.statearr.slice(r,r+65536),cia1:this.statearr.slice(e,e+64),cia2:this.statearr.slice(s,s+64),vic:this.statearr.slice(t+1,t+1+64),sid:this.statearr.slice(i,i+32),pla:this.statearr.slice(n,n+16)}}loadState(e){this.statearr.set(e.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:392,height:272,overscan:!0,videoFrequency:50,aspect:392/272*.9365}}setKeyInput(e,s,t){if(!(e==16||e==17||e==18||e==224)){var i=0,r=0;switch(e){case 32:i=16;break;case 37:e=8,i=4;break;case 38:e=11,i=1;break;case 39:e=9,i=8;break;case 40:e=10,i=2;break;case 113:e=241;break;case 115:e=243;break;case 119:e=245;break;case 121:e=247;break;case 188:e=t&a.Shift?60:46;break;case 190:e=t&a.Shift?62:44;break;case 191:e=t&a.Shift?63:47;break;case 222:e=t&a.Shift?34:39;break;case 219:e=t&a.Shift?123:91;break;case 221:e=t&a.Shift?125:93;break;case 48:t&a.Shift&&(e=41);break;case 49:t&a.Shift&&(e=33);break;case 50:t&a.Shift&&(e=64);break;case 51:t&a.Shift&&(e=35);break;case 52:t&a.Shift&&(e=36);break;case 53:t&a.Shift&&(e=37);break;case 54:t&a.Shift&&(e=94);break;case 55:t&a.Shift&&(e=38);break;case 56:t&a.Shift&&(e=42);break;case 57:t&a.Shift&&(e=40);break;case 59:t&a.Shift&&(e=58);break;case 61:t&a.Shift&&(e=43);break;case 173:e=t&a.Shift?95:45;break}t&a.KeyDown?(this.exports.machine_key_down(this.sys,e),this.joymask0|=i,this.joymask1|=r):t&a.KeyUp&&(this.exports.machine_key_up(this.sys,e),this.joymask0&=~i,this.joymask1&=~r),this.exports.c64_joystick(this.sys,this.joymask0,this.joymask1)}}getRasterX(){return this.statearr[244]}getRasterY(){return this.exports.machine_get_raster_line(this.sys)}getRasterCanvasPosition(){return{x:this.getRasterX()*392/63,y:this.getRasterY()-14}}getDebugStateOffset(e){var s=this.exports.machine_get_debug_pointer(this.sys,e);return s-this.sys}getDebugCategories(){return["CPU","ZPRAM","Stack","PLA","CIA","VIC","SID"]}getDebugInfo(e,s){switch(e){case"PLA":{let t="",i=s.pla[0],r=s.pla[3];return t+=`$0000 - $9FFF RAM
|
||||
import{a as M}from"./chunk-BFRMBEKQ.js";import{B as S,I as _,r as g,y as b}from"./chunk-ARTNMEGN.js";import{J as c,O as a,V as x,a as l,g as o,v as p}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var d=class extends g{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=63;this.joymask0=0;this.joymask1=0;this.lightpen_x=0;this.lightpen_y=0}loadBIOS(e){var s=59940-57344+12288;e[s]==196&&(e[s]=96),super.loadBIOS(e)}reset(){super.reset();for(var e=0;e<128;e++)this.exports.machine_key_up(this.sys,e);if(this.romptr&&this.romlen){if(this.exports.machine_load_rom(this.sys,this.romptr,this.romlen),this.prgstart=this.romarr[0]+(this.romarr[1]<<8),this.prgstart==2049)if(this.romarr[6]==158){for(var s=0,t=0;t<5;t++){var e=this.romarr[7+t];if(e==155||e==0)break;s=s*10+(e&15)}this.prgstart=s,console.log("SYS",s,o(s))}else this.prgstart=this.romarr[2]+(this.romarr[3]<<8)+2,console.log("RUN",this.prgstart,o(this.prgstart));if(this.prgstart<32768){this.exports.machine_exec(this.sys,25e4);for(var i="\rSYS "+this.prgstart,t=0;t<i.length;t++){var r=i.charCodeAt(t);this.exports.machine_exec(this.sys,3e4),this.exports.machine_key_down(this.sys,r),this.exports.machine_exec(this.sys,3e4),this.exports.machine_key_up(this.sys,r),this.exports.machine_exec(this.sys,1)}this.exports.machine_key_down(this.sys,13),this.exports.machine_exec(this.sys,1);for(var t=0;t<1e5&&this.getPC()!=this.prgstart;t++)this.exports.machine_tick(this.sys)}else{this.exports.machine_exec(this.sys,100);for(var n=this.romarr[4]+this.romarr[5]*256,t=0;t<15e4&&this.getPC()!=n;t++)this.exports.machine_tick(this.sys)}}}advanceFrame(e){var s=this.getRasterY(),t=Math.floor((this.numTotalScanlines-s)*19656/this.numTotalScanlines),i=this.probe!=null;return i&&this.exports.machine_reset_probe_buffer(),t=super.advanceFrameClock(e,t),i&&this.copyProbeData(),t}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var e=this.cpustatearr,s=e[2]+(e[3]<<8);return{PC:s,SP:e[9],A:e[6],X:e[7],Y:e[8],C:e[10]&1,Z:e[10]&2,I:e[10]&4,D:e[10]&8,V:e[10]&64,N:e[10]&128,o:this.readConst(s),R:e[19]!=55}}saveState(){this.exports.machine_save_state(this.sys,this.stateptr);let e=this.getDebugStateOffset(1),s=this.getDebugStateOffset(2),t=this.getDebugStateOffset(3),i=this.getDebugStateOffset(4),r=this.getDebugStateOffset(5),n=this.getDebugStateOffset(9);return{c:this.getCPUState(),state:this.statearr.slice(0),ram:this.statearr.slice(r,r+65536),cia1:this.statearr.slice(e,e+64),cia2:this.statearr.slice(s,s+64),vic:this.statearr.slice(t+1,t+1+64),sid:this.statearr.slice(i,i+32),pla:this.statearr.slice(n,n+16)}}loadState(e){this.statearr.set(e.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:392,height:272,overscan:!0,videoFrequency:50,aspect:392/272*.9365}}setKeyInput(e,s,t){if(!(e==16||e==17||e==18||e==224)){var i=0,r=0;switch(e){case 32:i=16;break;case 37:e=8,i=4;break;case 38:e=11,i=1;break;case 39:e=9,i=8;break;case 40:e=10,i=2;break;case 113:e=241;break;case 115:e=243;break;case 119:e=245;break;case 121:e=247;break;case 188:e=t&a.Shift?60:46;break;case 190:e=t&a.Shift?62:44;break;case 191:e=t&a.Shift?63:47;break;case 222:e=t&a.Shift?34:39;break;case 219:e=t&a.Shift?123:91;break;case 221:e=t&a.Shift?125:93;break;case 48:t&a.Shift&&(e=41);break;case 49:t&a.Shift&&(e=33);break;case 50:t&a.Shift&&(e=64);break;case 51:t&a.Shift&&(e=35);break;case 52:t&a.Shift&&(e=36);break;case 53:t&a.Shift&&(e=37);break;case 54:t&a.Shift&&(e=94);break;case 55:t&a.Shift&&(e=38);break;case 56:t&a.Shift&&(e=42);break;case 57:t&a.Shift&&(e=40);break;case 59:t&a.Shift&&(e=58);break;case 61:t&a.Shift&&(e=43);break;case 173:e=t&a.Shift?95:45;break}t&a.KeyDown?(this.exports.machine_key_down(this.sys,e),this.joymask0|=i,this.joymask1|=r):t&a.KeyUp&&(this.exports.machine_key_up(this.sys,e),this.joymask0&=~i,this.joymask1&=~r),this.exports.c64_joystick(this.sys,this.joymask0,this.joymask1)}}getRasterX(){return this.statearr[244]}getRasterY(){return this.exports.machine_get_raster_line(this.sys)}getRasterCanvasPosition(){return{x:this.getRasterX()*392/63,y:this.getRasterY()-14}}getDebugStateOffset(e){var s=this.exports.machine_get_debug_pointer(this.sys,e);return s-this.sys}getDebugCategories(){return["CPU","ZPRAM","Stack","PLA","CIA","VIC","SID"]}getDebugInfo(e,s){switch(e){case"PLA":{let t="",i=s.pla[0],r=s.pla[3];return t+=`$0000 - $9FFF RAM
|
||||
`,t+=`$A000 - $BFFF ${(r&3)==3?"BASIC ROM":"RAM"}
|
||||
`,t+=`$C000 - $CFFF RAM
|
||||
`,t+=`$D000 - $DFFF ${i?"I/O":(r&3)!=0?"CHAR ROM":"RAM"}
|
||||
@ -9,6 +9,6 @@ import{a as M}from"./chunk-ZE6LZV4I.js";import{B as S,I as _,r as g,y as b}from"
|
||||
`}return t}case"VIC":{let t=s.vic,i="",r=(s.cia2[0]&3^3)*16384,n=r+(s.vic[24]&14)*1024,m=r+(s.vic[24]>>4)*1024,h=s.vic[17]&32,C=(s.cia2[0]&1)==1&&(s.vic[24]&12)==4,A=s.state[244],I=this.getRasterY();return i+="Mode:",s.vic[17]&32?i+=" BITMAP":i+=" CHAR",s.vic[22]&16&&(i+=" MULTICOLOR"),s.vic[17]&64&&(i+=" EXTENDED"),i+=`
|
||||
`,i+=`Raster: (${l(A,3)}, ${l(I,3)}) `,i+=`Scroll: (${s.vic[22]&7}, ${s.vic[17]&7})`,i+=`
|
||||
`,i+=`VIC Bank: $${o(r,4)} Scrn: $${o(m,4)} `,h?i+=`Bitmap: $${o(n&57344,4)}`:C?i+=`Char: ROM $${o(n,4)}`:i+=`Char: $${o(n,4)}`,i+=`
|
||||
`,i+=x(t,53248,64),i}case"SID":{let t=s.sid,i="";return i+=x(t,54272,32),i}}}setPaddleInput(e,s){e==0&&(this.lightpen_x=s),e==1&&(this.lightpen_y=s);let t=22,i=36,r=228,n=220,m=p(0,255,(this.lightpen_x-t)/(r-t)*160+24),h=p(0,255,(this.lightpen_y-i)/(n-i)*200+50);this.exports.machine_set_mouse(this.sys,m,h)}};var R=[{id:"helloc.c",name:"Hello World",category:"C"},{id:"screen_ram.c",name:"Screen RAM"},{id:"joymove.c",name:"Sprite Movement"},{id:"sprite_collision.c",name:"Sprite Collision"},{id:"scroll1.c",name:"Scrolling (Single Buffer)"},{id:"test_setirq.c",name:"Raster Interrupts"},{id:"test_display_list.c",name:"Raster IRQ Library"},{id:"scrolling_text.c",name:"Big Scrolling Text"},{id:"side_scroller.c",name:"Side-Scrolling Game"},{id:"scroll2.c",name:"Scrolling (Double Buffer)"},{id:"scroll3.c",name:"Scrolling (Multidirectional)"},{id:"scroll4.c",name:"Scrolling (Color RAM Buffering)"},{id:"scroll5.c",name:"Scrolling (Camera Following)"},{id:"fullscrollgame.c",name:"Full-Scrolling Game"},{id:"test_multiplex.c",name:"Sprite Retriggering"},{id:"test_multispritelib.c",name:"Sprite Multiplexing Library"},{id:"mcbitmap.c",name:"Multicolor Bitmap Mode"},{id:"testlz4.c",name:"LZ4 Bitmap Compression"},{id:"musicplayer.c",name:"Music Player"},{id:"siddemo.c",name:"SID Player Demo"},{id:"climber.c",name:"Climber Game"},{id:"test_border_sprites.c",name:"Sprites in the Borders"},{id:"sprite_stretch.c",name:"Sprite Stretching"},{id:"plasma.c",name:"Plasma Demo"},{id:"siegegame.c",name:"Siege Game"},{id:"23matches.c",name:"23 Matches"},{id:"tgidemo.c",name:"TGI Graphics Demo"},{id:"upandaway.c",name:"Up, Up and Away"},{id:"hello.dasm",name:"Hello World (DASM)",category:"Assembly Language"},{id:"hello.acme",name:"Hello World (ACME)"},{id:"hello.wiz",name:"Hello Wiz (Wiz)"}],v={main:[{name:"6510 Registers",start:0,size:2,type:"io"},{name:"BIOS Reserved",start:512,size:167},{name:"Default Screen RAM",start:1024,size:1024,type:"ram"},{name:"Cartridge ROM",start:32768,size:8192,type:"rom"},{name:"BASIC ROM",start:40960,size:8192,type:"rom"},{name:"Upper RAM",start:49152,size:4096,type:"ram"},{name:"Character ROM",start:53248,size:4096,type:"rom"},{name:"VIC-II I/O",start:53248,size:1024,type:"io"},{name:"SID",start:54272,size:1024,type:"io"},{name:"Color RAM",start:55296,size:1024,type:"io"},{name:"CIA 1",start:56320,size:256,type:"io"},{name:"CIA 2",start:56576,size:256,type:"io"},{name:"I/O 1",start:56832,size:256,type:"io"},{name:"I/O 2",start:57088,size:256,type:"io"},{name:"KERNAL ROM",start:57344,size:8192,type:"rom"}]},f=class extends _{newMachine(){return new d("c64")}getPresets(){return R}getDefaultExtension(){return".c"}readAddress(e){return this.machine.readConst(e)}getMemoryMap(){return v}showHelp(){return"https://8bitworkshop.com/docs/platforms/c64/"}getROMExtension(e){return e&&e[0]==1&&e[1]==8?".prg":".bin"}},y=class extends M{constructor(){super(...arguments);this.getToolForFilename=b;this.getOpcodeMetadata=S}getPresets(){return R}getDefaultExtension(){return".c"}loadROM(e,s){if(!this.started)this.startModule(this.mainElement,{jsfile:"mame8bitpc.js",biosfile:"c64.zip",cfgfile:"c64.cfg",driver:"c64",width:418,height:235,romfn:"/emulator/image.crt",romdata:new Uint8Array(s),romsize:65536,extraargs:["-autoboot_delay","5","-autoboot_command",`load "$",8,1
|
||||
`],preInit:function(i){}});else{this.loadROMFile(s),this.loadRegion(":quickload",s);var t=this.luacall('image:load("/emulator/image.prg")');console.log("load rom",t)}}start(){}getMemoryMap(){return v}};c.c64=f;c["c64.wasm"]=f;c["c64.mame"]=y;
|
||||
//# sourceMappingURL=c64-6ONR7FTT.js.map
|
||||
`,i+=x(t,53248,64),i}case"SID":{let t=s.sid,i="";return i+=x(t,54272,32),i}}}setPaddleInput(e,s){e==0&&(this.lightpen_x=s),e==1&&(this.lightpen_y=s);let t=22,i=36,r=228,n=220,m=p(0,255,(this.lightpen_x-t)/(r-t)*160+24),h=p(0,255,(this.lightpen_y-i)/(n-i)*200+50);this.exports.machine_set_mouse(this.sys,m,h)}};var y=[{id:"helloc.c",name:"Hello World",category:"C"},{id:"screen_ram.c",name:"Screen RAM"},{id:"siegegame.c",name:"Siege Game"},{id:"joymove.c",name:"Sprite Movement"},{id:"sprite_collision.c",name:"Sprite Collision"},{id:"scroll1.c",name:"Scrolling (Single Buffer)"},{id:"test_setirq.c",name:"Raster Interrupts"},{id:"test_display_list.c",name:"Raster IRQ Library"},{id:"scrolling_text.c",name:"Big Scrolling Text"},{id:"side_scroller.c",name:"Side-Scrolling Game"},{id:"scroll2.c",name:"Scrolling (Double Buffer)"},{id:"scroll3.c",name:"Scrolling (Multidirectional)"},{id:"scroll4.c",name:"Scrolling (Color RAM Buffering)"},{id:"scroll5.c",name:"Scrolling (Camera Following)"},{id:"fullscrollgame.c",name:"Full-Scrolling Game"},{id:"test_multiplex.c",name:"Sprite Retriggering"},{id:"test_multispritelib.c",name:"Sprite Multiplexing Library"},{id:"mcbitmap.c",name:"Multicolor Bitmap Mode"},{id:"testlz4.c",name:"LZ4 Bitmap Compression"},{id:"musicplayer.c",name:"Music Player"},{id:"siddemo.c",name:"SID Player Demo"},{id:"digisound.c",name:"Digi Sound Player"},{id:"climber.c",name:"Climber Game"},{id:"test_border_sprites.c",name:"Sprites in the Borders"},{id:"sprite_stretch.c",name:"Sprite Stretching"},{id:"linecrunch.c",name:"Linecrunch"},{id:"fld.c",name:"Flexible Line Distance"},{id:"plasma.c",name:"Plasma Demo"},{id:"23matches.c",name:"23 Matches"},{id:"tgidemo.c",name:"TGI Graphics Demo"},{id:"upandaway.c",name:"Up, Up and Away"},{id:"hello.dasm",name:"Hello World (DASM)",category:"Assembly Language"},{id:"hello.acme",name:"Hello World (ACME)"},{id:"hello.wiz",name:"Hello Wiz (Wiz)"}],R={main:[{name:"6510 Registers",start:0,size:2,type:"io"},{name:"BIOS Reserved",start:512,size:167},{name:"Default Screen RAM",start:1024,size:1024,type:"ram"},{name:"Cartridge ROM",start:32768,size:8192,type:"rom"},{name:"BASIC ROM",start:40960,size:8192,type:"rom"},{name:"Upper RAM",start:49152,size:4096,type:"ram"},{name:"Character ROM",start:53248,size:4096,type:"rom"},{name:"VIC-II I/O",start:53248,size:1024,type:"io"},{name:"SID",start:54272,size:1024,type:"io"},{name:"Color RAM",start:55296,size:1024,type:"io"},{name:"CIA 1",start:56320,size:256,type:"io"},{name:"CIA 2",start:56576,size:256,type:"io"},{name:"I/O 1",start:56832,size:256,type:"io"},{name:"I/O 2",start:57088,size:256,type:"io"},{name:"KERNAL ROM",start:57344,size:8192,type:"rom"}]},f=class extends _{newMachine(){return new d("c64")}getPresets(){return y}getDefaultExtension(){return".c"}readAddress(e){return this.machine.readConst(e)}getMemoryMap(){return R}showHelp(){return"https://8bitworkshop.com/docs/platforms/c64/"}getROMExtension(e){return e&&e[0]==1&&e[1]==8?".prg":".bin"}},v=class extends M{constructor(){super(...arguments);this.getToolForFilename=b;this.getOpcodeMetadata=S}getPresets(){return y}getDefaultExtension(){return".c"}loadROM(e,s){if(!this.started)this.startModule(this.mainElement,{jsfile:"mame8bitpc.js",biosfile:"c64.zip",cfgfile:"c64.cfg",driver:"c64",width:418,height:235,romfn:"/emulator/image.crt",romdata:new Uint8Array(s),romsize:65536,extraargs:["-autoboot_delay","5","-autoboot_command",`load "$",8,1
|
||||
`],preInit:function(i){}});else{this.loadROMFile(s),this.loadRegion(":quickload",s);var t=this.luacall('image:load("/emulator/image.prg")');console.log("load rom",t)}}start(){}getMemoryMap(){return R}};c.c64=f;c["c64.wasm"]=f;c["c64.mame"]=v;
|
||||
//# sourceMappingURL=c64-7BVS4UW4.js.map
|
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
@ -1,4 +1,4 @@
|
||||
import{A as C,C as w,a as p,b as P}from"./chunk-ULPRULB6.js";import{P as b,S as v,U as S}from"./chunk-RXF2JDJ3.js";var m=class{constructor(t){this.loaded=!1;this.preinitted=!1;this.started=!1;this.romtype="cart";this.running=!1;this.initluavars=!1;this.mainElement=t,this.timer=new S(20,this.poll.bind(this))}luacall(t){return this.js_lua_string||(this.js_lua_string=Module.cwrap("_Z13js_lua_stringPKc","string",["string"])),this.js_lua_string(t||"")}_pause(){this.running=!1,this.timer.stop()}pause(){this.loaded&&this.running&&(this.luacall("emu.pause()"),this._pause())}_resume(){this.luacall("emu.unpause()"),this.running=!0,this.timer.start()}resume(){this.loaded&&!this.running&&this._resume()}reset(){this.loaded&&(this.luacall("manager:machine():soft_reset()"),this.running=!0,this.initluavars=!1)}isRunning(){return this.running}bufferConsoleOutput(t){typeof t=="string"&&console.log(t)}startModule(t,e){this.started=!0;var r=this.romfn=this.romfn||e.romfn,a=this.romdata=this.romdata||e.romdata||new v(e.romsize).mem,o=this.romtype=this.romtype||e.romtype,n=this.video=new b(this.mainElement,e.width,e.height);n.create(),$(n.canvas).attr("id","canvas"),console.log("loading",e.jsfile);var u=[e.driver,"-debug","-debugger","none","-verbose","-window","-nokeepaspect","-resolution",n.canvas.width+"x"+n.canvas.height];r&&u.push("-"+o,r),e.extraargs&&(u=u.concat(e.extraargs)),console.log(u),window.JSMESS={},window.Module={arguments:u,screenIsReadOnly:!0,print:this.bufferConsoleOutput,canvas:n.canvas,doNotCaptureKeyboard:!0,keyboardListeningElement:n.canvas,preInit:()=>{console.log("loading FS"),ENV.SDL_EMSCRIPTEN_KEYBOARD_ELEMENT="canvas",e.cfgfile&&(FS.mkdir("/cfg"),FS.writeFile("/cfg/"+e.cfgfile,e.cfgdata,{encoding:"utf8"})),e.biosfile&&(FS.mkdir("/roms"),FS.mkdir("/roms/"+e.driver),FS.writeFile("/roms/"+e.biosfile,e.biosdata,{encoding:"binary"})),FS.mkdir("/emulator"),r&&FS.writeFile(r,a,{encoding:"binary"}),e.preInit&&e.preInit(self),this.preinitted=!0},preRun:[()=>{$(n.canvas).click(i=>{n.canvas.focus()}),this.loaded=!0,console.log("about to run...")}]};var d,c,g=$.Deferred(),f=$.Deferred();if(e.cfgfile&&(d=$.get("mame/cfg/"+e.cfgfile,i=>{e.cfgdata=i,console.log("loaded "+e.cfgfile)},"text")),e.biosfile){var s=new XMLHttpRequest;s.open("GET","mame/roms/"+e.biosfile,!0),s.responseType="arraybuffer",s.onload=i=>{e.biosdata=new Uint8Array(s.response),console.log("loaded "+e.biosfile),g.resolve()},s.ontimeout=function(i){throw Error("Timeout loading "+e.biosfile)},s.send()}else g.resolve();c=$.get("mame/debugger.lua",i=>{this.luadebugscript=i,console.log("loaded debugger.lua")},"text");{var l=new XMLHttpRequest;l.open("GET","mame/"+e.jsfile.replace(".js",".wasm"),!0),l.responseType="arraybuffer",l.onload=i=>{console.log("loaded WASM file"),window.Module.wasmBinary=new Uint8Array(l.response),f.resolve()},l.ontimeout=function(i){throw Error("Timeout loading "+e.jsfile)},l.send()}$.when(c,d,g,f).done(()=>{var i=document.createElement("script");i.src="mame/"+e.jsfile,document.getElementsByTagName("head")[0].appendChild(i),console.log("created script element")}),window.mamelua=i=>(this.initlua(),[i,this.luacall(i)])}loadROMFile(t){this.romdata=t,this.preinitted&&this.romfn&&FS.writeFile(this.romfn,t,{encoding:"binary"})}loadRegion(t,e){if(this.loaded&&e.length>0){for(var r='rgn = manager:machine():memory().regions["'+t+`"]
|
||||
import{A as C,C as w,a as p,b as P}from"./chunk-ARTNMEGN.js";import{P as b,S as v,U as S}from"./chunk-RXF2JDJ3.js";var m=class{constructor(t){this.loaded=!1;this.preinitted=!1;this.started=!1;this.romtype="cart";this.running=!1;this.initluavars=!1;this.mainElement=t,this.timer=new S(20,this.poll.bind(this))}luacall(t){return this.js_lua_string||(this.js_lua_string=Module.cwrap("_Z13js_lua_stringPKc","string",["string"])),this.js_lua_string(t||"")}_pause(){this.running=!1,this.timer.stop()}pause(){this.loaded&&this.running&&(this.luacall("emu.pause()"),this._pause())}_resume(){this.luacall("emu.unpause()"),this.running=!0,this.timer.start()}resume(){this.loaded&&!this.running&&this._resume()}reset(){this.loaded&&(this.luacall("manager:machine():soft_reset()"),this.running=!0,this.initluavars=!1)}isRunning(){return this.running}bufferConsoleOutput(t){typeof t=="string"&&console.log(t)}startModule(t,e){this.started=!0;var r=this.romfn=this.romfn||e.romfn,a=this.romdata=this.romdata||e.romdata||new v(e.romsize).mem,o=this.romtype=this.romtype||e.romtype,n=this.video=new b(this.mainElement,e.width,e.height);n.create(),$(n.canvas).attr("id","canvas"),console.log("loading",e.jsfile);var u=[e.driver,"-debug","-debugger","none","-verbose","-window","-nokeepaspect","-resolution",n.canvas.width+"x"+n.canvas.height];r&&u.push("-"+o,r),e.extraargs&&(u=u.concat(e.extraargs)),console.log(u),window.JSMESS={},window.Module={arguments:u,screenIsReadOnly:!0,print:this.bufferConsoleOutput,canvas:n.canvas,doNotCaptureKeyboard:!0,keyboardListeningElement:n.canvas,preInit:()=>{console.log("loading FS"),ENV.SDL_EMSCRIPTEN_KEYBOARD_ELEMENT="canvas",e.cfgfile&&(FS.mkdir("/cfg"),FS.writeFile("/cfg/"+e.cfgfile,e.cfgdata,{encoding:"utf8"})),e.biosfile&&(FS.mkdir("/roms"),FS.mkdir("/roms/"+e.driver),FS.writeFile("/roms/"+e.biosfile,e.biosdata,{encoding:"binary"})),FS.mkdir("/emulator"),r&&FS.writeFile(r,a,{encoding:"binary"}),e.preInit&&e.preInit(self),this.preinitted=!0},preRun:[()=>{$(n.canvas).click(i=>{n.canvas.focus()}),this.loaded=!0,console.log("about to run...")}]};var d,c,g=$.Deferred(),f=$.Deferred();if(e.cfgfile&&(d=$.get("mame/cfg/"+e.cfgfile,i=>{e.cfgdata=i,console.log("loaded "+e.cfgfile)},"text")),e.biosfile){var s=new XMLHttpRequest;s.open("GET","mame/roms/"+e.biosfile,!0),s.responseType="arraybuffer",s.onload=i=>{e.biosdata=new Uint8Array(s.response),console.log("loaded "+e.biosfile),g.resolve()},s.ontimeout=function(i){throw Error("Timeout loading "+e.biosfile)},s.send()}else g.resolve();c=$.get("mame/debugger.lua",i=>{this.luadebugscript=i,console.log("loaded debugger.lua")},"text");{var l=new XMLHttpRequest;l.open("GET","mame/"+e.jsfile.replace(".js",".wasm"),!0),l.responseType="arraybuffer",l.onload=i=>{console.log("loaded WASM file"),window.Module.wasmBinary=new Uint8Array(l.response),f.resolve()},l.ontimeout=function(i){throw Error("Timeout loading "+e.jsfile)},l.send()}$.when(c,d,g,f).done(()=>{var i=document.createElement("script");i.src="mame/"+e.jsfile,document.getElementsByTagName("head")[0].appendChild(i),console.log("created script element")}),window.mamelua=i=>(this.initlua(),[i,this.luacall(i)])}loadROMFile(t){this.romdata=t,this.preinitted&&this.romfn&&FS.writeFile(this.romfn,t,{encoding:"binary"})}loadRegion(t,e){if(this.loaded&&e.length>0){for(var r='rgn = manager:machine():memory().regions["'+t+`"]
|
||||
`,a=0;a<e.length;a+=4){var o=e[a]+(e[a+1]<<8)+(e[a+2]<<16)+(e[a+3]<<24);r+="rgn:write_u32("+a+","+o+`)
|
||||
`}this.luacall(r),this.reset()}}initlua(){this.initluavars||(this.luacall(this.luadebugscript),this.luacall("mamedbg.init()"),this.initluavars=!0)}readAddress(t){return this.initlua(),parseInt(this.luacall("return mem:read_u8("+t+")"))}getCPUReg(t){return this.loaded?(this.initlua(),parseInt(this.luacall("return cpu.state."+t+".value"))):0}grabState(t){return this.initlua(),{c:this.getCPUState(),buf:this.luacall("return string.tohex("+t+")")}}saveState(){return this.grabState("manager:machine():buffer_save()")}loadState(t){return this.initlua(),this.luacall("manager:machine():buffer_load(string.fromhex('"+t.buf+"'))")}poll(){if(this.onBreakpointHit&&this.luacall("return tostring(mamedbg.is_stopped())")=="true"){this._pause();var t=this.grabState("lastBreakState");this.onBreakpointHit(t)}}clearDebug(){this.onBreakpointHit=null,this.loaded&&(this.initlua(),this.luacall("mamedbg.reset()"))}getDebugCallback(){return this.onBreakpointHit}setupDebug(t){this.onBreakpointHit=t}debugcmd(t){this.initlua(),this.luacall(t),this._resume()}runToPC(t){this.debugcmd("mamedbg.runTo("+t+")")}runToVsync(){this.debugcmd("mamedbg.runToVsync()")}runUntilReturn(){this.debugcmd("mamedbg.runUntilReturn()")}runEval(){this.reset(),this.step()}step(){this.debugcmd("mamedbg.step()")}getDebugCategories(){return["CPU"]}getDebugInfo(t,e){switch(t){case"CPU":return this.cpuStateToLongString(e.c)}}getDebugTree(){this.initlua();var t=JSON.parse(this.luacall("return table.tojson(manager:machine().devices)")),e=JSON.parse(this.luacall("return table.tojson(manager:machine().images)")),r=JSON.parse(this.luacall("return table.tojson(manager:machine():memory().regions)"));return{devices:t,images:e,regions:r}}},_=class extends m{getPC(){return this.getCPUReg("PC")}getSP(){return this.getCPUReg("SP")}isStable(){return!0}getCPUState(){return{PC:this.getPC(),SP:this.getSP(),A:this.getCPUReg("A"),X:this.getCPUReg("X"),Y:this.getCPUReg("Y"),flags:this.getCPUReg("P")}}disassemble(t,e){return p(t,e(t),e(t+1),e(t+2))}cpuStateToLongString(t){return C(t)}},E=class extends m{getPC(){return this.getCPUReg("PC")}getSP(){return this.getCPUReg("SP")}isStable(){return!0}getCPUState(){return{PC:this.getPC(),SP:this.getSP(),AF:this.getCPUReg("AF"),BC:this.getCPUReg("BC"),DE:this.getCPUReg("DE"),HL:this.getCPUReg("HL"),IX:this.getCPUReg("IX"),IY:this.getCPUReg("IY"),IR:this.getCPUReg("R")+(this.getCPUReg("I")<<8)}}disassemble(t,e){return P(t,e(t),e(t+1),e(t+2),e(t+3))}cpuStateToLongString(t){return w(t)}};export{_ as a,E as b};
|
||||
//# sourceMappingURL=chunk-ZE6LZV4I.js.map
|
||||
//# sourceMappingURL=chunk-BFRMBEKQ.js.map
|
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
@ -1,4 +1,4 @@
|
||||
import{c as E}from"./chunk-S56QHLVT.js";import{b as f}from"./chunk-ZE6LZV4I.js";import{E as m,J as n,d as w,f as c}from"./chunk-ULPRULB6.js";import{J as o,W as e,Z as s,aa as t,l as g,m as a}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var Q=s([[e.UP,0,1],[e.DOWN,0,4],[e.LEFT,0,8],[e.RIGHT,0,2],[e.A,0,64],[e.B,1,64],[e.GP_A,0,64],[e.GP_B,1,64],[e.P2_UP,2,1],[e.P2_DOWN,2,4],[e.P2_LEFT,2,8],[e.P2_RIGHT,2,2],[e.P2_A,2,64],[e.P2_B,3,64]]),r=class extends E{constructor(){super();this.defaultROMSize=32768;this.ram=new Uint8Array(1024);this.read=t([[0,8191,8191,A=>this.bios?this.bios[A]:0],[24576,32767,1023,A=>this.ram[A]],[32768,65535,32767,A=>this.rom?this.rom[A]:0]]);this.write=t([[24576,32767,1023,(A,B)=>{this.ram[A]=B}]]);this.init(this,this.newIOBus(),new c(new w)),this.bios=new g().decode(a(atob(l)))}getKeyboardMap(){return Q}vdpInterrupt(){this.probe.logInterrupt(0),this.cpu.NMI()}newIOBus(){return{read:A=>{switch(A&=255,A){case 252:return this.inputs[this.keypadMode?1:0]^255;case 255:return this.inputs[this.keypadMode?3:2]^255}return A>=160&&A<=191?A&1?this.vdp.readStatus():this.vdp.readData():0},write:(A,B)=>{switch(A&=255,B&=255,A>>4){case 8:case 9:this.keypadMode=!0;break;case 12:case 13:this.keypadMode=!1;break;case 10:case 11:return A&1?this.vdp.writeAddress(B):this.vdp.writeData(B);case 15:this.psg.setData(B);break}}}}loadState(A){super.loadState(A),this.keypadMode=A.kpm}saveState(){var A=super.saveState();return A.kpm=this.keypadMode,A}reset(){super.reset(),this.keypadMode=!1}},l=`
|
||||
import{c as E}from"./chunk-6SJKJ2GP.js";import{b as f}from"./chunk-BFRMBEKQ.js";import{E as m,J as n,d as w,f as c}from"./chunk-ARTNMEGN.js";import{J as o,W as e,Z as s,aa as t,l as g,m as a}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var Q=s([[e.UP,0,1],[e.DOWN,0,4],[e.LEFT,0,8],[e.RIGHT,0,2],[e.A,0,64],[e.B,1,64],[e.GP_A,0,64],[e.GP_B,1,64],[e.P2_UP,2,1],[e.P2_DOWN,2,4],[e.P2_LEFT,2,8],[e.P2_RIGHT,2,2],[e.P2_A,2,64],[e.P2_B,3,64]]),r=class extends E{constructor(){super();this.defaultROMSize=32768;this.ram=new Uint8Array(1024);this.read=t([[0,8191,8191,A=>this.bios?this.bios[A]:0],[24576,32767,1023,A=>this.ram[A]],[32768,65535,32767,A=>this.rom?this.rom[A]:0]]);this.write=t([[24576,32767,1023,(A,B)=>{this.ram[A]=B}]]);this.init(this,this.newIOBus(),new c(new w)),this.bios=new g().decode(a(atob(l)))}getKeyboardMap(){return Q}vdpInterrupt(){this.probe.logInterrupt(0),this.cpu.NMI()}newIOBus(){return{read:A=>{switch(A&=255,A){case 252:return this.inputs[this.keypadMode?1:0]^255;case 255:return this.inputs[this.keypadMode?3:2]^255}return A>=160&&A<=191?A&1?this.vdp.readStatus():this.vdp.readData():0},write:(A,B)=>{switch(A&=255,B&=255,A>>4){case 8:case 9:this.keypadMode=!0;break;case 12:case 13:this.keypadMode=!1;break;case 10:case 11:return A&1?this.vdp.writeAddress(B):this.vdp.writeData(B);case 15:this.psg.setData(B);break}}}}loadState(A){super.loadState(A),this.keypadMode=A.kpm}saveState(){var A=super.saveState();return A.kpm=this.keypadMode,A}reset(){super.reset(),this.keypadMode=!1}},l=`
|
||||
TFpHAAAgAAAAB7djQcnHAQEDBgcx/3MYawAAAMMMgAehB+EPB+USB+UVB+UYB+UbB+UeB+QHHAZm
|
||||
IYA8igUCBYIAKgCAff5VIAl8/qogBCoKgOnHAwkfgICAAAMFT6CgB4LgByEH4WDAYMBABlggQIAg
|
||||
B+HAwOCgYAMGKweBQAYxBphAQEAG+KBABnAGEuAGUAabB+QA4AflBkggIAYyB+FgoKCgwAZdwAY5
|
||||
@ -34,4 +34,4 @@ PANDTwNjYHAGWShQAwKHOBA4A8LZA0IIeAaZOEREKChsADBAIBA4BqkoA4KfA0KIVFQDIvg4QANi
|
||||
FwAGaQNjr3gHIwZYEAAGEEAwCDBABgkHoTAIBlEIFANIAlAgBiAAfAdhAwJ3B0IGfwMDjgPmiAcB
|
||||
A8SRHAYnBihQAwK9BwFgEAODTQPjNXgDAmgHHwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8H
|
||||
HwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8HHwcfBx8HHwcfBwM=`;var D=[{id:"text.c",name:"Text Mode"},{id:"hello.c",name:"Scrolling Text"},{id:"text32.c",name:"32-Column Color Text"},{id:"stars.c",name:"Scrolling Starfield"},{id:"cursorsmooth.c",name:"Moving Cursor"},{id:"simplemusic.c",name:"Simple Music"},{id:"musicplayer.c",name:"Multivoice Music"},{id:"mode2bitmap.c",name:"Mode 2 Bitmap"},{id:"mode2compressed.c",name:"Mode 2 Bitmap (LZG)"},{id:"lines.c",name:"Mode 2 Lines"},{id:"multicolor.c",name:"Multicolor Mode"},{id:"siegegame.c",name:"Siege Game"},{id:"shoot.c",name:"Solarian Game"},{id:"climber.c",name:"Climber Game"}],M=class extends n{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"BIOS",start:0,size:8192,type:"rom"},{name:"Cartridge Header",start:32768,size:256,type:"rom"}]}}}newMachine(){return new r}getPresets(){return D}getDefaultExtension(){return".c"}readAddress(A){return this.machine.read(A)}readVRAMAddress(A){return this.machine.readVRAMAddress(A)}showHelp(){return"https://8bitworkshop.com/docs/platforms/coleco/"}},h=class extends f{constructor(){super(...arguments);this.getToolForFilename=m}start(){this.startModule(this.mainElement,{jsfile:"mame8bitws.js",cfgfile:"coleco.cfg",biosfile:"coleco/313 10031-4005 73108a.u2",driver:"coleco",width:280*2,height:216*2,romfn:"/emulator/cart.rom",romsize:32768,preInit:function(A){}})}loadROM(A,B){this.loadROMFile(B),this.loadRegion(":coleco_cart:rom",B)}getPresets(){return D}getDefaultExtension(){return".c"}};o["coleco.mame"]=h;o.coleco=M;export{D as ColecoVision_PRESETS};
|
||||
//# sourceMappingURL=coleco-5Q7P7SYW.js.map
|
||||
//# sourceMappingURL=coleco-J62GBAPT.js.map
|
@ -319,6 +319,12 @@ function getToolForFilename_6502(fn) {
|
||||
return "wiz";
|
||||
if (fn.endsWith(".ecs"))
|
||||
return "ecs";
|
||||
if (fn.endsWith(".cpp"))
|
||||
return "oscar64";
|
||||
if (fn.endsWith(".cc"))
|
||||
return "oscar64";
|
||||
if (fn.endsWith(".o64"))
|
||||
return "oscar64";
|
||||
return "dasm"; // .a
|
||||
}
|
||||
// TODO: can merge w/ Z80?
|
||||
|
File diff suppressed because one or more lines are too long
@ -293,6 +293,15 @@ class WASIMemoryFilesystem {
|
||||
this.files.set(name, file);
|
||||
return file;
|
||||
}
|
||||
putSymbolicLink(name, target, rights) {
|
||||
if (!rights)
|
||||
rights = FDRights.PATH_SYMLINK;
|
||||
const file = new WASIFileDescriptor(name, FDType.SYMBOLIC_LINK, rights);
|
||||
file.write(new TextEncoder().encode(target));
|
||||
file.offset = 0;
|
||||
this.files.set(name, file);
|
||||
return file;
|
||||
}
|
||||
getFile(name) {
|
||||
var _a;
|
||||
let file = this.files.get(name);
|
||||
@ -467,6 +476,7 @@ class WASIRunner {
|
||||
const bytes = enc.encode(str);
|
||||
const len = Math.min(bytes.length, maxlen);
|
||||
this.mem8().set(bytes.subarray(0, len), ptr);
|
||||
return len;
|
||||
}
|
||||
peekUTF8(ptr, maxlen) {
|
||||
const bytes = this.mem8().subarray(ptr, ptr + maxlen);
|
||||
@ -632,9 +642,9 @@ class WASIRunner {
|
||||
if (dir.type !== FDType.DIRECTORY)
|
||||
return WASIErrors.NOTDIR;
|
||||
const filename = this.peekUTF8(path_ptr, path_len);
|
||||
const path = dir.name + '/' + filename;
|
||||
const path = filename.startsWith('/') ? filename : dir.name + '/' + filename; // TODO?
|
||||
const fd = this.fs.getFile(path);
|
||||
console.log("path_filestat_get", dir + "", path, filestat_ptr, '->', fd + "");
|
||||
console.log("path_filestat_get", dir + "", filename, path, filestat_ptr, '->', fd + "");
|
||||
if (!fd)
|
||||
return WASIErrors.NOENT;
|
||||
this.poke64(filestat_ptr, fd.fdindex); // dev
|
||||
@ -646,6 +656,50 @@ class WASIRunner {
|
||||
this.poke64(filestat_ptr + 48, 0); // mtim
|
||||
this.poke64(filestat_ptr + 56, 0); // ctim
|
||||
}
|
||||
path_readlink(dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr) {
|
||||
const dir = this.fds[dirfd];
|
||||
debug("path_readlink", dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr, dir + "");
|
||||
if (dir == null)
|
||||
return WASIErrors.BADF;
|
||||
if (dir.type !== FDType.DIRECTORY)
|
||||
return WASIErrors.NOTDIR;
|
||||
const filename = this.peekUTF8(path_ptr, path_len);
|
||||
const path = dir.name + '/' + filename;
|
||||
const fd = this.fs.getFile(path);
|
||||
debug("path_readlink", path, fd + "");
|
||||
if (!fd)
|
||||
return WASIErrors.NOENT;
|
||||
if (fd.type !== FDType.SYMBOLIC_LINK)
|
||||
return WASIErrors.INVAL;
|
||||
const target = fd.getBytesAsString();
|
||||
const len = this.pokeUTF8(target, buf_ptr, buf_len);
|
||||
this.poke32(buf_used_ptr, len);
|
||||
debug("path_readlink", path, '->', target);
|
||||
return WASIErrors.SUCCESS;
|
||||
}
|
||||
path_readlinkat(dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr) {
|
||||
return this.path_readlink(dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr);
|
||||
}
|
||||
path_unlink_file(dirfd, path_ptr, path_len) {
|
||||
const dir = this.fds[dirfd];
|
||||
if (dir == null)
|
||||
return WASIErrors.BADF;
|
||||
if (dir.type !== FDType.DIRECTORY)
|
||||
return WASIErrors.NOTDIR;
|
||||
const filename = this.peekUTF8(path_ptr, path_len);
|
||||
const path = dir.name + '/' + filename;
|
||||
const fd = this.fs.getFile(path);
|
||||
debug("path_unlink_file", dir + "", path, fd + "");
|
||||
if (!fd)
|
||||
return WASIErrors.NOENT;
|
||||
this.fs.getFile(path);
|
||||
return WASIErrors.SUCCESS;
|
||||
}
|
||||
clock_time_get(clock_id, precision, time_ptr) {
|
||||
const time = Date.now();
|
||||
this.poke64(time_ptr, time);
|
||||
return WASIErrors.SUCCESS;
|
||||
}
|
||||
getWASISnapshotPreview1() {
|
||||
return {
|
||||
args_sizes_get: this.args_sizes_get.bind(this),
|
||||
@ -663,16 +717,22 @@ class WASIRunner {
|
||||
fd_close: this.fd_close.bind(this),
|
||||
path_filestat_get: this.path_filestat_get.bind(this),
|
||||
random_get: this.random_get.bind(this),
|
||||
path_readlink: this.path_readlink.bind(this),
|
||||
path_unlink_file: this.path_unlink_file.bind(this),
|
||||
clock_time_get: this.clock_time_get.bind(this),
|
||||
fd_fdstat_set_flags() { warning("TODO: fd_fdstat_set_flags"); return WASIErrors.NOTSUP; },
|
||||
fd_readdir() { warning("TODO: fd_readdir"); return WASIErrors.NOTSUP; },
|
||||
path_unlink_file() { warning("TODO: path_unlink_file"); return WASIErrors.NOTSUP; },
|
||||
clock_time_get() { warning("TODO: clock_time_get"); return WASIErrors.NOTSUP; },
|
||||
fd_tell() { warning("TODO: fd_tell"); return WASIErrors.NOTSUP; },
|
||||
path_remove_directory() { warning("TODO: path_remove_directory"); return 0; },
|
||||
};
|
||||
}
|
||||
getEnv() {
|
||||
return {
|
||||
__syscall_unlinkat() { warning('TODO: unlink'); return WASIErrors.NOTSUP; },
|
||||
__syscall_faccessat() { warning("TODO: faccessat"); return WASIErrors.NOTSUP; },
|
||||
__syscall_readlinkat: this.path_readlinkat.bind(this),
|
||||
__syscall_getcwd() { warning("TODO: getcwd"); return WASIErrors.NOTSUP; },
|
||||
__syscall_rmdir() { warning("TODO: rmdir"); return WASIErrors.NOTSUP; },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
import{J as l,r as p}from"./chunk-ULPRULB6.js";import{J as i,O as o}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=class extends p{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=224;this.joymask0=0;this.runaddr=16384}loadROM(t){let e=new Uint8Array(t.length+m.length);e.set(m,0),e[24]=t.length&255,e[25]=t.length>>8,e[26]=this.runaddr&255,e[27]=this.runaddr>>8,e.set(t,m.length),super.loadROM(e)}reset(){if(super.reset(),this.exports.machine_exec(this.sys,1e6),this.romptr&&this.romlen){this.exports.machine_load_rom(this.sys,this.romptr,this.romlen);for(var t=0;t<1e5&&this.getPC()!=this.runaddr;t++)this.exports.machine_tick(this.sys)}}advanceFrame(t){var e=this.getRasterY(),r=Math.floor((this.numTotalScanlines-e)*(4e6/50)/this.numTotalScanlines),s=this.probe!=null;return s&&this.exports.machine_reset_probe_buffer(),r=super.advanceFrameClock(t,r),s&&this.copyProbeData(),r}getRasterY(){return this.exports.machine_get_raster_line(this.sys)}getRasterCanvasPosition(){return{x:-1,y:this.getRasterY()-14}}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,e=t[9]+(t[8]<<8),r=t[10]+(t[11]<<8),s=t[12]+(t[13]<<8),a=t[14]+(t[15]<<8),x=t[24]+(t[25]<<8),f=t[26]+(t[27]<<8),u=t[28]+(t[29]<<8),h=t[34]+(t[35]<<8),_=t[36]+(t[37]<<8);return{PC:h,SP:x,AF:e,BC:a,DE:s,HL:r,IX:u,IY:f,IR:_,o:this.readConst(h)}}saveState(){return this.exports.machine_save_state(this.sys,this.stateptr),{c:this.getCPUState(),state:this.statearr.slice(0)}}loadState(t){this.statearr.set(t.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:768,height:272,overscan:!0,videoFrequency:50,aspect:1.3}}setKeyInput(t,e,r){if(!(t==16||t==17||t==18||t==224)){var s=0,a=0;t==37&&(t=8,s=4),t==38&&(t=11,s=1),t==39&&(t=9,s=8),t==40&&(t=10,s=2),t==32&&(s=16),t==65&&(t=65,a=4),t==87&&(t=87,a=1),t==68&&(t=68,a=8),t==83&&(t=83,a=2),t==69&&(a=16),t==113&&(t=241),t==115&&(t=243),t==119&&(t=245),t==121&&(t=247),r&o.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=s):r&o.KeyUp&&(this.exports.machine_key_up(this.sys,t),this.joymask0&=~s)}}};var v=[{id:"hello.asm",name:"Hello World (ASM)"},{id:"easy_stdio_boxes.c",name:"Standard I/O (C)"},{id:"easy_mode_strings.c",name:"Video Modes (C)"},{id:"easy_random.c",name:"Random Numbers (C)"},{id:"easy_sprites.c",name:"Keyboard + Sprites (C)"},{id:"medium_scrolling.c",name:"Scrolling Text (C)"},{id:"siegegame.c",name:"Siege Game (C)"},{id:"music.c",name:"Music Player (C)"}],C={main:[{name:"BIOS",start:0,size:16384,type:"rom"},{name:"Screen RAM",start:49152,size:16384,type:"ram"}]},n=class extends l{newMachine(){return new c("cpc")}getPresets(){return v}getDefaultExtension(){return".asm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return C}showHelp(){return"http://lronaldo.github.io/cpctelera/files/readme-txt.html"}};i["cpc.6128"]=n;i["cpc.464"]=n;i["cpc.kcc"]=n;
|
||||
//# sourceMappingURL=cpc-Y7H77AJC.js.map
|
||||
import{J as l,r as p}from"./chunk-ARTNMEGN.js";import{J as i,O as o}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=class extends p{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=224;this.joymask0=0;this.runaddr=16384}loadROM(t){let e=new Uint8Array(t.length+m.length);e.set(m,0),e[24]=t.length&255,e[25]=t.length>>8,e[26]=this.runaddr&255,e[27]=this.runaddr>>8,e.set(t,m.length),super.loadROM(e)}reset(){if(super.reset(),this.exports.machine_exec(this.sys,1e6),this.romptr&&this.romlen){this.exports.machine_load_rom(this.sys,this.romptr,this.romlen);for(var t=0;t<1e5&&this.getPC()!=this.runaddr;t++)this.exports.machine_tick(this.sys)}}advanceFrame(t){var e=this.getRasterY(),r=Math.floor((this.numTotalScanlines-e)*(4e6/50)/this.numTotalScanlines),s=this.probe!=null;return s&&this.exports.machine_reset_probe_buffer(),r=super.advanceFrameClock(t,r),s&&this.copyProbeData(),r}getRasterY(){return this.exports.machine_get_raster_line(this.sys)}getRasterCanvasPosition(){return{x:-1,y:this.getRasterY()-14}}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,e=t[9]+(t[8]<<8),r=t[10]+(t[11]<<8),s=t[12]+(t[13]<<8),a=t[14]+(t[15]<<8),x=t[24]+(t[25]<<8),f=t[26]+(t[27]<<8),u=t[28]+(t[29]<<8),h=t[34]+(t[35]<<8),_=t[36]+(t[37]<<8);return{PC:h,SP:x,AF:e,BC:a,DE:s,HL:r,IX:u,IY:f,IR:_,o:this.readConst(h)}}saveState(){return this.exports.machine_save_state(this.sys,this.stateptr),{c:this.getCPUState(),state:this.statearr.slice(0)}}loadState(t){this.statearr.set(t.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:768,height:272,overscan:!0,videoFrequency:50,aspect:1.3}}setKeyInput(t,e,r){if(!(t==16||t==17||t==18||t==224)){var s=0,a=0;t==37&&(t=8,s=4),t==38&&(t=11,s=1),t==39&&(t=9,s=8),t==40&&(t=10,s=2),t==32&&(s=16),t==65&&(t=65,a=4),t==87&&(t=87,a=1),t==68&&(t=68,a=8),t==83&&(t=83,a=2),t==69&&(a=16),t==113&&(t=241),t==115&&(t=243),t==119&&(t=245),t==121&&(t=247),r&o.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=s):r&o.KeyUp&&(this.exports.machine_key_up(this.sys,t),this.joymask0&=~s)}}};var v=[{id:"hello.asm",name:"Hello World (ASM)"},{id:"easy_stdio_boxes.c",name:"Standard I/O (C)"},{id:"easy_mode_strings.c",name:"Video Modes (C)"},{id:"easy_random.c",name:"Random Numbers (C)"},{id:"easy_sprites.c",name:"Keyboard + Sprites (C)"},{id:"medium_scrolling.c",name:"Scrolling Text (C)"},{id:"siegegame.c",name:"Siege Game (C)"},{id:"music.c",name:"Music Player (C)"}],C={main:[{name:"BIOS",start:0,size:16384,type:"rom"},{name:"Screen RAM",start:49152,size:16384,type:"ram"}]},n=class extends l{newMachine(){return new c("cpc")}getPresets(){return v}getDefaultExtension(){return".asm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return C}showHelp(){return"http://lronaldo.github.io/cpctelera/files/readme-txt.html"}};i["cpc.6128"]=n;i["cpc.464"]=n;i["cpc.kcc"]=n;
|
||||
//# sourceMappingURL=cpc-5IL77URC.js.map
|
@ -1,2 +1,2 @@
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{t as c}from"./chunk-AJJ3WM3A.js";import"./chunk-XWTSBLAW.js";import"./chunk-B2GOFULO.js";import"./chunk-BADKNP7O.js";import{I as m,o as u,t as h}from"./chunk-ULPRULB6.js";import{C as o,J as l,aa as i,n}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.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-67QQGUUC.js.map
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{t as c}from"./chunk-Q5ACPWUW.js";import"./chunk-XWTSBLAW.js";import"./chunk-B2GOFULO.js";import"./chunk-MPSJCPTJ.js";import{I as m,o as u,t as h}from"./chunk-ARTNMEGN.js";import{C as o,J as l,aa as i,n}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.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-SCFJVO7L.js.map
|
@ -1,2 +1,2 @@
|
||||
import{b as w,c as x}from"./chunk-BADKNP7O.js";import{A as p,E as v,J as c,l as m,m as u,y as g}from"./chunk-RXF2JDJ3.js";import{e as I}from"./chunk-WAARL7ET.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-MPSJCPTJ.js";import{A as p,E as v,J as c,l as m,m as u,y as g}from"./chunk-RXF2JDJ3.js";import{e as I}from"./chunk-WAARL7ET.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
|
||||
|
@ -1,2 +1,2 @@
|
||||
import{I as y,q as u,t as d}from"./chunk-ULPRULB6.js";import{J as m,W as x,X as c,Z as p,aa as o}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var M=p([[x.START,1,-1],[x.RIGHT,1,-4],[x.LEFT,1,-8],[x.A,1,-16],[x.UP,1,-32],[x.DOWN,1,-64],[x.SELECT,1,-128]]),l=class extends u{constructor(){super();this.cpuFrequency=705562;this.sampleRate=894886;this.numVisibleScanlines=256;this.numTotalScanlines=262;this.cpuCyclesPerLine=336>>3;this.canvasWidth=256;this.defaultROMSize=32768+2048+10240;this.cpu=new d;this.ram=new Uint8Array(28672);this.color_latch=[84,238,107];this.palette=[4278190080,4278190335,4294901760,4294902015,4278255360,4278255615,4294967040,4294967295];this.inputs=new Uint8Array(4);this.keyMap=M;this.handler=c(this.inputs,this.keyMap);this.scrnbase=16384;this.charbase=26624;this.bus={read:o([[0,1023,0,t=>this.ram[t]],[4096,16383,0,t=>this.rom[t-4096]],[16384,20479,0,t=>this.ram[t]],[20736,20991,3,t=>t==3?this.int_latch():this.inputs[t]],[24576,28671,0,t=>this.ram[t]],[32768,65535,0,t=>this.rom[t-32768]]]),write:o([[0,1023,0,(t,e)=>{this.ram[t]=e}],[16384,20479,0,(t,e)=>{this.ram[t]=e}],[20480,20737,0,(t,e)=>{this.ram[t]=e}],[21008,21010,3,(t,e)=>{this.setColorLatch(t,e)}],[24576,28671,0,(t,e)=>{this.ram[t]=e}]])};this.connectCPUMemoryBus(this),this.updatePalette(),this.inputs[0]=234,this.inputs[1]=255}loadROM(t){super.loadROM(t),t.length<32768&&(t.length==11616?(this.rom.set(t.slice(10240,12288),32768),this.rom.set(t.slice(9984,10240),32512),this.rom.set(t.slice(0,10240),2048),this.scrnbase=16384,this.charbase=18432):t.length==14336?(this.rom.set(t.slice(13312,14336),32768),this.rom.set(t.slice(12032,12288),32512),this.scrnbase=16384,this.charbase=18432):console.log("Warning: ROM is too small",t.length));let e=32768;this.sprite_gfx=this.rom.subarray(e,e+32*32)}read(t){return this.bus.read(t)}readConst(t){return t==20739?this.inputs[3]:this.bus.read(t)}write(t,e){this.bus.write(t,e)}int_latch(){let t=this.inputs[3];return t|=this.inputs[1]&128?0:64,this.inputs[3]=128,t}updatePalette(){this.set_1_color(0,0),this.set_1_color(1,7),this.set_1_color(2,0),this.set_1_color(3,6),this.set_1_color(4,4),this.set_1_color(5,3),this.set_1_color(6,2),this.set_1_color(7,1)}set_1_color(t,e){let a=this.color_latch[0]&1<<e?1:0,s=this.color_latch[1]&1<<e?2:0,f=this.color_latch[2]&1<<e?4:0;this.palette[t]=S[a|s|f]}setColorLatch(t,e){this.color_latch[t&3]=e,this.updatePalette()}drawSprite(t,e,a,s){var f=236-t-4,i=244-e-4;if(i+=15,i-=this.scanline,i>=0&&i<16){i=15-i;let n=this.scanline*this.canvasWidth,h=this.sprite_gfx[a+i];for(let r=0;r<8;r++)h&128>>r&&(this.pixels[n+f+r]=this.palette[s]);h=this.sprite_gfx[a+i+16];for(let r=0;r<8;r++)h&128>>r&&(this.pixels[n+f+r+8]=this.palette[s])}}drawSprite1(){let t=this.ram[20480],e=this.ram[20544],a=this.ram[20737]&32?1:0,s=(this.ram[20736]&15)+16*a;this.drawSprite(t,e,s*32,1)}drawSprite2(){let t=this.ram[20608],e=this.ram[20672],a=this.ram[20737]&64?1:0,s=(this.ram[20736]>>4)+16*a;this.drawSprite(t,e,s*32,3)}startScanline(){}drawScanline(){let t=this.scanline,e=t>>3,a=t*this.canvasWidth;for(let s=0;s<256;s++){let f=s>>3,i=this.ram[this.scrnbase+e*32+f],n=4+(i>>6&3),r=this.ram[this.charbase+i*8+(t&7)]&128>>(s&7)?n:0;this.pixels[a+s]=this.palette[r]}this.drawSprite2(),this.drawSprite1()}postFrame(){this.inputs[3]&=127,this.cpu.IRQ()}getVideoParams(){return{width:256,height:256,aspect:6/5}}},S=[4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295];var g=[{id:"minimal.c",name:"Minimal Example",category:"C"}],b=class extends y{newMachine(){return new l}getPresets(){return g}getDefaultExtension(){return".dasm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return{main:[{name:"RAM",start:0,size:1024,type:"ram"},{name:"Sprite I/O",start:20480,size:256,type:"io"},{name:"I/O",start:20736,size:3,type:"io"},{name:"PIA 6821",start:20992,size:15,type:"io"},{name:"Color Latches",start:21008,size:3,type:"io"},{name:"Screen RAM",start:16384,size:1024,type:"ram"},{name:"Character RAM",start:26624,size:2048,type:"ram"},{name:"Audio ROM",start:22528,size:10240,type:"rom"},{name:"Program ROM",start:32768,size:32768,type:"rom"}]}}};m.exidy=b;
|
||||
//# sourceMappingURL=exidy-4ZSLRK6K.js.map
|
||||
import{I as y,q as u,t as d}from"./chunk-ARTNMEGN.js";import{J as m,W as x,X as c,Z as p,aa as o}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var M=p([[x.START,1,-1],[x.RIGHT,1,-4],[x.LEFT,1,-8],[x.A,1,-16],[x.UP,1,-32],[x.DOWN,1,-64],[x.SELECT,1,-128]]),l=class extends u{constructor(){super();this.cpuFrequency=705562;this.sampleRate=894886;this.numVisibleScanlines=256;this.numTotalScanlines=262;this.cpuCyclesPerLine=336>>3;this.canvasWidth=256;this.defaultROMSize=32768+2048+10240;this.cpu=new d;this.ram=new Uint8Array(28672);this.color_latch=[84,238,107];this.palette=[4278190080,4278190335,4294901760,4294902015,4278255360,4278255615,4294967040,4294967295];this.inputs=new Uint8Array(4);this.keyMap=M;this.handler=c(this.inputs,this.keyMap);this.scrnbase=16384;this.charbase=26624;this.bus={read:o([[0,1023,0,t=>this.ram[t]],[4096,16383,0,t=>this.rom[t-4096]],[16384,20479,0,t=>this.ram[t]],[20736,20991,3,t=>t==3?this.int_latch():this.inputs[t]],[24576,28671,0,t=>this.ram[t]],[32768,65535,0,t=>this.rom[t-32768]]]),write:o([[0,1023,0,(t,e)=>{this.ram[t]=e}],[16384,20479,0,(t,e)=>{this.ram[t]=e}],[20480,20737,0,(t,e)=>{this.ram[t]=e}],[21008,21010,3,(t,e)=>{this.setColorLatch(t,e)}],[24576,28671,0,(t,e)=>{this.ram[t]=e}]])};this.connectCPUMemoryBus(this),this.updatePalette(),this.inputs[0]=234,this.inputs[1]=255}loadROM(t){super.loadROM(t),t.length<32768&&(t.length==11616?(this.rom.set(t.slice(10240,12288),32768),this.rom.set(t.slice(9984,10240),32512),this.rom.set(t.slice(0,10240),2048),this.scrnbase=16384,this.charbase=18432):t.length==14336?(this.rom.set(t.slice(13312,14336),32768),this.rom.set(t.slice(12032,12288),32512),this.scrnbase=16384,this.charbase=18432):console.log("Warning: ROM is too small",t.length));let e=32768;this.sprite_gfx=this.rom.subarray(e,e+32*32)}read(t){return this.bus.read(t)}readConst(t){return t==20739?this.inputs[3]:this.bus.read(t)}write(t,e){this.bus.write(t,e)}int_latch(){let t=this.inputs[3];return t|=this.inputs[1]&128?0:64,this.inputs[3]=128,t}updatePalette(){this.set_1_color(0,0),this.set_1_color(1,7),this.set_1_color(2,0),this.set_1_color(3,6),this.set_1_color(4,4),this.set_1_color(5,3),this.set_1_color(6,2),this.set_1_color(7,1)}set_1_color(t,e){let a=this.color_latch[0]&1<<e?1:0,s=this.color_latch[1]&1<<e?2:0,f=this.color_latch[2]&1<<e?4:0;this.palette[t]=S[a|s|f]}setColorLatch(t,e){this.color_latch[t&3]=e,this.updatePalette()}drawSprite(t,e,a,s){var f=236-t-4,i=244-e-4;if(i+=15,i-=this.scanline,i>=0&&i<16){i=15-i;let n=this.scanline*this.canvasWidth,h=this.sprite_gfx[a+i];for(let r=0;r<8;r++)h&128>>r&&(this.pixels[n+f+r]=this.palette[s]);h=this.sprite_gfx[a+i+16];for(let r=0;r<8;r++)h&128>>r&&(this.pixels[n+f+r+8]=this.palette[s])}}drawSprite1(){let t=this.ram[20480],e=this.ram[20544],a=this.ram[20737]&32?1:0,s=(this.ram[20736]&15)+16*a;this.drawSprite(t,e,s*32,1)}drawSprite2(){let t=this.ram[20608],e=this.ram[20672],a=this.ram[20737]&64?1:0,s=(this.ram[20736]>>4)+16*a;this.drawSprite(t,e,s*32,3)}startScanline(){}drawScanline(){let t=this.scanline,e=t>>3,a=t*this.canvasWidth;for(let s=0;s<256;s++){let f=s>>3,i=this.ram[this.scrnbase+e*32+f],n=4+(i>>6&3),r=this.ram[this.charbase+i*8+(t&7)]&128>>(s&7)?n:0;this.pixels[a+s]=this.palette[r]}this.drawSprite2(),this.drawSprite1()}postFrame(){this.inputs[3]&=127,this.cpu.IRQ()}getVideoParams(){return{width:256,height:256,aspect:6/5}}},S=[4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295];var g=[{id:"minimal.c",name:"Minimal Example",category:"C"}],b=class extends y{newMachine(){return new l}getPresets(){return g}getDefaultExtension(){return".dasm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return{main:[{name:"RAM",start:0,size:1024,type:"ram"},{name:"Sprite I/O",start:20480,size:256,type:"io"},{name:"I/O",start:20736,size:3,type:"io"},{name:"PIA 6821",start:20992,size:15,type:"io"},{name:"Color Latches",start:21008,size:3,type:"io"},{name:"Screen RAM",start:16384,size:1024,type:"ram"},{name:"Character RAM",start:26624,size:2048,type:"ram"},{name:"Audio ROM",start:22528,size:10240,type:"rom"},{name:"Program ROM",start:32768,size:32768,type:"rom"}]}}};m.exidy=b;
|
||||
//# sourceMappingURL=exidy-DSUO7SYH.js.map
|
File diff suppressed because one or more lines are too long
@ -133,6 +133,7 @@ const TOOL_TO_SOURCE_STYLE = {
|
||||
'remote:llvm-mos': 'text/x-csrc',
|
||||
'cc7800': 'text/x-csrc',
|
||||
'armtcc': 'text/x-csrc',
|
||||
'oscar64': 'text/x-csrc',
|
||||
};
|
||||
// TODO: move into tool class
|
||||
const TOOL_TO_HELPURL = {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
import{I as c,o as x,t as F}from"./chunk-ULPRULB6.js";import{$ as p,J as l,O as A,W as e,aa as m,g as _,l as I,m as h}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var y=[e.VK_DELETE,e.VK_ENTER,e.VK_RIGHT,e.VK_F7,e.VK_F1,e.VK_F3,e.VK_F5,e.VK_DOWN,e.VK_3,e.VK_W,e.VK_A,e.VK_4,e.VK_Z,e.VK_S,e.VK_E,e.VK_SHIFT,e.VK_5,e.VK_R,e.VK_D,e.VK_6,e.VK_C,e.VK_F,e.VK_T,e.VK_X,e.VK_7,e.VK_Y,e.VK_G,e.VK_8,e.VK_B,e.VK_H,e.VK_U,e.VK_V,e.VK_9,e.VK_I,e.VK_J,e.VK_0,e.VK_M,e.VK_K,e.VK_O,e.VK_N,null,e.VK_P,e.VK_L,e.VK_MINUS,e.VK_PERIOD,null,null,e.VK_COMMA,null,null,e.VK_SEMICOLON,e.VK_HOME,e.VK_SHIFT,e.VK_EQUALS,e.VK_TILDE,e.VK_SLASH,e.VK_1,e.VK_LEFT,e.VK_CONTROL,e.VK_2,e.VK_SPACE,e.VK_ALT,e.VK_Q,null],a=0,u=class{constructor(){this.regs=new Uint8Array(16);this.ina=0;this.inb=0}read(r){return this.regs[r]}write(r,t){this.regs[r]=t}input_a(){return this.ina&~this.regs[1]}input_b(){return this.inb&~this.regs[1]}output_a(){return this.regs[0]^255|this.regs[1]}output_b(){return this.regs[2]^255|this.regs[3]}},f=class extends x{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=4096;this.cpu=new F;this.ram=new Uint8Array(6144);this.rriot1=new u;this.rriot2=new u;this.digits=[];this.read=m([[5888,5951,15,r=>this.readIO_1(r)],[5952,6015,15,r=>this.readIO_2(r)],[0,6143,8191,r=>this.ram[r]],[6144,8191,2047,r=>this.bios[r]]],{gmask:8191});this.write=m([[5888,5951,15,(r,t)=>this.writeIO_1(r,t)],[5952,6015,15,(r,t)=>this.writeIO_2(r,t)],[0,6143,8191,(r,t)=>{this.ram[r]=t}]],{gmask:8191});this.bios=new I().decode(h(atob(B))),this.connectCPUMemoryBus(this)}readConst(r){return this.read(r)}readIO_1(r){return this.rriot1.read(r)}writeIO_1(r,t){this.rriot1.write(r,t)}readIO_2(r){switch(r&15){case 0:let t=0;for(let i=0;i<8;i++)(this.rriot2.regs[0]&1<<i)==0&&(t|=this.inputs[a+i]);this.rriot2.ina=t^255}return this.rriot2.read(r)}writeIO_2(r,t){this.rriot2.write(r,t);let i=this.rriot2.output_a(),s=this.rriot2.output_b();console.log(i,s)}loadROM(r){super.loadROM(r),this.ram.set(this.rom,1024),this.reset()}loadBIOS(r){this.bios=p(r,2048),this.reset()}setKeyInput(r,t,i){for(var s=y,o=0;o<s.length;o++)if(s[o]&&s[o].c==r){let n=o>>3,K=o&7;i&A.KeyDown?this.inputs[a+n]|=1<<K:i&A.KeyUp&&(this.inputs[a+n]&=~(1<<K)),console.log(r,n,K,_(this.inputs[a+n]));break}}advanceFrame(r){for(var t=0;t<this.cpuFrequency/60&&!(r&&r());)t+=this.advanceCPU();return t}},B="TFpHAAAIAAAABY3ivWkoAQsOJSiprY3sFyAyGaknjUIXqb+NQxeiZKkWIHoZytD4qSoo4a35FyBhGa31FyBeGa32KKPtF833F63uF+34F5AkqS8lXeclnegooqICqQQOBTgAhfqF+0xPHCDsJXAg6hlMMxgPGamNDgVrTI3vF61xGI3wF61yGI3xF6kHDgJ8/43pFyBBGk7pFw3pFyUErekXyRbQ7aIKICQaJQHfytD2JUIq8AYlBtHw8yDzGc35F/ANrfkXyQAlDf/wF9CcJQ0gTBmN7RcOBQHuF0z4GCXEKKSiAiV9L/AUIAAa0CPK0PElDEzsFw4CnCWhzecX0Awo4ugX0ASpAPACqf8OBcWt9ReN7Ret9heN7hepYI3vF6kAjecXjegXYKgYbSUB5xet6BdpACUJmGAgTBmoSigBIG8ZmChiYCkPyQoYMAJpB2kwjukXjOoXoAggnhlKsAYooUyRGSDEKEKI0Ouu6Res6hdgoglILEcXEPupfo1EF6mnjUIXDgkHDiKqytDfaGCiBg4FHsMODB4lhw4HHu7tF9AD7u4XYCAkGiAAGiikYMkwMB7JRxAayUAwAxhpCSooAaQEKi7pF4jQ+a3pF6AAYMhgjusXoggOIovqFw3qF43qF8rQ8a3qFypKrusXYCxCFxD7rUYXoP+MKIEUiND9JQow+zjtDgYLByULSf8pgGAOSFsOBJeaDgymJYclW0x1Gv8oHygfKB4oGWsaKCKF82iF8WiF74X6aIXwhfuE9Ib1uobyIIgeTE8cbPoXbP4Xov+aJYmp/43zF6kBLEAX0Bkw+an8GGkBkAPu8xesQBcQ843yDkIbah4gjB4l2x4gLx6iCiAx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class extends c{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:5120,type:"ram"},{name:"6530",start:5888,size:64,type:"io"},{name:"6530",start:5952,size:64,type:"io"},{name:"RAM",start:6016,size:128,type:"ram"},{name:"BIOS",start:6144,size:2048,type:"rom"}]}}}newMachine(){return new f}getPresets(){return O}getDefaultExtension(){return".dasm"}readAddress(r){return this.machine.readConst(r)}};l.kim1=V;
|
||||
//# sourceMappingURL=kim1-J42RB7PR.js.map
|
||||
import{I as c,o as x,t as F}from"./chunk-ARTNMEGN.js";import{$ as p,J as l,O as A,W as e,aa as m,g as _,l as I,m as h}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var y=[e.VK_DELETE,e.VK_ENTER,e.VK_RIGHT,e.VK_F7,e.VK_F1,e.VK_F3,e.VK_F5,e.VK_DOWN,e.VK_3,e.VK_W,e.VK_A,e.VK_4,e.VK_Z,e.VK_S,e.VK_E,e.VK_SHIFT,e.VK_5,e.VK_R,e.VK_D,e.VK_6,e.VK_C,e.VK_F,e.VK_T,e.VK_X,e.VK_7,e.VK_Y,e.VK_G,e.VK_8,e.VK_B,e.VK_H,e.VK_U,e.VK_V,e.VK_9,e.VK_I,e.VK_J,e.VK_0,e.VK_M,e.VK_K,e.VK_O,e.VK_N,null,e.VK_P,e.VK_L,e.VK_MINUS,e.VK_PERIOD,null,null,e.VK_COMMA,null,null,e.VK_SEMICOLON,e.VK_HOME,e.VK_SHIFT,e.VK_EQUALS,e.VK_TILDE,e.VK_SLASH,e.VK_1,e.VK_LEFT,e.VK_CONTROL,e.VK_2,e.VK_SPACE,e.VK_ALT,e.VK_Q,null],a=0,u=class{constructor(){this.regs=new Uint8Array(16);this.ina=0;this.inb=0}read(r){return this.regs[r]}write(r,t){this.regs[r]=t}input_a(){return this.ina&~this.regs[1]}input_b(){return this.inb&~this.regs[1]}output_a(){return this.regs[0]^255|this.regs[1]}output_b(){return this.regs[2]^255|this.regs[3]}},f=class extends x{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=4096;this.cpu=new F;this.ram=new Uint8Array(6144);this.rriot1=new u;this.rriot2=new u;this.digits=[];this.read=m([[5888,5951,15,r=>this.readIO_1(r)],[5952,6015,15,r=>this.readIO_2(r)],[0,6143,8191,r=>this.ram[r]],[6144,8191,2047,r=>this.bios[r]]],{gmask:8191});this.write=m([[5888,5951,15,(r,t)=>this.writeIO_1(r,t)],[5952,6015,15,(r,t)=>this.writeIO_2(r,t)],[0,6143,8191,(r,t)=>{this.ram[r]=t}]],{gmask:8191});this.bios=new I().decode(h(atob(B))),this.connectCPUMemoryBus(this)}readConst(r){return this.read(r)}readIO_1(r){return this.rriot1.read(r)}writeIO_1(r,t){this.rriot1.write(r,t)}readIO_2(r){switch(r&15){case 0:let t=0;for(let i=0;i<8;i++)(this.rriot2.regs[0]&1<<i)==0&&(t|=this.inputs[a+i]);this.rriot2.ina=t^255}return this.rriot2.read(r)}writeIO_2(r,t){this.rriot2.write(r,t);let i=this.rriot2.output_a(),s=this.rriot2.output_b();console.log(i,s)}loadROM(r){super.loadROM(r),this.ram.set(this.rom,1024),this.reset()}loadBIOS(r){this.bios=p(r,2048),this.reset()}setKeyInput(r,t,i){for(var s=y,o=0;o<s.length;o++)if(s[o]&&s[o].c==r){let n=o>>3,K=o&7;i&A.KeyDown?this.inputs[a+n]|=1<<K:i&A.KeyUp&&(this.inputs[a+n]&=~(1<<K)),console.log(r,n,K,_(this.inputs[a+n]));break}}advanceFrame(r){for(var t=0;t<this.cpuFrequency/60&&!(r&&r());)t+=this.advanceCPU();return t}},B="TFpHAAAIAAAABY3ivWkoAQsOJSiprY3sFyAyGaknjUIXqb+NQxeiZKkWIHoZytD4qSoo4a35FyBhGa31FyBeGa32KKPtF833F63uF+34F5AkqS8lXeclnegooqICqQQOBTgAhfqF+0xPHCDsJXAg6hlMMxgPGamNDgVrTI3vF61xGI3wF61yGI3xF6kHDgJ8/43pFyBBGk7pFw3pFyUErekXyRbQ7aIKICQ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AmyUfw1clR8ArJTPAJTGocDiIgQh1M5xw4pfrpAYX6sALG+0ysHaAApfiR+kzCHaX7DgSOpQ4FlmCiB73VHyCgHsoQ92CF/A6D00wepfwogw6K1UygHob9oggORAQiMPkg1B4g6x6tQBcpgEb+Bf6F/iUJytDvJQym/aX+KkpgogGG/6IAjkEXoj+OQxeiB45CF9h4YKkghf6G/SUkrUIXKf4OInLUHqIIJYVG/mkAJcnK0O4lCgkBJcam/WCt8xeN9Bet8hc46QGwA870F6z0FxDzDggPSk70F5DjCYCw4KADogGp/45CF+joLUAXiND1oAeMQhcJgEn/YA4iXIX5qX+NQReiCaADufgADgPmSB8lAikPKOGI0OslMakAJRlM/h6E/Ki55x+gAIxAFyUOjUAXoH+I0P3o6KT8YOb60ALm+2CiIaABIAIf0AfgJ9D1qRVgoP8KsAPIEPqKKQ9KqpgQAxhpB8rQ+mAYZfeF96X2aQCF9mAgWh4grB8opKX4DqKkG8lHEBcOqaSgBCom+Cb5iA7iZWCl+IX6pfmF+2AAKAMKDU1JSyATUlJFIBO/htvP5u39h//v9/y53vnx////HBwiHB8c";var O=[{id:"hello.dasm",name:"Hello World (ASM)"}],V=class extends c{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:5120,type:"ram"},{name:"6530",start:5888,size:64,type:"io"},{name:"6530",start:5952,size:64,type:"io"},{name:"RAM",start:6016,size:128,type:"ram"},{name:"BIOS",start:6144,size:2048,type:"rom"}]}}}newMachine(){return new f}getPresets(){return O}getDefaultExtension(){return".dasm"}readAddress(r){return this.machine.readConst(r)}};l.kim1=V;
|
||||
//# sourceMappingURL=kim1-QTSA4WNT.js.map
|
@ -1,4 +1,4 @@
|
||||
import{c as x}from"./chunk-S56QHLVT.js";import{J as Q,d as U,e as r}from"./chunk-ULPRULB6.js";import{J as T,O as t,W as A,Z as H,l as E,m as O}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var n=H([[A.UP,0,1],[A.DOWN,0,2],[A.LEFT,0,4],[A.RIGHT,0,8],[A.A,0,16],[A.B,0,32],[A.P2_UP,1,1],[A.P2_DOWN,1,2],[A.P2_LEFT,1,4],[A.P2_RIGHT,1,8],[A.P2_A,1,16],[A.P2_B,1,32],[A.ANYKEY,2,0]]),o=0;var w=16,a=[A.VK_7,A.VK_6,A.VK_5,A.VK_4,A.VK_3,A.VK_2,A.VK_1,A.VK_0,A.VK_SEMICOLON,A.VK_CLOSE_BRACKET,A.VK_OPEN_BRACKET,A.VK_BACK_SLASH,A.VK_EQUALS,A.VK_MINUS,A.VK_9,A.VK_8,A.VK_B,A.VK_A,null,A.VK_SLASH,A.VK_PERIOD,A.VK_COMMA,A.VK_ACUTE,A.VK_QUOTE,A.VK_J,A.VK_I,A.VK_H,A.VK_G,A.VK_F,A.VK_E,A.VK_D,A.VK_C,A.VK_R,A.VK_Q,A.VK_P,A.VK_O,A.VK_N,A.VK_M,A.VK_L,A.VK_K,A.VK_Z,A.VK_Y,A.VK_X,A.VK_W,A.VK_V,A.VK_U,A.VK_T,A.VK_S,A.VK_F3,A.VK_F2,A.VK_F1,null,A.VK_CAPS_LOCK,null,A.VK_CONTROL,A.VK_SHIFT,A.VK_ENTER,null,A.VK_BACK_SPACE,null,A.VK_TAB,A.VK_ESCAPE,A.VK_F5,A.VK_F4,A.VK_RIGHT,A.VK_DOWN,A.VK_UP,A.VK_LEFT,A.VK_DELETE,A.VK_INSERT,A.VK_HOME,A.VK_SPACE,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],i=class extends x{constructor(){super();this.numVisibleScanlines=240;this.defaultROMSize=32768;this.ram=new Uint8Array(65536);this.slotmask=0;this.ppi_c=0;this.read=s=>{let e=s>>14<<1,D=this.slotmask>>e&3,g=this.slots[D];return g?g.read(s):0};this.write=(s,e)=>{let D=s>>14<<1,g=this.slotmask>>D&3,B=this.slots[g];B&&B.write(s,e)};this.init(this,this.newIOBus(),new r(new U)),this.bios=new E().decode(O(atob(l))),this.bios[3541]=0,this.bios[3542]=0,this.bios[3543]=0,this.slots=[{read:s=>this.bios[s]|0,write:(s,e)=>{}},{read:s=>this.rom[s-16384]|0,write:(s,e)=>{}},{read:s=>this.rom[s-16384]|0,write:(s,e)=>{}},{read:s=>this.ram[s]|0,write:(s,e)=>{this.ram[s]=e}}]}loadBIOS(s){this.bios=s}getKeyboardMap(){return n}getKeyboardFunction(){return(s,e,D,g)=>{for(var B=a,M=0;M<B.length;M++)if(B[M]&&B[M].c==e){let R=M>>3,f=7-(M&7);g&t.KeyDown?this.inputs[w+R]|=1<<f:g&t.KeyUp&&(this.inputs[w+R]&=~(1<<f));break}}}newIOBus(){return{read:s=>{switch(s&=255,s){case 152:return this.vdp.readData();case 153:return this.vdp.readStatus();case 162:return this.psg.currentRegister()==14?~this.inputs[o]:this.psg.readData();case 168:return this.slotmask;case 169:return~this.inputs[w+(this.ppi_c&15)];case 170:return this.ppi_c}return 0},write:(s,e)=>{switch(s&=255,e&=255,s){case 152:this.vdp.writeData(e);break;case 153:this.vdp.writeAddress(e);break;case 168:this.slotmask=e;break;case 170:this.ppi_c=e;break;case 171:let D=e>>1&7;this.ppi_c=this.ppi_c&~(1<<D)|(e&1)<<D;break;case 160:this.psg.selectRegister(e);break;case 161:this.psg.setData(e);break;case 252:case 253:case 254:case 255:break}}}}vdpInterrupt(){this.probe.logInterrupt(255),this.cpu.interrupt(255)}loadState(s){super.loadState(s),this.slotmask=s.slotmask,this.ppi_c=s.ppi_c,this.psg.selectRegister(s.psgRegister)}saveState(){var s=super.saveState();return s.slotmask=this.slotmask,s.ppi_c=this.ppi_c,s.psgRegister=this.psg.currentRegister(),s}reset(){super.reset(),this.slotmask=0,this.ppi_c=0}resetInputs(){this.inputs.fill(0)}},l=`
|
||||
import{c as x}from"./chunk-6SJKJ2GP.js";import{J as Q,d as U,e as r}from"./chunk-ARTNMEGN.js";import{J as T,O as t,W as A,Z as H,l as E,m as O}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var n=H([[A.UP,0,1],[A.DOWN,0,2],[A.LEFT,0,4],[A.RIGHT,0,8],[A.A,0,16],[A.B,0,32],[A.P2_UP,1,1],[A.P2_DOWN,1,2],[A.P2_LEFT,1,4],[A.P2_RIGHT,1,8],[A.P2_A,1,16],[A.P2_B,1,32],[A.ANYKEY,2,0]]),o=0;var w=16,a=[A.VK_7,A.VK_6,A.VK_5,A.VK_4,A.VK_3,A.VK_2,A.VK_1,A.VK_0,A.VK_SEMICOLON,A.VK_CLOSE_BRACKET,A.VK_OPEN_BRACKET,A.VK_BACK_SLASH,A.VK_EQUALS,A.VK_MINUS,A.VK_9,A.VK_8,A.VK_B,A.VK_A,null,A.VK_SLASH,A.VK_PERIOD,A.VK_COMMA,A.VK_ACUTE,A.VK_QUOTE,A.VK_J,A.VK_I,A.VK_H,A.VK_G,A.VK_F,A.VK_E,A.VK_D,A.VK_C,A.VK_R,A.VK_Q,A.VK_P,A.VK_O,A.VK_N,A.VK_M,A.VK_L,A.VK_K,A.VK_Z,A.VK_Y,A.VK_X,A.VK_W,A.VK_V,A.VK_U,A.VK_T,A.VK_S,A.VK_F3,A.VK_F2,A.VK_F1,null,A.VK_CAPS_LOCK,null,A.VK_CONTROL,A.VK_SHIFT,A.VK_ENTER,null,A.VK_BACK_SPACE,null,A.VK_TAB,A.VK_ESCAPE,A.VK_F5,A.VK_F4,A.VK_RIGHT,A.VK_DOWN,A.VK_UP,A.VK_LEFT,A.VK_DELETE,A.VK_INSERT,A.VK_HOME,A.VK_SPACE,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],i=class extends x{constructor(){super();this.numVisibleScanlines=240;this.defaultROMSize=32768;this.ram=new Uint8Array(65536);this.slotmask=0;this.ppi_c=0;this.read=s=>{let e=s>>14<<1,D=this.slotmask>>e&3,g=this.slots[D];return g?g.read(s):0};this.write=(s,e)=>{let D=s>>14<<1,g=this.slotmask>>D&3,B=this.slots[g];B&&B.write(s,e)};this.init(this,this.newIOBus(),new r(new U)),this.bios=new E().decode(O(atob(l))),this.bios[3541]=0,this.bios[3542]=0,this.bios[3543]=0,this.slots=[{read:s=>this.bios[s]|0,write:(s,e)=>{}},{read:s=>this.rom[s-16384]|0,write:(s,e)=>{}},{read:s=>this.rom[s-16384]|0,write:(s,e)=>{}},{read:s=>this.ram[s]|0,write:(s,e)=>{this.ram[s]=e}}]}loadBIOS(s){this.bios=s}getKeyboardMap(){return n}getKeyboardFunction(){return(s,e,D,g)=>{for(var B=a,M=0;M<B.length;M++)if(B[M]&&B[M].c==e){let R=M>>3,f=7-(M&7);g&t.KeyDown?this.inputs[w+R]|=1<<f:g&t.KeyUp&&(this.inputs[w+R]&=~(1<<f));break}}}newIOBus(){return{read:s=>{switch(s&=255,s){case 152:return this.vdp.readData();case 153:return this.vdp.readStatus();case 162:return this.psg.currentRegister()==14?~this.inputs[o]:this.psg.readData();case 168:return this.slotmask;case 169:return~this.inputs[w+(this.ppi_c&15)];case 170:return this.ppi_c}return 0},write:(s,e)=>{switch(s&=255,e&=255,s){case 152:this.vdp.writeData(e);break;case 153:this.vdp.writeAddress(e);break;case 168:this.slotmask=e;break;case 170:this.ppi_c=e;break;case 171:let D=e>>1&7;this.ppi_c=this.ppi_c&~(1<<D)|(e&1)<<D;break;case 160:this.psg.selectRegister(e);break;case 161:this.psg.setData(e);break;case 252:case 253:case 254:case 255:break}}}}vdpInterrupt(){this.probe.logInterrupt(255),this.cpu.interrupt(255)}loadState(s){super.loadState(s),this.slotmask=s.slotmask,this.ppi_c=s.ppi_c,this.psg.selectRegister(s.psgRegister)}saveState(){var s=super.saveState();return s.slotmask=this.slotmask,s.ppi_c=this.ppi_c,s.psgRegister=this.psg.currentRegister(),s}reset(){super.reset(),this.slotmask=0,this.ppi_c=0}resetInputs(){this.inputs.fill(0)}},l=`
|
||||
TFpHAADAAAAAI8Sp+W4NAVo7UZPzwxINvxuYmMPtEADDvyMAw/+T4QAkAMMbEQDDNJPhIZPhc5Ph
|
||||
JxEhAgAAAMM5EZOhk+HmGMNOEcNYEcMWAsMiAsMuAsNFAsNNAsNVAsNgAsNtAsOBAsOXAsOtAsPU
|
||||
AgDDXhnDHgPDggPDwgPDBQTDQwTDjwTDtwTD5gTDGQXDbwXDggXDjAXDlwXDOhfDUhfDXBfDahHD
|
||||
@ -161,4 +161,4 @@ H5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mf
|
||||
kx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+T
|
||||
H5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+THpMc/w==
|
||||
`;var h=[{id:"helloworld.asm",name:"Hello World (ASM)"},{id:"redbook_kbd.asm",name:"Redbook Keyboard Scanner (ASM)"},{id:"siegegame.c",name:"Siege Game"},{id:"eliza.c",name:"Eliza"},{id:"hello.wiz",name:"Hello (Wiz)"}],F=[{id:"text.c",name:"Text Mode"},{id:"hello.c",name:"Scrolling Text"},{id:"text32.c",name:"32-Column Color Text"},{id:"stars.c",name:"Scrolling Starfield"},{id:"cursorsmooth.c",name:"Moving Cursor"},{id:"simplemusic.c",name:"Simple Music"},{id:"musicplayer.c",name:"Multivoice Music"},{id:"mode2bitmap.c",name:"Mode 2 Bitmap"},{id:"mode2compressed.c",name:"Mode 2 Bitmap (LZG)"},{id:"lines.c",name:"Mode 2 Lines"},{id:"multicolor.c",name:"Multicolor Mode"},{id:"siegegame.c",name:"Siege Game"},{id:"shoot.c",name:"Solarian Game"},{id:"climber.c",name:"Climber Game"}],k=class extends Q{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"BIOS",start:0,size:16384,type:"rom"},{name:"RAM",start:49152,size:12800,type:"ram"},{name:"Stack",start:61440,size:768,type:"ram"},{name:"BIOS Work RAM",start:62208,size:3328}]}}}newMachine(){return new i}getPresets(){return h}getDefaultExtension(){return".c"}readAddress(s){return this.machine.read(s)}readVRAMAddress(s){return this.machine.readVRAMAddress(s)}},C=class extends k{getPresets(){return F}};T.msx=k;T["msx-libcv"]=C;
|
||||
//# sourceMappingURL=msx-OOYI4EPW.js.map
|
||||
//# sourceMappingURL=msx-627K5HNN.js.map
|
@ -1,2 +1,2 @@
|
||||
import{J as h,c as f,q as m}from"./chunk-ULPRULB6.js";import{J as n,W as t,X as o,Z as c,aa as i}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var l=c([[t.A,1,16],[t.LEFT,1,32],[t.RIGHT,1,64],[t.P2_A,2,16],[t.P2_LEFT,2,32],[t.P2_RIGHT,2,64],[t.SELECT,1,1],[t.START,1,4],[t.P2_START,1,2]]),u=256,w=4293848814,b=4278190080,a=class extends m{constructor(){super();this.cpuFrequency=1996800;this.canvasWidth=256;this.numTotalScanlines=262;this.numVisibleScanlines=224;this.cpuCyclesPerLine=Math.floor(1996800/(262*60));this.defaultROMSize=8192;this.rotate=-90;this.sampleRate=1;this.bitshift_offset=0;this.bitshift_register=0;this.cpu=new f;this.ram=new Uint8Array(8192);this.read=i([[0,8191,8191,e=>this.rom?this.rom[e]:0],[8192,16383,8191,e=>this.ram[e]]]);this.write=i([[8192,9215,1023,(e,s)=>{this.ram[e]=s}],[9216,16383,8191,(e,s)=>{this.ram[e]=s;for(var d=e-1024<<3,r=0;r<8;r++)this.pixels[d+r]=s&1<<r?w:b}]]);this.connectCPUMemoryBus(this),this.connectCPUIOBus(this.newIOBus()),this.handler=o(this.inputs,l)}newIOBus(){return{read:e=>{switch(e&=3,e){case 0:case 1:case 2:return this.inputs[e];case 3:return this.bitshift_register>>8-this.bitshift_offset&255}return 0},write:(e,s)=>{switch(e&=7,s&=255,e){case 2:this.bitshift_offset=s&7;break;case 3:case 5:break;case 4:this.bitshift_register=this.bitshift_register>>8|s<<8;break;case 6:this.watchdog_counter=u;break}}}}startScanline(){}drawScanline(){this.scanline==95?this.interrupt(207):this.scanline==223&&this.interrupt(215)}interrupt(e){this.probe.logInterrupt(e),this.cpu.interrupt(e)}advanceFrame(e){return this.watchdog_counter--<=0&&(console.log("WATCHDOG FIRED"),this.reset()),super.advanceFrame(e)}loadState(e){super.loadState(e),this.bitshift_register=e.bsr,this.bitshift_offset=e.bso,this.watchdog_counter=e.wdc}saveState(){var e=super.saveState();return e.bsr=this.bitshift_register,e.bso=this.bitshift_offset,e.wdc=this.watchdog_counter,e}reset(){super.reset(),this.watchdog_counter=u}};var _=[{id:"gfxtest.c",name:"Graphics Test"},{id:"shifter.c",name:"Sprite w/ Bit Shifter"},{id:"game2.c",name:"Cosmic Impalas"}],p=class extends h{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"Frame Buffer",start:9216,size:7168,type:"ram"}]}}}newMachine(){return new a}getPresets(){return _}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}showHelp(){return"https://8bitworkshop.com/docs/platforms/arcade/index.html#midway-8080"}};n.mw8080bw=p;
|
||||
//# sourceMappingURL=mw8080bw-BVUD3QUV.js.map
|
||||
import{J as h,c as f,q as m}from"./chunk-ARTNMEGN.js";import{J as n,W as t,X as o,Z as c,aa as i}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var l=c([[t.A,1,16],[t.LEFT,1,32],[t.RIGHT,1,64],[t.P2_A,2,16],[t.P2_LEFT,2,32],[t.P2_RIGHT,2,64],[t.SELECT,1,1],[t.START,1,4],[t.P2_START,1,2]]),u=256,w=4293848814,b=4278190080,a=class extends m{constructor(){super();this.cpuFrequency=1996800;this.canvasWidth=256;this.numTotalScanlines=262;this.numVisibleScanlines=224;this.cpuCyclesPerLine=Math.floor(1996800/(262*60));this.defaultROMSize=8192;this.rotate=-90;this.sampleRate=1;this.bitshift_offset=0;this.bitshift_register=0;this.cpu=new f;this.ram=new Uint8Array(8192);this.read=i([[0,8191,8191,e=>this.rom?this.rom[e]:0],[8192,16383,8191,e=>this.ram[e]]]);this.write=i([[8192,9215,1023,(e,s)=>{this.ram[e]=s}],[9216,16383,8191,(e,s)=>{this.ram[e]=s;for(var d=e-1024<<3,r=0;r<8;r++)this.pixels[d+r]=s&1<<r?w:b}]]);this.connectCPUMemoryBus(this),this.connectCPUIOBus(this.newIOBus()),this.handler=o(this.inputs,l)}newIOBus(){return{read:e=>{switch(e&=3,e){case 0:case 1:case 2:return this.inputs[e];case 3:return this.bitshift_register>>8-this.bitshift_offset&255}return 0},write:(e,s)=>{switch(e&=7,s&=255,e){case 2:this.bitshift_offset=s&7;break;case 3:case 5:break;case 4:this.bitshift_register=this.bitshift_register>>8|s<<8;break;case 6:this.watchdog_counter=u;break}}}}startScanline(){}drawScanline(){this.scanline==95?this.interrupt(207):this.scanline==223&&this.interrupt(215)}interrupt(e){this.probe.logInterrupt(e),this.cpu.interrupt(e)}advanceFrame(e){return this.watchdog_counter--<=0&&(console.log("WATCHDOG FIRED"),this.reset()),super.advanceFrame(e)}loadState(e){super.loadState(e),this.bitshift_register=e.bsr,this.bitshift_offset=e.bso,this.watchdog_counter=e.wdc}saveState(){var e=super.saveState();return e.bsr=this.bitshift_register,e.bso=this.bitshift_offset,e.wdc=this.watchdog_counter,e}reset(){super.reset(),this.watchdog_counter=u}};var _=[{id:"gfxtest.c",name:"Graphics Test"},{id:"shifter.c",name:"Sprite w/ Bit Shifter"},{id:"game2.c",name:"Cosmic Impalas"}],p=class extends h{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"Frame Buffer",start:9216,size:7168,type:"ram"}]}}}newMachine(){return new a}getPresets(){return _}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}showHelp(){return"https://8bitworkshop.com/docs/platforms/arcade/index.html#midway-8080"}};n.mw8080bw=p;
|
||||
//# sourceMappingURL=mw8080bw-U2I4GA65.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -7,6 +7,7 @@ const mameplatform_1 = require("../common/mameplatform");
|
||||
const C64_PRESETS = [
|
||||
{ id: 'helloc.c', name: 'Hello World', category: 'C' },
|
||||
{ id: 'screen_ram.c', name: 'Screen RAM' },
|
||||
{ id: 'siegegame.c', name: 'Siege Game' },
|
||||
{ id: 'joymove.c', name: 'Sprite Movement' },
|
||||
{ id: 'sprite_collision.c', name: 'Sprite Collision' },
|
||||
{ id: 'scroll1.c', name: 'Scrolling (Single Buffer)' },
|
||||
@ -28,11 +29,13 @@ const C64_PRESETS = [
|
||||
{ id: 'musicplayer.c', name: 'Music Player' },
|
||||
//{id:'sidtune.dasm', name:'Tiny SID Tune (ASM)'},
|
||||
{ id: 'siddemo.c', name: 'SID Player Demo' },
|
||||
{ id: 'digisound.c', name: 'Digi Sound Player' },
|
||||
{ id: 'climber.c', name: 'Climber Game' },
|
||||
{ id: 'test_border_sprites.c', name: 'Sprites in the Borders' },
|
||||
{ id: 'sprite_stretch.c', name: 'Sprite Stretching' },
|
||||
{ id: 'linecrunch.c', name: 'Linecrunch' },
|
||||
{ id: 'fld.c', name: 'Flexible Line Distance' },
|
||||
{ id: 'plasma.c', name: 'Plasma Demo' },
|
||||
{ id: 'siegegame.c', name: 'Siege Game' },
|
||||
{ id: '23matches.c', name: '23 Matches' },
|
||||
{ id: 'tgidemo.c', name: 'TGI Graphics Demo' },
|
||||
{ id: 'upandaway.c', name: 'Up, Up and Away' },
|
||||
|
File diff suppressed because one or more lines are too long
@ -21161,68 +21161,96 @@ var require_cookie = __commonJS({
|
||||
exports2.parse = parse;
|
||||
exports2.serialize = serialize;
|
||||
var __toString = Object.prototype.toString;
|
||||
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
||||
function parse(str, options) {
|
||||
var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
||||
var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
|
||||
var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
||||
var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
||||
function parse(str, opt) {
|
||||
if (typeof str !== "string") {
|
||||
throw new TypeError("argument str must be a string");
|
||||
}
|
||||
var obj = {};
|
||||
var opt = options || {};
|
||||
var dec = opt.decode || decode;
|
||||
var len = str.length;
|
||||
if (len < 2)
|
||||
return obj;
|
||||
var dec = opt && opt.decode || decode;
|
||||
var index = 0;
|
||||
while (index < str.length) {
|
||||
var eqIdx = str.indexOf("=", index);
|
||||
if (eqIdx === -1) {
|
||||
var eqIdx = 0;
|
||||
var endIdx = 0;
|
||||
do {
|
||||
eqIdx = str.indexOf("=", index);
|
||||
if (eqIdx === -1)
|
||||
break;
|
||||
}
|
||||
var endIdx = str.indexOf(";", index);
|
||||
endIdx = str.indexOf(";", index);
|
||||
if (endIdx === -1) {
|
||||
endIdx = str.length;
|
||||
} else if (endIdx < eqIdx) {
|
||||
endIdx = len;
|
||||
} else if (eqIdx > endIdx) {
|
||||
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
||||
continue;
|
||||
}
|
||||
var key = str.slice(index, eqIdx).trim();
|
||||
if (obj[key] === void 0) {
|
||||
var val = str.slice(eqIdx + 1, endIdx).trim();
|
||||
if (val.charCodeAt(0) === 34) {
|
||||
val = val.slice(1, -1);
|
||||
var keyStartIdx = startIndex(str, index, eqIdx);
|
||||
var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
|
||||
var key = str.slice(keyStartIdx, keyEndIdx);
|
||||
if (!obj.hasOwnProperty(key)) {
|
||||
var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
|
||||
var valEndIdx = endIndex(str, endIdx, valStartIdx);
|
||||
if (str.charCodeAt(valStartIdx) === 34 && str.charCodeAt(valEndIdx - 1) === 34) {
|
||||
valStartIdx++;
|
||||
valEndIdx--;
|
||||
}
|
||||
var val = str.slice(valStartIdx, valEndIdx);
|
||||
obj[key] = tryDecode(val, dec);
|
||||
}
|
||||
index = endIdx + 1;
|
||||
}
|
||||
} while (index < len);
|
||||
return obj;
|
||||
}
|
||||
function serialize(name, val, options) {
|
||||
var opt = options || {};
|
||||
var enc = opt.encode || encode;
|
||||
function startIndex(str, index, max) {
|
||||
do {
|
||||
var code = str.charCodeAt(index);
|
||||
if (code !== 32 && code !== 9)
|
||||
return index;
|
||||
} while (++index < max);
|
||||
return max;
|
||||
}
|
||||
function endIndex(str, index, min) {
|
||||
while (index > min) {
|
||||
var code = str.charCodeAt(--index);
|
||||
if (code !== 32 && code !== 9)
|
||||
return index + 1;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
function serialize(name, val, opt) {
|
||||
var enc = opt && opt.encode || encodeURIComponent;
|
||||
if (typeof enc !== "function") {
|
||||
throw new TypeError("option encode is invalid");
|
||||
}
|
||||
if (!fieldContentRegExp.test(name)) {
|
||||
if (!cookieNameRegExp.test(name)) {
|
||||
throw new TypeError("argument name is invalid");
|
||||
}
|
||||
var value = enc(val);
|
||||
if (value && !fieldContentRegExp.test(value)) {
|
||||
if (!cookieValueRegExp.test(value)) {
|
||||
throw new TypeError("argument val is invalid");
|
||||
}
|
||||
var str = name + "=" + value;
|
||||
if (!opt)
|
||||
return str;
|
||||
if (opt.maxAge != null) {
|
||||
var maxAge = opt.maxAge - 0;
|
||||
if (isNaN(maxAge) || !isFinite(maxAge)) {
|
||||
var maxAge = Math.floor(opt.maxAge);
|
||||
if (!isFinite(maxAge)) {
|
||||
throw new TypeError("option maxAge is invalid");
|
||||
}
|
||||
str += "; Max-Age=" + Math.floor(maxAge);
|
||||
str += "; Max-Age=" + maxAge;
|
||||
}
|
||||
if (opt.domain) {
|
||||
if (!fieldContentRegExp.test(opt.domain)) {
|
||||
if (!domainValueRegExp.test(opt.domain)) {
|
||||
throw new TypeError("option domain is invalid");
|
||||
}
|
||||
str += "; Domain=" + opt.domain;
|
||||
}
|
||||
if (opt.path) {
|
||||
if (!fieldContentRegExp.test(opt.path)) {
|
||||
if (!pathValueRegExp.test(opt.path)) {
|
||||
throw new TypeError("option path is invalid");
|
||||
}
|
||||
str += "; Path=" + opt.path;
|
||||
@ -21283,11 +21311,8 @@ var require_cookie = __commonJS({
|
||||
function decode(str) {
|
||||
return str.indexOf("%") !== -1 ? decodeURIComponent(str) : str;
|
||||
}
|
||||
function encode(val) {
|
||||
return encodeURIComponent(val);
|
||||
}
|
||||
function isDate(val) {
|
||||
return __toString.call(val) === "[object Date]" || val instanceof Date;
|
||||
return __toString.call(val) === "[object Date]";
|
||||
}
|
||||
function tryDecode(str, decode2) {
|
||||
try {
|
||||
@ -22402,6 +22427,10 @@ function isOutputResult(result) {
|
||||
}
|
||||
|
||||
// src/common/util.ts
|
||||
function getFilenamePrefix(s) {
|
||||
var pos = s.lastIndexOf(".");
|
||||
return pos > 0 ? s.substr(0, pos) : s;
|
||||
}
|
||||
function getBasePlatform(platform) {
|
||||
return platform.split(".")[0];
|
||||
}
|
||||
@ -22502,6 +22531,8 @@ var LLVM_MOS_TOOL = {
|
||||
extensions: [".c", ".cpp", ".s", ".S", ".C"],
|
||||
archs: ["6502"],
|
||||
platforms: ["atari8", "c64", "nes", "pce", "vcs"],
|
||||
processOutput: basicProcessOutput,
|
||||
processErrors: llvmMosProcessErrors,
|
||||
platform_configs: {
|
||||
default: {
|
||||
binpath: "llvm-mos/bin",
|
||||
@ -22531,6 +22562,110 @@ var LLVM_MOS_TOOL = {
|
||||
}
|
||||
}
|
||||
};
|
||||
async function basicProcessOutput(step, outfile) {
|
||||
let output = await import_fs.default.promises.readFile(outfile, { encoding: "base64" });
|
||||
return { output };
|
||||
}
|
||||
async function llvmMosProcessErrors(step, errorData) {
|
||||
errorData = errorData.replace(/(\/var\/folders\/.+?\/).+?:/g, "");
|
||||
let errors = [];
|
||||
let errorMatcher = makeErrorMatcher(errors, /([^:/]+):(\d+):(\d+):\s*(.+)/, 2, 4, step.path, 1);
|
||||
for (let line of errorData.split("\n")) {
|
||||
errorMatcher(line);
|
||||
}
|
||||
return { errors };
|
||||
}
|
||||
var OSCAR64_TOOL = {
|
||||
name: "oscar64",
|
||||
version: "",
|
||||
extensions: [".c", ".cc", ".cpp"],
|
||||
archs: ["6502"],
|
||||
platforms: ["atari8", "c64", "nes"],
|
||||
processOutput: oscar64ProcessOutput,
|
||||
processErrors: oscar64ProcessErrors,
|
||||
platform_configs: {
|
||||
default: {
|
||||
binpath: "oscar64/bin",
|
||||
command: "oscar64",
|
||||
args: ["-Os", "-g", "-d__8BITWORKSHOP__", "-o=$OUTFILE", "$INFILES"]
|
||||
},
|
||||
c64: {
|
||||
outfile: "a.prg"
|
||||
}
|
||||
}
|
||||
};
|
||||
async function oscar64ProcessErrors(step, errorData) {
|
||||
let errors = [];
|
||||
let errorMatcher = makeErrorMatcher(errors, /\/([^(]+)\((\d+), (\d+)\) : \s*(.+)/, 2, 4, step.path, 1);
|
||||
for (let line of errorData.split("\n")) {
|
||||
errorMatcher(line);
|
||||
}
|
||||
return { errors };
|
||||
}
|
||||
async function oscar64ProcessOutput(step, outpath) {
|
||||
let prefix_path = outpath.replace(/\.\w+$/, "");
|
||||
let output = await import_fs.default.promises.readFile(outpath, { encoding: "base64" });
|
||||
let listings = {};
|
||||
let symbolmap = {};
|
||||
let debuginfo = {};
|
||||
let segments = [];
|
||||
{
|
||||
let txt = await import_fs.default.promises.readFile(prefix_path + ".map", { encoding: "utf-8" });
|
||||
for (let line of txt.split("\n")) {
|
||||
const m1 = line.match(/([0-9a-f]+) - ([0-9a-f]+) : ([A-Z_]+), (.+)/);
|
||||
if (m1) {
|
||||
const name = m1[4];
|
||||
const start = parseInt(m1[1], 16);
|
||||
const end = parseInt(m1[2], 16);
|
||||
segments.push({
|
||||
name,
|
||||
start,
|
||||
size: end - start
|
||||
});
|
||||
}
|
||||
const m2 = line.match(/([0-9a-f]+) \(([0-9a-f]+)\) : ([^,]+), (.+)/);
|
||||
if (m2) {
|
||||
const addr = parseInt(m2[1], 16);
|
||||
const name = m2[3];
|
||||
symbolmap[name] = addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
let txt = await import_fs.default.promises.readFile(prefix_path + ".asm", { encoding: "utf-8" });
|
||||
let lst = { lines: [], text: txt };
|
||||
let asm_lineno = 0;
|
||||
let c_lineno = 0;
|
||||
let c_path = "";
|
||||
const path4 = step.path;
|
||||
for (let line of txt.split("\n")) {
|
||||
asm_lineno++;
|
||||
let m2 = line.match(/;\s*(\d+), "(.+?)"/);
|
||||
if (m2) {
|
||||
c_lineno = parseInt(m2[1]);
|
||||
c_path = m2[2].split("/").pop();
|
||||
}
|
||||
let m = line.match(/([0-9a-f]+) : ([0-9a-f _]{8}) (.+)/);
|
||||
if (m) {
|
||||
let offset = parseInt(m[1], 16);
|
||||
let hex = m[2];
|
||||
let asm = m[3];
|
||||
if (c_path) {
|
||||
lst.lines.push({
|
||||
line: c_lineno,
|
||||
path: c_path,
|
||||
offset,
|
||||
iscode: true
|
||||
});
|
||||
c_path = "";
|
||||
c_lineno = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
listings[getFilenamePrefix(step.path) + ".lst"] = lst;
|
||||
}
|
||||
return { output, listings, symbolmap, segments, debuginfo };
|
||||
}
|
||||
function findBestTool(step) {
|
||||
if (!step?.tool)
|
||||
throw new Error("No tool specified");
|
||||
@ -22543,7 +22678,8 @@ function findBestTool(step) {
|
||||
throw new Error(`Tool not found: ${step.tool}`);
|
||||
}
|
||||
var TOOLS = [
|
||||
Object.assign({}, LLVM_MOS_TOOL, { version: "latest" })
|
||||
Object.assign({}, LLVM_MOS_TOOL, { version: "latest" }),
|
||||
Object.assign({}, OSCAR64_TOOL, { version: "latest" })
|
||||
];
|
||||
var ServerBuildEnv = class {
|
||||
constructor(rootdir, sessionID, tool) {
|
||||
@ -22562,7 +22698,15 @@ var ServerBuildEnv = class {
|
||||
if (file.path.match(/[\\\/]/)) {
|
||||
throw new Error(`Invalid file path: ${file.path}`);
|
||||
}
|
||||
await import_fs.default.promises.writeFile(import_path2.default.join(this.sessionDir, file.path), file.data);
|
||||
let data = file.data;
|
||||
if (typeof data === "string" && data.startsWith("data:base64,")) {
|
||||
let parts = data.split(",");
|
||||
if (parts.length !== 2) {
|
||||
throw new Error(`Invalid data URL: ${data}`);
|
||||
}
|
||||
data = Buffer.from(parts[1], "base64");
|
||||
}
|
||||
await import_fs.default.promises.writeFile(import_path2.default.join(this.sessionDir, file.path), data);
|
||||
}
|
||||
async build(step, platform) {
|
||||
let platformID = platform || getRootBasePlatform(step.platform);
|
||||
@ -22577,7 +22721,7 @@ var ServerBuildEnv = class {
|
||||
config = Object.assign({}, defaultConfig, config);
|
||||
let args = config.args.slice(0);
|
||||
let command = config.command;
|
||||
let outfile = import_path2.default.join(this.sessionDir, "a.out");
|
||||
let outfile = import_path2.default.join(this.sessionDir, config.outfile || "a.out");
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
args[i] = args[i].replace(/\$OUTFILE/g, outfile);
|
||||
args[i] = args[i].replace(/\$WORKDIR/g, this.sessionDir);
|
||||
@ -22623,13 +22767,12 @@ var ServerBuildEnv = class {
|
||||
if (platform === "debug") {
|
||||
resolve(this.processDebugInfo(step));
|
||||
} else {
|
||||
resolve(this.processOutput(step));
|
||||
resolve(this.tool.processOutput(step, outfile));
|
||||
}
|
||||
} else {
|
||||
errorData = replaceAll(errorData, this.sessionDir, "");
|
||||
errorData = replaceAll(errorData, this.rootdir, "");
|
||||
errorData = errorData.replace(/(\/var\/folders\/.+?\/).+?:/g, "");
|
||||
let errorResult = await this.processErrors(step, errorData);
|
||||
let errorResult = await this.tool.processErrors(step, errorData);
|
||||
if (errorResult.errors.length === 0) {
|
||||
errorResult.errors.push({ line: 0, msg: `Build failed.
|
||||
|
||||
@ -22640,16 +22783,7 @@ ${errorData}` });
|
||||
});
|
||||
});
|
||||
}
|
||||
async processErrors(step, errorData) {
|
||||
let errors = [];
|
||||
let errorMatcher = makeErrorMatcher(errors, /([^:/]+):(\d+):(\d+):\s*(.+)/, 2, 4, step.path, 1);
|
||||
for (let line of errorData.split("\n")) {
|
||||
errorMatcher(line);
|
||||
}
|
||||
return { errors };
|
||||
}
|
||||
async processOutput(step) {
|
||||
let outfile = import_path2.default.join(this.sessionDir, "a.out");
|
||||
async processOutput(step, outfile) {
|
||||
let output = await import_fs.default.promises.readFile(outfile, { encoding: "base64" });
|
||||
return { output };
|
||||
}
|
||||
@ -22665,7 +22799,7 @@ ${errorData}` });
|
||||
}
|
||||
try {
|
||||
let result = await this.build(step);
|
||||
if (isOutputResult(result)) {
|
||||
if (step.tool == "llvm-mos" && isOutputResult(result)) {
|
||||
const debugInfo = await this.build(step, "debug");
|
||||
if (isOutputResult(debugInfo)) {
|
||||
result.listings = debugInfo.listings;
|
||||
@ -22686,7 +22820,7 @@ app.use(import_express.default.json({ limit: 1024 * 1024 }));
|
||||
app.get("/info", (req, res) => {
|
||||
res.json({ tools: TOOLS });
|
||||
});
|
||||
app.get("/test", async (req, res, next) => {
|
||||
app.get("/test1", async (req, res, next) => {
|
||||
try {
|
||||
const updates = [{ path: "test.c", data: "int main() { return 0; }" }];
|
||||
const buildStep = { tool: "llvm-mos", platform: "c64", files: ["test.c"] };
|
||||
@ -22697,6 +22831,17 @@ app.get("/test", async (req, res, next) => {
|
||||
return next(err);
|
||||
}
|
||||
});
|
||||
app.get("/test2", async (req, res, next) => {
|
||||
try {
|
||||
const updates = [{ path: "test.c", data: "int main() { return 0; }" }];
|
||||
const buildStep = { tool: "oscar64", platform: "c64", files: ["test.c"] };
|
||||
const env = new ServerBuildEnv(SERVER_ROOT, "test", TOOLS[1]);
|
||||
const result = await env.compileAndLink(buildStep, updates);
|
||||
res.json(result);
|
||||
} catch (err) {
|
||||
return next(err);
|
||||
}
|
||||
});
|
||||
app.post("/build", async (req, res, next) => {
|
||||
try {
|
||||
const updates = req.body.updates;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
import{a as g,b as p,c as M}from"./chunk-S56QHLVT.js";import{J as o,d,f as l}from"./chunk-ULPRULB6.js";import{$ as h,J as a,W as t,Z as x,aa as i,g as f}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var A=x([[t.UP,0,1],[t.DOWN,0,2],[t.LEFT,0,4],[t.RIGHT,0,8],[t.A,0,16],[t.B,0,32],[t.GP_A,0,16],[t.GP_B,0,32],[t.P2_UP,0,64],[t.P2_DOWN,0,128],[t.P2_LEFT,1,1],[t.P2_RIGHT,1,2],[t.P2_A,1,4],[t.P2_B,1,8],[t.VK_BACK_SLASH,1,16],[t.VK_ENTER,1,128]]),m=class extends M{constructor(){super();this.numVisibleScanlines=240;this.defaultROMSize=49152;this.ram=new Uint8Array(1024);this.read=i([[49152,65535,1023,e=>this.ram[e]],[0,49151,65535,e=>this.rom&&this.rom[e]]]);this.write=i([[49152,65535,1023,(e,r)=>{this.ram[e]=r}]]);this.init(this,this.newIOBus(),new l(new d))}getKeyboardMap(){return A}vdpInterrupt(){return this.probe.logInterrupt(255),this.cpu.interrupt(255)}getVCounter(){return 0}getHCounter(){return 0}setMemoryControl(e){}setIOPortControl(e){}readIO(e){switch(e&193){case 64:return this.getVCounter();case 65:return this.getHCounter();case 128:return this.vdp.readData();case 129:return this.vdp.readStatus();case 192:return this.inputs[0]^255;case 193:return this.inputs[1]^255}return 0}writeIO(e,r){switch(e&193){case 0:return this.setMemoryControl(r);case 1:return this.setIOPortControl(r);case 64:case 65:return this.psg.setData(r);case 128:return this.vdp.writeData(r);case 129:return this.vdp.writeAddress(r)}}newIOBus(){return{read:e=>(e&=255,this.readIO(e)),write:(e,r)=>{e&=255,r&=255,this.writeIO(e,r)}}}},u=class extends m{constructor(){super(...arguments);this.cartram=new Uint8Array(0);this.pagingRegisters=new Uint8Array(4);this.latchedHCounter=0;this.ioControlFlags=0;this.ram=new Uint8Array(8192);this.read=i([[49152,65535,8191,e=>this.ram[e]],[0,1023,1023,e=>this.rom&&this.rom[e]],[1024,16383,16383,e=>this.getPagedROM(e,1)],[16384,32767,16383,e=>this.getPagedROM(e,2)],[32768,49151,16383,e=>{var r=this.pagingRegisters[0];return r&8?this.cartram[r&4?e+16384:e]:this.getPagedROM(e,3)}]]);this.write=i([[49152,65531,8191,(e,r)=>{this.ram[e]=r}],[65532,65535,3,(e,r)=>{this.pagingRegisters[e]=r,this.ram[e+8188]=r}],[32768,49151,16383,(e,r)=>{var s=this.pagingRegisters[0];s&8&&(this.cartram.length==0&&(this.cartram=new Uint8Array(32768)),this.cartram[s&4?e+16384:e]=r)}]])}newVDP(e,r,s){return new g(e,r,s)}reset(){super.reset(),this.pagingRegisters.set([0,0,1,2])}getVCounter(){var e=this.scanline;return e<=218?e:e-6}getHCounter(){return this.latchedHCounter}computeHCounter(){return 0}setIOPortControl(e){(e^this.ioControlFlags)&160&&(this.latchedHCounter=this.computeHCounter()),this.ioControlFlags=e}getPagedROM(e,r){return this.rom&&this.rom[e+((this.pagingRegisters[r]&this.romPageMask)<<14)]}loadROM(e){if(e.length<=49152)this.rom=h(e,49152),this.romPageMask=3;else switch(e.length){case 65536:case 131072:case 262144:case 524288:this.rom=e,this.romPageMask=(e.length>>14)-1;break;default:throw Error("Unknown rom size: $"+f(e.length))}this.reset()}loadState(e){super.loadState(e),this.pagingRegisters.set(e.pr),this.cartram.set(e.cr),this.latchedHCounter=e.lhc,this.ioControlFlags=e.iocf}saveState(){var e=super.saveState();return e.pr=this.pagingRegisters.slice(0),e.cr=this.cartram.slice(0),e.lhc=this.latchedHCounter,e.iocf=this.ioControlFlags,e}getDebugInfo(e,r){switch(e){case"SMS":return super.getDebugInfo(e,r)+`
|
||||
import{a as g,b as p,c as M}from"./chunk-6SJKJ2GP.js";import{J as o,d,f as l}from"./chunk-ARTNMEGN.js";import{$ as h,J as a,W as t,Z as x,aa as i,g as f}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var A=x([[t.UP,0,1],[t.DOWN,0,2],[t.LEFT,0,4],[t.RIGHT,0,8],[t.A,0,16],[t.B,0,32],[t.GP_A,0,16],[t.GP_B,0,32],[t.P2_UP,0,64],[t.P2_DOWN,0,128],[t.P2_LEFT,1,1],[t.P2_RIGHT,1,2],[t.P2_A,1,4],[t.P2_B,1,8],[t.VK_BACK_SLASH,1,16],[t.VK_ENTER,1,128]]),m=class extends M{constructor(){super();this.numVisibleScanlines=240;this.defaultROMSize=49152;this.ram=new Uint8Array(1024);this.read=i([[49152,65535,1023,e=>this.ram[e]],[0,49151,65535,e=>this.rom&&this.rom[e]]]);this.write=i([[49152,65535,1023,(e,r)=>{this.ram[e]=r}]]);this.init(this,this.newIOBus(),new l(new d))}getKeyboardMap(){return A}vdpInterrupt(){return this.probe.logInterrupt(255),this.cpu.interrupt(255)}getVCounter(){return 0}getHCounter(){return 0}setMemoryControl(e){}setIOPortControl(e){}readIO(e){switch(e&193){case 64:return this.getVCounter();case 65:return this.getHCounter();case 128:return this.vdp.readData();case 129:return this.vdp.readStatus();case 192:return this.inputs[0]^255;case 193:return this.inputs[1]^255}return 0}writeIO(e,r){switch(e&193){case 0:return this.setMemoryControl(r);case 1:return this.setIOPortControl(r);case 64:case 65:return this.psg.setData(r);case 128:return this.vdp.writeData(r);case 129:return this.vdp.writeAddress(r)}}newIOBus(){return{read:e=>(e&=255,this.readIO(e)),write:(e,r)=>{e&=255,r&=255,this.writeIO(e,r)}}}},u=class extends m{constructor(){super(...arguments);this.cartram=new Uint8Array(0);this.pagingRegisters=new Uint8Array(4);this.latchedHCounter=0;this.ioControlFlags=0;this.ram=new Uint8Array(8192);this.read=i([[49152,65535,8191,e=>this.ram[e]],[0,1023,1023,e=>this.rom&&this.rom[e]],[1024,16383,16383,e=>this.getPagedROM(e,1)],[16384,32767,16383,e=>this.getPagedROM(e,2)],[32768,49151,16383,e=>{var r=this.pagingRegisters[0];return r&8?this.cartram[r&4?e+16384:e]:this.getPagedROM(e,3)}]]);this.write=i([[49152,65531,8191,(e,r)=>{this.ram[e]=r}],[65532,65535,3,(e,r)=>{this.pagingRegisters[e]=r,this.ram[e+8188]=r}],[32768,49151,16383,(e,r)=>{var s=this.pagingRegisters[0];s&8&&(this.cartram.length==0&&(this.cartram=new Uint8Array(32768)),this.cartram[s&4?e+16384:e]=r)}]])}newVDP(e,r,s){return new g(e,r,s)}reset(){super.reset(),this.pagingRegisters.set([0,0,1,2])}getVCounter(){var e=this.scanline;return e<=218?e:e-6}getHCounter(){return this.latchedHCounter}computeHCounter(){return 0}setIOPortControl(e){(e^this.ioControlFlags)&160&&(this.latchedHCounter=this.computeHCounter()),this.ioControlFlags=e}getPagedROM(e,r){return this.rom&&this.rom[e+((this.pagingRegisters[r]&this.romPageMask)<<14)]}loadROM(e){if(e.length<=49152)this.rom=h(e,49152),this.romPageMask=3;else switch(e.length){case 65536:case 131072:case 262144:case 524288:this.rom=e,this.romPageMask=(e.length>>14)-1;break;default:throw Error("Unknown rom size: $"+f(e.length))}this.reset()}loadState(e){super.loadState(e),this.pagingRegisters.set(e.pr),this.cartram.set(e.cr),this.latchedHCounter=e.lhc,this.ioControlFlags=e.iocf}saveState(){var e=super.saveState();return e.pr=this.pagingRegisters.slice(0),e.cr=this.cartram.slice(0),e.lhc=this.latchedHCounter,e.iocf=this.ioControlFlags,e}getDebugInfo(e,r){switch(e){case"SMS":return super.getDebugInfo(e,r)+`
|
||||
Bank Regs: `+this.pagingRegisters+`
|
||||
`;default:return super.getDebugInfo(e,r)}}},c=class extends u{newVDP(e,r,s){return new p(e,r,s)}readIO(e){switch(e&193){case 0:return~this.inputs[1]&128|64;case 220:return this.inputs[0]^255;case 221:return this.inputs[1]^255}return super.readIO(e)}};var C=[{id:"text.c",name:"Text Mode"},{id:"hello.c",name:"Scrolling Text"},{id:"text32.c",name:"32-Column Color Text"},{id:"stars.c",name:"Scrolling Starfield"},{id:"cursorsmooth.c",name:"Moving Cursor"},{id:"simplemusic.c",name:"Simple Music"},{id:"musicplayer.c",name:"Multivoice Music"},{id:"mode2bitmap.c",name:"Mode 2 Bitmap"},{id:"mode2compressed.c",name:"Mode 2 Bitmap (LZG)"},{id:"lines.c",name:"Mode 2 Lines"},{id:"multicolor.c",name:"Multicolor Mode"},{id:"siegegame.c",name:"Siege Game"},{id:"shoot.c",name:"Solarian Game"},{id:"climber.c",name:"Climber Game"}],P=[{id:"mode4test.c",name:"Mode 4 Test"},{id:"climber.c",name:"Climber Game"}],b=class extends o{newMachine(){return new m}getPresets(){return C}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}readVRAMAddress(e){return this.machine.readVRAMAddress(e)}},S=class extends o{newMachine(){return new u}getPresets(){return P}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}readVRAMAddress(e){return this.machine.readVRAMAddress(e)}},w=class extends o{newMachine(){return new c}getPresets(){return P}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}readVRAMAddress(e){return this.machine.readVRAMAddress(e)}};a["sms-sg1000-libcv"]=b;a["sms-sms-libcv"]=S;a["sms-gg-libcv"]=w;export{C as SG1000_PRESETS,P as SMS_PRESETS};
|
||||
//# sourceMappingURL=sms-6QH6TDVI.js.map
|
||||
//# sourceMappingURL=sms-ZZMMAJND.js.map
|
@ -1,2 +1,2 @@
|
||||
import{D as w}from"./chunk-ULPRULB6.js";import{$ as P,J as v,P as x,S as p,U as C,aa as d}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var y=[],A=function(R){this.__proto__=new w;var t,i,o,f,l,u,c,m,s,M=0,a=0,r,g=14318e3/8,b=1789750/1280,D=g/60,S=g/b;this.getPresets=function(){return y},this.start=function(){i=new p(1024),f={read:d([[0,16383,16383,function(e){return o?o[e]:null}],[16384,24575,1023,function(e){return i.mem[e]}]]),write:d([[16384,24575,1023,function(e,n){i.mem[e]=n}]]),isContended:function(){return!1}},l={read:function(e){if(e&64){if(a==15){var n=t.getTstates()/S&1;return n?255:0}return r.readRegister(a)&255}return 0},write:function(e,n){e&128&&(a=n&15),e&64&&r.writeRegisterAY(a,n&255)}},this.readAddress=f.read,t=this.newCPU(f,l),r=new PsgDeviceChannel,c=new MasterChannel,r.setMode(PsgDeviceChannel.MODE_SIGNED),r.setDevice(PsgDeviceChannel.DEVICE_AY_3_8910),c.addChannel(r),u=new AudioLooper(512),u.setChannel(c),m=new x(R,256,256),m.create(),m.setKeyboardEvents(function(e,n,T){var h=e-49;h>=0&&T&1&&(r.writeRegister(14,h),r.writeRegister(15,128),t.setIFF1(1),t.requestInterrupt(56))}),s=new C(60,()=>{if(!!this.isRunning()){var e=this.getDebugCallback(),n=t.getTstates()+D;if(e)for(;t.getTstates()<n;)e&&e()&&(e=null),t.runFrame(t.getTstates()+1);else t.runFrame(n)}})},this.loadROM=function(e,n){o=P(n,16384),t.reset()},this.loadState=function(e){t.loadState(e.c),i.mem.set(e.b)},this.saveState=function(){return{c:this.getCPUState(),b:i.mem.slice(0)}},this.getCPUState=function(){return t.saveState()},this.isRunning=function(){return s&&s.isRunning()},this.pause=function(){s.stop()},this.resume=function(){s.start(),u.activate()},this.reset=function(){t.reset(),this.getDebugCallback()||t.setTstates(0)}};v.sound_konami=A;
|
||||
//# sourceMappingURL=sound_konami-RWGOIUSP.js.map
|
||||
import{D as w}from"./chunk-ARTNMEGN.js";import{$ as P,J as v,P as x,S as p,U as C,aa as d}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var y=[],A=function(R){this.__proto__=new w;var t,i,o,f,l,u,c,m,s,M=0,a=0,r,g=14318e3/8,b=1789750/1280,D=g/60,S=g/b;this.getPresets=function(){return y},this.start=function(){i=new p(1024),f={read:d([[0,16383,16383,function(e){return o?o[e]:null}],[16384,24575,1023,function(e){return i.mem[e]}]]),write:d([[16384,24575,1023,function(e,n){i.mem[e]=n}]]),isContended:function(){return!1}},l={read:function(e){if(e&64){if(a==15){var n=t.getTstates()/S&1;return n?255:0}return r.readRegister(a)&255}return 0},write:function(e,n){e&128&&(a=n&15),e&64&&r.writeRegisterAY(a,n&255)}},this.readAddress=f.read,t=this.newCPU(f,l),r=new PsgDeviceChannel,c=new MasterChannel,r.setMode(PsgDeviceChannel.MODE_SIGNED),r.setDevice(PsgDeviceChannel.DEVICE_AY_3_8910),c.addChannel(r),u=new AudioLooper(512),u.setChannel(c),m=new x(R,256,256),m.create(),m.setKeyboardEvents(function(e,n,T){var h=e-49;h>=0&&T&1&&(r.writeRegister(14,h),r.writeRegister(15,128),t.setIFF1(1),t.requestInterrupt(56))}),s=new C(60,()=>{if(!!this.isRunning()){var e=this.getDebugCallback(),n=t.getTstates()+D;if(e)for(;t.getTstates()<n;)e&&e()&&(e=null),t.runFrame(t.getTstates()+1);else t.runFrame(n)}})},this.loadROM=function(e,n){o=P(n,16384),t.reset()},this.loadState=function(e){t.loadState(e.c),i.mem.set(e.b)},this.saveState=function(){return{c:this.getCPUState(),b:i.mem.slice(0)}},this.getCPUState=function(){return t.saveState()},this.isRunning=function(){return s&&s.isRunning()},this.pause=function(){s.stop()},this.resume=function(){s.start(),u.activate()},this.reset=function(){t.reset(),this.getDebugCallback()||t.setTstates(0)}};v.sound_konami=A;
|
||||
//# sourceMappingURL=sound_konami-CMUW4JA2.js.map
|
@ -1,2 +1,2 @@
|
||||
import{J as m,c as n,p as o}from"./chunk-ULPRULB6.js";import{J as i,aa as s}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var d=[{id:"swave.c",name:"Wavetable Synth"}],c=class extends o{constructor(){super();this.cpuFrequency=18432e3/6;this.cpuCyclesPerFrame=this.cpuFrequency/60;this.cpuAudioFactor=32;this.canvasWidth=256;this.numVisibleScanlines=256;this.defaultROMSize=16384;this.sampleRate=this.cpuFrequency;this.overscan=!0;this.ram=new Uint8Array(1024);this.command=0;this.dac=0;this.dac_float=0;this.xpos=0;this.read=s([[0,16383,16383,e=>this.rom&&this.rom[e]],[16384,32767,1023,e=>this.ram[e]]]);this.write=s([[16384,32767,1023,(e,t)=>{this.ram[e]=t}]]);this.cpu=new n,this.connectCPUMemoryBus(this),this.connectCPUIOBus({read:e=>this.command&255,write:(e,t)=>{let r=this.dac=t&255;this.dac_float=(r&128?-256+r:r)/128}})}advanceFrame(e){this.pixels&&this.pixels.fill(0);let t=this.cpuCyclesPerFrame;for(var r=0;r<t&&!(e&&e());)r+=this.advanceCPU();return r}advanceCPU(){var e=super.advanceCPU();return this.audio&&this.audio.feedSample(this.dac_float,e),this.pixels&&!this.cpu.isHalted()&&(this.pixels[(this.xpos>>8&255)+(255-this.dac<<8)]=4281597747,this.xpos=this.xpos+e&16777215),e}setKeyInput(e,t,r){var a=e-49;a>=0&&r&1&&(this.command=a&255,this.cpu.reset())}},f=class extends m{newMachine(){return new c}getPresets(){return d}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}};i["sound_williams-z80"]=f;export{f as WilliamsSoundPlatform};
|
||||
//# sourceMappingURL=sound_williams-XXEIJ7OI.js.map
|
||||
import{J as m,c as n,p as o}from"./chunk-ARTNMEGN.js";import{J as i,aa as s}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var d=[{id:"swave.c",name:"Wavetable Synth"}],c=class extends o{constructor(){super();this.cpuFrequency=18432e3/6;this.cpuCyclesPerFrame=this.cpuFrequency/60;this.cpuAudioFactor=32;this.canvasWidth=256;this.numVisibleScanlines=256;this.defaultROMSize=16384;this.sampleRate=this.cpuFrequency;this.overscan=!0;this.ram=new Uint8Array(1024);this.command=0;this.dac=0;this.dac_float=0;this.xpos=0;this.read=s([[0,16383,16383,e=>this.rom&&this.rom[e]],[16384,32767,1023,e=>this.ram[e]]]);this.write=s([[16384,32767,1023,(e,t)=>{this.ram[e]=t}]]);this.cpu=new n,this.connectCPUMemoryBus(this),this.connectCPUIOBus({read:e=>this.command&255,write:(e,t)=>{let r=this.dac=t&255;this.dac_float=(r&128?-256+r:r)/128}})}advanceFrame(e){this.pixels&&this.pixels.fill(0);let t=this.cpuCyclesPerFrame;for(var r=0;r<t&&!(e&&e());)r+=this.advanceCPU();return r}advanceCPU(){var e=super.advanceCPU();return this.audio&&this.audio.feedSample(this.dac_float,e),this.pixels&&!this.cpu.isHalted()&&(this.pixels[(this.xpos>>8&255)+(255-this.dac<<8)]=4281597747,this.xpos=this.xpos+e&16777215),e}setKeyInput(e,t,r){var a=e-49;a>=0&&r&1&&(this.command=a&255,this.cpu.reset())}},f=class extends m{newMachine(){return new c}getPresets(){return d}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}};i["sound_williams-z80"]=f;export{f as WilliamsSoundPlatform};
|
||||
//# sourceMappingURL=sound_williams-25HNN4CW.js.map
|
@ -41,6 +41,9 @@ async function loadDASM() {
|
||||
async function loadCC7800() {
|
||||
return loadWASM('cc7800');
|
||||
}
|
||||
async function loadOscar64() {
|
||||
return loadWASM('oscar64');
|
||||
}
|
||||
describe('test WASI DASM', function () {
|
||||
it('dasm help', async function () {
|
||||
let shim = await loadDASM();
|
||||
@ -101,4 +104,25 @@ describe('test WASI cc7800', function () {
|
||||
assert_1.default.ok(stdout.indexOf('Usage: cc7800') >= 0);
|
||||
});
|
||||
});
|
||||
/*
|
||||
describe('test WASI oscar64', function () {
|
||||
it('oscar64 compile', async function () {
|
||||
let shim = await loadOscar64();
|
||||
const zipdata = fs.readFileSync(`./src/worker/fs/oscar64-fs.zip`);
|
||||
shim.fs = await unzipWASIFilesystem(zipdata, "/root/");
|
||||
shim.addPreopenDirectory("/root");
|
||||
shim.fs.putSymbolicLink("/proc/self/exe", "/root/bin/oscar64");
|
||||
shim.fs.putFile("/root/main.c", "#include <stdio.h>\nint main() { return 0; }");
|
||||
shim.setArgs(["oscar64", '-v', '-o=foo.prg', 'main.c']);
|
||||
let errno = shim.run();
|
||||
const stdout = shim.fds[1].getBytesAsString();
|
||||
console.log(stdout);
|
||||
const stderr = shim.fds[2].getBytesAsString();
|
||||
console.log(stderr);
|
||||
assert.strictEqual(errno, 0);
|
||||
assert.ok(stdout.indexOf('Starting oscar64') >= 0);
|
||||
console.log(shim.fs.getFile("./foo.asm").getBytesAsString());
|
||||
});
|
||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AE,CAAC,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,gBAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;EAoBE"}
|
@ -1 +1 @@
|
||||
{"root":["../src/common/analysis.ts","../src/common/audio.ts","../src/common/baseplatform.ts","../src/common/binutils.ts","../src/common/devices.ts","../src/common/emu.ts","../src/common/mameplatform.ts","../src/common/probe.ts","../src/common/recorder.ts","../src/common/teletype.ts","../src/common/tokenizer.ts","../src/common/util.ts","../src/common/vlist.ts","../src/common/wasmplatform.ts","../src/common/workertypes.ts","../src/common/audio/CommodoreTape.ts","../src/common/basic/compiler.ts","../src/common/basic/fuzz.ts","../src/common/basic/run.ts","../src/common/basic/runtime.ts","../src/common/cpu/6809.ts","../src/common/cpu/ARM.ts","../src/common/cpu/MOS6502.ts","../src/common/cpu/ZilogZ80.ts","../src/common/cpu/disasm6502.ts","../src/common/cpu/disasmHuC6280.ts","../src/common/cpu/disasmz80.ts","../src/common/ecs/binpack.ts","../src/common/ecs/compiler.ts","../src/common/ecs/decoder.ts","../src/common/ecs/ecs.ts","../src/common/ecs/main.ts","../src/common/hdl/fuzz.ts","../src/common/hdl/hdlruntime.ts","../src/common/hdl/hdltypes.ts","../src/common/hdl/hdlwasm.ts","../src/common/hdl/vxmlparser.ts","../src/common/hdl/vxmltest.ts","../src/common/video/tms9918a.ts","../src/common/wasi/libretro.ts","../src/common/wasi/wasishim.ts","../src/ide/analytics.ts","../src/ide/dialogs.ts","../src/ide/embedui.ts","../src/ide/pixeleditor.ts","../src/ide/project.ts","../src/ide/services.ts","../src/ide/shareexport.ts","../src/ide/sync.ts","../src/ide/toolbar.ts","../src/ide/ui.ts","../src/ide/waveform.ts","../src/ide/windows.ts","../src/ide/views/asseteditor.ts","../src/ide/views/baseviews.ts","../src/ide/views/debugviews.ts","../src/ide/views/editors.ts","../src/ide/views/traceviews.ts","../src/ide/views/treeviews.ts","../src/machine/apple2.ts","../src/machine/arm32.ts","../src/machine/astrocade.ts","../src/machine/atari7800.ts","../src/machine/atari8.ts","../src/machine/c64.ts","../src/machine/coleco.ts","../src/machine/cpc.ts","../src/machine/devel.ts","../src/machine/exidy.ts","../src/machine/galaxian.ts","../src/machine/kim1.ts","../src/machine/msx.ts","../src/machine/mw8080bw.ts","../src/machine/sms.ts","../src/machine/vdp_z80.ts","../src/machine/vic20.ts","../src/machine/vicdual.ts","../src/machine/williams.ts","../src/machine/zx.ts","../src/machine/chips/antic.ts","../src/machine/chips/gtia.ts","../src/machine/chips/pokey.ts","../src/platform/_index.ts","../src/platform/apple2.ts","../src/platform/arm32.ts","../src/platform/astrocade.ts","../src/platform/atari7800.ts","../src/platform/atari8.ts","../src/platform/basic.ts","../src/platform/c64.ts","../src/platform/coleco.ts","../src/platform/cpc.ts","../src/platform/devel.ts","../src/platform/exidy.ts","../src/platform/galaxian.ts","../src/platform/kim1.ts","../src/platform/markdown.ts","../src/platform/msx.ts","../src/platform/mw8080bw.ts","../src/platform/nes.ts","../src/platform/pce.ts","../src/platform/sms.ts","../src/platform/sound_konami.ts","../src/platform/sound_williams.ts","../src/platform/vcs.ts","../src/platform/vector.ts","../src/platform/vectrex.ts","../src/platform/verilog.ts","../src/platform/vic20.ts","../src/platform/vicdual.ts","../src/platform/williams.ts","../src/platform/x86.ts","../src/platform/zmachine.ts","../src/platform/zx.ts","../src/test/testanalysis.ts","../src/test/testecs.ts","../src/test/testelfparser.ts","../src/test/testlibretro.ts","../src/test/testutil.ts","../src/test/testwasishim.ts","../src/tools/runmachine.ts","../src/tools/sim6502.ts","../src/worker/assembler.ts","../src/worker/builder.ts","../src/worker/listingutils.ts","../src/worker/platforms.ts","../src/worker/wasiutils.ts","../src/worker/wasmutils.ts","../src/worker/workermain.ts","../src/worker/workertools.ts","../src/worker/server/buildenv.ts","../src/worker/server/clang.ts","../src/worker/server/server.ts","../src/worker/tools/acme.ts","../src/worker/tools/arm.ts","../src/worker/tools/bataribasic.ts","../src/worker/tools/cc65.ts","../src/worker/tools/cc7800.ts","../src/worker/tools/dasm.ts","../src/worker/tools/ecs.ts","../src/worker/tools/m6502.ts","../src/worker/tools/m6809.ts","../src/worker/tools/mcpp.ts","../src/worker/tools/misc.ts","../src/worker/tools/remote.ts","../src/worker/tools/sdcc.ts","../src/worker/tools/verilog.ts","../src/worker/tools/x86.ts","../src/worker/tools/z80.ts"],"version":"5.6.2"}
|
||||
{"root":["../src/common/analysis.ts","../src/common/audio.ts","../src/common/baseplatform.ts","../src/common/binutils.ts","../src/common/devices.ts","../src/common/emu.ts","../src/common/mameplatform.ts","../src/common/probe.ts","../src/common/recorder.ts","../src/common/teletype.ts","../src/common/tokenizer.ts","../src/common/util.ts","../src/common/vlist.ts","../src/common/wasmplatform.ts","../src/common/workertypes.ts","../src/common/audio/CommodoreTape.ts","../src/common/basic/compiler.ts","../src/common/basic/fuzz.ts","../src/common/basic/run.ts","../src/common/basic/runtime.ts","../src/common/cpu/6809.ts","../src/common/cpu/ARM.ts","../src/common/cpu/MOS6502.ts","../src/common/cpu/ZilogZ80.ts","../src/common/cpu/disasm6502.ts","../src/common/cpu/disasmHuC6280.ts","../src/common/cpu/disasmz80.ts","../src/common/ecs/binpack.ts","../src/common/ecs/compiler.ts","../src/common/ecs/decoder.ts","../src/common/ecs/ecs.ts","../src/common/ecs/main.ts","../src/common/hdl/fuzz.ts","../src/common/hdl/hdlruntime.ts","../src/common/hdl/hdltypes.ts","../src/common/hdl/hdlwasm.ts","../src/common/hdl/vxmlparser.ts","../src/common/hdl/vxmltest.ts","../src/common/video/tms9918a.ts","../src/common/wasi/libretro.ts","../src/common/wasi/wasishim.ts","../src/ide/analytics.ts","../src/ide/dialogs.ts","../src/ide/embedui.ts","../src/ide/pixeleditor.ts","../src/ide/project.ts","../src/ide/services.ts","../src/ide/shareexport.ts","../src/ide/sync.ts","../src/ide/toolbar.ts","../src/ide/ui.ts","../src/ide/waveform.ts","../src/ide/windows.ts","../src/ide/views/asseteditor.ts","../src/ide/views/baseviews.ts","../src/ide/views/debugviews.ts","../src/ide/views/editors.ts","../src/ide/views/traceviews.ts","../src/ide/views/treeviews.ts","../src/machine/apple2.ts","../src/machine/arm32.ts","../src/machine/astrocade.ts","../src/machine/atari7800.ts","../src/machine/atari8.ts","../src/machine/c64.ts","../src/machine/coleco.ts","../src/machine/cpc.ts","../src/machine/devel.ts","../src/machine/exidy.ts","../src/machine/galaxian.ts","../src/machine/kim1.ts","../src/machine/msx.ts","../src/machine/mw8080bw.ts","../src/machine/sms.ts","../src/machine/vdp_z80.ts","../src/machine/vic20.ts","../src/machine/vicdual.ts","../src/machine/williams.ts","../src/machine/zx.ts","../src/machine/chips/antic.ts","../src/machine/chips/gtia.ts","../src/machine/chips/pokey.ts","../src/platform/_index.ts","../src/platform/apple2.ts","../src/platform/arm32.ts","../src/platform/astrocade.ts","../src/platform/atari7800.ts","../src/platform/atari8.ts","../src/platform/basic.ts","../src/platform/c64.ts","../src/platform/coleco.ts","../src/platform/cpc.ts","../src/platform/devel.ts","../src/platform/exidy.ts","../src/platform/galaxian.ts","../src/platform/kim1.ts","../src/platform/markdown.ts","../src/platform/msx.ts","../src/platform/mw8080bw.ts","../src/platform/nes.ts","../src/platform/pce.ts","../src/platform/sms.ts","../src/platform/sound_konami.ts","../src/platform/sound_williams.ts","../src/platform/vcs.ts","../src/platform/vector.ts","../src/platform/vectrex.ts","../src/platform/verilog.ts","../src/platform/vic20.ts","../src/platform/vicdual.ts","../src/platform/williams.ts","../src/platform/x86.ts","../src/platform/zmachine.ts","../src/platform/zx.ts","../src/test/testanalysis.ts","../src/test/testecs.ts","../src/test/testelfparser.ts","../src/test/testlibretro.ts","../src/test/testutil.ts","../src/test/testwasishim.ts","../src/tools/runmachine.ts","../src/tools/sim6502.ts","../src/worker/assembler.ts","../src/worker/builder.ts","../src/worker/listingutils.ts","../src/worker/platforms.ts","../src/worker/wasiutils.ts","../src/worker/wasmutils.ts","../src/worker/workermain.ts","../src/worker/workertools.ts","../src/worker/server/buildenv.ts","../src/worker/server/clang.ts","../src/worker/server/server.ts","../src/worker/tools/acme.ts","../src/worker/tools/arm.ts","../src/worker/tools/bataribasic.ts","../src/worker/tools/cc65.ts","../src/worker/tools/cc7800.ts","../src/worker/tools/dasm.ts","../src/worker/tools/ecs.ts","../src/worker/tools/m6502.ts","../src/worker/tools/m6809.ts","../src/worker/tools/mcpp.ts","../src/worker/tools/misc.ts","../src/worker/tools/oscar64.ts","../src/worker/tools/remote.ts","../src/worker/tools/sdcc.ts","../src/worker/tools/verilog.ts","../src/worker/tools/x86.ts","../src/worker/tools/z80.ts"],"version":"5.6.3"}
|
@ -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-AJJ3WM3A.js";import"./chunk-XWTSBLAW.js";import"./chunk-B2GOFULO.js";import"./chunk-BADKNP7O.js";import"./chunk-ULPRULB6.js";import"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.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-Q5ACPWUW.js";import"./chunk-XWTSBLAW.js";import"./chunk-B2GOFULO.js";import"./chunk-MPSJCPTJ.js";import"./chunk-ARTNMEGN.js";import"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.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
|
||||
|
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
@ -1,2 +1,2 @@
|
||||
import{J as A,c as d,d as y,e as S,k as v,q as g}from"./chunk-ULPRULB6.js";import{J as p,W as t,X as u,Z as h,aa as r}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var L=h([[t.A,2,-32],[t.B,2,-64],[t.LEFT,1,-16],[t.RIGHT,1,-32],[t.UP,1,-64],[t.DOWN,1,-128],[t.START,2,-16],[t.P2_START,3,-32],[t.SELECT,3,8]]),o=15468e3,w=262,K=224;var I=240,b=o/8,M=o/3/w,j=M/328,U=b/M,V=500,Z=b/(2*V),P=2,_=60*w,c=class extends g{constructor(){super();this.cpuFrequency=o/8;this.canvasWidth=256;this.numTotalScanlines=262;this.numVisibleScanlines=224;this.defaultROMSize=16448;this.sampleRate=_*P;this.cpuCyclesPerLine=U|0;this.rotate=-90;this.cpu=new d;this.ram=new Uint8Array(4096);this.read=r([[0,32767,16383,e=>this.rom?this.rom[e]:null],[32768,65535,4095,e=>this.ram[e]]]);this.write=r([[32768,65535,4095,(e,s)=>{this.ram[e]=s}]]);this.connectCPUMemoryBus(this),this.connectCPUIOBus(this.newIOBus()),this.inputs.set([255,255,255,255^8]),this.display=new T,this.handler=u(this.inputs,L,this.getKeyboardFunction()),this.psg=new S(new y),this.audioadapter=new v(this.psg.psg,P,this.sampleRate)}getKeyboardFunction(){return e=>{e.index==3&&e.mask==8&&(this.cpu.reset(),console.log("coin inserted"),console.log(this.inputs))}}newIOBus(){return{read:e=>this.inputs[e&3],write:(e,s)=>{e&1&&this.psg.selectRegister(s&15),e&2&&this.psg.setData(s),e&8,e&64&&(this.display.palbank=s&3)}}}reset(){super.reset(),this.psg.reset()}startScanline(){this.inputs[2]&=~8,this.inputs[2]|=(this.frameCycles/Z&1)<<3,this.scanline==K&&(this.inputs[1]|=8),this.scanline==I&&(this.inputs[1]&=~8),this.audio&&this.audioadapter.generate(this.audio)}drawScanline(){this.display.drawScanline(this.ram,this.pixels,this.scanline)}loadROM(e){super.loadROM(e),e.length>=16416&&(e[16384]||e[16415])&&(this.display.colorprom=e.slice(16384,16416))}loadState(e){super.loadState(e),this.display.palbank=e.pb}saveState(){var e=super.saveState();return e.pb=this.display.palbank,e}},T=class{constructor(){this.palbank=0;this.palette=[4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295];this.colorprom=[224,96,32,96,192,96,64,192,32,64,96,128,160,192,224,14,224,224,224,224,96,96,96,96,224,224,224,224,224,224,224,224]}drawScanline(e,s,i){if(!(i>=224))for(var k=i*256,x=k,F=i>>3<<5,C=i&7,a=0;a<32;a++)for(var l=e[F+a],D=e[2048+(l<<3)+C],m=(l>>5)+(this.palbank<<3),E=this.palette[this.colorprom[m]>>1&7],O=this.palette[this.colorprom[m]>>5&7],n=0;n<8;n++){var B=128>>n;s[x]=D&B?O:E,x++}}};var q=[{id:"minimal.c",name:"Minimal Example"},{id:"hello.c",name:"Hello World"},{id:"gfxtest.c",name:"Graphics Test"},{id:"soundtest.c",name:"Sound Test"},{id:"snake1.c",name:"Siege Game (Prototype)"},{id:"snake2.c",name:"Siege Game (Full)"},{id:"music.c",name:"Music Player"}],R=class extends A{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"Cell RAM",start:57344,size:32*32,type:"ram"},{name:"Tile RAM",start:59392,size:256*8,type:"ram"}]}}}newMachine(){return new c}getPresets(){return q}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}showHelp(){return"https://8bitworkshop.com/docs/platforms/arcade/index.html#vic-dual"}};p.vicdual=R;
|
||||
//# sourceMappingURL=vicdual-JMP5TCAX.js.map
|
||||
import{J as A,c as d,d as y,e as S,k as v,q as g}from"./chunk-ARTNMEGN.js";import{J as p,W as t,X as u,Z as h,aa as r}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var L=h([[t.A,2,-32],[t.B,2,-64],[t.LEFT,1,-16],[t.RIGHT,1,-32],[t.UP,1,-64],[t.DOWN,1,-128],[t.START,2,-16],[t.P2_START,3,-32],[t.SELECT,3,8]]),o=15468e3,w=262,K=224;var I=240,b=o/8,M=o/3/w,j=M/328,U=b/M,V=500,Z=b/(2*V),P=2,_=60*w,c=class extends g{constructor(){super();this.cpuFrequency=o/8;this.canvasWidth=256;this.numTotalScanlines=262;this.numVisibleScanlines=224;this.defaultROMSize=16448;this.sampleRate=_*P;this.cpuCyclesPerLine=U|0;this.rotate=-90;this.cpu=new d;this.ram=new Uint8Array(4096);this.read=r([[0,32767,16383,e=>this.rom?this.rom[e]:null],[32768,65535,4095,e=>this.ram[e]]]);this.write=r([[32768,65535,4095,(e,s)=>{this.ram[e]=s}]]);this.connectCPUMemoryBus(this),this.connectCPUIOBus(this.newIOBus()),this.inputs.set([255,255,255,255^8]),this.display=new T,this.handler=u(this.inputs,L,this.getKeyboardFunction()),this.psg=new S(new y),this.audioadapter=new v(this.psg.psg,P,this.sampleRate)}getKeyboardFunction(){return e=>{e.index==3&&e.mask==8&&(this.cpu.reset(),console.log("coin inserted"),console.log(this.inputs))}}newIOBus(){return{read:e=>this.inputs[e&3],write:(e,s)=>{e&1&&this.psg.selectRegister(s&15),e&2&&this.psg.setData(s),e&8,e&64&&(this.display.palbank=s&3)}}}reset(){super.reset(),this.psg.reset()}startScanline(){this.inputs[2]&=~8,this.inputs[2]|=(this.frameCycles/Z&1)<<3,this.scanline==K&&(this.inputs[1]|=8),this.scanline==I&&(this.inputs[1]&=~8),this.audio&&this.audioadapter.generate(this.audio)}drawScanline(){this.display.drawScanline(this.ram,this.pixels,this.scanline)}loadROM(e){super.loadROM(e),e.length>=16416&&(e[16384]||e[16415])&&(this.display.colorprom=e.slice(16384,16416))}loadState(e){super.loadState(e),this.display.palbank=e.pb}saveState(){var e=super.saveState();return e.pb=this.display.palbank,e}},T=class{constructor(){this.palbank=0;this.palette=[4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295];this.colorprom=[224,96,32,96,192,96,64,192,32,64,96,128,160,192,224,14,224,224,224,224,96,96,96,96,224,224,224,224,224,224,224,224]}drawScanline(e,s,i){if(!(i>=224))for(var k=i*256,x=k,F=i>>3<<5,C=i&7,a=0;a<32;a++)for(var l=e[F+a],D=e[2048+(l<<3)+C],m=(l>>5)+(this.palbank<<3),E=this.palette[this.colorprom[m]>>1&7],O=this.palette[this.colorprom[m]>>5&7],n=0;n<8;n++){var B=128>>n;s[x]=D&B?O:E,x++}}};var q=[{id:"minimal.c",name:"Minimal Example"},{id:"hello.c",name:"Hello World"},{id:"gfxtest.c",name:"Graphics Test"},{id:"soundtest.c",name:"Sound Test"},{id:"snake1.c",name:"Siege Game (Prototype)"},{id:"snake2.c",name:"Siege Game (Full)"},{id:"music.c",name:"Music Player"}],R=class extends A{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"Cell RAM",start:57344,size:32*32,type:"ram"},{name:"Tile RAM",start:59392,size:256*8,type:"ram"}]}}}newMachine(){return new c}getPresets(){return q}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}showHelp(){return"https://8bitworkshop.com/docs/platforms/arcade/index.html#vic-dual"}};p.vicdual=R;
|
||||
//# sourceMappingURL=vicdual-MATTGYOM.js.map
|
File diff suppressed because one or more lines are too long
@ -6920,6 +6920,15 @@
|
||||
this.files.set(name, file);
|
||||
return file;
|
||||
}
|
||||
putSymbolicLink(name, target, rights) {
|
||||
if (!rights)
|
||||
rights = 16777216;
|
||||
const file = new WASIFileDescriptor(name, 7, rights);
|
||||
file.write(new TextEncoder().encode(target));
|
||||
file.offset = 0;
|
||||
this.files.set(name, file);
|
||||
return file;
|
||||
}
|
||||
getFile(name) {
|
||||
var _a;
|
||||
let file = this.files.get(name);
|
||||
@ -7088,6 +7097,7 @@
|
||||
const bytes = enc.encode(str);
|
||||
const len = Math.min(bytes.length, maxlen);
|
||||
this.mem8().set(bytes.subarray(0, len), ptr);
|
||||
return len;
|
||||
}
|
||||
peekUTF8(ptr, maxlen) {
|
||||
const bytes = this.mem8().subarray(ptr, ptr + maxlen);
|
||||
@ -7249,9 +7259,9 @@
|
||||
if (dir.type !== 3)
|
||||
return 54;
|
||||
const filename = this.peekUTF8(path_ptr, path_len);
|
||||
const path = dir.name + "/" + filename;
|
||||
const path = filename.startsWith("/") ? filename : dir.name + "/" + filename;
|
||||
const fd = this.fs.getFile(path);
|
||||
console.log("path_filestat_get", dir + "", path, filestat_ptr, "->", fd + "");
|
||||
console.log("path_filestat_get", dir + "", filename, path, filestat_ptr, "->", fd + "");
|
||||
if (!fd)
|
||||
return 44;
|
||||
this.poke64(filestat_ptr, fd.fdindex);
|
||||
@ -7263,6 +7273,50 @@
|
||||
this.poke64(filestat_ptr + 48, 0);
|
||||
this.poke64(filestat_ptr + 56, 0);
|
||||
}
|
||||
path_readlink(dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr) {
|
||||
const dir = this.fds[dirfd];
|
||||
debug("path_readlink", dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr, dir + "");
|
||||
if (dir == null)
|
||||
return 8;
|
||||
if (dir.type !== 3)
|
||||
return 54;
|
||||
const filename = this.peekUTF8(path_ptr, path_len);
|
||||
const path = dir.name + "/" + filename;
|
||||
const fd = this.fs.getFile(path);
|
||||
debug("path_readlink", path, fd + "");
|
||||
if (!fd)
|
||||
return 44;
|
||||
if (fd.type !== 7)
|
||||
return 28;
|
||||
const target = fd.getBytesAsString();
|
||||
const len = this.pokeUTF8(target, buf_ptr, buf_len);
|
||||
this.poke32(buf_used_ptr, len);
|
||||
debug("path_readlink", path, "->", target);
|
||||
return 0;
|
||||
}
|
||||
path_readlinkat(dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr) {
|
||||
return this.path_readlink(dirfd, path_ptr, path_len, buf_ptr, buf_len, buf_used_ptr);
|
||||
}
|
||||
path_unlink_file(dirfd, path_ptr, path_len) {
|
||||
const dir = this.fds[dirfd];
|
||||
if (dir == null)
|
||||
return 8;
|
||||
if (dir.type !== 3)
|
||||
return 54;
|
||||
const filename = this.peekUTF8(path_ptr, path_len);
|
||||
const path = dir.name + "/" + filename;
|
||||
const fd = this.fs.getFile(path);
|
||||
debug("path_unlink_file", dir + "", path, fd + "");
|
||||
if (!fd)
|
||||
return 44;
|
||||
this.fs.getFile(path);
|
||||
return 0;
|
||||
}
|
||||
clock_time_get(clock_id, precision, time_ptr) {
|
||||
const time = Date.now();
|
||||
this.poke64(time_ptr, time);
|
||||
return 0;
|
||||
}
|
||||
getWASISnapshotPreview1() {
|
||||
return {
|
||||
args_sizes_get: this.args_sizes_get.bind(this),
|
||||
@ -7280,6 +7334,9 @@
|
||||
fd_close: this.fd_close.bind(this),
|
||||
path_filestat_get: this.path_filestat_get.bind(this),
|
||||
random_get: this.random_get.bind(this),
|
||||
path_readlink: this.path_readlink.bind(this),
|
||||
path_unlink_file: this.path_unlink_file.bind(this),
|
||||
clock_time_get: this.clock_time_get.bind(this),
|
||||
fd_fdstat_set_flags() {
|
||||
warning("TODO: fd_fdstat_set_flags");
|
||||
return 58;
|
||||
@ -7288,17 +7345,13 @@
|
||||
warning("TODO: fd_readdir");
|
||||
return 58;
|
||||
},
|
||||
path_unlink_file() {
|
||||
warning("TODO: path_unlink_file");
|
||||
return 58;
|
||||
},
|
||||
clock_time_get() {
|
||||
warning("TODO: clock_time_get");
|
||||
return 58;
|
||||
},
|
||||
fd_tell() {
|
||||
warning("TODO: fd_tell");
|
||||
return 58;
|
||||
},
|
||||
path_remove_directory() {
|
||||
warning("TODO: path_remove_directory");
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -7307,6 +7360,19 @@
|
||||
__syscall_unlinkat() {
|
||||
warning("TODO: unlink");
|
||||
return 58;
|
||||
},
|
||||
__syscall_faccessat() {
|
||||
warning("TODO: faccessat");
|
||||
return 58;
|
||||
},
|
||||
__syscall_readlinkat: this.path_readlinkat.bind(this),
|
||||
__syscall_getcwd() {
|
||||
warning("TODO: getcwd");
|
||||
return 58;
|
||||
},
|
||||
__syscall_rmdir() {
|
||||
warning("TODO: rmdir");
|
||||
return 58;
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -10890,11 +10956,8 @@
|
||||
xhr.send(null);
|
||||
return xhr.response;
|
||||
}
|
||||
async function loadWASIFilesystemZip(zippath) {
|
||||
async function unzipWASIFilesystem(zipdata, rootPath = "./") {
|
||||
const jszip = new import_jszip.default();
|
||||
const path = "../../src/worker/fs/" + zippath;
|
||||
const zipdata = loadBlobSync(path);
|
||||
console.log(zippath, zipdata);
|
||||
await jszip.loadAsync(zipdata);
|
||||
let fs = new WASIMemoryFilesystem();
|
||||
let promises = [];
|
||||
@ -10902,9 +10965,9 @@
|
||||
if (zipEntry.dir) {
|
||||
fs.putDirectory(relativePath);
|
||||
} else {
|
||||
let path2 = "./" + relativePath;
|
||||
let path = rootPath + relativePath;
|
||||
let prom = zipEntry.async("uint8array").then((data) => {
|
||||
fs.putFile(path2, data);
|
||||
fs.putFile(path, data);
|
||||
});
|
||||
promises.push(prom);
|
||||
}
|
||||
@ -10912,6 +10975,13 @@
|
||||
await Promise.all(promises);
|
||||
return fs;
|
||||
}
|
||||
async function loadWASIFilesystemZip(zippath, rootPath = "./") {
|
||||
const jszip = new import_jszip.default();
|
||||
const path = "../../src/worker/fs/" + zippath;
|
||||
const zipdata = loadBlobSync(path);
|
||||
console.log(zippath, zipdata);
|
||||
return unzipWASIFilesystem(zipdata, rootPath);
|
||||
}
|
||||
|
||||
// src/worker/tools/arm.ts
|
||||
function assembleARMIPS(step) {
|
||||
@ -14421,7 +14491,7 @@ ${this.scopeSymbol(name)} = ${name}::__Start`;
|
||||
for (var i = 0; i < step.files.length; i++) {
|
||||
let path = step.files[i];
|
||||
let entry = store.workfs[path];
|
||||
let data = typeof entry.data === "string" ? entry.data : btoa(byteArrayToString(entry.data));
|
||||
let data = typeof entry.data === "string" ? entry.data : "data:base64," + btoa(byteArrayToString(entry.data));
|
||||
updates.push({ path, data });
|
||||
}
|
||||
let cmd = { buildStep: step, updates, sessionID };
|
||||
@ -14679,6 +14749,55 @@ ${this.scopeSymbol(name)} = ${name}::__Start`;
|
||||
};
|
||||
}
|
||||
|
||||
// src/worker/tools/oscar64.ts
|
||||
var oscar64_fs = null;
|
||||
var wasiModule2 = null;
|
||||
async function compileOscar64(step) {
|
||||
const errors = [];
|
||||
const rootDir = "/root/";
|
||||
gatherFiles(step, { mainFilePath: "main.c" });
|
||||
const destpath = (step.path || "main.c").replace(/\.[^.]+$/, ".prg");
|
||||
console.log("destpath", destpath);
|
||||
if (staleFiles(step, [destpath])) {
|
||||
if (!oscar64_fs) {
|
||||
oscar64_fs = await loadWASIFilesystemZip("oscar64-fs.zip", "/root/");
|
||||
}
|
||||
if (!wasiModule2) {
|
||||
wasiModule2 = new WebAssembly.Module(loadWASMBinary("oscar64"));
|
||||
}
|
||||
const wasi = new WASIRunner();
|
||||
wasi.initSync(wasiModule2);
|
||||
wasi.fs.setParent(oscar64_fs);
|
||||
for (let file of step.files) {
|
||||
wasi.fs.putFile(rootDir + file, store.getFileData(file));
|
||||
}
|
||||
wasi.addPreopenDirectory("/root");
|
||||
wasi.setArgs(["oscar64", "-v", "-g", "-i=/root", step.path]);
|
||||
try {
|
||||
wasi.run();
|
||||
} catch (e) {
|
||||
errors.push(e);
|
||||
}
|
||||
let stdout = wasi.fds[1].getBytesAsString();
|
||||
let stderr = wasi.fds[2].getBytesAsString();
|
||||
console.log("stdout", stdout);
|
||||
console.log("stderr", stderr);
|
||||
const matcher = makeErrorMatcher(errors, /\((\d+),\s+(\d+)\)\s+: error (\d+): (.+)/, 1, 4, step.path);
|
||||
for (let line of stderr.split("\n")) {
|
||||
matcher(line);
|
||||
}
|
||||
if (errors.length) {
|
||||
return { errors };
|
||||
}
|
||||
const output = wasi.fs.getFile(destpath).getBytes();
|
||||
putWorkFile(destpath, output);
|
||||
return {
|
||||
output,
|
||||
errors
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// src/worker/workertools.ts
|
||||
var TOOLS = {
|
||||
"dasm": assembleDASM,
|
||||
@ -14714,7 +14833,8 @@ ${this.scopeSymbol(name)} = ${name}::__Start`;
|
||||
"remote": buildRemote,
|
||||
"cc7800": compileCC7800,
|
||||
"armtcc": compileARMTCC,
|
||||
"armtcclink": linkARMTCC
|
||||
"armtcclink": linkARMTCC,
|
||||
"oscar64": compileOscar64
|
||||
};
|
||||
var TOOL_PRELOADFS = {
|
||||
"cc65-apple2": "65-apple2",
|
||||
|
File diff suppressed because one or more lines are too long
@ -18,6 +18,8 @@ const LLVM_MOS_TOOL = {
|
||||
extensions: ['.c', '.cpp', '.s', '.S', '.C'],
|
||||
archs: ['6502'],
|
||||
platforms: ['atari8', 'c64', 'nes', 'pce', 'vcs'],
|
||||
processOutput: basicProcessOutput,
|
||||
processErrors: llvmMosProcessErrors,
|
||||
platform_configs: {
|
||||
default: {
|
||||
binpath: 'llvm-mos/bin',
|
||||
@ -47,6 +49,124 @@ const LLVM_MOS_TOOL = {
|
||||
},
|
||||
}
|
||||
};
|
||||
async function basicProcessOutput(step, outfile) {
|
||||
let output = await fs_1.default.promises.readFile(outfile, { encoding: 'base64' });
|
||||
return { output };
|
||||
}
|
||||
async function llvmMosProcessErrors(step, errorData) {
|
||||
errorData = errorData.replace(/(\/var\/folders\/.+?\/).+?:/g, ''); // TODO?
|
||||
let errors = [];
|
||||
// split errorData into lines
|
||||
let errorMatcher = (0, listingutils_1.makeErrorMatcher)(errors, /([^:/]+):(\d+):(\d+):\s*(.+)/, 2, 4, step.path, 1);
|
||||
for (let line of errorData.split('\n')) {
|
||||
errorMatcher(line);
|
||||
}
|
||||
return { errors };
|
||||
}
|
||||
const OSCAR64_TOOL = {
|
||||
name: 'oscar64',
|
||||
version: '',
|
||||
extensions: ['.c', '.cc', '.cpp'],
|
||||
archs: ['6502'],
|
||||
platforms: ['atari8', 'c64', 'nes'],
|
||||
processOutput: oscar64ProcessOutput,
|
||||
processErrors: oscar64ProcessErrors,
|
||||
platform_configs: {
|
||||
default: {
|
||||
binpath: 'oscar64/bin',
|
||||
command: 'oscar64',
|
||||
args: ['-Os', '-g', '-d__8BITWORKSHOP__', '-o=$OUTFILE', '$INFILES'],
|
||||
},
|
||||
c64: {
|
||||
outfile: 'a.prg',
|
||||
}
|
||||
}
|
||||
};
|
||||
async function oscar64ProcessErrors(step, errorData) {
|
||||
let errors = [];
|
||||
// split errorData into lines
|
||||
let errorMatcher = (0, listingutils_1.makeErrorMatcher)(errors, /\/([^(]+)\((\d+), (\d+)\) : \s*(.+)/, 2, 4, step.path, 1);
|
||||
for (let line of errorData.split('\n')) {
|
||||
errorMatcher(line);
|
||||
}
|
||||
return { errors };
|
||||
}
|
||||
async function oscar64ProcessOutput(step, outpath) {
|
||||
let prefix_path = outpath.replace(/\.\w+$/, '');
|
||||
let output = await fs_1.default.promises.readFile(outpath, { encoding: 'base64' });
|
||||
let listings = {};
|
||||
let symbolmap = {};
|
||||
let debuginfo = {};
|
||||
let segments = [];
|
||||
// read segments
|
||||
{
|
||||
let txt = await fs_1.default.promises.readFile(prefix_path + '.map', { encoding: 'utf-8' });
|
||||
for (let line of txt.split("\n")) {
|
||||
// 0880 - 0887 : DATA, code
|
||||
const m1 = line.match(/([0-9a-f]+) - ([0-9a-f]+) : ([A-Z_]+), (.+)/);
|
||||
if (m1) {
|
||||
const name = m1[4];
|
||||
const start = parseInt(m1[1], 16);
|
||||
const end = parseInt(m1[2], 16);
|
||||
segments.push({
|
||||
name, start, size: end - start,
|
||||
});
|
||||
}
|
||||
// 0801 (0062) : startup, NATIVE_CODE:startup
|
||||
const m2 = line.match(/([0-9a-f]+) \(([0-9a-f]+)\) : ([^,]+), (.+)/);
|
||||
if (m2) {
|
||||
const addr = parseInt(m2[1], 16);
|
||||
const name = m2[3];
|
||||
symbolmap[name] = addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
// read listings
|
||||
{
|
||||
let txt = await fs_1.default.promises.readFile(prefix_path + '.asm', { encoding: 'utf-8' });
|
||||
let lst = { lines: [], text: txt };
|
||||
let asm_lineno = 0;
|
||||
let c_lineno = 0;
|
||||
let c_path = '';
|
||||
const path = step.path;
|
||||
for (let line of txt.split("\n")) {
|
||||
asm_lineno++;
|
||||
//; 4, "/Users/sehugg/PuzzlingPlans/8bitworkshop/server-root/oscar64/main.c"
|
||||
let m2 = line.match(/;\s*(\d+), "(.+?)"/);
|
||||
if (m2) {
|
||||
c_lineno = parseInt(m2[1]);
|
||||
c_path = m2[2].split('/').pop(); // TODO
|
||||
}
|
||||
//0807 : 30 36 __ BMI $083f ; (startup + 62)
|
||||
let m = line.match(/([0-9a-f]+) : ([0-9a-f _]{8}) (.+)/);
|
||||
if (m) {
|
||||
let offset = parseInt(m[1], 16);
|
||||
let hex = m[2];
|
||||
let asm = m[3];
|
||||
if (c_path) {
|
||||
lst.lines.push({
|
||||
line: c_lineno,
|
||||
path: c_path,
|
||||
offset,
|
||||
iscode: true
|
||||
});
|
||||
c_path = '';
|
||||
c_lineno = 0;
|
||||
}
|
||||
/*
|
||||
lst.asmlines.push({
|
||||
line: asm_lineno,
|
||||
path,
|
||||
offset,
|
||||
insns: hex + ' ' + asm,
|
||||
iscode: true });
|
||||
*/
|
||||
}
|
||||
}
|
||||
listings[(0, util_1.getFilenamePrefix)(step.path) + '.lst'] = lst;
|
||||
}
|
||||
return { output, listings, symbolmap, segments, debuginfo };
|
||||
}
|
||||
function findBestTool(step) {
|
||||
if (!(step === null || step === void 0 ? void 0 : step.tool))
|
||||
throw new Error('No tool specified');
|
||||
@ -60,6 +180,7 @@ function findBestTool(step) {
|
||||
}
|
||||
exports.TOOLS = [
|
||||
Object.assign({}, LLVM_MOS_TOOL, { version: 'latest' }),
|
||||
Object.assign({}, OSCAR64_TOOL, { version: 'latest' }),
|
||||
];
|
||||
class ServerBuildEnv {
|
||||
constructor(rootdir, sessionID, tool) {
|
||||
@ -81,7 +202,16 @@ class ServerBuildEnv {
|
||||
if (file.path.match(/[\\\/]/)) {
|
||||
throw new Error(`Invalid file path: ${file.path}`);
|
||||
}
|
||||
await fs_1.default.promises.writeFile(path_1.default.join(this.sessionDir, file.path), file.data);
|
||||
let data = file.data;
|
||||
if (typeof data === 'string' && data.startsWith('data:base64,')) {
|
||||
// convert data URL to base64
|
||||
let parts = data.split(',');
|
||||
if (parts.length !== 2) {
|
||||
throw new Error(`Invalid data URL: ${data}`);
|
||||
}
|
||||
data = Buffer.from(parts[1], 'base64');
|
||||
}
|
||||
await fs_1.default.promises.writeFile(path_1.default.join(this.sessionDir, file.path), data);
|
||||
}
|
||||
async build(step, platform) {
|
||||
// build config
|
||||
@ -99,7 +229,7 @@ class ServerBuildEnv {
|
||||
let args = config.args.slice(0); //copy array
|
||||
let command = config.command;
|
||||
// replace $OUTFILE
|
||||
let outfile = path_1.default.join(this.sessionDir, 'a.out'); // TODO? a.out
|
||||
let outfile = path_1.default.join(this.sessionDir, config.outfile || 'a.out');
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
args[i] = args[i].replace(/\$OUTFILE/g, outfile);
|
||||
args[i] = args[i].replace(/\$WORKDIR/g, this.sessionDir);
|
||||
@ -131,7 +261,8 @@ class ServerBuildEnv {
|
||||
let childProcess = (0, child_process_1.spawn)(command, args, {
|
||||
shell: true,
|
||||
cwd: this.rootdir,
|
||||
env: { PATH: path_1.default.join(this.rootdir, config.binpath)
|
||||
env: {
|
||||
PATH: path_1.default.join(this.rootdir, config.binpath)
|
||||
}
|
||||
});
|
||||
let outputData = '';
|
||||
@ -150,15 +281,14 @@ class ServerBuildEnv {
|
||||
resolve(this.processDebugInfo(step));
|
||||
}
|
||||
else {
|
||||
resolve(this.processOutput(step));
|
||||
resolve(this.tool.processOutput(step, outfile));
|
||||
}
|
||||
}
|
||||
else {
|
||||
errorData = (0, util_1.replaceAll)(errorData, this.sessionDir, '');
|
||||
errorData = (0, util_1.replaceAll)(errorData, this.rootdir, '');
|
||||
// remove folder paths
|
||||
errorData = errorData.replace(/(\/var\/folders\/.+?\/).+?:/g, '');
|
||||
let errorResult = await this.processErrors(step, errorData);
|
||||
let errorResult = await this.tool.processErrors(step, errorData);
|
||||
if (errorResult.errors.length === 0) {
|
||||
errorResult.errors.push({ line: 0, msg: `Build failed.\n\n${errorData}` });
|
||||
}
|
||||
@ -167,17 +297,7 @@ class ServerBuildEnv {
|
||||
});
|
||||
});
|
||||
}
|
||||
async processErrors(step, errorData) {
|
||||
let errors = [];
|
||||
// split errorData into lines
|
||||
let errorMatcher = (0, listingutils_1.makeErrorMatcher)(errors, /([^:/]+):(\d+):(\d+):\s*(.+)/, 2, 4, step.path, 1);
|
||||
for (let line of errorData.split('\n')) {
|
||||
errorMatcher(line);
|
||||
}
|
||||
return { errors };
|
||||
}
|
||||
async processOutput(step) {
|
||||
let outfile = path_1.default.join(this.sessionDir, 'a.out');
|
||||
async processOutput(step, outfile) {
|
||||
let output = await fs_1.default.promises.readFile(outfile, { encoding: 'base64' });
|
||||
return { output };
|
||||
}
|
||||
@ -194,7 +314,7 @@ class ServerBuildEnv {
|
||||
try {
|
||||
let result = await this.build(step);
|
||||
// did we succeed?
|
||||
if ((0, workertypes_1.isOutputResult)(result)) {
|
||||
if (step.tool == 'llvm-mos' && (0, workertypes_1.isOutputResult)(result)) {
|
||||
// do the debug info
|
||||
const debugInfo = await this.build(step, 'debug');
|
||||
if ((0, workertypes_1.isOutputResult)(debugInfo)) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -26,7 +26,7 @@ app.get('/info', (req, res) => {
|
||||
// send a list of supported tools
|
||||
res.json({ tools: buildenv_1.TOOLS });
|
||||
});
|
||||
app.get('/test', async (req, res, next) => {
|
||||
app.get('/test1', async (req, res, next) => {
|
||||
// quick test of the build
|
||||
try {
|
||||
const updates = [{ path: 'test.c', data: 'int main() { return 0; }' }];
|
||||
@ -39,6 +39,19 @@ app.get('/test', async (req, res, next) => {
|
||||
return next(err);
|
||||
}
|
||||
});
|
||||
app.get('/test2', async (req, res, next) => {
|
||||
// quick test of the build
|
||||
try {
|
||||
const updates = [{ path: 'test.c', data: 'int main() { return 0; }' }];
|
||||
const buildStep = { tool: 'oscar64', platform: 'c64', files: ['test.c'] };
|
||||
const env = new buildenv_1.ServerBuildEnv(SERVER_ROOT, 'test', buildenv_1.TOOLS[1]);
|
||||
const result = await env.compileAndLink(buildStep, updates);
|
||||
res.json(result);
|
||||
}
|
||||
catch (err) {
|
||||
return next(err);
|
||||
}
|
||||
});
|
||||
app.post('/build', async (req, res, next) => {
|
||||
try {
|
||||
const updates = req.body.updates;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/worker/server/server.ts"],"names":[],"mappings":";;;;;AACA,4CAAoB;AACpB,gDAAwB;AACxB,sDAAqD;AACrD,gDAAwB;AAExB,yCAAiE;AAEjE;;;;;;;;;EASE;AAEF,oBAAoB;AAEpB,MA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AE,GAAG,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
|
62
gen/worker/tools/oscar64.js
Normal file
62
gen/worker/tools/oscar64.js
Normal file
@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.compileOscar64 = compileOscar64;
|
||||
const wasishim_1 = require("../../common/wasi/wasishim");
|
||||
const builder_1 = require("../builder");
|
||||
const listingutils_1 = require("../listingutils");
|
||||
const wasiutils_1 = require("../wasiutils");
|
||||
const wasmutils_1 = require("../wasmutils");
|
||||
let oscar64_fs = null;
|
||||
let wasiModule = null;
|
||||
async function compileOscar64(step) {
|
||||
const errors = [];
|
||||
const rootDir = "/root/";
|
||||
(0, builder_1.gatherFiles)(step, { mainFilePath: "main.c" });
|
||||
const destpath = (step.path || "main.c").replace(/\.[^.]+$/, ".prg");
|
||||
console.log('destpath', destpath);
|
||||
if ((0, builder_1.staleFiles)(step, [destpath])) {
|
||||
if (!oscar64_fs) {
|
||||
oscar64_fs = await (0, wasiutils_1.loadWASIFilesystemZip)("oscar64-fs.zip", "/root/");
|
||||
}
|
||||
if (!wasiModule) {
|
||||
wasiModule = new WebAssembly.Module((0, wasmutils_1.loadWASMBinary)("oscar64"));
|
||||
}
|
||||
const wasi = new wasishim_1.WASIRunner();
|
||||
wasi.initSync(wasiModule);
|
||||
wasi.fs.setParent(oscar64_fs);
|
||||
for (let file of step.files) {
|
||||
wasi.fs.putFile(rootDir + file, builder_1.store.getFileData(file));
|
||||
}
|
||||
//wasi.addPreopenDirectory("include");
|
||||
wasi.addPreopenDirectory("/root");
|
||||
wasi.setArgs(["oscar64", "-v", "-g", "-i=/root", step.path]);
|
||||
try {
|
||||
wasi.run();
|
||||
}
|
||||
catch (e) {
|
||||
errors.push(e);
|
||||
}
|
||||
// TODO
|
||||
let stdout = wasi.fds[1].getBytesAsString();
|
||||
let stderr = wasi.fds[2].getBytesAsString();
|
||||
console.log('stdout', stdout);
|
||||
console.log('stderr', stderr);
|
||||
// (58, 17) : error 3001: Could not open source file. 'stdlib.c'
|
||||
const matcher = (0, listingutils_1.makeErrorMatcher)(errors, /\((\d+),\s+(\d+)\)\s+: error (\d+): (.+)/, 1, 4, step.path);
|
||||
for (let line of stderr.split('\n')) {
|
||||
matcher(line);
|
||||
}
|
||||
if (errors.length) {
|
||||
return { errors };
|
||||
}
|
||||
const output = wasi.fs.getFile(destpath).getBytes();
|
||||
(0, builder_1.putWorkFile)(destpath, output);
|
||||
return {
|
||||
output,
|
||||
errors,
|
||||
//listings,
|
||||
//symbolmap
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=oscar64.js.map
|
1
gen/worker/tools/oscar64.js.map
Normal file
1
gen/worker/tools/oscar64.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"oscar64.js","sourceRoot":"","sources":["../../../src/worker/tools/oscar64.ts"],"names":[],"mappings":";;AASA,wCAiDC;AA1DD,yDAA8F;AAC9F,wCAAqG;AACrG,kDAAqE;AACrE,4CAAqD;AACrD,4CAA8C;AAE9C,IAAI,UAAU,GAA0B,IAAI,CAAC;AAC7C,IAAI,UAAU,GAA8B,IAAI,CAAC;AAE1C,KAAK,UAAU,cAAc,CAAC,IAAe;IAChD,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,OAAO,GAAG,QAAQ,CAAC;IACzB,IAAA,qBAAW,EAAC,IAAI,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAClC,IAAI,IAAA,oBAAU,EAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,EA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,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,gEAAgE;QAChE,MAAM,OAAO,GAAG,IAAA,+BAAgB,EAAC,MAAM,EAAE,0CAA0C,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACtG,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QACtB,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACpD,IAAA,qBAAW,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO;YACH,MAAM;YACN,MAAM;YACN,WAAW;YACX,WAAW;SACd,CAAC;IACN,CAAC;AACL,CAAC"}
|
@ -21,7 +21,7 @@ async function buildRemote(step) {
|
||||
let path = step.files[i];
|
||||
let entry = builder_1.store.workfs[path];
|
||||
// convert to base64
|
||||
let data = typeof entry.data === 'string' ? entry.data : btoa((0, util_1.byteArrayToString)(entry.data));
|
||||
let data = typeof entry.data === 'string' ? entry.data : "data:base64," + btoa((0, util_1.byteArrayToString)(entry.data));
|
||||
updates.push({ path, data });
|
||||
}
|
||||
// build the command
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../src/worker/tools/remote.ts"],"names":[],"mappings":";;AAQA,kCAwCC;AAhDD,4CAAyE;AACzE,0DAAwG;AACxG,wCAAwF;AAExF,oBAAoB;AACpB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,C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AAU,EAAE;YACjC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;YACzB,OAAO,EAAE;gBACL,cAAc,EAAE,kBAAkB;aACrC;SACJ,CAAC,CAAC;QACH,4BAA4B;QAC5B,IAAI,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC/B,2BAA2B;QAC3B,IAAI,IAAA,yBAAW,EAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,IAAI,IAAA,2BAAa,EAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACrC,IAAI,IAAA,4BAAc,EAAC,IAAI,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,IAAA,wBAAiB,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YACnD,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC;AACL,CAAC"}
|
@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.loadBlobSync = loadBlobSync;
|
||||
exports.unzipWASIFilesystem = unzipWASIFilesystem;
|
||||
exports.loadWASIFilesystemZip = loadWASIFilesystemZip;
|
||||
const jszip_1 = __importDefault(require("jszip"));
|
||||
const wasishim_1 = require("../common/wasi/wasishim");
|
||||
@ -14,11 +15,8 @@ function loadBlobSync(path) {
|
||||
xhr.send(null);
|
||||
return xhr.response;
|
||||
}
|
||||
async function loadWASIFilesystemZip(zippath) {
|
||||
async function unzipWASIFilesystem(zipdata, rootPath = "./") {
|
||||
const jszip = new jszip_1.default();
|
||||
const path = '../../src/worker/fs/' + zippath;
|
||||
const zipdata = loadBlobSync(path);
|
||||
console.log(zippath, zipdata);
|
||||
await jszip.loadAsync(zipdata);
|
||||
let fs = new wasishim_1.WASIMemoryFilesystem();
|
||||
let promises = [];
|
||||
@ -27,7 +25,7 @@ async function loadWASIFilesystemZip(zippath) {
|
||||
fs.putDirectory(relativePath);
|
||||
}
|
||||
else {
|
||||
let path = './' + relativePath;
|
||||
let path = rootPath + relativePath;
|
||||
let prom = zipEntry.async("uint8array").then((data) => {
|
||||
fs.putFile(path, data);
|
||||
});
|
||||
@ -37,4 +35,11 @@ async function loadWASIFilesystemZip(zippath) {
|
||||
await Promise.all(promises);
|
||||
return fs;
|
||||
}
|
||||
async function loadWASIFilesystemZip(zippath, rootPath = "./") {
|
||||
const jszip = new jszip_1.default();
|
||||
const path = '../../src/worker/fs/' + zippath;
|
||||
const zipdata = loadBlobSync(path);
|
||||
console.log(zippath, zipdata);
|
||||
return unzipWASIFilesystem(zipdata, rootPath);
|
||||
}
|
||||
//# sourceMappingURL=wasiutils.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"wasiutils.js","sourceRoot":"","sources":["../../src/worker/wasiutils.ts"],"names":[],"mappings":";;;;;AAGA,oCAMC;AAED,sDAqBC;AAhCD,kDAA0B;AAC1B,sDAA+D;AAE/D,SAAgB,YAAY,CAAC,IAAY;IACrC,IAAI,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;IAC/B,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC;IAC1B,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE,sBAAsB;IACrD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,OAAO,GAAG,CAAC,QAAQ,CAAC;AACxB,CAAC;AAEM,KAAK,UAAU,qBAAqB,CAAC,OAAe;IACvD,MAAM,KAAK,GAAG,IAAI,eAAK,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAG,sBAAsB,GAAG,OAAO,CAAC;IAC9C,MAAM,OAAO,GAAG,YAAY,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CAAC,CAAC;AAClD,CAAC"}
|
@ -39,6 +39,7 @@ const remote = __importStar(require("./tools/remote"));
|
||||
const acme = __importStar(require("./tools/acme"));
|
||||
const cc7800 = __importStar(require("./tools/cc7800"));
|
||||
const bataribasic = __importStar(require("./tools/bataribasic"));
|
||||
const oscar64 = __importStar(require("./tools/oscar64"));
|
||||
exports.TOOLS = {
|
||||
'dasm': dasm.assembleDASM,
|
||||
'acme': acme.assembleACME,
|
||||
@ -77,6 +78,7 @@ exports.TOOLS = {
|
||||
'cc7800': cc7800.compileCC7800,
|
||||
'armtcc': arm.compileARMTCC,
|
||||
'armtcclink': arm.linkARMTCC,
|
||||
'oscar64': oscar64.compileOscar64,
|
||||
};
|
||||
exports.TOOL_PRELOADFS = {
|
||||
'cc65-apple2': '65-apple2',
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"workertools.js","sourceRoot":"","sources":["../../src/worker/workertools.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAoC;AACpC,mDAAoC;AACpC,mDAAoC;AACpC,mDAAoC;AACpC,yDAA0C;AAC1C,qDAAsC;AACtC,qDAAsC;AACtC,iDAAkC;AAClC,iDAAkC;AAClC,iDAAkC;AAClC,iDAAkC;AAClC,uDAAwC;AACxC,mDAAoC;AACpC,uDAAwC;AACxC,iEAAkD;AAGrC,QAAA,KAAK,GAAG;IACnB,MAAM,EAAE,IAAI,CAAC,YAAY;IACzB,MAAM,EAAE,IAAI,CAAC,YAAY;IACzB,MAAM,EAAE,IAAI,CAAC,WAAW;IACxB,MAAM,EAAE,IAAI,CAAC,YAAY;IACzB,MAAM,EAAE,IAAI,CAAC,QAAQ;IACrB,2BAA2B;IAC3B,0BAA0B;IAC1B,SAAS,EAAE,IAAI,CAAC,eAAe;IAC/B,SAAS,EAAE,IAAI,CAAC,WAAW;IAC3B,MAAM,EAAE,IAAI,CAAC,WAAW;IACxB,UAAU,EAAE,KAAK,CAAC,gBAAgB;IAClC,MAAM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ACpB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,UAAU;IACxB,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,gBAAgB,EAAE,SAAS;IAC3B,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,aAAa,EAAE,WAAW;IAC1B,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,cAAc,EAAE,mCAAmC;IAC9D,SAAS,EAAE,QAAQ,EAAE,mCAAmC;IACxD,SAAS,EAAE,QAAQ,EAAE,mCAAmC;CACzD,CAAA"}
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
import{J as p,r as c}from"./chunk-ULPRULB6.js";import{J as n,O as i}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var o=class extends c{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=224;this.joymask0=0}reset(){super.reset(),this.exports.machine_exec(this.sys,2e6),this.romptr&&this.romlen&&this.exports.machine_load_rom(this.sys,this.romptr,this.romlen);for(var t=0;t<128;t++)this.setKeyInput(t,0,i.KeyUp)}advanceFrame(t){var a=this.probe!=null;a&&this.exports.machine_reset_probe_buffer();var s=super.advanceFrameClock(t,Math.floor(35e5/50));return a&&this.copyProbeData(),s}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,a=t[9]+(t[8]<<8),s=t[10]+(t[11]<<8),e=t[12]+(t[13]<<8),r=t[14]+(t[15]<<8),x=t[24]+(t[25]<<8),l=t[26]+(t[27]<<8),u=t[28]+(t[29]<<8),m=t[34]+(t[35]<<8),d=t[36]+(t[37]<<8);return{PC:m,SP:x,AF:a,BC:r,DE:e,HL:s,IX:u,IY:l,IR:d,o:this.readConst(m)}}saveState(){return this.exports.machine_save_state(this.sys,this.stateptr),{c:this.getCPUState(),state:this.statearr.slice(0)}}loadState(t){this.statearr.set(t.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:320,height:256,overscan:!0,videoFrequency:50}}setKeyInput(t,a,s){if(!(t==16||t==17||t==18||t==224)){var e=0,r=0;t==37&&(t=8,e=4),t==38&&(t=11,e=1),t==39&&(t=9,e=8),t==40&&(t=10,e=2),t==32&&(e=16),t==65&&(t=65,r=4),t==87&&(t=87,r=1),t==68&&(t=68,r=8),t==83&&(t=83,r=2),t==69&&(r=16),t==113&&(t=241),t==115&&(t=243),t==119&&(t=245),t==121&&(t=247),s&i.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=e):s&i.KeyUp&&(this.exports.machine_key_up(this.sys,t),this.joymask0&=~e),this.exports.zx_joystick(this.sys,this.joymask0,0)}}};var M=[{id:"hello.asm",name:"Hello World (ASM)"},{id:"bios.c",name:"BIOS Routines (C)"},{id:"cosmic.c",name:"Cosmic Impalas (C)"}],v={main:[{name:"BIOS",start:0,size:16384,type:"rom"},{name:"Screen RAM",start:16384,size:6144,type:"ram"},{name:"Color RAM",start:22528,size:768,type:"ram"},{name:"System RAM",start:23552,size:192,type:"ram"},{name:"User RAM",start:23755,size:65368-23755,type:"ram"}]},h=class extends p{newMachine(){return new o("zx")}getPresets(){return M}getDefaultExtension(){return".asm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return v}showHelp(){return"https://worldofspectrum.org/faq/reference/reference.htm"}};n.zx=h;
|
||||
//# sourceMappingURL=zx-XCACRHBB.js.map
|
||||
import{J as p,r as c}from"./chunk-ARTNMEGN.js";import{J as n,O as i}from"./chunk-RXF2JDJ3.js";import"./chunk-WAARL7ET.js";var o=class extends c{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=224;this.joymask0=0}reset(){super.reset(),this.exports.machine_exec(this.sys,2e6),this.romptr&&this.romlen&&this.exports.machine_load_rom(this.sys,this.romptr,this.romlen);for(var t=0;t<128;t++)this.setKeyInput(t,0,i.KeyUp)}advanceFrame(t){var a=this.probe!=null;a&&this.exports.machine_reset_probe_buffer();var s=super.advanceFrameClock(t,Math.floor(35e5/50));return a&&this.copyProbeData(),s}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,a=t[9]+(t[8]<<8),s=t[10]+(t[11]<<8),e=t[12]+(t[13]<<8),r=t[14]+(t[15]<<8),x=t[24]+(t[25]<<8),l=t[26]+(t[27]<<8),u=t[28]+(t[29]<<8),m=t[34]+(t[35]<<8),d=t[36]+(t[37]<<8);return{PC:m,SP:x,AF:a,BC:r,DE:e,HL:s,IX:u,IY:l,IR:d,o:this.readConst(m)}}saveState(){return this.exports.machine_save_state(this.sys,this.stateptr),{c:this.getCPUState(),state:this.statearr.slice(0)}}loadState(t){this.statearr.set(t.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:320,height:256,overscan:!0,videoFrequency:50}}setKeyInput(t,a,s){if(!(t==16||t==17||t==18||t==224)){var e=0,r=0;t==37&&(t=8,e=4),t==38&&(t=11,e=1),t==39&&(t=9,e=8),t==40&&(t=10,e=2),t==32&&(e=16),t==65&&(t=65,r=4),t==87&&(t=87,r=1),t==68&&(t=68,r=8),t==83&&(t=83,r=2),t==69&&(r=16),t==113&&(t=241),t==115&&(t=243),t==119&&(t=245),t==121&&(t=247),s&i.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=e):s&i.KeyUp&&(this.exports.machine_key_up(this.sys,t),this.joymask0&=~e),this.exports.zx_joystick(this.sys,this.joymask0,0)}}};var M=[{id:"hello.asm",name:"Hello World (ASM)"},{id:"bios.c",name:"BIOS Routines (C)"},{id:"cosmic.c",name:"Cosmic Impalas (C)"}],v={main:[{name:"BIOS",start:0,size:16384,type:"rom"},{name:"Screen RAM",start:16384,size:6144,type:"ram"},{name:"Color RAM",start:22528,size:768,type:"ram"},{name:"System RAM",start:23552,size:192,type:"ram"},{name:"User RAM",start:23755,size:65368-23755,type:"ram"}]},h=class extends p{newMachine(){return new o("zx")}getPresets(){return M}getDefaultExtension(){return".asm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return v}showHelp(){return"https://worldofspectrum.org/faq/reference/reference.htm"}};n.zx=h;
|
||||
//# sourceMappingURL=zx-XF6BW4RH.js.map
|
4
jquery/jquery.min.js
vendored
4
jquery/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
46
package-lock.json
generated
46
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "8bitworkshop",
|
||||
"version": "3.11.0",
|
||||
"version": "3.12.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "8bitworkshop",
|
||||
"version": "3.11.0",
|
||||
"version": "3.12.0",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@types/dompurify": "^3.0.5",
|
||||
@ -593,16 +593,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/mocha": {
|
||||
"version": "10.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.8.tgz",
|
||||
"integrity": "sha512-HfMcUmy9hTMJh66VNcmeC9iVErIZJli2bszuXc6julh5YGuRb/W5OnkHjwLNYdFlMis0sY3If5SEAp+PktdJjw==",
|
||||
"version": "10.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.9.tgz",
|
||||
"integrity": "sha512-sicdRoWtYevwxjOHNMPTl3vSfJM6oyW8o1wXeI7uww6b6xHg8eBznQDNSGBCDJmsE8UMxP05JgZRtsKbTqt//Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz",
|
||||
"integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==",
|
||||
"version": "22.7.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz",
|
||||
"integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -1364,9 +1364,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/chromedriver": {
|
||||
"version": "129.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-129.0.1.tgz",
|
||||
"integrity": "sha512-thJqK3c7p9rIhmjBvs/cgaK0Hk30g7LbnmMXQ2aLnn75ZOiEl/2GBcgc6fw+4GIw1SmOYhnNmaEI1iTP3qob0w==",
|
||||
"version": "129.0.4",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-129.0.4.tgz",
|
||||
"integrity": "sha512-j5I55cQwodFJUaYa1tWUmj2ss9KcPRBWmUa5Qonq3X8kqv2ASPyTboFYb4YB/YLztkYTUUw2E43txXw0wYzT/A==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
@ -1703,10 +1703,11 @@
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
|
||||
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
|
||||
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@ -2352,9 +2353,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
|
||||
"integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==",
|
||||
"version": "4.21.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
|
||||
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -2363,7 +2364,7 @@
|
||||
"body-parser": "1.20.3",
|
||||
"content-disposition": "0.5.4",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "0.6.0",
|
||||
"cookie": "0.7.1",
|
||||
"cookie-signature": "1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
@ -4618,7 +4619,8 @@
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mocha/node_modules/serialize-javascript": {
|
||||
"version": "6.0.2",
|
||||
@ -7174,9 +7176,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz",
|
||||
"integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
||||
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "8bitworkshop",
|
||||
"version": "3.11.0",
|
||||
"version": "3.12.0",
|
||||
"author": "Steven Hugg",
|
||||
"category": "Development",
|
||||
"description": "8bitworkshop.com retro programming IDE",
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user