Deploying to gh-pages from @ sehugg/8bitworkshop@69600744df 🚀

This commit is contained in:
sehugg 2023-11-01 01:46:35 +00:00
parent 1b7862e27e
commit 9bb6c517c6
37 changed files with 44509 additions and 20 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,287 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.disassembleHuC6280 = exports.OPS_HuC6280 = void 0;
const util_1 = require("../util");
exports.OPS_HuC6280 = [
{ mn: "BRK", am: "", nb: 1, il: 0, c1: 7, c2: 0, nw: 3, br: 1, mod: "SI" },
{ mn: "ORA", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "SXY", am: "", nb: 1, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "XY" },
{ mn: "ST0", am: "#aa", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "TSB", am: "aa", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "NZV" },
{ mn: "ORA", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ASL", am: "aa", nb: 2, il: 0, c1: 5, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RMB0", am: "aa", nb: 2, il: 0, c1: 7, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "PHP", am: "", nb: 1, il: 0, c1: 3, c2: 0, nw: 1, br: 0, mod: "S" },
{ mn: "ORA", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ASL", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "ANC", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "TSB", am: "AAAA", nb: 3, il: 0, c1: 7, c2: 0, nw: 0, br: 0, mod: "NZV" },
{ mn: "ORA", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ASL", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "BBR0", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "" },
// TODO: finish these
{ mn: "BPL", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "ORA", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "SLO", am: "(aa),y", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "aa,x", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ORA", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ASL", am: "aa,x", nb: 2, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "SLO", am: "aa,x", nb: 2, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "CLC", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "C" },
{ mn: "ORA", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "NOP", am: "", nb: 1, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "SLO", am: "AAAA,y", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "AAAA,x", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ORA", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "ASL", am: "AAAA,x", nb: 3, il: 0, c1: 7, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "SLO", am: "AAAA,x", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "JSR", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 1, mod: "S" },
{ mn: "AND", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "RLA", am: "(aa,x)", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "BIT", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "ZVN" },
{ mn: "AND", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ROL", am: "aa", nb: 2, il: 0, c1: 5, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RLA", am: "aa", nb: 2, il: 1, c1: 5, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "PLP", am: "", nb: 1, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "SCZIDVN" },
{ mn: "AND", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ROL", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "ANC", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "BIT", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "ZVN" },
{ mn: "AND", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ROL", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RLA", am: "AAAA", nb: 3, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "BMI", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "AND", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "RLA", am: "(aa),y", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "aa,x", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "AND", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ROL", am: "aa,x", nb: 2, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RLA", am: "aa,x", nb: 2, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "SEC", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "C" },
{ mn: "AND", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "NOP", am: "", nb: 1, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "RLA", am: "AAAA,y", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "AAAA,x", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "AND", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "ROL", am: "AAAA,x", nb: 3, il: 0, c1: 7, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RLA", am: "AAAA,x", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "RTI", am: "", nb: 1, il: 0, c1: 6, c2: 0, nw: 0, br: 1, mod: "SCZIDVN" },
{ mn: "EOR", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "SRE", am: "(aa,x)", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "aa", nb: 2, il: 1, c1: 3, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "EOR", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LSR", am: "aa", nb: 2, il: 0, c1: 5, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "SRE", am: "aa", nb: 2, il: 1, c1: 5, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "PHA", am: "", nb: 1, il: 0, c1: 3, c2: 0, nw: 1, br: 0, mod: "S" },
{ mn: "EOR", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LSR", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "ASR", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "JMP", am: "AAAA", nb: 3, il: 0, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "EOR", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LSR", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "SRE", am: "AAAA", nb: 3, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "BVC", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "EOR", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "SRE", am: "(aa),y", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "aa,x", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "EOR", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LSR", am: "aa,x", nb: 2, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "SRE", am: "aa,x", nb: 2, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "CLI", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "I" },
{ mn: "EOR", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "NOP", am: "", nb: 1, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "SRE", am: "AAAA,y", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "NOP", am: "AAAA,x", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "EOR", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "LSR", am: "AAAA,x", nb: 3, il: 0, c1: 7, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "SRE", am: "AAAA,x", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZN" },
{ mn: "RTS", am: "", nb: 1, il: 0, c1: 6, c2: 0, nw: 0, br: 1, mod: "S" },
{ mn: "ADC", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "RRA", am: "(aa,x)", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "aa", nb: 2, il: 1, c1: 3, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ADC", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "ROR", am: "aa", nb: 2, il: 0, c1: 5, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RRA", am: "aa", nb: 2, il: 1, c1: 5, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "PLA", am: "", nb: 1, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "SAZN" },
{ mn: "ADC", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "ROR", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZN" },
{ mn: "ARR", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "JMP", am: "(AAAA)", nb: 3, il: 0, c1: 5, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "ADC", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "ROR", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RRA", am: "AAAA", nb: 3, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "BVS", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "ADC", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "RRA", am: "(aa),y", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "aa,x", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ADC", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "ROR", am: "aa,x", nb: 2, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RRA", am: "aa,x", nb: 2, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "SEI", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "I" },
{ mn: "ADC", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "", nb: 1, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "RRA", am: "AAAA,y", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "AAAA,x", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ADC", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "ROR", am: "AAAA,x", nb: 3, il: 0, c1: 7, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "RRA", am: "AAAA,x", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "BRA", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "STA", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "NOP", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "SAX", am: "(aa,x)", nb: 2, il: 1, c1: 6, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STY", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STA", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STX", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "SAX", am: "aa", nb: 2, il: 1, c1: 3, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "DEY", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "NOP", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "TXA", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "ANE", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "STY", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STA", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STX", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "SAX", am: "AAAA", nb: 3, il: 1, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "BCC", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "STA", am: "(aa),y", nb: 2, il: 0, c1: 6, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "SHA", am: "(aa),y", nb: 2, il: 1, c1: 6, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STY", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STA", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STX", am: "aa,y", nb: 2, il: 0, c1: 4, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "SAX", am: "aa,y", nb: 3, il: 1, c1: 4, c2: 0, nw: 1, br: 1, mod: "" },
{ mn: "TYA", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "STA", am: "AAAA,y", nb: 3, il: 0, c1: 5, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "TXS", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "S" },
{ mn: "SHS", am: "AAAA,y", nb: 3, il: 1, c1: 5, c2: 0, nw: 1, br: 0, mod: "S" },
{ mn: "SHY", am: "AAAA,x", nb: 3, il: 1, c1: 5, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "STA", am: "AAAA,x", nb: 3, il: 0, c1: 5, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "SHX", am: "AAAA,y", nb: 3, il: 1, c1: 5, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "SHA", am: "AAAA,y", nb: 3, il: 1, c1: 5, c2: 0, nw: 1, br: 0, mod: "" },
{ mn: "LDY", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "LDA", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LDX", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "LAX", am: "(aa,x)", nb: 2, il: 1, c1: 6, c2: 0, nw: 0, br: 0, mod: "AXZN" },
{ mn: "LDY", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "LDA", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LDX", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "LAX", am: "aa", nb: 2, il: 1, c1: 3, c2: 0, nw: 0, br: 0, mod: "AXZN" },
{ mn: "TAY", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "LDA", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "TAX", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "LXA", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "AXZN" },
{ mn: "LDY", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "LDA", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LDX", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "LAX", am: "AAAA", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "AXZN" },
{ mn: "BCS", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "LDA", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "LAX", am: "(aa),y", nb: 2, il: 1, c1: 5, c2: 1, nw: 0, br: 0, mod: "AXZN" },
{ mn: "LDY", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "LDA", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "AZN" },
{ mn: "LDX", am: "aa,y", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "LAX", am: "aa,y", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "AXZN" },
{ mn: "CLV", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "V" },
{ mn: "LDA", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "TSX", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "LAS", am: "AAAA,y", nb: 3, il: 1, c1: 4, c2: 1, nw: 0, br: 0, mod: "SAXZN" },
{ mn: "LDY", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "YZN" },
{ mn: "LDA", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "AZN" },
{ mn: "LDX", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "XZN" },
{ mn: "LAX", am: "AAAA,y", nb: 3, il: 1, c1: 4, c2: 1, nw: 0, br: 0, mod: "AXZN" },
{ mn: "CPY", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "CMP", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "NOP", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "DCP", am: "(aa,x)", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "CPY", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "CMP", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "DEC", am: "aa", nb: 2, il: 0, c1: 5, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "DCP", am: "aa", nb: 2, il: 1, c1: 5, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "INY", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "YZN" },
{ mn: "CMP", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "DEX", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "SBX", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "XCZN" },
{ mn: "CPY", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "CMP", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "DEC", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "DCP", am: "AAAA", nb: 3, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "BNE", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "CMP", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "CZN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "DCP", am: "(aa),y", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "NOP", am: "aa,x", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "CMP", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "DEC", am: "aa,x", nb: 2, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "DCP", am: "aa,x", nb: 2, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "CLD", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "D" },
{ mn: "CMP", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "CZN" },
{ mn: "NOP", am: "", nb: 1, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "DCP", am: "AAAA,y", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "NOP", am: "AAAA,x", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "CMP", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "CZN" },
{ mn: "DEC", am: "AAAA,x", nb: 3, il: 0, c1: 7, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "DCP", am: "AAAA,x", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "CZN" },
{ mn: "CPX", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "SBC", am: "(aa,x)", nb: 2, il: 0, c1: 6, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ISB", am: "(aa,x)", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "CPX", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "SBC", am: "aa", nb: 2, il: 0, c1: 3, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "INC", am: "aa", nb: 2, il: 0, c1: 5, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "ISB", am: "aa", nb: 2, il: 1, c1: 5, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "INX", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "XZN" },
{ mn: "SBC", am: "#aa", nb: 2, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "SBC", am: "#aa", nb: 2, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "CPX", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "CZN" },
{ mn: "SBC", am: "AAAA", nb: 3, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "INC", am: "AAAA", nb: 3, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "ISB", am: "AAAA", nb: 3, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "BEQ", am: "branch", nb: 2, il: 0, c1: 2, c2: 2, nw: 0, br: 1, mod: "" },
{ mn: "SBC", am: "(aa),y", nb: 2, il: 0, c1: 5, c2: 1, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "KIL", am: "", nb: 1, il: 2, c1: 3, c2: 0, nw: 0, br: 1, mod: "" },
{ mn: "ISB", am: "(aa),y", nb: 2, il: 1, c1: 8, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "aa,x", nb: 2, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "SBC", am: "aa,x", nb: 2, il: 0, c1: 4, c2: 0, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "INC", am: "aa,x", nb: 2, il: 0, c1: 6, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "ISB", am: "aa,x", nb: 2, il: 1, c1: 6, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "SED", am: "", nb: 1, il: 0, c1: 2, c2: 0, nw: 0, br: 0, mod: "D" },
{ mn: "SBC", am: "AAAA,y", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "", nb: 1, il: 1, c1: 2, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "ISB", am: "AAAA,y", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZVN" },
{ mn: "NOP", am: "AAAA,x", nb: 3, il: 1, c1: 4, c2: 0, nw: 0, br: 0, mod: "" },
{ mn: "SBC", am: "AAAA,x", nb: 3, il: 0, c1: 4, c2: 1, nw: 0, br: 0, mod: "ACZVN" },
{ mn: "INC", am: "AAAA,x", nb: 3, il: 0, c1: 7, c2: 0, nw: 2, br: 0, mod: "ZN" },
{ mn: "ISB", am: "AAAA,x", nb: 3, il: 1, c1: 7, c2: 0, nw: 2, br: 0, mod: "ACZVN" }, // ff
];
function disassembleHuC6280(pc, b0, b1, b2) {
var op = exports.OPS_HuC6280[b0];
if (op == null)
return { line: "???", nbytes: 1, isaddr: false };
var s = op.mn;
var am = op.am;
var isaddr = false;
if (am == 'branch') {
var offset = (b1 < 0x80) ? (pc + 2 + b1) : (pc + 2 - (256 - b1));
offset &= 0xffff;
am = '$' + (0, util_1.hex)(offset, 4);
isaddr = true;
}
else {
am = am.replace('aa', '$' + (0, util_1.hex)(b1, 2));
am = am.replace('AAAA', '$' + (0, util_1.hex)(b1 + (b2 << 8), 4));
if (am.indexOf('#') < 0 && am.indexOf('$') >= 0)
isaddr = true;
}
return { line: op.mn + " " + am, nbytes: op.nb, isaddr: isaddr };
}
exports.disassembleHuC6280 = disassembleHuC6280;
;
//# sourceMappingURL=disasmHuC6280.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-6LSEFRMB.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-QHCN4ZOY.js";import{I as m,o as u,t as h}from"./chunk-TV4YGKI4.js";import{$ as i,B as o,J as l,m as n}from"./chunk-Z5CU44VP.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new h;this.ram=new Uint8Array(16384);this.read=i([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=i([[0,16383,16383,(e,t)=>{this.ram[e]=t}],[16387,16387,65535,(e,t)=>this.serial.sendByte(t)],[16399,16399,65535,(e,t)=>{this.inputs[s]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var t=0;t<this.cpuFrequency/60&&!(e&&e());)t+=this.advanceCPU();return t}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[s]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[s]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],f=class{constructor(e){e.style.overflowY="auto";var t=$('<div id="gameport"/>').appendTo(e);$('<p class="transcript-header">Serial Output</p>').appendTo(t);var y=$('<div id="windowport" class="transcript"/>').appendTo(t);this.div=y[0]}start(){this.tty=new d(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(e){this.tty.loadState(e)}};function p(r){return r==10?"":r<32?String.fromCharCode(r+9216):String.fromCharCode(r)}var v=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(e){this.clearToSend()&&(this.outputBytes.push(e),this.viewer.tty.addtext(p(e),2|32),e==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var e=this.readIndex();this.inputIndex=e;var t=(this.inputBytes&&this.inputBytes[e])|0;return this.viewer.tty.addtext(p(t),2|16),t==10&&this.viewer.tty.newline(),t}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(e){this.clk+=e}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(e){this.clk=e.clk,this.inputIndex=e.idx,this.outputBytes=e.out.slice()}},x=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new f(e)}async start(){super.start(),this.serial=new v,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=o(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=n(this.serial.outputBytes),c(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new a}getPresets(){return S}getDefaultExtension(){return".dasm"}readAddress(e){return this.machine.readConst(e)}};l["devel-6502"]=x;export{v as SerialTestHarness};
//# sourceMappingURL=devel-GTWJAFXM.js.map
import{a as d}from"./chunk-3XE5YOCV.js";import{o as c}from"./chunk-VD7T557T.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-AT7M4NIM.js";import{I as m,o as u,t as h}from"./chunk-TV4YGKI4.js";import{$ as i,B as o,J as l,m as n}from"./chunk-Z5CU44VP.js";import"./chunk-5XVCUSSZ.js";var s=31,a=class extends u{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new h;this.ram=new Uint8Array(16384);this.read=i([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=i([[0,16383,16383,(e,t)=>{this.ram[e]=t}],[16387,16387,65535,(e,t)=>this.serial.sendByte(t)],[16399,16399,65535,(e,t)=>{this.inputs[s]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var t=0;t<this.cpuFrequency/60&&!(e&&e());)t+=this.advanceCPU();return t}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[s]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[s]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],f=class{constructor(e){e.style.overflowY="auto";var t=$('<div id="gameport"/>').appendTo(e);$('<p class="transcript-header">Serial Output</p>').appendTo(t);var y=$('<div id="windowport" class="transcript"/>').appendTo(t);this.div=y[0]}start(){this.tty=new d(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(e){this.tty.loadState(e)}};function p(r){return r==10?"":r<32?String.fromCharCode(r+9216):String.fromCharCode(r)}var v=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(e){this.clearToSend()&&(this.outputBytes.push(e),this.viewer.tty.addtext(p(e),2|32),e==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var e=this.readIndex();this.inputIndex=e;var t=(this.inputBytes&&this.inputBytes[e])|0;return this.viewer.tty.addtext(p(t),2|16),t==10&&this.viewer.tty.newline(),t}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(e){this.clk+=e}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(e){this.clk=e.clk,this.inputIndex=e.idx,this.outputBytes=e.out.slice()}},x=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new f(e)}async start(){super.start(),this.serial=new v,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=o(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=n(this.serial.outputBytes),c(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new a}getPresets(){return S}getDefaultExtension(){return".dasm"}readAddress(e){return this.machine.readConst(e)}};l["devel-6502"]=x;export{v as SerialTestHarness};
//# sourceMappingURL=devel-TVAWHFKG.js.map

View File

@ -1,2 +1,2 @@
import{b as w,c as x}from"./chunk-QHCN4ZOY.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-Z5CU44VP.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
import{b as w,c as x}from"./chunk-AT7M4NIM.js";import{D as v,J as c,k as m,l as u,x as g,z as p}from"./chunk-Z5CU44VP.js";import{e as I}from"./chunk-5XVCUSSZ.js";var h=I(x()),i,a,l,y=function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r}(window.location.search.substr(1).split("&"));function P(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function k(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){v("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{k(r,f)},"arraybuffer"),!0;if(n){var s=u(atob(n));t=new m().decode(s)}return M(),k(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await w(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){P(),y.p&&b(y)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,h.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
//# sourceMappingURL=embedui.js.map

2
gen/pce-G33KDEJG.js Normal file

File diff suppressed because one or more lines are too long

7
gen/pce-G33KDEJG.js.map Normal file

File diff suppressed because one or more lines are too long

View File

@ -43,6 +43,7 @@ function importPlatform(name) {
case "msx": return Promise.resolve().then(() => __importStar(require("../platform/msx")));
case "mw8080bw": return Promise.resolve().then(() => __importStar(require("../platform/mw8080bw")));
case "nes": return Promise.resolve().then(() => __importStar(require("../platform/nes")));
case "pce": return Promise.resolve().then(() => __importStar(require("../platform/pce")));
case "script": return Promise.resolve().then(() => __importStar(require("../platform/script")));
case "sms": return Promise.resolve().then(() => __importStar(require("../platform/sms")));
case "sound_konami": return Promise.resolve().then(() => __importStar(require("../platform/sound_konami")));

View File

@ -1 +1 @@
{"version":3,"file":"_index.js","sourceRoot":"","sources":["../../src/platform/_index.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,SAAgB,cAAc,CAAC,IAAY;IACvC,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,WAAW,CAAC,CAAC,yDAAc,uBAAuB,IAAE;QACzD,KAAK,WAAW,CAAC,CAAC,yDAAc,uBAAuB,IAAE;QACzD,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,MAAM,CAAC,CAAC,yDAAc,kBAAkB,IAAE;QAC/C,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,cAAc,CAAC,CAAC,yDAAc,0BAA0B,IAAE;QAC/D,KAAK,gBAAgB,CAAC,CAAC,yDAAc,4BAA4B,IAAE;QACnE,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,SAAS,CAAC,CAAC,yDAAc,qBAAqB,IAAE;QACrD,KAAK,SAAS,CAAC,CAAC,yDAAc,qBAAqB,IAAE;QACrD,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,SAAS,CAAC,CAAC,yDAAc,qBAAqB,IAAE;QACrD,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,IAAI,CAAC,CAAC,yDAAc,gBAAgB,IAAE;QAC3C,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,GAAG,CAAC,CAAA;KAC/D;AACH,CAAC;AAlCH,wCAkCG"}
{"version":3,"file":"_index.js","sourceRoot":"","sources":["../../src/platform/_index.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,SAAgB,cAAc,CAAC,IAAY;IACvC,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,WAAW,CAAC,CAAC,yDAAc,uBAAuB,IAAE;QACzD,KAAK,WAAW,CAAC,CAAC,yDAAc,uBAAuB,IAAE;QACzD,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,MAAM,CAAC,CAAC,yDAAc,kBAAkB,IAAE;QAC/C,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,cAAc,CAAC,CAAC,yDAAc,0BAA0B,IAAE;QAC/D,KAAK,gBAAgB,CAAC,CAAC,yDAAc,4BAA4B,IAAE;QACnE,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,QAAQ,CAAC,CAAC,yDAAc,oBAAoB,IAAE;QACnD,KAAK,SAAS,CAAC,CAAC,yDAAc,qBAAqB,IAAE;QACrD,KAAK,SAAS,CAAC,CAAC,yDAAc,qBAAqB,IAAE;QACrD,KAAK,OAAO,CAAC,CAAC,yDAAc,mBAAmB,IAAE;QACjD,KAAK,SAAS,CAAC,CAAC,yDAAc,qBAAqB,IAAE;QACrD,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,KAAK,CAAC,CAAC,yDAAc,iBAAiB,IAAE;QAC7C,KAAK,UAAU,CAAC,CAAC,yDAAc,sBAAsB,IAAE;QACvD,KAAK,IAAI,CAAC,CAAC,yDAAc,gBAAgB,IAAE;QAC3C,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,GAAG,CAAC,CAAA;KAC/D;AACH,CAAC;AAnCH,wCAmCG"}

3146
gen/platform/pce.js Normal file

File diff suppressed because it is too large Load Diff

1
gen/platform/pce.js.map Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w}from"./chunk-6LSEFRMB.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-QHCN4ZOY.js";import"./chunk-TV4YGKI4.js";import"./chunk-Z5CU44VP.js";import"./chunk-5XVCUSSZ.js";export{l as clearBreakpoint,h as compparams,f as current_project,u as emulationHalted,p as getPlatformAndRepo,t as getSaveState,s as getTestOutput,n as haltEmulation,w as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,v as reloadWorkspaceFile,d as repo_id,k as runToPC,m as setFrameRateUI,r as setTestInput,j as setupBreakpoint,o as setupSplits,q as startUI,c as store_id};
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w}from"./chunk-VD7T557T.js";import"./chunk-SXEVG2WS.js";import"./chunk-5SHCNQ2O.js";import"./chunk-AT7M4NIM.js";import"./chunk-TV4YGKI4.js";import"./chunk-Z5CU44VP.js";import"./chunk-5XVCUSSZ.js";export{l as clearBreakpoint,h as compparams,f as current_project,u as emulationHalted,p as getPlatformAndRepo,t as getSaveState,s as getTestOutput,n as haltEmulation,w as highlightSearch,i as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,v as reloadWorkspaceFile,d as repo_id,k as runToPC,m as setFrameRateUI,r as setTestInput,j as setupBreakpoint,o as setupSplits,q as startUI,c as store_id};
//# sourceMappingURL=ui.js.map

View File

@ -2799,6 +2799,12 @@
var aout = FS.readFile("main", { encoding: "binary" });
var mapout = FS.readFile("main.map", { encoding: "utf8" });
var viceout = FS.readFile("main.vice", { encoding: "utf8" });
if (step.platform == "pce" && aout.length > 8192) {
let newrom = new Uint8Array(aout.length);
newrom.set(aout.slice(aout.length - 8192), 0);
newrom.set(aout.slice(0, aout.length - 8192), 8192);
aout = newrom;
}
putWorkFile("main", aout);
putWorkFile("main.map", mapout);
putWorkFile("main.vice", viceout);
@ -9191,6 +9197,12 @@ ${this.scopeSymbol(name)} = ${name}::__Start`;
extra_compile_files: ["cpctelera.h"],
extra_link_args: ["crt0-cpc.rel", "cpctelera.lib"],
extra_link_files: ["crt0-cpc.rel", "crt0-cpc.lst", "cpctelera.lib", "cpctelera.lst"]
},
"pce": {
arch: "huc6280",
define: ["__PCE__"],
cfgfile: "pce.cfg",
libargs: ["pce.lib", "-D", "__CARTSIZE__=0x8000"]
}
};
PLATFORM_PARAMS["sms-sms-libcv"] = PLATFORM_PARAMS["sms-sg1000-libcv"];
@ -9869,6 +9881,8 @@ ${this.scopeSymbol(name)} = ${name}::__Start`;
"ca65-devel": "65-none",
"cc65-vcs": "65-atari2600",
"ca65-vcs": "65-atari2600",
"cc65-pce": "65-pce",
"ca65-pce": "65-pce",
"sdasz80": "sdcc",
"sdcc": "sdcc",
"sccz80": "sccz80",

File diff suppressed because one or more lines are too long

View File

@ -188,6 +188,14 @@ function linkLD65(step) {
var aout = FS.readFile("main", { encoding: 'binary' });
var mapout = FS.readFile("main.map", { encoding: 'utf8' });
var viceout = FS.readFile("main.vice", { encoding: 'utf8' });
// correct binary for PCEngine
if (step.platform == 'pce' && aout.length > 0x2000) {
// move 8 KB from end to front
let newrom = new Uint8Array(aout.length);
newrom.set(aout.slice(aout.length - 0x2000), 0);
newrom.set(aout.slice(0, aout.length - 0x2000), 0x2000);
aout = newrom;
}
//var dbgout = FS.readFile("main.dbg", {encoding:'utf8'});
(0, workermain_1.putWorkFile)("main", aout);
(0, workermain_1.putWorkFile)("main.map", mapout);

File diff suppressed because one or more lines are too long

View File

@ -405,6 +405,12 @@ var PLATFORM_PARAMS = {
extra_link_args: ['crt0-cpc.rel', 'cpctelera.lib'],
extra_link_files: ['crt0-cpc.rel', 'crt0-cpc.lst', 'cpctelera.lib', 'cpctelera.lst'],
},
'pce': {
arch: 'huc6280',
define: ['__PCE__'],
cfgfile: 'pce.cfg',
libargs: ['pce.lib', '-D', '__CARTSIZE__=0x8000'],
},
};
PLATFORM_PARAMS['sms-sms-libcv'] = PLATFORM_PARAMS['sms-sg1000-libcv'];
PLATFORM_PARAMS['sms-gg-libcv'] = PLATFORM_PARAMS['sms-sms-libcv'];
@ -1173,6 +1179,8 @@ var TOOL_PRELOADFS = {
'ca65-devel': '65-none',
'cc65-vcs': '65-atari2600',
'ca65-vcs': '65-atari2600',
'cc65-pce': '65-pce',
'ca65-pce': '65-pce',
'sdasz80': 'sdcc',
'sdcc': 'sdcc',
'sccz80': 'sccz80',

File diff suppressed because one or more lines are too long

View File

@ -208,6 +208,7 @@ body {
<li><a class="dropdown-item" href="?platform=nes.mame">NES (MAME)</a></li>
<hr>
<li><a class="dropdown-item" href="?platform=williams">Williams (6809)</a></li>
<li><a class="dropdown-item" href="?platform=pce">PC Engine</a></li>
</ul>
</li>
</ul>
@ -313,7 +314,7 @@ body {
<span class="control-def"><span class="control-key">&#x2190;&#x2191;&#x2193;&#x2192;</span> Joystick</span>
<span class="control-def"><span class="control-key small">Space</span> Button</span>
</div>
<div class="emucontrols-nes emucontrols-atari7800 text-center small control-insns" style="display:none">
<div class="emucontrols-nes emucontrols-atari7800 emucontrols-pce text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">&#x2190;&#x2191;&#x2193;&#x2192;</span> Joypad</span>
<span class="control-def"><span class="control-key small">Space</span> Button A</span>
<span class="control-def"><span class="control-key small">Shift</span> Button B</span>

241
presets/pce/siegegame.c Normal file
View File

@ -0,0 +1,241 @@
/*
Text-based version of a Blockade-style game.
For more information, see "Making Arcade Games in C".
*/
#include <conio.h>
#include <joystick.h>
#include <string.h>
#include <stdlib.h>
#define COLS 50
#define ROWS 28
typedef unsigned char byte;
typedef signed char sbyte;
typedef unsigned short word;
typedef signed short sword;
// get the character at a specfic x/y position
byte readcharxy(byte x, byte y) {
gotoxy(x,y); // set cursor position
return cpeekc();
}
void delay(byte count) {
while (count--) {
waitvsync();
}
}
////////// GAME DATA
typedef struct {
byte x;
byte y;
byte dir;
word score;
char head_attr;
char tail_attr;
int collided:1;
int human:1;
} Player;
Player players[2];
byte credits = 0;
byte frames_per_move;
byte gameover;
#define START_SPEED 12
#define MAX_SPEED 5
#define MAX_SCORE 7
///////////
const char BOX_CHARS[8] = { '+', '+', '+', '+',
'-', '-', '!', '!'};
void draw_box(byte x, byte y, byte x2, byte y2, const char* chars) {
byte x1 = x;
cputcxy(x, y, chars[2]);
cputcxy(x2, y, chars[3]);
cputcxy(x, y2, chars[0]);
cputcxy(x2, y2, chars[1]);
while (++x < x2) {
cputcxy(x, y, chars[5]);
cputcxy(x, y2, chars[4]);
}
while (++y < y2) {
cputcxy(x1, y, chars[6]);
cputcxy(x2, y, chars[7]);
}
}
void draw_playfield() {
draw_box(0,1,COLS-1,ROWS-1,BOX_CHARS);
cputsxy( 0, 0, "Plyr1:");
cputsxy(20, 0, "Plyr2:");
cputcxy( 7, 0, players[0].score+'0');
cputcxy(27, 0, players[1].score+'0');
}
typedef enum { D_RIGHT, D_DOWN, D_LEFT, D_UP } dir_t;
const sbyte DIR_X[4] = { 1, 0, -1, 0 };
const sbyte DIR_Y[4] = { 0, 1, 0, -1 };
void init_game() {
memset(players, 0, sizeof(players));
players[0].head_attr = '1';
players[1].head_attr = '2';
players[0].tail_attr = '#';
players[1].tail_attr = '*';
frames_per_move = START_SPEED;
}
void reset_players() {
players[0].x = players[0].y = 5;
players[0].dir = D_RIGHT;
players[1].x = COLS-6;
players[1].y = ROWS-6;
players[1].dir = D_LEFT;
players[0].collided = players[1].collided = 0;
}
void draw_player(Player* p) {
cputcxy(p->x, p->y, p->head_attr);
}
void move_player(Player* p) {
cputcxy(p->x, p->y, p->tail_attr);
p->x += DIR_X[p->dir];
p->y += DIR_Y[p->dir];
if ((readcharxy(p->x, p->y) & 0x7f) != ' ')
p->collided = 1;
draw_player(p);
}
void human_control(Player* p) {
byte dir = 0xff;
char joy;
if (!p->human) return;
//if (!kbhit()) return;
joy = joy_read(0);
if (JOY_UP(joy)) dir = D_UP;
if (JOY_LEFT(joy)) dir = D_LEFT;
if (JOY_RIGHT(joy)) dir = D_RIGHT;
if (JOY_DOWN(joy)) dir = D_DOWN;
// don't let the player reverse direction
if (dir < 0x80 && dir != (p->dir ^ 2)) {
p->dir = dir;
}
}
byte ai_try_dir(Player* p, dir_t dir, byte shift) {
byte x,y;
dir &= 3;
x = p->x + (DIR_X[dir] << shift);
y = p->y + (DIR_Y[dir] << shift);
if (x < COLS && y < ROWS
&& (readcharxy(x, y) & 0x7f) == ' ') {
p->dir = dir;
return 1;
} else {
return 0;
}
}
void ai_control(Player* p) {
dir_t dir;
if (p->human) return;
dir = p->dir;
if (!ai_try_dir(p, dir, 0)) {
ai_try_dir(p, dir+1, 0);
ai_try_dir(p, dir-1, 0);
} else {
ai_try_dir(p, dir-1, 0) && ai_try_dir(p, dir-1, 1+(rand() & 3));
ai_try_dir(p, dir+1, 0) && ai_try_dir(p, dir+1, 1+(rand() & 3));
ai_try_dir(p, dir, rand() & 3);
}
}
void flash_colliders() {
byte i;
// flash players that collided
for (i=0; i<56; i++) {
delay(2);
revers(players[0].collided && (i&1));
draw_player(&players[0]);
revers(players[1].collided && (i&1));
draw_player(&players[1]);
}
revers(0);
}
void make_move() {
byte i;
for (i=0; i<frames_per_move; i++) {
human_control(&players[0]);
delay(1);
}
ai_control(&players[0]);
ai_control(&players[1]);
// if players collide, 2nd player gets the point
textcolor(COLOR_CYAN);
move_player(&players[1]);
textcolor(COLOR_YELLOW);
move_player(&players[0]);
textcolor(COLOR_WHITE);
}
void declare_winner(byte winner) {
byte i;
clrscr();
for (i=0; i<ROWS/2-3; i++) {
draw_box(i,i,COLS-1-i,ROWS-1-i,BOX_CHARS);
delay(1);
}
cputsxy(12,10,"WINNER:");
cputsxy(12,13,"PLAYER ");
cputcxy(12+7, 13, '1'+winner);
delay(200);
gameover = 1;
}
void play_round() {
reset_players();
clrscr();
textcolor(COLOR_WHITE);
draw_playfield();
while (1) {
make_move();
if (players[0].collided || players[1].collided) break;
}
flash_colliders();
// add scores to players that didn't collide
if (players[0].collided) players[1].score++;
if (players[1].collided) players[0].score++;
// increase speed
if (frames_per_move > MAX_SPEED) frames_per_move--;
// game over?
if (players[0].score != players[1].score) {
if (players[0].score >= MAX_SCORE)
declare_winner(0);
else if (players[1].score >= MAX_SCORE)
declare_winner(1);
}
}
void play_game() {
gameover = 0;
init_game();
players[0].human = 1;
while (!gameover) {
play_round();
}
}
void main() {
joy_install (joy_static_stddrv);
play_game();
}

14
presets/pce/test_conio.c Normal file
View File

@ -0,0 +1,14 @@
#include <conio.h>
#include <peekpoke.h>
int tmp; // need at least 1 variable
int main() {
clrscr();
bgcolor(COLOR_BLUE);
textcolor(COLOR_WHITE);
cputs("\r\n*** HELLO WORLD! ***");
while (1) ;
return 0;
}

View File

@ -0,0 +1,283 @@
import { hex } from "../util";
export var OPS_HuC6280 = [
{mn:"BRK",am:"",nb:1,il:0,c1:7,c2:0,nw:3,br:1,mod:"SI"}, // 0
{mn:"ORA",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"AZN"}, // 1
{mn:"SXY",am:"",nb:1,il:0,c1:3,c2:0,nw:0,br:0,mod:"XY"}, // 2
{mn:"ST0",am:"#aa",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:""}, // 3
{mn:"TSB",am:"aa",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"NZV"}, // 4
{mn:"ORA",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"AZN"}, // 5
{mn:"ASL",am:"aa",nb:2,il:0,c1:5,c2:0,nw:2,br:0,mod:"CZN"}, // 6
{mn:"RMB0",am:"aa",nb:2,il:0,c1:7,c2:0,nw:1,br:0,mod:""}, // 7
{mn:"PHP",am:"",nb:1,il:0,c1:3,c2:0,nw:1,br:0,mod:"S"}, // 8
{mn:"ORA",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // 9
{mn:"ASL",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // a
{mn:"ANC",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // b
{mn:"TSB",am:"AAAA",nb:3,il:0,c1:7,c2:0,nw:0,br:0,mod:"NZV"}, // c
{mn:"ORA",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // d
{mn:"ASL",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // e
{mn:"BBR0",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:0,br:0,mod:""}, // f
// TODO: finish these
{mn:"BPL",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // 10
{mn:"ORA",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"AZN"}, // 11
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 12
{mn:"SLO",am:"(aa),y",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZN"}, // 13
{mn:"NOP",am:"aa,x",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 14
{mn:"ORA",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // 15
{mn:"ASL",am:"aa,x",nb:2,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 16
{mn:"SLO",am:"aa,x",nb:2,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZN"}, // 17
{mn:"CLC",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"C"}, // 18
{mn:"ORA",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // 19
{mn:"NOP",am:"",nb:1,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // 1a
{mn:"SLO",am:"AAAA,y",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZN"}, // 1b
{mn:"NOP",am:"AAAA,x",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 1c
{mn:"ORA",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // 1d
{mn:"ASL",am:"AAAA,x",nb:3,il:0,c1:7,c2:0,nw:2,br:0,mod:"CZN"}, // 1e
{mn:"SLO",am:"AAAA,x",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZN"}, // 1f
{mn:"JSR",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:1,mod:"S"}, // 20
{mn:"AND",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"AZN"}, // 21
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 22
{mn:"RLA",am:"(aa,x)",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZN"}, // 23
{mn:"BIT",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"ZVN"}, // 24
{mn:"AND",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"AZN"}, // 25
{mn:"ROL",am:"aa",nb:2,il:0,c1:5,c2:0,nw:2,br:0,mod:"CZN"}, // 26
{mn:"RLA",am:"aa",nb:2,il:1,c1:5,c2:0,nw:2,br:0,mod:"ACZN"}, // 27
{mn:"PLP",am:"",nb:1,il:0,c1:4,c2:0,nw:0,br:0,mod:"SCZIDVN"}, // 28
{mn:"AND",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // 29
{mn:"ROL",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // 2a
{mn:"ANC",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // 2b
{mn:"BIT",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"ZVN"}, // 2c
{mn:"AND",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // 2d
{mn:"ROL",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 2e
{mn:"RLA",am:"AAAA",nb:3,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZN"}, // 2f
{mn:"BMI",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // 30
{mn:"AND",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"AZN"}, // 31
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 32
{mn:"RLA",am:"(aa),y",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZN"}, // 33
{mn:"NOP",am:"aa,x",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 34
{mn:"AND",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // 35
{mn:"ROL",am:"aa,x",nb:2,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 36
{mn:"RLA",am:"aa,x",nb:2,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZN"}, // 37
{mn:"SEC",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"C"}, // 38
{mn:"AND",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // 39
{mn:"NOP",am:"",nb:1,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // 3a
{mn:"RLA",am:"AAAA,y",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZN"}, // 3b
{mn:"NOP",am:"AAAA,x",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 3c
{mn:"AND",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // 3d
{mn:"ROL",am:"AAAA,x",nb:3,il:0,c1:7,c2:0,nw:2,br:0,mod:"CZN"}, // 3e
{mn:"RLA",am:"AAAA,x",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZN"}, // 3f
{mn:"RTI",am:"",nb:1,il:0,c1:6,c2:0,nw:0,br:1,mod:"SCZIDVN"}, // 40
{mn:"EOR",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"AZN"}, // 41
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 42
{mn:"SRE",am:"(aa,x)",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZN"}, // 43
{mn:"NOP",am:"aa",nb:2,il:1,c1:3,c2:0,nw:0,br:0,mod:""}, // 44
{mn:"EOR",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"AZN"}, // 45
{mn:"LSR",am:"aa",nb:2,il:0,c1:5,c2:0,nw:2,br:0,mod:"CZN"}, // 46
{mn:"SRE",am:"aa",nb:2,il:1,c1:5,c2:0,nw:2,br:0,mod:"ACZN"}, // 47
{mn:"PHA",am:"",nb:1,il:0,c1:3,c2:0,nw:1,br:0,mod:"S"}, // 48
{mn:"EOR",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // 49
{mn:"LSR",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // 4a
{mn:"ASR",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // 4b
{mn:"JMP",am:"AAAA",nb:3,il:0,c1:3,c2:0,nw:0,br:1,mod:""}, // 4c
{mn:"EOR",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // 4d
{mn:"LSR",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 4e
{mn:"SRE",am:"AAAA",nb:3,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZN"}, // 4f
{mn:"BVC",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // 50
{mn:"EOR",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"AZN"}, // 51
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 52
{mn:"SRE",am:"(aa),y",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZN"}, // 53
{mn:"NOP",am:"aa,x",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 54
{mn:"EOR",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // 55
{mn:"LSR",am:"aa,x",nb:2,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 56
{mn:"SRE",am:"aa,x",nb:2,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZN"}, // 57
{mn:"CLI",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"I"}, // 58
{mn:"EOR",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // 59
{mn:"NOP",am:"",nb:1,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // 5a
{mn:"SRE",am:"AAAA,y",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZN"}, // 5b
{mn:"NOP",am:"AAAA,x",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 5c
{mn:"EOR",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // 5d
{mn:"LSR",am:"AAAA,x",nb:3,il:0,c1:7,c2:0,nw:2,br:0,mod:"CZN"}, // 5e
{mn:"SRE",am:"AAAA,x",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZN"}, // 5f
{mn:"RTS",am:"",nb:1,il:0,c1:6,c2:0,nw:0,br:1,mod:"S"}, // 60
{mn:"ADC",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"ACZVN"}, // 61
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 62
{mn:"RRA",am:"(aa,x)",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZVN"}, // 63
{mn:"NOP",am:"aa",nb:2,il:1,c1:3,c2:0,nw:0,br:0,mod:""}, // 64
{mn:"ADC",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"ACZVN"}, // 65
{mn:"ROR",am:"aa",nb:2,il:0,c1:5,c2:0,nw:2,br:0,mod:"CZN"}, // 66
{mn:"RRA",am:"aa",nb:2,il:1,c1:5,c2:0,nw:2,br:0,mod:"ACZVN"}, // 67
{mn:"PLA",am:"",nb:1,il:0,c1:4,c2:0,nw:0,br:0,mod:"SAZN"}, // 68
{mn:"ADC",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"ACZVN"}, // 69
{mn:"ROR",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"ACZN"}, // 6a
{mn:"ARR",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"ACZVN"}, // 6b
{mn:"JMP",am:"(AAAA)",nb:3,il:0,c1:5,c2:0,nw:0,br:1,mod:""}, // 6c
{mn:"ADC",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"ACZVN"}, // 6d
{mn:"ROR",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 6e
{mn:"RRA",am:"AAAA",nb:3,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZVN"}, // 6f
{mn:"BVS",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // 70
{mn:"ADC",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"ACZVN"}, // 71
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 72
{mn:"RRA",am:"(aa),y",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZVN"}, // 73
{mn:"NOP",am:"aa,x",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 74
{mn:"ADC",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"ACZVN"}, // 75
{mn:"ROR",am:"aa,x",nb:2,il:0,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // 76
{mn:"RRA",am:"aa,x",nb:2,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZVN"}, // 77
{mn:"SEI",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"I"}, // 78
{mn:"ADC",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"ACZVN"}, // 79
{mn:"NOP",am:"",nb:1,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // 7a
{mn:"RRA",am:"AAAA,y",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZVN"}, // 7b
{mn:"NOP",am:"AAAA,x",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // 7c
{mn:"ADC",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"ACZVN"}, // 7d
{mn:"ROR",am:"AAAA,x",nb:3,il:0,c1:7,c2:0,nw:2,br:0,mod:"CZN"}, // 7e
{mn:"RRA",am:"AAAA,x",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZVN"}, // 7f
{mn:"BRA",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // 80
{mn:"STA",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:1,br:0,mod:""}, // 81
{mn:"NOP",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // 82
{mn:"SAX",am:"(aa,x)",nb:2,il:1,c1:6,c2:0,nw:1,br:0,mod:""}, // 83
{mn:"STY",am:"aa",nb:2,il:0,c1:3,c2:0,nw:1,br:0,mod:""}, // 84
{mn:"STA",am:"aa",nb:2,il:0,c1:3,c2:0,nw:1,br:0,mod:""}, // 85
{mn:"STX",am:"aa",nb:2,il:0,c1:3,c2:0,nw:1,br:0,mod:""}, // 86
{mn:"SAX",am:"aa",nb:2,il:1,c1:3,c2:0,nw:1,br:0,mod:""}, // 87
{mn:"DEY",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"YZN"}, // 88
{mn:"NOP",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // 89
{mn:"TXA",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // 8a
{mn:"ANE",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // 8b
{mn:"STY",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:1,br:0,mod:""}, // 8c
{mn:"STA",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:1,br:0,mod:""}, // 8d
{mn:"STX",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:1,br:0,mod:""}, // 8e
{mn:"SAX",am:"AAAA",nb:3,il:1,c1:4,c2:0,nw:1,br:0,mod:""}, // 8f
{mn:"BCC",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // 90
{mn:"STA",am:"(aa),y",nb:2,il:0,c1:6,c2:0,nw:1,br:0,mod:""}, // 91
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // 92
{mn:"SHA",am:"(aa),y",nb:2,il:1,c1:6,c2:0,nw:1,br:0,mod:""}, // 93
{mn:"STY",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:1,br:0,mod:""}, // 94
{mn:"STA",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:1,br:0,mod:""}, // 95
{mn:"STX",am:"aa,y",nb:2,il:0,c1:4,c2:0,nw:1,br:0,mod:""}, // 96
{mn:"SAX",am:"aa,y",nb:3,il:1,c1:4,c2:0,nw:1,br:1,mod:""}, // 97
{mn:"TYA",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // 98
{mn:"STA",am:"AAAA,y",nb:3,il:0,c1:5,c2:0,nw:1,br:0,mod:""}, // 99
{mn:"TXS",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"S"}, // 9a
{mn:"SHS",am:"AAAA,y",nb:3,il:1,c1:5,c2:0,nw:1,br:0,mod:"S"}, // 9b
{mn:"SHY",am:"AAAA,x",nb:3,il:1,c1:5,c2:0,nw:1,br:0,mod:""}, // 9c
{mn:"STA",am:"AAAA,x",nb:3,il:0,c1:5,c2:0,nw:1,br:0,mod:""}, // 9d
{mn:"SHX",am:"AAAA,y",nb:3,il:1,c1:5,c2:0,nw:1,br:0,mod:""}, // 9e
{mn:"SHA",am:"AAAA,y",nb:3,il:1,c1:5,c2:0,nw:1,br:0,mod:""}, // 9f
{mn:"LDY",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"YZN"}, // a0
{mn:"LDA",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"AZN"}, // a1
{mn:"LDX",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"XZN"}, // a2
{mn:"LAX",am:"(aa,x)",nb:2,il:1,c1:6,c2:0,nw:0,br:0,mod:"AXZN"}, // a3
{mn:"LDY",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"YZN"}, // a4
{mn:"LDA",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"AZN"}, // a5
{mn:"LDX",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"XZN"}, // a6
{mn:"LAX",am:"aa",nb:2,il:1,c1:3,c2:0,nw:0,br:0,mod:"AXZN"}, // a7
{mn:"TAY",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"YZN"}, // a8
{mn:"LDA",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"AZN"}, // a9
{mn:"TAX",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"XZN"}, // aa
{mn:"LXA",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"AXZN"}, // ab
{mn:"LDY",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"YZN"}, // ac
{mn:"LDA",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // ad
{mn:"LDX",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"XZN"}, // ae
{mn:"LAX",am:"AAAA",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:"AXZN"}, // af
{mn:"BCS",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // b0
{mn:"LDA",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"AZN"}, // b1
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // b2
{mn:"LAX",am:"(aa),y",nb:2,il:1,c1:5,c2:1,nw:0,br:0,mod:"AXZN"}, // b3
{mn:"LDY",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"YZN"}, // b4
{mn:"LDA",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"AZN"}, // b5
{mn:"LDX",am:"aa,y",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"XZN"}, // b6
{mn:"LAX",am:"aa,y",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:"AXZN"}, // b7
{mn:"CLV",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"V"}, // b8
{mn:"LDA",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // b9
{mn:"TSX",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"XZN"}, // ba
{mn:"LAS",am:"AAAA,y",nb:3,il:1,c1:4,c2:1,nw:0,br:0,mod:"SAXZN"}, // bb
{mn:"LDY",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"YZN"}, // bc
{mn:"LDA",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"AZN"}, // bd
{mn:"LDX",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"XZN"}, // be
{mn:"LAX",am:"AAAA,y",nb:3,il:1,c1:4,c2:1,nw:0,br:0,mod:"AXZN"}, // bf
{mn:"CPY",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"CZN"}, // c0
{mn:"CMP",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"CZN"}, // c1
{mn:"NOP",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // c2
{mn:"DCP",am:"(aa,x)",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"CZN"}, // c3
{mn:"CPY",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"CZN"}, // c4
{mn:"CMP",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"CZN"}, // c5
{mn:"DEC",am:"aa",nb:2,il:0,c1:5,c2:0,nw:2,br:0,mod:"ZN"}, // c6
{mn:"DCP",am:"aa",nb:2,il:1,c1:5,c2:0,nw:2,br:0,mod:"CZN"}, // c7
{mn:"INY",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"YZN"}, // c8
{mn:"CMP",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"CZN"}, // c9
{mn:"DEX",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"XZN"}, // ca
{mn:"SBX",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"XCZN"}, // cb
{mn:"CPY",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"CZN"}, // cc
{mn:"CMP",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"CZN"}, // cd
{mn:"DEC",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:0,mod:"ZN"}, // ce
{mn:"DCP",am:"AAAA",nb:3,il:1,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // cf
{mn:"BNE",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // d0
{mn:"CMP",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"CZN"}, // d1
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // d2
{mn:"DCP",am:"(aa),y",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"CZN"}, // d3
{mn:"NOP",am:"aa,x",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // d4
{mn:"CMP",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"CZN"}, // d5
{mn:"DEC",am:"aa,x",nb:2,il:0,c1:6,c2:0,nw:2,br:0,mod:"ZN"}, // d6
{mn:"DCP",am:"aa,x",nb:2,il:1,c1:6,c2:0,nw:2,br:0,mod:"CZN"}, // d7
{mn:"CLD",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"D"}, // d8
{mn:"CMP",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"CZN"}, // d9
{mn:"NOP",am:"",nb:1,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // da
{mn:"DCP",am:"AAAA,y",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"CZN"}, // db
{mn:"NOP",am:"AAAA,x",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // dc
{mn:"CMP",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"CZN"}, // dd
{mn:"DEC",am:"AAAA,x",nb:3,il:0,c1:7,c2:0,nw:2,br:0,mod:"ZN"}, // de
{mn:"DCP",am:"AAAA,x",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"CZN"}, // df
{mn:"CPX",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"CZN"}, // e0
{mn:"SBC",am:"(aa,x)",nb:2,il:0,c1:6,c2:0,nw:0,br:0,mod:"ACZVN"}, // e1
{mn:"NOP",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // e2
{mn:"ISB",am:"(aa,x)",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZVN"}, // e3
{mn:"CPX",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"CZN"}, // e4
{mn:"SBC",am:"aa",nb:2,il:0,c1:3,c2:0,nw:0,br:0,mod:"ACZVN"}, // e5
{mn:"INC",am:"aa",nb:2,il:0,c1:5,c2:0,nw:2,br:0,mod:"ZN"}, // e6
{mn:"ISB",am:"aa",nb:2,il:1,c1:5,c2:0,nw:2,br:0,mod:"ACZVN"}, // e7
{mn:"INX",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"XZN"}, // e8
{mn:"SBC",am:"#aa",nb:2,il:0,c1:2,c2:0,nw:0,br:0,mod:"ACZVN"}, // e9
{mn:"NOP",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:""}, // ea
{mn:"SBC",am:"#aa",nb:2,il:1,c1:2,c2:0,nw:0,br:0,mod:"ACZVN"}, // eb
{mn:"CPX",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"CZN"}, // ec
{mn:"SBC",am:"AAAA",nb:3,il:0,c1:4,c2:0,nw:0,br:0,mod:"ACZVN"}, // ed
{mn:"INC",am:"AAAA",nb:3,il:0,c1:6,c2:0,nw:2,br:0,mod:"ZN"}, // ee
{mn:"ISB",am:"AAAA",nb:3,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZVN"}, // ef
{mn:"BEQ",am:"branch",nb:2,il:0,c1:2,c2:2,nw:0,br:1,mod:""}, // f0
{mn:"SBC",am:"(aa),y",nb:2,il:0,c1:5,c2:1,nw:0,br:0,mod:"ACZVN"}, // f1
{mn:"KIL",am:"",nb:1,il:2,c1:3,c2:0,nw:0,br:1,mod:""}, // f2
{mn:"ISB",am:"(aa),y",nb:2,il:1,c1:8,c2:0,nw:2,br:0,mod:"ACZVN"}, // f3
{mn:"NOP",am:"aa,x",nb:2,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // f4
{mn:"SBC",am:"aa,x",nb:2,il:0,c1:4,c2:0,nw:0,br:0,mod:"ACZVN"}, // f5
{mn:"INC",am:"aa,x",nb:2,il:0,c1:6,c2:0,nw:2,br:0,mod:"ZN"}, // f6
{mn:"ISB",am:"aa,x",nb:2,il:1,c1:6,c2:0,nw:2,br:0,mod:"ACZVN"}, // f7
{mn:"SED",am:"",nb:1,il:0,c1:2,c2:0,nw:0,br:0,mod:"D"}, // f8
{mn:"SBC",am:"AAAA,y",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"ACZVN"}, // f9
{mn:"NOP",am:"",nb:1,il:1,c1:2,c2:0,nw:0,br:0,mod:""}, // fa
{mn:"ISB",am:"AAAA,y",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZVN"}, // fb
{mn:"NOP",am:"AAAA,x",nb:3,il:1,c1:4,c2:0,nw:0,br:0,mod:""}, // fc
{mn:"SBC",am:"AAAA,x",nb:3,il:0,c1:4,c2:1,nw:0,br:0,mod:"ACZVN"}, // fd
{mn:"INC",am:"AAAA,x",nb:3,il:0,c1:7,c2:0,nw:2,br:0,mod:"ZN"}, // fe
{mn:"ISB",am:"AAAA,x",nb:3,il:1,c1:7,c2:0,nw:2,br:0,mod:"ACZVN"}, // ff
];
export function disassembleHuC6280(pc:number, b0:number, b1:number, b2:number) : {line:string, nbytes:number, isaddr:boolean} {
var op = OPS_HuC6280[b0];
if (op == null) return {line:"???", nbytes:1, isaddr:false};
var s = op.mn;
var am = op.am;
var isaddr = false;
if (am == 'branch') {
var offset = (b1 < 0x80) ? (pc+2+b1) : (pc+2-(256-b1));
offset &= 0xffff;
am = '$'+hex(offset, 4);
isaddr = true;
} else {
am = am.replace('aa','$'+hex(b1, 2));
am = am.replace('AAAA','$'+hex(b1+(b2<<8), 4));
if (am.indexOf('#') < 0 && am.indexOf('$') >= 0)
isaddr = true;
}
return {line:op.mn + " " + am, nbytes:op.nb, isaddr:isaddr};
};

View File

@ -18,6 +18,7 @@ export function importPlatform(name: string) : Promise<any> {
case "msx": return import("../platform/msx");
case "mw8080bw": return import("../platform/mw8080bw");
case "nes": return import("../platform/nes");
case "pce": return import("../platform/pce");
case "script": return import("../platform/script");
case "sms": return import("../platform/sms");
case "sound_konami": return import("../platform/sound_konami");

3846
src/platform/pce.ts Normal file

File diff suppressed because it is too large Load Diff

36397
src/worker/fs/fs65-pce.data Normal file

File diff suppressed because one or more lines are too long

214
src/worker/fs/fs65-pce.js Normal file
View File

@ -0,0 +1,214 @@
var Module = typeof Module !== 'undefined' ? Module : {};
if (!Module.expectedDataFileDownloads) {
Module.expectedDataFileDownloads = 0;
}
Module.expectedDataFileDownloads++;
(function() {
// Do not attempt to redownload the virtual filesystem data when in a pthread or a Wasm Worker context.
if (Module['ENVIRONMENT_IS_PTHREAD'] || Module['$ww']) return;
var loadPackage = function(metadata) {
var PACKAGE_PATH = '';
if (typeof window === 'object') {
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
// web worker
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
}
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-pce.data';
var REMOTE_PACKAGE_BASE = 'fs65-pce.data';
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
Module['locateFile'] = Module['locateFilePackage'];
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
}
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
function fetchRemotePackage(packageName, packageSize, callback, errback) {
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
require('fs').readFile(packageName, function(err, contents) {
if (err) {
errback(err);
} else {
callback(contents.buffer);
}
});
return;
}
var xhr = new XMLHttpRequest();
xhr.open('GET', packageName, true);
xhr.responseType = 'arraybuffer';
xhr.onprogress = function(event) {
var url = packageName;
var size = packageSize;
if (event.total) size = event.total;
if (event.loaded) {
if (!xhr.addedTotal) {
xhr.addedTotal = true;
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
Module.dataFileDownloads[url] = {
loaded: event.loaded,
total: size
};
} else {
Module.dataFileDownloads[url].loaded = event.loaded;
}
var total = 0;
var loaded = 0;
var num = 0;
for (var download in Module.dataFileDownloads) {
var data = Module.dataFileDownloads[download];
total += data.total;
loaded += data.loaded;
num++;
}
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
} else if (!Module.dataFileDownloads) {
if (Module['setStatus']) Module['setStatus']('Downloading data...');
}
};
xhr.onerror = function(event) {
throw new Error("NetworkError for: " + packageName);
}
xhr.onload = function(event) {
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
var packageData = xhr.response;
callback(packageData);
} else {
throw new Error(xhr.statusText + " : " + xhr.responseURL);
}
};
xhr.send(null);
};
function handleError(error) {
console.error('package error:', error);
};
var fetchedCallback = null;
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
if (fetchedCallback) {
fetchedCallback(data);
fetchedCallback = null;
} else {
fetched = data;
}
}, handleError);
function runWithFS() {
function assert(check, msg) {
if (!check) throw msg + new Error().stack;
}
Module['FS_createPath']("/", "asminc", true, true);
Module['FS_createPath']("/", "cfg", true, true);
Module['FS_createPath']("/", "include", true, true);
Module['FS_createPath']("/include", "arpa", true, true);
Module['FS_createPath']("/include", "em", true, true);
Module['FS_createPath']("/include", "geos", true, true);
Module['FS_createPath']("/include", "joystick", true, true);
Module['FS_createPath']("/include", "mouse", true, true);
Module['FS_createPath']("/include", "sys", true, true);
Module['FS_createPath']("/include", "tgi", true, true);
Module['FS_createPath']("/", "lib", true, true);
Module['FS_createPath']("/", "target", true, true);
Module['FS_createPath']("/target", "pce", true, true);
Module['FS_createPath']("/target/pce", "drv", true, true);
Module['FS_createPath']("/target/pce/drv", "joy", true, true);
/** @constructor */
function DataRequest(start, end, audio) {
this.start = start;
this.end = end;
this.audio = audio;
}
DataRequest.prototype = {
requests: {},
open: function(mode, name) {
this.name = name;
this.requests[name] = this;
Module['addRunDependency']('fp ' + this.name);
},
send: function() {},
onload: function() {
var byteArray = this.byteArray.subarray(this.start, this.end);
this.finish(byteArray);
},
finish: function(byteArray) {
var that = this;
// canOwn this data in the filesystem, it is a slide into the heap that will never change
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true);
Module['removeRunDependency']('fp ' + that.name);
this.requests[this.name] = null;
}
};
var files = metadata['files'];
for (var i = 0; i < files.length; ++i) {
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
}
function processPackageData(arrayBuffer) {
assert(arrayBuffer, 'Loading data file failed.');
assert(arrayBuffer.constructor.name === ArrayBuffer.name, 'bad input to processPackageData');
var byteArray = new Uint8Array(arrayBuffer);
var curr;
// Reuse the bytearray from the XHR as the source for file reads.
DataRequest.prototype.byteArray = byteArray;
var files = metadata['files'];
for (var i = 0; i < files.length; ++i) {
DataRequest.prototype.requests[files[i].filename].onload();
} Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-pce.data');
};
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-pce.data');
if (!Module.preloadResults) Module.preloadResults = {};
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
if (fetched) {
processPackageData(fetched);
fetched = null;
} else {
fetchedCallback = processPackageData;
}
}
if (Module['calledRun']) {
runWithFS();
} else {
if (!Module['preRun']) Module['preRun'] = [];
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
}
Module['removeRunDependency']('fs65-pce.js.metadata');
}
function runMetaWithFS() {
Module['addRunDependency']('fs65-pce.js.metadata');
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-pce.js.metadata', '') : 'fs65-pce.js.metadata';
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
loadPackage(JSON.parse(xhr.responseText));
}
}
xhr.open('GET', REMOTE_METADATA_NAME, true);
xhr.overrideMimeType('application/json');
xhr.send(null);
}
if (Module['calledRun']) {
runMetaWithFS();
} else {
if (!Module['preRun']) Module['preRun'] = [];
Module["preRun"].push(runMetaWithFS);
}
})();

File diff suppressed because one or more lines are too long

View File

@ -186,6 +186,14 @@ export function linkLD65(step: BuildStep): BuildStepResult {
var aout = FS.readFile("main", { encoding: 'binary' });
var mapout = FS.readFile("main.map", { encoding: 'utf8' });
var viceout = FS.readFile("main.vice", { encoding: 'utf8' });
// correct binary for PCEngine
if (step.platform == 'pce' && aout.length > 0x2000) {
// move 8 KB from end to front
let newrom = new Uint8Array(aout.length);
newrom.set(aout.slice(aout.length - 0x2000), 0);
newrom.set(aout.slice(0, aout.length - 0x2000), 0x2000);
aout = newrom;
}
//var dbgout = FS.readFile("main.dbg", {encoding:'utf8'});
putWorkFile("main", aout);
putWorkFile("main.map", mapout);

View File

@ -394,6 +394,12 @@ var PLATFORM_PARAMS = {
extra_link_args: ['crt0-cpc.rel', 'cpctelera.lib'],
extra_link_files: ['crt0-cpc.rel', 'crt0-cpc.lst', 'cpctelera.lib', 'cpctelera.lst'],
},
'pce': {
arch: 'huc6280',
define: ['__PCE__'],
cfgfile: 'pce.cfg',
libargs: ['pce.lib', '-D', '__CARTSIZE__=0x8000'],
},
};
PLATFORM_PARAMS['sms-sms-libcv'] = PLATFORM_PARAMS['sms-sg1000-libcv'];
@ -1189,6 +1195,8 @@ var TOOL_PRELOADFS = {
'ca65-devel': '65-none',
'cc65-vcs': '65-atari2600',
'ca65-vcs': '65-atari2600',
'cc65-pce': '65-pce',
'ca65-pce': '65-pce',
'sdasz80': 'sdcc',
'sdcc': 'sdcc',
'sccz80': 'sccz80',