More PCjs/PCx86 disambiguation

This commit is contained in:
Jeff Parsons 2016-05-17 00:04:51 -07:00
commit a1e999e0c4
92 changed files with 3553 additions and 3555 deletions

View file

@ -1,21 +1,20 @@
PCjs: Home of the Virtual IBM PC
PC Simulations in JavaScript
===
Welcome to PCjs, home of [PCx86](/docs/about/pcx86/), the first IBM PC simulation to run in your web browser without
any plugins. It was added to the [PCjs Project](https://github.com/jeffpar/pcjs) in Fall 2012.
PCjs includes the following web-based emulators:
Welcome to PCjs, home of the first IBM PC simulation to run in your web browser without
any plugins. It was released in Fall 2012 as part of the [PCjs Project](https://github.com/jeffpar/pcjs),
which includes:
* [PCx86](/docs/pcx86/), an x86-based IBM PC and PC-compatible emulator
* [PC8080](/modules/pc8080/), a 8080-based generic machine emulator
* [C1Pjs](/docs/c1pjs/), a 6502-based Ohio Scientific Challenger 1P emulator
PCx86 first simulated the 4.77Mhz 8088-based IBM PC, and has steadily evolved to support more classic x86 machines,
PCx86 originally simulated the 4.77Mhz 8088-based IBM PC and has steadily evolved to support more classic x86 machines,
including the IBM PC XT, the 80286-based IBM PC AT, and the 80386-based COMPAQ DeskPro 386. PCx86 fully supports
the original machine ROMs, video cards, etc, and all machines run at their original speeds.
All the simulations are written entirely in [JavaScript](/modules/). No Flash, Java or other plugins are required.
Supported browsers include modern versions of Chrome, Safari, Firefox, Internet Explorer (v9.0 and up), Edge,
All PCjs computer simulations are written entirely in [JavaScript](/modules/). No Flash, Java or other plugins are
required. Supported browsers include modern versions of Chrome, Safari, Firefox, Internet Explorer (v9.0 and up), Edge,
and assorted mobile browsers.
[Embedded IBM PC](/devices/pcx86/machine/5150/mda/64kb/ "PCx86:ibm5150")
@ -34,7 +33,7 @@ Demos
---
Some pre-configured machines are shown below, ready to run BASIC, DOS, Windows, OS/2, and other assorted software.
![IBM PC running VisiCalc](/apps/pcx86/1981/visicalc/thumbnail.jpg "link:/apps/pc/1981/visicalc/:200:120")
![IBM PC running VisiCalc](/apps/pcx86/1981/visicalc/thumbnail.jpg "link:/apps/pcx86/1981/visicalc/:200:120")
![IBM PC running DONKEY.BAS](/devices/pcx86/machine/5150/cga/64kb/donkey/thumbnail.jpg "link:/devices/pcx86/machine/5150/cga/64kb/donkey/:200:120")
![IBM PC AT w/EGA, OS/2 1.0](/disks/pcx86/os2/ibm/1.0/thumbnail.jpg "link:/disks/pcx86/os2/ibm/1.0/:200:120")
![IBM PC XT w/CGA, Windows 1.01](/devices/pcx86/machine/5160/cga/256kb/win101/thumbnail.jpg "link:/devices/pcx86/machine/5160/cga/256kb/win101/:200:120")
@ -267,7 +266,7 @@ the command, then it's passed on to *eval()*, like a good little REPL.
Use the "load" command to load a JSON machine configuration file. A sample
[ibm5150.json](modules/pcx86/bin/ibm5150.json) is provided in the *bin* directory, which is a "JSON-ified" version
of the [machine.xml](devices/pc/machine/5150/mda/64kb/machine.xml) displayed on the [pcjs.org](http://www.pcjs.org/)
of the [machine.xml](devices/pcx86/machine/5150/mda/64kb/machine.xml) displayed on the [pcjs.org](http://www.pcjs.org/)
home page.
The command-line loader creates all the JSON-defined machine components in the same order that the browser creates

View file

@ -1,13 +1,12 @@
# Site settings
title: "PCjs: The Virtual IBM PC"
title: "PCjs: PC Simulations in JavaScript"
email: Jeff@pcjs.org
description: >
PCjs: The Original IBM PC in a Browser.
Classic computer simulations in JavaScript.
PCjs: Home of the original IBM PC emulator in a browser.
Classic computer simulations in JavaScript, including the IBM PC and other x86-based machines, 6502-based
machines such as the Ohio Scientific Challenger 1P, and 8080-based machines such as Space Invaders.
Includes an archive of historical PC software and publications.
Additional computer simulations in JavaScript include the 6502-based Ohio Scientific Challenger 1P and 8080-based
machines, including arcade machines such as Space Invaders.
baseurl: "" # "/pcjs" when using http://jeffpar.github.io or "" when using http://www.pcjs.org
url: "http://www.pcjs.org" # "http://jeffpar.github.io" or "http://www.pcjs.org"
twitter_username: jeffpar

View file

@ -11,8 +11,8 @@
<xsl:variable name="MACHINECLASS">pc</xsl:variable>
<xsl:variable name="CSSCLASS">pcjs</xsl:variable>
<xsl:variable name="APPCLASS">pcjs</xsl:variable>
<xsl:variable name="APPNAME">PCjs</xsl:variable>
<xsl:variable name="APPCLASS">pcx86</xsl:variable>
<xsl:variable name="APPNAME">PCx86</xsl:variable>
<xsl:variable name="APPVERSION">1.23.0</xsl:variable>
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>
@ -31,7 +31,7 @@
</xsl:template>
<xsl:template name="machine">
<xsl:param name="href">/devices/pc/machine/5150/mda/64kb/machine.xml</xsl:param>
<xsl:param name="href" select="''"/>
<xsl:param name="state" select="''"/>
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="$href"/></xsl:variable>
<xsl:apply-templates select="document($componentFile)/machine">

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -11,21 +11,20 @@ machines:
config: /devices/c1p/machine/8kb/large/machine.xml
---
Welcome to PCjs, home of [PCx86](/docs/about/pcx86/), the first IBM PC simulation to run in your web browser without
any plugins. It was added to the [PCjs Project](https://github.com/jeffpar/pcjs) in Fall 2012.
PCjs includes the following web-based emulators:
Welcome to PCjs, home of the first IBM PC simulation to run in your web browser without
any plugins. It was released in Fall 2012 as part of the [PCjs Project](https://github.com/jeffpar/pcjs),
which includes:
* [PCx86](/docs/pcx86/), an x86-based IBM PC and PC-compatible emulator
* [PC8080](/modules/pc8080/), an 8080-based generic machine emulator
* [C1Pjs](/docs/c1pjs/), a 6502-based Ohio Scientific Challenger 1P emulator
PCx86 first simulated the 4.77Mhz 8088-based IBM PC, and has steadily evolved to support more classic x86 machines,
PCx86 orginally simulated the 4.77Mhz 8088-based IBM PC and has steadily evolved to support more classic x86 machines,
including the IBM PC XT, the 80286-based IBM PC AT, and the 80386-based COMPAQ DeskPro 386. PCx86 fully supports
the original machine ROMs, video cards, etc, and all machines run at their original speeds.
All the simulations are written entirely in [JavaScript](/modules/). No Flash, Java or other plugins are required.
Supported browsers include modern versions of Chrome, Safari, Firefox, Internet Explorer (v9.0 and up), Edge,
All PCjs computer simulations are written entirely in [JavaScript](/modules/). No Flash, Java or other plugins are
required. Supported browsers include modern versions of Chrome, Safari, Firefox, Internet Explorer (v9.0 and up), Edge,
and assorted mobile browsers.
{% include machine.html id="ibm5150" %}
@ -44,7 +43,7 @@ Demos
---
Some pre-configured machines are shown below, ready to run BASIC, DOS, Windows, OS/2, and other assorted software.
{% include screenshot.html src="/apps/pcx86/1981/visicalc/thumbnail.jpg" width="200" height="120" title="IBM PC running VisiCalc" link="/apps/pc/1981/visicalc/" %}
{% include screenshot.html src="/apps/pcx86/1981/visicalc/thumbnail.jpg" width="200" height="120" title="IBM PC running VisiCalc" link="/apps/pcx86/1981/visicalc/" %}
{% include screenshot.html src="/devices/pcx86/machine/5150/cga/64kb/donkey/thumbnail.jpg" width="200" height="120" title="IBM PC running DONKEY.BAS" link="/devices/pcx86/machine/5150/cga/64kb/donkey/" %}
{% include screenshot.html src="/disks/pcx86/os2/ibm/1.0/thumbnail.jpg" width="200" height="120" title="IBM PC AT w/EGA, OS/2 1.0" link="/disks/pcx86/os2/ibm/1.0/" %}
{% include screenshot.html src="/devices/pcx86/machine/5160/cga/256kb/win101/thumbnail.jpg" width="200" height="120" title="IBM PC XT w/CGA, Windows 1.01" link="/devices/pcx86/machine/5160/cga/256kb/win101/" %}

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
/*
@ -99,10 +98,6 @@ function C1PComputer(parmsComputer, modules)
this.modules = modules;
}
C1PComputer.APPNAME = APPNAME || "C1Pjs";
C1PComputer.APPVERSION = APPVERSION;
C1PComputer.COPYRIGHT = "Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>";
Component.subclass(C1PComputer);
/**
@ -245,7 +240,7 @@ C1PComputer.power = function(computer)
*/
computer.setReady();
computer.println(C1PComputer.APPNAME + " v" + C1PComputer.APPVERSION + "\n" + C1PComputer.COPYRIGHT);
computer.println(C1PJS.APPNAME + " v" + C1PJS.APPVERSION + "\n" + COPYRIGHT);
/*
* Once we get to this point, we're guaranteed that all components are ready, so it's safe to "power" the CPU;
@ -268,9 +263,9 @@ C1PComputer.init = function()
/*
* In non-COMPILED builds, embedMachine() may have set XMLVERSION.
*/
if (!COMPILED && XMLVERSION) C1PComputer.APPVERSION = XMLVERSION;
if (!COMPILED && C1PJS.XMLVERSION) C1PJS.APPVERSION = C1PJS.XMLVERSION;
var aeComputers = Component.getElementsByClass(document, C1PJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, C1PJS.APPCLASS, "computer");
for (var iComputer=0; iComputer < aeComputers.length; iComputer++) {
@ -363,7 +358,7 @@ C1PComputer.init = function()
/*
* We may eventually add a "Power" button, but for now, all we have is a "Reset" button
*/
Component.bindComponentControls(computer, eComputer, C1PJSCLASS);
Component.bindComponentControls(computer, eComputer, C1PJS.APPCLASS);
/*
* "Power" the computer automatically

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -3879,12 +3878,12 @@ C1PCPU.prototype.opUndefined = function()
*/
C1PCPU.init = function()
{
var aeCPUs = Component.getElementsByClass(document, C1PJSCLASS, "cpu");
var aeCPUs = Component.getElementsByClass(document, C1PJS.APPCLASS, "cpu");
for (var iCPU=0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new C1PCPU(parmsCPU);
Component.bindComponentControls(cpu, eCPU, C1PJSCLASS);
Component.bindComponentControls(cpu, eCPU, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -2202,12 +2201,12 @@ if (DEBUGGER) {
*/
C1PDebugger.init = function()
{
var aeDbg = Component.getElementsByClass(document, C1PJSCLASS, "debugger");
var aeDbg = Component.getElementsByClass(document, C1PJS.APPCLASS, "debugger");
for (var iDbg=0; iDbg < aeDbg.length; iDbg++) {
var eDbg = aeDbg[iDbg];
var parmsDbg = Component.getComponentParms(eDbg);
var dbg = new C1PDebugger(parmsDbg);
Component.bindComponentControls(dbg, eDbg, C1PJSCLASS);
Component.bindComponentControls(dbg, eDbg, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -42,11 +41,6 @@ var APPCLASS = "c1pjs"; // this @define is the default application class
*/
var APPNAME = "C1Pjs"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
/**
* @define {string}
*/
var C1PJSCLASS = "c1pjs"; // this @define is the default application class (formerly APPCLASS) to use for C1Pjs; TODO: Remove
/**
* @define {boolean}
*
@ -61,3 +55,20 @@ var C1PJSCLASS = "c1pjs"; // this @define is the default application class
* (nodebugger.js) to be loaded immediately after this file, which *explicitly* overrides DEBUGGER with *false*.
*/
var DEBUGGER = true; // this @define is overridden by the Closure Compiler to remove Debugger-related support
/*
* Combine all the shared globals and machine-specific globals into one machine-specific global object,
* which all machine components should start using; eg: "if (C1PJS.DEBUG) ..." instead of "if (DEBUG) ...".
*/
var C1PJS = {
APPCLASS: APPCLASS,
APPNAME: APPNAME,
APPVERSION: APPVERSION, // shared
COMPILED: COMPILED, // shared
DEBUG: DEBUG, // shared
DEBUGGER: DEBUGGER,
MAXDEBUG: MAXDEBUG, // shared
PRIVATE: PRIVATE, // shared
SITEHOST: SITEHOST, // shared
XMLVERSION: XMLVERSION // shared
}

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -1256,12 +1255,12 @@ C1PDiskController.prototype.writePort = function(port, reg)
*/
C1PDiskController.init = function()
{
var aeDC = Component.getElementsByClass(document, C1PJSCLASS, "disk");
var aeDC = Component.getElementsByClass(document, C1PJS.APPCLASS, "disk");
for (var iDC=0; iDC < aeDC.length; iDC++) {
var eDC = aeDC[iDC];
var parmsDC = Component.getComponentParms(eDC);
var controller = new C1PDiskController(parmsDC);
Component.bindComponentControls(controller, eDC, C1PJSCLASS);
Component.bindComponentControls(controller, eDC, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -1094,12 +1093,12 @@ C1PKeyboard.prototype.updateMemory = function(fPropagate, addr, bWrite)
*/
C1PKeyboard.init = function()
{
var aeKbd = Component.getElementsByClass(document, C1PJSCLASS, "keyboard");
var aeKbd = Component.getElementsByClass(document, C1PJS.APPCLASS, "keyboard");
for (var iKbd=0; iKbd < aeKbd.length; iKbd++) {
var eKbd = aeKbd[iKbd];
var parmsKbd = Component.getComponentParms(eKbd);
var kbd = new C1PKeyboard(parmsKbd);
Component.bindComponentControls(kbd, eKbd, C1PJSCLASS);
Component.bindComponentControls(kbd, eKbd, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -112,7 +111,7 @@ C1PPanel.prototype.setPower = function(fOn, cmp)
C1PPanel.init = function()
{
var fReady = false;
var aePanels = Component.getElementsByClass(document, C1PJSCLASS, "panel");
var aePanels = Component.getElementsByClass(document, C1PJS.APPCLASS, "panel");
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
var ePanel = aePanels[iPanel];
var parmsPanel = Component.getComponentParms(ePanel);
@ -121,7 +120,7 @@ C1PPanel.init = function()
fReady = true;
panel = new C1PPanel(parmsPanel);
}
Component.bindComponentControls(panel, ePanel, C1PJSCLASS);
Component.bindComponentControls(panel, ePanel, C1PJS.APPCLASS);
if (fReady) panel.setReady();
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -83,12 +82,12 @@ C1PRAM.prototype.setBuffer = function(abMemory, start, end, cpu)
*/
C1PRAM.init = function()
{
var aeRAM = Component.getElementsByClass(document, C1PJSCLASS, "ram");
var aeRAM = Component.getElementsByClass(document, C1PJS.APPCLASS, "ram");
for (var iRAM=0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new C1PRAM(parmsRAM);
Component.bindComponentControls(ram, eRAM, C1PJSCLASS);
Component.bindComponentControls(ram, eRAM, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -232,12 +231,12 @@ C1PROM.prototype.copyImage = function()
*/
C1PROM.init = function()
{
var aeROM = Component.getElementsByClass(document, C1PJSCLASS, "rom");
var aeROM = Component.getElementsByClass(document, C1PJS.APPCLASS, "rom");
for (var iROM=0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new C1PROM(parmsROM);
Component.bindComponentControls(rom, eROM, C1PJSCLASS);
Component.bindComponentControls(rom, eROM, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -436,12 +435,12 @@ C1PSerialPort.prototype.updateMemory = function()
*/
C1PSerialPort.init = function()
{
var aeSerial = Component.getElementsByClass(document, C1PJSCLASS, "serial");
var aeSerial = Component.getElementsByClass(document, C1PJS.APPCLASS, "serial");
for (var iSerial=0; iSerial < aeSerial.length; iSerial++) {
var eSerial = aeSerial[iSerial];
var parmsSerial = Component.getComponentParms(eSerial);
var serial = new C1PSerialPort(parmsSerial);
Component.bindComponentControls(serial, eSerial, C1PJSCLASS);
Component.bindComponentControls(serial, eSerial, C1PJS.APPCLASS);
}
};

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* C1Pjs is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* C1Pjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with C1Pjs. If not,
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see C1PComputer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some C1Pjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* C1Pjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -561,7 +560,7 @@ C1PVideo.prototype.updateWindow = function(col, row, b)
*/
C1PVideo.init = function()
{
var aeVideo = Component.getElementsByClass(document, C1PJSCLASS, "video");
var aeVideo = Component.getElementsByClass(document, C1PJS.APPCLASS, "video");
for (var iVideo=0; iVideo < aeVideo.length; iVideo++) {
var eVideo = aeVideo[iVideo];
var parmsVideo = Component.getComponentParms(eVideo);
@ -580,7 +579,7 @@ C1PVideo.init = function()
eVideo.innerHTML = "<br/>Missing &lt;canvas&gt; support. Please try a newer web browser.";
return;
}
eCanvas.setAttribute("class", C1PJSCLASS + "-canvas");
eCanvas.setAttribute("class", C1PJS.APPCLASS + "-canvas");
eCanvas.setAttribute("width", parmsVideo['screenWidth']);
eCanvas.setAttribute("height", parmsVideo['screenHeight']);
@ -628,7 +627,7 @@ C1PVideo.init = function()
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
* even the "Refresh" button is just a diagnostic tool, to verify that the screen contents are up-to-date.
*/
Component.bindComponentControls(video, eVideo, C1PJSCLASS);
Component.bindComponentControls(video, eVideo, C1PJS.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -551,12 +550,12 @@ ChipSet.aPortOutput = {
*/
ChipSet.init = function()
{
var aeChipSet = Component.getElementsByClass(document, APPCLASS, "chipset");
var aeChipSet = Component.getElementsByClass(document, PC8080.APPCLASS, "chipset");
for (var iChip = 0; iChip < aeChipSet.length; iChip++) {
var eChipSet = aeChipSet[iChip];
var parmsChipSet = Component.getComponentParms(eChipSet);
var chipset = new ChipSet(parmsChipSet);
Component.bindComponentControls(chipset, eChipSet, APPCLASS);
Component.bindComponentControls(chipset, eChipSet, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -189,7 +188,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
}
}
this.println(Computer.APPNAME + " v" + Computer.APPVERSION + "\n" + Computer.COPYRIGHT + "\n" + Computer.LICENSE);
this.println(PC8080.APPNAME + " v" + PC8080.APPVERSION + "\n" + COPYRIGHT + "\n" + LICENSE);
if (DEBUG && this.messageEnabled()) this.printMessage("TYPEDARRAYS: " + TYPEDARRAYS);
@ -240,7 +239,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
this.resume = Computer.RESUME_NONE;
}
if (this.resume) {
this.stateComputer = new State(this, Computer.APPVERSION);
this.stateComputer = new State(this, PC8080.APPVERSION);
if (this.stateComputer.load()) {
sStatePath = null;
} else {
@ -277,16 +276,6 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
Component.subclass(Computer);
Computer.APPNAME = APPNAME || "PC8080";
Computer.APPVERSION = APPVERSION;
Computer.COPYRIGHT = "Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>";
/*
* I think it's a good idea to also display a GPL notice, putting people on notice that even
* the "compiled" source code has all the same GPL requirements as the uncompiled source code.
*/
Computer.LICENSE = "License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>";
Computer.STATE_FAILSAFE = "failsafe";
Computer.STATE_VALIDATE = "validate";
Computer.STATE_TIMESTAMP = "timestamp";
@ -466,7 +455,7 @@ Computer.prototype.wait = function(fn, parms)
Computer.prototype.validateState = function(stateComputer)
{
var fValid = true;
var stateValidate = new State(this, Computer.APPVERSION, Computer.STATE_VALIDATE);
var stateValidate = new State(this, PC8080.APPVERSION, Computer.STATE_VALIDATE);
if (stateValidate.load() && stateValidate.parse()) {
var sTimestampValidate = stateValidate.get(Computer.STATE_TIMESTAMP);
var sTimestampComputer = stateComputer ? stateComputer.get(Computer.STATE_TIMESTAMP) : "unknown";
@ -509,7 +498,7 @@ Computer.prototype.powerOn = function(resume)
var fRepower = false;
var fRestore = false;
this.fRestoreError = false;
var stateComputer = this.stateComputer || new State(this, Computer.APPVERSION);
var stateComputer = this.stateComputer || new State(this, PC8080.APPVERSION);
if (resume == Computer.RESUME_REPOWER) {
fRepower = true;
@ -522,7 +511,7 @@ Computer.prototype.powerOn = function(resume)
* Which means, of course, that if a previous "failsafe" checkpoint already exists, something bad
* may have happened the last time around.
*/
this.stateFailSafe = new State(this, Computer.APPVERSION, Computer.STATE_FAILSAFE);
this.stateFailSafe = new State(this, PC8080.APPVERSION, Computer.STATE_FAILSAFE);
if (this.stateFailSafe.load()) {
this.powerReport(stateComputer);
/*
@ -542,7 +531,7 @@ Computer.prototype.powerOn = function(resume)
this.stateFailSafe.store();
var fValidate = this.resume && !this.fServerState;
if (resume == Computer.RESUME_AUTO || web.confirmUser("Click OK to restore the previous " + Computer.APPNAME + " machine state, or CANCEL to reset the machine.")) {
if (resume == Computer.RESUME_AUTO || web.confirmUser("Click OK to restore the previous " + PC8080.APPNAME + " machine state, or CANCEL to reset the machine.")) {
fRestore = stateComputer.parse();
if (fRestore) {
var sCode = stateComputer.get(UserAPI.RES.CODE);
@ -815,8 +804,8 @@ Computer.prototype.checkPower = function()
*/
Computer.prototype.powerReport = function(stateComputer)
{
if (web.confirmUser("There may be a problem with your " + Computer.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + Computer.APPNAME + " machine state to http://" + SITEHOST + ".")) {
web.sendReport(Computer.APPNAME, Computer.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
if (web.confirmUser("There may be a problem with your " + PC8080.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + PC8080.APPNAME + " machine state to http://" + SITEHOST + ".")) {
web.sendReport(PC8080.APPNAME, PC8080.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
}
};
@ -865,8 +854,8 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
}
this.nPowerChange--;
var stateComputer = new State(this, Computer.APPVERSION);
var stateValidate = new State(this, Computer.APPVERSION, Computer.STATE_VALIDATE);
var stateComputer = new State(this, PC8080.APPVERSION);
var stateValidate = new State(this, PC8080.APPVERSION, Computer.STATE_VALIDATE);
var sTimestamp = usr.getTimestamp();
stateValidate.set(Computer.STATE_TIMESTAMP, sTimestamp);
@ -1222,7 +1211,7 @@ Computer.prototype.getServerStatePath = function()
if (DEBUG && this.messageEnabled()) {
this.printMessage(Computer.STATE_USERID + " for load: " + this.sUserID);
}
sStatePath = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.LOAD + '&' + UserAPI.QUERY.USER + '=' + this.sUserID + '&' + UserAPI.QUERY.STATE + '=' + State.key(this, Computer.APPVERSION);
sStatePath = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.LOAD + '&' + UserAPI.QUERY.USER + '=' + this.sUserID + '&' + UserAPI.QUERY.STATE + '=' + State.key(this, PC8080.APPVERSION);
} else {
if (DEBUG && this.messageEnabled()) {
this.printMessage(Computer.STATE_USERID + " unavailable");
@ -1290,7 +1279,7 @@ Computer.prototype.storeServerState = function(sUserID, sState, fSync)
var dataPost = {};
dataPost[UserAPI.QUERY.REQ] = UserAPI.REQ.STORE;
dataPost[UserAPI.QUERY.USER] = sUserID;
dataPost[UserAPI.QUERY.STATE] = State.key(this, Computer.APPVERSION);
dataPost[UserAPI.QUERY.STATE] = State.key(this, PC8080.APPVERSION);
dataPost[UserAPI.QUERY.DATA] = sState;
var sRequest = web.getHost() + UserAPI.ENDPOINT;
if (!fSync) {
@ -1359,7 +1348,7 @@ Computer.prototype.onReset = function()
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
*/
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + Computer.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + PC8080.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
this.powerOff(fSave, true);
/*
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
@ -1503,16 +1492,16 @@ Computer.init = function()
/*
* In non-COMPILED builds, embedMachine() may have set XMLVERSION.
*/
if (!COMPILED && XMLVERSION) Computer.APPVERSION = XMLVERSION;
if (!COMPILED && PC8080.XMLVERSION) PC8080.APPVERSION = PC8080.XMLVERSION;
var aeMachines = Component.getElementsByClass(document, APPCLASS + "-machine");
var aeMachines = Component.getElementsByClass(document, PC8080.APPCLASS + "-machine");
for (var iMachine = 0; iMachine < aeMachines.length; iMachine++) {
var eMachine = aeMachines[iMachine];
var parmsMachine = Component.getComponentParms(eMachine);
var aeComputers = Component.getElementsByClass(eMachine, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(eMachine, PC8080.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
@ -1534,7 +1523,7 @@ Computer.init = function()
* but "reset" now provides a way to force the machine to start from scratch again, so "erase"
* may be redundant now.
*/
Component.bindComponentControls(computer, eComputer, APPCLASS);
Component.bindComponentControls(computer, eComputer, PC8080.APPCLASS);
/*
* Power on the computer, giving every component the opportunity to reset or restore itself.
@ -1555,7 +1544,7 @@ Computer.init = function()
*/
Computer.show = function()
{
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, PC8080.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);
@ -1604,7 +1593,7 @@ Computer.show = function()
*/
Computer.exit = function()
{
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, PC8080.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -1153,12 +1152,12 @@ CPUState.prototype.stepCPU = function(nMinCycles)
*/
CPUState.init = function()
{
var aeCPUs = Component.getElementsByClass(document, APPCLASS, "cpu");
var aeCPUs = Component.getElementsByClass(document, PC8080.APPCLASS, "cpu");
for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new CPUState(parmsCPU);
Component.bindComponentControls(cpu, eCPU, APPCLASS);
Component.bindComponentControls(cpu, eCPU, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -4776,12 +4775,12 @@ if (DEBUGGER) {
*/
Debugger.init = function()
{
var aeDbg = Component.getElementsByClass(document, APPCLASS, "debugger");
var aeDbg = Component.getElementsByClass(document, PC8080.APPCLASS, "debugger");
for (var iDbg = 0; iDbg < aeDbg.length; iDbg++) {
var eDbg = aeDbg[iDbg];
var parmsDbg = Component.getComponentParms(eDbg);
var dbg = new Debugger(parmsDbg);
Component.bindComponentControls(dbg, eDbg, APPCLASS);
Component.bindComponentControls(dbg, eDbg, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -75,12 +74,32 @@ var BYTEARRAYS = false;
*/
var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined');
/*
* Combine all the shared globals and machine-specific globals into one machine-specific global object,
* which all machine components should start using; eg: "if (PC8080.DEBUG) ..." instead of "if (DEBUG) ...".
*/
var PC8080 = {
APPCLASS: APPCLASS,
APPNAME: APPNAME,
APPVERSION: APPVERSION, // shared
BYTEARRAYS: BYTEARRAYS,
COMPILED: COMPILED, // shared
DEBUG: DEBUG, // shared
DEBUGGER: DEBUGGER,
MAXDEBUG: MAXDEBUG, // shared
PRIVATE: PRIVATE, // shared
TYPEDARRAYS: TYPEDARRAYS,
SITEHOST: SITEHOST, // shared
XMLVERSION: XMLVERSION // shared
}
if (NODE) {
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.BYTEARRAYS = BYTEARRAYS;
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.BYTEARRAYS = BYTEARRAYS;
global.TYPEDARRAYS = TYPEDARRAYS;
global.PC8080 = PC8080;
/*
* TODO: When we're "required" by Node, should we return anything via module.exports?
*/

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -453,12 +452,12 @@ Keyboard.prototype.onSoftKeyDown = function(sSoftCode, fDown)
*/
Keyboard.init = function()
{
var aeKbd = Component.getElementsByClass(document, APPCLASS, "keyboard");
var aeKbd = Component.getElementsByClass(document, PC8080.APPCLASS, "keyboard");
for (var iKbd = 0; iKbd < aeKbd.length; iKbd++) {
var eKbd = aeKbd[iKbd];
var parmsKbd = Component.getComponentParms(eKbd);
var kbd = new Keyboard(parmsKbd);
Component.bindComponentControls(kbd, eKbd, APPCLASS);
Component.bindComponentControls(kbd, eKbd, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -163,7 +162,7 @@ Panel.prototype.updateStatus = function(fForce)
Panel.init = function()
{
var fReady = false;
var aePanels = Component.getElementsByClass(document, APPCLASS, "panel");
var aePanels = Component.getElementsByClass(document, PC8080.APPCLASS, "panel");
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
var ePanel = aePanels[iPanel];
var parmsPanel = Component.getComponentParms(ePanel);
@ -172,7 +171,7 @@ Panel.init = function()
fReady = true;
panel = new Panel(parmsPanel);
}
Component.bindComponentControls(panel, ePanel, APPCLASS);
Component.bindComponentControls(panel, ePanel, PC8080.APPCLASS);
if (fReady) panel.setReady();
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -180,12 +179,12 @@ RAM.prototype.restore = function(data)
*/
RAM.init = function()
{
var aeRAM = Component.getElementsByClass(document, APPCLASS, "ram");
var aeRAM = Component.getElementsByClass(document, PC8080.APPCLASS, "ram");
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new RAM(parmsRAM);
Component.bindComponentControls(ram, eRAM, APPCLASS);
Component.bindComponentControls(ram, eRAM, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -505,12 +504,12 @@ ROM.prototype.cloneROM = function(addr)
*/
ROM.init = function()
{
var aeROM = Component.getElementsByClass(document, APPCLASS, "rom");
var aeROM = Component.getElementsByClass(document, PC8080.APPCLASS, "rom");
for (var iROM = 0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new ROM(parmsROM);
Component.bindComponentControls(rom, eROM, APPCLASS);
Component.bindComponentControls(rom, eROM, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -593,7 +592,7 @@ Video.prototype.updateScreen = function(n)
*/
Video.init = function()
{
var aeVideo = Component.getElementsByClass(document, APPCLASS, "video");
var aeVideo = Component.getElementsByClass(document, PC8080.APPCLASS, "video");
for (var iVideo = 0; iVideo < aeVideo.length; iVideo++) {
var eVideo = aeVideo[iVideo];
var parmsVideo = Component.getComponentParms(eVideo);
@ -717,7 +716,7 @@ Video.init = function()
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
* even the "Refresh" button is just a diagnostic tool, to ensure that the screen contents are up-to-date.
*/
Component.bindComponentControls(video, eVideo, APPCLASS);
Component.bindComponentControls(video, eVideo, PC8080.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -131,7 +130,7 @@ function ChipSet(parmsChipSet)
bSwitches = this.parseDIPSwitches(parmsChipSet[ChipSet.CONTROLS.SW2]);
this.aDIPSwitches[1] = [bSwitches, bSwitches];
this.sCellClass = APPCLASS + "-bitCell";
this.sCellClass = PCX86.APPCLASS + "-bitCell";
this.cDMACs = this.cPICs = 1;
if (this.model >= ChipSet.MODEL_5170) {
@ -5981,12 +5980,12 @@ if (DESKPRO386) {
*/
ChipSet.init = function()
{
var aeChipSet = Component.getElementsByClass(document, APPCLASS, "chipset");
var aeChipSet = Component.getElementsByClass(document, PCX86.APPCLASS, "chipset");
for (var iChip = 0; iChip < aeChipSet.length; iChip++) {
var eChipSet = aeChipSet[iChip];
var parmsChipSet = Component.getComponentParms(eChipSet);
var chipset = new ChipSet(parmsChipSet);
Component.bindComponentControls(chipset, eChipSet, APPCLASS);
Component.bindComponentControls(chipset, eChipSet, PCX86.APPCLASS);
chipset.updateDIPSwitchDescriptions();
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
/*
@ -218,7 +217,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
}
}
this.println(Computer.APPNAME + " v" + Computer.APPVERSION + "\n" + Computer.COPYRIGHT + "\n" + Computer.LICENSE);
this.println(PCX86.APPNAME + " v" + PCX86.APPVERSION + "\n" + COPYRIGHT + "\n" + LICENSE);
if (DEBUG && this.messageEnabled()) this.printMessage("PREFETCH: " + PREFETCH + ", TYPEDARRAYS: " + TYPEDARRAYS);
@ -269,7 +268,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
this.resume = Computer.RESUME_NONE;
}
if (this.resume) {
this.stateComputer = new State(this, Computer.APPVERSION);
this.stateComputer = new State(this, PCX86.APPVERSION);
if (this.stateComputer.load()) {
sStatePath = null;
} else {
@ -306,22 +305,6 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
Component.subclass(Computer);
/*
* NOTE: 1.01 is the first version to provide limited save/restore support using localStorage.
* From this point on, care must be taken to insure that any new version that's incompatible with
* previous localStorage data be released with a version number that is at least 1 greater,
* since we're tagging the localStorage data with the integer portion of the version string.
*/
Computer.APPNAME = APPNAME || "PCx86";
Computer.APPVERSION = APPVERSION;
Computer.COPYRIGHT = "Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>";
/*
* I think it's a good idea to also display a GPL notice, putting people on notice that even
* the "compiled" source code has all the same GPL requirements as the uncompiled source code.
*/
Computer.LICENSE = "License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>";
Computer.STATE_FAILSAFE = "failsafe";
Computer.STATE_VALIDATE = "validate";
Computer.STATE_TIMESTAMP = "timestamp";
@ -501,7 +484,7 @@ Computer.prototype.wait = function(fn, parms)
Computer.prototype.validateState = function(stateComputer)
{
var fValid = true;
var stateValidate = new State(this, Computer.APPVERSION, Computer.STATE_VALIDATE);
var stateValidate = new State(this, PCX86.APPVERSION, Computer.STATE_VALIDATE);
if (stateValidate.load() && stateValidate.parse()) {
var sTimestampValidate = stateValidate.get(Computer.STATE_TIMESTAMP);
var sTimestampComputer = stateComputer ? stateComputer.get(Computer.STATE_TIMESTAMP) : "unknown";
@ -544,7 +527,7 @@ Computer.prototype.powerOn = function(resume)
var fRepower = false;
var fRestore = false;
this.fRestoreError = false;
var stateComputer = this.stateComputer || new State(this, Computer.APPVERSION);
var stateComputer = this.stateComputer || new State(this, PCX86.APPVERSION);
if (resume == Computer.RESUME_REPOWER) {
fRepower = true;
@ -557,7 +540,7 @@ Computer.prototype.powerOn = function(resume)
* Which means, of course, that if a previous "failsafe" checkpoint already exists, something bad
* may have happened the last time around.
*/
this.stateFailSafe = new State(this, Computer.APPVERSION, Computer.STATE_FAILSAFE);
this.stateFailSafe = new State(this, PCX86.APPVERSION, Computer.STATE_FAILSAFE);
if (this.stateFailSafe.load()) {
this.powerReport(stateComputer);
/*
@ -577,7 +560,7 @@ Computer.prototype.powerOn = function(resume)
this.stateFailSafe.store();
var fValidate = this.resume && !this.fServerState;
if (resume == Computer.RESUME_AUTO || web.confirmUser("Click OK to restore the previous " + Computer.APPNAME + " machine state, or CANCEL to reset the machine.")) {
if (resume == Computer.RESUME_AUTO || web.confirmUser("Click OK to restore the previous " + PCX86.APPNAME + " machine state, or CANCEL to reset the machine.")) {
fRestore = stateComputer.parse();
if (fRestore) {
var sCode = stateComputer.get(UserAPI.RES.CODE);
@ -850,8 +833,8 @@ Computer.prototype.checkPower = function()
*/
Computer.prototype.powerReport = function(stateComputer)
{
if (web.confirmUser("There may be a problem with your " + Computer.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + Computer.APPNAME + " machine state to http://" + SITEHOST + ".")) {
web.sendReport(Computer.APPNAME, Computer.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
if (web.confirmUser("There may be a problem with your " + PCX86.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + PCX86.APPNAME + " machine state to http://" + SITEHOST + ".")) {
web.sendReport(PCX86.APPNAME, PCX86.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
}
};
@ -900,8 +883,8 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
}
this.nPowerChange--;
var stateComputer = new State(this, Computer.APPVERSION);
var stateValidate = new State(this, Computer.APPVERSION, Computer.STATE_VALIDATE);
var stateComputer = new State(this, PCX86.APPVERSION);
var stateValidate = new State(this, PCX86.APPVERSION, Computer.STATE_VALIDATE);
var sTimestamp = usr.getTimestamp();
stateValidate.set(Computer.STATE_TIMESTAMP, sTimestamp);
@ -1257,7 +1240,7 @@ Computer.prototype.getServerStatePath = function()
if (DEBUG && this.messageEnabled()) {
this.printMessage(Computer.STATE_USERID + " for load: " + this.sUserID);
}
sStatePath = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.LOAD + '&' + UserAPI.QUERY.USER + '=' + this.sUserID + '&' + UserAPI.QUERY.STATE + '=' + State.key(this, Computer.APPVERSION);
sStatePath = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.LOAD + '&' + UserAPI.QUERY.USER + '=' + this.sUserID + '&' + UserAPI.QUERY.STATE + '=' + State.key(this, PCX86.APPVERSION);
} else {
if (DEBUG && this.messageEnabled()) {
this.printMessage(Computer.STATE_USERID + " unavailable");
@ -1325,7 +1308,7 @@ Computer.prototype.storeServerState = function(sUserID, sState, fSync)
var dataPost = {};
dataPost[UserAPI.QUERY.REQ] = UserAPI.REQ.STORE;
dataPost[UserAPI.QUERY.USER] = sUserID;
dataPost[UserAPI.QUERY.STATE] = State.key(this, Computer.APPVERSION);
dataPost[UserAPI.QUERY.STATE] = State.key(this, PCX86.APPVERSION);
dataPost[UserAPI.QUERY.DATA] = sState;
var sRequest = web.getHost() + UserAPI.ENDPOINT;
if (!fSync) {
@ -1394,7 +1377,7 @@ Computer.prototype.onReset = function()
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
*/
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + Computer.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + PCX86.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
this.powerOff(fSave, true);
/*
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
@ -1540,16 +1523,16 @@ Computer.init = function()
/*
* In non-COMPILED builds, embedMachine() may have set XMLVERSION.
*/
if (!COMPILED && XMLVERSION) Computer.APPVERSION = XMLVERSION;
if (!COMPILED && PCX86.XMLVERSION) PCX86.APPVERSION = PCX86.XMLVERSION;
var aeMachines = Component.getElementsByClass(document, APPCLASS + "-machine");
var aeMachines = Component.getElementsByClass(document, PCX86.APPCLASS + "-machine");
for (var iMachine = 0; iMachine < aeMachines.length; iMachine++) {
var eMachine = aeMachines[iMachine];
var parmsMachine = Component.getComponentParms(eMachine);
var aeComputers = Component.getElementsByClass(eMachine, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(eMachine, PCX86.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
@ -1571,7 +1554,7 @@ Computer.init = function()
* but "reset" now provides a way to force the machine to start from scratch again, so "erase"
* may be redundant now.
*/
Component.bindComponentControls(computer, eComputer, APPCLASS);
Component.bindComponentControls(computer, eComputer, PCX86.APPCLASS);
/*
* Power on the computer, giving every component the opportunity to reset or restore itself.
@ -1592,7 +1575,7 @@ Computer.init = function()
*/
Computer.show = function()
{
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, PCX86.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);
@ -1641,7 +1624,7 @@ Computer.show = function()
*/
Computer.exit = function()
{
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, PCX86.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -8219,12 +8218,12 @@ if (DEBUGGER) {
*/
Debugger.init = function()
{
var aeDbg = Component.getElementsByClass(document, APPCLASS, "debugger");
var aeDbg = Component.getElementsByClass(document, PCX86.APPCLASS, "debugger");
for (var iDbg = 0; iDbg < aeDbg.length; iDbg++) {
var eDbg = aeDbg[iDbg];
var parmsDbg = Component.getComponentParms(eDbg);
var dbg = new Debugger(parmsDbg);
Component.bindComponentControls(dbg, eDbg, APPCLASS);
Component.bindComponentControls(dbg, eDbg, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -148,19 +147,46 @@ var DESKPRO386 = I386;
*/
var PAGEBLOCKS = I386;
/*
* Combine all the shared globals and machine-specific globals into one machine-specific global object,
* which all machine components should start using; eg: "if (PCX86.DEBUG) ..." instead of "if (DEBUG) ...".
*/
var PCX86 = {
APPCLASS: APPCLASS,
APPNAME: APPNAME,
APPVERSION: APPVERSION, // shared
BACKTRACK: BACKTRACK,
BUGS_8086: BUGS_8086,
BYTEARRAYS: BYTEARRAYS,
COMPILED: COMPILED, // shared
DEBUG: DEBUG, // shared
DEBUGGER: DEBUGGER,
DESKPRO386: DESKPRO386,
I386: I386,
MAXDEBUG: MAXDEBUG, // shared
PAGEBLOCKS: PAGEBLOCKS,
PREFETCH: PREFETCH,
PRIVATE: PRIVATE, // shared
TYPEDARRAYS: TYPEDARRAYS,
SITEHOST: SITEHOST, // shared
SYMBOLS: SYMBOLS,
XMLVERSION: XMLVERSION // shared
}
if (NODE) {
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.PREFETCH = PREFETCH;
global.BYTEARRAYS = BYTEARRAYS;
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.PREFETCH = PREFETCH;
global.BYTEARRAYS = BYTEARRAYS;
global.TYPEDARRAYS = TYPEDARRAYS;
global.BACKTRACK = BACKTRACK;
global.SYMBOLS = SYMBOLS;
global.BUGS_8086 = BUGS_8086;
global.I386 = I386;
global.DESKPRO386 = DESKPRO386;
global.PAGEBLOCKS = PAGEBLOCKS;
global.BACKTRACK = BACKTRACK;
global.SYMBOLS = SYMBOLS;
global.BUGS_8086 = BUGS_8086;
global.I386 = I386;
global.DESKPRO386 = DESKPRO386;
global.PAGEBLOCKS = PAGEBLOCKS;
global.PCX86 = PCX86;
/*
* TODO: When we're "required" by Node, should we return anything via module.exports?
*/

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
/*

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -2723,12 +2722,12 @@ FDC.aPortOutput = {
* any associated HTML controls to the new component.
*/
FDC.init = function() {
var aeFDC = Component.getElementsByClass(document, APPCLASS, "fdc");
var aeFDC = Component.getElementsByClass(document, PCX86.APPCLASS, "fdc");
for (var iFDC = 0; iFDC < aeFDC.length; iFDC++) {
var eFDC = aeFDC[iFDC];
var parmsFDC = Component.getComponentParms(eFDC);
var fdc = new FDC(parmsFDC);
Component.bindComponentControls(fdc, eFDC, APPCLASS);
Component.bindComponentControls(fdc, eFDC, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -3043,12 +3042,12 @@ HDC.aATCPortOutput = {
*/
HDC.init = function()
{
var aeHDC = Component.getElementsByClass(document, APPCLASS, "hdc");
var aeHDC = Component.getElementsByClass(document, PCX86.APPCLASS, "hdc");
for (var iHDC = 0; iHDC < aeHDC.length; iHDC++) {
var eHDC = aeHDC[iHDC];
var parmsHDC = Component.getComponentParms(eHDC);
var hdc = new HDC(parmsHDC);
Component.bindComponentControls(hdc, eHDC, APPCLASS);
Component.bindComponentControls(hdc, eHDC, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -2552,12 +2551,12 @@ Keyboard.prototype.keySimulate = function(simCode, fDown)
*/
Keyboard.init = function()
{
var aeKbd = Component.getElementsByClass(document, APPCLASS, "keyboard");
var aeKbd = Component.getElementsByClass(document, PCX86.APPCLASS, "keyboard");
for (var iKbd = 0; iKbd < aeKbd.length; iKbd++) {
var eKbd = aeKbd[iKbd];
var parmsKbd = Component.getComponentParms(eKbd);
var kbd = new Keyboard(parmsKbd);
Component.bindComponentControls(kbd, eKbd, APPCLASS);
Component.bindComponentControls(kbd, eKbd, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -720,12 +719,12 @@ Mouse.prototype.notifyMCR = function(bMCR)
*/
Mouse.init = function()
{
var aeMouse = Component.getElementsByClass(document, APPCLASS, "mouse");
var aeMouse = Component.getElementsByClass(document, PCX86.APPCLASS, "mouse");
for (var iMouse = 0; iMouse < aeMouse.length; iMouse++) {
var eMouse = aeMouse[iMouse];
var parmsMouse = Component.getComponentParms(eMouse);
var mouse = new Mouse(parmsMouse);
Component.bindComponentControls(mouse, eMouse, APPCLASS);
Component.bindComponentControls(mouse, eMouse, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -972,7 +971,7 @@ Panel.prototype.centerText = function(sText)
Panel.init = function()
{
var fReady = false;
var aePanels = Component.getElementsByClass(document, APPCLASS, "panel");
var aePanels = Component.getElementsByClass(document, PCX86.APPCLASS, "panel");
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
var ePanel = aePanels[iPanel];
var parmsPanel = Component.getComponentParms(ePanel);
@ -981,7 +980,7 @@ Panel.init = function()
fReady = true;
panel = new Panel(parmsPanel);
}
Component.bindComponentControls(panel, ePanel, APPCLASS);
Component.bindComponentControls(panel, ePanel, PCX86.APPCLASS);
if (fReady) panel.setReady();
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -503,12 +502,12 @@ ParallelPort.aPortOutput = {
*/
ParallelPort.init = function()
{
var aeParallel = Component.getElementsByClass(document, APPCLASS, "parallel");
var aeParallel = Component.getElementsByClass(document, PCX86.APPCLASS, "parallel");
for (var iParallel = 0; iParallel < aeParallel.length; iParallel++) {
var eParallel = aeParallel[iParallel];
var parmsParallel = Component.getComponentParms(eParallel);
var parallel = new ParallelPort(parmsParallel);
Component.bindComponentControls(parallel, eParallel, APPCLASS);
Component.bindComponentControls(parallel, eParallel, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -264,12 +263,12 @@ RAM.prototype.restore = function(data)
*/
RAM.init = function()
{
var aeRAM = Component.getElementsByClass(document, APPCLASS, "ram");
var aeRAM = Component.getElementsByClass(document, PCX86.APPCLASS, "ram");
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new RAM(parmsRAM);
Component.bindComponentControls(ram, eRAM, APPCLASS);
Component.bindComponentControls(ram, eRAM, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -416,13 +415,12 @@ ROM.prototype.cloneROM = function(addr)
*/
ROM.init = function()
{
var sAppClass = APPCLASS;
var aeROM = Component.getElementsByClass(document, sAppClass, "rom");
var aeROM = Component.getElementsByClass(document, PCX86.APPCLASS, "rom");
for (var iROM = 0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new ROM(parmsROM);
Component.bindComponentControls(rom, eROM, APPCLASS);
Component.bindComponentControls(rom, eROM, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -897,12 +896,12 @@ SerialPort.aPortOutput = {
*/
SerialPort.init = function()
{
var aeSerial = Component.getElementsByClass(document, APPCLASS, "serial");
var aeSerial = Component.getElementsByClass(document, PCX86.APPCLASS, "serial");
for (var iSerial = 0; iSerial < aeSerial.length; iSerial++) {
var eSerial = aeSerial[iSerial];
var parmsSerial = Component.getComponentParms(eSerial);
var serial = new SerialPort(parmsSerial);
Component.bindComponentControls(serial, eSerial, APPCLASS);
Component.bindComponentControls(serial, eSerial, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -43,16 +42,20 @@ if (NODE) {
*
* State objects are used by components to save/restore their state.
*
* During a save operation, components add data to a State object via set(),
* and then return the resulting data using data().
* During a save operation, components add data to a State object via set(), and then return
* the resulting data using data().
*
* During a restore operation, the Computer component passes the results of each
* data() call back to the originating component.
* During a restore operation, the Computer component passes the results of each data() call
* back to the originating component.
*
* WARNING: Since State objects are low-level objects that have no UI requirements,
* they do not inherit from the Component class, so you should only use class methods
* of Component, such as Component.assert(), or Debugger methods if the Debugger
* is available.
* WARNING: Since State objects are low-level objects that have no UI requirements, they do not
* inherit from the Component class, so you should only use class methods of Component, such as
* Component.assert(), or Debugger methods if the Debugger is available.
*
* NOTE: 1.01 is the first version to provide limited save/restore support using localStorage.
* From that point on, care must be taken to insure that any new version that's incompatible with
* previous localStorage data be released with a version number that is at least 1 greater,
* since we're tagging the localStorage data with the integer portion of the version string.
*
* @constructor
* @param {Component} component

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -7258,7 +7257,7 @@ Video.aVGAPortOutput = {
*/
Video.init = function()
{
var aeVideo = Component.getElementsByClass(document, APPCLASS, "video");
var aeVideo = Component.getElementsByClass(document, PCX86.APPCLASS, "video");
for (var iVideo = 0; iVideo < aeVideo.length; iVideo++) {
var eVideo = aeVideo[iVideo];
var parmsVideo = Component.getComponentParms(eVideo);
@ -7382,7 +7381,7 @@ Video.init = function()
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
* even the "Refresh" button is just a diagnostic tool, to ensure that the screen contents are up-to-date.
*/
Component.bindComponentControls(video, eVideo, APPCLASS);
Component.bindComponentControls(video, eVideo, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -4398,12 +4397,12 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
*/
X86CPU.init = function()
{
var aeCPUs = Component.getElementsByClass(document, APPCLASS, "cpu");
var aeCPUs = Component.getElementsByClass(document, PCX86.APPCLASS, "cpu");
for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new X86CPU(parmsCPU);
Component.bindComponentControls(cpu, eCPU, APPCLASS);
Component.bindComponentControls(cpu, eCPU, PCX86.APPCLASS);
}
};

View file

@ -6,11 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* FPU instruction description excerpts from the PC Magazine "Programmer's Technical Reference:
* The Processor and Coprocessor," Copyright 1992 by Ziff-Davis Press (ISBN 1-56276-016-5).
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -25,12 +21,15 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*
* FPU instruction description excerpts from the PC Magazine "Programmer's Technical Reference:
* The Processor and Coprocessor," Copyright 1992 by Ziff-Davis Press (ISBN 1-56276-016-5).
*/
"use strict";
@ -3363,12 +3362,12 @@ X86FPU.afnPreserveExceptions = [
*/
X86FPU.init = function()
{
var aeFPUs = Component.getElementsByClass(document, APPCLASS, "fpu");
var aeFPUs = Component.getElementsByClass(document, PCX86.APPCLASS, "fpu");
for (var iFPU = 0; iFPU < aeFPUs.length; iFPU++) {
var eFPU = aeFPUs[iFPU];
var parmsFPU = Component.getComponentParms(eFPU);
var fpu = new X86FPU(parmsFPU);
Component.bindComponentControls(fpu, eFPU, APPCLASS);
Component.bindComponentControls(fpu, eFPU, PCX86.APPCLASS);
}
};

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
/*

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -39,6 +38,10 @@ var APPVERSION = "1.x.x"; // this @define is overridden by the Closure Com
var XMLVERSION = null; // this is set in non-COMPILED builds by embedMachine() if a version number was found in the machine XML
var COPYRIGHT = "Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>";
var LICENSE = "License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>";
/**
* @define {string}
*/
@ -76,11 +79,13 @@ if (NODE) {
global.window = false; // provides an alternative "if (typeof window === 'undefined')" (ie, "if (window) ...")
global.APPVERSION = APPVERSION;
global.XMLVERSION = XMLVERSION;
global.SITEHOST = SITEHOST;
global.COMPILED = COMPILED;
global.DEBUG = DEBUG;
global.MAXDEBUG = MAXDEBUG;
global.NODE = NODE;
global.COPYRIGHT = COPYRIGHT;
global.SITEHOST = SITEHOST;
global.COMPILED = COMPILED;
global.DEBUG = DEBUG;
global.MAXDEBUG = MAXDEBUG;
global.PRIVATE = PRIVATE;
global.NODE = NODE;
/*
* TODO: When we're "required" by Node, should we return anything via module.exports?
*/

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
@ -568,9 +567,16 @@ function embedPC8080(idMachine, sXMLFile, sXSLFile, sParms)
* Prevent the Closure Compiler from renaming functions we want to export,
* by adding them as (named) properties of a global object.
*/
if (APPNAME == "C1Pjs") window['embedC1P'] = embedC1P;
if (APPNAME == "PCx86") window['embedPCx86'] = embedPCx86;
if (APPNAME == "PC8080") window['embedPC8080'] = embedPC8080;
if (APPNAME == "C1Pjs") {
window['embedC1P'] = embedC1P;
}
if (APPNAME == "PCx86") {
window['embedPC'] = embedPCx86; // WARNING: embedPC() deprecated as of v1.23.0
window['embedPCx86'] = embedPCx86;
}
if (APPNAME == "PC8080") {
window['embedPC8080'] = embedPC8080;
}
window['enableEvents'] = web.enablePageEvents;
window['sendEvent'] = web.sendPageEvent;

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";

View file

@ -6,28 +6,27 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
/*

View file

@ -12,8 +12,8 @@
<xsl:variable name="MACHINECLASS">pc</xsl:variable>
<xsl:variable name="CSSCLASS">pcjs</xsl:variable>
<xsl:variable name="APPCLASS">pcjs</xsl:variable>
<xsl:variable name="APPNAME">PCjs</xsl:variable>
<xsl:variable name="APPCLASS">pcx86</xsl:variable>
<xsl:variable name="APPNAME">PCx86</xsl:variable>
<xsl:variable name="APPVERSION">1.x.x</xsl:variable>
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>

View file

@ -229,12 +229,12 @@ to the virtual serial port. And *nc* is included with OS X, whereas *socat* mus
TODO
===
- Fix all *class="pc"* in machine XML files.
- Fix all *class="pc"* in machine XML files
- Fix all paths:
- /apps/pc -> /apps/pcx86
- /devices/pc -> /devices/pcx86
- /disks/pc -> /disks/pcx86
- etc
- Should we rename PCJSCLASS back to APPCLASS? Yes
- Rename PCJSCLASS to APPCLASS
- Remove C1PJSCLASS
- Look for XML files that still refer to /configs

View file

@ -31,7 +31,7 @@
</xsl:template>
<xsl:template name="machine">
<xsl:param name="href">/devices/pc/machine/5150/mda/64kb/machine.xml</xsl:param>
<xsl:param name="href" select="''"/>
<xsl:param name="state" select="''"/>
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="$href"/></xsl:variable>
<xsl:apply-templates select="document($componentFile)/machine">

View file

@ -6,9 +6,9 @@ function na(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0
function oa(a,b,c,d){var e=0,f=null,h=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),h;var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(g.onreadystatechange=function(){4===g.readyState&&(f=g.responseText,200==g.status||!g.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=g.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",k;for(k in b)b.hasOwnProperty(k)&&(l&&(l+="&"),l+=k+"="+encodeURIComponent(b[k]));l=l.replace(/%20/g,"+");g.open("POST",a,!!c);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(l)}else g.open("GET",a,!!c),"bytes"==b&&g.overrideMimeType("text/plain; charset=x-user-defined"),g.send();c||(f=g.responseText,200!=g.status&&(e=g.status||-1),d&&d(a,f,e),h=[f,e]);return h}function pa(){return"http://"+(window?window.location.host:"www.pcjs.org")}
function qa(){return window?window.navigator.userAgent:""}function t(a){window&&window.alert(a)}function ra(a){var b=!1;window&&(b=window.confirm(a));return b}var sa=null;function ta(){if(null==sa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}sa=a}return sa}
function ua(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function va(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function wa(a){if(window){var b=qa();return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function xa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ca(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 Da={init:[],show:[],exit:[]},Ea=!1,Fa=!0;function Ga(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ha(a){Da.init.push(a)}
function Ja(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.")}}function Ka(a){!Fa&&a?(Fa=!0,Ea&&La("init")):Fa=a}function La(a){Da[a]&&Ja(Da[a])}Ga("onload",function(){Ea=!0;Ja(Da.init)});Ga("onpageshow",function(){Ja(Da.show)});Ga(wa("Opera")||wa("iOS")?"onunload":"onbeforeunload",function(){Ja(Da.exit)});
function ua(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function va(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function wa(a){if(window){var b=qa();return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ba(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ca(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 Da={init:[],show:[],exit:[]},Ea=!1,Fa=!0;function Ga(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ia(a){Da.init.push(a)}
function Ja(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.")}}function Ka(a){!Fa&&a?(Fa=!0,Ea&&Oa("init")):Fa=a}function Oa(a){Da[a]&&Ja(Da[a])}Ga("onload",function(){Ea=!0;Ja(Da.init)});Ga("onpageshow",function(){Ja(Da.show)});Ga(wa("Opera")||wa("iOS")?"onunload":"onbeforeunload",function(){Ja(Da.exit)});
function v(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;this.Hb=b.comment;this.Sb=b;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.Ib=this.id.substr(0,b),this.eb=this.id.substr(b+1)):this.eb=this.id;this[a]=c;this.A={Ta:!1,Qa:!1,zb:!1,ka:!1,Sa:!1};this.ub=null;this.A.Sa=!1;this.K={};this.G=null;this.ja=d||0;Pa.push(this)}var Qa=void 0,Ra={};
if(window){Qa||(Qa=window.location.search.substr(1));for(var Sa,Ta=/\+/g,Ua=/([^&=]+)=?([^&]*)/g;Sa=Ua.exec(Qa);)Ra[decodeURIComponent(Sa[1].replace(Ta," "))]=decodeURIComponent(Sa[2].replace(Ta," "))}function Va(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function Wa(a,b){b||(b=v);a.prototype=Va(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}var Pa=[],Xa={};function Ya(a,b,c){Xa[a]&&b&&(Xa[a][b]=c)}function Za(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<Pa.length;b++){var d=Pa[b];a&&d.id.indexOf(a)||c.push(d)}return c}
@ -16,17 +16,17 @@ function $a(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(
function ab(a,b){for(var c=z(b.parentNode,"pc8080-control"),d=0;d<c.length;d++)for(var e=c[d].childNodes,f=0;f<e.length;f++){var h=e[f];if(1===h.nodeType){var g=h.getAttribute("class");if(g)for(var l=g.split(" "),k=0;k<l.length;k++)switch(g=l[k],g){case "pc8080-binding":(g=y(h))&&g.binding&&a.ma(g.type,g.binding,h,g.value),k=l.length}}}}
function z(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ma:function(a,b,c){switch(b){case "clear":return this.K[b]||(this.K[b]=c,c.onclick=function(a){return function(){a.K.print&&(a.K.print.value="")}}(this)),!0;case "print":return this.K[b]||(this.ta=this.K[b]=c,c.value="",this.g=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.oa=function(a,b,c){this.g(a,"notice",c)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.eb+": "+a)},oa:function(a,b){b||t(a)},Ba:function(){return this.A.ka=!0},Aa:function(a,b){b&&(this.A.ka=!1);return!0}};function bb(a,b,c,d,e,f){var h=!0;a.G&&(!0===h?h=0:null==h&&(h=a.ja),cb(a.G,a,b,c,d,e,f,h))}function db(a,b,c){a.G&&(!0===c||gb(a,c|0))&&a.G.message(b,void 0)}
this.oa=function(a,b,c){this.g(a,"notice",c)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.eb+": "+a)},oa:function(a,b){b||t(a)},Ba:function(){return this.A.ka=!0},Aa:function(a,b){b&&(this.A.ka=!1);return!0}};function bb(a,b,c,d,e,f){var h=!0;a.G&&(!0===h?h=0:null==h&&(h=a.ja),cb(a.G,a,b,c,d,e,f,h))}function fb(a,b,c){a.G&&(!0===c||gb(a,c|0))&&a.G.message(b,void 0)}
function gb(a,b){if(a.G){a===a.G?b|=0:b=b||a.ja;var c=a.G.ja&b;return!!b&&c===b||!!(c&a.G.Xb)}return!1}function hb(a,b){if(a.A.zb)return a.A.Qa&&(a.A.Qa=!1),a.A.zb=!1;if(a.A.Sa)return a.g(a.toString()+" error"),!1;a.A.Qa=b;return a.A.Qa}function ib(a,b){a.A.Qa&&(b?a.A.zb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.A.Qa}function C(a){if(!a.A.Sa&&(a.A.Ta=!0,a.A.Ta)){var b=a.ub;a.ub=null;b&&b()}}function jb(a,b){b&&(a.A.Ta?b():a.ub=b);return a.A.Ta}function kb(a,b){a.A.Sa=!0;a.oa(b)}
var lb="undefined"!==typeof ArrayBuffer,mb=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function nb(a){v.call(this,"Panel",a,nb)}Wa(nb);m=nb.prototype;m.ma=function(a,b,c,d){return this.w&&this.w.ma(a,b,c,d)||this.b&&this.b.ma(a,b,c,d)||this.ea&&this.ea.ma(a,b,c,d)||this.G&&this.G.ma(a,b,c,d)?!0:this.parent.ma.call(this,a,b,c,d)};m.Ea=function(a,b,c,d){this.w=a;this.C=b;this.b=c;this.G=d;this.ea=ob(a,"Keyboard")};m.Ba=function(a,b){b||pb();return!0};m.Aa=function(){return!0};m.va=function(){};
function pb(){for(var a=!1,b=z(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f;a:{f=e.id;if(void 0!==f)for(var h=void 0,h=0;h<Pa.length;h++)if(Pa[h].id===f){f=Pa[h];break a}f=null}f||(a=!0,f=new nb(e));ab(f,d);a&&C(f)}}Ha(pb);
function pb(){for(var a=!1,b=z(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f;a:{f=e.id;if(void 0!==f)for(var h=void 0,h=0;h<Pa.length;h++)if(Pa[h].id===f){f=Pa[h];break a}f=null}f||(a=!0,f=new nb(e));ab(f,d);a&&C(f)}}Ia(pb);
function qb(a,b,c){v.call(this,"Bus",a,qb);this.b=b;this.G=c;this.I=a.busWidth||16;this.V=Math.pow(2,this.I);this.B=this.V-1|0;this.fa=16>=this.I?10:20>=this.I?12:24>=this.I?14:15;this.ua=1<<this.fa;this.Y=this.ua>>2;this.C=this.ua-1;this.L=this.V/this.ua|0;this.J=this.L-1;this.w=[];this.u=[];this.F=this.H=!1;this.Z=[];this.ba=[];a=new D;rb(a,this.G);this.T=Array(this.L);for(b=0;b<this.L;b++)this.T[b]=a;C(this)}Wa(qb);m=qb.prototype;m.reset=function(){};m.Ba=function(a,b){b||this.reset();return!0};
function sb(a,b,c,d){for(var e=b,f=c,h=e>>>a.fa;0<f&&h<a.T.length;){var g=a.T[h],l=h*a.ua,k=a.ua-(e-l);k>f&&(k=f);if(g&&g.size){if(g.type==d){if(e+f<=g.D)return g.ob+=g.D-e,g.D=e,!0;if(e>=g.D+g.ob){k=g.size-(e-l);k>f&&(k=f);g.ob=e-g.D+k;e=l+a.ua;f-=k;h++;continue}}return tb(1,e,f)}e=new D(e,k,a.ua,d);rb(e,a.G,g);a.T[h++]=e;e=l+a.ua;f-=k}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+ub[d]+" at "+r(b)),!0):tb(2,b,c)}m.W=function(a){return this.T[(a&this.B)>>>this.fa].ab(a&this.C,a)};
function vb(a,b){return a.T[(b&a.B)>>>a.fa].mb(b&a.C,b)}m.Ia=function(a){var b=a&this.C,c=(a&this.B)>>>this.fa;return b!=this.C?this.T[c].Tb(b,a):this.T[c++].ab(b,a)|this.T[c&this.J].ab(0,a+1)<<8};function wb(a,b){var c=b&a.C,d=(b&a.B)>>>a.fa;return c!=a.C?a.T[d].Eb(c,b):a.T[d++].mb(c,b)|a.T[d&a.J].mb(0,b+1)<<8}m.ha=function(a,b){this.T[(a&this.B)>>>this.fa].cb(a&this.C,b&255,a)};function xb(a,b,c){a.T[(b&a.B)>>>a.fa].pb(b&a.C,c&255,b)}
m.xb=function(a,b){var c=a&this.C,d=(a&this.B)>>>this.fa;c!=this.C?this.T[d].Vb(c,b&65535,a):(this.T[d++].cb(c,b&255,a),this.T[d&this.J].cb(0,b>>8&255,a+1))};function yb(a,b){if(void 0===b)return a.F=!a.F,a.F;void 0===a.w[b]&&(a.w[b]=[null,!1]);a.w[b][1]=!a.w[b][1];return a.w[b][1]}
function zb(a,b,c){for(var d=1,e=0,f=0;0<d;){var h=a.w[b],g=a.Z[b]||1,l=1==g?255:2==g?65535:-1,k=l;void 0!==h?(h[0]&&(k=h[0](b,c),void 0===k?k=l:k&=l),a.G&&a.F!=h[1]&&Ab(a.G,b,k)):a.G&&(cb(a.G,a,b,null,c),a.F&&Ab(a.G,b,k));e|=k<<f;f+=g<<3;b+=g;d-=g}return e}function Bb(a,b){if(void 0===b)return a.H=!a.H,a.H;void 0===a.u[b]&&(a.u[b]=[null,!1]);a.u[b][1]=!a.u[b][1];return a.u[b][1]}
function Cb(a,b,c,d){for(var e=1,f=0;0<e;){var h=a.u[b],g=a.ba[b]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h){if(h[0])h[0](b,l,d);a.G&&a.H!=h[1]&&Db(a.G,b,l)}else a.G&&(cb(a.G,a,b,l,d),a.H&&Db(a.G,b,l));f+=g<<3;b+=g;e-=g}}function tb(a,b,c){t("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Eb;if(lb){var Nb=new ArrayBuffer(2);(new DataView(Nb)).setUint16(0,256,!0);Eb=256===(new Uint16Array(Nb))[0]}else Eb=!1;var Ob=Eb;
function Cb(a,b,c,d){for(var e=1,f=0;0<e;){var h=a.u[b],g=a.ba[b]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h){if(h[0])h[0](b,l,d);a.G&&a.H!=h[1]&&Lb(a.G,b,l)}else a.G&&(cb(a.G,a,b,l,d),a.H&&Lb(a.G,b,l));f+=g<<3;b+=g;e-=g}}function tb(a,b,c){t("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}var Mb;if(lb){var Nb=new ArrayBuffer(2);(new DataView(Nb)).setUint16(0,256,!0);Mb=256===(new Uint16Array(Nb))[0]}else Mb=!1;var Ob=Mb;
function D(a,b,c,d){this.id=Pb+=2;this.b=null;this.D=a;this.ob=b;this.size=c||0;this.type=d||Qb;this.K=d==Rb;rb(this);this.ya=this.Lb=!1;if(c)if(lb)this.F=new ArrayBuffer(c),this.H=new DataView(this.F,0,c),this.C=new Uint8Array(this.F,0,c),this.J=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),Sb(this,Ob?Tb:Ub);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;Sb(this,Vb)}else Sb(this)}var Qb=0,Rb=2,ub=["NONE","RAM","ROM","VID","H/W"],Pb=0;
D.prototype={constructor:D,parent:null,save:function(){var a,b;if(lb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.H.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(lb)for(b=0;b<a.length;b++)this.H.setInt32(b<<2,a[b],!0);else this.b=a;return this.ya=!0}return!1},Ja:function(a,b){b?0===this.u++&&Wb(this,Xb,!1):0===this.w++&&Yb(this,Xb,!1)},L:function(){this.G&&gb(this.G,129)&&this.G.message("attempt to read invalid block %"+q(this.D),!0);
return 255},B:function(a,b){this.G&&gb(this.G,129)&&this.G.message("attempt to write "+r(b)+" to invalid block %"+q(this.D),!0)},V:function(a,b){return this.ab(a++,b++)|this.ab(a,b)<<8},I:function(a,b,c){this.cb(a++,b&255,c++);this.cb(a,b>>8,c)},ea:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ra: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},xa:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<<d)|b<<d;this.ya=!0},Ha:function(a,
@ -36,34 +36,34 @@ function rb(a,b,c){a.G=b;a.w=a.u=0;c&&((a.w=c.w)&&Yb(a,Xb,!1),(a.u=c.u)&&Wb(a,Xb
var ac=[],Vb=[D.prototype.ea,D.prototype.ra,D.prototype.xa,D.prototype.Ha],Xb=[D.prototype.Z,D.prototype.ia,D.prototype.sa,D.prototype.Ga];if(lb)var Ub=[D.prototype.Y,D.prototype.ga,D.prototype.Fa,D.prototype.Ca],Tb=[D.prototype.ba,D.prototype.qa,D.prototype.wa,D.prototype.eb];
function bc(a,b){v.call(this,"CPU",a,bc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.$a=c;this.i.wb=0;this.i.Na=d;this.i.Bb=Math.round(this.i.$a/1E4)/100;this.i.La=this.i.Bb*this.i.Na;this.A.na=!1;this.A.Ab=!1;this.A.Kb=a.autoStart;this.A.Mb=!1;this.A.Ra=!1;this.i.gb=this.i.Xa=0;this.i.hb=a.csStart;this.i.Wa=a.csInterval;this.i.Ya=a.csStop;this.Z=this.Oa.bind(this);C(this)}Wa(bc);var cc=["power","reset"];m=bc.prototype;
m.Ea=function(a,b,c,d){this.w=a;this.C=b;this.G=d;for(b=0;b<cc.length;b++)(c=this.K[cc[b]])&&this.w.ma(null,cc[b],c);this.Fa=(b=ob(a,"Video"))&&Math.max(b.Fa,b.Zb)||60;this.B=ob(a,"ChipSet");a=dc(a,"autoStart");null!=a&&(this.A.Kb="true"==a?!0:"false"==a?!1:!!a);C(this)};m.reset=function(){this.i.wb=0};m.save=function(){return null};m.restore=function(){return!1};
m.Ba=function(a,b){if(!b){if(a&&this.restore){ec(this);if(!this.restore(a))return!1;fc(this)}else this.reset();if(this.G){var c=this.G;c.g("Type ? for help with PC8080 Debugger commands");c.va();if(c.Ha){var d=c.Ha;c.Ha=null;rc(c,d)}}else this.g("No debugger detected")}sc(this);return!0};m.Aa=function(a){return a?this.save():!0};function tc(a){(a.A.Kb||!a.G&&void 0===a.K.run)&&a.Oa(!0)}m.Ob=function(){return 0};
function fc(a){void 0===a.i.hb&&(a.i.hb=0);void 0===a.i.Wa&&(a.i.Wa=-1);void 0===a.i.Ya&&(a.i.Ya=-1);a.A.Ra=0<=a.i.hb&&0<a.i.Wa;a.A.Ra&&(a.i.gb=0,a.i.Xa=a.i.hb-a.I)}function uc(a,b){if(a.A.Ra){var c=!1;a.i.gb=a.i.gb+a.Ob()|0;a.i.Xa-=b;0>=a.i.Xa&&(a.i.Xa+=a.i.Wa,c=!0);0<=a.i.Ya&&a.i.Ya<=vc(a)&&(a.i.Wa=a.i.Ya=-1,fc(a),a.da(),c=!0);c&&a.g(vc(a)+" cycles: checksum="+q(a.i.gb))}}
m.Ba=function(a,b){if(!b){if(a&&this.restore){pc(this);if(!this.restore(a))return!1;qc(this)}else this.reset();if(this.G){var c=this.G;c.g("Type ? for help with PC8080 Debugger commands");c.va();if(c.Ha){var d=c.Ha;c.Ha=null;rc(c,d)}}else this.g("No debugger detected")}sc(this);return!0};m.Aa=function(a){return a?this.save():!0};function tc(a){(a.A.Kb||!a.G&&void 0===a.K.run)&&a.Oa(!0)}m.Ob=function(){return 0};
function qc(a){void 0===a.i.hb&&(a.i.hb=0);void 0===a.i.Wa&&(a.i.Wa=-1);void 0===a.i.Ya&&(a.i.Ya=-1);a.A.Ra=0<=a.i.hb&&0<a.i.Wa;a.A.Ra&&(a.i.gb=0,a.i.Xa=a.i.hb-a.I)}function uc(a,b){if(a.A.Ra){var c=!1;a.i.gb=a.i.gb+a.Ob()|0;a.i.Xa-=b;0>=a.i.Xa&&(a.i.Xa+=a.i.Wa,c=!0);0<=a.i.Ya&&a.i.Ya<=vc(a)&&(a.i.Wa=a.i.Ya=-1,qc(a),a.da(),c=!0);c&&a.g(vc(a)+" cycles: checksum="+q(a.i.gb))}}
m.ma=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.K[b]=c;a=!0;break;case "run":this.K[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.A.ka)a=!0;else{var b=null,c,g=Za(a.id);for(c=0;c<g.length&&(b=g[c],b===a||b.A.Ta);c++);if(c==g.length)for(c=0;c<g.length&&(b=g[c],b===a||b.A.ka);c++);c==g.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.A.Ta?"powered yet":"ready yet"+(b.ub?" (waiting for notification)":""))+".");a=!1}a&&(d.A.na?d.da(!0):d.Oa(!0))};a=
!0;break;case "speed":this.K[b]=c;a=!0;break;case "setSpeed":this.K[b]=c,c.onclick=function(){wc(d,d.i.Na<<1,!0)},c.textContent=this.i.La.toFixed(2)+"Mhz",a=!0}return a};function xc(a,b,c){a.I+=b;c&&(a.F=a.b=0)}
function yc(a,b){var c=30;c<a.Fa&&(c=a.Fa);2>c&&(c=2);var d=1;b&&1<a.i.Na&&a.i.Ka&&(d=a.i.Ka/a.i.Bb);a.i.Pb=Math.round(1E3/30);a.i.hc=Math.floor(a.i.$a/c*d);a.i.Cb=Math.floor(a.i.$a/30*d);a.i.Rb=Math.floor(a.i.$a/a.Fa*d);a.i.Qb=Math.floor(a.i.$a/2*d);b||(a.i.Za=a.i.Cb,a.i.jb=a.i.Rb,a.i.ib=a.i.Qb);a.i.Db=0}function vc(a){return a.I+a.H+a.F-a.b}function ec(a){a.i.Ka=0;a.I=a.H=a.F=a.b=0;fc(a);wc(a,1)}
function yc(a,b){var c=30;c<a.Fa&&(c=a.Fa);2>c&&(c=2);var d=1;b&&1<a.i.Na&&a.i.Ka&&(d=a.i.Ka/a.i.Bb);a.i.Pb=Math.round(1E3/30);a.i.hc=Math.floor(a.i.$a/c*d);a.i.Cb=Math.floor(a.i.$a/30*d);a.i.Rb=Math.floor(a.i.$a/a.Fa*d);a.i.Qb=Math.floor(a.i.$a/2*d);b||(a.i.Za=a.i.Cb,a.i.jb=a.i.Rb,a.i.ib=a.i.Qb);a.i.Db=0}function vc(a){return a.I+a.H+a.F-a.b}function pc(a){a.i.Ka=0;a.I=a.H=a.F=a.b=0;qc(a);wc(a,1)}
function wc(a,b,c){var d=!1;if(void 0!==b){.8>a.i.Ka/a.i.La?b=1:d=!0;a.i.Na=b;b=a.i.Bb*a.i.Na;if(a.i.La!=b){a.i.La=b;b=a.i.La.toFixed(2)+"Mhz";var e=a.K.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.w&&a.w.nb()}xc(a,a.H);a.H=0;a.i.Va=ka();a.i.Ma=0;yc(a);return d}
m.Oa=function(a){if(hb(this,!0)){if(!this.A.na){wc(this);this.w&&this.w.start(this.i.Va,vc(this));this.A.na=!0;this.A.Ab=!0;this.B&&this.B.start();var b=this.K.run;b&&(b.textContent="Halt");this.w&&(this.w.va(!0),a&&this.w.nb(!0))}this.i.Db>=this.i.$a&&yc(this,!0);this.i.kb=0;this.i.vb=ka();this.i.Ma&&(a=this.i.vb-this.i.Ma,a>this.i.Pb&&(this.i.Va+=a,this.i.Va>this.i.vb&&(this.i.Va=this.i.vb)));try{do{this.bb(this.A.Ra?1:this.i.hc);var c=this.F-this.b;this.H+=c;this.i.kb+=c;xc(this,0,!0);uc(this,
c);this.i.jb-=c;0>=this.i.jb&&(this.i.jb+=this.i.Rb,this.w&&zc(this.w,this.i.wb++),this.i.wb>this.Fa&&(this.i.wb=0));this.i.ib-=c;0>=this.i.ib&&(this.i.ib+=this.i.Qb,this.w&&this.w.va());this.i.Za-=c;if(0>=this.i.Za){this.i.Za+=this.i.Cb;break}}while(this.A.na)}catch(e){this.da();sc(this);this.w&&this.w.stop(ka(),vc(this));hb(this,!1);kb(this,e.stack||e.message);return}c=setTimeout;a=this.Z;this.i.Ma=ka();b=this.i.Pb;this.i.kb&&(b=Math.round(b*this.i.kb/this.i.Cb));var b=b-(this.i.Ma-this.i.vb),d=
this.i.Ma-this.i.Va;d&&(this.i.Ka=Math.round(this.H/(10*d))/100,864E5<=d&&(this.I=0,wc(this)));if(0>b||this.i.Ka<this.i.La)b=0;this.i.Db+=this.i.kb;this.i.Ma+=b;c(a,b)}else sc(this),this.w&&this.w.stop(ka(),vc(this))};m.bb=function(){return 0};m.da=function(a){ib(this,!0);this.F-=this.b;this.b=0;xc(this,this.H);this.H=0;if(this.A.na){this.A.na=!1;this.B&&this.B.stop();var b=this.K.run;b&&(b.textContent="Run")}this.A.tb=a};function sc(a,b){a.w&&(zc(a.w,-1),a.w.va(b))}
function Ac(a){this.Ua=+a.model||8080;bc.call(this,a,1E6);this.L=Bc;ec(this);this.A.tb=this.A.Yb=!1;this.Y=0;this.J=[];this.V=0;Cc(this)}Wa(Ac,bc);function Dc(a,b){a.J.push(b)}m=Ac.prototype;m.reset=function(){this.A.na&&this.da();Cc(this);ec(this);this.A.Sa=!1;this.parent.reset.call(this)};function Cc(a){a.j=0;a.N=0;a.O=0;a.P=0;a.R=0;a.S=0;a.U=0;a.ca=0;E(a,a.V);Ec(a,0);a.u=0}function Fc(a,b){a.V=b;E(a,b)}
function Ac(a){this.Ua=+a.model||8080;bc.call(this,a,1E6);this.L=Bc;pc(this);this.A.tb=this.A.Yb=!1;this.Y=0;this.J=[];this.V=0;Cc(this)}Wa(Ac,bc);function Dc(a,b){a.J.push(b)}m=Ac.prototype;m.reset=function(){this.A.na&&this.da();Cc(this);pc(this);this.A.Sa=!1;this.parent.reset.call(this)};function Cc(a){a.j=0;a.N=0;a.O=0;a.P=0;a.R=0;a.S=0;a.U=0;a.ca=0;E(a,a.V);Ec(a,0);a.u=0}function Fc(a,b){a.V=b;E(a,b)}
m.Ob=function(){var a=this.j+this.N+this.O+this.P+this.R+this.S+this.U|0;return a=a+this.ca+this.M+Gc(this)|0};
m.save=function(){var a=new Hc(this);F(a,0,[this.j,this.N,this.O,this.P,this.R,this.S,this.U,this.ca,this.M,Gc(this)]);F(a,1,[this.u,this.I,this.i.Na]);for(var b=this.C,c=0,d=[],e=0;e<b.L;e++){var f=b.T[e];if(f.ya||f.Lb){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,l=0,k=[];g<f.length;){for(var n=f[g],p=g+1;p<f.length&&f[p]===n;)p++;k[l++]=p-g;k[l++]=n;g=p}if(k.length<f.length){f=k;break a}}d[h]=f}}F(a,2,d);return a.data()};
m.restore=function(a){var b=a[0];this.j=b[0];this.N=b[1];this.O=b[2];this.P=b[3];this.R=b[4];this.S=b[5];this.U=b[6];this.ca=b[7]&65535;E(this,b[8]);Ec(this,b[9]);b=a[1];this.u=b[0];this.I=b[1];wc(this,b[3]);a:{b=this.C;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.Y){for(var f=0,h=Array(b.Y),g=0;g<e.length-1;)for(var l=e[g++],k=e[g++];l--;)h[f++]=k;e=h}f=b.T[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
m.ma=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.K[b]=c;this.Y++;d=!0;break;default:d=this.parent.ma.call(this,a,b,c)}return d};function Ic(a){return a.N<<8|a.O}function Jc(a,b){a.N=b>>8&255;a.O=b&255}function Kc(a){return a.P<<8|a.R}function Lc(a,b){a.P=b>>8&255;a.R=b&255}function H(a){return a.S<<8|a.U}
function Mc(a,b){a.S=b>>8&255;a.U=b&255}function E(a,b){a.M=b&65535}function I(a){return a.X&256?1:0}function Nc(a,b){a.X=a.X&255|b}function Oc(a){return mb[a.aa&255]?4:0}function Pc(a){return(a.aa^a.la)&16?16:0}function Qc(a){return a.X&255?0:64}function Rc(a){return a.aa&128?128:0}function Gc(a){return a.pa&-214|Rc(a)|Qc(a)|Pc(a)|Oc(a)|I(a)}function Ec(a,b){a.X=a.aa=a.la=0;b&1&&(a.X|=256);b&4||(a.aa|=1);b&16&&(a.la|=16);b&64||(a.X|=255);b&128&&(a.aa^=192);a.pa=a.pa&-726|b&512|2}
function Sc(a,b){a.la=a.j^b;return a.aa=(a.X=a.j+b)&255}function Tc(a,b){a.la=a.j^b;return a.aa=(a.X=a.j+b+(a.X&256?1:0))&255}function Uc(a,b){a.X=a.aa=a.la=a.j&b;(a.j|b)&8&&(a.la^=16);return a.X}function Vc(a,b){a.la=b^255;b=a.aa=b+255&255;a.X=a.X&-256|b;return b}function Wc(a,b){a.la=b;b=a.aa=b+1&255;a.X=a.X&-256|b;return b}function Xc(a,b){return a.aa=a.X=a.la=a.j|b}function J(a,b){b^=255;a.la=a.j^b;return a.aa=(a.X=a.j+b+1^256)&255}
function Sc(a,b){a.la=a.j^b;return a.aa=(a.X=a.j+b)&255}function Tc(a,b){a.la=a.j^b;return a.aa=(a.X=a.j+b+(a.X&256?1:0))&255}function Uc(a,b){a.X=a.aa=a.la=a.j&b;(a.j|b)&8&&(a.la^=16);return a.X}function Vc(a,b){a.la=b^255;b=a.aa=b+255&255;a.X=a.X&-256|b;return b}function md(a,b){a.la=b;b=a.aa=b+1&255;a.X=a.X&-256|b;return b}function nd(a,b){return a.aa=a.X=a.la=a.j|b}function J(a,b){b^=255;a.la=a.j^b;return a.aa=(a.X=a.j+b+1^256)&255}
function od(a,b){b^=255;a.la=a.j^b;return a.aa=(a.X=a.j+b+(a.X&256?0:1)^256)&255}function pd(a,b){return a.aa=a.X=a.la=a.j^b}m.W=function(a){return this.C.W(a)};m.ha=function(a,b){this.C.ha(a,b)};function L(a){var b=a.W(a.M);E(a,a.M+1);return b}function N(a){var b=a.C.Ia(a.M);E(a,a.M+2);return b}function O(a){var b=a.C.Ia(a.ca);a.ca=a.ca+2&65535;return b}function Q(a,b){a.ca=a.ca-2&65535;a.C.xb(a.ca,b)}
function R(a,b,c,d){d=d||2;a.K[b]&&(void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.da()),c=!a.A.na||a.A.Mb?q(c,d):"--------".substr(0,d),a.K[b].textContent!=c&&(a.K[b].textContent=c))}
m.va=function(a){this.Y&&(a||!this.A.na||this.A.Mb)&&(R(this,"A",this.j),R(this,"B",this.N),R(this,"C",this.O),R(this,"BC",Ic(this),4),R(this,"D",this.P),R(this,"E",this.R),R(this,"DE",Kc(this),4),R(this,"H",this.S),R(this,"L",this.U),R(this,"HL",H(this),4),R(this,"SP",this.ca,4),R(this,"PC",this.M,4),a=Gc(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.K.speed)a.textContent=
this.A.na&&this.i.Ka?this.i.Ka.toFixed(2)+"Mhz":"Stopped"};
m.bb=function(a){this.A.tb=!0;var b=this.A.Yb=this.G&&qd(this.G),c=a?this.A.Ab?0:1:-1;this.A.Ab=!1;this.F=this.b=a;do{if(this.u){var d;this.u&8&&this.pa&512?(d=199|(this.u&7)<<3,this.u&=-16,this.pa&=-513,this.L[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(rd(this.G,this.M,c)){this.da();break}c=1}this.L[L(this)].call(this)}while(0<this.b);return this.A.tb?this.F-this.b:void 0===this.A.tb?0:-1};
Ha(function(){for(var a=z(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Ac(d);ab(d,c)}});function sd(){this.b-=4}function td(){E(this,N(this));this.b-=10}function ud(){E(this,O(this));this.b-=10}function vd(){var a=N(this);Q(this,this.M);E(this,a);this.b-=17}
var Bc=[sd,function(){Jc(this,N(this));this.b-=10},function(){this.ha(Ic(this),this.j);this.b-=7},function(){Jc(this,Ic(this)+1);this.b-=5},function(){this.N=Wc(this,this.N);this.b-=5},function(){this.N=Vc(this,this.N);this.b-=5},function(){this.N=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|a>>8;Nc(this,a&256);this.b-=4},sd,function(){var a;Mc(this,a=H(this)+Ic(this));Nc(this,a>>8&256);this.b-=10},function(){this.j=this.W(Ic(this));this.b-=7},function(){Jc(this,Ic(this)-1);this.b-=
5},function(){this.O=Wc(this,this.O);this.b-=5},function(){this.O=Vc(this,this.O);this.b-=5},function(){this.O=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Nc(this,a);this.b-=4},sd,function(){Lc(this,N(this));this.b-=10},function(){this.ha(Kc(this),this.j);this.b-=7},function(){Lc(this,Kc(this)+1);this.b-=5},function(){this.P=Wc(this,this.P);this.b-=5},function(){this.P=Vc(this,this.P);this.b-=5},function(){this.P=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|
I(this);Nc(this,a&256);this.b-=4},sd,function(){var a;Mc(this,a=H(this)+Kc(this));Nc(this,a>>8&256);this.b-=10},function(){this.j=this.W(Kc(this));this.b-=7},function(){Lc(this,Kc(this)-1);this.b-=5},function(){this.R=Wc(this,this.R);this.b-=5},function(){this.R=Vc(this,this.R);this.b-=5},function(){this.R=L(this);this.b-=7},function(){var a=this.j<<8;this.j=(I(this)<<8|this.j)>>1;Nc(this,a&256);this.b-=4},sd,function(){Mc(this,N(this));this.b-=10},function(){var a=N(this);this.C.xb(a,H(this));this.b-=
16},function(){Mc(this,H(this)+1);this.b-=5},function(){this.S=Wc(this,this.S);this.b-=5},function(){this.S=Vc(this,this.S);this.b-=5},function(){this.S=L(this);this.b-=7},function(){var a=0,b=I(this);if(Pc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Sc(this,a);Nc(this,b?256:0);this.b-=4},sd,function(){var a;Mc(this,a=H(this)+H(this));Nc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.C.Ia(a);Mc(this,a);this.b-=16},function(){Mc(this,H(this)-1);this.b-=5},function(){this.U=
Wc(this,this.U);this.b-=5},function(){this.U=Vc(this,this.U);this.b-=5},function(){this.U=L(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},sd,function(){this.ca=N(this)&65535;this.b-=10},function(){this.ha(N(this),this.j);this.b-=13},function(){this.ca=this.ca+1&65535;this.b-=5},function(){var a=H(this);this.ha(a,Wc(this,this.W(a)));this.b-=10},function(){var a=H(this);this.ha(a,Vc(this,this.W(a)));this.b-=10},function(){this.ha(H(this),L(this));this.b-=10},function(){this.X|=256;this.b-=
4},sd,function(){var a;Mc(this,a=H(this)+this.ca);Nc(this,a>>8&256);this.b-=10},function(){this.j=this.W(N(this));this.b-=13},function(){this.ca=this.ca-1&65535;this.b-=5},function(){this.j=Wc(this,this.j);this.b-=5},function(){this.j=Vc(this,this.j);this.b-=5},function(){this.j=L(this);this.b-=7},function(){Nc(this,I(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.N=this.O;this.b-=5},function(){this.N=this.P;this.b-=5},function(){this.N=this.R;this.b-=5},function(){this.N=this.S;this.b-=
Ia(function(){for(var a=z(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Ac(d);ab(d,c)}});function sd(){this.b-=4}function td(){E(this,N(this));this.b-=10}function ud(){E(this,O(this));this.b-=10}function vd(){var a=N(this);Q(this,this.M);E(this,a);this.b-=17}
var Bc=[sd,function(){Jc(this,N(this));this.b-=10},function(){this.ha(Ic(this),this.j);this.b-=7},function(){Jc(this,Ic(this)+1);this.b-=5},function(){this.N=md(this,this.N);this.b-=5},function(){this.N=Vc(this,this.N);this.b-=5},function(){this.N=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|a>>8;Nc(this,a&256);this.b-=4},sd,function(){var a;Mc(this,a=H(this)+Ic(this));Nc(this,a>>8&256);this.b-=10},function(){this.j=this.W(Ic(this));this.b-=7},function(){Jc(this,Ic(this)-1);this.b-=
5},function(){this.O=md(this,this.O);this.b-=5},function(){this.O=Vc(this,this.O);this.b-=5},function(){this.O=L(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Nc(this,a);this.b-=4},sd,function(){Lc(this,N(this));this.b-=10},function(){this.ha(Kc(this),this.j);this.b-=7},function(){Lc(this,Kc(this)+1);this.b-=5},function(){this.P=md(this,this.P);this.b-=5},function(){this.P=Vc(this,this.P);this.b-=5},function(){this.P=L(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255|
I(this);Nc(this,a&256);this.b-=4},sd,function(){var a;Mc(this,a=H(this)+Kc(this));Nc(this,a>>8&256);this.b-=10},function(){this.j=this.W(Kc(this));this.b-=7},function(){Lc(this,Kc(this)-1);this.b-=5},function(){this.R=md(this,this.R);this.b-=5},function(){this.R=Vc(this,this.R);this.b-=5},function(){this.R=L(this);this.b-=7},function(){var a=this.j<<8;this.j=(I(this)<<8|this.j)>>1;Nc(this,a&256);this.b-=4},sd,function(){Mc(this,N(this));this.b-=10},function(){var a=N(this);this.C.xb(a,H(this));this.b-=
16},function(){Mc(this,H(this)+1);this.b-=5},function(){this.S=md(this,this.S);this.b-=5},function(){this.S=Vc(this,this.S);this.b-=5},function(){this.S=L(this);this.b-=7},function(){var a=0,b=I(this);if(Pc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Sc(this,a);Nc(this,b?256:0);this.b-=4},sd,function(){var a;Mc(this,a=H(this)+H(this));Nc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.C.Ia(a);Mc(this,a);this.b-=16},function(){Mc(this,H(this)-1);this.b-=5},function(){this.U=
md(this,this.U);this.b-=5},function(){this.U=Vc(this,this.U);this.b-=5},function(){this.U=L(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},sd,function(){this.ca=N(this)&65535;this.b-=10},function(){this.ha(N(this),this.j);this.b-=13},function(){this.ca=this.ca+1&65535;this.b-=5},function(){var a=H(this);this.ha(a,md(this,this.W(a)));this.b-=10},function(){var a=H(this);this.ha(a,Vc(this,this.W(a)));this.b-=10},function(){this.ha(H(this),L(this));this.b-=10},function(){this.X|=256;this.b-=
4},sd,function(){var a;Mc(this,a=H(this)+this.ca);Nc(this,a>>8&256);this.b-=10},function(){this.j=this.W(N(this));this.b-=13},function(){this.ca=this.ca-1&65535;this.b-=5},function(){this.j=md(this,this.j);this.b-=5},function(){this.j=Vc(this,this.j);this.b-=5},function(){this.j=L(this);this.b-=7},function(){Nc(this,I(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.N=this.O;this.b-=5},function(){this.N=this.P;this.b-=5},function(){this.N=this.R;this.b-=5},function(){this.N=this.S;this.b-=
5},function(){this.N=this.U;this.b-=5},function(){this.N=this.W(H(this));this.b-=7},function(){this.N=this.j;this.b-=5},function(){this.O=this.N;this.b-=5},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.U;this.b-=5},function(){this.O=this.W(H(this));this.b-=7},function(){this.O=this.j;this.b-=5},function(){this.P=this.N;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.U;this.b-=5},function(){this.P=this.W(H(this));this.b-=7},function(){this.P=this.j;this.b-=5},function(){this.R=this.N;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.U;this.b-=5},function(){this.R=this.W(H(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.N;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.U;this.b-=5},function(){this.S=this.W(H(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.U=this.N;this.b-=5},function(){this.U=this.O;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.b-=5},function(){this.U=this.W(H(this));this.b-=7},function(){this.U=this.j;
@ -73,30 +73,30 @@ function(){this.ha(H(this),this.j);this.b-=7},function(){this.j=this.N;this.b-=5
this.b-=7},function(){this.j=Tc(this,this.j);this.b-=4},function(){this.j=J(this,this.N);this.b-=4},function(){this.j=J(this,this.O);this.b-=4},function(){this.j=J(this,this.P);this.b-=4},function(){this.j=J(this,this.R);this.b-=4},function(){this.j=J(this,this.S);this.b-=4},function(){this.j=J(this,this.U);this.b-=4},function(){this.j=J(this,this.W(H(this)));this.b-=7},function(){this.j=J(this,this.j);this.b-=4},function(){this.j=od(this,this.N);this.b-=4},function(){this.j=od(this,this.O);this.b-=
4},function(){this.j=od(this,this.P);this.b-=4},function(){this.j=od(this,this.R);this.b-=4},function(){this.j=od(this,this.S);this.b-=4},function(){this.j=od(this,this.U);this.b-=4},function(){this.j=od(this,this.W(H(this)));this.b-=7},function(){this.j=od(this,this.j);this.b-=4},function(){this.j=Uc(this,this.N);this.b-=4},function(){this.j=Uc(this,this.O);this.b-=4},function(){this.j=Uc(this,this.P);this.b-=4},function(){this.j=Uc(this,this.R);this.b-=4},function(){this.j=Uc(this,this.S);this.b-=
4},function(){this.j=Uc(this,this.U);this.b-=4},function(){this.j=Uc(this,this.W(H(this)));this.b-=7},function(){this.j=Uc(this,this.j);this.b-=4},function(){this.j=pd(this,this.N);this.b-=4},function(){this.j=pd(this,this.O);this.b-=4},function(){this.j=pd(this,this.P);this.b-=4},function(){this.j=pd(this,this.R);this.b-=4},function(){this.j=pd(this,this.S);this.b-=4},function(){this.j=pd(this,this.U);this.b-=4},function(){this.j=pd(this,this.W(H(this)));this.b-=7},function(){this.j=pd(this,this.j);
this.b-=4},function(){this.j=Xc(this,this.N);this.b-=4},function(){this.j=Xc(this,this.O);this.b-=4},function(){this.j=Xc(this,this.P);this.b-=4},function(){this.j=Xc(this,this.R);this.b-=4},function(){this.j=Xc(this,this.S);this.b-=4},function(){this.j=Xc(this,this.U);this.b-=4},function(){this.j=Xc(this,this.W(H(this)));this.b-=7},function(){this.j=Xc(this,this.j);this.b-=4},function(){J(this,this.N);this.b-=4},function(){J(this,this.O);this.b-=4},function(){J(this,this.P);this.b-=4},function(){J(this,
this.b-=4},function(){this.j=nd(this,this.N);this.b-=4},function(){this.j=nd(this,this.O);this.b-=4},function(){this.j=nd(this,this.P);this.b-=4},function(){this.j=nd(this,this.R);this.b-=4},function(){this.j=nd(this,this.S);this.b-=4},function(){this.j=nd(this,this.U);this.b-=4},function(){this.j=nd(this,this.W(H(this)));this.b-=7},function(){this.j=nd(this,this.j);this.b-=4},function(){J(this,this.N);this.b-=4},function(){J(this,this.O);this.b-=4},function(){J(this,this.P);this.b-=4},function(){J(this,
this.R);this.b-=4},function(){J(this,this.S);this.b-=4},function(){J(this,this.U);this.b-=4},function(){J(this,this.W(H(this)));this.b-=7},function(){J(this,this.j);this.b-=4},function(){Qc(this)||(E(this,O(this)),this.b-=6);this.b-=5},function(){Jc(this,O(this));this.b-=10},function(){var a=N(this);Qc(this)||E(this,a);this.b-=10},td,function(){var a=N(this);Qc(this)||(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},function(){Q(this,Ic(this));this.b-=11},function(){this.j=Sc(this,L(this));this.b-=
7},function(){Q(this,this.M);E(this,0);this.b-=11},function(){Qc(this)&&(E(this,O(this)),this.b-=6);this.b-=5},ud,function(){var a=N(this);Qc(this)&&E(this,a);this.b-=10},td,function(){var a=N(this);Qc(this)&&(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},vd,function(){this.j=Tc(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,8);this.b-=11},function(){I(this)||(E(this,O(this)),this.b-=6);this.b-=5},function(){Lc(this,O(this));this.b-=10},function(){var a=N(this);I(this)||E(this,a);this.b-=
10},function(){var a=L(this);Cb(this.C,a,this.j,this.M+-2&65535);this.b-=10},function(){var a=N(this);I(this)||(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},function(){Q(this,Kc(this));this.b-=11},function(){this.j=J(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,16);this.b-=11},function(){I(this)&&(E(this,O(this)),this.b-=6);this.b-=5},ud,function(){var a=N(this);I(this)&&E(this,a);this.b-=10},function(){var a=L(this);this.j=zb(this.C,a,this.M+-2&65535)&255;this.b-=10},function(){var a=
N(this);I(this)&&(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},vd,function(){this.j=od(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,24);this.b-=11},function(){Oc(this)||(E(this,O(this)),this.b-=6);this.b-=5},function(){Mc(this,O(this));this.b-=10},function(){var a=N(this);Oc(this)||E(this,a);this.b-=10},function(){var a=O(this);Q(this,H(this));Mc(this,a);this.b-=18},function(){var a=N(this);Oc(this)||(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},function(){Q(this,H(this));this.b-=
11},function(){this.j=Uc(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,32);this.b-=11},function(){Oc(this)&&(E(this,O(this)),this.b-=6);this.b-=5},function(){E(this,H(this));this.b-=5},function(){var a=N(this);Oc(this)&&E(this,a);this.b-=10},function(){var a=H(this);Mc(this,Kc(this));Lc(this,a);this.b-=5},function(){var a=N(this);Oc(this)&&(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},vd,function(){this.j=pd(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,40);this.b-=11},
function(){Rc(this)||(E(this,O(this)),this.b-=6);this.b-=5},function(){var a=O(this);Ec(this,a&255|this.pa&-256);this.j=a>>8;this.b-=10},function(){var a=N(this);Rc(this)||E(this,a);this.b-=10},function(){this.pa&=-513;this.b-=4},function(){var a=N(this);Rc(this)||(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},function(){Q(this,Gc(this)&255|this.j<<8);this.b-=11},function(){this.j=Xc(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,48);this.b-=11},function(){Rc(this)&&(E(this,O(this)),
function(){Rc(this)||(E(this,O(this)),this.b-=6);this.b-=5},function(){var a=O(this);Ec(this,a&255|this.pa&-256);this.j=a>>8;this.b-=10},function(){var a=N(this);Rc(this)||E(this,a);this.b-=10},function(){this.pa&=-513;this.b-=4},function(){var a=N(this);Rc(this)||(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},function(){Q(this,Gc(this)&255|this.j<<8);this.b-=11},function(){this.j=nd(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,48);this.b-=11},function(){Rc(this)&&(E(this,O(this)),
this.b-=6);this.b-=5},function(){this.ca=H(this)&65535;this.b-=5},function(){var a=N(this);Rc(this)&&E(this,a);this.b-=10},function(){this.pa|=512;this.b-=4},function(){var a=N(this);Rc(this)&&(Q(this,this.M),E(this,a),this.b-=6);this.b-=11},vd,function(){J(this,L(this));this.b-=7},function(){Q(this,this.M);E(this,56);this.b-=11}];
function S(a){v.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!wd[b]&&t("Unrecognized ChipSet model: "+b);this.Ua=wd[b]||xd;a.sound&&(this.V=null,window&&(this.V=window.AudioContext||window.webkitAudioContext),this.V&&new this.V);C(this)}Wa(S);var xd=1978.1,wd={SI1978:xd};m=S.prototype;m.ma=function(){return!1};
m.Ea=function(a,b,c,d){this.C=b;this.b=c;this.G=d;this.w=a;if(this.Ua==xd){var e;a=yd;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.w[g]?t("Input port "+r(g)+" already registered"):c.w[g]=[h,!1]}var l;e=zd;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.u[d]?t("Output port "+r(d)+" already registered"):f.u[d]=[c,!1]}};
m.Ba=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.Aa=function(a){return a?this.save():!0};m.reset=function(){this.J=14;this.u=8;this.H=this.I=this.F=this.B=this.L=0};m.save=function(){var a=new Hc(this);this.Ua==xd&&F(a,0,[this.J,this.u,this.L,this.B,this.F,this.H,this.I]);return a.data()};m.restore=function(a){a=a[0];this.Ua==xd&&(this.J=a[0],this.u=a[1],this.L=a[2],this.B=a[3],this.F=a[4],this.H=a[5],this.I=a[6]);return!0};m.start=function(){};m.stop=function(){};
function Ad(a,b,c){a.u&=~b;c&&(a.u|=b)}m.cc=function(a,b){var c=this.J;bb(this,a,null,b,"STATUS0",c);return c};m.dc=function(a,b){var c=this.u;bb(this,a,null,b,"STATUS1",c);return c};m.ec=function(a,b){var c=this.L;bb(this,a,null,b,"STATUS2",c);return c};m.bc=function(a,b){var c=this.B>>8-this.F&255;bb(this,a,null,b,"SHIFT.RESULT",c);return c};m.ic=function(a,b,c){bb(this,a,b,c,"SHIFT.COUNT",null);this.F=b};m.kc=function(a,b,c){bb(this,a,b,c,"SOUND1",null);this.H=b};
m.jc=function(a,b,c){bb(this,a,b,c,"SHIFT.DATA",null);this.B=b<<8|this.B>>8};m.lc=function(a,b,c){bb(this,a,b,c,"SOUND2",null);this.I=b};m.mc=function(a,b,c){bb(this,a,b,c,"WATCHDOG",null)};var yd={0:S.prototype.cc,1:S.prototype.dc,2:S.prototype.ec,3:S.prototype.bc},zd={2:S.prototype.ic,3:S.prototype.kc,4:S.prototype.jc,5:S.prototype.lc,6:S.prototype.mc};Ha(function(){for(var a=z(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new S(d);ab(d,c)}});
m.jc=function(a,b,c){bb(this,a,b,c,"SHIFT.DATA",null);this.B=b<<8|this.B>>8};m.lc=function(a,b,c){bb(this,a,b,c,"SOUND2",null);this.I=b};m.mc=function(a,b,c){bb(this,a,b,c,"WATCHDOG",null)};var yd={0:S.prototype.cc,1:S.prototype.dc,2:S.prototype.ec,3:S.prototype.bc},zd={2:S.prototype.ic,3:S.prototype.kc,4:S.prototype.jc,5:S.prototype.lc,6:S.prototype.mc};Ia(function(){for(var a=z(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new S(d);ab(d,c)}});
function Bd(a){v.call(this,"ROM",a,Bd);this.w=null;this.H=a.addr;this.u=a.size;this.I=a.writable;this.B=a.alias;this.F=a.file;this.J=ba(this.F);if(this.F){a=this.F;var b=ca(this.J);"json"!=b&&"hex"!=b&&(a=pa()+"/api/v1/dump?file="+this.F+"&format=bytes&decimal=true");var c=this;oa(a,null,!0,function(a,b,f){Cd(c,a,b,f)})}}Wa(Bd);var Dd=[0,5];Bd.prototype.Ea=function(a,b,c,d){this.C=b;this.b=c;this.G=d;Ed(this)};
Bd.prototype.Ba=function(){if(this.Da){if(this.G){var a=this.G,b=this.id,c=this.H,d=this.u,e=this.Da,f=[],h;for(h in e){var g=e[h];"number"==typeof g&&(e[h]=g={o:g});var l=g.o,k=g.a;if(void 0!==l){var n=f,l=[l>>>0,h],p=ja(n,l,a.qb);0>p&&n.splice(-(p+1),0,l)}k&&(g.a=k.replace(/''/g,'"'))}a.I.push({nc:b,D:c,gc:d,Da:e,Gb:f})}delete this.Da}return!0};Bd.prototype.Aa=function(){return!0};
function Cd(a,b,c,d){if(d)a.oa("Unable to load system ROM (error "+d+": "+b+")");else{Ya(a.Ib,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<h.length;c++)a.w[d++]=h[c]&255,a.w[d++]=h[c]>>8&255,a.w[d++]=h[c]>>16&255,a.w[d++]=h[c]>>24&255;else a.w=e;a.Da=e.symbols;if(!a.w.length){t("Empty ROM: "+b);return}if(1==a.w.length){t(a.w[0]);return}}catch(g){a.oa("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
" ").replace(/ +$/,"").split(" "),a.w=Array(b.length),e=0;e<b.length;e++)a.w[e]=aa(b[e],16);Ed(a)}}
function Ed(a){if(!jb(a))if(!a.F)C(a);else if(a.w&&a.C){a.u||(a.u=a.w.length);if(a.w.length!=a.u)kb(a,"ROM size (0x"+q(a.w.length)+") does not match specified size ("+("0x"+q(a.u))+")");else if(Fd(a,a.H)){var b=[];"number"==typeof a.B?b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(var c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.C,h=d.u,g=[],l=d.H>>>f.fa;0<h&&l<f.T.length;)g.push(f.T[l++]),h-=f.ua;f=d.C;d=d.u;h=0;for(e>>>=f.fa;0<d&&e<f.T.length;){l=g[h++];if(!l)break;f.T[e++]=l;d-=f.ua}}delete a.w}C(a)}}
function Fd(a,b){if(sb(a.C,b,a.u,a.I?1:Rb)){var c;for(c=0;c<a.w.length;c++)xb(a.C,b+c,a.w[c]);if(a.I&&256==b){for(c=0;c<Dd.length;c++)xb(a.C,Dd[c],118);Dc(a.b,function(a){return function(b){if(0<=Dd.indexOf(b)){var c=!1,h=a.b,g=a.G;if(5==b)switch(c=!0,h.O){case 2:Gd(a,String.fromCharCode(h.R));break;case 9:for(var l=Kc(h),k="",n=255;n--;){var p=a.b.W(l++);if(36==p)break;k+=String.fromCharCode(p)}Gd(a,k);break;default:c=!1}c?ud.call(h):g&&(a.g("\nCP/M vector "+r(b)),E(h,b),g.da());b=!0}else b=!1;return b}}(a));
Fc(a.b,b)}return!0}return!1}function Gd(a,b){b=b.replace(/\r/g,"");a.ta&&(a.ta.value+=b,a.ta.scrollTop=a.ta.scrollHeight)}Ha(function(){for(var a=z(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Bd(d);ab(d,c)}});function Hd(a){v.call(this,"RAM",a,Hd);this.B=a.addr;this.u=a.size;this.w=!1}Wa(Hd);m=Hd.prototype;m.Ea=function(a,b,c,d){this.C=b;this.b=c;this.G=d;C(this)};m.Ba=function(a,b){b||this.reset();return!0};m.Aa=function(a){return a?this.save():!0};
m.reset=function(){!this.w&&this.u&&sb(this.C,this.B,this.u,1)&&(this.w=!0);this.w||t("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};Ha(function(){for(var a=z(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Hd(d);ab(d,c)}});function Id(a){v.call(this,"Keyboard",a,Id,65536);this.reset();C(this)}Wa(Id);var Jd={"1p":49,"2p":50,coin:51,left:37,right:39,fire:32},Kd={65:37,68:39,76:32};Id.prototype.reset=function(){this.b={}};
Fc(a.b,b)}return!0}return!1}function Gd(a,b){b=b.replace(/\r/g,"");a.ta&&(a.ta.value+=b,a.ta.scrollTop=a.ta.scrollHeight)}Ia(function(){for(var a=z(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Bd(d);ab(d,c)}});function Hd(a){v.call(this,"RAM",a,Hd);this.B=a.addr;this.u=a.size;this.w=!1}Wa(Hd);m=Hd.prototype;m.Ea=function(a,b,c,d){this.C=b;this.b=c;this.G=d;C(this)};m.Ba=function(a,b){b||this.reset();return!0};m.Aa=function(a){return a?this.save():!0};
m.reset=function(){!this.w&&this.u&&sb(this.C,this.B,this.u,1)&&(this.w=!0);this.w||t("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};Ia(function(){for(var a=z(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Hd(d);ab(d,c)}});function Id(a){v.call(this,"Keyboard",a,Id,65536);this.reset();C(this)}Wa(Id);var Jd={"1p":49,"2p":50,coin:51,left:37,right:39,fire:32},Kd={65:37,68:39,76:32};Id.prototype.reset=function(){this.b={}};
Id.prototype.ma=function(a,b,c){var d=this;a=a+"-"+b;if(void 0===this.K[a])switch(b){case "kbd":return c.onkeydown=function(a){return Ld(d,a,!0)},c.onkeyup=function(a){return Ld(d,a,!1)},!0;default:if(void 0!==Jd[b])return this.K[a]=c,a=function(a,b){return function(){Md(a,b,!0)}}(this,b),b=function(a,b){return function(){Md(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};
Id.prototype.Ea=function(a,b,c,d){this.G=d;this.B=ob(a,"ChipSet")};function Ld(a,b,c){var d=!0,e;a:{e=b.keyCode;e=Kd[e]||e;for(var f in Jd)if(Jd[f]===e){e=f;break a}e=null}e&&(d=Md(a,e,c));d||b.preventDefault();return d}function Md(a,b,c){a.b[b]=c;if(a.B)switch(b){case "1p":Ad(a.B,4,c);break;case "2p":Ad(a.B,2,c);break;case "coin":Ad(a.B,1,c);break;case "left":Ad(a.B,32,c);break;case "right":Ad(a.B,64,c);break;case "fire":Ad(a.B,16,c)}return!1}
Ha(function(){for(var a=z(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Id(d);ab(d,c)}});
Ia(function(){for(var a=z(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Id(d);ab(d,c)}});
function Nd(a,b,c,d,e){var f=this;this.Ca=wa("Gecko/");var h=["","moz","ms","webkit"];v.call(this,"Video",a,Nd,262144);this.qa=a.screenWidth;this.Z=a.screenHeight;this.wa=a.bufferAddr;this.J=a.bufferCols;this.Y=a.bufferRows;this.ra=a.bufferBits||1;this.rb=a.bufferLeft||0;if(this.B=a.bufferRotate)this.B=this.B%360,0<this.B&&(this.B-=360),-90!=this.B&&(this.oa("unsupported buffer rotation: "+this.B),this.B=0);this.Zb=a.interruptRate;this.Fa=a.refreshRate||60;this.H=b;this.I=c;this.ba=(this.sb=d)||b||
null;b=a.smoothing;(c=Ra.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)if(d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.I[d]){this.I[d]=b;break}if(this.F=a.screenRotate)this.F=this.F%360,0<this.F&&(this.F-=360),-90!=this.F?(this.oa("unsupported screen rotation: "+this.F),this.F=0):(this.I.translate(0,this.Z),this.I.rotate(this.F*Math.PI/180),this.I.scale(this.Z/this.qa,this.qa/this.Z));this.ga=1<<this.ra;this.V=Array(this.ga+2);this.V[0]=[0,0,0,255];this.V[1]=
[255,255,255,255];this.V[this.ga+0]=[255,255,0,255];this.V[this.ga+1]=[0,255,0,255];a=this.J;b=this.Y;this.B&&(a=this.Y,b=this.J);this.Ga=this.I.createImageData(a,b);this.L=document.createElement("canvas");this.L.width=a;this.L.height=b;this.qb=this.L.getContext("2d");if(this.u=e)if(this.u.Pa=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.u.Pa){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Od(f,
@ -104,8 +104,8 @@ document.fullscreenElement||document.msFullscreenElement||document.mozFullScreen
Nd.prototype.Ea=function(a,b,c,d){this.w=a;this.C=b;this.b=c;this.G=d;this.sa=(this.J*this.ra>>3)*this.Y;sb(this.C,this.wa,this.sa,3)&&(this.Ha=this.sa>>1,this.fb=16/this.ra|0,this.xa=!1,void 0===this.ia||this.ia.length!=this.Ha)&&(this.ia=Array(this.Ha));(this.ea=ob(a,"Keyboard"))&&this.H&&this.ea.ma(this.sb?"textarea":"canvas","kbd",this.ba);C(this)};
Nd.prototype.ma=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.K[b]=c,this.u&&this.u.Pa?c.onclick=function(){d.Pa()}:c.parentNode.removeChild(c),!0}return!1};
Nd.prototype.Pa=function(){var a=!1;if(this.u){if(this.u.Pa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.qa/this.Z;b>c&&(a=Math.round(c/b*100)+"%")}this.Ca?(this.H.style.width=a,this.H.style.width=a,this.H.style.display="block",this.H.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.Pa();a=!0}this.ba&&this.ba.focus()}return a};
function Od(a,b){!b&&a.u&&(a.Ca?a.H.style.width=a.H.style.height="":a.u.style.width=a.u.style.height="");db(a,"notifyFullScreen("+b+")",!0)}
Ha(function(){for(var a=z(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=y(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; 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<=qa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
function Od(a,b){!b&&a.u&&(a.Ca?a.H.style.width=a.H.style.height="":a.u.style.width=a.u.style.height="");fb(a,"notifyFullScreen("+b+")",!0)}
Ia(function(){for(var a=z(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=y(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; 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<=qa().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&&(Ga("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");wa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Nd(d,e,h,f,c);ab(d,c)}});
function Pd(a){v.call(this,"Debugger",a,Pd);this.style=Qd;this.ea=this.Ca=this.L=0;this.Y=T();this.rb=T();this.F=-1;this.B=[];this.ia=!1;this.ga=T();this.I=[];this.qa={};this.u=this.Z=this.H=[];Rd(this);this.wa=0;Sd(this);this.Ga=[];Td(this,a.messages);this.Ha=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return rc(b,a)}):void 0===global.$&&(global.$=function(a){return rc(b,a)})}Wa(Pd);
var Ud={"?":"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",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"},Qd=8080,Vd="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(" "),
@ -133,14 +133,14 @@ m.bb=function(a,b,c){if(!me(this))return!1;this.L=0;a||qd(this)&&rd(this,this.b.
function me(a){var b;if(b=a.b&&jb(a.b))b=a.b,b.A.ka?b=!0:(b.g(b.toString()+" not powered"),b=!1);b&&!ib(a.b)?(a=a.b,a.A.Sa?(a.g(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}m.Ba=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};m.Aa=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};m.reset=function(a){Sd(this);this.ea=this.Ca=0;this.xa=null;this.L=0;this.Y=T(this.b.M);this.A.na=!1;pe(this);a||this.va()};
m.save=function(){var a=new Hc(this);F(a,0,be(this.Y));F(a,1,be(this.ga));F(a,2,[this.B,this.ia,this.ja]);F(a,3,this.I);return a.data()};m.restore=function(a){var b=0;void 0!==a[2]&&(this.Y=ce(a[b++]),this.ga=ce(a[b++]),this.B=a[b][0],"string"==typeof this.B&&(this.B=[this.B]),this.ia=a[b][1],this.ja|=a[b][2]);a[3]&&(this.I=a[3]);return!0};m.start=function(a,b){this.ba||this.g("running");this.A.na=!0;this.$b=a;this.ac=b};
m.stop=function(a,b){if(this.A.na){this.A.na=!1;this.L=b-this.ac;if(!this.ba){var c="stopped";if(this.L){var d=a-this.$b,e=0<d?Math.round(1E3*this.L/d):0,c=c+" (";qd(this)&&(c+=this.ea+" opcodes, ",this.Ca-=this.ea,this.ea=0);c+=this.L+" cycles, "+d+" ms, "+e+" hz)"}else gb(this,-2147483648)&&(c+=" (use the 't' command to execute blocked faults)");this.g(c)}this.va(!0);this.nb();pe(this,this.b.M)}};function qd(a){return 1<a.u.length||!!a.wa}
function rd(a,b,c){var d=a.b;if(0<c&&(a.wa&&!--a.wa||Zb(a,b,1,a.u)))return!0;0<=c&&a.J.length&&(a.ea++,b=vb(a.C,b),null!=b&&(a.J[b][1]++,b=a.V[a.ra],b.D=d.M,b.za=!1,++a.ra==a.V.length&&(a.ra=0)));return!1}function Ab(a,b,c){a.g("break on input from port "+r(b)+": "+q(c));a.da(!0)}function Db(a,b,c){a.g("break on output to port "+r(b)+": "+q(c));a.da(!0)}
function rd(a,b,c){var d=a.b;if(0<c&&(a.wa&&!--a.wa||Zb(a,b,1,a.u)))return!0;0<=c&&a.J.length&&(a.ea++,b=vb(a.C,b),null!=b&&(a.J[b][1]++,b=a.V[a.ra],b.D=d.M,b.za=!1,++a.ra==a.V.length&&(a.ra=0)));return!1}function Ab(a,b,c){a.g("break on input from port "+r(b)+": "+q(c));a.da(!0)}function Lb(a,b,c){a.g("break on output to port "+r(b)+": "+q(c));a.da(!0)}
function Rd(a){var b,c;a.u=["bp"];if(void 0!==a.Z)for(b=1;b<a.Z.length;b++){c=a.Z[b];var d=a.C;$b(d.T[V(c)>>>d.fa],!1)}a.Z=["br"];if(void 0!==a.H)for(b=1;b<a.H.length;b++)c=a.H[b],d=a.C,$b(d.T[V(c)>>>d.fa],!0);a.H=["bw"];a.sb=0}m.Ja=function(a,b,c){var d=!0;c||qe(this,a,b,!1,!0);if(a!=this.u){var e=V(b);if(-1===e)this.g("invalid address: "+X(b.D)),d=!1;else{var f=this.C;f.T[e>>>f.fa].Ja(e&f.C,a==this.H)}}d&&(a.push(b),c?b.za=!0:(re(this,a,a.length-1,"set"),Sd(this)));return d};
function qe(a,b,c,d,e){var f=!1;c=V(c);for(var h=1;h<b.length;h++){var g=b[h];if(c==V(g)&&(!d||g.za)){f=!0;g.za||e||re(a,b,h,"cleared");b.splice(h,1);b!=a.u&&(d=a.C,$b(d.T[c>>>d.fa],b==a.H));g.za||Sd(a);break}}return f}function se(a,b){for(var c=1;c<b.length;c++)re(a,b,c);return b.length-1}function re(a,b,c,d){c=b[c];a.g(b[0]+" "+X(c.D)+(d?" "+d:c.Ub?' "'+c.Ub+'"':""))}
function pe(a,b){if(void 0!==b)Zb(a,b,1,a.u,!0),a.ba=0;else for(var c=1;c<a.u.length;c++){var d=a.u[c];if(d.za){if(!qe(a,a.u,d,!0))break;c=0}}}
function Zb(a,b,c,d,e){var f=!1;if(!a.sb++)for(var h=1;!f&&h<d.length;h++){var g=d[h];if(!e||g.za)for(var l=V(g),k=0;k<c;k++)if(b+k==l){var n,f=!0;g.za&&(qe(a,d,g,!0),e=!0);if(n=g.Wb){for(var f=!1,p=0;p<n.length;p++)if(!te(a,n[p],!0)){if(n[p].indexOf("if")){f=!0;break}for(var x=p+1;x<n.length&&n[x].indexOf("else");x++)p++;if(x==n.length){f=!0;break}}a.b.A.na||(f=!0)}if(f){e||re(a,d,h,"hit");break}}}a.sb--;return f}
function ue(a,b,c,d){for(var e=T(b.D),f=a.W(b,1),h=a.fb[f],g="",l=(8086!=a.style?Vd:Wd)[h[0]],k=h.length-1,n=0,p,x=1;x<=k;x++){var B="";p=h[x];if(void 0!==p&&!(p&16384&&a.style==Qd)){var u=p&240;if(u){var ma=p&15;ma?n=ma:p|=n;p&61440||(p|=1==x?8192:4096);if(u&32)a:{var B=a,u=p,ma=b,w=" ";switch(u&15){case 1:w=q(B.W(ma,1),2);break;case 2:w=q(B.W(ma,1)<<24>>24,4);break;case 3:w=q(B.Ia(ma,2),4);break;default:B="imm("+r(u)+")";break a}8086==B.style&&u&64?w="["+w+"]":u&16||(w=(B.style==Qd?"$":"0x")+w);
function Se(a,b,c,d){for(var e=T(b.D),f=a.W(b,1),h=a.fb[f],g="",l=(8086!=a.style?Vd:Wd)[h[0]],k=h.length-1,n=0,p,x=1;x<=k;x++){var B="";p=h[x];if(void 0!==p&&!(p&16384&&a.style==Qd)){var u=p&240;if(u){var ma=p&15;ma?n=ma:p|=n;p&61440||(p|=1==x?8192:4096);if(u&32)a:{var B=a,u=p,ma=b,w=" ";switch(u&15){case 1:w=q(B.W(ma,1),2);break;case 2:w=q(B.W(ma,1)<<24>>24,4);break;case 3:w=q(B.Ia(ma,2),4);break;default:B="imm("+r(u)+")";break a}8086==B.style&&u&64?w="["+w+"]":u&16||(w=(B.style==Qd?"$":"0x")+w);
B=w}else u&16?(B=(p&3840)>>8,u=Xd[B],8086==a.style&&p&64&&(6==B&&(u="HL"),u="["+u+"]"),B=u):u&128&&(B=(f>>3&7).toString());if(!B||!B.length){g="INVALID";break}0<g.length&&(g+=",");g+=B||"???"}}}f="";h=X(e.D)+" ";if(-1!==e.D&&-1!==b.D){do if(f+=q(a.W(e,1),2),null==e.D)break;while(e.D!=b.D)}h+=ha(f,10);h=h+(p&32768?"*":" ")+ha(l,7);g&&(h+=" "+g);c&&(h=ha(h,40)+";"+c,h=a.b.A.Ra?h+("cycles="+vc(a.b).toString()+" cs="+q(a.b.i.gb)):h+(null!=d?"="+d.toString():""));return h}
function ve(a,b){var c;switch(b){case "IF":c=a.b.pa&512;break;case "SF":c=Rc(a.b);break;case "ZF":c=Qc(a.b);break;case "AF":c=Pc(a.b);break;case "PF":c=Oc(a.b);break;case "CF":c=I(a.b);break;default:c=0}return b.charAt(0)+(c?"1":"0")+" "}function Ue(a,b){return Xd[b]+"="+je(a,b)+" "}function Ve(a){return Ue(a,7)+Ue(a,8)+Ue(a,9)+Ue(a,10)+Ue(a,11)+ve(a,"IF")+ve(a,"SF")+ve(a,"ZF")+ve(a,"AF")+ve(a,"PF")+ve(a,"CF")}
function Te(a,b){var c;switch(b){case "IF":c=a.b.pa&512;break;case "SF":c=Rc(a.b);break;case "ZF":c=Qc(a.b);break;case "AF":c=Pc(a.b);break;case "PF":c=Oc(a.b);break;case "CF":c=I(a.b);break;default:c=0}return b.charAt(0)+(c?"1":"0")+" "}function Ue(a,b){return Xd[b]+"="+je(a,b)+" "}function Ve(a){return Ue(a,7)+Ue(a,8)+Ue(a,9)+Ue(a,10)+Ue(a,11)+Te(a,"IF")+Te(a,"SF")+Te(a,"ZF")+Te(a,"AF")+Te(a,"PF")+Te(a,"CF")}
var We={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Xe(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<<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;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?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}
@ -152,63 +152,63 @@ function af(a,b,c){var d=[],e=V(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],h=
function cf(a,b){if("?"==b)a.g("frequency commands:"),a.g("\tclear\tclear all frequency counts");else{var c,d=0;if(a.J)if("clear"==b){for(c=0;c<a.J.length;c++)a.J[c]=[c,0];a.g("frequency data cleared");d++}else if(void 0!==b)a.g("unknown frequency command: "+b),d++;else{var e=a.J.slice();e.sort(function(a,b){return b[1]-a[1]});var f=8086!=a.style?Vd:Wd;for(c=0;c<e.length;c++){var h=e[c][0],g=e[c][1];g&&(a.g((f[a.fb[h][0]]+" ").substr(0,5)+" ("+("0x"+q(h,2))+"): "+g+" times"),d++)}}d||a.g("no frequency data available")}}
function df(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return $e(a)||a.g("no variables"),!0;if(!c[2])return $e(a,c[1]);if(!c[3])return delete a.qa[c[1]],!0;var d=ee(a,c[3]);return void 0!==d?(a.qa[c[1]]=d,!0):!1}a.g("invalid assignment:"+b);return!1}
function ef(a,b,c){var d=null;if(b=W(a,b,!0)){var e=af(a,b,!0);if(e.length){var f,h;e[0]&&(h="",(f=b.D-e[1])&&(h=" + "+r(f)),f=e[0]+" ("+X(e[1])+")"+h,c&&a.g(f),d=f);4<e.length&&e[4]&&(h="",(f=e[5]-b.D)&&(h=" - "+r(f)),f=e[4]+" ("+X(e[5])+")"+h,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
function ff(a,b){switch(b[1]){case "8080":a.style=Qd;break;case "8086":a.style=8086;break;case "cs":var c;void 0!==b[3]&&(c=+b[3]);switch(b[2]){case "int":a.b.i.Wa=c;break;case "start":a.b.i.hb=c;break;case "stop":a.b.i.Ya=c;break;default:a.g("unknown cs option");return}void 0!==c&&fc(a.b);a.g("checksums "+(a.b.A.Ra?"enabled":"disabled"));return;case "sp":void 0!==b[2]&&(wc(a.b,+b[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.i.La.toFixed(2)+"Mhz")+
function ff(a,b){switch(b[1]){case "8080":a.style=Qd;break;case "8086":a.style=8086;break;case "cs":var c;void 0!==b[3]&&(c=+b[3]);switch(b[2]){case "int":a.b.i.Wa=c;break;case "start":a.b.i.hb=c;break;case "stop":a.b.i.Ya=c;break;default:a.g("unknown cs option");return}void 0!==c&&qc(a.b);a.g("checksums "+(a.b.A.Ra?"enabled":"disabled"));return;case "sp":void 0!==b[2]&&(wc(a.b,+b[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.i.La.toFixed(2)+"Mhz")+
" ("+a.b.i.Na+"x)");return;case "?":a.g("debugger options:");a.g("\t8080\t\tselect 8080-style mnemonics");a.g("\t8086\t\tselect 8086-style mnemonics");a.g("\tcs int #\tset checksum cycle interval to #");a.g("\tcs start #\tset checksum cycle start count to #");a.g("\tcs stop #\tset checksum cycle stop count to #");a.g("\tsp #\t\tset speed multiplier to #");break;default:if(b[1]){a.g("unknown option: "+b[1]);return}}a.g(a.style+"-style mnemonics enabled")}
function ne(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(null!=b&&1<b.length){var e=b[1],f=null,h=e.indexOf("=");if(0<h)f=e.substr(h+1),e=e.substr(0,h);else if(2<b.length)f=b[2];else{a.g("missing value for "+b[1]);return}var h=!1,g=ee(a,f);if(void 0!==g)switch(h=!0,e.toUpperCase()){case "A":d.j=g&255;break;case "B":d.N=g&255;break;case "BC":d.N=g>>8&255;case "C":d.O=g&255;break;case "D":d.P=
g&255;break;case "DE":d.P=g>>8&255;case "E":d.R=g&255;break;case "H":d.S=g&255;break;case "HL":d.S=g>>8&255;case "L":d.U=g&255;break;case "SP":d.ca=g&65535;break;case "PC":E(d,g);a.Y=T(d.M);break;case "PS":Ec(d,g);break;case "PSW":Ec(d,g&255|d.pa&-256);d.j=g>>8;break;case "CF":d.X=g?d.X|256:d.X&255;break;case "PF":g?Oc(d)||(d.aa^=1):Oc(d)&&(d.aa^=1);break;case "AF":d.la=g?~d.aa&16|d.la&-17:d.aa&16|d.la&-17;break;case "ZF":d.X=g?d.X&-256:d.X|255;break;case "SF":g?Rc(d)||(d.aa^=192):Rc(d)&&(d.aa^=192);
break;case "IF":d.pa=g?d.pa|512:d.pa&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}sc(d);a.g("updated registers:")}a.g(Ve(a));c&&(a.Y=T(d.M),oe(a,X(a.Y.D)))}}function gf(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(le(a,c[2])):ee(a,b,!0)}function hf(a,b,c){var d="t"!=b;c=Ye(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);xa(c,function(){return hb(a,!0)&&a.bb(e,d,!1)},function(){sc(a.b);hb(a,!1)})}
function oe(a,b,c,d){if(b=W(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=W(a,c,!0);if(!d||d.D<b.D)return;e=d.D-b.D;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ib(a,!1)||a.ba?a.L:null;var h=null!=f?"cycles":null,g=af(a,b),l=b.D;if(g[0]&&d&&(!c&&d||0>g[0].indexOf("+"))){var k=g[0]+":";g[2]&&(k+=" "+g[2]);a.g(k)}g[3]&&(h=g[3],f=null);f=ue(a,b,h,f);a.g(f);a.Y=b;e-=b.D-l;c++}}}
break;case "IF":d.pa=g?d.pa|512:d.pa&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}sc(d);a.g("updated registers:")}a.g(Ve(a));c&&(a.Y=T(d.M),oe(a,X(a.Y.D)))}}function gf(a,b){b=ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(le(a,c[2])):ee(a,b,!0)}function hf(a,b,c){var d="t"!=b;c=Ye(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ba(c,function(){return hb(a,!0)&&a.bb(e,d,!1)},function(){sc(a.b);hb(a,!1)})}
function oe(a,b,c,d){if(b=W(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=W(a,c,!0);if(!d||d.D<b.D)return;e=d.D-b.D;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ib(a,!1)||a.ba?a.L:null;var h=null!=f?"cycles":null,g=af(a,b),l=b.D;if(g[0]&&d&&(!c&&d||0>g[0].indexOf("+"))){var k=g[0]+":";g[2]&&(k+=" "+g[2]);a.g(k)}g[3]&&(h=g[3],f=null);f=Se(a,b,h,f);a.g(f);a.Y=b;e-=b.D-l;c++}}}
function ge(a,b,c,d){if(c)if(b){0>a.F&&a.B.length&&(a.F=0);if(0>a.F||b!=a.B[a.F])a.B.splice(0,0,b),a.F=0;a.F--}else a.ia?b="end":b=a.B[a.F+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(ia(b.substring(c,f))),c=f+1}}return a}
function te(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.ia&&(a.g("ended assemble at "+X(a.ga.D)),a.Y=a.ga,a.ia=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(jb(a)&&0<b.length){a.ia&&(b="a "+X(a.ga.D)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var h=f[0],g=h.charAt(0),l=1;l<h.length;l++){var k=h.charAt(l);if("?"==g||"r"==g||"a">k||"z"<k){f[0]=h.substr(l);f.unshift(h.substr(0,l));break}}switch(f[0].charAt(0)){case "a":var n=W(a,f[1],!0);if(n)if(a.ga=
n,void 0===f[2])a.g("begin assemble at "+X(n.D)),a.ia=!0,sc(a.b);else{var p;a.g("not supported yet");p=[];if(p.length){for(var x=0;x<p.length;x++)a.ha(n,p[x],1);a.g(ue(a,a.ga))}}break;case "b":a:{var B=f[0],u=f[1],ma=b;if("?"==u)a.g("breakpoint commands:"),a.g("\tbi [p]\ttoggle break on input port [p]"),a.g("\tbo [p]\ttoggle break on output port [p]"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),
n,void 0===f[2])a.g("begin assemble at "+X(n.D)),a.ia=!0,sc(a.b);else{var p;a.g("not supported yet");p=[];if(p.length){for(var x=0;x<p.length;x++)a.ha(n,p[x],1);a.g(Se(a,a.ga))}}break;case "b":a:{var B=f[0],u=f[1],ma=b;if("?"==u)a.g("breakpoint commands:"),a.g("\tbi [p]\ttoggle break on input port [p]"),a.g("\tbo [p]\ttoggle break on output port [p]"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),
a.g("\tbc [a]\tclear breakpoint at addr [a]"),a.g("\tbl\tlist all breakpoints"),a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var w=B.charAt(1);if("l"==w){var ea=0,ea=ea+se(a,a.u),ea=ea+se(a,a.Z);(ea+=se(a,a.H))||a.g("no breakpoints")}else if("n"==w)a.wa=Ye(a,u),a.g("break after "+a.wa+" instruction(s)");else if(void 0===u)a.g("missing breakpoint address");else{var K=T();if("*"!=u&&(K=W(a,u,!0),!K))break a;u=r(K.D);"c"==w?null==K.D?(Rd(a),a.g("all breakpoints cleared")):qe(a,a.u,K)||qe(a,a.Z,
K)||qe(a,a.H,K)||a.g("breakpoint missing: "+X(K.D)):"i"==w?a.g("breakpoint "+(yb(a.C,K.D)?"enabled":"cleared")+": port "+u+" (input)"):"o"==w?a.g("breakpoint "+(Bb(a.C,K.D)?"enabled":"cleared")+": port "+u+" (output)"):null!=K.D&&(fe(a,K,ma),"p"==w?a.Ja(a.u,K):"r"==w?a.Ja(a.Z,K):"w"==w?a.Ja(a.H,K):a.g("unknown breakpoint command: "+w))}}}break;case "c":a.ta&&(a.ta.value="");break;case "d":a:{var M,P=f[0],A=f[1],Y=f[2],Ff=f[3];if("?"==A){var ya="";for(M in Zd)a.Ga[M]&&(ya&&(ya+=","),ya+=M);ya+=",state,symbols";
a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");ya.length&&a.g("dump extension commands:\n\t"+ya)}else if("state"==A){var we=jf(a.w,!0);"console"==Y?console.log(we):(a.ta&&(a.ta.value=""),a.g(we))}else if("symbols"==A)for(var Yc=0;Yc<a.I.length;Yc++){var Zc=a.I[Yc],eb;for(eb in Zc.Da)if("."!=eb.charAt(0)){var xe=Zc.Da[eb].o;
if(void 0!==xe){var ye=Zc.Da[eb].l;ye&&(eb=ye);a.g(X(xe)+" "+eb)}}}else{if("d"==P){for(M in Zd)if(f[1]==M){var ze=a.Ga[M];ze?(f.shift(),f.shift(),ze(f)):a.g("no dump registered for "+A);break a}A||(P=a.fc||"db")}else a.fc=P;if("dh"==P){var Ae=A,Be=Y,Ce="",De=0,U=a.ra,za=a.V;if(za.length){var Z=+Ae||a.Nb,fb=+Be||10;isNaN(Z)?Z=fb:Ce="more ";Z>za.length&&(a.g("note: only "+za.length+" available"),Z=za.length);U-=Z;0>U&&(null==za[za.length-1].D?(Z=U+Z,U=0):U+=za.length);var $c=[];"call"==Be&&(fb=1E5,
$c=["CALL"]);for(void 0!==Ae&&a.g(Z+" instructions earlier:");0<fb&&U!=a.ra;){var Ee=za[U++];if(null==Ee.D)break;var Fb=T(Ee.D),Gf=Z--,Fe=ue(a,Fb,"history",Gf);(!$c.length||0<=Fe.indexOf($c[0]))&&a.g(Fe);Fb.yb&&(U+=Fb.yb,fb-=Fb.yb,Z-=Fb.yb);U>=za.length&&(U=0);a.Nb=Z;De++;fb--}}De||(a.g("no "+Ce+"history available"),a.Nb=void 0)}else{var gc=W(a,A);if(gc){var hc=0;Y&&("l"==Y.charAt(0)&&(Y=Y.substr(1)||Ff),hc=Ye(a,Y)>>>0,65536<hc&&(hc=65536));for(var Ma="",ic="dd"==P?4:"dw"==P?2:1,jc=ic*hc||128,Hf=
jc+15>>4||1;Hf--&&0<jc;){var kc=0,ad=0,Gb,Hb="",bd="",A=X(gc.D);for(Gb=16;0<Gb&&0<jc;Gb--){var lc=a.W(gc,1),kc=kc|lc<<(ad++<<3);ad==ic&&(Hb+=q(kc,2*ic),Hb+=1==ic?9==Gb?"-":" ":" ",kc=ad=0);bd+=32<=lc&&128>lc?String.fromCharCode(lc):".";jc--}Ma&&(Ma+="\n");Ma+=A+" "+Hb+(0==Gb?" "+bd:"")}Ma&&a.g(Ma);a.rb=gc}}}}break;case "e":if("else"==f[0])break;var mc=1,Ge=255,He=a.W,Ie=a.ha;"ew"==f[0]&&(mc=2,Ge=65535,He=a.Ia,Ie=a.xb);var Je=mc<<1,Ke=f[1];if(null==Ke)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 nc=W(a,Ke);if(nc)for(var oc=2;oc<f.length;oc++){var Ib=ee(a,f[oc]);if(void 0===Ib){a.g("unrecognized value: "+f[oc]);break}Ib&~Ge&&a.g("warning: "+q(Ib)+" exceeds "+mc+"-byte value");var If=He.call(a,nc);a.g("changing "+X(nc.D)+" from 0x"+q(If,Je)+" to 0x"+q(Ib,Je));Ie.call(a,nc,Ib,mc)}}break;case "f":cf(a,f[1]);break;case "g":a:{var Le=f[1],Jf=b;if(void 0!==Le){var cd=W(a,Le,!0);if(!cd)break a;fe(a,cd,Jf);a.Ja(a.u,cd,!0)}a.Oa(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;
case "h":a:{var dd;if(a.A.na)dd="halting",a.da();else{if(ib(a,!0))break a;dd="already halted"}c||a.g(dd)}break;case "i":if("if"==f[0]){var ed;var Jb=b.substr(2),Jb=ia(Jb);ee(a,Jb)?(c||a.g("true: "+Jb),ed=!0):(c||a.g("false: "+Jb),ed=!1);ed||(d=!1);break}var fd=f[1];if(fd&&"?"!=fd){var gd=Ye(a,fd);if(void 0!==gd){var Kf=zb(a.C,gd);a.g(r(gd)+": "+("0x"+q(Kf,2)))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var Lf=f[0];
if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var hd=0,Me=T(),Kb=T(a.b.ca);for(a.g("stack trace for "+X(Kb.D));10>hd;){for(var Na=null,Mf=256;65536>Kb.D>>>0;){Me.D=a.Ia(Kb,2);if(null==Kb.D||!Mf--)break;for(var Nf=a,pc=Me,Ne=null,Lb=pc.D,Oe=Lb,id=1;6>=id&&Lb;id++){if(2<id){pc.D=Lb;var qc=ue(Nf,pc);if(0<=qc.indexOf("CALL")){var Pe=qc.indexOf(" ");if(Lb+(qc.indexOf(" ",Pe+1)-Pe-1)/2==Oe){Ne=qc;break}}}Lb--}pc.D=Oe;if(Na=Ne)break}if(!Na||
null==Na)break;var Qe=null;if("ks"==Lf){var Re=Na.match(/[0-9A-F]+$/);Re&&(Qe=ef(a,Re[0]))}Na=ha(Na,50)+" ;"+(Qe||"stack="+X(Kb.D));a.g(Na);hd++}hd||a.g("no return addresses found")}break;case "l":if("ln"==f[0]){ef(a,f[1],!0);break}break;case "m":a:{var Aa,Ba=null,G=f[1];"?"==G&&(G=void 0);if(void 0!==G){var Oa=0;if("all"==G)Oa=1610481663,G=null;else if("on"==G)Ba=!0,G=null;else if("off"==G)Ba=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(Aa in Zd)if(G==Aa){Oa=Zd[Aa];Ba=!!(a.ja&
Oa);break}if(!Oa){a.g("unknown message category: "+G);break a}}Oa&&("on"==f[2]?(a.ja|=Oa,Ba=!0):"off"==f[2]&&(a.ja&=~Oa,Ba=!1))}var Of=0,Ia="";for(Aa in Zd)if(!G||G==Aa){var Pf=!!(a.ja&Zd[Aa]);if(null===Ba||Ba==Pf)Ia&&(Ia+=","),++Of%10||(Ia+="\n\t"),"key"==Aa&&(Aa="keys"),Ia+=Aa}void 0===G&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==Ba?Ba?"messages on: ":"messages off: ":"message categories:\n\t")+(Ia||"none"));Sd(a)}break;case "o":var jd=f[1],Qf=f[2];if(jd&&
"?"!=jd){var kd=Ye(a,jd,"port #"),ld=Ye(a,Qf);void 0!==kd&&void 0!==ld&&(Cb(a.C,kd,ld),a.g(r(kd)+": "+("0x"+q(ld,2))))}else a.g("output commands:"),a.g("\to [p] [b]\twrite byte [b] to port [p]"),a.g("warning: port accesses can affect hardware state");break;case "p":if("print"==f[0]){gf(a,b.substr(5));break}var Se="pr"==f[0]?1:0,Rf=1+Se;if(a.ba)a.g("step in progress");else{var md=T(a.b.M);switch(a.W(md)){case 205:a.ba=Rf,ae(md,3)}a.ba?(a.Ja(a.u,md,!0),a.Oa()||(a.w&&a.w.nb(),a.ba=0)):hf(a,Se?"tr":"t")}break;
case "r":if("reset"==b){a.w&&a.w.reset();break}ne(a,f);break;case "s":ff(a,f);break;case "t":hf(a,f[0],f[1]);break;case "u":oe(a,f[1],f[2],8);break;case "v":if("var"==f[0]){df(a,b.substr(3))||(d=!1);break}a.g("PC8080 version 1.23.0 ("+a.b.Ua+",RELEASE"+(lb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(qa());break;case "?":if(f[1]){gf(a,b.substr(1));break}var Mb="commands:",nd;for(nd in Ud)Mb+="\n"+ha(nd,7)+Ud[nd];qd(a)||(Mb+="\nnote: frequency/history disabled if no exec breakpoints");a.g(Mb);break;default:a.g("unknown command: "+
b),d=!1}}}catch(Te){a.g("debugger error: "+(Te.stack||Te.message)),d=!1}return d}function rc(a,b,c){b=ge(a,b,c);for(var d in b)if(!te(a,b[d]))return!1;return!0}Ha(function(){for(var a=z(document,"pc8080","debugger"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Pd(d);ab(d,c)}});function Hc(a,b,c){this.id=a.id;this.key=kf(a,b,c);this.G=a.G;lf(this,a.Sb)}function kf(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
K)||qe(a,a.H,K)||a.g("breakpoint missing: "+X(K.D)):"i"==w?a.g("breakpoint "+(yb(a.C,K.D)?"enabled":"cleared")+": port "+u+" (input)"):"o"==w?a.g("breakpoint "+(Bb(a.C,K.D)?"enabled":"cleared")+": port "+u+" (output)"):null!=K.D&&(fe(a,K,ma),"p"==w?a.Ja(a.u,K):"r"==w?a.Ja(a.Z,K):"w"==w?a.Ja(a.H,K):a.g("unknown breakpoint command: "+w))}}}break;case "c":a.ta&&(a.ta.value="");break;case "d":a:{var M,P=f[0],A=f[1],Y=f[2],Df=f[3];if("?"==A){var xa="";for(M in Zd)a.Ga[M]&&(xa&&(xa+=","),xa+=M);xa+=",state,symbols";
a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");xa.length&&a.g("dump extension commands:\n\t"+xa)}else if("state"==A){var ue=jf(a.w,!0);"console"==Y?console.log(ue):(a.ta&&(a.ta.value=""),a.g(ue))}else if("symbols"==A)for(var Wc=0;Wc<a.I.length;Wc++){var Xc=a.I[Wc],db;for(db in Xc.Da)if("."!=db.charAt(0)){var ve=Xc.Da[db].o;
if(void 0!==ve){var we=Xc.Da[db].l;we&&(db=we);a.g(X(ve)+" "+db)}}}else{if("d"==P){for(M in Zd)if(f[1]==M){var xe=a.Ga[M];xe?(f.shift(),f.shift(),xe(f)):a.g("no dump registered for "+A);break a}A||(P=a.fc||"db")}else a.fc=P;if("dh"==P){var ye=A,ze=Y,Ae="",Be=0,U=a.ra,ya=a.V;if(ya.length){var Z=+ye||a.Nb,eb=+ze||10;isNaN(Z)?Z=eb:Ae="more ";Z>ya.length&&(a.g("note: only "+ya.length+" available"),Z=ya.length);U-=Z;0>U&&(null==ya[ya.length-1].D?(Z=U+Z,U=0):U+=ya.length);var Yc=[];"call"==ze&&(eb=1E5,
Yc=["CALL"]);for(void 0!==ye&&a.g(Z+" instructions earlier:");0<eb&&U!=a.ra;){var Ce=ya[U++];if(null==Ce.D)break;var Db=T(Ce.D),Ef=Z--,De=Se(a,Db,"history",Ef);(!Yc.length||0<=De.indexOf(Yc[0]))&&a.g(De);Db.yb&&(U+=Db.yb,eb-=Db.yb,Z-=Db.yb);U>=ya.length&&(U=0);a.Nb=Z;Be++;eb--}}Be||(a.g("no "+Ae+"history available"),a.Nb=void 0)}else{var ec=W(a,A);if(ec){var fc=0;Y&&("l"==Y.charAt(0)&&(Y=Y.substr(1)||Df),fc=Ye(a,Y)>>>0,65536<fc&&(fc=65536));for(var La="",gc="dd"==P?4:"dw"==P?2:1,hc=gc*fc||128,Ff=
hc+15>>4||1;Ff--&&0<hc;){var ic=0,Zc=0,Eb,Fb="",$c="",A=X(ec.D);for(Eb=16;0<Eb&&0<hc;Eb--){var jc=a.W(ec,1),ic=ic|jc<<(Zc++<<3);Zc==gc&&(Fb+=q(ic,2*gc),Fb+=1==gc?9==Eb?"-":" ":" ",ic=Zc=0);$c+=32<=jc&&128>jc?String.fromCharCode(jc):".";hc--}La&&(La+="\n");La+=A+" "+Fb+(0==Eb?" "+$c:"")}La&&a.g(La);a.rb=ec}}}}break;case "e":if("else"==f[0])break;var kc=1,Ee=255,Fe=a.W,Ge=a.ha;"ew"==f[0]&&(kc=2,Ee=65535,Fe=a.Ia,Ge=a.xb);var He=kc<<1,Ie=f[1];if(null==Ie)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 lc=W(a,Ie);if(lc)for(var mc=2;mc<f.length;mc++){var Gb=ee(a,f[mc]);if(void 0===Gb){a.g("unrecognized value: "+f[mc]);break}Gb&~Ee&&a.g("warning: "+q(Gb)+" exceeds "+kc+"-byte value");var Gf=Fe.call(a,lc);a.g("changing "+X(lc.D)+" from 0x"+q(Gf,He)+" to 0x"+q(Gb,He));Ge.call(a,lc,Gb,kc)}}break;case "f":cf(a,f[1]);break;case "g":a:{var Je=f[1],Hf=b;if(void 0!==Je){var ad=W(a,Je,!0);if(!ad)break a;fe(a,ad,Hf);a.Ja(a.u,ad,!0)}a.Oa(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;
case "h":a:{var bd;if(a.A.na)bd="halting",a.da();else{if(ib(a,!0))break a;bd="already halted"}c||a.g(bd)}break;case "i":if("if"==f[0]){var cd;var Hb=b.substr(2),Hb=ia(Hb);ee(a,Hb)?(c||a.g("true: "+Hb),cd=!0):(c||a.g("false: "+Hb),cd=!1);cd||(d=!1);break}var dd=f[1];if(dd&&"?"!=dd){var ed=Ye(a,dd);if(void 0!==ed){var If=zb(a.C,ed);a.g(r(ed)+": "+("0x"+q(If,2)))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var Jf=f[0];
if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var fd=0,Ke=T(),Ib=T(a.b.ca);for(a.g("stack trace for "+X(Ib.D));10>fd;){for(var Ma=null,Kf=256;65536>Ib.D>>>0;){Ke.D=a.Ia(Ib,2);if(null==Ib.D||!Kf--)break;for(var Lf=a,nc=Ke,Le=null,Jb=nc.D,Me=Jb,gd=1;6>=gd&&Jb;gd++){if(2<gd){nc.D=Jb;var oc=Se(Lf,nc);if(0<=oc.indexOf("CALL")){var Ne=oc.indexOf(" ");if(Jb+(oc.indexOf(" ",Ne+1)-Ne-1)/2==Me){Le=oc;break}}}Jb--}nc.D=Me;if(Ma=Le)break}if(!Ma||
null==Ma)break;var Oe=null;if("ks"==Jf){var Pe=Ma.match(/[0-9A-F]+$/);Pe&&(Oe=ef(a,Pe[0]))}Ma=ha(Ma,50)+" ;"+(Oe||"stack="+X(Ib.D));a.g(Ma);fd++}fd||a.g("no return addresses found")}break;case "l":if("ln"==f[0]){ef(a,f[1],!0);break}break;case "m":a:{var za,Aa=null,G=f[1];"?"==G&&(G=void 0);if(void 0!==G){var Na=0;if("all"==G)Na=1610481663,G=null;else if("on"==G)Aa=!0,G=null;else if("off"==G)Aa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(za in Zd)if(G==za){Na=Zd[za];Aa=!!(a.ja&
Na);break}if(!Na){a.g("unknown message category: "+G);break a}}Na&&("on"==f[2]?(a.ja|=Na,Aa=!0):"off"==f[2]&&(a.ja&=~Na,Aa=!1))}var Mf=0,Ha="";for(za in Zd)if(!G||G==za){var Nf=!!(a.ja&Zd[za]);if(null===Aa||Aa==Nf)Ha&&(Ha+=","),++Mf%10||(Ha+="\n\t"),"key"==za&&(za="keys"),Ha+=za}void 0===G&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==Aa?Aa?"messages on: ":"messages off: ":"message categories:\n\t")+(Ha||"none"));Sd(a)}break;case "o":var hd=f[1],Of=f[2];if(hd&&
"?"!=hd){var id=Ye(a,hd,"port #"),jd=Ye(a,Of);void 0!==id&&void 0!==jd&&(Cb(a.C,id,jd),a.g(r(id)+": "+("0x"+q(jd,2))))}else a.g("output commands:"),a.g("\to [p] [b]\twrite byte [b] to port [p]"),a.g("warning: port accesses can affect hardware state");break;case "p":if("print"==f[0]){gf(a,b.substr(5));break}var Qe="pr"==f[0]?1:0,Pf=1+Qe;if(a.ba)a.g("step in progress");else{var kd=T(a.b.M);switch(a.W(kd)){case 205:a.ba=Pf,ae(kd,3)}a.ba?(a.Ja(a.u,kd,!0),a.Oa()||(a.w&&a.w.nb(),a.ba=0)):hf(a,Qe?"tr":"t")}break;
case "r":if("reset"==b){a.w&&a.w.reset();break}ne(a,f);break;case "s":ff(a,f);break;case "t":hf(a,f[0],f[1]);break;case "u":oe(a,f[1],f[2],8);break;case "v":if("var"==f[0]){df(a,b.substr(3))||(d=!1);break}a.g("PC8080 version 1.23.0 ("+a.b.Ua+",RELEASE"+(lb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(qa());break;case "?":if(f[1]){gf(a,b.substr(1));break}var Kb="commands:",ld;for(ld in Ud)Kb+="\n"+ha(ld,7)+Ud[ld];qd(a)||(Kb+="\nnote: frequency/history disabled if no exec breakpoints");a.g(Kb);break;default:a.g("unknown command: "+
b),d=!1}}}catch(Re){a.g("debugger error: "+(Re.stack||Re.message)),d=!1}return d}function rc(a,b,c){b=ge(a,b,c);for(var d in b)if(!te(a,b[d]))return!1;return!0}Ia(function(){for(var a=z(document,"pc8080","debugger"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Pd(d);ab(d,c)}});function Hc(a,b,c){this.id=a.id;this.key=kf(a,b,c);this.G=a.G;lf(this,a.Sb)}function kf(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
Hc.prototype={constructor:Hc,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){lf(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}}};
function lf(a,b){a[a.id]={};b&&F(a,"parms",b);a.b=!1}function mf(a){var b=!0;if(ta()){var c=JSON.stringify(a[a.id]);va(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function nf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function of(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:ta()&&(b=ua(a.key))?(a[a.id]=b,a.b=!0):!1}function pf(a,b){return a[a.id][b]||null}function F(a,b,c){try{a[a.id][b]=c}catch(d){}}
function qf(a,b,c){v.call(this,"Computer",a,qf,67108864);this.A.ka=!1;rf(this,b);this.ba=dc(this,"autoPower",a);this.B=0;this.qa=a.busWidth||a.buswidth;this.w=sf;this.Y=null;this.J=this.ia=!1;this.ra=dc(this,"url")||"";(Math.random()+.1).toString(36);this.u=tf(this);if(this.b=$a("CPU",this.id)){this.G=$a("Debugger",this.id);this.I=[];for(b=null;b=ob(this,"Video",b);)this.I.push(b);this.C=new qb({id:this.Ib+".bus",busWidth:this.qa},this.b,this.G);var d,e=Za(this.id);if((this.F=$a("Panel",this.id))&&
this.F.ta)for(b=0;b<e.length;b++)d=e[b],d.oa=this.F.oa,d.g=this.F.g,d.ta=this.F.ta;this.g(uf+" v"+vf+"\n"+wf+"\n"+xf);for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.C,this.b,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.V=d:this.w=parseInt(d,10));var f;if(a=dc(this,"state")||(f=!0,a.state))b=this.ea=a,f||(this.J=!0,this.w=sf),this.w&&(this.Z=new Hc(this,vf),of(this.Z)?b=null:delete this.Z);!b&&this.w&&(b=yf(this))&&(this.J=!0);if(b){var h=this;oa(b,null,!0,function(a,b,c){c?(h.V=null,
h.J=!1,h.oa("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(h.Y=b,h.ia=!0);C(h)})}else C(this);this.K.power||(this.ba=!0);!c&&this.ba&&zf(this,this.lb)}else t("Unable to find CPU component")}Wa(qf);var uf="PC8080",vf="1.23.0",wf="Copyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>",xf="License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>",sf=0;
function rf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.L=b}function dc(a,b,c){var d=b.toLowerCase(),d=Ra[b]||Ra[d];void 0===d&&a.L&&(d=a.L[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function zf(a,b,c){for(var d=Za(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!jb(f)){jb(f,function(){zf(a,b,c)});return}}b.call(a,c)}
function Af(a,b){var c=new Hc(a,vf,"validate");if(of(c)&&nf(c)){var d=pf(c,"timestamp"),e=b?pf(b,"timestamp"):"unknown";d!=e&&(a.oa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}m=qf.prototype;
m.lb=function(a){void 0===a&&(a=this.w||(this.Y?1:sf));if(!this.B){this.B++;var b=!1,c=!1;this.ga=!1;var d=this.Z||new Hc(this,vf);if(-1==a)b=!0;else if(a>sf){if(of(d,this.Y)){this.H=new Hc(this,vf,"failsafe");of(this.H)&&(Bf(this,d),a=2,lf(this.H));F(this.H,"timestamp",la());mf(this.H);var e=this.w&&!this.J;if(1==a||ra("Click OK to restore the previous "+uf+" machine state, or CANCEL to reset the machine.")){if(c=nf(d)){var f=pf(d,"code"),h=pf(d,"data");f&&("ok"==f?of(d,h):("error"==f&&"no machine state"!=
h?(this.oa("Error: "+h),"unable to verify user"==h&&(va("user",""),this.u=null)):this.g(f+": "+h),lf(d),of(d)?(c=nf(d),e=!0):c=!1))}e&&Af(this,c?d:null)}else 2==a&&d.clear()}else Af(this);delete this.Y;delete this.Z}e=Za(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.b&&(c=Cf(this,h,d,b,c));b=[d,a,c];-1!=a?zf(this,this.Jb,b):this.Jb(b)}};
function Cf(a,b,c,d,e){if(!b.A.ka){b.A.ka=!0;if(b.Ba){var f=null;e&&((f=pf(c,b.id))||(f=pf(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ba(f,d)&&f&&(t("Unable to restore state for "+b.type),a.ea&&!a.ia?(c.clear(),a.w=sf,window&&window.location.reload()):a.ga=!0,b.Ba(null),e=!1)}if(!d&&b.Hb)for(a=b.Hb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
m.Jb=function(a){var b=a[0],c=0>a[1];a=a[2];this.sa=!0;this.A.ka=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(Cf(this,this.b,b,c,a),tc(this.b));this.ga&&(Bf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.B=0};
function Bf(a,b){if(ra("There may be a problem with your "+uf+" machine.\n\nTo help us diagnose it, click OK to send this "+uf+" machine state to http://www.pcjs.org.")){var c=a.ra,d=a.u||"",e=b.toString(),f=vf,h={};h.app=uf;h.ver=f;h.url=c;h.user=d;h.type="bug";h.data=e;oa("http://www.pcjs.org/api/v1/report",h,!0)}}
function jf(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new Hc(a,vf),h=new Hc(a,vf,"validate"),g=la();F(h,"timestamp",g);F(f,"timestamp",g);F(f,"version","1.23.0");F(f,"url",window?window.location.href:null);F(f,"browser",qa());a.b&&a.b.Aa&&(c&&a.b.da(),d=a.b.Aa(b,c),"object"===typeof d&&F(f,a.b.id,d),c&&(a.b.A.ka=!1,!1===d&&(e=null)));for(var g=Za(a.id),l=0;l<g.length;l++){var k=g[l];k.A.ka&&(k.Aa&&(d=k.Aa(b,c),"object"===typeof d&&F(f,k.id,d)),c&&(k.A.ka=!1,!1===d&&(e=null)))}e&&(c?(g=
d=!1,b?(a.u&&Df(a,a.u,f.toString()),mf(h)&&mf(f)||(e=null,d=g=!0)):a.w&&(d=!0,g=3==a.w),d&&f.clear(g)):e=f.toString());c&&(a.A.ka=!1,b=a.K.power)&&(b.textContent="Power");a.B=0;return e}m.reset=function(){this.C&&this.C.reset&&(db(this,"Resetting "+this.C.type),this.C.reset());for(var a=Za(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.C&&c.reset&&(db(this,"Resetting "+c.type),c.reset())}};
this.F.ta)for(b=0;b<e.length;b++)d=e[b],d.oa=this.F.oa,d.g=this.F.g,d.ta=this.F.ta;this.g("PC8080 v1.23.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.C,this.b,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.V=d:this.w=parseInt(d,10));var f;if(a=dc(this,"state")||(f=!0,a.state))b=this.ea=a,f||(this.J=!0,this.w=sf),this.w&&(this.Z=new Hc(this,"1.23.0"),of(this.Z)?
b=null:delete this.Z);!b&&this.w&&(b=uf(this))&&(this.J=!0);if(b){var h=this;oa(b,null,!0,function(a,b,c){c?(h.V=null,h.J=!1,h.oa("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(h.Y=b,h.ia=!0);C(h)})}else C(this);this.K.power||(this.ba=!0);!c&&this.ba&&vf(this,this.lb)}else t("Unable to find CPU component")}Wa(qf);var sf=0;function rf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.L=b}
function dc(a,b,c){var d=b.toLowerCase(),d=Ra[b]||Ra[d];void 0===d&&a.L&&(d=a.L[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function vf(a,b,c){for(var d=Za(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!jb(f)){jb(f,function(){vf(a,b,c)});return}}b.call(a,c)}
function wf(a,b){var c=new Hc(a,"1.23.0","validate");if(of(c)&&nf(c)){var d=pf(c,"timestamp"),e=b?pf(b,"timestamp"):"unknown";d!=e&&(a.oa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}m=qf.prototype;
m.lb=function(a){void 0===a&&(a=this.w||(this.Y?1:sf));if(!this.B){this.B++;var b=!1,c=!1;this.ga=!1;var d=this.Z||new Hc(this,"1.23.0");if(-1==a)b=!0;else if(a>sf){if(of(d,this.Y)){this.H=new Hc(this,"1.23.0","failsafe");of(this.H)&&(xf(this,d),a=2,lf(this.H));F(this.H,"timestamp",la());mf(this.H);var e=this.w&&!this.J;if(1==a||ra("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=nf(d)){var f=pf(d,"code"),h=pf(d,"data");f&&("ok"==f?of(d,h):("error"==
f&&"no machine state"!=h?(this.oa("Error: "+h),"unable to verify user"==h&&(va("user",""),this.u=null)):this.g(f+": "+h),lf(d),of(d)?(c=nf(d),e=!0):c=!1))}e&&wf(this,c?d:null)}else 2==a&&d.clear()}else wf(this);delete this.Y;delete this.Z}e=Za(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.b&&(c=yf(this,h,d,b,c));b=[d,a,c];-1!=a?vf(this,this.Jb,b):this.Jb(b)}};
function yf(a,b,c,d,e){if(!b.A.ka){b.A.ka=!0;if(b.Ba){var f=null;e&&((f=pf(c,b.id))||(f=pf(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ba(f,d)&&f&&(t("Unable to restore state for "+b.type),a.ea&&!a.ia?(c.clear(),a.w=sf,window&&window.location.reload()):a.ga=!0,b.Ba(null),e=!1)}if(!d&&b.Hb)for(a=b.Hb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
m.Jb=function(a){var b=a[0],c=0>a[1];a=a[2];this.sa=!0;this.A.ka=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(yf(this,this.b,b,c,a),tc(this.b));this.ga&&(xf(this,b),b.clear());!c&&this.H&&(this.H.clear(),delete this.H);this.B=0};
function xf(a,b){if(ra("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.0"};e.url=a.ra;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}}
function jf(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new Hc(a,"1.23.0"),h=new Hc(a,"1.23.0","validate"),g=la();F(h,"timestamp",g);F(f,"timestamp",g);F(f,"version","1.23.0");F(f,"url",window?window.location.href:null);F(f,"browser",qa());a.b&&a.b.Aa&&(c&&a.b.da(),d=a.b.Aa(b,c),"object"===typeof d&&F(f,a.b.id,d),c&&(a.b.A.ka=!1,!1===d&&(e=null)));for(var g=Za(a.id),l=0;l<g.length;l++){var k=g[l];k.A.ka&&(k.Aa&&(d=k.Aa(b,c),"object"===typeof d&&F(f,k.id,d)),c&&(k.A.ka=!1,!1===d&&(e=null)))}e&&
(c?(g=d=!1,b?(a.u&&zf(a,a.u,f.toString()),mf(h)&&mf(f)||(e=null,d=g=!0)):a.w&&(d=!0,g=3==a.w),d&&f.clear(g)):e=f.toString());c&&(a.A.ka=!1,b=a.K.power)&&(b.textContent="Power");a.B=0;return e}m.reset=function(){this.C&&this.C.reset&&(fb(this,"Resetting "+this.C.type),this.C.reset());for(var a=Za(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.C&&c.reset&&(fb(this,"Resetting "+c.type),c.reset())}};
m.start=function(a,b){for(var c=Za(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};m.stop=function(a,b){for(var c=Za(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
m.ma=function(a,b,c){var d=this;switch(b){case "power":return this.K[b]=c,c.onclick=function(){d.B||(d.A.ka?jf(d,!1,!0):zf(d,d.lb))},!0;case "reset":return this.K[b]=c,c.onclick=function(){if(d.A.ka&&!d.B)if(d.w&&!d.V){var a=ra("Click OK to save changes to this "+uf+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");jf(d,a,!0);!a&&d.ea?window&&window.location.reload():d.lb(sf)}else d.reset(),d.b&&tc(d.b)},!0;case "save":if(da(pa(),"pcjs.org")){c.parentNode.removeChild(c);
break}this.K[b]=c;c.onclick=function(){var a=tf(d,!0);if(a){var b=!!(d.w&&!d.V||d.ea),c=jf(d,b);b?Df(d,a,c):d.oa("Resume disabled, machine state not saved")}};return!0}return!1};
function tf(a,b){var c=a.u;c||(c=ua("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=Ef(a,c))||a.oa("The user ID is invalid."))):b&&a.oa("Browser local storage is not available"));return c}
function Ef(a,b){a.u=null;var c=oa(pa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(va("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function yf(a){var b=null;a.u&&(b=pa()+"/api/v1/user?req=load&user="+a.u+"&state="+kf(a,vf));return b}
function Df(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=kf(a,vf);d.data=c;b=oa(pa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.oa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.oa(c),va("user",""),a.u=null)}}
m.ma=function(a,b,c){var d=this;switch(b){case "power":return this.K[b]=c,c.onclick=function(){d.B||(d.A.ka?jf(d,!1,!0):vf(d,d.lb))},!0;case "reset":return this.K[b]=c,c.onclick=function(){if(d.A.ka&&!d.B)if(d.w&&!d.V){var a=ra("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");jf(d,a,!0);!a&&d.ea?window&&window.location.reload():d.lb(sf)}else d.reset(),d.b&&tc(d.b)},!0;case "save":if(da(pa(),"pcjs.org")){c.parentNode.removeChild(c);
break}this.K[b]=c;c.onclick=function(){var a=tf(d,!0);if(a){var b=!!(d.w&&!d.V||d.ea),c=jf(d,b);b?zf(d,a,c):d.oa("Resume disabled, machine state not saved")}};return!0}return!1};
function tf(a,b){var c=a.u;c||(c=ua("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=Af(a,c))||a.oa("The user ID is invalid."))):b&&a.oa("Browser local storage is not available"));return c}
function Af(a,b){a.u=null;var c=oa(pa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(va("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function uf(a){var b=null;a.u&&(b=pa()+"/api/v1/user?req=load&user="+a.u+"&state="+kf(a,"1.23.0"));return b}
function zf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=kf(a,"1.23.0");d.data=c;b=oa(pa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.oa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.oa(c),va("user",""),a.u=null)}}
function ob(a,b,c){a=Za(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}m.nb=function(a){if(this.I.length){var b=0,c=0;a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.I[0];d.ba&&d.ba.focus();a&&window&&window.scrollTo(b,c)}};m.va=function(a){this.b&&this.b.va(a);this.F&&this.F.va(a)};
function zc(a,b){for(var c=0;c<a.I.length;c++)a:{var d=a.I[c];if(0<=b){if(b&1){d=d.b;d.u=d.u&-8|10;break a}var e=d.b;e.u=e.u&-8|9;if(e=d.xa){for(var e=d.C,f=d.sa,h=!0,g=d.wa>>>e.fa;0<f&&g<e.T.length;)e.T[g].ya&&(e.T[g].ya=h=!1,e.T[g].Lb=!0),f-=e.ua,g++;e=h}if(e)break a}var g=d.wa,l=g+d.sa,k=0,n=0,p=0,e=d.J,x=0,f=d.Y,B=h=0,u=d.ra,ma=(1<<u)-1;d.rb&&(u=-u,B=16+u);for(;g<l;){var w=wb(d.C,g);if(d.xa&&w===d.ia[k])n+=d.fb;else{d.ia[k]=w;var ea=B;ea&&(w=w>>8|(w&255)<<8);n<e&&(e=n);for(var K=d.fb;K--;){var M=
w>>ea&ma,P=d.Ga,A=n++,Y=M,M=void 0,M=d.B?(P.height-A-1)*P.width+p:A+p*P.width;Y&&(208<=A&&236>A?Y=d.ga+0:28<=A&&72>A&&(Y=d.ga+1));A=d.V[Y];M*=A.length;P.data[M]=A[0];P.data[M+1]=A[1];P.data[M+2]=A[2];P.data[M+3]=A[3];ea+=u}n>x&&(x=n);p<f&&(f=p);p>=h&&(h=p+1)}g+=2;k++;if(n>=d.J&&(n=0,p++,p>d.Y))break}d.xa=!0;e<d.J&&(g=x-e,h-=f,d.B&&(l=e,k=g,e=f,g=h,f=d.J-(l+k),h=k),d.qb.putImageData(d.Ga,0,0,e,f,g,h),d.I.drawImage(d.L,0,0,d.L.width,d.L.height,0,0,d.qa,d.Z))}}
Ha(function(){for(var a=z(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=z(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new qf(h,d,!0);ab(h,f);h.ba&&zf(h,h.lb)}});Da.show.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=$a("Computer",c.id))&&c.sa&&!c.A.ka&&c.lb(-1)}});
Da.exit.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=$a("Computer",c.id))&&c.A.ka&&jf(c,!(!c.w||c.V),!0)}});var Sf=0;function Tf(a,b,c,d,e,f){e("Loading "+a+"...");oa(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Uf(g,a,b,c,d,e,f)})}
function Uf(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Ya(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Vf(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
function Vf(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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 l=g[0],k,n=/( [a-z]+=)(['"])(.*?)\2/g;k=n.exec(f);)l=0>l.indexOf(k[1])?l.replace(">",k[0]+">"):l.replace(new RegExp(k[1]+"(['\"])(.*?)\\1"),k[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);Vf(a,b,c)}})}else c(a,null)}
function Wf(a,b,c,d){function e(a){if(void 0===g){var b=h&&z(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--Sf||Ka(!0));l=!1}var h,g,l=!0;Sf++;Xa[a]={};try{if(h=document.getElementById(a)){var k;if("object"==typeof resources&&(k=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=k:p.appendChild(document.createTextNode(k));n.appendChild(p)}c||
(c="/versions/pc8080/1.23.0/components.xsl");k=function(d,g){g?Tf(c,null,null,!1,e,function(d,k){if(k)if(Ya(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Sf||Ka(!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),--Sf||Ka(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Tf(b,a,d,!0,e,k):Uf(b,null,a,d,!1,e,k)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPC8080=function(a,b,c,d){Ka(!1);return Wf(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;
function Xf(a,b,c,d){if(!c&&b){d.push(b);a=Xa[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){Yf(b,d)}):Yf(null,d)}else t("Error ("+c+") requesting "+a)}
function Yf(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=Xa[f],l={},k;for(k in g){var n=g[k],p=ca(k);if("xml"==p){for(p=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=p.exec(g[k]);){var x=d[2];x&&(g[x]||(n=n.replace(d[0],"")))}d=k=ba(k)}else"xsl"==p&&(e=k=ba(k));l[k]=n}a&&(l[k="css"]=a);b[2]&&(l[k="parms"]=b[2]);b[3]&&(l[k="state"]=b[3]);d&&e?(k=JSON.stringify(l),h+=".js",c=c[1]+"var resources="+k+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
Ia(function(){for(var a=z(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=z(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new qf(h,d,!0);ab(h,f);h.ba&&vf(h,h.lb)}});Da.show.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=$a("Computer",c.id))&&c.sa&&!c.A.ka&&c.lb(-1)}});
Da.exit.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=$a("Computer",c.id))&&c.A.ka&&jf(c,!(!c.w||c.V),!0)}});var Bf=0;function Cf(a,b,c,d,e,f){e("Loading "+a+"...");oa(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Qf(g,a,b,c,d,e,f)})}
function Qf(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Ya(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Rf(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
function Rf(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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 l=g[0],k,n=/( [a-z]+=)(['"])(.*?)\2/g;k=n.exec(f);)l=0>l.indexOf(k[1])?l.replace(">",k[0]+">"):l.replace(new RegExp(k[1]+"(['\"])(.*?)\\1"),k[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);Rf(a,b,c)}})}else c(a,null)}
function Sf(a,b,c,d){function e(a){if(void 0===g){var b=h&&z(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--Bf||Ka(!0));l=!1}var h,g,l=!0;Bf++;Xa[a]={};try{if(h=document.getElementById(a)){var k;if("object"==typeof resources&&(k=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=k:p.appendChild(document.createTextNode(k));n.appendChild(p)}c||
(c="/versions/pc8080/1.23.0/components.xsl");k=function(d,g){g?Cf(c,null,null,!1,e,function(d,k){if(k)if(Ya(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Bf||Ka(!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),--Bf||Ka(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Cf(b,a,d,!0,e,k):Qf(b,null,a,d,!1,e,k)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPC8080=function(a,b,c,d){Ka(!1);return Sf(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=Oa;
function Tf(a,b,c,d){if(!c&&b){d.push(b);a=Xa[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){Uf(b,d)}):Uf(null,d)}else t("Error ("+c+") requesting "+a)}
function Uf(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=Xa[f],l={},k;for(k in g){var n=g[k],p=ca(k);if("xml"==p){for(p=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=p.exec(g[k]);){var x=d[2];x&&(g[x]||(n=n.replace(d[0],"")))}d=k=ba(k)}else"xsl"==p&&(e=k=ba(k));l[k]=n}a&&(l[k="css"]=a);b[2]&&(l[k="parms"]=b[2]);b[3]&&(l[k="state"]=b[3]);d&&e?(k=JSON.stringify(l),h+=".js",c=c[1]+"var resources="+k+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),k=h,g=null,l="data:application/javascript,",l=wa("Firefox")?l+encodeURIComponent(c):l+encodeURI(c),k&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=l,g.download=k,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+k+"."):(window.open(l),c="Check your browser for a new window/tab containing the requested data"+(k?" ("+k+")":"")+"."),c+=', copy it to your web server as "'+h+'", and then add the following to your web page:\n\n',
c+='<div id="'+f+'"></div>\n',c+="...\n",c+='<script type="text/javascript" src="'+h+'">\x3c/script>\n',c+='<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n',c+="The machine should appear where the <div> is located.",t(c)):t("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=$a("Computer",a),e=$a("Debugger",a);if(d){var f=jf(d,!0),h=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcjs/1.23.0/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Sb:h}))return!0;oa(b,null,!0,function(c,d,e){Xf(c,d,e,[a,ba(b,!0),h,f])});return!0}t("Unable to identify machine '"+a+"'");return!1};})();
window.savePC=function(a,b,c){var d=$a("Computer",a),e=$a("Debugger",a);if(d){var f=jf(d,!0),h=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcjs/1.23.0/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Sb:h}))return!0;oa(b,null,!0,function(c,d,e){Tf(c,d,e,[a,ba(b,!0),h,f])});return!0}t("Unable to identify machine '"+a+"'");return!1};})();

View file

@ -1,6 +1,6 @@
(function(){var m;function aa(a){var b=16,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(){var m;function ca(a){var b=16,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 n(a,b){var c="";void 0===b?b=8:8<b&&(b=8);if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;){var d=a&15,d=d+(0<=d&&9>=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function da(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ea(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
function fa(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ga={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}var ia=Date.now||function(){return+new Date};function ja(){function a(a){return(10>a?"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 fa(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ga={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}var ia=Date.now||function(){return+new Date};function ka(){function a(a){return(10>a?"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 p(a,b,c,d){var e=0,f=null,h=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),h;var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(g.onreadystatechange=function(){4===g.readyState&&(f=g.responseText,200==g.status||!g.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=g.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",k;for(k in b)b.hasOwnProperty(k)&&(l&&(l+="&"),l+=k+"="+encodeURIComponent(b[k]));l=l.replace(/%20/g,"+");g.open("POST",a,!!c);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(l)}else g.open("GET",a,!!c),"bytes"==b&&g.overrideMimeType("text/plain; charset=x-user-defined"),g.send();c||(f=g.responseText,200!=g.status&&(e=g.status||-1),d&&d(a,f,e),h=[f,e]);return h}function la(){return"http://"+(window?window.location.host:"www.pcjs.org")}
function r(a){window&&window.alert(a)}function ma(a){var b=!1;window&&(b=window.confirm(a));return b}var na=null;function oa(){if(null==na){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}na=a}return na}function pa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
@ -13,14 +13,14 @@ function Ia(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(
function Ja(a,b){for(var c=z(b.parentNode,"pc8080-control"),d=0;d<c.length;d++)for(var e=c[d].childNodes,f=0;f<e.length;f++){var h=e[f];if(1===h.nodeType){var g=h.getAttribute("class");if(g)for(var l=g.split(" "),k=0;k<l.length;k++)switch(g=l[k],g){case "pc8080-binding":(g=y(h))&&g.binding&&a.O(g.type,g.binding,h,g.value),k=l.length}}}}
function z(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},O:function(a,b,c){switch(b){case "clear":return this.B[b]||(this.B[b]=c,c.onclick=function(a){return function(){a.B.print&&(a.B.print.value="")}}(this)),!0;case "print":return this.B[b]||(this.Z=this.B[b]=c,c.value="",this.R=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.J=function(a,b,c){this.R(a,"notice",c)}),!0;default:return!1}},log:function(){},R:function(){},status:function(a){this.R(this.Aa+": "+a)},J:function(a,b){b||r(a)},X:function(){return this.h.N=!0},W:function(a,b){b&&(this.h.N=!1);return!0}};function Ka(a,b){if(a.h.Ka)return a.h.pa&&(a.h.pa=!1),a.h.Ka=!1;if(a.h.da)return a.R(a.toString()+" error"),!1;a.h.pa=b;return a.h.pa}function B(a){if(!a.h.da&&(a.h.ia=!0,a.h.ia)){var b=a.Ea;a.Ea=null;b&&b()}}
function La(a,b){b&&(a.h.ia?b():a.Ea=b);return a.h.ia}
this.J=function(a,b,c){this.R(a,"notice",c)}),!0;default:return!1}},log:function(){},R:function(){},status:function(a){this.R(this.Aa+": "+a)},J:function(a,b){b||r(a)},X:function(){return this.h.N=!0},W:function(a,b){b&&(this.h.N=!1);return!0}};function Ma(a,b){if(a.h.Ka)return a.h.pa&&(a.h.pa=!1),a.h.Ka=!1;if(a.h.da)return a.R(a.toString()+" error"),!1;a.h.pa=b;return a.h.pa}function B(a){if(!a.h.da&&(a.h.ia=!0,a.h.ia)){var b=a.Ea;a.Ea=null;b&&b()}}
function Na(a,b){b&&(a.h.ia?b():a.Ea=b);return a.h.ia}
var Oa="undefined"!==typeof ArrayBuffer,Pa=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function Qa(a){u.call(this,"Panel",a,Qa)}w(Qa);m=Qa.prototype;m.O=function(a,b,c,d){return this.u&&this.u.O(a,b,c,d)||this.a&&this.a.O(a,b,c,d)||this.D&&this.D.O(a,b,c,d)?!0:this.parent.O.call(this,a,b,c,d)};m.$=function(a,b,c,d){this.u=a;this.o=b;this.a=c;this.I=d;this.D=Ra(a,"Keyboard")};m.X=function(a,b){b||Sa();return!0};m.W=function(){return!0};m.ga=function(){};
function Sa(){for(var a=!1,b=z(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=y(d),f;a:{f=e.id;if(void 0!==f)for(var h=void 0,h=0;h<v.length;h++)if(v[h].id===f){f=v[h];break a}f=null}f||(a=!0,f=new Qa(e));Ja(f,d);a&&B(f)}}wa(Sa);
function Ta(a,b,c){u.call(this,"Bus",a,Ta);this.a=b;this.I=c;this.j=a.busWidth||16;this.s=Math.pow(2,this.j);this.i=this.s-1|0;this.c=16>=this.j?10:20>=this.j?12:24>=this.j?14:15;this.f=1<<this.c;this.A=this.f>>2;this.g=this.f-1;this.o=this.s/this.f|0;this.u=this.o-1;this.l=[];this.m=[];this.C=[];this.D=[];a=new C;Ua(a,this.I);this.b=Array(this.o);for(b=0;b<this.o;b++)this.b[b]=a;B(this)}w(Ta);Ta.prototype.reset=function(){};Ta.prototype.X=function(a,b){b||this.reset();return!0};
function Va(a,b,c,d){for(var e=b,f=c,h=e>>>a.c;0<f&&h<a.b.length;){var g=a.b[h],l=h*a.f,k=a.f-(e-l);k>f&&(k=f);if(g&&g.size){if(g.type==d){if(e+f<=g.oa)return g.Ja+=g.oa-e,g.oa=e,!0;if(e>=g.oa+g.Ja){k=g.size-(e-l);k>f&&(k=f);g.Ja=e-g.oa+k;e=l+a.f;f-=k;h++;continue}}return Wa(1,e,f)}e=new C(e,k,a.f,d);Ua(e,a.I,g);a.b[h++]=e;e=l+a.f;f-=k}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Xa[d]+" at "+("0x"+n(b,4))),!0):Wa(2,b,c)}
Ta.prototype.F=function(a){return this.b[(a&this.i)>>>this.c].xa(a&this.g,a)};function Ya(a,b){var c=b&a.g,d=(b&a.i)>>>a.c;return c!=a.g?a.b[d].tb(c,b):a.b[d++].xa(c,b)|a.b[d&a.u].xa(0,b+1)<<8}Ta.prototype.P=function(a,b){this.b[(a&this.i)>>>this.c].ya(a&this.g,b&255,a)};function Za(a,b,c){a.b[(b&a.i)>>>a.c].cb(b&a.g,c&255,b)}function $a(a,b,c){var d=b&a.g,e=(b&a.i)>>>a.c;d!=a.g?a.b[e].ub(d,c&65535,b):(a.b[e++].ya(d,c&255,b),a.b[e&a.u].ya(0,c>>8&255,b+1))}
Ta.prototype.F=function(a){return this.b[(a&this.i)>>>this.c].xa(a&this.g,a)};function Ya(a,b){var c=b&a.g,d=(b&a.i)>>>a.c;return c!=a.g?a.b[d].tb(c,b):a.b[d++].xa(c,b)|a.b[d&a.u].xa(0,b+1)<<8}Ta.prototype.P=function(a,b){this.b[(a&this.i)>>>this.c].ya(a&this.g,b&255,a)};function $a(a,b,c){a.b[(b&a.i)>>>a.c].cb(b&a.g,c&255,b)}function ab(a,b,c){var d=b&a.g,e=(b&a.i)>>>a.c;d!=a.g?a.b[e].ub(d,c&65535,b):(a.b[e++].ya(d,c&255,b),a.b[e&a.u].ya(0,c>>8&255,b+1))}
function Wa(a,b,c){r("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var bb;if(Oa){var cb=new ArrayBuffer(2);(new DataView(cb)).setUint16(0,256,!0);bb=256===(new Uint16Array(cb))[0]}else bb=!1;var db=bb;
function C(a,b,c,d){this.id=eb+=2;this.a=null;this.oa=a;this.Ja=b;this.size=c||0;this.type=d||fb;this.g=d==gb;Ua(this);this.U=this.Ta=!1;if(c)if(Oa)this.c=new ArrayBuffer(c),this.f=new DataView(this.c,0,c),this.b=new Uint8Array(this.c,0,c),this.o=new Uint16Array(this.c,0,c>>1),this.a=new Int32Array(this.c,0,c>>2),hb(this,db?ib:jb);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;hb(this,kb)}else hb(this)}var fb=0,gb=2,Xa=["NONE","RAM","ROM","VID","H/W"],eb=0;
C.prototype={constructor:C,parent:null,save:function(){var a,b;if(Oa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.f.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(Oa)for(b=0;b<a.length;b++)this.f.setInt32(b<<2,a[b],!0);else this.a=a;return this.U=!0}return!1},l:function(){return 255},m:function(){},B:function(a,b){return this.xa(a++,b++)|this.xa(a,b)<<8},u:function(a,b,c){this.ya(a++,b&255,c++);this.ya(a,b>>8,c)},D:function(a){return this.a[a>>
@ -35,26 +35,26 @@ m.O=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.B[b
case "speed":this.B[b]=c;a=!0;break;case "setSpeed":this.B[b]=c,c.onclick=function(){xb(d,d.c.ma<<1,!0)},c.textContent=this.c.ja.toFixed(2)+"Mhz",a=!0}return a};function yb(a,b,c){a.M+=b;c&&(a.L=a.a=0)}
function zb(a,b){var c=30;c<a.Y&&(c=a.Y);2>c&&(c=2);var d=1;b&&1<a.c.ma&&a.c.ea&&(d=a.c.ea/a.c.La);a.c.Xa=Math.round(1E3/30);a.c.nb=Math.floor(a.c.na/c*d);a.c.Ma=Math.floor(a.c.na/30*d);a.c.Za=Math.floor(a.c.na/a.Y*d);a.c.Ya=Math.floor(a.c.na/2*d);b||(a.c.ua=a.c.Ma,a.c.ta=a.c.Za,a.c.sa=a.c.Ya);a.c.Na=0}function Ab(a){return a.M+a.K+a.L-a.a}function sb(a){a.c.ea=0;a.M=a.K=a.L=a.a=0;tb(a);xb(a,1)}
function xb(a,b,c){if(void 0!==b){.8>a.c.ea/a.c.ja&&(b=1);a.c.ma=b;b=a.c.La*a.c.ma;if(a.c.ja!=b){a.c.ja=b;b=a.c.ja.toFixed(2)+"Mhz";var d=a.B.setSpeed;d&&(d.textContent=b);a.R("target speed: "+b)}c&&a.u&&Bb(a.u)}yb(a,a.K);a.K=0;a.c.ka=ia();a.c.fa=0;zb(a)}
m.Pa=function(a){if(Ka(this,!0)){if(!this.h.V){xb(this);this.u&&this.u.start(this.c.ka,Ab(this));this.h.V=!0;this.h.Va=!0;this.G&&this.G.start();var b=this.B.run;b&&(b.textContent="Halt");this.u&&(this.u.ga(!0),a&&Bb(this.u,!0))}this.c.Na>=this.c.na&&zb(this,!0);this.c.va=0;this.c.Fa=ia();this.c.fa&&(a=this.c.Fa-this.c.fa,a>this.c.Xa&&(this.c.ka+=a,this.c.ka>this.c.Fa&&(this.c.ka=this.c.Fa)));try{do{this.bb(this.h.Ca?1:this.c.nb);var c=this.L-this.a;this.K+=c;this.c.va+=c;yb(this,0,!0);a=c;this.h.Ca&&
m.Pa=function(a){if(Ma(this,!0)){if(!this.h.V){xb(this);this.u&&this.u.start(this.c.ka,Ab(this));this.h.V=!0;this.h.Va=!0;this.G&&this.G.start();var b=this.B.run;b&&(b.textContent="Halt");this.u&&(this.u.ga(!0),a&&Bb(this.u,!0))}this.c.Na>=this.c.na&&zb(this,!0);this.c.va=0;this.c.Fa=ia();this.c.fa&&(a=this.c.Fa-this.c.fa,a>this.c.Xa&&(this.c.ka+=a,this.c.ka>this.c.Fa&&(this.c.ka=this.c.Fa)));try{do{this.bb(this.h.Ca?1:this.c.nb);var c=this.L-this.a;this.K+=c;this.c.va+=c;yb(this,0,!0);a=c;this.h.Ca&&
(b=!1,this.c.Ga=this.c.Ga+this.Wa()|0,this.c.la-=a,0>=this.c.la&&(this.c.la+=this.c.qa,b=!0),0<=this.c.ra&&this.c.ra<=Ab(this)&&(this.c.qa=this.c.ra=-1,tb(this),wb(this),b=!0),b&&this.R(Ab(this)+" cycles: checksum="+n(this.c.Ga)));this.c.ta-=c;0>=this.c.ta&&(this.c.ta+=this.c.Za,this.u&&Cb(this.u,this.c.Ia++),this.c.Ia>this.Y&&(this.c.Ia=0));this.c.sa-=c;0>=this.c.sa&&(this.c.sa+=this.c.Ya,this.u&&this.u.ga());this.c.ua-=c;if(0>=this.c.ua){this.c.ua+=this.c.Ma;break}}while(this.h.V)}catch(e){wb(this);
ub(this);this.u&&this.u.stop(ia(),Ab(this));Ka(this,!1);c=e.stack||e.message;this.h.da=!0;this.J(c);return}c=setTimeout;a=this.Ba;this.c.fa=ia();b=this.c.Xa;this.c.va&&(b=Math.round(b*this.c.va/this.c.Ma));var b=b-(this.c.fa-this.c.Fa),d=this.c.fa-this.c.ka;d&&(this.c.ea=Math.round(this.K/(10*d))/100,864E5<=d&&(this.M=0,xb(this)));if(0>b||this.c.ea<this.c.ja)b=0;this.c.Na+=this.c.va;this.c.fa+=b;c(a,b)}else ub(this),this.u&&this.u.stop(ia(),Ab(this))};m.bb=function(){return 0};
ub(this);this.u&&this.u.stop(ia(),Ab(this));Ma(this,!1);c=e.stack||e.message;this.h.da=!0;this.J(c);return}c=setTimeout;a=this.Ba;this.c.fa=ia();b=this.c.Xa;this.c.va&&(b=Math.round(b*this.c.va/this.c.Ma));var b=b-(this.c.fa-this.c.Fa),d=this.c.fa-this.c.ka;d&&(this.c.ea=Math.round(this.K/(10*d))/100,864E5<=d&&(this.M=0,xb(this)));if(0>b||this.c.ea<this.c.ja)b=0;this.c.Na+=this.c.va;this.c.fa+=b;c(a,b)}else ub(this),this.u&&this.u.stop(ia(),Ab(this))};m.bb=function(){return 0};
function wb(a,b){a.h.pa&&(a.h.Ka=!0);a.L-=a.a;a.a=0;yb(a,a.K);a.K=0;if(a.h.V){a.h.V=!1;a.G&&a.G.stop();var c=a.B.run;c&&(c.textContent="Run")}a.h.Da=b}function ub(a){a.u&&(Cb(a.u,-1),a.u.ga(void 0))}function Db(a){this.S=+a.model||8080;pb.call(this,a,1E6);this.aa=Eb;sb(this);this.h.Da=this.h.ib=!1;this.ca=0;this.T=[];this.ba=0;Fb(this)}w(Db,pb);function Gb(a,b){a.T.push(b)}m=Db.prototype;m.reset=function(){this.h.V&&wb(this);Fb(this);sb(this);this.h.da=!1;this.parent.reset.call(this)};
function Fb(a){a.b=0;a.f=0;a.v=0;a.g=0;a.w=0;a.i=0;a.j=0;a.A=0;D(a,a.ba);Hb(a,0);a.D=0}function Ib(a,b){a.ba=b;D(a,b)}m.Wa=function(){var a=this.b+this.f+this.v+this.g+this.w+this.i+this.j|0;return a=a+this.A+this.m+Jb(this)|0};
m.save=function(){var a=new E(this);F(a,0,[this.b,this.f,this.v,this.g,this.w,this.i,this.j,this.A,this.m,Jb(this)]);F(a,1,[this.D,this.M,this.c.ma]);for(var b=this.o,c=0,d=[],e=0;e<b.o;e++){var f=b.b[e];if(f.U||f.Ta){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,l=0,k=[];g<f.length;){for(var t=f[g],q=g+1;q<f.length&&f[q]===t;)q++;k[l++]=q-g;k[l++]=t;g=q}if(k.length<f.length){f=k;break a}}d[h]=f}}F(a,2,d);return a.data()};
m.restore=function(a){var b=a[0];this.b=b[0];this.f=b[1];this.v=b[2];this.g=b[3];this.w=b[4];this.i=b[5];this.j=b[6];this.A=b[7]&65535;D(this,b[8]);Hb(this,b[9]);b=a[1];this.D=b[0];this.M=b[1];xb(this,b[3]);a:{b=this.o;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.A){for(var f=0,h=Array(b.A),g=0;g<e.length-1;)for(var l=e[g++],k=e[g++];l--;)h[f++]=k;e=h}f=b.b[d];if(!f||!f.restore(e)){r("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
m.O=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "BC":case "D":case "E":case "DE":case "H":case "L":case "HL":case "SP":case "PC":case "PS":case "IF":case "SF":case "ZF":case "AF":case "PF":case "CF":this.B[b]=c;this.ca++;d=!0;break;default:d=this.parent.O.call(this,a,b,c)}return d};function Kb(a){return a.f<<8|a.v}function Lb(a,b){a.f=b>>8&255;a.v=b&255}function G(a){return a.g<<8|a.w}function Mb(a,b){a.g=b>>8&255;a.w=b&255}function H(a){return a.i<<8|a.j}
function J(a,b){a.i=b>>8&255;a.j=b&255}function D(a,b){a.m=b&65535}function K(a){return a.l&256?1:0}function L(a,b){a.l=a.l&255|b}function Nb(a){return Pa[a.s&255]?4:0}function Jb(a){return a.H&-214|(a.s&128?128:0)|(a.l&255?0:64)|((a.s^a.C)&16?16:0)|Nb(a)|K(a)}function Hb(a,b){a.l=a.s=a.C=0;b&1&&(a.l|=256);b&4||(a.s|=1);b&16&&(a.C|=16);b&64||(a.l|=255);b&128&&(a.s^=192);a.H=a.H&-726|b&512|2}function N(a,b){a.C=a.b^b;return a.s=(a.l=a.b+b)&255}
function O(a,b){a.C=a.b^b;return a.s=(a.l=a.b+b+(a.l&256?1:0))&255}function P(a,b){a.l=a.s=a.C=a.b&b;(a.b|b)&8&&(a.C^=16);return a.l}function Ob(a,b){a.C=b^255;b=a.s=b+255&255;a.l=a.l&-256|b;return b}function Pb(a,b){a.C=b;b=a.s=b+1&255;a.l=a.l&-256|b;return b}function Q(a,b){return a.s=a.l=a.C=a.b|b}function R(a,b){b^=255;a.C=a.b^b;return a.s=(a.l=a.b+b+1^256)&255}function S(a,b){b^=255;a.C=a.b^b;return a.s=(a.l=a.b+b+(a.l&256?0:1)^256)&255}function Qb(a,b){return a.s=a.l=a.C=a.b^b}m.F=function(a){return this.o.F(a)};
m.P=function(a,b){this.o.P(a,b)};function T(a){var b=a.F(a.m);D(a,a.m+1);return b}function U(a){var b=Ya(a.o,a.m);D(a,a.m+2);return b}function V(a){var b=Ya(a.o,a.A);a.A=a.A+2&65535;return b}function W(a,b){a.A=a.A-2&65535;$a(a.o,a.A,b)}function X(a,b,c,d){d=d||2;a.B[b]&&(void 0===c&&(a.h.da=!0,a.J("Value for "+b+" is invalid"),wb(a)),c=!a.h.V||a.h.Ua?n(c,d):"--------".substr(0,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))}
m.ga=function(a){this.ca&&(a||!this.h.V||this.h.Ua)&&(X(this,"A",this.b),X(this,"B",this.f),X(this,"C",this.v),X(this,"BC",Kb(this),4),X(this,"D",this.g),X(this,"E",this.w),X(this,"DE",G(this),4),X(this,"H",this.i),X(this,"L",this.j),X(this,"HL",H(this),4),X(this,"SP",this.A,4),X(this,"PC",this.m,4),a=Jb(this),X(this,"PS",a,4),X(this,"IF",a&512?1:0,1),X(this,"SF",a&128?1:0,1),X(this,"ZF",a&64?1:0,1),X(this,"AF",a&16?1:0,1),X(this,"PF",a&4?1:0,1),X(this,"CF",a&1?1:0,1));if(a=this.B.speed)a.textContent=
this.h.V&&this.c.ea?this.c.ea.toFixed(2)+"Mhz":"Stopped"};m.bb=function(a){this.h.Da=!0;this.h.ib=!1;this.h.Va=!1;this.L=this.a=a;do{if(a=this.D)this.D&8&&this.H&512?(a=199|(this.D&7)<<3,this.D&=-16,this.H&=-513,this.aa[a].call(this),a=!0):a=!1,a=!a;if(a&&this.D&16){this.a=0;break}this.aa[T(this)].call(this)}while(0<this.a);return this.h.Da?this.L-this.a:void 0===this.h.Da?0:-1};wa(function(){for(var a=z(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Db(d);Ja(d,c)}});
function Rb(){this.a-=4}function Sb(){D(this,U(this));this.a-=10}function Tb(){D(this,V(this));this.a-=10}function Ub(){var a=U(this);W(this,this.m);D(this,a);this.a-=17}
var Eb=[Rb,function(){Lb(this,U(this));this.a-=10},function(){this.P(Kb(this),this.b);this.a-=7},function(){Lb(this,Kb(this)+1);this.a-=5},function(){this.f=Pb(this,this.f);this.a-=5},function(){this.f=Ob(this,this.f);this.a-=5},function(){this.f=T(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|a>>8;L(this,a&256);this.a-=4},Rb,function(){var a;J(this,a=H(this)+Kb(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.F(Kb(this));this.a-=7},function(){Lb(this,Kb(this)-1);this.a-=5},function(){this.v=
Pb(this,this.v);this.a-=5},function(){this.v=Ob(this,this.v);this.a-=5},function(){this.v=T(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;L(this,a);this.a-=4},Rb,function(){Mb(this,U(this));this.a-=10},function(){this.P(G(this),this.b);this.a-=7},function(){Mb(this,G(this)+1);this.a-=5},function(){this.g=Pb(this,this.g);this.a-=5},function(){this.g=Ob(this,this.g);this.a-=5},function(){this.g=T(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|K(this);L(this,a&256);this.a-=
4},Rb,function(){var a;J(this,a=H(this)+G(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.F(G(this));this.a-=7},function(){Mb(this,G(this)-1);this.a-=5},function(){this.w=Pb(this,this.w);this.a-=5},function(){this.w=Ob(this,this.w);this.a-=5},function(){this.w=T(this);this.a-=7},function(){var a=this.b<<8;this.b=(K(this)<<8|this.b)>>1;L(this,a&256);this.a-=4},Rb,function(){J(this,U(this));this.a-=10},function(){var a=U(this);$a(this.o,a,H(this));this.a-=16},function(){J(this,H(this)+1);
this.a-=5},function(){this.i=Pb(this,this.i);this.a-=5},function(){this.i=Ob(this,this.i);this.a-=5},function(){this.i=T(this);this.a-=7},function(){var a=0,b=K(this);if((this.s^this.C)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=N(this,a);L(this,b?256:0);this.a-=4},Rb,function(){var a;J(this,a=H(this)+H(this));L(this,a>>8&256);this.a-=10},function(){var a;a=U(this);a=Ya(this.o,a);J(this,a);this.a-=16},function(){J(this,H(this)-1);this.a-=5},function(){this.j=Pb(this,this.j);this.a-=
5},function(){this.j=Ob(this,this.j);this.a-=5},function(){this.j=T(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},Rb,function(){this.A=U(this)&65535;this.a-=10},function(){this.P(U(this),this.b);this.a-=13},function(){this.A=this.A+1&65535;this.a-=5},function(){var a=H(this);this.P(a,Pb(this,this.F(a)));this.a-=10},function(){var a=H(this);this.P(a,Ob(this,this.F(a)));this.a-=10},function(){this.P(H(this),T(this));this.a-=10},function(){this.l|=256;this.a-=4},Rb,function(){var a;J(this,
a=H(this)+this.A);L(this,a>>8&256);this.a-=10},function(){this.b=this.F(U(this));this.a-=13},function(){this.A=this.A-1&65535;this.a-=5},function(){this.b=Pb(this,this.b);this.a-=5},function(){this.b=Ob(this,this.b);this.a-=5},function(){this.b=T(this);this.a-=7},function(){L(this,K(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.f=this.v;this.a-=5},function(){this.f=this.g;this.a-=5},function(){this.f=this.w;this.a-=5},function(){this.f=this.i;this.a-=5},function(){this.f=this.j;this.a-=
function O(a,b){a.C=a.b^b;return a.s=(a.l=a.b+b+(a.l&256?1:0))&255}function P(a,b){a.l=a.s=a.C=a.b&b;(a.b|b)&8&&(a.C^=16);return a.l}function Ob(a,b){a.C=b^255;b=a.s=b+255&255;a.l=a.l&-256|b;return b}function Pb(a,b){a.C=b;b=a.s=b+1&255;a.l=a.l&-256|b;return b}function Q(a,b){return a.s=a.l=a.C=a.b|b}function R(a,b){b^=255;a.C=a.b^b;return a.s=(a.l=a.b+b+1^256)&255}function S(a,b){b^=255;a.C=a.b^b;return a.s=(a.l=a.b+b+(a.l&256?0:1)^256)&255}function T(a,b){return a.s=a.l=a.C=a.b^b}m.F=function(a){return this.o.F(a)};
m.P=function(a,b){this.o.P(a,b)};function U(a){var b=a.F(a.m);D(a,a.m+1);return b}function V(a){var b=Ya(a.o,a.m);D(a,a.m+2);return b}function W(a){var b=Ya(a.o,a.A);a.A=a.A+2&65535;return b}function X(a,b){a.A=a.A-2&65535;ab(a.o,a.A,b)}function Y(a,b,c,d){d=d||2;a.B[b]&&(void 0===c&&(a.h.da=!0,a.J("Value for "+b+" is invalid"),wb(a)),c=!a.h.V||a.h.Ua?n(c,d):"--------".substr(0,d),a.B[b].textContent!=c&&(a.B[b].textContent=c))}
m.ga=function(a){this.ca&&(a||!this.h.V||this.h.Ua)&&(Y(this,"A",this.b),Y(this,"B",this.f),Y(this,"C",this.v),Y(this,"BC",Kb(this),4),Y(this,"D",this.g),Y(this,"E",this.w),Y(this,"DE",G(this),4),Y(this,"H",this.i),Y(this,"L",this.j),Y(this,"HL",H(this),4),Y(this,"SP",this.A,4),Y(this,"PC",this.m,4),a=Jb(this),Y(this,"PS",a,4),Y(this,"IF",a&512?1:0,1),Y(this,"SF",a&128?1:0,1),Y(this,"ZF",a&64?1:0,1),Y(this,"AF",a&16?1:0,1),Y(this,"PF",a&4?1:0,1),Y(this,"CF",a&1?1:0,1));if(a=this.B.speed)a.textContent=
this.h.V&&this.c.ea?this.c.ea.toFixed(2)+"Mhz":"Stopped"};m.bb=function(a){this.h.Da=!0;this.h.ib=!1;this.h.Va=!1;this.L=this.a=a;do{if(a=this.D)this.D&8&&this.H&512?(a=199|(this.D&7)<<3,this.D&=-16,this.H&=-513,this.aa[a].call(this),a=!0):a=!1,a=!a;if(a&&this.D&16){this.a=0;break}this.aa[U(this)].call(this)}while(0<this.a);return this.h.Da?this.L-this.a:void 0===this.h.Da?0:-1};wa(function(){for(var a=z(document,"pc8080","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Db(d);Ja(d,c)}});
function Qb(){this.a-=4}function Rb(){D(this,V(this));this.a-=10}function Sb(){D(this,W(this));this.a-=10}function Tb(){var a=V(this);X(this,this.m);D(this,a);this.a-=17}
var Eb=[Qb,function(){Lb(this,V(this));this.a-=10},function(){this.P(Kb(this),this.b);this.a-=7},function(){Lb(this,Kb(this)+1);this.a-=5},function(){this.f=Pb(this,this.f);this.a-=5},function(){this.f=Ob(this,this.f);this.a-=5},function(){this.f=U(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|a>>8;L(this,a&256);this.a-=4},Qb,function(){var a;J(this,a=H(this)+Kb(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.F(Kb(this));this.a-=7},function(){Lb(this,Kb(this)-1);this.a-=5},function(){this.v=
Pb(this,this.v);this.a-=5},function(){this.v=Ob(this,this.v);this.a-=5},function(){this.v=U(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;L(this,a);this.a-=4},Qb,function(){Mb(this,V(this));this.a-=10},function(){this.P(G(this),this.b);this.a-=7},function(){Mb(this,G(this)+1);this.a-=5},function(){this.g=Pb(this,this.g);this.a-=5},function(){this.g=Ob(this,this.g);this.a-=5},function(){this.g=U(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|K(this);L(this,a&256);this.a-=
4},Qb,function(){var a;J(this,a=H(this)+G(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.F(G(this));this.a-=7},function(){Mb(this,G(this)-1);this.a-=5},function(){this.w=Pb(this,this.w);this.a-=5},function(){this.w=Ob(this,this.w);this.a-=5},function(){this.w=U(this);this.a-=7},function(){var a=this.b<<8;this.b=(K(this)<<8|this.b)>>1;L(this,a&256);this.a-=4},Qb,function(){J(this,V(this));this.a-=10},function(){var a=V(this);ab(this.o,a,H(this));this.a-=16},function(){J(this,H(this)+1);
this.a-=5},function(){this.i=Pb(this,this.i);this.a-=5},function(){this.i=Ob(this,this.i);this.a-=5},function(){this.i=U(this);this.a-=7},function(){var a=0,b=K(this);if((this.s^this.C)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=N(this,a);L(this,b?256:0);this.a-=4},Qb,function(){var a;J(this,a=H(this)+H(this));L(this,a>>8&256);this.a-=10},function(){var a;a=V(this);a=Ya(this.o,a);J(this,a);this.a-=16},function(){J(this,H(this)-1);this.a-=5},function(){this.j=Pb(this,this.j);this.a-=
5},function(){this.j=Ob(this,this.j);this.a-=5},function(){this.j=U(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},Qb,function(){this.A=V(this)&65535;this.a-=10},function(){this.P(V(this),this.b);this.a-=13},function(){this.A=this.A+1&65535;this.a-=5},function(){var a=H(this);this.P(a,Pb(this,this.F(a)));this.a-=10},function(){var a=H(this);this.P(a,Ob(this,this.F(a)));this.a-=10},function(){this.P(H(this),U(this));this.a-=10},function(){this.l|=256;this.a-=4},Qb,function(){var a;J(this,
a=H(this)+this.A);L(this,a>>8&256);this.a-=10},function(){this.b=this.F(V(this));this.a-=13},function(){this.A=this.A-1&65535;this.a-=5},function(){this.b=Pb(this,this.b);this.a-=5},function(){this.b=Ob(this,this.b);this.a-=5},function(){this.b=U(this);this.a-=7},function(){L(this,K(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.f=this.v;this.a-=5},function(){this.f=this.g;this.a-=5},function(){this.f=this.w;this.a-=5},function(){this.f=this.i;this.a-=5},function(){this.f=this.j;this.a-=
5},function(){this.f=this.F(H(this));this.a-=7},function(){this.f=this.b;this.a-=5},function(){this.v=this.f;this.a-=5},function(){this.a-=5},function(){this.v=this.g;this.a-=5},function(){this.v=this.w;this.a-=5},function(){this.v=this.i;this.a-=5},function(){this.v=this.j;this.a-=5},function(){this.v=this.F(H(this));this.a-=7},function(){this.v=this.b;this.a-=5},function(){this.g=this.f;this.a-=5},function(){this.g=this.v;this.a-=5},function(){this.a-=5},function(){this.g=this.w;this.a-=5},function(){this.g=
this.i;this.a-=5},function(){this.g=this.j;this.a-=5},function(){this.g=this.F(H(this));this.a-=7},function(){this.g=this.b;this.a-=5},function(){this.w=this.f;this.a-=5},function(){this.w=this.v;this.a-=5},function(){this.w=this.g;this.a-=5},function(){this.a-=5},function(){this.w=this.i;this.a-=5},function(){this.w=this.j;this.a-=5},function(){this.w=this.F(H(this));this.a-=7},function(){this.w=this.b;this.a-=5},function(){this.i=this.f;this.a-=5},function(){this.i=this.v;this.a-=5},function(){this.i=
this.g;this.a-=5},function(){this.i=this.w;this.a-=5},function(){this.a-=5},function(){this.i=this.j;this.a-=5},function(){this.i=this.F(H(this));this.a-=7},function(){this.i=this.b;this.a-=5},function(){this.j=this.f;this.a-=5},function(){this.j=this.v;this.a-=5},function(){this.j=this.g;this.a-=5},function(){this.j=this.w;this.a-=5},function(){this.j=this.i;this.a-=5},function(){this.a-=5},function(){this.j=this.F(H(this));this.a-=7},function(){this.j=this.b;this.a-=5},function(){this.P(H(this),
@ -63,75 +63,75 @@ function(){this.b=this.g;this.a-=5},function(){this.b=this.w;this.a-=5},function
this.a-=7},function(){this.b=N(this,this.b);this.a-=4},function(){this.b=O(this,this.f);this.a-=4},function(){this.b=O(this,this.v);this.a-=4},function(){this.b=O(this,this.g);this.a-=4},function(){this.b=O(this,this.w);this.a-=4},function(){this.b=O(this,this.i);this.a-=4},function(){this.b=O(this,this.j);this.a-=4},function(){this.b=O(this,this.F(H(this)));this.a-=7},function(){this.b=O(this,this.b);this.a-=4},function(){this.b=R(this,this.f);this.a-=4},function(){this.b=R(this,this.v);this.a-=
4},function(){this.b=R(this,this.g);this.a-=4},function(){this.b=R(this,this.w);this.a-=4},function(){this.b=R(this,this.i);this.a-=4},function(){this.b=R(this,this.j);this.a-=4},function(){this.b=R(this,this.F(H(this)));this.a-=7},function(){this.b=R(this,this.b);this.a-=4},function(){this.b=S(this,this.f);this.a-=4},function(){this.b=S(this,this.v);this.a-=4},function(){this.b=S(this,this.g);this.a-=4},function(){this.b=S(this,this.w);this.a-=4},function(){this.b=S(this,this.i);this.a-=4},function(){this.b=
S(this,this.j);this.a-=4},function(){this.b=S(this,this.F(H(this)));this.a-=7},function(){this.b=S(this,this.b);this.a-=4},function(){this.b=P(this,this.f);this.a-=4},function(){this.b=P(this,this.v);this.a-=4},function(){this.b=P(this,this.g);this.a-=4},function(){this.b=P(this,this.w);this.a-=4},function(){this.b=P(this,this.i);this.a-=4},function(){this.b=P(this,this.j);this.a-=4},function(){this.b=P(this,this.F(H(this)));this.a-=7},function(){this.b=P(this,this.b);this.a-=4},function(){this.b=
Qb(this,this.f);this.a-=4},function(){this.b=Qb(this,this.v);this.a-=4},function(){this.b=Qb(this,this.g);this.a-=4},function(){this.b=Qb(this,this.w);this.a-=4},function(){this.b=Qb(this,this.i);this.a-=4},function(){this.b=Qb(this,this.j);this.a-=4},function(){this.b=Qb(this,this.F(H(this)));this.a-=7},function(){this.b=Qb(this,this.b);this.a-=4},function(){this.b=Q(this,this.f);this.a-=4},function(){this.b=Q(this,this.v);this.a-=4},function(){this.b=Q(this,this.g);this.a-=4},function(){this.b=
Q(this,this.w);this.a-=4},function(){this.b=Q(this,this.i);this.a-=4},function(){this.b=Q(this,this.j);this.a-=4},function(){this.b=Q(this,this.F(H(this)));this.a-=7},function(){this.b=Q(this,this.b);this.a-=4},function(){R(this,this.f);this.a-=4},function(){R(this,this.v);this.a-=4},function(){R(this,this.g);this.a-=4},function(){R(this,this.w);this.a-=4},function(){R(this,this.i);this.a-=4},function(){R(this,this.j);this.a-=4},function(){R(this,this.F(H(this)));this.a-=7},function(){R(this,this.b);
this.a-=4},function(){this.l&255&&(D(this,V(this)),this.a-=6);this.a-=5},function(){Lb(this,V(this));this.a-=10},function(){var a=U(this);this.l&255&&D(this,a);this.a-=10},Sb,function(){var a=U(this);this.l&255&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,Kb(this));this.a-=11},function(){this.b=N(this,T(this));this.a-=7},function(){W(this,this.m);D(this,0);this.a-=11},function(){this.l&255||(D(this,V(this)),this.a-=6);this.a-=5},Tb,function(){var a=U(this);this.l&255||D(this,
a);this.a-=10},Sb,function(){var a=U(this);this.l&255||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Ub,function(){this.b=O(this,T(this));this.a-=7},function(){W(this,this.m);D(this,8);this.a-=11},function(){K(this)||(D(this,V(this)),this.a-=6);this.a-=5},function(){Mb(this,V(this));this.a-=10},function(){var a=U(this);K(this)||D(this,a);this.a-=10},function(){for(var a=T(this),b=this.o,c=this.b,d=this.m+-2&65535,e=1,f=0;0<e;){var h=b.m[a],g=b.D[a]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==
h&&h[0])h[0](a,l,d);f+=g<<3;a+=g;e-=g}this.a-=10},function(){var a=U(this);K(this)||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,G(this));this.a-=11},function(){this.b=R(this,T(this));this.a-=7},function(){W(this,this.m);D(this,16);this.a-=11},function(){K(this)&&(D(this,V(this)),this.a-=6);this.a-=5},Tb,function(){var a=U(this);K(this)&&D(this,a);this.a-=10},function(){for(var a=T(this),b=this.o,c=this.m+-2&65535,d=1,e=0,f=0;0<d;){var h=b.l[a],g=b.C[a]||1,l=1==g?255:2==g?65535:
-1,k=l;void 0!==h&&h[0]&&(k=h[0](a,c),void 0===k?k=l:k&=l);e|=k<<f;f+=g<<3;a+=g;d-=g}this.b=e&255;this.a-=10},function(){var a=U(this);K(this)&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Ub,function(){this.b=S(this,T(this));this.a-=7},function(){W(this,this.m);D(this,24);this.a-=11},function(){Nb(this)||(D(this,V(this)),this.a-=6);this.a-=5},function(){J(this,V(this));this.a-=10},function(){var a=U(this);Nb(this)||D(this,a);this.a-=10},function(){var a=V(this);W(this,H(this));J(this,a);this.a-=
18},function(){var a=U(this);Nb(this)||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,H(this));this.a-=11},function(){this.b=P(this,T(this));this.a-=7},function(){W(this,this.m);D(this,32);this.a-=11},function(){Nb(this)&&(D(this,V(this)),this.a-=6);this.a-=5},function(){D(this,H(this));this.a-=5},function(){var a=U(this);Nb(this)&&D(this,a);this.a-=10},function(){var a=H(this);J(this,G(this));Mb(this,a);this.a-=5},function(){var a=U(this);Nb(this)&&(W(this,this.m),D(this,a),this.a-=
6);this.a-=11},Ub,function(){this.b=Qb(this,T(this));this.a-=7},function(){W(this,this.m);D(this,40);this.a-=11},function(){this.s&128||(D(this,V(this)),this.a-=6);this.a-=5},function(){var a=V(this);Hb(this,a&255|this.H&-256);this.b=a>>8;this.a-=10},function(){var a=U(this);this.s&128||D(this,a);this.a-=10},function(){this.H&=-513;this.a-=4},function(){var a=U(this);this.s&128||(W(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){W(this,Jb(this)&255|this.b<<8);this.a-=11},function(){this.b=
Q(this,T(this));this.a-=7},function(){W(this,this.m);D(this,48);this.a-=11},function(){this.s&128&&(D(this,V(this)),this.a-=6);this.a-=5},function(){this.A=H(this)&65535;this.a-=5},function(){var a=U(this);this.s&128&&D(this,a);this.a-=10},function(){this.H|=512;this.a-=4},function(){var a=U(this);this.s&128&&(W(this,this.m),D(this,a),this.a-=6);this.a-=11},Ub,function(){R(this,T(this));this.a-=7},function(){W(this,this.m);D(this,56);this.a-=11}];
function Y(a){u.call(this,"ChipSet",a,Y);var b=a.model;b&&!Vb[b]&&r("Unrecognized ChipSet model: "+b);this.S=Vb[b]||Wb;a.sound&&(this.m=null,window&&(this.m=window.AudioContext||window.webkitAudioContext),this.m&&new this.m);B(this)}w(Y);var Wb=1978.1,Vb={SI1978:Wb};m=Y.prototype;m.O=function(){return!1};
m.$=function(a,b,c,d){this.o=b;this.a=c;this.I=d;this.u=a;if(this.S==Wb){var e;a=Xb;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.l[g]?r("Input port 0x"+n(g,4)+" already registered"):c.l[g]=[h,!1]}var l;e=Yb;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.m[d]?r("Output port 0x"+n(d,4)+" already registered"):f.m[d]=[c,!1]}};
m.X=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.W=function(a){return a?this.save():!0};m.reset=function(){this.j=14;this.b=8;this.g=this.i=this.f=this.c=this.l=0};m.save=function(){var a=new E(this);this.S==Wb&&F(a,0,[this.j,this.b,this.l,this.c,this.f,this.g,this.i]);return a.data()};m.restore=function(a){a=a[0];this.S==Wb&&(this.j=a[0],this.b=a[1],this.l=a[2],this.c=a[3],this.f=a[4],this.g=a[5],this.i=a[6]);return!0};m.start=function(){};m.stop=function(){};
function Zb(a,b,c){a.b&=~b;c&&(a.b|=b)}m.kb=function(){return this.j};m.lb=function(){return this.b};m.mb=function(){return this.l};m.jb=function(){return this.c>>8-this.f&255};m.ob=function(a,b){this.f=b};m.qb=function(a,b){this.g=b};m.pb=function(a,b){this.c=b<<8|this.c>>8};m.rb=function(a,b){this.i=b};m.sb=function(){};var Xb={0:Y.prototype.kb,1:Y.prototype.lb,2:Y.prototype.mb,3:Y.prototype.jb},Yb={2:Y.prototype.ob,3:Y.prototype.qb,4:Y.prototype.pb,5:Y.prototype.rb,6:Y.prototype.sb};
wa(function(){for(var a=z(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Y(d);Ja(d,c)}});function $b(a){u.call(this,"ROM",a,$b);this.b=null;this.j=a.addr;this.c=a.size;this.l=a.writable;this.f=a.alias;this.g=a.file;this.m=da(this.g);if(this.g){a=this.g;var b=ea(this.m);"json"!=b&&"hex"!=b&&(a=la()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,f){ac(c,a,b,f)})}}w($b);var bc=[0,5];
$b.prototype.$=function(a,b,c,d){this.o=b;this.a=c;this.I=d;cc(this)};$b.prototype.X=function(){this.i&&(this.I&&this.I.a(this.id,this.j,this.c,this.i),delete this.i);return!0};$b.prototype.W=function(){return!0};
function ac(a,b,c,d){if(d)a.J("Unable to load system ROM (error "+d+": "+b+")");else{Ha(a.Qa,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.b=f;else if(h)for(a.b=Array(4*h.length),d=c=0;c<h.length;c++)a.b[d++]=h[c]&255,a.b[d++]=h[c]>>8&255,a.b[d++]=h[c]>>16&255,a.b[d++]=h[c]>>24&255;else a.b=e;a.i=e.symbols;if(!a.b.length){r("Empty ROM: "+b);return}if(1==a.b.length){r(a.b[0]);return}}catch(g){a.J("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
" ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=aa(b[e]);cc(a)}}
function cc(a){if(!La(a))if(!a.g)B(a);else if(a.b&&a.o){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size (0x"+n(a.b.length)+") does not match specified size ("+("0x"+n(a.c))+")";a.h.da=!0;a.J(b)}else if(dc(a,a.j)){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(var c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.o,h=d.c,g=[],l=d.j>>>f.c;0<h&&l<f.b.length;)g.push(f.b[l++]),h-=f.f;f=d.o;d=d.c;h=0;for(e>>>=f.c;0<d&&e<f.b.length;){l=g[h++];if(!l)break;f.b[e++]=l;d-=f.f}}delete a.b}B(a)}}
function dc(a,b){if(Va(a.o,b,a.c,a.l?1:gb)){var c;for(c=0;c<a.b.length;c++)Za(a.o,b+c,a.b[c]);if(a.l&&256==b){for(c=0;c<bc.length;c++)Za(a.o,bc[c],118);Gb(a.a,function(a){return function(b){if(0<=bc.indexOf(b)){var c=!1,h=a.a,g=a.I;if(5==b)switch(c=!0,h.v){case 2:ec(a,String.fromCharCode(h.w));break;case 9:for(var l=G(h),k="",t=255;t--;){var q=a.a.F(l++);if(36==q)break;k+=String.fromCharCode(q)}ec(a,k);break;default:c=!1}c?Tb.call(h):g&&(a.R("\nCP/M vector 0x"+n(b,4)),D(h,b),wb(g));b=!0}else b=!1;
return b}}(a));Ib(a.a,b)}return!0}return!1}function ec(a,b){b=b.replace(/\r/g,"");a.Z&&(a.Z.value+=b,a.Z.scrollTop=a.Z.scrollHeight)}wa(function(){for(var a=z(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new $b(d);Ja(d,c)}});function fc(a){u.call(this,"RAM",a,fc);this.f=a.addr;this.c=a.size;this.b=!1}w(fc);m=fc.prototype;m.$=function(a,b,c,d){this.o=b;this.a=c;this.I=d;B(this)};m.X=function(a,b){b||this.reset();return!0};m.W=function(a){return a?this.save():!0};
m.reset=function(){!this.b&&this.c&&Va(this.o,this.f,this.c,1)&&(this.b=!0);this.b||r("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};wa(function(){for(var a=z(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new fc(d);Ja(d,c)}});function gc(a){u.call(this,"Keyboard",a,gc);this.reset();B(this)}w(gc);var hc={"1p":49,"2p":50,coin:51,left:37,right:39,fire:32},ic={65:37,68:39,76:32};gc.prototype.reset=function(){this.a={}};
gc.prototype.O=function(a,b,c){var d=this;a=a+"-"+b;if(void 0===this.B[a])switch(b){case "kbd":return c.onkeydown=function(a){return kc(d,a,!0)},c.onkeyup=function(a){return kc(d,a,!1)},!0;default:if(void 0!==hc[b])return this.B[a]=c,a=function(a,b){return function(){lc(a,b,!0)}}(this,b),b=function(a,b){return function(){lc(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};
gc.prototype.$=function(a,b,c,d){this.I=d;this.G=Ra(a,"ChipSet")};function kc(a,b,c){var d=!0,e;a:{e=b.keyCode;e=ic[e]||e;for(var f in hc)if(hc[f]===e){e=f;break a}e=null}e&&(d=lc(a,e,c));d||b.preventDefault();return d}function lc(a,b,c){a.a[b]=c;if(a.G)switch(b){case "1p":Zb(a.G,4,c);break;case "2p":Zb(a.G,2,c);break;case "coin":Zb(a.G,1,c);break;case "left":Zb(a.G,32,c);break;case "right":Zb(a.G,64,c);break;case "fire":Zb(a.G,16,c)}return!1}
wa(function(){for(var a=z(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new gc(d);Ja(d,c)}});
function mc(a,b,c,d,e){var f=this;this.aa=ra("Gecko/");var h=["","moz","ms","webkit"];u.call(this,"Video",a,mc);this.K=a.screenWidth;this.A=a.screenHeight;this.S=a.bufferAddr;this.j=a.bufferCols;this.s=a.bufferRows;this.L=a.bufferBits||1;this.fb=a.bufferLeft||0;if(this.c=a.bufferRotate)this.c=this.c%360,0<this.c&&(this.c-=360),-90!=this.c&&(this.J("unsupported buffer rotation: "+this.c),this.c=0);this.gb=a.interruptRate;this.Y=a.refreshRate||60;this.g=b;this.i=c;this.C=(this.hb=d)||b||null;b=a.smoothing;
T(this,this.f);this.a-=4},function(){this.b=T(this,this.v);this.a-=4},function(){this.b=T(this,this.g);this.a-=4},function(){this.b=T(this,this.w);this.a-=4},function(){this.b=T(this,this.i);this.a-=4},function(){this.b=T(this,this.j);this.a-=4},function(){this.b=T(this,this.F(H(this)));this.a-=7},function(){this.b=T(this,this.b);this.a-=4},function(){this.b=Q(this,this.f);this.a-=4},function(){this.b=Q(this,this.v);this.a-=4},function(){this.b=Q(this,this.g);this.a-=4},function(){this.b=Q(this,this.w);
this.a-=4},function(){this.b=Q(this,this.i);this.a-=4},function(){this.b=Q(this,this.j);this.a-=4},function(){this.b=Q(this,this.F(H(this)));this.a-=7},function(){this.b=Q(this,this.b);this.a-=4},function(){R(this,this.f);this.a-=4},function(){R(this,this.v);this.a-=4},function(){R(this,this.g);this.a-=4},function(){R(this,this.w);this.a-=4},function(){R(this,this.i);this.a-=4},function(){R(this,this.j);this.a-=4},function(){R(this,this.F(H(this)));this.a-=7},function(){R(this,this.b);this.a-=4},
function(){this.l&255&&(D(this,W(this)),this.a-=6);this.a-=5},function(){Lb(this,W(this));this.a-=10},function(){var a=V(this);this.l&255&&D(this,a);this.a-=10},Rb,function(){var a=V(this);this.l&255&&(X(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){X(this,Kb(this));this.a-=11},function(){this.b=N(this,U(this));this.a-=7},function(){X(this,this.m);D(this,0);this.a-=11},function(){this.l&255||(D(this,W(this)),this.a-=6);this.a-=5},Sb,function(){var a=V(this);this.l&255||D(this,a);this.a-=
10},Rb,function(){var a=V(this);this.l&255||(X(this,this.m),D(this,a),this.a-=6);this.a-=11},Tb,function(){this.b=O(this,U(this));this.a-=7},function(){X(this,this.m);D(this,8);this.a-=11},function(){K(this)||(D(this,W(this)),this.a-=6);this.a-=5},function(){Mb(this,W(this));this.a-=10},function(){var a=V(this);K(this)||D(this,a);this.a-=10},function(){for(var a=U(this),b=this.o,c=this.b,d=this.m+-2&65535,e=1,f=0;0<e;){var h=b.m[a],g=b.D[a]||1,l=1==g?255:2==g?65535:-1,l=(c>>>=f)&l;if(void 0!==h&&
h[0])h[0](a,l,d);f+=g<<3;a+=g;e-=g}this.a-=10},function(){var a=V(this);K(this)||(X(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){X(this,G(this));this.a-=11},function(){this.b=R(this,U(this));this.a-=7},function(){X(this,this.m);D(this,16);this.a-=11},function(){K(this)&&(D(this,W(this)),this.a-=6);this.a-=5},Sb,function(){var a=V(this);K(this)&&D(this,a);this.a-=10},function(){for(var a=U(this),b=this.o,c=this.m+-2&65535,d=1,e=0,f=0;0<d;){var h=b.l[a],g=b.C[a]||1,l=1==g?255:2==g?65535:
-1,k=l;void 0!==h&&h[0]&&(k=h[0](a,c),void 0===k?k=l:k&=l);e|=k<<f;f+=g<<3;a+=g;d-=g}this.b=e&255;this.a-=10},function(){var a=V(this);K(this)&&(X(this,this.m),D(this,a),this.a-=6);this.a-=11},Tb,function(){this.b=S(this,U(this));this.a-=7},function(){X(this,this.m);D(this,24);this.a-=11},function(){Nb(this)||(D(this,W(this)),this.a-=6);this.a-=5},function(){J(this,W(this));this.a-=10},function(){var a=V(this);Nb(this)||D(this,a);this.a-=10},function(){var a=W(this);X(this,H(this));J(this,a);this.a-=
18},function(){var a=V(this);Nb(this)||(X(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){X(this,H(this));this.a-=11},function(){this.b=P(this,U(this));this.a-=7},function(){X(this,this.m);D(this,32);this.a-=11},function(){Nb(this)&&(D(this,W(this)),this.a-=6);this.a-=5},function(){D(this,H(this));this.a-=5},function(){var a=V(this);Nb(this)&&D(this,a);this.a-=10},function(){var a=H(this);J(this,G(this));Mb(this,a);this.a-=5},function(){var a=V(this);Nb(this)&&(X(this,this.m),D(this,a),this.a-=
6);this.a-=11},Tb,function(){this.b=T(this,U(this));this.a-=7},function(){X(this,this.m);D(this,40);this.a-=11},function(){this.s&128||(D(this,W(this)),this.a-=6);this.a-=5},function(){var a=W(this);Hb(this,a&255|this.H&-256);this.b=a>>8;this.a-=10},function(){var a=V(this);this.s&128||D(this,a);this.a-=10},function(){this.H&=-513;this.a-=4},function(){var a=V(this);this.s&128||(X(this,this.m),D(this,a),this.a-=6);this.a-=11},function(){X(this,Jb(this)&255|this.b<<8);this.a-=11},function(){this.b=
Q(this,U(this));this.a-=7},function(){X(this,this.m);D(this,48);this.a-=11},function(){this.s&128&&(D(this,W(this)),this.a-=6);this.a-=5},function(){this.A=H(this)&65535;this.a-=5},function(){var a=V(this);this.s&128&&D(this,a);this.a-=10},function(){this.H|=512;this.a-=4},function(){var a=V(this);this.s&128&&(X(this,this.m),D(this,a),this.a-=6);this.a-=11},Tb,function(){R(this,U(this));this.a-=7},function(){X(this,this.m);D(this,56);this.a-=11}];
function Z(a){u.call(this,"ChipSet",a,Z);var b=a.model;b&&!Ub[b]&&r("Unrecognized ChipSet model: "+b);this.S=Ub[b]||Vb;a.sound&&(this.m=null,window&&(this.m=window.AudioContext||window.webkitAudioContext),this.m&&new this.m);B(this)}w(Z);var Vb=1978.1,Ub={SI1978:Vb};m=Z.prototype;m.O=function(){return!1};
m.$=function(a,b,c,d){this.o=b;this.a=c;this.I=d;this.u=a;if(this.S==Vb){var e;a=Wb;void 0===e&&(e=0);for(var f in a){c=b;d=+f+e;var h=a[f].bind(this);if(void 0!==h)for(var g=+f+e;g<=d;g++)void 0!==c.l[g]?r("Input port 0x"+n(g,4)+" already registered"):c.l[g]=[h,!1]}var l;e=Xb;void 0===l&&(l=0);for(var k in e)if(f=b,a=+k+l,c=e[k].bind(this),void 0!==c)for(d=+k+l;d<=a;d++)void 0!==f.m[d]?r("Output port 0x"+n(d,4)+" already registered"):f.m[d]=[c,!1]}};
m.X=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};m.W=function(a){return a?this.save():!0};m.reset=function(){this.j=14;this.b=8;this.g=this.i=this.f=this.c=this.l=0};m.save=function(){var a=new E(this);this.S==Vb&&F(a,0,[this.j,this.b,this.l,this.c,this.f,this.g,this.i]);return a.data()};m.restore=function(a){a=a[0];this.S==Vb&&(this.j=a[0],this.b=a[1],this.l=a[2],this.c=a[3],this.f=a[4],this.g=a[5],this.i=a[6]);return!0};m.start=function(){};m.stop=function(){};
function Yb(a,b,c){a.b&=~b;c&&(a.b|=b)}m.kb=function(){return this.j};m.lb=function(){return this.b};m.mb=function(){return this.l};m.jb=function(){return this.c>>8-this.f&255};m.ob=function(a,b){this.f=b};m.qb=function(a,b){this.g=b};m.pb=function(a,b){this.c=b<<8|this.c>>8};m.rb=function(a,b){this.i=b};m.sb=function(){};var Wb={0:Z.prototype.kb,1:Z.prototype.lb,2:Z.prototype.mb,3:Z.prototype.jb},Xb={2:Z.prototype.ob,3:Z.prototype.qb,4:Z.prototype.pb,5:Z.prototype.rb,6:Z.prototype.sb};
wa(function(){for(var a=z(document,"pc8080","chipset"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Z(d);Ja(d,c)}});function Zb(a){u.call(this,"ROM",a,Zb);this.b=null;this.j=a.addr;this.c=a.size;this.l=a.writable;this.f=a.alias;this.g=a.file;this.m=da(this.g);if(this.g){a=this.g;var b=ea(this.m);"json"!=b&&"hex"!=b&&(a=la()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,f){$b(c,a,b,f)})}}w(Zb);var ac=[0,5];
Zb.prototype.$=function(a,b,c,d){this.o=b;this.a=c;this.I=d;bc(this)};Zb.prototype.X=function(){this.i&&(this.I&&this.I.a(this.id,this.j,this.c,this.i),delete this.i);return!0};Zb.prototype.W=function(){return!0};
function $b(a,b,c,d){if(d)a.J("Unable to load system ROM (error "+d+": "+b+")");else{Ha(a.Qa,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.b=f;else if(h)for(a.b=Array(4*h.length),d=c=0;c<h.length;c++)a.b[d++]=h[c]&255,a.b[d++]=h[c]>>8&255,a.b[d++]=h[c]>>16&255,a.b[d++]=h[c]>>24&255;else a.b=e;a.i=e.symbols;if(!a.b.length){r("Empty ROM: "+b);return}if(1==a.b.length){r(a.b[0]);return}}catch(g){a.J("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
" ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=ca(b[e]);bc(a)}}
function bc(a){if(!Na(a))if(!a.g)B(a);else if(a.b&&a.o){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size (0x"+n(a.b.length)+") does not match specified size ("+("0x"+n(a.c))+")";a.h.da=!0;a.J(b)}else if(cc(a,a.j)){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(var c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.o,h=d.c,g=[],l=d.j>>>f.c;0<h&&l<f.b.length;)g.push(f.b[l++]),h-=f.f;f=d.o;d=d.c;h=0;for(e>>>=f.c;0<d&&e<f.b.length;){l=g[h++];if(!l)break;f.b[e++]=l;d-=f.f}}delete a.b}B(a)}}
function cc(a,b){if(Va(a.o,b,a.c,a.l?1:gb)){var c;for(c=0;c<a.b.length;c++)$a(a.o,b+c,a.b[c]);if(a.l&&256==b){for(c=0;c<ac.length;c++)$a(a.o,ac[c],118);Gb(a.a,function(a){return function(b){if(0<=ac.indexOf(b)){var c=!1,h=a.a,g=a.I;if(5==b)switch(c=!0,h.v){case 2:dc(a,String.fromCharCode(h.w));break;case 9:for(var l=G(h),k="",t=255;t--;){var q=a.a.F(l++);if(36==q)break;k+=String.fromCharCode(q)}dc(a,k);break;default:c=!1}c?Sb.call(h):g&&(a.R("\nCP/M vector 0x"+n(b,4)),D(h,b),wb(g));b=!0}else b=!1;
return b}}(a));Ib(a.a,b)}return!0}return!1}function dc(a,b){b=b.replace(/\r/g,"");a.Z&&(a.Z.value+=b,a.Z.scrollTop=a.Z.scrollHeight)}wa(function(){for(var a=z(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Zb(d);Ja(d,c)}});function ec(a){u.call(this,"RAM",a,ec);this.f=a.addr;this.c=a.size;this.b=!1}w(ec);m=ec.prototype;m.$=function(a,b,c,d){this.o=b;this.a=c;this.I=d;B(this)};m.X=function(a,b){b||this.reset();return!0};m.W=function(a){return a?this.save():!0};
m.reset=function(){!this.b&&this.c&&Va(this.o,this.f,this.c,1)&&(this.b=!0);this.b||r("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};wa(function(){for(var a=z(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ec(d);Ja(d,c)}});function fc(a){u.call(this,"Keyboard",a,fc);this.reset();B(this)}w(fc);var gc={"1p":49,"2p":50,coin:51,left:37,right:39,fire:32},ic={65:37,68:39,76:32};fc.prototype.reset=function(){this.a={}};
fc.prototype.O=function(a,b,c){var d=this;a=a+"-"+b;if(void 0===this.B[a])switch(b){case "kbd":return c.onkeydown=function(a){return jc(d,a,!0)},c.onkeyup=function(a){return jc(d,a,!1)},!0;default:if(void 0!==gc[b])return this.B[a]=c,a=function(a,b){return function(){kc(a,b,!0)}}(this,b),b=function(a,b){return function(){kc(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};
fc.prototype.$=function(a,b,c,d){this.I=d;this.G=Ra(a,"ChipSet")};function jc(a,b,c){var d=!0,e;a:{e=b.keyCode;e=ic[e]||e;for(var f in gc)if(gc[f]===e){e=f;break a}e=null}e&&(d=kc(a,e,c));d||b.preventDefault();return d}function kc(a,b,c){a.a[b]=c;if(a.G)switch(b){case "1p":Yb(a.G,4,c);break;case "2p":Yb(a.G,2,c);break;case "coin":Yb(a.G,1,c);break;case "left":Yb(a.G,32,c);break;case "right":Yb(a.G,64,c);break;case "fire":Yb(a.G,16,c)}return!1}
wa(function(){for(var a=z(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new fc(d);Ja(d,c)}});
function lc(a,b,c,d,e){var f=this;this.aa=ra("Gecko/");var h=["","moz","ms","webkit"];u.call(this,"Video",a,lc);this.K=a.screenWidth;this.A=a.screenHeight;this.S=a.bufferAddr;this.j=a.bufferCols;this.s=a.bufferRows;this.L=a.bufferBits||1;this.fb=a.bufferLeft||0;if(this.c=a.bufferRotate)this.c=this.c%360,0<this.c&&(this.c-=360),-90!=this.c&&(this.J("unsupported buffer rotation: "+this.c),this.c=0);this.gb=a.interruptRate;this.Y=a.refreshRate||60;this.g=b;this.i=c;this.C=(this.hb=d)||b||null;b=a.smoothing;
(c=Ba.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)if(d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.i[d]){this.i[d]=b;break}if(this.f=a.screenRotate)this.f=this.f%360,0<this.f&&(this.f-=360),-90!=this.f?(this.J("unsupported screen rotation: "+this.f),this.f=0):(this.i.translate(0,this.A),this.i.rotate(this.f*Math.PI/180),this.i.scale(this.A/this.K,this.K/this.A));this.G=1<<this.L;this.m=Array(this.G+2);this.m[0]=[0,0,0,255];this.m[1]=[255,255,255,255];this.m[this.G+
0]=[255,255,0,255];this.m[this.G+1]=[0,255,0,255];a=this.j;b=this.s;this.c&&(a=this.s,b=this.j);this.ba=this.i.createImageData(a,b);this.l=document.createElement("canvas");this.l.width=a;this.l.height=b;this.eb=this.l.getContext("2d");if(this.b=e)if(this.b.ha=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.ha){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){nc(f,document.fullscreenElement||
document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){nc(f,null)},!1);break}}}w(mc);
mc.prototype.$=function(a,b,c,d){this.u=a;this.o=b;this.a=c;this.I=d;this.M=(this.j*this.L>>3)*this.s;Va(this.o,this.S,this.M,3)&&(this.ca=this.M>>1,this.Ba=16/this.L|0,this.T=!1,void 0===this.H||this.H.length!=this.ca)&&(this.H=Array(this.ca));(this.D=Ra(a,"Keyboard"))&&this.g&&this.D.O(this.hb?"textarea":"canvas","kbd",this.C);B(this)};
mc.prototype.O=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.B[b]=c,this.b&&this.b.ha?c.onclick=function(){d.ha()}:c.parentNode.removeChild(c),!0}return!1};
mc.prototype.ha=function(){var a=!1;if(this.b){if(this.b.ha){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.K/this.A;b>c&&(a=Math.round(c/b*100)+"%")}this.aa?(this.g.style.width=a,this.g.style.width=a,this.g.style.display="block",this.g.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.ha();a=!0}this.C&&this.C.focus()}return a};
function nc(a,b){!b&&a.b&&(a.aa?a.g.style.width=a.g.style.height="":a.b.style.width=a.b.style.height="")}
0]=[255,255,0,255];this.m[this.G+1]=[0,255,0,255];a=this.j;b=this.s;this.c&&(a=this.s,b=this.j);this.ba=this.i.createImageData(a,b);this.l=document.createElement("canvas");this.l.width=a;this.l.height=b;this.eb=this.l.getContext("2d");if(this.b=e)if(this.b.ha=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.ha){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){mc(f,document.fullscreenElement||
document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){mc(f,null)},!1);break}}}w(lc);
lc.prototype.$=function(a,b,c,d){this.u=a;this.o=b;this.a=c;this.I=d;this.M=(this.j*this.L>>3)*this.s;Va(this.o,this.S,this.M,3)&&(this.ca=this.M>>1,this.Ba=16/this.L|0,this.T=!1,void 0===this.H||this.H.length!=this.ca)&&(this.H=Array(this.ca));(this.D=Ra(a,"Keyboard"))&&this.g&&this.D.O(this.hb?"textarea":"canvas","kbd",this.C);B(this)};
lc.prototype.O=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.B[b]=c,this.b&&this.b.ha?c.onclick=function(){d.ha()}:c.parentNode.removeChild(c),!0}return!1};
lc.prototype.ha=function(){var a=!1;if(this.b){if(this.b.ha){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.K/this.A;b>c&&(a=Math.round(c/b*100)+"%")}this.aa?(this.g.style.width=a,this.g.style.width=a,this.g.style.display="block",this.g.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.ha();a=!0}this.C&&this.C.focus()}return a};
function mc(a,b){!b&&a.b&&(a.aa?a.g.style.width=a.g.style.height="":a.b.style.width=a.b.style.height="")}
wa(function(){for(var a=z(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=y(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; 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<=(window?window.navigator.userAgent:"").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||Ba.aspect);f&&.3<=f&&3.33>=f&&(va("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");ra("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new mc(d,e,h,f,c);Ja(d,c)}});
function E(a,b,c){this.id=a.id;this.key=oc(a,b,c);this.I=a.I;pc(this,a.$a)}function oc(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
E.prototype={constructor:E,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){pc(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}}};
function pc(a,b){a[a.id]={};b&&F(a,"parms",b);a.a=!1}function qc(a){var b=!0;if(oa()){var c=JSON.stringify(a[a.id]);qa(a.key,c)||(r("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function rc(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){r(c.message||c),b=!1}return b}function sc(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:oa()&&(b=pa(a.key))?(a[a.id]=b,a.a=!0):!1}function tc(a,b){return a[a.id][b]||null}function F(a,b,c){try{a[a.id][b]=c}catch(d){}}
function uc(a,b,c){u.call(this,"Computer",a,uc);this.h.N=!1;vc(this,b);this.C=rb(this,"autoPower",a);this.f=0;this.K=a.busWidth||a.buswidth;this.b=wc;this.s=null;this.l=this.H=!1;this.L=rb(this,"url")||"";(Math.random()+.1).toString(36);this.c=xc(this);if(this.a=Ia("CPU",this.id)){this.I=Ia("Debugger",this.id);this.j=[];for(b=null;b=Ra(this,"Video",b);)this.j.push(b);this.o=new Ta({id:this.Qa+".bus",busWidth:this.K},this.a,this.I);var d,e=x(this.id);if((this.g=Ia("Panel",this.id))&&this.g.Z)for(b=
0;b<e.length;b++)d=e[b],d.J=this.g.J,d.R=this.g.R,d.Z=this.g.Z;this.R(yc+" v"+Z+"\n"+zc+"\n"+Ac);for(b=0;b<e.length;b++)d=e[b],d.$&&d.$(this,this.o,this.a,this.I);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.u=d:this.b=parseInt(d,10));var f;if(a=rb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.l=!0,this.b=wc),this.b&&(this.A=new E(this,Z),sc(this.A)?b=null:delete this.A);!b&&this.b&&(b=Bc(this))&&(this.l=!0);if(b){var h=this;p(b,null,!0,function(a,b,c){c?(h.u=null,h.l=!1,h.J("Unable to load machine state from server (error "+
c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):(h.s=b,h.H=!0);B(h)})}else B(this);this.B.power||(this.C=!0);!c&&this.C&&Cc(this,this.wa)}else r("Unable to find CPU component")}w(uc);var yc="PC8080",Z="1.23.0",zc="Copyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>",Ac="License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>",wc=0;
function vc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.m=b}function rb(a,b,c){var d=b.toLowerCase(),d=Ba[b]||Ba[d];void 0===d&&a.m&&(d=a.m[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Cc(a,b,c){for(var d=x(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!La(f)){La(f,function(){Cc(a,b,c)});return}}b.call(a,c)}
function Dc(a,b){var c=new E(a,Z,"validate");if(sc(c)&&rc(c)){var d=tc(c,"timestamp"),e=b?tc(b,"timestamp"):"unknown";d!=e&&(a.J("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}m=uc.prototype;
m.wa=function(a){void 0===a&&(a=this.b||(this.s?1:wc));if(!this.f){this.f++;var b=!1,c=!1;this.G=!1;var d=this.A||new E(this,Z);if(-1==a)b=!0;else if(a>wc){if(sc(d,this.s)){this.i=new E(this,Z,"failsafe");sc(this.i)&&(Ec(this,d),a=2,pc(this.i));F(this.i,"timestamp",ja());qc(this.i);var e=this.b&&!this.l;if(1==a||ma("Click OK to restore the previous "+yc+" machine state, or CANCEL to reset the machine.")){if(c=rc(d)){var f=tc(d,"code"),h=tc(d,"data");f&&("ok"==f?sc(d,h):("error"==f&&"no machine state"!=
h?(this.J("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.R(f+": "+h),pc(d),sc(d)?(c=rc(d),e=!0):c=!1))}e&&Dc(this,c?d:null)}else 2==a&&d.clear()}else Dc(this);delete this.s;delete this.A}e=x(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=Fc(this,h,d,b,c));b=[d,a,c];-1!=a?Cc(this,this.Ra,b):this.Ra(b)}};
function Fc(a,b,c,d,e){if(!b.h.N){b.h.N=!0;if(b.X){var f=null;e&&((f=tc(c,b.id))||(f=tc(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.X(f,d)&&f&&(r("Unable to restore state for "+b.type),a.D&&!a.H?(c.clear(),a.b=wc,window&&window.location.reload()):a.G=!0,b.X(null),e=!1)}if(!d&&b.za)for(a=b.za.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
m.Ra=function(a){var b=a[0],c=0>a[1];a=a[2];this.M=!0;this.h.N=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.a&&(Fc(this,this.a,b,c,a),vb(this.a));this.G&&(Ec(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0};
function Ec(a,b){if(ma("There may be a problem with your "+yc+" machine.\n\nTo help us diagnose it, click OK to send this "+yc+" machine state to http://www.pcjs.org.")){var c=a.L,d=a.c||"",e=b.toString(),f=Z,h={};h.app=yc;h.ver=f;h.url=c;h.user=d;h.type="bug";h.data=e;p("http://www.pcjs.org/api/v1/report",h,!0)}}
function Gc(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new E(a,Z),h=new E(a,Z,"validate"),g=ja();F(h,"timestamp",g);F(f,"timestamp",g);F(f,"version","1.23.0");F(f,"url",window?window.location.href:null);F(f,"browser",window?window.navigator.userAgent:"");a.a&&a.a.W&&(c&&wb(a.a),d=a.a.W(b,c),"object"===typeof d&&F(f,a.a.id,d),c&&(a.a.h.N=!1,!1===d&&(e=null)));for(var g=x(a.id),l=0;l<g.length;l++){var k=g[l];k.h.N&&(k.W&&(d=k.W(b,c),"object"===typeof d&&F(f,k.id,d)),c&&(k.h.N=!1,!1===d&&(e=
null)))}e&&(c?(g=d=!1,b?(a.c&&Hc(a,a.c,f.toString()),qc(h)&&qc(f)||(e=null,d=g=!0)):a.b&&(d=!0,g=3==a.b),d&&f.clear(g)):e=f.toString());c&&(a.h.N=!1,b=a.B.power)&&(b.textContent="Power");a.f=0;return e}m.reset=function(){this.o&&this.o.reset&&this.o.reset();for(var a=x(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.o&&c.reset&&c.reset()}};m.start=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
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||Ba.aspect);f&&.3<=f&&3.33>=f&&(va("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");ra("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new lc(d,e,h,f,c);Ja(d,c)}});
function E(a,b,c){this.id=a.id;this.key=nc(a,b,c);this.I=a.I;oc(this,a.$a)}function nc(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
E.prototype={constructor:E,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){oc(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}}};
function oc(a,b){a[a.id]={};b&&F(a,"parms",b);a.a=!1}function pc(a){var b=!0;if(oa()){var c=JSON.stringify(a[a.id]);qa(a.key,c)||(r("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function qc(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){r(c.message||c),b=!1}return b}function rc(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:oa()&&(b=pa(a.key))?(a[a.id]=b,a.a=!0):!1}function sc(a,b){return a[a.id][b]||null}function F(a,b,c){try{a[a.id][b]=c}catch(d){}}
function tc(a,b,c){u.call(this,"Computer",a,tc);this.h.N=!1;uc(this,b);this.C=rb(this,"autoPower",a);this.f=0;this.K=a.busWidth||a.buswidth;this.b=vc;this.s=null;this.l=this.H=!1;this.L=rb(this,"url")||"";(Math.random()+.1).toString(36);this.c=wc(this);if(this.a=Ia("CPU",this.id)){this.I=Ia("Debugger",this.id);this.j=[];for(b=null;b=Ra(this,"Video",b);)this.j.push(b);this.o=new Ta({id:this.Qa+".bus",busWidth:this.K},this.a,this.I);var d,e=x(this.id);if((this.g=Ia("Panel",this.id))&&this.g.Z)for(b=
0;b<e.length;b++)d=e[b],d.J=this.g.J,d.R=this.g.R,d.Z=this.g.Z;this.R("PC8080 v1.23.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.$&&d.$(this,this.o,this.a,this.I);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.u=d:this.b=parseInt(d,10));var f;if(a=rb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.l=!0,this.b=vc),this.b&&(this.A=new E(this,"1.23.0"),rc(this.A)?b=null:delete this.A);
!b&&this.b&&(b=xc(this))&&(this.l=!0);if(b){var h=this;p(b,null,!0,function(a,b,c){c?(h.u=null,h.l=!1,h.J("Unable to load machine state from server (error "+c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):(h.s=b,h.H=!0);B(h)})}else B(this);this.B.power||(this.C=!0);!c&&this.C&&yc(this,this.wa)}else r("Unable to find CPU component")}w(tc);var vc=0;
function uc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.m=b}function rb(a,b,c){var d=b.toLowerCase(),d=Ba[b]||Ba[d];void 0===d&&a.m&&(d=a.m[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function yc(a,b,c){for(var d=x(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Na(f)){Na(f,function(){yc(a,b,c)});return}}b.call(a,c)}
function zc(a,b){var c=new E(a,"1.23.0","validate");if(rc(c)&&qc(c)){var d=sc(c,"timestamp"),e=b?sc(b,"timestamp"):"unknown";d!=e&&(a.J("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}m=tc.prototype;
m.wa=function(a){void 0===a&&(a=this.b||(this.s?1:vc));if(!this.f){this.f++;var b=!1,c=!1;this.G=!1;var d=this.A||new E(this,"1.23.0");if(-1==a)b=!0;else if(a>vc){if(rc(d,this.s)){this.i=new E(this,"1.23.0","failsafe");rc(this.i)&&(Ac(this,d),a=2,oc(this.i));F(this.i,"timestamp",ka());pc(this.i);var e=this.b&&!this.l;if(1==a||ma("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=qc(d)){var f=sc(d,"code"),h=sc(d,"data");f&&("ok"==f?rc(d,h):("error"==f&&
"no machine state"!=h?(this.J("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.R(f+": "+h),oc(d),rc(d)?(c=qc(d),e=!0):c=!1))}e&&zc(this,c?d:null)}else 2==a&&d.clear()}else zc(this);delete this.s;delete this.A}e=x(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=Bc(this,h,d,b,c));b=[d,a,c];-1!=a?yc(this,this.Ra,b):this.Ra(b)}};
function Bc(a,b,c,d,e){if(!b.h.N){b.h.N=!0;if(b.X){var f=null;e&&((f=sc(c,b.id))||(f=sc(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.X(f,d)&&f&&(r("Unable to restore state for "+b.type),a.D&&!a.H?(c.clear(),a.b=vc,window&&window.location.reload()):a.G=!0,b.X(null),e=!1)}if(!d&&b.za)for(a=b.za.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
m.Ra=function(a){var b=a[0],c=0>a[1];a=a[2];this.M=!0;this.h.N=!0;var d=this.B.power;d&&(d.textContent="Shutdown");this.a&&(Bc(this,this.a,b,c,a),vb(this.a));this.G&&(Ac(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0};
function Ac(a,b){if(ma("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.0"};e.url=a.L;e.user=c;e.type="bug";e.data=d;p("http://www.pcjs.org/api/v1/report",e,!0)}}
function Cc(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new E(a,"1.23.0"),h=new E(a,"1.23.0","validate"),g=ka();F(h,"timestamp",g);F(f,"timestamp",g);F(f,"version","1.23.0");F(f,"url",window?window.location.href:null);F(f,"browser",window?window.navigator.userAgent:"");a.a&&a.a.W&&(c&&wb(a.a),d=a.a.W(b,c),"object"===typeof d&&F(f,a.a.id,d),c&&(a.a.h.N=!1,!1===d&&(e=null)));for(var g=x(a.id),l=0;l<g.length;l++){var k=g[l];k.h.N&&(k.W&&(d=k.W(b,c),"object"===typeof d&&F(f,k.id,d)),c&&(k.h.N=
!1,!1===d&&(e=null)))}e&&(c?(g=d=!1,b?(a.c&&Dc(a,a.c,f.toString()),pc(h)&&pc(f)||(e=null,d=g=!0)):a.b&&(d=!0,g=3==a.b),d&&f.clear(g)):e=f.toString());c&&(a.h.N=!1,b=a.B.power)&&(b.textContent="Power");a.f=0;return e}m.reset=function(){this.o&&this.o.reset&&this.o.reset();for(var a=x(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.o&&c.reset&&c.reset()}};m.start=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
m.stop=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
m.O=function(a,b,c){var d=this;switch(b){case "power":return this.B[b]=c,c.onclick=function(){d.f||(d.h.N?Gc(d,!1,!0):Cc(d,d.wa))},!0;case "reset":return this.B[b]=c,c.onclick=function(){if(d.h.N&&!d.f)if(d.b&&!d.u){var a=ma("Click OK to save changes to this "+yc+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Gc(d,a,!0);!a&&d.D?window&&window.location.reload():d.wa(wc)}else d.reset(),d.a&&vb(d.a)},!0;case "save":if(fa(la(),"pcjs.org")){c.parentNode.removeChild(c);break}this.B[b]=
c;c.onclick=function(){var a=xc(d,!0);if(a){var b=!!(d.b&&!d.u||d.D),c=Gc(d,b);b?Hc(d,a,c):d.J("Resume disabled, machine state not saved")}};return!0}return!1};
function xc(a,b){var c=a.c;c||(c=pa("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=Ic(a,c))||a.J("The user ID is invalid."))):b&&a.J("Browser local storage is not available"));return c}
function Ic(a,b){a.c=null;var c=p(la()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(qa("user",c.data),a.c=c.data)}catch(e){r(e.message+" ("+d+")")}return a.c}function Bc(a){var b=null;a.c&&(b=la()+"/api/v1/user?req=load&user="+a.c+"&state="+oc(a,Z));return b}
function Hc(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=oc(a,Z);d.data=c;b=p(la()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.J("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.J(c),qa("user",""),a.c=null)}}
m.O=function(a,b,c){var d=this;switch(b){case "power":return this.B[b]=c,c.onclick=function(){d.f||(d.h.N?Cc(d,!1,!0):yc(d,d.wa))},!0;case "reset":return this.B[b]=c,c.onclick=function(){if(d.h.N&&!d.f)if(d.b&&!d.u){var a=ma("Click OK to save changes to this PC8080 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Cc(d,a,!0);!a&&d.D?window&&window.location.reload():d.wa(vc)}else d.reset(),d.a&&vb(d.a)},!0;case "save":if(fa(la(),"pcjs.org")){c.parentNode.removeChild(c);break}this.B[b]=
c;c.onclick=function(){var a=wc(d,!0);if(a){var b=!!(d.b&&!d.u||d.D),c=Cc(d,b);b?Dc(d,a,c):d.J("Resume disabled, machine state not saved")}};return!0}return!1};
function wc(a,b){var c=a.c;c||(c=pa("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=Ec(a,c))||a.J("The user ID is invalid."))):b&&a.J("Browser local storage is not available"));return c}
function Ec(a,b){a.c=null;var c=p(la()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(qa("user",c.data),a.c=c.data)}catch(e){r(e.message+" ("+d+")")}return a.c}function xc(a){var b=null;a.c&&(b=la()+"/api/v1/user?req=load&user="+a.c+"&state="+nc(a,"1.23.0"));return b}
function Dc(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=nc(a,"1.23.0");d.data=c;b=p(la()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.J("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.J(c),qa("user",""),a.c=null)}}
function Ra(a,b,c){a=x(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function Bb(a,b){if(a.j.length){var c=0,d=0;b&&window&&(c=window.scrollX,d=window.scrollY);var e=a.j[0];e.C&&e.C.focus();b&&window&&window.scrollTo(c,d)}}m.ga=function(a){this.a&&this.a.ga(a);this.g&&this.g.ga(a)};
function Cb(a,b){for(var c=0;c<a.j.length;c++)a:{var d=a.j[c];if(0<=b){if(b&1){d=d.a;d.D=d.D&-8|10;break a}var e=d.a;e.D=e.D&-8|9;if(e=d.T){for(var e=d.o,f=d.M,h=!0,g=d.S>>>e.c;0<f&&g<e.b.length;)e.b[g].U&&(e.b[g].U=h=!1,e.b[g].Ta=!0),f-=e.f,g++;e=h}if(e)break a}var g=d.S,l=g+d.M,k=0,t=0,q=0,e=d.j,ka=0,f=d.s,jc=h=0,Ma=d.L,Oc=(1<<Ma)-1;d.fb&&(Ma=-Ma,jc=16+Ma);for(;g<l;){var A;A=d.o;var ba=g,Na=ba&A.g,M=(ba&A.i)>>>A.c;A=Na!=A.g?A.b[M].ab(Na,ba):A.b[M++].Oa(Na,ba)|A.b[M&A.u].Oa(0,ba+1)<<8;if(d.T&&A===
d.H[k])t+=d.Ba;else{d.H[k]=A;(ba=jc)&&(A=A>>8|(A&255)<<8);t<e&&(e=t);for(Na=d.Ba;Na--;){var ca=A>>ba&Oc,M=d.ba,I=t++,ab=ca,ca=void 0,ca=d.c?(M.height-I-1)*M.width+q:I+q*M.width;ab&&(208<=I&&236>I?ab=d.G+0:28<=I&&72>I&&(ab=d.G+1));I=d.m[ab];ca*=I.length;M.data[ca]=I[0];M.data[ca+1]=I[1];M.data[ca+2]=I[2];M.data[ca+3]=I[3];ba+=Ma}t>ka&&(ka=t);q<f&&(f=q);q>=h&&(h=q+1)}g+=2;k++;if(t>=d.j&&(t=0,q++,q>d.s))break}d.T=!0;e<d.j&&(g=ka-e,h-=f,d.c&&(l=e,k=g,e=f,g=h,f=d.j-(l+k),h=k),d.eb.putImageData(d.ba,0,
0,e,f,g,h),d.i.drawImage(d.l,0,0,d.l.width,d.l.height,0,0,d.K,d.A))}}wa(function(){for(var a=z(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=z(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new uc(h,d,!0);Ja(h,f);h.C&&Cc(h,h.wa)}});sa.show.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ia("Computer",c.id))&&c.M&&!c.h.N&&c.wa(-1)}});
sa.exit.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ia("Computer",c.id))&&c.h.N&&Gc(c,!(!c.b||c.u),!0)}});var Jc=0;function Kc(a,b,c,d,e,f){e("Loading "+a+"...");p(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Lc(g,a,b,c,d,e,f)})}
function Lc(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Ha(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Mc(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
function Mc(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");p(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 l=g[0],k,t=/( [a-z]+=)(['"])(.*?)\2/g;k=t.exec(f);)l=0>l.indexOf(k[1])?l.replace(">",k[0]+">"):l.replace(new RegExp(k[1]+"(['\"])(.*?)\\1"),k[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);Mc(a,b,c)}})}else c(a,null)}
function Nc(a,b,c,d){function e(a){if(void 0===g){var b=h&&z(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ha(a))}function f(a){e("Error: "+a);l&&(--Jc||ya(!0));l=!1}var h,g,l=!0;Jc++;Ga[a]={};try{if(h=document.getElementById(a)){var k;if("object"==typeof resources&&(k=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=k:q.appendChild(document.createTextNode(k));t.appendChild(q)}c||
(c="/versions/pc8080/1.23.0/components.xsl");k=function(d,g){g?Kc(c,null,null,!1,e,function(d,k){if(k)if(Ha(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Jc||ya(!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),--Jc||ya(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Kc(b,a,d,!0,e,k):Lc(b,null,a,d,!1,e,k)}else f("missing machine element: "+a)}catch(ka){f(ka.message)}return l}window.embedPC8080=function(a,b,c,d){ya(!1);return Nc(a,b,c,d)};window.enableEvents=ya;window.sendEvent=za;
function Pc(a,b,c,d){if(!c&&b){d.push(b);a=Ga[d[0]];b=null;for(var e in a)if(fa(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?p(b,null,!0,function(a,b){Qc(b,d)}):Qc(null,d)}else r("Error ("+c+") requesting "+a)}
function Qc(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=Ga[f],l={},k;for(k in g){var t=g[k],q=ea(k);if("xml"==q){for(q=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[k]);){var ka=d[2];ka&&(g[ka]||(t=t.replace(d[0],"")))}d=k=da(k)}else"xsl"==q&&(e=k=da(k));l[k]=t}a&&(l[k="css"]=a);b[2]&&(l[k="parms"]=b[2]);b[3]&&(l[k="state"]=b[3]);d&&e?(k=JSON.stringify(l),h+=".js",c=c[1]+"var resources="+k+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
function Cb(a,b){for(var c=0;c<a.j.length;c++)a:{var d=a.j[c];if(0<=b){if(b&1){d=d.a;d.D=d.D&-8|10;break a}var e=d.a;e.D=e.D&-8|9;if(e=d.T){for(var e=d.o,f=d.M,h=!0,g=d.S>>>e.c;0<f&&g<e.b.length;)e.b[g].U&&(e.b[g].U=h=!1,e.b[g].Ta=!0),f-=e.f,g++;e=h}if(e)break a}var g=d.S,l=g+d.M,k=0,t=0,q=0,e=d.j,ja=0,f=d.s,hc=h=0,Ka=d.L,Kc=(1<<Ka)-1;d.fb&&(Ka=-Ka,hc=16+Ka);for(;g<l;){var A;A=d.o;var aa=g,La=aa&A.g,M=(aa&A.i)>>>A.c;A=La!=A.g?A.b[M].ab(La,aa):A.b[M++].Oa(La,aa)|A.b[M&A.u].Oa(0,aa+1)<<8;if(d.T&&A===
d.H[k])t+=d.Ba;else{d.H[k]=A;(aa=hc)&&(A=A>>8|(A&255)<<8);t<e&&(e=t);for(La=d.Ba;La--;){var ba=A>>aa&Kc,M=d.ba,I=t++,Za=ba,ba=void 0,ba=d.c?(M.height-I-1)*M.width+q:I+q*M.width;Za&&(208<=I&&236>I?Za=d.G+0:28<=I&&72>I&&(Za=d.G+1));I=d.m[Za];ba*=I.length;M.data[ba]=I[0];M.data[ba+1]=I[1];M.data[ba+2]=I[2];M.data[ba+3]=I[3];aa+=Ka}t>ja&&(ja=t);q<f&&(f=q);q>=h&&(h=q+1)}g+=2;k++;if(t>=d.j&&(t=0,q++,q>d.s))break}d.T=!0;e<d.j&&(g=ja-e,h-=f,d.c&&(l=e,k=g,e=f,g=h,f=d.j-(l+k),h=k),d.eb.putImageData(d.ba,0,
0,e,f,g,h),d.i.drawImage(d.l,0,0,d.l.width,d.l.height,0,0,d.K,d.A))}}wa(function(){for(var a=z(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=z(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new tc(h,d,!0);Ja(h,f);h.C&&yc(h,h.wa)}});sa.show.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ia("Computer",c.id))&&c.M&&!c.h.N&&c.wa(-1)}});
sa.exit.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ia("Computer",c.id))&&c.h.N&&Cc(c,!(!c.b||c.u),!0)}});var Fc=0;function Gc(a,b,c,d,e,f){e("Loading "+a+"...");p(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Hc(g,a,b,c,d,e,f)})}
function Hc(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Ha(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Ic(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
function Ic(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");p(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 l=g[0],k,t=/( [a-z]+=)(['"])(.*?)\2/g;k=t.exec(f);)l=0>l.indexOf(k[1])?l.replace(">",k[0]+">"):l.replace(new RegExp(k[1]+"(['\"])(.*?)\\1"),k[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);Ic(a,b,c)}})}else c(a,null)}
function Jc(a,b,c,d){function e(a){if(void 0===g){var b=h&&z(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ha(a))}function f(a){e("Error: "+a);l&&(--Fc||ya(!0));l=!1}var h,g,l=!0;Fc++;Ga[a]={};try{if(h=document.getElementById(a)){var k;if("object"==typeof resources&&(k=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=k:q.appendChild(document.createTextNode(k));t.appendChild(q)}c||
(c="/versions/pc8080/1.23.0/components.xsl");k=function(d,g){g?Gc(c,null,null,!1,e,function(d,k){if(k)if(Ha(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Fc||ya(!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),--Fc||ya(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Gc(b,a,d,!0,e,k):Hc(b,null,a,d,!1,e,k)}else f("missing machine element: "+a)}catch(ja){f(ja.message)}return l}window.embedPC8080=function(a,b,c,d){ya(!1);return Jc(a,b,c,d)};window.enableEvents=ya;window.sendEvent=za;
function Lc(a,b,c,d){if(!c&&b){d.push(b);a=Ga[d[0]];b=null;for(var e in a)if(fa(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?p(b,null,!0,function(a,b){Mc(b,d)}):Mc(null,d)}else r("Error ("+c+") requesting "+a)}
function Mc(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=Ga[f],l={},k;for(k in g){var t=g[k],q=ea(k);if("xml"==q){for(q=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[k]);){var ja=d[2];ja&&(g[ja]||(t=t.replace(d[0],"")))}d=k=da(k)}else"xsl"==q&&(e=k=da(k));l[k]=t}a&&(l[k="css"]=a);b[2]&&(l[k="parms"]=b[2]);b[3]&&(l[k="state"]=b[3]);d&&e?(k=JSON.stringify(l),h+=".js",c=c[1]+"var resources="+k+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),k=h,g=null,l="data:application/javascript,",l=ra("Firefox")?l+encodeURIComponent(c):l+encodeURI(c),k&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=l,g.download=k,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+k+"."):(window.open(l),c="Check your browser for a new window/tab containing the requested data"+(k?" ("+k+")":"")+"."),c+=', copy it to your web server as "'+h+'", and then add the following to your web page:\n\n',
c+='<div id="'+f+'"></div>\n',c+="...\n",c+='<script type="text/javascript" src="'+h+'">\x3c/script>\n',c+='<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n',c+="The machine should appear where the <div> is located.",r(c)):r("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=Ia("Computer",a),e=Ia("Debugger",a);if(d){var f=Gc(d,!0),h=d.m?JSON.stringify(d.m):null;b||(b="/versions/pcjs/1.23.0/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,$a:h}))return!0;p(b,null,!0,function(c,d,e){Pc(c,d,e,[a,da(b,!0),h,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();
window.savePC=function(a,b,c){var d=Ia("Computer",a),e=Ia("Debugger",a);if(d){var f=Cc(d,!0),h=d.m?JSON.stringify(d.m):null;b||(b="/versions/pcjs/1.23.0/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,$a:h}))return!0;p(b,null,!0,function(c,d,e){Lc(c,d,e,[a,da(b,!0),h,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();

View file

@ -11,8 +11,8 @@
<xsl:variable name="MACHINECLASS">pc</xsl:variable>
<xsl:variable name="CSSCLASS">pcjs</xsl:variable>
<xsl:variable name="APPCLASS">pcjs</xsl:variable>
<xsl:variable name="APPNAME">PCjs</xsl:variable>
<xsl:variable name="APPCLASS">pcx86</xsl:variable>
<xsl:variable name="APPNAME">PCx86</xsl:variable>
<xsl:variable name="APPVERSION">1.23.0</xsl:variable>
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>
@ -31,7 +31,7 @@
</xsl:template>
<xsl:template name="machine">
<xsl:param name="href">/devices/pc/machine/5150/mda/64kb/machine.xml</xsl:param>
<xsl:param name="href" select="''"/>
<xsl:param name="state" select="''"/>
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="$href"/></xsl:variable>
<xsl:apply-templates select="document($componentFile)/machine">

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff