1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-01 20:41:36 +00:00
8bitworkshop/src/platform/galaxian.ts

36 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2017-02-01 18:21:17 +00:00
import { Platform } from "../common/baseplatform";
import { PLATFORMS } from "../common/emu";
import { GalaxianMachine, GalaxianScrambleMachine } from "../machine/galaxian";
import { BaseZ80MachinePlatform } from "../common/baseplatform";
2018-08-23 12:49:14 +00:00
const GALAXIAN_PRESETS = [
2019-08-25 01:11:38 +00:00
{ id: 'gfxtest.c', name: 'Graphics Test' },
{ id: 'shoot2.c', name: 'Solarian Game' },
];
class GalaxianPlatform extends BaseZ80MachinePlatform<GalaxianMachine> implements Platform {
newMachine() { return new GalaxianMachine(); }
getPresets() { return GALAXIAN_PRESETS; }
getDefaultExtension() { return ".c"; };
readAddress(a) { return this.machine.readConst(a); }
readVRAMAddress(a) { return (a < 0x800) ? this.machine.vram[a] : this.machine.oram[a-0x800]; }
// TODO loadBIOS(bios) { this.machine.loadBIOS(a); }
getMemoryMap = function() { return { main:[
{name:'Video RAM',start:0x5000,size:0x400,type:'ram'},
{name:'Sprite RAM',start:0x5800,size:0x100,type:'ram'},
{name:'I/O Registers',start:0x6000,size:0x2000,type:'io'},
] } };
showHelp() { return "https://8bitworkshop.com/docs/platforms/arcade/index.html#galaxian-scramble" }
2019-08-25 01:11:38 +00:00
}
class GalaxianScramblePlatform extends GalaxianPlatform implements Platform {
2019-08-25 01:11:38 +00:00
newMachine() { return new GalaxianScrambleMachine(); }
2017-02-15 21:03:52 +00:00
}
PLATFORMS['galaxian'] = GalaxianPlatform;
PLATFORMS['galaxian-scramble'] = GalaxianScramblePlatform;