mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-23 03:29:05 +00:00
Deploying to gh-pages from @ sehugg/8bitworkshop@fa09db6026 🚀
This commit is contained in:
parent
f5d46535e5
commit
0d0139f98a
@ -25,6 +25,8 @@ npm i
|
||||
npm run build
|
||||
```
|
||||
|
||||
To use GitHub integration locally, download the Firebase config file, e.g. https://8bitworkshop.com/v[version]/config.js
|
||||
|
||||
### Start Server
|
||||
|
||||
Start a web server on http://localhost:8000/ while TypeScript compiles in the background:
|
||||
@ -108,3 +110,4 @@ The IDE uses custom forks for many of these, found at https://github.com/sehugg?
|
||||
* https://github.com/sehugg/8bitworkshop-compilers
|
||||
* https://github.com/sehugg/8bit-tools
|
||||
* https://github.com/sehugg/awesome-8bitgamedev
|
||||
|
||||
|
90
ecsroot/kernel.txt
Normal file
90
ecsroot/kernel.txt
Normal file
@ -0,0 +1,90 @@
|
||||
# Kernel
|
||||
# A Kernel draws a set of scanlines to the screen.
|
||||
|
||||
component Kernel
|
||||
lines: 0..255 "Height of region in scanlines"
|
||||
bgcolor: 0..255 "Background color"
|
||||
end
|
||||
|
||||
system SimpleKernel
|
||||
tempbytes 8
|
||||
on preframe do once [Kernel] ---
|
||||
lda #192 ; TODO: numlines
|
||||
sec
|
||||
sbc ypos_ypos_b0+ent
|
||||
sta {{$5}}+ofs
|
||||
|
||||
ldy hasbitmap_bitmap_b0+ent
|
||||
lda bitmap_bitmapdata_b0,y
|
||||
sec
|
||||
sbc {{$5}}+ofs
|
||||
sta {{$0}}+ofs
|
||||
lda bitmap_bitmapdata_b8,y
|
||||
sbc #0
|
||||
sta {{$1}}+ofs
|
||||
|
||||
ldy hascolormap_colormap_b0+ent
|
||||
lda colormap_colormapdata_b0,y
|
||||
sec
|
||||
sbc {{$5}}+ofs
|
||||
sta {{$2}}+ofs
|
||||
lda colormap_colormapdata_b8,y
|
||||
sbc #0
|
||||
sta {{$3}}+ofs
|
||||
|
||||
lda sprite_height_b0+ent
|
||||
sta {{$4}}+ofs
|
||||
lda ypos_ypos_b0+ent
|
||||
sta {{$5}}+ofs
|
||||
---
|
||||
on preframe do once [Sprite,HasBitmap,HasColormap,HasYpos] --
|
||||
{{@KernelSetup}} 0,0
|
||||
{{@KernelSetup}} 1,6
|
||||
--
|
||||
on kernel do once [Kernel]:
|
||||
lda %{<bgcolor}
|
||||
sta COLUBK
|
||||
ldy %{<lines}
|
||||
@LVScan:
|
||||
lda %{$4} ; height
|
||||
dcp %{$5}
|
||||
bcs @DoDraw1
|
||||
lda #0
|
||||
.byte $2C
|
||||
@DoDraw1:
|
||||
lda (%{$0}),y
|
||||
sta WSYNC
|
||||
sta GRP0
|
||||
lda (%{$2}),y
|
||||
sta COLUP0
|
||||
|
||||
lda %{$10} ; height
|
||||
dcp %{$11}
|
||||
bcs @DoDraw2
|
||||
lda #0
|
||||
.byte $2C
|
||||
@DoDraw2:
|
||||
lda (%{$6}),y
|
||||
sta GRP1
|
||||
lda (%{$8}),y
|
||||
sta COLUP1
|
||||
|
||||
dey ; decrement
|
||||
bne @LVScan ; repeat until 192 lines
|
||||
--
|
||||
end
|
||||
|
||||
scope Root
|
||||
|
||||
entity kernel [SimpleKernel]
|
||||
const lines = 100
|
||||
end
|
||||
|
||||
entity player1 [Sprite,HasBitmap,HasColormap,HasYpos]
|
||||
const plyrindex = 0
|
||||
init height = 8
|
||||
init xpos = 100
|
||||
init ypos = 100
|
||||
end
|
||||
|
||||
end scope
|
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{G as W,h as E,k as N,n as F,r as _}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as k,T as M,U as r,V as T,X as O,Z as U,_ as w,g,s as I}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var f=0,R=2,A=8,q=O([[r.A,A+0,128],[r.B,A+1,128],[r.SELECT,R,-2],[r.START,R,-1],[r.UP,f,-16],[r.DOWN,f,-32],[r.LEFT,f,-64],[r.RIGHT,f,-128],[r.P2_A,A+2,128],[r.P2_B,A+3,128],[r.P2_UP,f,-1],[r.P2_DOWN,f,-2],[r.P2_LEFT,f,-4],[r.P2_RIGHT,f,-8]]);var S=262,z=258-16,d=454,X=28,K=4,Y=S*60*K,P=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+=M(t.regs,0,32),e}},B=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.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}}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}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!!(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){if(this.bus=t,this.cycles=0,this.pixels.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=16,this.offset<0&&this.readDLLEntry(t);let s=this.dlstart&65280,a=this.dlstart&255;do{let b=t.read(s+(a+0&511)),n=t.read(s+(a+1&511));if(n==0||s>=16384)break;let $=t.read(s+(a+2&511)),v=t.read(s+(a+3&511)),p=!1;if((n&31)==0){var e=v>>5,o=32-(v&31),x=t.read(s+(a+4&511)),i=n&128;p=(n&32)!=0,a+=5,this.cycles+=10}else{var x=v,e=n>>5,o=32-(n&31),i=0;a+=4,this.cycles+=8}let D=b+(($+(p?0:this.offset)&255)<<8);x*=2;let j=(this.regs[28]&3)+(i?4:0),C=p&&(this.regs[28]&16)!=0;C&&(o*=2);for(var l=0;l<o;l++){let m=this.readDMA(C?D+(l>>1):D+l);if(p){let h=(this.regs[20]+this.offset<<8)+m;C&&l&1&&(h++,this.cycles-=3),m=this.readDMA(h)}switch(j){case 0:for(let h=0;h<4;h++){var c=m>>6&3;c>0&&(this.pixels[x]=this.pixels[x+1]=this.regs[(e<<2)+c]),m<<=2,x=x+2&511}break;case 2:case 3:for(let h=0;h<8;h++){var c=m&128?1:0;c>0&&(this.pixels[x]=this.regs[(e<<2)+c]),m<<=1,x=x+1&511}break}}}while(this.cycles<d);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+=M(t.regs,0,32),e+=`
|
||||
import{G as W,h as E,k as N,n as F,r as _}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as k,T as M,U as r,V as T,X as O,Z as U,_ as w,g,s as I}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";var f=0,R=2,A=8,q=O([[r.A,A+0,128],[r.B,A+1,128],[r.SELECT,R,-2],[r.START,R,-1],[r.UP,f,-16],[r.DOWN,f,-32],[r.LEFT,f,-64],[r.RIGHT,f,-128],[r.P2_A,A+2,128],[r.P2_B,A+3,128],[r.P2_UP,f,-1],[r.P2_DOWN,f,-2],[r.P2_LEFT,f,-4],[r.P2_RIGHT,f,-8]]);var S=262,z=258-16,d=454,X=28,K=4,Y=S*60*K,P=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+=M(t.regs,0,32),e}},B=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.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}}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}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!!(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){if(this.bus=t,this.cycles=0,this.pixels.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=16,this.offset<0&&this.readDLLEntry(t);let s=this.dlstart&65280,a=this.dlstart&255;do{let b=t.read(s+(a+0&511)),n=t.read(s+(a+1&511));if(n==0||s>=16384)break;let $=t.read(s+(a+2&511)),v=t.read(s+(a+3&511)),p=!1;if((n&31)==0){var e=v>>5,o=32-(v&31),x=t.read(s+(a+4&511)),i=n&128;p=(n&32)!=0,a+=5,this.cycles+=10}else{var x=v,e=n>>5,o=32-(n&31),i=0;a+=4,this.cycles+=8}let D=b+(($+(p?0:this.offset)&255)<<8);x*=2;let j=(this.regs[28]&3)+(i?4:0),C=p&&(this.regs[28]&16)!=0;C&&(o*=2);for(var l=0;l<o;l++){let m=this.readDMA(C?D+(l>>1):D+l);if(p){let h=(this.regs[20]+this.offset<<8)+m;C&&l&1&&(h++,this.cycles-=3),m=this.readDMA(h)}switch(j){case 0:for(let h=0;h<4;h++){var c=m>>6&3;c>0&&(this.pixels[x]=this.pixels[x+1]=this.regs[(e<<2)+c]),m<<=2,x=x+2&511}break;case 2:case 3:for(let h=0;h<8;h++){var c=m&128?1:0;c>0&&(this.pixels[x]=this.regs[(e<<2)+c]),m<<=1,x=x+1&511}break}}}while(this.cycles<d);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+=M(t.regs,0,32),e+=`
|
||||
DLL: $`+g((t.regs[12]<<8)+t.regs[16],4)+" @ $"+g(t.dll,4),e+=`
|
||||
DL: $`+g(t.dlstart,4),e+=`
|
||||
Offset: `+t.offset,e+=`
|
||||
DLI? `+t.dli,e}},L=class extends F{constructor(){super();this.cpuFrequency=1789772;this.canvasWidth=320;this.numTotalScanlines=S;this.numVisibleScanlines=z;this.defaultROMSize=49152;this.cpuCyclesPerLine=113.5;this.sampleRate=Y;this.ram=new Uint8Array(4096);this.regs6532=new Uint8Array(4);this.tia=new P;this.maria=new B;this.lastFrameCycles=0;this.xtracyc=0;this.cpu=new _,this.read=w([[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,3,t=>(this.xtracyc++,this.inputs[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=w([[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,3,(t,e)=>{this.xtracyc++,this.regs6532[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.probeDMABus=this.probeIOBus(this),this.handler=T(this.inputs,q),this.pokey1=new E,this.audioadapter=new N(this.pokey1,K,Y)}readConst(t){let e=this.probe;this.probe=null;let o=this.read(t);return this.probe=e,o}readInput(t){switch(t){case 12:return~this.inputs[8]&128;case 13:return~this.inputs[9]&128;default:return this.inputs[t]|0}}advanceCPU(){var t=super.advanceCPU();return this.xtracyc&&(t+=this.xtracyc,this.probe.logClocks(this.xtracyc),this.xtracyc=0),t}advanceFrame(t){var e=this.pixels,o=0,x,i=0,l=0,c=0;this.probe.logNewFrame();for(var s=0;s<S;s++){this.scanline=s;var a=s<z;for(this.maria.setVBLANK(!a),this.maria.WSYNC=0;i<X&&!this.maria.WSYNC;){if(t&&t()){t=null,s=999;break}i+=this.advanceCPU()<<2,c++}if(a){let n=this.maria.doDMA(this.probeDMABus);if(this.probe.logClocks(n>>2),i+=n,e)for(var b=0;b<320;b++)e[o++]=G[this.maria.pixels[b]]}for((a||s==S-1)&&this.maria.doInterrupt()&&(this.probe.logInterrupt(0),this.cpu.NMI());i<d;){if(this.maria.WSYNC){this.probe.logClocks(d-i>>2),i=d;break}if(t&&t()){t=null,s=999;break}i+=this.advanceCPU()<<2,c++}this.audio&&this.audioadapter.generate(this.audio),i-=d,l+=i,this.probe.logNewScanline()}return this.lastFrameCycles=l,c}getRasterX(){return this.lastFrameCycles%d}getRasterY(){return Math.floor(this.lastFrameCycles/d)}loadROM(t){t.length==49280&&(t=t.slice(128)),this.rom=U(t,this.defaultROMSize,!0)}reset(){super.reset(),this.tia.reset(),this.maria.reset(),this.inputs.fill(0),this.inputs[f]=255,this.inputs[R]=1+2+8}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.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)}}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 P.stateToLongString(e.tia);case"MARIA":return B.stateToLongString(e.maria)+`
|
||||
Scanline: `+this.scanline}}},H=[0,4210752,7105644,9474192,11579568,13158600,14474460,16053492,17476,1074276,2393220,3448992,4241592,5296336,6088936,6880508,10352,1328260,2645144,3963052,5016764,6070476,6862044,7915756,6276,1586328,3166380,4745408,6062288,7378144,8431852,9747708,136,2105500,3947696,5789888,7368912,8947936,10526956,11842812,6029432,7610508,8928416,10246320,11563200,12616912,13671644,14725356,7864392,9445472,10763384,12081292,13398176,14451892,15506628,16560340,8650772,9969712,11287628,12605544,13660284,14715028,15507624,16561340,8912896,10231836,11550776,12606544,13661288,14716028,15508624,16562340,8132608,9451548,11031608,12349520,13404264,14457980,15512720,16566436,6040576,7883804,9463864,11306064,12622952,13939836,15256720,16572580,2898944,4742172,6585400,8428624,9745512,11325564,12641424,13958308,15360,2120736,4226112,6069340,7648372,9228428,10806436,12123320,14356,1858612,3701840,5281900,6861956,8178844,9495732,10812616,12332,1855564,3436648,5016708,6596764,7913652,8967372,10284256,10308,1591396,3172484,4490400,5807288,7124176,8178920,9232636],G=new Uint32Array(256),J=[];for(u=0;u<256;u++)G[u]=H[u>>1]|4278190080,J[u]="#"+g(I(H[u>>1]),6);var u;var Q=[{id:"sprites.dasm",name:"Sprites (ASM)"},{id:"wsync.c",name:"WSYNC"},{id:"sprites.c",name:"Double Buffering"},{id:"scroll.c",name:"Scrolling"}],V=class extends W{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,type:"rom"}]}}}newMachine(){return new L}getPresets(){return Q}getDefaultExtension(){return".c"}readAddress(t){return this.machine.readConst(t)}getROMExtension(){return".a78"}};k.atari7800=V;
|
||||
//# sourceMappingURL=atari7800-QU2XJDVM.js.map
|
||||
//# sourceMappingURL=atari7800-WXTPSC5M.js.map
|
@ -1,2 +1,2 @@
|
||||
import{a as g}from"./chunk-VD5NND7R.js";import{G as p,q as h,w as d,z as c}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as o,N as r,U as m,X as l}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var n=class extends h{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=63;this.joymask0=0;this.joymask1=0}loadROM(e){super.loadROM(e),this.reloadROM()}reloadROM(){if(this.sys){var e=this.exports.machine_load_rom(this.sys,this.romptr,this.romlen);console.log("machine_load_rom",e)}}loadBIOS(e){super.loadBIOS(e)}reset(){super.reset(),this.reloadROM()}advanceFrame(e){return this.exports.machine_start_frame(this.sys),e?this.advanceFrameClock(e,999999):this.exports.machine_advance_frame(this.sys),this.syncVideo(),this.syncAudio(),1}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.stateptr);var e=this.statearr,t=e[6]+(e[7]<<8);return{PC:t,SP:e[2],A:e[0],X:e[3],Y:e[4],C:e[1]&1,Z:e[1]&2,I:e[1]&4,D:e[1]&8,V:e[1]&64,N:e[1]&128,o:this.readConst(t)}}saveState(){var e=this.getCPUState();return this.exports.machine_save_state(this.sys,this.stateptr),{c:e,state:this.statearr.slice(0)}}loadState(e){this.statearr.set(e.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:384,height:240,overscan:!0,videoFrequency:60}}pollControls(){}setKeyInput(e,t,i){i&r.Shift&&(e|=256),i&r.Ctrl&&(e|=512);var a=0;e==37&&(e=8,a=4),e==38&&(e=11,a=1),e==39&&(e=9,a=8),e==40&&(e=10,a=2),e==32&&(a=256),i&r.KeyDown?(this.exports.machine_key_down(this.sys,e),this.joymask0|=a):i&r.KeyUp&&(this.exports.machine_key_up(this.sys,e),this.joymask0&=~a),this.setJoyInput(0,this.joymask0),this.setJoyInput(1,this.joymask1)}setJoyInput(e,t){this.exports.machine_joy_set(this.sys,e,t)}setPaddleInput(e,t){this.exports.machine_paddle_set(this.sys,e,t)}};var x=[{id:"hello.dasm",name:"Hello World (ASM)"},{id:"hellopm.dasm",name:"Hello Sprites (ASM)"},{id:"helloconio.c",name:"Text Mode (C)"},{id:"siegegame.c",name:"Siege Game (C)"},{id:"hellodlist.c",name:"Display List (C)"}],B=x.concat([{id:"sieve.bas",name:"Benchmark (FastBasic)"},{id:"pmtest.bas",name:"Sprites Test (FastBasic)"},{id:"dli.bas",name:"DLI Test (FastBasic)"},{id:"joyas.bas",name:"Match-3 Game (FastBasic)"}]),Z=l([[m.VK_SPACE,0,0],[m.VK_ENTER,0,0]]),f={main:[{name:"RAM",start:0,size:65536,type:"ram"},{name:"Left Cartridge ROM",start:40960,size:8192,type:"rom"},{name:"GTIA",start:53248,size:32,type:"io"},{name:"POKEY",start:53760,size:16,type:"io"},{name:"PIA",start:54016,size:4,type:"io"},{name:"ANTIC",start:54272,size:16,type:"io"},{name:"Cartridge Control Line",start:54784,size:256,type:"io"},{name:"ROM",start:55296,size:2048,type:"rom"},{name:"ATARI Character Set",start:57344,size:1024,type:"rom"},{name:"ROM",start:58368,size:7168,type:"rom"}]};function u(s){return s.endsWith(".bas")||s.endsWith(".fb")||s.endsWith(".fbi")?"fastbasic":d(s)}var A=class extends g{constructor(){super(...arguments);this.getToolForFilename=u;this.getOpcodeMetadata=c}getPresets(){return x}getDefaultExtension(){return".asm"}showHelp(e,t){e=="fastbasic"?window.open("https://github.com/dmsc/fastbasic/blob/master/manual.md","_help"):window.open("https://atariwiki.org/wiki/Wiki.jsp?page=Assembler","_help")}};var M=class extends A{constructor(){super(...arguments);this.getMemoryMap=function(){return f}}getPresets(){return B}loadROM(e,t){this.started?(this.loadROMFile(t),this.loadRegion(":cartleft:cart:rom",t)):this.startModule(this.mainElement,{jsfile:"mame8bitws.js",biosfile:"a800xl.zip",cfgfile:"a800xl.cfg",driver:"a800xl",width:336*2,height:225*2,romfn:"/emulator/cart.rom",romdata:new Uint8Array(t),romsize:8192,preInit:function(i){}})}start(){}},y=class extends A{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"Cartridge ROM",start:16384,size:32768,type:"rom"},{name:"GTIA",start:49152,size:32,type:"io"},{name:"ANTIC",start:54272,size:16,type:"io"},{name:"POKEY",start:59392,size:16,type:"io"},{name:"ATARI Character Set",start:63488,size:1024,type:"rom"},{name:"ROM",start:64512,size:1024,type:"rom"}]}}}loadROM(e,t){this.started?(this.loadROMFile(t),this.loadRegion(":cartleft:cart:rom",t)):this.startModule(this.mainElement,{jsfile:"mame8bitws.js",biosfile:"a5200/5200.rom",cfgfile:"a5200.cfg",driver:"a5200",width:336*2,height:225*2,romfn:"/emulator/cart.rom",romdata:new Uint8Array(t),romsize:32768,preInit:function(i){}})}start(){}};var w=class extends p{constructor(){super(...arguments);this.getToolForFilename=u}newMachine(){return new n("atari8")}getPresets(){return B}getDefaultExtension(){return".c"}readAddress(e){return this.machine.readConst(e)}getMemoryMap(){return f}showHelp(){}getROMExtension(e){return e&&e[0]==1&&e[1]==8?".prg":".bin"}},I=class extends w{};o["atari8-800xl.mame"]=M;o["atari8-5200.mame"]=y;o["atari8-800xl"]=I;
|
||||
//# sourceMappingURL=atari8-5TSJIAYK.js.map
|
||||
import{a as g}from"./chunk-XPSUBSUG.js";import{G as p,q as h,w as d,z as c}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as o,N as r,U as m,X as l}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";var n=class extends h{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=63;this.joymask0=0;this.joymask1=0}loadROM(e){super.loadROM(e),this.reloadROM()}reloadROM(){if(this.sys){var e=this.exports.machine_load_rom(this.sys,this.romptr,this.romlen);console.log("machine_load_rom",e)}}loadBIOS(e){super.loadBIOS(e)}reset(){super.reset(),this.reloadROM()}advanceFrame(e){return this.exports.machine_start_frame(this.sys),e?this.advanceFrameClock(e,999999):this.exports.machine_advance_frame(this.sys),this.syncVideo(),this.syncAudio(),1}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.stateptr);var e=this.statearr,t=e[6]+(e[7]<<8);return{PC:t,SP:e[2],A:e[0],X:e[3],Y:e[4],C:e[1]&1,Z:e[1]&2,I:e[1]&4,D:e[1]&8,V:e[1]&64,N:e[1]&128,o:this.readConst(t)}}saveState(){var e=this.getCPUState();return this.exports.machine_save_state(this.sys,this.stateptr),{c:e,state:this.statearr.slice(0)}}loadState(e){this.statearr.set(e.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:384,height:240,overscan:!0,videoFrequency:60}}pollControls(){}setKeyInput(e,t,i){i&r.Shift&&(e|=256),i&r.Ctrl&&(e|=512);var a=0;e==37&&(e=8,a=4),e==38&&(e=11,a=1),e==39&&(e=9,a=8),e==40&&(e=10,a=2),e==32&&(a=256),i&r.KeyDown?(this.exports.machine_key_down(this.sys,e),this.joymask0|=a):i&r.KeyUp&&(this.exports.machine_key_up(this.sys,e),this.joymask0&=~a),this.setJoyInput(0,this.joymask0),this.setJoyInput(1,this.joymask1)}setJoyInput(e,t){this.exports.machine_joy_set(this.sys,e,t)}setPaddleInput(e,t){this.exports.machine_paddle_set(this.sys,e,t)}};var x=[{id:"hello.dasm",name:"Hello World (ASM)"},{id:"hellopm.dasm",name:"Hello Sprites (ASM)"},{id:"helloconio.c",name:"Text Mode (C)"},{id:"siegegame.c",name:"Siege Game (C)"},{id:"hellodlist.c",name:"Display List (C)"}],B=x.concat([{id:"sieve.bas",name:"Benchmark (FastBasic)"},{id:"pmtest.bas",name:"Sprites Test (FastBasic)"},{id:"dli.bas",name:"DLI Test (FastBasic)"},{id:"joyas.bas",name:"Match-3 Game (FastBasic)"}]),Z=l([[m.VK_SPACE,0,0],[m.VK_ENTER,0,0]]),f={main:[{name:"RAM",start:0,size:65536,type:"ram"},{name:"Left Cartridge ROM",start:40960,size:8192,type:"rom"},{name:"GTIA",start:53248,size:32,type:"io"},{name:"POKEY",start:53760,size:16,type:"io"},{name:"PIA",start:54016,size:4,type:"io"},{name:"ANTIC",start:54272,size:16,type:"io"},{name:"Cartridge Control Line",start:54784,size:256,type:"io"},{name:"ROM",start:55296,size:2048,type:"rom"},{name:"ATARI Character Set",start:57344,size:1024,type:"rom"},{name:"ROM",start:58368,size:7168,type:"rom"}]};function u(s){return s.endsWith(".bas")||s.endsWith(".fb")||s.endsWith(".fbi")?"fastbasic":d(s)}var A=class extends g{constructor(){super(...arguments);this.getToolForFilename=u;this.getOpcodeMetadata=c}getPresets(){return x}getDefaultExtension(){return".asm"}showHelp(e,t){e=="fastbasic"?window.open("https://github.com/dmsc/fastbasic/blob/master/manual.md","_help"):window.open("https://atariwiki.org/wiki/Wiki.jsp?page=Assembler","_help")}};var M=class extends A{constructor(){super(...arguments);this.getMemoryMap=function(){return f}}getPresets(){return B}loadROM(e,t){this.started?(this.loadROMFile(t),this.loadRegion(":cartleft:cart:rom",t)):this.startModule(this.mainElement,{jsfile:"mame8bitws.js",biosfile:"a800xl.zip",cfgfile:"a800xl.cfg",driver:"a800xl",width:336*2,height:225*2,romfn:"/emulator/cart.rom",romdata:new Uint8Array(t),romsize:8192,preInit:function(i){}})}start(){}},y=class extends A{constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"Cartridge ROM",start:16384,size:32768,type:"rom"},{name:"GTIA",start:49152,size:32,type:"io"},{name:"ANTIC",start:54272,size:16,type:"io"},{name:"POKEY",start:59392,size:16,type:"io"},{name:"ATARI Character Set",start:63488,size:1024,type:"rom"},{name:"ROM",start:64512,size:1024,type:"rom"}]}}}loadROM(e,t){this.started?(this.loadROMFile(t),this.loadRegion(":cartleft:cart:rom",t)):this.startModule(this.mainElement,{jsfile:"mame8bitws.js",biosfile:"a5200/5200.rom",cfgfile:"a5200.cfg",driver:"a5200",width:336*2,height:225*2,romfn:"/emulator/cart.rom",romdata:new Uint8Array(t),romsize:32768,preInit:function(i){}})}start(){}};var w=class extends p{constructor(){super(...arguments);this.getToolForFilename=u}newMachine(){return new n("atari8")}getPresets(){return B}getDefaultExtension(){return".c"}readAddress(e){return this.machine.readConst(e)}getMemoryMap(){return f}showHelp(){}getROMExtension(e){return e&&e[0]==1&&e[1]==8?".prg":".bin"}},I=class extends w{};o["atari8-800xl.mame"]=M;o["atari8-5200.mame"]=y;o["atari8-800xl"]=I;
|
||||
//# sourceMappingURL=atari8-3D24MBZE.js.map
|
File diff suppressed because one or more lines are too long
@ -1,3 +1,3 @@
|
||||
import{a as u}from"./chunk-VD5NND7R.js";import{G as x,p as h,w as p,z as d}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as i,N as o,g as l}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var m=class extends h{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=63;this.joymask0=0;this.joymask1=0}loadBIOS(t){var s=59940-57344+12288;t[s]=96,super.loadBIOS(t)}reset(){super.reset();for(var t=0;t<128;t++)this.setKeyInput(t,0,o.KeyUp);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&&(this.prgstart=this.romarr[2]+(this.romarr[3]<<8)+2,console.log("prgstart",l(this.prgstart))),this.prgstart<32768){this.exports.machine_exec(this.sys,25e4);for(var s="SYS "+this.prgstart+"\r",e=0;e<s.length;e++){var r=s.charCodeAt(e);this.exports.machine_exec(this.sys,2e4),this.exports.machine_key_down(this.sys,r),this.exports.machine_exec(this.sys,2e4),this.exports.machine_key_up(this.sys,r)}for(var e=0;e<1e5&&this.getPC()!=this.prgstart;e++)this.exports.machine_tick(this.sys)}else{this.exports.machine_exec(this.sys,100);for(var a=this.romarr[4]+this.romarr[5]*256,e=0;e<15e4&&this.getPC()!=a;e++)this.exports.machine_tick(this.sys)}}advanceFrame(t){var s=this.exports.machine_get_raster_line(this.sys),e=Math.floor((this.numTotalScanlines-s)*(19656+295)/this.numTotalScanlines),r=this.probe!=null;return r&&this.exports.machine_reset_probe_buffer(),e=super.advanceFrameClock(t,e),r&&this.copyProbeData(),e}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,s=t[2]+(t[3]<<8);return{PC:s,SP:t[9],A:t[6],X:t[7],Y:t[8],C:t[10]&1,Z:t[10]&2,I:t[10]&4,D:t[10]&8,V:t[10]&64,N:t[10]&128,o:this.readConst(s)}}saveState(){return this.exports.machine_save_state(this.sys,this.stateptr),{c:this.getCPUState(),state:this.statearr.slice(0),ram:this.statearr.slice(18640,18640+512)}}loadState(t){this.statearr.set(t.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:392,height:272,overscan:!0,videoFrequency:50}}setKeyInput(t,s,e){if(!(t==16||t==17||t==18||t==224)){var r=0,a=0;t==37&&(t=8,r=4),t==38&&(t=11,r=1),t==39&&(t=9,r=8),t==40&&(t=10,r=2),t==32&&(r=16),t==113&&(t=241),t==115&&(t=243),t==119&&(t=245),t==121&&(t=247),e&o.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=r,this.joymask1|=a):e&o.KeyUp&&(this.exports.machine_key_up(this.sys,t),this.joymask0&=~r,this.joymask1&=~a),this.exports.c64_joystick(this.sys,this.joymask0,this.joymask1)}}};var f=[{id:"hello.dasm",name:"Hello World (ASM)"},{id:"eliza.c",name:"Eliza (C)"},{id:"tgidemo.c",name:"TGI Graphics Demo (C)"},{id:"upandaway.c",name:"Up, Up and Away (C)"},{id:"joymove.c",name:"Joystick Movement (C)"},{id:"siegegame.c",name:"Siege Game (C)"},{id:"scroll1.c",name:"Scrolling 1 (C)"},{id:"scroll2.c",name:"Scrolling 2 (C)"},{id:"scroll3.c",name:"Scrolling 3 (C)"},{id:"scroll4.c",name:"Scrolling 4 (C)"},{id:"scroll5.c",name:"Scrolling 5 (C)"},{id:"climber.c",name:"Climber Game (C)"},{id:"multilines.c",name:"Multicolor Lines+Flood Fill (C)"},{id:"sidtune.dasm",name:"SID Tune (ASM)"},{id:"musicplayer.c",name:"Music Player (C)"}],g={main:[{name:"6510 Registers",start:0,size:2,type:"io"},{name:"Cartridge ROM",start:32768,size:8192,type:"rom"},{name:"BASIC ROM",start:40960,size:8192,type:"rom"},{name:"RAM",start:49152,size:4096,type:"ram"},{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"}]},n=class extends x{newMachine(){return new m("c64")}getPresets(){return f}getDefaultExtension(){return".c"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return g}showHelp(){window.open("https://8bitworkshop.com/docs/platforms/c64/","_help")}getROMExtension(t){return t&&t[0]==1&&t[1]==8?".prg":".bin"}},y=class extends u{constructor(){super(...arguments);this.getToolForFilename=p;this.getOpcodeMetadata=d}getPresets(){return f}getDefaultExtension(){return".c"}loadROM(t,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
|
||||
import{a as u}from"./chunk-XPSUBSUG.js";import{G as x,p as h,w as p,z as d}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as i,N as o,g as l}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";var m=class extends h{constructor(){super(...arguments);this.numTotalScanlines=312;this.cpuCyclesPerLine=63;this.joymask0=0;this.joymask1=0}loadBIOS(t){var s=59940-57344+12288;t[s]=96,super.loadBIOS(t)}reset(){super.reset();for(var t=0;t<128;t++)this.setKeyInput(t,0,o.KeyUp);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&&(this.prgstart=this.romarr[2]+(this.romarr[3]<<8)+2,console.log("prgstart",l(this.prgstart))),this.prgstart<32768){this.exports.machine_exec(this.sys,25e4);for(var s="SYS "+this.prgstart+"\r",e=0;e<s.length;e++){var r=s.charCodeAt(e);this.exports.machine_exec(this.sys,2e4),this.exports.machine_key_down(this.sys,r),this.exports.machine_exec(this.sys,2e4),this.exports.machine_key_up(this.sys,r)}for(var e=0;e<1e5&&this.getPC()!=this.prgstart;e++)this.exports.machine_tick(this.sys)}else{this.exports.machine_exec(this.sys,100);for(var a=this.romarr[4]+this.romarr[5]*256,e=0;e<15e4&&this.getPC()!=a;e++)this.exports.machine_tick(this.sys)}}advanceFrame(t){var s=this.exports.machine_get_raster_line(this.sys),e=Math.floor((this.numTotalScanlines-s)*(19656+295)/this.numTotalScanlines),r=this.probe!=null;return r&&this.exports.machine_reset_probe_buffer(),e=super.advanceFrameClock(t,e),r&&this.copyProbeData(),e}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,s=t[2]+(t[3]<<8);return{PC:s,SP:t[9],A:t[6],X:t[7],Y:t[8],C:t[10]&1,Z:t[10]&2,I:t[10]&4,D:t[10]&8,V:t[10]&64,N:t[10]&128,o:this.readConst(s)}}saveState(){return this.exports.machine_save_state(this.sys,this.stateptr),{c:this.getCPUState(),state:this.statearr.slice(0),ram:this.statearr.slice(18640,18640+512)}}loadState(t){this.statearr.set(t.state),this.exports.machine_load_state(this.sys,this.stateptr)}getVideoParams(){return{width:392,height:272,overscan:!0,videoFrequency:50}}setKeyInput(t,s,e){if(!(t==16||t==17||t==18||t==224)){var r=0,a=0;t==37&&(t=8,r=4),t==38&&(t=11,r=1),t==39&&(t=9,r=8),t==40&&(t=10,r=2),t==32&&(r=16),t==113&&(t=241),t==115&&(t=243),t==119&&(t=245),t==121&&(t=247),e&o.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=r,this.joymask1|=a):e&o.KeyUp&&(this.exports.machine_key_up(this.sys,t),this.joymask0&=~r,this.joymask1&=~a),this.exports.c64_joystick(this.sys,this.joymask0,this.joymask1)}}};var f=[{id:"hello.dasm",name:"Hello World (ASM)"},{id:"eliza.c",name:"Eliza (C)"},{id:"tgidemo.c",name:"TGI Graphics Demo (C)"},{id:"upandaway.c",name:"Up, Up and Away (C)"},{id:"joymove.c",name:"Joystick Movement (C)"},{id:"siegegame.c",name:"Siege Game (C)"},{id:"scroll1.c",name:"Scrolling 1 (C)"},{id:"scroll2.c",name:"Scrolling 2 (C)"},{id:"scroll3.c",name:"Scrolling 3 (C)"},{id:"scroll4.c",name:"Scrolling 4 (C)"},{id:"scroll5.c",name:"Scrolling 5 (C)"},{id:"climber.c",name:"Climber Game (C)"},{id:"multilines.c",name:"Multicolor Lines+Flood Fill (C)"},{id:"sidtune.dasm",name:"SID Tune (ASM)"},{id:"musicplayer.c",name:"Music Player (C)"}],g={main:[{name:"6510 Registers",start:0,size:2,type:"io"},{name:"Cartridge ROM",start:32768,size:8192,type:"rom"},{name:"BASIC ROM",start:40960,size:8192,type:"rom"},{name:"RAM",start:49152,size:4096,type:"ram"},{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"}]},n=class extends x{newMachine(){return new m("c64")}getPresets(){return f}getDefaultExtension(){return".c"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return g}showHelp(){window.open("https://8bitworkshop.com/docs/platforms/c64/","_help")}getROMExtension(t){return t&&t[0]==1&&t[1]==8?".prg":".bin"}},y=class extends u{constructor(){super(...arguments);this.getToolForFilename=p;this.getOpcodeMetadata=d}getPresets(){return f}getDefaultExtension(){return".c"}loadROM(t,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(r){}});else{this.loadROMFile(s),this.loadRegion(":quickload",s);var e=this.luacall('image:load("/emulator/image.prg")');console.log("load rom",e)}}start(){}getMemoryMap(){return g}};i.c64=n;i["c64.wasm"]=n;i["c64.mame"]=y;
|
||||
//# sourceMappingURL=c64-56IZBEWI.js.map
|
||||
//# sourceMappingURL=c64-GZC5POAK.js.map
|
@ -1,2 +1,2 @@
|
||||
import{K as a,L as l}from"./chunk-VOKPYVET.js";var u=class{constructor(t){this.checkpointInterval=10;this.maxCheckpoints=300;this.reset(),this.platform=t}reset(){this.checkpoints=[],this.framerecs=[],this.frameCount=0,this.lastSeekFrame=0,this.lastSeekStep=0,this.lastStepCount=0,this.callbackStateChanged&&this.callbackStateChanged()}frameRequested(){var t={controls:this.platform.saveControlsState(),seed:a()},e=!1;return this.lastSeekFrame<this.frameCount?this.loadControls(this.lastSeekFrame):(this.platform.saveControlsState&&this.framerecs.push(t),e=this.frameCount++%this.checkpointInterval==0),this.lastSeekFrame++,this.lastSeekStep=0,this.callbackStateChanged&&this.callbackStateChanged(),e}numFrames(){return this.frameCount}currentFrame(){return this.lastSeekFrame}currentStep(){return this.lastSeekStep}recordFrame(t){this.checkpoints.push(t),this.callbackNewCheckpoint&&this.callbackNewCheckpoint(t),this.checkpoints.length>this.maxCheckpoints&&(this.checkpoints.shift(),this.framerecs=this.framerecs.slice(this.checkpointInterval),this.lastSeekFrame-=this.checkpointInterval,this.frameCount-=this.checkpointInterval,this.callbackStateChanged&&this.callbackStateChanged())}getStateAtOrBefore(t){if(t<=0&&this.checkpoints.length>0)return{frame:0,state:this.checkpoints[0]};var e=Math.floor(t/this.checkpointInterval),s=e<this.checkpoints.length?e:this.checkpoints.length-1,h=s*this.checkpointInterval;return{frame:h,state:this.checkpoints[s]}}loadFrame(t,e){if(t|=0,e|=0,t==this.lastSeekFrame&&e==this.lastSeekStep)return t;let{frame:s,state:h}=this.getStateAtOrBefore(t-1);if(h){var n=0;for(this.platform.pause(),this.platform.loadState(h);s<t;)s<this.framerecs.length&&this.loadControls(s),s++,n=this.platform.advance(s<t);return s==0&&(n=this.platform.advance(!0),this.platform.loadState(h)),e>0&&this.platform.advanceFrameClock&&(e=this.platform.advanceFrameClock(null,e)),this.lastSeekFrame=t,this.lastSeekStep=e,this.lastStepCount=n,t}else return-1}loadControls(t){this.platform.loadControlsState&&this.platform.loadControlsState(this.framerecs[t].controls),l(this.framerecs[t].seed)}getLastCheckpoint(){return this.checkpoints.length&&this.checkpoints[this.checkpoints.length-1]}},r;(function(i){i[i.CLOCKS=0]="CLOCKS",i[i.EXECUTE=16777216]="EXECUTE",i[i.HAS_VALUE=268435456]="HAS_VALUE",i[i.MEM_READ=301989888]="MEM_READ",i[i.MEM_WRITE=318767104]="MEM_WRITE",i[i.IO_READ=335544320]="IO_READ",i[i.IO_WRITE=352321536]="IO_WRITE",i[i.VRAM_READ=369098752]="VRAM_READ",i[i.VRAM_WRITE=385875968]="VRAM_WRITE",i[i.INTERRUPT=134217728]="INTERRUPT",i[i.ILLEGAL=150994944]="ILLEGAL",i[i.SP_PUSH=167772160]="SP_PUSH",i[i.SP_POP=184549376]="SP_POP",i[i.SCANLINE=2113929216]="SCANLINE",i[i.FRAME=2130706432]="FRAME"})(r||(r={}));var m=class{constructor(t,e){this.idx=0;this.sl=0;this.cur_sp=-1;this.singleFrame=!0;this.m=t,this.reset(e||1048576)}start(){this.m.connectProbe(this)}stop(){this.m.connectProbe(null)}reset(t){t&&(this.buf=new Uint32Array(t)),this.sl=0,this.cur_sp=-1,this.clear()}clear(){this.idx=0}logData(t){this.log(t)}log(t){this.idx>=this.buf.length||(this.buf[this.idx++]=t)}relog(t){this.buf[this.idx-1]=t}lastOp(){return this.idx>0?this.buf[this.idx-1]&4278190080:-1}lastAddr(){return this.idx>0?this.buf[this.idx-1]&16777215:-1}addLogBuffer(t){this.idx+t.length>this.buf.length&&(t=t.slice(0,this.buf.length-this.idx)),this.buf.set(t,this.idx),this.idx+=t.length}logClocks(t){t|=0,t>0&&(this.lastOp()==0?this.relog(this.lastAddr()+t|0):this.log(t|0))}logNewScanline(){this.log(2113929216),this.sl++}logNewFrame(){this.log(2130706432),this.sl=0,this.singleFrame&&this.clear()}logExecute(t,e){this.cur_sp!==e&&(e<this.cur_sp&&this.log(167772160|e),e>this.cur_sp&&this.log(184549376|e),this.cur_sp=e),this.log(t|16777216)}logInterrupt(t){this.log(t|134217728)}logValue(t,e,s){this.log(t&65535|(e&255)<<16|s)}logRead(t,e){this.logValue(t,e,301989888)}logWrite(t,e){this.logValue(t,e,318767104)}logIORead(t,e){this.logValue(t,e,335544320)}logIOWrite(t,e){this.logValue(t,e,352321536)}logVRAMRead(t,e){this.logValue(t,e,369098752)}logVRAMWrite(t,e){this.logValue(t,e,385875968)}logIllegal(t){this.log(t|150994944)}countEvents(t){for(var e=0,s=0;s<this.idx;s++)(this.buf[s]&4278190080)==t&&e++;return e}countClocks(){for(var t=0,e=0;e<this.idx;e++)(this.buf[e]&4278190080)==0&&(t+=this.buf[e]&65535);return t}};export{u as a,r as b,m as c};
|
||||
//# sourceMappingURL=chunk-JM5NHRL4.js.map
|
||||
import{K as a,L as l}from"./chunk-ZDSSTLWD.js";var u=class{constructor(t){this.checkpointInterval=10;this.maxCheckpoints=300;this.reset(),this.platform=t}reset(){this.checkpoints=[],this.framerecs=[],this.frameCount=0,this.lastSeekFrame=0,this.lastSeekStep=0,this.lastStepCount=0,this.callbackStateChanged&&this.callbackStateChanged()}frameRequested(){var t={controls:this.platform.saveControlsState(),seed:a()},e=!1;return this.lastSeekFrame<this.frameCount?this.loadControls(this.lastSeekFrame):(this.platform.saveControlsState&&this.framerecs.push(t),e=this.frameCount++%this.checkpointInterval==0),this.lastSeekFrame++,this.lastSeekStep=0,this.callbackStateChanged&&this.callbackStateChanged(),e}numFrames(){return this.frameCount}currentFrame(){return this.lastSeekFrame}currentStep(){return this.lastSeekStep}recordFrame(t){this.checkpoints.push(t),this.callbackNewCheckpoint&&this.callbackNewCheckpoint(t),this.checkpoints.length>this.maxCheckpoints&&(this.checkpoints.shift(),this.framerecs=this.framerecs.slice(this.checkpointInterval),this.lastSeekFrame-=this.checkpointInterval,this.frameCount-=this.checkpointInterval,this.callbackStateChanged&&this.callbackStateChanged())}getStateAtOrBefore(t){if(t<=0&&this.checkpoints.length>0)return{frame:0,state:this.checkpoints[0]};var e=Math.floor(t/this.checkpointInterval),s=e<this.checkpoints.length?e:this.checkpoints.length-1,h=s*this.checkpointInterval;return{frame:h,state:this.checkpoints[s]}}loadFrame(t,e){if(t|=0,e|=0,t==this.lastSeekFrame&&e==this.lastSeekStep)return t;let{frame:s,state:h}=this.getStateAtOrBefore(t-1);if(h){var n=0;for(this.platform.pause(),this.platform.loadState(h);s<t;)s<this.framerecs.length&&this.loadControls(s),s++,n=this.platform.advance(s<t);return s==0&&(n=this.platform.advance(!0),this.platform.loadState(h)),e>0&&this.platform.advanceFrameClock&&(e=this.platform.advanceFrameClock(null,e)),this.lastSeekFrame=t,this.lastSeekStep=e,this.lastStepCount=n,t}else return-1}loadControls(t){this.platform.loadControlsState&&this.platform.loadControlsState(this.framerecs[t].controls),l(this.framerecs[t].seed)}getLastCheckpoint(){return this.checkpoints.length&&this.checkpoints[this.checkpoints.length-1]}},r;(function(i){i[i.CLOCKS=0]="CLOCKS",i[i.EXECUTE=16777216]="EXECUTE",i[i.HAS_VALUE=268435456]="HAS_VALUE",i[i.MEM_READ=301989888]="MEM_READ",i[i.MEM_WRITE=318767104]="MEM_WRITE",i[i.IO_READ=335544320]="IO_READ",i[i.IO_WRITE=352321536]="IO_WRITE",i[i.VRAM_READ=369098752]="VRAM_READ",i[i.VRAM_WRITE=385875968]="VRAM_WRITE",i[i.INTERRUPT=134217728]="INTERRUPT",i[i.ILLEGAL=150994944]="ILLEGAL",i[i.SP_PUSH=167772160]="SP_PUSH",i[i.SP_POP=184549376]="SP_POP",i[i.SCANLINE=2113929216]="SCANLINE",i[i.FRAME=2130706432]="FRAME"})(r||(r={}));var m=class{constructor(t,e){this.idx=0;this.sl=0;this.cur_sp=-1;this.singleFrame=!0;this.m=t,this.reset(e||1048576)}start(){this.m.connectProbe(this)}stop(){this.m.connectProbe(null)}reset(t){t&&(this.buf=new Uint32Array(t)),this.sl=0,this.cur_sp=-1,this.clear()}clear(){this.idx=0}logData(t){this.log(t)}log(t){this.idx>=this.buf.length||(this.buf[this.idx++]=t)}relog(t){this.buf[this.idx-1]=t}lastOp(){return this.idx>0?this.buf[this.idx-1]&4278190080:-1}lastAddr(){return this.idx>0?this.buf[this.idx-1]&16777215:-1}addLogBuffer(t){this.idx+t.length>this.buf.length&&(t=t.slice(0,this.buf.length-this.idx)),this.buf.set(t,this.idx),this.idx+=t.length}logClocks(t){t|=0,t>0&&(this.lastOp()==0?this.relog(this.lastAddr()+t|0):this.log(t|0))}logNewScanline(){this.log(2113929216),this.sl++}logNewFrame(){this.log(2130706432),this.sl=0,this.singleFrame&&this.clear()}logExecute(t,e){this.cur_sp!==e&&(e<this.cur_sp&&this.log(167772160|e),e>this.cur_sp&&this.log(184549376|e),this.cur_sp=e),this.log(t|16777216)}logInterrupt(t){this.log(t|134217728)}logValue(t,e,s){this.log(t&65535|(e&255)<<16|s)}logRead(t,e){this.logValue(t,e,301989888)}logWrite(t,e){this.logValue(t,e,318767104)}logIORead(t,e){this.logValue(t,e,335544320)}logIOWrite(t,e){this.logValue(t,e,352321536)}logVRAMRead(t,e){this.logValue(t,e,369098752)}logVRAMWrite(t,e){this.logValue(t,e,385875968)}logIllegal(t){this.log(t|150994944)}countEvents(t){for(var e=0,s=0;s<this.idx;s++)(this.buf[s]&4278190080)==t&&e++;return e}countClocks(){for(var t=0,e=0;e<this.idx;e++)(this.buf[e]&4278190080)==0&&(t+=this.buf[e]&65535);return t}};export{u as a,r as b,m as c};
|
||||
//# sourceMappingURL=chunk-5B4VPQ4V.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{c as x}from"./chunk-5XVCUSSZ.js";var E=x((f,d)=>{(function(c,i){typeof define=="function"&&define.amd?define([],i):typeof f!="undefined"?i():(i(),c.FileSaver={})})(f,function(){"use strict";function c(e,t){return typeof t=="undefined"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){p(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,w=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(e,t,n){var r=a.URL||a.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?l(o):v(o.href)?i(e,t,n):l(o,o.target="_blank")):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){l(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(c(e,n),t);else if(v(e))i(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){l(r)})}}:function(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,n);var o=e.type==="application/octet-stream",b=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&b||w)&&typeof FileReader!="undefined"){var m=new FileReader;m.onloadend=function(){var s=m.result;s=y?s:s.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=s:location=s,r=null},m.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,u=h.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){h.revokeObjectURL(u)},4e4)}});a.saveAs=p.saveAs=p,typeof d!="undefined"&&(d.exports=p)})});function g(c){switch(c){case"apple2":return import("./apple2-C7CSPQ33.js");case"arm32":return import("./arm32-32CWPLI3.js");case"astrocade":return import("./astrocade-OKOMBZM2.js");case"atari7800":return import("./atari7800-QU2XJDVM.js");case"atari8":return import("./atari8-5TSJIAYK.js");case"basic":return import("./basic-DP43RDWM.js");case"c64":return import("./c64-56IZBEWI.js");case"coleco":return import("./coleco-EBMJUP4T.js");case"cpc":return import("./cpc-INI5TYZK.js");case"devel":return import("./devel-IUFGDZ3J.js");case"galaxian":return import("./galaxian-DSJTHBWW.js");case"kim1":return import("./kim1-IK2XJ354.js");case"markdown":return import("./markdown-3OKXF7BI.js");case"msx":return import("./msx-I635A3G2.js");case"mw8080bw":return import("./mw8080bw-GEN2OQJD.js");case"nes":return import("./nes-JRPIXPUQ.js");case"script":return import("./script-B7KQC3KR.js");case"sms":return import("./sms-JYZTOW6M.js");case"sound_konami":return import("./sound_konami-ZTQ2YZMZ.js");case"sound_williams":return import("./sound_williams-O3GGVKQY.js");case"vcs":return import("./vcs-JQ6YN3Q3.js");case"vector":return import("./vector-RV52LY7J.js");case"vectrex":return import("./vectrex-XTEVL2ST.js");case"verilog":return import("./verilog-VV33MJ4Z.js");case"vic20":return import("./vic20-RKV2ICA5.js");case"vicdual":return import("./vicdual-ES7Y77LX.js");case"williams":return import("./williams-RRVBPADN.js");case"x86":return import("./x86-VPTP6IV2.js");case"zmachine":return import("./zmachine-G6GNDZUX.js");case"zx":return import("./zx-CLH5TLWB.js");default:throw new Error(`Platform not recognized: '${c}'`)}}export{g as a,E as b};
|
||||
//# sourceMappingURL=chunk-7IBR52CF.js.map
|
||||
import{c as x}from"./chunk-5XVCUSSZ.js";var E=x((f,d)=>{(function(c,i){typeof define=="function"&&define.amd?define([],i):typeof f!="undefined"?i():(i(),c.FileSaver={})})(f,function(){"use strict";function c(e,t){return typeof t=="undefined"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){p(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,w=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(e,t,n){var r=a.URL||a.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?l(o):v(o.href)?i(e,t,n):l(o,o.target="_blank")):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){l(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(c(e,n),t);else if(v(e))i(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){l(r)})}}:function(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,n);var o=e.type==="application/octet-stream",b=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&b||w)&&typeof FileReader!="undefined"){var m=new FileReader;m.onloadend=function(){var s=m.result;s=y?s:s.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=s:location=s,r=null},m.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,u=h.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){h.revokeObjectURL(u)},4e4)}});a.saveAs=p.saveAs=p,typeof d!="undefined"&&(d.exports=p)})});function g(c){switch(c){case"apple2":return import("./apple2-H22D37EU.js");case"arm32":return import("./arm32-74VUYCYT.js");case"astrocade":return import("./astrocade-V6AO5FSN.js");case"atari7800":return import("./atari7800-WXTPSC5M.js");case"atari8":return import("./atari8-3D24MBZE.js");case"basic":return import("./basic-5LZDWHLX.js");case"c64":return import("./c64-GZC5POAK.js");case"coleco":return import("./coleco-M4HXPR4M.js");case"cpc":return import("./cpc-4U2LEU66.js");case"devel":return import("./devel-4ALBT3HO.js");case"galaxian":return import("./galaxian-B23NWWVJ.js");case"kim1":return import("./kim1-XN2SDPG5.js");case"markdown":return import("./markdown-SPPH7JDJ.js");case"msx":return import("./msx-GZ3LPP3D.js");case"mw8080bw":return import("./mw8080bw-C26LYF3I.js");case"nes":return import("./nes-DIK3FKJG.js");case"script":return import("./script-NR35TBVT.js");case"sms":return import("./sms-B2MIBBZY.js");case"sound_konami":return import("./sound_konami-HSHUR3JJ.js");case"sound_williams":return import("./sound_williams-NKTPLGE3.js");case"vcs":return import("./vcs-ICYYLR5A.js");case"vector":return import("./vector-22T2RHG5.js");case"vectrex":return import("./vectrex-Q742MIC7.js");case"verilog":return import("./verilog-UGUMHJJU.js");case"vic20":return import("./vic20-SGGF5CFV.js");case"vicdual":return import("./vicdual-64UNHMTT.js");case"williams":return import("./williams-AAYRYE6M.js");case"x86":return import("./x86-BIXLY4TN.js");case"zmachine":return import("./zmachine-PIND3QXR.js");case"zx":return import("./zx-73WXGMP5.js");default:throw new Error(`Platform not recognized: '${c}'`)}}export{g as a,E as b};
|
||||
//# sourceMappingURL=chunk-U54L2MMB.js.map
|
@ -1,4 +1,4 @@
|
||||
import{A as w,a as p,b as P,y as C}from"./chunk-2T5IQXGX.js";import{O as b,Q as v,S}from"./chunk-VOKPYVET.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 w,a as p,b as P,y as C}from"./chunk-SFNCS4L7.js";import{O as b,Q as v,S}from"./chunk-ZDSSTLWD.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-VD5NND7R.js.map
|
||||
//# sourceMappingURL=chunk-XPSUBSUG.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,2 +1,2 @@
|
||||
import{c as _,g as i}from"./chunk-VOKPYVET.js";var p=[[{N:0},{N:1}],[{N:1},{N:0}],[{V:0},{V:1}],[{V:1},{V:0}],[{C:0},{C:1}],[{C:1},{C:0}],[{Z:0},{Z:1}],[{Z:1},{Z:0}]];function d(C,e){if(C==null||e==null)return null;for(var s in C)if(e[s]!=="undefined")return C[s]==e[s];for(var s in e)if(C[s]!=="undefined")return C[s]==e[s];return null}var S=class{constructor(e){this.pc2minclocks={};this.pc2maxclocks={};this.jsrresult={};this.MAX_CYCLES=2e3;this.platform=e}getClockCountsAtPC(e){var s=this.platform.readAddress(e),t=this.platform.getOpcodeMetadata(s,e);return t}traceInstructions(e,s,t,n,o){this.WRAP_CLOCKS&&(this.pc2minclocks[e]!==void 0&&(s=Math.min(s,this.pc2minclocks[e])),this.pc2maxclocks[e]!==void 0&&(t=Math.max(t,this.pc2maxclocks[e]))),o||(o={});for(var c=!0,x=!1,L=0;c&&!x;L++){if(L>=this.MAX_CYCLES){console.log("too many cycles @",i(e),"routine",i(n));break}c=!1,this.WRAP_CLOCKS&&s>=this.MAX_CLOCKS?(s=s%this.MAX_CLOCKS,t=t%this.MAX_CLOCKS):(s=Math.min(this.MAX_CLOCKS,s),t=Math.min(this.MAX_CLOCKS,t));var r=this.getClockCountsAtPC(e),l=this.platform.readAddress(e+1),m=this.platform.readAddress(e+2),u=l+(m<<8),f=e;if(s>=this.pc2minclocks[f]||(this.pc2minclocks[f]=s,c=!0),t<=this.pc2maxclocks[f]||(this.pc2maxclocks[f]=t,c=!0),!r.insnlength){console.log("Illegal instruction!",i(e),i(r.opcode),r);break}e+=r.insnlength;var A=o;switch(o=null,r.opcode){case 25:case 29:case 57:case 61:case 89:case 93:case 121:case 125:case 153:case 157:case 169:case 173:case 185:case 189:case 188:case 190:case 217:case 221:case 249:case 253:l==0&&(r.maxCycles-=1);break;case 133:l==2&&(s=t=0,r.minCycles=r.maxCycles=0);break;case 44:l==2&&m==32&&(s=0,t=4,r.minCycles=r.maxCycles=0);break;case 32:s+=r.minCycles,t+=r.maxCycles,this.traceInstructions(u,s,t,u,o);var a=this.jsrresult[u];a?(s=a.minclocks,t=a.maxclocks):(console.log("No JSR result!",i(e),i(u)),s=t);break;case 76:e=u;break;case 64:x=!0;break;case 96:if(n){var a=this.jsrresult[n];a?a={minclocks:Math.min(s,a.minclocks),maxclocks:Math.max(t,a.maxclocks)}:a={minclocks:s,maxclocks:t},this.jsrresult[n]=a,console.log("RTS",i(e),i(n),this.jsrresult[n])}return;case 16:case 48:case 80:case 112:case 144:case 176:case 208:case 240:var O=e+_(l),y=e>>8!=O>>8;y||r.maxCycles--;var h=p[Math.floor((r.opcode-16)/32)],b=d(A,h[0]),K=d(A,h[1]);this.traceInstructions(O,s+r.maxCycles,t+r.maxCycles,n,h[0]),K===!1&&(console.log("branch always taken",i(e),A,h[1]),x=!0),o=h[1],r.maxCycles=r.minCycles;break;case 108:console.log("Instruction not supported!",i(e),i(r.opcode),r);return}s+=r.minCycles,t+=r.maxCycles}}showLoopTimingForPC(e){this.pc2minclocks={},this.pc2maxclocks={},this.jsrresult={},this.traceInstructions(e|this.platform.getOriginPC(),this.START_CLOCKS,this.MAX_CLOCKS,0,{})}},M=class extends S{constructor(e){super(e);this.MAX_CLOCKS=this.START_CLOCKS=76*4,this.WRAP_CLOCKS=!1}},v=class extends S{constructor(e){super(e);this.MAX_CLOCKS=114,this.START_CLOCKS=0,this.WRAP_CLOCKS=!0}};export{M as a,v as b};
|
||||
//# sourceMappingURL=chunk-5JXVXIWK.js.map
|
||||
import{c as _,g as i}from"./chunk-ZDSSTLWD.js";var p=[[{N:0},{N:1}],[{N:1},{N:0}],[{V:0},{V:1}],[{V:1},{V:0}],[{C:0},{C:1}],[{C:1},{C:0}],[{Z:0},{Z:1}],[{Z:1},{Z:0}]];function d(C,e){if(C==null||e==null)return null;for(var s in C)if(e[s]!=="undefined")return C[s]==e[s];for(var s in e)if(C[s]!=="undefined")return C[s]==e[s];return null}var S=class{constructor(e){this.pc2minclocks={};this.pc2maxclocks={};this.jsrresult={};this.MAX_CYCLES=2e3;this.platform=e}getClockCountsAtPC(e){var s=this.platform.readAddress(e),t=this.platform.getOpcodeMetadata(s,e);return t}traceInstructions(e,s,t,n,o){this.WRAP_CLOCKS&&(this.pc2minclocks[e]!==void 0&&(s=Math.min(s,this.pc2minclocks[e])),this.pc2maxclocks[e]!==void 0&&(t=Math.max(t,this.pc2maxclocks[e]))),o||(o={});for(var c=!0,x=!1,L=0;c&&!x;L++){if(L>=this.MAX_CYCLES){console.log("too many cycles @",i(e),"routine",i(n));break}c=!1,this.WRAP_CLOCKS&&s>=this.MAX_CLOCKS?(s=s%this.MAX_CLOCKS,t=t%this.MAX_CLOCKS):(s=Math.min(this.MAX_CLOCKS,s),t=Math.min(this.MAX_CLOCKS,t));var r=this.getClockCountsAtPC(e),l=this.platform.readAddress(e+1),m=this.platform.readAddress(e+2),u=l+(m<<8),f=e;if(s>=this.pc2minclocks[f]||(this.pc2minclocks[f]=s,c=!0),t<=this.pc2maxclocks[f]||(this.pc2maxclocks[f]=t,c=!0),!r.insnlength){console.log("Illegal instruction!",i(e),i(r.opcode),r);break}e+=r.insnlength;var A=o;switch(o=null,r.opcode){case 25:case 29:case 57:case 61:case 89:case 93:case 121:case 125:case 153:case 157:case 169:case 173:case 185:case 189:case 188:case 190:case 217:case 221:case 249:case 253:l==0&&(r.maxCycles-=1);break;case 133:l==2&&(s=t=0,r.minCycles=r.maxCycles=0);break;case 44:l==2&&m==32&&(s=0,t=4,r.minCycles=r.maxCycles=0);break;case 32:s+=r.minCycles,t+=r.maxCycles,this.traceInstructions(u,s,t,u,o);var a=this.jsrresult[u];a?(s=a.minclocks,t=a.maxclocks):(console.log("No JSR result!",i(e),i(u)),s=t);break;case 76:e=u;break;case 64:x=!0;break;case 96:if(n){var a=this.jsrresult[n];a?a={minclocks:Math.min(s,a.minclocks),maxclocks:Math.max(t,a.maxclocks)}:a={minclocks:s,maxclocks:t},this.jsrresult[n]=a,console.log("RTS",i(e),i(n),this.jsrresult[n])}return;case 16:case 48:case 80:case 112:case 144:case 176:case 208:case 240:var O=e+_(l),y=e>>8!=O>>8;y||r.maxCycles--;var h=p[Math.floor((r.opcode-16)/32)],b=d(A,h[0]),K=d(A,h[1]);this.traceInstructions(O,s+r.maxCycles,t+r.maxCycles,n,h[0]),K===!1&&(console.log("branch always taken",i(e),A,h[1]),x=!0),o=h[1],r.maxCycles=r.minCycles;break;case 108:console.log("Instruction not supported!",i(e),i(r.opcode),r);return}s+=r.minCycles,t+=r.maxCycles}}showLoopTimingForPC(e){this.pc2minclocks={},this.pc2maxclocks={},this.jsrresult={},this.traceInstructions(e|this.platform.getOriginPC(),this.START_CLOCKS,this.MAX_CLOCKS,0,{})}},M=class extends S{constructor(e){super(e);this.MAX_CLOCKS=this.START_CLOCKS=76*4,this.WRAP_CLOCKS=!1}},v=class extends S{constructor(e){super(e);this.MAX_CLOCKS=114,this.START_CLOCKS=0,this.WRAP_CLOCKS=!0}};export{M as a,v as b};
|
||||
//# sourceMappingURL=chunk-ZEJLIEKX.js.map
|
@ -1,4 +1,4 @@
|
||||
import{b as E}from"./chunk-4UOPFAU7.js";import{b as f}from"./chunk-VD5NND7R.js";import{C as m,H as n,d as w,f as c}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as o,U as e,X as s,_ as t,k as g,l as a}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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.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]]),i=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{b as E}from"./chunk-62DK4CUF.js";import{b as f}from"./chunk-XPSUBSUG.js";import{C as m,H as n,d as w,f as c}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as o,U as e,X as s,_ as t,k as g,l as a}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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.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]]),i=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 i}getPresets(){return D}getDefaultExtension(){return".c"}readAddress(A){return this.machine.read(A)}readVRAMAddress(A){return this.machine.readVRAMAddress(A)}showHelp(A,B){window.open("https://8bitworkshop.com/docs/platforms/coleco/","_help")}},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-EBMJUP4T.js.map
|
||||
//# sourceMappingURL=coleco-M4HXPR4M.js.map
|
@ -71,7 +71,12 @@ class BasePlatform {
|
||||
return inspectSymbol(this, sym);
|
||||
}
|
||||
getDebugTree() {
|
||||
return this.saveState();
|
||||
var _a;
|
||||
var o = {};
|
||||
o.state = this.saveState();
|
||||
if ((_a = this.debugSymbols) === null || _a === void 0 ? void 0 : _a.debuginfo)
|
||||
o.debuginfo = this.debugSymbols.debuginfo;
|
||||
return o;
|
||||
}
|
||||
readFile(path) {
|
||||
return this.internalFiles[path];
|
||||
@ -288,6 +293,8 @@ function getToolForFilename_6502(fn) {
|
||||
return "acme";
|
||||
if (fn.endsWith(".wiz"))
|
||||
return "wiz";
|
||||
if (fn.endsWith(".ecs"))
|
||||
return "ecs";
|
||||
return "dasm"; // .a
|
||||
}
|
||||
exports.getToolForFilename_6502 = getToolForFilename_6502;
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
247
gen/common/ecs/binpack.js
Normal file
247
gen/common/ecs/binpack.js
Normal file
@ -0,0 +1,247 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Packer = exports.Bin = void 0;
|
||||
var debug = false;
|
||||
var BoxPlacement;
|
||||
(function (BoxPlacement) {
|
||||
BoxPlacement[BoxPlacement["TopLeft"] = 0] = "TopLeft";
|
||||
BoxPlacement[BoxPlacement["TopRight"] = 1] = "TopRight";
|
||||
BoxPlacement[BoxPlacement["BottomLeft"] = 2] = "BottomLeft";
|
||||
BoxPlacement[BoxPlacement["BottomRight"] = 3] = "BottomRight";
|
||||
})(BoxPlacement || (BoxPlacement = {}));
|
||||
function boxesIntersect(a, b) {
|
||||
return !(b.left >= a.right || b.right <= a.left || b.top >= a.bottom || b.bottom <= a.top);
|
||||
}
|
||||
function boxesContain(a, b) {
|
||||
return b.left >= a.left && b.top >= a.top && b.right <= a.right && b.bottom <= a.bottom;
|
||||
}
|
||||
class Bin {
|
||||
constructor(binbounds) {
|
||||
this.binbounds = binbounds;
|
||||
this.boxes = [];
|
||||
this.free = [];
|
||||
this.extents = { left: 0, top: 0, right: 0, bottom: 0 };
|
||||
this.free.push(binbounds);
|
||||
}
|
||||
getBoxes(bounds, limit, boxes) {
|
||||
let result = [];
|
||||
if (!boxes)
|
||||
boxes = this.boxes;
|
||||
for (let box of boxes) {
|
||||
//console.log(bounds, box, boxesIntersect(bounds, box))
|
||||
if (boxesIntersect(bounds, box)) {
|
||||
result.push(box);
|
||||
if (result.length >= limit)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
fits(b) {
|
||||
if (!boxesContain(this.binbounds, b)) {
|
||||
if (debug)
|
||||
console.log('out of bounds!', b.left, b.top, b.right, b.bottom);
|
||||
return false;
|
||||
}
|
||||
if (this.getBoxes(b, 1).length > 0) {
|
||||
if (debug)
|
||||
console.log('intersect!', b.left, b.top, b.right, b.bottom);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bestFit(b) {
|
||||
let bestscore = 0;
|
||||
let best = null;
|
||||
for (let f of this.free) {
|
||||
if (b.left != null && b.left < f.left)
|
||||
continue;
|
||||
if (b.left != null && b.left + b.width > f.right)
|
||||
continue;
|
||||
if (b.top != null && b.top < f.top)
|
||||
continue;
|
||||
if (b.top != null && b.top + b.height > f.bottom)
|
||||
continue;
|
||||
let dx = (f.right - f.left) - b.width;
|
||||
let dy = (f.bottom - f.top) - b.height;
|
||||
if (dx >= 0 && dy >= 0) {
|
||||
let score = 1 / (1 + dx + dy + f.left * 0.001);
|
||||
if (score > bestscore) {
|
||||
best = f;
|
||||
bestscore = score;
|
||||
if (score == 1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
anyFit(b) {
|
||||
let bestscore = 0;
|
||||
let best = null;
|
||||
for (let f of this.free) {
|
||||
let box = {
|
||||
left: b.left != null ? b.left : f.left,
|
||||
right: f.left + b.width,
|
||||
top: b.top != null ? b.top : f.top,
|
||||
bottom: f.top + b.height
|
||||
};
|
||||
if (this.fits(box)) {
|
||||
let score = 1 / (1 + box.left + box.top);
|
||||
if (score > bestscore) {
|
||||
best = f;
|
||||
if (score == 1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
add(b) {
|
||||
if (debug)
|
||||
console.log('add', b.left, b.top, b.right, b.bottom);
|
||||
if (!this.fits(b)) {
|
||||
//console.log('collided with', this.getBoxes(b, 1));
|
||||
throw new Error(`bad fit ${b.left} ${b.top} ${b.right} ${b.bottom}`);
|
||||
}
|
||||
// add box to list
|
||||
this.boxes.push(b);
|
||||
this.extents.right = Math.max(this.extents.right, b.right);
|
||||
this.extents.bottom = Math.max(this.extents.bottom, b.bottom);
|
||||
// delete bin
|
||||
for (let p of b.parents) {
|
||||
let i = this.free.indexOf(p);
|
||||
if (i < 0)
|
||||
throw new Error('cannot find parent');
|
||||
if (debug)
|
||||
console.log('removed', p.left, p.top, p.right, p.bottom);
|
||||
this.free.splice(i, 1);
|
||||
// split into new bins
|
||||
// make long columns
|
||||
this.addFree(p.left, p.top, b.left, p.bottom);
|
||||
this.addFree(b.right, p.top, p.right, p.bottom);
|
||||
// make top caps
|
||||
this.addFree(b.left, p.top, b.right, b.top);
|
||||
this.addFree(b.left, b.bottom, b.right, p.bottom);
|
||||
}
|
||||
}
|
||||
addFree(left, top, right, bottom) {
|
||||
if (bottom > top && right > left) {
|
||||
let b = { left, top, right, bottom };
|
||||
if (debug)
|
||||
console.log('free', b.left, b.top, b.right, b.bottom);
|
||||
this.free.push(b);
|
||||
}
|
||||
// TODO: merge free boxes?
|
||||
}
|
||||
}
|
||||
exports.Bin = Bin;
|
||||
class Packer {
|
||||
constructor() {
|
||||
this.bins = [];
|
||||
this.boxes = [];
|
||||
this.defaultPlacement = BoxPlacement.TopLeft; //TODO
|
||||
}
|
||||
pack() {
|
||||
for (let bc of this.boxes) {
|
||||
let box = this.bestPlacement(bc);
|
||||
if (!box)
|
||||
return false;
|
||||
box.bin.add(box);
|
||||
bc.box = box;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bestPlacement(b) {
|
||||
for (let bin of this.bins) {
|
||||
let parent = bin.bestFit(b);
|
||||
let approx = false;
|
||||
if (!parent) {
|
||||
parent = bin.anyFit(b);
|
||||
approx = true;
|
||||
if (debug)
|
||||
console.log('anyfit', parent === null || parent === void 0 ? void 0 : parent.left, parent === null || parent === void 0 ? void 0 : parent.top);
|
||||
}
|
||||
if (parent) {
|
||||
let place = this.defaultPlacement;
|
||||
let box = {
|
||||
left: parent.left,
|
||||
top: parent.top,
|
||||
right: parent.left + b.width,
|
||||
bottom: parent.top + b.height
|
||||
};
|
||||
if (b.left != null) {
|
||||
box.left = b.left;
|
||||
box.right = b.left + b.width;
|
||||
}
|
||||
if (b.top != null) {
|
||||
box.top = b.top;
|
||||
box.bottom = b.top + b.height;
|
||||
}
|
||||
if (place == BoxPlacement.BottomLeft || place == BoxPlacement.BottomRight) {
|
||||
let h = box.bottom - box.top;
|
||||
box.top = parent.bottom - h;
|
||||
box.bottom = parent.bottom;
|
||||
}
|
||||
if (place == BoxPlacement.TopRight || place == BoxPlacement.BottomRight) {
|
||||
let w = box.right - box.left;
|
||||
box.left = parent.right - w;
|
||||
box.right = parent.right;
|
||||
}
|
||||
if (debug)
|
||||
console.log('place', b.label, box.left, box.top, box.right, box.bottom, parent === null || parent === void 0 ? void 0 : parent.left, parent === null || parent === void 0 ? void 0 : parent.top);
|
||||
let parents = [parent];
|
||||
// if approx match, might overlap multiple free boxes
|
||||
if (approx)
|
||||
parents = bin.getBoxes(box, 100, bin.free);
|
||||
return Object.assign({ parents, place, bin }, box);
|
||||
}
|
||||
}
|
||||
if (debug)
|
||||
console.log('cannot place!', b.left, b.top, b.width, b.height);
|
||||
return null;
|
||||
}
|
||||
toSVG() {
|
||||
let s = '';
|
||||
let r = { width: 100, height: 70 };
|
||||
for (let bin of this.bins) {
|
||||
r.width = Math.max(r.width, bin.binbounds.right);
|
||||
r.height = Math.max(r.height, bin.binbounds.bottom);
|
||||
}
|
||||
s += `<svg viewBox="0 0 ${r.width} ${r.height}" xmlns="http://www.w3.org/2000/svg"><style><![CDATA[text {font: 1px sans-serif;}]]></style>`;
|
||||
for (let bin of this.bins) {
|
||||
let be = bin.extents;
|
||||
s += '<g>';
|
||||
s += `<rect width="${be.right - be.left}" height="${be.bottom - be.top}" stroke="black" stroke-width="0.5" fill="none"/>`;
|
||||
let textx = be.right + 1;
|
||||
let texty = 0;
|
||||
for (let box of this.boxes) {
|
||||
let b = box.box;
|
||||
if (b) {
|
||||
if (b.bin == bin)
|
||||
s += `<rect width="${b.right - b.left}" height="${b.bottom - b.top}" x="${b.left}" y="${b.top}" stroke="black" stroke-width="0.25" fill="#ccc"/>`;
|
||||
if (b.top == texty)
|
||||
textx += 10;
|
||||
else
|
||||
textx = be.right + 1;
|
||||
texty = b.top;
|
||||
if (box.label)
|
||||
s += `<text x="${textx}" y="${texty}" height="1">${box.label}</text>`;
|
||||
}
|
||||
}
|
||||
/*
|
||||
for (let b of bin.free) {
|
||||
s += `<rect width="${b.right-b.left}" height="${b.bottom-b.top}" x="${b.left}" y="${b.top}" stroke="red" stroke-width="0.1" fill="none"/>`;
|
||||
}
|
||||
*/
|
||||
s += '</g>';
|
||||
}
|
||||
s += `</svg>`;
|
||||
return s;
|
||||
}
|
||||
toSVGUrl() {
|
||||
return `data:image/svg+xml;base64,${btoa(this.toSVG())}`;
|
||||
}
|
||||
}
|
||||
exports.Packer = Packer;
|
||||
//# sourceMappingURL=binpack.js.map
|
1
gen/common/ecs/binpack.js.map
Normal file
1
gen/common/ecs/binpack.js.map
Normal file
File diff suppressed because one or more lines are too long
868
gen/common/ecs/compiler.js
Normal file
868
gen/common/ecs/compiler.js
Normal file
@ -0,0 +1,868 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ECSActionCompiler = exports.ECSCompiler = exports.ECSTokenType = void 0;
|
||||
const tokenizer_1 = require("../tokenizer");
|
||||
const decoder_1 = require("./decoder");
|
||||
const ecs_1 = require("./ecs");
|
||||
var ECSTokenType;
|
||||
(function (ECSTokenType) {
|
||||
ECSTokenType["Ellipsis"] = "ellipsis";
|
||||
ECSTokenType["Operator"] = "operator";
|
||||
ECSTokenType["Relational"] = "relational";
|
||||
ECSTokenType["QuotedString"] = "quoted-string";
|
||||
ECSTokenType["Integer"] = "integer";
|
||||
ECSTokenType["CodeFragment"] = "code-fragment";
|
||||
ECSTokenType["Placeholder"] = "placeholder";
|
||||
})(ECSTokenType = exports.ECSTokenType || (exports.ECSTokenType = {}));
|
||||
const OPERATORS = {
|
||||
'IMP': { f: 'bimp', p: 4 },
|
||||
'EQV': { f: 'beqv', p: 5 },
|
||||
'XOR': { f: 'bxor', p: 6 },
|
||||
'OR': { f: 'bor', p: 7 },
|
||||
'AND': { f: 'band', p: 8 },
|
||||
'||': { f: 'lor', p: 17 },
|
||||
'&&': { f: 'land', p: 18 },
|
||||
'=': { f: 'eq', p: 50 },
|
||||
'==': { f: 'eq', p: 50 },
|
||||
'<>': { f: 'ne', p: 50 },
|
||||
'><': { f: 'ne', p: 50 },
|
||||
'!=': { f: 'ne', p: 50 },
|
||||
'#': { f: 'ne', p: 50 },
|
||||
'<': { f: 'lt', p: 50 },
|
||||
'>': { f: 'gt', p: 50 },
|
||||
'<=': { f: 'le', p: 50 },
|
||||
'>=': { f: 'ge', p: 50 },
|
||||
'MIN': { f: 'min', p: 75 },
|
||||
'MAX': { f: 'max', p: 75 },
|
||||
'+': { f: 'add', p: 100 },
|
||||
'-': { f: 'sub', p: 100 },
|
||||
};
|
||||
function getOperator(op) {
|
||||
return OPERATORS[op];
|
||||
}
|
||||
function getPrecedence(tok) {
|
||||
switch (tok.type) {
|
||||
case ECSTokenType.Operator:
|
||||
case ECSTokenType.Relational:
|
||||
case tokenizer_1.TokenType.Ident:
|
||||
let op = getOperator(tok.str);
|
||||
if (op)
|
||||
return op.p;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// is token an end of statement marker? (":" or end of line)
|
||||
function isEOS(tok) {
|
||||
return tok.type == tokenizer_1.TokenType.EOL || tok.type == tokenizer_1.TokenType.Comment
|
||||
|| tok.str == ':' || tok.str == 'ELSE'; // TODO: only ELSE if ifElse==true
|
||||
}
|
||||
///
|
||||
class ECSCompiler extends tokenizer_1.Tokenizer {
|
||||
constructor(em, isMainFile) {
|
||||
super();
|
||||
this.em = em;
|
||||
this.isMainFile = isMainFile;
|
||||
this.currentScope = null;
|
||||
this.currentContext = null;
|
||||
this.includeDebugInfo = false;
|
||||
//this.includeEOL = true;
|
||||
this.setTokenRules([
|
||||
{ type: ECSTokenType.Ellipsis, regex: /\.\./ },
|
||||
{ type: ECSTokenType.QuotedString, regex: /".*?"/ },
|
||||
{ type: ECSTokenType.CodeFragment, regex: /---.*?---/ },
|
||||
{ type: ECSTokenType.Integer, regex: /0[xX][A-Fa-f0-9]+/ },
|
||||
{ type: ECSTokenType.Integer, regex: /\$[A-Fa-f0-9]+/ },
|
||||
{ type: ECSTokenType.Integer, regex: /[%][01]+/ },
|
||||
{ type: ECSTokenType.Integer, regex: /\d+/ },
|
||||
{ type: ECSTokenType.Relational, regex: /[=<>][=<>]?/ },
|
||||
{ type: ECSTokenType.Operator, regex: /[.#,:(){}\[\]\-\+]/ },
|
||||
{ type: tokenizer_1.TokenType.Ident, regex: /[A-Za-z_][A-Za-z0-9_]*/ },
|
||||
{ type: tokenizer_1.TokenType.Ignore, regex: /\/\/.*?[\n\r]/ },
|
||||
{ type: tokenizer_1.TokenType.Ignore, regex: /\/\*.*?\*\// },
|
||||
{ type: tokenizer_1.TokenType.EOL, regex: /[\n\r]+/ },
|
||||
{ type: tokenizer_1.TokenType.Ignore, regex: /\s+/ },
|
||||
]);
|
||||
this.errorOnCatchAll = true;
|
||||
}
|
||||
annotate(fn) {
|
||||
let start = this.peekToken();
|
||||
let obj = fn();
|
||||
let end = this.lasttoken;
|
||||
let $loc = end ? (0, tokenizer_1.mergeLocs)(start.$loc, end.$loc) : start.$loc;
|
||||
if (obj)
|
||||
obj.$loc = $loc;
|
||||
return obj;
|
||||
}
|
||||
parseFile(text, path) {
|
||||
this.tokenizeFile(text, path);
|
||||
while (!this.isEOF()) {
|
||||
let top = this.parseTopLevel();
|
||||
if (top) {
|
||||
let t = top;
|
||||
this.annotate(() => t); // TODO? typescript bug?
|
||||
}
|
||||
}
|
||||
this.runDeferred();
|
||||
}
|
||||
importFile(path) {
|
||||
if (!this.em.imported[path]) { // already imported?
|
||||
let text = this.getImportFile && this.getImportFile(path);
|
||||
if (!text)
|
||||
this.compileError(`I can't find the import file "${path}".`);
|
||||
this.em.imported[path] = true;
|
||||
let comp = new ECSCompiler(this.em, false);
|
||||
comp.includeDebugInfo = this.includeDebugInfo; // TODO: clone compiler
|
||||
try {
|
||||
comp.parseFile(text, path);
|
||||
}
|
||||
catch (e) {
|
||||
for (var err of comp.errors)
|
||||
this.errors.push(err);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
parseTopLevel() {
|
||||
//this.skipBlankLines();
|
||||
let tok = this.expectTokens(['component', 'system', 'scope', 'resource', 'import', 'demo', 'comment']);
|
||||
if (tok.str == 'component') {
|
||||
return this.em.defineComponent(this.parseComponentDefinition());
|
||||
}
|
||||
if (tok.str == 'system') {
|
||||
return this.em.defineSystem(this.parseSystem());
|
||||
}
|
||||
if (tok.str == 'scope') {
|
||||
return this.parseScope();
|
||||
}
|
||||
if (tok.str == 'resource') {
|
||||
return this.em.defineSystem(this.parseResource());
|
||||
}
|
||||
if (tok.str == 'import') {
|
||||
let tok = this.expectTokenTypes([ECSTokenType.QuotedString]);
|
||||
let path = tok.str.substring(1, tok.str.length - 1);
|
||||
return this.importFile(path);
|
||||
}
|
||||
if (tok.str == 'demo') {
|
||||
if (this.isMainFile) {
|
||||
let scope = this.parseScope();
|
||||
scope.isDemo = true;
|
||||
this.expectToken('demo');
|
||||
return scope;
|
||||
}
|
||||
else {
|
||||
this.skipDemo(); // don't even parse it, just skip it
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (tok.str == 'comment') {
|
||||
this.expectTokenTypes([ECSTokenType.CodeFragment]);
|
||||
return;
|
||||
}
|
||||
this.compileError(`Unexpected top-level keyword: ${tok.str}`);
|
||||
}
|
||||
skipDemo() {
|
||||
var tok;
|
||||
while ((tok = this.consumeToken()) && !this.isEOF()) {
|
||||
if (tok.str == 'end' && this.peekToken().str == 'demo') {
|
||||
this.consumeToken();
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new ecs_1.ECSError(`Expected "end demo" after a "demo" declaration.`);
|
||||
}
|
||||
parseComponentDefinition() {
|
||||
let name = this.expectIdent().str;
|
||||
let fields = [];
|
||||
this.em.deferComponent(name);
|
||||
while (this.peekToken().str != 'end') {
|
||||
fields.push(this.parseComponentField());
|
||||
}
|
||||
this.expectToken('end');
|
||||
return { name, fields };
|
||||
}
|
||||
parseComponentField() {
|
||||
let name = this.expectIdent();
|
||||
this.expectToken(':', 'I expected either a ":" or "end" here.'); // TODO
|
||||
let type = this.parseDataType();
|
||||
return Object.assign({ name: name.str, $loc: name.$loc }, type);
|
||||
}
|
||||
parseDataType() {
|
||||
if (this.peekToken().type == 'integer') {
|
||||
let lo = this.parseIntegerConstant();
|
||||
this.expectToken('..');
|
||||
let hi = this.parseIntegerConstant();
|
||||
this.checkLowerLimit(lo, -0x80000000, "lower int range");
|
||||
this.checkUpperLimit(hi, 0x7fffffff, "upper int range");
|
||||
this.checkUpperLimit(hi - lo, 0xffffffff, "int range");
|
||||
this.checkLowerLimit(hi, lo, "int range");
|
||||
// TODO: use default value?
|
||||
let defvalue;
|
||||
if (this.ifToken('default')) {
|
||||
defvalue = this.parseIntegerConstant();
|
||||
}
|
||||
// TODO: check types
|
||||
return { dtype: 'int', lo, hi, defvalue };
|
||||
}
|
||||
if (this.peekToken().str == '[') {
|
||||
return { dtype: 'ref', query: this.parseQuery() };
|
||||
}
|
||||
if (this.ifToken('array')) {
|
||||
let index = undefined;
|
||||
if (this.peekToken().type == ECSTokenType.Integer) {
|
||||
index = this.parseDataType();
|
||||
}
|
||||
this.expectToken('of');
|
||||
let elem = this.parseDataType();
|
||||
let baseoffset;
|
||||
if (this.ifToken('baseoffset')) {
|
||||
baseoffset = this.parseIntegerConstant();
|
||||
this.checkLowerLimit(baseoffset, -32768, "base offset");
|
||||
this.checkUpperLimit(baseoffset, 32767, "base offset");
|
||||
}
|
||||
return { dtype: 'array', index, elem, baseoffset };
|
||||
}
|
||||
if (this.ifToken('enum')) {
|
||||
this.expectToken('[');
|
||||
let enumtoks = this.parseList(this.parseEnumIdent, ',');
|
||||
this.expectToken(']');
|
||||
if (enumtoks.length == 0)
|
||||
this.compileError(`must define at least one enum`);
|
||||
let lo = 0;
|
||||
let hi = enumtoks.length - 1;
|
||||
this.checkLowerLimit(hi, 0, "enum count");
|
||||
this.checkUpperLimit(hi, 255, "enum count");
|
||||
let enums = {};
|
||||
for (let i = 0; i <= hi; i++)
|
||||
enums[enumtoks[i].str] = i;
|
||||
// TODO: use default value?
|
||||
let defvalue;
|
||||
if (this.ifToken('default')) {
|
||||
defvalue = this.parseIntegerConstant();
|
||||
}
|
||||
return { dtype: 'int', lo, hi, defvalue, enums };
|
||||
}
|
||||
throw this.compileError(`I expected a data type here.`);
|
||||
}
|
||||
parseEnumIdent() {
|
||||
let tok = this.expectTokenTypes([tokenizer_1.TokenType.Ident]);
|
||||
return tok;
|
||||
}
|
||||
parseEnumValue(tok, field) {
|
||||
if (!field.enums)
|
||||
throw new ecs_1.ECSError(`field is not an enum`);
|
||||
let value = field.enums[tok.str];
|
||||
if (value == null)
|
||||
throw new ecs_1.ECSError(`unknown enum "${tok.str}"`);
|
||||
return value;
|
||||
}
|
||||
parseDataValue(field) {
|
||||
var _a, _b;
|
||||
let tok = this.peekToken();
|
||||
// TODO: move to expr
|
||||
if (tok.type == tokenizer_1.TokenType.Ident && field.dtype == 'int') {
|
||||
return this.parseEnumValue(this.consumeToken(), field);
|
||||
}
|
||||
if (tok.type == tokenizer_1.TokenType.Ident) {
|
||||
let entity = (_a = this.currentScope) === null || _a === void 0 ? void 0 : _a.getEntityByName(tok.str);
|
||||
if (!entity)
|
||||
this.compileError('no entity named "${tok.str}"');
|
||||
else {
|
||||
this.consumeToken();
|
||||
this.expectToken('.');
|
||||
let fieldName = this.expectIdent().str;
|
||||
let constValue = (_b = this.currentScope) === null || _b === void 0 ? void 0 : _b.getConstValue(entity, fieldName);
|
||||
if (constValue == null)
|
||||
throw new ecs_1.ECSError(`"${fieldName}" is not defined as a constant`, entity);
|
||||
else
|
||||
return constValue;
|
||||
}
|
||||
}
|
||||
if (tok.str == '[') {
|
||||
// TODO: 16-bit?
|
||||
return new Uint8Array(this.parseDataArray());
|
||||
}
|
||||
if (tok.str == '#') {
|
||||
this.consumeToken();
|
||||
let reftype = field.dtype == 'ref' ? field : undefined;
|
||||
return this.parseEntityForwardRef(reftype);
|
||||
}
|
||||
// TODO?
|
||||
return this.parseIntegerConstant();
|
||||
// TODO: throw this.compileError(`I expected a ${field.dtype} here.`);
|
||||
}
|
||||
parseEntityForwardRef(reftype) {
|
||||
let token = this.expectIdent();
|
||||
return { reftype, token };
|
||||
}
|
||||
parseDataArray() {
|
||||
this.expectToken('[');
|
||||
let arr = this.parseList(this.parseIntegerConstant, ',');
|
||||
this.expectToken(']');
|
||||
return arr;
|
||||
}
|
||||
expectInteger() {
|
||||
let s = this.consumeToken().str;
|
||||
let i;
|
||||
if (s.startsWith('$'))
|
||||
i = parseInt(s.substring(1), 16); // hex $...
|
||||
else if (s.startsWith('%'))
|
||||
i = parseInt(s.substring(1), 2); // binary %...
|
||||
else
|
||||
i = parseInt(s); // default base 10 or 16 (0x...)
|
||||
if (isNaN(i))
|
||||
this.compileError('There should be an integer here.');
|
||||
return i;
|
||||
}
|
||||
parseSystem() {
|
||||
let name = this.expectIdent().str;
|
||||
let actions = [];
|
||||
let system = { name, actions };
|
||||
let cmd;
|
||||
while ((cmd = this.expectTokens(['on', 'locals', 'end']).str) != 'end') {
|
||||
if (cmd == 'on') {
|
||||
let action = this.annotate(() => this.parseAction(system));
|
||||
actions.push(action);
|
||||
}
|
||||
else if (cmd == 'locals') {
|
||||
system.tempbytes = this.parseIntegerConstant();
|
||||
}
|
||||
else {
|
||||
this.compileError(`Unexpected system keyword: ${cmd}`);
|
||||
}
|
||||
}
|
||||
return system;
|
||||
}
|
||||
parseResource() {
|
||||
let name = this.expectIdent().str;
|
||||
let tempbytes;
|
||||
if (this.peekToken().str == 'locals') {
|
||||
this.consumeToken();
|
||||
tempbytes = this.parseIntegerConstant();
|
||||
}
|
||||
let system = { name, tempbytes, actions: [] };
|
||||
let expr = this.annotate(() => this.parseBlockStatement());
|
||||
let action = { expr, event: name };
|
||||
system.actions.push(action);
|
||||
return system;
|
||||
}
|
||||
parseAction(system) {
|
||||
// TODO: unused events?
|
||||
const event = this.expectIdent().str;
|
||||
this.expectToken('do');
|
||||
let fitbytes = undefined;
|
||||
let critical = undefined;
|
||||
if (this.ifToken('critical'))
|
||||
critical = true;
|
||||
if (this.ifToken('fit'))
|
||||
fitbytes = this.parseIntegerConstant();
|
||||
let expr = this.annotate(() => this.parseBlockStatement());
|
||||
//query, join, select, direction,
|
||||
let action = { expr, event, fitbytes, critical };
|
||||
return action;
|
||||
}
|
||||
parseQuery() {
|
||||
let q = { include: [] };
|
||||
let start = this.expectToken('[');
|
||||
this.parseList(() => this.parseQueryItem(q), ',');
|
||||
this.expectToken(']');
|
||||
// TODO: other params
|
||||
q.$loc = (0, tokenizer_1.mergeLocs)(start.$loc, this.lasttoken.$loc);
|
||||
return q;
|
||||
}
|
||||
parseQueryItem(q) {
|
||||
let prefix = this.peekToken();
|
||||
if (prefix.type != tokenizer_1.TokenType.Ident) {
|
||||
this.consumeToken();
|
||||
}
|
||||
if (prefix.type == tokenizer_1.TokenType.Ident) {
|
||||
let cref = this.parseComponentRef();
|
||||
q.include.push(cref);
|
||||
}
|
||||
else if (prefix.str == '-') {
|
||||
let cref = this.parseComponentRef();
|
||||
if (!q.exclude)
|
||||
q.exclude = [];
|
||||
q.exclude.push(cref);
|
||||
}
|
||||
else if (prefix.str == '#') {
|
||||
const scope = this.currentScope;
|
||||
if (scope == null) {
|
||||
throw this.compileError('You can only reference specific entities inside of a scope.');
|
||||
}
|
||||
let eref = this.parseEntityForwardRef();
|
||||
this.deferred.push(() => {
|
||||
let refvalue = this.resolveEntityRef(scope, eref);
|
||||
if (!q.entities)
|
||||
q.entities = [];
|
||||
q.entities.push(scope.entities[refvalue]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.compileError(`Query components may be preceded only by a '-'.`);
|
||||
}
|
||||
}
|
||||
parseEventName() {
|
||||
return this.expectIdent().str;
|
||||
}
|
||||
parseEventList() {
|
||||
return this.parseList(this.parseEventName, ",");
|
||||
}
|
||||
parseCode() {
|
||||
// TODO: add $loc
|
||||
let tok = this.expectTokenTypes([ECSTokenType.CodeFragment]);
|
||||
let code = tok.str.substring(3, tok.str.length - 3);
|
||||
// TODO: add after parsing maybe?
|
||||
let lines = code.split('\n');
|
||||
if (this.includeDebugInfo)
|
||||
this.addDebugInfo(lines, tok.$loc.line);
|
||||
code = lines.join('\n');
|
||||
//let acomp = new ECSActionCompiler(context);
|
||||
//let nodes = acomp.parseFile(code, this.path);
|
||||
// TODO: return nodes
|
||||
return code;
|
||||
}
|
||||
addDebugInfo(lines, startline) {
|
||||
const re = /^\s*(;|\/\/|$)/; // ignore comments and blank lines
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
if (!lines[i].match(re))
|
||||
lines[i] = this.em.dialect.debug_line(this.path, startline + i) + '\n' + lines[i];
|
||||
}
|
||||
}
|
||||
parseScope() {
|
||||
let name = this.expectIdent().str;
|
||||
let scope = this.em.newScope(name, this.currentScope || undefined);
|
||||
scope.filePath = this.path;
|
||||
this.currentScope = scope;
|
||||
let cmd;
|
||||
while ((cmd = this.expectTokens(['end', 'using', 'entity', 'scope', 'comment', 'system']).str) != 'end') {
|
||||
if (cmd == 'using') {
|
||||
this.parseScopeUsing();
|
||||
}
|
||||
if (cmd == 'entity') {
|
||||
this.annotate(() => this.parseEntity());
|
||||
}
|
||||
if (cmd == 'scope') {
|
||||
this.annotate(() => this.parseScope());
|
||||
}
|
||||
if (cmd == 'comment') {
|
||||
this.expectTokenTypes([ECSTokenType.CodeFragment]);
|
||||
}
|
||||
// TODO: need to make these local names, otherwise we get "duplicate name"
|
||||
if (cmd == 'system') {
|
||||
let sys = this.annotate(() => this.parseSystem());
|
||||
this.em.defineSystem(sys);
|
||||
this.currentScope.newSystemInstanceWithDefaults(sys);
|
||||
}
|
||||
}
|
||||
this.currentScope = scope.parent || null;
|
||||
return scope;
|
||||
}
|
||||
parseScopeUsing() {
|
||||
var _a;
|
||||
let instlist = this.parseList(this.parseSystemInstanceRef, ',');
|
||||
let params = {};
|
||||
if (this.peekToken().str == 'with') {
|
||||
this.consumeToken();
|
||||
params = this.parseSystemInstanceParameters();
|
||||
}
|
||||
for (let inst of instlist) {
|
||||
inst.params = params;
|
||||
(_a = this.currentScope) === null || _a === void 0 ? void 0 : _a.newSystemInstance(inst);
|
||||
}
|
||||
}
|
||||
parseEntity() {
|
||||
if (!this.currentScope) {
|
||||
throw this.internalError();
|
||||
}
|
||||
const scope = this.currentScope;
|
||||
let entname = '';
|
||||
if (this.peekToken().type == tokenizer_1.TokenType.Ident) {
|
||||
entname = this.expectIdent().str;
|
||||
}
|
||||
let etype = this.parseEntityArchetype();
|
||||
let entity = this.currentScope.newEntity(etype, entname);
|
||||
let cmd2;
|
||||
// TODO: remove init?
|
||||
while ((cmd2 = this.expectTokens(['const', 'init', 'var', 'decode', 'end']).str) != 'end') {
|
||||
let cmd = cmd2; // put in scope
|
||||
if (cmd == 'var')
|
||||
cmd = 'init'; // TODO: remove?
|
||||
if (cmd == 'init' || cmd == 'const') {
|
||||
this.parseInitConst(cmd, scope, entity);
|
||||
}
|
||||
else if (cmd == 'decode') {
|
||||
this.parseDecode(scope, entity);
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
parseInitConst(cmd, scope, entity) {
|
||||
// TODO: check data types
|
||||
let name = this.expectIdent().str;
|
||||
let { c, f } = this.getEntityField(entity, name);
|
||||
let symtype = scope.isConstOrInit(c, name);
|
||||
if (symtype && symtype != cmd)
|
||||
this.compileError(`I can't mix const and init values for a given field in a scope.`);
|
||||
this.expectToken('=');
|
||||
let valueOrRef = this.parseDataValue(f);
|
||||
if (valueOrRef.token != null) {
|
||||
this.deferred.push(() => {
|
||||
this.lasttoken = valueOrRef.token; // for errors
|
||||
let refvalue = this.resolveEntityRef(scope, valueOrRef);
|
||||
if (cmd == 'const')
|
||||
scope.setConstValue(entity, c, f, refvalue);
|
||||
if (cmd == 'init')
|
||||
scope.setInitValue(entity, c, f, refvalue);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (cmd == 'const')
|
||||
scope.setConstValue(entity, c, f, valueOrRef);
|
||||
if (cmd == 'init')
|
||||
scope.setInitValue(entity, c, f, valueOrRef);
|
||||
}
|
||||
}
|
||||
parseDecode(scope, entity) {
|
||||
let decoderid = this.expectIdent().str;
|
||||
let codetok = this.expectTokenTypes([ECSTokenType.CodeFragment]);
|
||||
let code = codetok.str;
|
||||
code = code.substring(3, code.length - 3);
|
||||
let decoder = (0, decoder_1.newDecoder)(decoderid, code);
|
||||
if (!decoder) {
|
||||
throw this.compileError(`I can't find a "${decoderid}" decoder.`);
|
||||
}
|
||||
let result;
|
||||
try {
|
||||
result = decoder.parse();
|
||||
}
|
||||
catch (e) {
|
||||
throw new ecs_1.ECSError(e.message, decoder.getErrorLocation(codetok.$loc));
|
||||
}
|
||||
for (let entry of Object.entries(result.properties)) {
|
||||
let { c, f } = this.getEntityField(entity, entry[0]);
|
||||
scope.setConstValue(entity, c, f, entry[1]);
|
||||
}
|
||||
}
|
||||
getEntityField(e, name) {
|
||||
if (!this.currentScope) {
|
||||
throw this.internalError();
|
||||
}
|
||||
let comps = this.em.componentsWithFieldName([e.etype], name);
|
||||
if (comps.length == 0)
|
||||
this.compileError(`I couldn't find a field named "${name}" for this entity.`);
|
||||
if (comps.length > 1)
|
||||
this.compileError(`I found more than one field named "${name}" for this entity.`);
|
||||
let component = comps[0];
|
||||
let field = component.fields.find(f => f.name == name);
|
||||
if (!field) {
|
||||
throw this.internalError();
|
||||
}
|
||||
return { c: component, f: field };
|
||||
}
|
||||
parseEntityArchetype() {
|
||||
this.expectToken('[');
|
||||
let components = this.parseList(this.parseComponentRef, ',');
|
||||
this.expectToken(']');
|
||||
return { components };
|
||||
}
|
||||
parseComponentRef() {
|
||||
let name = this.expectIdent().str;
|
||||
let cref = this.em.getComponentByName(name);
|
||||
if (!cref)
|
||||
this.compileError(`I couldn't find a component named "${name}".`);
|
||||
return cref;
|
||||
}
|
||||
findEntityByName(scope, token) {
|
||||
let name = token.str;
|
||||
let eref = scope.entities.find(e => e.name == name);
|
||||
if (!eref) {
|
||||
throw this.compileError(`I couldn't find an entity named "${name}" in this scope.`, token.$loc);
|
||||
}
|
||||
return eref;
|
||||
}
|
||||
resolveEntityRef(scope, ref) {
|
||||
let id = this.findEntityByName(scope, ref.token).id;
|
||||
if (ref.reftype) {
|
||||
// TODO: make this a function? elo ehi etc?
|
||||
let atypes = this.em.archetypesMatching(ref.reftype.query);
|
||||
let entities = scope.entitiesMatching(atypes);
|
||||
if (entities.length == 0)
|
||||
throw this.compileError(`This entity doesn't seem to fit the reference type.`, ref.token.$loc);
|
||||
id -= entities[0].id;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
parseSystemInstanceRef() {
|
||||
let name = this.expectIdent().str;
|
||||
let system = this.em.getSystemByName(name);
|
||||
if (!system)
|
||||
throw this.compileError(`I couldn't find a system named "${name}".`, this.lasttoken.$loc);
|
||||
let params = {};
|
||||
let inst = { system, params, id: 0 };
|
||||
return inst;
|
||||
}
|
||||
parseSystemInstanceParameters() {
|
||||
let scope = this.currentScope;
|
||||
if (scope == null)
|
||||
throw this.internalError();
|
||||
if (this.peekToken().str == '[') {
|
||||
return { query: this.parseQuery() };
|
||||
}
|
||||
this.expectToken('#');
|
||||
let entname = this.expectIdent();
|
||||
this.expectToken('.');
|
||||
let fieldname = this.expectIdent();
|
||||
let entity = this.findEntityByName(scope, entname);
|
||||
let cf = this.getEntityField(entity, fieldname.str);
|
||||
return { refEntity: entity, refField: cf };
|
||||
}
|
||||
exportToFile(src) {
|
||||
this.em.exportToFile(src);
|
||||
}
|
||||
export() {
|
||||
let src = new ecs_1.SourceFileExport();
|
||||
src.line(this.em.dialect.debug_file(this.path));
|
||||
for (let path of Object.keys(this.em.imported))
|
||||
src.line(this.em.dialect.debug_file(path));
|
||||
this.exportToFile(src);
|
||||
return src.toString();
|
||||
}
|
||||
checkUpperLimit(value, upper, what) {
|
||||
if (value > upper)
|
||||
this.compileError(`This ${what} is too high; must be ${upper} or less`);
|
||||
}
|
||||
checkLowerLimit(value, lower, what) {
|
||||
if (value < lower)
|
||||
this.compileError(`This ${what} is too low; must be ${lower} or more`);
|
||||
}
|
||||
// expression stuff
|
||||
parseConstant() {
|
||||
let expr = this.parseExpr();
|
||||
expr = this.em.evalExpr(expr, this.currentScope);
|
||||
if ((0, ecs_1.isLiteral)(expr))
|
||||
return expr.value;
|
||||
throw this.compileError('This expression is not a constant.');
|
||||
}
|
||||
parseIntegerConstant() {
|
||||
let value = this.parseConstant();
|
||||
if (typeof value === 'number')
|
||||
return value;
|
||||
throw this.compileError('This expression is not an integer.');
|
||||
}
|
||||
parseExpr() {
|
||||
var startloc = this.peekToken().$loc;
|
||||
var expr = this.parseExpr1(this.parsePrimary(), 0);
|
||||
var endloc = this.lasttoken.$loc;
|
||||
expr.$loc = (0, tokenizer_1.mergeLocs)(startloc, endloc);
|
||||
return expr;
|
||||
}
|
||||
parseExpr1(left, minPred) {
|
||||
let look = this.peekToken();
|
||||
while (getPrecedence(look) >= minPred) {
|
||||
let op = this.consumeToken();
|
||||
let right = this.parsePrimary();
|
||||
look = this.peekToken();
|
||||
while (getPrecedence(look) > getPrecedence(op)) {
|
||||
right = this.parseExpr1(right, getPrecedence(look));
|
||||
look = this.peekToken();
|
||||
}
|
||||
var opfn = getOperator(op.str).f;
|
||||
// use logical operators instead of bitwise?
|
||||
if (op.str == 'and')
|
||||
opfn = 'land';
|
||||
if (op.str == 'or')
|
||||
opfn = 'lor';
|
||||
var valtype = this.exprTypeForOp(opfn, left, right, op);
|
||||
left = { valtype: valtype, op: opfn, left: left, right: right };
|
||||
}
|
||||
return left;
|
||||
}
|
||||
parsePrimary() {
|
||||
let tok = this.consumeToken();
|
||||
switch (tok.type) {
|
||||
case ECSTokenType.Integer:
|
||||
this.pushbackToken(tok);
|
||||
let value = this.expectInteger();
|
||||
let valtype = { dtype: 'int', lo: value, hi: value };
|
||||
return { valtype, value };
|
||||
case tokenizer_1.TokenType.Ident:
|
||||
if (tok.str == 'not') {
|
||||
let expr = this.parsePrimary();
|
||||
let valtype = { dtype: 'int', lo: 0, hi: 1 };
|
||||
return { valtype, op: 'lnot', expr: expr };
|
||||
}
|
||||
else {
|
||||
this.pushbackToken(tok);
|
||||
return this.parseVarSubscriptOrFunc();
|
||||
}
|
||||
case ECSTokenType.Operator:
|
||||
if (tok.str == '(') {
|
||||
let expr = this.parseExpr();
|
||||
this.expectToken(')', `There should be another expression or a ")" here.`);
|
||||
return expr;
|
||||
}
|
||||
else if (tok.str == '-') {
|
||||
let expr = this.parsePrimary(); // TODO: -2^2=-4 and -2-2=-4
|
||||
let valtype = expr.valtype;
|
||||
if ((valtype === null || valtype === void 0 ? void 0 : valtype.dtype) == 'int') {
|
||||
let hi = Math.abs(valtype.hi);
|
||||
let negtype = { dtype: 'int', lo: -hi, hi: hi };
|
||||
return { valtype: negtype, op: 'neg', expr: expr };
|
||||
}
|
||||
}
|
||||
else if (tok.str == '+') {
|
||||
return this.parsePrimary(); // ignore unary +
|
||||
}
|
||||
default:
|
||||
throw this.compileError(`The expression is incomplete.`);
|
||||
}
|
||||
}
|
||||
parseVarSubscriptOrFunc() {
|
||||
var tok = this.consumeToken();
|
||||
switch (tok.type) {
|
||||
case tokenizer_1.TokenType.Ident:
|
||||
// component:field
|
||||
if (this.ifToken(':')) {
|
||||
let ftok = this.consumeToken();
|
||||
let component = this.em.getComponentByName(tok.str);
|
||||
if (!component)
|
||||
throw this.compileError(`A component named "${tok.str}" has not been defined.`);
|
||||
let field = component.fields.find(f => f.name == ftok.str);
|
||||
if (!field)
|
||||
throw this.compileError(`There is no "${ftok.str}" field in the ${tok.str} component.`);
|
||||
if (!this.currentScope)
|
||||
throw this.compileError(`This operation only works inside of a scope.`);
|
||||
let atypes = this.em.archetypesMatching({ include: [component] });
|
||||
let entities = this.currentScope.entitiesMatching(atypes);
|
||||
return { entities, field };
|
||||
}
|
||||
// entity.field
|
||||
if (this.ifToken('.')) {
|
||||
let ftok = this.consumeToken();
|
||||
if (!this.currentScope)
|
||||
throw this.compileError(`This operation only works inside of a scope.`);
|
||||
let entity = this.currentScope.getEntityByName(tok.str);
|
||||
if (!entity)
|
||||
throw this.compileError(`An entity named "${tok.str}" has not been defined.`);
|
||||
let component = this.em.singleComponentWithFieldName([entity.etype], ftok.str, ftok);
|
||||
let field = component.fields.find(f => f.name == ftok.str);
|
||||
if (!field)
|
||||
throw this.compileError(`There is no "${ftok.str}" field in this entity.`);
|
||||
let entities = [entity];
|
||||
return { entities, field };
|
||||
}
|
||||
let args = [];
|
||||
if (this.ifToken('(')) {
|
||||
args = this.parseExprList();
|
||||
this.expectToken(')', `There should be another expression or a ")" here.`);
|
||||
}
|
||||
var loc = (0, tokenizer_1.mergeLocs)(tok.$loc, this.lasttoken.$loc);
|
||||
var valtype = this.exprTypeForSubscript(tok.str, args, loc);
|
||||
return { valtype: valtype, name: tok.str, args: args, $loc: loc };
|
||||
default:
|
||||
throw this.compileError(`There should be a variable name here.`);
|
||||
}
|
||||
}
|
||||
parseLexpr() {
|
||||
var lexpr = this.parseVarSubscriptOrFunc();
|
||||
//this.vardefs[lexpr.name] = lexpr;
|
||||
//this.validateVarName(lexpr);
|
||||
return lexpr;
|
||||
}
|
||||
exprTypeForOp(fnname, left, right, optok) {
|
||||
return { dtype: 'int', lo: 0, hi: 255 }; // TODO?
|
||||
}
|
||||
exprTypeForSubscript(fnname, args, loc) {
|
||||
return { dtype: 'int', lo: 0, hi: 255 }; // TODO?
|
||||
}
|
||||
parseLexprList() {
|
||||
return this.parseList(this.parseLexpr, ',');
|
||||
}
|
||||
parseExprList() {
|
||||
return this.parseList(this.parseExpr, ',');
|
||||
}
|
||||
// TODO: annotate with location
|
||||
parseBlockStatement() {
|
||||
let valtype = { dtype: 'int', lo: 0, hi: 0 }; // TODO?
|
||||
if (this.peekToken().type == ECSTokenType.CodeFragment) {
|
||||
return { valtype, code: this.parseCode() };
|
||||
}
|
||||
if (this.ifToken('begin')) {
|
||||
let stmts = [];
|
||||
while (this.peekToken().str != 'end') {
|
||||
stmts.push(this.annotate(() => this.parseBlockStatement()));
|
||||
}
|
||||
this.expectToken('end');
|
||||
return { valtype, stmts };
|
||||
}
|
||||
let cmd = this.peekToken();
|
||||
if (ecs_1.SELECT_TYPE.includes(cmd.str)) {
|
||||
return this.parseQueryStatement();
|
||||
}
|
||||
throw this.compileError(`There should be a statement or "end" here.`, cmd.$loc);
|
||||
}
|
||||
parseQueryStatement() {
|
||||
// TODO: include modifiers in error msg
|
||||
const select = this.expectTokens(ecs_1.SELECT_TYPE).str; // TODO: type check?
|
||||
let all = this.ifToken('all') != null;
|
||||
let query = undefined;
|
||||
let join = undefined;
|
||||
if (select == 'once') {
|
||||
if (this.peekToken().str == '[')
|
||||
this.compileError(`A "${select}" action can't include a query.`);
|
||||
}
|
||||
else {
|
||||
query = this.parseQuery();
|
||||
}
|
||||
if (select == 'join') {
|
||||
this.expectToken('with');
|
||||
join = this.parseQuery();
|
||||
}
|
||||
if (this.ifToken('limit')) {
|
||||
if (!query) {
|
||||
this.compileError(`A "${select}" query can't include a limit.`);
|
||||
}
|
||||
else
|
||||
query.limit = this.parseIntegerConstant();
|
||||
}
|
||||
const all_modifiers = ['asc', 'desc']; // TODO
|
||||
const modifiers = this.parseModifiers(all_modifiers);
|
||||
let direction = undefined;
|
||||
if (modifiers['asc'])
|
||||
direction = 'asc';
|
||||
else if (modifiers['desc'])
|
||||
direction = 'desc';
|
||||
let body = this.annotate(() => this.parseBlockStatement());
|
||||
return { select, query, join, direction, all, stmts: [body], loop: select == 'foreach' };
|
||||
}
|
||||
}
|
||||
exports.ECSCompiler = ECSCompiler;
|
||||
///
|
||||
class ECSActionCompiler extends tokenizer_1.Tokenizer {
|
||||
constructor(context) {
|
||||
super();
|
||||
this.context = context;
|
||||
this.setTokenRules([
|
||||
{ type: ECSTokenType.Placeholder, regex: /\{\{.*?\}\}/ },
|
||||
{ type: tokenizer_1.TokenType.CatchAll, regex: /[^{\n]+\n*/ },
|
||||
]);
|
||||
this.errorOnCatchAll = false;
|
||||
}
|
||||
parseFile(text, path) {
|
||||
this.tokenizeFile(text, path);
|
||||
let nodes = [];
|
||||
while (!this.isEOF()) {
|
||||
let tok = this.consumeToken();
|
||||
if (tok.type == ECSTokenType.Placeholder) {
|
||||
let args = tok.str.substring(2, tok.str.length - 2).split(/\s+/);
|
||||
nodes.push(new ecs_1.CodePlaceholderNode(this.context, tok.$loc, args));
|
||||
}
|
||||
else if (tok.type == tokenizer_1.TokenType.CatchAll) {
|
||||
nodes.push(new ecs_1.CodeLiteralNode(this.context, tok.$loc, tok.str));
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
}
|
||||
exports.ECSActionCompiler = ECSActionCompiler;
|
||||
//# sourceMappingURL=compiler.js.map
|
1
gen/common/ecs/compiler.js.map
Normal file
1
gen/common/ecs/compiler.js.map
Normal file
File diff suppressed because one or more lines are too long
200
gen/common/ecs/decoder.js
Normal file
200
gen/common/ecs/decoder.js
Normal file
@ -0,0 +1,200 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.newDecoder = exports.VCSBitmap48Decoder = exports.VCSVersatilePlayfieldDecoder = exports.VCSPlayfieldDecoder = exports.VCSBitmapDecoder = exports.VCSSpriteDecoder = void 0;
|
||||
const ecs_1 = require("./ecs");
|
||||
class LineDecoder {
|
||||
constructor(text) {
|
||||
this.curline = 0; // for debugging, zero-indexed
|
||||
// split the text into lines and into tokens
|
||||
this.lines = text.split('\n').map(s => s.trim()).filter(s => !!s).map(s => s.split(/\s+/));
|
||||
}
|
||||
decodeBits(s, n, msbfirst) {
|
||||
if (s.length != n)
|
||||
throw new ecs_1.ECSError(`Expected ${n} characters`);
|
||||
let b = 0;
|
||||
for (let i = 0; i < n; i++) {
|
||||
let bit;
|
||||
let ch = s.charAt(i);
|
||||
if (ch == 'x' || ch == 'X' || ch == '1')
|
||||
bit = 1;
|
||||
else if (ch == '.' || ch == '0')
|
||||
bit = 0;
|
||||
else
|
||||
throw new ecs_1.ECSError('need x or . (or 0 or 1)');
|
||||
if (bit) {
|
||||
if (msbfirst)
|
||||
b |= 1 << (n - 1 - i);
|
||||
else
|
||||
b |= 1 << i;
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
assertTokens(toks, count) {
|
||||
if (toks.length != count)
|
||||
throw new ecs_1.ECSError(`Expected ${count} tokens on line.`);
|
||||
}
|
||||
hex(s) {
|
||||
let v = parseInt(s, 16);
|
||||
if (isNaN(v))
|
||||
throw new ecs_1.ECSError(`Invalid hex value: ${s}`);
|
||||
return v;
|
||||
}
|
||||
getErrorLocation($loc) {
|
||||
// TODO: blank lines mess this up
|
||||
$loc.line += this.curline + 1;
|
||||
return $loc;
|
||||
}
|
||||
}
|
||||
class VCSSpriteDecoder extends LineDecoder {
|
||||
parse() {
|
||||
let height = this.lines.length;
|
||||
let bitmapdata = new Uint8Array(height);
|
||||
let colormapdata = new Uint8Array(height);
|
||||
for (let i = 0; i < height; i++) {
|
||||
this.curline = height - 1 - i;
|
||||
let toks = this.lines[this.curline];
|
||||
this.assertTokens(toks, 2);
|
||||
bitmapdata[i] = this.decodeBits(toks[0], 8, true);
|
||||
colormapdata[i] = this.hex(toks[1]);
|
||||
}
|
||||
return {
|
||||
properties: {
|
||||
bitmapdata, colormapdata, height: height - 1
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.VCSSpriteDecoder = VCSSpriteDecoder;
|
||||
class VCSBitmapDecoder extends LineDecoder {
|
||||
parse() {
|
||||
let height = this.lines.length;
|
||||
let bitmapdata = new Uint8Array(height);
|
||||
for (let i = 0; i < height; i++) {
|
||||
this.curline = height - 1 - i;
|
||||
let toks = this.lines[this.curline];
|
||||
this.assertTokens(toks, 1);
|
||||
bitmapdata[i] = this.decodeBits(toks[0], 8, true);
|
||||
}
|
||||
return {
|
||||
properties: {
|
||||
bitmapdata, height: height - 1
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.VCSBitmapDecoder = VCSBitmapDecoder;
|
||||
class VCSPlayfieldDecoder extends LineDecoder {
|
||||
parse() {
|
||||
let height = this.lines.length;
|
||||
let pf = new Uint32Array(height);
|
||||
for (let i = 0; i < height; i++) {
|
||||
this.curline = height - 1 - i;
|
||||
let toks = this.lines[this.curline];
|
||||
this.assertTokens(toks, 1);
|
||||
let pf0 = this.decodeBits(toks[0].substring(0, 4), 4, false) << 4;
|
||||
let pf1 = this.decodeBits(toks[0].substring(4, 12), 8, true);
|
||||
let pf2 = this.decodeBits(toks[0].substring(12, 20), 8, false);
|
||||
pf[i] = (pf0 << 0) | (pf1 << 8) | (pf2 << 16);
|
||||
}
|
||||
return {
|
||||
properties: {
|
||||
pf
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.VCSPlayfieldDecoder = VCSPlayfieldDecoder;
|
||||
class VCSVersatilePlayfieldDecoder extends LineDecoder {
|
||||
parse() {
|
||||
let height = this.lines.length;
|
||||
let data = new Uint8Array(height * 2);
|
||||
data.fill(0x3f);
|
||||
// pf0 pf1 pf2 colupf colubk ctrlpf trash
|
||||
const regs = [0x0d, 0x0e, 0x0f, 0x08, 0x09, 0x0a, 0x3f];
|
||||
let prev = [0, 0, 0, 0, 0, 0, 0];
|
||||
let cur = [0, 0, 0, 0, 0, 0, 0];
|
||||
for (let i = 0; i < height; i++) {
|
||||
let dataofs = height * 2 - i * 2;
|
||||
this.curline = i;
|
||||
let toks = this.lines[this.curline];
|
||||
if (toks.length == 2) {
|
||||
data[dataofs - 1] = this.hex(toks[0]);
|
||||
data[dataofs - 2] = this.hex(toks[1]);
|
||||
continue;
|
||||
}
|
||||
this.assertTokens(toks, 4);
|
||||
cur[0] = this.decodeBits(toks[0].substring(0, 4), 4, false) << 4;
|
||||
cur[1] = this.decodeBits(toks[0].substring(4, 12), 8, true);
|
||||
cur[2] = this.decodeBits(toks[0].substring(12, 20), 8, false);
|
||||
if (toks[1] != '..')
|
||||
cur[3] = this.hex(toks[1]);
|
||||
if (toks[2] != '..')
|
||||
cur[4] = this.hex(toks[2]);
|
||||
if (toks[3] != '..')
|
||||
cur[5] = this.hex(toks[3]);
|
||||
let changed = [];
|
||||
for (let j = 0; j < cur.length; j++) {
|
||||
if (cur[j] != prev[j])
|
||||
changed.push(j);
|
||||
}
|
||||
if (changed.length > 1) {
|
||||
console.log(changed, cur, prev);
|
||||
throw new ecs_1.ECSError(`More than one register change in line ${i + 1}: [${changed}]`);
|
||||
}
|
||||
let chgidx = changed.length ? changed[0] : regs.length - 1;
|
||||
data[dataofs - 1] = regs[chgidx];
|
||||
data[dataofs - 2] = cur[chgidx];
|
||||
prev[chgidx] = cur[chgidx];
|
||||
}
|
||||
return {
|
||||
properties: {
|
||||
data
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.VCSVersatilePlayfieldDecoder = VCSVersatilePlayfieldDecoder;
|
||||
class VCSBitmap48Decoder extends LineDecoder {
|
||||
parse() {
|
||||
let height = this.lines.length;
|
||||
let bitmap0 = new Uint8Array(height);
|
||||
let bitmap1 = new Uint8Array(height);
|
||||
let bitmap2 = new Uint8Array(height);
|
||||
let bitmap3 = new Uint8Array(height);
|
||||
let bitmap4 = new Uint8Array(height);
|
||||
let bitmap5 = new Uint8Array(height);
|
||||
for (let i = 0; i < height; i++) {
|
||||
this.curline = height - 1 - i;
|
||||
let toks = this.lines[this.curline];
|
||||
this.assertTokens(toks, 1);
|
||||
bitmap0[i] = this.decodeBits(toks[0].slice(0, 8), 8, true);
|
||||
bitmap1[i] = this.decodeBits(toks[0].slice(8, 16), 8, true);
|
||||
bitmap2[i] = this.decodeBits(toks[0].slice(16, 24), 8, true);
|
||||
bitmap3[i] = this.decodeBits(toks[0].slice(24, 32), 8, true);
|
||||
bitmap4[i] = this.decodeBits(toks[0].slice(32, 40), 8, true);
|
||||
bitmap5[i] = this.decodeBits(toks[0].slice(40, 48), 8, true);
|
||||
}
|
||||
return {
|
||||
properties: {
|
||||
bitmap0, bitmap1, bitmap2, bitmap3, bitmap4, bitmap5,
|
||||
height: height - 1
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.VCSBitmap48Decoder = VCSBitmap48Decoder;
|
||||
function newDecoder(name, text) {
|
||||
let cons = DECODERS[name];
|
||||
if (cons)
|
||||
return new cons(text);
|
||||
}
|
||||
exports.newDecoder = newDecoder;
|
||||
const DECODERS = {
|
||||
'vcs_sprite': VCSSpriteDecoder,
|
||||
'vcs_bitmap': VCSBitmapDecoder,
|
||||
'vcs_playfield': VCSPlayfieldDecoder,
|
||||
'vcs_versatile': VCSVersatilePlayfieldDecoder,
|
||||
'vcs_bitmap48': VCSBitmap48Decoder,
|
||||
};
|
||||
//# sourceMappingURL=decoder.js.map
|
1
gen/common/ecs/decoder.js.map
Normal file
1
gen/common/ecs/decoder.js.map
Normal file
File diff suppressed because one or more lines are too long
1845
gen/common/ecs/ecs.js
Normal file
1845
gen/common/ecs/ecs.js
Normal file
File diff suppressed because it is too large
Load Diff
1
gen/common/ecs/ecs.js.map
Normal file
1
gen/common/ecs/ecs.js.map
Normal file
File diff suppressed because one or more lines are too long
32
gen/common/ecs/main.js
Normal file
32
gen/common/ecs/main.js
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_1 = require("fs");
|
||||
const compiler_1 = require("./compiler");
|
||||
const ecs_1 = require("./ecs");
|
||||
class ECSMain {
|
||||
constructor(args) {
|
||||
this.args = args;
|
||||
this.compiler = new compiler_1.ECSCompiler(new ecs_1.EntityManager(new ecs_1.Dialect_CA65()), true); // TODO
|
||||
}
|
||||
run() {
|
||||
for (let path of this.args) {
|
||||
let text = (0, fs_1.readFileSync)(path, 'utf-8');
|
||||
try {
|
||||
this.compiler.parseFile(text, path);
|
||||
if (this.compiler.errors.length == 0) {
|
||||
let file = new ecs_1.SourceFileExport();
|
||||
this.compiler.exportToFile(file);
|
||||
console.log(file.toString());
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
for (let err of this.compiler.errors) {
|
||||
console.error(`${err.path}:${err.line}:${err.start}: ${err.msg}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
new ECSMain(process.argv.slice(2)).run();
|
||||
//# sourceMappingURL=main.js.map
|
1
gen/common/ecs/main.js.map
Normal file
1
gen/common/ecs/main.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/common/ecs/main.ts"],"names":[],"mappings":";;AAAA,2BAAkC;AAClC,yCAAyC;AACzC,+BAAsE;AAEtE,MAAM,OAAO;IAIT,YAAqB,IAAc;QAAd,SAAI,GAAJ,IAAI,CAAU;QAFnC,aAAQ,GAAG,IAAI,sBAAW,CAAC,IAAI,mBAAa,CAAC,IAAI,kBAAY,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO;IAGhF,CAAC;IAED,GAAG;QACC,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;YACxB,IAAI,IAAI,GAAG,IAAA,iBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACvC,IAAI;gBACA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;oBAClC,IAAI,IAAI,GAAG,IAAI,sBAAgB,EAAE,CAAC;oBAClC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;iBAChC;aACJ;YAAC,OAAO,CAAC,EAAE;gBACR,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACpB;YACD,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAClC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;aACrE;SACJ;IACL,CAAC;CACJ;AAED,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC"}
|
231
gen/common/tokenizer.js
Normal file
231
gen/common/tokenizer.js
Normal file
@ -0,0 +1,231 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Tokenizer = exports.TokenizerRuleSet = exports.TokenRule = exports.Token = exports.TokenType = exports.mergeLocs = exports.CompileError = void 0;
|
||||
class CompileError extends Error {
|
||||
constructor(msg, loc) {
|
||||
super(msg);
|
||||
Object.setPrototypeOf(this, CompileError.prototype);
|
||||
this.$loc = loc;
|
||||
}
|
||||
}
|
||||
exports.CompileError = CompileError;
|
||||
function mergeLocs(a, b) {
|
||||
return {
|
||||
line: Math.min(a.line, b.line),
|
||||
start: Math.min(a.start, b.start),
|
||||
end: Math.max(a.end, b.end),
|
||||
label: a.label || b.label,
|
||||
path: a.path || b.path,
|
||||
};
|
||||
}
|
||||
exports.mergeLocs = mergeLocs;
|
||||
var TokenType;
|
||||
(function (TokenType) {
|
||||
TokenType["EOF"] = "eof";
|
||||
TokenType["EOL"] = "eol";
|
||||
TokenType["Ident"] = "ident";
|
||||
TokenType["Comment"] = "comment";
|
||||
TokenType["Ignore"] = "ignore";
|
||||
TokenType["CatchAll"] = "catch-all";
|
||||
})(TokenType = exports.TokenType || (exports.TokenType = {}));
|
||||
class Token {
|
||||
}
|
||||
exports.Token = Token;
|
||||
class TokenRule {
|
||||
}
|
||||
exports.TokenRule = TokenRule;
|
||||
const CATCH_ALL_RULES = [
|
||||
{ type: TokenType.CatchAll, regex: /.+?/ }
|
||||
];
|
||||
function re_escape(rule) {
|
||||
return `(${rule.regex.source})`;
|
||||
}
|
||||
class TokenizerRuleSet {
|
||||
constructor(rules) {
|
||||
this.rules = rules.concat(CATCH_ALL_RULES);
|
||||
var pattern = this.rules.map(re_escape).join('|');
|
||||
this.regex = new RegExp(pattern, "gs"); // global, dotall
|
||||
}
|
||||
}
|
||||
exports.TokenizerRuleSet = TokenizerRuleSet;
|
||||
class Tokenizer {
|
||||
constructor() {
|
||||
this.errorOnCatchAll = false;
|
||||
this.deferred = [];
|
||||
this.errors = [];
|
||||
this.lineno = 0;
|
||||
this.lineindex = [];
|
||||
this.tokens = [];
|
||||
}
|
||||
setTokenRuleSet(ruleset) {
|
||||
this.ruleset = ruleset;
|
||||
}
|
||||
setTokenRules(rules) {
|
||||
this.setTokenRuleSet(new TokenizerRuleSet(rules));
|
||||
}
|
||||
tokenizeFile(contents, path) {
|
||||
this.path = path;
|
||||
let m;
|
||||
let re = /\n|\r\n?/g;
|
||||
this.lineindex.push(0);
|
||||
while (m = re.exec(contents)) {
|
||||
this.lineindex.push(m.index);
|
||||
}
|
||||
this._tokenize(contents);
|
||||
this.eof = { type: TokenType.EOF, str: "", eol: true, $loc: { path: this.path, line: this.lineno } };
|
||||
this.pushToken(this.eof);
|
||||
}
|
||||
_tokenize(text) {
|
||||
// iterate over each token via re_toks regex
|
||||
let m;
|
||||
this.lineno = 0;
|
||||
while (m = this.ruleset.regex.exec(text)) {
|
||||
let found = false;
|
||||
// find line #
|
||||
while (m.index >= this.lineindex[this.lineno]) {
|
||||
this.lineno++;
|
||||
}
|
||||
// find out which capture group was matched, and thus token type
|
||||
let rules = this.ruleset.rules;
|
||||
for (let i = 0; i < rules.length; i++) {
|
||||
let s = m[i + 1];
|
||||
if (s != null) {
|
||||
found = true;
|
||||
let col = m.index - (this.lineindex[this.lineno - 1] || -1) - 1;
|
||||
let loc = { path: this.path, line: this.lineno, start: col, end: col + s.length };
|
||||
let rule = rules[i];
|
||||
// add token to list
|
||||
switch (rule.type) {
|
||||
case TokenType.CatchAll:
|
||||
if (this.errorOnCatchAll) {
|
||||
this.compileError(`I didn't expect the character "${m[0]}" here.`, loc);
|
||||
}
|
||||
default:
|
||||
this.pushToken({ str: s, type: rule.type, $loc: loc, eol: false });
|
||||
break;
|
||||
case TokenType.EOL:
|
||||
// set EOL for last token
|
||||
if (this.tokens.length)
|
||||
this.tokens[this.tokens.length - 1].eol = true;
|
||||
case TokenType.Comment:
|
||||
case TokenType.Ignore:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
this.compileError(`Could not parse token: <<${m[0]}>>`);
|
||||
}
|
||||
}
|
||||
}
|
||||
pushToken(token) {
|
||||
this.tokens.push(token);
|
||||
}
|
||||
addError(msg, loc) {
|
||||
let tok = this.lasttoken || this.peekToken();
|
||||
if (!loc)
|
||||
loc = tok.$loc;
|
||||
this.errors.push({ path: loc.path, line: loc.line, label: this.curlabel, start: loc.start, end: loc.end, msg: msg });
|
||||
}
|
||||
internalError() {
|
||||
return this.compileError("Internal error.");
|
||||
}
|
||||
notImplementedError() {
|
||||
return this.compileError("Not yet implemented.");
|
||||
}
|
||||
compileError(msg, loc, loc2) {
|
||||
this.addError(msg, loc);
|
||||
//if (loc2 != null) this.addError(`...`, loc2);
|
||||
let e = new CompileError(msg, loc);
|
||||
throw e;
|
||||
return e;
|
||||
}
|
||||
peekToken(lookahead) {
|
||||
let tok = this.tokens[lookahead || 0];
|
||||
return tok ? tok : this.eof;
|
||||
}
|
||||
consumeToken() {
|
||||
let tok = this.lasttoken = (this.tokens.shift() || this.eof);
|
||||
return tok;
|
||||
}
|
||||
ifToken(match) {
|
||||
if (this.peekToken().str == match)
|
||||
return this.consumeToken();
|
||||
}
|
||||
expectToken(str, msg) {
|
||||
let tok = this.consumeToken();
|
||||
let tokstr = tok.str;
|
||||
if (str != tokstr) {
|
||||
this.compileError(msg || `There should be a "${str}" here.`);
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
expectTokens(strlist, msg) {
|
||||
let tok = this.consumeToken();
|
||||
let tokstr = tok.str;
|
||||
if (!strlist.includes(tokstr)) {
|
||||
this.compileError(msg || `These keywords are valid here: ${strlist.join(', ')}`);
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
parseModifiers(modifiers) {
|
||||
let result = {};
|
||||
do {
|
||||
var tok = this.peekToken();
|
||||
if (modifiers.indexOf(tok.str) < 0)
|
||||
return result;
|
||||
this.consumeToken();
|
||||
result[tok.str] = true;
|
||||
} while (tok != null);
|
||||
}
|
||||
expectIdent(msg) {
|
||||
let tok = this.consumeToken();
|
||||
if (tok.type != TokenType.Ident)
|
||||
this.compileError(msg || `There should be an identifier here.`);
|
||||
return tok;
|
||||
}
|
||||
pushbackToken(tok) {
|
||||
this.tokens.unshift(tok);
|
||||
}
|
||||
isEOF() {
|
||||
return this.tokens.length == 0 || this.peekToken().type == 'eof'; // TODO?
|
||||
}
|
||||
expectEOL(msg) {
|
||||
let tok = this.consumeToken();
|
||||
if (tok.type != TokenType.EOL)
|
||||
this.compileError(msg || `There's too much stuff on this line.`);
|
||||
}
|
||||
skipBlankLines() {
|
||||
this.skipTokenTypes(['eol']);
|
||||
}
|
||||
skipTokenTypes(types) {
|
||||
while (types.includes(this.peekToken().type))
|
||||
this.consumeToken();
|
||||
}
|
||||
expectTokenTypes(types, msg) {
|
||||
let tok = this.consumeToken();
|
||||
if (!types.includes(tok.type))
|
||||
this.compileError(msg || `There should be a ${types.map((s) => `"${s}"`).join(' or ')} here. not a "${tok.type}".`);
|
||||
return tok;
|
||||
}
|
||||
parseList(parseFunc, delim) {
|
||||
var sep;
|
||||
var list = [];
|
||||
do {
|
||||
var el = parseFunc.bind(this)(); // call parse function
|
||||
if (el != null)
|
||||
list.push(el); // add parsed element to list
|
||||
sep = this.consumeToken(); // consume seperator token
|
||||
} while (sep.str == delim);
|
||||
this.pushbackToken(sep);
|
||||
return list;
|
||||
}
|
||||
runDeferred() {
|
||||
while (this.deferred.length) {
|
||||
this.deferred.shift()();
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Tokenizer = Tokenizer;
|
||||
//# sourceMappingURL=tokenizer.js.map
|
1
gen/common/tokenizer.js.map
Normal file
1
gen/common/tokenizer.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.coerceToArray = exports.FileDataCache = exports.findIntegerFactors = exports.escapeHTML = exports.parseXMLPoorly = exports.XMLParseError = exports.parseBool = exports.decodeQueryString = exports.loadScript = exports.byteToASCII = exports.convertDataToString = exports.convertDataToUint8Array = exports.isTypedArray = exports.isArray = exports.getRootBasePlatform = exports.getRootPlatform = exports.getBasePlatform = exports.getWithBinary = exports.rle_unpack = exports.safeident = exports.clamp = exports.RGBA = exports.rgb2bgr = exports.printFlags = exports.safe_extend = exports.compressLZG = exports.isProbablyBinary = exports.removeBOM = exports.byteArrayToUTF8 = exports.byteArrayToString = exports.stringToByteArray = exports.lzgmini = exports.highlightDifferences = exports.invertMap = exports.arrayCompare = exports.toradix = exports.tobin = exports.hex = exports.getFilenamePrefix = exports.getFolderForPath = exports.getFilenameForPath = exports.byte2signed = exports.rpad = exports.lpad = void 0;
|
||||
exports.coerceToArray = exports.FileDataCache = exports.findIntegerFactors = exports.escapeHTML = exports.parseXMLPoorly = exports.XMLParseError = exports.parseBool = exports.decodeQueryString = exports.loadScript = exports.byteToASCII = exports.convertDataToString = exports.convertDataToUint8Array = exports.isTypedArray = exports.isArray = exports.getRootBasePlatform = exports.getBasePlatform = exports.getWithBinary = exports.rle_unpack = exports.safeident = exports.clamp = exports.RGBA = exports.rgb2bgr = exports.printFlags = exports.safe_extend = exports.compressLZG = exports.isProbablyBinary = exports.removeBOM = exports.byteArrayToUTF8 = exports.byteArrayToString = exports.stringToByteArray = exports.lzgmini = exports.highlightDifferences = exports.invertMap = exports.arrayCompare = exports.toradix = exports.tobin = exports.hex = exports.getFilenamePrefix = exports.getFolderForPath = exports.getFilenameForPath = exports.byte2signed = exports.rpad = exports.lpad = void 0;
|
||||
function lpad(s, n) {
|
||||
s += ''; // convert to string
|
||||
while (s.length < n)
|
||||
@ -484,7 +484,6 @@ exports.getBasePlatform = getBasePlatform;
|
||||
function getRootPlatform(platform) {
|
||||
return platform.split('-')[0];
|
||||
}
|
||||
exports.getRootPlatform = getRootPlatform;
|
||||
// get platform ID without emulator or specialization
|
||||
function getRootBasePlatform(platform) {
|
||||
return getRootPlatform(getBasePlatform(platform));
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"file":"workertypes.js","sourceRoot":"","sources":["../../src/common/workertypes.ts"],"names":[],"mappings":";;;AAqBA,MAAa,UAAU;IAMrB,YAAY,KAAkB,EAAE,IAAW;QACzC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;QAC7B,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;YACtB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,0CAA0C;gBAC1C,4DAA4D;gBAC5D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;gBACtC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;oBAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;aAC7C;SACF;IACH,CAAC;IACD,qEAAqE;IACrE,iBAAiB,CAAC,EAAS,EAAE,UAAiB;QAC5C,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,IAAE,UAAU,EAAE,CAAC,EAAE,EAAE;gBAChC,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAC9B,IAAI,GAAG,EAAE;oBACP,OAAO,GAAG,CAAC;iBACZ;gBACD,EAAE,EAAE,CAAC;aACN;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,SAAS,KAAY,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjD;AArCD,gCAqCC;AAYA,CAAC;AAOD,CAAC;AAID,CAAC;AAsDF,SAAgB,WAAW,CAAC,MAAoB;IAC9C,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,kCAEC;AAED,SAAgB,aAAa,CAAC,MAAoB;IAChD,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,sCAEC;AAED,SAAgB,cAAc,CAAC,MAAoB;IACjD,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,wCAEC"}
|
||||
{"version":3,"file":"workertypes.js","sourceRoot":"","sources":["../../src/common/workertypes.ts"],"names":[],"mappings":";;;AA8BA,MAAa,UAAU;IAMrB,YAAY,KAAkB,EAAE,IAAW;QACzC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;QAC7B,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;YACtB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,0CAA0C;gBAC1C,4DAA4D;gBAC5D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;gBACtC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;oBAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;aAC7C;SACF;IACH,CAAC;IACD,qEAAqE;IACrE,iBAAiB,CAAC,EAAS,EAAE,UAAiB;QAC5C,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,IAAE,UAAU,EAAE,CAAC,EAAE,EAAE;gBAChC,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAC9B,IAAI,GAAG,EAAE;oBACP,OAAO,GAAG,CAAC;iBACZ;gBACD,EAAE,EAAE,CAAC;aACN;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,SAAS,KAAY,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjD;AArCD,gCAqCC;AAYA,CAAC;AAOD,CAAC;AAID,CAAC;AAsDF,SAAgB,WAAW,CAAC,MAAoB;IAC9C,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,kCAEC;AAED,SAAgB,aAAa,CAAC,MAAoB;IAChD,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,sCAEC;AAED,SAAgB,cAAc,CAAC,MAAoB;IACjD,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,wCAEC"}
|
@ -1,2 +1,2 @@
|
||||
import{H as l,p}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as i,N as o}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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.exports.machine_get_raster_line(this.sys),a=Math.floor((this.numTotalScanlines-e)*19965/this.numTotalScanlines),s=this.probe!=null;return s&&this.exports.machine_reset_probe_buffer(),a=super.advanceFrameClock(t,a),s&&this.copyProbeData(),a}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,e=t[9]+(t[8]<<8),a=t[10]+(t[11]<<8),s=t[12]+(t[13]<<8),r=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:r,DE:s,HL:a,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,a){if(!(t==16||t==17||t==18||t==224)){var s=0,r=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,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),a&o.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=s):a&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(){window.open("http://lronaldo.github.io/cpctelera/files/readme-txt.html","_help")}};i["cpc.6128"]=n;i["cpc.464"]=n;i["cpc.kcc"]=n;
|
||||
//# sourceMappingURL=cpc-INI5TYZK.js.map
|
||||
import{H as l,p}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as i,N as o}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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.exports.machine_get_raster_line(this.sys),a=Math.floor((this.numTotalScanlines-e)*19965/this.numTotalScanlines),s=this.probe!=null;return s&&this.exports.machine_reset_probe_buffer(),a=super.advanceFrameClock(t,a),s&&this.copyProbeData(),a}getCPUState(){this.exports.machine_save_cpu_state(this.sys,this.cpustateptr);var t=this.cpustatearr,e=t[9]+(t[8]<<8),a=t[10]+(t[11]<<8),s=t[12]+(t[13]<<8),r=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:r,DE:s,HL:a,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,a){if(!(t==16||t==17||t==18||t==224)){var s=0,r=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,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),a&o.KeyDown?(this.exports.machine_key_down(this.sys,t),this.joymask0|=s):a&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(){window.open("http://lronaldo.github.io/cpctelera/files/readme-txt.html","_help")}};i["cpc.6128"]=n;i["cpc.464"]=n;i["cpc.kcc"]=n;
|
||||
//# sourceMappingURL=cpc-4U2LEU66.js.map
|
@ -1,2 +1,2 @@
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{m as c}from"./chunk-M2YCTORM.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-7IBR52CF.js";import{G as m,m as u,r as h}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{A as o,I as l,_ as i,m as n}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new 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-IUFGDZ3J.js.map
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{m as c}from"./chunk-C6UFFJRO.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-U54L2MMB.js";import{G as m,m as u,r as h}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{A as o,I as l,_ as i,m as n}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new h;this.ram=new Uint8Array(16384);this.read=i([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=i([[0,16383,16383,(e,t)=>{this.ram[e]=t}],[16387,16387,65535,(e,t)=>this.serial.sendByte(t)],[16399,16399,65535,(e,t)=>{this.inputs[s]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var t=0;t<this.cpuFrequency/60&&!(e&&e());)t+=this.advanceCPU();return t}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[s]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[s]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],f=class{constructor(e){e.style.overflowY="auto";var t=$('<div id="gameport"/>').appendTo(e);$('<p class="transcript-header">Serial Output</p>').appendTo(t);var y=$('<div id="windowport" class="transcript"/>').appendTo(t);this.div=y[0]}start(){this.tty=new d(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(e){this.tty.loadState(e)}};function p(r){return r==10?"":r<32?String.fromCharCode(r+9216):String.fromCharCode(r)}var v=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(e){this.clearToSend()&&(this.outputBytes.push(e),this.viewer.tty.addtext(p(e),2|32),e==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var e=this.readIndex();this.inputIndex=e;var t=(this.inputBytes&&this.inputBytes[e])|0;return this.viewer.tty.addtext(p(t),2|16),t==10&&this.viewer.tty.newline(),t}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(e){this.clk+=e}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(e){this.clk=e.clk,this.inputIndex=e.idx,this.outputBytes=e.out.slice()}},x=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new f(e)}async start(){super.start(),this.serial=new v,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=o(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=n(this.serial.outputBytes),c(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new a}getPresets(){return S}getDefaultExtension(){return".dasm"}readAddress(e){return this.machine.readConst(e)}};l["devel-6502"]=x;export{v as SerialTestHarness};
|
||||
//# sourceMappingURL=devel-4ALBT3HO.js.map
|
@ -1,2 +1,2 @@
|
||||
import{a as w,b as x}from"./chunk-7IBR52CF.js";import"./chunk-JM5NHRL4.js";import{C as v,I as c,k as m,l as u,w as g,y as p}from"./chunk-VOKPYVET.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
|
||||
import{a as w,b as x}from"./chunk-U54L2MMB.js";import"./chunk-5B4VPQ4V.js";import{C as v,I as c,k as m,l as u,w as g,y as p}from"./chunk-ZDSSTLWD.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
|
||||
//# sourceMappingURL=embedui.js.map
|
||||
|
File diff suppressed because one or more lines are too long
@ -113,6 +113,9 @@ class CodeProject {
|
||||
if (data && (0, workertypes_1.isOutputResult)(data)) {
|
||||
this.processBuildResult(data);
|
||||
}
|
||||
else if ((0, workertypes_1.isErrorResult)(data)) {
|
||||
this.processBuildListings(data);
|
||||
}
|
||||
this.callbackBuildResult(data);
|
||||
}
|
||||
preloadWorker(path) {
|
||||
@ -130,6 +133,7 @@ class CodeProject {
|
||||
if (dir.length > 0 && dir != 'local') // TODO
|
||||
files.push(dir + '/' + fn);
|
||||
}
|
||||
// TODO: use tool id to parse files, not platform
|
||||
parseIncludeDependencies(text) {
|
||||
let files = [];
|
||||
let m;
|
||||
@ -181,13 +185,18 @@ class CodeProject {
|
||||
this.pushAllFiles(files, m[2]);
|
||||
}
|
||||
// for wiz
|
||||
let re5 = /^\s*(import|embed)\s+"(.+?)";/gmi;
|
||||
let re5 = /^\s*(import|embed)\s*"(.+?)";/gmi;
|
||||
while (m = re5.exec(text)) {
|
||||
if (m[1] == 'import')
|
||||
this.pushAllFiles(files, m[2] + ".wiz");
|
||||
else
|
||||
this.pushAllFiles(files, m[2]);
|
||||
}
|
||||
// for ecs
|
||||
let re6 = /^\s*(import)\s*"(.+?)"/gmi;
|
||||
while (m = re6.exec(text)) {
|
||||
this.pushAllFiles(files, m[2]);
|
||||
}
|
||||
}
|
||||
return files;
|
||||
}
|
||||
@ -352,7 +361,7 @@ class CodeProject {
|
||||
this.callbackBuildStatus(true);
|
||||
this.sendBuild();
|
||||
}
|
||||
processBuildResult(data) {
|
||||
processBuildListings(data) {
|
||||
// TODO: link listings with source files
|
||||
if (data.listings) {
|
||||
this.listings = data.listings;
|
||||
@ -364,6 +373,12 @@ class CodeProject {
|
||||
lst.assemblyfile = new workertypes_1.SourceFile(lst.asmlines, lst.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
processBuildResult(data) {
|
||||
this.processBuildListings(data);
|
||||
this.processBuildSegments(data);
|
||||
}
|
||||
processBuildSegments(data) {
|
||||
// save and sort segment list
|
||||
var segs = (this.platform.getMemoryMap && this.platform.getMemoryMap()["main"]) || [];
|
||||
if (data.segments) {
|
||||
@ -383,6 +398,10 @@ class CodeProject {
|
||||
var fnprefix = (0, util_1.getFilenamePrefix)(this.stripLocalPath(path));
|
||||
var listings = this.getListings();
|
||||
var onlyfile = null;
|
||||
for (var lstfn in listings) {
|
||||
if (lstfn == path)
|
||||
return listings[lstfn];
|
||||
}
|
||||
for (var lstfn in listings) {
|
||||
onlyfile = lstfn;
|
||||
if ((0, util_1.getFilenamePrefix)(lstfn) == fnprefix) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -84,7 +84,8 @@ const TOOL_TO_SOURCE_STYLE = {
|
||||
'silice': 'verilog',
|
||||
'wiz': 'text/x-wiz',
|
||||
'vasmarm': 'vasm',
|
||||
'armips': 'vasm'
|
||||
'armips': 'vasm',
|
||||
'ecs': 'ecs',
|
||||
};
|
||||
const TOOL_TO_HELPURL = {
|
||||
'dasm': 'https://github.com/dasm-assembler/dasm/blob/master/docs/dasm.pdf',
|
||||
@ -281,7 +282,7 @@ function refreshWindowList() {
|
||||
for (var lstfn in listings) {
|
||||
var lst = listings[lstfn];
|
||||
// add listing if source/assembly file exists and has text
|
||||
if ((lst.assemblyfile && lst.assemblyfile.text) || (lst.sourcefile && lst.sourcefile.text)) {
|
||||
if ((lst.assemblyfile && lst.assemblyfile.text) || (lst.sourcefile && lst.sourcefile.text) || lst.text) {
|
||||
addWindowItem(lstfn, (0, util_1.getFilenameForPath)(lstfn), (path) => {
|
||||
return new editors_1.ListingView(path);
|
||||
});
|
||||
@ -1774,6 +1775,8 @@ function _addIncludeFile() {
|
||||
addFileToProject("Verilog", ".v", (s) => { return '`include "' + s + '"'; });
|
||||
else if (tool == 'wiz')
|
||||
addFileToProject("Include", ".wiz", (s) => { return 'import "' + s + '";'; });
|
||||
else if (tool == 'ecs')
|
||||
addFileToProject("Include", ".ecs", (s) => { return 'import "' + s + '"'; });
|
||||
else
|
||||
alertError("Can't add include file to this project type (" + tool + ")");
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -185,6 +185,12 @@ class AssetEditorView {
|
||||
var meta = { defs: metadefs, width: width * 8, height: height * 8 };
|
||||
result.push({ fileid: id, label: ident, meta: meta });
|
||||
}
|
||||
// TODO: look for decode <ident> --- ... ---
|
||||
/*
|
||||
var re3 = /\bdecode\s+(\w+)\s*---(.+?)---/gims;
|
||||
while (m = re3.exec(data)) {
|
||||
}
|
||||
*/
|
||||
return result;
|
||||
}
|
||||
// TODO: move to pixeleditor.ts?
|
||||
|
File diff suppressed because one or more lines are too long
@ -28,7 +28,8 @@ const MODEDEFS = {
|
||||
inform6: { theme: 'cobalt' },
|
||||
markdown: { lineWrap: true },
|
||||
fastbasic: { noGutters: true },
|
||||
basic: { noLineNumbers: true, noGutters: true }, // TODO: not used?
|
||||
basic: { noLineNumbers: true, noGutters: true },
|
||||
ecs: { theme: 'mbo', isAsm: true },
|
||||
};
|
||||
exports.textMapFunctions = {
|
||||
input: null
|
||||
@ -186,7 +187,7 @@ class SourceEditor {
|
||||
if (!info.path || this.path.endsWith(info.path)) {
|
||||
var numLines = this.editor.lineCount();
|
||||
var line = info.line - 1;
|
||||
if (line < 0 || line >= numLines)
|
||||
if (isNaN(line) || line < 0 || line >= numLines)
|
||||
line = 0;
|
||||
this.addErrorMarker(line, info.msg);
|
||||
if (info.start != null) {
|
||||
@ -247,6 +248,7 @@ class SourceEditor {
|
||||
this.editor.clearGutter("gutter-clock");
|
||||
var lstlines = this.sourcefile.lines || [];
|
||||
for (var info of lstlines) {
|
||||
//if (info.path && info.path != this.path) continue;
|
||||
if (info.offset >= 0) {
|
||||
this.setGutter("gutter-offset", info.line - 1, (0, util_1.hex)(info.offset & 0xffff, 4));
|
||||
}
|
||||
@ -528,7 +530,7 @@ class ListingView extends DisassemblerView {
|
||||
refreshListing() {
|
||||
// lookup corresponding assemblyfile for this file, using listing
|
||||
var lst = ui_1.current_project.getListingForFile(this.path);
|
||||
// TODO?
|
||||
// TODO?
|
||||
this.assemblyfile = lst && (lst.assemblyfile || lst.sourcefile);
|
||||
}
|
||||
refresh(moveCursor) {
|
||||
@ -538,6 +540,7 @@ class ListingView extends DisassemblerView {
|
||||
return;
|
||||
var asmtext = this.assemblyfile.text;
|
||||
var disasmview = this.getDisasmView();
|
||||
// TODO: sometimes it picks one without a text file
|
||||
disasmview.setValue(asmtext);
|
||||
// go to PC
|
||||
if (!ui_1.platform.saveState)
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
import{G as c,m as x,r as F}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as l,N as A,U as e,Z as p,_ as m,g as _,k as I,l as h}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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+an8GGkBkAPu8xesQBcQ843yDkIbah4gjB4l2x4gLx6iCiAxHkyvHakAhfiF+SBaHskB8AYgrB9M2x0gGR/Q0yWi8MwlBPD0KILvIGofyRUQu8kU8ETJEPAsyREoYRLwL8kT8DEKKAGF/KIEpP/QCrH6BvwqkfpMwxwKJvom+8rQ6vAIqQHQAqkAhf8OgmZjHyihTMgdpe+F+qXwDoR6Wh7JO9D5JRr3hfYgnR+qIJEfKMGF+yjl+ijhivAPJQORJUMlO8rQ8uglB8X20BcowvfQE4rQuaIMDkOaDgLPTxwlD6IR0O4OBNYoofaF9yAvHqk7IKAepfrN9xel+w6iGRipACA7HiDMHyAeHqX2JQOl9yiBTGQcqRiqJVGRJVGgALH6DgUFDgJy8A4IIeb40ALm+UxIHSV6Lx4lJCCeDgcnng4CQCUqTKwdpvKapftIpfpIpfFIpvWk9KXzQMkg8MrJf/AbyQ3w28kK8BzJLvAmyUfw1clR8ArJTPAJTGocDiIgQh1M5xw4pfrpAYX6sALG+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-IK2XJ354.js.map
|
||||
import{G as c,m as x,r as F}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as l,N as A,U as e,Z as p,_ as m,g as _,k as I,l as h}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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+an8GGkBkAPu8xesQBcQ843yDkIbah4gjB4l2x4gLx6iCiAxHkyvHakAhfiF+SBaHskB8AYgrB9M2x0gGR/Q0yWi8MwlBPD0KILvIGofyRUQu8kU8ETJEPAsyREoYRLwL8kT8DEKKAGF/KIEpP/QCrH6BvwqkfpMwxwKJvom+8rQ6vAIqQHQAqkAhf8OgmZjHyihTMgdpe+F+qXwDoR6Wh7JO9D5JRr3hfYgnR+qIJEfKMGF+yjl+ijhivAPJQORJUMlO8rQ8uglB8X20BcowvfQE4rQuaIMDkOaDgLPTxwlD6IR0O4OBNYoofaF9yAvHqk7IKAepfrN9xel+w6iGRipACA7HiDMHyAeHqX2JQOl9yiBTGQcqRiqJVGRJVGgALH6DgUFDgJy8A4IIeb40ALm+UxIHSV6Lx4lJCCeDgcnng4CQCUqTKwdpvKapftIpfpIpfFIpvWk9KXzQMkg8MrJf/AbyQ3w28kK8BzJLvAmyUfw1clR8ArJTPAJTGocDiIgQh1M5xw4pfrpAYX6sALG+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-XN2SDPG5.js.map
|
@ -1,2 +1,2 @@
|
||||
import{I as t}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var o=class{constructor(e){this.mainElement=e,this.iframe=$('<iframe sandbox="allow-same-origin" width="100%" height="100%"/>').appendTo(e)[0],this.iframe.style.backgroundColor="white",e.classList.add("vertical-scroll"),e.style.overflowY="auto"}start(){}reset(){}pause(){}resume(){}loadROM(e,r){$(this.iframe).contents().find("body").html(r)}isRunning(){return!1}isDebugging(){return!1}getToolForFilename(e){return"markdown"}getDefaultExtension(){return".md"}getPresets(){return[{id:"hello.md",name:"Hello"}]}showHelp(){window.open("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax","_help")}};t.markdown=o;
|
||||
//# sourceMappingURL=markdown-3OKXF7BI.js.map
|
||||
import{I as t}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";var o=class{constructor(e){this.mainElement=e,this.iframe=$('<iframe sandbox="allow-same-origin" width="100%" height="100%"/>').appendTo(e)[0],this.iframe.style.backgroundColor="white",e.classList.add("vertical-scroll"),e.style.overflowY="auto"}start(){}reset(){}pause(){}resume(){}loadROM(e,r){$(this.iframe).contents().find("body").html(r)}isRunning(){return!1}isDebugging(){return!1}getToolForFilename(e){return"markdown"}getDefaultExtension(){return".md"}getPresets(){return[{id:"hello.md",name:"Hello"}]}showHelp(){window.open("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax","_help")}};t.markdown=o;
|
||||
//# sourceMappingURL=markdown-SPPH7JDJ.js.map
|
@ -1,4 +1,4 @@
|
||||
import{b as r}from"./chunk-4UOPFAU7.js";import{H as x,d as U,e as Q}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as T,N as t,U as A,X as H,k as E,l as O}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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 r{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 Q(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}}]}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{b as r}from"./chunk-62DK4CUF.js";import{H as x,d as U,e as Q}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as T,N as t,U as A,X as H,k as E,l as O}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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 r{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 Q(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}}]}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 F=[{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)"}],h=[{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 x{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 F}getDefaultExtension(){return".c"}readAddress(s){return this.machine.read(s)}readVRAMAddress(s){return this.machine.readVRAMAddress(s)}},C=class extends k{getPresets(){return h}};T.msx=k;T["msx-libcv"]=C;
|
||||
//# sourceMappingURL=msx-I635A3G2.js.map
|
||||
//# sourceMappingURL=msx-GZ3LPP3D.js.map
|
@ -1,2 +1,2 @@
|
||||
import{H as h,c as f,o as m}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as a,U as t,V as o,X as c,_ as i}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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,b=4293848814,w=4278190080,n=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?b:w}]]);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 n}getPresets(){return _}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}};a.mw8080bw=p;
|
||||
//# sourceMappingURL=mw8080bw-GEN2OQJD.js.map
|
||||
import{H as h,c as f,o as m}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as a,U as t,V as o,X as c,_ as i}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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,b=4293848814,w=4278190080,n=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?b:w}]]);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 n}getPresets(){return _}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}};a.mw8080bw=p;
|
||||
//# sourceMappingURL=mw8080bw-C26LYF3I.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -81,11 +81,12 @@ class JSNESPlatform extends baseplatform_1.Base6502Platform {
|
||||
this.probe = this.nullProbe;
|
||||
this.getMemoryMap = function () {
|
||||
return { main: [
|
||||
//{name:'Work RAM',start:0x0,size:0x800,type:'ram'},
|
||||
{ name: 'Zero Page RAM', start: 0x0, size: 0x100, type: 'ram' },
|
||||
{ name: 'OAM Buffer', start: 0x200, size: 0x100, type: 'ram' },
|
||||
{ name: 'Work RAM', start: 0x300, size: 0x1000 - 0x300, type: 'ram' },
|
||||
{ name: 'PPU Registers', start: 0x2000, last: 0x2008, size: 0x2000, type: 'io' },
|
||||
{ name: 'APU Registers', start: 0x4000, last: 0x4020, size: 0x2000, type: 'io' },
|
||||
{ name: 'Cartridge RAM', start: 0x6000, size: 0x2000, type: 'ram' },
|
||||
{ name: 'Optional Cartridge RAM', start: 0x6000, size: 0x2000, type: 'ram' },
|
||||
] };
|
||||
};
|
||||
this.mainElement = mainElement;
|
||||
|
File diff suppressed because one or more lines are too long
@ -59,6 +59,8 @@ function getToolForFilename_vcs(fn) {
|
||||
return "bataribasic";
|
||||
if (fn.endsWith(".ca65"))
|
||||
return "ca65";
|
||||
if (fn.endsWith(".ecs"))
|
||||
return "ecs";
|
||||
return "dasm";
|
||||
}
|
||||
class VCSPlatform extends baseplatform_1.BasePlatform {
|
||||
|
File diff suppressed because one or more lines are too long
@ -14,7 +14,7 @@ var WilliamsPlatform = function (mainElement, proto, options) {
|
||||
var self = this;
|
||||
this.__proto__ = new (proto ? proto : baseplatform_1.Base6809Platform)();
|
||||
options = options || {};
|
||||
var isDefender = options.isDefender;
|
||||
var isDefender = options === null || options === void 0 ? void 0 : options.isDefender;
|
||||
var SCREEN_HEIGHT = 304;
|
||||
var SCREEN_WIDTH = 256;
|
||||
var cpu, ram, rom, nvram;
|
||||
@ -289,7 +289,7 @@ var WilliamsPlatform = function (mainElement, proto, options) {
|
||||
worker = new Worker("./src/common/audio/z80worker.js");
|
||||
workerchannel = new audio_1.WorkerSoundChannel(worker);
|
||||
audio.master.addChannel(workerchannel);
|
||||
let rotate = options.rotate == null ? -90 : parseFloat(options.rotate);
|
||||
let rotate = (options === null || options === void 0 ? void 0 : options.rotate) == null ? -90 : parseFloat(options.rotate);
|
||||
video = new emu_1.RasterVideo(mainElement, SCREEN_WIDTH, SCREEN_HEIGHT, { rotate });
|
||||
video.create();
|
||||
$(video.canvas).click(function (e) {
|
||||
|
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 l,b as g}from"./chunk-4UOPFAU7.js";import{H as m,d as h,f as d}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as o,U as t,X as u,Z as x,_ as s,g as f}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";var S=u([[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.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]]),n=class extends g{constructor(){super();this.numVisibleScanlines=240;this.defaultROMSize=49152;this.ram=new Uint8Array(1024);this.read=s([[49152,65535,1023,e=>this.ram[e]],[0,49151,65535,e=>this.rom&&this.rom[e]]]);this.write=s([[49152,65535,1023,(e,r)=>{this.ram[e]=r}]]);this.init(this,this.newIOBus(),new d(new h))}getKeyboardMap(){return S}vdpInterrupt(){return this.probe.logInterrupt(255),this.cpu.interrupt(255)}getVCounter(){return 0}getHCounter(){return 0}setMemoryControl(e){}setIOPortControl(e){}newIOBus(){return{read:e=>{switch(e&=255,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},write:(e,r)=>{switch(e&=255,r&=255,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)}}}}},c=class extends n{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=s([[49152,65535,8191,e=>this.ram[e]],[0,1023,1023,e=>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=s([[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 i=this.pagingRegisters[0];i&8&&(this.cartram.length==0&&(this.cartram=new Uint8Array(32768)),this.cartram[i&4?e+16384:e]=r)}]])}newVDP(e,r,i){return new l(e,r,i)}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=x(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 l,b as g}from"./chunk-62DK4CUF.js";import{H as m,d as h,f as d}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as o,U as t,X as u,Z as x,_ as s,g as f}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";var S=u([[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.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]]),n=class extends g{constructor(){super();this.numVisibleScanlines=240;this.defaultROMSize=49152;this.ram=new Uint8Array(1024);this.read=s([[49152,65535,1023,e=>this.ram[e]],[0,49151,65535,e=>this.rom&&this.rom[e]]]);this.write=s([[49152,65535,1023,(e,r)=>{this.ram[e]=r}]]);this.init(this,this.newIOBus(),new d(new h))}getKeyboardMap(){return S}vdpInterrupt(){return this.probe.logInterrupt(255),this.cpu.interrupt(255)}getVCounter(){return 0}getHCounter(){return 0}setMemoryControl(e){}setIOPortControl(e){}newIOBus(){return{read:e=>{switch(e&=255,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},write:(e,r)=>{switch(e&=255,r&=255,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)}}}}},c=class extends n{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=s([[49152,65535,8191,e=>this.ram[e]],[0,1023,1023,e=>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=s([[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 i=this.pagingRegisters[0];i&8&&(this.cartram.length==0&&(this.cartram=new Uint8Array(32768)),this.cartram[i&4?e+16384:e]=r)}]])}newVDP(e,r,i){return new l(e,r,i)}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=x(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)}}};var P=[{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"}],b=[{id:"mode4test.c",name:"Mode 4 Test"},{id:"climber.c",name:"Climber Game"}],p=class extends m{newMachine(){return new n}getPresets(){return P}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}readVRAMAddress(e){return this.machine.readVRAMAddress(e)}},M=class extends m{newMachine(){return new c}getPresets(){return b}getDefaultExtension(){return".c"}readAddress(e){return this.machine.read(e)}readVRAMAddress(e){return this.machine.readVRAMAddress(e)}};o["sms-sg1000-libcv"]=p;o["sms-sms-libcv"]=M;export{P as SG1000_PRESETS,b as SMS_PRESETS};
|
||||
//# sourceMappingURL=sms-JYZTOW6M.js.map
|
||||
//# sourceMappingURL=sms-B2MIBBZY.js.map
|
@ -1,2 +1,2 @@
|
||||
import{B as w}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as v,O as x,Q as p,S as C,Z as P,_ as d}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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-ZTQ2YZMZ.js.map
|
||||
import{B as w}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as v,O as x,Q as p,S as C,Z as P,_ as d}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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-HSHUR3JJ.js.map
|
@ -1,2 +1,2 @@
|
||||
import{H as m,c as n,n as o}from"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import{I as i,_ as s}from"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.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-O3GGVKQY.js.map
|
||||
import{H as m,c as n,n as o}from"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import{I as i,_ as s}from"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.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-NKTPLGE3.js.map
|
181
gen/test/testecs.js
Normal file
181
gen/test/testecs.js
Normal file
@ -0,0 +1,181 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const child_process_1 = require("child_process");
|
||||
const fs_1 = require("fs");
|
||||
const mocha_1 = require("mocha");
|
||||
const binpack_1 = require("../common/ecs/binpack");
|
||||
const compiler_1 = require("../common/ecs/compiler");
|
||||
const ecs_1 = require("../common/ecs/ecs");
|
||||
function testCompiler() {
|
||||
let em = new ecs_1.EntityManager(new ecs_1.Dialect_CA65()); // TODO
|
||||
let c = new compiler_1.ECSCompiler(em, true);
|
||||
try {
|
||||
c.parseFile(`
|
||||
// comment
|
||||
/*
|
||||
mju,fjeqowfjqewiofjqe
|
||||
*/
|
||||
component Kernel
|
||||
lines: 0..255
|
||||
bgcolor: 0..255
|
||||
end
|
||||
component Bitmap
|
||||
data: array of 0..255
|
||||
end
|
||||
component HasBitmap
|
||||
bitmap: [Bitmap]
|
||||
end
|
||||
|
||||
system SimpleKernel
|
||||
locals 8
|
||||
on preframe do with [Kernel] --- JUNK_AT_END
|
||||
lda #5
|
||||
sta #6
|
||||
Label:
|
||||
---
|
||||
end
|
||||
|
||||
comment ---
|
||||
|
||||
---
|
||||
|
||||
scope Root
|
||||
entity kernel [Kernel]
|
||||
const lines = 0xc0
|
||||
//const lines = $c0
|
||||
end
|
||||
entity nobmp [Bitmap]
|
||||
const data = [4]
|
||||
end
|
||||
entity bmp [Bitmap]
|
||||
const data = [1,2,3]
|
||||
end
|
||||
entity player1 [HasBitmap]
|
||||
init bitmap = #bmp
|
||||
end
|
||||
end
|
||||
|
||||
`, 'foo.txt');
|
||||
//console.log('json', c.em.toJSON());
|
||||
let src = new ecs_1.SourceFileExport();
|
||||
c.exportToFile(src);
|
||||
// TODO: test?
|
||||
console.log(src.toString());
|
||||
return em;
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
for (let err of c.errors) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(c.tokens);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
// TODO: files in markdown?
|
||||
// TODO: jsr OperModeExecutionTree?
|
||||
(0, mocha_1.describe)('Tokenizer', function () {
|
||||
it('Should use Compiler', function () {
|
||||
testCompiler();
|
||||
});
|
||||
});
|
||||
(0, mocha_1.describe)('Compiler', function () {
|
||||
let testdir = './test/ecs/';
|
||||
let files = (0, fs_1.readdirSync)(testdir).filter(f => f.endsWith('.ecs'));
|
||||
files.forEach((ecsfn) => {
|
||||
it('Should compile ' + ecsfn, function () {
|
||||
let asmfn = ecsfn.replace('.ecs', '.asm');
|
||||
let goodfn = ecsfn.replace('.ecs', '.txt');
|
||||
let ecspath = testdir + ecsfn;
|
||||
let goodpath = testdir + goodfn;
|
||||
let dialect = new ecs_1.Dialect_CA65();
|
||||
let em = new ecs_1.EntityManager(dialect);
|
||||
em.mainPath = ecspath;
|
||||
let compiler = new compiler_1.ECSCompiler(em, true);
|
||||
compiler.getImportFile = (path) => {
|
||||
return (0, fs_1.readFileSync)(testdir + path, 'utf-8');
|
||||
};
|
||||
let code = (0, fs_1.readFileSync)(ecspath, 'utf-8');
|
||||
var outtxt = '';
|
||||
try {
|
||||
compiler.parseFile(code, ecspath);
|
||||
// TODO: errors
|
||||
let out = new ecs_1.SourceFileExport();
|
||||
em.exportToFile(out);
|
||||
outtxt = out.toString();
|
||||
}
|
||||
catch (e) {
|
||||
outtxt = e.toString();
|
||||
console.log(e);
|
||||
}
|
||||
if (compiler.errors.length)
|
||||
outtxt = compiler.errors.map(e => `${e.line}:${e.msg}`).join('\n');
|
||||
let goodtxt = (0, fs_1.existsSync)(goodpath) ? (0, fs_1.readFileSync)(goodpath, 'utf-8') : '';
|
||||
if (outtxt.trim() != goodtxt.trim()) {
|
||||
let asmpath = '/tmp/' + asmfn;
|
||||
(0, fs_1.writeFileSync)(asmpath, outtxt, 'utf-8');
|
||||
console.log((0, child_process_1.spawnSync)('/usr/bin/diff', [goodpath, asmpath], { encoding: 'utf-8' }).stdout);
|
||||
throw new Error(`files different; to fix: cp ${asmpath} ${goodpath}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function testPack(bins, boxes) {
|
||||
let packer = new binpack_1.Packer();
|
||||
for (let bin of bins)
|
||||
packer.bins.push(bin);
|
||||
for (let bc of boxes)
|
||||
packer.boxes.push(bc);
|
||||
if (!packer.pack())
|
||||
throw new Error('cannot pack');
|
||||
//console.log(packer.boxes);
|
||||
//console.log(packer.bins[0].free)
|
||||
}
|
||||
(0, mocha_1.describe)('Box Packer', function () {
|
||||
it('Should pack boxes', function () {
|
||||
testPack([
|
||||
new binpack_1.Bin({ left: 0, top: 0, right: 10, bottom: 10 })
|
||||
], [
|
||||
{ width: 5, height: 5 },
|
||||
{ width: 5, height: 5 },
|
||||
{ width: 5, height: 5 },
|
||||
{ width: 5, height: 5 },
|
||||
]);
|
||||
});
|
||||
it('Should pack top-aligned boxes', function () {
|
||||
testPack([
|
||||
new binpack_1.Bin({ left: 0, top: 0, right: 10, bottom: 10 })
|
||||
], [
|
||||
{ width: 5, height: 7, top: 0 },
|
||||
{ width: 5, height: 7, top: 1 },
|
||||
{ width: 5, height: 1 },
|
||||
{ width: 5, height: 1 },
|
||||
{ width: 5, height: 3 },
|
||||
{ width: 5, height: 1 },
|
||||
]);
|
||||
});
|
||||
it('Should pack unaligned boxes', function () {
|
||||
testPack([
|
||||
new binpack_1.Bin({ left: 0, top: 0, right: 10, bottom: 10 })
|
||||
], [
|
||||
{ width: 3, height: 7, top: 0 },
|
||||
{ width: 3, height: 7, top: 1 },
|
||||
{ width: 3, height: 7, top: 2 },
|
||||
{ width: 5, height: 1 },
|
||||
{ width: 3, height: 1 },
|
||||
]);
|
||||
});
|
||||
it('Should pack multiple bins', function () {
|
||||
testPack([
|
||||
new binpack_1.Bin({ left: 0, top: 0, right: 10, bottom: 10 }),
|
||||
new binpack_1.Bin({ left: 0, top: 0, right: 10, bottom: 10 })
|
||||
], [
|
||||
{ width: 5, height: 10 },
|
||||
{ width: 5, height: 10 },
|
||||
{ width: 5, height: 5 },
|
||||
{ width: 5, height: 10 },
|
||||
{ width: 5, height: 5 },
|
||||
]);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=testecs.js.map
|
1
gen/test/testecs.js.map
Normal file
1
gen/test/testecs.js.map
Normal file
File diff suppressed because one or more lines are too long
172
gen/test/testutil.js
Normal file
172
gen/test/testutil.js
Normal file
@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const mocha_1 = require("mocha");
|
||||
const emu_1 = require("../common/emu");
|
||||
const util_1 = require("../common/util");
|
||||
const tokenizer_1 = require("../common/tokenizer");
|
||||
var NES_CONIO_ROM_LZG = [
|
||||
76, 90, 71, 0, 0, 160, 16, 0, 0, 11, 158, 107, 131, 223, 83, 1, 9, 17, 21, 22, 78, 69, 83, 26, 2, 1, 3, 0, 22, 6, 120, 216,
|
||||
162, 0, 134, 112, 134, 114, 134, 113, 134, 115, 154, 169, 32, 157, 0, 2, 157, 0, 3, 157, 0, 4, 232, 208, 244, 32, 134, 130, 32, 85, 129, 169,
|
||||
0, 162, 8, 133, 2, 134, 3, 32, 93, 128, 32, 50, 129, 32, 73, 129, 76, 0, 128, 72, 152, 72, 138, 72, 169, 1, 133, 112, 230, 107, 208, 2,
|
||||
230, 108, 32, 232, 129, 169, 32, 141, 6, 32, 169, 0, 22, 129, 141, 5, 22, 66, 104, 170, 104, 168, 104, 64, 160, 0, 240, 7, 169, 105, 162, 128,
|
||||
76, 4, 96, 96, 162, 0, 21, 23, 0, 32, 22, 195, 1, 22, 194, 63, 21, 37, 21, 134, 22, 197, 41, 21, 27, 173, 41, 96, 201, 4, 32, 169,
|
||||
129, 240, 3, 76, 158, 128, 76, 188, 128, 169, 184, 162, 130, 24, 109, 41, 96, 144, 1, 232, 160, 0, 32, 130, 129, 141, 7, 21, 36, 238, 41, 96,
|
||||
21, 32, 76, 140, 128, 21, 47, 33, 21, 246, 201, 17, 14, 61, 15, 21, 253, 227, 128, 76, 1, 129, 169, 169, 17, 24, 61, 209, 21, 125, 17, 2,
|
||||
180, 17, 10, 130, 5, 22, 201, 128, 17, 4, 172, 30, 141, 1, 32, 76, 46, 129, 22, 65, 96, 173, 0, 96, 174, 1, 96, 32, 112, 130, 173, 2,
|
||||
96, 174, 3, 21, 65, 160, 4, 76, 105, 128, 17, 3, 228, 188, 162, 130, 17, 2, 228, 169, 188, 133, 10, 169, 130, 133, 11, 169, 0, 133, 12, 169,
|
||||
96, 133, 13, 162, 214, 169, 255, 133, 18, 160, 0, 232, 240, 13, 177, 10, 145, 12, 200, 208, 246, 230, 11, 230, 13, 208, 240, 230, 18, 208, 239, 96,
|
||||
133, 10, 134, 11, 162, 0, 177, 10, 96, 208, 42, 162, 0, 138, 96, 240, 36, 22, 163, 30, 48, 28, 22, 227, 2, 16, 20, 22, 227, 14, 144, 12,
|
||||
21, 200, 176, 4, 22, 226, 162, 0, 169, 1, 96, 165, 115, 208, 252, 96, 169, 255, 197, 115, 240, 252, 96, 133, 118, 132, 116, 134, 117, 32, 193, 129,
|
||||
164, 113, 165, 116, 153, 0, 2, 165, 117, 153, 0, 3, 165, 118, 153, 0, 4, 200, 132, 113, 230, 115, 96, 164, 115, 208, 1, 96, 166, 114, 169, 14,
|
||||
141, 42, 96, 189, 0, 2, 141, 6, 32, 189, 0, 3, 22, 163, 4, 141, 7, 32, 232, 136, 240, 93, 17, 19, 14, 71, 17, 19, 14, 49, 17, 19,
|
||||
14, 27, 17, 19, 14, 5, 206, 42, 96, 208, 141, 134, 114, 132, 115, 96, 169, 0, 162, 0, 72, 165, 2, 56, 233, 2, 133, 2, 176, 2, 198, 3,
|
||||
160, 1, 138, 145, 2, 104, 136, 145, 2, 96, 169, 41, 133, 10, 169, 96, 17, 34, 41, 168, 162, 0, 240, 10, 145, 10, 200, 208, 251, 230, 11, 202,
|
||||
208, 246, 192, 2, 240, 5, 21, 70, 247, 96, 78, 111, 32, 99, 97, 114, 116, 32, 108, 111, 97, 100, 101, 100, 0, 1, 0, 16, 32, 17, 66, 184,
|
||||
141, 18, 96, 142, 19, 96, 141, 25, 96, 142, 26, 96, 136, 185, 255, 255, 141, 35, 22, 196, 34, 96, 140, 37, 96, 32, 255, 255, 160, 255, 208, 232,
|
||||
96, 17, 71, 230, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 10, 53, 128, 0, 128, 92, 128,
|
||||
17, 14, 14, 204, 204, 51, 51, 22, 106, 0, 24, 60, 126, 24, 22, 1, 22, 231, 16, 48, 127, 127, 48, 16, 0, 22, 230, 12, 18, 48, 124, 48,
|
||||
98, 252, 22, 231, 0, 0, 3, 62, 118, 54, 54, 22, 231, 127, 127, 17, 4, 80, 22, 230, 224, 224, 96, 22, 3, 22, 230, 24, 24, 24, 248, 248,
|
||||
21, 16, 22, 230, 204, 153, 51, 102, 22, 106, 51, 153, 204, 22, 107, 21, 27, 255, 255, 17, 4, 67, 22, 227, 3, 22, 13, 17, 6, 188, 22, 230,
|
||||
17, 2, 172, 22, 13, 31, 31, 22, 236, 255, 255, 22, 236, 31, 31, 17, 4, 136, 22, 227, 22, 1, 248, 248, 21, 5, 22, 233, 17, 14, 123, 17,
|
||||
3, 64, 22, 230, 17, 3, 64, 21, 248, 17, 8, 29, 21, 216, 17, 6, 88, 17, 3, 64, 22, 230, 240, 22, 13, 21, 233, 21, 243, 22, 230, 17,
|
||||
6, 16, 22, 226, 192, 192, 48, 48, 22, 106, 15, 22, 1, 21, 84, 22, 230, 17, 10, 4, 22, 226, 17, 10, 52, 22, 230, 17, 6, 16, 17, 10,
|
||||
44, 22, 6, 17, 35, 220, 0, 24, 22, 231, 102, 102, 17, 34, 107, 0, 22, 233, 255, 22, 33, 102, 22, 231, 24, 62, 96, 60, 6, 124, 21, 40,
|
||||
22, 229, 0, 102, 12, 24, 48, 102, 70, 22, 231, 60, 102, 60, 56, 103, 102, 63, 22, 231, 6, 12, 17, 36, 59, 22, 230, 21, 30, 48, 48, 24,
|
||||
12, 22, 231, 22, 97, 12, 21, 4, 22, 231, 0, 102, 60, 255, 60, 17, 2, 115, 22, 230, 24, 24, 126, 17, 35, 70, 22, 230, 17, 4, 173, 21,
|
||||
33, 22, 231, 126, 21, 205, 22, 231, 21, 80, 22, 232, 3, 6, 12, 24, 48, 96, 22, 231, 60, 102, 110, 118, 102, 102, 60, 22, 231, 24, 24, 56,
|
||||
24, 24, 24, 126, 22, 231, 60, 102, 6, 12, 48, 96, 22, 235, 28, 6, 21, 168, 22, 228, 6, 14, 30, 102, 127, 6, 6, 22, 231, 126, 96, 124,
|
||||
6, 21, 80, 22, 230, 60, 102, 96, 124, 17, 4, 88, 22, 228, 126, 102, 12, 17, 35, 83, 22, 230, 60, 21, 13, 21, 216, 22, 231, 62, 21, 240,
|
||||
22, 228, 17, 34, 124, 22, 66, 22, 236, 17, 2, 224, 22, 228, 14, 24, 48, 96, 48, 24, 14, 0, 22, 230, 17, 2, 239, 17, 4, 241, 22, 228,
|
||||
112, 24, 12, 6, 12, 24, 112, 22, 231, 17, 2, 192, 24, 21, 52, 22, 232, 110, 110, 96, 98, 17, 3, 248, 22, 227, 24, 60, 102, 126, 17, 34,
|
||||
228, 22, 230, 124, 102, 102, 22, 66, 22, 231, 60, 102, 96, 96, 96, 17, 4, 200, 22, 227, 120, 108, 21, 30, 108, 120, 22, 231, 126, 96, 96, 120,
|
||||
96, 96, 126, 22, 237, 96, 22, 231, 21, 48, 110, 17, 37, 8, 22, 227, 21, 46, 17, 3, 96, 22, 230, 60, 17, 99, 19, 21, 24, 22, 229, 30,
|
||||
12, 22, 1, 108, 56, 22, 231, 102, 108, 120, 112, 120, 108, 21, 40, 22, 229, 17, 132, 62, 126, 22, 231, 99, 119, 127, 107, 99, 99, 99, 22, 231,
|
||||
102, 118, 126, 126, 110, 17, 2, 88, 22, 229, 60, 102, 22, 2, 17, 35, 88, 22, 227, 17, 2, 205, 21, 49, 22, 231, 21, 144, 60, 14, 22, 231,
|
||||
21, 80, 17, 2, 96, 22, 230, 60, 102, 96, 60, 17, 37, 208, 22, 227, 17, 163, 13, 17, 34, 200, 22, 229, 21, 111, 17, 5, 208, 22, 232, 60,
|
||||
17, 5, 16, 22, 225, 99, 99, 99, 107, 127, 119, 99, 22, 231, 21, 77, 60, 17, 3, 248, 22, 230, 21, 1, 17, 4, 64, 22, 227, 126, 17, 67,
|
||||
159, 126, 22, 231, 60, 48, 22, 2, 60, 22, 231, 96, 48, 24, 12, 6, 3, 0, 22, 231, 60, 17, 34, 32, 12, 21, 24, 22, 229, 17, 34, 193,
|
||||
17, 68, 244, 22, 229, 22, 3, 17, 165, 133, 22, 225, 17, 134, 203, 22, 230, 21, 58, 6, 62, 102, 62, 22, 232, 96, 17, 66, 176, 124, 22, 232,
|
||||
0, 60, 96, 96, 96, 17, 66, 144, 22, 229, 6, 21, 31, 21, 96, 22, 230, 0, 60, 102, 126, 21, 216, 22, 228, 14, 24, 62, 17, 3, 84, 22,
|
||||
230, 0, 21, 95, 6, 124, 22, 231, 17, 3, 80, 102, 17, 5, 88, 22, 225, 24, 0, 56, 17, 34, 240, 22, 231, 6, 0, 6, 22, 1, 60, 22,
|
||||
231, 96, 96, 108, 17, 34, 128, 22, 231, 21, 30, 21, 160, 22, 230, 0, 102, 127, 127, 107, 99, 22, 233, 17, 2, 79, 21, 32, 22, 231, 17, 34,
|
||||
210, 17, 4, 152, 22, 228, 17, 36, 242, 22, 232, 17, 3, 144, 6, 22, 232, 124, 17, 66, 226, 21, 160, 22, 228, 17, 131, 225, 22, 232, 17, 130,
|
||||
127, 17, 98, 112, 22, 230, 17, 35, 226, 17, 34, 0, 22, 233, 60, 17, 2, 240, 22, 230, 99, 107, 127, 62, 17, 226, 24, 22, 230, 17, 35, 241,
|
||||
22, 234, 21, 47, 12, 120, 22, 232, 126, 12, 24, 48, 17, 98, 194, 22, 228, 28, 48, 24, 112, 24, 48, 28, 22, 231, 17, 164, 159, 22, 3, 22,
|
||||
227, 56, 12, 24, 14, 24, 12, 56, 0, 22, 230, 51, 255, 204, 17, 35, 206, 22, 230, 22, 14, 17, 194, 92, 22, 10, 17, 236, 246, 204, 204, 255,
|
||||
231, 195, 129, 231, 22, 1, 22, 231, 239, 207, 128, 128, 207, 239, 255, 22, 230, 243, 237, 207, 131, 207, 157, 3, 22, 231, 255, 255, 252, 193, 137, 201,
|
||||
201, 22, 231, 128, 128, 17, 4, 80, 22, 230, 31, 31, 159, 22, 3, 22, 230, 231, 231, 231, 7, 7, 21, 16, 22, 230, 17, 236, 246, 204, 17, 237,
|
||||
246, 51, 153, 17, 227, 11, 17, 4, 67, 22, 227, 252, 22, 13, 17, 6, 188, 22, 230, 17, 2, 172, 22, 13, 224, 224, 22, 236, 0, 0, 22, 236,
|
||||
224, 224, 17, 4, 136, 22, 227, 22, 1, 7, 7, 21, 5, 22, 233, 17, 14, 123, 17, 3, 64, 22, 230, 17, 3, 64, 21, 248, 17, 8, 29, 21,
|
||||
216, 17, 6, 88, 17, 3, 64, 22, 230, 17, 226, 124, 22, 10, 17, 238, 244, 22, 226, 17, 6, 16, 22, 226, 63, 63, 207, 207, 22, 106, 17, 226,
|
||||
192, 21, 84, 22, 230, 17, 10, 4, 17, 230, 220, 17, 14, 60, 17, 234, 252, 17, 6, 44, 22, 6, 17, 35, 220, 255, 231, 22, 231, 153, 153, 17,
|
||||
34, 107, 255, 22, 233, 0, 22, 33, 153, 22, 231, 231, 193, 159, 195, 249, 131, 21, 40, 22, 229, 255, 153, 243, 231, 207, 153, 185, 22, 231, 195, 153,
|
||||
195, 199, 152, 153, 192, 22, 231, 249, 243, 17, 36, 59, 22, 230, 21, 30, 207, 207, 231, 243, 22, 231, 22, 97, 243, 21, 4, 22, 231, 255, 153, 195,
|
||||
0, 195, 17, 2, 115, 22, 230, 231, 231, 129, 17, 35, 70, 22, 230, 17, 4, 173, 21, 33, 22, 231, 129, 21, 205, 22, 231, 21, 80, 22, 232, 252,
|
||||
249, 243, 231, 207, 159, 22, 231, 195, 153, 145, 137, 153, 153, 195, 22, 231, 231, 231, 199, 231, 231, 231, 129, 22, 231, 195, 153, 249, 243, 207, 159, 22,
|
||||
235, 227, 249, 21, 168, 22, 228, 249, 241, 225, 153, 128, 249, 249, 22, 231, 129, 159, 131, 249, 21, 80, 22, 230, 195, 153, 159, 131, 17, 4, 88, 22,
|
||||
228, 129, 153, 243, 17, 35, 83, 22, 230, 195, 21, 13, 21, 216, 22, 231, 193, 21, 240, 22, 228, 17, 34, 124, 22, 66, 22, 236, 17, 2, 224, 22,
|
||||
228, 241, 231, 207, 159, 207, 231, 241, 255, 22, 230, 17, 2, 239, 17, 4, 241, 22, 228, 143, 231, 243, 249, 243, 231, 143, 22, 231, 17, 2, 192, 231,
|
||||
21, 52, 22, 232, 145, 145, 159, 157, 17, 3, 248, 22, 227, 231, 195, 153, 129, 17, 34, 228, 22, 230, 131, 153, 153, 22, 66, 22, 231, 195, 153, 159,
|
||||
159, 159, 17, 4, 200, 22, 227, 135, 147, 21, 30, 147, 135, 22, 231, 129, 159, 159, 135, 159, 159, 129, 22, 237, 159, 22, 231, 21, 48, 145, 17, 37,
|
||||
8, 22, 227, 21, 46, 17, 3, 96, 22, 230, 195, 17, 99, 19, 21, 24, 22, 229, 225, 243, 22, 1, 147, 199, 22, 231, 153, 147, 135, 143, 135, 147,
|
||||
21, 40, 22, 229, 17, 132, 62, 129, 22, 231, 156, 136, 128, 148, 156, 156, 156, 22, 231, 153, 137, 129, 129, 145, 17, 2, 88, 22, 229, 195, 153, 22,
|
||||
2, 17, 35, 88, 22, 227, 17, 2, 205, 21, 49, 22, 231, 21, 144, 195, 241, 22, 231, 21, 80, 17, 2, 96, 22, 230, 195, 153, 159, 195, 17, 37,
|
||||
208, 22, 227, 17, 163, 13, 17, 34, 200, 22, 229, 21, 111, 17, 5, 208, 22, 232, 195, 17, 5, 16, 22, 225, 156, 156, 156, 148, 128, 136, 156, 22,
|
||||
231, 21, 77, 195, 17, 3, 248, 22, 230, 21, 1, 17, 4, 64, 22, 227, 129, 17, 67, 159, 129, 22, 231, 195, 207, 22, 2, 195, 22, 231, 159, 207,
|
||||
231, 243, 249, 252, 255, 22, 231, 195, 17, 34, 32, 243, 21, 24, 22, 229, 17, 34, 193, 17, 68, 244, 22, 229, 22, 3, 17, 165, 133, 22, 225, 17,
|
||||
134, 203, 22, 230, 21, 58, 249, 193, 153, 193, 22, 232, 159, 17, 66, 176, 131, 22, 232, 255, 195, 159, 159, 159, 17, 66, 144, 22, 229, 249, 21, 31,
|
||||
21, 96, 22, 230, 255, 195, 153, 129, 21, 216, 22, 228, 241, 231, 193, 17, 3, 84, 22, 230, 255, 21, 95, 249, 131, 22, 231, 17, 3, 80, 153, 17,
|
||||
5, 88, 22, 225, 231, 255, 199, 17, 34, 240, 22, 231, 249, 255, 249, 22, 1, 195, 22, 231, 159, 159, 147, 17, 34, 128, 22, 231, 21, 30, 21, 160,
|
||||
22, 230, 255, 153, 128, 128, 148, 156, 22, 233, 17, 2, 79, 21, 32, 22, 231, 17, 34, 210, 17, 4, 152, 22, 228, 17, 36, 242, 22, 232, 17, 3,
|
||||
144, 249, 22, 232, 131, 17, 66, 226, 21, 160, 22, 228, 17, 131, 225, 22, 232, 17, 130, 127, 17, 98, 112, 22, 230, 17, 35, 226, 17, 34, 0, 22,
|
||||
233, 195, 17, 2, 240, 22, 230, 156, 148, 128, 193, 17, 226, 24, 22, 230, 17, 35, 241, 22, 234, 21, 47, 243, 135, 22, 232, 129, 243, 231, 207, 17,
|
||||
98, 194, 22, 228, 227, 207, 231, 143, 231, 207, 227, 22, 231, 17, 164, 159, 22, 3, 22, 227, 199, 243, 231, 241, 231, 243, 199, 255, 22, 230, 204, 0,
|
||||
51, 17, 35, 206, 22, 230, 22, 14, 9, 19, 0, 13, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 31,
|
||||
22, 31, 22, 31, 22, 31, 22, 31, 22, 31, 22, 30, 22, 28
|
||||
];
|
||||
(0, mocha_1.describe)('LZG', function () {
|
||||
it('Should decode LZG', function () {
|
||||
var rom = new Uint8Array(new util_1.lzgmini().decode(NES_CONIO_ROM_LZG));
|
||||
assert_1.default.equal(40976, rom.length);
|
||||
});
|
||||
});
|
||||
(0, mocha_1.describe)('string functions', function () {
|
||||
it('Should detect binary', function () {
|
||||
assert_1.default.ok(!(0, util_1.isProbablyBinary)(null, [32, 32, 10, 13, 9, 32, 32, 10, 13]));
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)(null, [32, 32, 0x80]));
|
||||
assert_1.default.ok(!(0, util_1.isProbablyBinary)(null, [32, 32, 0xc1, 0x81, 32, 32, 10, 13]));
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)(null, NES_CONIO_ROM_LZG));
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)('test.bin'));
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)('test.chr'));
|
||||
assert_1.default.ok(!(0, util_1.isProbablyBinary)('test.txt'));
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)('test.dat'));
|
||||
assert_1.default.ok(!(0, util_1.isProbablyBinary)(null, [0x20, 0xa9, 0x20, 0x31, 0x39, 0x38, 0x32]));
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)(null, [0x00, 0x00])); // 00 is binary
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)(null, [0x9f])); // 9f is binary
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)(null, [0xff])); // FF is binary
|
||||
assert_1.default.ok((0, util_1.isProbablyBinary)(null, [0xf0, 0x12])); // ran out of data
|
||||
});
|
||||
});
|
||||
(0, mocha_1.describe)('EmuHalt', function () {
|
||||
it('Should detect emuhalt', function () {
|
||||
var e = new emu_1.EmuHalt("?");
|
||||
assert_1.default.ok(e instanceof emu_1.EmuHalt);
|
||||
assert_1.default.ok(e.hasOwnProperty('$loc'));
|
||||
});
|
||||
});
|
||||
(0, mocha_1.describe)('Tokenizer', function () {
|
||||
it('Should tokenize', function () {
|
||||
var t = new tokenizer_1.Tokenizer();
|
||||
t.setTokenRules([
|
||||
{ type: 'ident', regex: /[$A-Za-z_][A-Za-z0-9_-]*/ },
|
||||
{ type: 'delim', regex: /[\(\)\{\}\[\]]/ },
|
||||
{ type: 'qstring', regex: /".*?"/ },
|
||||
{ type: 'integer', regex: /[-]?\d+/ },
|
||||
{ type: 'eol', regex: /\n+/ },
|
||||
{ type: 'ignore', regex: /\s+/ },
|
||||
]);
|
||||
t.tokenizeFile("a\n{\"key\" value\n \"number\" 531\n\n \"f\" (fn [x] (+ x 2))}\n", "test.file");
|
||||
assert_1.default.strictEqual(t.tokens.map(t => t.type).join(' '), 'ident delim qstring ident qstring integer qstring delim ident delim ident delim delim catch-all ident integer delim delim delim eof');
|
||||
assert_1.default.strictEqual(t.tokens.map(t => t.str).join(' '), 'a { "key" value "number" 531 "f" ( fn [ x ] ( + x 2 ) ) } ');
|
||||
assert_1.default.strictEqual(t.tokens.filter(t => t.eol).map(t => t.str).join(' '), 'a value 531 } ');
|
||||
assert_1.default.strictEqual(t.tokens.map(t => t.$loc.line).join(' '), '1 2 2 2 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 6');
|
||||
assert_1.default.strictEqual(20, t.tokens.length);
|
||||
assert_1.default.strictEqual('a', t.peekToken().str);
|
||||
assert_1.default.strictEqual('a', t.expectToken('a').str);
|
||||
t.expectTokens(['foo', '{']);
|
||||
t.pushbackToken(t.consumeToken());
|
||||
assert_1.default.strictEqual('"key"', t.consumeToken().str);
|
||||
assert_1.default.deepStrictEqual({ 'value': true }, t.parseModifiers(['foo', 'value', 'bar']));
|
||||
assert_1.default.deepStrictEqual([], t.errors);
|
||||
t = new tokenizer_1.Tokenizer();
|
||||
t.setTokenRules([
|
||||
{ type: 'ident', regex: /[$A-Za-z_][A-Za-z0-9_-]*/ },
|
||||
{ type: 'delim', regex: /[\(\)\{\}\[\]]/ },
|
||||
{ type: 'code-fragment', regex: /---[^-]*---/ },
|
||||
{ type: 'ignore', regex: /\s+/ },
|
||||
]);
|
||||
t.tokenizeFile("key value ---\nthis is\na fragment\n--- foo", "test.file");
|
||||
assert_1.default.strictEqual(t.tokens.map(t => t.type).join(' '), 'ident ident code-fragment ident eof');
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=testutil.js.map
|
1
gen/test/testutil.js.map
Normal file
1
gen/test/testutil.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u}from"./chunk-M2YCTORM.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-7IBR52CF.js";import"./chunk-2T5IQXGX.js";import"./chunk-JM5NHRL4.js";import"./chunk-VOKPYVET.js";import"./chunk-5XVCUSSZ.js";export{h as compparams,f as current_project,s as emulationHalted,n as getPlatformAndRepo,r as getSaveState,q as getTestOutput,l as haltEmulation,u as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,t as reloadWorkspaceFile,d as repo_id,j as runToPC,k as setFrameRateUI,p as setTestInput,m as setupSplits,o as startUI,c as store_id};
|
||||
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u}from"./chunk-C6UFFJRO.js";import"./chunk-M72QJ5SI.js";import"./chunk-5SHCNQ2O.js";import"./chunk-U54L2MMB.js";import"./chunk-SFNCS4L7.js";import"./chunk-5B4VPQ4V.js";import"./chunk-ZDSSTLWD.js";import"./chunk-5XVCUSSZ.js";export{h as compparams,f as current_project,s as emulationHalted,n as getPlatformAndRepo,r as getSaveState,q as getTestOutput,l as haltEmulation,u as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,t as reloadWorkspaceFile,d as repo_id,j as runToPC,k as setFrameRateUI,p as setTestInput,m as setupSplits,o as startUI,c as store_id};
|
||||
//# sourceMappingURL=ui.js.map
|
||||
|
File diff suppressed because one or more lines are too long
7
gen/vcs-ICYYLR5A.js.map
Normal file
7
gen/vcs-ICYYLR5A.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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