8bitworkshop/src/platform/sms.ts

53 lines
1.7 KiB
TypeScript
Raw Normal View History

2018-11-28 15:31:07 +00:00
2019-08-25 17:01:07 +00:00
import { SG1000, SMS } from "../machine/sms";
2021-07-31 14:52:25 +00:00
import { Platform, BaseZ80MachinePlatform } from "../common/baseplatform";
import { PLATFORMS } from "../common/emu";
2018-11-28 15:31:07 +00:00
// TODO: merge w/ coleco
export var SG1000_PRESETS = [
{id:'text.c', name:'Text Mode'},
{id:'hello.c', name:'Scrolling Text'},
{id:'text32.c', name:'32-Column Color Text'},
2018-11-28 15:31:07 +00:00
{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'},
2019-08-10 01:11:53 +00:00
{id:'climber.c', name:'Climber Game'},
2018-11-28 15:31:07 +00:00
];
2019-08-10 01:11:53 +00:00
export var SMS_PRESETS = [
{id:'mode4test.c', name:'Mode 4 Test'},
{id:'climber.c', name:'Climber Game'},
];
2018-11-28 15:31:07 +00:00
///
2019-08-25 17:01:07 +00:00
class SG1000Platform extends BaseZ80MachinePlatform<SG1000> implements Platform {
2019-08-25 17:01:07 +00:00
newMachine() { return new SG1000(); }
getPresets() { return SG1000_PRESETS; }
getDefaultExtension() { return ".c"; };
readAddress(a) { return this.machine.read(a); }
readVRAMAddress(a) { return this.machine.readVRAMAddress(a); }
2019-08-25 17:01:07 +00:00
}
2019-08-25 17:01:07 +00:00
class SMSPlatform extends BaseZ80MachinePlatform<SMS> implements Platform {
2019-08-25 17:01:07 +00:00
newMachine() { return new SMS(); }
getPresets() { return SMS_PRESETS; }
getDefaultExtension() { return ".c"; };
readAddress(a) { return this.machine.read(a); }
readVRAMAddress(a) { return this.machine.readVRAMAddress(a); }
}
///
PLATFORMS['sms-sg1000-libcv'] = SG1000Platform;
PLATFORMS['sms-sms-libcv'] = SMSPlatform;