import { MOS6502, MOS6502State } from "../common/cpu/MOS6502"; import { BasicMachine, RasterFrameBased, Bus, ProbeAll } from "../common/devices"; import { KeyFlags, newAddressDecoder, padBytes, Keys, makeKeycodeMap, newKeyboardHandler, EmuHalt, dumpRAM } from "../common/emu"; import { lzgmini, stringToByteArray, hex, rgb2bgr } from "../common/util"; //// WASM Machine import { Machine } from "../common/baseplatform"; import { TrapCondition } from "../common/devices"; import { BaseWASMMachine } from "../common/wasmplatform"; export class ZX_WASMMachine extends BaseWASMMachine implements Machine { numTotalScanlines = 312; cpuCyclesPerLine = 224; joymask0 = 0; reset() { super.reset(); // advance bios this.exports.machine_exec(this.sys, 2000000); // load rom (Z80 header: https://worldofspectrum.org/faq/reference/z80format.htm) if (this.romptr && this.romlen) { // TODO this.exports.machine_load_rom(this.sys, this.romptr, this.romlen); /* var romstart = 0x5ccb; for (var i=0; i