1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-05-28 08:41:30 +00:00

Deploying to gh-pages from @ sehugg/8bitworkshop@02834db8a1 🚀

This commit is contained in:
sehugg 2023-07-12 19:11:15 +00:00
parent ae940e1942
commit d865012dd4
19 changed files with 164 additions and 79 deletions

View File

@ -1,7 +1,7 @@
import{I as z,h as W,k as N,p as F,t as H}from"./chunk-HB3LWF25.js";import{$ as I,J as B,U as M,V as f,W as O,Y as U,_ as E,da as _,g}from"./chunk-ATS7PSQG.js";import"./chunk-5XVCUSSZ.js";var d=0,L=2,P=8,X=U([[f.A,P+0,128],[f.B,P+1,128],[f.SELECT,L,-2],[f.START,L,-1],[f.UP,d,-16],[f.DOWN,d,-32],[f.LEFT,d,-64],[f.RIGHT,d,-128],[f.P2_A,P+2,128],[f.P2_B,P+3,128],[f.P2_UP,d,-1],[f.P2_DOWN,d,-2],[f.P2_LEFT,d,-4],[f.P2_RIGHT,d,-8]]);var D=263,K=258-16,b=451,j=28,q=16,J=24,Y=2,$=D*60*Y,T=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}},k=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){if(this.bus=t,this.cycles=0,this.pixels.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=this.offset==0?J:q,this.offset<0&&this.readDLLEntry(t);let i=this.dlstart&65280,h=this.dlstart&255;do{let n=t.read(i+(h+0&511)),c=t.read(i+(h+1&511));if(c==0||i>=16384)break;let A=t.read(i+(h+2&511)),m=t.read(i+(h+3&511)),x=!1;if((c&31)==0){var e=m>>5,a=32-(m&31),r=t.read(i+(h+4&511)),s=c&128;x=(c&32)!=0,h+=5,this.cycles+=10}else{var r=m,e=c>>5,a=32-(c&31),s=0;h+=4,this.cycles+=8}this.indirect=x;let v=n+((A+(x?0:this.offset)&255)<<8);r*=2;let C=(this.regs[28]&3)+(s?4:0),y=x&&(this.regs[28]&16)!=0;y&&(a*=2);for(var o=0;o<a;o++){let p=this.readDMA(y?v+(o>>1):v+o);if(x){let u=(this.regs[20]+this.offset<<8)+p;y&&o&1&&(u++,this.cycles-=3),p=this.readDMA(u)}switch(C){case 0:for(let u=0;u<4;u++){var l=p>>6&3;l>0&&(this.pixels[r]=this.pixels[r+1]=this.regs[(e<<2)+l]),p<<=2,r=r+2&511}break;case 2:case 3:for(let u=0;u<8;u++){var l=p&128?1:0;l>0&&(this.pixels[r]=this.regs[(e<<2)+l]),p<<=1,r=r+1&511}break}}}while(this.cycles<b);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{I as z,h as W,k as N,p as F,t as H}from"./chunk-HB3LWF25.js";import{$ as M,J as B,U as I,V as f,W as O,Y as U,_ as E,da as _,g}from"./chunk-ATS7PSQG.js";import"./chunk-5XVCUSSZ.js";var d=0,L=2,P=8,X=U([[f.A,P+0,128],[f.B,P+1,128],[f.SELECT,L,-2],[f.START,L,-1],[f.UP,d,-16],[f.DOWN,d,-32],[f.LEFT,d,-64],[f.RIGHT,d,-128],[f.P2_A,P+2,128],[f.P2_B,P+3,128],[f.P2_UP,d,-1],[f.P2_DOWN,d,-2],[f.P2_LEFT,d,-4],[f.P2_RIGHT,d,-8]]);var D=263,K=258-16,b=451,j=28,q=16,J=24,Y=2,$=D*60*Y,T=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+=I(t.regs,0,32),e}},k=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){if(this.bus=t,this.cycles=0,this.pixels.fill(this.regs[0]),this.isDMAEnabled()){this.cycles+=this.offset==0?J:q,this.offset<0&&this.readDLLEntry(t);let i=this.dlstart&65280,h=this.dlstart&255;do{let n=t.read(i+(h+0&511)),c=t.read(i+(h+1&511));if(c==0||i>=16384)break;let A=t.read(i+(h+2&511)),m=t.read(i+(h+3&511)),x=!1;if((c&31)==0){var e=m>>5,a=32-(m&31),r=t.read(i+(h+4&511)),s=c&128;x=(c&32)!=0,h+=5,this.cycles+=10}else{var r=m,e=c>>5,a=32-(c&31),s=0;h+=4,this.cycles+=8}this.indirect=x;let v=n+((A+(x?0:this.offset)&255)<<8);r*=2;let C=(this.regs[28]&3)+(s?4:0),y=x&&(this.regs[28]&16)!=0;y&&(a*=2);for(var o=0;o<a;o++){let p=this.readDMA(y?v+(o>>1):v+o);if(x){let u=(this.regs[20]+this.offset<<8)+p;y&&o&1&&(u++,this.cycles-=3),p=this.readDMA(u)}switch(C){case 0:for(let u=0;u<4;u++){var l=p>>6&3;l>0&&(this.pixels[r]=this.pixels[r+1]=this.regs[(e<<2)+l]),p<<=2,r=r+2&511}break;case 2:case 3:for(let u=0;u<8;u++){var l=p&128?1:0;l>0&&(this.pixels[r]=this.regs[(e<<2)+l]),p<<=1,r=r+1&511}break}}}while(this.cycles<b);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+=I(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}},R=class extends F{constructor(){super();this.cpuFrequency=1789772;this.canvasWidth=320;this.numTotalScanlines=D;this.numVisibleScanlines=K;this.defaultROMSize=49152;this.cpuCyclesPerLine=113.5;this.sampleRate=$;this.ram=new Uint8Array(4096);this.regs6532=new Uint8Array(4);this.piatimer=0;this.timerinterval=1;this.tia=new T;this.maria=new k;this.lastFrameCycles=0;this.xtracyc=0;this.cpu=new H,this.read=I([[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=I([[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=O(this.inputs,X),this.pokey1=new W,this.audioadapter=new N(this.pokey1,Y,$)}readConst(t){let e=this.probe;this.probe=null;let a=this.read(t);return this.probe=e,a}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,a=0,r,s=0,o=0,l=0;this.probe.logNewFrame();for(var i=0;i<D;i++){this.scanline=i;var h=i<K;for(this.maria.setVBLANK(!h),this.maria.WSYNC=0;s<j&&!this.maria.WSYNC;){if(t&&t()){t=null,i=999;break}s+=this.advanceCPU()<<2,l++}if(h){let c=this.maria.doDMA(this.dmaBus);if(this.tickClocks(c>>2),s+=c,e)for(var n=0;n<320;n++)e[a++]=V[this.maria.pixels[n]]}for((h||i==D-1)&&this.maria.doInterrupt()&&(this.probe.logInterrupt(0),this.cpu.NMI());s<b;){if(this.maria.WSYNC){this.probe.logWait(0),this.tickClocks(b-s>>2),s=b;break}if(t&&t()){t=null,i=999;break}s+=this.advanceCPU()<<2,l++}this.audio&&this.audioadapter.generate(this.audio),s-=b,o+=s,this.probe.logNewScanline()}return this.lastFrameCycles=o,l}getRasterX(){return this.lastFrameCycles%b}getRasterY(){return this.scanline}loadROM(t){t.length==49280&&(t=t.slice(128)),this.rom=E(t,this.defaultROMSize,!0)}reset(){super.reset(),this.tia.reset(),this.maria.reset(),this.inputs.fill(0),this.inputs[d]=255,this.inputs[L]=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.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 T.stateToLongString(e.tia);case"MARIA":return k.stateToLongString(e.maria)+`
DLI? `+t.dli,e}},R=class extends F{constructor(){super();this.cpuFrequency=1789772;this.canvasWidth=320;this.numTotalScanlines=D;this.numVisibleScanlines=K;this.defaultROMSize=49152;this.cpuCyclesPerLine=113.5;this.sampleRate=$;this.ram=new Uint8Array(4096);this.regs6532=new Uint8Array(4);this.piatimer=0;this.timerinterval=1;this.tia=new T;this.maria=new k;this.lastFrameCycles=0;this.xtracyc=0;this.cpu=new H,this.read=M([[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=M([[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=O(this.inputs,X),this.pokey1=new W,this.audioadapter=new N(this.pokey1,Y,$)}readConst(t){let e=this.probe;this.probe=null;let a=this.read(t);return this.probe=e,a}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,a=0,r,s=0,o=0,l=0;this.probe.logNewFrame();for(var i=0;i<D;i++){this.scanline=i;var h=i<K;for(this.maria.setVBLANK(!h),this.maria.WSYNC=0;s<j&&!this.maria.WSYNC;){if(t&&t()){t=null,i=999;break}s+=this.advanceCPU()<<2,l++}if(h){let c=this.maria.doDMA(this.dmaBus);if(this.tickClocks(c>>2),s+=c,e)for(var n=0;n<320;n++)e[a++]=V[this.maria.pixels[n]]}for((h||i==D-1)&&this.maria.doInterrupt()&&(this.probe.logInterrupt(0),this.cpu.NMI());s<b;){if(this.maria.WSYNC){this.probe.logWait(0),this.tickClocks(b-s>>2),s=b;break}if(t&&t()){t=null,i=999;break}s+=this.advanceCPU()<<2,l++}this.audio&&this.audioadapter.generate(this.audio),s-=b,o+=s,this.probe.logNewScanline()}return this.lastFrameCycles=o,l}getRasterX(){return this.lastFrameCycles%b}getRasterY(){return this.scanline}loadROM(t){t.length==49280&&(t=t.slice(128)),this.rom=E(t,this.defaultROMSize,!0)}reset(){super.reset(),this.tia.reset(),this.maria.reset(),this.inputs.fill(0),this.inputs[d]=255,this.inputs[L]=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 T.stateToLongString(e.tia);case"MARIA":return k.stateToLongString(e.maria)+`
Scanline: `+this.scanline}}getDebugDisplayLists(){let t={},e=this.maria.getDLLStart(),a=0;for(;a<240;){let r=this.readConst(e),s=r&15,o=(r&64)!=0,l=(r&32)!=0,i=(this.readConst(e+1)<<8)+this.readConst(e+2);e=e+3&65535;let h=(this.readConst(e)&128)!=0,n="DL $"+g(i,4)+" "+a+"-"+(a+s);o&&(n+=" H16"),l&&(n+=" H8"),h&&(n+=" DLI"),t[n]={$$:this._readDebugDisplayList(i)},a+=s+1}return t}_readDebugDisplayList(t){return()=>this.readDebugDisplayList(t)}readDebugDisplayList(t){let e=[],a=t&65280,r=t&255;do{let h=this.readConst(a+(r+0&511)),n=this.readConst(a+(r+1&511));if(n==0)break;let c=this.readConst(a+(r+2&511)),A=this.readConst(a+(r+3&511)),m=!1,x="";if((n&31)==0){var s=A>>5,o=32-(A&31),l=this.readConst(a+(r+4&511)),i=n&128;m=(n&32)!=0,r+=5,x+="X="+l+" W="+o+" P="+s+" "+(i?"WRITE":"")}else{var l=A,s=n>>5,o=32-(n&31),i=0;r+=4,x+="X="+l+" W="+o+" P="+s}let v=h+((c+(m?0:this.maria.offset)&255)<<8),C=(this.maria.regs[28]&3)+(i?4:0),y=m&&(this.maria.regs[28]&16)!=0;C&&(x+=" READMODE="+C),y&&(x+=" DBL"),m&&(x+=" CHR=$"+g(this.maria.regs[20]+this.maria.offset&255)+"xx"),x=" $"+g(v,4)+" "+x,e.push(x)}while(r<512);return e}},V=new Uint32Array(256);for(S=0;S<256;S++)V[S]=_(S);var S;var Q=[{id:"sprites.dasm",name:"Sprites (ASM)"},{id:"wsync.c",name:"WSYNC"},{id:"sprites.c",name:"Double Buffering"},{id:"scroll.c",name:"Scrolling"}],G=class extends z{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 R}getPresets(){return Q}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}};B.atari7800=G;
//# sourceMappingURL=atari7800-5KKGRW7B.js.map
//# sourceMappingURL=atari7800-N22FZCY6.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

View File

@ -1,2 +1,2 @@
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-CKCEJACI.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-3R2WJJJP.js";import{I as m,o as u,t as h}from"./chunk-HB3LWF25.js";import{$ as i,B as o,J as l,m as n}from"./chunk-ATS7PSQG.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-MDELKDXR.js.map
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-NDAI7GI2.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-3ZY5KX5H.js";import{I as m,o as u,t as h}from"./chunk-HB3LWF25.js";import{$ as i,B as o,J as l,m as n}from"./chunk-ATS7PSQG.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-N6DPMGWQ.js.map

View File

@ -1,2 +1,2 @@
import{b as w,c as x}from"./chunk-3R2WJJJP.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-ATS7PSQG.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-3ZY5KX5H.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-ATS7PSQG.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
//# sourceMappingURL=embedui.js.map

View File

@ -515,6 +515,7 @@ class Atari7800 extends devices_1.BasicMachine {
this.inputs.fill(0x0);
this.inputs[SWCHA] = 0xff;
this.inputs[SWCHB] = 1 + 2 + 8;
this.setPIATimer(0, 0); // TODO?
//this.cpu.advanceClock(); // needed for test to pass?
}
readAddress(addr) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w}from"./chunk-CKCEJACI.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-3R2WJJJP.js";import"./chunk-HB3LWF25.js";import"./chunk-ATS7PSQG.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-NDAI7GI2.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-3ZY5KX5H.js";import"./chunk-HB3LWF25.js";import"./chunk-ATS7PSQG.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

141
presets/atari7800/7800.h Normal file
View File

@ -0,0 +1,141 @@
; 7800.h
; Version 1.0, 2019/12/13
; This file defines hardware registers and memory mapping for the
; Atari 7800. It is distributed as a companion machine-specific support package
; for the DASM compiler. Updates to this file, DASM, and associated tools are
; available at https://github.com/dasm-assembler/dasm
; ******************** 7800 Hardware Adresses ***************************
;
; MEMORY MAP USAGE OF THE 7800
;
; 00 - 1F TIA REGISTERS
; 20 - 3F MARIA REGISTERS
; 40 - FF RAM block 0 (zero page)
; 100 - 11F TIA (mirror of 0000-001f)
; 120 - 13F MARIA (mirror of 0020-003f)
; 140 - 1FF RAM block 1 (stack)
; 200 - 21F TIA (mirror of 0000-001f)
; 220 - 23F MARIA (mirror of 0020-003f)
; 240 - 27F ???
; 280 - 2FF RIOT I/O ports and timers
; 300 - 31F TIA (mirror of 0000-001f)
; 320 - 33F MARIA (mirror of 0020-003f)
; 340 - 3FF ???
; 400 - 47F unused address space
; 480 - 4FF RIOT RAM
; 500 - 57F unused address space
; 580 - 5FF RIOT RAM (mirror of 0480-04ff)
; 600 - 17FF unused address space
; 1800 - 203F RAM
; 2040 - 20FF RAM block 0 (mirror of 0000-001f)
; 2100 - 213F RAM
; 2140 - 21FF RAM block 1 (mirror of 0140-01ff)
; 2200 - 27FF RAM
; 2800 - 2FFF mirror of 1800-27ff
; 3000 - 3FFF unused address space
; 4000 - FF7F potential cartridge address space
; FF80 - FFF9 RESERVED FOR ENCRYPTION
; FFFA - FFFF 6502 VECTORS
;****** 00-1F ********* TIA REGISTERS ******************
INPTCTRL = $01 ;Input control. In same address space as TIA. write-only
VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only
INPT0 = $08 ;Paddle Control Input 0 read-only
INPT1 = $09 ;Paddle Control Input 1 read-only
INPT2 = $0A ;Paddle Control Input 2 read-only
INPT3 = $0B ;Paddle Control Input 3 read-only
; ** some common alternate names for INPT0/1/2/3
INPT4B = $08 ;Joystick 0 Fire 1 read-only
INPT4A = $09 ;Joystick 0 Fire 1 read-only
INPT5B = $0A ;Joystick 1 Fire 0 read-only
INPT5A = $0B ;Joystick 1 Fire 1 read-only
INPT4R = $08 ;Joystick 0 Fire 1 read-only
INPT4L = $09 ;Joystick 0 Fire 1 read-only
INPT5R = $0A ;Joystick 1 Fire 0 read-only
INPT5L = $0B ;Joystick 1 Fire 1 read-only
INPT4 = $0C ;Player 0 Fire Button Input read-only
INPT5 = $0D ;Player 1 Fire Button Input read-only
AUDC0 = $15 ;Audio Control Channel 0 write-only
AUDC1 = $16 ;Audio Control Channel 1 write-only
AUDF0 = $17 ;Audio Frequency Channel 0 write-only
AUDF1 = $18 ;Audio Frequency Channel 1 write-only
AUDV0 = $19 ;Audio Volume Channel 0 write-only
AUDV1 = $1A ;Audio Volume Channel 1 write-only
;****** 20-3F ********* MARIA REGISTERS ***************
BACKGRND = $20 ;Background Color write-only
P0C1 = $21 ;Palette 0 - Color 1 write-only
P0C2 = $22 ;Palette 0 - Color 2 write-only
P0C3 = $23 ;Palette 0 - Color 3 write-only
WSYNC = $24 ;Wait For Sync write-only
P1C1 = $25 ;Palette 1 - Color 1 write-only
P1C2 = $26 ;Palette 1 - Color 2 write-only
P1C3 = $27 ;Palette 1 - Color 3 write-only
MSTAT = $28 ;Maria Status read-only
P2C1 = $29 ;Palette 2 - Color 1 write-only
P2C2 = $2A ;Palette 2 - Color 2 write-only
P2C3 = $2B ;Palette 2 - Color 3 write-only
DPPH = $2C ;Display List List Pointer High write-only
P3C1 = $2D ;Palette 3 - Color 1 write-only
P3C2 = $2E ;Palette 3 - Color 2 write-only
P3C3 = $2F ;Palette 3 - Color 3 write-only
DPPL = $30 ;Display List List Pointer Low write-only
P4C1 = $31 ;Palette 4 - Color 1 write-only
P4C2 = $32 ;Palette 4 - Color 2 write-only
P4C3 = $33 ;Palette 4 - Color 3 write-only
CHARBASE = $34 ;Character Base Address write-only
CHBASE = $34 ;Character Base Address write-only
P5C1 = $35 ;Palette 5 - Color 1 write-only
P5C2 = $36 ;Palette 5 - Color 2 write-only
P5C3 = $37 ;Palette 5 - Color 3 write-only
OFFSET = $38 ;Unused - Store zero here write-only
P6C1 = $39 ;Palette 6 - Color 1 write-only
P6C2 = $3A ;Palette 6 - Color 2 write-only
P6C3 = $3B ;Palette 6 - Color 3 write-only
CTRL = $3C ;Maria Control Register write-only
P7C1 = $3D ;Palette 7 - Color 1 write-only
P7C2 = $3E ;Palette 7 - Color 2 write-only
P7C3 = $3F ;Palette 7 - Color 3 write-only
;****** 280-2FF ******* PIA PORTS AND TIMERS ************
SWCHA = $280 ;P0+P1 Joystick Directional Input read-write
CTLSWA = $281 ;I/O Control for SCHWA read-write
SWACNT = $281 ;VCS name for above read-write
SWCHB = $282 ;Console Switches read-write
CTLSWB = $283 ;I/O Control for SCHWB read-write
SWBCNT = $283 ;VCS name for above read-write
INTIM = $284 ;Iterval Timer Read read-only
TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only
TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only
TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only
T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only
TIM64TI = $29E ;Interrupt timer 64T write-only
;XM
XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2
; Pokey register relative locations, since its base may be different
; depending on the hardware.
PAUDF0 = $0 ; extra audio channels and frequencies
PAUDC0 = $1
PAUDF1 = $2
PAUDC1 = $3
PAUDF2 = $4
PAUDC2 = $5
PAUDF3 = $6
PAUDC3 = $7
PAUDCTL = $8 ; Audio Control
PRANDOM = $A ; 17 bit polycounter pseudo random
PSKCTL = $F ; Serial Port control

View File

@ -6,66 +6,11 @@
;
processor 6502
; ************ Hardware Adresses ***************************
INPTCTRL equ $01 ;Input control
AUDC0 equ $15 ;Audio Control Channel 0
AUDC1 equ $16 ;Audio Control Channel 1
AUDF0 equ $17 ;Audio Frequency Channel 0
AUDF1 equ $18 ;Audio Frequency Channel 1
AUDV0 equ $19 ;Audio Volume Channel 0
AUDV1 equ $1A ;Audio Volume Channel 1
INPT0 equ $08 ;Paddle Control Input 0
INPT1 equ $09 ;Paddle Control Input 1
INPT2 equ $0A ;Paddle Control Input 2
INPT3 equ $0B ;Paddle Control Input 3
INPT4 equ $0C ;Player 0 Fire Button Input
INPT5 equ $0D ;Player 1 Fire Button Input
BACKGRND equ $20 ;Background Color
P0C1 equ $21 ;Palette 0 - Color 1
P0C2 equ $22 ;Palette 0 - Color 2
P0C3 equ $23 ;Palette 0 - Color 3
WSYNC equ $24 ;Wait For Sync
P1C1 equ $25 ;Palette 1 - Color 1
P1C2 equ $26 ;Palette 1 - Color 2
P1C3 equ $27 ;Palette 1 - Color 3
MSTAT equ $28 ;Maria Status
P2C1 equ $29 ;Palette 2 - Color 1
P2C2 equ $2A ;Palette 2 - Color 2
P2C3 equ $2B ;Palette 2 - Color 3
DPPH equ $2C ;Display List List Pointer High
P3C1 equ $2D ;Palette 3 - Color 1
P3C2 equ $2E ;Palette 3 - Color 2
P3C3 equ $2F ;Palette 3 - Color 3
DPPL equ $30 ;Display List List Pointer Low
P4C1 equ $31 ;Palette 4 - Color 1
P4C2 equ $32 ;Palette 4 - Color 2
P4C3 equ $33 ;Palette 4 - Color 3
CHARBASE equ $34 ;Character Base Address
P5C1 equ $35 ;Palette 5 - Color 1
P5C2 equ $36 ;Palette 5 - Color 2
P5C3 equ $37 ;Palette 5 - Color 3
OFFSET equ $38 ;Unused - Store zero here
P6C1 equ $39 ;Palette 6 - Color 1
P6C2 equ $3A ;Palette 6 - Color 2
P6C3 equ $3B ;Palette 6 - Color 3
CTRL equ $3C ;Maria Control Register
P7C1 equ $3D ;Palette 7 - Color 1
P7C2 equ $3E ;Palette 7 - Color 2
P7C3 equ $3F ;Palette 7 - Color 3
SWCHA equ $280 ;P0, P1 Joystick Directional Input
SWCHB equ $282 ;Console Switches
CTLSWA equ $281 ;I/O Control for SCHWA
CTLSWB equ $283 ;I/O Control for SCHWB
SEG.U data
include "7800.h"
;******* Vairables ********************************
SEG.U data
org $40
xpos ds.b 1 ;X Position of sprite
@ -75,12 +20,9 @@ dlpnt ds.w 1
dlend ds.b 12 ;Index of end of each DL
;**********************************************************
SEG code
SEG code
org $4000 ;Start of code
START

View File

@ -547,6 +547,7 @@ export class Atari7800 extends BasicMachine implements RasterFrameBased {
this.inputs.fill(0x0);
this.inputs[SWCHA] = 0xff;
this.inputs[SWCHB] = 1+2+8;
this.setPIATimer(0, 0); // TODO?
//this.cpu.advanceClock(); // needed for test to pass?
}