mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-16 05:05:11 +00:00
Deploying to gh-pages from @ sehugg/8bitworkshop@cc385b7d98 🚀
This commit is contained in:
parent
571229f936
commit
3fc981dfb0
7
gen/atari7800-RD53CT3A.js
Normal file
7
gen/atari7800-RD53CT3A.js
Normal file
@ -0,0 +1,7 @@
|
||||
import{I as $,h as H,k as z,p as K,t as Y}from"./chunk-SWGVMGGE.js";import{$ as T,J as _,U as L,V as c,W as E,Y as N,_ as W,da as F,g as p}from"./chunk-G5LGIVML.js";import"./chunk-5XVCUSSZ.js";var g=0,B=2,P=8,Q=N([[c.A,P+0,128],[c.B,P+1,128],[c.SELECT,B,-2],[c.START,B,-1],[c.UP,g,-16],[c.DOWN,g,-32],[c.LEFT,g,-64],[c.RIGHT,g,-128],[c.P2_A,P+2,128],[c.P2_B,P+3,128],[c.P2_UP,g,-1],[c.P2_DOWN,g,-2],[c.P2_LEFT,g,-4],[c.P2_RIGHT,g,-8]]);var D=263,j=258-16,C=451,Z=28,tt=16,et=24,V=2,G=D*60*V,R=class{constructor(){this.regs=new Uint8Array(32)}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e}saveState(){return{regs:this.regs.slice(0)}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e])}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e}},O=class{constructor(){this.cycles=0;this.regs=new Uint8Array(32);this.offset=-1;this.dll=0;this.dlstart=0;this.dli=!1;this.h16=!1;this.h8=!1;this.writemode=0;this.indirect=!1;this.pixels=new Uint8Array(320);this.WSYNC=0}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e,t==4&&this.WSYNC++}saveState(){return{regs:this.regs.slice(0),offset:this.offset,dll:this.dll,dlstart:this.dlstart,dli:this.dli,h16:this.h16,h8:this.h8,indirect:this.indirect,writemode:this.writemode}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e]|0);this.offset=t.offset|0,this.dll=t.dll|0,this.dlstart=t.dlstart|0,this.dli=!!t.dli,this.h16=!!t.h16,this.h8=!!t.h8,this.indirect=!!t.indirect,this.writemode=t.writemode|0}isDMAEnabled(){return(this.regs[28]&96)==64}getDLLStart(){return(this.regs[12]<<8)+this.regs[16]}getCharBaseAddress(){return(this.regs[20]<<8)+this.offset}setVBLANK(t){t?(this.regs[8]|=128,this.offset=-1,this.dll=this.getDLLStart(),this.dli=this.bus&&(this.bus.read(this.dll)&128)!=0):this.regs[8]&=~128}readDLLEntry(t){if(this.dll>=16384)return;let e=t.read(this.dll);this.offset=e&15,this.h16=(e&64)!=0,this.h8=(e&32)!=0,this.dlstart=(t.read(this.dll+1)<<8)+t.read(this.dll+2),this.dll=this.dll+3&65535,this.dli=(t.read(this.dll)&128)!=0}isHoley(t){return this.indirect?!1:!!(t&32768&&(this.h16&&t&4096||this.h8&&t&2048))}readDMA(t){return this.isHoley(t)?0:(this.cycles+=3,this.bus.read(t))}doDMA(t){this.bus=t,this.cycles=0;let e=this.pixels;if(e.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=this.offset==0?et:tt,this.offset<0&&this.readDLLEntry(t);let o=this.dlstart&65280,a=this.dlstart&255;do{let u=t.read(o+(a+0&511)),s=t.read(o+(a+1&511));if(s==0||o>=16384)break;let y=t.read(o+(a+2&511)),b=t.read(o+(a+3&511)),d=!1;if((s&31)==0){var i=b>>5,f=32-(b&31),r=t.read(o+(a+4&511));d=(s&32)!=0,a+=5,this.cycles+=10,this.writemode=s&128}else{var r=b,i=s>>5,f=32-(s&31);a+=4,this.cycles+=8}this.indirect=d;let m=u+((y+(d?0:this.offset)&255)<<8);r*=2;let S=this.regs[28],M=(S&3)+(this.writemode?4:0),A=(S&4)!=0,I=d&&(S&16)!=0;I&&(f*=2);for(var x=0;x<f;x++){let h=this.readDMA(I?m+(x>>1):m+x);if(d){let v=(this.regs[20]+this.offset<<8)+h;I&&x&1&&(v++,this.cycles-=3),h=this.readDMA(v)}switch(M){case 0:for(let n=0;n<4;n++){let l=h>>6&3;(l||A)&&(e[r]=e[r+1]=this.regs[(i<<2)+l]),h<<=2,r=r+2&511}break;case 3:for(let n=0;n<8;n++){let l=(h&128)>>6;(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 4:for(let n=0;n<2;n++){let l=(h>>6&3)+(h&12);(l&3||A)&&(e[r]=e[r+1]=e[r+2]=e[r+3]=this.regs[((i&4)<<2)+l]),h<<=2,r=r+2&511}break;case 6:for(let n=0;n<4;n++){let l=(h&128)>>6|(h&8)>>3;(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 2:for(let n=0;n<8;n++){let l=(h&128)>>6;l+=n&1?i&1:i>>1&1,(l||A)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 7:let v=h;for(let n=0;n<4;n++){n==2&&(v<<=2);let l=(h&128)>>6,J=i&4|v>>2&3;(l||A)&&(e[r]=this.regs[(J<<2)+l]),h<<=1,r=r+1&511}break}}}while(this.cycles<C);this.offset-=1}return this.cycles}doInterrupt(){return this.dli&&this.offset<0?(this.dli=!1,!0):!1}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e+=`
|
||||
DLL: $`+p((t.regs[12]<<8)+t.regs[16],4)+" @ $"+p(t.dll,4),e+=`
|
||||
DL: $`+p(t.dlstart,4),e+=`
|
||||
Offset: `+t.offset,e+=`
|
||||
DLI? `+t.dli,e}},U=class extends K{constructor(){super();this.cpuFrequency=1789772;this.canvasWidth=320;this.numTotalScanlines=D;this.numVisibleScanlines=j;this.defaultROMSize=49152;this.cpuCyclesPerLine=113.5;this.sampleRate=G;this.ram=new Uint8Array(4096);this.regs6532=new Uint8Array(4);this.piatimer=0;this.timerinterval=1;this.tia=new R;this.maria=new O;this.lastFrameCycles=0;this.xtracyc=0;this.cpu=new Y,this.read=T([[8,13,15,t=>(this.xtracyc++,this.readInput(t))],[0,31,31,t=>(this.xtracyc++,this.tia.read(t))],[32,63,31,t=>this.maria.read(t)],[64,255,255,t=>this.ram[t+2048]],[256,319,255,t=>this.read(t)],[320,511,511,t=>this.ram[t+2048]],[640,767,127,t=>(this.xtracyc++,this.readPIA(t))],[6144,10239,65535,t=>this.ram[t-6144]],[10240,16383,2047,t=>this.read(t|8192)],[16384,65535,65535,t=>this.rom?this.rom[t-16384]:0],[0,65535,65535,t=>this.probe&&this.probe.logIllegal(t)]]),this.write=T([[21,26,31,(t,e)=>{this.xtracyc++,this.pokey1.setTIARegister(t,e)}],[0,31,31,(t,e)=>{this.xtracyc++,this.tia.write(t,e)}],[32,63,31,(t,e)=>{this.maria.write(t,e)}],[64,255,255,(t,e)=>{this.ram[t+2048]=e}],[256,319,255,(t,e)=>{this.write(t,e)}],[320,511,511,(t,e)=>{this.ram[t+2048]=e}],[640,767,127,(t,e)=>{this.xtracyc++,this.writePIA(t,e)}],[6144,10239,65535,(t,e)=>{this.ram[t-6144]=e}],[10240,16383,2047,(t,e)=>{this.write(t|8192,e)}],[49151,49151,65535,(t,e)=>{}],[0,65535,65535,(t,e)=>{this.probe&&this.probe.logIllegal(t)}]]),this.connectCPUMemoryBus(this),this.dmaBus=this.probeDMABus(this),this.handler=E(this.inputs,Q),this.pokey1=new H,this.audioadapter=new z(this.pokey1,V,G)}readConst(t){let e=this.probe;this.probe=null;let i=this.read(t);return this.probe=e,i}readInput(t){switch(t){case 12:return~this.inputs[8]&128;case 13:return~this.inputs[9]&128;default:return this.inputs[t]|0}}readPIA(t){switch(t){case 0:case 2:return this.inputs[t];case 1:case 3:return this.regs6532[t];case 4:return this.getPIATimerValue();default:return 0}}writePIA(t,e){switch(t){case 0:case 1:case 2:case 3:this.regs6532[t]=e;return;case 20:this.setPIATimer(e,0);return;case 21:this.setPIATimer(e,3);return;case 22:this.setPIATimer(e,6);return;case 23:this.setPIATimer(e,10);return;case 24:this.setPIATimer(e,6);return}}setPIATimer(t,e){this.piatimer=t+1<<e,this.timerinterval=e}getPIATimerValue(){let t=this.piatimer;return t>0?t>>this.timerinterval:t&255}advanceCPU(){var t=super.advanceCPU();return this.tickPIATimer(t),this.xtracyc&&(t+=this.xtracyc,this.tickClocks(this.xtracyc),this.xtracyc=0),t}tickClocks(t){this.probe.logClocks(t),this.tickPIATimer(t)}tickPIATimer(t){this.piatimer=Math.max(-256,this.piatimer-t)}advanceFrame(t){var e=this.pixels,i=0,f,r=0,x=0,o=0;this.probe.logNewFrame();for(var a=0;a<D;a++){this.scanline=a;var u=a<j;for(this.maria.setVBLANK(!u),this.maria.WSYNC=0;r<Z&&!this.maria.WSYNC;){if(t&&t()){t=null,a=999;break}r+=this.advanceCPU()<<2,o++}if(u){let y=this.maria.doDMA(this.dmaBus);if(this.tickClocks(y>>2),r+=y,e){let m=(this.maria.regs[28]&128)!=0?15:255;for(var s=0;s<320;s++)e[i++]=X[this.maria.pixels[s]&m]}}for((u||a==D-1)&&this.maria.doInterrupt()&&(this.probe.logInterrupt(0),this.cpu.NMI());r<C;){if(this.maria.WSYNC){this.probe.logWait(0),this.tickClocks(C-r>>2),r=C;break}if(t&&t()){t=null,a=999;break}r+=this.advanceCPU()<<2,o++}this.audio&&this.audioadapter.generate(this.audio),r-=C,x+=r,this.probe.logNewScanline()}return this.lastFrameCycles=x,o}getRasterX(){return this.lastFrameCycles%C}getRasterY(){return this.scanline}loadROM(t){t.length==49280&&(t=t.slice(128)),this.rom=W(t,this.defaultROMSize,!0)}reset(){super.reset(),this.tia.reset(),this.maria.reset(),this.inputs.fill(0),this.inputs[g]=255,this.inputs[B]=1+2+8,this.setPIATimer(0,0)}readAddress(t){return this.read(t)|0}loadState(t){this.cpu.loadState(t.c),this.ram.set(t.ram),this.tia.loadState(t.tia),this.maria.loadState(t.maria),this.regs6532.set(t.regs6532),this.piatimer=t.pia.timer,this.timerinterval=t.pia.interval,this.loadControlsState(t)}saveState(){return{c:this.cpu.saveState(),ram:this.ram.slice(0),tia:this.tia.saveState(),maria:this.maria.saveState(),regs6532:this.regs6532.slice(0),inputs:this.inputs.slice(0),pia:{timer:this.piatimer,interval:this.timerinterval}}}loadControlsState(t){this.inputs.set(t.inputs)}saveControlsState(){return{inputs:this.inputs.slice(0)}}getDebugCategories(){return["CPU","Stack","TIA","MARIA"]}getDebugInfo(t,e){switch(t){case"TIA":return R.stateToLongString(e.tia);case"MARIA":return O.stateToLongString(e.maria)+`
|
||||
Scanline: `+this.scanline}}getDebugDisplayLists(){let t={},e=this.maria.getDLLStart(),i=0;for(;i<240;){let f=this.readConst(e),r=f&15,x=(f&64)!=0,o=(f&32)!=0,a=(this.readConst(e+1)<<8)+this.readConst(e+2);e=e+3&65535;let u=(this.readConst(e)&128)!=0,s="DL $"+p(a,4)+" "+i+"-"+(i+r);x&&(s+=" H16"),o&&(s+=" H8"),u&&(s+=" DLI"),t[s]={$$:this._readDebugDisplayList(a)},i+=r+1}return t}_readDebugDisplayList(t){return()=>this.readDebugDisplayList(t)}readDebugDisplayList(t){let e=[],i=t&65280,f=t&255;do{let a=this.maria.regs[28],u=this.readConst(i+(f+0&511)),s=this.readConst(i+(f+1&511));if(s==0)break;let y=this.readConst(i+(f+2&511)),b=this.readConst(i+(f+3&511)),d=!1,m="",S,M=(a&3)+(s&128?4:0);if((s&31)==0){var r=b>>5,x=32-(b&31),o=this.readConst(i+(f+4&511));d=(s&32)!=0,S=s&128,f+=5}else{var o=b,r=s>>5,x=32-(s&31);f+=4}m+="X="+o+" W="+x+" P="+r,S&&(m+=" WM=1"),d&&(m+=" CHR=$"+p(this.maria.regs[20]+this.maria.offset&255)+"xx");let A=u+((y+(d?0:this.maria.offset)&255)<<8);m=" $"+p(A,4)+" "+m,m=["160A","?","320D","320A","160B","?","320B","320C"][M]+" "+m,e.push(m)}while(f<512);return e}},X=new Uint32Array(256);for(w=0;w<256;w++)X[w]=F(w);var w;var rt=[{id:"sprites.dasm",name:"Sprites (ASM)"},{id:"wsync.c",name:"WSYNC"},{id:"sprites.c",name:"Double Buffering"},{id:"scroll.c",name:"Scrolling"}],q=class extends ${constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"TIA",start:0,size:32,type:"io"},{name:"MARIA",start:32,size:32,type:"io"},{name:"RAM (6166 Block 0)",start:64,size:192,type:"ram"},{name:"RAM (6166 Block 1)",start:320,size:192,type:"ram"},{name:"PIA",start:640,size:24,type:"io"},{name:"RAM",start:6144,size:4096,type:"ram"},{name:"Cartridge ROM",start:16384,size:49152,type:"rom"}]}}}newMachine(){return new U}getPresets(){return rt}getDefaultExtension(){return".c"}readAddress(t){return this.machine.readConst(t)}getROMExtension(){return".a78"}getDebugTree(){let t=super.getDebugTree();return t.display_list=this.machine.getDebugDisplayLists(),t}};_.atari7800=q;
|
||||
//# sourceMappingURL=atari7800-RD53CT3A.js.map
|
7
gen/atari7800-RD53CT3A.js.map
Normal file
7
gen/atari7800-RD53CT3A.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +0,0 @@
|
||||
import{I as $,h as H,k as z,p as K,t as Y}from"./chunk-SWGVMGGE.js";import{$ as T,J as _,U as L,V as c,W as E,Y as N,_ as F,da as W,g as A}from"./chunk-G5LGIVML.js";import"./chunk-5XVCUSSZ.js";var g=0,B=2,D=8,Z=N([[c.A,D+0,128],[c.B,D+1,128],[c.SELECT,B,-2],[c.START,B,-1],[c.UP,g,-16],[c.DOWN,g,-32],[c.LEFT,g,-64],[c.RIGHT,g,-128],[c.P2_A,D+2,128],[c.P2_B,D+3,128],[c.P2_UP,g,-1],[c.P2_DOWN,g,-2],[c.P2_LEFT,g,-4],[c.P2_RIGHT,g,-8]]);var k=263,j=258-16,S=451,tt=28,et=16,rt=24,V=2,G=k*60*V,R=class{constructor(){this.regs=new Uint8Array(32)}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e}saveState(){return{regs:this.regs.slice(0)}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e])}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e}},O=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.indirect=!1;this.pixels=new Uint8Array(320);this.WSYNC=0}reset(){this.regs.fill(0)}read(t){return this.regs[t]|0}write(t,e){this.regs[t]=e,t==4&&this.WSYNC++}saveState(){return{regs:this.regs.slice(0),offset:this.offset,dll:this.dll,dlstart:this.dlstart,dli:this.dli,h16:this.h16,h8:this.h8,indirect:this.indirect}}loadState(t){for(let e=0;e<32;e++)this.write(e,t.regs[e]|0);this.offset=t.offset|0,this.dll=t.dll|0,this.dlstart=t.dlstart|0,this.dli=!!t.dli,this.h16=!!t.h16,this.h8=!!t.h8,this.indirect=!!t.indirect}isDMAEnabled(){return(this.regs[28]&96)==64}getDLLStart(){return(this.regs[12]<<8)+this.regs[16]}getCharBaseAddress(){return(this.regs[20]<<8)+this.offset}setVBLANK(t){t?(this.regs[8]|=128,this.offset=-1,this.dll=this.getDLLStart(),this.dli=this.bus&&(this.bus.read(this.dll)&128)!=0):this.regs[8]&=~128}readDLLEntry(t){if(this.dll>=16384)return;let e=t.read(this.dll);this.offset=e&15,this.h16=(e&64)!=0,this.h8=(e&32)!=0,this.dlstart=(t.read(this.dll+1)<<8)+t.read(this.dll+2),this.dll=this.dll+3&65535,this.dli=(t.read(this.dll)&128)!=0}isHoley(t){return this.indirect?!1:!!(t&32768&&(this.h16&&t&4096||this.h8&&t&2048))}readDMA(t){return this.isHoley(t)?0:(this.cycles+=3,this.bus.read(t))}doDMA(t){this.bus=t,this.cycles=0;let e=this.pixels;if(e.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=this.offset==0?rt:et,this.offset<0&&this.readDLLEntry(t);let o=this.dlstart&65280,a=this.dlstart&255;do{let d=t.read(o+(a+0&511)),s=t.read(o+(a+1&511));if(s==0||o>=16384)break;let p=t.read(o+(a+2&511)),b=t.read(o+(a+3&511)),u=!1,m=s&128;if((s&31)==0){var i=b>>5,f=32-(b&31),r=t.read(o+(a+4&511));u=(s&32)!=0,a+=5,this.cycles+=10}else{var r=b,i=s>>5,f=32-(s&31);a+=4,this.cycles+=8}this.indirect=u;let w=d+((p+(u?0:this.offset)&255)<<8);r*=2;let C=this.regs[28],J=(C&3)+(m?4:0),y=(C&4)!=0,M=u&&(C&16)!=0;M&&(f*=2);for(var x=0;x<f;x++){let h=this.readDMA(M?w+(x>>1):w+x);if(u){let v=(this.regs[20]+this.offset<<8)+h;M&&x&1&&(v++,this.cycles-=3),h=this.readDMA(v)}switch(J){case 0:for(let n=0;n<4;n++){let l=h>>6&3;(l||y)&&(e[r]=e[r+1]=this.regs[(i<<2)+l]),h<<=2,r=r+2&511}break;case 3:for(let n=0;n<8;n++){let l=(h&128)>>6;(l||y)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 4:for(let n=0;n<2;n++){let l=(h>>6&3)+(h&12);(l&3||y)&&(e[r]=e[r+1]=e[r+2]=e[r+3]=this.regs[((i&4)<<2)+l]),h<<=2,r=r+2&511}break;case 6:for(let n=0;n<4;n++){let l=(h&128)>>6|(h&8)>>3;(l||y)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 2:for(let n=0;n<8;n++){let l=(h&128)>>6;l+=n&1?i&1:i>>1&1,(l||y)&&(e[r]=this.regs[(i<<2)+l]),h<<=1,r=r+1&511}break;case 7:let v=h;for(let n=0;n<4;n++){n==2&&(v<<=2);let l=(h&128)>>6,Q=i&4|v>>2&3;(l||y)&&(e[r]=this.regs[(Q<<2)+l]),h<<=1,r=r+1&511}break}}}while(this.cycles<S);this.offset-=1}return this.cycles}doInterrupt(){return this.dli&&this.offset<0?(this.dli=!1,!0):!1}static stateToLongString(t){let e="";return e+=L(t.regs,0,32),e+=`
|
||||
DLL: $`+A((t.regs[12]<<8)+t.regs[16],4)+" @ $"+A(t.dll,4),e+=`
|
||||
DL: $`+A(t.dlstart,4),e+=`
|
||||
Offset: `+t.offset,e+=`
|
||||
DLI? `+t.dli,e}},U=class extends K{constructor(){super();this.cpuFrequency=1789772;this.canvasWidth=320;this.numTotalScanlines=k;this.numVisibleScanlines=j;this.defaultROMSize=49152;this.cpuCyclesPerLine=113.5;this.sampleRate=G;this.ram=new Uint8Array(4096);this.regs6532=new Uint8Array(4);this.piatimer=0;this.timerinterval=1;this.tia=new R;this.maria=new O;this.lastFrameCycles=0;this.xtracyc=0;this.cpu=new Y,this.read=T([[8,13,15,t=>(this.xtracyc++,this.readInput(t))],[0,31,31,t=>(this.xtracyc++,this.tia.read(t))],[32,63,31,t=>this.maria.read(t)],[64,255,255,t=>this.ram[t+2048]],[256,319,255,t=>this.read(t)],[320,511,511,t=>this.ram[t+2048]],[640,767,127,t=>(this.xtracyc++,this.readPIA(t))],[6144,10239,65535,t=>this.ram[t-6144]],[10240,16383,2047,t=>this.read(t|8192)],[16384,65535,65535,t=>this.rom?this.rom[t-16384]:0],[0,65535,65535,t=>this.probe&&this.probe.logIllegal(t)]]),this.write=T([[21,26,31,(t,e)=>{this.xtracyc++,this.pokey1.setTIARegister(t,e)}],[0,31,31,(t,e)=>{this.xtracyc++,this.tia.write(t,e)}],[32,63,31,(t,e)=>{this.maria.write(t,e)}],[64,255,255,(t,e)=>{this.ram[t+2048]=e}],[256,319,255,(t,e)=>{this.write(t,e)}],[320,511,511,(t,e)=>{this.ram[t+2048]=e}],[640,767,127,(t,e)=>{this.xtracyc++,this.writePIA(t,e)}],[6144,10239,65535,(t,e)=>{this.ram[t-6144]=e}],[10240,16383,2047,(t,e)=>{this.write(t|8192,e)}],[49151,49151,65535,(t,e)=>{}],[0,65535,65535,(t,e)=>{this.probe&&this.probe.logIllegal(t)}]]),this.connectCPUMemoryBus(this),this.dmaBus=this.probeDMABus(this),this.handler=E(this.inputs,Z),this.pokey1=new H,this.audioadapter=new z(this.pokey1,V,G)}readConst(t){let e=this.probe;this.probe=null;let i=this.read(t);return this.probe=e,i}readInput(t){switch(t){case 12:return~this.inputs[8]&128;case 13:return~this.inputs[9]&128;default:return this.inputs[t]|0}}readPIA(t){switch(t){case 0:case 2:return this.inputs[t];case 1:case 3:return this.regs6532[t];case 4:return this.getPIATimerValue();default:return 0}}writePIA(t,e){switch(t){case 0:case 1:case 2:case 3:this.regs6532[t]=e;return;case 20:this.setPIATimer(e,0);return;case 21:this.setPIATimer(e,3);return;case 22:this.setPIATimer(e,6);return;case 23:this.setPIATimer(e,10);return;case 24:this.setPIATimer(e,6);return}}setPIATimer(t,e){this.piatimer=t+1<<e,this.timerinterval=e}getPIATimerValue(){let t=this.piatimer;return t>0?t>>this.timerinterval:t&255}advanceCPU(){var t=super.advanceCPU();return this.tickPIATimer(t),this.xtracyc&&(t+=this.xtracyc,this.tickClocks(this.xtracyc),this.xtracyc=0),t}tickClocks(t){this.probe.logClocks(t),this.tickPIATimer(t)}tickPIATimer(t){this.piatimer=Math.max(-256,this.piatimer-t)}advanceFrame(t){var e=this.pixels,i=0,f,r=0,x=0,o=0;this.probe.logNewFrame();for(var a=0;a<k;a++){this.scanline=a;var d=a<j;for(this.maria.setVBLANK(!d),this.maria.WSYNC=0;r<tt&&!this.maria.WSYNC;){if(t&&t()){t=null,a=999;break}r+=this.advanceCPU()<<2,o++}if(d){let p=this.maria.doDMA(this.dmaBus);if(this.tickClocks(p>>2),r+=p,e){let m=(this.maria.regs[28]&128)!=0?15:255;for(var s=0;s<320;s++)e[i++]=X[this.maria.pixels[s]&m]}}for((d||a==k-1)&&this.maria.doInterrupt()&&(this.probe.logInterrupt(0),this.cpu.NMI());r<S;){if(this.maria.WSYNC){this.probe.logWait(0),this.tickClocks(S-r>>2),r=S;break}if(t&&t()){t=null,a=999;break}r+=this.advanceCPU()<<2,o++}this.audio&&this.audioadapter.generate(this.audio),r-=S,x+=r,this.probe.logNewScanline()}return this.lastFrameCycles=x,o}getRasterX(){return this.lastFrameCycles%S}getRasterY(){return this.scanline}loadROM(t){t.length==49280&&(t=t.slice(128)),this.rom=F(t,this.defaultROMSize,!0)}reset(){super.reset(),this.tia.reset(),this.maria.reset(),this.inputs.fill(0),this.inputs[g]=255,this.inputs[B]=1+2+8,this.setPIATimer(0,0)}readAddress(t){return this.read(t)|0}loadState(t){this.cpu.loadState(t.c),this.ram.set(t.ram),this.tia.loadState(t.tia),this.maria.loadState(t.maria),this.regs6532.set(t.regs6532),this.piatimer=t.pia.timer,this.timerinterval=t.pia.interval,this.loadControlsState(t)}saveState(){return{c:this.cpu.saveState(),ram:this.ram.slice(0),tia:this.tia.saveState(),maria:this.maria.saveState(),regs6532:this.regs6532.slice(0),inputs:this.inputs.slice(0),pia:{timer:this.piatimer,interval:this.timerinterval}}}loadControlsState(t){this.inputs.set(t.inputs)}saveControlsState(){return{inputs:this.inputs.slice(0)}}getDebugCategories(){return["CPU","Stack","TIA","MARIA"]}getDebugInfo(t,e){switch(t){case"TIA":return R.stateToLongString(e.tia);case"MARIA":return O.stateToLongString(e.maria)+`
|
||||
Scanline: `+this.scanline}}getDebugDisplayLists(){let t={},e=this.maria.getDLLStart(),i=0;for(;i<240;){let f=this.readConst(e),r=f&15,x=(f&64)!=0,o=(f&32)!=0,a=(this.readConst(e+1)<<8)+this.readConst(e+2);e=e+3&65535;let d=(this.readConst(e)&128)!=0,s="DL $"+A(a,4)+" "+i+"-"+(i+r);x&&(s+=" H16"),o&&(s+=" H8"),d&&(s+=" DLI"),t[s]={$$:this._readDebugDisplayList(a)},i+=r+1}return t}_readDebugDisplayList(t){return()=>this.readDebugDisplayList(t)}readDebugDisplayList(t){let e=[],i=t&65280,f=t&255;do{let a=this.maria.regs[28],d=this.readConst(i+(f+0&511)),s=this.readConst(i+(f+1&511));if(s==0)break;let p=this.readConst(i+(f+2&511)),b=this.readConst(i+(f+3&511)),u=!1,m="",w=(a&3)+(s&128?4:0);if((s&31)==0){var r=b>>5,x=32-(b&31),o=this.readConst(i+(f+4&511));u=(s&32)!=0,f+=5}else{var o=b,r=s>>5,x=32-(s&31);f+=4}m+="X="+o+" W="+x+" P="+r,u&&(m+=" CHR=$"+A(this.maria.regs[20]+this.maria.offset&255)+"xx");let C=d+((p+(u?0:this.maria.offset)&255)<<8);m=" $"+A(C,4)+" "+m,m=["160A","?","320D","320A","160B","?","320B","320C"][w]+" "+m,e.push(m)}while(f<512);return e}},X=new Uint32Array(256);for(P=0;P<256;P++)X[P]=W(P);var P;var it=[{id:"sprites.dasm",name:"Sprites (ASM)"},{id:"wsync.c",name:"WSYNC"},{id:"sprites.c",name:"Double Buffering"},{id:"scroll.c",name:"Scrolling"}],q=class extends ${constructor(){super(...arguments);this.getMemoryMap=function(){return{main:[{name:"TIA",start:0,size:32,type:"io"},{name:"MARIA",start:32,size:32,type:"io"},{name:"RAM (6166 Block 0)",start:64,size:192,type:"ram"},{name:"RAM (6166 Block 1)",start:320,size:192,type:"ram"},{name:"PIA",start:640,size:24,type:"io"},{name:"RAM",start:6144,size:4096,type:"ram"},{name:"Cartridge ROM",start:16384,size:49152,type:"rom"}]}}}newMachine(){return new U}getPresets(){return it}getDefaultExtension(){return".c"}readAddress(t){return this.machine.readConst(t)}getROMExtension(){return".a78"}getDebugTree(){let t=super.getDebugTree();return t.display_list=this.machine.getDebugDisplayLists(),t}};_.atari7800=q;
|
||||
//# sourceMappingURL=atari7800-TFPNEVKI.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-FYI4X4B2.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-5HIMDMXR.js";import{I as m,o as u,t as h}from"./chunk-SWGVMGGE.js";import{$ as i,B as o,J as l,m as n}from"./chunk-G5LGIVML.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-SEIZCV25.js.map
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-J4MP5ZI2.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-NNHZRAOX.js";import{I as m,o as u,t as h}from"./chunk-SWGVMGGE.js";import{$ as i,B as o,J as l,m as n}from"./chunk-G5LGIVML.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-Z2QJYM35.js.map
|
@ -1,2 +1,2 @@
|
||||
import{b as w,c as x}from"./chunk-5HIMDMXR.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-G5LGIVML.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{b as w,c as x}from"./chunk-NNHZRAOX.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-G5LGIVML.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
|
||||
|
@ -79,6 +79,7 @@ class MARIA {
|
||||
this.dli = false;
|
||||
this.h16 = false;
|
||||
this.h8 = false;
|
||||
this.writemode = 0;
|
||||
this.indirect = false;
|
||||
this.pixels = new Uint8Array(320);
|
||||
this.WSYNC = 0;
|
||||
@ -106,6 +107,7 @@ class MARIA {
|
||||
h16: this.h16,
|
||||
h8: this.h8,
|
||||
indirect: this.indirect,
|
||||
writemode: this.writemode,
|
||||
};
|
||||
}
|
||||
loadState(s) {
|
||||
@ -118,6 +120,7 @@ class MARIA {
|
||||
this.h16 = !!s.h16;
|
||||
this.h8 = !!s.h8;
|
||||
this.indirect = !!s.indirect;
|
||||
this.writemode = s.writemode | 0;
|
||||
}
|
||||
isDMAEnabled() {
|
||||
return (this.regs[0x1c] & 0x60) == 0x40;
|
||||
@ -201,7 +204,6 @@ class MARIA {
|
||||
let b2 = bus.read(dlhi + ((dlofs + 2) & 0x1ff));
|
||||
let b3 = bus.read(dlhi + ((dlofs + 3) & 0x1ff));
|
||||
let indirect = false;
|
||||
const writemode = b1 & 0x80;
|
||||
// extended header?
|
||||
if ((b1 & 31) == 0) {
|
||||
var pal = b3 >> 5;
|
||||
@ -210,6 +212,7 @@ class MARIA {
|
||||
indirect = (b1 & 0x20) != 0;
|
||||
dlofs += 5;
|
||||
this.cycles += 10;
|
||||
this.writemode = b1 & 0x80;
|
||||
}
|
||||
else {
|
||||
// direct mode
|
||||
@ -224,7 +227,7 @@ class MARIA {
|
||||
xpos *= 2;
|
||||
const ctrlreg = this.regs[0x1c];
|
||||
// gfx mode (readmode + writemode * 4)
|
||||
const grmode = (ctrlreg & 0x3) + (writemode ? 4 : 0);
|
||||
const grmode = (ctrlreg & 0x3) + (this.writemode ? 4 : 0);
|
||||
// kangaroo mode
|
||||
const kangaroo = (ctrlreg & 0x4) != 0;
|
||||
// double bytes?
|
||||
@ -656,12 +659,14 @@ class Atari7800 extends devices_1.BasicMachine {
|
||||
// extended header?
|
||||
let indirect = false;
|
||||
let description = "";
|
||||
let writemode;
|
||||
const grmode = (ctrlreg & 0x3) + ((b1 & 0x80) ? 4 : 0);
|
||||
if ((b1 & 31) == 0) {
|
||||
var pal = b3 >> 5;
|
||||
var width = 32 - (b3 & 31);
|
||||
var xpos = this.readConst(dlhi + ((dlofs + 4) & 0x1ff));
|
||||
indirect = (b1 & 0x20) != 0;
|
||||
writemode = b1 & 0x80;
|
||||
dlofs += 5;
|
||||
}
|
||||
else {
|
||||
@ -672,6 +677,8 @@ class Atari7800 extends devices_1.BasicMachine {
|
||||
dlofs += 4;
|
||||
}
|
||||
description += "X=" + xpos + " W=" + width + " P=" + pal;
|
||||
if (writemode)
|
||||
description += " WM=1";
|
||||
if (indirect)
|
||||
description += " CHR=$" + (0, util_1.hex)((this.maria.regs[0x14] + this.maria.offset) & 0xff) + "xx";
|
||||
let gfxadr = b0 + (((b2 + (indirect ? 0 : this.maria.offset)) & 0xff) << 8);
|
||||
|
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{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w}from"./chunk-FYI4X4B2.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-5HIMDMXR.js";import"./chunk-SWGVMGGE.js";import"./chunk-G5LGIVML.js";import"./chunk-5XVCUSSZ.js";export{l as clearBreakpoint,h as compparams,f as current_project,u as emulationHalted,p as getPlatformAndRepo,t as getSaveState,s as getTestOutput,n as haltEmulation,w as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,v as reloadWorkspaceFile,d as repo_id,k as runToPC,m as setFrameRateUI,r as setTestInput,j as setupBreakpoint,o as setupSplits,q 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,w as v,x as w}from"./chunk-J4MP5ZI2.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-NNHZRAOX.js";import"./chunk-SWGVMGGE.js";import"./chunk-G5LGIVML.js";import"./chunk-5XVCUSSZ.js";export{l as clearBreakpoint,h as compparams,f as current_project,u as emulationHalted,p as getPlatformAndRepo,t as getSaveState,s as getTestOutput,n as haltEmulation,w as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,v as reloadWorkspaceFile,d as repo_id,k as runToPC,m as setFrameRateUI,r as setTestInput,j as setupBreakpoint,o as setupSplits,q as startUI,c as store_id};
|
||||
//# sourceMappingURL=ui.js.map
|
||||
|
@ -114,6 +114,7 @@ class MARIA {
|
||||
dli : boolean = false;
|
||||
h16 : boolean = false;
|
||||
h8 : boolean = false;
|
||||
writemode : number = 0;
|
||||
indirect : boolean = false;
|
||||
pixels = new Uint8Array(320);
|
||||
WSYNC : number = 0;
|
||||
@ -140,6 +141,7 @@ class MARIA {
|
||||
h16: this.h16,
|
||||
h8: this.h8,
|
||||
indirect: this.indirect,
|
||||
writemode: this.writemode,
|
||||
};
|
||||
}
|
||||
loadState(s) {
|
||||
@ -152,6 +154,7 @@ class MARIA {
|
||||
this.h16 = !!s.h16;
|
||||
this.h8 = !!s.h8;
|
||||
this.indirect = !!s.indirect;
|
||||
this.writemode = s.writemode|0;
|
||||
}
|
||||
isDMAEnabled() {
|
||||
return (this.regs[0x1c] & 0x60) == 0x40;
|
||||
@ -225,7 +228,6 @@ class MARIA {
|
||||
let b2 = bus.read(dlhi + ((dlofs+2) & 0x1ff));
|
||||
let b3 = bus.read(dlhi + ((dlofs+3) & 0x1ff));
|
||||
let indirect = false;
|
||||
const writemode = b1 & 0x80;
|
||||
// extended header?
|
||||
if ((b1 & 31) == 0) {
|
||||
var pal = b3 >> 5;
|
||||
@ -234,6 +236,7 @@ class MARIA {
|
||||
indirect = (b1 & 0x20) != 0;
|
||||
dlofs += 5;
|
||||
this.cycles += 10;
|
||||
this.writemode = b1 & 0x80;
|
||||
} else {
|
||||
// direct mode
|
||||
var xpos = b3;
|
||||
@ -247,7 +250,7 @@ class MARIA {
|
||||
xpos *= 2;
|
||||
const ctrlreg = this.regs[0x1c];
|
||||
// gfx mode (readmode + writemode * 4)
|
||||
const grmode = (ctrlreg & 0x3) + (writemode ? 4 : 0);
|
||||
const grmode = (ctrlreg & 0x3) + (this.writemode ? 4 : 0);
|
||||
// kangaroo mode
|
||||
const kangaroo = (ctrlreg & 0x4) != 0;
|
||||
// double bytes?
|
||||
@ -687,12 +690,14 @@ export class Atari7800 extends BasicMachine implements RasterFrameBased {
|
||||
// extended header?
|
||||
let indirect = false;
|
||||
let description = "";
|
||||
let writemode;
|
||||
const grmode = (ctrlreg & 0x3) + ((b1 & 0x80) ? 4 : 0);
|
||||
if ((b1 & 31) == 0) {
|
||||
var pal = b3 >> 5;
|
||||
var width = 32 - (b3 & 31);
|
||||
var xpos = this.readConst(dlhi + ((dlofs+4) & 0x1ff));
|
||||
indirect = (b1 & 0x20) != 0;
|
||||
writemode = b1 & 0x80;
|
||||
dlofs += 5;
|
||||
} else {
|
||||
// direct mode
|
||||
@ -702,6 +707,7 @@ export class Atari7800 extends BasicMachine implements RasterFrameBased {
|
||||
dlofs += 4;
|
||||
}
|
||||
description += "X=" + xpos + " W=" + width + " P=" + pal;
|
||||
if (writemode) description += " WM=1";
|
||||
if (indirect) description += " CHR=$" + hex((this.maria.regs[0x14] + this.maria.offset) & 0xff) + "xx";
|
||||
let gfxadr = b0 + (((b2 + (indirect?0:this.maria.offset)) & 0xff) << 8);
|
||||
description = " $" + hex(gfxadr,4) + " " + description;
|
||||
|
Loading…
Reference in New Issue
Block a user