diff --git a/devices/pc8080/machine/invaders/README.md b/devices/pc8080/machine/invaders/README.md
index 15b5864a5..91dedfc2f 100644
--- a/devices/pc8080/machine/invaders/README.md
+++ b/devices/pc8080/machine/invaders/README.md
@@ -10,8 +10,7 @@ machines:
Space Invaders (1978)
---
-This is a test of [PC8080](/modules/pc8080/), a new 8080-based machine emulator recently added to the
-PCjs Project.
+This is a test of [PC8080](/modules/pc8080/), a new 8080-based PCjs emulator running the original Space Invaders.
It is currently playable only in desktop browsers and uses the following hard-coded key mappings:
diff --git a/devices/pc8080/machine/invaders/debugger/machine.xml b/devices/pc8080/machine/invaders/debugger/machine.xml
index 170279973..94de7936f 100644
--- a/devices/pc8080/machine/invaders/debugger/machine.xml
+++ b/devices/pc8080/machine/invaders/debugger/machine.xml
@@ -18,7 +18,7 @@
-
+
diff --git a/devices/pc8080/machine/invaders/machine.xml b/devices/pc8080/machine/invaders/machine.xml
index 99a0839bb..ae5044552 100644
--- a/devices/pc8080/machine/invaders/machine.xml
+++ b/devices/pc8080/machine/invaders/machine.xml
@@ -18,5 +18,5 @@
-
+
diff --git a/devices/pc8080/machine/vt100/debugger/machine.xml b/devices/pc8080/machine/vt100/debugger/machine.xml
index bf2bf441f..179c55a18 100644
--- a/devices/pc8080/machine/vt100/debugger/machine.xml
+++ b/devices/pc8080/machine/vt100/debugger/machine.xml
@@ -24,7 +24,7 @@
-
+
diff --git a/devices/pc8080/machine/vt100/machine.xml b/devices/pc8080/machine/vt100/machine.xml
index 383aad6d9..4d6b1b236 100644
--- a/devices/pc8080/machine/vt100/machine.xml
+++ b/devices/pc8080/machine/vt100/machine.xml
@@ -24,5 +24,5 @@
-
+
diff --git a/modules/pc8080/lib/chipset.js b/modules/pc8080/lib/chipset.js
index 00b8bc6a9..a863b8f84 100644
--- a/modules/pc8080/lib/chipset.js
+++ b/modules/pc8080/lib/chipset.js
@@ -59,16 +59,11 @@ function ChipSet(parmsChipSet)
var model = parmsChipSet['model'];
- /*
- * this.model is a numeric version of the 'model' string; when comparing this.model to "base"
- * model numbers, you should generally compare (this.model|0) to the target value, which truncates it.
- */
if (model && !ChipSet.MODELS[model]) {
Component.notice("Unrecognized ChipSet model: " + model);
}
- this.config = ChipSet.MODELS[model] || ChipSet.SI1978;
- this.model = this.config.MODEL;
+ this.config = ChipSet.MODELS[model] || {};
this.bSwitches = this.parseDIPSwitches(parmsChipSet['swDIP']);
@@ -246,7 +241,7 @@ ChipSet.VT100 = {
};
/*
- * Supported model strings
+ * Supported models and their configurations
*/
ChipSet.MODELS = {
"SI1978": ChipSet.SI1978,
@@ -345,7 +340,7 @@ ChipSet.prototype.powerDown = function(fSave, fShutdown)
return fSave? this.save() : true;
};
-ChipSet.SI1978.init = [
+ChipSet.SI1978.INIT = [
[
ChipSet.SI1978.STATUS0.ALWAYS_SET,
ChipSet.SI1978.STATUS1.ALWAYS_SET,
@@ -354,7 +349,7 @@ ChipSet.SI1978.init = [
]
];
-ChipSet.VT100.init = [
+ChipSet.VT100.INIT = [
[
ChipSet.VT100.BRIGHTNESS.INIT,
ChipSet.VT100.FLAGS_BUFFER.NO_AVO | ChipSet.VT100.FLAGS_BUFFER.NO_GFX,
@@ -373,7 +368,7 @@ ChipSet.VT100.init = [
*/
ChipSet.prototype.reset = function()
{
- if (!this.restore(this.config.init)) {
+ if (this.config.INIT && !this.restore(this.config.INIT)) {
this.notice("reset error");
}
};
@@ -389,7 +384,7 @@ ChipSet.prototype.reset = function()
ChipSet.prototype.save = function()
{
var state = new State(this);
- switch(this.model) {
+ switch(this.config.MODEL) {
case ChipSet.SI1978.MODEL:
state.set(0, [this.bStatus0, this.bStatus1, this.bStatus2, this.wShiftData, this.bShiftCount, this.bSound1, this.bSound2]);
break;
@@ -414,7 +409,7 @@ ChipSet.prototype.restore = function(data)
{
var a;
if (data && (a = data[0]) && a.length) {
- switch(this.model) {
+ switch(this.config.MODEL) {
case ChipSet.SI1978.MODEL:
this.bStatus0 = a[0];
this.bStatus1 = a[1];
diff --git a/modules/pc8080/lib/keyboard.js b/modules/pc8080/lib/keyboard.js
index b03ef0a20..00386d0de 100644
--- a/modules/pc8080/lib/keyboard.js
+++ b/modules/pc8080/lib/keyboard.js
@@ -42,6 +42,10 @@ if (NODE) {
/**
* Keyboard(parmsKbd)
*
+ * The Keyboard component has the following component-specific (parmsKbd) properties:
+ *
+ * model: eg, "VT100" (should be a member of Keyboard.MODELS)
+ *
* @constructor
* @extends Component
* @param {Object} parmsKbd
@@ -50,6 +54,14 @@ function Keyboard(parmsKbd)
{
Component.call(this, "Keyboard", parmsKbd, Keyboard, Messages.KEYBOARD);
+ var model = parmsKbd['model'];
+
+ if (model && !Keyboard.MODELS[model]) {
+ Component.notice("Unrecognized Keyboard model: " + model);
+ }
+
+ this.config = Keyboard.MODELS[model] || {};
+
this.reset();
this.setReady();
@@ -57,20 +69,6 @@ function Keyboard(parmsKbd)
Component.subclass(Keyboard);
-Keyboard.VT100 = {
- STATUS: {
- PORT: 0x82, // write-only
- LED4: 0x01,
- LED3: 0x02,
- LED2: 0x04,
- LED1: 0x08,
- LOCKED: 0x10,
- ONLINE: 0x20,
- START: 0x40,
- CLICK: 0x80
- }
-};
-
/**
* Alphanumeric and other common (printable) ASCII codes.
*
@@ -118,7 +116,7 @@ Keyboard.KEYCODE = {
/* 0x11 */ CTRL: 17,
/* 0x12 */ ALT: 18,
/* 0x13 */ PAUSE: 19, // PAUSE/BREAK
- /* 0x14 */ CAPS_LOCK: 20,
+ /* 0x14 */ CAPSLOCK: 20,
/* 0x1B */ ESC: 27,
/* 0x20 */ SPACE: 32,
/* 0x21 */ PGUP: 33,
@@ -153,21 +151,31 @@ Keyboard.KEYCODE = {
/* 0x5C */ FF_BSLASH: 92,
/* 0x5D */ RCMD: 93, // aka MENU
/* 0x5D */ FF_RBRACK: 93,
- /* 0x60 */ NUM_INS: 96, // 0
+ /* 0x60 */ NUM_0: 96,
+ /* 0x60 */ NUM_INS: 96,
/* 0x60 */ FF_BQUOTE: 96,
- /* 0x61 */ NUM_END: 97, // 1
- /* 0x62 */ NUM_DOWN: 98, // 2
- /* 0x63 */ NUM_PGDN: 99, // 3
- /* 0x64 */ NUM_LEFT: 100, // 4
- /* 0x65 */ NUM_CENTER: 101, // 5
- /* 0x66 */ NUM_RIGHT: 102, // 6
- /* 0x67 */ NUM_HOME: 103, // 7
- /* 0x68 */ NUM_UP: 104, // 8
- /* 0x69 */ NUM_PGUP: 105, // 9
+ /* 0x61 */ NUM_1: 97,
+ /* 0x61 */ NUM_END: 97,
+ /* 0x62 */ NUM_2: 98,
+ /* 0x62 */ NUM_DOWN: 98,
+ /* 0x63 */ NUM_3: 99,
+ /* 0x63 */ NUM_PGDN: 99,
+ /* 0x64 */ NUM_4: 100,
+ /* 0x64 */ NUM_LEFT: 100,
+ /* 0x65 */ NUM_5: 101,
+ /* 0x65 */ NUM_CENTER: 101,
+ /* 0x66 */ NUM_6: 102,
+ /* 0x66 */ NUM_RIGHT: 102,
+ /* 0x67 */ NUM_7: 103,
+ /* 0x67 */ NUM_HOME: 103,
+ /* 0x68 */ NUM_8: 104,
+ /* 0x68 */ NUM_UP: 104,
+ /* 0x69 */ NUM_9: 105,
+ /* 0x69 */ NUM_PGUP: 105,
/* 0x6A */ NUM_MUL: 106,
/* 0x6B */ NUM_ADD: 107,
/* 0x6D */ NUM_SUB: 109,
- /* 0x6E */ NUM_DEL: 110, // .
+ /* 0x6E */ NUM_DEL: 110, // aka PERIOD
/* 0x6F */ NUM_DIV: 111,
/* 0x70 */ F1: 112,
/* 0x71 */ F2: 113,
@@ -217,6 +225,11 @@ Keyboard.KEYCODE = {
FAKE: 4000
};
+/*
+ * Check the event object's 'location' property for a non-zero value for the following ONRIGHT keys.
+ */
+Keyboard.KEYCODE.NUM_CR = Keyboard.KEYCODE.CR + Keyboard.KEYCODE.ONRIGHT;
+
/*
* Maps "stupid" keyCodes to their "non-stupid" counterparts
*/
@@ -234,20 +247,6 @@ Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.RBRACK] = Keyboard.ASCII[']']; // 2
Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.QUOTE] = Keyboard.ASCII["'"]; // 222 -> 39
Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.FF_DASH] = Keyboard.ASCII['-'];
-/**
- * Maps SOFTCODE (string) to KEYCODE (number).
- *
- * @enum {number}
- */
-Keyboard.SOFTCODES = {
- '1p': Keyboard.KEYCODE.ONE,
- '2p': Keyboard.KEYCODE.TWO,
- 'coin': Keyboard.KEYCODE.THREE,
- 'left': Keyboard.KEYCODE.LEFT,
- 'right': Keyboard.KEYCODE.RIGHT,
- 'fire': Keyboard.KEYCODE.SPACE
-};
-
Keyboard.MINPRESSTIME = 100; // 100ms
/**
@@ -261,7 +260,123 @@ Keyboard.ALTCODES[Keyboard.ASCII.A] = Keyboard.KEYCODE.LEFT;
Keyboard.ALTCODES[Keyboard.ASCII.D] = Keyboard.KEYCODE.RIGHT;
Keyboard.ALTCODES[Keyboard.ASCII.L] = Keyboard.KEYCODE.SPACE;
-Keyboard.LEDSTATES = {
+/*
+ * Supported configurations
+ */
+Keyboard.SI1978 = {
+ MODEL: 1978.1,
+ SOFTCODES: {
+ '1p': Keyboard.KEYCODE.ONE,
+ '2p': Keyboard.KEYCODE.TWO,
+ 'coin': Keyboard.KEYCODE.THREE,
+ 'left': Keyboard.KEYCODE.LEFT,
+ 'right': Keyboard.KEYCODE.RIGHT,
+ 'fire': Keyboard.KEYCODE.SPACE
+ }
+};
+
+Keyboard.VT100 = {
+ MODEL: 100.0,
+ SOFTCODES: {},
+ STATUS: {
+ PORT: 0x82, // write-only
+ LED4: 0x01,
+ LED3: 0x02,
+ LED2: 0x04,
+ LED1: 0x08,
+ LOCKED: 0x10,
+ ONLINE: 0x20,
+ START: 0x40, // set to initiate a scan
+ CLICK: 0x80,
+ INIT: 0x00
+ }
+};
+
+Keyboard.VT100.KEYMAP = {};
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.DEL] = 0x03;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.P] = 0x05;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.O] = 0x06;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.Y] = 0x07;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.T] = 0x08;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.W] = 0x09;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.Q] = 0x0A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.RIGHT] = 0x10;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII[']']] = 0x14;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['[']] = 0x15;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.I] = 0x16;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.U] = 0x17;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.R] = 0x18;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.E] = 0x19;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['1']] = 0x1A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.LEFT] = 0x20;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.DOWN] = 0x22;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.PAUSE] = 0x23; // aka BREAK
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['`']] = 0x24;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['-']] = 0x25;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['9']] = 0x26;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['7']] = 0x27;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['4']] = 0x28;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['3']] = 0x29;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.ESC] = 0x2A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.UP] = 0x30;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F3] = 0x31; // aka PF3
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F1] = 0x32; // aka PF1
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.BS] = 0x33;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['=']] = 0x34;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['0']] = 0x35;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['8']] = 0x36;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['6']] = 0x37;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['5']] = 0x38;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['2']] = 0x39;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.TAB] = 0x3A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_7] = 0x40;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F4] = 0x41; // aka PF4
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F2] = 0x42; // aka PF2
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_0] = 0x43;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.LF] = 0x44;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['\\']] = 0x45;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.L] = 0x46;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.K] = 0x47;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.G] = 0x48;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.F] = 0x49;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.A] = 0x4A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_8] = 0x50;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_CR] = 0x51;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_2] = 0x52;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_1] = 0x53;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII["'"]] = 0x55;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII[';']] = 0x56;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.J] = 0x57;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.H] = 0x58;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.D] = 0x59;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.S] = 0x5A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_DEL] = 0x60; // keypad period
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F8] = 0x61; // aka keypad comma
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_5] = 0x62;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_4] = 0x63;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.CR] = 0x64; // TODO: Figure out why the Technical Manual lists CR at both 0x04 and 0x64
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['.']] = 0x65;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII[',']] = 0x66;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.N] = 0x67;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.B] = 0x68;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.X] = 0x69;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F9] = 0x6A; // aka NO SCROLL
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_9] = 0x70;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_3] = 0x71;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_6] = 0x72;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.NUM_SUB] = 0x73;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII['/']] = 0x75;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.M] = 0x76;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII[' ']] = 0x77;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.V] = 0x78;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.C] = 0x79;
+Keyboard.VT100.KEYMAP[Keyboard.ASCII.Z] = 0x7A;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.F10] = 0x7B; // aka SET-UP
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.CTRL] = 0x7C;
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.SHIFT] = 0x7D; // either shift key (doesn't matter)
+Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.CAPSLOCK]= 0x7E;
+
+Keyboard.VT100.LEDCODES = {
'l4': Keyboard.VT100.STATUS.LED4,
'l3': Keyboard.VT100.STATUS.LED3,
'l2': Keyboard.VT100.STATUS.LED2,
@@ -271,6 +386,14 @@ Keyboard.LEDSTATES = {
'local': ~Keyboard.VT100.STATUS.ONLINE
};
+/*
+ * Supported models and their configurations
+ */
+Keyboard.MODELS = {
+ "SI1978": Keyboard.SI1978,
+ "VT100": Keyboard.VT100
+};
+
/**
* setBinding(sHTMLType, sBinding, control, sValue)
*
@@ -306,7 +429,7 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
if (this.bindings[id] === undefined) {
- if (sHTMLType == "led" && Keyboard.LEDSTATES[sBinding]) {
+ if (sHTMLType == "led" && this.config.LEDCODES && this.config.LEDCODES[sBinding]) {
this.bindings[id] = control;
return true;
}
@@ -330,7 +453,7 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
return true;
default:
- if (Keyboard.SOFTCODES[sBinding] !== undefined) {
+ if (this.config.SOFTCODES && this.config.SOFTCODES[sBinding] !== undefined) {
this.bindings[id] = control;
var fnDown = function(kbd, sSoftCode) {
return function onMouseOrTouchDownKeyboard(event) {
@@ -370,16 +493,8 @@ Keyboard.prototype.initBus = function(cmp, bus, cpu, dbg)
{
this.dbg = dbg; // NOTE: The "dbg" property must be set for the message functions to work
this.chipset = cmp.getMachineComponent("ChipSet");
- this.model = this.chipset.model;
- switch(this.model) {
- case ChipSet.VT100.MODEL:
- this.config = Keyboard.VT100;
- break;
- }
- if (this.config) {
- bus.addPortInputTable(this, this.config.portsInput);
- bus.addPortOutputTable(this, this.config.portsOutput);
- }
+ bus.addPortInputTable(this, this.config.portsInput);
+ bus.addPortOutputTable(this, this.config.portsOutput);
};
/**
@@ -415,9 +530,9 @@ Keyboard.prototype.powerDown = function(fSave, fShutdown)
return fSave? this.save() : true;
};
-Keyboard.VT100.init = [
+Keyboard.VT100.INIT = [
[
- 0
+ Keyboard.VT100.STATUS.INIT
]
];
@@ -438,7 +553,7 @@ Keyboard.prototype.reset = function()
this.keysPressed = {};
this.keysToRelease = {};
- if (this.config && !this.restore(this.config.init)) {
+ if (this.config.INIT && !this.restore(this.config.INIT)) {
this.notice("reset error");
}
};
@@ -454,10 +569,10 @@ Keyboard.prototype.reset = function()
Keyboard.prototype.save = function()
{
var state = new State(this);
- switch(this.model) {
- case ChipSet.SI1978.MODEL:
+ switch(this.config.MODEL) {
+ case Keyboard.SI1978.MODEL:
break;
- case ChipSet.VT100.MODEL:
+ case Keyboard.VT100.MODEL:
state.set(0, [this.bLEDs]);
break;
}
@@ -477,10 +592,11 @@ Keyboard.prototype.restore = function(data)
{
var a;
if (data && (a = data[0]) && a.length) {
- switch(this.model) {
- case ChipSet.SI1978.MODEL:
+ switch(this.config.MODEL) {
+ case Keyboard.SI1978.MODEL:
return true;
- case ChipSet.VT100.MODEL:
+
+ case Keyboard.VT100.MODEL:
this.bLEDs = a[0];
this.updateLEDs();
return true;
@@ -511,11 +627,11 @@ Keyboard.prototype.setLED = function(control, f)
*/
Keyboard.prototype.updateLEDs = function()
{
- for (var sBinding in Keyboard.LEDSTATES) {
+ for (var sBinding in this.config.LEDCODES) {
var id = "led-" + sBinding;
var control = this.bindings[id];
if (control) {
- var bitLED = Keyboard.LEDSTATES[sBinding];
+ var bitLED = this.config.LEDCODES[sBinding];
var fOn = !!(this.bLEDs & bitLED);
if (bitLED & (bitLED-1)) {
fOn = !(this.bLEDs & ~bitLED);
@@ -534,8 +650,8 @@ Keyboard.prototype.updateLEDs = function()
Keyboard.prototype.getSoftCode = function(keyCode)
{
keyCode = Keyboard.ALTCODES[keyCode] || keyCode;
- for (var sSoftCode in Keyboard.SOFTCODES) {
- if (Keyboard.SOFTCODES[sSoftCode] === keyCode) {
+ for (var sSoftCode in this.config.SOFTCODES) {
+ if (this.config.SOFTCODES[sSoftCode] === keyCode) {
return sSoftCode;
}
}
diff --git a/versions/pc8080/1.23.3/pc8080-dbg.js b/versions/pc8080/1.23.3/pc8080-dbg.js
index 2c2bb182e..4eaf152f6 100644
--- a/versions/pc8080/1.23.3/pc8080-dbg.js
+++ b/versions/pc8080/1.23.3/pc8080-dbg.js
@@ -1,234 +1,237 @@
(function(){var m;function aa(a,b){var c;if(a){b||(b=16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var e,d=a,f=b;(f&&10!=f?16==f?null!==d.match(/^[0-9a-f]+$/i):2==f&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(e=parseInt(a,b))&&(c=e|0)}return c}
-function q(a,b){var c="";void 0===b?b=8:8=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function r(a){return"0x"+q(a,4)}function ba(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ia(a,b){return(a+" ").slice(0,b)}function ja(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
+function n(a,b){var c="";void 0===b?b=8:8=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function r(a){return"0x"+n(a,4)}function ba(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a,b){return(a+" ").slice(0,b)}function ja(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
function ka(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(a,b){return a>b?1:a>1,g;g=c(b,a[h]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function na(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c=this.I?10:20>=this.I?12:24>=this.I?14:15;this.Ba=1<>2;this.A=this.Ba-1;this.K=this.N/this.Ba|0;this.J=this.K-1;this.u=[];this.C=[];this.D=this.H=!1;this.Y=[];this.aa=[];a=new G;tb(a,this.G);this.V=Array(this.K);for(b=0;b>>a.la;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.F)return g.Fb+=g.F-e,g.F=e,!0;if(e>=g.F+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.F+l;e=k+a.Ba;f-=l;h++;continue}}return vb(1,e,f)}e=new G(e,l,a.Ba,d);tb(e,a.G,g);a.V[h++]=e;e=k+a.Ba;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+wb[d]+" at "+r(b)),!0):vb(2,b,c)}m.X=function(a){return this.V[(a&this.w)>>>this.la].rb(a&this.A,a)};
-function xb(a,b){return a.V[(b&a.w)>>>a.la].Db(b&a.A,b)}m.Oa=function(a){var b=a&this.A,c=(a&this.w)>>>this.la;return b!=this.A?this.V[c].tc(b,a):this.V[c++].rb(b,a)|this.V[c&this.J].rb(0,a+1)<<8};function yb(a,b){var c=b&a.A,d=(b&a.w)>>>a.la;return c!=a.A?a.V[d].Xb(c,b):a.V[d++].Db(c,b)|a.V[d&a.J].Db(0,b+1)<<8}m.qa=function(a,b){this.V[(a&this.w)>>>this.la].tb(a&this.A,b&255,a)};function zb(a,b,c){a.V[(b&a.w)>>>a.la].Gb(b&a.A,c&255,b)}
-m.Pb=function(a,b){var c=a&this.A,d=(a&this.w)>>>this.la;c!=this.A?this.V[d].vc(c,b&65535,a):(this.V[d++].tb(c,b&255,a),this.V[d&this.J].tb(0,b>>8&255,a+1))};function Ab(a,b){if(void 0===b)return a.D=!a.D,a.D;void 0===a.u[b]&&(a.u[b]=[null,!1]);a.u[b][1]=!a.u[b][1];return a.u[b][1]}function Bb(a,b,c){var d;void 0===d&&(d=0);if(c)for(var e in c){var f=a,h=+e+d,g=c[e].bind(b);if(void 0!==g)for(var k=+e+d;k<=h;k++)void 0!==f.u[k]?v("Input port "+r(k)+" already registered"):f.u[k]=[g,!1]}}
-function Cb(a,b,c){for(var d=1,e=0,f=0;0>>=f)&k;if(void 0!==h){if(h[0])h[0](b,k,d);a.G&&a.H!=h[1]&&Hb(a.G,b,k)}else a.G&&(eb(a.G,a,b,k,d),a.H&&Hb(a.G,b,k));f+=g<<3;b+=g;e-=g}}
-function vb(a,b,c){v("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Ib;if(nb){var Rb=new ArrayBuffer(2);(new DataView(Rb)).setUint16(0,256,!0);Ib=256===(new Uint16Array(Rb))[0]}else Ib=!1;var Sb=Ib;
-function G(a,b,c,d){this.id=Tb+=2;this.b=null;this.F=a;this.Fb=b;this.size=c||0;this.type=d||Ub;this.L=d==Vb;tb(this);this.Ka=this.ec=!1;if(c)if(nb)this.D=new ArrayBuffer(c),this.H=new DataView(this.D,0,c),this.A=new Uint8Array(this.D,0,c),this.J=new Uint16Array(this.D,0,c>>1),this.b=new Int32Array(this.D,0,c>>2),Wb(this,Sb?Xb:Yb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ka:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},ya:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.Ka=!0},Y:function(a,b){if(this.G&&null!=this.F){var c=this.G;cc(c,this.F+a,1,c.Y)&&c.ja(!0)}return this.Db(a,b)},ea:function(a,b){if(this.G&&null!=this.F){var c=this.G;cc(c,this.F+a,2,c.Y)&&c.ja(!0)}return this.Xb(a,b)},ua:function(a,b,c){if(this.G&&null!=this.F){var d=this.G;cc(d,this.F+a,1,d.H)&&d.ja(!0)}this.L?this.w(a,b,c):this.Gb(a,b,c)},
-Ga:function(a,b,c){if(this.G&&null!=this.F){var d=this.G;cc(d,this.F+a,2,d.H)&&d.ja(!0)}this.L?this.w(a,b,c):this.Yb(a,b,c)},U:function(a){return this.A[a]},aa:function(a){return this.A[a]},da:function(a){return this.H.getUint16(a,!0)},ga:function(a){return a&1?this.A[a]|this.A[a+1]<<8:this.J[a>>1]},ma:function(a,b){this.A[a]=b;this.Ka=!0},xa:function(a,b){this.A[a]=b;this.Ka=!0},za:function(a,b){this.H.setUint16(a,b,!0);this.Ka=!0},Ha:function(a,b){a&1?(this.A[a]=b,this.A[a+1]=b>>8):this.J[a>>1]=
-b;this.Ka=!0}};function tb(a,b,c){a.G=b;a.u=a.C=0;c&&((a.u=c.u)&&bc(a,ac,!1),(a.C=c.C)&&$b(a,ac,!1))}function dc(a,b){b?0===--a.C&&(a.tb=a.L?a.w:a.Gb,a.vc=a.L?a.I:a.Yb):0===--a.u&&(a.rb=a.Db,a.tc=a.Xb)}function $b(a,b,c){c&&a.C||(a.tb=!a.L&&b[2]||a.w,a.vc=!a.L&&b[3]||a.I);if(c||void 0===c)a.Gb=b[2]||a.w,a.Yb=b[3]||a.I}function bc(a,b,c){c&&a.u||(a.rb=b[0]||a.K,a.tc=b[1]||a.N);if(c||void 0===c)a.Db=b[0]||a.K,a.Xb=b[1]||a.N}function Wb(a,b){b||(b=ec);bc(a,b,void 0);$b(a,b,void 0)}
-var ec=[],Zb=[G.prototype.ca,G.prototype.ka,G.prototype.ya,G.prototype.cb],ac=[G.prototype.Y,G.prototype.ea,G.prototype.ua,G.prototype.Ga];if(nb)var Yb=[G.prototype.U,G.prototype.da,G.prototype.ma,G.prototype.za],Xb=[G.prototype.aa,G.prototype.ga,G.prototype.xa,G.prototype.Ha];
-function fc(a,b){y.call(this,"CPU",a,fc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.qb=c;this.i.Mb=0;this.i.$a=d;this.i.Ub=Math.round(this.i.qb/1E4)/100;this.i.Ya=this.i.Ub*this.i.$a;this.B.va=!1;this.B.Sb=!1;this.B.dc=a.autoStart;this.B.fc=!1;this.B.ib=!1;this.i.xb=this.i.nb=0;this.i.yb=a.csStart;this.i.mb=a.csInterval;this.i.ob=a.csStop;this.aa=this.ab.bind(this);E(this)}Za(fc);var gc=["power","reset"];m=fc.prototype;
-m.Na=function(a,b,c,d){this.u=a;this.A=b;this.G=d;for(b=0;b=a.i.nb&&(a.i.nb+=a.i.mb,c=!0);0<=a.i.ob&&a.i.ob<=zc(a)&&(a.i.mb=a.i.ob=-1,jc(a),a.ja(),c=!0);c&&a.g(zc(a)+" cycles: checksum="+q(a.i.xb))}}
-m.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.L[b]=c;a=!0;break;case "run":this.L[b]=c;c.onclick=function(){var a;if(a=d.u)if(a=d.u,a.B.ra)a=!0;else{var b=null,c,g=bb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Xa/a.i.Ya?b=1:d=!0;a.i.$a=b;b=a.i.Ub*a.i.$a;if(a.i.Ya!=b){a.i.Ya=b;b=a.i.Ya.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.u&&a.u.Eb()}Bc(a,a.H);a.H=0;a.i.lb=la();a.i.Za=0;Cc(a);return d}
-m.ab=function(a){if(hb(this,!0)){if(!this.B.va){Ac(this);this.u&&this.u.start(this.i.lb,zc(this));this.B.va=!0;this.B.Sb=!0;this.C&&this.C.start();var b=this.L.run;b&&(b.textContent="Halt");this.u&&(this.u.Da(!0),a&&this.u.Eb(!0))}this.i.Wb>=this.i.qb&&Cc(this,!0);this.i.Bb=0;this.i.Lb=la();this.i.Za&&(a=this.i.Lb-this.i.Za,a>this.i.mc&&(this.i.lb+=a,this.i.lb>this.i.Lb&&(this.i.lb=this.i.Lb)));try{do{this.sb(this.B.ib?1:this.i.dd);var c=this.D-this.b;this.H+=c;this.i.Bb+=c;Bc(this,0,!0);yc(this,
-c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.oc,this.u&&Dc(this.u,this.i.Mb++),this.i.Mb>this.K&&(this.i.Mb=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.nc,this.u&&this.u.Da());this.i.pb-=c;if(0>=this.i.pb){this.i.pb+=this.i.Vb;break}}while(this.B.va)}catch(e){this.ja();kc(this);this.u&&this.u.stop(la(),zc(this));hb(this,!1);mb(this,e.stack||e.message);return}c=setTimeout;a=this.aa;this.i.Za=la();b=this.i.mc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Vb));var b=b-(this.i.Za-this.i.Lb),d=
-this.i.Za-this.i.lb;d&&(this.i.Xa=Math.round(this.H/(10*d))/100,864E5<=d&&(this.I=0,Ac(this)));if(0>b||this.i.Xa>8&255;a.P=b&255}function Nc(a){return a.R<<8|a.S}function Oc(a,b){a.R=b>>8&255;a.S=b&255}function K(a){return a.T<<8|a.W}
-function Pc(a,b){a.T=b>>8&255;a.W=b&255}function H(a,b){a.M=b&65535}function L(a){return a.Z&256?1:0}function Qc(a,b){a.Z=a.Z&255|b}function Rc(a){return ob[a.ba&255]?4:0}function Sc(a){return(a.ba^a.ta)&16?16:0}function Tc(a){return a.Z&255?0:64}function Uc(a){return a.ba&128?128:0}function Kc(a){return a.sa&-214|Uc(a)|Tc(a)|Sc(a)|Rc(a)|L(a)}function Ic(a,b){a.Z=a.ba=a.ta=0;b&1&&(a.Z|=256);b&4||(a.ba|=1);b&16&&(a.ta|=16);b&64||(a.Z|=255);b&128&&(a.ba^=192);a.sa=a.sa&-726|b&512|2}
-function Vc(a,b){a.ta=a.j^b;return a.ba=(a.Z=a.j+b)&255}function Wc(a,b){a.ta=a.j^b;return a.ba=(a.Z=a.j+b+(a.Z&256?1:0))&255}function Xc(a,b){a.Z=a.ba=a.ta=a.j&b;(a.j|b)&8&&(a.ta^=16);return a.Z}function Yc(a,b){a.ta=b^255;b=a.ba=b+255&255;a.Z=a.Z&-256|b;return b}function Zc(a,b){a.ta=b;b=a.ba=b+1&255;a.Z=a.Z&-256|b;return b}function $c(a,b){return a.ba=a.Z=a.ta=a.j|b}function M(a,b){b^=255;a.ta=a.j^b;return a.ba=(a.Z=a.j+b+1^256)&255}
-function ad(a,b){b^=255;a.ta=a.j^b;return a.ba=(a.Z=a.j+b+(a.Z&256?0:1)^256)&255}function bd(a,b){return a.ba=a.Z=a.ta=a.j^b}m.X=function(a){return this.A.X(a)};m.qa=function(a,b){this.A.qa(a,b)};function O(a){var b=a.X(a.M);H(a,a.M+1);return b}function P(a){var b=a.A.Oa(a.M);H(a,a.M+2);return b}function Q(a){var b=a.A.Oa(a.ia);a.ia=a.ia+2&65535;return b}function R(a,b){a.ia=a.ia-2&65535;a.A.Pb(a.ia,b)}
-function S(a,b,c,d){d=d||2;a.L[b]&&(void 0===c&&(mb(a,"Value for "+b+" is invalid"),a.ja()),c=!a.B.va||a.B.fc?q(c,d):"--------".substr(0,d),a.L[b].textContent!=c&&(a.L[b].textContent=c))}
-m.Da=function(a){this.Y&&(a||!this.B.va||this.B.fc)&&(S(this,"A",this.j),S(this,"B",this.O),S(this,"C",this.P),S(this,"BC",Lc(this),4),S(this,"D",this.R),S(this,"E",this.S),S(this,"DE",Nc(this),4),S(this,"H",this.T),S(this,"L",this.W),S(this,"HL",K(this),4),S(this,"SP",this.ia,4),S(this,"PC",this.M,4),a=Kc(this),S(this,"PS",a,4),S(this,"IF",a&512?1:0,1),S(this,"SF",a&128?1:0,1),S(this,"ZF",a&64?1:0,1),S(this,"AF",a&16?1:0,1),S(this,"PF",a&4?1:0,1),S(this,"CF",a&1?1:0,1));if(a=this.L.speed)a.textContent=
-this.B.va&&this.i.Xa?this.i.Xa.toFixed(2)+"Mhz":"Stopped"};
-m.sb=function(a){this.B.Ib=!0;var b=this.B.Xc=this.G&&cd(this.G),c=a?this.B.Sb?0:1:-1;this.B.Sb=!1;this.D=this.b=a;do{if(this.w){var d;this.w&8&&this.sa&512?(d=199|(this.w&7)<<3,this.w&=-16,this.sa&=-513,this.N[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.w&16){this.b=0;break}}if(b){if(wd(this.G,this.M,c)){this.ja();break}c=1}this.N[O(this)].call(this)}while(0>8;Qc(this,a&256);this.b-=4},xd,function(){var a;Pc(this,a=K(this)+Lc(this));Qc(this,a>>8&256);this.b-=10},function(){this.j=this.X(Lc(this));this.b-=7},function(){Mc(this,Lc(this)-1);this.b-=
-5},function(){this.P=Zc(this,this.P);this.b-=5},function(){this.P=Yc(this,this.P);this.b-=5},function(){this.P=O(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Qc(this,a);this.b-=4},xd,function(){Oc(this,P(this));this.b-=10},function(){this.qa(Nc(this),this.j);this.b-=7},function(){Oc(this,Nc(this)+1);this.b-=5},function(){this.R=Zc(this,this.R);this.b-=5},function(){this.R=Yc(this,this.R);this.b-=5},function(){this.R=O(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|
-L(this);Qc(this,a&256);this.b-=4},xd,function(){var a;Pc(this,a=K(this)+Nc(this));Qc(this,a>>8&256);this.b-=10},function(){this.j=this.X(Nc(this));this.b-=7},function(){Oc(this,Nc(this)-1);this.b-=5},function(){this.S=Zc(this,this.S);this.b-=5},function(){this.S=Yc(this,this.S);this.b-=5},function(){this.S=O(this);this.b-=7},function(){var a=this.j<<8;this.j=(L(this)<<8|this.j)>>1;Qc(this,a&256);this.b-=4},xd,function(){Pc(this,P(this));this.b-=10},function(){var a=P(this);this.A.Pb(a,K(this));this.b-=
-16},function(){Pc(this,K(this)+1);this.b-=5},function(){this.T=Zc(this,this.T);this.b-=5},function(){this.T=Yc(this,this.T);this.b-=5},function(){this.T=O(this);this.b-=7},function(){var a=0,b=L(this);if(Sc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Vc(this,a);Qc(this,b?256:0);this.b-=4},xd,function(){var a;Pc(this,a=K(this)+K(this));Qc(this,a>>8&256);this.b-=10},function(){var a;a=P(this);a=this.A.Oa(a);Pc(this,a);this.b-=16},function(){Pc(this,K(this)-1);this.b-=5},function(){this.W=
-Zc(this,this.W);this.b-=5},function(){this.W=Yc(this,this.W);this.b-=5},function(){this.W=O(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},xd,function(){this.ia=P(this)&65535;this.b-=10},function(){this.qa(P(this),this.j);this.b-=13},function(){this.ia=this.ia+1&65535;this.b-=5},function(){var a=K(this);this.qa(a,Zc(this,this.X(a)));this.b-=10},function(){var a=K(this);this.qa(a,Yc(this,this.X(a)));this.b-=10},function(){this.qa(K(this),O(this));this.b-=10},function(){this.Z|=256;this.b-=
-4},xd,function(){var a;Pc(this,a=K(this)+this.ia);Qc(this,a>>8&256);this.b-=10},function(){this.j=this.X(P(this));this.b-=13},function(){this.ia=this.ia-1&65535;this.b-=5},function(){this.j=Zc(this,this.j);this.b-=5},function(){this.j=Yc(this,this.j);this.b-=5},function(){this.j=O(this);this.b-=7},function(){Qc(this,L(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.O=this.P;this.b-=5},function(){this.O=this.R;this.b-=5},function(){this.O=this.S;this.b-=5},function(){this.O=this.T;this.b-=
-5},function(){this.O=this.W;this.b-=5},function(){this.O=this.X(K(this));this.b-=7},function(){this.O=this.j;this.b-=5},function(){this.P=this.O;this.b-=5},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.T;this.b-=5},function(){this.P=this.W;this.b-=5},function(){this.P=this.X(K(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.O;this.b-=5},function(){this.R=this.P;this.b-=5},function(){this.b-=5},function(){this.R=
-this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.W;this.b-=5},function(){this.R=this.X(K(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.O;this.b-=5},function(){this.S=this.P;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=this.T;this.b-=5},function(){this.S=this.W;this.b-=5},function(){this.S=this.X(K(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.O;this.b-=5},function(){this.T=
-this.P;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T=this.W;this.b-=5},function(){this.T=this.X(K(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){this.W=this.O;this.b-=5},function(){this.W=this.P;this.b-=5},function(){this.W=this.R;this.b-=5},function(){this.W=this.S;this.b-=5},function(){this.W=this.T;this.b-=5},function(){this.b-=5},function(){this.W=this.X(K(this));this.b-=7},function(){this.W=this.j;
-this.b-=5},function(){this.qa(K(this),this.O);this.b-=7},function(){this.qa(K(this),this.P);this.b-=7},function(){this.qa(K(this),this.R);this.b-=7},function(){this.qa(K(this),this.S);this.b-=7},function(){this.qa(K(this),this.T);this.b-=7},function(){this.qa(K(this),this.W);this.b-=7},function(){var a=this.M-1;if(this.J.length)for(var b=0;b>8;this.b-=10},function(){var a=P(this);Uc(this)||H(this,a);this.b-=10},function(){this.sa&=-513;this.b-=4},function(){var a=P(this);Uc(this)||(R(this,this.M),H(this,a),this.b-=6);this.b-=11},function(){R(this,Kc(this)&255|this.j<<8);this.b-=11},function(){this.j=$c(this,O(this));this.b-=7},function(){R(this,this.M);H(this,48);this.b-=11},function(){Uc(this)&&(H(this,Q(this)),
-this.b-=6);this.b-=5},function(){this.ia=K(this)&65535;this.b-=5},function(){var a=P(this);Uc(this)&&H(this,a);this.b-=10},function(){this.sa|=512;this.b-=4},function(){var a=P(this);Uc(this)&&(R(this,this.M),H(this,a),this.b-=6);this.b-=11},Ad,function(){M(this,O(this));this.b-=7},function(){R(this,this.M);H(this,56);this.b-=11}];
-function T(a){y.call(this,"ChipSet",a,T,32768);var b=a.model;b&&!Bd[b]&&v("Unrecognized ChipSet model: "+b);this.w=Bd[b]||U;this.Ia=this.w.Ea;a.sound&&(this.aa=null,window&&(this.aa=window.AudioContext||window.webkitAudioContext),this.aa&&new this.aa);E(this)}Za(T);
-var U={Ea:1978.1,Sc:{wa:0,yd:1,Cd:16,Kd:32,Td:64,Sd:128,ub:14},Ra:{wa:1,zc:1,Oc:2,Kc:4,Lc:16,Mc:32,Nc:64,ub:8},Tc:{wa:2,xd:3,ae:4,zd:8,Od:16,Pd:32,Qd:64,Ad:128,ub:0},Wd:{wa:3},Ud:{wa:2,Ld:7},Yd:{wa:3,be:1,Xd:2,Rd:4,Hd:8,Bd:16,vd:32},Vd:{wa:4},Zd:{wa:5,Dd:1,Ed:2,Fd:4,Gd:8,ce:16}},V={Ea:100,bb:{wa:66,de:1,Ic:2,Jc:4,Nd:8,Md:16,$b:32,Zb:64,Id:128},yc:{wa:66,INIT:0},Fa:{Jd:{wa:98},Pa:{xc:0,wc:1,Qc:2,Uc:4,Cc:5,Pc:6,Rc:7},Hb:16383},Bc:{wa:162,INIT:0},Ac:{wa:194,INIT:0}},Bd={SI1978:U,VT100:V};
-T.prototype.pa=function(){return!1};T.prototype.Na=function(a,b,c,d){this.A=b;this.b=c;this.G=d;this.u=a;Bb(b,this,this.w.Nb);Fb(b,this,this.w.Ob)};T.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.Ja=function(a){return a?this.save():!0};U.Wa=[[U.Sc.ub,U.Ra.ub,U.Tc.ub,0,0,0,0]];V.Wa=[[V.yc.INIT,V.bb.Ic|V.bb.Jc,V.Bc.INIT,V.Ac.INIT],[0,0,0,0,Array(100)]];m=T.prototype;m.reset=function(){this.restore(this.w.Wa)||this.fa("reset error")};
-m.save=function(){var a=new I(this);switch(this.Ia){case U.Ea:J(a,0,[this.ma,this.D,this.ua,this.N,this.Y,this.ga,this.ka]);break;case V.Ea:J(a,0,[this.ca,this.I,this.ea,this.da]),J(a,1,[this.K,this.C,this.J,this.U,this.H])}return a.data()};
-m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.Ia){case U.Ea:return this.ma=b[0],this.D=b[1],this.ua=b[2],this.N=b[3],this.Y=b[4],this.ga=b[5],this.ka=b[6],!0;case V.Ea:return this.ca=b[0],this.I=b[2],this.ea=b[3],this.da=b[4],b=a[1],this.K=b[0],this.C=b[1],this.J=b[2],this.U=b[3],this.H=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Cd(a,b,c){a.D&=~b;c&&(a.D|=b)}m.Zc=function(a,b){var c=this.ma;D(this,a,null,b,"STATUS0",c);return c};
-m.$c=function(a,b){var c=this.D;D(this,a,null,b,"STATUS1",c);return c};m.ad=function(a,b){var c=this.ua;D(this,a,null,b,"STATUS2",c);return c};m.Yc=function(a,b){var c=this.N>>8-this.Y&255;D(this,a,null,b,"SHIFT.RESULT",c);return c};m.ed=function(a,b,c){D(this,a,b,c,"SHIFT.COUNT",null);this.Y=b};m.gd=function(a,b,c){D(this,a,b,c,"SOUND1",null);this.ga=b};m.fd=function(a,b,c){D(this,a,b,c,"SHIFT.DATA",null);this.N=b<<8|this.N>>8};m.hd=function(a,b,c){D(this,a,b,c,"SOUND2",null);this.ka=b};
-m.jd=function(a,b,c){D(this,a,b,c,"WATCHDOG",null)};function Dd(a){var b=0,c=0,d=~a.K;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c}
-m.bd=function(a,b){var c=this.I,c=c&~V.bb.Zb;if((zc(this.b)&64)<<1&&(c|=V.bb.Zb,c!=this.I)){var d,e;d=this.J&1;e=this.J>>1&7;switch(e){case V.Fa.Pa.Rc:break;case V.Fa.Pa.wc:this.K=this.K<<1|d;break;case V.Fa.Pa.Cc:d=Dd(this);this.H[d]=V.Fa.Hb;fb(this,"doNVRCommand(): erase data at addr "+r(d));break;case V.Fa.Pa.xc:this.C=this.C<<1|d;break;case V.Fa.Pa.Uc:d=Dd(this);e=this.C&V.Fa.Hb;this.H[d]=e;fb(this,"doNVRCommand(): write data "+r(e)+" to addr "+r(d));break;case V.Fa.Pa.Pc:d=Dd(this);e=this.H[d];
-null==e&&(e=V.Fa.Hb);this.C=e;fb(this,"doNVRCommand(): read data "+r(e)+" from addr "+r(d));break;case V.Fa.Pa.Qc:this.C<<=1;this.U=this.C&V.Fa.Hb+1;break;default:fb(this,"doNVRCommand(): unrecognized command 0x"+q(e,2))}}c&=~V.bb.$b;this.U&&(c|=V.bb.$b);this.I=c;D(this,a,null,b,"FLAGS.BUFFER",c);return c};m.kd=function(a,b,c){D(this,a,b,c,"BRIGHTNESS",null);this.ca=b};m.nd=function(a,b,c){D(this,a,b,c,"NVR.LATCH",null);this.J=b};m.md=function(a,b,c){D(this,a,b,c,"DC012",null);this.ea=b};
-m.ld=function(a,b,c){D(this,a,b,c,"DC011",null);this.da=b};U.Nb={0:T.prototype.Zc,1:T.prototype.$c,2:T.prototype.ad,3:T.prototype.Yc};U.Ob={2:T.prototype.ed,3:T.prototype.gd,4:T.prototype.fd,5:T.prototype.hd,6:T.prototype.jd};V.Nb={66:T.prototype.bd};V.Ob={66:T.prototype.kd,98:T.prototype.nd,162:T.prototype.md,194:T.prototype.ld};Ja(function(){for(var a=C(document,"pc8080","chipset"),b=0;b>>0,h],p=ka(n,k,a.Ta);0>p&&n.splice(-(p+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.I.push({ee:b,F:c,cd:d,Ma:e,bc:f})}delete this.Ma}return!0};Ed.prototype.Ja=function(){return!0};
-function Fd(a,b,c,d){if(d)a.fa("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.Tb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.u=f;else if(h)for(a.u=Array(4*h.length),d=c=0;c>8&255,a.u[d++]=h[c]>>16&255,a.u[d++]=h[c]>>24&255;else a.u=e;a.Ma=e.symbols;if(!a.u.length){v("Empty ROM: "+b);return}if(1==a.u.length){v(a.u[0]);return}}catch(g){a.fa("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
-" ").replace(/ +$/,"").split(" "),a.u=Array(b.length),e=0;e>>f.la;0>>=f.la;0Date.now()-d)return a.b[b]=d,Sd(a),!0;delete a.u[b]}if(a.C)switch(b){case "1p":Cd(a.C,U.Ra.Kc,c);break;case "2p":Cd(a.C,U.Ra.Oc,c);break;case "coin":Cd(a.C,U.Ra.zc,c);break;case "left":Cd(a.C,U.Ra.Mc,c);break;case "right":Cd(a.C,U.Ra.Nc,c);break;case "fire":Cd(a.C,U.Ra.Lc,c)}return!0}
-function Sd(a){for(var b=-1,c=Object.keys(a.b),d=0;db||b>f)b=f}else delete a.b[e],Qd(a,e,!1)}0<=b&&setTimeout(function(){Sd(a)},b)}X.prototype.D=function(a,b,c){D(this,a,b,c,"KBDUART.STATUS",null);this.A=b;Rd(this)};Ld.Nb={};Ld.Ob={130:X.prototype.D};Ja(function(){for(var a=C(document,"pc8080","keyboard"),b=0;b>3)*this.ca;if(this.rd||ub(this.A,this.ya,this.Va,3))1>1)),this.K=document.createElement("canvas"),this.K.width=b,this.K.height=c,this.fb=
-this.K.getContext("2d"),this.ma={},this.Ha=1<=a.od?8:16,f=8>(7>
+function za(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Fa={init:[],show:[],exit:[]},Ga=!1,Ha=!0;function Ia(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ja(a){Fa.init.push(a)}
+function Ka(a){if(Ha)try{for(var b=0;b=this.J?10:20>=this.J?12:24>=this.J?14:15;this.Ba=1<>2;this.A=this.Ba-1;this.L=this.O/this.Ba|0;this.K=this.L-1;this.w=[];this.u=[];this.D=this.I=!1;this.Z=[];this.ba=[];a=new F;ub(a,this.H);this.V=Array(this.L);for(b=0;b>>a.la;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.F)return g.Fb+=g.F-e,g.F=e,!0;if(e>=g.F+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.F+l;e=k+a.Ba;f-=l;h++;continue}}return wb(1,e,f)}e=new F(e,l,a.Ba,d);ub(e,a.H,g);a.V[h++]=e;e=k+a.Ba;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+xb[d]+" at "+r(b)),!0):wb(2,b,c)}m.Y=function(a){return this.V[(a&this.G)>>>this.la].qb(a&this.A,a)};
+function yb(a,b){return a.V[(b&a.G)>>>a.la].Db(b&a.A,b)}m.Pa=function(a){var b=a&this.A,c=(a&this.G)>>>this.la;return b!=this.A?this.V[c].vc(b,a):this.V[c++].qb(b,a)|this.V[c&this.K].qb(0,a+1)<<8};function zb(a,b){var c=b&a.A,d=(b&a.G)>>>a.la;return c!=a.A?a.V[d].Zb(c,b):a.V[d++].Db(c,b)|a.V[d&a.K].Db(0,b+1)<<8}m.qa=function(a,b){this.V[(a&this.G)>>>this.la].sb(a&this.A,b&255,a)};function Ab(a,b,c){a.V[(b&a.G)>>>a.la].Gb(b&a.A,c&255,b)}
+m.Qb=function(a,b){var c=a&this.A,d=(a&this.G)>>>this.la;c!=this.A?this.V[d].xc(c,b&65535,a):(this.V[d++].sb(c,b&255,a),this.V[d&this.K].sb(0,b>>8&255,a+1))};function Bb(a,b){if(void 0===b)return a.D=!a.D,a.D;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]}function Cb(a,b,c){var d;void 0===d&&(d=0);if(c)for(var e in c){var f=a,h=+e+d,g=c[e].bind(b);if(void 0!==g)for(var k=+e+d;k<=h;k++)void 0!==f.w[k]?t("Input port "+r(k)+" already registered"):f.w[k]=[g,!1]}}
+function Db(a,b,c){for(var d=1,e=0,f=0;0>>=f)&k;if(void 0!==h){if(h[0])h[0](b,k,d);a.H&&a.I!=h[1]&&Ib(a.H,b,k)}else a.H&&(fb(a.H,a,b,k,d),a.I&&Ib(a.H,b,k));f+=g<<3;b+=g;e-=g}}
+function wb(a,b,c){t("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Jb;if(ob){var Sb=new ArrayBuffer(2);(new DataView(Sb)).setUint16(0,256,!0);Jb=256===(new Uint16Array(Sb))[0]}else Jb=!1;var Tb=Jb;
+function F(a,b,c,d){this.id=Ub+=2;this.b=null;this.F=a;this.Fb=b;this.size=c||0;this.type=d||Vb;this.M=d==Wb;ub(this);this.Ka=this.oc=!1;if(c)if(ob)this.D=new ArrayBuffer(c),this.I=new DataView(this.D,0,c),this.A=new Uint8Array(this.D,0,c),this.K=new Uint16Array(this.D,0,c>>1),this.b=new Int32Array(this.D,0,c>>2),Xb(this,Tb?Yb:Zb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},Ea:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.Ka=!0},Z:function(a,b){if(this.H&&null!=this.F){var c=this.H;dc(c,this.F+a,1,c.Z)&&c.ja(!0)}return this.Db(a,b)},fa:function(a,b){if(this.H&&null!=this.F){var c=this.H;dc(c,this.F+a,2,c.Z)&&c.ja(!0)}return this.Zb(a,b)},wa:function(a,b,c){if(this.H&&null!=this.F){var d=this.H;dc(d,this.F+a,1,d.I)&&d.ja(!0)}this.M?this.G(a,b,c):this.Gb(a,b,c)},Ga:function(a,
+b,c){if(this.H&&null!=this.F){var d=this.H;dc(d,this.F+a,2,d.I)&&d.ja(!0)}this.M?this.G(a,b,c):this.$b(a,b,c)},W:function(a){return this.A[a]},ba:function(a){return this.A[a]},ea:function(a){return this.I.getUint16(a,!0)},ka:function(a){return a&1?this.A[a]|this.A[a+1]<<8:this.K[a>>1]},ra:function(a,b){this.A[a]=b;this.Ka=!0},za:function(a,b){this.A[a]=b;this.Ka=!0},Fa:function(a,b){this.I.setUint16(a,b,!0);this.Ka=!0},Ha:function(a,b){a&1?(this.A[a]=b,this.A[a+1]=b>>8):this.K[a>>1]=b;this.Ka=!0}};
+function ub(a,b,c){a.H=b;a.w=a.u=0;c&&((a.w=c.w)&&cc(a,bc,!1),(a.u=c.u)&&ac(a,bc,!1))}function ec(a,b){b?0===--a.u&&(a.sb=a.M?a.G:a.Gb,a.xc=a.M?a.J:a.$b):0===--a.w&&(a.qb=a.Db,a.vc=a.Zb)}function ac(a,b,c){c&&a.u||(a.sb=!a.M&&b[2]||a.G,a.xc=!a.M&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.G,a.$b=b[3]||a.J}function cc(a,b,c){c&&a.w||(a.qb=b[0]||a.L,a.vc=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.L,a.Zb=b[1]||a.O}function Xb(a,b){b||(b=fc);cc(a,b,void 0);ac(a,b,void 0)}
+var fc=[],$b=[F.prototype.da,F.prototype.ma,F.prototype.Ea,F.prototype.ab],bc=[F.prototype.Z,F.prototype.fa,F.prototype.wa,F.prototype.Ga];if(ob)var Zb=[F.prototype.W,F.prototype.ea,F.prototype.ra,F.prototype.Fa],Yb=[F.prototype.ba,F.prototype.ka,F.prototype.za,F.prototype.Ha];
+function gc(a,b){w.call(this,"CPU",a,gc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.pb=c;this.i.Nb=0;this.i.Za=d;this.i.Vb=Math.round(this.i.pb/1E4)/100;this.i.Xa=this.i.Vb*this.i.Za;this.C.va=!1;this.C.Ub=!1;this.C.nc=a.autoStart;this.C.pc=!1;this.C.hb=!1;this.i.xb=this.i.mb=0;this.i.yb=a.csStart;this.i.lb=a.csInterval;this.i.nb=a.csStop;this.ba=this.$a.bind(this);E(this)}$a(gc);var hc=["power","reset"];m=gc.prototype;
+m.Na=function(a,b,c,d){this.w=a;this.A=b;this.H=d;for(b=0;b=a.i.mb&&(a.i.mb+=a.i.lb,c=!0);0<=a.i.nb&&a.i.nb<=Bc(a)&&(a.i.lb=a.i.nb=-1,kc(a),a.ja(),c=!0);c&&a.g(Bc(a)+" cycles: checksum="+n(a.i.xb))}}
+m.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.M[b]=c;a=!0;break;case "run":this.M[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.C.sa)a=!0;else{var b=null,c,g=cb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Wa/a.i.Xa?b=1:d=!0;a.i.Za=b;b=a.i.Vb*a.i.Za;if(a.i.Xa!=b){a.i.Xa=b;b=a.i.Xa.toFixed(2)+"Mhz";var e=a.M.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.Eb()}Dc(a,a.I);a.I=0;a.i.kb=la();a.i.Ya=0;Ec(a);return d}
+m.$a=function(a){if(ib(this,!0)){if(!this.C.va){Cc(this);this.w&&this.w.start(this.i.kb,Bc(this));this.C.va=!0;this.C.Ub=!0;this.G&&this.G.start();var b=this.M.run;b&&(b.textContent="Halt");this.w&&(this.w.Da(!0),a&&this.w.Eb(!0))}this.i.Yb>=this.i.pb&&Ec(this,!0);this.i.Bb=0;this.i.Mb=la();this.i.Ya&&(a=this.i.Mb-this.i.Ya,a>this.i.rc&&(this.i.kb+=a,this.i.kb>this.i.Mb&&(this.i.kb=this.i.Mb)));try{do{this.rb(this.C.hb?1:this.i.nd);var c=this.D-this.b;this.I+=c;this.i.Bb+=c;Dc(this,0,!0);Ac(this,
+c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.tc,this.w&&Fc(this.w,this.i.Nb++),this.i.Nb>this.L&&(this.i.Nb=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.sc,this.w&&this.w.Da());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Xb;break}}while(this.C.va)}catch(e){this.ja();mc(this);this.w&&this.w.stop(la(),Bc(this));ib(this,!1);nb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Ya=la();b=this.i.rc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Xb));var b=b-(this.i.Ya-this.i.Mb),d=
+this.i.Ya-this.i.kb;d&&(this.i.Wa=Math.round(this.I/(10*d))/100,864E5<=d&&(this.J=0,Cc(this)));if(0>b||this.i.Wa>8&255;a.R=b&255}function Pc(a){return a.S<<8|a.T}function Qc(a,b){a.S=b>>8&255;a.T=b&255}function K(a){return a.U<<8|a.X}
+function Rc(a,b){a.U=b>>8&255;a.X=b&255}function G(a,b){a.N=b&65535}function Sc(a){return a.aa&256?1:0}function Tc(a,b){a.aa=a.aa&255|b}function Uc(a){return pb[a.ca&255]?4:0}function Vc(a){return(a.ca^a.ua)&16?16:0}function Wc(a){return a.aa&255?0:64}function Xc(a){return a.ca&128?128:0}function Mc(a){return a.ta&-214|Xc(a)|Wc(a)|Vc(a)|Uc(a)|Sc(a)}function Kc(a,b){a.aa=a.ca=a.ua=0;b&1&&(a.aa|=256);b&4||(a.ca|=1);b&16&&(a.ua|=16);b&64||(a.aa|=255);b&128&&(a.ca^=192);a.ta=a.ta&-726|b&512|2}
+function Yc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b)&255}function Zc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?1:0))&255}function $c(a,b){a.aa=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.aa}function ad(a,b){a.ua=b^255;b=a.ca=b+255&255;a.aa=a.aa&-256|b;return b}function bd(a,b){a.ua=b;b=a.ca=b+1&255;a.aa=a.aa&-256|b;return b}function cd(a,b){return a.ca=a.aa=a.ua=a.j|b}function L(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+1^256)&255}
+function wd(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?0:1)^256)&255}function xd(a,b){return a.ca=a.aa=a.ua=a.j^b}m.Y=function(a){return this.A.Y(a)};m.qa=function(a,b){this.A.qa(a,b)};function M(a){var b=a.Y(a.N);G(a,a.N+1);return b}function N(a){var b=a.A.Pa(a.N);G(a,a.N+2);return b}function P(a){var b=a.A.Pa(a.ia);a.ia=a.ia+2&65535;return b}function Q(a,b){a.ia=a.ia-2&65535;a.A.Qb(a.ia,b)}
+function R(a,b,c,d){d=d||2;a.M[b]&&(void 0===c&&(nb(a,"Value for "+b+" is invalid"),a.ja()),c=!a.C.va||a.C.pc?n(c,d):"--------".substr(0,d),a.M[b].textContent!=c&&(a.M[b].textContent=c))}
+m.Da=function(a){this.Z&&(a||!this.C.va||this.C.pc)&&(R(this,"A",this.j),R(this,"B",this.P),R(this,"C",this.R),R(this,"BC",Nc(this),4),R(this,"D",this.S),R(this,"E",this.T),R(this,"DE",Pc(this),4),R(this,"H",this.U),R(this,"L",this.X),R(this,"HL",K(this),4),R(this,"SP",this.ia,4),R(this,"PC",this.N,4),a=Mc(this),R(this,"PS",a,4),R(this,"IF",a&512?1:0,1),R(this,"SF",a&128?1:0,1),R(this,"ZF",a&64?1:0,1),R(this,"AF",a&16?1:0,1),R(this,"PF",a&4?1:0,1),R(this,"CF",a&1?1:0,1));if(a=this.M.speed)a.textContent=
+this.C.va&&this.i.Wa?this.i.Wa.toFixed(2)+"Mhz":"Stopped"};
+m.rb=function(a){this.C.Kb=!0;var b=this.C.fd=this.H&&yd(this.H),c=a?this.C.Ub?0:1:-1;this.C.Ub=!1;this.D=this.b=a;do{if(this.u){var d;this.u&8&&this.ta&512?(d=199|(this.u&7)<<3,this.u&=-16,this.ta&=-513,this.O[d].call(this),d=!0):d=!1;if(d){if(!a){this.g("interrupt dispatched");break}}else if(this.u&16){this.b=0;break}}if(b){if(zd(this.H,this.N,c)){this.ja();break}c=1}this.O[M(this)].call(this)}while(0>8;Tc(this,a&256);this.b-=4},Ad,function(){var a;Rc(this,a=K(this)+Nc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Nc(this));this.b-=7},function(){Oc(this,Nc(this)-1);this.b-=
+5},function(){this.R=bd(this,this.R);this.b-=5},function(){this.R=ad(this,this.R);this.b-=5},function(){this.R=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Tc(this,a);this.b-=4},Ad,function(){Qc(this,N(this));this.b-=10},function(){this.qa(Pc(this),this.j);this.b-=7},function(){Qc(this,Pc(this)+1);this.b-=5},function(){this.S=bd(this,this.S);this.b-=5},function(){this.S=ad(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|
+Sc(this);Tc(this,a&256);this.b-=4},Ad,function(){var a;Rc(this,a=K(this)+Pc(this));Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Pc(this));this.b-=7},function(){Qc(this,Pc(this)-1);this.b-=5},function(){this.T=bd(this,this.T);this.b-=5},function(){this.T=ad(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.j<<8;this.j=(Sc(this)<<8|this.j)>>1;Tc(this,a&256);this.b-=4},Ad,function(){Rc(this,N(this));this.b-=10},function(){var a=N(this);this.A.Qb(a,K(this));
+this.b-=16},function(){Rc(this,K(this)+1);this.b-=5},function(){this.U=bd(this,this.U);this.b-=5},function(){this.U=ad(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=0,b=Sc(this);if(Vc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Yc(this,a);Tc(this,b?256:0);this.b-=4},Ad,function(){var a;Rc(this,a=K(this)+K(this));Tc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.A.Pa(a);Rc(this,a);this.b-=16},function(){Rc(this,K(this)-1);this.b-=5},function(){this.X=
+bd(this,this.X);this.b-=5},function(){this.X=ad(this,this.X);this.b-=5},function(){this.X=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},Ad,function(){this.ia=N(this)&65535;this.b-=10},function(){this.qa(N(this),this.j);this.b-=13},function(){this.ia=this.ia+1&65535;this.b-=5},function(){var a=K(this);this.qa(a,bd(this,this.Y(a)));this.b-=10},function(){var a=K(this);this.qa(a,ad(this,this.Y(a)));this.b-=10},function(){this.qa(K(this),M(this));this.b-=10},function(){this.aa|=256;this.b-=
+4},Ad,function(){var a;Rc(this,a=K(this)+this.ia);Tc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(N(this));this.b-=13},function(){this.ia=this.ia-1&65535;this.b-=5},function(){this.j=bd(this,this.j);this.b-=5},function(){this.j=ad(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){Tc(this,Sc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.P=this.R;this.b-=5},function(){this.P=this.S;this.b-=5},function(){this.P=this.T;this.b-=5},function(){this.P=this.U;this.b-=
+5},function(){this.P=this.X;this.b-=5},function(){this.P=this.Y(K(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.P;this.b-=5},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.U;this.b-=5},function(){this.R=this.X;this.b-=5},function(){this.R=this.Y(K(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.P;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=
+this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.X;this.b-=5},function(){this.S=this.Y(K(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.P;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T=this.U;this.b-=5},function(){this.T=this.X;this.b-=5},function(){this.T=this.Y(K(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){this.U=this.P;this.b-=5},function(){this.U=
+this.R;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-=5},function(){this.U=this.X;this.b-=5},function(){this.U=this.Y(K(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.X=this.P;this.b-=5},function(){this.X=this.R;this.b-=5},function(){this.X=this.S;this.b-=5},function(){this.X=this.T;this.b-=5},function(){this.X=this.U;this.b-=5},function(){this.b-=5},function(){this.X=this.Y(K(this));this.b-=7},function(){this.X=this.j;
+this.b-=5},function(){this.qa(K(this),this.P);this.b-=7},function(){this.qa(K(this),this.R);this.b-=7},function(){this.qa(K(this),this.S);this.b-=7},function(){this.qa(K(this),this.T);this.b-=7},function(){this.qa(K(this),this.U);this.b-=7},function(){this.qa(K(this),this.X);this.b-=7},function(){var a=this.N-1;if(this.K.length)for(var b=0;b>8;this.b-=10},function(){var a=N(this);Xc(this)||G(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=N(this);Xc(this)||(Q(this,this.N),G(this,a),this.b-=6);this.b-=11},function(){Q(this,Mc(this)&255|this.j<<8);this.b-=11},function(){this.j=cd(this,M(this));this.b-=7},function(){Q(this,this.N);G(this,48);this.b-=11},function(){Xc(this)&&(G(this,P(this)),
+this.b-=6);this.b-=5},function(){this.ia=K(this)&65535;this.b-=5},function(){var a=N(this);Xc(this)&&G(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=N(this);Xc(this)&&(Q(this,this.N),G(this,a),this.b-=6);this.b-=11},Dd,function(){L(this,M(this));this.b-=7},function(){Q(this,this.N);G(this,56);this.b-=11}];
+function S(a){w.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!Ed[b]&&La("Unrecognized ChipSet model: "+b);this.G=Ed[b]||{};a.sound&&(this.ba=null,window&&(this.ba=window.AudioContext||window.webkitAudioContext),this.ba&&new this.ba);E(this)}$a(S);
+var T={xa:1978.1,Vc:{ya:0,Hd:1,Md:16,$d:32,ne:64,le:128,tb:14},Ua:{ya:1,Cc:1,Rc:2,Nc:4,Oc:16,Pc:32,Qc:64,tb:8},Wc:{ya:2,Gd:3,xe:4,Id:8,he:16,ie:32,je:64,Jd:128,tb:0},re:{ya:3},pe:{ya:2,be:7},te:{ya:3,ze:1,se:2,ke:4,Ud:8,Kd:16,yd:32},qe:{ya:4},ue:{ya:5,Nd:1,Od:2,Pd:4,Qd:8,Ae:16}},U={xa:100,bb:{ya:66,Ee:1,Lc:2,Mc:4,fe:8,de:16,cc:32,bc:64,Xd:128},Bc:{ya:66,INIT:0},Ia:{Zd:{ya:98},Qa:{Ac:0,zc:1,Tc:2,Zc:4,Fc:5,Sc:6,Uc:7},Jb:16383},Ec:{ya:162,INIT:0},Dc:{ya:194,INIT:0}},Ed={SI1978:T,VT100:U};
+S.prototype.pa=function(){return!1};S.prototype.Na=function(a,b,c,d){this.A=b;this.b=c;this.H=d;this.w=a;Cb(b,this,this.G.Ob);Gb(b,this,this.G.Pb)};S.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};S.prototype.Ja=function(a){return a?this.save():!0};T.INIT=[[T.Vc.tb,T.Ua.tb,T.Wc.tb,0,0,0,0]];U.INIT=[[U.Bc.INIT,U.bb.Lc|U.bb.Mc,U.Ec.INIT,U.Dc.INIT],[0,0,0,0,Array(100)]];m=S.prototype;m.reset=function(){this.G.INIT&&!this.restore(this.G.INIT)&&this.ga("reset error")};
+m.save=function(){var a=new I(this);switch(this.G.xa){case T.xa:J(a,0,[this.ra,this.D,this.wa,this.O,this.Z,this.ka,this.ma]);break;case U.xa:J(a,0,[this.da,this.J,this.fa,this.ea]),J(a,1,[this.L,this.u,this.K,this.W,this.I])}return a.data()};
+m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.G.xa){case T.xa:return this.ra=b[0],this.D=b[1],this.wa=b[2],this.O=b[3],this.Z=b[4],this.ka=b[5],this.ma=b[6],!0;case U.xa:return this.da=b[0],this.J=b[2],this.fa=b[3],this.ea=b[4],b=a[1],this.L=b[0],this.u=b[1],this.K=b[2],this.W=b[3],this.I=b[4],!0}return!1};m.start=function(){};m.stop=function(){};function Fd(a,b,c){a.D&=~b;c&&(a.D|=b)}m.hd=function(a,b){var c=this.ra;D(this,a,null,b,"STATUS0",c);return c};
+m.jd=function(a,b){var c=this.D;D(this,a,null,b,"STATUS1",c);return c};m.kd=function(a,b){var c=this.wa;D(this,a,null,b,"STATUS2",c);return c};m.gd=function(a,b){var c=this.O>>8-this.Z&255;D(this,a,null,b,"SHIFT.RESULT",c);return c};m.od=function(a,b,c){D(this,a,b,c,"SHIFT.COUNT",null);this.Z=b};m.qd=function(a,b,c){D(this,a,b,c,"SOUND1",null);this.ka=b};m.pd=function(a,b,c){D(this,a,b,c,"SHIFT.DATA",null);this.O=b<<8|this.O>>8};m.rd=function(a,b,c){D(this,a,b,c,"SOUND2",null);this.ma=b};
+m.sd=function(a,b,c){D(this,a,b,c,"WATCHDOG",null)};function Gd(a){var b=0,c=0,d=~a.L;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c}
+m.ld=function(a,b){var c=this.J,c=c&~U.bb.bc;if((Bc(this.b)&64)<<1&&(c|=U.bb.bc,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case U.Ia.Qa.Uc:break;case U.Ia.Qa.zc:this.L=this.L<<1|d;break;case U.Ia.Qa.Fc:d=Gd(this);this.I[d]=U.Ia.Jb;gb(this,"doNVRCommand(): erase data at addr "+r(d));break;case U.Ia.Qa.Ac:this.u=this.u<<1|d;break;case U.Ia.Qa.Zc:d=Gd(this);e=this.u&U.Ia.Jb;this.I[d]=e;gb(this,"doNVRCommand(): write data "+r(e)+" to addr "+r(d));break;case U.Ia.Qa.Sc:d=Gd(this);e=this.I[d];
+null==e&&(e=U.Ia.Jb);this.u=e;gb(this,"doNVRCommand(): read data "+r(e)+" from addr "+r(d));break;case U.Ia.Qa.Tc:this.u<<=1;this.W=this.u&U.Ia.Jb+1;break;default:gb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~U.bb.cc;this.W&&(c|=U.bb.cc);this.J=c;D(this,a,null,b,"FLAGS.BUFFER",c);return c};m.td=function(a,b,c){D(this,a,b,c,"BRIGHTNESS",null);this.da=b};m.wd=function(a,b,c){D(this,a,b,c,"NVR.LATCH",null);this.K=b};m.vd=function(a,b,c){D(this,a,b,c,"DC012",null);this.fa=b};
+m.ud=function(a,b,c){D(this,a,b,c,"DC011",null);this.ea=b};T.Ob={0:S.prototype.hd,1:S.prototype.jd,2:S.prototype.kd,3:S.prototype.gd};T.Pb={2:S.prototype.od,3:S.prototype.qd,4:S.prototype.pd,5:S.prototype.rd,6:S.prototype.sd};U.Ob={66:S.prototype.ld};U.Pb={66:S.prototype.td,98:S.prototype.wd,162:S.prototype.vd,194:S.prototype.ud};Ja(function(){for(var a=A(document,"pc8080","chipset"),b=0;b>>0,h],q=ka(p,k,a.Sa);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({Te:b,F:c,md:d,Ma:e,lc:f})}delete this.Ma}return!0};Hd.prototype.Ja=function(){return!0};
+function Id(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Rb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.w=f;else if(h)for(a.w=Array(4*h.length),d=c=0;c>8&255,a.w[d++]=h[c]>>16&255,a.w[d++]=h[c]>>24&255;else a.w=e;a.Ma=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.ga("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
+" ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e>>f.la;0>>=f.la;0":62,"?":63,"@":64,xd:65,zd:66,Ad:67,Fd:68,E:69,Ld:70,Rd:71,Sd:72,Td:73,Vd:74,Wd:75,Yd:76,ae:77,ce:78,ee:79,ge:80,Q:81,me:82,oe:83,we:84,ye:85,Be:86,Ce:87,De:88,Fe:89,Ge:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,He:97,Ie:98,Je:99,d:100,e:101,Ke:102,Le:103,Me:104,Ne:105,Oe:106,k:107,Pe:108,
+Qe:109,n:110,Re:111,p:112,q:113,r:114,Se:115,t:116,Ue:117,Ve:118,We:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},Qd={65:37,68:39,76:32},Rd={xa:1978.1,wb:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},W={xa:100,wb:{},Oa:{ya:130,Jc:1,Ic:2,Hc:4,Gc:8,Kc:16,ec:32,ve:64,Bd:128,INIT:0},B:{}};W.B[46]=3;W.B[80]=5;W.B[79]=6;W.B[89]=7;W.B[84]=8;W.B[87]=9;W.B[81]=10;W.B[39]=16;W.B[V["]"]]=20;W.B[V["["]]=21;W.B[73]=22;W.B[85]=23;W.B[82]=24;W.B[69]=25;W.B[V["1"]]=26;W.B[37]=32;W.B[40]=34;
+W.B[19]=35;W.B[V["`"]]=36;W.B[V["-"]]=37;W.B[V["9"]]=38;W.B[V["7"]]=39;W.B[V["4"]]=40;W.B[V["3"]]=41;W.B[27]=42;W.B[38]=48;W.B[114]=49;W.B[112]=50;W.B[8]=51;W.B[V["="]]=52;W.B[V["0"]]=53;W.B[V["8"]]=54;W.B[V["6"]]=55;W.B[V["5"]]=56;W.B[V["2"]]=57;W.B[9]=58;W.B[103]=64;W.B[115]=65;W.B[113]=66;W.B[96]=67;W.B[10]=68;W.B[V["\\"]]=69;W.B[76]=70;W.B[75]=71;W.B[71]=72;W.B[70]=73;W.B[65]=74;W.B[104]=80;W.B[2013]=81;W.B[98]=82;W.B[97]=83;W.B[V["'"]]=85;W.B[V[";"]]=86;W.B[74]=87;W.B[72]=88;W.B[68]=89;
+W.B[83]=90;W.B[110]=96;W.B[119]=97;W.B[101]=98;W.B[100]=99;W.B[13]=100;W.B[V["."]]=101;W.B[V[","]]=102;W.B[78]=103;W.B[66]=104;W.B[88]=105;W.B[120]=106;W.B[105]=112;W.B[99]=113;W.B[102]=114;W.B[109]=115;W.B[V["/"]]=117;W.B[77]=118;W.B[V[" "]]=119;W.B[86]=120;W.B[67]=121;W.B[90]=122;W.B[121]=123;W.B[17]=124;W.B[16]=125;W.B[20]=126;W.Hb={l4:W.Oa.Jc,l3:W.Oa.Ic,l2:W.Oa.Hc,l1:W.Oa.Gc,locked:W.Oa.Kc,online:W.Oa.ec,local:~W.Oa.ec};var Pd={SI1978:Rd,VT100:W};
+Od.prototype.pa=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.M[e]){if("led"==a&&this.b.Hb&&this.b.Hb[b])return this.M[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return Sd(d,a,!0)},c.onkeyup=function(a){return Sd(d,a,!1)},!0;default:if(this.b.wb&&void 0!==this.b.wb[b])return this.M[e]=c,a=function(a,b){return function(){Td(a,b,!0)}}(this,b),b=function(a,b){return function(){Td(a,b,!1)}}(this,b),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=
+c.onmouseout=b),!0}}return!1};Od.prototype.Na=function(a,b,c,d){this.H=d;this.G=rb(a,"ChipSet");Cb(b,this,this.b.Ob);Gb(b,this,this.b.Pb)};Od.prototype.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};Od.prototype.Ja=function(a){return a?this.save():!0};W.INIT=[[W.Oa.INIT]];Od.prototype.reset=function(){this.u={};this.A={};this.b.INIT&&!this.restore(this.b.INIT)&&this.ga("reset error")};
+Od.prototype.save=function(){var a=new I(this);switch(this.b.xa){case W.xa:J(a,0,[this.w])}return a.data()};Od.prototype.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.xa){case Rd.xa:return!0;case W.xa:return this.w=b[0],Ud(this),!0}return!1};function Ud(a){for(var b in a.b.Hb){var c=a.M["led-"+b];if(c){var d=a.b.Hb[b],e=!!(a.w&d);d&d-1&&(e=!(a.w&~d));c.style.backgroundColor=e?"#ff0000":"#000000"}}}
+function Sd(a,b,c){var d=!0,e;a:{e=b.keyCode;e=Qd[e]||e;for(var f in a.b.wb)if(a.b.wb[f]===e){e=f;break a}e=null}e&&(d=Td(a,e,c),b.preventDefault());return d}
+function Td(a,b,c){if(c)a.u[b]=Date.now(),delete a.A[b];else{var d=a.u[b];if(d&&100>Date.now()-d)return a.A[b]=d,Vd(a),!0;delete a.u[b]}if(a.G)switch(b){case "1p":Fd(a.G,T.Ua.Nc,c);break;case "2p":Fd(a.G,T.Ua.Rc,c);break;case "coin":Fd(a.G,T.Ua.Cc,c);break;case "left":Fd(a.G,T.Ua.Pc,c);break;case "right":Fd(a.G,T.Ua.Qc,c);break;case "fire":Fd(a.G,T.Ua.Oc,c)}return!0}
+function Vd(a){for(var b=-1,c=Object.keys(a.A),d=0;db||b>f)b=f}else delete a.A[e],Td(a,e,!1)}0<=b&&setTimeout(function(){Vd(a)},b)}Od.prototype.D=function(a,b,c){D(this,a,b,c,"KBDUART.STATUS",null);this.w=b;Ud(this)};W.Ob={};W.Pb={130:Od.prototype.D};Ja(function(){for(var a=A(document,"pc8080","keyboard"),b=0;b>3)*this.da;if(this.ad||vb(this.A,this.Ea,this.Ta,3))1>1)),this.L=document.createElement("canvas"),this.L.width=b,this.L.height=c,this.eb=
+this.L.getContext("2d"),this.ra={},this.Ha=1<=a.Xc?8:16,f=8>(7>
4)*c)}return k}
-Td.prototype.Ca=function(){if(2==this.Y){for(var a={0:[32,"SET-UP A"],2:[64,'TO EXIT PRESS "SET-UP"'],22:[96," T T T T T T T T T"],23:[96,"1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890"],24:[]},b=this.ya,c=-1,d=-1,e,f=-(60==this.rc?2:5);f>8&15|16;zb(this.A,b++,e);zb(this.A,b++,c&
-255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.jc?(this.N.style.width=a,this.N.style.width=a,this.N.style.display="block",this.N.style.margin="auto"):(this.w.style.width=a,this.w.style.height="auto");this.w.style.backgroundColor="black";this.w.gb();a=!0}this.Ga&&this.Ga.focus()}return a};
-function Wd(a,b){!b&&a.w&&(a.jc?a.N.style.width=a.N.style.height="":a.w.style.width=a.w.style.height="");fb(a,"notifyFullScreen("+b+")",!0)}function Yd(a,b){a.lc=b;a.za=!1;if(void 0===a.ka||a.ka.length!=a.lc)a.ka=Array(a.lc)}function ae(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.Y&&(208<=c&&236>c?e=a.Ha+0:28<=c&&72>c&&(e=a.Ha+1));a=a.ua[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]}
-function be(a){for(var b=a.ya,c=-1,d=0,e=60==a.rc?2:5,f=0,h=0;d>4)*n.ha,A=void 0,u=void 0,F=void 0,B=void 0,ha=n.oa,pa=n.ha;x?(A=k*p.oa,u=d*p.ha,
-F=p.oa,B=p.ha):(A=k*p.Kb,u=d*p.ic,F=p.Kb,B=p.ic);n.oa>p.oa&&(A*=2,F*=2);n.ha>p.ha&&(0==l&&(w+=p.ha),pa=p.ha);x?x.drawImage(n.canvas,t,w,ha,pa,A,u,F,B):(A+=0,u+=0,p.H.drawImage(n.canvas,t,w,ha,pa,A,u,F,B))}h++}f++}d++}}a.za=!0;h&&a.fb&&a.H.drawImage(a.K,0,0,a.J,a.ca-a.ha,0,0,a.pd,a.qd)}
-Ja(function(){for(var a=C(document,"pc8080","video"),b=0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=ra().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
-(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Ra.aspect);f&&.3<=f&&3.33>=f&&(Ia("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");xa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Td(d,e,h,f,c);db(d,c)}});
-function ce(a){y.call(this,"Debugger",a,ce);this.style=de;this.ca=this.za=this.K=0;this.U=Y();this.Va=Y();this.D=-1;this.w=[];this.ea=!1;this.da=Y();this.I=[];this.ga={};this.C=this.Y=this.H=[];ee(this);this.ua=0;fe(this);this.Ga=[];ge(this,a.messages);this.Ha=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return he(b,a)}):void 0===global.$&&(global.$=function(a){return he(b,a)})}Za(ce);
-var ie={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},
-de=8080,je="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),ke="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),
-le="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),me=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768],[21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963,
+Wd.prototype.Ca=function(){if(2==this.Z){for(var a={0:[32,"SET-UP A"],2:[64,'TO EXIT PRESS "SET-UP"'],22:[96," T T T T T T T T T"],23:[96,"1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890"],24:[]},b=this.Ea,c=-1,d=-1,e,f=-(60==this.kc?2:5);f>8&15|16;Ab(this.A,b++,e);Ab(this.A,b++,c&
+255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.fc?(this.O.style.width=a,this.O.style.width=a,this.O.style.display="block",this.O.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.fb();a=!0}this.Ga&&this.Ga.focus()}return a};
+function Zd(a,b){!b&&a.u&&(a.fc?a.O.style.width=a.O.style.height="":a.u.style.width=a.u.style.height="");gb(a,"notifyFullScreen("+b+")",!0)}function ae(a,b){a.hc=b;a.Fa=!1;if(void 0===a.ma||a.ma.length!=a.hc)a.ma=Array(a.hc)}function de(a,b,c,d,e){d=a.D?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.Z&&(208<=c&&236>c?e=a.Ha+0:28<=c&&72>c&&(e=a.Ha+1));a=a.wa[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]}
+function ee(a){for(var b=a.Ea,c=-1,d=0,e=60==a.kc?2:5,f=0,h=0;d>4)*p.ha,B=void 0,v=void 0,H=void 0,C=void 0,ia=p.oa,qa=p.ha;y?(B=k*q.oa,v=d*q.ha,
+H=q.oa,C=q.ha):(B=k*q.Ib,v=d*q.dc,H=q.Ib,C=q.dc);p.oa>q.oa&&(B*=2,H*=2);p.ha>q.ha&&(0==l&&(x+=q.ha),qa=q.ha);y?y.drawImage(p.canvas,u,x,ia,qa,B,v,H,C):(B+=0,v+=0,q.I.drawImage(p.canvas,u,x,ia,qa,B,v,H,C))}h++}f++}d++}}a.Fa=!0;h&&a.eb&&a.I.drawImage(a.L,0,0,a.K,a.da-a.ha,0,0,a.Yc,a.$c)}
+Ja(function(){for(var a=A(document,"pc8080","video"),b=0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=ra().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
+(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Sa.aspect);f&&.3<=f&&3.33>=f&&(Ia("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");xa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Wd(d,e,h,f,c);eb(d,c)}});
+function fe(a){w.call(this,"Debugger",a,fe);this.style=ge;this.da=this.Fa=this.L=0;this.W=X();this.Ta=X();this.D=-1;this.G=[];this.fa=!1;this.ea=X();this.J=[];this.ka={};this.u=this.Z=this.I=[];he(this);this.wa=0;ie(this);this.Ga=[];je(this,a.messages);this.Ha=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return lc(b,a)}):void 0===global.$&&(global.$=function(a){return lc(b,a)})}$a(fe);
+var ke={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble",v:"print version","var":"assign variable"},
+ge=8080,le="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "),me="NONE ADC ADC ADD ADD AND AND CALL CALLC CALLS CALLNC CALLNZ CALLNS CALLP CALLNP CALLZ NOT CMC CMP CMP DAA ADD DEC DEC CLI STI HLT IN INC INC JMP JC JS JNC JNZ JNS JP JNP JZ MOV MOV MOV MOV MOV MOV NOP OR OR OUT JMP POP PUSH RCL RCR RET RETC RETS RETNC RETNZ RETNS RETP RETNP RETZ ROL ROR RST SBB SBB MOV MOV MOV MOV STC SUB SUB XCHG XOR XOR XCHG".split(" "),
+ne="B C D E H L M A BC DE HL SP PC PS PSW".split(" "),oe=[[45],[42,2067,32],[71,2131,18193],[29,2067],[28,17],[22,17],[44,17,32],[63],[45,32768],[21,18963,2067],[40,18193,2131],[23,2067],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2323,32],[71,2387,18193],[29,2323],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,18963,2323],[40,18193,2387],[23,2323],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2579,32],[68,115,18963],[29,2579],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,18963,
2579],[41,18963,115],[23,2579],[28,1297],[22,1297],[44,1297,32],[16,18193],[45,32768],[42,2835,32],[70,115,18193],[29,2835],[28,1617],[22,1617],[44,1617,32],[72],[45,32768],[21,18963,2835],[39,18193,115],[23,2835],[28,1809],[22,1809],[44,1809,32],[17],[43,17,17],[43,17,273],[43,17,529],[43,17,785],[43,17,1041],[43,17,1297],[43,17,1617],[43,17,1809],[43,273,17],[43,273,273],[43,273,529],[43,273,785],[43,273,1041],[43,273,1297],[43,273,1617],[43,273,1809],[43,529,17],[43,529,273],[43,529,529],[43,529,
785],[43,529,1041],[43,529,1297],[43,529,1617],[43,529,1809],[43,785,17],[43,785,273],[43,785,529],[43,785,785],[43,785,1041],[43,785,1297],[43,785,1617],[43,785,1809],[43,1041,17],[43,1041,273],[43,1041,529],[43,1041,785],[43,1041,1041],[43,1041,1297],[43,1041,1617],[43,1041,1809],[43,1297,17],[43,1297,273],[43,1297,529],[43,1297,785],[43,1297,1041],[43,1297,1297],[43,1297,1617],[43,1297,1809],[43,1617,17],[43,1617,273],[43,1617,529],[43,1617,785],[43,1617,1041],[43,1617,1297],[26],[43,1617,1809],
[43,1809,17],[43,1809,273],[43,1809,529],[43,1809,785],[43,1809,1041],[43,1809,1297],[43,1809,1617],[43,1809,1809],[3,18193,17],[3,18193,273],[3,18193,529],[3,18193,785],[3,18193,1041],[3,18193,1297],[3,18193,1617],[3,18193,1809],[2,18193,17],[2,18193,273],[2,18193,529],[2,18193,785],[2,18193,1041],[2,18193,1297],[2,18193,1617],[2,18193,1809],[73,18193,17],[73,18193,273],[73,18193,529],[73,18193,785],[73,18193,1041],[73,18193,1297],[73,18193,1617],[73,18193,1809],[66,18193,17],[66,18193,273],[66,
18193,529],[66,18193,785],[66,18193,1041],[66,18193,1297],[66,18193,1617],[66,18193,1809],[5,18193,17],[5,18193,273],[5,18193,529],[5,18193,785],[5,18193,1041],[5,18193,1297],[5,18193,1617],[5,18193,1809],[76,18193,17],[76,18193,273],[76,18193,529],[76,18193,785],[76,18193,1041],[76,18193,1297],[76,18193,1617],[76,18193,1809],[46,18193,17],[46,18193,273],[46,18193,529],[46,18193,785],[46,18193,1041],[46,18193,1297],[46,18193,1617],[46,18193,1809],[18,18193,17],[18,18193,273],[18,18193,529],[18,18193,
785],[18,18193,1041],[18,18193,1297],[18,18193,1617],[18,18193,1809],[58],[50,2067],[34,51],[30,51],[11,51],[51,2067],[4,18193,33],[65,128],[62],[54],[38,51],[30,32819],[15,51],[7,51],[1,18193,33],[65,128],[57],[50,2323],[33,51],[48,33,18193],[10,51],[51,2323],[74,18193,33],[65,128],[55],[54,32768],[31,51],[27,18193,33],[8,51],[7,32819],[67,18193,33],[65,128],[61],[50,2579],[37,51],[78,19283,18963],[14,51],[51,2579],[6,18193,33],[65,128],[60],[49,2579],[36,51],[75,18963,18707],[13,51],[7,32819],[77,
-18193,33],[65,128],[59],[50,3603],[35,51],[24],[12,51],[51,3603],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19,18193,33],[65,128]],ne={cpu:1,bus:64,mem:128,port:256,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};m=ce.prototype;
-m.Na=function(a,b,c,d){this.A=b;this.b=c;this.u=a;(a=hc(a,"messages"))&&ge(this,a);this.Sa=me;oe(this,function(a){a:{var b=d.A.V,c=a[0],g=a=0,k=b.length;if(c){a=pe(qe(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.A.la;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,l=0;k--;){var n=b[g];n.type==c?l++||d.g("..."):(c=n.type,l=wb[c],n&&d.g(q(n.id)+" %"+q(g<>>e.la;f!=e.A?e.V[h].Yb(f,b&65535,d):(e.V[h++].Gb(f,b&255,d),e.V[h&e.J].Gb(0,b>>8&255,d+1));c&&re(a,c);kc(this.b,!0)}};function Y(a){return{F:a,La:!1}}function se(a){return[a.F,a.La]}function te(a){return{F:a[0],La:a[1]}}
-function qe(a,b,c){var d;c=(c?a.U:a.Va).F;if(void 0!==b){d=b=ue(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=na(le,a.substr(b,1))));return c}function Ae(a,b){var c=0,d=Be(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?q(d,c):"??"}
-function Be(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.O;break;case 1:c=d.P;break;case 8:c=Lc(d);break;case 2:c=d.R;break;case 3:c=d.S;break;case 9:c=Nc(d);break;case 4:c=d.T;break;case 5:c=d.W;break;case 10:c=K(d);break;case 6:c=d.X(K(d));break;case 11:c=d.ia;break;case 12:c=d.M;break;case 13:c=Kc(d);break;case 14:c=Kc(d)&255|d.j<<8}}return c}
-function Ce(a,b){b=ue(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=ze(b,c+1),0<=e&&(b=b.substr(0,c)+Ae(a,e)+b.substr(c+1+le[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=qe(a,e))?(d=e+' "'+ye(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=qe(a,e))?(re(d),d=e+' "'+
-ye(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(Y(this.b.M).F));if(this.na&1073741824)this.ya.push(a);else if(!this.xa||a!=this.xa)if(this.xa=a,this.na&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.pb=0;c.D-=c.b;c.b=0;kc(c)}};
-function eb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.na&g)!=g||a.message(b.cb+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+q(d,2):"")+")"+(null!=h?": 0x"+q(h,2):"")+(null!=e?" at "+Z(e):""))}m.Wa=function(){this.g("Type ? for help with PC8080 Debugger commands");this.Da();if(this.Ha){var a=this.Ha;this.Ha=null;he(this,a)}};
-function fe(a){var b;if(cd(a)){if(!a.N||!a.N.length){a.N=Array(1E3);for(b=0;b>>d.la],!1)}a.Y=["br"];if(void 0!==a.H)for(b=1;b>>d.la],!0);a.H=["bw"];a.eb=0}m.Ua=function(a,b,c){var d=!0;c||He(this,a,b,!1,!0);if(a!=this.C){var e=pe(b);if(-1===e)this.g("invalid address: "+Z(b.F)),d=!1;else{var f=this.A;f.V[e>>>f.la].Ua(e&f.A,a==this.H)}}d&&(a.push(b),c?b.La=!0:(Ie(this,a,a.length-1,"set"),fe(this)));return d};
-function He(a,b,c,d,e){var f=!1;c=pe(c);for(var h=1;h>>d.la],b==a.H));g.La||fe(a);break}}return f}function hf(a,b){for(var c=1;c>24,4);break;case 3:u=q(w.Oa(A,2),4);break;default:w="imm("+r(t)+")";break a}8086==w.style&&t&64?u="["+u+"]":t&16||(u=(w.style==de?"$":"0x")+u);w=u}else t&
-16?(w=(p&3840)>>8,t=le[w],8086==a.style&&p&64&&(6==w&&(t="HL"),t="["+t+"]"),w=t):t&128&&(w=(f>>3&7).toString());if(!w||!w.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
-function pf(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
+18193,33],[65,128],[59],[50,3603],[35,51],[24],[12,51],[51,3603],[47,18193,33],[65,128],[56],[69,19219,18963],[32,51],[25],[9,51],[7,32819],[19,18193,33],[65,128]],pe={cpu:1,bus:64,mem:128,port:256,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};m=fe.prototype;
+m.Na=function(a,b,c,d){this.A=b;this.b=c;this.w=a;(a=ic(a,"messages"))&&je(this,a);this.Ra=oe;qe(this,function(a){a:{var b=d.A.V,c=a[0],g=a=0,k=b.length;if(c){a=re(se(d,c));if(-1===a){d.g("invalid address: "+c);break a}g=a>>>d.A.la;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,l=0;k--;){var p=b[g];p.type==c?l++||d.g("..."):(c=p.type,l=xb[c],p&&d.g(n(p.id)+" %"+n(g<>>e.la;f!=e.A?e.V[h].$b(f,b&65535,d):(e.V[h++].Gb(f,b&255,d),e.V[h&e.K].Gb(0,b>>8&255,d+1));c&&te(a,c);mc(this.b,!0)}};function X(a){return{F:a,La:!1}}function ue(a){return[a.F,a.La]}function ve(a){return{F:a[0],La:a[1]}}
+function se(a,b,c){var d;c=(c?a.W:a.Ta).F;if(void 0!==b){d=b=we(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=na(ne,a.substr(b,1))));return c}function Ce(a,b){var c=0,d=De(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?n(d,c):"??"}
+function De(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.P;break;case 1:c=d.R;break;case 8:c=Nc(d);break;case 2:c=d.S;break;case 3:c=d.T;break;case 9:c=Pc(d);break;case 4:c=d.U;break;case 5:c=d.X;break;case 10:c=K(d);break;case 6:c=d.Y(K(d));break;case 11:c=d.ia;break;case 12:c=d.N;break;case 13:c=Mc(d);break;case 14:c=Mc(d)&255|d.j<<8}}return c}
+function Ee(a,b){b=we(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=Be(b,c+1),0<=e&&(b=b.substr(0,c)+Ce(a,e)+b.substr(c+1+ne[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=se(a,e))?(d=e+' "'+Ae(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=se(a,e))?(te(d),d=e+' "'+
+Ae(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Z(X(this.b.N).F));if(this.na&1073741824)this.Ea.push(a);else if(!this.za||a!=this.za)if(this.za=a,this.na&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.ob=0;c.D-=c.b;c.b=0;mc(c)}};
+function fb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.na&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+r(c)+","+(f?f:"unknown")+(null!=d?",0x"+n(d,2):"")+")"+(null!=h?": 0x"+n(h,2):"")+(null!=e?" at "+Z(e):""))}
+function ie(a){var b;if(yd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.la],!1)}a.Z=["br"];if(void 0!==a.I)for(b=1;b>>d.la],!0);a.I=["bw"];a.cb=0}m.Va=function(a,b,c){var d=!0;c||Je(this,a,b,!1,!0);if(a!=this.u){var e=re(b);if(-1===e)this.g("invalid address: "+Z(b.F)),d=!1;else{var f=this.A;f.V[e>>>f.la].Va(e&f.A,a==this.I)}}d&&(a.push(b),c?b.La=!0:(Ke(this,a,a.length-1,"set"),ie(this)));return d};
+function Je(a,b,c,d,e){var f=!1;c=re(c);for(var h=1;h>>d.la],b==a.I));g.La||ie(a);break}}return f}function kf(a,b){for(var c=1;c>24,4);break;case 3:v=n(x.Pa(B,2),4);break;default:x="imm("+r(u)+")";break a}8086==x.style&&u&64?v="["+v+"]":u&16||(v=(x.style==ge?"$":"0x")+v);x=v}else u&
+16?(x=(q&3840)>>8,u=ne[x],8086==a.style&&q&64&&(6==x&&(u="HL"),u="["+u+"]"),x=u):u&128&&(x=(f>>3&7).toString());if(!x||!x.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
+function rf(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
-function ve(a,b,c){var d;if(b){b=ue(a,b);for(var e=0,f=!1,h=b,g=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=n+"b"+h;d>>=8}d="0x"+q(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function sf(a,b){if(b)return rf(a,b,a.ga[b]);var c=0;for(b in a.ga)rf(a,b,a.ga[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.cd;if(e>=h&&e>8&255;case "C":d.P=g&255;break;case "D":d.R=
-g&255;break;case "DE":d.R=g>>8&255;case "E":d.S=g&255;break;case "H":d.T=g&255;break;case "HL":d.T=g>>8&255;case "L":d.W=g&255;break;case "SP":d.ia=g&65535;break;case "PC":H(d,g);a.U=Y(d.M);break;case "PS":Ic(d,g);break;case "PSW":Ic(d,g&255|d.sa&-256);d.j=g>>8;break;case "CF":d.Z=g?d.Z|256:d.Z&255;break;case "PF":g?Rc(d)||(d.ba^=1):Rc(d)&&(d.ba^=1);break;case "AF":d.ta=g?~d.ba&16|d.ta&-17:d.ba&16|d.ta&-17;break;case "ZF":d.Z=g?d.Z&-256:d.Z|255;break;case "SF":g?Uc(d)||(d.ba^=192):Uc(d)&&(d.ba^=192);
-break;case "IF":d.sa=g?d.sa|512:d.sa&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}kc(d);a.g("updated registers:")}a.g(nf(a));c&&(a.U=Y(d.M),Fe(a,Z(a.U.F)))}}function zf(a,b){b=ja(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Ce(a,c[2])):ve(a,b,!0)}function Af(a,b,c){var d="t"!=b;c=qf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);ya(c,function(){return hb(a,!0)&&a.sb(e,d,!1)},function(){kc(a.b);hb(a,!1)})}
-function Fe(a,b,c,d){if(b=qe(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=qe(a,c,!0);if(!d||d.Fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=kf(a,b,h,f);a.g(f);a.U=b;e-=b.F-k;c++}}}
-function xe(a,b,c,d){if(c)if(b){0>a.D&&a.w.length&&(a.D=0);if(0>a.D||b!=a.w[a.D])a.w.splice(0,0,b),a.D=0;a.D--}else a.ea?b="end":b=a.w[a.D+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ja(b.substring(c,f))),c=f+1}}return a}
-function jf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.ea&&(a.g("ended assemble at "+Z(a.da.F)),a.U=a.da,a.ea=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(jb(a)&&0l||"z"Ba.length&&(a.g("note: only "+Ba.length+" available"),ca=Ba.length);W-=ca;0>W&&(null==Ba[Ba.length-1].F?(ca=W+ca,W=0):W+=Ba.length);
-var fd=[];"call"==Oe&&(lb=1E5,fd=["CALL"]);for(void 0!==Ne&&a.g(ca+" instructions earlier:");0=Ba.length&&(W=0);a.fb=ca;Qe++;lb--}}Qe||(a.g("no "+Pe+"history available"),a.fb=void 0)}else{var mc=qe(a,za);if(mc){var nc=0;Ua&&("l"==Ua.charAt(0)&&(Ua=Ua.substr(1)||Vf),nc=qf(a,Ua)>>>0,65536>4||1;Xf--&&0rc?String.fromCharCode(rc):".";pc--}Va&&(Va+="\n");Va+=za+" "+Lb+(0==Kb?" "+hd:"")}Va&&a.g(Va);a.Va=mc}}}}break;case "e":if("else"==f[0])break;var sc=1,Te=255,Ue=a.X,Ve=a.qa;"ew"==f[0]&&(sc=2,Te=65535,Ue=a.Oa,Ve=a.Pb);var We=sc<<1,Xe=f[1];if(null==Xe)a.g("edit memory commands:"),
-a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var tc=qe(a,Xe);if(tc)for(var uc=2;ucod;){for(var Wa=null,cg=256;65536>Ob.F>>>0;){$e.F=a.Oa(Ob,2);if(null==Ob.F||!cg--)break;for(var dg=a,wc=$e,af=null,Pb=wc.F,bf=Pb,pd=1;6>=pd&&Pb;pd++){if(2\nLicense: GPL version 3 or later ");for(b=0;bKf){if(Gf(d,this.U)){this.H=new I(this,"1.23.3","failsafe");Gf(this.H)&&(Pf(this,d),a=2,Df(this.H));J(this.H,"timestamp",ma());Ef(this.H);var e=this.u&&!this.J;if(1==a||sa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Ff(d)){var f=Hf(d,"code"),h=Hf(d,"data");f&&("ok"==f?Gf(d,h):("error"==f&&
-"no machine state"!=h?(this.fa("Error: "+h),"unable to verify user"==h&&(wa("user",""),this.C=null)):this.g(f+": "+h),Df(d),Gf(d)?(c=Ff(d),e=!0):c=!1))}e&&Of(this,c?d:null)}else 2==a&&d.clear()}else Of(this);delete this.U;delete this.Y}e=bb(this.id);for(f=0;fa[1];a=a[2];this.ma=!0;this.B.ra=!0;var d=this.L.power;d&&(d.textContent="Shutdown");this.b&&(Qf(this,this.b,b,c,a),lc(this.b));this.da&&(Pf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.w=0};
-function Pf(a,b){if(sa("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.C||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.ka;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}}
-function Bf(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new I(a,"1.23.3"),h=new I(a,"1.23.3","validate"),g=ma();J(h,"timestamp",g);J(f,"timestamp",g);J(f,"version","1.23.3");J(f,"url",window?window.location.href:null);J(f,"browser",ra());a.b&&a.b.Ja&&(c&&a.b.ja(),d=a.b.Ja(b,c),"object"===typeof d&&J(f,a.b.id,d),c&&(a.b.B.ra=!1,!1===d&&(e=null)));for(var g=bb(a.id),k=0;k>>f.la;0>8|(u&255)<<8);n>F&A;ae(d,d.kc,n++,p,ha);F+=t}n>x&&(x=n);p=h&&(h=p+1)}g+=2;l++;if(n>=d.J&&(n=0,p++,p>d.ca))break}d.za=!0;eg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2"));
-g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");oa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,n=/( [a-z]+=)(['"])(.*?)\2/g;l=n.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
-"");a=a.replace(d[0],h);jg(a,b,c)}})}else c(a,null)}
-function kg(a,b,c,d){function e(a){if(void 0===g){var b=h&&C(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);k&&(--Tf||Na(!0));k=!1}var h,g,k=!0;Tf++;$a[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=l:p.appendChild(document.createTextNode(l));n.appendChild(p)}c||
-(c="/versions/pc8080/1.23.3/components.xsl");l=function(d,g){g?Uf(c,null,null,!1,e,function(d,k){if(k)if(ab(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Tf||Na(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--Tf||Na(!0)):f("invalid machine element: "+
-a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Uf(b,a,d,!0,e,l):ig(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(x){f(x.message)}return k}window.embedPC8080=function(a,b,c,d){Na(!1);return kg(a,b,c,d)};window.enableEvents=Na;window.sendEvent=Oa;
-function lg(a,b,c,d){if(!c&&b){d.push(b);a=$a[d[0]];b=null;for(var e in a)if(ea(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?oa(b,null,!0,function(a,b){mg(b,d)}):mg(null,d)}else v("Error ("+c+") requesting "+a)}
-function mg(a,b){var c,d,e,f=b[0],h=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var g=$a[f],k={},l;for(l in g){var n=g[l],p=da(l);if("xml"==p){for(p=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=p.exec(g[l]);){var x=d[2];x&&(g[x]||(n=n.replace(d[0],"")))}d=l=ba(l)}else"xsl"==p&&(e=l=ba(l));k[l]=n}a&&(k[l="css"]=a);b[2]&&(k[l="parms"]=b[2]);b[3]&&(k[l="state"]=b[3]);d&&e?(l=JSON.stringify(k),h+=".js",c=c[1]+"var resources="+l+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
+function xe(a,b,c){var d;if(b){b=we(a,b);for(var e=0,f=!1,h=b,g=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=p+"b"+h;d>>=8}d="0x"+n(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function uf(a,b){if(b)return tf(a,b,a.ka[b]);var c=0;for(b in a.ka)tf(a,b,a.ka[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.md;if(e>=h&&e>8&255;case "C":d.R=g&255;break;case "D":d.S=
+g&255;break;case "DE":d.S=g>>8&255;case "E":d.T=g&255;break;case "H":d.U=g&255;break;case "HL":d.U=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ia=g&65535;break;case "PC":G(d,g);a.W=X(d.N);break;case "PS":Kc(d,g);break;case "PSW":Kc(d,g&255|d.ta&-256);d.j=g>>8;break;case "CF":d.aa=g?d.aa|256:d.aa&255;break;case "PF":g?Uc(d)||(d.ca^=1):Uc(d)&&(d.ca^=1);break;case "AF":d.ua=g?~d.ca&16|d.ua&-17:d.ca&16|d.ua&-17;break;case "ZF":d.aa=g?d.aa&-256:d.aa|255;break;case "SF":g?Xc(d)||(d.ca^=192):Xc(d)&&(d.ca^=
+192);break;case "IF":d.ta=g?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}mc(d);a.g("updated registers:")}a.g(pf(a));c&&(a.W=X(d.N),He(a,Z(a.W.F)))}}function Bf(a,b){b=ja(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Ee(a,c[2])):xe(a,b,!0)}function Cf(a,b,c){var d="t"!=b;c=sf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);ya(c,function(){return ib(a,!0)&&a.rb(e,d,!1)},function(){mc(a.b);ib(a,!1)})}
+function He(a,b,c,d){if(b=se(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=se(a,c,!0);if(!d||d.Fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=mf(a,b,h,f);a.g(f);a.W=b;e-=b.F-k;c++}}}
+function ze(a,b,c,d){if(c)if(b){0>a.D&&a.G.length&&(a.D=0);if(0>a.D||b!=a.G[a.D])a.G.splice(0,0,b),a.D=0;a.D--}else a.fa?b="end":b=a.G[a.D+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ja(b.substring(c,f))),c=f+1}}return a}
+function lf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.fa&&(a.g("ended assemble at "+Z(a.ea.F)),a.W=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.za=null;if(kb(a)&&0l||"z"Ca.length&&(a.g("note: only "+Ca.length+" available"),ea=Ca.length);Y-=ea;0>Y&&(null==Ca[Ca.length-1].F?(ea=Y+ea,Y=0):Y+=Ca.length);
+var fd=[];"call"==Qe&&(mb=1E5,fd=["CALL"]);for(void 0!==Pe&&a.g(ea+" instructions earlier:");0=Ca.length&&(Y=0);a.eb=ea;Se++;mb--}}Se||(a.g("no "+Re+"history available"),a.eb=void 0)}else{var oc=se(a,Aa);if(oc){var pc=0;Va&&("l"==Va.charAt(0)&&(Va=Va.substr(1)||Xf),pc=sf(a,Va)>>>0,65536>4||1;Zf--&&0tc?String.fromCharCode(tc):".";rc--}Wa&&(Wa+="\n");Wa+=Aa+" "+Mb+(0==Lb?" "+hd:"")}Wa&&a.g(Wa);a.Ta=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,Ve=255,We=a.Y,Xe=a.qa;"ew"==f[0]&&(uc=2,Ve=65535,We=a.Pa,Xe=a.Qb);var Ye=uc<<1,Ze=f[1];if(null==Ze)a.g("edit memory commands:"),
+a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var vc=se(a,Ze);if(vc)for(var wc=2;wcod;){for(var Xa=null,eg=256;65536>Pb.F>>>0;){bf.F=a.Pa(Pb,2);if(null==Pb.F||!eg--)break;for(var fg=a,yc=bf,cf=null,Qb=yc.F,df=Qb,pd=1;6>=pd&&Qb;pd++){if(2\nLicense: GPL version 3 or later ");for(b=0;bMf){if(If(d,this.W)){this.I=new I(this,"1.23.3","failsafe");If(this.I)&&(Rf(this,d),a=2,Ff(this.I));J(this.I,"timestamp",ma());Gf(this.I);var e=this.w&&!this.K;if(1==a||sa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Hf(d)){var f=Jf(d,"code"),h=Jf(d,"data");f&&("ok"==f?If(d,h):("error"==f&&
+"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(wa("user",""),this.u=null)):this.g(f+": "+h),Ff(d),If(d)?(c=Hf(d),e=!0):c=!1))}e&&Qf(this,c?d:null)}else 2==a&&d.clear()}else Qf(this);delete this.W;delete this.Z}e=cb(this.id);for(f=0;fa[1];a=a[2];this.ra=!0;this.C.sa=!0;var d=this.M.power;d&&(d.textContent="Shutdown");this.b&&(Sf(this,this.b,b,c,a),nc(this.b));this.ea&&(Rf(this,b),b.clear());!c&&this.I&&(this.I.clear(),delete this.I);this.G=0};
+function Rf(a,b){if(sa("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.u||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.ma;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}}
+function Df(a,b,c){var d,e="none";if(a.G)return null;a.G--;var f=new I(a,"1.23.3"),h=new I(a,"1.23.3","validate"),g=ma();J(h,"timestamp",g);J(f,"timestamp",g);J(f,"version","1.23.3");J(f,"url",window?window.location.href:null);J(f,"browser",ra());a.b&&a.b.Ja&&(c&&a.b.ja(),d=a.b.Ja(b,c),"object"===typeof d&&J(f,a.b.id,d),c&&(a.b.C.sa=!1,!1===d&&(e=null)));for(var g=cb(a.id),k=0;k>>f.la;0>8|(v&255)<<8);p>H&B;de(d,d.gc,p++,q,ia);H+=u}p>y&&(y=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.Fa=!0;eg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2"));
+g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");oa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,p=/( [a-z]+=)(['"])(.*?)\2/g;l=p.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
+"");a=a.replace(d[0],h);lg(a,b,c)}})}else c(a,null)}
+function mg(a,b,c,d){function e(a){if(void 0===g){var b=h&&A(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);k&&(--Vf||Oa(!0));k=!1}var h,g,k=!0;Vf++;ab[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=l:q.appendChild(document.createTextNode(l));p.appendChild(q)}c||
+(c="/versions/pc8080/1.23.3/components.xsl");l=function(d,g){g?Wf(c,null,null,!1,e,function(d,k){if(k)if(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Vf||Oa(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--Vf||Oa(!0)):f("invalid machine element: "+
+a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Wf(b,a,d,!0,e,l):kg(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(y){f(y.message)}return k}window.embedPC8080=function(a,b,c,d){Oa(!1);return mg(a,b,c,d)};window.enableEvents=Oa;window.sendEvent=Pa;
+function ng(a,b,c,d){if(!c&&b){d.push(b);a=ab[d[0]];b=null;for(var e in a)if(da(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?oa(b,null,!0,function(a,b){og(b,d)}):og(null,d)}else t("Error ("+c+") requesting "+a)}
+function og(a,b){var c,d,e,f=b[0],h=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var g=ab[f],k={},l;for(l in g){var p=g[l],q=ca(l);if("xml"==q){for(q=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[l]);){var y=d[2];y&&(g[y]||(p=p.replace(d[0],"")))}d=l=ba(l)}else"xsl"==q&&(e=l=ba(l));k[l]=p}a&&(k[l="css"]=a);b[2]&&(k[l="parms"]=b[2]);b[3]&&(k[l="state"]=b[3]);d&&e?(l=JSON.stringify(k),h+=".js",c=c[1]+"var resources="+l+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"©"),l=h,g=null,k="data:application/javascript,",k=xa("Firefox")?k+encodeURIComponent(c):k+encodeURI(c),l&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=k,g.download=l,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+l+"."):(window.open(k),c="Check your browser for a new window/tab containing the requested data"+(l?" ("+l+")":"")+"."),c+=', copy it to your web server as "'+h+'", and then add the following to your web page:\n\n',
-c+='\n',c+="...\n",c+='