1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-08 08:33:32 +00:00
8bitworkshop/src/platform/coleco.ts

67 lines
2.0 KiB
TypeScript
Raw Normal View History

2019-08-25 16:15:22 +00:00
import { ColecoVision } from "../machine/coleco";
import { Platform, BaseZ80MachinePlatform, BaseMAMEPlatform, getToolForFilename_z80 } from "../baseplatform";
import { PLATFORMS } from "../emu";
export var ColecoVision_PRESETS = [
2019-08-05 00:10:14 +00:00
{ id: 'text.c', name: 'Text Mode' },
{ id: 'hello.c', name: 'Scrolling Text' },
{ id: 'text32.c', name: '32-Column Color Text' },
{ id: 'stars.c', name: 'Scrolling Starfield' },
{ id: 'cursorsmooth.c', name: 'Moving Cursor' },
{ id: 'simplemusic.c', name: 'Simple Music' },
{ id: 'musicplayer.c', name: 'Multivoice Music' },
{ id: 'mode2bitmap.c', name: 'Mode 2 Bitmap' },
{ id: 'mode2compressed.c', name: 'Mode 2 Bitmap (LZG)' },
{ id: 'lines.c', name: 'Mode 2 Lines' },
{ id: 'multicolor.c', name: 'Multicolor Mode' },
{ id: 'siegegame.c', name: 'Siege Game' },
{ id: 'shoot.c', name: 'Solarian Game' },
{ id: 'climber.c', name: 'Platform Game' },
];
2019-08-25 16:15:22 +00:00
class ColecoVisionPlatform extends BaseZ80MachinePlatform<ColecoVision> implements Platform {
2018-11-19 14:10:13 +00:00
2019-08-25 16:15:22 +00:00
newMachine() { return new ColecoVision(); }
getPresets() { return ColecoVision_PRESETS; }
getDefaultExtension() { return ".c"; };
readAddress(a) { return this.machine.read(a); }
// TODO loadBios(bios) { this.machine.loadBIOS(a); }
2019-08-05 00:10:14 +00:00
2018-11-19 14:10:13 +00:00
}
/// MAME support
class ColecoVisionMAMEPlatform extends BaseMAMEPlatform implements Platform {
2018-08-23 12:49:14 +00:00
start() {
this.startModule(this.mainElement, {
2019-08-05 00:10:14 +00:00
jsfile: 'mamecoleco.js',
cfgfile: 'coleco.cfg',
biosfile: 'coleco/313 10031-4005 73108a.u2',
driver: 'coleco',
width: 280 * 2,
height: 216 * 2,
romfn: '/emulator/cart.rom',
romsize: 0x8000,
preInit: function(_self) {
},
});
}
2018-08-23 12:49:14 +00:00
loadROM(title, data) {
this.loadROMFile(data);
this.loadRegion(":coleco_cart:rom", data);
}
2018-08-23 12:49:14 +00:00
getPresets() { return ColecoVision_PRESETS; }
2018-08-23 12:49:14 +00:00
getToolForFilename = getToolForFilename_z80;
getDefaultExtension() { return ".c"; };
}
2018-11-19 14:10:13 +00:00
///
2018-11-19 14:10:13 +00:00
PLATFORMS['coleco.mame'] = ColecoVisionMAMEPlatform;
2019-08-05 00:10:14 +00:00
PLATFORMS['coleco'] = ColecoVisionPlatform;