mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-04-04 20:31:39 +00:00
Deploying to gh-pages from @ sehugg/8bitworkshop@8023d56b88 🚀
This commit is contained in:
parent
fd03d98566
commit
75d8ea2a22
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
14
gen/astrocade-Q5URXEDG.js
Normal file
14
gen/astrocade-Q5URXEDG.js
Normal file
File diff suppressed because one or more lines are too long
7
gen/astrocade-Q5URXEDG.js.map
Normal file
7
gen/astrocade-Q5URXEDG.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
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{t as c}from"./chunk-JMPDXGK5.js";import"./chunk-SDBJC2RS.js";import"./chunk-XMPGMPQ4.js";import"./chunk-NFHWZ4B3.js";import{I as m,o as u,t as h}from"./chunk-42IVW2OL.js";import{C as o,J as l,aa as i,n}from"./chunk-S4FPTY4A.js";import"./chunk-RQFURXHW.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-DCPTC5VJ.js.map
|
||||
import{a as d}from"./chunk-3XE5YOCV.js";import{t as c}from"./chunk-W3JZ7KMT.js";import"./chunk-SDBJC2RS.js";import"./chunk-XMPGMPQ4.js";import"./chunk-2KLMJIHE.js";import{I as m,o as u,t as h}from"./chunk-42IVW2OL.js";import{C as o,J as l,aa as i,n}from"./chunk-S4FPTY4A.js";import"./chunk-RQFURXHW.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-RYHV7TSB.js.map
|
@ -1,2 +1,2 @@
|
||||
import{b as w,c as x}from"./chunk-NFHWZ4B3.js";import{A as p,E as v,J as c,l as m,m as u,y as g}from"./chunk-S4FPTY4A.js";import{c as I}from"./chunk-RQFURXHW.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-2KLMJIHE.js";import{A as p,E as v,J as c,l as m,m as u,y as g}from"./chunk-S4FPTY4A.js";import{c as I}from"./chunk-RQFURXHW.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
|
||||
|
2
gen/exidy-W3QKDB3N.js
Normal file
2
gen/exidy-W3QKDB3N.js
Normal file
@ -0,0 +1,2 @@
|
||||
import{I as y,q as u,t as d}from"./chunk-42IVW2OL.js";import{J as m,W as x,X as c,Z as p,aa as o}from"./chunk-S4FPTY4A.js";import"./chunk-RQFURXHW.js";var M=p([[x.START,1,-1],[x.RIGHT,1,-4],[x.LEFT,1,-8],[x.A,1,-16],[x.UP,1,-32],[x.DOWN,1,-64],[x.SELECT,1,-128]]),l=class extends u{constructor(){super();this.cpuFrequency=705562;this.sampleRate=894886;this.numVisibleScanlines=256;this.numTotalScanlines=262;this.cpuCyclesPerLine=336>>3;this.canvasWidth=256;this.defaultROMSize=32768+2048+10240;this.cpu=new d;this.ram=new Uint8Array(28672);this.color_latch=[84,238,107];this.palette=[4278190080,4278190335,4294901760,4294902015,4278255360,4278255615,4294967040,4294967295];this.inputs=new Uint8Array(4);this.keyMap=M;this.handler=c(this.inputs,this.keyMap);this.scrnbase=16384;this.charbase=26624;this.bus={read:o([[0,1023,0,t=>this.ram[t]],[4096,16383,0,t=>this.rom[t-4096]],[16384,20479,0,t=>this.ram[t]],[20736,20991,3,t=>t==3?this.int_latch():this.inputs[t]],[24576,28671,0,t=>this.ram[t]],[32768,65535,0,t=>this.rom[t-32768]]]),write:o([[0,1023,0,(t,e)=>{this.ram[t]=e}],[16384,20479,0,(t,e)=>{this.ram[t]=e}],[20480,20737,0,(t,e)=>{this.ram[t]=e}],[21008,21010,3,(t,e)=>{this.setColorLatch(t,e)}],[24576,28671,0,(t,e)=>{this.ram[t]=e}]])};this.connectCPUMemoryBus(this),this.updatePalette(),this.inputs[0]=234,this.inputs[1]=255}loadROM(t){super.loadROM(t),t.length<32768&&(t.length==11616?(this.rom.set(t.slice(10240,12288),32768),this.rom.set(t.slice(9984,10240),32512),this.rom.set(t.slice(0,10240),2048),this.scrnbase=16384,this.charbase=18432):t.length==14336?(this.rom.set(t.slice(13312,14336),32768),this.rom.set(t.slice(12032,12288),32512),this.scrnbase=16384,this.charbase=18432):console.log("Warning: ROM is too small",t.length));let e=32768;this.sprite_gfx=this.rom.subarray(e,e+32*32)}read(t){return this.bus.read(t)}readConst(t){return t==20739?this.inputs[3]:this.bus.read(t)}write(t,e){this.bus.write(t,e)}int_latch(){let t=this.inputs[3];return t|=this.inputs[1]&128?0:64,this.inputs[3]=128,t}updatePalette(){this.set_1_color(0,0),this.set_1_color(1,7),this.set_1_color(2,0),this.set_1_color(3,6),this.set_1_color(4,4),this.set_1_color(5,3),this.set_1_color(6,2),this.set_1_color(7,1)}set_1_color(t,e){let a=this.color_latch[0]&1<<e?1:0,s=this.color_latch[1]&1<<e?2:0,f=this.color_latch[2]&1<<e?4:0;this.palette[t]=S[a|s|f]}setColorLatch(t,e){this.color_latch[t&3]=e,this.updatePalette()}drawSprite(t,e,a,s){var f=236-t-4,i=244-e-4;if(i+=15,i-=this.scanline,i>=0&&i<16){i=15-i;let n=this.scanline*this.canvasWidth,h=this.sprite_gfx[a+i];for(let r=0;r<8;r++)h&128>>r&&(this.pixels[n+f+r]=this.palette[s]);h=this.sprite_gfx[a+i+16];for(let r=0;r<8;r++)h&128>>r&&(this.pixels[n+f+r+8]=this.palette[s])}}drawSprite1(){let t=this.ram[20480],e=this.ram[20544],a=this.ram[20737]&32?1:0,s=(this.ram[20736]&15)+16*a;this.drawSprite(t,e,s*32,1)}drawSprite2(){let t=this.ram[20608],e=this.ram[20672],a=this.ram[20737]&64?1:0,s=(this.ram[20736]>>4)+16*a;this.drawSprite(t,e,s*32,3)}startScanline(){}drawScanline(){let t=this.scanline,e=t>>3,a=t*this.canvasWidth;for(let s=0;s<256;s++){let f=s>>3,i=this.ram[this.scrnbase+e*32+f],n=4+(i>>6&3),r=this.ram[this.charbase+i*8+(t&7)]&128>>(s&7)?n:0;this.pixels[a+s]=this.palette[r]}this.drawSprite2(),this.drawSprite1()}postFrame(){this.inputs[3]&=127,this.cpu.IRQ()}getVideoParams(){return{width:256,height:256,aspect:6/5}}},S=[4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295];var g=[{id:"minimal.c",name:"Minimal Example",category:"C"}],b=class extends y{newMachine(){return new l}getPresets(){return g}getDefaultExtension(){return".dasm"}readAddress(t){return this.machine.readConst(t)}getMemoryMap(){return{main:[{name:"RAM",start:0,size:1024,type:"ram"},{name:"Sprite I/O",start:20480,size:256,type:"io"},{name:"I/O",start:20736,size:3,type:"io"},{name:"PIA 6821",start:20992,size:15,type:"io"},{name:"Color Latches",start:21008,size:3,type:"io"},{name:"Screen RAM",start:16384,size:1024,type:"ram"},{name:"Character RAM",start:26624,size:2048,type:"ram"},{name:"Audio ROM",start:22528,size:10240,type:"rom"},{name:"Program ROM",start:32768,size:32768,type:"rom"}]}}};m.exidy=b;
|
||||
//# sourceMappingURL=exidy-W3QKDB3N.js.map
|
7
gen/exidy-W3QKDB3N.js.map
Normal file
7
gen/exidy-W3QKDB3N.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._BallyArcade = exports.BallyAstrocade = void 0;
|
||||
exports.BallyAstrocade = void 0;
|
||||
const ZilogZ80_1 = require("../common/cpu/ZilogZ80");
|
||||
const devices_1 = require("../common/devices");
|
||||
const emu_1 = require("../common/emu");
|
||||
@ -67,6 +67,7 @@ const _BallyAstrocade = function (arcade) {
|
||||
const swidth = arcade ? 320 : 160;
|
||||
const sheight = arcade ? 204 : 102;
|
||||
const swbytes = swidth >> 2;
|
||||
const samask = arcade ? 0x3fff : 0xfff;
|
||||
const INITIAL_WATCHDOG = 256;
|
||||
const PIXEL_ON = 0xffeeeeee;
|
||||
const PIXEL_OFF = 0xff000000;
|
||||
@ -85,17 +86,18 @@ const _BallyAstrocade = function (arcade) {
|
||||
var palinds = new Uint8Array(8);
|
||||
var refreshlines = 0;
|
||||
var dirtylines = new Uint8Array(arcade ? 262 : 131);
|
||||
var vidactive = false;
|
||||
var rotdata = new Uint8Array(4);
|
||||
var rotcount = 0;
|
||||
var intst = 0;
|
||||
var waitstates = 0;
|
||||
var patboard = new Uint8Array(0x08);
|
||||
var patdest = 0;
|
||||
function ramwrite(a, v) {
|
||||
// set RAM
|
||||
ram[a] = v;
|
||||
waitstates++;
|
||||
// mark scanline as dirty
|
||||
dirtylines[((a & 0xfff) / swbytes) | 0] = 1;
|
||||
dirtylines[((a & samask) / swbytes) | 0] = 1;
|
||||
// this was old behavior where we updated instantly
|
||||
// but it had problems if we had mid-screen palette changes
|
||||
//ramupdate(a, v);
|
||||
@ -194,6 +196,89 @@ const _BallyAstrocade = function (arcade) {
|
||||
function refreshall() {
|
||||
refreshlines = sheight;
|
||||
}
|
||||
// bally astrocade pattern board
|
||||
// https://github.com/mamedev/mame/blob/7ff10685c56a6e123336c684e5e96fdb9e8b3674/src/mame/midway/astrocde_v.cpp#L726
|
||||
function xfer_patboard() {
|
||||
let m_pattern_source = patboard[0] | (patboard[1] << 8);
|
||||
let m_pattern_mode = patboard[2] & 0x3f;
|
||||
let m_pattern_skip = patboard[3];
|
||||
let m_pattern_dest = (patdest & 0xff) | (patboard[4] << 8);
|
||||
let m_pattern_width = patboard[5];
|
||||
let m_pattern_height = patboard[6] + 1;
|
||||
let curwidth;
|
||||
let u13ff = 0;
|
||||
let cycles = 0;
|
||||
u13ff = 0;
|
||||
if ((m_pattern_mode & 0x02) === 0) {
|
||||
u13ff = 1;
|
||||
}
|
||||
function incrementSource() {
|
||||
if (u13ff && (m_pattern_mode & 0x04) !== 0 && (curwidth !== 0 || (m_pattern_mode & 0x08) === 0)) {
|
||||
m_pattern_source++;
|
||||
}
|
||||
if ((m_pattern_mode & 0x02) !== 0) {
|
||||
u13ff ^= 1;
|
||||
}
|
||||
}
|
||||
function incrementDest() {
|
||||
if (curwidth !== 0) {
|
||||
if ((m_pattern_mode & 0x20) !== 0) {
|
||||
m_pattern_dest++;
|
||||
}
|
||||
else {
|
||||
m_pattern_dest--;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Loop over height
|
||||
while (m_pattern_height >= 0) {
|
||||
let carry;
|
||||
curwidth = m_pattern_width;
|
||||
// Loop over width
|
||||
while (curwidth >= 0) {
|
||||
let busaddr;
|
||||
let busdata;
|
||||
// Read Phase
|
||||
busaddr = (m_pattern_mode & 0x01) === 0 ? m_pattern_source : m_pattern_dest;
|
||||
if (curwidth === 0 && (m_pattern_mode & 0x08) !== 0) {
|
||||
busdata = 0;
|
||||
}
|
||||
else {
|
||||
busdata = membus.read(m_pattern_source);
|
||||
}
|
||||
if ((m_pattern_mode & 0x01) === 0) {
|
||||
incrementSource();
|
||||
}
|
||||
else {
|
||||
incrementDest();
|
||||
}
|
||||
// Write Phase
|
||||
busaddr = (m_pattern_mode & 0x01) !== 0 ? m_pattern_source : m_pattern_dest;
|
||||
ramwrite(busaddr, busdata);
|
||||
if ((m_pattern_mode & 0x01) === 0) {
|
||||
incrementDest();
|
||||
}
|
||||
else {
|
||||
incrementSource();
|
||||
}
|
||||
cycles += 4;
|
||||
curwidth--;
|
||||
}
|
||||
// At the end of each row, adjust m_pattern_dest
|
||||
carry = ((m_pattern_dest & 0xff) + m_pattern_skip) & 0x100;
|
||||
m_pattern_dest = (m_pattern_dest & 0xff00) | ((m_pattern_dest + m_pattern_skip) & 0xff);
|
||||
if ((m_pattern_mode & 0x10) === 0) {
|
||||
m_pattern_dest += carry;
|
||||
}
|
||||
else {
|
||||
m_pattern_dest -= carry ^ 0x100;
|
||||
}
|
||||
m_pattern_height--;
|
||||
}
|
||||
// Adjust m_maincpu.icount
|
||||
// m_maincpu.adjust_icount(-cycles);
|
||||
// Replace the above line with the actual adjustment of icount.
|
||||
}
|
||||
this.drawScanline = (sl) => {
|
||||
// interrupt
|
||||
if (sl == inlin && (inmod & 0x8)) {
|
||||
@ -217,9 +302,9 @@ const _BallyAstrocade = function (arcade) {
|
||||
ram = r;
|
||||
inputs = inp;
|
||||
psg = psgg;
|
||||
//bios = padBytes(ASTROCADE_MINIMAL_BIOS, 0x2000);
|
||||
bios = (0, emu_1.padBytes)(new util_1.lzgmini().decode((0, util_1.stringToByteArray)(atob(ASTROLIBRE_BIOS_LZG))), 0x2000);
|
||||
if (!arcade) {
|
||||
//bios = padBytes(ASTROCADE_MINIMAL_BIOS, 0x2000);
|
||||
bios = (0, emu_1.padBytes)(new util_1.lzgmini().decode((0, util_1.stringToByteArray)(atob(ASTROLIBRE_BIOS_LZG))), 0x2000);
|
||||
// game console
|
||||
membus = {
|
||||
read: (0, emu_1.newAddressDecoder)([
|
||||
@ -238,13 +323,14 @@ const _BallyAstrocade = function (arcade) {
|
||||
membus = {
|
||||
read: (0, emu_1.newAddressDecoder)([
|
||||
[0x4000, 0x7fff, 0x3fff, function (a) { return ram[a]; }],
|
||||
[0xd000, 0xdfff, 0xfff, function (a) { return ram[a + 0x4000]; }],
|
||||
[0x0000, 0xafff, 0xffff, function (a) { return rom ? rom[a] : 0; }], // ROM (0-3fff,8000-afff)
|
||||
[0xd000, 0xdfff, 0x0fff, function (a) { return ram[a + 0x4000]; }],
|
||||
[0x0000, 0x3fff, 0x3fff, function (a) { return rom ? rom[a] : 0; }],
|
||||
[0x8000, 0xbfff, 0x3fff, function (a) { return rom ? rom[a + 0x4000] : 0; }], // ROM
|
||||
]),
|
||||
write: (0, emu_1.newAddressDecoder)([
|
||||
[0x4000, 0x7fff, 0x3fff, ramwrite],
|
||||
[0xd000, 0xdfff, 0xfff, function (a, v) { ramwrite(a + 0x4000, v); }],
|
||||
[0x0000, 0x3fff, 0x3fff, magicwrite],
|
||||
[0xd000, 0xdfff, 0x0fff, function (a, v) { ramwrite(a + 0x4000, v); }], // static RAM
|
||||
]),
|
||||
};
|
||||
}
|
||||
@ -265,6 +351,25 @@ const _BallyAstrocade = function (arcade) {
|
||||
return rtn;
|
||||
},
|
||||
write: function (addr, val) {
|
||||
if (addr == 0xa55b) {
|
||||
// TODO: protected_ram_enable_w
|
||||
return;
|
||||
}
|
||||
addr &= 0xff;
|
||||
// pattern board
|
||||
if (addr > 0x78 && addr < 0x80) {
|
||||
patboard[addr & 7] = val;
|
||||
if (addr == 0x72) {
|
||||
patdest = 0;
|
||||
}
|
||||
if (addr == 0x74) {
|
||||
patdest = (patdest + patboard[3]) & 0xff;
|
||||
}
|
||||
if (addr == 0x7e) {
|
||||
xfer_patboard();
|
||||
}
|
||||
return;
|
||||
}
|
||||
addr &= 0x1f;
|
||||
val &= 0xff;
|
||||
switch (addr) {
|
||||
@ -324,8 +429,15 @@ const _BallyAstrocade = function (arcade) {
|
||||
case 0x19: // XPAND
|
||||
xpand = val;
|
||||
break;
|
||||
case 0x1a:
|
||||
case 0x1b:
|
||||
case 0x1c:
|
||||
case 0x1d:
|
||||
case 0x1e:
|
||||
//psg2.setACRegister(addr - 0x1a, val);
|
||||
break;
|
||||
default:
|
||||
console.log('IO write', (0, util_1.hex)(addr, 4), (0, util_1.hex)(val, 2));
|
||||
//console.log('IO write', hex(addr, 4), hex(val, 2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -362,6 +474,8 @@ const _BallyAstrocade = function (arcade) {
|
||||
rotdata.set(state.rotdata);
|
||||
intst = state.intst;
|
||||
inputs.set(state.inputs);
|
||||
patboard.set(state.patboard);
|
||||
patdest = state.patdest;
|
||||
refreshall();
|
||||
};
|
||||
this.saveState = () => {
|
||||
@ -382,7 +496,9 @@ const _BallyAstrocade = function (arcade) {
|
||||
verbl: verbl,
|
||||
rotcount: rotcount,
|
||||
rotdata: rotdata.slice(0),
|
||||
intst: intst
|
||||
intst: intst,
|
||||
patboard: patboard.slice(0),
|
||||
patdest: patdest,
|
||||
};
|
||||
};
|
||||
this.reset = () => {
|
||||
@ -430,6 +546,7 @@ class BallyAstrocade extends devices_1.BasicScanlineMachine {
|
||||
this.cpuFrequency = 1789000;
|
||||
this.numTotalScanlines = 262;
|
||||
this.sampleRate = 60 * 262 * audioOversample;
|
||||
this.arcade = arcade;
|
||||
this.cpu = new ZilogZ80_1.Z80();
|
||||
this.psg = new AstrocadeAudio(new audio_1.MasterAudio());
|
||||
this.audioadapter = new audio_1.TssChannelAdapter(this.psg.psg, audioOversample, this.sampleRate);
|
||||
@ -443,6 +560,12 @@ class BallyAstrocade extends devices_1.BasicScanlineMachine {
|
||||
//this.cpuCyclesPerVisible = this.cpuCyclesPerLine - this.cpuCyclesPerHBlank;
|
||||
this.m = new _BallyAstrocade(arcade);
|
||||
this.m.init(this, this.cpu, this.ram, this.inputs, this.psg);
|
||||
if (arcade) {
|
||||
this.inputs[0x10] = 0xff; // switches (active low)
|
||||
this.inputs[0x11] = 0xff; // switches (active low)
|
||||
this.inputs[0x12] = 0x00;
|
||||
this.inputs[0x13] = 0x08; // dip switches
|
||||
}
|
||||
}
|
||||
read(a) {
|
||||
return this.m.membus.read(a);
|
||||
@ -525,7 +648,17 @@ class BallyAstrocade extends devices_1.BasicScanlineMachine {
|
||||
case 'Astro': return this.m.toLongString(state);
|
||||
}
|
||||
}
|
||||
getRasterCanvasPosition() { return { x: this.getRasterX(), y: this.getRasterY() }; }
|
||||
getRasterCanvasPosition() {
|
||||
return { x: this.getRasterX(), y: this.getRasterY() };
|
||||
}
|
||||
getVideoParams() {
|
||||
if (this.arcade) {
|
||||
return { width: 320, height: 204, rotate: 180 };
|
||||
}
|
||||
else {
|
||||
return { width: 160, height: 102 };
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.BallyAstrocade = BallyAstrocade;
|
||||
/////
|
||||
@ -557,16 +690,6 @@ class AstrocadeAudio extends audio_1.AY38910_Audio {
|
||||
}
|
||||
}
|
||||
}
|
||||
const _BallyArcade = function () {
|
||||
this.__proto__ = new _BallyAstrocade(true);
|
||||
// TODO: inputs[0x13] = 0xfe; // dip switch on arcade
|
||||
// TODO: arcade controls, bit blit
|
||||
var _in = this.saveControlsState();
|
||||
_in.in[0x10] = 0xff; // switches
|
||||
_in.in[0x13] = 0xfe; // dip switches
|
||||
this.loadControlsState(_in);
|
||||
};
|
||||
exports._BallyArcade = _BallyArcade;
|
||||
/////
|
||||
//http://glankonian.com/~lance/astrocade_palette.html
|
||||
var ASTROCADE_PALETTE = [0x000000, 0x242424, 0x484848, 0x6D6D6D, 0x919191, 0xB6B6B6, 0xDADADA, 0xFFFFFF, 0x2500BB, 0x4900E0, 0x6E11FF, 0x9235FF, 0xB75AFF, 0xDB7EFF, 0xFFA3FF, 0xFFC7FF, 0x4900B0, 0x6D00D5, 0x9201F9, 0xB625FF, 0xDA4AFF, 0xFF6EFF, 0xFF92FF, 0xFFB7FF, 0x6A009F, 0x8E00C3, 0xB300E7, 0xD718FF, 0xFB3CFF, 0xFF61FF, 0xFF85FF, 0xFFA9FF, 0x870087, 0xAB00AB, 0xD000D0, 0xF40EF4, 0xFF32FF, 0xFF56FF, 0xFF7BFF, 0xFF9FFF, 0x9F006A, 0xC3008E, 0xE700B3, 0xFF07D7, 0xFF2CFB, 0xFF50FF, 0xFF74FF, 0xFF99FF, 0xB00049, 0xD5006D, 0xF90092, 0xFF05B6, 0xFF29DA, 0xFF4DFF, 0xFF72FF, 0xFF96FF, 0xBB0025, 0xE00049, 0xFF006E, 0xFF0692, 0xFF2AB7, 0xFF4FDB, 0xFF73FF, 0xFF98FF, 0xBF0000, 0xE30024, 0xFF0048, 0xFF0B6D, 0xFF3091, 0xFF54B6, 0xFF79DA, 0xFF9DFF, 0xBB0000, 0xE00000, 0xFF0023, 0xFF1447, 0xFF396C, 0xFF5D90, 0xFF82B5, 0xFFA6D9, 0xB00000, 0xD50000, 0xF90000, 0xFF2124, 0xFF4548, 0xFF6A6C, 0xFF8E91, 0xFFB3B5, 0x9F0000, 0xC30000, 0xE70C00, 0xFF3003, 0xFF5527, 0xFF794B, 0xFF9E70, 0xFFC294, 0x870000, 0xAB0000, 0xD01E00, 0xF44200, 0xFF670A, 0xFF8B2E, 0xFFAF53, 0xFFD477, 0x6A0000, 0x8E0D00, 0xB33100, 0xD75600, 0xFB7A00, 0xFF9E17, 0xFFC33B, 0xFFE75F, 0x490000, 0x6D2100, 0x924500, 0xB66A00, 0xDA8E00, 0xFFB305, 0xFFD729, 0xFFFC4E, 0x251100, 0x493500, 0x6E5A00, 0x927E00, 0xB7A300, 0xDBC700, 0xFFEB1E, 0xFFFF43, 0x002500, 0x244900, 0x486D00, 0x6D9200, 0x91B600, 0xB6DB00, 0xDAFF1B, 0xFFFF3F, 0x003700, 0x005B00, 0x238000, 0x47A400, 0x6CC900, 0x90ED00, 0xB5FF1E, 0xD9FF43, 0x004700, 0x006C00, 0x009000, 0x24B400, 0x48D900, 0x6CFD05, 0x91FF29, 0xB5FF4E, 0x005500, 0x007900, 0x009D00, 0x03C200, 0x27E600, 0x4BFF17, 0x70FF3B, 0x94FF5F, 0x005F00, 0x008300, 0x00A800, 0x00CC00, 0x0AF00A, 0x2EFF2E, 0x53FF53, 0x77FF77, 0x006500, 0x008A00, 0x00AE00, 0x00D203, 0x00F727, 0x17FF4B, 0x3BFF70, 0x5FFF94, 0x006800, 0x008C00, 0x00B100, 0x00D524, 0x00F948, 0x05FF6C, 0x29FF91, 0x4EFFB5, 0x006600, 0x008B00, 0x00AF23, 0x00D447, 0x00F86C, 0x00FF90, 0x1EFFB5, 0x43FFD9, 0x006100, 0x008524, 0x00AA48, 0x00CE6D, 0x00F391, 0x00FFB6, 0x1BFFDA, 0x3FFFFE, 0x005825, 0x007C49, 0x00A16E, 0x00C592, 0x00EAB7, 0x00FFDB, 0x1EFFFF, 0x43FFFF, 0x004B49, 0x00706D, 0x009492, 0x00B9B6, 0x00DDDA, 0x05FFFF, 0x29FFFF, 0x4EFFFF, 0x003C6A, 0x00608E, 0x0085B3, 0x00A9D7, 0x00CEFB, 0x17F2FF, 0x3BFFFF, 0x5FFFFF, 0x002A87, 0x004FAB, 0x0073D0, 0x0097F4, 0x0ABCFF, 0x2EE0FF, 0x53FFFF, 0x77FFFF, 0x00179F, 0x003BC3, 0x0060E7, 0x0384FF, 0x27A8FF, 0x4BCDFF, 0x70F1FF, 0x94FFFF, 0x0002B0, 0x0027D5, 0x004BF9, 0x2470FF, 0x4894FF, 0x6CB9FF, 0x91DDFF, 0xB5FFFF, 0x0000BB, 0x0013E0, 0x2337FF, 0x475BFF, 0x6C80FF, 0x90A4FF, 0xB5C9FF, 0xD9EDFF];
|
||||
|
File diff suppressed because one or more lines are too long
323
gen/machine/exidy.js
Normal file
323
gen/machine/exidy.js
Normal file
@ -0,0 +1,323 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ExidyUGBv2 = void 0;
|
||||
const MOS6502_1 = require("../common/cpu/MOS6502");
|
||||
const devices_1 = require("../common/devices");
|
||||
const emu_1 = require("../common/emu");
|
||||
// https://github.com/mamedev/mame/blob/e9ac85ca86a873c67d6bc8d7cf2e37bc7696b379/src/mame/exidy/exidy.cpp#L327
|
||||
// http://www.arcaderestoration.com/games/9089/Targ.aspx
|
||||
// http://www.arcaderestoration.com/memorymap/9089/Targ.aspx
|
||||
// http://www.arcaderestoration.com/memorymap/3933/Hard+Hat.aspx
|
||||
// https://github.com/mamedev/mame/blob/74c4a0c3774e3aeb4895eb13f3c47773d34ce270/src/mame/shared/exidysound.cpp#L13
|
||||
const EXIDY_KEYCODE_MAP = (0, emu_1.makeKeycodeMap)([
|
||||
[emu_1.Keys.START, 1, -0x1],
|
||||
//[Keys.START, 1, -0x2],
|
||||
[emu_1.Keys.RIGHT, 1, -0x4],
|
||||
[emu_1.Keys.LEFT, 1, -0x8],
|
||||
[emu_1.Keys.A, 1, -0x10],
|
||||
[emu_1.Keys.UP, 1, -0x20],
|
||||
[emu_1.Keys.DOWN, 1, -0x40],
|
||||
[emu_1.Keys.SELECT, 1, -0x80],
|
||||
]);
|
||||
/*
|
||||
ROM layout:
|
||||
0x0000 - 0x5fff: program ROM
|
||||
0x6000 - 0x67ff: sprite ROM
|
||||
0x6800 - 0x7fff: audio ROM
|
||||
*/
|
||||
class ExidyUGBv2 extends devices_1.BasicScanlineMachine {
|
||||
constructor() {
|
||||
super();
|
||||
this.cpuFrequency = 705562;
|
||||
this.sampleRate = 894886;
|
||||
this.numVisibleScanlines = 256;
|
||||
this.numTotalScanlines = 262;
|
||||
this.cpuCyclesPerLine = 0x150 >> 3;
|
||||
this.canvasWidth = 256;
|
||||
this.defaultROMSize = 0x8000 + 0x800 + 0x2800; // PRG + CHR + SOUND
|
||||
this.cpu = new MOS6502_1.MOS6502();
|
||||
this.ram = new Uint8Array(0x7000);
|
||||
this.color_latch = [0x54, 0xee, 0x6b]; // RGB
|
||||
this.palette = [
|
||||
0xff000000, 0xff0000ff, 0xffff0000, 0xffff00ff,
|
||||
0xff00ff00, 0xff00ffff, 0xffffff00, 0xffffffff,
|
||||
];
|
||||
this.inputs = new Uint8Array(4);
|
||||
this.keyMap = EXIDY_KEYCODE_MAP;
|
||||
this.handler = (0, emu_1.newKeyboardHandler)(this.inputs, this.keyMap); /*, (o,k,c,f) => {
|
||||
// coin inserted?
|
||||
if (o.index == 1 && o.mask == 128 && (f & KeyFlags.KeyDown)) {
|
||||
this.inputs[3] |= 0x40;
|
||||
//this.cpu.IRQ();
|
||||
//this.ram[0xa2] += 8; // TODO
|
||||
}
|
||||
});
|
||||
*/
|
||||
this.scrnbase = 0x4000;
|
||||
this.charbase = 0x6800;
|
||||
this.bus = {
|
||||
read: (0, emu_1.newAddressDecoder)([
|
||||
[0x0000, 0x03ff, 0, (a) => { return this.ram[a]; }],
|
||||
[0x1000, 0x3fff, 0, (a) => { return this.rom[a - 0x1000]; }],
|
||||
[0x4000, 0x4fff, 0, (a) => { return this.ram[a]; }],
|
||||
[0x5100, 0x51ff, 0x03, (a) => { return a == 3 ? this.int_latch() : this.inputs[a]; }],
|
||||
[0x6000, 0x6fff, 0, (a) => { return this.ram[a]; }],
|
||||
[0x8000, 0xffff, 0, (a) => { return this.rom[a - 0x8000]; }],
|
||||
]),
|
||||
write: (0, emu_1.newAddressDecoder)([
|
||||
[0x0000, 0x03ff, 0, (a, v) => { this.ram[a] = v; }],
|
||||
[0x4000, 0x4fff, 0, (a, v) => { this.ram[a] = v; }],
|
||||
[0x5000, 0x5101, 0, (a, v) => { this.ram[a] = v; }],
|
||||
[0x5210, 0x5212, 3, (a, v) => { this.setColorLatch(a, v); }],
|
||||
[0x6000, 0x6fff, 0, (a, v) => { this.ram[a] = v; }],
|
||||
]),
|
||||
};
|
||||
this.connectCPUMemoryBus(this);
|
||||
this.updatePalette();
|
||||
this.inputs[0] = 0b11101010; // dip switch
|
||||
this.inputs[1] = 0b11111111; // active low
|
||||
}
|
||||
loadROM(rom) {
|
||||
super.loadROM(rom);
|
||||
if (rom.length < 0x8000) {
|
||||
if (rom.length == 11616) { // targ
|
||||
this.rom.set(rom.slice(0x2800, 0x3000), 0x8000); // copy sprites
|
||||
this.rom.set(rom.slice(0x2700, 0x2800), 0x7f00); // copy ff00-ffff
|
||||
this.rom.set(rom.slice(0x0000, 0x2800), 0x0800); // ROM starts @ 0x1800
|
||||
this.scrnbase = 0x4000;
|
||||
this.charbase = 0x4800;
|
||||
}
|
||||
else if (rom.length == 14336) { // spectar
|
||||
this.rom.set(rom.slice(0x3400, 0x3800), 0x8000); // copy sprites
|
||||
this.rom.set(rom.slice(0x2f00, 0x3000), 0x7f00); // copy ff00-ffff
|
||||
this.scrnbase = 0x4000;
|
||||
this.charbase = 0x4800;
|
||||
}
|
||||
else {
|
||||
console.log("Warning: ROM is too small", rom.length);
|
||||
}
|
||||
}
|
||||
let sprite_ofs = 0x8000;
|
||||
this.sprite_gfx = this.rom.subarray(sprite_ofs, sprite_ofs + 32 * 32);
|
||||
}
|
||||
read(a) {
|
||||
return this.bus.read(a);
|
||||
}
|
||||
readConst(a) {
|
||||
if (a == 0x5103)
|
||||
return this.inputs[3];
|
||||
return this.bus.read(a);
|
||||
}
|
||||
write(a, v) {
|
||||
this.bus.write(a, v);
|
||||
}
|
||||
int_latch() {
|
||||
let intsrc = this.inputs[3];
|
||||
intsrc |= (this.inputs[1] & 0x80) ? 0 : 0x40; // coin 1
|
||||
this.inputs[3] = 0x80; // clear int latch
|
||||
return intsrc; // TODO
|
||||
}
|
||||
updatePalette() {
|
||||
/* motion object 1 */
|
||||
this.set_1_color(0, 0);
|
||||
this.set_1_color(1, 7);
|
||||
/* motion object 2 */
|
||||
this.set_1_color(2, 0);
|
||||
this.set_1_color(3, 6);
|
||||
/* characters */
|
||||
this.set_1_color(4, 4);
|
||||
this.set_1_color(5, 3);
|
||||
this.set_1_color(6, 2);
|
||||
this.set_1_color(7, 1);
|
||||
}
|
||||
set_1_color(index, dipsw) {
|
||||
let r = (this.color_latch[0] & (1 << dipsw)) ? 1 : 0;
|
||||
let g = (this.color_latch[1] & (1 << dipsw)) ? 2 : 0;
|
||||
let b = (this.color_latch[2] & (1 << dipsw)) ? 4 : 0;
|
||||
this.palette[index] = RGB8[r | g | b];
|
||||
}
|
||||
setColorLatch(a, v) {
|
||||
this.color_latch[a & 3] = v;
|
||||
this.updatePalette();
|
||||
}
|
||||
drawSprite(xpos, ypos, ofs, palind) {
|
||||
var sx = 236 - xpos - 4;
|
||||
var sy = 244 - ypos - 4;
|
||||
/*
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
|
||||
((*m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1,
|
||||
0, 0, sx, sy, 0);*/
|
||||
sy += 15;
|
||||
sy -= this.scanline;
|
||||
if (sy >= 0 && sy < 16) {
|
||||
sy = 15 - sy;
|
||||
//console.log("draw sprite", sx, sy, ofs);
|
||||
let yofs = this.scanline * this.canvasWidth;
|
||||
let pix = this.sprite_gfx[ofs + sy];
|
||||
for (let x = 0; x < 8; x++) {
|
||||
if (pix & (0x80 >> x)) {
|
||||
this.pixels[yofs + sx + x] = this.palette[palind];
|
||||
}
|
||||
}
|
||||
pix = this.sprite_gfx[ofs + sy + 16];
|
||||
for (let x = 0; x < 8; x++) {
|
||||
if (pix & (0x80 >> x)) {
|
||||
this.pixels[yofs + sx + x + 8] = this.palette[palind];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
drawSprite1() {
|
||||
let xpos = this.ram[0x5000];
|
||||
let ypos = this.ram[0x5040];
|
||||
let set = (this.ram[0x5101] & 0x20) ? 1 : 0;
|
||||
let sprite = (this.ram[0x5100] & 0x0f) + 16 * set;
|
||||
this.drawSprite(xpos, ypos, sprite * 32, 1);
|
||||
}
|
||||
drawSprite2() {
|
||||
let xpos = this.ram[0x5080];
|
||||
let ypos = this.ram[0x50c0];
|
||||
let set = (this.ram[0x5101] & 0x40) ? 1 : 0;
|
||||
let sprite = (this.ram[0x5100] >> 4) + 16 * set;
|
||||
this.drawSprite(xpos, ypos, sprite * 32, 3);
|
||||
}
|
||||
startScanline() {
|
||||
}
|
||||
drawScanline() {
|
||||
const y = this.scanline;
|
||||
const row = y >> 3;
|
||||
const yofs = y * this.canvasWidth;
|
||||
for (let x = 0; x < 256; x++) {
|
||||
const col = x >> 3;
|
||||
let code = this.ram[this.scrnbase + row * 32 + col];
|
||||
let color1 = 4 + ((code >> 6) & 0x03);
|
||||
let pix = this.ram[this.charbase + code * 8 + (y & 7)];
|
||||
let palind = (pix & (0x80 >> (x & 7))) ? color1 : 0;
|
||||
this.pixels[yofs + x] = this.palette[palind];
|
||||
}
|
||||
this.drawSprite2();
|
||||
this.drawSprite1();
|
||||
}
|
||||
postFrame() {
|
||||
this.inputs[3] &= 0x7f; // TODO?
|
||||
this.cpu.IRQ();
|
||||
}
|
||||
getVideoParams() {
|
||||
return { width: 256, height: 256, aspect: 6 / 5 };
|
||||
}
|
||||
}
|
||||
exports.ExidyUGBv2 = ExidyUGBv2;
|
||||
const RGB8 = [
|
||||
0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
|
||||
0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff,
|
||||
];
|
||||
/*
|
||||
0000-00FF R/W Zero Page RAM
|
||||
0100-01FF R/W Stack RAM
|
||||
0200-03FF R/W Scratchpad RAM
|
||||
0800-3FFF R Program ROM (Targ, Spectar only)
|
||||
1A00 R PX3 (Player 2 inputs) (Fax only)
|
||||
bit 4 D
|
||||
bit 5 C
|
||||
bit 6 B
|
||||
bit 7 A
|
||||
1C00 R PX2 (Player 1 inputs) (Fax only)
|
||||
bit 0 2 player start
|
||||
bit 1 1 player start
|
||||
bit 4 D
|
||||
bit 5 C
|
||||
bit 6 B
|
||||
bit 7 A
|
||||
2000-3FFF R Banked question ROM (Fax only)
|
||||
4000-43FF R/W Screen RAM
|
||||
4800-4FFF R/W Character Generator RAM (except Pepper II and Fax)
|
||||
5000 W Motion Object 1 Horizontal Position Latch (sprite 1 X)
|
||||
5040 W Motion Object 1 Vertical Position Latch (sprite 1 Y)
|
||||
5080 W Motion Object 2 Horizontal Position Latch (sprite 2 X)
|
||||
50C0 W Motion Object 2 Vertical Position Latch (sprite 2 Y)
|
||||
5100 R Option Dipswitch Port
|
||||
bit 0 coin 2 (NOT inverted) (must activate together with $5103 bit 5)
|
||||
bit 1-2 bonus
|
||||
bit 3-4 coins per play
|
||||
bit 5-6 lives
|
||||
bit 7 US/UK coins
|
||||
5100 W Motion Objects Image Latch
|
||||
Sprite number bits 0-3 Sprite #1 4-7 Sprite #2
|
||||
5101 R Control Inputs Port
|
||||
bit 0 start 1
|
||||
bit 1 start 2
|
||||
bit 2 right
|
||||
bit 3 left
|
||||
bit 5 up
|
||||
bit 6 down
|
||||
bit 7 coin 1 (must activate together with $5103 bit 6)
|
||||
5101 W Output Control Latch (not used in PEPPER II upright)
|
||||
bit 7 Enable sprite #1
|
||||
bit 6 Enable sprite #2
|
||||
5103 R Interrupt Condition Latch
|
||||
bit 0 LNG0 - supposedly a language DIP switch
|
||||
bit 1 LNG1 - supposedly a language DIP switch
|
||||
bit 2 different for each game, but generally a collision bit
|
||||
bit 3 TABLE - supposedly a cocktail table DIP switch
|
||||
bit 4 different for each game, but generally a collision bit
|
||||
bit 5 coin 2 (must activate together with $5100 bit 0)
|
||||
bit 6 coin 1 (must activate together with $5101 bit 7)
|
||||
bit 7 L256 - VBlank?
|
||||
5213 R IN2 (Mouse Trap)
|
||||
bit 3 blue button
|
||||
bit 2 free play
|
||||
bit 1 red button
|
||||
bit 0 yellow button
|
||||
52XX R/W Audio/Color Board Communications
|
||||
6000-6FFF R/W Character Generator RAM (Pepper II, Fax only)
|
||||
8000-FFF9 R Program memory space
|
||||
FFFA-FFFF R Interrupt and Reset Vectors
|
||||
|
||||
Exidy Sound Board:
|
||||
0000-07FF R/W RAM (mirrored every 0x7f)
|
||||
0800-0FFF R/W 6532 Timer
|
||||
1000-17FF R/W 6520 PIA
|
||||
1800-1FFF R/W 8253 Timer
|
||||
2000-27FF bit 0 Channel 1 Filter 1 enable
|
||||
bit 1 Channel 1 Filter 2 enable
|
||||
bit 2 Channel 2 Filter 1 enable
|
||||
bit 3 Channel 2 Filter 2 enable
|
||||
bit 4 Channel 3 Filter 1 enable
|
||||
bit 5 Channel 3 Filter 2 enable
|
||||
2800-2FFF 6840 Timer
|
||||
3000 Bit 0..1 Noise select
|
||||
3001 Bit 0..2 Channel 1 Amplitude
|
||||
3002 Bit 0..2 Channel 2 Amplitude
|
||||
3003 Bit 0..2 Channel 3 Amplitude
|
||||
5800-7FFF ROM
|
||||
|
||||
Targ:
|
||||
5200 Sound board control
|
||||
bit 0 Music
|
||||
bit 1 Shoot
|
||||
bit 2 unused
|
||||
bit 3 Swarn
|
||||
bit 4 Sspec
|
||||
bit 5 crash
|
||||
bit 6 long
|
||||
bit 7 game
|
||||
|
||||
5201 Sound board control
|
||||
bit 0 note
|
||||
bit 1 upper
|
||||
|
||||
MouseTrap:
|
||||
5101 W MouseTrap P1/P2 LED States
|
||||
bit 2 Player 1 LED state
|
||||
bit 4 Player 2 LED state
|
||||
|
||||
MouseTrap Digital Sound:
|
||||
0000-3FFF ROM
|
||||
|
||||
IO:
|
||||
A7 = 0: R Communication from sound processor
|
||||
A6 = 0: R CVSD Clock State
|
||||
A5 = 0: W Busy to sound processor
|
||||
A4 = 0: W Data to CVSD
|
||||
*/
|
||||
//# sourceMappingURL=exidy.js.map
|
1
gen/machine/exidy.js.map
Normal file
1
gen/machine/exidy.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -37,6 +37,7 @@ function importPlatform(name) {
|
||||
case "coleco": return Promise.resolve().then(() => __importStar(require("../platform/coleco")));
|
||||
case "cpc": return Promise.resolve().then(() => __importStar(require("../platform/cpc")));
|
||||
case "devel": return Promise.resolve().then(() => __importStar(require("../platform/devel")));
|
||||
case "exidy": return Promise.resolve().then(() => __importStar(require("../platform/exidy")));
|
||||
case "galaxian": return Promise.resolve().then(() => __importStar(require("../platform/galaxian")));
|
||||
case "kim1": return Promise.resolve().then(() => __importStar(require("../platform/kim1")));
|
||||
case "markdown": return Promise.resolve().then(() => __importStar(require("../platform/markdown")));
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"_index.js","sourceRoot":"","sources":["../../src/platform/_index.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,SAAgB,cAAc,CAAC,IAAY;IACvC,QAAQ,I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: 'bios.c', name: 'BIOS' },
|
||||
];
|
||||
const ASTROCADE_ARCADE_PRESETS = [
|
||||
{ id: 'hello.c', name: 'Hello Graphics' },
|
||||
];
|
||||
class BallyAstrocadePlatform extends baseplatform_1.BaseZ80MachinePlatform {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
@ -51,12 +54,15 @@ class BallyArcadePlatform extends BallyAstrocadePlatform {
|
||||
super(...arguments);
|
||||
this.getMemoryMap = function () {
|
||||
return { main: [
|
||||
{ name: 'ROM', start: 0x0, size: 0x4000, type: 'rom' },
|
||||
{ name: 'Magic RAM', start: 0x0, size: 0x4000, type: 'ram' },
|
||||
{ name: 'Screen RAM', start: 0x4000, size: 0x4000, type: 'ram' },
|
||||
{ name: 'ROM', start: 0x8000, size: 0x4000, type: 'rom' },
|
||||
] };
|
||||
};
|
||||
}
|
||||
newMachine() { return new astrocade_1.BallyAstrocade(true); }
|
||||
getPresets() { return ASTROCADE_ARCADE_PRESETS; }
|
||||
}
|
||||
emu_1.PLATFORMS['astrocade'] = BallyAstrocadePlatform;
|
||||
emu_1.PLATFORMS['astrocade-bios'] = BallyAstrocadeBIOSPlatform;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"astrocade.js","sourceRoot":"","sources":["../../src/platform/astrocade.ts"],"names":[],"mappings":";;AACA,oDAAsD;AACtD,yDAAgE;AAEhE,uCAA0C;AAE1C,iDAAiD;AAEjD,MAAM,iBAAiB,GAAG;IACxB,EAAE,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,mBAAmB,EAAE;IACvD,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACnD,EAAE,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,mBAAmB,EAAE;IACpD,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACzC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;IAChC,EAAE,EAA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KAAK,EAAC;oBACvD,EAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,EAAC;iBACnD,EAAE,CAAA;QAAC,CAAC,CAAC;IACR,CAAC;IATC,UAAU,KAAc,OAAO,IAAI,0BAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1D,UAAU,KAAc,OAAO,wBAAwB,CAAC,CAAC,CAAC;CAQ3D;AAED,eAAS,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC;AAChD,eAAS,CAAC,gBAAgB,CAAC,GAAG,0BAA0B,CAAC;AACzD,eAAS,CAAC,kBAAkB,CAAC,GAAG,mBAAmB,CAAC"}
|
31
gen/platform/exidy.js
Normal file
31
gen/platform/exidy.js
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const baseplatform_1 = require("../common/baseplatform");
|
||||
const emu_1 = require("../common/emu");
|
||||
const exidy_1 = require("../machine/exidy");
|
||||
var EXIDY_PRESETS = [
|
||||
{ id: 'minimal.c', name: 'Minimal Example', category: "C" },
|
||||
];
|
||||
class ExidyUGBPlatform extends baseplatform_1.Base6502MachinePlatform {
|
||||
newMachine() { return new exidy_1.ExidyUGBv2(); }
|
||||
getPresets() { return EXIDY_PRESETS; }
|
||||
getDefaultExtension() { return ".dasm"; }
|
||||
;
|
||||
readAddress(a) { return this.machine.readConst(a); }
|
||||
getMemoryMap() {
|
||||
return { main: [
|
||||
{ name: 'RAM', start: 0x00, size: 0x400, type: 'ram' },
|
||||
{ name: 'Sprite I/O', start: 0x5000, size: 0x100, type: 'io' },
|
||||
{ name: 'I/O', start: 0x5100, size: 0x3, type: 'io' },
|
||||
{ name: 'PIA 6821', start: 0x5200, size: 0xf, type: 'io' },
|
||||
{ name: 'Color Latches', start: 0x5210, size: 0x3, type: 'io' },
|
||||
{ name: 'Screen RAM', start: 0x4000, size: 0x400, type: 'ram' },
|
||||
{ name: 'Character RAM', start: 0x6800, size: 0x800, type: 'ram' },
|
||||
{ name: 'Audio ROM', start: 0x5800, size: 0x2800, type: 'rom' },
|
||||
{ name: 'Program ROM', start: 0x8000, size: 0x8000, type: 'rom' },
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
emu_1.PLATFORMS["exidy"] = ExidyUGBPlatform;
|
||||
//# sourceMappingURL=exidy.js.map
|
1
gen/platform/exidy.js.map
Normal file
1
gen/platform/exidy.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"exidy.js","sourceRoot":"","sources":["../../src/platform/exidy.ts"],"names":[],"mappings":";;AAAA,yDAA2E;AAC3E,uCAA0C;AAC1C,4CAA8C;AAE9C,IAAI,aAAa,GAAG;IAChB,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,EAAE;CAC9D,CAAC;AAEF,MAAM,gBAAiB,SAAQ,sCAAmC;IAE9D,UAAU,KAAK,OAAO,IAAI,kBAAU,EAAE,CAAC,CAAC,CAAC;IACzC,UAAU,KAAK,OAAO,aAAa,CAAC,CAAC,CAAC;IACtC,mBAAmB,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC;IAAA,CAAC;IAC1C,WAAW,CAAC,CAAC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,YAAY;QACR,OAAO,EAAE,IAAI,EAAE;gBACX,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;gBACtD,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC9D,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE;gBACrD,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC1D,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC/D,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;gBAC/D,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;gBAClE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE;gBAC/D,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE;aACpE;SACJ,CAAA;IAAC,CAAC;CACN;AAED,eAAS,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAAC"}
|
@ -1,2 +1,2 @@
|
||||
import{A as z,B as A,C as B,D as C,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"./chunk-JMPDXGK5.js";import"./chunk-SDBJC2RS.js";import"./chunk-XMPGMPQ4.js";import"./chunk-NFHWZ4B3.js";import"./chunk-42IVW2OL.js";import"./chunk-S4FPTY4A.js";import"./chunk-RQFURXHW.js";export{q as clearBreakpoint,f as current_project,A as emulationHalted,n as getCurrentEditorFilename,m as getCurrentMainFilename,k as getCurrentOutput,j as getCurrentProject,v as getPlatformAndRepo,i as getPlatformStore,z as getSaveState,y as getTestOutput,l as getWorkerParams,t as gotoNewLocation,s as haltEmulation,C as highlightSearch,h as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,B as reloadWorkspaceFile,d as repo_id,p as runToPC,r as setFrameRateUI,x as setTestInput,o as setupBreakpoint,u as setupSplits,w as startUI,c as store_id};
|
||||
import{A as z,B as A,C as B,D as C,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"./chunk-W3JZ7KMT.js";import"./chunk-SDBJC2RS.js";import"./chunk-XMPGMPQ4.js";import"./chunk-2KLMJIHE.js";import"./chunk-42IVW2OL.js";import"./chunk-S4FPTY4A.js";import"./chunk-RQFURXHW.js";export{q as clearBreakpoint,f as current_project,A as emulationHalted,n as getCurrentEditorFilename,m as getCurrentMainFilename,k as getCurrentOutput,j as getCurrentProject,v as getPlatformAndRepo,i as getPlatformStore,z as getSaveState,y as getTestOutput,l as getWorkerParams,t as gotoNewLocation,s as haltEmulation,C as highlightSearch,h as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,B as reloadWorkspaceFile,d as repo_id,p as runToPC,r as setFrameRateUI,x as setTestInput,o as setupBreakpoint,u as setupSplits,w as startUI,c as store_id};
|
||||
//# sourceMappingURL=ui.js.map
|
||||
|
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fixParamsWithDefines = exports.anyTargetChanged = exports.staleFiles = exports.populateExtraFiles = exports.populateFiles = exports.getPrefix = exports.gatherFiles = exports.populateEntry = exports.getWorkFileAsString = exports.putWorkFile = exports.endtime = exports.starttime = exports.builder = exports.Builder = exports.errorResult = exports.store = exports.FileWorkingStore = exports.PWORKER = void 0;
|
||||
exports.processEmbedDirective = exports.fixParamsWithDefines = exports.anyTargetChanged = exports.staleFiles = exports.populateExtraFiles = exports.populateFiles = exports.getPrefix = exports.gatherFiles = exports.populateEntry = exports.getWorkFileAsString = exports.putWorkFile = exports.endtime = exports.starttime = exports.builder = exports.Builder = exports.errorResult = exports.store = exports.FileWorkingStore = exports.PWORKER = void 0;
|
||||
const util_1 = require("../common/util");
|
||||
const platforms_1 = require("./platforms");
|
||||
const workertools_1 = require("./workertools");
|
||||
@ -383,4 +383,21 @@ function fixParamsWithDefines(path, params) {
|
||||
}
|
||||
}
|
||||
exports.fixParamsWithDefines = fixParamsWithDefines;
|
||||
function processEmbedDirective(code) {
|
||||
let re3 = /^\s*#embed\s+"(.+?)"/gm;
|
||||
// find #embed "filename.bin" and replace with C array data
|
||||
return code.replace(re3, (m, m1) => {
|
||||
let filename = m1;
|
||||
let filedata = exports.store.getFileData(filename);
|
||||
let bytes = (0, util_1.convertDataToUint8Array)(filedata);
|
||||
if (!bytes)
|
||||
throw new Error('#embed: file not found: "' + filename + '"');
|
||||
let out = '';
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
out += bytes[i].toString() + ',';
|
||||
}
|
||||
return out.substring(0, out.length - 1);
|
||||
});
|
||||
}
|
||||
exports.processEmbedDirective = processEmbedDirective;
|
||||
//# sourceMappingURL=builder.js.map
|
File diff suppressed because one or more lines are too long
@ -5523,6 +5523,12 @@
|
||||
define: ["__PCE__"],
|
||||
cfgfile: "pce.cfg",
|
||||
libargs: ["pce.lib", "-D", "__CARTSIZE__=0x8000"]
|
||||
},
|
||||
"exidy": {
|
||||
define: ["__EXIDY__"],
|
||||
cfgfile: "exidy.cfg",
|
||||
libargs: ["crt0.o", "none.lib"],
|
||||
extra_link_files: ["crt0.o", "exidy.cfg"]
|
||||
}
|
||||
};
|
||||
PLATFORM_PARAMS["sms-sms-libcv"] = PLATFORM_PARAMS["sms-sg1000-libcv"];
|
||||
@ -5865,6 +5871,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
function processEmbedDirective(code) {
|
||||
let re3 = /^\s*#embed\s+"(.+?)"/gm;
|
||||
return code.replace(re3, (m, m1) => {
|
||||
let filename = m1;
|
||||
let filedata = store.getFileData(filename);
|
||||
let bytes = convertDataToUint8Array(filedata);
|
||||
if (!bytes)
|
||||
throw new Error('#embed: file not found: "' + filename + '"');
|
||||
let out = "";
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
out += bytes[i].toString() + ",";
|
||||
}
|
||||
return out.substring(0, out.length - 1);
|
||||
});
|
||||
}
|
||||
|
||||
// src/worker/wasmutils.ts
|
||||
var ENVIRONMENT_IS_WEB = typeof window === "object";
|
||||
@ -5988,6 +6009,8 @@
|
||||
name = "65-none";
|
||||
if (name === "65-vcs")
|
||||
name = "65-atari2600";
|
||||
if (name === "65-exidy")
|
||||
name = "65-none";
|
||||
if (!fsMeta[name])
|
||||
throw Error("No filesystem for '" + name + "'");
|
||||
FS.mkdir("/share");
|
||||
@ -6569,21 +6592,6 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
function processIncbin(code) {
|
||||
let re3 = /^\s*#embed\s+"(.+?)"/gm;
|
||||
return code.replace(re3, (m, m1) => {
|
||||
let filename = m1;
|
||||
let filedata = store.getFileData(filename);
|
||||
let bytes = convertDataToUint8Array(filedata);
|
||||
if (!bytes)
|
||||
throw new Error('#embed: file not found: "' + filename + '"');
|
||||
let out = "";
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
out += bytes[i].toString() + ",";
|
||||
}
|
||||
return out;
|
||||
});
|
||||
}
|
||||
function compileCC65(step) {
|
||||
loadNative("cc65");
|
||||
var params = step.params;
|
||||
@ -6617,7 +6625,7 @@
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === "string") {
|
||||
code = processIncbin(code);
|
||||
code = processEmbedDirective(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
@ -7505,7 +7513,15 @@
|
||||
var FS = MCPP.FS;
|
||||
if (filesys)
|
||||
setupFS(FS, filesys);
|
||||
populateFiles(step, FS);
|
||||
populateFiles(step, FS, {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === "string") {
|
||||
code = processEmbedDirective(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
});
|
||||
populateExtraFiles(step, FS, params.extra_compile_files);
|
||||
var args = [
|
||||
"-D",
|
||||
@ -7682,6 +7698,9 @@
|
||||
args.push.apply(args, params.extra_link_args);
|
||||
args.push.apply(args, step.args);
|
||||
execMain(step, LDZ80, args);
|
||||
if (errors.length) {
|
||||
return { errors };
|
||||
}
|
||||
var hexout = FS.readFile("main.ihx", { encoding: "utf8" });
|
||||
var noiout = FS.readFile("main.noi", { encoding: "utf8" });
|
||||
putWorkFile("main.ihx", hexout);
|
||||
@ -13474,6 +13493,8 @@ ${this.scopeSymbol(name)} = ${name}::__Start`;
|
||||
"ca65-vcs": "65-atari2600",
|
||||
"cc65-pce": "65-pce",
|
||||
"ca65-pce": "65-pce",
|
||||
"cc65-exidy": "65-none",
|
||||
"ca65-exidy": "65-none",
|
||||
"sdasz80": "sdcc",
|
||||
"sdcc": "sdcc",
|
||||
"sccz80": "sccz80",
|
||||
|
File diff suppressed because one or more lines are too long
@ -329,6 +329,13 @@ exports.PLATFORM_PARAMS = {
|
||||
cfgfile: 'pce.cfg',
|
||||
libargs: ['pce.lib', '-D', '__CARTSIZE__=0x8000'],
|
||||
},
|
||||
'exidy': {
|
||||
define: ['__EXIDY__'],
|
||||
cfgfile: 'exidy.cfg',
|
||||
libargs: ['crt0.o', 'none.lib'],
|
||||
extra_link_files: ['crt0.o', 'exidy.cfg'],
|
||||
//extra_compile_files: ['exidy.h'],
|
||||
},
|
||||
};
|
||||
exports.PLATFORM_PARAMS['sms-sms-libcv'] = exports.PLATFORM_PARAMS['sms-sg1000-libcv'];
|
||||
exports.PLATFORM_PARAMS['sms-gg-libcv'] = exports.PLATFORM_PARAMS['sms-sms-libcv'];
|
||||
|
File diff suppressed because one or more lines are too long
@ -278,22 +278,6 @@ function linkLD65(step) {
|
||||
}
|
||||
}
|
||||
exports.linkLD65 = linkLD65;
|
||||
function processIncbin(code) {
|
||||
let re3 = /^\s*#embed\s+"(.+?)"/gm;
|
||||
// find #embed "filename.bin" and replace with C array data
|
||||
return code.replace(re3, (m, m1) => {
|
||||
let filename = m1;
|
||||
let filedata = builder_1.store.getFileData(filename);
|
||||
let bytes = (0, util_1.convertDataToUint8Array)(filedata);
|
||||
if (!bytes)
|
||||
throw new Error('#embed: file not found: "' + filename + '"');
|
||||
let out = '';
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
out += bytes[i].toString() + ',';
|
||||
}
|
||||
return out;
|
||||
});
|
||||
}
|
||||
function compileCC65(step) {
|
||||
(0, wasmutils_1.loadNative)("cc65");
|
||||
var params = step.params;
|
||||
@ -329,7 +313,7 @@ function compileCC65(step) {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === 'string') {
|
||||
code = processIncbin(code);
|
||||
code = (0, builder_1.processEmbedDirective)(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -27,7 +27,15 @@ function preprocessMCPP(step, filesys) {
|
||||
var FS = MCPP.FS;
|
||||
if (filesys)
|
||||
(0, wasmutils_1.setupFS)(FS, filesys);
|
||||
(0, builder_1.populateFiles)(step, FS);
|
||||
(0, builder_1.populateFiles)(step, FS, {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === 'string') {
|
||||
code = (0, builder_1.processEmbedDirective)(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
});
|
||||
(0, builder_1.populateExtraFiles)(step, FS, params.extra_compile_files);
|
||||
// TODO: make configurable by other compilers
|
||||
var args = [
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"mcpp.js","sourceRoot":"","sources":["../../../src/worker/tools/mcpp.ts"],"names":[],"mappings":";;;AAAA,4CAAoD;AACpD,wCAAuF;AACvF,kDAAkE;AAClE,4CAA+C;AAC/C,4CAA6F;AAE7F,SAAS,W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AAM,EAAE,MAAM,EAAE,CAAC;IAC9B,IAAI,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACvD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACzC,IAAI;QACA,IAAI,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3D,IAAI,MAAM,CAAC,MAAM,EAAE;YACf,yDAAyD;YACzD,IAAI,MAAM,GAAG,IAAA,4BAAa,EAAC,qBAAqB,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1F,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,MAAM,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,CAAC,MAAM,CAAC;aACvC;YACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SAC7B;KACJ;IAAC,OAAO,CAAC,EAAE;QACR,EAAE;KACL;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC;AA7DD,wCA6DC"}
|
@ -149,6 +149,9 @@ function linkSDLDZ80(step) {
|
||||
args.push.apply(args, step.args);
|
||||
//console.log(args);
|
||||
(0, wasmutils_1.execMain)(step, LDZ80, args);
|
||||
if (errors.length) {
|
||||
return { errors: errors };
|
||||
}
|
||||
var hexout = FS.readFile("main.ihx", { encoding: 'utf8' });
|
||||
var noiout = FS.readFile("main.noi", { encoding: 'utf8' });
|
||||
(0, builder_1.putWorkFile)("main.ihx", hexout);
|
||||
|
File diff suppressed because one or more lines are too long
@ -148,6 +148,8 @@ function setupFS(FS, name) {
|
||||
name = '65-none'; // TODO
|
||||
if (name === '65-vcs')
|
||||
name = '65-atari2600'; // TODO
|
||||
if (name === '65-exidy')
|
||||
name = '65-none'; // TODO
|
||||
if (!exports.fsMeta[name])
|
||||
throw Error("No filesystem for '" + name + "'");
|
||||
FS.mkdir('/share');
|
||||
|
File diff suppressed because one or more lines are too long
@ -97,6 +97,8 @@ exports.TOOL_PRELOADFS = {
|
||||
'ca65-vcs': '65-atari2600',
|
||||
'cc65-pce': '65-pce',
|
||||
'ca65-pce': '65-pce',
|
||||
'cc65-exidy': '65-none',
|
||||
'ca65-exidy': '65-none',
|
||||
'sdasz80': 'sdcc',
|
||||
'sdcc': 'sdcc',
|
||||
'sccz80': 'sccz80',
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"workertools.js","sourceRoot":"","sources":["../../src/worker/workertools.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAoC;AACpC,mDAAoC;AACpC,mDAAoC;AACpC,mDAAoC;AACpC,yDAA0C;AAC1C,qDAAsC;AACtC,qDAAsC;AACtC,iDAAkC;AAClC,iDAAkC;AAClC,iDAAkC;AAClC,iDAAkC;AAClC,uDAAwC;AACxC,mDAAoC;AACpC,uDAAwC;AACxC,iEAAkD;AAGrC,QAAA,KAAK,GAAG;IACnB,MAAM,EAAE,IAAI,CAAC,YAAY;IACzB,MAAM,EAAE,IAAI,CAAC,YAAY;IACzB,MAAM,EAAE,IAAI,CAAC,WAAW;IACxB,MAAM,EAAE,IAAI,CAAC,YAAY;IACzB,MAAM,EAAE,IAAI,CAAC,QAAQ;IACrB,2BAA2B;IAC3B,0BAA0B;IAC1B,SAAS,EAAE,IAAI,CAAC,eAAe;IAC/B,SAAS,EAAE,IAAI,CAAC,WAAW;IAC3B,MAAM,EAAE,IAAI,CAAC,WAAW;IACxB,UAAU,EAAE,KAAK,CAAC,gBAAgB;IAClC,MAAM,EAAE,KAAK,CAAC,WAAW;IACzB,OAAO,EAAE,KAAK,CAAC,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC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;IAC1B,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,aAAa,EAAE,WAAW;IAC1B,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,cAAc;IACzB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ,EAAE,mCAAmC;CACzD,CAAA"}
|
@ -1,9 +1,12 @@
|
||||
|
||||
VIC_BASE = $0
|
||||
VIC_SCRN_BASE = VIC_BASE + $400
|
||||
|
||||
MAX_MSPRITES = 28
|
||||
|
||||
MIN_Y_SPACING = 35
|
||||
|
||||
DEBUG = 1
|
||||
DEBUG = 0
|
||||
|
||||
.code
|
||||
|
||||
@ -31,7 +34,7 @@ _msprite_render_section:
|
||||
adc #MIN_Y_SPACING
|
||||
sta bailout_line
|
||||
@loop:
|
||||
.ifdef DEBUG
|
||||
.if DEBUG
|
||||
inc $d020
|
||||
.endif
|
||||
lda $d012
|
||||
@ -66,7 +69,7 @@ _msprite_render_section:
|
||||
sta $d027,x
|
||||
; POKE(0x7f8+j, msprite_shape[i]);
|
||||
lda _msprite_shape,y
|
||||
sta $07f8,x
|
||||
sta VIC_SCRN_BASE + $03f8,x
|
||||
; set hi X bit
|
||||
lda _msprite_x_hi,y
|
||||
lsr
|
||||
@ -83,7 +86,7 @@ _msprite_render_section:
|
||||
sta j ; next h/w sprite
|
||||
jmp @loop
|
||||
@loopexit:
|
||||
.ifdef DEBUG
|
||||
.if DEBUG
|
||||
lda #0
|
||||
sta $d020
|
||||
.endif
|
||||
|
@ -26,10 +26,9 @@ void sid_init() {
|
||||
|
||||
byte music_index = 0;
|
||||
byte cur_duration = 0;
|
||||
byte music_wavebits = 0;
|
||||
byte music_wavebits = SID_SQUARE;
|
||||
|
||||
const byte music1[]; // music data -- see end of file
|
||||
const byte* music_ptr = music1;
|
||||
const byte* music_ptr = 0;
|
||||
|
||||
byte next_music_byte() {
|
||||
return *music_ptr++;
|
||||
@ -180,6 +179,8 @@ void setSIDRegisters() {
|
||||
music_wavebits = buf[0x04];
|
||||
}
|
||||
|
||||
const byte music1[]; // music data -- see end of file
|
||||
|
||||
char music_update() {
|
||||
if (!music_ptr) start_music(music1);
|
||||
play_music();
|
||||
|
71
presets/exidy/minimal.c
Normal file
71
presets/exidy/minimal.c
Normal file
File diff suppressed because one or more lines are too long
@ -79,21 +79,31 @@ typedef enum {
|
||||
|
||||
void main();
|
||||
|
||||
void start() {
|
||||
void start() __naked {
|
||||
__asm
|
||||
LD SP,#0x4800
|
||||
EI
|
||||
; copy initialized data to RAM
|
||||
LD BC, #l__INITIALIZER+1
|
||||
LD BC, #l__INITIALIZER
|
||||
LD A, B
|
||||
LD DE, #s__INITIALIZED
|
||||
LD HL, #s__INITIALIZER
|
||||
LDIR
|
||||
.skipinit:
|
||||
JP _main
|
||||
; padding to get to offset 0x66
|
||||
.ds 0x66 - (. - _start)
|
||||
__endasm;
|
||||
main();
|
||||
}
|
||||
|
||||
const char __at (0x4000) tilerom[0x1000] = {
|
||||
volatile byte video_framecount = 0; // actual framecount
|
||||
|
||||
// starts at address 0x66
|
||||
void rst_66() __interrupt {
|
||||
video_framecount++;
|
||||
}
|
||||
|
||||
const char __at (0x4000) tilerom[0x1000] = {/*{w:16,h:16,remap:[3,0,1,2,4,5,6,7,8,9,10],brev:1,np:2,pofs:2048,count:64}*/
|
||||
0x00,0xfe,0x82,0x82,0x82,0xfe,0xfe,0x00,0x00,0x00,0xfe,0xfe,0xc0,0x00,0x00,0x00,0x00,0xf2,0xf2,0x92,0x92,0x9e,0x9e,0x00,0x00,0xfe,0xfe,0x92,0x92,0x82,0x00,0x00,0x08,0xfe,0xfe,0x88,0x88,0xf8,0xf8,0x00,0x00,0x9e,0x9e,0x92,0x92,0xf2,0xf2,0x00,0x00,0x9e,0x92,0x92,0x92,0xfe,0xfe,0x00,0x00,0xf0,0xf0,0x9e,0x9e,0x80,0x80,0x00,0x00,0xfe,0x92,0x92,0x92,0xfe,0xfe,0x00,0x00,0xfe,0x92,0x92,0x92,0xf2,0xf0,0x00,0x00,0xfe,0xc8,0x88,0x88,0xfe,0xfe,0x00,0x00,0xee,0x92,0x92,0x92,0xfe,0xfe,0x00,0x00,0x82,0x82,0x82,0x86,0xfe,0xfe,0x00,0x00,0xfc,0x86,0x82,0x82,0xfe,0xfe,0x00,0x00,0x82,0x92,0x92,0x92,0xfe,0xfe,0x00,0x00,0x80,0x90,0x90,0x90,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc8,0x88,0x88,0xfe,0xfe,0x00,0x00,0xee,0x92,0x92,0x92,0xfe,0xfe,0x00,0x00,0x82,0x82,0x82,0x86,0xfe,0xfe,0x00,0x00,0xfc,0x86,0x82,0x82,0xfe,0xfe,0x00,0x00,0x82,0x92,0x92,0x92,0xfe,0xfe,0x00,0x80,0x90,0x90,0x90,0x90,0xfe,0xfe,0x00,0x00,0x9e,0x92,0x82,0x82,0xfe,0xfe,0x00,0xfe,0xfe,0x10,0x10,0x10,0xfe,0xfe,0x00,0x00,0x00,0xbe,0xbe,0x00,0x00,0x00,0x00,0xfc,0xfe,0x06,0x02,0x02,0x02,0x00,0x00,0x00,0x82,0x44,0x28,0x18,0xfe,0xfe,0x00,0x02,0x02,0x02,0x06,0xfe,0xfe,0x00,0x00,0xfe,0x40,0x20,0x18,0x20,0xfe,0xfe,0x00,0xfe,0x0c,0x08,0x10,0x20,0xfe,0xfe,0x00,0xfe,0x82,0x82,0x82,0x86,0xfe,0xfe,0x00,
|
||||
0x00,0xf8,0x88,0x88,0x88,0xfe,0xfe,0x00,0x7e,0x86,0x8a,0x82,0x82,0xfe,0xfe,0x00,0xf8,0x8a,0x8c,0x88,0x88,0xfe,0xfe,0x00,0x00,0x9e,0x96,0x92,0x92,0xf2,0xf2,0x00,0x80,0x80,0xfe,0xfe,0x80,0x80,0x00,0x00,0x00,0xfe,0x06,0x02,0x02,0xfe,0xfe,0x00,0xf0,0x08,0x04,0x06,0x0c,0xf8,0xf0,0x00,0xf8,0x06,0x0c,0x18,0x0c,0xfe,0xf8,0x00,0x82,0x44,0x28,0x38,0x6c,0xc6,0x82,0x00,0x80,0x40,0x30,0x1e,0x3e,0x40,0x80,0x00,0xc2,0xe2,0xb2,0x9e,0x8e,0x86,0x82,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x80,0x78,0x7e,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x78,0x80,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x28,0x07,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x80,0xe0,0xf0,0x07,0x07,0x28,0x10,0x00,0x00,0x00,0x00,0xe0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x04,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x80,0xe0,0xe0,0x07,0x27,0x18,0x00,0x00,0x00,0x00,0x00,0xf0,0xf8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x04,0x02,0x03,0x07,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xe0,0x3f,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xf0,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x01,0x01,0x23,0x3f,0x07,0x00,0x00,0x00,0x00,0x80,0xc0,0xc0,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x13,0x1f,0x07,0x03,0x00,0x00,0x80,0x80,0x80,0xc0,0xe0,0xf0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xe0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x09,0x0f,0x07,0x07,0x00,0x80,0x40,0x80,0x80,0xc0,0xc0,0xc0,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x08,0x04,0x03,0x03,0x03,0x00,0x00,0x10,0x08,0x10,0x60,0xe0,0xe0,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0xe0,0xc0,0xc0,0x80,0x00,0x00,0x00,0x00,
|
||||
@ -112,7 +122,8 @@ const char __at (0x4000) tilerom[0x1000] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x78,0x00,0x02,0x06,0x10,0x01,0x4a,0x00,0x10,0x00,0xa0,0x02,0x14,0x10,0x08,0x00,0x00,0x80,0x01,0x1c,0x40,0x86,0x01,0x81,0x60,0x00,0x04,0x90,0x70,0x08,0x02,0x00,0x40,0x00,0x00,0x40,0x00,0x20,0x00,0x10,0x7c,0x81,0x01,0x01,0x04,0x00,0x08,0x80,0x20,0x04,0x01,0x40,0x04,0x48,0x11,0xa0,0x00,0x02,0x00,0x08,0x84,0x02,0x01,0x00,0x18,0x86,0x80,0x0c,0x11,0x18,0xdb,0x05,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x02,0x00,0x00,0x00,0x00,0x62,0x90,0x01,0x05,0x00,0x01,0x81,0x7c,0x01,0x40,0x00,0xc0,0x00,0x01,0x80,0x80,0x40,0x44,0x80,0x01,0x02,0x64,0x00,0x00,0x48,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x04,0x03,0x00,0x00,0x18,0x00,0x12,0x10,0x0a,0xc2,0x00,0x01,0x00,0x00,0x01,0x00,0x02,0x00,0x21,0x02,0x19,0x8e,0xa2,0x6c,0xe4,0x70,0x00,0x00,0x00,0x00,0x00,0x60,0xe3,0x02,0x60,0x00,0x14,0x20,0x08,0x80,0x00,0x00,0x0e,0x5a,0x5b,0x8a,0x45,0x35,0x04,0x02,0xe0,0x00,0x10,0x90,0x40,0x20,0x00,0x80,0x12,0x15,0x04,0x00,0x00,0x00,0x02,0x02,0xc0,0x60,0x20,0x60,0x20,0x18,0x3c,0x00,0x01,0x0e,0x0a,0x10,0x18,0x10,0x00,0x30,0x05,0x20,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x09,0x08,0x08,0x40,0x40,0x0c,0x10,0x20,0x20,0xd0,0x00,0x08,0x70,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x24,0x12,0x0a,0x00,0x10,
|
||||
0x00,0x00,0x60,0x30,0x18,0x08,0x00,0x00,0x10,0x40,0x20,0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x20,0x20,0x00,0x00,0x00,0x40,0x10,0x08,0x0d,0x10,0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00,0x00,0x05,0x08,0x02,0x44,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x10,0x88,0x04,0x00,0x00,0x00,0x00,0x00,0x06,0x04,0x00,0x00,0x00,0x08,0x08,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x08,0x12,0x24,0x08,0x50,0x00,0x40,0x00,0x00,0x70,0x04,0x00,0x01,0x0e,0x80,0xa8,0x00,0x80,0x20,0x40,0x60,0x00,0x80,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x00,0x88,0x00,0x40,0x00,0x39,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x38,0x01,0x08,0x04,0x02,0x00,0x30,0x30,0x18,0x04,0x00,0x01,0x00,0x0a,0x0c,0x04,0x02,0x02,0x04,0x70,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xe0,0xe5,0x03,0x00,0x00,0x00,0x00,0x0c,0x18,0x40,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x3a,0x00,0x08,0x98,0x70,0x00,0x20,0x0e,0x0e,0x01,0x00,0x00,0x02,0x80,0x90,0x23,0x31,0xbd,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x80,0x87,0x08,0x10,0x20,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x40,0x00,0x40,0x10,0x64,0x84,0x00,0x00,0x00,0x00,0x00,0x10,0xc8,0xc1,0xc0,0x38,0x20,0x80,0x50,0x10,0x08,0x00,0x00,0x80,
|
||||
};
|
||||
const char __at (0x5000) palette[32] = {
|
||||
|
||||
const char __at (0x5000) palette[32] = {/*{pal:332,n:4}*/
|
||||
0x00,0x00,0x00,0xf6,0x00,0x16,0xc0,0x3f,
|
||||
0x00,0xd8,0x07,0x3f,0x00,0xc0,0xc4,0x07,
|
||||
0x00,0xc0,0xa0,0x07,0x00,0x00,0x00,0x07,
|
||||
@ -134,30 +145,6 @@ byte getchar(byte x, byte y) {
|
||||
return vram[29-x][y];
|
||||
}
|
||||
|
||||
volatile byte video_framecount; // actual framecount
|
||||
|
||||
void _buffer() {
|
||||
__asm
|
||||
; padding to get to offset 0x66
|
||||
ld ix,#0
|
||||
ld ix,#0
|
||||
ld ix,#0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
__endasm;
|
||||
}
|
||||
|
||||
void rst_66() __interrupt {
|
||||
video_framecount++;
|
||||
}
|
||||
|
||||
void reset_video_framecount() __critical {
|
||||
video_framecount = 0;
|
||||
}
|
||||
|
||||
|
||||
void putchar(byte x, byte y, byte ch) {
|
||||
vram[29-x][y] = ch;
|
||||
}
|
||||
@ -176,9 +163,10 @@ void putstring(byte x, byte y, const char* string) {
|
||||
}
|
||||
|
||||
void wait_for_frame() {
|
||||
byte initial_framecount = video_framecount;
|
||||
watchdog++;
|
||||
while (video_framecount == initial_framecount);
|
||||
__asm
|
||||
HALT
|
||||
__endasm;
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
#include "stdlib.h"
|
||||
|
||||
const byte palette_data[16] = {
|
||||
0x00, 0x03, 0x19, 0x50, 0x52, 0x07, 0x1f, 0x37, 0xe0, 0xa4, 0xfd, 0xff, 0x00, 0x00, 0x00, 0xf8, };
|
||||
const byte palette_data[16] = {/*{pal:332,n:16}*/
|
||||
0x00, 0x03, 0x19, 0x50, 0x52, 0x07, 0x1f, 0x37, 0xe0, 0xa4, 0xfd, 0xff, 0x38, 0x70, 0x7f, 0xf8, };
|
||||
|
||||
const byte sprite1[2+16*16/2] = {
|
||||
8,16,
|
||||
8,16,/*{w:16,h:16,bpp:4,brev:1}*/
|
||||
0x00,0x09,0x99,0x00,0x00,0x99,0x90,0x00,
|
||||
0x00,0x94,0x94,0x90,0x09,0x49,0x49,0x00,
|
||||
0x04,0x49,0x49,0x90,0x09,0x94,0x94,0x90,
|
||||
@ -27,27 +27,28 @@ const byte sprite1[2+16*16/2] = {
|
||||
0x00,0x09,0x99,0x00,0x00,0x99,0x90,0x00,
|
||||
};
|
||||
|
||||
const byte sprite2[2+16*15/2] = {
|
||||
8,16,
|
||||
0x00,0x94,0x94,0x90,0x09,0x49,0x49,0x00,
|
||||
0x04,0x49,0x49,0x90,0x09,0x94,0x94,0x90,
|
||||
0x94,0x99,0x94,0x90,0x09,0x49,0x99,0x49,
|
||||
0x99,0x99,0x49,0x93,0x39,0x94,0x99,0x99,
|
||||
0x04,0x49,0x99,0x94,0x49,0x99,0x94,0x90,
|
||||
0x00,0x94,0x94,0x43,0x34,0x49,0x49,0x00,
|
||||
0x00,0x09,0x43,0x94,0x49,0x34,0x90,0x00,
|
||||
0x00,0x90,0x00,0x39,0x93,0x00,0x09,0x00,
|
||||
0x00,0x09,0x83,0x33,0x33,0x33,0x90,0x00,
|
||||
0x00,0x09,0x32,0x23,0x32,0x23,0x90,0x00,
|
||||
0x00,0x03,0x03,0x23,0x82,0x30,0x30,0x00,
|
||||
0x03,0x30,0x00,0x33,0x33,0x00,0x03,0x30,
|
||||
0x00,0x30,0x03,0x00,0x00,0x30,0x03,0x00,
|
||||
0x00,0x00,0x00,0x30,0x03,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,
|
||||
const byte sprite2[2+16*16/2] = {
|
||||
8,16,/*{w:16,h:16,bpp:4,brev:1}*/
|
||||
0x00,0x08,0x80,0x40,0x00,0x00,0x8D,0x00,
|
||||
0x80,0x94,0x88,0x90,0x09,0x48,0x89,0x00,
|
||||
0x08,0x49,0x48,0x66,0x66,0x98,0x94,0x98,
|
||||
0x94,0x89,0x66,0x66,0x66,0x66,0x98,0x89,
|
||||
0x99,0x66,0x67,0x76,0x67,0x76,0x69,0x98,
|
||||
0x88,0x67,0x77,0x66,0x66,0x77,0x74,0x90,
|
||||
0x09,0x97,0x74,0x46,0x64,0x47,0x78,0x88,
|
||||
0x09,0x89,0x43,0x96,0x69,0x34,0x99,0x90,
|
||||
0x08,0x89,0xBB,0x39,0x93,0xBB,0x98,0x90,
|
||||
0x80,0x99,0x3B,0x33,0x33,0xB0,0x99,0x88,
|
||||
0x00,0x09,0x9C,0xC3,0x3C,0xC8,0x99,0x08,
|
||||
0x00,0x00,0x03,0xC3,0x8C,0x30,0x00,0x00,
|
||||
0x00,0x00,0x0D,0xD3,0x3D,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0D,0x00,0x0D,0xD0,0x00,0x00,
|
||||
0x00,0x00,0xDD,0x30,0x03,0xD0,0x00,0x00,
|
||||
0x00,0x00,0xD0,0x40,0x00,0xD0,0x00,0x00,
|
||||
};
|
||||
|
||||
const byte sprite3[2+16*16/2] = {
|
||||
8,16,
|
||||
8,16,/*{w:16,h:16,bpp:4,brev:1}*/
|
||||
0x00,0x00,0x00,0x01,0x10,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x11,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x01,0x10,0x00,0x00,0x00,
|
||||
@ -67,7 +68,7 @@ const byte sprite3[2+16*16/2] = {
|
||||
};
|
||||
|
||||
const byte sprite4[2+16*16/2] = {
|
||||
8,16,
|
||||
8,16,/*{w:16,h:16,bpp:4,brev:1}*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xbb,0xbb,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xbb,0xbb,0x00,0x00,0x00,
|
||||
@ -106,8 +107,8 @@ const byte sprite5[2+16*16/2] = {
|
||||
0x02,0x02,0x00,0x20,0x02,0x00,0x20,0x20,
|
||||
};
|
||||
|
||||
const byte sprite6[2+16*10/2] = {
|
||||
8,10,
|
||||
const byte sprite6[2+10*16/2] = {
|
||||
8,10,/*{w:16,h:10,bpp:4,brev:1}*/
|
||||
0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x00,
|
||||
0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x40,
|
||||
0x00,0x00,0x04,0x04,0x49,0x49,0x99,0x44,
|
||||
@ -120,8 +121,8 @@ const byte sprite6[2+16*10/2] = {
|
||||
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
const byte sprite7[2+16*14/2] = {
|
||||
8,14,
|
||||
const byte sprite7[2+14*16/2] = {
|
||||
8,14,/*{w:16,h:14,bpp:4,brev:1}*/
|
||||
0x00,0x60,0x00,0x00,0x00,0x00,0x06,0x00,
|
||||
0x60,0x60,0x00,0x00,0x00,0x00,0x06,0x06,
|
||||
0x60,0x60,0x50,0x00,0x00,0x05,0x06,0x06,
|
||||
@ -138,8 +139,8 @@ const byte sprite7[2+16*14/2] = {
|
||||
0x00,0x00,0x10,0x00,0x00,0x01,0x00,0x00,
|
||||
};
|
||||
|
||||
const byte sprite8[2+16*15/2] = {
|
||||
8,15,
|
||||
const byte sprite8[2+15*16/2] = {
|
||||
8,15,/*{w:16,h:15,bpp:4,brev:1}*/
|
||||
0x00,0x00,0x11,0x11,0x11,0x11,0x00,0x00,
|
||||
0x00,0x01,0x61,0x11,0x21,0x12,0x10,0x00,
|
||||
0x00,0x11,0x12,0x11,0x61,0x11,0x11,0x00,
|
||||
@ -158,7 +159,7 @@ const byte sprite8[2+16*15/2] = {
|
||||
};
|
||||
|
||||
const byte sprite9[2+13*16/2] = {
|
||||
8,13,
|
||||
8,13,/*{w:16,h:13,bpp:4,brev:1}*/
|
||||
0x00,0x00,0xaa,0x00,0x00,0xaa,0x00,0x00,
|
||||
0x00,0x00,0xa0,0x0a,0xa0,0x0a,0x00,0x00,
|
||||
0x0a,0xaa,0xa4,0xaa,0xaa,0x3a,0xaa,0xa0,
|
||||
@ -174,6 +175,7 @@ const byte sprite9[2+13*16/2] = {
|
||||
0x00,0x0a,0xa0,0x00,0x00,0x0a,0xa0,0x00,
|
||||
};
|
||||
|
||||
|
||||
const byte* const all_sprites[9] = {
|
||||
sprite1,
|
||||
sprite2,
|
||||
@ -329,6 +331,7 @@ int main() {
|
||||
while (video_counter >= 0x80) ;
|
||||
update_grid_rows(GDIM/2,GDIM);
|
||||
watchdog0x39 = 0x39;
|
||||
//palette[0] = i++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
const swidth = arcade ? 320 : 160;
|
||||
const sheight = arcade ? 204 : 102;
|
||||
const swbytes = swidth >> 2;
|
||||
const samask = arcade ? 0x3fff : 0xfff;
|
||||
const INITIAL_WATCHDOG = 256;
|
||||
const PIXEL_ON = 0xffeeeeee;
|
||||
const PIXEL_OFF = 0xff000000;
|
||||
@ -90,19 +91,19 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
var palinds = new Uint8Array(8);
|
||||
var refreshlines = 0;
|
||||
var dirtylines = new Uint8Array(arcade ? 262 : 131);
|
||||
var vidactive = false;
|
||||
var rotdata = new Uint8Array(4);
|
||||
var rotcount = 0;
|
||||
var intst = 0;
|
||||
var waitstates = 0;
|
||||
|
||||
var patboard = new Uint8Array(0x08);
|
||||
var patdest = 0;
|
||||
|
||||
function ramwrite(a: number, v: number) {
|
||||
// set RAM
|
||||
ram[a] = v;
|
||||
waitstates++;
|
||||
// mark scanline as dirty
|
||||
dirtylines[((a & 0xfff) / swbytes) | 0] = 1;
|
||||
dirtylines[((a & samask) / swbytes) | 0] = 1;
|
||||
// this was old behavior where we updated instantly
|
||||
// but it had problems if we had mid-screen palette changes
|
||||
//ramupdate(a, v);
|
||||
@ -201,7 +202,105 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
function refreshall() {
|
||||
refreshlines = sheight;
|
||||
}
|
||||
|
||||
|
||||
// bally astrocade pattern board
|
||||
// https://github.com/mamedev/mame/blob/7ff10685c56a6e123336c684e5e96fdb9e8b3674/src/mame/midway/astrocde_v.cpp#L726
|
||||
function xfer_patboard() {
|
||||
let m_pattern_source = patboard[0] | (patboard[1] << 8);
|
||||
let m_pattern_mode = patboard[2] & 0x3f;
|
||||
let m_pattern_skip = patboard[3];
|
||||
let m_pattern_dest = (patdest & 0xff) | (patboard[4] << 8);
|
||||
let m_pattern_width = patboard[5];
|
||||
let m_pattern_height = patboard[6] + 1;
|
||||
|
||||
let curwidth: number;
|
||||
let u13ff: number = 0;
|
||||
let cycles: number = 0;
|
||||
|
||||
u13ff = 0;
|
||||
|
||||
if ((m_pattern_mode & 0x02) === 0) {
|
||||
u13ff = 1;
|
||||
}
|
||||
|
||||
function incrementSource(): void {
|
||||
if (u13ff && (m_pattern_mode & 0x04) !== 0 && (curwidth !== 0 || (m_pattern_mode & 0x08) === 0)) {
|
||||
m_pattern_source++;
|
||||
}
|
||||
|
||||
if ((m_pattern_mode & 0x02) !== 0) {
|
||||
u13ff ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
function incrementDest(): void {
|
||||
if (curwidth !== 0) {
|
||||
if ((m_pattern_mode & 0x20) !== 0) {
|
||||
m_pattern_dest++;
|
||||
} else {
|
||||
m_pattern_dest--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over height
|
||||
while (m_pattern_height >= 0) {
|
||||
let carry: number;
|
||||
|
||||
curwidth = m_pattern_width;
|
||||
|
||||
// Loop over width
|
||||
while (curwidth >= 0) {
|
||||
let busaddr: number;
|
||||
let busdata: number;
|
||||
|
||||
// Read Phase
|
||||
busaddr = (m_pattern_mode & 0x01) === 0 ? m_pattern_source : m_pattern_dest;
|
||||
|
||||
if (curwidth === 0 && (m_pattern_mode & 0x08) !== 0) {
|
||||
busdata = 0;
|
||||
} else {
|
||||
busdata = membus.read(m_pattern_source);
|
||||
}
|
||||
|
||||
if ((m_pattern_mode & 0x01) === 0) {
|
||||
incrementSource();
|
||||
} else {
|
||||
incrementDest();
|
||||
}
|
||||
|
||||
// Write Phase
|
||||
busaddr = (m_pattern_mode & 0x01) !== 0 ? m_pattern_source : m_pattern_dest;
|
||||
ramwrite(busaddr, busdata);
|
||||
|
||||
if ((m_pattern_mode & 0x01) === 0) {
|
||||
incrementDest();
|
||||
} else {
|
||||
incrementSource();
|
||||
}
|
||||
|
||||
cycles += 4;
|
||||
curwidth--;
|
||||
}
|
||||
|
||||
// At the end of each row, adjust m_pattern_dest
|
||||
carry = ((m_pattern_dest & 0xff) + m_pattern_skip) & 0x100;
|
||||
m_pattern_dest = (m_pattern_dest & 0xff00) | ((m_pattern_dest + m_pattern_skip) & 0xff);
|
||||
|
||||
if ((m_pattern_mode & 0x10) === 0) {
|
||||
m_pattern_dest += carry;
|
||||
} else {
|
||||
m_pattern_dest -= carry ^ 0x100;
|
||||
}
|
||||
|
||||
m_pattern_height--;
|
||||
}
|
||||
|
||||
// Adjust m_maincpu.icount
|
||||
// m_maincpu.adjust_icount(-cycles);
|
||||
// Replace the above line with the actual adjustment of icount.
|
||||
}
|
||||
|
||||
this.drawScanline = (sl:number) => {
|
||||
// interrupt
|
||||
if (sl == inlin && (inmod & 0x8)) {
|
||||
@ -226,9 +325,9 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
ram = r;
|
||||
inputs = inp;
|
||||
psg = psgg;
|
||||
//bios = padBytes(ASTROCADE_MINIMAL_BIOS, 0x2000);
|
||||
bios = padBytes(new lzgmini().decode(stringToByteArray(atob(ASTROLIBRE_BIOS_LZG))), 0x2000);
|
||||
if (!arcade) {
|
||||
//bios = padBytes(ASTROCADE_MINIMAL_BIOS, 0x2000);
|
||||
bios = padBytes(new lzgmini().decode(stringToByteArray(atob(ASTROLIBRE_BIOS_LZG))), 0x2000);
|
||||
// game console
|
||||
membus = {
|
||||
read: newAddressDecoder([
|
||||
@ -246,13 +345,14 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
membus = {
|
||||
read: newAddressDecoder([
|
||||
[0x4000, 0x7fff, 0x3fff, function(a) { return ram[a]; }], // screen RAM
|
||||
[0xd000, 0xdfff, 0xfff, function(a) { return ram[a + 0x4000]; }], // static RAM
|
||||
[0x0000, 0xafff, 0xffff, function(a) { return rom ? rom[a] : 0; }], // ROM (0-3fff,8000-afff)
|
||||
[0xd000, 0xdfff, 0x0fff, function(a) { return ram[a + 0x4000]; }], // static RAM
|
||||
[0x0000, 0x3fff, 0x3fff, function(a) { return rom ? rom[a] : 0; }], // ROM
|
||||
[0x8000, 0xbfff, 0x3fff, function(a) { return rom ? rom[a + 0x4000] : 0; }], // ROM
|
||||
]),
|
||||
write: newAddressDecoder([
|
||||
[0x4000, 0x7fff, 0x3fff, ramwrite],
|
||||
[0xd000, 0xdfff, 0xfff, function(a, v) { ramwrite(a + 0x4000, v); }], // static RAM
|
||||
[0x0000, 0x3fff, 0x3fff, magicwrite],
|
||||
[0xd000, 0xdfff, 0x0fff, function(a, v) { ramwrite(a + 0x4000, v); }], // static RAM
|
||||
]),
|
||||
}
|
||||
}
|
||||
@ -273,6 +373,19 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
return rtn;
|
||||
},
|
||||
write: function(addr, val) {
|
||||
if (addr == 0xa55b) {
|
||||
// TODO: protected_ram_enable_w
|
||||
return;
|
||||
}
|
||||
addr &= 0xff;
|
||||
// pattern board
|
||||
if (addr > 0x78 && addr < 0x80) {
|
||||
patboard[addr & 7] = val;
|
||||
if (addr == 0x72) { patdest = 0; }
|
||||
if (addr == 0x74) { patdest = (patdest + patboard[3]) & 0xff; }
|
||||
if (addr == 0x7e) { xfer_patboard(); }
|
||||
return;
|
||||
}
|
||||
addr &= 0x1f;
|
||||
val &= 0xff;
|
||||
switch (addr) {
|
||||
@ -332,8 +445,15 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
case 0x19: // XPAND
|
||||
xpand = val;
|
||||
break;
|
||||
case 0x1a:
|
||||
case 0x1b:
|
||||
case 0x1c:
|
||||
case 0x1d:
|
||||
case 0x1e:
|
||||
//psg2.setACRegister(addr - 0x1a, val);
|
||||
break;
|
||||
default:
|
||||
console.log('IO write', hex(addr, 4), hex(val, 2));
|
||||
//console.log('IO write', hex(addr, 4), hex(val, 2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -372,6 +492,8 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
rotdata.set(state.rotdata);
|
||||
intst = state.intst;
|
||||
inputs.set(state.inputs);
|
||||
patboard.set(state.patboard);
|
||||
patdest = state.patdest;
|
||||
refreshall();
|
||||
}
|
||||
|
||||
@ -393,7 +515,9 @@ const _BallyAstrocade = function(arcade:boolean) {
|
||||
verbl: verbl,
|
||||
rotcount: rotcount,
|
||||
rotdata: rotdata.slice(0),
|
||||
intst: intst
|
||||
intst: intst,
|
||||
patboard: patboard.slice(0),
|
||||
patdest: patdest,
|
||||
};
|
||||
}
|
||||
this.reset = () => {
|
||||
@ -450,6 +574,7 @@ export class BallyAstrocade extends BasicScanlineMachine implements AcceptsPaddl
|
||||
ram : Uint8Array;
|
||||
cpu : Z80;
|
||||
m; // _BallyAstrocade
|
||||
arcade : boolean;
|
||||
|
||||
psg: AstrocadeAudio;
|
||||
audioadapter;
|
||||
@ -458,6 +583,7 @@ export class BallyAstrocade extends BasicScanlineMachine implements AcceptsPaddl
|
||||
|
||||
constructor(arcade:boolean) {
|
||||
super();
|
||||
this.arcade = arcade;
|
||||
this.cpu = new Z80();
|
||||
this.psg = new AstrocadeAudio(new MasterAudio());
|
||||
this.audioadapter = new TssChannelAdapter(this.psg.psg, audioOversample, this.sampleRate);
|
||||
@ -471,6 +597,12 @@ export class BallyAstrocade extends BasicScanlineMachine implements AcceptsPaddl
|
||||
//this.cpuCyclesPerVisible = this.cpuCyclesPerLine - this.cpuCyclesPerHBlank;
|
||||
this.m = new _BallyAstrocade(arcade);
|
||||
this.m.init(this, this.cpu, this.ram, this.inputs, this.psg);
|
||||
if (arcade) {
|
||||
this.inputs[0x10] = 0xff; // switches (active low)
|
||||
this.inputs[0x11] = 0xff; // switches (active low)
|
||||
this.inputs[0x12] = 0x00;
|
||||
this.inputs[0x13] = 0x08; // dip switches
|
||||
}
|
||||
}
|
||||
|
||||
read(a:number) : number {
|
||||
@ -556,8 +688,16 @@ export class BallyAstrocade extends BasicScanlineMachine implements AcceptsPaddl
|
||||
case 'Astro': return this.m.toLongString(state);
|
||||
}
|
||||
}
|
||||
getRasterCanvasPosition() { return { x: this.getRasterX(), y: this.getRasterY() }; }
|
||||
|
||||
getRasterCanvasPosition() {
|
||||
return { x: this.getRasterX(), y: this.getRasterY() };
|
||||
}
|
||||
getVideoParams() {
|
||||
if (this.arcade) {
|
||||
return { width: 320, height: 204, rotate: 180 };
|
||||
} else {
|
||||
return { width: 160, height: 102 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////
|
||||
@ -591,16 +731,6 @@ class AstrocadeAudio extends AY38910_Audio {
|
||||
}
|
||||
}
|
||||
|
||||
export const _BallyArcade = function() {
|
||||
this.__proto__ = new (_BallyAstrocade as any)(true);
|
||||
// TODO: inputs[0x13] = 0xfe; // dip switch on arcade
|
||||
// TODO: arcade controls, bit blit
|
||||
var _in = this.saveControlsState();
|
||||
_in.in[0x10] = 0xff; // switches
|
||||
_in.in[0x13] = 0xfe; // dip switches
|
||||
this.loadControlsState(_in);
|
||||
}
|
||||
|
||||
/////
|
||||
|
||||
//http://glankonian.com/~lance/astrocade_palette.html
|
||||
|
331
src/machine/exidy.ts
Normal file
331
src/machine/exidy.ts
Normal file
@ -0,0 +1,331 @@
|
||||
import { MOS6502 } from "../common/cpu/MOS6502";
|
||||
import { BasicScanlineMachine, CPU } from "../common/devices";
|
||||
import { KeyFlags, Keys, makeKeycodeMap, newAddressDecoder, newKeyboardHandler } from "../common/emu";
|
||||
|
||||
// https://github.com/mamedev/mame/blob/e9ac85ca86a873c67d6bc8d7cf2e37bc7696b379/src/mame/exidy/exidy.cpp#L327
|
||||
// http://www.arcaderestoration.com/games/9089/Targ.aspx
|
||||
// http://www.arcaderestoration.com/memorymap/9089/Targ.aspx
|
||||
// http://www.arcaderestoration.com/memorymap/3933/Hard+Hat.aspx
|
||||
// https://github.com/mamedev/mame/blob/74c4a0c3774e3aeb4895eb13f3c47773d34ce270/src/mame/shared/exidysound.cpp#L13
|
||||
|
||||
const EXIDY_KEYCODE_MAP = makeKeycodeMap([
|
||||
[Keys.START, 1, -0x1],
|
||||
//[Keys.START, 1, -0x2],
|
||||
[Keys.RIGHT, 1, -0x4],
|
||||
[Keys.LEFT, 1, -0x8],
|
||||
[Keys.A, 1, -0x10],
|
||||
[Keys.UP, 1, -0x20],
|
||||
[Keys.DOWN, 1, -0x40],
|
||||
[Keys.SELECT, 1, -0x80],
|
||||
]);
|
||||
|
||||
/*
|
||||
ROM layout:
|
||||
0x0000 - 0x5fff: program ROM
|
||||
0x6000 - 0x67ff: sprite ROM
|
||||
0x6800 - 0x7fff: audio ROM
|
||||
*/
|
||||
|
||||
export class ExidyUGBv2 extends BasicScanlineMachine {
|
||||
cpuFrequency = 705562;
|
||||
sampleRate = 894886;
|
||||
numVisibleScanlines = 256;
|
||||
numTotalScanlines = 262;
|
||||
cpuCyclesPerLine = 0x150 >> 3;
|
||||
canvasWidth = 256;
|
||||
defaultROMSize = 0x8000 + 0x800 + 0x2800; // PRG + CHR + SOUND
|
||||
cpu = new MOS6502();
|
||||
ram = new Uint8Array(0x7000);
|
||||
color_latch = [0x54, 0xee, 0x6b]; // RGB
|
||||
palette = [
|
||||
0xff000000, 0xff0000ff, 0xffff0000, 0xffff00ff,
|
||||
0xff00ff00, 0xff00ffff, 0xffffff00, 0xffffffff,
|
||||
];
|
||||
sprite_gfx: Uint8Array;
|
||||
inputs = new Uint8Array(4);
|
||||
keyMap = EXIDY_KEYCODE_MAP;
|
||||
handler = newKeyboardHandler(this.inputs, this.keyMap); /*, (o,k,c,f) => {
|
||||
// coin inserted?
|
||||
if (o.index == 1 && o.mask == 128 && (f & KeyFlags.KeyDown)) {
|
||||
this.inputs[3] |= 0x40;
|
||||
//this.cpu.IRQ();
|
||||
//this.ram[0xa2] += 8; // TODO
|
||||
}
|
||||
});
|
||||
*/
|
||||
scrnbase = 0x4000;
|
||||
charbase = 0x6800;
|
||||
|
||||
bus = {
|
||||
read: newAddressDecoder([
|
||||
[0x0000, 0x03ff, 0, (a) => { return this.ram[a]; }],
|
||||
[0x1000, 0x3fff, 0, (a) => { return this.rom[a - 0x1000]; }],
|
||||
[0x4000, 0x4fff, 0, (a) => { return this.ram[a]; }],
|
||||
[0x5100, 0x51ff, 0x03, (a) => { return a == 3 ? this.int_latch() : this.inputs[a] }],
|
||||
[0x6000, 0x6fff, 0, (a) => { return this.ram[a]; }],
|
||||
[0x8000, 0xffff, 0, (a) => { return this.rom[a - 0x8000]; }],
|
||||
]),
|
||||
write: newAddressDecoder([
|
||||
[0x0000, 0x03ff, 0, (a, v) => { this.ram[a] = v; }],
|
||||
[0x4000, 0x4fff, 0, (a, v) => { this.ram[a] = v; }],
|
||||
[0x5000, 0x5101, 0, (a, v) => { this.ram[a] = v; }], // TODO: sprite latch
|
||||
[0x5210, 0x5212, 3, (a, v) => { this.setColorLatch(a, v); }],
|
||||
[0x6000, 0x6fff, 0, (a, v) => { this.ram[a] = v; }],
|
||||
]),
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.connectCPUMemoryBus(this);
|
||||
this.updatePalette();
|
||||
this.inputs[0] = 0b11101010; // dip switch
|
||||
this.inputs[1] = 0b11111111; // active low
|
||||
}
|
||||
|
||||
loadROM(rom: Uint8Array) {
|
||||
super.loadROM(rom);
|
||||
if (rom.length < 0x8000) {
|
||||
if (rom.length == 11616) { // targ
|
||||
this.rom.set(rom.slice(0x2800, 0x3000), 0x8000); // copy sprites
|
||||
this.rom.set(rom.slice(0x2700, 0x2800), 0x7f00); // copy ff00-ffff
|
||||
this.rom.set(rom.slice(0x0000, 0x2800), 0x0800); // ROM starts @ 0x1800
|
||||
this.scrnbase = 0x4000;
|
||||
this.charbase = 0x4800;
|
||||
} else if (rom.length == 14336) { // spectar
|
||||
this.rom.set(rom.slice(0x3400, 0x3800), 0x8000); // copy sprites
|
||||
this.rom.set(rom.slice(0x2f00, 0x3000), 0x7f00); // copy ff00-ffff
|
||||
this.scrnbase = 0x4000;
|
||||
this.charbase = 0x4800;
|
||||
} else {
|
||||
console.log("Warning: ROM is too small", rom.length);
|
||||
}
|
||||
}
|
||||
let sprite_ofs = 0x8000;
|
||||
this.sprite_gfx = this.rom.subarray(sprite_ofs, sprite_ofs + 32 * 32);
|
||||
}
|
||||
|
||||
read(a: number): number {
|
||||
return this.bus.read(a);
|
||||
}
|
||||
readConst(a: number): number {
|
||||
if (a == 0x5103) return this.inputs[3];
|
||||
return this.bus.read(a);
|
||||
}
|
||||
write(a: number, v: number): void {
|
||||
this.bus.write(a, v);
|
||||
}
|
||||
|
||||
int_latch() {
|
||||
let intsrc = this.inputs[3];
|
||||
intsrc |= (this.inputs[1] & 0x80) ? 0 : 0x40; // coin 1
|
||||
this.inputs[3] = 0x80; // clear int latch
|
||||
return intsrc; // TODO
|
||||
}
|
||||
|
||||
updatePalette() {
|
||||
/* motion object 1 */
|
||||
this.set_1_color(0, 0);
|
||||
this.set_1_color(1, 7);
|
||||
|
||||
/* motion object 2 */
|
||||
this.set_1_color(2, 0);
|
||||
this.set_1_color(3, 6);
|
||||
|
||||
/* characters */
|
||||
this.set_1_color(4, 4);
|
||||
this.set_1_color(5, 3);
|
||||
this.set_1_color(6, 2);
|
||||
this.set_1_color(7, 1);
|
||||
}
|
||||
set_1_color(index: number, dipsw: number) {
|
||||
let r = (this.color_latch[0] & (1 << dipsw)) ? 1 : 0;
|
||||
let g = (this.color_latch[1] & (1 << dipsw)) ? 2 : 0;
|
||||
let b = (this.color_latch[2] & (1 << dipsw)) ? 4 : 0;
|
||||
this.palette[index] = RGB8[r | g | b];
|
||||
}
|
||||
setColorLatch(a: number, v: number): void {
|
||||
this.color_latch[a & 3] = v;
|
||||
this.updatePalette();
|
||||
}
|
||||
drawSprite(xpos: number, ypos: number, ofs: number, palind: number) {
|
||||
var sx = 236 - xpos - 4;
|
||||
var sy = 244 - ypos - 4;
|
||||
/*
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
|
||||
((*m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1,
|
||||
0, 0, sx, sy, 0);*/
|
||||
sy += 15;
|
||||
sy -= this.scanline;
|
||||
if (sy >= 0 && sy < 16) {
|
||||
sy = 15 - sy;
|
||||
//console.log("draw sprite", sx, sy, ofs);
|
||||
let yofs = this.scanline * this.canvasWidth;
|
||||
let pix = this.sprite_gfx[ofs + sy];
|
||||
for (let x = 0; x < 8; x++) {
|
||||
if (pix & (0x80 >> x)) {
|
||||
this.pixels[yofs + sx + x] = this.palette[palind];
|
||||
}
|
||||
}
|
||||
pix = this.sprite_gfx[ofs + sy + 16];
|
||||
for (let x = 0; x < 8; x++) {
|
||||
if (pix & (0x80 >> x)) {
|
||||
this.pixels[yofs + sx + x + 8] = this.palette[palind];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
drawSprite1() {
|
||||
let xpos = this.ram[0x5000];
|
||||
let ypos = this.ram[0x5040];
|
||||
let set = (this.ram[0x5101] & 0x20) ? 1 : 0;
|
||||
let sprite = (this.ram[0x5100] & 0x0f) + 16 * set;
|
||||
this.drawSprite(xpos, ypos, sprite * 32, 1);
|
||||
}
|
||||
drawSprite2() {
|
||||
let xpos = this.ram[0x5080];
|
||||
let ypos = this.ram[0x50c0];
|
||||
let set = (this.ram[0x5101] & 0x40) ? 1 : 0;
|
||||
let sprite = (this.ram[0x5100] >> 4) + 16 * set;
|
||||
this.drawSprite(xpos, ypos, sprite * 32, 3);
|
||||
}
|
||||
startScanline(): void {
|
||||
}
|
||||
drawScanline(): void {
|
||||
const y = this.scanline;
|
||||
const row = y >> 3;
|
||||
const yofs = y * this.canvasWidth;
|
||||
for (let x = 0; x < 256; x++) {
|
||||
const col = x >> 3;
|
||||
let code = this.ram[this.scrnbase + row * 32 + col];
|
||||
let color1 = 4 + ((code >> 6) & 0x03);
|
||||
let pix = this.ram[this.charbase + code * 8 + (y & 7)];
|
||||
let palind = (pix & (0x80 >> (x & 7))) ? color1 : 0;
|
||||
this.pixels[yofs + x] = this.palette[palind];
|
||||
}
|
||||
this.drawSprite2();
|
||||
this.drawSprite1();
|
||||
}
|
||||
postFrame() {
|
||||
this.inputs[3] &= 0x7f; // TODO?
|
||||
this.cpu.IRQ();
|
||||
}
|
||||
getVideoParams() {
|
||||
return { width: 256, height: 256, aspect: 6/5 };
|
||||
}
|
||||
}
|
||||
|
||||
const RGB8 = [
|
||||
0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
|
||||
0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff,
|
||||
];
|
||||
|
||||
|
||||
/*
|
||||
0000-00FF R/W Zero Page RAM
|
||||
0100-01FF R/W Stack RAM
|
||||
0200-03FF R/W Scratchpad RAM
|
||||
0800-3FFF R Program ROM (Targ, Spectar only)
|
||||
1A00 R PX3 (Player 2 inputs) (Fax only)
|
||||
bit 4 D
|
||||
bit 5 C
|
||||
bit 6 B
|
||||
bit 7 A
|
||||
1C00 R PX2 (Player 1 inputs) (Fax only)
|
||||
bit 0 2 player start
|
||||
bit 1 1 player start
|
||||
bit 4 D
|
||||
bit 5 C
|
||||
bit 6 B
|
||||
bit 7 A
|
||||
2000-3FFF R Banked question ROM (Fax only)
|
||||
4000-43FF R/W Screen RAM
|
||||
4800-4FFF R/W Character Generator RAM (except Pepper II and Fax)
|
||||
5000 W Motion Object 1 Horizontal Position Latch (sprite 1 X)
|
||||
5040 W Motion Object 1 Vertical Position Latch (sprite 1 Y)
|
||||
5080 W Motion Object 2 Horizontal Position Latch (sprite 2 X)
|
||||
50C0 W Motion Object 2 Vertical Position Latch (sprite 2 Y)
|
||||
5100 R Option Dipswitch Port
|
||||
bit 0 coin 2 (NOT inverted) (must activate together with $5103 bit 5)
|
||||
bit 1-2 bonus
|
||||
bit 3-4 coins per play
|
||||
bit 5-6 lives
|
||||
bit 7 US/UK coins
|
||||
5100 W Motion Objects Image Latch
|
||||
Sprite number bits 0-3 Sprite #1 4-7 Sprite #2
|
||||
5101 R Control Inputs Port
|
||||
bit 0 start 1
|
||||
bit 1 start 2
|
||||
bit 2 right
|
||||
bit 3 left
|
||||
bit 5 up
|
||||
bit 6 down
|
||||
bit 7 coin 1 (must activate together with $5103 bit 6)
|
||||
5101 W Output Control Latch (not used in PEPPER II upright)
|
||||
bit 7 Enable sprite #1
|
||||
bit 6 Enable sprite #2
|
||||
5103 R Interrupt Condition Latch
|
||||
bit 0 LNG0 - supposedly a language DIP switch
|
||||
bit 1 LNG1 - supposedly a language DIP switch
|
||||
bit 2 different for each game, but generally a collision bit
|
||||
bit 3 TABLE - supposedly a cocktail table DIP switch
|
||||
bit 4 different for each game, but generally a collision bit
|
||||
bit 5 coin 2 (must activate together with $5100 bit 0)
|
||||
bit 6 coin 1 (must activate together with $5101 bit 7)
|
||||
bit 7 L256 - VBlank?
|
||||
5213 R IN2 (Mouse Trap)
|
||||
bit 3 blue button
|
||||
bit 2 free play
|
||||
bit 1 red button
|
||||
bit 0 yellow button
|
||||
52XX R/W Audio/Color Board Communications
|
||||
6000-6FFF R/W Character Generator RAM (Pepper II, Fax only)
|
||||
8000-FFF9 R Program memory space
|
||||
FFFA-FFFF R Interrupt and Reset Vectors
|
||||
|
||||
Exidy Sound Board:
|
||||
0000-07FF R/W RAM (mirrored every 0x7f)
|
||||
0800-0FFF R/W 6532 Timer
|
||||
1000-17FF R/W 6520 PIA
|
||||
1800-1FFF R/W 8253 Timer
|
||||
2000-27FF bit 0 Channel 1 Filter 1 enable
|
||||
bit 1 Channel 1 Filter 2 enable
|
||||
bit 2 Channel 2 Filter 1 enable
|
||||
bit 3 Channel 2 Filter 2 enable
|
||||
bit 4 Channel 3 Filter 1 enable
|
||||
bit 5 Channel 3 Filter 2 enable
|
||||
2800-2FFF 6840 Timer
|
||||
3000 Bit 0..1 Noise select
|
||||
3001 Bit 0..2 Channel 1 Amplitude
|
||||
3002 Bit 0..2 Channel 2 Amplitude
|
||||
3003 Bit 0..2 Channel 3 Amplitude
|
||||
5800-7FFF ROM
|
||||
|
||||
Targ:
|
||||
5200 Sound board control
|
||||
bit 0 Music
|
||||
bit 1 Shoot
|
||||
bit 2 unused
|
||||
bit 3 Swarn
|
||||
bit 4 Sspec
|
||||
bit 5 crash
|
||||
bit 6 long
|
||||
bit 7 game
|
||||
|
||||
5201 Sound board control
|
||||
bit 0 note
|
||||
bit 1 upper
|
||||
|
||||
MouseTrap:
|
||||
5101 W MouseTrap P1/P2 LED States
|
||||
bit 2 Player 1 LED state
|
||||
bit 4 Player 2 LED state
|
||||
|
||||
MouseTrap Digital Sound:
|
||||
0000-3FFF ROM
|
||||
|
||||
IO:
|
||||
A7 = 0: R Communication from sound processor
|
||||
A6 = 0: R CVSD Clock State
|
||||
A5 = 0: W Busy to sound processor
|
||||
A4 = 0: W Data to CVSD
|
||||
*/
|
@ -12,6 +12,7 @@ export function importPlatform(name: string) : Promise<any> {
|
||||
case "coleco": return import("../platform/coleco");
|
||||
case "cpc": return import("../platform/cpc");
|
||||
case "devel": return import("../platform/devel");
|
||||
case "exidy": return import("../platform/exidy");
|
||||
case "galaxian": return import("../platform/galaxian");
|
||||
case "kim1": return import("../platform/kim1");
|
||||
case "markdown": return import("../platform/markdown");
|
||||
|
@ -26,6 +26,10 @@ const ASTROCADE_BIOS_PRESETS = [
|
||||
{ id: 'bios.c', name: 'BIOS' },
|
||||
];
|
||||
|
||||
const ASTROCADE_ARCADE_PRESETS = [
|
||||
{ id: 'hello.c', name: 'Hello Graphics' },
|
||||
];
|
||||
|
||||
class BallyAstrocadePlatform extends BaseZ80MachinePlatform<BallyAstrocade> implements Platform {
|
||||
|
||||
newMachine() { return new BallyAstrocade(false); }
|
||||
@ -52,10 +56,13 @@ class BallyAstrocadeBIOSPlatform extends BallyAstrocadePlatform implements Platf
|
||||
class BallyArcadePlatform extends BallyAstrocadePlatform implements Platform {
|
||||
|
||||
newMachine() { return new BallyAstrocade(true); }
|
||||
getPresets() { return ASTROCADE_ARCADE_PRESETS; }
|
||||
|
||||
getMemoryMap = function() { return { main:[
|
||||
{name:'ROM',start:0x0,size:0x4000,type:'rom'},
|
||||
{name:'Magic RAM',start:0x0,size:0x4000,type:'ram'},
|
||||
{name:'Screen RAM',start:0x4000,size:0x4000,type:'ram'},
|
||||
{name:'ROM',start:0x8000,size:0x4000,type:'rom'},
|
||||
] } };
|
||||
}
|
||||
|
||||
|
32
src/platform/exidy.ts
Normal file
32
src/platform/exidy.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import { Base6502MachinePlatform, Platform } from "../common/baseplatform";
|
||||
import { PLATFORMS } from "../common/emu";
|
||||
import { ExidyUGBv2 } from "../machine/exidy";
|
||||
|
||||
var EXIDY_PRESETS = [
|
||||
{ id: 'minimal.c', name: 'Minimal Example', category: "C" },
|
||||
];
|
||||
|
||||
class ExidyUGBPlatform extends Base6502MachinePlatform<ExidyUGBv2> implements Platform {
|
||||
|
||||
newMachine() { return new ExidyUGBv2(); }
|
||||
getPresets() { return EXIDY_PRESETS; }
|
||||
getDefaultExtension() { return ".dasm"; };
|
||||
readAddress(a) { return this.machine.readConst(a); }
|
||||
|
||||
getMemoryMap() {
|
||||
return { main: [
|
||||
{ name: 'RAM', start: 0x00, size: 0x400, type: 'ram' },
|
||||
{ name: 'Sprite I/O', start: 0x5000, size: 0x100, type: 'io' },
|
||||
{ name: 'I/O', start: 0x5100, size: 0x3, type: 'io' },
|
||||
{ name: 'PIA 6821', start: 0x5200, size: 0xf, type: 'io' },
|
||||
{ name: 'Color Latches', start: 0x5210, size: 0x3, type: 'io' },
|
||||
{ name: 'Screen RAM', start: 0x4000, size: 0x400, type: 'ram' },
|
||||
{ name: 'Character RAM', start: 0x6800, size: 0x800, type: 'ram' },
|
||||
{ name: 'Audio ROM', start: 0x5800, size: 0x2800, type: 'rom' },
|
||||
{ name: 'Program ROM', start: 0x8000, size: 0x8000, type: 'rom' },
|
||||
]
|
||||
} }
|
||||
}
|
||||
|
||||
PLATFORMS["exidy"] = ExidyUGBPlatform;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { getBasePlatform } from "../common/util";
|
||||
import { convertDataToUint8Array, getBasePlatform } from "../common/util";
|
||||
import { WorkerBuildStep, WorkerError, WorkerErrorResult, WorkerMessage, WorkerResult, WorkingStore } from "../common/workertypes";
|
||||
import { PLATFORM_PARAMS } from "./platforms";
|
||||
import { TOOLS } from "./workertools";
|
||||
@ -414,3 +414,20 @@ export function fixParamsWithDefines(path: string, params) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function processEmbedDirective(code: string) {
|
||||
let re3 = /^\s*#embed\s+"(.+?)"/gm;
|
||||
// find #embed "filename.bin" and replace with C array data
|
||||
return code.replace(re3, (m, m1) => {
|
||||
let filename = m1;
|
||||
let filedata = store.getFileData(filename);
|
||||
let bytes = convertDataToUint8Array(filedata);
|
||||
if (!bytes) throw new Error('#embed: file not found: "' + filename + '"');
|
||||
let out = '';
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
out += bytes[i].toString() + ',';
|
||||
}
|
||||
return out.substring(0, out.length-1);
|
||||
});
|
||||
}
|
||||
|
||||
|
BIN
src/worker/lib/exidy/crt0.o
Normal file
BIN
src/worker/lib/exidy/crt0.o
Normal file
Binary file not shown.
96
src/worker/lib/exidy/crt0.s
Normal file
96
src/worker/lib/exidy/crt0.s
Normal file
@ -0,0 +1,96 @@
|
||||
; Startup code for cc65 and Shiru's NES library
|
||||
; based on code by Groepaz/Hitmen <groepaz@gmx.net>, Ullrich von Bassewitz <uz@cc65.org>
|
||||
; edited by Steven Hugg for Exidy
|
||||
|
||||
.export _exit,__STARTUP__:absolute=1
|
||||
.export _HandyRTI
|
||||
.exportzp _INTVEC
|
||||
.export NMI,IRQ,START
|
||||
.import initlib,push0,popa,popax,_main,zerobss,copydata
|
||||
.importzp sp
|
||||
|
||||
; Linker generated symbols
|
||||
.import __RAM0_START__ ,__RAM0_SIZE__
|
||||
.import __ROM_START__ ,__ROM_SIZE__
|
||||
.import __STARTUP_LOAD__,__STARTUP_RUN__,__STARTUP_SIZE__
|
||||
.import __CODE_LOAD__ ,__CODE_RUN__ ,__CODE_SIZE__
|
||||
.import __RODATA_LOAD__ ,__RODATA_RUN__ ,__RODATA_SIZE__
|
||||
|
||||
.segment "ZEROPAGE"
|
||||
|
||||
_INTVEC: .res 2
|
||||
|
||||
.segment "STARTUP"
|
||||
|
||||
START:
|
||||
_exit:
|
||||
sei ;Disable interrupts
|
||||
cld ;Clear decimal mode
|
||||
ldx #$ff ;Setup stack pointer
|
||||
txs
|
||||
|
||||
|
||||
@irrwait:
|
||||
lda $5103
|
||||
dex
|
||||
bne @irrwait
|
||||
|
||||
lda #$00 ;Clear Ram
|
||||
sta $5100 ;Set sprites to #0
|
||||
@2:
|
||||
sta $0,x
|
||||
sta $100,x
|
||||
sta $200,x
|
||||
sta $300,x
|
||||
sta $4000,x
|
||||
sta $4100,x
|
||||
sta $4200,x
|
||||
sta $4300,x
|
||||
sta $6800,x
|
||||
sta $6900,x
|
||||
sta $6a00,x
|
||||
sta $6b00,x
|
||||
sta $6c00,x
|
||||
sta $6d00,x
|
||||
sta $6e00,x
|
||||
sta $6f00,x
|
||||
inx
|
||||
bne @2
|
||||
|
||||
; copy data segment
|
||||
jsr copydata
|
||||
|
||||
; initialize cc65 stack
|
||||
lda #<(__RAM0_START__+__RAM0_SIZE__)
|
||||
sta sp
|
||||
lda #>(__RAM0_START__+__RAM0_SIZE__)
|
||||
sta sp+1
|
||||
|
||||
; init CC65 library
|
||||
jsr initlib
|
||||
|
||||
; set interrupt vector in ZP
|
||||
lda #<_HandyRTI
|
||||
sta _INTVEC
|
||||
lda #>_HandyRTI
|
||||
sta _INTVEC+1
|
||||
cli ;Enable interrupts
|
||||
|
||||
; start main()
|
||||
jmp _main ;no parameters
|
||||
|
||||
; interrupt handler
|
||||
NMI:
|
||||
IRQ:
|
||||
jmp (_INTVEC)
|
||||
|
||||
_HandyRTI:
|
||||
rti
|
||||
|
||||
; CPU vectors
|
||||
.segment "VECTORS"
|
||||
|
||||
.word NMI ;$fffa vblank nmi
|
||||
.word START ;$fffc reset
|
||||
.word IRQ ;$fffe irq / brk
|
||||
|
50
src/worker/lib/exidy/exidy.cfg
Normal file
50
src/worker/lib/exidy/exidy.cfg
Normal file
@ -0,0 +1,50 @@
|
||||
SYMBOLS {
|
||||
__STACKSIZE__: type = weak, value = $0100;
|
||||
}
|
||||
MEMORY {
|
||||
# Zero Page
|
||||
ZP: file = "", start = $0000, size = $0100, type = rw, define = yes;
|
||||
|
||||
# RAM
|
||||
RAM0: file = "", start = $200, size = $200, define = yes;
|
||||
|
||||
# ROM Bank
|
||||
PRG: file = %O, start = $8000, size = $8000 - 6, fill = yes, define = yes;
|
||||
|
||||
# CPU Vectors
|
||||
VECTORS: file = %O, start = $FFFA, size = $0006, fill = yes;
|
||||
|
||||
# Sprite Bitmaps
|
||||
SPRITES: file = %O, start = $0, size = $800, fill = yes, define = yes;
|
||||
|
||||
# Audio ROM
|
||||
AUDIO: file = %O, start = $5800, size = $2800, fill = yes, define = yes;
|
||||
}
|
||||
SEGMENTS {
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
STARTUP: load = PRG, type = ro, define = yes;
|
||||
RODATA: load = PRG, type = ro, define = yes;
|
||||
ONCE: load = PRG, type = ro, optional = yes;
|
||||
CODE: load = PRG, type = ro, define = yes;
|
||||
DATA: load = PRG, run = RAM0, type = rw, define = yes;
|
||||
VECTORS: load = VECTORS, type = ro;
|
||||
SPRITES: load = SPRITES, type = ro, optional = yes;
|
||||
BSS: load = RAM0, type = bss, define = yes;
|
||||
RAM: load = RAM0, type = rw, optional = yes;
|
||||
AUDIO: load = AUDIO, type = ro, optional = yes;
|
||||
}
|
||||
FEATURES {
|
||||
CONDES: type = constructor,
|
||||
label = __CONSTRUCTOR_TABLE__,
|
||||
count = __CONSTRUCTOR_COUNT__,
|
||||
segment = ONCE;
|
||||
CONDES: type = destructor,
|
||||
label = __DESTRUCTOR_TABLE__,
|
||||
count = __DESTRUCTOR_COUNT__,
|
||||
segment = RODATA;
|
||||
CONDES: type = interruptor,
|
||||
label = __INTERRUPTOR_TABLE__,
|
||||
count = __INTERRUPTOR_COUNT__,
|
||||
segment = RODATA,
|
||||
import = __CALLIRQ__;
|
||||
}
|
@ -327,6 +327,13 @@ export var PLATFORM_PARAMS = {
|
||||
cfgfile: 'pce.cfg',
|
||||
libargs: ['pce.lib', '-D', '__CARTSIZE__=0x8000'],
|
||||
},
|
||||
'exidy': {
|
||||
define: ['__EXIDY__'],
|
||||
cfgfile: 'exidy.cfg',
|
||||
libargs: ['crt0.o', 'none.lib'],
|
||||
extra_link_files: ['crt0.o', 'exidy.cfg'],
|
||||
//extra_compile_files: ['exidy.h'],
|
||||
},
|
||||
};
|
||||
|
||||
PLATFORM_PARAMS['sms-sms-libcv'] = PLATFORM_PARAMS['sms-sg1000-libcv'];
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
import { convertDataToUint8Array, getFilenamePrefix, getRootBasePlatform, safeident } from "../../common/util";
|
||||
import { getRootBasePlatform } from "../../common/util";
|
||||
import { CodeListingMap, WorkerError } from "../../common/workertypes";
|
||||
import { BuildStep, BuildStepResult, gatherFiles, staleFiles, populateFiles, fixParamsWithDefines, putWorkFile, populateExtraFiles, store, populateEntry, anyTargetChanged } from "../builder";
|
||||
import { BuildStep, BuildStepResult, gatherFiles, staleFiles, populateFiles, fixParamsWithDefines, putWorkFile, populateExtraFiles, store, populateEntry, anyTargetChanged, processEmbedDirective } from "../builder";
|
||||
import { re_crlf, makeErrorMatcher } from "../listingutils";
|
||||
import { loadNative, moduleInstFn, print_fn, setupFS, execMain, emglobal, EmscriptenModule } from "../wasmutils";
|
||||
|
||||
@ -270,22 +270,6 @@ export function linkLD65(step: BuildStep): BuildStepResult {
|
||||
}
|
||||
}
|
||||
|
||||
function processIncbin(code: string) {
|
||||
let re3 = /^\s*#embed\s+"(.+?)"/gm;
|
||||
// find #embed "filename.bin" and replace with C array data
|
||||
return code.replace(re3, (m, m1) => {
|
||||
let filename = m1;
|
||||
let filedata = store.getFileData(filename);
|
||||
let bytes = convertDataToUint8Array(filedata);
|
||||
if (!bytes) throw new Error('#embed: file not found: "' + filename + '"');
|
||||
let out = '';
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
out += bytes[i].toString() + ',';
|
||||
}
|
||||
return out;
|
||||
});
|
||||
}
|
||||
|
||||
export function compileCC65(step: BuildStep): BuildStepResult {
|
||||
loadNative("cc65");
|
||||
var params = step.params;
|
||||
@ -321,7 +305,7 @@ export function compileCC65(step: BuildStep): BuildStepResult {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === 'string') {
|
||||
code = processIncbin(code);
|
||||
code = processEmbedDirective(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { getBasePlatform } from "../../common/util";
|
||||
import { BuildStep, populateFiles, populateExtraFiles, errorResult } from "../builder";
|
||||
import { BuildStep, populateFiles, populateExtraFiles, errorResult, processEmbedDirective } from "../builder";
|
||||
import { makeErrorMatcher, extractErrors } from "../listingutils";
|
||||
import { PLATFORM_PARAMS } from "../platforms";
|
||||
import { load, print_fn, setupFS, execMain, emglobal, EmscriptenModule } from "../wasmutils";
|
||||
@ -24,7 +24,15 @@ export function preprocessMCPP(step: BuildStep, filesys: string) {
|
||||
});
|
||||
var FS = MCPP.FS;
|
||||
if (filesys) setupFS(FS, filesys);
|
||||
populateFiles(step, FS);
|
||||
populateFiles(step, FS, {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === 'string') {
|
||||
code = processEmbedDirective(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
});
|
||||
populateExtraFiles(step, FS, params.extra_compile_files);
|
||||
// TODO: make configurable by other compilers
|
||||
var args = [
|
||||
|
@ -146,6 +146,9 @@ export function linkSDLDZ80(step: BuildStep) {
|
||||
args.push.apply(args, step.args);
|
||||
//console.log(args);
|
||||
execMain(step, LDZ80, args);
|
||||
if (errors.length) {
|
||||
return { errors: errors };
|
||||
}
|
||||
var hexout = FS.readFile("main.ihx", { encoding: 'utf8' });
|
||||
var noiout = FS.readFile("main.noi", { encoding: 'utf8' });
|
||||
putWorkFile("main.ihx", hexout);
|
||||
|
@ -149,6 +149,7 @@ export function setupFS(FS, name: string) {
|
||||
if (name === '65-atari7800') name = '65-none'; // TODO
|
||||
if (name === '65-devel') name = '65-none'; // TODO
|
||||
if (name === '65-vcs') name = '65-atari2600'; // TODO
|
||||
if (name === '65-exidy') name = '65-none'; // TODO
|
||||
if (!fsMeta[name]) throw Error("No filesystem for '" + name + "'");
|
||||
FS.mkdir('/share');
|
||||
FS.mount(WORKERFS, {
|
||||
|
@ -75,6 +75,8 @@ export const TOOL_PRELOADFS = {
|
||||
'ca65-vcs': '65-atari2600',
|
||||
'cc65-pce': '65-pce',
|
||||
'ca65-pce': '65-pce',
|
||||
'cc65-exidy': '65-none',
|
||||
'ca65-exidy': '65-none',
|
||||
'sdasz80': 'sdcc',
|
||||
'sdcc': 'sdcc',
|
||||
'sccz80': 'sccz80',
|
||||
|
Loading…
x
Reference in New Issue
Block a user