1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-19 09:31:24 +00:00
8bitworkshop/gen/mw8080bw-GSZA5VDU.js.map

8 lines
7.0 KiB
Plaintext
Raw Normal View History

{
"version": 3,
"sources": ["../src/machine/mw8080bw.ts", "../src/platform/mw8080bw.ts"],
"sourcesContent": ["\nimport { Z80, Z80State } from \"../common/cpu/ZilogZ80\";\nimport { BasicScanlineMachine } from \"../common/devices\";\nimport { KeyFlags, newAddressDecoder, padBytes, Keys, makeKeycodeMap, newKeyboardHandler } from \"../common/emu\";\nimport { TssChannelAdapter, MasterAudio, AY38910_Audio } from \"../common/audio\";\n\n// http://www.computerarcheology.com/Arcade/\n\nconst SPACEINV_KEYCODE_MAP = makeKeycodeMap([\n [Keys.A, 1, 0x10], // P1\n [Keys.LEFT, 1, 0x20],\n [Keys.RIGHT, 1, 0x40],\n [Keys.P2_A, 2, 0x10], // P2\n [Keys.P2_LEFT, 2, 0x20],\n [Keys.P2_RIGHT, 2, 0x40],\n [Keys.SELECT, 1, 0x1],\n [Keys.START, 1, 0x4],\n [Keys.P2_START, 1, 0x2],\n]);\n\nconst INITIAL_WATCHDOG = 256;\nconst PIXEL_ON = 0xffeeeeee;\nconst PIXEL_OFF = 0xff000000;\n\nexport class Midway8080 extends BasicScanlineMachine {\n\n cpuFrequency = 1996800; // MHz\n canvasWidth = 256;\n numTotalScanlines = 262;\n numVisibleScanlines = 224;\n cpuCyclesPerLine = Math.floor(1996800 / (262*60));\n defaultROMSize = 0x2000;\n rotate = -90;\n sampleRate = 1;\n\n bitshift_offset = 0;\n bitshift_register = 0;\n watchdog_counter;\n \n cpu: Z80 = new Z80();\n ram = new Uint8Array(0x2000);\n\n constructor() {\n super();\n this.connectCPUMemoryBus(this);\n this.connectCPUIOBus(this.newIOBus());\n this.handler = newKeyboardHandler(this.inputs, SPACEINV_KEYCODE_MAP);\n }\n \n read = newAddressDecoder([\n [0x0000, 0x1fff, 0x1fff, (a) => { return this.rom ? this.rom[a] : 0; }],\n [0x2000, 0x3fff, 0x1fff, (a) => { return this.ram[a]; }],\n ]);\n write = newAddressDecoder([\n [0x2000, 0x23ff, 0x3ff, (a, v) => { this.ram[a] = v; }],\n [0x2400, 0x3fff, 0x1fff, (a, v) => {\n this.ram[a] = v;\n var ofs = (a - 0x400) << 3;\n for (var i = 0; i < 8; i++) {\n this.pixels[ofs + i] = (v & (1 << i)) ? PIXEL_ON : PIXEL_OFF;\n }\n //if (displayPCs) displayPCs[a] = cpu.getPC(); // save program counter\n }],\n ]);\n\n newIOBus() {\n return {\n read: (addr) => {\n addr &= 0x3;\n //console.log('IO read', hex(addr,4));\n switch (addr) {\n case 0:\n case 1:\n case 2:\n return this.inputs[addr];\n case 3:\n return (this.bitshift_register >> (8 - this.bitshift_offset)) & 0xff;\n }\n return 0;\n },\n write: (addr, val) => {\n addr &= 0x7;\n val &= 0xff;\n //console.log('IO write', hex(addr,4), hex(val,2));\n switch (addr) {\n case 2:\n this.bitshift_offset = val & 0x7;\n break;\n case 3:\n case 5:\n // TODO: sound\n break;\n case 4:\n this.bitshift_register = (this.bitshift_register >> 8) | (val << 8);\n break;\n case 6:\n this.watchdog_counter = INITIAL_WATCHDOG;\n break;\n }\n }\n };\n }\n\n startScanline() {\n }\n\n drawScanline() {\n // at end of scanline\n if (this.scanline == 95)\n this.interrupt(0xcf); // RST $8\n else if (this.scanline == 223)\n this.interrupt(0xd7); // RST $10\n }\n \n interrupt(data:number) {\n this.probe.logInterrupt(data);\n this.cpu.interrupt(data);\n }\n\n advanceFrame(trap) : number {\n if (this.watchdog_counter-- <= 0) {\n console.log(\"WATCHDOG FIRED\"); // TODO: alert on video\n this.reset();\n }\n return super.advanceFrame(trap);\n }\n\n loadState(state) {\n super.loadState(state);\n this.bitshift_register = state.bsr;\n this.bitshift_offset = state.bso;\n this.watchdog_counter = state.wdc;\n }\n saveState() {\n var state: any = super.saveState();\n state.bsr = this.bitshift_register;\n state.bso = this.bitshift_offset;\n state.wdc = this.watchdog_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