2017-01-07 18:05:02 +00:00
|
|
|
"use strict";
|
2017-12-30 17:48:30 +00:00
|
|
|
|
2018-08-26 02:00:45 +00:00
|
|
|
import { Platform, Base6502Platform, BaseMAMEPlatform, getOpcodeMetadata_6502, getToolForFilename_6502 } from "../baseplatform";
|
2018-12-09 12:44:39 +00:00
|
|
|
import { PLATFORMS, RAM, newAddressDecoder, padBytes, noise, setKeyboardFromMap, AnimationTimer, RasterVideo, Keys, KeyFlags, makeKeycodeMap, dumpRAM } from "../emu";
|
2018-08-16 23:19:20 +00:00
|
|
|
import { hex, lzgmini } from "../util";
|
2019-08-22 20:10:15 +00:00
|
|
|
import { SampleAudio, SampledAudio } from "../audio";
|
2018-08-16 23:19:20 +00:00
|
|
|
|
2018-08-23 12:49:14 +00:00
|
|
|
const APPLE2_PRESETS = [
|
2018-08-05 14:00:53 +00:00
|
|
|
{id:'sieve.c', name:'Sieve'},
|
2018-08-24 00:53:37 +00:00
|
|
|
{id:'keyboardtest.c', name:'Keyboard Test'},
|
2018-08-05 14:00:53 +00:00
|
|
|
{id:'mandel.c', name:'Mandelbrot'},
|
|
|
|
{id:'tgidemo.c', name:'TGI Graphics Demo'},
|
2018-12-08 12:35:48 +00:00
|
|
|
{id:'Eliza.c', name:'Eliza'},
|
2018-08-05 14:00:53 +00:00
|
|
|
{id:'siegegame.c', name:'Siege Game'},
|
|
|
|
{id:'cosmic.c', name:'Cosmic Impalas'},
|
2018-12-08 12:35:48 +00:00
|
|
|
{id:'hgrtest.a', name:"HGR Test (ASM)"},
|
|
|
|
{id:'conway.a', name:"Conway's Game of Life (ASM)"},
|
|
|
|
{id:'lz4fh.a', name:"LZ4FH Graphics Compression (ASM)"},
|
2018-06-19 22:42:02 +00:00
|
|
|
// {id:'tb_6502.s', name:'Tom Bombem (assembler game)'},
|
2017-01-03 15:43:40 +00:00
|
|
|
];
|
2017-01-03 01:42:15 +00:00
|
|
|
|
2018-06-18 08:12:52 +00:00
|
|
|
/// MAME support
|
|
|
|
|
2018-08-26 02:00:45 +00:00
|
|
|
class Apple2MAMEPlatform extends BaseMAMEPlatform implements Platform {
|
2018-06-18 08:12:52 +00:00
|
|
|
|
2018-08-23 12:49:14 +00:00
|
|
|
start () {
|
|
|
|
this.startModule(this.mainElement, {
|
2018-06-18 08:12:52 +00:00
|
|
|
jsfile:'mameapple2e.js',
|
2018-06-22 06:24:52 +00:00
|
|
|
biosfile:['apple2e.zip'],
|
2018-06-18 08:12:52 +00:00
|
|
|
//cfgfile:'nes.cfg',
|
|
|
|
driver:'apple2e',
|
2018-06-22 06:24:52 +00:00
|
|
|
width:280*2,
|
|
|
|
height:192*2,
|
2018-06-18 08:12:52 +00:00
|
|
|
//romfn:'/emulator/cart.nes',
|
|
|
|
//romsize:romSize,
|
|
|
|
//romdata:new lzgmini().decode(lzgRom).slice(0, romSize),
|
|
|
|
preInit:function(_self) {
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-08-23 12:49:14 +00:00
|
|
|
getOpcodeMetadata = getOpcodeMetadata_6502;
|
|
|
|
getDefaultExtension () { return ".c"; };
|
2018-08-26 02:00:45 +00:00
|
|
|
getToolForFilename = getToolForFilename_6502;
|
2018-06-18 08:12:52 +00:00
|
|
|
|
2018-08-23 12:49:14 +00:00
|
|
|
getPresets () { return APPLE2_PRESETS; }
|
2018-06-18 08:12:52 +00:00
|
|
|
|
2018-08-23 12:49:14 +00:00
|
|
|
loadROM (title, data) {
|
2018-06-18 08:12:52 +00:00
|
|
|
this.loadROMFile(data);
|
2018-06-22 06:24:52 +00:00
|
|
|
// TODO
|
2018-06-18 08:12:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-22 02:55:32 +00:00
|
|
|
///
|
|
|
|
|
2019-08-23 01:31:56 +00:00
|
|
|
import { AppleII } from "../machine/apple2";
|
2019-08-23 14:37:30 +00:00
|
|
|
import { Base6502MachinePlatform } from "../baseplatform";
|
2019-08-22 02:55:32 +00:00
|
|
|
|
2019-08-23 14:37:30 +00:00
|
|
|
class NewApple2Platform extends Base6502MachinePlatform<AppleII> implements Platform {
|
2019-08-22 02:55:32 +00:00
|
|
|
|
2019-08-23 14:37:30 +00:00
|
|
|
newMachine() { return new AppleII(); }
|
|
|
|
getPresets() { return APPLE2_PRESETS; }
|
|
|
|
getDefaultExtension() { return ".c"; };
|
|
|
|
readAddress(a) { return this.machine.readConst(a); }
|
|
|
|
// TODO loadBios(bios) { this.machine.loadBIOS(a); }
|
2019-08-22 02:55:32 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
PLATFORMS['apple2.mame'] = Apple2MAMEPlatform;
|
2019-08-23 14:37:30 +00:00
|
|
|
PLATFORMS['apple2'] = NewApple2Platform;
|