2017-12-30 17:48:30 +00:00
|
|
|
|
2019-10-26 01:55:50 +00:00
|
|
|
import { Platform, BaseMAMEPlatform, getOpcodeMetadata_6502, getToolForFilename_6502 } from "../common/baseplatform";
|
|
|
|
import { PLATFORMS } from "../common/emu";
|
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'},
|
2019-09-08 21:42:32 +00:00
|
|
|
{id:'farmhouse.c', name:"Farmhouse Adventure"},
|
|
|
|
{id:'yum.c', name:"Yum Dice Game"},
|
2020-07-12 22:21:54 +00:00
|
|
|
{id:'lzgtest.c', name:"LZG Decompressor (C)"},
|
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)"},
|
2020-07-12 22:21:54 +00:00
|
|
|
{id:'lz4fh.a', name:"LZ4FH Decompressor (ASM)"},
|
2020-07-16 00:01:28 +00:00
|
|
|
{id:'deltamod.dasm', name:"Delta Modulation (ASM)"},
|
2020-06-14 01:28:58 +00:00
|
|
|
// {id:'zap.dasm', name:"ZAP! (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, {
|
2020-07-29 20:21:28 +00:00
|
|
|
jsfile:'mame8bitws.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-10-26 01:55:50 +00:00
|
|
|
import { Base6502MachinePlatform } from "../common/baseplatform";
|
2020-07-24 02:52:53 +00:00
|
|
|
import { CodeAnalyzer_apple2 } from "../common/analysis";
|
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); }
|
2020-01-27 05:59:09 +00:00
|
|
|
// TODO loadBIOS(bios) { this.machine.loadBIOS(a); }
|
2019-08-27 16:12:56 +00:00
|
|
|
getMemoryMap = function() { return { main:[
|
2020-07-06 17:47:24 +00:00
|
|
|
{name:'Zero Page RAM',start:0x0,size:0x100,type:'ram'},
|
|
|
|
{name:'Line Input RAM',start:0x200,size:0x100,type:'ram'},
|
|
|
|
{name:'RAM',start:0x300,size:0xc0,type:'ram'},
|
|
|
|
{name:'DOS Vectors',start:0x3c0,size:0x40,type:'ram'},
|
|
|
|
{name:'Text/Lores Page 1',start:0x400,size:0x400,type:'ram'},
|
|
|
|
{name:'RAM',start:0x800,size:0x1800,type:'ram'},
|
|
|
|
{name:'Hires Page 1',start:0x2000,size:0x2000,type:'ram'},
|
|
|
|
{name:'Hires Page 2',start:0x4000,size:0x2000,type:'ram'},
|
|
|
|
{name:'RAM',start:0x6000,size:0x6000,type:'ram'},
|
2019-08-27 16:12:56 +00:00
|
|
|
{name:'I/O',start:0xc000,size:0x1000,type:'io'},
|
|
|
|
{name:'ROM',start:0xd000,size:0x3000-6,type:'rom'},
|
|
|
|
] } };
|
2020-07-11 14:51:26 +00:00
|
|
|
getROMExtension(rom:Uint8Array) {
|
|
|
|
if (rom && rom.length == 35*16*256) return ".dsk"; // DSK image
|
|
|
|
return ".bin";
|
|
|
|
};
|
2020-07-25 23:33:55 +00:00
|
|
|
getToolForFilename = (fn:string) : string => {
|
|
|
|
if (fn.endsWith(".lnk")) return "merlin32";
|
|
|
|
else return getToolForFilename_6502(fn);
|
|
|
|
}
|
2020-07-24 02:52:53 +00:00
|
|
|
/*
|
|
|
|
newCodeAnalyzer() {
|
|
|
|
return new CodeAnalyzer_apple2(this);
|
|
|
|
}
|
|
|
|
getOriginPC() {
|
|
|
|
return 0x803; // TODO?
|
|
|
|
}
|
|
|
|
*/
|
2019-08-22 02:55:32 +00:00
|
|
|
}
|
|
|
|
|
2020-07-24 02:52:53 +00:00
|
|
|
//PLATFORMS['apple2.mame'] = Apple2MAMEPlatform;
|
2019-08-23 14:37:30 +00:00
|
|
|
PLATFORMS['apple2'] = NewApple2Platform;
|