forked from mattgodbolt/jsbeeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.js
61 lines (55 loc) · 2.48 KB
/
models.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"use strict";
import {I8271, WD1770} from "./fdc.js";
class Model {
constructor(name, synonyms, os, nmos, isMaster, swram, fdc, tube) {
this.name = name;
this.synonyms = synonyms;
this.os = os;
this.nmos = nmos;
this.isMaster = isMaster;
this.Fdc = fdc;
this.swram = swram;
this.isTest = false;
this.tube = tube;
}
}
// TODO: semi-bplus-style to get swram for exile hardcoded here
const beebSwram = [
true, true, true, true, // Dunjunz variants. Exile (not picky).
true, true, true, true, // Crazee Rider.
false, false, false, false,
false, false, false, false];
const masterSwram = [
false, false, false, false,
true, true, true, true,
false, false, false, false,
false, false, false, false];
const tube65c02 = new Model("Tube65C02", [], ["tube/6502Tube.rom"], false, false);
export const allModels = [
new Model("BBC B", ["B"], ["os.rom", "BASIC.ROM", "b/DFS-0.9.rom"], true, false, beebSwram, I8271),
new Model("BBC B (DFS 0.9)", ["B-DFS0.9"], ["os.rom", "BASIC.ROM", "b/DFS-0.9.rom"], true, false, beebSwram, I8271),
new Model("BBC B (DFS 1.2)", ["B-DFS1.2"], ["os.rom", "BASIC.ROM", "b/DFS-1.2.rom"], true, false, beebSwram, I8271),
new Model("BBC B (with 65c02 Tube)", ["B-Tube"], ["os.rom", "BASIC.ROM", "b/DFS-1.2.rom"], true, false, beebSwram, I8271, tube65c02),
new Model("BBC B (1770)", ["B1770"], ["os.rom", "BASIC.ROM", "b1770/dfs1770.rom", "b1770/zADFS.ROM"],
true, false, beebSwram, WD1770),
new Model("BBC Master 128", ["Master"], ["master/mos3.20"], false, true, masterSwram, WD1770),
new Model("BBC Master Turbo", ["MasterTurbo"], ["master/mos3.20"], false, true, masterSwram, WD1770, tube65c02),
];
export function findModel(name) {
name = name.toLowerCase();
for (let i = 0; i < allModels.length; ++i) {
const model = allModels[i];
if (model.name.toLowerCase() === name)
return model;
for (let j = 0; j < model.synonyms.length; ++j) {
if (model.synonyms[j].toLowerCase() === name)
return model;
}
}
return null;
}
export const TEST_6502 = new Model("TEST", ["TEST"], [], true, false, beebSwram, I8271);
TEST_6502.isTest = true;
export const TEST_65C12 = new Model("TEST", ["TEST"], [], false, false, masterSwram, I8271);
TEST_65C12.isTest = true;
export const basicOnly = new Model("Basic only", ["Basic only"], ["master/mos3.20"], false, true, masterSwram, WD1770);