1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-18 03:05:35 +00:00
8bitworkshop/gen/williams-N7W7D3RV.js.map

8 lines
47 KiB
Plaintext
Raw Normal View History

{
"version": 3,
"sources": ["../src/machine/williams.ts", "../src/platform/williams.ts"],
"sourcesContent": ["import { hex } from \"chroma-js\";\nimport { MasterAudio, WorkerSoundChannel } from \"../common/audio\";\nimport { MemoryBus } from \"../common/baseplatform\";\nimport { CPU6809 } from \"../common/cpu/6809\";\nimport { BasicScanlineMachine } from \"../common/devices\";\nimport { Keys, makeKeycodeMap, newAddressDecoder, newKeyboardHandler, padBytes } from \"../common/emu\";\n\nconst INITIAL_WATCHDOG = 8;\nconst SCREEN_HEIGHT = 304;\n\nexport class WilliamsMachine extends BasicScanlineMachine {\n\n xtal = 12000000;\n cpuFrequency = this.xtal / 3 / 4;\n //cpuCyclesPerLine = 64;\n cpuCyclesPerLine = 54; // TODO: becuse we swapped width and height\n canvasWidth = 256;\n numTotalScanlines = 304;\n numVisibleScanlines = 304;\n defaultROMSize = 0xc000;\n rotate = -90;\n sampleRate = 1;\n\n cpu;\n membus: MemoryBus;\n ram = new Uint8Array(0xc000);\n nvram = new Uint8Array(0x400);\n rom = new Uint8Array(0xc000);\n portsel = 0;\n banksel = 0;\n watchdog_counter = 0;\n watchdog_enabled = false;\n pia6821 = new Uint8Array(8);\n blitregs = new Uint8Array(8);\n\n worker: Worker;\n master;\n audioadapter;\n\n palette = new Uint32Array(16);\n screenNeedsRefresh = false;\n displayPCs;\n cpuScale = 1;\n waitCycles = 0;\n\n constructor(public isDefender: boolean) {\n super();\n this.palette.fill(0xff000000);\n this.initBus(isDefender);\n this.initInputs(isDefender);\n this.initAudio();\n this.initCPU();\n }\n\n initInputs(isDefender: boolean) {\n var DEFENDER_KEYCODE_MAP = makeKeycodeMap([\n [Keys.A, 4, 0x1],\n [Keys.RIGHT, 4, 0x2],\n [Keys.B, 4, 0x4],\n [Keys.VK_X, 4, 0x8],\n [Keys.P2_START, 4, 0x10],\n [Keys.START, 4, 0x20],\n [Keys.LEFT, 4, 0x40],\n [Keys.DOWN, 4, 0x80],\n [Keys.UP, 6, 0x1],\n [Keys.SELECT, 0, 0x4],\n [Keys.VK_7, 0, 0x1],\n [Keys.VK_8, 0, 0x2],\n [Keys.VK_9, 0, 0x8],\n ]);\n\n var ROBOTRON_KEYCODE_MAP = makeKeycodeMap([\n [Keys.P2_UP, 0, 0x1],\n [Keys.P2_DOWN, 0, 0x2],\n [Keys.P2_LEFT, 0, 0x4],\n [Keys.P2_RIGHT, 0, 0x8],\n [Keys.START, 0, 0x10],\n [Keys.P2_START, 0, 0x20],\n [Keys.UP, 0, 0x40],\n [Keys.DOWN, 0, 0x80],\n [Keys.LEFT, 2, 0x1],\n [Keys.RIGHT, 2, 0x2],\n [Keys.VK_7, 4, 0x1],\n [Keys.VK_8, 4, 0x2],\n [Keys.VK_6, 4, 0x4],\n [Keys.VK_9, 4, 0x8],\n [Keys.SELECT, 4, 0x10],\n ]);\n\n var KEYCODE_MAP = isDefender ? DEFENDER_KEYCODE_MAP : ROBOTRON_KEYCODE_MAP;\n //this.inputs.set(this.pia6821);\n this.handler = newKeyboardHandler(this.pia6821, KEYCODE_MAP);\n }\n\n initBus(isDefender: boolean) {\n var ioread_defender = newAddressDecoder([\n [0x400, 0x5ff, 0x1ff, (a) => { return this.nvram[a]; }],\n [0x800, 0x800, 0, (a) => { return this.scanline; }],\n [0xc00, 0xc07, 0x7, (a) => { return this.pia6821[a]; }],\n [0x0, 0xfff, 0, (a) => { /*console.log('ioread',hex(a));*/ }],\n ]);\n\n var iowrite_defender = newAddressDecoder([\n [0x0, 0xf, 0xf, this.setPalette.bind(this)],\n [0x3fc, 0x3ff, 0, (a, v) => { if (v == 0x38) this.watchdog_counter = INITIAL_WATCHDOG; this.watchdog_enabled = true; }],\n [0x400, 0x5ff, 0x1ff, (a, v) => { this.nvram[a] = v; }],\n [0xc02, 0xc02, 0x1, (a, v) => { if (this.worker) this.worker.postMessage({ command: v & 0x3f }); }],\n [0xc00, 0xc07, 0x7, (a, v) => { this.pia6821[a] = v; }],\n [0x0, 0xfff, 0, (a, v) => { /* console.log('iowrite', hex(a), hex(v)); */ }],\n ]);\n\n var memread_defender = newAddressDecoder([\n [0x0000, 0xbfff, 0xffff, (a) => { return this.ram[a]; }],\n [0xc000, 0xcfff, 0x0fff, (a) => {\n
"mappings": "qOAOA,GAAM,GAAmB,EACnB,GAAgB,IAEf,eAA8B,GAAqB,CAmCtD,YAAmB,EAAqB,CACpC,QADe,kBAjCnB,UAAO,KACP,kBAAe,KAAK,KAAO,EAAI,EAE/B,sBAAmB,GACnB,iBAAc,IACd,uBAAoB,IACpB,yBAAsB,IACtB,oBAAiB,MACjB,YAAS,IACT,gBAAa,EAIb,SAAM,GAAI,YAAW,OACrB,WAAQ,GAAI,YAAW,MACvB,SAAM,GAAI,YAAW,OACrB,aAAU,EACV,aAAU,EACV,sBAAmB,EACnB,sBAAmB,GACnB,aAAU,GAAI,YAAW,GACzB,cAAW,GAAI,YAAW,GAM1B,aAAU,GAAI,aAAY,IAC1B,wBAAqB,GAErB,cAAW,EACX,gBAAa,EAIT,KAAK,QAAQ,KAAK,YAClB,KAAK,QAAQ,GACb,KAAK,WAAW,GAChB,KAAK,YACL,KAAK,UAGT,WAAW,EAAqB,CAC5B,GAAI,GAAuB,EAAe,CACtC,CAAC,EAAK,EAAG,EAAG,GACZ,CAAC,EAAK,MAAO,EAAG,GAChB,CAAC,EAAK,EAAG,EAAG,GACZ,CAAC,EAAK,KAAM,EAAG,GACf,CAAC,EAAK,SAAU,EAAG,IACnB,CAAC,EAAK,MAAO,EAAG,IAChB,CAAC,EAAK,KAAM,EAAG,IACf,CAAC,EAAK,KAAM,EAAG,KACf,CAAC,EAAK,GAAI,EAAG,GACb,CAAC,EAAK,OAAQ,EAAG,GACjB,CAAC,EAAK,KAAM,EAAG,GACf,CAAC,EAAK,KAAM,EAAG,GACf,CAAC,EAAK,KAAM,EAAG,KA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