added scr2floyd utils

This commit is contained in:
Steven Hugg 2018-11-27 15:14:22 -05:00
parent 13a6f92d7b
commit b52f3c2271
10 changed files with 428 additions and 3 deletions

View File

@ -79,6 +79,9 @@ TODO:
- rename, delete, save as
- sdcc: can't link asm files before c files
- what if >1 file with same name? (local/nonlocal/directory)
- can't upload files already exist
- upload files w/o new project
- what if .c and .s names collide?
WEB WORKER FORMAT

View File

@ -12,7 +12,7 @@
/* link in MODE 2 bitmap data */
//#link "bitmaps/sailboat.s"
//#link "sailboat.s"
extern const unsigned char msx_bitmap[0x3807];

View File

@ -14,7 +14,7 @@
//#link "lzg.c"
//#link "bitmaps/sailboat-lzg.s"
//#link "sailboat-lzg.s"
extern const unsigned char msx_bitmap_lzg[];

389
src/platform/msx.ts Normal file
View File

@ -0,0 +1,389 @@
"use strict";
import { Platform, BaseZ80Platform, getToolForFilename_z80 } from "../baseplatform";
import { PLATFORMS, RAM, newAddressDecoder, padBytes, noise, setKeyboardFromMap, AnimationTimer, RasterVideo, Keys, makeKeycodeMap } from "../emu";
import { hex, lzgmini, stringToByteArray } from "../util";
import { MasterAudio, SN76489_Audio } from "../audio";
import { TMS9918A } from "../video/tms9918a";
// https://www.konamiman.com/msx/msx-e.html#msx2th
// https://www.msx.org/wiki/MSX_Cartridge_slot
// http://map.grauw.nl/resources/msx_io_ports.php
// https://openmsx.org/manual/setup.html
// https://www.msx.org/wiki/Slots
// https://www.msx.org/wiki/SDCC
var MSX_PRESETS = [
{id:'helloworld.asm', name:'Hello World (ASM)'},
];
var MSX_KEYCODE_MAP = makeKeycodeMap([
[Keys.VK_UP, 0, 0x1],
[Keys.VK_DOWN, 0, 0x4],
[Keys.VK_LEFT, 0, 0x8],
[Keys.VK_RIGHT, 0, 0x2],
[Keys.VK_SPACE, 0, 0x40],
[Keys.VK_CONTROL, 1, 0x40],
[Keys.VK_W, 2, 0x1],
[Keys.VK_S, 2, 0x4],
[Keys.VK_A, 2, 0x8],
[Keys.VK_D, 2, 0x2],
[Keys.VK_Z, 2, 0x40],
[Keys.VK_X, 3, 0x40],
]);
/// standard emulator
const _MSXPlatform = function(mainElement) {
const cpuFrequency = 3579545; // MHz
const canvasWidth = 304;
const numTotalScanlines = 262;
const numVisibleScanlines = 240;
const cpuCyclesPerLine = Math.round(cpuFrequency / 60 / numTotalScanlines);
var cpu, ram, membus, iobus, rom, bios;
var video, vdp, timer;
var audio, psg;
var inputs = new Uint8Array(4);
var slotmask = 0;
var slots : MSXSlot[];
interface MSXSlot {
read(addr:number) : number;
write(addr:number, val:number) : void;
}
class MSXPlatform extends BaseZ80Platform implements Platform {
getPresets() { return MSX_PRESETS; }
getToolForFilename = getToolForFilename_z80;
getDefaultExtension() { return ".c"; };
start() {
ram = new RAM(0x10000);
bios = new lzgmini().decode(stringToByteArray(atob(MSX1_BIOS_LZG)));
slots = [
// slot 0 : BIOS
{
read: (a) => { return bios[a] | 0; },
write: (a,v) => { }
},
// slot 1: cartridge
{
read: (a) => { return rom[a] | 0; },
write: (a,v) => { }
},
// slot 2 : empty
null,
// slot 3 : RAM
{
read: (a) => { return ram[a] | 0; },
write: (a,v) => { ram[a] = v; }
},
];
// slot mapper
membus = {
read: (a) => {
let shift = (a >> 14) << 1;
let slotnum = (slotmask >> shift) & 3;
let slot = slots[slotnum];
return slot ? slot.read(a) : 0;
},
write: (a,v) => {
let shift = (a >> 14) << 1;
let slotnum = (slotmask >> shift) & 3;
let slot = slots[slotnum];
if (slot) slot.write(a, v);
},
isContended: function() { return false; },
};
iobus = {
read: function(addr) {
addr &= 0xff;
//console.log('IO read', hex(addr,4));
switch (addr) {
case 0x98: return vdp.readData();
case 0x99: return vdp.readStatus();
case 0xa8: return slotmask;
}
return 0;
},
write: function(addr, val) {
addr &= 0xff;
val &= 0xff;
//console.log('IO write', hex(addr,4), hex(val,2));
switch (addr) {
case 0x98: vdp.writeData(val); break;
case 0x99: vdp.writeAddress(val); break;
case 0xa8: slotmask = val; break;
}
}
};
cpu = this.newCPU(membus, iobus);
video = new RasterVideo(mainElement,canvasWidth,numVisibleScanlines);
video.create();
audio = new MasterAudio();
psg = new SN76489_Audio(audio);
var cru = {
setVDPInterrupt: (b) => {
if (b) {
cpu.nonMaskableInterrupt();
} else {
// TODO: reset interrupt?
}
}
};
vdp = new TMS9918A(video.canvas, cru, false);
setKeyboardFromMap(video, inputs, MSX_KEYCODE_MAP);
timer = new AnimationTimer(60, this.nextFrame.bind(this));
}
readAddress(addr) {
return membus.read(addr);
}
advance(novideo : boolean) {
for (var sl=0; sl<numTotalScanlines; sl++) {
this.runCPU(cpu, cpuCyclesPerLine);
if (sl < numVisibleScanlines)
vdp.drawScanline(sl);
}
vdp.updateCanvas();
}
loadROM(title, data) {
rom = padBytes(data, 0x10000);
this.reset();
}
loadState(state) {
cpu.loadState(state.c);
ram.mem.set(state.b);
vdp.restoreState(state.vdp);
inputs.set(state.in);
slotmask = state.sm;
}
saveState() {
return {
c:this.getCPUState(),
b:ram.mem.slice(0),
vdp:vdp.getState(),
in:inputs.slice(0),
sm:slotmask,
};
}
loadControlsState(state) {
inputs.set(state.in);
}
saveControlsState() {
return {
in:inputs.slice(0)
};
}
getCPUState() {
return cpu.saveState();
}
isRunning() {
return timer && timer.isRunning();
}
pause() {
timer.stop();
audio.stop();
}
resume() {
timer.start();
audio.start();
}
reset() {
cpu.reset();
cpu.setTstates(0);
}
getDebugCategories() {
return super.getDebugCategories().concat(['VDP']);
}
getDebugInfo(category, state) {
switch (category) {
case 'VDP': return this.vdpStateToLongString(state.vdp);
default: return super.getDebugInfo(category, state);
}
}
vdpStateToLongString(ppu) {
return vdp.getRegsString();
}
}
return new MSXPlatform();
}
///
PLATFORMS['msx'] = _MSXPlatform;
///
var MSX1_BIOS_LZG = `
TFpHAADAAAAAI8Sp+W4NAVo7UZPzwxINvxuYmMPtEADDvyMAw/+T4QAkAMMbEQDDNJPhIZPhc5Ph
JxEhAgAAAMM5EZOhk+HmGMNOEcNYEcMWAsMiAsMuAsNFAsNNAsNVAsNgAsNtAsOB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DsG
AVEnUUZRJx47BTCT4lHSUZ4BAVE5OwsQUU07BnQYGBiBkwIICDtEClELUQZRDTsHkFGak+GTAxiT
pBiBUW47BrRRq1EsUVU7CEA7AliT4pMCOwffUYWAURCEOwUhBDtmAwSTDVHOAICAgYKDhIWGhzsj
JpMJiImKi4yNjo+QjJMK45GSkwCUjJWWUUSXOwkQ5JiZmoyMm5ydnp+goaKjnaSlpp2TAYzkp6ip
jIyqq4yMrK2ur4yMsLGys7OztIzktbVRLraTYbe4ubqMjLu8vb6+v8CM5MHCw4yMxMXFxsfIycrL
zM3OxcXFz9CM5NHC0jsLgZMF5NPU1dbX2Nna2zsHC1YwLjI55IDc3d7C3+Dh4pMM5VoGXW2TH5Mf
kx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+T
H5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mf
kx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+T
H5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+TH5Mfkx+THpMc/w==
`;

View File

@ -63,7 +63,7 @@ export class CodeProject {
files.push(fn);
// look for files in current (main file) folder
var dir = getFolderForPath(this.mainpath);
if (dir.length > 0)
if (dir.length > 0 && dir != 'local') // TODO
files.push(dir + '/' + fn);
}

19
tools/Makefile Normal file
View File

@ -0,0 +1,19 @@
all: binaries images/parrot.c
%.hex: %
cat $< | hexdump -v -e '"\n.byte" 16/1 ",0x%02x"' | sed "s/byte,/byte /" > $@
%.c: %.CHR.lzg.hex %.CLR.lzg.hex
echo "// MSX mode 2 data" > $@
xxd -i $(word 1,$^) >> $@
xxd -i $(word 2,$^) >> $@
%.lzg: %
lzg -9 $< $@
%.CHR: %.tga
./scr2floyd_percept $<
binaries: scr2floyd scr2floyd_percept galois

14
tools/convertmode2.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
./scr2floyd_percept $1.tga
lzg -9 $1.CHR > $1.CHR.lzg
lzg -9 $1.CLR > $1.CLR.lzg
rm -f $1.s
echo "\t.area _CODE" >> $1.s
echo "\t.globl _msx_mode2_pattern_lzg" >> $1.s
echo "\t.globl _msx_mode2_color_lzg" >> $1.s
echo "\n_msx_mode2_pattern_lzg:" >> $1.s
cat $1.CHR.lzg | hexdump -v -e '"\n.db " 16/1 ",0x%02x"' | sed "s/n.db,/ .db /" | tail -n +3 >> $1.s
echo "\n_msx_mode2_color_lzg:" >> $1.s
cat $1.CLR.lzg | hexdump -v -e '"\n.db " 16/1 ",0x%02x"' | sed "s/n.db,/ .db /" | tail -n +3 >> $1.s

BIN
tools/images/parrot.tga Normal file

Binary file not shown.