From 980c2ac5ab3a90b1d1b436ea6015fe034d81aab4 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Mon, 17 Oct 2016 11:01:32 -0700 Subject: [PATCH] Updated PC8080 and PDPjs to support RAM images, eliminating the need for the old "writable ROM" kludge; RAM images can include their own load and exec addresses as part of the JSON file, but the RAM component can provide explicit overrides (if no load address is specified either way, the default load address is the starting RAM address) --- devices/pc8080/README.md | 4 +- devices/pc8080/machine/exerciser/README.md | 2 +- .../machine/exerciser/machine-8080ex1.xml | 3 +- .../machine/exerciser/machine-8080pre.xml | 3 +- .../machine/exerciser/machine-cputest.xml | 3 +- .../pc8080/machine/exerciser/machine-test.xml | 3 +- devices/pc8080/machine/exerciser/machine.xml | 3 +- devices/pc8080/ram/README.md | 21 + .../pc8080/{rom => ram}/exerciser/8080EX1.MAC | 0 .../{rom => ram}/exerciser/8080EX1.json | 0 .../{rom => ram}/exerciser/8080EXER.MAC | 0 .../{rom => ram}/exerciser/8080EXER.json | 0 .../pc8080/{rom => ram}/exerciser/8080PRE.MAC | 0 .../{rom => ram}/exerciser/8080PRE.json | 0 .../{rom => ram}/exerciser/CPUTEST.json | 0 .../pc8080/{rom => ram}/exerciser/README.md | 6 +- .../pc8080/{rom => ram}/exerciser/TEST.ASM | 0 .../pc8080/{rom => ram}/exerciser/TEST.json | 0 devices/pdp11/README.md | 4 +- devices/pdp11/machine/1120/README.md | 1 + .../pdp11/machine/1120/bootstrap/README.md | 10 + .../machine/1120/bootstrap/debugger/README.md | 11 + .../1120/bootstrap/debugger/machine.xml | 13 + .../pdp11/machine/1120/bootstrap/machine.xml | 12 + devices/pdp11/machine/1120/test/README.md | 2 +- .../machine/1120/test/debugger/machine.xml | 7 +- devices/pdp11/machine/1120/test/machine.xml | 8 +- .../machine/1170/panel/debugger/machine.xml | 5 +- devices/pdp11/machine/1170/panel/machine.xml | 5 +- .../machine/1170/test/debugger/machine.xml | 5 +- devices/pdp11/machine/1170/test/machine.xml | 5 +- .../machine/1170/vt100/debugger/machine.xml | 5 +- devices/pdp11/machine/1170/vt100/machine.xml | 5 +- devices/pdp11/ram/README.md | 11 + devices/pdp11/ram/bootdemo/README.md | 15 + .../boot.json => ram/bootdemo/bootdemo.json} | 0 .../boot.lst => ram/bootdemo/bootdemo.lst} | 0 .../boot.mac => ram/bootdemo/bootdemo.mac} | 0 devices/pdp11/ram/bootdemo/makefile | 11 + .../pdp11/{loader => ram/bootstrap}/README.md | 8 +- .../{loader => ram/bootstrap}/bootstrap.json | 4 +- .../{loader => ram/bootstrap}/bootstrap.lst | 0 devices/pdp11/rom/README.md | 8 +- devices/pdp11/rom/test/README.md | 13 - devices/pdp11/rom/test/makefile | 11 - docs/pcx86/examples/components.css | 2 +- docs/pcx86/examples/components.xsl | 34 +- modules/pc8080/lib/ram.js | 264 ++++++++-- modules/pc8080/lib/rom.js | 146 +----- modules/pdp11/lib/cpustate.js | 18 +- modules/pdp11/lib/ram.js | 124 ++++- modules/pdp11/lib/rom.js | 127 ++--- modules/shared/lib/weblib.js | 84 ++++ modules/shared/templates/components.xsl | 34 +- versions/pc8080/1.30.1/components.css | 2 +- versions/pc8080/1.30.1/components.xsl | 34 +- versions/pc8080/1.30.1/pc8080-dbg.js | 465 +++++++++--------- versions/pc8080/1.30.1/pc8080.js | 311 ++++++------ versions/pcx86/1.30.1/components.css | 2 +- versions/pcx86/1.30.1/components.xsl | 34 +- versions/pdpjs/1.30.1/components.css | 2 +- versions/pdpjs/1.30.1/components.xsl | 34 +- versions/pdpjs/1.30.1/pdp11-dbg.js | 396 +++++++-------- versions/pdpjs/1.30.1/pdp11.js | 301 ++++++------ 64 files changed, 1483 insertions(+), 1158 deletions(-) create mode 100644 devices/pc8080/ram/README.md rename devices/pc8080/{rom => ram}/exerciser/8080EX1.MAC (100%) rename devices/pc8080/{rom => ram}/exerciser/8080EX1.json (100%) rename devices/pc8080/{rom => ram}/exerciser/8080EXER.MAC (100%) rename devices/pc8080/{rom => ram}/exerciser/8080EXER.json (100%) rename devices/pc8080/{rom => ram}/exerciser/8080PRE.MAC (100%) rename devices/pc8080/{rom => ram}/exerciser/8080PRE.json (100%) rename devices/pc8080/{rom => ram}/exerciser/CPUTEST.json (100%) rename devices/pc8080/{rom => ram}/exerciser/README.md (70%) rename devices/pc8080/{rom => ram}/exerciser/TEST.ASM (100%) rename devices/pc8080/{rom => ram}/exerciser/TEST.json (100%) create mode 100644 devices/pdp11/machine/1120/bootstrap/README.md create mode 100644 devices/pdp11/machine/1120/bootstrap/debugger/README.md create mode 100644 devices/pdp11/machine/1120/bootstrap/debugger/machine.xml create mode 100644 devices/pdp11/machine/1120/bootstrap/machine.xml create mode 100644 devices/pdp11/ram/README.md create mode 100644 devices/pdp11/ram/bootdemo/README.md rename devices/pdp11/{rom/test/boot.json => ram/bootdemo/bootdemo.json} (100%) rename devices/pdp11/{rom/test/boot.lst => ram/bootdemo/bootdemo.lst} (100%) rename devices/pdp11/{rom/test/boot.mac => ram/bootdemo/bootdemo.mac} (100%) create mode 100644 devices/pdp11/ram/bootdemo/makefile rename devices/pdp11/{loader => ram/bootstrap}/README.md (93%) rename devices/pdp11/{loader => ram/bootstrap}/bootstrap.json (86%) rename devices/pdp11/{loader => ram/bootstrap}/bootstrap.lst (100%) delete mode 100644 devices/pdp11/rom/test/README.md delete mode 100644 devices/pdp11/rom/test/makefile diff --git a/devices/pc8080/README.md b/devices/pc8080/README.md index 2628e758c..70f0f05ba 100644 --- a/devices/pc8080/README.md +++ b/devices/pc8080/README.md @@ -13,8 +13,8 @@ All our [8080-Based Machines](machine/) are built from a collection of devices, * [Control Panels](panel/) * CPU (8080) * [Machines](machine/) -* RAM -* [ROMs](rom/) +* [RAM Images](ram/) +* [ROM Images](rom/) * Video Adapters Complete [machine configurations](machine/) are constructed from those devices. A machine configuration is a single XML file diff --git a/devices/pc8080/machine/exerciser/README.md b/devices/pc8080/machine/exerciser/README.md index 107ddc8cc..07c79e2d8 100644 --- a/devices/pc8080/machine/exerciser/README.md +++ b/devices/pc8080/machine/exerciser/README.md @@ -18,7 +18,7 @@ PCjs Project. The test machine below loads a copy of the [8080 Exerciser](https://web.archive.org/web/20151006085348/http://www.idb.me.uk/sunhillow/8080.html) -(specifically, [8080EX1](/devices/pc8080/rom/exerciser/8080EX1.MAC)) and intercepts the exerciser's CP/M console +(specifically, [8080EX1](/devices/pc8080/ram/exerciser/8080EX1.MAC)) and intercepts the exerciser's CP/M console calls so that you can see its progress in the Control Panel window. This is a "headless" test machine (no keyboard or display), so that's all you get. diff --git a/devices/pc8080/machine/exerciser/machine-8080ex1.xml b/devices/pc8080/machine/exerciser/machine-8080ex1.xml index d15f5cc0c..734dfa5d3 100644 --- a/devices/pc8080/machine/exerciser/machine-8080ex1.xml +++ b/devices/pc8080/machine/exerciser/machine-8080ex1.xml @@ -4,8 +4,7 @@ 8080 Exerciser Test Machine - - + diff --git a/devices/pc8080/machine/exerciser/machine-8080pre.xml b/devices/pc8080/machine/exerciser/machine-8080pre.xml index c43b27344..248ef7bff 100644 --- a/devices/pc8080/machine/exerciser/machine-8080pre.xml +++ b/devices/pc8080/machine/exerciser/machine-8080pre.xml @@ -4,8 +4,7 @@ 8080 Exerciser Preliminary Test Machine - - + diff --git a/devices/pc8080/machine/exerciser/machine-cputest.xml b/devices/pc8080/machine/exerciser/machine-cputest.xml index 7d65f4b52..c4773ab71 100644 --- a/devices/pc8080/machine/exerciser/machine-cputest.xml +++ b/devices/pc8080/machine/exerciser/machine-cputest.xml @@ -4,8 +4,7 @@ 8080 CPUTEST Machine - - + diff --git a/devices/pc8080/machine/exerciser/machine-test.xml b/devices/pc8080/machine/exerciser/machine-test.xml index 14bb853d4..fc3e6d764 100644 --- a/devices/pc8080/machine/exerciser/machine-test.xml +++ b/devices/pc8080/machine/exerciser/machine-test.xml @@ -4,8 +4,7 @@ 8080 "Kelly Smith" Test Machine - - + diff --git a/devices/pc8080/machine/exerciser/machine.xml b/devices/pc8080/machine/exerciser/machine.xml index d15f5cc0c..734dfa5d3 100644 --- a/devices/pc8080/machine/exerciser/machine.xml +++ b/devices/pc8080/machine/exerciser/machine.xml @@ -4,8 +4,7 @@ 8080 Exerciser Test Machine - - + diff --git a/devices/pc8080/ram/README.md b/devices/pc8080/ram/README.md new file mode 100644 index 000000000..e5ebd5ab2 --- /dev/null +++ b/devices/pc8080/ram/README.md @@ -0,0 +1,21 @@ +--- +layout: page +title: 8080-Based RAM Images +permalink: /devices/pc8080/ram/ +--- + +8080-Based RAM Images +--------------------- + +RAM images are added to machines by including a ** component in the machine XML configuration file +with the *file* attribute set to the filename of the image; eg: + +```xml + +``` + +The project currently contains the following 8080-based ROMs: + +* [8080 Exerciser Tests](exerciser/) +* [Space Invaders (1978)](invaders/) +* [DEC VT100 Terminal](vt100/) diff --git a/devices/pc8080/rom/exerciser/8080EX1.MAC b/devices/pc8080/ram/exerciser/8080EX1.MAC similarity index 100% rename from devices/pc8080/rom/exerciser/8080EX1.MAC rename to devices/pc8080/ram/exerciser/8080EX1.MAC diff --git a/devices/pc8080/rom/exerciser/8080EX1.json b/devices/pc8080/ram/exerciser/8080EX1.json similarity index 100% rename from devices/pc8080/rom/exerciser/8080EX1.json rename to devices/pc8080/ram/exerciser/8080EX1.json diff --git a/devices/pc8080/rom/exerciser/8080EXER.MAC b/devices/pc8080/ram/exerciser/8080EXER.MAC similarity index 100% rename from devices/pc8080/rom/exerciser/8080EXER.MAC rename to devices/pc8080/ram/exerciser/8080EXER.MAC diff --git a/devices/pc8080/rom/exerciser/8080EXER.json b/devices/pc8080/ram/exerciser/8080EXER.json similarity index 100% rename from devices/pc8080/rom/exerciser/8080EXER.json rename to devices/pc8080/ram/exerciser/8080EXER.json diff --git a/devices/pc8080/rom/exerciser/8080PRE.MAC b/devices/pc8080/ram/exerciser/8080PRE.MAC similarity index 100% rename from devices/pc8080/rom/exerciser/8080PRE.MAC rename to devices/pc8080/ram/exerciser/8080PRE.MAC diff --git a/devices/pc8080/rom/exerciser/8080PRE.json b/devices/pc8080/ram/exerciser/8080PRE.json similarity index 100% rename from devices/pc8080/rom/exerciser/8080PRE.json rename to devices/pc8080/ram/exerciser/8080PRE.json diff --git a/devices/pc8080/rom/exerciser/CPUTEST.json b/devices/pc8080/ram/exerciser/CPUTEST.json similarity index 100% rename from devices/pc8080/rom/exerciser/CPUTEST.json rename to devices/pc8080/ram/exerciser/CPUTEST.json diff --git a/devices/pc8080/rom/exerciser/README.md b/devices/pc8080/ram/exerciser/README.md similarity index 70% rename from devices/pc8080/rom/exerciser/README.md rename to devices/pc8080/ram/exerciser/README.md index 1a385bb28..279935e76 100644 --- a/devices/pc8080/rom/exerciser/README.md +++ b/devices/pc8080/ram/exerciser/README.md @@ -1,7 +1,9 @@ --- layout: page title: 8080 Exerciser Tests -permalink: /devices/pc8080/rom/exerciser/ +permalink: /devices/pc8080/ram/exerciser/ +redirect_from: + - /devices/pc8080/rom/exerciser/ --- 8080 Exerciser Tests @@ -12,4 +14,4 @@ permalink: /devices/pc8080/rom/exerciser/ * [8080PRE](8080PRE.MAC) Our [8080 Exerciser Test Machine](/devices/pc8080/machine/exerciser/) runs [8080EX1](8080EX1.MAC), -since it is the most comprehensive test and verifies strict compatibilty with the original Intel 8080. +since it is the most comprehensive test and verifies strict compatibility with the original Intel 8080. diff --git a/devices/pc8080/rom/exerciser/TEST.ASM b/devices/pc8080/ram/exerciser/TEST.ASM similarity index 100% rename from devices/pc8080/rom/exerciser/TEST.ASM rename to devices/pc8080/ram/exerciser/TEST.ASM diff --git a/devices/pc8080/rom/exerciser/TEST.json b/devices/pc8080/ram/exerciser/TEST.json similarity index 100% rename from devices/pc8080/rom/exerciser/TEST.json rename to devices/pc8080/ram/exerciser/TEST.json diff --git a/devices/pdp11/README.md b/devices/pdp11/README.md index 34379cd02..5f9648589 100644 --- a/devices/pdp11/README.md +++ b/devices/pdp11/README.md @@ -9,10 +9,10 @@ PDP-11 Device Configurations [PDP-11 Machines](/devices/pdp11/machine/) powered by [PDPjs](/modules/pdp11/) rely on a variety of devices and resources, including: -* [Loaders](loader/) * [Machines](machine/) * [Panels](panel/) -* [ROMs](rom/) +* [RAM Images](ram/) +* [ROM Images](rom/) Our collection of sample machines includes a [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) and [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/). diff --git a/devices/pdp11/machine/1120/README.md b/devices/pdp11/machine/1120/README.md index bde29e5ec..e3a8b5b76 100644 --- a/devices/pdp11/machine/1120/README.md +++ b/devices/pdp11/machine/1120/README.md @@ -10,3 +10,4 @@ PDP-11/20 Machine Configurations PCjs is adding support the following PDP-11/20 configurations: * [PDP-11/20 Test Machine](/devices/pdp11/machine/1120/test/) ([Debugger](/devices/pdp11/machine/1120/test/debugger/)) +* [PDP-11/20 with 16Kb and Bootstrap Loader](/devices/pdp11/machine/1120/bootstrap/) ([Debugger](/devices/pdp11/machine/1120/bootstrap/debugger/)) diff --git a/devices/pdp11/machine/1120/bootstrap/README.md b/devices/pdp11/machine/1120/bootstrap/README.md new file mode 100644 index 000000000..8e1fd45ca --- /dev/null +++ b/devices/pdp11/machine/1120/bootstrap/README.md @@ -0,0 +1,10 @@ +--- +layout: page +title: PDP-11/20 with 16Kb and Bootstrap Loader +permalink: /devices/pdp11/machine/1120/bootstrap/ +machines: + - id: test1120 + type: pdp11 +--- + +{% include machine.html id="test1120" %} diff --git a/devices/pdp11/machine/1120/bootstrap/debugger/README.md b/devices/pdp11/machine/1120/bootstrap/debugger/README.md new file mode 100644 index 000000000..1932330c3 --- /dev/null +++ b/devices/pdp11/machine/1120/bootstrap/debugger/README.md @@ -0,0 +1,11 @@ +--- +layout: page +title: PDP-11/20 with 16Kb, Bootstrap Loader, and Debugger +permalink: /devices/pdp11/machine/1120/bootstrap/debugger/ +machines: + - id: test1120 + type: pdp11 + debugger: true +--- + +{% include machine.html id="test1120" %} diff --git a/devices/pdp11/machine/1120/bootstrap/debugger/machine.xml b/devices/pdp11/machine/1120/bootstrap/debugger/machine.xml new file mode 100644 index 000000000..5126b2d90 --- /dev/null +++ b/devices/pdp11/machine/1120/bootstrap/debugger/machine.xml @@ -0,0 +1,13 @@ + + + + PDP-11/20: 16Kb, Bootstrap Loader, Debugger + + + + + + + + + diff --git a/devices/pdp11/machine/1120/bootstrap/machine.xml b/devices/pdp11/machine/1120/bootstrap/machine.xml new file mode 100644 index 000000000..0c8fe4b0e --- /dev/null +++ b/devices/pdp11/machine/1120/bootstrap/machine.xml @@ -0,0 +1,12 @@ + + + + PDP-11/20: 16Kb, Bootstrap Loader + + + + + + + + diff --git a/devices/pdp11/machine/1120/test/README.md b/devices/pdp11/machine/1120/test/README.md index 80613b2ec..009eb0bdf 100644 --- a/devices/pdp11/machine/1120/test/README.md +++ b/devices/pdp11/machine/1120/test/README.md @@ -1,6 +1,6 @@ --- layout: page -title: PDP-11/20 Test Machine +title: PDP-11/20 Test Machine permalink: /devices/pdp11/machine/1120/test/ machines: - id: test1120 diff --git a/devices/pdp11/machine/1120/test/debugger/machine.xml b/devices/pdp11/machine/1120/test/debugger/machine.xml index dc20b1d3d..fa6e6760e 100644 --- a/devices/pdp11/machine/1120/test/debugger/machine.xml +++ b/devices/pdp11/machine/1120/test/debugger/machine.xml @@ -1,11 +1,10 @@ - PDP-11/20 Test Machine with Debugger + PDP-11/20 Test Machine with 56Kb and Debugger - - - + + diff --git a/devices/pdp11/machine/1120/test/machine.xml b/devices/pdp11/machine/1120/test/machine.xml index 9e25546f2..f01522a86 100644 --- a/devices/pdp11/machine/1120/test/machine.xml +++ b/devices/pdp11/machine/1120/test/machine.xml @@ -1,12 +1,12 @@ - PDP-11/20 Test Machine + PDP-11/20 Test Machine with 56Kb - - - + + + diff --git a/devices/pdp11/machine/1170/panel/debugger/machine.xml b/devices/pdp11/machine/1170/panel/debugger/machine.xml index e5f973935..4fcdc1eab 100644 --- a/devices/pdp11/machine/1170/panel/debugger/machine.xml +++ b/devices/pdp11/machine/1170/panel/debugger/machine.xml @@ -3,9 +3,8 @@ PDP-11/70 with Front Panel and Debugger - - - + + diff --git a/devices/pdp11/machine/1170/panel/machine.xml b/devices/pdp11/machine/1170/panel/machine.xml index e69c04ad2..463841a98 100644 --- a/devices/pdp11/machine/1170/panel/machine.xml +++ b/devices/pdp11/machine/1170/panel/machine.xml @@ -3,9 +3,8 @@ PDP-11/70 with Front Panel - - - + + diff --git a/devices/pdp11/machine/1170/test/debugger/machine.xml b/devices/pdp11/machine/1170/test/debugger/machine.xml index 7351f82e9..5de64ce40 100644 --- a/devices/pdp11/machine/1170/test/debugger/machine.xml +++ b/devices/pdp11/machine/1170/test/debugger/machine.xml @@ -3,9 +3,8 @@ PDP-11/70 Test Machine with Debugger - - - + + diff --git a/devices/pdp11/machine/1170/test/machine.xml b/devices/pdp11/machine/1170/test/machine.xml index 779fee551..87e3736ee 100644 --- a/devices/pdp11/machine/1170/test/machine.xml +++ b/devices/pdp11/machine/1170/test/machine.xml @@ -3,9 +3,8 @@ PDP-11/70 Test Machine - - - + + diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine.xml b/devices/pdp11/machine/1170/vt100/debugger/machine.xml index 3ef3ce4af..71dce867a 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/machine.xml +++ b/devices/pdp11/machine/1170/vt100/debugger/machine.xml @@ -3,9 +3,8 @@ PDP-11/70 with Front Panel - - - + + diff --git a/devices/pdp11/machine/1170/vt100/machine.xml b/devices/pdp11/machine/1170/vt100/machine.xml index 2f9362178..69be2f3ee 100644 --- a/devices/pdp11/machine/1170/vt100/machine.xml +++ b/devices/pdp11/machine/1170/vt100/machine.xml @@ -3,9 +3,8 @@ PDP-11/70 with Front Panel - - - + + diff --git a/devices/pdp11/ram/README.md b/devices/pdp11/ram/README.md new file mode 100644 index 000000000..20cbf01d6 --- /dev/null +++ b/devices/pdp11/ram/README.md @@ -0,0 +1,11 @@ +--- +layout: page +title: PDP-11 RAM Images +permalink: /devices/pdp11/ram/ +--- + +PDP-11 RAM Images +----------------- + +* [PDP-11 Boot Demo](bootdemo/) +* [PDP-11 Bootstrap Loader](bootstrap/) diff --git a/devices/pdp11/ram/bootdemo/README.md b/devices/pdp11/ram/bootdemo/README.md new file mode 100644 index 000000000..9633f08aa --- /dev/null +++ b/devices/pdp11/ram/bootdemo/README.md @@ -0,0 +1,15 @@ +--- +layout: page +title: PDP-11 Boot Demo +permalink: /devices/pdp11/ram/bootdemo/ +redirect_from: + - /devices/pdp11/rom/test/ +--- + +PDP-11 Boot Demo +---------------- + +[BOOTDEMO.MAC](bootdemo.mac) is based on [BOOT.MAC](http://skn.noip.me/pdp11/boot.mac) written by [Paul Nankervis](mailto:paulnank@hotmail.com)) + +[BOOTDEMO.MAC](bootdemo.mac) was cross-assembled with [MACRO11](https://github.com/shattered/macro11) to produce [BOOTDEMO.LST](bootdemo.lst), +which was then processed by [FileDump](/modules/filedump/) to produce [BOOTDEMO.JSON](bootdemo.json). diff --git a/devices/pdp11/rom/test/boot.json b/devices/pdp11/ram/bootdemo/bootdemo.json similarity index 100% rename from devices/pdp11/rom/test/boot.json rename to devices/pdp11/ram/bootdemo/bootdemo.json diff --git a/devices/pdp11/rom/test/boot.lst b/devices/pdp11/ram/bootdemo/bootdemo.lst similarity index 100% rename from devices/pdp11/rom/test/boot.lst rename to devices/pdp11/ram/bootdemo/bootdemo.lst diff --git a/devices/pdp11/rom/test/boot.mac b/devices/pdp11/ram/bootdemo/bootdemo.mac similarity index 100% rename from devices/pdp11/rom/test/boot.mac rename to devices/pdp11/ram/bootdemo/bootdemo.mac diff --git a/devices/pdp11/ram/bootdemo/makefile b/devices/pdp11/ram/bootdemo/makefile new file mode 100644 index 000000000..d371c4914 --- /dev/null +++ b/devices/pdp11/ram/bootdemo/makefile @@ -0,0 +1,11 @@ +# +# Don't have macro11? Make yourself a copy from https://github.com/shattered/macro11 +# + +all: bootdemo.json + +bootdemo.lst: bootdemo.mac + macro11 bootdemo.mac -l bootdemo.lst + +bootdemo.json: bootdemo.lst + node ../../../../modules/filedump/bin/filedump --file=bootdemo.lst --format=octal --output=bootdemo.json --overwrite diff --git a/devices/pdp11/loader/README.md b/devices/pdp11/ram/bootstrap/README.md similarity index 93% rename from devices/pdp11/loader/README.md rename to devices/pdp11/ram/bootstrap/README.md index 1def583b0..2e2f0735e 100644 --- a/devices/pdp11/loader/README.md +++ b/devices/pdp11/ram/bootstrap/README.md @@ -1,11 +1,11 @@ --- layout: page -title: PDP-11 Loaders -permalink: /devices/pdp11/loader/ +title: PDP-11 Bootstrap Loader +permalink: /devices/pdp11/ram/bootstrap/ --- -PDP-11 Loaders --------------- +PDP-11 Bootstrap Loader +----------------------- The blog post "[PDP-11 Paper Tape BASIC](http://avitech.com.au/?page_id=709)" describes the *Bootstrap Loader*, a small program used to load the *Absolute Loader*, which in turn loads the *PDP-11 BASIC Paper Tape*. diff --git a/devices/pdp11/loader/bootstrap.json b/devices/pdp11/ram/bootstrap/bootstrap.json similarity index 86% rename from devices/pdp11/loader/bootstrap.json rename to devices/pdp11/ram/bootstrap/bootstrap.json index edc54ec3e..0120e2f27 100644 --- a/devices/pdp11/loader/bootstrap.json +++ b/devices/pdp11/ram/bootstrap/bootstrap.json @@ -1,4 +1,4 @@ -{"words":[ +{"load":0x3FE4,"exec":0x3FE4,"words":[ 0x1DC1 /*016701*/,0x0016 /*000026*/,0x15C2 /*012702*/,0x00EA /*000352*/,0x0A89 /*005211*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x9C72 /*116162*/, 0x0002 /*000002*/,0x3F00 /*037400*/,0x0AB7 /*005267*/,0xFFEE /*177756*/,0x01F5 /*000765*/,0xFF68 /*177550*/] -} \ No newline at end of file +} diff --git a/devices/pdp11/loader/bootstrap.lst b/devices/pdp11/ram/bootstrap/bootstrap.lst similarity index 100% rename from devices/pdp11/loader/bootstrap.lst rename to devices/pdp11/ram/bootstrap/bootstrap.lst diff --git a/devices/pdp11/rom/README.md b/devices/pdp11/rom/README.md index c33d8afe3..d43e62260 100644 --- a/devices/pdp11/rom/README.md +++ b/devices/pdp11/rom/README.md @@ -1,10 +1,10 @@ --- layout: page -title: PDP-11 ROMs +title: PDP-11 ROM Images permalink: /devices/pdp11/rom/ --- -PDP-11 ROMs ------------ +PDP-11 ROM Images +----------------- -* [Test ROM](test/) (based on [BOOT.MAC](http://skn.noip.me/pdp11/boot.mac) written by [Paul Nankervis](mailto:paulnank@hotmail.com)) +Any ROM images added to the project will be stored here. diff --git a/devices/pdp11/rom/test/README.md b/devices/pdp11/rom/test/README.md deleted file mode 100644 index 343b55954..000000000 --- a/devices/pdp11/rom/test/README.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -layout: page -title: PDP-11 Test ROM -permalink: /devices/pdp11/rom/test/ ---- - -PDP-11 Test ROM ---------------- - -This isn't a ROM so much as a read-only image that can be loaded in RAM by the ROM component. - -[BOOT.MAC](boot.mac) was cross-assembled with [MACRO11](https://github.com/shattered/macro11) to produce [BOOT.LST](boot.lst), -which was then processed by [FileDump](/modules/filedump/) to produce [BOOT.JSON](boot.json). diff --git a/devices/pdp11/rom/test/makefile b/devices/pdp11/rom/test/makefile deleted file mode 100644 index ea582823e..000000000 --- a/devices/pdp11/rom/test/makefile +++ /dev/null @@ -1,11 +0,0 @@ -# -# Don't have macro11? Make yourself a copy from https://github.com/shattered/macro11 -# - -all: boot.json - -boot.lst: boot.mac - macro11 boot.mac -l boot.lst - -boot.json: boot.lst - node ../../../../modules/filedump/bin/filedump --file=boot.lst --format=octal --output=boot.json --overwrite diff --git a/docs/pcx86/examples/components.css b/docs/pcx86/examples/components.css index dc7dbc154..6fa42a7a7 100644 --- a/docs/pcx86/examples/components.css +++ b/docs/pcx86/examples/components.css @@ -85,7 +85,7 @@ } .pcjs-description, .pcjs-status { font-size: x-small; - line-height: 2em; + line-height: 2.8em; } .pcjs-key { border: 1px solid black; diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index a7246cf44..0d52ee7d3 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -580,9 +580,9 @@ null - + - + 0 @@ -610,7 +610,7 @@ - ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,resetAddr:,csStart:,csInterval:,csStop: + ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,addrReset:,csStart:,csInterval:,csStop: @@ -931,16 +931,10 @@ - - - - false - - rom - ,addr:,size:,alias:,file:'',notify:'',writable: + ,addr:,size:,alias:,file:'',notify:'' @@ -964,6 +958,24 @@ 0 + + + + + + + + + + null + + + + + + null + + @@ -973,7 +985,7 @@ ram - ,addr:,size:,test: + ,addr:,size:,file:'',load:,exec:,test: diff --git a/modules/pc8080/lib/ram.js b/modules/pc8080/lib/ram.js index f2920f65b..42b5692ec 100644 --- a/modules/pc8080/lib/ram.js +++ b/modules/pc8080/lib/ram.js @@ -31,11 +31,12 @@ if (NODE) { var str = require("../../shared/lib/strlib"); var web = require("../../shared/lib/weblib"); + var DumpAPI = require("../../shared/lib/dumpapi"); var Component = require("../../shared/lib/component"); var State = require("../../shared/lib/state"); var PC8080 = require("./defines"); + var CPUDef8080 = require("./cpudef"); var Memory8080 = require("./memory"); - var ROM8080 = require("./rom"); } /** @@ -45,6 +46,9 @@ if (NODE) { * * addr: starting physical address of RAM (default is 0) * size: amount of RAM, in bytes (default is 0, which means defer to motherboard switch settings) + * file: name of optional data file to load into RAM (default is "") + * load: optional file load address (overrides any load address specified in the data file; default is null) + * exec: optional file exec address (overrides any exec address specified in the data file; default is null) * * NOTE: We make a note of the specified size, but no memory is initially allocated for the RAM until the * Computer component calls powerUp(). @@ -57,14 +61,66 @@ function RAM8080(parmsRAM) { Component.call(this, "RAM", parmsRAM, RAM8080); + this.abInit = null; + this.aSymbols = null; + this.addrRAM = parmsRAM['addr']; this.sizeRAM = parmsRAM['size']; + this.nFileLoad = parmsRAM['load']; + this.nFileExec = parmsRAM['exec']; + this.fInstalled = (!!this.sizeRAM); // 0 is the default value for 'size' when none is specified this.fAllocated = false; + + this.sFilePath = parmsRAM['file']; + this.sFileName = str.getBaseName(this.sFilePath); + + if (this.sFilePath) { + var sFileURL = this.sFilePath; + if (DEBUG) this.log('load("' + sFileURL + '")'); + /* + * If the selected data file has a ".json" extension, then we assume it's pre-converted + * JSON-encoded data, so we load it as-is; ditto for ROM files with a ".hex" extension. + * Otherwise, we ask our server-side converter to return the file in a JSON-compatible format. + */ + var sFileExt = str.getExtension(this.sFileName); + if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) { + sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true'; + } + var ram = this; + web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) { + ram.doneLoad(sURL, sResponse, nErrorCode); + }); + } } Component.subclass(RAM8080); +RAM8080.CPM = { + BIOS: { + VECTOR: 0x0000 + }, + BDOS: { + VECTOR: 0x0005, + FUNC: { // function number (specified in regC) + RESET: 0x00, + CON_READ: 0x01, // output: A = L = ASCII character + CON_WRITE: 0x02, // input: E = ASCII character + AUX_READ: 0x03, // output: A = L = ASCII character + AUX_WRITE: 0x04, // input: E = ASCII character + PRN_WRITE: 0x05, // input: E = ASCII character + MEM_SIZE: 0x06, // output: base address of CCP (Console Command Processor), but which register? (perhaps moot if this was CP/M 1.3 only...) + CON_IO: 0x06, // input: E = ASCII character (or 0xFF to return ASCII character in A) + GET_IOBYTE: 0x07, + SET_IOBYTE: 0x08, + STR_WRITE: 0x09 // input: DE = address of string + } + }, + INIT: 0x100 +}; + +RAM8080.CPM.VECTORS = [RAM8080.CPM.BIOS.VECTOR, RAM8080.CPM.BDOS.VECTOR]; + /** * initBus(cmp, bus, cpu, dbg) * @@ -79,7 +135,7 @@ RAM8080.prototype.initBus = function(cmp, bus, cpu, dbg) this.bus = bus; this.cpu = cpu; this.dbg = dbg; - this.setReady(); + this.initRAM(); }; /** @@ -92,15 +148,12 @@ RAM8080.prototype.initBus = function(cmp, bus, cpu, dbg) */ RAM8080.prototype.powerUp = function(data, fRepower) { - if (!fRepower) { - /* - * The Computer powers up the CPU last, at which point CPUState state is restored, - * which includes the Bus state, and since we use the Bus to allocate all our memory, - * memory contents are already restored for us, so we don't need the usual restore - * logic. We just need to call reset(), to allocate memory for the RAM. - */ - this.reset(); - } + /* + * The Computer powers up the CPU last, at which point CPUState state is restored, + * which includes the Bus state, and since we use the Bus to allocate all our memory, + * memory contents are already restored for us, so we don't need the usual restore + * logic. + */ return true; }; @@ -120,7 +173,98 @@ RAM8080.prototype.powerDown = function(fSave, fShutdown) * our memory, memory contents are already saved for us, so we don't need the usual * save logic. */ - return (fSave)? this.save() : true; + return true; +}; + +/** + * doneLoad(sURL, sData, nErrorCode) + * + * @this {RAM8080} + * @param {string} sURL + * @param {string} sData + * @param {number} nErrorCode (response from server if anything other than 200) + */ +RAM8080.prototype.doneLoad = function(sURL, sData, nErrorCode) +{ + if (nErrorCode) { + this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")"); + return; + } + + Component.addMachineResource(this.idMachine, sURL, sData); + + var resource = web.parseMemoryResource(sURL, sData); + if (resource) { + this.abInit = resource.aBytes; + this.aSymbols = resource.aSymbols; + if (this.nFileLoad == null && resource.nLoad != null) this.nFileLoad = resource.nLoad; + if (this.nFileExec == null && resource.nExec != null) this.nFileExec = resource.nExec; + } else { + this.sFilePath = null; + } + this.initRAM(); +}; + +/** + * initRAM() + * + * This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place + * until after initBus() has received the Bus component AND doneLoad() has received the data. When both those + * criteria are satisfied, the component becomes "ready". + * + * @this {RAM8080} + */ +RAM8080.prototype.initRAM = function() +{ + if (!this.fAllocated && this.sizeRAM) { + if (this.bus.addMemory(this.addrRAM, this.sizeRAM, Memory8080.TYPE.RAM)) { + this.fAllocated = true; + } + } + if (!this.isReady()) { + if (!this.fAllocated) { + Component.error("No RAM allocated"); + } + else if (this.sFilePath) { + /* + * Too early... + */ + if (!this.abInit || !this.bus) return; + + var addr = this.addrRAM; + if (this.nFileLoad !== null) addr = this.nFileLoad; + for (var i = 0; i < this.abInit.length; i++) { + this.bus.setByteDirect(addr + i, this.abInit[i]); + } + + if (this.nFileExec !== null) { + /* + * Here's where we enable our "Fake CP/M" support, triggered by the user loading a "writable" ROM image + * at offset 0x100. Fake CP/M support works by installing HLT opcodes at well-known CP/M addresses + * (namely, 0x0000, which is the CP/M reset vector, and 0x0005, which is the CP/M system call vector) and + * then telling the CPU to call us whenever a HLT occurs, so we can check PC for one of these addresses. + */ + if (this.nFileExec == RAM8080.CPM.INIT) { + for (i = 0; i < RAM8080.CPM.VECTORS.length; i++) { + this.bus.setByteDirect(RAM8080.CPM.VECTORS[i], CPUDef8080.OPCODE.HLT); + } + + this.cpu.addHaltCheck(function(rom) { + return function(addr) { + return rom.checkCPMVector(addr) + }; + }(this)); + } + this.cpu.setReset(this.nFileExec); + } + + /* + * TODO: Consider an option to retain this data and give the user a way of restoring the initial contents. + */ + delete this.abInit; + } + this.setReady(); + } }; /** @@ -130,41 +274,99 @@ RAM8080.prototype.powerDown = function(fSave, fShutdown) */ RAM8080.prototype.reset = function() { - if (!this.fAllocated && this.sizeRAM) { - if (this.bus.addMemory(this.addrRAM, this.sizeRAM, Memory8080.TYPE.RAM)) { - this.fAllocated = true; + /* + * If you want to zero RAM on reset, then this would be a good place to do it. + */ +}; + +/** + * checkCPMVector(addr) + * + * @this {RAM8080} + * @param {number} addr (of the HLT opcode) + * @return {boolean} true if special processing performed, false if not + */ +RAM8080.prototype.checkCPMVector = function(addr) +{ + var i = RAM8080.CPM.VECTORS.indexOf(addr); + if (i >= 0) { + var fCPM = false; + var cpu = this.cpu; + var dbg = this.dbg; + if (addr == RAM8080.CPM.BDOS.VECTOR) { + fCPM = true; + switch(cpu.regC) { + case RAM8080.CPM.BDOS.FUNC.CON_WRITE: + this.writeCPMString(this.getCPMChar(cpu.regE)); + break; + case RAM8080.CPM.BDOS.FUNC.STR_WRITE: + this.writeCPMString(this.getCPMString(cpu.getDE(), '$')); + break; + default: + fCPM = false; + break; + } } + if (fCPM) { + CPUDef8080.opRET.call(cpu); // for recognized calls, automatically return + } + else if (dbg) { + this.println("\nCP/M vector " + str.toHexWord(addr)); + cpu.setPC(addr); // this is purely for the Debugger's benefit, to show the HLT + dbg.stopCPU(); + } + return true; } - if (!this.fAllocated) { - Component.error("No RAM allocated"); - } + return false; +}; + + +/** + * getCPMChar(ch) + * + * @this {RAM8080} + * @param {number} ch + * @return {string} + */ +RAM8080.prototype.getCPMChar = function(ch) +{ + return String.fromCharCode(ch); }; /** - * save() - * - * This implements save support for the RAM8080 component. + * getCPMString(addr, chEnd) * * @this {RAM8080} - * @return {Object} + * @param {number} addr (of a string) + * @param {string|number} [chEnd] (terminating character, default is 0) + * @return {string} */ -RAM8080.prototype.save = function() +RAM8080.prototype.getCPMString = function(addr, chEnd) { - return null; + var s = ""; + var cchMax = 255; + var bEnd = chEnd && chEnd.length && chEnd.charCodeAt(0) || chEnd || 0; + while (cchMax--) { + var b = this.cpu.getByte(addr++); + if (b == bEnd) break; + s += String.fromCharCode(b); + } + return s; }; /** - * restore(data) - * - * This implements restore support for the RAM8080 component. + * writeCPMString(s) * * @this {RAM8080} - * @param {Object} data - * @return {boolean} true if successful, false if failure + * @param {string} s */ -RAM8080.prototype.restore = function(data) +RAM8080.prototype.writeCPMString = function(s) { - return true; + s = s.replace(/\r/g, ''); + if (this.controlPrint) { + this.controlPrint.value += s; + this.controlPrint.scrollTop = this.controlPrint.scrollHeight; + } }; /** diff --git a/modules/pc8080/lib/rom.js b/modules/pc8080/lib/rom.js index 2e02eae08..a25ecfcae 100644 --- a/modules/pc8080/lib/rom.js +++ b/modules/pc8080/lib/rom.js @@ -34,7 +34,6 @@ if (NODE) { var DumpAPI = require("../../shared/lib/dumpapi"); var Component = require("../../shared/lib/component"); var PC8080 = require("./defines"); - var CPUDef8080 = require("./cpudef"); var Memory8080 = require("./memory"); } @@ -47,7 +46,6 @@ if (NODE) { * size: amount of ROM, in bytes * alias: physical alias address (null if none) * file: name of ROM data file - * writable: true to make ROM writable (default is false) * * NOTE: The ROM data will not be copied into place until the Bus is ready (see initBus()) AND the * ROM data file has finished loading (see doneLoad()). @@ -55,13 +53,6 @@ if (NODE) { * Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM you received * is the ROM you expected. * - * Finally, while making ROM "writable" may seem a contradiction in terms, I want to be able to load selected - * binary files into memory purely for testing purposes, and the RAM component has no "file" option, so the - * simplest solution was to add the option to load binary files into memory as "writable" ROMs. - * - * Moreover, if a "writable" ROM is installed at addr 0x100, that triggers our "Fake CP/M" support, providing - * a quick-and-dirty means of loading simple CP/M test binaries. See addROM() for details. - * * @constructor * @extends Component * @param {Object} parmsROM @@ -73,7 +64,7 @@ function ROM8080(parmsROM) this.abROM = null; this.addrROM = parmsROM['addr']; this.sizeROM = parmsROM['size']; - this.fWritable = parmsROM['writable']; + /* * The new 'alias' property can now be EITHER a single physical address (like 'addr') OR an array of @@ -112,30 +103,6 @@ function ROM8080(parmsROM) Component.subclass(ROM8080); -ROM8080.CPM = { - BIOS: { - VECTOR: 0x0000 - }, - BDOS: { - VECTOR: 0x0005, - FUNC: { // function number (specified in regC) - RESET: 0x00, - CON_READ: 0x01, // output: A = L = ASCII character - CON_WRITE: 0x02, // input: E = ASCII character - AUX_READ: 0x03, // output: A = L = ASCII character - AUX_WRITE: 0x04, // input: E = ASCII character - PRN_WRITE: 0x05, // input: E = ASCII character - MEM_SIZE: 0x06, // output: base address of CCP (Console Command Processor), but which register? (perhaps moot if this was CP/M 1.3 only...) - CON_IO: 0x06, // input: E = ASCII character (or 0xFF to return ASCII character in A) - GET_IOBYTE: 0x07, - SET_IOBYTE: 0x08, - STR_WRITE: 0x09 // input: DE = address of string - } - } -}; - -ROM8080.CPM.VECTORS = [ROM8080.CPM.BIOS.VECTOR, ROM8080.CPM.BDOS.VECTOR]; - /* * NOTE: There's currently no need for this component to have a reset() function, since * once the ROM data is loaded, it can't be changed, so there's nothing to reinitialize. @@ -350,31 +317,12 @@ ROM8080.prototype.copyROM = function() */ ROM8080.prototype.addROM = function(addr) { - if (this.bus.addMemory(addr, this.sizeROM, this.fWritable? Memory8080.TYPE.RAM : Memory8080.TYPE.ROM)) { + if (this.bus.addMemory(addr, this.sizeROM, Memory8080.TYPE.ROM)) { if (DEBUG) this.log("addROM(): copying ROM to " + str.toHexLong(addr) + " (" + str.toHexLong(this.abROM.length) + " bytes)"); var i; for (i = 0; i < this.abROM.length; i++) { this.bus.setByteDirect(addr + i, this.abROM[i]); } - if (this.fWritable && addr == 0x100) { - /* - * Here's where we enable our "Fake CP/M" support, triggered by the user loading a "writable" ROM image - * at offset 0x100. Fake CP/M support works by installing HLT opcodes at well-known CP/M addresses - * (namely, 0x0000, which is the CP/M reset vector, and 0x0005, which is the CP/M system call vector) and - * then telling the CPU to call us whenever a HLT occurs, so we can check PC for one of these addresses. - */ - for (i = 0; i < ROM8080.CPM.VECTORS.length; i++) { - this.bus.setByteDirect(ROM8080.CPM.VECTORS[i], CPUDef8080.OPCODE.HLT); - } - - this.cpu.addHaltCheck(function(rom) { - return function(addr) { - return rom.checkCPMVector(addr) - }; - }(this)); - - this.cpu.setReset(addr); - } return true; } /* @@ -383,96 +331,6 @@ ROM8080.prototype.addROM = function(addr) return false; }; -/** - * checkCPMVector(addr) - * - * @this {ROM8080} - * @param {number} addr (of the HLT opcode) - * @return {boolean} true if special processing performed, false if not - */ -ROM8080.prototype.checkCPMVector = function(addr) -{ - var i = ROM8080.CPM.VECTORS.indexOf(addr); - if (i >= 0) { - var fCPM = false; - var cpu = this.cpu; - var dbg = this.dbg; - if (addr == ROM8080.CPM.BDOS.VECTOR) { - fCPM = true; - switch(cpu.regC) { - case ROM8080.CPM.BDOS.FUNC.CON_WRITE: - this.writeCPMString(this.getCPMChar(cpu.regE)); - break; - case ROM8080.CPM.BDOS.FUNC.STR_WRITE: - this.writeCPMString(this.getCPMString(cpu.getDE(), '$')); - break; - default: - fCPM = false; - break; - } - } - if (fCPM) { - CPUDef8080.opRET.call(cpu); // for recognized calls, automatically return - } - else if (dbg) { - this.println("\nCP/M vector " + str.toHexWord(addr)); - cpu.setPC(addr); // this is purely for the Debugger's benefit, to show the HLT - dbg.stopCPU(); - } - return true; - } - return false; -}; - - -/** - * getCPMChar(ch) - * - * @this {ROM8080} - * @param {number} ch - * @return {string} - */ -ROM8080.prototype.getCPMChar = function(ch) -{ - return String.fromCharCode(ch); -}; - -/** - * getCPMString(addr, chEnd) - * - * @this {ROM8080} - * @param {number} addr (of a string) - * @param {string|number} [chEnd] (terminating character, default is 0) - * @return {string} - */ -ROM8080.prototype.getCPMString = function(addr, chEnd) -{ - var s = ""; - var cchMax = 255; - var bEnd = chEnd && chEnd.length && chEnd.charCodeAt(0) || chEnd || 0; - while (cchMax--) { - var b = this.cpu.getByte(addr++); - if (b == bEnd) break; - s += String.fromCharCode(b); - } - return s; -}; - -/** - * writeCPMString(s) - * - * @this {ROM8080} - * @param {string} s - */ -ROM8080.prototype.writeCPMString = function(s) -{ - s = s.replace(/\r/g, ''); - if (this.controlPrint) { - this.controlPrint.value += s; - this.controlPrint.scrollTop = this.controlPrint.scrollHeight; - } -}; - /** * cloneROM(addr) * diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 3076be152..a26e7a1b2 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -50,7 +50,7 @@ if (NODE) { * The CPUStatePDP11 class uses the following (parmsCPU) properties: * * model: a number (eg, 1170) that should match one of the PDP11.MODEL_* values - * resetAddr: reset address (default is 0) + * addrReset: reset address (default is 0) * * This extends the CPU class and passes any remaining parmsCPU properties to the CPU class * constructor, along with a default speed (cycles per second) based on the specified (or default) @@ -63,7 +63,7 @@ if (NODE) { function CPUStatePDP11(parmsCPU) { this.model = +parmsCPU['model'] || PDP11.MODEL_1170; - this.resetAddr = parmsCPU['resetAddr'] || 0; + this.addrReset = parmsCPU['addrReset'] || 0; var nCyclesDefault = 0; switch(this.model) { @@ -175,7 +175,7 @@ CPUStatePDP11.prototype.initRegs = function() this.flagN = 0x8000; // PSW N bit this.regPSW = 0x000f; // PSW other bits (TODO: What's the point of setting the flag bits here, too?) this.regsGen = [ // General R0 - R7 - 0, 0, 0, 0, 0, 0, 0, this.resetAddr + 0, 0, 0, 0, 0, 0, 0, this.addrReset ]; this.regsAlt = [ // Alternate R0 - R5 0, 0, 0, 0, 0, 0 @@ -359,6 +359,18 @@ CPUStatePDP11.prototype.setMMR3 = function(newMMR3) } }; +/** + * setReset(addr) + * + * @this {CPUStatePDP11} + * @param {number} addr + */ +CPUStatePDP11.prototype.setReset = function(addr) +{ + this.addrReset = addr; + this.setPC(addr); +}; + /** * getChecksum() * diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index 861b29cdb..5d2a64ea0 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -35,11 +35,11 @@ if (NODE) { var str = require("../../shared/lib/strlib"); var web = require("../../shared/lib/weblib"); + var DumpAPI = require("../../shared/lib/dumpapi"); var Component = require("../../shared/lib/component"); var State = require("../../shared/lib/state"); var PDP11 = require("./defines"); var MemoryPDP11 = require("./memory"); - var ROMPDP11 = require("./rom"); } /** @@ -49,6 +49,9 @@ if (NODE) { * * addr: starting physical address of RAM (default is 0) * size: amount of RAM, in bytes (default is 0, which means defer to motherboard switch settings) + * file: name of optional data file to load into RAM (default is "") + * load: optional file load address (overrides any load address specified in the data file; default is null) + * exec: optional file exec address (overrides any exec address specified in the data file; default is null) * * NOTE: We make a note of the specified size, but no memory is initially allocated for the RAM until the * Computer component calls powerUp(). @@ -61,10 +64,37 @@ function RAMPDP11(parmsRAM) { Component.call(this, "RAM", parmsRAM, RAMPDP11); + this.abInit = null; + this.aSymbols = null; + this.addrRAM = parmsRAM['addr']; this.sizeRAM = parmsRAM['size']; + this.nFileLoad = parmsRAM['load']; + this.nFileExec = parmsRAM['exec']; + this.fInstalled = (!!this.sizeRAM); // 0 is the default value for 'size' when none is specified this.fAllocated = false; + + this.sFilePath = parmsRAM['file']; + this.sFileName = str.getBaseName(this.sFilePath); + + if (this.sFilePath) { + var sFileURL = this.sFilePath; + if (DEBUG) this.log('load("' + sFileURL + '")'); + /* + * If the selected data file has a ".json" extension, then we assume it's pre-converted + * JSON-encoded data, so we load it as-is; ditto for ROM files with a ".hex" extension. + * Otherwise, we ask our server-side converter to return the file in a JSON-compatible format. + */ + var sFileExt = str.getExtension(this.sFileName); + if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) { + sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true'; + } + var ram = this; + web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) { + ram.doneLoad(sURL, sResponse, nErrorCode); + }); + } } Component.subclass(RAMPDP11); @@ -86,24 +116,6 @@ RAMPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.initRAM(); }; -/** - * initRAM() - * - * @this {RAMPDP11} - */ -RAMPDP11.prototype.initRAM = function() -{ - if (!this.fAllocated && this.sizeRAM) { - if (this.bus.addMemory(this.addrRAM, this.sizeRAM, MemoryPDP11.TYPE.RAM)) { - this.fAllocated = true; - } - } - if (!this.fAllocated) { - Component.error("No RAM allocated"); - } - this.setReady(); -}; - /** * powerUp(data, fRepower) * @@ -142,6 +154,80 @@ RAMPDP11.prototype.powerDown = function(fSave, fShutdown) return true; }; +/** + * doneLoad(sURL, sData, nErrorCode) + * + * @this {RAMPDP11} + * @param {string} sURL + * @param {string} sData + * @param {number} nErrorCode (response from server if anything other than 200) + */ +RAMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode) +{ + if (nErrorCode) { + this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")"); + return; + } + + Component.addMachineResource(this.idMachine, sURL, sData); + + var resource = web.parseMemoryResource(sURL, sData); + if (resource) { + this.abInit = resource.aBytes; + this.aSymbols = resource.aSymbols; + if (this.nFileLoad == null && resource.nLoad != null) this.nFileLoad = resource.nLoad; + if (this.nFileExec == null && resource.nExec != null) this.nFileExec = resource.nExec; + } else { + this.sFilePath = null; + } + this.initRAM(); +}; + +/** + * initRAM() + * + * This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place + * until after initBus() has received the Bus component AND doneLoad() has received the data. When both those + * criteria are satisfied, the component becomes "ready". + * + * @this {RAMPDP11} + */ +RAMPDP11.prototype.initRAM = function() +{ + if (!this.fAllocated && this.sizeRAM) { + if (this.bus.addMemory(this.addrRAM, this.sizeRAM, MemoryPDP11.TYPE.RAM)) { + this.fAllocated = true; + } + } + if (!this.isReady()) { + if (!this.fAllocated) { + Component.error("No RAM allocated"); + } + else if (this.sFilePath) { + /* + * Too early... + */ + if (!this.abInit || !this.bus) return; + + var addr = this.addrRAM; + if (this.nFileLoad !== null) addr = this.nFileLoad; + for (var i = 0; i < this.abInit.length; i++) { + this.bus.setByteDirect(addr + i, this.abInit[i]); + } + + if (this.nFileExec !== null) { + this.cpu.setReset(this.nFileExec); + } + + /* + * TODO: Consider an option to retain this data and give the user a way of restoring the initial contents. + */ + delete this.abInit; + } + this.setReady(); + } +}; + /** * reset() * diff --git a/modules/pdp11/lib/rom.js b/modules/pdp11/lib/rom.js index 3e26f4bbd..300387fbe 100644 --- a/modules/pdp11/lib/rom.js +++ b/modules/pdp11/lib/rom.js @@ -50,7 +50,6 @@ if (NODE) { * size: amount of ROM, in bytes * alias: physical alias address (null if none) * file: name of ROM data file - * writable: true to make ROM writable (default is false) * * NOTE: The ROM data will not be copied into place until the Bus is ready (see initBus()) AND the * ROM data file has finished loading (see doneLoad()). @@ -58,10 +57,6 @@ if (NODE) { * Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM you received * is the ROM you expected. * - * Finally, while making ROM "writable" may seem a contradiction in terms, I want to be able to load selected - * binary files into memory purely for testing purposes, and the RAM component has no "file" option, so the - * simplest solution was to add the option to load binary files into memory as "writable" ROMs. - * * @constructor * @extends Component * @param {Object} parmsROM @@ -70,10 +65,11 @@ function ROMPDP11(parmsROM) { Component.call(this, "ROM", parmsROM, ROMPDP11); - this.abROM = null; + this.abInit = null; + this.aSymbols = null; + this.addrROM = parmsROM['addr']; this.sizeROM = parmsROM['size']; - this.fWritable = parmsROM['writable']; /* * The new 'alias' property can now be EITHER a single physical address (like 'addr') OR an array of @@ -184,87 +180,28 @@ ROMPDP11.prototype.powerDown = function(fSave, fShutdown) }; /** - * doneLoad(sURL, sROMData, nErrorCode) + * doneLoad(sURL, sData, nErrorCode) * * @this {ROMPDP11} * @param {string} sURL - * @param {string} sROMData + * @param {string} sData * @param {number} nErrorCode (response from server if anything other than 200) */ -ROMPDP11.prototype.doneLoad = function(sURL, sROMData, nErrorCode) +ROMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode) { if (nErrorCode) { - this.notice("Unable to load system ROM (error " + nErrorCode + ": " + sURL + ")"); + this.notice("Unable to load ROM resource (error " + nErrorCode + ": " + sURL + ")"); return; } - Component.addMachineResource(this.idMachine, sURL, sROMData); + Component.addMachineResource(this.idMachine, sURL, sData); - var i; - if (sROMData.charAt(0) == "[" || sROMData.charAt(0) == "{") { - try { - /* - * The most likely source of any exception will be here: parsing the JSON-encoded ROM. - */ - var a, ib; - var rom = eval("(" + sROMData + ")"); - - if (a = rom['bytes']) { - this.abROM = a; - } - else if (a = rom['words']) { - /* - * Convert all WORDs into BYTEs, so that subsequent code only has to deal with abROM. - */ - this.abROM = new Array(a.length * 2); - for (i = 0, ib = 0; i < a.length; i++) { - this.abROM[ib++] = a[i] & 0xff; - this.abROM[ib++] = (a[i] >> 8) & 0xff; - this.assert(!(a[i] & ~0xffff)); - } - } - else if (a = rom['data']) { - /* - * Convert all DWORDs into BYTEs, so that subsequent code only has to deal with abROM. - */ - this.abROM = new Array(a.length * 4); - for (i = 0, ib = 0; i < a.length; i++) { - this.abROM[ib++] = a[i] & 0xff; - this.abROM[ib++] = (a[i] >> 8) & 0xff; - this.abROM[ib++] = (a[i] >> 16) & 0xff; - this.abROM[ib++] = (a[i] >> 24) & 0xff; - } - } - else { - this.abROM = rom; - } - - this.aSymbols = rom['symbols']; - - if (!this.abROM.length) { - Component.error("Empty ROM: " + sURL); - return; - } - else if (this.abROM.length == 1) { - Component.error(this.abROM[0]); - return; - } - } catch (e) { - this.notice("ROM data error: " + e.message); - return; - } - } - else { - /* - * Parse the ROM data manually; we assume it's in "simplified" hex form (a series of hex byte-values - * separated by whitespace). - */ - var sHexData = sROMData.replace(/\n/gm, " ").replace(/ +$/, ""); - var asHexData = sHexData.split(" "); - this.abROM = new Array(asHexData.length); - for (i = 0; i < asHexData.length; i++) { - this.abROM[i] = str.parseInt(asHexData[i], 16); - } + var resource = web.parseMemoryResource(sURL, sData); + if (resource) { + this.abInit = resource.aBytes; + this.aSymbols = resource.aSymbols; + } else { + this.sFilePath = null; } this.initROM(); }; @@ -272,33 +209,35 @@ ROMPDP11.prototype.doneLoad = function(sURL, sROMData, nErrorCode) /** * initROM() * - * This function is called by both initBus() and doneLoad(), but it cannot copy the the ROM data into place - * until after initBus() has received the Bus component AND doneLoad() has received the abROM data. When both - * those criteria are satisfied, the component becomes "ready". + * This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place + * until after initBus() has received the Bus component AND doneLoad() has received the data. When both those + * criteria are satisfied, the component becomes "ready". * * @this {ROMPDP11} */ ROMPDP11.prototype.initROM = function() { if (!this.isReady()) { - if (!this.sFilePath) { - this.setReady(); - } - else if (this.abROM && this.bus) { + if (this.sFilePath) { + /* + * Too early... + */ + if (!this.abInit || !this.bus) return; + /* * If no explicit size was specified, then use whatever the actual size is. */ if (!this.sizeROM) { - this.sizeROM = this.abROM.length; + this.sizeROM = this.abInit.length; } - if (this.abROM.length != this.sizeROM) { + if (this.abInit.length != this.sizeROM) { /* * Note that setError() sets the component's fError flag, which in turn prevents setReady() from * marking the component ready. TODO: Revisit this decision. On the one hand, it sounds like a * good idea to stop the machine in its tracks whenever a setError() occurs, but there may also be * times when we'd like to forge ahead anyway. */ - this.setError("ROM size (" + str.toHexLong(this.abROM.length) + ") does not match specified size (" + str.toHexLong(this.sizeROM) + ")"); + this.setError("ROM size (" + str.toHexLong(this.abInit.length) + ") does not match specified size (" + str.toHexLong(this.sizeROM) + ")"); } else if (this.addROM(this.addrROM)) { @@ -312,7 +251,7 @@ ROMPDP11.prototype.initROM = function() this.cloneROM(aliases[i]); } /* - * We used to hang onto the original ROM data so that we could restore any bytes the CPU overwrote, + * We used to hang onto the initial ROM data so that we could restore any bytes the CPU overwrote, * using memory write-notification handlers, but with the introduction of read-only memory blocks, that's * no longer necessary. * @@ -321,10 +260,10 @@ ROMPDP11.prototype.initROM = function() * whether they're ROM or RAM. However, the only way to modify a machine's ROM is with the Debugger, * and Debugger users should know better. */ - delete this.abROM; + delete this.abInit; } - this.setReady(); } + this.setReady(); } }; @@ -337,11 +276,11 @@ ROMPDP11.prototype.initROM = function() */ ROMPDP11.prototype.addROM = function(addr) { - if (this.bus.addMemory(addr, this.sizeROM, this.fWritable? MemoryPDP11.TYPE.RAM : MemoryPDP11.TYPE.ROM)) { - if (DEBUG) this.log("addROM(): copying ROM to " + str.toHexLong(addr) + " (" + str.toHexLong(this.abROM.length) + " bytes)"); + if (this.bus.addMemory(addr, this.sizeROM, MemoryPDP11.TYPE.ROM)) { + if (DEBUG) this.log("addROM(): copying ROM to " + str.toHexLong(addr) + " (" + str.toHexLong(this.abInit.length) + " bytes)"); var i; - for (i = 0; i < this.abROM.length; i++) { - this.bus.setByteDirect(addr + i, this.abROM[i]); + for (i = 0; i < this.abInit.length; i++) { + this.bus.setByteDirect(addr + i, this.abInit[i]); } return true; } diff --git a/modules/shared/lib/weblib.js b/modules/shared/lib/weblib.js index cce022f5e..412a2a757 100644 --- a/modules/shared/lib/weblib.js +++ b/modules/shared/lib/weblib.js @@ -283,6 +283,90 @@ web.getResource = function(sURL, dataPost, fAsync, done) return response; }; +/** + * parseMemoryResource(sURL, sData) + * + * @param {string} sData + * @return {Object|null} (resource) + */ +web.parseMemoryResource = function(sURL, sData) +{ + var i; + var resource = { + aBytes: null, + aSymbols: null, + nLoad: null, + nExec: null + }; + if (sData.charAt(0) == "[" || sData.charAt(0) == "{") { + try { + var a, ib; + var data = eval("(" + sData + ")"); + + resource.nLoad = data['load']; + resource.nExec = data['exec']; + + if (a = data['bytes']) { + resource.aBytes = a; + } + else if (a = data['words']) { + /* + * Convert all words into bytes + */ + resource.aBytes = new Array(a.length * 2); + for (i = 0, ib = 0; i < a.length; i++) { + resource.aBytes[ib++] = a[i] & 0xff; + resource.aBytes[ib++] = (a[i] >> 8) & 0xff; + Component.assert(!(a[i] & ~0xffff)); + } + } + else if (a = data['data']) { + /* + * Convert all dwords (longs) into bytes + */ + resource.aBytes = new Array(a.length * 4); + for (i = 0, ib = 0; i < a.length; i++) { + resource.aBytes[ib++] = a[i] & 0xff; + resource.aBytes[ib++] = (a[i] >> 8) & 0xff; + resource.aBytes[ib++] = (a[i] >> 16) & 0xff; + resource.aBytes[ib++] = (a[i] >> 24) & 0xff; + } + } + else { + resource.aBytes = data; + } + + resource.aSymbols = data['symbols']; + + if (!resource.aBytes.length) { + Component.error("Empty resource: " + sURL); + resource = null; + } + else if (resource.aBytes.length == 1) { + Component.error(resource.aBytes[0]); + resource = null; + } + } catch (e) { + Component.error("Resource data error: " + e.message); + resource = null; + } + } + else { + /* + * Parse the data manually; we'll assume it's in "simplified" hex form + * (a series of hex byte-values separated by whitespace). + */ + var sHexData = sData.replace(/\n/gm, " ").replace(/ +$/, ""); + var asHexData = sHexData.split(" "); + resource.aBytes = new Array(asHexData.length); + for (i = 0; i < asHexData.length; i++) { + resource.aBytes[i] = parseInt(asHexData[i], 16); + Component.assert(!isNaN(resource.aBytes[i])); + } + } + return resource; +}; + /** * sendReport(sApp, sVer, sURL, sUser, sType, sReport, sHostName) * diff --git a/modules/shared/templates/components.xsl b/modules/shared/templates/components.xsl index 35c18170b..8be709153 100644 --- a/modules/shared/templates/components.xsl +++ b/modules/shared/templates/components.xsl @@ -582,9 +582,9 @@ null - + - + 0 @@ -612,7 +612,7 @@ - ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,resetAddr:,csStart:,csInterval:,csStop: + ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,addrReset:,csStart:,csInterval:,csStop: @@ -933,16 +933,10 @@ - - - - false - - rom - ,addr:,size:,alias:,file:'',notify:'',writable: + ,addr:,size:,alias:,file:'',notify:'' @@ -966,6 +960,24 @@ 0 + + + + + + + + + + null + + + + + + null + + @@ -975,7 +987,7 @@ ram - ,addr:,size:,test: + ,addr:,size:,file:'',load:,exec:,test: diff --git a/versions/pc8080/1.30.1/components.css b/versions/pc8080/1.30.1/components.css index dc7dbc154..6fa42a7a7 100644 --- a/versions/pc8080/1.30.1/components.css +++ b/versions/pc8080/1.30.1/components.css @@ -85,7 +85,7 @@ } .pcjs-description, .pcjs-status { font-size: x-small; - line-height: 2em; + line-height: 2.8em; } .pcjs-key { border: 1px solid black; diff --git a/versions/pc8080/1.30.1/components.xsl b/versions/pc8080/1.30.1/components.xsl index 2631d86f2..be0817a37 100644 --- a/versions/pc8080/1.30.1/components.xsl +++ b/versions/pc8080/1.30.1/components.xsl @@ -580,9 +580,9 @@ null - + - + 0 @@ -610,7 +610,7 @@ - ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,resetAddr:,csStart:,csInterval:,csStop: + ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,addrReset:,csStart:,csInterval:,csStop: @@ -931,16 +931,10 @@ - - - - false - - rom - ,addr:,size:,alias:,file:'',notify:'',writable: + ,addr:,size:,alias:,file:'',notify:'' @@ -964,6 +958,24 @@ 0 + + + + + + + + + + null + + + + + + null + + @@ -973,7 +985,7 @@ ram - ,addr:,size:,test: + ,addr:,size:,file:'',load:,exec:,test: diff --git a/versions/pc8080/1.30.1/pc8080-dbg.js b/versions/pc8080/1.30.1/pc8080-dbg.js index 174849394..0346bc1e9 100644 --- a/versions/pc8080/1.30.1/pc8080-dbg.js +++ b/versions/pc8080/1.30.1/pc8080-dbg.js @@ -29,8 +29,8 @@ http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -var l,m={me:1,ne:3,oe:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Ub:65,Hc:66,Jc:67,Xb:68,E:69,Mc:70,Nc:71,Oc:72,Pc:73,Wc:74,Xc:75,Zb:76,dd:77,ed:78,gd:79,hd:80,Q:81,od:82,rd:83,xd:84,yd:85,zd:86,Ad:87,Cd:88,Dd:89,Ed:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ve:97,We:98,Xe:99,d:100,e:101,Ye:102,Ze:103,$e:104,af:105,bf:106,k:107,cf:108, -df:109,n:110,ef:111,p:112,q:113,r:114,ff:115,t:116,hf:117,jf:118,kf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126}; +var l,m={pe:1,qe:3,re:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Xb:65,Kc:66,Mc:67,$b:68,E:69,Pc:70,Qc:71,Rc:72,Sc:73,Zc:74,$c:75,bc:76,gd:77,hd:78,kd:79,ld:80,Q:81,rd:82,ud:83,Ad:84,Bd:85,Cd:86,Dd:87,Fd:88,Gd:89,Hd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ye:97,Ze:98,$e:99,d:100,e:101,af:102,bf:103,cf:104,df:105,ef:106,k:107,ff:108, +gf:109,n:110,hf:111,p:112,q:113,r:114,jf:115,t:116,lf:117,mf:118,nf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126}; function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function t(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){return t(a,2,!0)} function u(a){return t(a,4,!0)}function ea(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})} @@ -38,245 +38,250 @@ function ma(a,b){return(a+" ").slice(0,b) function pa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function sa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;cb?this.cb=this.id:(this.Bb=this.id.substr(0,b),this.cb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,sb:!1,Kb:!1,xa:!1,error:!1};this.Eb=null;this.C.error=!1;this.N={};this.H=null;this.ta=d||0;Ta.push(this)}var Ua=void 0,Va={}; -if(window){Ua||(Ua=window.location.search.substr(1));for(var Wa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Wa=Za.exec(Ua);)Va[decodeURIComponent(Wa[1].replace(Ya," "))]=decodeURIComponent(Wa[2].replace(Ya," "))}function $a(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 A(a,b){b||(b=z);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),Ta=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},Ta=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function Pa(a,b,c){b||w((c?c+": ":"")+a)} -function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>8&255;else if(e=g.data)for(d.za=Array(4*e.length),f=c=0;c>8&255,d.za[f++]=e[c]>>16&255,d.za[f++]=e[c]>>24&255;else d.za=g;d.Ea=g.symbols;d.za.length?1==d.za.length&&(w(d.za[0]),d=null): +(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error: "+h.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.za=Array(a.length),c=0;cb?this.eb=this.id:(this.fb=this.id.substr(0,b),this.eb=this.id.substr(b+1));this[a]=c;this.D={ready:!1,ub:!1,Lb:!1,xa:!1,error:!1};this.Fb=null;this.D.error=!1;this.N={};this.I=null;this.ta=d||0;Ua.push(this)}var Va=void 0,Wa={}; +if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,$a=/([^&=]+)=?([^&]*)/g;Xa=$a.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function ab(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 A(a,b){b||(b=z);a.prototype=ab(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var bb=window.PCjs.Machines||(window.PCjs.Machines={}),Ua=window.PCjs.Components||(window.PCjs.Components=[])}else bb={},Ua=[];function cb(a,b,c){bb[a]&&b&&(bb[a][b]=c)}function Qa(a,b,c){b||w((c?c+": ":"")+a)} +function db(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.ia&&(this.ia=10);15>2;this.u=this.Ha-1;this.J=this.L/this.Ha|0;this.G=this.J-1;this.B=[];this.j=[];this.I=this.D=!1;this.O=[];this.P=[];a=new H;wb(a,this.H);this.X=Array(this.J);for(b=0;b>>a.ia;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.F)return h.yb+=h.F-e,h.F=e,!0;if(e>=h.F+h.yb){n=h.size-(e-k);n>f&&(n=f);h.yb=e-h.F+n;e=k+a.Ha;f-=n;g++;continue}}return yb(1,e,f)}e=new H(e,n,a.Ha,d);wb(e,a.H,h);a.X[g++]=e;e=k+a.Ha;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+zb[d]+" at "+u(b)),!0):yb(2,b,c)} -l.aa=function(a){return this.X[(a&this.w)>>>this.ia].jb(a&this.u,a)};function Ab(a,b){return a.X[(b&a.w)>>>a.ia].wb(b&a.u,b)}l.$a=function(a){var b=a&this.u,c=(a&this.w)>>>this.ia;return b!=this.u?this.X[c].Ac(b,a):this.X[c++].jb(b,a)|this.X[c&this.G].jb(0,a+1)<<8};function Bb(a,b){var c=b&a.u,d=(b&a.w)>>>a.ia;return c!=a.u?a.X[d].Pb(c,b):a.X[d++].wb(c,b)|a.X[d&a.G].wb(0,b+1)<<8}l.va=function(a,b){this.X[(a&this.w)>>>this.ia].lb(a&this.u,b&255,a)}; -function Db(a,b,c){a.X[(b&a.w)>>>a.ia].zb(b&a.u,c&255,b)}l.Ib=function(a,b){var c=a&this.u,d=(a&this.w)>>>this.ia;c!=this.u?this.X[d].Cc(c,b&65535,a):(this.X[d++].lb(c,b&255,a),this.X[d&this.G].lb(0,b>>8&255,a+1))};function Eb(a){for(var b=0,c=[],d=0;d>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,d);a.H&&a.D!=g[1]&&Vb(a.H,b,k)}else a.H&&(gb(a.H,a,b,k,d),a.D&&Vb(a.H,b,k));f+=h<<3;b+=h;e-=h}} -function yb(a,b,c){w("Memory block error ("+a+": "+t(b)+","+t(c)+")");return!1}var Wb;if(pb){var Xb=new ArrayBuffer(2);(new DataView(Xb)).setUint16(0,256,!0);Wb=256===(new Uint16Array(Xb))[0]}else Wb=!1;var Yb=Wb; -function H(a,b,c,d){this.id=Zb+=2;this.b=null;this.F=a;this.yb=b;this.size=c||0;this.type=d||$b;this.N=d==ac;wb(this);this.Na=this.xc=!1;if(c)if(pb)this.I=new ArrayBuffer(c),this.D=new DataView(this.I,0,c),this.u=new Uint8Array(this.I,0,c),this.J=new Uint16Array(this.I,0,c>>1),this.b=new Int32Array(this.I,0,c>>2),bc(this,Yb?cc:dc);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Y:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},fa: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},la:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<> -2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Na=!0},O:function(a,b){if(this.H&&null!=this.F){var c=this.H;ic(c,this.F+a,1,c.O)&&c.qa(!0)}return this.wb(a,b)},ca:function(a,b){if(this.H&&null!=this.F){var c=this.H;ic(c,this.F+a,2,c.O)&&c.qa(!0)}return this.Pb(a,b)},ja:function(a,b,c){if(this.H&&null!=this.F){var d=this.H;ic(d,this.F+a,1,d.D)&&d.qa(!0)}this.N?this.w(a,b,c):this.zb(a,b,c)},ma:function(a,b,c){if(this.H&& -null!=this.F){var d=this.H;ic(d,this.F+a,2,d.D)&&d.qa(!0)}this.N?this.w(a,b,c):this.Tb(a,b,c)},M:function(a){return this.u[a]},P:function(a){return this.u[a]},ba:function(a){return this.D.getUint16(a,!0)},ea:function(a){return a&1?this.u[a]|this.u[a+1]<<8:this.J[a>>1]},ha:function(a,b){this.u[a]=b;this.Na=!0},cb:function(a,b){this.u[a]=b;this.Na=!0},ra:function(a,b){this.D.setUint16(a,b,!0);this.Na=!0},wa:function(a,b){a&1?(this.u[a]=b,this.u[a+1]=b>>8):this.J[a>>1]=b;this.Na=!0}}; -function wb(a,b,c){a.H=b;a.B=a.j=0;c&&((a.B=c.B)&&hc(a,gc,!1),(a.j=c.j)&&fc(a,gc,!1))}function jc(a,b){b?--a.j||(a.lb=a.N?a.w:a.zb,a.Cc=a.N?a.G:a.Tb):--a.B||(a.jb=a.wb,a.Ac=a.Pb)}function fc(a,b,c){c&&a.j||(a.lb=!a.N&&b[1]||a.w,a.Cc=!a.N&&b[3]||a.G);if(c||void 0===c)a.zb=b[1]||a.w,a.Tb=b[3]||a.G}function hc(a,b,c){c&&a.B||(a.jb=b[0]||a.K,a.Ac=b[2]||a.L);if(c||void 0===c)a.wb=b[0]||a.K,a.Pb=b[2]||a.L}function bc(a,b){b||(b=kc);hc(a,b,void 0);fc(a,b,void 0)} -var kc=[],ec=[H.prototype.Y,H.prototype.la,H.prototype.fa,H.prototype.za],gc=[H.prototype.O,H.prototype.ja,H.prototype.ca,H.prototype.ma];if(pb)var dc=[H.prototype.M,H.prototype.ha,H.prototype.ba,H.prototype.ra],cc=[H.prototype.P,H.prototype.cb,H.prototype.ea,H.prototype.wa]; -function lc(a,b){z.call(this,"CPU",a,lc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Ra=c;this.ha=Math.round(this.Y/1E4)/100;this.ab=this.ha*this.Ra;this.C.Aa=!1;this.C.Sb=!1;this.C.rb=a.autoStart;this.C.vc=!1;this.C.fb=!1;this.tb=this.O=0;this.ub=a.csStart;this.hb=a.csInterval;this.ib=a.csStop;this.w=[];this.Fa=this.bb.bind(this);F(this)}A(lc);var mc=["power","reset"];l=lc.prototype; -l.Pa=function(a,b,c,d){this.B=a;this.u=b;this.H=d;for(b=0;b=a.O&&(a.O+=a.hb,c=!0);0<=a.ib&&a.ib<=Fc(a)&&(a.hb=a.ib=-1,Bc(a),a.qa(),c=!0);c&&a.g(Fc(a)+" cycles: checksum="+t(a.tb))}} -l.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.xa)a=!0;else{var b=null,c,h=cb(a.id);for(c=0;ca.J/a.ab?b=1:d=!0;a.Ra=b;b=a.ha*a.Ra;if(a.ab!=b){a.ab=b;b=a.ab.toFixed(2)+"Mhz";var e=a.N.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.B&&a.B.xb()}Hc(a,a.G);a.G=0;a.D=qa();a.K=0;Ic(a);return d}function Jc(a,b){var c=a.w.length;a.w.push([-1,b]);return c}function Kc(a,b,c){0<=b&&ba.w[b][0]&&(c*=a.Y*a.Ra/1E3,a.w[b][0]=c+Lc(a))}function Lc(a,b){var c=a.L-=a.b;a.b=0;b&&(a.L=0);return c} -l.bb=function(a){if(jb(this,!0)){if(!this.C.Aa){Gc(this);this.B&&this.B.start(this.D,Fc(this));this.C.Aa=!0;this.C.Sb=!0;this.I&&this.I.start();var b=this.N.run;b&&(b.textContent="Halt");this.B&&(this.B.Ja(!0),a&&this.B.xb(!0))}this.ja>=this.Y&&Ic(this,!0);this.ba=0;this.ea=qa();this.K&&(a=this.ea-this.K,a>this.wa&&(this.D+=a,this.D>this.ea&&(this.D=this.ea)));try{do{for(var c,d=this.C.fb?1:this.fa,e=this.w.length-1;0<=e;e--){var f=this.w[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.kb(c);c=Lc(this,!0);this.ba+= -c;this.G+=c;Ec(this,c);a=c;for(var g=this.w.length-1;0<=g;g--){var h=this.w[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.P-=c;if(0>=this.P){this.P+=this.fa;15<=++this.za&&(this.B&&this.B.Ja(),this.za=0);break}}while(this.C.Aa)}catch(k){this.qa();Dc(this);this.B&&this.B.stop(qa(),Fc(this));jb(this,!1);ob(this,k.stack||k.message);return}c=setTimeout;d=this.Fa;this.K=qa();e=this.wa;this.ba&&(e=Math.round(e*this.ba/this.fa));e-=this.K-this.ea;if(f=this.K-this.D)this.J=Math.round(this.G/(10*f))/ -100,864E5<=f&&(this.M=0,Gc(this));if(0>e||this.Je&&(this.D-=e),e=0;this.ja+=this.ba;this.K+=e;c(d,e)}else Dc(this),this.B&&this.B.stop(qa(),Fc(this))};l.kb=function(){return 0};l.qa=function(a){kb(this,!0);Lc(this);Hc(this,this.G);this.G=0;if(this.C.Aa){this.C.Aa=!1;this.I&&this.I.stop();var b=this.N.run;b&&(b.textContent="Run")}this.C.complete=a};function Dc(a,b){if(a.B){for(var c=a.B,d=0;d>8&255;a.T=b&255}function Wc(a){return a.U<<8|a.V}function Xc(a,b){a.U=b>>8&255;a.V=b&255}function K(a){return a.W<<8|a.Z} -function Yc(a,b){a.W=b>>8&255;a.Z=b&255}function I(a,b){a.R=b&65535}function Zc(a){return a.da&256?1:0}function $c(a,b){a.da=a.da&255|b}function ad(a){return qb[a.ga&255]?4:0}function bd(a){return(a.ga^a.ya)&16?16:0}function cd(a){return a.da&255?0:64}function dd(a){return a.ga&128?128:0}function Tc(a){return a.ua&-214|dd(a)|cd(a)|bd(a)|ad(a)|Zc(a)}function Rc(a,b){a.da=a.ga=a.ya=0;b&1&&(a.da|=256);b&4||(a.ga|=1);b&16&&(a.ya|=16);b&64||(a.da|=255);b&128&&(a.ga^=192);a.ua=a.ua&-726|b&512|2} -function ed(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b)&255}function fd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?1:0))&255}function gd(a,b){a.da=a.ga=a.ya=a.i&b;(a.i|b)&8&&(a.ya^=16);return a.da}function hd(a,b){a.ya=b^255;b=a.ga=b+255&255;a.da=a.da&-256|b;return b}function id(a,b){a.ya=b;b=a.ga=b+1&255;a.da=a.da&-256|b;return b}function Dd(a,b){return a.ga=a.da=a.ya=a.i|b}function L(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+1^256)&255} -function Ed(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?0:1)^256)&255}function Fd(a,b){return a.ga=a.da=a.ya=a.i^b}l.aa=function(a){return this.u.aa(a)};l.va=function(a,b){this.u.va(a,b)};function M(a){var b=a.aa(a.R);I(a,a.R+1);return b}function O(a){var b=a.u.$a(a.R);I(a,a.R+2);return b}function P(a){var b=a.u.$a(a.oa);a.oa=a.oa+2&65535;return b}function Q(a,b){a.oa=a.oa-2&65535;a.u.Ib(a.oa,b)} -function Gd(a){if(a.b&&a.j&255&&a.ua&512){for(var b=0;8>b&&!(a.j&1<b?255:1<>8;$c(this,a&256);this.b-=4},Kd,function(){var a;Yc(this,a=K(this)+Uc(this));$c(this,a>>8&256);this.b-=10},function(){this.i=this.aa(Uc(this));this.b-=7},function(){Vc(this,Uc(this)-1);this.b-= -5},function(){this.T=id(this,this.T);this.b-=5},function(){this.T=hd(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.i<<8&256;this.i=(a|this.i)>>1;$c(this,a);this.b-=4},Kd,function(){Xc(this,O(this));this.b-=10},function(){this.va(Wc(this),this.i);this.b-=7},function(){Xc(this,Wc(this)+1);this.b-=5},function(){this.U=id(this,this.U);this.b-=5},function(){this.U=hd(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255| -Zc(this);$c(this,a&256);this.b-=4},Kd,function(){var a;Yc(this,a=K(this)+Wc(this));$c(this,a>>8&256);this.b-=10},function(){this.i=this.aa(Wc(this));this.b-=7},function(){Xc(this,Wc(this)-1);this.b-=5},function(){this.V=id(this,this.V);this.b-=5},function(){this.V=hd(this,this.V);this.b-=5},function(){this.V=M(this);this.b-=7},function(){var a=this.i<<8;this.i=(Zc(this)<<8|this.i)>>1;$c(this,a&256);this.b-=4},Kd,function(){Yc(this,O(this));this.b-=10},function(){var a=O(this);this.u.Ib(a,K(this)); -this.b-=16},function(){Yc(this,K(this)+1);this.b-=5},function(){this.W=id(this,this.W);this.b-=5},function(){this.W=hd(this,this.W);this.b-=5},function(){this.W=M(this);this.b-=7},function(){var a=0,b=Zc(this);if(bd(this)||9<(this.i&15))a|=6;if(b||154<=this.i)a|=96,b=1;this.i=ed(this,a);$c(this,b?256:0);this.b-=4},Kd,function(){var a;Yc(this,a=K(this)+K(this));$c(this,a>>8&256);this.b-=10},function(){var a;a=O(this);a=this.u.$a(a);Yc(this,a);this.b-=16},function(){Yc(this,K(this)-1);this.b-=5},function(){this.Z= -id(this,this.Z);this.b-=5},function(){this.Z=hd(this,this.Z);this.b-=5},function(){this.Z=M(this);this.b-=7},function(){this.i=~this.i&255;this.b-=4},Kd,function(){this.oa=O(this)&65535;this.b-=10},function(){this.va(O(this),this.i);this.b-=13},function(){this.oa=this.oa+1&65535;this.b-=5},function(){var a=K(this);this.va(a,id(this,this.aa(a)));this.b-=10},function(){var a=K(this);this.va(a,hd(this,this.aa(a)));this.b-=10},function(){this.va(K(this),M(this));this.b-=10},function(){this.da|=256;this.b-= -4},Kd,function(){var a;Yc(this,a=K(this)+this.oa);$c(this,a>>8&256);this.b-=10},function(){this.i=this.aa(O(this));this.b-=13},function(){this.oa=this.oa-1&65535;this.b-=5},function(){this.i=id(this,this.i);this.b-=5},function(){this.i=hd(this,this.i);this.b-=5},function(){this.i=M(this);this.b-=7},function(){$c(this,Zc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.S=this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.W; +var qb="undefined"!==typeof ArrayBuffer,rb=[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],sb={cpu:1,bus:64,mem:128,port:256,nvr:16384,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function tb(a){z.call(this,"Panel",a,tb)}A(tb);l=tb.prototype; +l.qa=function(a,b,c,d){return this.A&&this.A.qa(a,b,c,d)||this.b&&this.b.qa(a,b,c,d)||this.K&&this.K.qa(a,b,c,d)||this.I&&this.I.qa(a,b,c,d)?!0:this.parent.qa.call(this,a,b,c,d)};l.Ra=function(a,b,c,d){this.A=a;this.u=b;this.b=c;this.I=d;this.K=ub(a,"Keyboard")};l.Ga=function(a,b){b||vb();return!0};l.Ka=function(){return!0};l.La=function(){};function vb(){for(var a=!1,b=D(document,"pc8080","panel"),c=0;c>1)+2;10>this.ia&&(this.ia=10);15>2;this.u=this.Ja-1;this.K=this.L/this.Ja|0;this.G=this.K-1;this.A=[];this.j=[];this.F=this.C=!1;this.O=[];this.P=[];a=new G;xb(a,this.I);this.X=Array(this.K);for(b=0;b>>a.ia;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.H)return h.Ab+=h.H-e,h.H=e,!0;if(e>=h.H+h.Ab){n=h.size-(e-k);n>f&&(n=f);h.Ab=e-h.H+n;e=k+a.Ja;f-=n;g++;continue}}return zb(1,e,f)}e=new G(e,n,a.Ja,d);xb(e,a.I,h);a.X[g++]=e;e=k+a.Ja;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Ab[d]+" at "+u(b)),!0):zb(2,b,c)} +l.aa=function(a){return this.X[(a&this.w)>>>this.ia].lb(a&this.u,a)};function Bb(a,b){return a.X[(b&a.w)>>>a.ia].yb(b&a.u,b)}l.ab=function(a){var b=a&this.u,c=(a&this.w)>>>this.ia;return b!=this.u?this.X[c].Dc(b,a):this.X[c++].lb(b,a)|this.X[c&this.G].lb(0,a+1)<<8};function Cb(a,b){var c=b&a.u,d=(b&a.w)>>>a.ia;return c!=a.u?a.X[d].Sb(c,b):a.X[d++].yb(c,b)|a.X[d&a.G].yb(0,b+1)<<8}l.va=function(a,b){this.X[(a&this.w)>>>this.ia].nb(a&this.u,b&255,a)}; +function Db(a,b,c){a.X[(b&a.w)>>>a.ia].Bb(b&a.u,c&255,b)}l.Jb=function(a,b){var c=a&this.u,d=(a&this.w)>>>this.ia;c!=this.u?this.X[d].Fc(c,b&65535,a):(this.X[d++].nb(c,b&255,a),this.X[d&this.G].nb(0,b>>8&255,a+1))};function Fb(a){for(var b=0,c=[],d=0;d>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,d);a.I&&a.C!=g[1]&&Wb(a.I,b,k)}else a.I&&(hb(a.I,a,b,k,d),a.C&&Wb(a.I,b,k));f+=h<<3;b+=h;e-=h}} +function zb(a,b,c){w("Memory block error ("+a+": "+t(b)+","+t(c)+")");return!1}var Xb;if(qb){var Yb=new ArrayBuffer(2);(new DataView(Yb)).setUint16(0,256,!0);Xb=256===(new Uint16Array(Yb))[0]}else Xb=!1;var Zb=Xb; +function G(a,b,c,d){this.id=$b+=2;this.b=null;this.H=a;this.Ab=b;this.size=c||0;this.type=d||ac;this.N=d==bc;xb(this);this.Pa=this.Ac=!1;if(c)if(qb)this.F=new ArrayBuffer(c),this.C=new DataView(this.F,0,c),this.u=new Uint8Array(this.F,0,c),this.K=new Uint16Array(this.F,0,c>>1),this.b=new Int32Array(this.F,0,c>>2),cc(this,Zb?dc:ec);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Y:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},fa: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},fb:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<> +2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Pa=!0},O:function(a,b){if(this.I&&null!=this.H){var c=this.I;jc(c,this.H+a,1,c.O)&&c.ra(!0)}return this.yb(a,b)},ca:function(a,b){if(this.I&&null!=this.H){var c=this.I;jc(c,this.H+a,2,c.O)&&c.ra(!0)}return this.Sb(a,b)},ja:function(a,b,c){if(this.I&&null!=this.H){var d=this.I;jc(d,this.H+a,1,d.C)&&d.ra(!0)}this.N?this.w(a,b,c):this.Bb(a,b,c)},ma:function(a,b,c){if(this.I&& +null!=this.H){var d=this.I;jc(d,this.H+a,2,d.C)&&d.ra(!0)}this.N?this.w(a,b,c):this.Wb(a,b,c)},M:function(a){return this.u[a]},P:function(a){return this.u[a]},ba:function(a){return this.C.getUint16(a,!0)},ea:function(a){return a&1?this.u[a]|this.u[a+1]<<8:this.K[a>>1]},ha:function(a,b){this.u[a]=b;this.Pa=!0},eb:function(a,b){this.u[a]=b;this.Pa=!0},la:function(a,b){this.C.setUint16(a,b,!0);this.Pa=!0},na:function(a,b){a&1?(this.u[a]=b,this.u[a+1]=b>>8):this.K[a>>1]=b;this.Pa=!0}}; +function xb(a,b,c){a.I=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc,!1))}function kc(a,b){b?--a.j||(a.nb=a.N?a.w:a.Bb,a.Fc=a.N?a.G:a.Wb):--a.A||(a.lb=a.yb,a.Dc=a.Sb)}function gc(a,b,c){c&&a.j||(a.nb=!a.N&&b[1]||a.w,a.Fc=!a.N&&b[3]||a.G);if(c||void 0===c)a.Bb=b[1]||a.w,a.Wb=b[3]||a.G}function ic(a,b,c){c&&a.A||(a.lb=b[0]||a.J,a.Dc=b[2]||a.L);if(c||void 0===c)a.yb=b[0]||a.J,a.Sb=b[2]||a.L}function cc(a,b){b||(b=lc);ic(a,b,void 0);gc(a,b,void 0)} +var lc=[],fc=[G.prototype.Y,G.prototype.fb,G.prototype.fa,G.prototype.wa],hc=[G.prototype.O,G.prototype.ja,G.prototype.ca,G.prototype.ma];if(qb)var ec=[G.prototype.M,G.prototype.ha,G.prototype.ba,G.prototype.la],dc=[G.prototype.P,G.prototype.eb,G.prototype.ea,G.prototype.na]; +function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.bb=this.ha*this.Sa;this.D.Aa=!1;this.D.Vb=!1;this.D.tb=a.autoStart;this.D.yc=!1;this.D.hb=!1;this.vb=this.O=0;this.wb=a.csStart;this.jb=a.csInterval;this.kb=a.csStop;this.w=[];this.Ha=this.cb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype; +l.Ra=function(a,b,c,d){this.A=a;this.u=b;this.I=d;for(b=0;b=a.O&&(a.O+=a.jb,c=!0);0<=a.kb&&a.kb<=Gc(a)&&(a.jb=a.kb=-1,Cc(a),a.ra(),c=!0);c&&a.g(Gc(a)+" cycles: checksum="+t(a.vb))}} +l.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.D.xa)a=!0;else{var b=null,c,h=db(a.id);for(c=0;ca.K/a.bb?b=1:d=!0;a.Sa=b;b=a.ha*a.Sa;if(a.bb!=b){a.bb=b;b=a.bb.toFixed(2)+"Mhz";var e=a.N.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.A&&a.A.zb()}Ic(a,a.G);a.G=0;a.C=qa();a.J=0;Jc(a);return d}function Kc(a,b){var c=a.w.length;a.w.push([-1,b]);return c}function Lc(a,b,c){0<=b&&ba.w[b][0]&&(c*=a.Y*a.Sa/1E3,a.w[b][0]=c+Mc(a))}function Mc(a,b){var c=a.L-=a.b;a.b=0;b&&(a.L=0);return c} +l.cb=function(a){if(kb(this,!0)){if(!this.D.Aa){Hc(this);this.A&&this.A.start(this.C,Gc(this));this.D.Aa=!0;this.D.Vb=!0;this.F&&this.F.start();var b=this.N.run;b&&(b.textContent="Halt");this.A&&(this.A.La(!0),a&&this.A.zb(!0))}this.ja>=this.Y&&Jc(this,!0);this.ba=0;this.ea=qa();this.J&&(a=this.ea-this.J,a>this.wa&&(this.C+=a,this.C>this.ea&&(this.C=this.ea)));try{do{for(var c,d=this.D.hb?1:this.fa,e=this.w.length-1;0<=e;e--){var f=this.w[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.mb(c);c=Mc(this,!0);this.ba+= +c;this.G+=c;Fc(this,c);a=c;for(var g=this.w.length-1;0<=g;g--){var h=this.w[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.P-=c;if(0>=this.P){this.P+=this.fa;15<=++this.Ba&&(this.A&&this.A.La(),this.Ba=0);break}}while(this.D.Aa)}catch(k){this.ra();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.wa;this.ba&&(e=Math.round(e*this.ba/this.fa));e-=this.J-this.ea;if(f=this.J-this.C)this.K=Math.round(this.G/(10*f))/ +100,864E5<=f&&(this.M=0,Hc(this));if(0>e||this.Ke&&(this.C-=e),e=0;this.ja+=this.ba;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.mb=function(){return 0};l.ra=function(a){lb(this,!0);Mc(this);Ic(this,this.G);this.G=0;if(this.D.Aa){this.D.Aa=!1;this.F&&this.F.stop();var b=this.N.run;b&&(b.textContent="Run")}this.D.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d>8&255;a.T=b&255}function Xc(a){return a.U<<8|a.V}function Yc(a,b){a.U=b>>8&255;a.V=b&255}function K(a){return a.W<<8|a.Z} +function Zc(a,b){a.W=b>>8&255;a.Z=b&255}function I(a,b){a.R=b&65535}function $c(a){return a.da&256?1:0}function ad(a,b){a.da=a.da&255|b}function bd(a){return rb[a.ga&255]?4:0}function cd(a){return(a.ga^a.ya)&16?16:0}function dd(a){return a.da&255?0:64}function ed(a){return a.ga&128?128:0}function Uc(a){return a.ua&-214|ed(a)|dd(a)|cd(a)|bd(a)|$c(a)}function Sc(a,b){a.da=a.ga=a.ya=0;b&1&&(a.da|=256);b&4||(a.ga|=1);b&16&&(a.ya|=16);b&64||(a.da|=255);b&128&&(a.ga^=192);a.ua=a.ua&-726|b&512|2} +function fd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b)&255}function gd(a,b){a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?1:0))&255}function hd(a,b){a.da=a.ga=a.ya=a.i&b;(a.i|b)&8&&(a.ya^=16);return a.da}function id(a,b){a.ya=b^255;b=a.ga=b+255&255;a.da=a.da&-256|b;return b}function jd(a,b){a.ya=b;b=a.ga=b+1&255;a.da=a.da&-256|b;return b}function Ed(a,b){return a.ga=a.da=a.ya=a.i|b}function L(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+1^256)&255} +function Fd(a,b){b^=255;a.ya=a.i^b;return a.ga=(a.da=a.i+b+(a.da&256?0:1)^256)&255}function Gd(a,b){return a.ga=a.da=a.ya=a.i^b}l.aa=function(a){return this.u.aa(a)};l.va=function(a,b){this.u.va(a,b)};function M(a){var b=a.aa(a.R);I(a,a.R+1);return b}function O(a){var b=a.u.ab(a.R);I(a,a.R+2);return b}function P(a){var b=a.u.ab(a.pa);a.pa=a.pa+2&65535;return b}function Q(a,b){a.pa=a.pa-2&65535;a.u.Jb(a.pa,b)} +function Hd(a){if(a.b&&a.j&255&&a.ua&512){for(var b=0;8>b&&!(a.j&1<b?255:1<>8;ad(this,a&256);this.b-=4},Ld,function(){var a;Zc(this,a=K(this)+Vc(this));ad(this,a>>8&256);this.b-=10},function(){this.i=this.aa(Vc(this));this.b-=7},function(){Wc(this,Vc(this)-1);this.b-= +5},function(){this.T=jd(this,this.T);this.b-=5},function(){this.T=id(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.i<<8&256;this.i=(a|this.i)>>1;ad(this,a);this.b-=4},Ld,function(){Yc(this,O(this));this.b-=10},function(){this.va(Xc(this),this.i);this.b-=7},function(){Yc(this,Xc(this)+1);this.b-=5},function(){this.U=jd(this,this.U);this.b-=5},function(){this.U=id(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255| +$c(this);ad(this,a&256);this.b-=4},Ld,function(){var a;Zc(this,a=K(this)+Xc(this));ad(this,a>>8&256);this.b-=10},function(){this.i=this.aa(Xc(this));this.b-=7},function(){Yc(this,Xc(this)-1);this.b-=5},function(){this.V=jd(this,this.V);this.b-=5},function(){this.V=id(this,this.V);this.b-=5},function(){this.V=M(this);this.b-=7},function(){var a=this.i<<8;this.i=($c(this)<<8|this.i)>>1;ad(this,a&256);this.b-=4},Ld,function(){Zc(this,O(this));this.b-=10},function(){var a=O(this);this.u.Jb(a,K(this)); +this.b-=16},function(){Zc(this,K(this)+1);this.b-=5},function(){this.W=jd(this,this.W);this.b-=5},function(){this.W=id(this,this.W);this.b-=5},function(){this.W=M(this);this.b-=7},function(){var a=0,b=$c(this);if(cd(this)||9<(this.i&15))a|=6;if(b||154<=this.i)a|=96,b=1;this.i=fd(this,a);ad(this,b?256:0);this.b-=4},Ld,function(){var a;Zc(this,a=K(this)+K(this));ad(this,a>>8&256);this.b-=10},function(){var a;a=O(this);a=this.u.ab(a);Zc(this,a);this.b-=16},function(){Zc(this,K(this)-1);this.b-=5},function(){this.Z= +jd(this,this.Z);this.b-=5},function(){this.Z=id(this,this.Z);this.b-=5},function(){this.Z=M(this);this.b-=7},function(){this.i=~this.i&255;this.b-=4},Ld,function(){this.pa=O(this)&65535;this.b-=10},function(){this.va(O(this),this.i);this.b-=13},function(){this.pa=this.pa+1&65535;this.b-=5},function(){var a=K(this);this.va(a,jd(this,this.aa(a)));this.b-=10},function(){var a=K(this);this.va(a,id(this,this.aa(a)));this.b-=10},function(){this.va(K(this),M(this));this.b-=10},function(){this.da|=256;this.b-= +4},Ld,function(){var a;Zc(this,a=K(this)+this.pa);ad(this,a>>8&256);this.b-=10},function(){this.i=this.aa(O(this));this.b-=13},function(){this.pa=this.pa-1&65535;this.b-=5},function(){this.i=jd(this,this.i);this.b-=5},function(){this.i=id(this,this.i);this.b-=5},function(){this.i=M(this);this.b-=7},function(){ad(this,$c(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.S=this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.W; this.b-=5},function(){this.S=this.Z;this.b-=5},function(){this.S=this.aa(K(this));this.b-=7},function(){this.S=this.i;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T=this.U;this.b-=5},function(){this.T=this.V;this.b-=5},function(){this.T=this.W;this.b-=5},function(){this.T=this.Z;this.b-=5},function(){this.T=this.aa(K(this));this.b-=7},function(){this.T=this.i;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-= 5},function(){this.U=this.V;this.b-=5},function(){this.U=this.W;this.b-=5},function(){this.U=this.Z;this.b-=5},function(){this.U=this.aa(K(this));this.b-=7},function(){this.U=this.i;this.b-=5},function(){this.V=this.S;this.b-=5},function(){this.V=this.T;this.b-=5},function(){this.V=this.U;this.b-=5},function(){this.b-=5},function(){this.V=this.W;this.b-=5},function(){this.V=this.Z;this.b-=5},function(){this.V=this.aa(K(this));this.b-=7},function(){this.V=this.i;this.b-=5},function(){this.W=this.S; this.b-=5},function(){this.W=this.T;this.b-=5},function(){this.W=this.U;this.b-=5},function(){this.W=this.V;this.b-=5},function(){this.b-=5},function(){this.W=this.Z;this.b-=5},function(){this.W=this.aa(K(this));this.b-=7},function(){this.W=this.i;this.b-=5},function(){this.Z=this.S;this.b-=5},function(){this.Z=this.T;this.b-=5},function(){this.Z=this.U;this.b-=5},function(){this.Z=this.V;this.b-=5},function(){this.Z=this.W;this.b-=5},function(){this.b-=5},function(){this.Z=this.aa(K(this));this.b-= -7},function(){this.Z=this.i;this.b-=5},function(){this.va(K(this),this.S);this.b-=7},function(){this.va(K(this),this.T);this.b-=7},function(){this.va(K(this),this.U);this.b-=7},function(){this.va(K(this),this.V);this.b-=7},function(){this.va(K(this),this.W);this.b-=7},function(){this.va(K(this),this.Z);this.b-=7},function(){var a=this.R-1;if(this.ca.length)for(var b=0;b>8;this.b-=10},function(){var a=O(this);dd(this)||I(this,a);this.b-=10},function(){this.ua&=-513;this.b-=4},function(){var a=O(this);dd(this)||(Q(this,this.R),I(this,a),this.b-=6);this.b-=11},function(){Q(this,Tc(this)&255|this.i<<8);this.b-=11},function(){this.i=Dd(this,M(this));this.b-=7},function(){Q(this,this.R);I(this,48);this.b-=11},function(){dd(this)&& -(I(this,P(this)),this.b-=6);this.b-=5},function(){this.oa=K(this)&65535;this.b-=5},function(){var a=O(this);dd(this)&&I(this,a);this.b-=10},function(){this.ua|=512;this.b-=4;Gd(this)},function(){var a=O(this);dd(this)&&(Q(this,this.R),I(this,a),this.b-=6);this.b-=11},Nd,function(){L(this,M(this));this.b-=7},function(){Q(this,this.R);I(this,56);this.b-=11}]; -function S(a){z.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!Od[b]&&Pa("Unrecognized ChipSet model: "+b);this.w=Od[b]||{};a.sound&&(this.fa=null,window&&(this.fa=window.AudioContext||window.webkitAudioContext),this.fa&&new this.fa);F(this)}A(S); -var U={Ba:1978.1,vd:{Ca:0,qe:1,ue:16,Be:32,Ke:64,Je:128,mb:14},Ya:{Ca:1,Kc:1,nd:2,jd:4,kd:16,ld:32,md:64,mb:8},wd:{Ca:2,pe:3,Se:4,re:8,Fe:16,Ge:32,He:64,se:128,mb:0},Oe:{Ca:3},Me:{Ca:2,Ce:7},Qe:{Ca:3,Te:1,Pe:2,Ie:4,ze:8,te:16,je:32},Ne:{Ca:4},Re:{Ca:5,ve:1,we:2,xe:4,ye:8,Ue:16}},V={Ba:100,Ka:{Ca:66,mc:1,bc:2,fd:4,Ee:8,De:16,dc:32,cc:64,Yb:128},Ic:{Ca:66,INIT:0},Ta:{Ca:194,le:0,Wb:16,pd:32,ic:48,Sc:0,Tc:32},Ab:{Ca:162,Le:0,Vc:0,Rc:0,Uc:0,Qc:0},La:{Ae:{Ca:98},Sa:{Fc:0,Ec:1,sd:2,Bd:4,Lc:5,qd:6,td:7}, -Cb:16383}},Od={SI1978:U,VT100:V};S.prototype.pa=function(){return!1};S.prototype.Pa=function(a,b,c,d){this.u=b;this.b=c;this.H=d;this.B=a;this.J=tb(a,"Keyboard");this.Fa=tb(a,"SerialPort");this.video=tb(a,"Video");Pb(b,this,this.w.Gb);Tb(b,this,this.w.Hb);if(d){var e=this;Pd(d,16384,function(){for(var a="",b=0;b>8;this.b-=10},function(){var a=O(this);ed(this)||I(this,a);this.b-=10},function(){this.ua&=-513;this.b-=4},function(){var a=O(this);ed(this)||(Q(this,this.R),I(this,a),this.b-=6);this.b-=11},function(){Q(this,Uc(this)&255|this.i<<8);this.b-=11},function(){this.i=Ed(this,M(this));this.b-=7},function(){Q(this,this.R);I(this,48);this.b-=11},function(){ed(this)&& +(I(this,P(this)),this.b-=6);this.b-=5},function(){this.pa=K(this)&65535;this.b-=5},function(){var a=O(this);ed(this)&&I(this,a);this.b-=10},function(){this.ua|=512;this.b-=4;Hd(this)},function(){var a=O(this);ed(this)&&(Q(this,this.R),I(this,a),this.b-=6);this.b-=11},Od,function(){L(this,M(this));this.b-=7},function(){Q(this,this.R);I(this,56);this.b-=11}]; +function S(a){z.call(this,"ChipSet",a,S,32768);var b=a.model;b&&!Pd[b]&&Qa("Unrecognized ChipSet model: "+b);this.w=Pd[b]||{};a.sound&&(this.fa=null,window&&(this.fa=window.AudioContext||window.webkitAudioContext),this.fa&&new this.fa);F(this)}A(S); +var U={Ca:1978.1,yd:{Da:0,te:1,xe:16,Ee:32,Ne:64,Me:128,ob:14},Za:{Da:1,Nc:1,qd:2,md:4,nd:16,od:32,pd:64,ob:8},zd:{Da:2,se:3,Ve:4,ue:8,Ie:16,Je:32,Ke:64,ve:128,ob:0},Re:{Da:3},Pe:{Da:2,Fe:7},Te:{Da:3,We:1,Se:2,Le:4,Ce:8,we:16,me:32},Qe:{Da:4},Ue:{Da:5,ye:1,ze:2,Ae:4,Be:8,Xe:16}},V={Ca:100,Ma:{Da:66,pc:1,ec:2,jd:4,He:8,Ge:16,gc:32,fc:64,ac:128},Lc:{Da:66,INIT:0},Ua:{Da:194,oe:0,Zb:16,sd:32,lc:48,Vc:0,Wc:32},Cb:{Da:162,Oe:0,Yc:0,Uc:0,Xc:0,Tc:0},Na:{De:{Da:98},Ta:{Ic:0,Hc:1,vd:2,Ed:4,Oc:5,td:6,wd:7}, +Db:16383}},Pd={SI1978:U,VT100:V};S.prototype.qa=function(){return!1};S.prototype.Ra=function(a,b,c,d){this.u=b;this.b=c;this.I=d;this.A=a;this.K=ub(a,"Keyboard");this.Ha=ub(a,"SerialPort");this.video=ub(a,"Video");Hb(b,this,this.w.Hb);Ub(b,this,this.w.Ib);if(d){var e=this;Qd(d,16384,function(){for(var a="",b=0;b>8-this.ea&255;E(this,a,null,b,"SHIFT.RESULT",c,!0);return c};l.$d=function(a,b,c){E(this,a,b,c,"SHIFT.COUNT",null,!0);this.ea=b};l.be=function(a,b,c){E(this,a,b,c,"SOUND1",null,!0);this.ra=b};l.ae=function(a,b,c){E(this,a,b,c,"SHIFT.DATA",null,!0);this.Y=b<<8|this.Y>>8}; -l.ce=function(a,b,c){E(this,a,b,c,"SOUND2",null,!0);this.ma=b};l.de=function(a,b,c){E(this,a,b,c,"WATCHDOG",null,!0)};function Qd(a){var b=0,c=0,d=~a.P;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} -l.Td=function(a,b){var c=this.K,c=c&~V.Ka.cc;if((Fc(this.b)&64)<<1&&(c|=V.Ka.cc,c!=this.K)){var d,e;d=this.O&1;e=this.O>>1&7;switch(e){case V.La.Sa.td:break;case V.La.Sa.Ec:this.P=this.P<<1|d;break;case V.La.Sa.Lc:d=Qd(this);this.I[d]=V.La.Cb;hb(this,"doNVRCommand(): erase data at addr "+u(d));break;case V.La.Sa.Fc:this.j=this.j<<1|d;break;case V.La.Sa.Bd:d=Qd(this);e=this.j&V.La.Cb;this.I[d]=e;hb(this,"doNVRCommand(): write data "+u(e)+" to addr "+u(d));break;case V.La.Sa.qd:d=Qd(this);e=this.I[d]; -null==e&&(e=V.La.Cb);this.j=e;hb(this,"doNVRCommand(): read data "+u(e)+" from addr "+u(d));break;case V.La.Sa.sd:this.j<<=1;this.ca=this.j&V.La.Cb+1;break;default:hb(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~V.Ka.dc;this.ca&&(c|=V.Ka.dc);c&=~V.Ka.Yb;if(d=this.J){d=this.J;if(e=d.D)e=d.b,e=Fc(d.b)>=d.K+e.Y*e.Ra/1E3*1.2731488;e&&(d.D=!1);d=!d.D}d&&(c|=V.Ka.Yb);c&=~V.Ka.mc;this.Fa&&this.Fa.Da&1&&(c|=V.Ka.mc);this.K=c;E(this,a,null,b,"FLAGS",c);return c}; -l.ee=function(a,b,c){E(this,a,b,c,"BRIGHTNESS");this.ha=b};l.he=function(a,b,c){E(this,a,b,c,"NVR.LATCH");this.O=b};l.ge=function(a,b,c){E(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.D=this.D&-4|a;break;case 1:this.D=this.D&-13|a<<2;this.video&&(b=this.video,a=this.D,hb(b,"updateScrollOffset("+a+")"),b.eb!==a&&((b.eb=a)?Mc(b,!0):b.ob=!0));break;case 2:switch(a){case 0:this.ba=~this.ba;break;case 2:case 3:this.la=3-a}break;case 3:this.ja=a}}; -l.fe=function(a,b,c){E(this,a,b,c,"DC011");b&V.Ta.pd?(b&=V.Ta.ic,this.M!=b&&(this.M=b,this.video&&(a=this.video,b=this.M==V.Ta.ic?50:60,hb(a,"updateRate("+b+")"),a.qc=b))):(b&=V.Ta.Wb,this.L!=b&&(this.L=b,this.video&&(a=this.L==V.Ta.Wb?132:80,b=this.video,hb(b,"updateDimensions("+a+","+(80>>0,g],q=pa(p,k,a.uc);0>q&&p.splice(-(q+1),0,k)}n&&(h.a=n.replace(/''/g,'"'))}a.G.push({gf:b,F:c,Vd:d,Qa:e,tc:f})}delete this.Qa}return!0};Td.prototype.Ia=function(){return!0}; -function Ud(a,b,c,d){if(d)a.ka("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Bb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.B=f;else if(g)for(a.B=Array(4*g.length),d=c=0;c>8&255,a.B[d++]=g[c]>>16&255,a.B[d++]=g[c]>>24&255;else a.B=e;a.Qa=e.symbols;if(!a.B.length){w("Empty ROM: "+b);return}if(1==a.B.length){w(a.B[0]);return}}catch(h){a.ka("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, -" ").replace(/ +$/,"").split(" "),a.B=Array(b.length),e=0;e>>f.ia;0>>=f.ia;0d?a.j.push({Rb:b,Ob:Date.now(),Db:!1}):(a.j[d].Ob=Date.now(),a.j[d].Db=!1);else if(0<=d){if(!a.j[d].Db){var e=a.j[d].Ob;if(e&&100>Date.now()-e)return a.j[d].Db=!0,ge(a),!0}a.j.splice(d,1)}if(a.I){d=0;switch(b){case "1p":d=U.Ya.jd;break;case "2p":d=U.Ya.nd;break;case "coin":d=U.Ya.Kc;break;case "left":d=U.Ya.ld;break;case "right":d=U.Ya.md;break;case "fire":d=U.Ya.kd}d&&(a=a.I,b=d,a.G&=~b,c&&(a.G|=b))}return!0} -function ge(a){for(var b=0,c=-1;bc||c>e)c=e}else{ee(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){ge(a)},c)}l.Ud=function(a,b){var c=this.G;0<=this.w&&(this.w>3)*a.ba,!xb(a.u,a.Ua,a.P,3)))return!1;a.P?(a.lc=a.I.createImageData(b,c),a.oc=16/a.Va|0,me(a,a.P>>1)):me(a,(a.ca+1)*a.wa);a.L=document.createElement("canvas");a.L.width=b;a.L.height=c;a.nb=a.L.getContext("2d");a.fa={};a.ra=1<=a.fc?8:16,f=8>(7>4)*c)}return k}he.prototype.Ea=function(){return!0};he.prototype.pa=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Jb[b]=c,!0;switch(b){case "fullScreen":return this.N[b]=c,this.j&&this.j.gb?c.onclick=function(){d.gb()}:c.parentNode.removeChild(c),!0}return!1}; -he.prototype.gb=function(){var a=!1;if(this.j){if(this.j.gb){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.Y/this.O;b>c&&(a=Math.round(c/b*100)+"%")}this.kc?(this.M.style.width=a,this.M.style.width=a,this.M.style.display="block",this.M.style.margin="auto"):(this.j.style.width=a,this.j.style.height="auto");this.j.style.backgroundColor="black";this.j.gb();a=!0}this.la&&this.la.focus()}return a}; -function ke(a,b){!b&&a.j&&(a.kc?a.M.style.width=a.M.style.height="":a.j.style.width=a.j.style.height="");hb(a,"notifyFullScreen("+b+")")}function me(a,b){a.nc=b;a.ja=!1;if(void 0===a.G||a.G.length!=a.nc)a.G=Array(a.nc)}function oe(a,b,c,d,e){d=a.w?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ma&&(208<=c&&236>c?e=a.ra+0:28<=c&&72>c&&(e=a.ra+1));a=a.ha[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Mc(a,b){var c=!0;if(!b){a.Wa&&(120==a.Wa?a.pc&1?(Hd(a.b,2),c=!1):Hd(a.b,1):Hd(a.b,4));if(c&&a.ja&&a.P){for(var d=a.u,e=a.P,f=!0,g=a.Ua>>>d.ia;0>=1);;){var v=Ab(a.u,p++);if(127==(v&127)){var r=Ab(a.u,p++),d=r&96,c=(r&15)<<8|Ab(a.u,p),c=c+ -(r&16?8192:16384);break}if(n>4)*v.na,C,T,da,X,ta=v.sa,Cb=v.na;y?(C=x*r.sa,T=e*r.na,da=r.sa,X=r.na):(C=x*r.gc,T=e*r.hc,da=r.gc,X=r.hc);v.sa>r.sa&&(C*=2,da*=2);v.na>r.na&&(q||(G+=r.na),Cb=r.na);y?y.drawImage(v.canvas,ga,G,ta,Cb,C,T,da,X):(C+=0,T+=0,r.I.drawImage(v.canvas, -ga,G,ta,Cb,C,T,da,X))}h++}g++}e++}}a.ja=!0;!b&&a.ob&&1==h&&(a.G[k]=-1,h=0);a.ob=!1;(h||b)&&a.nb&&a.I.drawImage(a.L,0,a.eb,a.K,a.ba-a.na,0,0,a.Dc,a.Gd)}else{e=a.Ua;f=e+a.P;k=h=g=0;b=a.K;n=0;c=a.ba;q=d=0;p=a.Va;x=(1<>8|(r&255)<<8);h>y&x,oe(a,a.lc,h++,k,ga),y+=p;h>n&&(n=h);k=d&&(d=k+1)}e+=2;g++;if(h>=a.K&&(h=0,k++,k>a.ba))break}a.ja=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=wa().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||Va.aspect);f&&.3<=f&&3.33>=f&&(Ma("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");Ca("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new he(d,e,g,f,c);fb(d,c)}}); -function pe(a){this.fa=+a.adapter;switch(this.fa){case 0:this.ha=0;this.la=2;break;default:w("Unrecognized serial adapter #"+this.fa);return}this.j=this.w=null;this.ja=a.tabSize;this.ea=a.charBOL;this.D=0;this.ba=!1;z.call(this,"SerialPort",a,pe,8388608);var b=a.binding;if("console"==b)this.w="";else{var c;a=qe;b&&(void 0===c&&(c="Panel"),(c=eb(c,this.id))&&(b=c.N[b])&&this.pa(null,a,b))}this.G="";this.J=this.M=null;this.exports={connect:this.zc,receiveData:this.Qb}}A(pe); -var re=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],se=[!1,0,0,133,142,39,238],qe="buffer";l=pe.prototype; -l.pa=function(a,b,c,d){var e=this;switch(b){case qe:return this.N[b]=this.j=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=na(b[0]);if(c!=this.cb)return;b=na(b[1]);if(this.J=db(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.M=d.receiveData){this.status(this.Bb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};l.Ea=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -l.Ia=function(a){return a?this.save():!0};l.reset=function(){we(this)};l.save=function(){var a=new J(this),b=0,c=[];c[b++]=this.L;c[b++]=this.Y;c[b++]=this.ca;c[b++]=this.Da;c[b++]=this.K;c[b++]=this.P;c[b]=this.O;a.set(0,c);return a.data()};l.restore=function(a){return we(this,a[0])};function we(a,b){var c=0;b||(b=se);a.L=b[c++];a.Y=b[c++];a.ca=b[c++];a.Da=b[c++];a.K=b[c++];a.P=b[c++];a.O=b[c];return!0} -function xe(a,b){var c=a.O&b;b&15||(c>>=4);b=re[c];c=((a.K&12)>>2)+6;a.K&16&&c++;c+=((a.K&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function te(a,b){hb(a,"receiveByte("+ca(b)+"), status="+ca(a.Da));return a.ba||a.Da&2?!1:(a.Y=b,a.Da|=2,Hd(a.b,a.la),!0)}l.Qb=function(a){null!=a&&(this.G="number"!=typeof a?a:this.G+String.fromCharCode(a));this.G&&(te(this,this.G.charCodeAt(0))&&(this.G=this.G.substr(1)),this.G&&this.b&&Kc(this.b,this.ra,xe(this,15)));return!0}; -l.Od=function(a,b){var c=this.Y;E(this,a,null,b,"DATA",c);this.Da&=-3;return c};l.Nd=function(a,b){var c=this.Da;E(this,a,null,b,"STATUS",c);return c}; -l.Zd=function(a,b,c){E(this,a,b,c,"DATA");this.ca=b;this.Da&=-6;hb(this,"transmitByte("+ca(b)+")");if(19==b)this.ba=!0;else if(17==b)this.ba=!1;else if(this.M&&this.M.call(this.J,b),this.j)8==b?(this.j.value=this.j.value.slice(0,-1),0":String.fromCharCode(b),c=a.length,9==b?(b=this.ja||8,c=b-this.D%b,this.ja&&(a=ma("",c))):13==b&&(this.D=c=0,a="\n"),this.ea&&!this.D&&c&&(a=String.fromCharCode(this.ea)+a),this.j.value+=a,this.j.scrollTop=this.j.scrollHeight, -this.D+=c);else if(null!=this.w){if(10==b||1024<=this.w.length)this.g(this.w),this.w="";10!=b&&(this.w+=String.fromCharCode(b))}this.b&&Kc(this.b,this.ma,xe(this,240))};l.Yd=function(a,b,c){E(this,a,b,c,"CONTROL");this.L?(this.P=b,this.P&64&&(this.L=!1)):(this.K=b,this.L=!0)};l.Xd=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.O=b};var ue={0:pe.prototype.Od,1:pe.prototype.Nd},ve={0:pe.prototype.Zd,1:pe.prototype.Yd,2:pe.prototype.Xd}; -Na(function(){for(var a=D(document,"pc8080","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ye.prototype.Mb=function(){return-1};ye.prototype.Nb=function(){}; -ye.prototype.Fb=function(a,b,c){if(b)if(a){0>this.j&&this.w.length&&(this.j=0);if(0>this.j||a!=this.w[this.j])this.w.splice(0,0,a),this.j=0;this.j--}else this.P?a="end":a=this.w[this.j+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; -function Ae(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +l.save=function(){var a=new J(this);switch(this.w.Ca){case U.Ca:a.set(0,[this.wa,this.G,this.Ba,this.Y,this.ea,this.ma,this.na]);break;case V.Ca:a.set(0,[this.ha,this.J]),a.set(1,[this.L,this.M]),a.set(2,[this.C,this.ba,this.la,this.ja]),a.set(3,[this.P,this.j,this.O,this.ca,this.F])}return a.data()}; +l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.w.Ca){case U.Ca:return this.wa=b[0],this.G=b[1],this.Ba=b[2],this.Y=b[3],this.ea=b[4],this.ma=b[5],this.na=b[6],!0;case V.Ca:return this.ha=b[0],this.J=b[1],b=a[1],this.L=b[0],this.M=b[1],b=a[2],this.C=b[0],this.ba=b[1],this.la=b[2],this.ja=b[3],b=a[3],this.P=b[0],this.j=b[1],this.O=b[2],this.ca=b[3],this.F=b[4],!0}return!1};l.start=function(){};l.stop=function(){};l.Td=function(a,b){var c=this.wa;E(this,a,null,b,"STATUS0",c,!0);return c}; +l.Ud=function(a,b){var c=this.G;E(this,a,null,b,"STATUS1",c,!0);return c};l.Vd=function(a,b){var c=this.Ba;E(this,a,null,b,"STATUS2",c,!0);return c};l.Sd=function(a,b){var c=this.Y>>8-this.ea&255;E(this,a,null,b,"SHIFT.RESULT",c,!0);return c};l.ce=function(a,b,c){E(this,a,b,c,"SHIFT.COUNT",null,!0);this.ea=b};l.ee=function(a,b,c){E(this,a,b,c,"SOUND1",null,!0);this.ma=b};l.de=function(a,b,c){E(this,a,b,c,"SHIFT.DATA",null,!0);this.Y=b<<8|this.Y>>8}; +l.fe=function(a,b,c){E(this,a,b,c,"SOUND2",null,!0);this.na=b};l.ge=function(a,b,c){E(this,a,b,c,"WATCHDOG",null,!0)};function Rd(a){var b=0,c=0,d=~a.P;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} +l.Wd=function(a,b){var c=this.J,c=c&~V.Ma.fc;if((Gc(this.b)&64)<<1&&(c|=V.Ma.fc,c!=this.J)){var d,e;d=this.O&1;e=this.O>>1&7;switch(e){case V.Na.Ta.wd:break;case V.Na.Ta.Hc:this.P=this.P<<1|d;break;case V.Na.Ta.Oc:d=Rd(this);this.F[d]=V.Na.Db;ib(this,"doNVRCommand(): erase data at addr "+u(d));break;case V.Na.Ta.Ic:this.j=this.j<<1|d;break;case V.Na.Ta.Ed:d=Rd(this);e=this.j&V.Na.Db;this.F[d]=e;ib(this,"doNVRCommand(): write data "+u(e)+" to addr "+u(d));break;case V.Na.Ta.td:d=Rd(this);e=this.F[d]; +null==e&&(e=V.Na.Db);this.j=e;ib(this,"doNVRCommand(): read data "+u(e)+" from addr "+u(d));break;case V.Na.Ta.vd:this.j<<=1;this.ca=this.j&V.Na.Db+1;break;default:ib(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~V.Ma.gc;this.ca&&(c|=V.Ma.gc);c&=~V.Ma.ac;if(d=this.K){d=this.K;if(e=d.C)e=d.b,e=Gc(d.b)>=d.J+e.Y*e.Sa/1E3*1.2731488;e&&(d.C=!1);d=!d.C}d&&(c|=V.Ma.ac);c&=~V.Ma.pc;this.Ha&&this.Ha.Fa&1&&(c|=V.Ma.pc);this.J=c;E(this,a,null,b,"FLAGS",c);return c}; +l.he=function(a,b,c){E(this,a,b,c,"BRIGHTNESS");this.ha=b};l.ke=function(a,b,c){E(this,a,b,c,"NVR.LATCH");this.O=b};l.je=function(a,b,c){E(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.C=this.C&-4|a;break;case 1:this.C=this.C&-13|a<<2;this.video&&(b=this.video,a=this.C,ib(b,"updateScrollOffset("+a+")"),b.gb!==a&&((b.gb=a)?Nc(b,!0):b.qb=!0));break;case 2:switch(a){case 0:this.ba=~this.ba;break;case 2:case 3:this.la=3-a}break;case 3:this.ja=a}}; +l.ie=function(a,b,c){E(this,a,b,c,"DC011");b&V.Ua.sd?(b&=V.Ua.lc,this.M!=b&&(this.M=b,this.video&&(a=this.video,b=this.M==V.Ua.lc?50:60,ib(a,"updateRate("+b+")"),a.tc=b))):(b&=V.Ua.Zb,this.L!=b&&(this.L=b,this.video&&(a=this.L==V.Ua.Zb?132:80,b=this.video,ib(b,"updateDimensions("+a+","+(80>>0,g],q=pa(p,k,a.xc);0>q&&p.splice(-(q+1),0,k)}n&&(h.a=n.replace(/''/g,'"'))}a.G.push({kf:b,H:c,Yd:d,Ea:e,wc:f})}delete this.Ea}return!0};Ud.prototype.Ka=function(){return!0}; +function Vd(a,b,c,d){if(d)a.ka("Unable to load system ROM (error "+d+": "+b+")");else{cb(a.fb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Ea=e.symbols;if(!a.A.length){w("Empty ROM: "+b);return}if(1==a.A.length){w(a.A[0]);return}}catch(h){a.ka("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, +" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e>>f.ia;0>>= +f.ia;0d?a.j.push({Ub:b,Pb:Date.now(),Eb:!1}):(a.j[d].Pb=Date.now(),a.j[d].Eb=!1);else if(0<=d){if(!a.j[d].Eb){var e=a.j[d].Pb;if(e&&100>Date.now()-e)return a.j[d].Eb=!0,he(a),!0}a.j.splice(d,1)}if(a.F){d=0;switch(b){case "1p":d=U.Za.md;break;case "2p":d=U.Za.qd;break;case "coin":d=U.Za.Nc;break;case "left":d=U.Za.od;break;case "right":d=U.Za.pd;break;case "fire":d=U.Za.nd}d&&(a=a.F,b=d,a.G&=~b,c&&(a.G|=b))}return!0} +function he(a){for(var b=0,c=-1;bc||c>e)c=e}else{fe(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){he(a)},c)}l.Xd=function(a,b){var c=this.G;0<=this.w&&(this.w>3)*a.ba,!yb(a.u,a.Va,a.P,3)))return!1;a.P?(a.oc=a.F.createImageData(b,c),a.rc=16/a.Wa|0,ne(a,a.P>>1)):ne(a,(a.ca+1)*a.wa);a.L=document.createElement("canvas");a.L.width=b;a.L.height=c;a.pb=a.L.getContext("2d");a.fa={};a.ma=1<=a.ic?8:16,f=8>(7>4)*c)}return k}ie.prototype.Ga=function(){return!0};ie.prototype.qa=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Kb[b]=c,!0;switch(b){case "fullScreen":return this.N[b]=c,this.j&&this.j.ib?c.onclick=function(){d.ib()}:c.parentNode.removeChild(c),!0}return!1}; +ie.prototype.ib=function(){var a=!1;if(this.j){if(this.j.ib){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.Y/this.O;b>c&&(a=Math.round(c/b*100)+"%")}this.nc?(this.M.style.width=a,this.M.style.width=a,this.M.style.display="block",this.M.style.margin="auto"):(this.j.style.width=a,this.j.style.height="auto");this.j.style.backgroundColor="black";this.j.ib();a=!0}this.la&&this.la.focus()}return a}; +function le(a,b){!b&&a.j&&(a.nc?a.M.style.width=a.M.style.height="":a.j.style.width=a.j.style.height="");ib(a,"notifyFullScreen("+b+")")}function ne(a,b){a.qc=b;a.ja=!1;if(void 0===a.G||a.G.length!=a.qc)a.G=Array(a.qc)}function pe(a,b,c,d,e){d=a.w?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.na&&(208<=c&&236>c?e=a.ma+0:28<=c&&72>c&&(e=a.ma+1));a=a.ha[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} +function Nc(a,b){var c=!0;if(!b){a.Xa&&(120==a.Xa?a.sc&1?(Id(a.b,2),c=!1):Id(a.b,1):Id(a.b,4));if(c&&a.ja&&a.P){for(var d=a.u,e=a.P,f=!0,g=a.Va>>>d.ia;0>=1);;){var v=Bb(a.u,p++);if(127==(v&127)){var r=Bb(a.u,p++),d=r&96,c=(r&15)<<8|Bb(a.u,p),c=c+ +(r&16?8192:16384);break}if(n>4)*v.oa,C,T,da,X,ta=v.sa,Eb=v.oa;y?(C=x*r.sa,T=e*r.oa,da=r.sa,X=r.oa):(C=x*r.jc,T=e*r.kc,da=r.jc,X=r.kc);v.sa>r.sa&&(C*=2,da*=2);v.oa>r.oa&&(q||(H+=r.oa),Eb=r.oa);y?y.drawImage(v.canvas,ga,H,ta,Eb,C,T,da,X):(C+=0,T+=0,r.F.drawImage(v.canvas, +ga,H,ta,Eb,C,T,da,X))}h++}g++}e++}}a.ja=!0;!b&&a.qb&&1==h&&(a.G[k]=-1,h=0);a.qb=!1;(h||b)&&a.pb&&a.F.drawImage(a.L,0,a.gb,a.J,a.ba-a.oa,0,0,a.Gc,a.Jd)}else{e=a.Va;f=e+a.P;k=h=g=0;b=a.J;n=0;c=a.ba;q=d=0;p=a.Wa;x=(1<>8|(r&255)<<8);h>y&x,pe(a,a.oc,h++,k,ga),y+=p;h>n&&(n=h);k=d&&(d=k+1)}e+=2;g++;if(h>=a.J&&(h=0,k++,k>a.ba))break}a.ja=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=xa().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||Wa.aspect);f&&.3<=f&&3.33>=f&&(Na("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");Da("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new ie(d,e,g,f,c);gb(d,c)}}); +function qe(a){this.fa=+a.adapter;switch(this.fa){case 0:this.ha=0;this.la=2;break;default:w("Unrecognized serial adapter #"+this.fa);return}this.j=this.w=null;this.ja=a.tabSize;this.ea=a.charBOL;this.C=0;this.ba=!1;z.call(this,"SerialPort",a,qe,8388608);var b=a.binding;if("console"==b)this.w="";else{var c;a=re;b&&(void 0===c&&(c="Panel"),(c=fb(c,this.id))&&(b=c.N[b])&&this.qa(null,a,b))}this.G="";this.K=this.M=null;this.exports={connect:this.Cc,receiveData:this.Tb}}A(qe); +var se=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],te=[!1,0,0,133,142,39,238],re="buffer";l=qe.prototype; +l.qa=function(a,b,c,d){var e=this;switch(b){case re:return this.N[b]=this.j=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=na(b[0]);if(c!=this.eb)return;b=na(b[1]);if(this.K=eb(b)){var d=this.K.exports;if(d){var e=d.connect;e&&e.call(this.K);if(this.M=d.receiveData){this.status(this.fb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};l.Ga=function(a,b){if(!b)if(this.Cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +l.Ka=function(a){return a?this.save():!0};l.reset=function(){xe(this)};l.save=function(){var a=new J(this),b=0,c=[];c[b++]=this.L;c[b++]=this.Y;c[b++]=this.ca;c[b++]=this.Fa;c[b++]=this.J;c[b++]=this.P;c[b]=this.O;a.set(0,c);return a.data()};l.restore=function(a){return xe(this,a[0])};function xe(a,b){var c=0;b||(b=te);a.L=b[c++];a.Y=b[c++];a.ca=b[c++];a.Fa=b[c++];a.J=b[c++];a.P=b[c++];a.O=b[c];return!0} +function ye(a,b){var c=a.O&b;b&15||(c>>=4);b=se[c];c=((a.J&12)>>2)+6;a.J&16&&c++;c+=((a.J&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function ue(a,b){ib(a,"receiveByte("+ca(b)+"), status="+ca(a.Fa));return a.ba||a.Fa&2?!1:(a.Y=b,a.Fa|=2,Id(a.b,a.la),!0)}l.Tb=function(a){null!=a&&(this.G="number"!=typeof a?a:this.G+String.fromCharCode(a));this.G&&(ue(this,this.G.charCodeAt(0))&&(this.G=this.G.substr(1)),this.G&&this.b&&Lc(this.b,this.ma,ye(this,15)));return!0}; +l.Rd=function(a,b){var c=this.Y;E(this,a,null,b,"DATA",c);this.Fa&=-3;return c};l.Qd=function(a,b){var c=this.Fa;E(this,a,null,b,"STATUS",c);return c}; +l.be=function(a,b,c){E(this,a,b,c,"DATA");this.ca=b;this.Fa&=-6;ib(this,"transmitByte("+ca(b)+")");if(19==b)this.ba=!0;else if(17==b)this.ba=!1;else if(this.M&&this.M.call(this.K,b),this.j)8==b?(this.j.value=this.j.value.slice(0,-1),0":String.fromCharCode(b),c=a.length,9==b?(b=this.ja||8,c=b-this.C%b,this.ja&&(a=ma("",c))):13==b&&(this.C=c=0,a="\n"),this.ea&&!this.C&&c&&(a=String.fromCharCode(this.ea)+a),this.j.value+=a,this.j.scrollTop=this.j.scrollHeight, +this.C+=c);else if(null!=this.w){if(10==b||1024<=this.w.length)this.g(this.w),this.w="";10!=b&&(this.w+=String.fromCharCode(b))}this.b&&Lc(this.b,this.na,ye(this,240))};l.ae=function(a,b,c){E(this,a,b,c,"CONTROL");this.L?(this.P=b,this.P&64&&(this.L=!1)):(this.J=b,this.L=!0)};l.$d=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.O=b};var ve={0:qe.prototype.Rd,1:qe.prototype.Qd},we={0:qe.prototype.be,1:qe.prototype.ae,2:qe.prototype.$d}; +Oa(function(){for(var a=D(document,"pc8080","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ze.prototype.Nb=function(){return-1};ze.prototype.Ob=function(){}; +ze.prototype.Gb=function(a,b,c){if(b)if(a){0>this.j&&this.w.length&&(this.j=0);if(0>this.j||a!=this.w[this.j])this.w.splice(0,0,a),this.j=0;this.j--}else this.P?a="end":a=this.w[this.j+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; +function Be(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function Be(a,b,c){var d;if(b){b=Ce(a,b);for(var e=0,f=!1,g=b,h=[],k=[],n=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=p+g;d>>=8}d=t(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function Ge(a,b){if(b)return Ee(a,b,a.ea[b]);var c=0;for(b in a.ea)Ee(a,b,a.ea[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=p+g;d>>=8}d=t(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function He(a,b){if(b)return Fe(a,b,a.ea[b]);var c=0;for(b in a.ea)Fe(a,b,a.ea[b]),c++;return 0>>d.u.ia;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,n=0;k--;){var p=b[e];p.type==c?n++||d.g("..."):(c=p.type,n=zb[c],p&&d.g(t(p.id)+" %"+t(e<>>e.ia;f!=e.u?e.X[g].Tb(f,b&65535,d):(e.X[g++].zb(f,b&255,d),e.X[g&e.G].zb(0,b>>8&255,d+1));c&&sf(a,c);Dc(this.b,!0)}};function Y(a){return{F:a,Oa:!1}}function tf(a){return[a.F,a.Oa]}function uf(a){return{F:a[0],Oa:a[1]}} -function Se(a,b,c){var d;c=(c?a.M:a.Ua).F;if(void 0!==b){d=b=Ce(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=sa(Pe,a.substr(b,1))));return c};function xf(a,b){var c=0;a=a.Nb(b);if(void 0!==a)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?t(a,c):"??"} -l.Nb=function(a){var b;if(0<=a){var c=this.b;switch(a){case 7:b=c.i;break;case 0:b=c.S;break;case 1:b=c.T;break;case 8:b=Uc(c);break;case 2:b=c.U;break;case 3:b=c.V;break;case 9:b=Wc(c);break;case 4:b=c.W;break;case 5:b=c.Z;break;case 10:b=K(c);break;case 6:b=c.aa(K(c));break;case 11:b=c.oa;break;case 12:b=c.R;break;case 13:b=Tc(c);break;case 14:b=Tc(c)&255|c.i<<8}}return b}; -function yf(a,b){b=Ce(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Mb(b,c+1),0<=e&&(b=b.substr(0,c)+xf(a,e)+b.substr(c+1+Pe[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=Se(a,e))?(d=e+' "'+wf(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=Se(a,e))?(sf(d),d=e+ -' "'+wf(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}l.message=function(a,b){b&&(a+=" at "+Z(Y(this.b.R).F));this.ta&1073741824?this.ra.push(a):this.la&&a==this.la||(this.la=a,this.ta&-2147483648&&(this.qa(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Lc(a),a.P=0,Dc(a)))}; -function gb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.ta&h)!=h||a.message(b.cb+"."+(null!=d?"outPort":"inPort")+"("+u(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))} -function Ke(a){var b;if(Id(a)){if(!a.L||!a.L.length){a.L=Array(1E3);for(b=0;b>>d.ia],!1)}a.O=["br"];if(a.D)for(b=1;b>>d.ia],!0);a.D=["bw"];a.Wa=0}l.Za=function(a,b,c){var d=!0;c||Df(this,a,b,!1,!0);if(a!=this.I){var e=Re(b);if(-1===e)this.g("invalid address: "+Z(b.F)),d=!1;else{var f=this.u;f.X[e>>>f.ia].Za(e&f.u,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(Ef(this,a,a.length-1,"set"),Ke(this)));return d}; -function Df(a,b,c,d,e){var f=!1;c=Re(c);for(var g=1;g>>d.ia],b==a.D));h.Oa||Ke(a);break}}return f}function Ff(a,b){for(var c=1;c>24,4);break;case 3:y=t(v.$a(y,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?y="["+y+"]":r&16||(y=(v.style==Ie?"$":"0x")+y);v=y}else r&16? -(v=(q&3840)>>8,r=Pe[v],8086==a.style&&q&64&&(6==v&&(r="HL"),r="["+r+"]"),v=r):r&128&&(v=(f>>3&7).toString());if(!v||!v.length){h="INVALID";break}0b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Vd;if(e>=g&&e>8&255;case "C":d.T=f&255;break;case "D":d.U=f&255;break; -case "DE":d.U=f>>8&255;case "E":d.V=f&255;break;case "H":d.W=f&255;break;case "HL":d.W=f>>8&255;case "L":d.Z=f&255;break;case "SP":d.oa=f&65535;break;case "PC":I(d,f);a.M=Y(d.R);break;case "PS":Rc(d,f);break;case "PSW":Rc(d,f&255|d.ua&-256);d.i=f>>8;break;case "CF":d.da=f?d.da|256:d.da&255;break;case "PF":f?ad(d)||(d.ga^=1):ad(d)&&(d.ga^=1);break;case "AF":d.ya=f?~d.ga&16|d.ya&-17:d.ga&16|d.ya&-17;break;case "ZF":d.da=f?d.da&-256:d.da|255;break;case "SF":f?dd(d)||(d.ga^=192):dd(d)&&(d.ga^=192);break; -case "IF":d.ua=f?d.ua|512:d.ua&-513;break;default:a.g("unknown register: "+e);return}Dc(d);a.g("updated registers:")}a.g(Kf(a));c&&(a.M=Y(d.R),Bf(a,Z(a.M.F)))}}function Rf(a,b){b=na(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(yf(a,c[2])):Be(a,b,!0)}function Sf(a,b,c){var d="t"!=b;c=De(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Da(c,function(){return jb(a,!0)&&a.kb(e,d,!1)},function(){Dc(a.b);jb(a,!1)})} -function Bf(a,b,c,d){if(b=Se(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Se(a,c,!0);if(!d||d.Fh[0].indexOf("+"))){var n=h[0]+":";h[2]&&(n+=" "+h[2]);a.g(n)}h[3]&&(g=h[3],f=null);f=Hf(a,b,g,f);a.g(f);a.M=b;e-=b.F-k;c++}}} -l.Fb=function(a,b,c){if(b)if(a){0>this.j&&this.w.length&&(this.j=0);if(0>this.j||a!=this.w[this.j])this.w.splice(0,0,a),this.j=0;this.j--}else this.P?a="end":a=this.w[this.j+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; -function Gf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.P&&(a.g("ended assemble at "+Z(a.ca.F)),a.M=a.ca,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.la=null;if(lb(a)&&0n||"z"Fa.length&&(a.g("note: only "+Fa.length+" available"),ia=Fa.length);ua-=ia;0>ua&&(null==Fa[Fa.length-1].F?(ia=ua+ia,ua=0):ua+=Fa.length);var ld=[];"call"==Ye&&(Gb=1E5,ld=["CALL"]);for(void 0!==Xe&&a.g(ia+" instructions earlier:");0< -Gb&&ua!=a.fa;){var af=Fa[ua++];if(null==af.F)break;var Hb=Y(af.F),kg=ia--,bf=Hf(a,Hb,"history",kg);(!ld.length||0<=bf.indexOf(ld[0]))&&a.g(bf);Hb.Lb&&(ua+=Hb.Lb,Gb-=Hb.Lb,ia-=Hb.Lb);ua>=Fa.length&&(ua=0);a.eb=ia;$e++;Gb--}}$e||(a.g("no "+Ze+"history available"),a.eb=void 0)}else{var nc=Se(a,X);if(nc){var oc=0;ta&&("l"==ta.charAt(0)&&(ta=ta.substr(1)||Cb),oc=De(a,ta)>>>0,65536>4||1;lg--&&0sc?String.fromCharCode(sc):".";qc--}Ib&&(Ib+="\n");Ib+=X+" "+nd+(Jb?"":" "+cf)}Ib&&a.g(Ib);a.Ua=nc}}}}break;case "e":if("else"==f[0])break;var tc=1,df=255,ef=a.aa,ff=a.va;"ew"==f[0]&&(tc=2,df=65535,ef=a.$a,ff=a.Ib);var gf=tc<<1,hf=f[1];if(null==hf)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 uc=Se(a,hf);if(uc)for(var vc=2;vcud;){for(var Xa=null,rg=256;65536>Mb.F>>>0;){kf.F=a.$a(Mb,2);if(null==Mb.F||!rg--)break;for(var sg=a,xc=kf,lf= -null,Nb=xc.F,mf=Nb,vd=1;6>=vd&&Nb;vd++){if(2\nLicense: GPL version 3 or later ");for(b=0;bWf){if(Yf(d,this.L)){this.D=new J(this,"1.30.1","failsafe");Yf(this.D)&&(cg(this,d),a=2,dg(this.D));this.D.set("timestamp",ra());eg(this.D);var e=this.B&&!this.J;if(1==a||xa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=bg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Yf(d,g):("error"== -f&&"no machine state"!=g?(this.ka("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.j=null)):this.g(f+": "+g),dg(d),Yf(d)?(c=bg(d),e=!0):c=!1))}e&&ag(this,c?d:null)}else 2==a&&d.clear()}else ag(this);delete this.L;delete this.M}e=cb(this.id);for(f=0;fa[1];a=a[2];this.ha=!0;this.C.xa=!0;var d=this.N.power;d&&(d.textContent="Shutdown");this.b&&(fg(this,this.b,b,c,a),this.b.rb());this.Y&&(cg(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.w=0}; -function cg(a,b){if(xa("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.j||"";b=b.toString();var d={app:"PC8080",ver:"1.30.1"};d.url=a.fa;d.user=c;d.type="bug";d.data=b;va("http://www.pcjs.org/api/v1/report",d,!0)}} -function Tf(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new J(a,"1.30.1"),g=new J(a,"1.30.1","validate"),h=ra();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",wa());a.b&&a.b.Ia&&(c&&a.b.qa(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.xa=!1,!1===d&&(e=null)));for(var h=cb(a.id),k=0;kf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PC8080$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255>>d.u.ia;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,n=0;k--;){var p=b[e];p.type==c?n++||d.g("..."):(c=p.type,n=Ab[c],p&&d.g(t(p.id)+" %"+t(e<>>e.ia;f!=e.u?e.X[g].Wb(f,b&65535,d):(e.X[g++].Bb(f,b&255,d),e.X[g&e.G].Bb(0,b>>8&255,d+1));c&&Ue(a,c);Ec(this.b,!0)}};function Y(a){return{H:a,Qa:!1}}function uf(a){return[a.H,a.Qa]}function vf(a){return{H:a[0],Qa:a[1]}} +function Te(a,b,c){var d;c=(c?a.M:a.Va).H;if(void 0!==b){d=b=De(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=sa(Qe,a.substr(b,1))));return c};function yf(a,b){var c=0;a=a.Ob(b);if(void 0!==a)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?t(a,c):"??"} +l.Ob=function(a){var b;if(0<=a){var c=this.b;switch(a){case 7:b=c.i;break;case 0:b=c.S;break;case 1:b=c.T;break;case 8:b=Vc(c);break;case 2:b=c.U;break;case 3:b=c.V;break;case 9:b=Xc(c);break;case 4:b=c.W;break;case 5:b=c.Z;break;case 10:b=K(c);break;case 6:b=c.aa(K(c));break;case 11:b=c.pa;break;case 12:b=c.R;break;case 13:b=Uc(c);break;case 14:b=Uc(c)&255|c.i<<8}}return b}; +function zf(a,b){b=De(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Nb(b,c+1),0<=e&&(b=b.substr(0,c)+yf(a,e)+b.substr(c+1+Qe[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=aa(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=Te(a,e))?(d=e+' "'+xf(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=Te(a,e))?(Ue(d),d=e+ +' "'+xf(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}l.message=function(a,b){b&&(a+=" at "+Z(Y(this.b.R).H));this.ta&1073741824?this.ma.push(a):this.la&&a==this.la||(this.la=a,this.ta&-2147483648&&(this.ra(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Mc(a),a.P=0,Ec(a)))}; +function hb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.ta&h)!=h||a.message(b.eb+"."+(null!=d?"outPort":"inPort")+"("+u(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))} +function Le(a){var b;if(Jd(a)){if(!a.L||!a.L.length){a.L=Array(1E3);for(b=0;b>>d.ia],!1)}a.O=["br"];if(a.C)for(b=1;b>>d.ia],!0);a.C=["bw"];a.Xa=0}l.$a=function(a,b,c){var d=!0;c||Ef(this,a,b,!1,!0);if(a!=this.F){var e=Se(b);if(-1===e)this.g("invalid address: "+Z(b.H)),d=!1;else{var f=this.u;f.X[e>>>f.ia].$a(e&f.u,a==this.C)}}d&&(a.push(b),c?b.Qa=!0:(Ff(this,a,a.length-1,"set"),Le(this)));return d}; +function Ef(a,b,c,d,e){var f=!1;c=Se(c);for(var g=1;g>>d.ia],b==a.C));h.Qa||Le(a);break}}return f}function Gf(a,b){for(var c=1;c>24,4);break;case 3:y=t(v.ab(y,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?y="["+y+"]":r&16||(y=(v.style==Je?"$":"0x")+y);v=y}else r&16? +(v=(q&3840)>>8,r=Qe[v],8086==a.style&&q&64&&(6==v&&(r="HL"),r="["+r+"]"),v=r):r&128&&(v=(f>>3&7).toString());if(!v||!v.length){h="INVALID";break}0b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Yd;if(e>=g&&e>8&255;case "C":d.T=f&255;break;case "D":d.U=f&255;break; +case "DE":d.U=f>>8&255;case "E":d.V=f&255;break;case "H":d.W=f&255;break;case "HL":d.W=f>>8&255;case "L":d.Z=f&255;break;case "SP":d.pa=f&65535;break;case "PC":I(d,f);a.M=Y(d.R);break;case "PS":Sc(d,f);break;case "PSW":Sc(d,f&255|d.ua&-256);d.i=f>>8;break;case "CF":d.da=f?d.da|256:d.da&255;break;case "PF":f?bd(d)||(d.ga^=1):bd(d)&&(d.ga^=1);break;case "AF":d.ya=f?~d.ga&16|d.ya&-17:d.ga&16|d.ya&-17;break;case "ZF":d.da=f?d.da&-256:d.da|255;break;case "SF":f?ed(d)||(d.ga^=192):ed(d)&&(d.ga^=192);break; +case "IF":d.ua=f?d.ua|512:d.ua&-513;break;default:a.g("unknown register: "+e);return}Ec(d);a.g("updated registers:")}a.g(Lf(a));c&&(a.M=Y(d.R),Cf(a,Z(a.M.H)))}}function Sf(a,b){b=na(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(zf(a,c[2])):Ce(a,b,!0)}function Tf(a,b,c){var d="t"!=b;c=Ee(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ea(c,function(){return kb(a,!0)&&a.mb(e,d,!1)},function(){Ec(a.b);kb(a,!1)})} +function Cf(a,b,c,d){if(b=Te(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Te(a,c,!0);if(!d||d.Hh[0].indexOf("+"))){var n=h[0]+":";h[2]&&(n+=" "+h[2]);a.g(n)}h[3]&&(g=h[3],f=null);f=If(a,b,g,f);a.g(f);a.M=b;e-=b.H-k;c++}}} +l.Gb=function(a,b,c){if(b)if(a){0>this.j&&this.w.length&&(this.j=0);if(0>this.j||a!=this.w[this.j])this.w.splice(0,0,a),this.j=0;this.j--}else this.P?a="end":a=this.w[this.j+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; +function Hf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.P&&(a.g("ended assemble at "+Z(a.ca.H)),a.M=a.ca,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.la=null;if(mb(a)&&0n||"z"Ga.length&&(a.g("note: only "+Ga.length+" available"),ia=Ga.length);ua-=ia;0>ua&&(null==Ga[Ga.length-1].H?(ia=ua+ia,ua=0):ua+=Ga.length);var md=[];"call"==$e&&(Ib=1E5,md=["CALL"]);for(void 0!==Ze&&a.g(ia+" instructions earlier:");0< +Ib&&ua!=a.fa;){var cf=Ga[ua++];if(null==cf.H)break;var Jb=Y(cf.H),lg=ia--,df=If(a,Jb,"history",lg);(!md.length||0<=df.indexOf(md[0]))&&a.g(df);Jb.Mb&&(ua+=Jb.Mb,Ib-=Jb.Mb,ia-=Jb.Mb);ua>=Ga.length&&(ua=0);a.gb=ia;bf++;Ib--}}bf||(a.g("no "+af+"history available"),a.gb=void 0)}else{var oc=Te(a,X);if(oc){var pc=0;ta&&("l"==ta.charAt(0)&&(ta=ta.substr(1)||Eb),pc=Ee(a,ta)>>>0,65536>4||1;mg--&&0tc?String.fromCharCode(tc):".";rc--}Kb&&(Kb+="\n");Kb+=X+" "+od+(Lb?"":" "+ef)}Kb&&a.g(Kb);a.Va=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,ff=255,gf=a.aa,hf=a.va;"ew"==f[0]&&(uc=2,ff=65535,gf=a.ab,hf=a.Jb);var jf=uc<<1,kf=f[1];if(null==kf)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a"); +else{var vc=Te(a,kf);if(vc)for(var wc=2;wcvd;){for(var Za=null,sg=256;65536>Ob.H>>>0;){mf.H=a.ab(Ob,2);if(null==Ob.H||!sg--)break;for(var tg=a,yc=mf,nf= +null,Pb=yc.H,of=Pb,wd=1;6>=wd&&Pb;wd++){if(2\nLicense: GPL version 3 or later ");for(b=0;bXf){if(Zf(d,this.L)){this.C=new J(this,"1.30.1","failsafe");Zf(this.C)&&(dg(this,d),a=2,eg(this.C));this.C.set("timestamp",ra());fg(this.C);var e=this.A&&!this.K;if(1==a||ya("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=cg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Zf(d,g):("error"== +f&&"no machine state"!=g?(this.ka("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.j=null)):this.g(f+": "+g),eg(d),Zf(d)?(c=cg(d),e=!0):c=!1))}e&&bg(this,c?d:null)}else 2==a&&d.clear()}else bg(this);delete this.L;delete this.M}e=db(this.id);for(f=0;fa[1];a=a[2];this.ha=!0;this.D.xa=!0;var d=this.N.power;d&&(d.textContent="Shutdown");this.b&&(gg(this,this.b,b,c,a),this.b.tb());this.Y&&(dg(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.w=0}; +function dg(a,b){if(ya("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.j||"";b=b.toString();var d={app:"PC8080",ver:"1.30.1"};d.url=a.fa;d.user=c;d.type="bug";d.data=b;va("http://www.pcjs.org/api/v1/report",d,!0)}} +function Uf(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new J(a,"1.30.1"),g=new J(a,"1.30.1","validate"),h=ra();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",xa());a.b&&a.b.Ka&&(c&&a.b.ra(),d=a.b.Ka(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.D.xa=!1,!1===d&&(e=null)));for(var h=db(a.id),k=0;kf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PC8080$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");va(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)k=0>k.indexOf(n[1])?k.replace(">",n[0]+">"):k.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,""); -a=a.replace(d[0],g);zg(a,b,c)}})}else c(a,null)} -function Ag(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=la(a))}function f(a){e("Error: "+a);k&&(--jg||Qa(!0));k=!1}var g,h,k=!0;jg++;ab[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=n:q.appendChild(document.createTextNode(n));p.appendChild(q)}c|| -(c="/versions/pc8080/1.30.1/components.xsl");n=function(d,h){h?xg(c,null,null,!1,e,function(d,k){k?(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--jg||Qa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--jg||Qa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,n):yg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(x){f(x.message)}return k}window.embedPC8080=function(a,b,c,d){Qa(!1);return Ag(a,b,c,d)};window.enableEvents=Qa;window.sendEvent=Sa;})(); +function Ag(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");va(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)k=0>k.indexOf(n[1])?k.replace(">",n[0]+">"):k.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,""); +a=a.replace(d[0],g);Ag(a,b,c)}})}else c(a,null)} +function Bg(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=la(a))}function f(a){e("Error: "+a);k&&(--kg||Sa(!0));k=!1}var g,h,k=!0;kg++;bb[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=n:q.appendChild(document.createTextNode(n));p.appendChild(q)}c|| +(c="/versions/pc8080/1.30.1/components.xsl");n=function(d,h){h?yg(c,null,null,!1,e,function(d,k){k?(cb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--kg||Sa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--kg||Sa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?yg(b,a,d,!0,e,n):zg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(x){f(x.message)}return k}window.embedPC8080=function(a,b,c,d){Sa(!1);return Bg(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ta;})(); diff --git a/versions/pc8080/1.30.1/pc8080.js b/versions/pc8080/1.30.1/pc8080.js index b6a8f0922..6654169c1 100644 --- a/versions/pc8080/1.30.1/pc8080.js +++ b/versions/pc8080/1.30.1/pc8080.js @@ -29,169 +29,174 @@ http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -var k,m={pd:1,qd:3,rd:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,jb:65,Mb:66,Ob:67,mb:68,E:69,Rb:70,Sb:71,Tb:72,Ub:73,ac:74,bc:75,ob:76,ic:77,jc:78,mc:79,nc:80,Q:81,tc:82,wc:83,Bc:84,Cc:85,Dc:86,Ec:87,Gc:88,Hc:89,Ic:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Zd:97,$d:98,ae:99,d:100,e:101,be:102,ce:103,de:104,ee:105,fe:106,k:107,ge:108, -he:109,n:110,ie:111,p:112,q:113,r:114,je:115,t:116,ke:117,le:118,me:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126}; +var k,m={td:1,ud:3,vd:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,nb:65,Qb:66,Sb:67,qb:68,E:69,Vb:70,Wb:71,Xb:72,Yb:73,ec:74,fc:75,sb:76,mc:77,nc:78,qc:79,rc:80,Q:81,xc:82,Ac:83,Fc:84,Gc:85,Hc:86,Ic:87,Kc:88,Lc:89,Mc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ce:97,de:98,ee:99,d:100,e:101,fe:102,ge:103,he:104,ie:105,je:106,k:107,ke:108, +le:109,n:110,me:111,p:112,q:113,r:114,ne:115,t:116,oe:117,pe:118,qe:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126}; function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ia={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ja=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 la(a,b,c,d){var e=0,f=null,g=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)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function q(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} -function qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ra(a){if(window){var b=window?window.navigator.userAgent:"";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}var ta={init:[],show:[],exit:[]},ua=!1,va=!1,wa=!0;function xa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function ya(a){ta.init.push(a)} -function za(a){if(wa)try{for(var b=0;bb?this.Sa=this.id:(this.Ta=this.id.substr(0,b),this.Sa=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Wa:!1,eb:!1,Y:!1,error:!1};this.Za=null;this.l.error=!1;this.A={};this.O=null;v.push(this)}var Da=void 0,Ea={}; -if(window){Da||(Da=window.location.search.substr(1));for(var Fa,Ga=/\+/g,Ha=/([^&=]+)=?([^&]*)/g;Fa=Ha.exec(Da);)Ea[decodeURIComponent(Fa[1].replace(Ga," "))]=decodeURIComponent(Fa[2].replace(Ga," "))}function Ia(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 w(a,b){b||(b=r);a.prototype=Ia(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ja=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Ja={},v=[];function Ka(a,b,c){Ja[a]&&b&&(Ja[a][b]=c)}function Aa(a,b,c){b||q((c?c+": ":"")+a)} -function La(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>8&255;else if(e=g.data)for(d.Y=Array(4*e.length),f=c=0;c>8&255,d.Y[f++]=e[c]>>16&255,d.Y[f++]=e[c]>>24&255;else d.Y=g;d.wa=g.symbols;d.Y.length?1==d.Y.length&&(q(d.Y[0]),d=null):(q("Empty resource: "+ +a),d=null)}catch(h){q("Resource data error: "+h.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.Y=Array(a.length),c=0;cb?this.Va=this.id:(this.ya=this.id.substr(0,b),this.Va=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Ya:!1,gb:!1,Z:!1,error:!1};this.ab=null;this.l.error=!1;this.A={};this.O=null;v.push(this)}var Ea=void 0,Fa={}; +if(window){Ea||(Ea=window.location.search.substr(1));for(var Ga,Ha=/\+/g,Ia=/([^&=]+)=?([^&]*)/g;Ga=Ia.exec(Ea);)Fa[decodeURIComponent(Ga[1].replace(Ha," "))]=decodeURIComponent(Ga[2].replace(Ha," "))}function Ja(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 w(a,b){b||(b=r);a.prototype=Ja(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ka=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Ka={},v=[];function La(a,b,c){Ka[a]&&b&&(Ka[a][b]=c)}function Ba(a,b,c){b||q((c?c+": ":"")+a)} +function Ma(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.j&&(this.j=10);15>2;this.f=this.c-1;this.i=this.u/this.c|0;this.o=this.i-1;this.m=[];this.v=[];this.B=[];this.C=[];a=new D;Ya(a,this.O);this.b=Array(this.i);for(b=0;b>>a.j;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Ma)return h.cb+=h.Ma-e,h.Ma=e,!0;if(e>=h.Ma+h.cb){n=h.size-(e-l);n>f&&(n=f);h.cb=e-h.Ma+n;e=l+a.c;f-=n;g++;continue}}return $a(1,e,f)}e=new D(e,n,a.c,d);Ya(e,a.O,h);a.b[g++]=e;e=l+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+ab[d]+" at "+p(b,4,!0)),!0):$a(2,b,c)}Xa.prototype.J=function(a){return this.b[(a&this.g)>>>this.j].Pa(a&this.f,a)}; -function bb(a,b){return a.b[(b&a.g)>>>a.j].bb(b&a.f,b)}function cb(a,b){var c=b&a.f,d=(b&a.g)>>>a.j;return c!=a.f?a.b[d].kd(c,b):a.b[d++].Pa(c,b)|a.b[d&a.o].Pa(0,b+1)<<8}Xa.prototype.aa=function(a,b){this.b[(a&this.g)>>>this.j].Qa(a&this.f,b&255,a)};function db(a,b,c){a.b[(b&a.g)>>>a.j].Hb(b&a.f,c&255,b)}function fb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.j;d!=a.f?a.b[e].ld(d,c&65535,b):(a.b[e++].Qa(d,c&255,b),a.b[e&a.o].Qa(0,c>>8&255,b+1))} -function gb(a){for(var b=0,c=[],d=0;d>1),this.a=new Int32Array(this.j,0,c>>2),pb(this,lb?qb:rb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},C:function(a){return this.a[a>> -2]>>>((a&3)<<3)&255},I:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},S:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.na=!0},w:function(a,b){return this.bb(a,b)},H:function(a,b){return this.Eb(a,b)},N:function(a,b,c){this.c||this.Hb(a,b,c)},W:function(a, -b,c){this.c||this.X(a,b,c)},u:function(a){return this.b[a]},B:function(a){return this.b[a]},G:function(a){return this.A.getUint16(a,!0)},M:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.i[a>>1]},K:function(a,b){this.b[a]=b;this.na=!0},R:function(a,b){this.b[a]=b;this.na=!0},U:function(a,b){this.A.setUint16(a,b,!0);this.na=!0},Z:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.i[a>>1]=b;this.na=!0}};function Ya(a,b,c){a.O=b;a.f=a.g=0;c&&((a.f=c.f)&&tb(a,ub,!1),(a.g=c.g)&&vb(a,ub,!1))} -function vb(a,b,c){c&&a.g||(a.Qa=!a.c&&b[1]||a.o,a.ld=!a.c&&b[3]||a.s);if(c||void 0===c)a.Hb=b[1]||a.o,a.X=b[3]||a.s}function tb(a,b,c){c&&a.f||(a.Pa=b[0]||a.m,a.kd=b[2]||a.v);if(c||void 0===c)a.bb=b[0]||a.m,a.Eb=b[2]||a.v}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)}var wb=[],sb=[D.prototype.C,D.prototype.S,D.prototype.I,D.prototype.ea],ub=[D.prototype.w,D.prototype.N,D.prototype.H,D.prototype.W]; -if(Sa)var rb=[D.prototype.u,D.prototype.K,D.prototype.G,D.prototype.U],qb=[D.prototype.B,D.prototype.R,D.prototype.M,D.prototype.Z];function xb(a,b){r.call(this,"CPU",a,xb);var c=a.multiplier||1;this.la=a.cycles||b;this.K=c;this.Ca=Math.round(this.la/1E4)/100;this.U=this.Ca*this.K;this.l.oa=!1;this.l.Fb=!1;this.l.Na=a.autoStart;this.l.yb=!1;this.l.Xa=!1;this.ta=this.X=0;this.ua=a.csStart;this.Z=a.csInterval;this.ea=a.csStop;this.G=[];this.Va=this.hb.bind(this);B(this)}w(xb);var yb=["power","reset"]; -k=xb.prototype;k.qa=function(a,b,c,d){this.v=a;this.j=b;this.O=d;for(b=0;ba.R/a.U&&(b=1);a.K=b;b=a.Ca*a.K;if(a.U!=b){a.U=b;b=a.U.toFixed(2)+"Mhz";var d=a.A.setSpeed;d&&(d.textContent=b);a.da("target speed: "+b)}c&&a.v&&Hb(a.v)}a.H+=a.N;a.N=0;a.I=ja();a.S=0;Fb(a)}function Ib(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function Kb(a,b,c){0<=b&&ba.G[b][0]&&(c*=a.la*a.K/1E3,a.G[b][0]=c+Lb(a))}function Lb(a,b){var c=a.W-=a.a;a.a=0;b&&(a.W=0);return c} -k.hb=function(a){if(Qa(this,!0)){if(!this.l.oa){Eb(this);this.v&&this.v.start(this.I,Gb(this));this.l.oa=!0;this.l.Fb=!0;this.M&&this.M.start();var b=this.A.run;b&&(b.textContent="Halt");this.v&&(this.v.Aa(!0),a&&Hb(this.v,!0))}this.Da>=this.la&&Fb(this,!0);this.pa=0;this.sa=ja();this.S&&(a=this.sa-this.S,a>this.Ka&&(this.I+=a,this.I>this.sa&&(this.I=this.sa)));try{do{for(var c,d=this.l.Xa?1:this.xa,e=this.G.length-1;0<=e;e--){var f=this.G[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Gb(c);c=Lb(this,!0); -this.pa+=c;this.N+=c;a=c;this.l.Xa&&(b=!1,this.ta=this.ta+this.Bb()|0,this.X-=a,0>=this.X&&(this.X+=this.Z,b=!0),0<=this.ea&&this.ea<=Gb(this)&&(this.Z=this.ea=-1,Bb(this),Db(this),b=!0),b&&this.da(Gb(this)+" cycles: checksum="+p(this.ta)));a=c;for(var g=this.G.length-1;0<=g;g--){var h=this.G[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ja-=c;if(0>=this.ja){this.ja+=this.xa;15<=++this.La&&(this.v&&this.v.Aa(),this.La=0);break}}while(this.l.oa)}catch(l){Db(this);Cb(this);this.v&&this.v.stop(ja(), -Gb(this));Qa(this,!1);c=l.stack||l.message;this.l.error=!0;this.L(c);return}c=setTimeout;d=this.Va;this.S=ja();e=this.Ka;this.pa&&(e=Math.round(e*this.pa/this.xa));e-=this.S-this.sa;if(f=this.S-this.I)this.R=Math.round(this.N/(10*f))/100,864E5<=f&&(this.H=0,Eb(this));if(0>e||this.Re&&(this.I-=e),e=0;this.Da+=this.pa;this.S+=e;c(d,e)}else Cb(this),this.v&&this.v.stop(ja(),Gb(this))};k.Gb=function(){return 0}; -function Db(a){a.l.Wa&&(a.l.eb=!0);Lb(a);a.H+=a.N;a.N=0;if(a.l.oa){a.l.oa=!1;a.M&&a.M.stop();var b=a.A.run;b&&(b.textContent="Run")}a.l.complete=void 0}function Cb(a){if(a.v){for(var b=a.v,c=0;c>8&255;a.D=b&255}function Wb(a){return a.f<<8|a.F}function Xb(a,b){a.f=b>>8&255;a.F=b&255}function G(a){return a.g<<8|a.i} -function I(a,b){a.g=b>>8&255;a.i=b&255}function E(a,b){a.o=b&65535}function J(a){return a.m&256?1:0}function K(a,b){a.m=a.m&255|b}function Yb(a){return Ta[a.s&255]?4:0}function Tb(a){return a.C&-214|(a.s&128?128:0)|(a.m&255?0:64)|((a.s^a.w)&16?16:0)|Yb(a)|J(a)}function Rb(a,b){a.m=a.s=a.w=0;b&1&&(a.m|=256);b&4||(a.s|=1);b&16&&(a.w|=16);b&64||(a.m|=255);b&128&&(a.s^=192);a.C=a.C&-726|b&512|2}function L(a,b){a.w=a.b^b;return a.s=(a.m=a.b+b)&255} -function Zb(a,b){a.w=a.b^b;return a.s=(a.m=a.b+b+(a.m&256?1:0))&255}function $b(a,b){a.m=a.s=a.w=a.b&b;(a.b|b)&8&&(a.w^=16);return a.m}function ac(a,b){a.w=b^255;b=a.s=b+255&255;a.m=a.m&-256|b;return b}function bc(a,b){a.w=b;b=a.s=b+1&255;a.m=a.m&-256|b;return b}function cc(a,b){return a.s=a.m=a.w=a.b|b}function M(a,b){b^=255;a.w=a.b^b;return a.s=(a.m=a.b+b+1^256)&255}function dc(a,b){b^=255;a.w=a.b^b;return a.s=(a.m=a.b+b+(a.m&256?0:1)^256)&255}function ec(a,b){return a.s=a.m=a.w=a.b^b}k.J=function(a){return this.j.J(a)}; -k.aa=function(a,b){this.j.aa(a,b)};function N(a){var b=a.J(a.o);E(a,a.o+1);return b}function O(a){var b=cb(a.j,a.o);E(a,a.o+2);return b}function P(a){var b=cb(a.j,a.u);a.u=a.u+2&65535;return b}function R(a,b){a.u=a.u-2&65535;fb(a.j,a.u,b)}function fc(a){if(a.a&&a.B&255&&a.C&512){for(var b=0;8>b&&!(a.B&1<b?255:1<>8;K(this,a&256);this.a-=4},hc,function(){var a;I(this,a=G(this)+Ub(this));K(this,a>>8&256);this.a-=10},function(){this.b=this.J(Ub(this));this.a-=7},function(){Vb(this,Ub(this)-1);this.a-=5}, -function(){this.D=bc(this,this.D);this.a-=5},function(){this.D=ac(this,this.D);this.a-=5},function(){this.D=N(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;K(this,a);this.a-=4},hc,function(){Xb(this,O(this));this.a-=10},function(){this.aa(Wb(this),this.b);this.a-=7},function(){Xb(this,Wb(this)+1);this.a-=5},function(){this.f=bc(this,this.f);this.a-=5},function(){this.f=ac(this,this.f);this.a-=5},function(){this.f=N(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|J(this); -K(this,a&256);this.a-=4},hc,function(){var a;I(this,a=G(this)+Wb(this));K(this,a>>8&256);this.a-=10},function(){this.b=this.J(Wb(this));this.a-=7},function(){Xb(this,Wb(this)-1);this.a-=5},function(){this.F=bc(this,this.F);this.a-=5},function(){this.F=ac(this,this.F);this.a-=5},function(){this.F=N(this);this.a-=7},function(){var a=this.b<<8;this.b=(J(this)<<8|this.b)>>1;K(this,a&256);this.a-=4},hc,function(){I(this,O(this));this.a-=10},function(){var a=O(this);fb(this.j,a,G(this));this.a-=16},function(){I(this, -G(this)+1);this.a-=5},function(){this.g=bc(this,this.g);this.a-=5},function(){this.g=ac(this,this.g);this.a-=5},function(){this.g=N(this);this.a-=7},function(){var a=0,b=J(this);if((this.s^this.w)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=L(this,a);K(this,b?256:0);this.a-=4},hc,function(){var a;I(this,a=G(this)+G(this));K(this,a>>8&256);this.a-=10},function(){var a;a=O(this);a=cb(this.j,a);I(this,a);this.a-=16},function(){I(this,G(this)-1);this.a-=5},function(){this.i=bc(this,this.i); -this.a-=5},function(){this.i=ac(this,this.i);this.a-=5},function(){this.i=N(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},hc,function(){this.u=O(this)&65535;this.a-=10},function(){this.aa(O(this),this.b);this.a-=13},function(){this.u=this.u+1&65535;this.a-=5},function(){var a=G(this);this.aa(a,bc(this,this.J(a)));this.a-=10},function(){var a=G(this);this.aa(a,ac(this,this.J(a)));this.a-=10},function(){this.aa(G(this),N(this));this.a-=10},function(){this.m|=256;this.a-=4},hc,function(){var a; -I(this,a=G(this)+this.u);K(this,a>>8&256);this.a-=10},function(){this.b=this.J(O(this));this.a-=13},function(){this.u=this.u-1&65535;this.a-=5},function(){this.b=bc(this,this.b);this.a-=5},function(){this.b=ac(this,this.b);this.a-=5},function(){this.b=N(this);this.a-=7},function(){K(this,J(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.c=this.D;this.a-=5},function(){this.c=this.f;this.a-=5},function(){this.c=this.F;this.a-=5},function(){this.c=this.g;this.a-=5},function(){this.c=this.i; +var Ta="undefined"!==typeof ArrayBuffer,Ua=[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 Va(a){r.call(this,"Panel",a,Va)}w(Va);k=Va.prototype;k.V=function(a,b,c,d){return this.v&&this.v.V(a,b,c,d)||this.a&&this.a.V(a,b,c,d)||this.m&&this.m.V(a,b,c,d)?!0:this.parent.V.call(this,a,b,c,d)};k.ra=function(a,b,c,d){this.v=a;this.j=b;this.a=c;this.O=d;this.m=Wa(a,"Keyboard")};k.ga=function(a,b){b||Xa();return!0};k.ia=function(){return!0};k.Da=function(){}; +function Xa(){for(var a=!1,b=A(document,"pc8080","panel"),c=0;c>1)+2;10>this.j&&(this.j=10);15>2;this.f=this.c-1;this.i=this.u/this.c|0;this.o=this.i-1;this.m=[];this.v=[];this.B=[];this.C=[];a=new C;Za(a,this.O);this.b=Array(this.i);for(b=0;b>>a.j;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Pa)return h.fb+=h.Pa-e,h.Pa=e,!0;if(e>=h.Pa+h.fb){n=h.size-(e-l);n>f&&(n=f);h.fb=e-h.Pa+n;e=l+a.c;f-=n;g++;continue}}return ab(1,e,f)}e=new C(e,n,a.c,d);Za(e,a.O,h);a.b[g++]=e;e=l+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+bb[d]+" at "+p(b,4,!0)),!0):ab(2,b,c)}Ya.prototype.J=function(a){return this.b[(a&this.g)>>>this.j].Sa(a&this.f,a)}; +function cb(a,b){return a.b[(b&a.g)>>>a.j].eb(b&a.f,b)}function db(a,b){var c=b&a.f,d=(b&a.g)>>>a.j;return c!=a.f?a.b[d].od(c,b):a.b[d++].Sa(c,b)|a.b[d&a.o].Sa(0,b+1)<<8}Ya.prototype.ba=function(a,b){this.b[(a&this.g)>>>this.j].Ta(a&this.f,b&255,a)};function eb(a,b,c){a.b[(b&a.g)>>>a.j].Lb(b&a.f,c&255,b)}function gb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.j;d!=a.f?a.b[e].pd(d,c&65535,b):(a.b[e++].Ta(d,c&255,b),a.b[e&a.o].Ta(0,c>>8&255,b+1))} +function hb(a){for(var b=0,c=[],d=0;d>1),this.a=new Int32Array(this.j,0,c>>2),qb(this,mb?rb:sb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},C:function(a){return this.a[a>> +2]>>>((a&3)<<3)&255},I:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},S:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.oa=!0},w:function(a,b){return this.eb(a,b)},H:function(a,b){return this.Ib(a,b)},N:function(a,b,c){this.c||this.Lb(a,b,c)},W:function(a, +b,c){this.c||this.X(a,b,c)},u:function(a){return this.b[a]},B:function(a){return this.b[a]},G:function(a){return this.A.getUint16(a,!0)},M:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.i[a>>1]},L:function(a,b){this.b[a]=b;this.oa=!0},R:function(a,b){this.b[a]=b;this.oa=!0},U:function(a,b){this.A.setUint16(a,b,!0);this.oa=!0},ya:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.i[a>>1]=b;this.oa=!0}};function Za(a,b,c){a.O=b;a.f=a.g=0;c&&((a.f=c.f)&&ub(a,vb,!1),(a.g=c.g)&&wb(a,vb,!1))} +function wb(a,b,c){c&&a.g||(a.Ta=!a.c&&b[1]||a.o,a.pd=!a.c&&b[3]||a.s);if(c||void 0===c)a.Lb=b[1]||a.o,a.X=b[3]||a.s}function ub(a,b,c){c&&a.f||(a.Sa=b[0]||a.m,a.od=b[2]||a.v);if(c||void 0===c)a.eb=b[0]||a.m,a.Ib=b[2]||a.v}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[C.prototype.C,C.prototype.S,C.prototype.I,C.prototype.aa],vb=[C.prototype.w,C.prototype.N,C.prototype.H,C.prototype.W]; +if(Ta)var sb=[C.prototype.u,C.prototype.L,C.prototype.G,C.prototype.U],rb=[C.prototype.B,C.prototype.R,C.prototype.M,C.prototype.ya];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.L=c;this.Fa=Math.round(this.ma/1E4)/100;this.U=this.Fa*this.L;this.l.pa=!1;this.l.Jb=!1;this.l.Qa=a.autoStart;this.l.Cb=!1;this.l.Za=!1;this.ua=this.X=0;this.va=a.csStart;this.aa=a.csInterval;this.ja=a.csStop;this.G=[];this.Xa=this.lb.bind(this);B(this)}w(yb);var zb=["power","reset"]; +k=yb.prototype;k.ra=function(a,b,c,d){this.v=a;this.j=b;this.O=d;for(b=0;ba.R/a.U&&(b=1);a.L=b;b=a.Fa*a.L;if(a.U!=b){a.U=b;b=a.U.toFixed(2)+"Mhz";var d=a.A.setSpeed;d&&(d.textContent=b);a.ea("target speed: "+b)}c&&a.v&&Ib(a.v)}a.H+=a.N;a.N=0;a.I=ja();a.S=0;Gb(a)}function Jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function Kb(a,b,c){0<=b&&ba.G[b][0]&&(c*=a.ma*a.L/1E3,a.G[b][0]=c+Mb(a))}function Mb(a,b){var c=a.W-=a.a;a.a=0;b&&(a.W=0);return c} +k.lb=function(a){if(Ra(this,!0)){if(!this.l.pa){Fb(this);this.v&&this.v.start(this.I,Hb(this));this.l.pa=!0;this.l.Jb=!0;this.M&&this.M.start();var b=this.A.run;b&&(b.textContent="Halt");this.v&&(this.v.Da(!0),a&&Ib(this.v,!0))}this.Ga>=this.ma&&Gb(this,!0);this.qa=0;this.ta=ja();this.S&&(a=this.ta-this.S,a>this.Na&&(this.I+=a,this.I>this.ta&&(this.I=this.ta)));try{do{for(var c,d=this.l.Za?1:this.Aa,e=this.G.length-1;0<=e;e--){var f=this.G[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Kb(c);c=Mb(this,!0); +this.qa+=c;this.N+=c;a=c;this.l.Za&&(b=!1,this.ua=this.ua+this.Fb()|0,this.X-=a,0>=this.X&&(this.X+=this.aa,b=!0),0<=this.ja&&this.ja<=Hb(this)&&(this.aa=this.ja=-1,Cb(this),Eb(this),b=!0),b&&this.ea(Hb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.G.length-1;0<=g;g--){var h=this.G[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.la-=c;if(0>=this.la){this.la+=this.Aa;15<=++this.Oa&&(this.v&&this.v.Da(),this.Oa=0);break}}while(this.l.pa)}catch(l){Eb(this);Db(this);this.v&&this.v.stop(ja(), +Hb(this));Ra(this,!1);c=l.stack||l.message;this.l.error=!0;this.K(c);return}c=setTimeout;d=this.Xa;this.S=ja();e=this.Na;this.qa&&(e=Math.round(e*this.qa/this.Aa));e-=this.S-this.ta;if(f=this.S-this.I)this.R=Math.round(this.N/(10*f))/100,864E5<=f&&(this.H=0,Fb(this));if(0>e||this.Re&&(this.I-=e),e=0;this.Ga+=this.qa;this.S+=e;c(d,e)}else Db(this),this.v&&this.v.stop(ja(),Hb(this))};k.Kb=function(){return 0}; +function Eb(a){a.l.Ya&&(a.l.gb=!0);Mb(a);a.H+=a.N;a.N=0;if(a.l.pa){a.l.pa=!1;a.M&&a.M.stop();var b=a.A.run;b&&(b.textContent="Run")}a.l.complete=void 0}function Db(a){if(a.v){for(var b=a.v,c=0;c>8&255;a.D=b&255}function Xb(a){return a.f<<8|a.F}function Yb(a,b){a.f=b>>8&255;a.F=b&255}function G(a){return a.g<<8|a.i} +function I(a,b){a.g=b>>8&255;a.i=b&255}function E(a,b){a.o=b&65535}function J(a){return a.m&256?1:0}function K(a,b){a.m=a.m&255|b}function Zb(a){return Ua[a.s&255]?4:0}function Ub(a){return a.C&-214|(a.s&128?128:0)|(a.m&255?0:64)|((a.s^a.w)&16?16:0)|Zb(a)|J(a)}function Sb(a,b){a.m=a.s=a.w=0;b&1&&(a.m|=256);b&4||(a.s|=1);b&16&&(a.w|=16);b&64||(a.m|=255);b&128&&(a.s^=192);a.C=a.C&-726|b&512|2}function L(a,b){a.w=a.b^b;return a.s=(a.m=a.b+b)&255} +function $b(a,b){a.w=a.b^b;return a.s=(a.m=a.b+b+(a.m&256?1:0))&255}function ac(a,b){a.m=a.s=a.w=a.b&b;(a.b|b)&8&&(a.w^=16);return a.m}function bc(a,b){a.w=b^255;b=a.s=b+255&255;a.m=a.m&-256|b;return b}function cc(a,b){a.w=b;b=a.s=b+1&255;a.m=a.m&-256|b;return b}function dc(a,b){return a.s=a.m=a.w=a.b|b}function M(a,b){b^=255;a.w=a.b^b;return a.s=(a.m=a.b+b+1^256)&255}function ec(a,b){b^=255;a.w=a.b^b;return a.s=(a.m=a.b+b+(a.m&256?0:1)^256)&255}function fc(a,b){return a.s=a.m=a.w=a.b^b}k.J=function(a){return this.j.J(a)}; +k.ba=function(a,b){this.j.ba(a,b)};function N(a){var b=a.J(a.o);E(a,a.o+1);return b}function O(a){var b=db(a.j,a.o);E(a,a.o+2);return b}function P(a){var b=db(a.j,a.u);a.u=a.u+2&65535;return b}function R(a,b){a.u=a.u-2&65535;gb(a.j,a.u,b)}function gc(a){if(a.a&&a.B&255&&a.C&512){for(var b=0;8>b&&!(a.B&1<b?255:1<>8;K(this,a&256);this.a-=4},ic,function(){var a;I(this,a=G(this)+Vb(this));K(this,a>>8&256);this.a-=10},function(){this.b=this.J(Vb(this));this.a-=7},function(){Wb(this,Vb(this)-1);this.a-=5}, +function(){this.D=cc(this,this.D);this.a-=5},function(){this.D=bc(this,this.D);this.a-=5},function(){this.D=N(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;K(this,a);this.a-=4},ic,function(){Yb(this,O(this));this.a-=10},function(){this.ba(Xb(this),this.b);this.a-=7},function(){Yb(this,Xb(this)+1);this.a-=5},function(){this.f=cc(this,this.f);this.a-=5},function(){this.f=bc(this,this.f);this.a-=5},function(){this.f=N(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|J(this); +K(this,a&256);this.a-=4},ic,function(){var a;I(this,a=G(this)+Xb(this));K(this,a>>8&256);this.a-=10},function(){this.b=this.J(Xb(this));this.a-=7},function(){Yb(this,Xb(this)-1);this.a-=5},function(){this.F=cc(this,this.F);this.a-=5},function(){this.F=bc(this,this.F);this.a-=5},function(){this.F=N(this);this.a-=7},function(){var a=this.b<<8;this.b=(J(this)<<8|this.b)>>1;K(this,a&256);this.a-=4},ic,function(){I(this,O(this));this.a-=10},function(){var a=O(this);gb(this.j,a,G(this));this.a-=16},function(){I(this, +G(this)+1);this.a-=5},function(){this.g=cc(this,this.g);this.a-=5},function(){this.g=bc(this,this.g);this.a-=5},function(){this.g=N(this);this.a-=7},function(){var a=0,b=J(this);if((this.s^this.w)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=L(this,a);K(this,b?256:0);this.a-=4},ic,function(){var a;I(this,a=G(this)+G(this));K(this,a>>8&256);this.a-=10},function(){var a;a=O(this);a=db(this.j,a);I(this,a);this.a-=16},function(){I(this,G(this)-1);this.a-=5},function(){this.i=cc(this,this.i); +this.a-=5},function(){this.i=bc(this,this.i);this.a-=5},function(){this.i=N(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},ic,function(){this.u=O(this)&65535;this.a-=10},function(){this.ba(O(this),this.b);this.a-=13},function(){this.u=this.u+1&65535;this.a-=5},function(){var a=G(this);this.ba(a,cc(this,this.J(a)));this.a-=10},function(){var a=G(this);this.ba(a,bc(this,this.J(a)));this.a-=10},function(){this.ba(G(this),N(this));this.a-=10},function(){this.m|=256;this.a-=4},ic,function(){var a; +I(this,a=G(this)+this.u);K(this,a>>8&256);this.a-=10},function(){this.b=this.J(O(this));this.a-=13},function(){this.u=this.u-1&65535;this.a-=5},function(){this.b=cc(this,this.b);this.a-=5},function(){this.b=bc(this,this.b);this.a-=5},function(){this.b=N(this);this.a-=7},function(){K(this,J(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.c=this.D;this.a-=5},function(){this.c=this.f;this.a-=5},function(){this.c=this.F;this.a-=5},function(){this.c=this.g;this.a-=5},function(){this.c=this.i; this.a-=5},function(){this.c=this.J(G(this));this.a-=7},function(){this.c=this.b;this.a-=5},function(){this.D=this.c;this.a-=5},function(){this.a-=5},function(){this.D=this.f;this.a-=5},function(){this.D=this.F;this.a-=5},function(){this.D=this.g;this.a-=5},function(){this.D=this.i;this.a-=5},function(){this.D=this.J(G(this));this.a-=7},function(){this.D=this.b;this.a-=5},function(){this.f=this.c;this.a-=5},function(){this.f=this.D;this.a-=5},function(){this.a-=5},function(){this.f=this.F;this.a-= 5},function(){this.f=this.g;this.a-=5},function(){this.f=this.i;this.a-=5},function(){this.f=this.J(G(this));this.a-=7},function(){this.f=this.b;this.a-=5},function(){this.F=this.c;this.a-=5},function(){this.F=this.D;this.a-=5},function(){this.F=this.f;this.a-=5},function(){this.a-=5},function(){this.F=this.g;this.a-=5},function(){this.F=this.i;this.a-=5},function(){this.F=this.J(G(this));this.a-=7},function(){this.F=this.b;this.a-=5},function(){this.g=this.c;this.a-=5},function(){this.g=this.D;this.a-= -5},function(){this.g=this.f;this.a-=5},function(){this.g=this.F;this.a-=5},function(){this.a-=5},function(){this.g=this.i;this.a-=5},function(){this.g=this.J(G(this));this.a-=7},function(){this.g=this.b;this.a-=5},function(){this.i=this.c;this.a-=5},function(){this.i=this.D;this.a-=5},function(){this.i=this.f;this.a-=5},function(){this.i=this.F;this.a-=5},function(){this.i=this.g;this.a-=5},function(){this.a-=5},function(){this.i=this.J(G(this));this.a-=7},function(){this.i=this.b;this.a-=5},function(){this.aa(G(this), -this.c);this.a-=7},function(){this.aa(G(this),this.D);this.a-=7},function(){this.aa(G(this),this.f);this.a-=7},function(){this.aa(G(this),this.F);this.a-=7},function(){this.aa(G(this),this.g);this.a-=7},function(){this.aa(G(this),this.i);this.a-=7},function(){var a=this.o-1;if(this.ra.length)for(var b=0;b>>=f)&l;if(void 0!==g&&g[0])g[0](a,l,d);f+=h<<3;a+=h;e-=h}this.a-=10},function(){var a=O(this);J(this)||(R(this,this.o),E(this,a),this.a-=6);this.a-=11},function(){R(this,Wb(this));this.a-=11},function(){this.b=M(this,N(this));this.a-=7},function(){R(this,this.o);E(this,16);this.a-=11},function(){J(this)&&(E(this,P(this)),this.a-=6);this.a-=5},jc,function(){var a=O(this);J(this)&&E(this,a);this.a-=10},function(){for(var a=N(this),b=this.j,c=this.o+-2&65535,d=1,e=0, -f=0;0>8;this.a-=10},function(){var a=O(this);this.s&128||E(this,a);this.a-=10},function(){this.C&=-513;this.a-=4},function(){var a=O(this);this.s&128||(R(this,this.o),E(this,a),this.a-=6);this.a-=11},function(){R(this, -Tb(this)&255|this.b<<8);this.a-=11},function(){this.b=cc(this,N(this));this.a-=7},function(){R(this,this.o);E(this,48);this.a-=11},function(){this.s&128&&(E(this,P(this)),this.a-=6);this.a-=5},function(){this.u=G(this)&65535;this.a-=5},function(){var a=O(this);this.s&128&&E(this,a);this.a-=10},function(){this.C|=512;this.a-=4;fc(this)},function(){var a=O(this);this.s&128&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},kc,function(){M(this,N(this));this.a-=7},function(){R(this,this.o);E(this,56); -this.a-=11}];function T(a){r.call(this,"ChipSet",a,T);var b=a.model;b&&!lc[b]&&Aa("Unrecognized ChipSet model: "+b);this.c=lc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(T); -var V={ba:1978.1,zc:{ca:0,td:1,xd:16,Ed:32,Nd:64,Md:128,Fa:14},za:{ca:1,Pb:1,sc:2,oc:4,pc:16,qc:32,rc:64,Fa:8},Ac:{ca:2,sd:3,Wd:4,ud:8,Id:16,Jd:32,Kd:64,vd:128,Fa:0},Rd:{ca:3},Pd:{ca:2,Fd:7},Td:{ca:3,Xd:1,Sd:2,Ld:4,Cd:8,wd:16,md:32},Qd:{ca:4},Ud:{ca:5,yd:1,zd:2,Ad:4,Bd:8,Yd:16}},W={ba:100,ka:{ca:66,vb:1,kc:2,lc:4,Hd:8,Gd:16,sb:32,rb:64,nb:128},Nb:{ca:66,INIT:0},wa:{ca:194,od:0,lb:16,uc:32,tb:48,Xb:0,Yb:32},Ra:{ca:162,Od:0,$b:0,Wb:0,Zb:0,Vb:0},ma:{Dd:{ca:98},Ba:{Kb:0,Jb:1,xc:2,Fc:4,Qb:5,vc:6,Vd:7}, -Ua:16383}},lc={SI1978:V,VT100:W};T.prototype.V=function(){return!1};T.prototype.qa=function(a,b,c,d){this.j=b;this.a=c;this.O=d;this.v=a;this.m=Va(a,"Keyboard");this.Z=Va(a,"SerialPort");this.video=Va(a,"Video");hb(b,this,this.c.$a);ib(b,this,this.c.ab)};T.prototype.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.ia=function(a){return a?this.save():!0};V.INIT=[[V.zc.Fa,V.za.Fa,V.Ac.Fa,0,0,0,0]]; -W.INIT=[[W.Nb.INIT,W.ka.kc|W.ka.lc],[W.wa.Xb,W.wa.Yb],[W.Ra.$b,W.Ra.Wb,W.Ra.Zb,W.Ra.Vb],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], -[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];k=T.prototype;k.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.L("reset error")}; -k.save=function(){var a=new F(this);switch(this.c.ba){case V.ba:a.set(0,[this.W,this.g,this.X,this.C,this.M,this.S,this.U]);break;case W.ba:a.set(0,[this.K,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.N]),a.set(3,[this.B,this.b,this.w,this.H,this.i])}return a.data()}; -k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.c.ba){case V.ba:return this.W=b[0],this.g=b[1],this.X=b[2],this.C=b[3],this.M=b[4],this.S=b[5],this.U=b[6],!0;case W.ba:return this.K=b[0],this.u=b[1],b=a[1],this.o=b[0],this.s=b[1],b=a[2],this.f=b[0],this.G=b[1],this.R=b[2],this.N=b[3],b=a[3],this.B=b[0],this.b=b[1],this.w=b[2],this.H=b[3],this.i=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Sc=function(){return this.W};k.Tc=function(){return this.g};k.Uc=function(){return this.X}; -k.Rc=function(){return this.C>>8-this.M&255};k.$c=function(a,b){this.M=b};k.bd=function(a,b){this.S=b};k.ad=function(a,b){this.C=b<<8|this.C>>8};k.cd=function(a,b){this.U=b};k.dd=function(){};function mc(a){var b=0,c=0,d=~a.B;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} -k.Vc=function(){var a=this.u,a=a&~W.ka.rb;if((Gb(this.a)&64)<<1&&(a|=W.ka.rb,a!=this.u)){var b,c;b=this.w&1;switch(this.w>>1&7){case W.ma.Ba.Jb:this.B=this.B<<1|b;break;case W.ma.Ba.Qb:b=mc(this);this.i[b]=W.ma.Ua;break;case W.ma.Ba.Kb:this.b=this.b<<1|b;break;case W.ma.Ba.Fc:b=mc(this);c=this.b&W.ma.Ua;this.i[b]=c;break;case W.ma.Ba.vc:b=mc(this);c=this.i[b];null==c&&(c=W.ma.Ua);this.b=c;break;case W.ma.Ba.xc:this.b<<=1,this.H=this.b&W.ma.Ua+1}}a&=~W.ka.sb;this.H&&(a|=W.ka.sb);a&=~W.ka.nb;if(b=this.m){b= -this.m;if(c=b.f)c=b.a,c=Gb(b.a)>=b.m+c.la*c.K/1E3*1.2731488;c&&(b.f=!1);b=!b.f}b&&(a|=W.ka.nb);a&=~W.ka.vb;this.Z&&this.Z.fa&1&&(a|=W.ka.vb);return this.u=a};k.ed=function(a,b){this.K=b};k.hd=function(a,b){this.w=b};k.gd=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.pa!==a&&((b.pa=a)?Mb(b,!0):b.sa=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.N=a}}; -k.fd=function(a,b){b&W.wa.uc?(b&=W.wa.tb,this.s!=b&&(this.s=b,this.video&&(this.video.Db=this.s==W.wa.tb?50:60))):(b&=W.wa.lb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==W.wa.lb?132:80,a.H=b,a.T=a.xa,80>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.i=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.L("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, +L(this,this.J(G(this)));this.a-=7},function(){this.b=L(this,this.b);this.a-=4},function(){this.b=$b(this,this.c);this.a-=4},function(){this.b=$b(this,this.D);this.a-=4},function(){this.b=$b(this,this.f);this.a-=4},function(){this.b=$b(this,this.F);this.a-=4},function(){this.b=$b(this,this.g);this.a-=4},function(){this.b=$b(this,this.i);this.a-=4},function(){this.b=$b(this,this.J(G(this)));this.a-=7},function(){this.b=$b(this,this.b);this.a-=4},function(){this.b=M(this,this.c);this.a-=4},function(){this.b= +M(this,this.D);this.a-=4},function(){this.b=M(this,this.f);this.a-=4},function(){this.b=M(this,this.F);this.a-=4},function(){this.b=M(this,this.g);this.a-=4},function(){this.b=M(this,this.i);this.a-=4},function(){this.b=M(this,this.J(G(this)));this.a-=7},function(){this.b=M(this,this.b);this.a-=4},function(){this.b=ec(this,this.c);this.a-=4},function(){this.b=ec(this,this.D);this.a-=4},function(){this.b=ec(this,this.f);this.a-=4},function(){this.b=ec(this,this.F);this.a-=4},function(){this.b=ec(this, +this.g);this.a-=4},function(){this.b=ec(this,this.i);this.a-=4},function(){this.b=ec(this,this.J(G(this)));this.a-=7},function(){this.b=ec(this,this.b);this.a-=4},function(){this.b=ac(this,this.c);this.a-=4},function(){this.b=ac(this,this.D);this.a-=4},function(){this.b=ac(this,this.f);this.a-=4},function(){this.b=ac(this,this.F);this.a-=4},function(){this.b=ac(this,this.g);this.a-=4},function(){this.b=ac(this,this.i);this.a-=4},function(){this.b=ac(this,this.J(G(this)));this.a-=7},function(){this.b= +ac(this,this.b);this.a-=4},function(){this.b=fc(this,this.c);this.a-=4},function(){this.b=fc(this,this.D);this.a-=4},function(){this.b=fc(this,this.f);this.a-=4},function(){this.b=fc(this,this.F);this.a-=4},function(){this.b=fc(this,this.g);this.a-=4},function(){this.b=fc(this,this.i);this.a-=4},function(){this.b=fc(this,this.J(G(this)));this.a-=7},function(){this.b=fc(this,this.b);this.a-=4},function(){this.b=dc(this,this.c);this.a-=4},function(){this.b=dc(this,this.D);this.a-=4},function(){this.b= +dc(this,this.f);this.a-=4},function(){this.b=dc(this,this.F);this.a-=4},function(){this.b=dc(this,this.g);this.a-=4},function(){this.b=dc(this,this.i);this.a-=4},function(){this.b=dc(this,this.J(G(this)));this.a-=7},function(){this.b=dc(this,this.b);this.a-=4},function(){M(this,this.c);this.a-=4},function(){M(this,this.D);this.a-=4},function(){M(this,this.f);this.a-=4},function(){M(this,this.F);this.a-=4},function(){M(this,this.g);this.a-=4},function(){M(this,this.i);this.a-=4},function(){M(this, +this.J(G(this)));this.a-=7},function(){M(this,this.b);this.a-=4},function(){this.m&255&&(E(this,P(this)),this.a-=6);this.a-=5},function(){Wb(this,P(this));this.a-=10},function(){var a=O(this);this.m&255&&E(this,a);this.a-=10},jc,function(){var a=O(this);this.m&255&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},function(){R(this,Vb(this));this.a-=11},function(){this.b=L(this,N(this));this.a-=7},function(){R(this,this.o);E(this,0);this.a-=11},function(){this.m&255||(E(this,P(this)),this.a-=6);this.a-= +5},kc,function(){var a=O(this);this.m&255||E(this,a);this.a-=10},jc,function(){var a=O(this);this.m&255||(R(this,this.o),E(this,a),this.a-=6);this.a-=11},lc,function(){this.b=$b(this,N(this));this.a-=7},function(){R(this,this.o);E(this,8);this.a-=11},function(){J(this)||(E(this,P(this)),this.a-=6);this.a-=5},function(){Yb(this,P(this));this.a-=10},function(){var a=O(this);J(this)||E(this,a);this.a-=10},function(){for(var a=N(this),b=this.j,c=this.b,d=this.o+-2&65535,e=1,f=0;0>>=f)&l;if(void 0!==g&&g[0])g[0](a,l,d);f+=h<<3;a+=h;e-=h}this.a-=10},function(){var a=O(this);J(this)||(R(this,this.o),E(this,a),this.a-=6);this.a-=11},function(){R(this,Xb(this));this.a-=11},function(){this.b=M(this,N(this));this.a-=7},function(){R(this,this.o);E(this,16);this.a-=11},function(){J(this)&&(E(this,P(this)),this.a-=6);this.a-=5},kc,function(){var a=O(this);J(this)&&E(this,a);this.a-=10},function(){for(var a=N(this),b=this.j,c=this.o+-2&65535,d=1,e=0, +f=0;0>8;this.a-=10},function(){var a=O(this);this.s&128||E(this,a);this.a-=10},function(){this.C&=-513;this.a-=4},function(){var a=O(this);this.s&128||(R(this,this.o),E(this,a),this.a-=6);this.a-=11},function(){R(this, +Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=dc(this,N(this));this.a-=7},function(){R(this,this.o);E(this,48);this.a-=11},function(){this.s&128&&(E(this,P(this)),this.a-=6);this.a-=5},function(){this.u=G(this)&65535;this.a-=5},function(){var a=O(this);this.s&128&&E(this,a);this.a-=10},function(){this.C|=512;this.a-=4;gc(this)},function(){var a=O(this);this.s&128&&(R(this,this.o),E(this,a),this.a-=6);this.a-=11},lc,function(){M(this,N(this));this.a-=7},function(){R(this,this.o);E(this,56); +this.a-=11}];function T(a){r.call(this,"ChipSet",a,T);var b=a.model;b&&!mc[b]&&Ba("Unrecognized ChipSet model: "+b);this.c=mc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(T); +var V={ca:1978.1,Dc:{da:0,xd:1,Bd:16,Id:32,Rd:64,Qd:128,Ia:14},Ca:{da:1,Tb:1,wc:2,sc:4,tc:16,uc:32,vc:64,Ia:8},Ec:{da:2,wd:3,$d:4,yd:8,Md:16,Nd:32,Od:64,zd:128,Ia:0},Vd:{da:3},Td:{da:2,Jd:7},Xd:{da:3,ae:1,Wd:2,Pd:4,Gd:8,Ad:16,qd:32},Ud:{da:4},Yd:{da:5,Cd:1,Dd:2,Ed:4,Fd:8,be:16}},W={ca:100,ka:{da:66,zb:1,oc:2,pc:4,Ld:8,Kd:16,wb:32,vb:64,rb:128},Rb:{da:66,INIT:0},za:{da:194,sd:0,pb:16,yc:32,xb:48,ac:0,bc:32},Ua:{da:162,Sd:0,dc:0,$b:0,cc:0,Zb:0},na:{Hd:{da:98},Ea:{Ob:0,Nb:1,Bc:2,Jc:4,Ub:5,zc:6,Zd:7}, +Wa:16383}},mc={SI1978:V,VT100:W};T.prototype.V=function(){return!1};T.prototype.ra=function(a,b,c,d){this.j=b;this.a=c;this.O=d;this.v=a;this.m=Wa(a,"Keyboard");this.aa=Wa(a,"SerialPort");this.video=Wa(a,"Video");ib(b,this,this.c.bb);jb(b,this,this.c.cb)};T.prototype.ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.ia=function(a){return a?this.save():!0};V.INIT=[[V.Dc.Ia,V.Ca.Ia,V.Ec.Ia,0,0,0,0]]; +W.INIT=[[W.Rb.INIT,W.ka.oc|W.ka.pc],[W.za.ac,W.za.bc],[W.Ua.dc,W.Ua.$b,W.Ua.cc,W.Ua.Zb],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];k=T.prototype;k.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.K("reset error")}; +k.save=function(){var a=new F(this);switch(this.c.ca){case V.ca:a.set(0,[this.W,this.g,this.X,this.C,this.M,this.S,this.U]);break;case W.ca:a.set(0,[this.L,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.N]),a.set(3,[this.B,this.b,this.w,this.H,this.i])}return a.data()}; +k.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.c.ca){case V.ca:return this.W=b[0],this.g=b[1],this.X=b[2],this.C=b[3],this.M=b[4],this.S=b[5],this.U=b[6],!0;case W.ca:return this.L=b[0],this.u=b[1],b=a[1],this.o=b[0],this.s=b[1],b=a[2],this.f=b[0],this.G=b[1],this.R=b[2],this.N=b[3],b=a[3],this.B=b[0],this.b=b[1],this.w=b[2],this.H=b[3],this.i=b[4],!0}return!1};k.start=function(){};k.stop=function(){};k.Wc=function(){return this.W};k.Xc=function(){return this.g};k.Yc=function(){return this.X}; +k.Vc=function(){return this.C>>8-this.M&255};k.dd=function(a,b){this.M=b};k.fd=function(a,b){this.S=b};k.ed=function(a,b){this.C=b<<8|this.C>>8};k.gd=function(a,b){this.U=b};k.hd=function(){};function nc(a){var b=0,c=0,d=~a.B;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} +k.Zc=function(){var a=this.u,a=a&~W.ka.vb;if((Hb(this.a)&64)<<1&&(a|=W.ka.vb,a!=this.u)){var b,c;b=this.w&1;switch(this.w>>1&7){case W.na.Ea.Nb:this.B=this.B<<1|b;break;case W.na.Ea.Ub:b=nc(this);this.i[b]=W.na.Wa;break;case W.na.Ea.Ob:this.b=this.b<<1|b;break;case W.na.Ea.Jc:b=nc(this);c=this.b&W.na.Wa;this.i[b]=c;break;case W.na.Ea.zc:b=nc(this);c=this.i[b];null==c&&(c=W.na.Wa);this.b=c;break;case W.na.Ea.Bc:this.b<<=1,this.H=this.b&W.na.Wa+1}}a&=~W.ka.wb;this.H&&(a|=W.ka.wb);a&=~W.ka.rb;if(b=this.m){b= +this.m;if(c=b.f)c=b.a,c=Hb(b.a)>=b.m+c.ma*c.L/1E3*1.2731488;c&&(b.f=!1);b=!b.f}b&&(a|=W.ka.rb);a&=~W.ka.zb;this.aa&&this.aa.fa&1&&(a|=W.ka.zb);return this.u=a};k.jd=function(a,b){this.L=b};k.md=function(a,b){this.w=b};k.ld=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.qa!==a&&((b.qa=a)?Nb(b,!0):b.ta=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.N=a}}; +k.kd=function(a,b){b&W.za.yc?(b&=W.za.xb,this.s!=b&&(this.s=b,this.video&&(this.video.Hb=this.s==W.za.xb?50:60))):(b&=W.za.pb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==W.za.pb?132:80,a.H=b,a.T=a.Aa,80>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.wa=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.K("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>f.j;0>>=f.j;0d?a.j.push({ib:b,fb:Date.now(),Ya:!1}):(a.j[d].fb=Date.now(),a.j[d].Ya=!1);else if(0<=d){if(!a.j[d].Ya){var e=a.j[d].fb;if(e&&100>Date.now()-e)return a.j[d].Ya=!0,Dc(a),!0}a.j.splice(d,1)}if(a.M){d=0;switch(b){case "1p":d=V.za.oc;break;case "2p":d=V.za.sc;break;case "coin":d=V.za.Pb;break;case "left":d=V.za.qc;break;case "right":d=V.za.rc;break;case "fire":d=V.za.pc}d&&(a=a.M,b=d,a.g&=~b,c&&(a.g|=b))}return!0} -function Dc(a){for(var b=0,c=-1;bc||c>e)c=e}else{Bc(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Dc(a)},c)}k.Wc=function(){var a=this.g;0<=this.c&&(this.c>3)*a.G,!Za(a.j,a.ea,a.B,3)))return!1;a.B?(a.Ja=a.f.createImageData(b,c),a.La=16/a.ja|0,Jc(a,a.B>>1)):Jc(a,(a.H+1)*a.W);a.s=document.createElement("canvas");a.s.width=b;a.s.height=c;a.ra=a.s.getContext("2d");a.I={};a.S=1<=a.xa?8:16,f=8>(7>4)*c)}return l}Ec.prototype.ga=function(){return!0};Ec.prototype.V=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.ua[b]=c,!0;switch(b){case "fullScreen":return this.A[b]=c,this.b&&this.b.Ea?c.onclick=function(){d.Ea()}:c.parentNode.removeChild(c),!0}return!1}; -Ec.prototype.Ea=function(){var a=!1;if(this.b){if(this.b.Ea){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.C/this.w;b>c&&(a=Math.round(c/b*100)+"%")}this.Ia?(this.u.style.width=a,this.u.style.width=a,this.u.style.display="block",this.u.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Ea();a=!0}this.R&&this.R.focus()}return a}; -function Hc(a,b){!b&&a.b&&(a.Ia?a.u.style.width=a.u.style.height="":a.b.style.width=a.b.style.height="")}function Jc(a,b){a.Ka=b;a.N=!1;if(void 0===a.i||a.i.length!=a.Ka)a.i=Array(a.Ka)}function Lc(a,b,c,d,e){d=a.c?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.U&&(208<=c&&236>c?e=a.S+0:28<=c&&72>c&&(e=a.S+1));a=a.K[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Mb(a,b){var c=!0;if(!b){a.la&&(120==a.la?a.Va&1?(gc(a.a,2),c=!1):gc(a.a,1):gc(a.a,4));if(c&&a.N&&a.B){for(var d=a.j,e=a.B,f=!0,g=a.ea>>>d.j;0>=1);;){var x=bb(a.j,u++);if(127==(x&127)){var t=bb(a.j,u++),d=t&96,c=(t&15)<<8|bb(a.j,u),c=c+(t&16? -8192:16384);break}if(n>4)*x.P,Z,sa,Na,eb,xc=x.T,Jb=x.P;C?(Z=H*t.T,sa=e*t.P,Na=t.T,eb=t.P):(Z=H*t.Ca,sa=e*t.Da,Na=t.Ca,eb=t.Da);x.T>t.T&&(Z*=2,Na*=2);x.P>t.P&&(y||(Q+=t.P),Jb=t.P);C?C.drawImage(x.canvas,U,Q,xc,Jb,Z,sa,Na,eb):(Z+=0,sa+=0,t.f.drawImage(x.canvas,U,Q,xc,Jb,Z, -sa,Na,eb))}h++}g++}e++}}a.N=!0;!b&&a.sa&&1==h&&(a.i[l]=-1,h=0);a.sa=!1;(h||b)&&a.ra&&a.f.drawImage(a.s,0,a.pa,a.o,a.G-a.P,0,0,a.Jc,a.Ib)}else{e=a.ea;f=e+a.B;l=h=g=0;b=a.o;n=0;c=a.G;y=d=0;u=a.ja;H=(1<>>t.j;t=x!=t.f?t.b[U].Eb(x,C):t.b[U++].bb(x,C)|t.b[U&t.o].bb(0,C+1)<<8;if(a.N&&t===a.i[g])h+=a.La;else{a.i[g]=t;(C=y)&&(t=t>>8|(t&255)<<8);h>C&H,Lc(a,a.Ja,h++,l,U),C+=u;h>n&&(n=h);l=d&&(d=l+1)}e+= -2;g++;if(h>=a.o&&(h=0,l++,l>a.G))break}a.N=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(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||Ea.aspect);f&&.3<=f&&3.33>=f&&(xa("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 g=e.getContext("2d"),d=new Ec(d,e,g,f,c);Pa(d,c)}}); -function Mc(a){this.I=+a.adapter;switch(this.I){case 0:this.K=0;this.R=2;break;default:q("Unrecognized serial adapter #"+this.I);return}this.b=this.c=null;this.N=a.tabSize;this.H=a.charBOL;this.f=0;this.C=!1;r.call(this,"SerialPort",a,Mc);var b=a.binding;if("console"==b)this.c="";else{var c;a=Nc;b&&(void 0===c&&(c="Panel"),(c=Oa(c,this.id))&&(b=c.A[b])&&this.V(null,a,b))}this.g="";this.i=this.s=null;this.exports={connect:this.Cb,receiveData:this.gb}}w(Mc); -var Oc=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Pc=[!1,0,0,133,142,39,238],Nc="buffer";k=Mc.prototype; -k.V=function(a,b,c,d){var e=this;switch(b){case Nc:return this.A[b]=this.b=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.Sa)return;b=ha(b[1]);if(this.i=Ma(b)){var d=this.i.exports;if(d){var e=d.connect;e&&e.call(this.i);if(this.s=d.receiveData){this.status(this.Ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.ga=function(a,b){if(!b)if(this.Cb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.ia=function(a){return a?this.save():!0};k.reset=function(){Tc(this)};k.save=function(){var a=new F(this),b=0,c=[];c[b++]=this.o;c[b++]=this.B;c[b++]=this.G;c[b++]=this.fa;c[b++]=this.m;c[b++]=this.w;c[b]=this.u;a.set(0,c);return a.data()};k.restore=function(a){return Tc(this,a[0])};function Tc(a,b){var c=0;b||(b=Pc);a.o=b[c++];a.B=b[c++];a.G=b[c++];a.fa=b[c++];a.m=b[c++];a.w=b[c++];a.u=b[c];return!0} -function Uc(a,b){var c=a.u&b;b&15||(c>>=4);b=Oc[c];c=((a.m&12)>>2)+6;a.m&16&&c++;c+=((a.m&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Qc(a,b){return a.C||a.fa&2?!1:(a.B=b,a.fa|=2,gc(a.a,a.R),!0)}k.gb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Qc(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.a&&Kb(this.a,this.S,Uc(this,15)));return!0};k.Qc=function(){var a=this.B;this.fa&=-3;return a};k.Pc=function(){return this.fa}; -k.Zc=function(a,b){this.G=b;this.fa&=-6;if(19==b)this.C=!0;else if(17==b)this.C=!1;else if(this.s&&this.s.call(this.i,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0":String.fromCharCode(b);var c=a.length;9==b?(b=this.N||8,c=b-this.f%b,this.N&&(a=" ".slice(0,c))):13==b&&(this.f=c=0,a="\n");this.H&&!this.f&&c&&(a=String.fromCharCode(this.H)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;this.f+=c}else if(null!= -this.c){if(10==b||1024<=this.c.length)this.da(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.a&&Kb(this.a,this.U,Uc(this,240))};k.Yc=function(a,b){this.o?(this.w=b,this.w&64&&(this.o=!1)):(this.m=b,this.o=!0)};k.Xc=function(a,b){this.u=b};var Rc={0:Mc.prototype.Qc,1:Mc.prototype.Pc},Sc={0:Mc.prototype.Zc,1:Mc.prototype.Yc,2:Mc.prototype.Xc};ya(function(){for(var a=A(document,"pc8080","serial"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;bXc){if(Zc(d,this.s)){this.i=new F(this,"1.30.1","failsafe");Zc(this.i)&&(dd(this,d),a=2,ed(this.i));this.i.set("timestamp",ka());fd(this.i);var e=this.b&&!this.v;if(1==a||ma("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=cd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Zc(d,g):("error"== -f&&"no machine state"!=g?(this.L("Error: "+g),"unable to verify user"==g&&(qa("user",""),this.c=null)):this.da(f+": "+g),ed(d),Zc(d)?(c=cd(d),e=!0):c=!1))}e&&bd(this,c?d:null)}else 2==a&&d.clear()}else bd(this);delete this.s;delete this.u}e=La(this.id);for(f=0;fa[1];a=a[2];this.K=!0;this.l.Y=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(gd(this,this.a,b,c,a),this.a.Na());this.C&&(dd(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0}; -function dd(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||"";b=b.toString();var d={app:"PC8080",ver:"1.30.1"};d.url=a.I;d.user=c;d.type="bug";d.data=b;la("http://www.pcjs.org/api/v1/report",d,!0)}} -function hd(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new F(a,"1.30.1"),g=new F(a,"1.30.1","validate"),h=ka();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&Db(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.Y=!1,!1===d&&(e=null)));for(var h=La(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PC8080$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(u){f=null,a=u.message}else a="unrecognized XML: "+(255>>f.j;0>>=f.j;0d?a.j.push({mb:b,hb:Date.now(),$a:!1}):(a.j[d].hb=Date.now(),a.j[d].$a=!1);else if(0<=d){if(!a.j[d].$a){var e=a.j[d].hb;if(e&&100>Date.now()-e)return a.j[d].$a=!0,Ec(a),!0}a.j.splice(d,1)}if(a.M){d=0;switch(b){case "1p":d=V.Ca.sc;break;case "2p":d=V.Ca.wc;break;case "coin":d=V.Ca.Tb;break;case "left":d=V.Ca.uc;break;case "right":d=V.Ca.vc;break;case "fire":d=V.Ca.tc}d&&(a=a.M,b=d,a.g&=~b,c&&(a.g|=b))}return!0} +function Ec(a){for(var b=0,c=-1;bc||c>e)c=e}else{Cc(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Ec(a)},c)}k.$c=function(){var a=this.g;0<=this.c&&(this.c>3)*a.G,!$a(a.j,a.ja,a.B,3)))return!1;a.B?(a.Ma=a.f.createImageData(b,c),a.Oa=16/a.la|0,Kc(a,a.B>>1)):Kc(a,(a.H+1)*a.W);a.s=document.createElement("canvas");a.s.width=b;a.s.height=c;a.sa=a.s.getContext("2d");a.I={};a.S=1<=a.Aa?8:16,f=8>(7>4)*c)}return l}Fc.prototype.ga=function(){return!0};Fc.prototype.V=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.va[b]=c,!0;switch(b){case "fullScreen":return this.A[b]=c,this.b&&this.b.Ha?c.onclick=function(){d.Ha()}:c.parentNode.removeChild(c),!0}return!1}; +Fc.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.C/this.w;b>c&&(a=Math.round(c/b*100)+"%")}this.La?(this.u.style.width=a,this.u.style.width=a,this.u.style.display="block",this.u.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Ha();a=!0}this.R&&this.R.focus()}return a}; +function Ic(a,b){!b&&a.b&&(a.La?a.u.style.width=a.u.style.height="":a.b.style.width=a.b.style.height="")}function Kc(a,b){a.Na=b;a.N=!1;if(void 0===a.i||a.i.length!=a.Na)a.i=Array(a.Na)}function Mc(a,b,c,d,e){d=a.c?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.U&&(208<=c&&236>c?e=a.S+0:28<=c&&72>c&&(e=a.S+1));a=a.L[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} +function Nb(a,b){var c=!0;if(!b){a.ma&&(120==a.ma?a.Xa&1?(hc(a.a,2),c=!1):hc(a.a,1):hc(a.a,4));if(c&&a.N&&a.B){for(var d=a.j,e=a.B,f=!0,g=a.ja>>>d.j;0>=1);;){var x=cb(a.j,u++);if(127==(x&127)){var t=cb(a.j,u++),d=t&96,c=(t&15)<<8|cb(a.j,u),c=c+(t&16? +8192:16384);break}if(n>4)*x.P,Z,sa,Pa,fb,zc=x.T,Lb=x.P;D?(Z=H*t.T,sa=e*t.P,Pa=t.T,fb=t.P):(Z=H*t.Fa,sa=e*t.Ga,Pa=t.Fa,fb=t.Ga);x.T>t.T&&(Z*=2,Pa*=2);x.P>t.P&&(y||(Q+=t.P),Lb=t.P);D?D.drawImage(x.canvas,U,Q,zc,Lb,Z,sa,Pa,fb):(Z+=0,sa+=0,t.f.drawImage(x.canvas,U,Q,zc,Lb, +Z,sa,Pa,fb))}h++}g++}e++}}a.N=!0;!b&&a.ta&&1==h&&(a.i[l]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.s,0,a.qa,a.o,a.G-a.P,0,0,a.Nc,a.Mb)}else{e=a.ja;f=e+a.B;l=h=g=0;b=a.o;n=0;c=a.G;y=d=0;u=a.la;H=(1<>>t.j;t=x!=t.f?t.b[U].Ib(x,D):t.b[U++].eb(x,D)|t.b[U&t.o].eb(0,D+1)<<8;if(a.N&&t===a.i[g])h+=a.Oa;else{a.i[g]=t;(D=y)&&(t=t>>8|(t&255)<<8);h>D&H,Mc(a,a.Ma,h++,l,U),D+=u;h>n&&(n=h);l=d&&(d=l+1)}e+= +2;g++;if(h>=a.o&&(h=0,l++,l>a.G))break}a.N=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(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||Fa.aspect);f&&.3<=f&&3.33>=f&&(ya("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");ta("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Fc(d,e,g,f,c);Qa(d,c)}}); +function Nc(a){this.I=+a.adapter;switch(this.I){case 0:this.L=0;this.R=2;break;default:q("Unrecognized serial adapter #"+this.I);return}this.b=this.c=null;this.N=a.tabSize;this.H=a.charBOL;this.f=0;this.C=!1;r.call(this,"SerialPort",a,Nc);var b=a.binding;if("console"==b)this.c="";else{var c;a=Oc;b&&(void 0===c&&(c="Panel"),(c=Oa(c,this.id))&&(b=c.A[b])&&this.V(null,a,b))}this.g="";this.i=this.s=null;this.exports={connect:this.Gb,receiveData:this.kb}}w(Nc); +var Pc=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Qc=[!1,0,0,133,142,39,238],Oc="buffer";k=Nc.prototype; +k.V=function(a,b,c,d){var e=this;switch(b){case Oc:return this.A[b]=this.b=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.Va)return;b=ha(b[1]);if(this.i=Na(b)){var d=this.i.exports;if(d){var e=d.connect;e&&e.call(this.i);if(this.s=d.receiveData){this.status(this.ya+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.ga=function(a,b){if(!b)if(this.Gb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.ia=function(a){return a?this.save():!0};k.reset=function(){Uc(this)};k.save=function(){var a=new F(this),b=0,c=[];c[b++]=this.o;c[b++]=this.B;c[b++]=this.G;c[b++]=this.fa;c[b++]=this.m;c[b++]=this.w;c[b]=this.u;a.set(0,c);return a.data()};k.restore=function(a){return Uc(this,a[0])};function Uc(a,b){var c=0;b||(b=Qc);a.o=b[c++];a.B=b[c++];a.G=b[c++];a.fa=b[c++];a.m=b[c++];a.w=b[c++];a.u=b[c];return!0} +function Vc(a,b){var c=a.u&b;b&15||(c>>=4);b=Pc[c];c=((a.m&12)>>2)+6;a.m&16&&c++;c+=((a.m&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Rc(a,b){return a.C||a.fa&2?!1:(a.B=b,a.fa|=2,hc(a.a,a.R),!0)}k.kb=function(a){null!=a&&(this.g="number"!=typeof a?a:this.g+String.fromCharCode(a));this.g&&(Rc(this,this.g.charCodeAt(0))&&(this.g=this.g.substr(1)),this.g&&this.a&&Kb(this.a,this.S,Vc(this,15)));return!0};k.Uc=function(){var a=this.B;this.fa&=-3;return a};k.Tc=function(){return this.fa}; +k.cd=function(a,b){this.G=b;this.fa&=-6;if(19==b)this.C=!0;else if(17==b)this.C=!1;else if(this.s&&this.s.call(this.i,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0":String.fromCharCode(b);var c=a.length;9==b?(b=this.N||8,c=b-this.f%b,this.N&&(a=" ".slice(0,c))):13==b&&(this.f=c=0,a="\n");this.H&&!this.f&&c&&(a=String.fromCharCode(this.H)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;this.f+=c}else if(null!= +this.c){if(10==b||1024<=this.c.length)this.ea(this.c),this.c="";10!=b&&(this.c+=String.fromCharCode(b))}this.a&&Kb(this.a,this.U,Vc(this,240))};k.bd=function(a,b){this.o?(this.w=b,this.w&64&&(this.o=!1)):(this.m=b,this.o=!0)};k.ad=function(a,b){this.u=b};var Sc={0:Nc.prototype.Uc,1:Nc.prototype.Tc},Tc={0:Nc.prototype.cd,1:Nc.prototype.bd,2:Nc.prototype.ad};za(function(){for(var a=A(document,"pc8080","serial"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;bYc){if($c(d,this.s)){this.i=new F(this,"1.30.1","failsafe");$c(this.i)&&(ed(this,d),a=2,fd(this.i));this.i.set("timestamp",ka());gd(this.i);var e=this.b&&!this.v;if(1==a||na("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=dd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?$c(d,g):("error"== +f&&"no machine state"!=g?(this.K("Error: "+g),"unable to verify user"==g&&(ra("user",""),this.c=null)):this.ea(f+": "+g),fd(d),$c(d)?(c=dd(d),e=!0):c=!1))}e&&cd(this,c?d:null)}else 2==a&&d.clear()}else cd(this);delete this.s;delete this.u}e=Ma(this.id);for(f=0;fa[1];a=a[2];this.L=!0;this.l.Z=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(hd(this,this.a,b,c,a),this.a.Qa());this.C&&(ed(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0}; +function ed(a,b){if(na("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||"";b=b.toString();var d={app:"PC8080",ver:"1.30.1"};d.url=a.I;d.user=c;d.type="bug";d.data=b;la("http://www.pcjs.org/api/v1/report",d,!0)}} +function id(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new F(a,"1.30.1"),g=new F(a,"1.30.1","validate"),h=ka();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&Eb(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.Z=!1,!1===d&&(e=null)));for(var h=Ma(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PC8080$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(u){f=null,a=u.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");la(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],n,u=/( [a-z]+=)(['"])(.*?)\2/g;n=u.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,""); -a=a.replace(d[0],g);od(a,b,c)}})}else c(a,null)} -function pd(a,b,c,d){function e(a){if(void 0===h){var b=g&&A(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--ld||Ba(!0));l=!1}var g,h,l=!0;ld++;Ja[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css";y.styleSheet?y.styleSheet.cssText=n:y.appendChild(document.createTextNode(n));u.appendChild(y)}c|| -(c="/versions/pc8080/1.30.1/components.xsl");n=function(d,h){h?md(c,null,null,!1,e,function(d,l){l?(Ka(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--ld||Ba(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ld||Ba(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?md(b,a,d,!0,e,n):nd(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(H){f(H.message)}return l}window.embedPC8080=function(a,b,c,d){Ba(!1);return pd(a,b,c,d)};window.enableEvents=Ba;window.sendEvent=Ca;})(); +function pd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");la(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],n,u=/( [a-z]+=)(['"])(.*?)\2/g;n=u.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,""); +a=a.replace(d[0],g);pd(a,b,c)}})}else c(a,null)} +function qd(a,b,c,d){function e(a){if(void 0===h){var b=g&&A(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--md||Ca(!0));l=!1}var g,h,l=!0;md++;Ka[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css";y.styleSheet?y.styleSheet.cssText=n:y.appendChild(document.createTextNode(n));u.appendChild(y)}c|| +(c="/versions/pc8080/1.30.1/components.xsl");n=function(d,h){h?nd(c,null,null,!1,e,function(d,l){l?(La(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--md||Ca(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--md||Ca(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nd(b,a,d,!0,e,n):od(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(H){f(H.message)}return l}window.embedPC8080=function(a,b,c,d){Ca(!1);return qd(a,b,c,d)};window.enableEvents=Ca;window.sendEvent=Da;})(); diff --git a/versions/pcx86/1.30.1/components.css b/versions/pcx86/1.30.1/components.css index dc7dbc154..6fa42a7a7 100644 --- a/versions/pcx86/1.30.1/components.css +++ b/versions/pcx86/1.30.1/components.css @@ -85,7 +85,7 @@ } .pcjs-description, .pcjs-status { font-size: x-small; - line-height: 2em; + line-height: 2.8em; } .pcjs-key { border: 1px solid black; diff --git a/versions/pcx86/1.30.1/components.xsl b/versions/pcx86/1.30.1/components.xsl index 2fdfafed3..4e63686a9 100644 --- a/versions/pcx86/1.30.1/components.xsl +++ b/versions/pcx86/1.30.1/components.xsl @@ -580,9 +580,9 @@ null - + - + 0 @@ -610,7 +610,7 @@ - ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,resetAddr:,csStart:,csInterval:,csStop: + ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,addrReset:,csStart:,csInterval:,csStop: @@ -931,16 +931,10 @@ - - - - false - - rom - ,addr:,size:,alias:,file:'',notify:'',writable: + ,addr:,size:,alias:,file:'',notify:'' @@ -964,6 +958,24 @@ 0 + + + + + + + + + + null + + + + + + null + + @@ -973,7 +985,7 @@ ram - ,addr:,size:,test: + ,addr:,size:,file:'',load:,exec:,test: diff --git a/versions/pdpjs/1.30.1/components.css b/versions/pdpjs/1.30.1/components.css index dc7dbc154..6fa42a7a7 100644 --- a/versions/pdpjs/1.30.1/components.css +++ b/versions/pdpjs/1.30.1/components.css @@ -85,7 +85,7 @@ } .pcjs-description, .pcjs-status { font-size: x-small; - line-height: 2em; + line-height: 2.8em; } .pcjs-key { border: 1px solid black; diff --git a/versions/pdpjs/1.30.1/components.xsl b/versions/pdpjs/1.30.1/components.xsl index 2ed955772..3d896754c 100644 --- a/versions/pdpjs/1.30.1/components.xsl +++ b/versions/pdpjs/1.30.1/components.xsl @@ -580,9 +580,9 @@ null - + - + 0 @@ -610,7 +610,7 @@ - ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,resetAddr:,csStart:,csInterval:,csStop: + ,model:'',stepping:'',fpu:,cycles:,multiplier:,autoStart:,addrReset:,csStart:,csInterval:,csStop: @@ -931,16 +931,10 @@ - - - - false - - rom - ,addr:,size:,alias:,file:'',notify:'',writable: + ,addr:,size:,alias:,file:'',notify:'' @@ -964,6 +958,24 @@ 0 + + + + + + + + + + null + + + + + + null + + @@ -973,7 +985,7 @@ ram - ,addr:,size:,test: + ,addr:,size:,file:'',load:,exec:,test: diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index b773c3a4e..4986bdf8b 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -29,231 +29,233 @@ http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function pa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ua(a){return a.replace(/[&<>"']/g,function(a){return ta[a]})}function va(a,b){return(a+" ").slice(0,b)} -function xa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ya={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,l;l=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function Fa(a,b,c,d){var e=0,f=null,g=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)}),g;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function sa(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function n(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){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}Ha=a}return Ha}function Ja(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} -function Ka(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function La(a){if(window){var b=window?window.navigator.userAgent:"";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 Ma(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function oa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ta(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}function ua(a,b){return(a+" ").slice(0,b)} +function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var wa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function ya(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,l;l=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function Ba(a,b,c,d){var e=0,f=null,g=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)}),g;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g} +function Fa(a,b){var c,d={ga:null,ja:null,Lb:null,Kb:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g=eval("("+b+")");d.Lb=g.load;d.Kb=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;c>8&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ja=g.symbols;d.ga.length?1==d.ga.length&&(n(d.ga[0]),d=null): +(n("Empty resource: "+a),d=null)}catch(l){n("Resource data error: "+l.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.ga=Array(a.length),c=0;cb?this.Ua=this.id:(this.Gb=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,jb:!1,Hb:!1,ha:!1,error:!1};this.xb=null;this.v.error=!1;this.J={};this.i=null;this.ia=d||0;t.push(this)}var cb=void 0,db={}; +function Ua(a){if(Ra)try{for(var b=0;bb?this.Ua=this.id:(this.Va=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,mb:!1,Ib:!1,ia:!1,error:!1};this.zb=null;this.v.error=!1;this.J={};this.i=null;this.ka=d||0;t.push(this)}var cb=void 0,db={}; if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(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 u(a,b){b||(b=r);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ib=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ib={},t=[];function jb(a,b,c){ib[a]&&b&&(ib[a][b]=c)}function kb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.w=this.sa-1;this.D=this.H/this.sa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Nb,Ob,Pb,Qb];a=new J(this);Rb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&G(this.i,64)&&E(this.i,e[4]+".readByte("+K(this.i,b)+"): "+K(this.i,c),!0,!0),c;c=Tb(d,b,!0);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+K(this.i,b)+": "+K(this.i,c),!0,!0);return c} -function Ob(a,b,c){var d=!1,e=this.controller,f=e.Ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&G(this.i,64)&&E(this.i,f[4]+".writeByte("+K(this.i,c)+","+K(this.i,b)+")",!0,!0):(Tb(e,c,!0,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+K(this.i,c)+": "+K(this.i,b),!0,!0))} -function Pb(a,b){var c=-1,d=this.controller;(a=d.Ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&G(this.i,64)&&E(this.i,a[4]+".readWord("+K(this.i,b)+"): "+K(this.i,c),!0,!0),c;c=Tb(d,b,!1);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+K(this.i,b)+": "+K(this.i,c),!0,!0);return c} -function Qb(a,b,c){var d=!1,e=this.controller;if(a=e.Ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&G(this.i,64)&&E(this.i,a[4]+".writeWord("+K(this.i,c)+","+K(this.i,b)+")",!0,!0):(Tb(e,c,!1,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+K(this.i,c)+": "+K(this.i,b),!0,!0))} -function Ub(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ga;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.tb+=m.A-f,m.A=f,!0;if(f>=m.A+m.tb){q=m.size-(f-p);q>g&&(q=g);m.tb=f-m.A+q;f=p+a.sa;g-=q;l++;continue}}return $b(1,f,g)}f=new J(a,f,q,a.sa,d,e);Rb(f,a.i,m);a.W[l++]=f;f=p+a.sa;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ga;0>>=a.ga;0>>this.ga].Cb(a&this.w,a)};h.zb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ga].Jb(a&this.w,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.ga].ra(a&this.w,a)}; -h.mb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ga;this.C++;a=this.W[c].Kb(b,a);this.C--;return a};h.Db=function(a,b){this.W[(a&this.f)>>>this.ga].Fb(a&this.w,b&255,a)};h.rb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ga].Pb(a&this.w,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.ga].ub(a&this.w,b&65535,a)};h.Eb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ga;this.C++;this.W[d].Qb(c,b&65535,a);this.C--}; -function bc(a){for(var b=0,c=[],d=0;da.b.Ya)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));kc(a,e,e,g,l,m,p,f[4])}}}function mc(a,b){a.B.push(b)} -function nc(a,b){a.C||(a.i&&G(a.i,536870912)&&E(a.i,"memory fault on address "+K(a.i,b),!0,!0),a.b.ea(4,b))}function $b(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function L(a){r.call(this,"Device",a,L,256);this.g={data:0,Pd:0,Bb:20,dd:0};this.f={Qd:0,Ob:-1}}u(L);h=L.prototype; -h.Ba=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Ob=oc(c,function(){e.f.Ia|=128;e.f.Ia&64&&(pc(e.b,e.f.ed),qc(e.b,e.f.Ob,1E3/60))});this.f.ed=rc(64,6);lc(b,this,M);mc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Bb=this.g.Bb&-120|20;this.f.Ia=0};h.Ac=function(){var a=this.f.Ia;this.f.Ia&=-129;return a};h.od=function(a){this.f.Ia=a;a&64&&qc(this.b,this.f.Ob,1E3/60);this.f.Ia=a&-129};h.tc=function(a){return(a?this.g.dd:this.g.data)&65535}; -h.gd=function(a){this.g.data=a};h.Cc=function(){var a=this.b;return a.G&62337|a.ua<<5|a.va<<1};h.qd=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ua=a>>5&3;b.va=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ja!=c&&(b.Ja=c,sc(b))}tc(this)};h.Dc=function(){var a=this.b.La;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ec=function(){return this.b.qb};h.Fc=function(){return this.b.Ma}; -h.rd=function(a){var b=this.b;1170>b.Ya&&(a&=-49);b.Ma!=a&&(b.Ma=a,a&16?(b.Wa=4194303,b.wa=3915776):(b.Wa=262143,b.wa=253952),sc(b));tc(this)};function tc(a){a.g.Bb=a.g.Bb&-8|(a.b.Ja?a.b.Ma&16?1:2:4)}h.Tc=function(a){return this.b.P[1][a>>1&7]};h.Fd=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Rc=function(a){return this.b.P[1][(a>>1&7)+8]};h.Dd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Sc=function(a){return this.b.qa[1][a>>1&7]}; -h.Ed=function(a,b){b=b>>1&7;this.b.qa[1][b]=a;this.b.P[1][b]&=65295};h.Qc=function(a){return this.b.qa[1][(a>>1&7)+8]};h.Cd=function(a,b){b=(b>>1&7)+8;this.b.qa[1][b]=a;this.b.P[1][b]&=65295};h.zc=function(a){return this.b.P[0][a>>1&7]};h.nd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.xc=function(a){return this.b.P[0][(a>>1&7)+8]};h.ld=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.yc=function(a){return this.b.qa[0][a>>1&7]};h.md=function(a,b){b=b>>1&7;this.b.qa[0][b]=a;this.b.P[0][b]&=65295}; -h.wc=function(a){return this.b.qa[0][(a>>1&7)+8]};h.kd=function(a,b){b=(b>>1&7)+8;this.b.qa[0][b]=a;this.b.P[0][b]&=65295};h.Zc=function(a){return this.b.P[3][a>>1&7]};h.Ld=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.Xc=function(a){return this.b.P[3][(a>>1&7)+8]};h.Jd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Yc=function(a){return this.b.qa[3][a>>1&7]};h.Kd=function(a,b){b=b>>1&7;this.b.qa[3][b]=a;this.b.P[3][b]&=65295};h.Wc=function(a){return this.b.qa[3][(a>>1&7)+8]}; -h.Id=function(a,b){b=(b>>1&7)+8;this.b.qa[3][b]=a;this.b.P[3][b]&=65295};h.bb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.gb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Kc=function(){return this.b.L&49152?this.b.ta[0]:this.b.u[6]};h.wd=function(a){this.b.L&49152?this.b.ta[0]=a:this.b.u[6]=a};h.Nc=function(){return this.b.u[7]};h.zd=function(a){this.b.u[7]=a};h.cb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; -h.hb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Lc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.ta[1]};h.xd=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ta[1]=a};h.Mc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.ta[3]};h.yd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ta[3]=a};h.vc=function(a){return this.b.cc[a-65504>>1]};h.jd=function(a,b){this.b.cc[b-65504>>1]=a};h.$b=function(a){return 65520==a?61183:0};h.fc=function(){}; -h.Vc=function(){return 1};h.Hd=function(){};h.uc=function(){return this.b.Z};h.hd=function(){this.b.Z=0};h.Bc=function(){return this.b.bc};h.pd=function(a,b){b&1||(a&=255);this.b.bc=a};h.Gc=function(a){return a?this.b.Mb:0};h.sd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Mb=a;b.F|=2};h.Uc=function(a){return a?this.b.Na&65280:0};h.Gd=function(a){this.b.Na=a|255};h.Jc=function(){return Kb(this.b)};h.vd=function(a){uc(this.b,a&-1809|Kb(this.b)&1808);this.b.F|=128}; -h.ec=function(a,b){G(this)&&E(this,"writeIgnored("+oa(b)+"): "+oa(a),!0,!0)}; -var N={},M=(N[62592]=[null,null,L.prototype.Tc,L.prototype.Fd,"SISDR",1145],N[62608]=[null,null,L.prototype.Rc,L.prototype.Dd,"SDSDR",1145],N[62624]=[null,null,L.prototype.Sc,L.prototype.Ed,"SISAR",1145],N[62640]=[null,null,L.prototype.Qc,L.prototype.Cd,"SDSAR",1145],N[62656]=[null,null,L.prototype.zc,L.prototype.nd,"KISDR",1145],N[62672]=[null,null,L.prototype.xc,L.prototype.ld,"KDSDR",1145],N[62688]=[null,null,L.prototype.yc,L.prototype.md,"KISAR",1145],N[62704]=[null,null,L.prototype.wc,L.prototype.kd, -"KDSAR",1145],N[62798]=[null,null,L.prototype.Fc,L.prototype.rd,"MMR3",1145],N[65382]=[null,null,L.prototype.Ac,L.prototype.od,"LKS"],N[65400]=[null,null,L.prototype.tc,L.prototype.gd,"CNSL"],N[65402]=[null,null,L.prototype.Cc,L.prototype.qd,"MMR0",1145],N[65404]=[null,null,L.prototype.Dc,L.prototype.ec,"MMR1",1145],N[65406]=[null,null,L.prototype.Ec,L.prototype.ec,"MMR2",1145],N[65408]=[null,null,L.prototype.Zc,L.prototype.Ld,"UISDR",1145],N[65424]=[null,null,L.prototype.Xc,L.prototype.Jd,"UDSDR", -1145],N[65440]=[null,null,L.prototype.Yc,L.prototype.Kd,"UISAR",1145],N[65456]=[null,null,L.prototype.Wc,L.prototype.Id,"UDSAR",1145],N[65472]=[null,null,L.prototype.bb,L.prototype.gb,"R0SET0"],N[65473]=[null,null,L.prototype.bb,L.prototype.gb,"R1SET0"],N[65474]=[null,null,L.prototype.bb,L.prototype.gb,"R2SET0"],N[65475]=[null,null,L.prototype.bb,L.prototype.gb,"R3SET0"],N[65476]=[null,null,L.prototype.bb,L.prototype.gb,"R4SET0"],N[65477]=[null,null,L.prototype.bb,L.prototype.gb,"R5SET0"],N[65478]= -[null,null,L.prototype.Kc,L.prototype.wd,"R6KERNEL"],N[65479]=[null,null,L.prototype.Nc,L.prototype.zd,"R7KERNEL"],N[65480]=[null,null,L.prototype.cb,L.prototype.hb,"R0SET1",1145],N[65481]=[null,null,L.prototype.cb,L.prototype.hb,"R1SET1",1145],N[65482]=[null,null,L.prototype.cb,L.prototype.hb,"R2SET1",1145],N[65483]=[null,null,L.prototype.cb,L.prototype.hb,"R3SET1",1145],N[65484]=[null,null,L.prototype.cb,L.prototype.hb,"R4SET1",1145],N[65485]=[null,null,L.prototype.cb,L.prototype.hb,"R5SET1",1145], -N[65486]=[null,null,L.prototype.Lc,L.prototype.xd,"R6SUPER",1145],N[65487]=[null,null,L.prototype.Mc,L.prototype.yd,"R6USER",1145],N[65504]=[null,null,L.prototype.vc,L.prototype.jd,"CTRL",1170],N[65520]=[null,null,L.prototype.$b,L.prototype.fc,"LSIZE",1170],N[65522]=[null,null,L.prototype.$b,L.prototype.fc,"HSIZE",1170],N[65524]=[null,null,L.prototype.Vc,L.prototype.Hd,"SYSID",1170],N[65526]=[null,null,L.prototype.uc,L.prototype.hd,"CPUERR",1170],N[65528]=[null,null,L.prototype.Bc,L.prototype.pd, -"MB",1170],N[65530]=[null,null,L.prototype.Gc,L.prototype.sd,"PIR"],N[65532]=[null,null,L.prototype.Uc,L.prototype.Gd,"SL"],N[65534]=[null,null,L.prototype.Jc,L.prototype.vd,"PSW"],N);M[62594]=M[62592];M[62596]=M[62592];M[62598]=M[62592];M[62600]=M[62592];M[62602]=M[62592];M[62604]=M[62592];M[62606]=M[62592];M[62610]=M[62608];M[62612]=M[62608];M[62614]=M[62608];M[62616]=M[62608];M[62618]=M[62608];M[62620]=M[62608];M[62622]=M[62608];M[62626]=M[62624];M[62628]=M[62624];M[62630]=M[62624];M[62632]=M[62624]; -M[62634]=M[62624];M[62636]=M[62624];M[62638]=M[62624];M[62642]=M[62640];M[62644]=M[62640];M[62646]=M[62640];M[62648]=M[62640];M[62650]=M[62640];M[62652]=M[62640];M[62654]=M[62640];M[62658]=M[62656];M[62660]=M[62656];M[62662]=M[62656];M[62664]=M[62656];M[62666]=M[62656];M[62668]=M[62656];M[62670]=M[62656];M[62674]=M[62672];M[62676]=M[62672];M[62678]=M[62672];M[62680]=M[62672];M[62682]=M[62672];M[62684]=M[62672];M[62686]=M[62672];M[62690]=M[62688];M[62692]=M[62688];M[62694]=M[62688];M[62696]=M[62688]; -M[62698]=M[62688];M[62700]=M[62688];M[62702]=M[62688];M[62706]=M[62704];M[62708]=M[62704];M[62710]=M[62704];M[62712]=M[62704];M[62714]=M[62704];M[62716]=M[62704];M[62718]=M[62704];M[65410]=M[65408];M[65412]=M[65408];M[65414]=M[65408];M[65416]=M[65408];M[65418]=M[65408];M[65420]=M[65408];M[65422]=M[65408];M[65426]=M[65424];M[65428]=M[65424];M[65430]=M[65424];M[65432]=M[65424];M[65434]=M[65424];M[65436]=M[65424];M[65438]=M[65424];M[65442]=M[65440];M[65444]=M[65440];M[65446]=M[65440];M[65448]=M[65440]; -M[65450]=M[65440];M[65452]=M[65440];M[65454]=M[65440];M[65458]=M[65456];M[65460]=M[65456];M[65462]=M[65456];M[65464]=M[65456];M[65466]=M[65456];M[65468]=M[65456];M[65470]=M[65456];M[65506]=M[65504];M[65508]=M[65504];M[65510]=M[65504];M[65512]=M[65504];M[65514]=M[65504];M[65516]=M[65504];M[65518]=M[65504];Ta(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),Cc(this,yc?Dc:Ec);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ja:function(a,b){a&1&&nc(this.w,b);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},ua:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]= -this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ha=!0},T:function(a,b){if(this.i&&null!=this.A){var c=this.i;Jc(c,this.A+a,1,c.M)&&c.da(!0)}return this.Jb(a,b)},ba:function(a,b){if(this.i&&null!=this.A){var c=this.i;Jc(c,this.A+a,2,c.M)&&c.da(!0)}return this.Kb(a,b)},ma:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Jc(d,this.A+a, -1,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Pb(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Jc(d,this.A+a,2,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Qb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&G(this.i,128)&&E(this.i,"Memory.readByte("+K(this.i,b)+"): "+K(this.i,a),!0);return a},aa:function(a,b){a&1&&nc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&nc(this.w,b);a=this.I[a>>1];this.i&&G(this.i,128)&&E(this.i,"Memory.readWord("+ -K(this.i,b)+"): "+K(this.i,a),!0);return a},la:function(a,b){this.D[a]=b;this.Ha=!0},pa:function(a,b,c){this.D[a]=b;this.Ha=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeByte("+K(this.i,c)+","+K(this.i,b)+")",!0)},va:function(a,b,c){a&1&&nc(this.w,c);this.G.setUint16(a,b,!0);this.Ha=!0},Ua:function(a,b,c){a&1&&nc(this.w,c);this.I[a>>1]=b;this.Ha=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeWord("+K(this.i,c)+","+K(this.i,b)+")",!0)}}; -function Rb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Ic(a,Hc,!1),(a.B=c.B)&&Gc(a,Hc,!1))}function Kc(a,b){b?--a.B||(a.Fb=a.f?a.J:a.Pb,a.ub=a.f?a.H:a.Qb):--a.g||(a.Cb=a.Jb,a.ra=a.Kb)}function Gc(a,b,c){c&&a.B||(a.Fb=!a.f&&b[1]||a.J,a.ub=!a.f&&b[3]||a.H);if(c||void 0===c)a.Pb=b[1]||a.J,a.Qb=b[3]||a.H}function Ic(a,b,c){c&&a.g||(a.Cb=b[0]||a.K,a.ra=b[2]||a.M);if(c||void 0===c)a.Jb=b[0]||a.K,a.Kb=b[2]||a.M}function Cc(a,b){b||(b=Lc);Ic(a,b,void 0);Gc(a,b,void 0)} -var Lc=[],Fc=[J.prototype.V,J.prototype.ua,J.prototype.ja,J.prototype.za],Hc=[J.prototype.T,J.prototype.ma,J.prototype.ba,J.prototype.wa];if(sb)var Ec=[J.prototype.R,J.prototype.la,J.prototype.aa,J.prototype.va],Dc=[J.prototype.U,J.prototype.pa,J.prototype.fa,J.prototype.Ua]; -function Mc(a,b){r.call(this,"CPU",a,Mc,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.Ka=c;this.Va=Math.round(this.Fa/1E4)/100;this.Ra=this.Va*this.Ka;this.v.ca=!1;this.v.Nb=!1;this.v.ib=a.autoStart;this.v.Xa=!1;this.nb=this.ja=0;this.ob=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.K=[];this.Ab=this.cd.bind(this);H(this)}u(Mc);var Nc=["power","reset"];h=Mc.prototype; -h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.ja&&(a.ja+=a.Za,c=!0);0<=a.$a&&a.$a<=Tc(a)&&(a.Za=a.$a=-1,Qc(a),a.da(),c=!0);c&&a.j(Tc(a)+" cycles: checksum="+k(a.nb))}} -h.oa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,l=kb(a.id);for(c=0;ca.V/a.Ra?b=1:d=!0;a.Ka=b;b=a.Va*a.Ka;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.sb()}Vc(a,a.T);a.T=0;a.R=Aa();a.aa=0;Wc(a);return d}function oc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function qc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Fa*a.Ka/1E3*c|0,a.K[b][0]=c+Xc(a))} -function Yc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Xc(a,b){var c=a.ba-=a.b;a.b=0;b&&(a.ba=0);return c} -h.cd=function(){if(this.v.ca){this.kb>=this.Fa&&Wc(this,!0);this.pa=0;this.za=Aa();if(this.aa){var a=this.za-this.aa;a>this.wb&&(this.R+=a,this.R>this.za&&(this.R=this.za))}try{do{var b=Yc(this,this.v.Xa?1:this.Oa);try{this.fb(b)}catch(e){if("number"!=typeof e)throw e;}b=Xc(this,!0);this.pa+=b;this.T+=b;Sc(this,b);Zc(this,b);this.la-=b;if(0>=this.la){this.la+=this.Oa;15<=++this.yb&&(this.B&&this.B.$(),this.yb=0);break}}while(this.v.ca)}catch(e){this.da();this.B&&this.B.stop(Aa(),Tc(this));rb(this, -e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.Ab;this.aa=Aa();var c=this.wb;this.pa&&(c=Math.round(c*this.pa/this.Oa));var c=c-(this.aa-this.za),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Uc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.kb+=this.pa;this.aa+=c;a(b,c)}}}; -h.eb=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Uc(this);this.v.ca=!0;this.v.Nb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,Tc(this)));setTimeout(this.Ab,0);return!0};h.fb=function(){return 0};h.da=function(a){if(this.v.ca){Xc(this);Vc(this,this.T);this.T=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(Aa(),Tc(this))}this.v.complete=a}; -function $c(a){this.Ya=+a.model||1170;this.qc=a.resetAddr||0;Mc.call(this,a,6666667);this.decode=1120==this.Ya?ad.bind(this):ud.bind(this);vd(this);this.C=0;this.U=null;this.v.complete=this.v.kc=!1}u($c,Mc);h=$c.prototype;h.reset=function(){this.status("model "+this.Ya);this.v.ca&&this.da();vd(this);Pc(this);this.v.error=!1;this.parent.reset.call(this)}; -function vd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.qc];a.Ea=[0,0,0,0,0,0];a.ta=[0,0,0,0];a.D=0;a.va=0;a.oc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.qa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.rc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.cc=[0,0,0,0,0,0,0,0];a.bc=0;a.F=0;a.H=a.I=0;a.g=a.f=a.Ta=0;a.ma=-1;wd(a)}function wd(a){a.Na=255;a.Z=0;a.Mb=0;a.G=0;a.La=0;a.qb=0;a.Ma=0;a.Ja=0;a.ua=0;a.Wa=262143;a.wa=253952;a.F|=2;a.w&&sc(a)}function sc(a){a.Ja?(a.M=65536,a.Y=a.nc,a.ra=a.$c,a.ub=a.Md,Ub(a.w,a.Ma&16?22:18)):(a.M=0,a.Y=a.mc,a.ra=a.ac,a.ub=a.gc,Ub(a.w,16))}h.Wb=function(){return 0}; -h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.fa,this.Ka]);a.set(2,bc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Uc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.D!=c&&(a.ta[c]=a.u[6],a.u[6]=a.ta[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function Cd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function Dd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function Ed(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function Fd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))} -h.ea=function(a,b){if(!this.C){var c=!1;0>this.ma?this.ma=Kb(this):this.D||(a=4,c=!0);this.G&57344||(this.La=63222,this.qb=a);this.D=0;var d=this.ra(a|this.M),e=this.ra(a+2&65535|this.M);uc(this,e&-12289|this.ma>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.ma);Gd(this,this.u[7]);Bd(this,d);this.F&=-113;this.ma=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);Bd(a,b);uc(a,c);a.F&=-17} -function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Ma&a.oc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.qa[a.D][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ma&32&&(f=a.rc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.wa&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? -192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.ua=a.D,a.va=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ua<<5|a.va<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ra(e)|g; -a.b-=8;break;case 6:return e=Ad(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Ad(a),e=e+a.u[c]&65535,e=a.ra(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.La=a.La<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.zb=function(a){if(!this.Ja)return this.w.zb(a);this.C++;a=Kd(this,Jd(this,a,3));this.C--;return a}; -h.mb=function(a){if(!this.Ja)return this.w.mb(a);this.C++;a=this.ac(Jd(this,a,2));this.C--;return a};h.rb=function(a,b){this.Ja?(this.C++,Ld(this,Jd(this,a,5),b),this.C--):this.w.rb(a,b)};h.Eb=function(a,b){this.Ja?(this.C++,this.gc(Jd(this,a,4),b),this.C--):this.w.Eb(a,b)};h.mc=function(a,b,c){return Md(this,a,b,c)};h.nc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ac=function(a){return this.w.ka(a)};h.$c=function(a){return this.w.ka(Jd(this,a,2))};h.gc=function(a,b){this.w.Sa(a,b&65535)}; -h.Md=function(a,b){this.w.Sa(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ra(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.ta[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.La=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.ta[a.L>>12&3]=d} -function Pd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.ka(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ka(a.Y(b,c,2)):a.u[c]} -function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Ta=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Sa(e,d.call(a,c,a.w.ka(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Sa(a.Y(b,d,4),c):a.u[d]=c&65535;return c} -function S(a,b,c){c&&(Bd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.fb=function(a){this.v.complete=!0;var b=this.v.kc=this.i&&Wd(this.i),c=a?this.v.Nb?0:1:-1;this.v.Nb=!1;this.ba=this.b=a;do{if(b){if(Xd(this.i,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Mb&224)>>5;if(a=this.U&&this.U.ab>e?this.U:null)d=a.fd,e=a.ab;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1; -if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.La=0,this.qb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Ad(this))}while(0>2;this.w=this.ua-1;this.D=this.H/this.ua|0;this.Ha=[];this.C=0;this.B=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&G(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&G(this.i,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function Qb(a,b){var c=-1,d=this.controller;(a=d.Ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&G(this.i,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&G(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&G(this.i,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&G(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ha;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.vb+=m.A-f,m.A=f,!0;if(f>=m.A+m.vb){q=m.size-(f-p);q>g&&(q=g);m.vb=f-m.A+q;f=p+a.ua;g-=q;l++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.W[l++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ha;0>>=a.ha;0>>this.ha].Eb(a&this.w,a)};h.Bb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ha].Mb(a&this.w,a);this.C--;return a};h.ma=function(a){return this.W[(a&this.f)>>>this.ha].ta(a&this.w,a)}; +h.pb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ha;this.C++;a=this.W[c].Nb(b,a);this.C--;return a};h.Fb=function(a,b){this.W[(a&this.f)>>>this.ha].Hb(a&this.w,b&255,a)};h.gb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ha].Sb(a&this.w,b&255,a);this.C--};h.Ta=function(a,b){this.W[(a&this.f)>>>this.ha].wb(a&this.w,b&65535,a)};h.Gb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ha;this.C++;this.W[d].Tb(c,b&65535,a);this.C--}; +function cc(a){for(var b=0,c=[],d=0;da.b.$a)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));lc(a,e,e,g,l,m,p,f[4])}}}function nc(a,b){a.B.push(b)} +function oc(a,b){a.C||(a.i&&G(a.i,536870912)&&E(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Db:20,gd:0};this.f={Td:0,Rb:-1}}u(K);h=K.prototype; +h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Rb=pc(c,function(){e.f.Ja|=128;e.f.Ja&64&&(qc(e.b,e.f.hd),rc(e.b,e.f.Rb,1E3/60))});this.f.hd=sc(64,6);mc(b,this,L);nc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Db=this.g.Db&-120|20;this.f.Ja=0};h.Dc=function(){var a=this.f.Ja;this.f.Ja&=-129;return a};h.rd=function(a){this.f.Ja=a;a&64&&rc(this.b,this.f.Rb,1E3/60);this.f.Ja=a&-129};h.wc=function(a){return(a?this.g.gd:this.g.data)&65535}; +h.kd=function(a){this.g.data=a};h.Fc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.td=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ka!=c&&(b.Ka=c,tc(b))}uc(this)};h.Gc=function(){var a=this.b.Ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hc=function(){return this.b.tb};h.Ic=function(){return this.b.Na}; +h.ud=function(a){var b=this.b;1170>b.$a&&(a&=-49);b.Na!=a&&(b.Na=a,a&16?(b.Ya=4194303,b.ya=3915776):(b.Ya=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.Ka?a.b.Na&16?1:2:4)}h.Wc=function(a){return this.b.P[1][a>>1&7]};h.Id=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.P[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.sa[1][a>>1&7]}; +h.Hd=function(a,b){b=b>>1&7;this.b.sa[1][b]=a;this.b.P[1][b]&=65295};h.Tc=function(a){return this.b.sa[1][(a>>1&7)+8]};h.Fd=function(a,b){b=(b>>1&7)+8;this.b.sa[1][b]=a;this.b.P[1][b]&=65295};h.Cc=function(a){return this.b.P[0][a>>1&7]};h.qd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.Ac=function(a){return this.b.P[0][(a>>1&7)+8]};h.od=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.Bc=function(a){return this.b.sa[0][a>>1&7]};h.pd=function(a,b){b=b>>1&7;this.b.sa[0][b]=a;this.b.P[0][b]&=65295}; +h.zc=function(a){return this.b.sa[0][(a>>1&7)+8]};h.nd=function(a,b){b=(b>>1&7)+8;this.b.sa[0][b]=a;this.b.P[0][b]&=65295};h.bd=function(a){return this.b.P[3][a>>1&7]};h.Od=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.$c=function(a){return this.b.P[3][(a>>1&7)+8]};h.Md=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.b.sa[3][a>>1&7]};h.Nd=function(a,b){b=b>>1&7;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.Zc=function(a){return this.b.sa[3][(a>>1&7)+8]}; +h.Ld=function(a,b){b=(b>>1&7)+8;this.b.sa[3][b]=a;this.b.P[3][b]&=65295};h.eb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.jb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.fb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; +h.kb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};h.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};h.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};h.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};h.yc=function(a){return this.b.gc[a-65504>>1]};h.md=function(a,b){this.b.gc[b-65504>>1]=a};h.dc=function(a){return 65520==a?61183:0};h.jc=function(){}; +h.Yc=function(){return 1};h.Kd=function(){};h.xc=function(){return this.b.Z};h.ld=function(){this.b.Z=0};h.Ec=function(){return this.b.fc};h.sd=function(a,b){b&1||(a&=255);this.b.fc=a};h.Jc=function(a){return a?this.b.Pb:0};h.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Pb=a;b.F|=2};h.Xc=function(a){return a?this.b.Oa&65280:0};h.Jd=function(a){this.b.Oa=a|255};h.Mc=function(){return Lb(this.b)};h.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.F|=128}; +h.ic=function(a,b){G(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +var M={},L=(M[62592]=[null,null,K.prototype.Wc,K.prototype.Id,"SISDR",1145],M[62608]=[null,null,K.prototype.Uc,K.prototype.Gd,"SDSDR",1145],M[62624]=[null,null,K.prototype.Vc,K.prototype.Hd,"SISAR",1145],M[62640]=[null,null,K.prototype.Tc,K.prototype.Fd,"SDSAR",1145],M[62656]=[null,null,K.prototype.Cc,K.prototype.qd,"KISDR",1145],M[62672]=[null,null,K.prototype.Ac,K.prototype.od,"KDSDR",1145],M[62688]=[null,null,K.prototype.Bc,K.prototype.pd,"KISAR",1145],M[62704]=[null,null,K.prototype.zc,K.prototype.nd, +"KDSAR",1145],M[62798]=[null,null,K.prototype.Ic,K.prototype.ud,"MMR3",1145],M[65382]=[null,null,K.prototype.Dc,K.prototype.rd,"LKS"],M[65400]=[null,null,K.prototype.wc,K.prototype.kd,"CNSL"],M[65402]=[null,null,K.prototype.Fc,K.prototype.td,"MMR0",1145],M[65404]=[null,null,K.prototype.Gc,K.prototype.ic,"MMR1",1145],M[65406]=[null,null,K.prototype.Hc,K.prototype.ic,"MMR2",1145],M[65408]=[null,null,K.prototype.bd,K.prototype.Od,"UISDR",1145],M[65424]=[null,null,K.prototype.$c,K.prototype.Md,"UDSDR", +1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.eb,K.prototype.jb,"R0SET0"],M[65473]=[null,null,K.prototype.eb,K.prototype.jb,"R1SET0"],M[65474]=[null,null,K.prototype.eb,K.prototype.jb,"R2SET0"],M[65475]=[null,null,K.prototype.eb,K.prototype.jb,"R3SET0"],M[65476]=[null,null,K.prototype.eb,K.prototype.jb,"R4SET0"],M[65477]=[null,null,K.prototype.eb,K.prototype.jb,"R5SET0"],M[65478]= +[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.fb,K.prototype.kb,"R0SET1",1145],M[65481]=[null,null,K.prototype.fb,K.prototype.kb,"R1SET1",1145],M[65482]=[null,null,K.prototype.fb,K.prototype.kb,"R2SET1",1145],M[65483]=[null,null,K.prototype.fb,K.prototype.kb,"R3SET1",1145],M[65484]=[null,null,K.prototype.fb,K.prototype.kb,"R4SET1",1145],M[65485]=[null,null,K.prototype.fb,K.prototype.kb,"R5SET1",1145], +M[65486]=[null,null,K.prototype.Oc,K.prototype.Ad,"R6SUPER",1145],M[65487]=[null,null,K.prototype.Pc,K.prototype.Bd,"R6USER",1145],M[65504]=[null,null,K.prototype.yc,K.prototype.md,"CTRL",1170],M[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1170],M[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Yc,K.prototype.Kd,"SYSID",1170],M[65526]=[null,null,K.prototype.xc,K.prototype.ld,"CPUERR",1170],M[65528]=[null,null,K.prototype.Ec,K.prototype.sd, +"MB",1170],M[65530]=[null,null,K.prototype.Jc,K.prototype.vd,"PIR"],M[65532]=[null,null,K.prototype.Xc,K.prototype.Jd,"SL"],M[65534]=[null,null,K.prototype.Mc,K.prototype.yd,"PSW"],M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624]; +L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688]; +L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440]; +L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456];L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];Ta(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),Dc(this,zc?Ec:Fc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&oc(this.w,b);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},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]= +this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ia=!0},T:function(a,b){if(this.i&&null!=this.A){var c=this.i;Kc(c,this.A+a,1,c.M)&&c.da(!0)}return this.Mb(a,b)},ba:function(a,b){if(this.i&&null!=this.A){var c=this.i;Kc(c,this.A+a,2,c.M)&&c.da(!0)}return this.Nb(a,b)},oa:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Kc(d,this.A+a, +1,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Sb(a,b,c)},ya:function(a,b,c){if(this.i&&null!=this.A){var d=this.i;Kc(d,this.A+a,2,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Tb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&G(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&oc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&oc(this.w,b);a=this.I[a>>1];this.i&&G(this.i,128)&&E(this.i,"Memory.readWord("+ +J(this.i,b)+"): "+J(this.i,a),!0);return a},na:function(a,b){this.D[a]=b;this.Ia=!0},ra:function(a,b,c){this.D[a]=b;this.Ia=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},xa:function(a,b,c){a&1&&oc(this.w,c);this.G.setUint16(a,b,!0);this.Ia=!0},Ua:function(a,b,c){a&1&&oc(this.w,c);this.I[a>>1]=b;this.Ia=!0;this.i&&G(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; +function Sb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.B=c.B)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.B||(a.Hb=a.f?a.J:a.Sb,a.wb=a.f?a.H:a.Tb):--a.g||(a.Eb=a.Mb,a.ta=a.Nb)}function Hc(a,b,c){c&&a.B||(a.Hb=!a.f&&b[1]||a.J,a.wb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Sb=b[1]||a.J,a.Tb=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Eb=b[0]||a.K,a.ta=b[2]||a.M);if(c||void 0===c)a.Mb=b[0]||a.K,a.Nb=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)} +var Mc=[],Gc=[I.prototype.V,I.prototype.wa,I.prototype.la,I.prototype.Va],Ic=[I.prototype.T,I.prototype.oa,I.prototype.ba,I.prototype.ya];if(sb)var Fc=[I.prototype.R,I.prototype.na,I.prototype.aa,I.prototype.xa],Ec=[I.prototype.U,I.prototype.ra,I.prototype.fa,I.prototype.Ua]; +function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.La=c;this.Xa=Math.round(this.Ga/1E4)/100;this.Sa=this.Xa*this.La;this.v.ca=!1;this.v.Qb=!1;this.v.lb=a.autoStart;this.v.Za=!1;this.qb=this.la=0;this.rb=a.csStart;this.ab=a.csInterval;this.bb=a.csStop;this.K=[];this.bc=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];h=Nc.prototype; +h.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.la&&(a.la+=a.ab,c=!0);0<=a.bb&&a.bb<=Uc(a)&&(a.ab=a.bb=-1,Rc(a),a.da(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+k(a.qb))}} +h.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ia)a=!0;else{var b=null,c,l=kb(a.id);for(c=0;ca.V/a.Sa?b=1:d=!0;a.La=b;b=a.Xa*a.La;if(a.Sa!=b){a.Sa=b;b=a.Sa.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.ub()}Wc(a,a.T);a.T=0;a.R=za();a.aa=0;Xc(a);return d}function pc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function rc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Ga*a.La/1E3*c|0,a.K[b][0]=c+Yc(a))} +function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function $c(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Yc(a,b){var c=a.ba-=a.b;a.b=0;b&&(a.ba=0);return c} +h.fd=function(){if(this.v.ca){this.nb>=this.Ga&&Xc(this,!0);this.ra=0;this.Fa=za();if(this.aa){var a=this.Fa-this.aa;a>this.Ab&&(this.R+=a,this.R>this.Fa&&(this.R=this.Fa))}try{do{var b=Zc(this,this.v.Za?1:this.Pa);try{this.ib(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.ra+=b;this.T+=b;Tc(this,b);$c(this,b);this.na-=b;if(0>=this.na){this.na+=this.Pa;15<=++this.Cb&&(this.B&&this.B.$(),this.Cb=0);break}}while(this.v.ca)}catch(e){this.da();this.B&&this.B.stop(za(),Uc(this));rb(this, +e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.bc;this.aa=za();var c=this.Ab;this.ra&&(c=Math.round(c*this.ra/this.Pa));var c=c-(this.aa-this.Fa),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.nb+=this.ra;this.aa+=c;a(b,c)}}}; +h.hb=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ca=!0;this.v.Qb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.ub(!0),this.B.start(this.R,Uc(this)));setTimeout(this.bc,0);return!0};h.ib=function(){return 0};h.da=function(a){if(this.v.ca){Yc(this);Wc(this,this.T);this.T=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(za(),Uc(this))}this.v.complete=a}; +function ad(a){this.$a=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.$a?ud.bind(this):vd.bind(this);wd(this);this.C=0;this.U=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.$a);this.v.ca&&this.da();wd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; +function wd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.D=0;a.xa=0;a.sc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.sa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.F=0;a.H=a.I=0;a.g=a.f=a.Wa=0;a.oa=-1;xd(a)}function xd(a){a.Oa=255;a.Z=0;a.Pb=0;a.G=0;a.Ma=0;a.tb=0;a.Na=0;a.Ka=0;a.wa=0;a.Ya=262143;a.ya=253952;a.F|=2;a.w&&tc(a)}function tc(a){a.Ka?(a.M=65536,a.Y=a.rc,a.ta=a.cd,a.wb=a.Pd,Vb(a.w,a.Na&16?22:18)):(a.M=0,a.Y=a.qc,a.ta=a.ec,a.wb=a.kc,Vb(a.w,16))}h.Zb=function(){return 0}; +h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.La]);a.set(2,cc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.D!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function Cd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function Dd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function Ed(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function Fd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))} +h.ea=function(a,b){if(!this.C){var c=!1;0>this.oa?this.oa=Lb(this):this.D||(a=4,c=!0);this.G&57344||(this.Ma=63222,this.tb=a);this.D=0;var d=this.ta(a|this.M),e=this.ta(a+2&65535|this.M);vc(this,e&-12289|this.oa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.oa);Gd(this,this.u[7]);O(this,d);this.F&=-113;this.oa=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.F&=-17} +function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Na&a.sc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.sa[a.D][d]<<6)+(b&8191)&a.Ya;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Na&32&&(f=a.uc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? +192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.wa=a.D,a.xa=d;g&&(g&57344&&(0<=a.oa&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ta(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ta(e)|g; +a.b-=8;break;case 6:return e=Bd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Bd(a),e=e+a.u[c]&65535,e=a.ta(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Ma=a.Ma<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Oa||65534<=a.u[6])&&(a.u[6]<=a.Oa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.Bb=function(a){if(!this.Ka)return this.w.Bb(a);this.C++;a=Kd(this,Jd(this,a,3));this.C--;return a}; +h.pb=function(a){if(!this.Ka)return this.w.pb(a);this.C++;a=this.ec(Jd(this,a,2));this.C--;return a};h.gb=function(a,b){this.Ka?(this.C++,Ld(this,Jd(this,a,5),b),this.C--):this.w.gb(a,b)};h.Gb=function(a,b){this.Ka?(this.C++,this.kc(Jd(this,a,4),b),this.C--):this.w.Gb(a,b)};h.qc=function(a,b,c){return Md(this,a,b,c)};h.rc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ec=function(a){return this.w.ma(a)};h.cd=function(a){return this.w.ma(Jd(this,a,2))};h.kc=function(a,b){this.w.Ta(a,b&65535)}; +h.Pd=function(a,b){this.w.Ta(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ta(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.Ma=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Ta(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d} +function Pd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.ma(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ma(a.Y(b,c,2)):a.u[c]} +function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Wa=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Ta(e,d.call(a,c,a.w.ma(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Ta(a.Y(b,d,4),c):a.u[d]=c&65535;return c} +function S(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +h.ib=function(a){this.v.complete=!0;var b=this.v.oc=this.i&&Wd(this.i),c=a?this.v.Qb?0:1:-1;this.v.Qb=!1;this.ba=this.b=a;do{if(b){if(Xd(this.i,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Pb&224)>>5;if(a=this.U&&this.U.cb>e?this.U:null)d=a.jd,e=a.cb;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1; +if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.Ma=0,this.tb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Bd(this))}while(0>1|b<<16;Ed(this,a);return a&65535}function ce(a,b){a=b&2048|b>>1|b<<8;Ed(this,a<<8);return a&255}function de(a,b){a=b&~a;P(this,a);return a}function ee(a,b){a=b&~a;P(this,a<<8);return a}function fe(a,b){a|=b;P(this,a);return a}function ge(a,b){a|=b;P(this,a<<8);return a} function he(a,b){a=~b|65536;Cd(this,a);return a&65535}function ie(a,b){a=~b|256;Cd(this,a<<8);return a&255}function je(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function ke(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function le(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function me(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255} function ne(a,b){a=-b;Cd(this,a,a&b&32768);return a&65535}function oe(a,b){a=-b;Cd(this,a<<8,(a&b&128)<<8);return a&255}function pe(a,b){a=b<<1|this.N>>16&1;Ed(this,a);return a&65535}function qe(a,b){a=b<<1|this.N>>16&1;Ed(this,a<<8);return a&255}function re(a,b){a=(this.N&65536|b)>>1|b<<16;Ed(this,a);return a&65535}function se(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;Ed(this,a<<8);return a&255}function te(a,b){var c=b-a;Fd(this,c,a,b);return c&65535} function ue(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function ve(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function we(a,b){a^=b;P(this,a);return a&65535}function xe(a){R(this,a,Qd(this,a),Yd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function ye(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.g?6:7)+b} -function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ae(a){S(this,a,!xd(this))}function Be(a){S(this,a,xd(this))} +function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ae(a){S(this,a,!yd(this))}function Be(a){S(this,a,yd(this))} function Ce(a){R(this,a,Qd(this,a),de);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){Q(this,a,Pd(this,a),ee);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){R(this,a,Qd(this,a),fe);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Pd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,zd(this))}function Je(a){S(this,a,!this.Da()==!yd(this))}function Ke(a){S(this,a,!zd(this)&&!this.Da()==!yd(this))}function Le(a){S(this,a,!xd(this)&&!zd(this))}function Me(a){S(this,a,zd(this)||!this.Da()!=!yd(this))} -function Ne(a){S(this,a,xd(this)||zd(this))}function Oe(a){S(this,a,!this.Da()!=!yd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!zd(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!yd(this))}function Ve(a){S(this,a,yd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} +function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,Ad(this))}function Je(a){S(this,a,!this.Da()==!zd(this))}function Ke(a){S(this,a,!Ad(this)&&!this.Da()==!zd(this))}function Le(a){S(this,a,!yd(this)&&!Ad(this))}function Me(a){S(this,a,Ad(this)||!this.Da()!=!zd(this))} +function Ne(a){S(this,a,yd(this)||Ad(this))}function Oe(a){S(this,a,!this.Da()!=!zd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!Ad(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!zd(this))}function Ve(a){S(this,a,zd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} function We(a){var b=Qd(this,a);a=Td(this,a);Fd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Xe(a){var b=Pd(this,a)<<8;a=Sd(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} function Ye(a){var b=Td(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}function Ze(){this.ea(24,2);this.b-=25}function $e(){this.L&49152?(this.Z|=128,this.ea(4,3)):this.da();this.b-=7} -function af(){this.ea(16,4);this.b-=25}var bf=[0,7,7,10,7,11,9,13];function cf(a){var b=this.b;Bd(this,Rd(this,a));this.b=b-bf[this.g]}var df=[0,14,14,17,14,18,16,20];function ef(a){var b=this.b,c=Rd(this,a);a=a>>6&7;Gd(this,this.u[a]);this.u[a]=this.u[7];Bd(this,c);this.b=b-df[this.g]}var ff=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function gf(a){var b=Qd(this,a),c=this.b;P(this,Vd(this,a,b));this.b=c-ff[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)} -function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)Bd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function rf(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+K(b,a),!0,!0),b=Zb(b);b||this.ea(8,6)}function ad(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)} -function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a&15].call(this,a)}function Xf(a){Yf[a&15].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)} +function af(){this.ea(16,4);this.b-=25}var bf=[0,7,7,10,7,11,9,13];function cf(a){var b=this.b;O(this,Rd(this,a));this.b=b-bf[this.g]}var df=[0,14,14,17,14,18,16,20];function ef(a){var b=this.b,c=Rd(this,a);a=a>>6&7;Gd(this,this.u[a]);this.u[a]=this.u[7];O(this,c);this.b=b-df[this.g]}var ff=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function gf(a){var b=Qd(this,a),c=this.b;P(this,Vd(this,a,b));this.b=c-ff[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)} +function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function rf(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function ud(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)} +function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a&15].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)} var vf=[function(a){eg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,V,function(a){fg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],eg=[function(a){gg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,V,V,V],xf=[function(a){Cd(this,Vd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,je);this.b-=this.g?9:3+(7==this.f?2:0)}],zf=[function(a){R(this,a,0, -ne);this.b-=this.g?11:6},function(a){R(this,a,xd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,xd(this)?1:0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}], -gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Xf,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Df=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Yf=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Zf,ag,cg,V,V,V],$f=[function(a){Cd(this, -Ud(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){Q(this,a,0,oe);this.b-=this.g?11:6},function(a){Q(this,a,xd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,xd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7== -this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.g?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function ud(a){ig[a>>12].call(this,a)} -var ig=[function(a){jg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],jg=[function(a){mg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,function(a){ng[a>>6&3].call(this,a)},V,V],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.M);Bd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Nd(this,a,0);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c= -this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.g]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Xf,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Zf,ag,cg,function(a){pg[a>>6&3].call(this, -a)},V,V],pg=[V,function(a){a=Nd(this,a,65536);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c=this.b;Od(this,a,65536,b);P(this,b);this.b=c-jf[this.g]},V];function qg(a){r.call(this,"ROM",a,qg);this.f=null;this.D=a.addr;this.g=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=pa(this.C);if(this.C){a=this.C;var b=qa(this.H);"json"!=b&&"hex"!=b&&(a=sa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Fa(a,null,!0,function(a,b,f){rg(c,a,b,f)})}}u(qg); -qg.prototype.Ba=function(a,b,c,d){this.w=b;this.b=c;this.i=d;sg(this)};qg.prototype.ya=function(){if(this.Ca){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.g,e=this.Ca,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=za(q,m,a.Sb);0>v&&q.splice(-(v+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Rd:b,A:c,sc:d,Ca:e,Rb:f})}delete this.Ca}return!0};qg.prototype.xa=function(){return!0}; -function rg(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{jb(a.Gb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Ca=l.symbols;if(!a.f.length){n("Empty ROM: "+ -b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=xa(b[0]);if(c!=this.Ua)return;b=xa(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Gb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ya=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.xa=function(a){return a?this.save():!0};h.reset=function(){xg(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return xg(this)};function xg(a){a.R=0;a.f=0;a.g=128;a.D=[];return!0}h.Lb=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=va("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G), -this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;qc(this.b,this.V,1)}};var yg={},wg=(yg[65392]=[null,null,Y.prototype.Pc,Y.prototype.Bd,"RCSR"],yg[65394]=[null,null,Y.prototype.Oc,Y.prototype.Ad,"RBUF"],yg[65396]=[null,null,Y.prototype.bd,Y.prototype.Od,"XCSR"],yg[65398]=[null,null,Y.prototype.ad,Y.prototype.Nd,"XBUF"],yg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Bg.prototype.Xb=function(){return-1};Bg.prototype.Yb=function(){}; -function Dg(a,b,c,d){if(c)if(b){0>a.C&&a.g.length&&(a.C=0);if(0>a.C||b!=a.g[a.C])a.g.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.g[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} +ne);this.b-=this.g?11:6},function(a){R(this,a,yd(this)?1:0,Yd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,yd(this)?1:0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.g?9:3+(7==this.f?2:0)}], +gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Ef,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Df=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Ff=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,ag,cg,V,V,V],$f=[function(a){Cd(this, +Ud(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){Q(this,a,0,oe);this.b-=this.g?11:6},function(a){Q(this,a,yd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,yd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.g?4:3+(7== +this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.g?9+(this.Wa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9+(this.Wa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}];function vd(a){ig[a>>12].call(this,a)} +var ig=[function(a){jg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],jg=[function(a){mg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,function(a){ng[a>>6&3].call(this,a)},V,V],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ta(a|this.M);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Nd(this,a,0);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c= +this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.g]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Ef,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Gf,ag,cg,function(a){pg[a>>6&3].call(this, +a)},V,V],pg=[V,function(a){a=Nd(this,a,65536);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c=this.b;Od(this,a,65536,b);P(this,b);this.b=c-jf[this.g]},V]; +function qg(a){r.call(this,"ROM",a,qg);this.ja=this.f=null;this.D=a.addr;this.g=a.size;this.C=a.alias;this.B=a.file;this.G=oa(this.B);if(this.B){a=this.B;var b=pa(this.G);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.pa("Unable to load ROM resource (error "+f+": "+a+")"):(jb(c.Va,a,b),(a=Fa(a,b))?(c.f=a.ga,c.ja=a.ja):c.B=null,rg(c))})}}u(qg);qg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)}; +qg.prototype.Aa=function(){if(this.ja){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.g,e=this.ja,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=ya(q,m,a.Vb);0>v&&q.splice(-(v+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Ud:b,A:c,vc:d,ja:e,Ub:f})}delete this.ja}return!0};qg.prototype.za=function(){return!0}; +function rg(a){if(!pb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)rb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.g,8,!0)+")");else{var b;b=a.D;if(Yb(a.w,b,a.g,Cc)){var c;for(c=0;c=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=va(b[0]);if(c!=this.Ua)return;b=va(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Va+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.za=function(a){return a?this.save():!0};h.reset=function(){xg(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return xg(this)};function xg(a){a.R=0;a.f=0;a.g=128;a.D=[];return!0}h.Ob=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G), +this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;rc(this.b,this.V,1)}};var yg={},wg=(yg[65392]=[null,null,X.prototype.Sc,X.prototype.Ed,"RCSR"],yg[65394]=[null,null,X.prototype.Rc,X.prototype.Dd,"RBUF"],yg[65396]=[null,null,X.prototype.ed,X.prototype.Rd,"XCSR"],yg[65398]=[null,null,X.prototype.dd,X.prototype.Qd,"XBUF"],yg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Bg.prototype.$b=function(){return-1};Bg.prototype.ac=function(){}; +function Dg(a,b,c,d){if(c)if(b){0>a.C&&a.g.length&&(a.C=0);if(0>a.C||b!=a.g[a.C])a.g.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.g[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a} function Eg(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function Fg(a,b,c){var d;if(b){b=Gg(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+oa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Jg(a,b){if(b)return Ig(a,b,a.aa[b]);var c=0;for(b in a.aa)Ig(a,b,a.aa[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Jg(a,b){if(b)return Ig(a,b,a.aa[b]);var c=0;for(b in a.aa)Ig(a,b,a.aa[b]),c++;return 0this.b.Ya?Sg:[];Tg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Ug(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ga;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=ac[c],q&&d.j(k(q.id,8)+" %"+k(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Yb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.ta[a-16]:20==a&&(b=Kb(this.b)));return b}; -h.message=function(a,b){b&&(a+=" @"+K(this,Z(this.b.qb).A));this.ia&1073741824?this.ua.push(a):this.pa&&a==this.pa||(this.pa=a,this.ia&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Xc(a),a.la=0,a.B.$()))}; -function Mg(a){var b;if(Wd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.ga],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ga],!0);a.D=["bw"];a.Ta=0} -h.Pa=function(a,b,c){var d=!0;c||dh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+K(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.ga].Pa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Aa=!0:(eh(this,a,a.length-1,"set"),Mg(this)));return d};function dh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ga],b==a.D));l.Aa||Mg(a);break}}return f} -function fh(a,b){for(var c=1;c>23)&65535,y=K(x,w);else if(8192==D)w=w.A-((f&63)<<1)&65535,y=K(x,w);else if(12288==D)y=K(x,f&7,1);else if(24576==D)y=K(x,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:y= -Zg(C);break;case 8:y="@"+Zg(C);break;case 16:7>C?y="("+Zg(C)+")+":(D=x.ka(w,2),y="#"+K(x,D,0,!0));break;case 24:7>C?y="@("+Zg(C)+")+":(D=x.ka(w,2),y="@#"+K(x,D,0,!0));break;case 32:y="-("+Zg(C)+")";break;case 40:y="@-("+Zg(C)+")";break;case 48:D=x.ka(w,2);y=K(x,D,0,!0)+"("+Zg(C)+")";7==C&&(y=[y,K(x,D+w.A&65535)]);break;case 56:D=x.ka(w,2),y="@"+K(x,D)+"("+Zg(C)+")",7==C&&(y=[y,K(x,D+w.A&65535)])}x=y;if(!x||!x.length){l="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=Zg(b),c+="="+K(a,d.u[b])):13>b?c="A"+(b-8)+"="+K(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+K(a,d.ta[b-16]):20==b&&(c="PS="+K(a,Kb(d)));c&&(c+=" ");return c}function kh(a){var b,c="";for(b=0;6>b;b++)c+=jh(a,b);c=c+"\n"+(jh(a,6)+jh(a,7)+jh(a,20));return c+=ih(a,"T")+ih(a,"N")+ih(a,"Z")+ih(a,"V")+ih(a,"C")}h.Sb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.sc;if(e>=g&&ethis.b.$a?Sg:[];Tg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Ug(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ha;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(k(q.id,8)+" %"+k(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b}; +h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.tb).A));this.ka&1073741824?this.wa.push(a):this.ra&&a==this.ra||(this.ra=a,this.ka&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.na=0,a.B.$()))}; +function Mg(a){var b;if(Wd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.ha],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ha],!0);a.D=["bw"];a.Wa=0} +h.Qa=function(a,b,c){var d=!0;c||dh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.ha].Qa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Ba=!0:(eh(this,a,a.length-1,"set"),Mg(this)));return d};function dh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ha],b==a.D));l.Ba||Mg(a);break}}return f} +function fh(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==D)w=w.A-((f&63)<<1)&65535,y=J(x,w);else if(12288==D)y=J(x,f&7,1);else if(24576==D)y=J(x,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:y= +Zg(C);break;case 8:y="@"+Zg(C);break;case 16:7>C?y="("+Zg(C)+")+":(D=x.ma(w,2),y="#"+J(x,D,0,!0));break;case 24:7>C?y="@("+Zg(C)+")+":(D=x.ma(w,2),y="@#"+J(x,D,0,!0));break;case 32:y="-("+Zg(C)+")";break;case 40:y="@-("+Zg(C)+")";break;case 48:D=x.ma(w,2);y=J(x,D,0,!0)+"("+Zg(C)+")";7==C&&(y=[y,J(x,D+w.A&65535)]);break;case 56:D=x.ma(w,2),y="@"+J(x,D)+"("+Zg(C)+")",7==C&&(y=[y,J(x,D+w.A&65535)])}x=y;if(!x||!x.length){l="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=Zg(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function kh(a){var b,c="";for(b=0;6>b;b++)c+=jh(a,b);c=c+"\n"+(jh(a,6)+jh(a,7)+jh(a,20));return c+=ih(a,"T")+ih(a,"N")+ih(a,"Z")+ih(a,"V")+ih(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.$();a.j("updated registers:")}a.j(kh(a));c&&(a.K=Z(d.u[7]),bh(a,K(a,a.K.A)))}}function ph(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.$();a.j("updated registers:")}a.j(kh(a));c&&(a.K=Z(d.u[7]),bh(a,J(a,a.K.A)))}}function ph(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.j(p)}l[3]&&(g=l[3],f=null);f=hh(a,b,g,f);a.j(f);a.K=b;e-=b.A-m;c++}}} -function gh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.U&&(a.j("ended assemble at "+K(a,a.T.A)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.pa=null;if(pb(a)&&0q||"z"ia.length&&(a.j("note: only "+ia.length+" available"),X=ia.length);ca-=X;0>ca&&(null==ia[ia.length-1].A?(X=ca+X,ca=0):ca+=ia.length);var ed=[];"call"==Jf&&(tb=1E5,ed=["CALL"]);for(void 0!==If&&a.j(X+" instructions earlier:");0=ia.length&&(ca=0);a.Va=X;Lf++;tb--}}Lf||(a.j("no "+Kf+"history available"),a.Va=void 0)}else{var vb=Ug(a,ha);if(vb){var cc=0;Da&&("l"==Da.charAt(0)&&(Da=Da.substr(1)||Jh),cc=Hg(a,Da)>>>0,65536>4||1;Lh--&&0fc?String.fromCharCode(fc):".";dc--}wb&&(wb+="\n");wb+=ha+" "+fd+(0==yb?" "+Of:"")}wb&&a.j(wb);a.Oa=vb}}}}break;case "e":if("else"==g[0])break;var $a,hd,id,jd,kd=g[0],ld=g[1];"eb"==kd?($a=1,hd=255,id=a.lb,jd=a.Db):"e"==kd||"ew"==kd?($a=2,hd=65535,id=a.ka,jd=a.Sa):ld=null;if(null==ld)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var gc=Ug(a,ld);if(gc)for(var hc=2;hc< -g.length;hc++){var zb=Fg(a,g[hc]);if(void 0===zb){a.j("unrecognized value: "+g[hc]);break}zb&~hd&&a.j("warning: "+k(zb)+" exceeds "+$a+"-byte value");var Mh=id.call(a,gc);a.j("changing "+K(a,gc.A)+" from "+K(a,Mh,$a)+" to "+K(a,zb,$a));jd.call(a,gc,zb,$a)}}break;case "g":a:{var Pf=g[1],Nh=b;if(void 0!==Pf){var md=Ug(a,Pf,!0);if(!md)break a;Yg(a,md,Nh);a.Pa(a.f,md,!0)}a.eb(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var nd; -var Ab=b.substr(2),Ab=xa(Ab);Fg(a,Ab)?(c||a.j("true: "+Ab),nd=!0):(c||a.j("false: "+Ab),nd=!1);nd||(d=!1);break}f=!0;break;case "k":var Oh=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var od=0,pd=Z(),Bb=Z(a.b.u[6]);for(a.j("stack trace for "+K(a,Bb.A));10>od;){for(var Ea=null,Ph=256;65536>Bb.A>>>0;){pd.A=a.ka(Bb,2);if(null==Bb.A||!Ph--)break;if(!(pd.A&1)){for(var Qh=a,ic=pd,Qf=null,Cb=ic.A,Rf=Cb,qd=1;6>=qd&&Cb;qd++){if(2< -qd){ic.A=Cb;var jc=hh(Qh,ic);if(0<=jc.indexOf("JSR")){var Sf=jc.indexOf(" ");if(Cb+(jc.indexOf(" ",Sf+1)-Sf-1)/2==Rf){Qf=jc;break}}}Cb-=2}ic.A=Rf;if(Ea=Qf)break}}if(!Ea||null==Ea)break;var Tf=null;if("ks"==Oh){var Uf=Ea.match(/[0-9A-F]+$/);Uf&&(Tf=oh(a,Uf[0]))}Ea=va(Ea,50)+" ;"+(Tf||"stack="+K(a,Bb.A));a.j(Ea);od++}od||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){oh(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var wa=0;if("all"== -F)wa=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in I)if(F==ja){wa=I[ja];ka=!!(a.ia&wa);break}if(!wa){a.j("unknown message category: "+F);break a}}if(wa)if("on"==g[2])a.ia|=wa,ka=!0;else if("off"==g[2]&&(a.ia&=~wa,ka=!1,1073741824==wa)){for(var rd=0;rd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;buh){if(wh(d,this.I)){this.D=new O(this,"1.30.1","failsafe");wh(this.D)&&(Bh(this,d),a=2,Ch(this.D));this.D.set("timestamp",Ba());Dh(this.D);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ah(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?wh(d,g):("error"== -f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Ch(d),wh(d)?(c=Ah(d),e=!0):c=!1))}e&&zh(this,c?d:null)}else 2==a&&d.clear()}else zh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Eh(this,this.b,b,c,a),this.b.ib());this.T&&(Bh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; -function Bh(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Fa("http://www.pcjs.org/api/v1/report",d,!0)}} -function rh(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),l=Ba();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.xa&&(c&&a.b.da(),d=a.b.xa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var l=kb(a.id),m=0;m> "+b):(a.U&&(a.j("ended assemble at "+J(a,a.T.A)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ra=null;if(pb(a)&&0q||"z"ia.length&&(a.j("note: only "+ia.length+" available"),Y=ia.length);ca-=Y;0>ca&&(null==ia[ia.length-1].A?(Y=ca+Y,ca=0):ca+=ia.length);var ed=[];"call"==Mf&&(tb=1E5,ed=["CALL"]);for(void 0!==Lf&&a.j(Y+" instructions earlier:");0=ia.length&&(ca=0);a.Xa=Y;Of++;tb--}}Of||(a.j("no "+Nf+"history available"),a.Xa=void 0)}else{var vb=Ug(a,ha);if(vb){var dc=0;Da&&("l"==Da.charAt(0)&&(Da=Da.substr(1)||Jh),dc=Hg(a,Da)>>>0,65536>4||1;Lh--&&0gc?String.fromCharCode(gc):".";ec--}wb&&(wb+="\n");wb+=ha+" "+fd+(0==yb?" "+Rf:"")}wb&&a.j(wb);a.Pa=vb}}}}break;case "e":if("else"==g[0])break;var bb,hd,id,jd,kd=g[0],ld=g[1];"eb"==kd?(bb=1,hd=255,id=a.ob,jd=a.Fb):"e"==kd||"ew"==kd?(bb=2,hd=65535,id=a.ma,jd=a.Ta):ld=null;if(null==ld)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var hc=Ug(a,ld);if(hc)for(var ic=2;ic< +g.length;ic++){var zb=Fg(a,g[ic]);if(void 0===zb){a.j("unrecognized value: "+g[ic]);break}zb&~hd&&a.j("warning: "+k(zb)+" exceeds "+bb+"-byte value");var Mh=id.call(a,hc);a.j("changing "+J(a,hc.A)+" from "+J(a,Mh,bb)+" to "+J(a,zb,bb));jd.call(a,hc,zb,bb)}}break;case "g":a:{var Sf=g[1],Nh=b;if(void 0!==Sf){var md=Ug(a,Sf,!0);if(!md)break a;Yg(a,md,Nh);a.Qa(a.f,md,!0)}a.hb(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var nd; +var Ab=b.substr(2),Ab=va(Ab);Fg(a,Ab)?(c||a.j("true: "+Ab),nd=!0):(c||a.j("false: "+Ab),nd=!1);nd||(d=!1);break}f=!0;break;case "k":var Oh=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var od=0,pd=Z(),Bb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Bb.A));10>od;){for(var Ea=null,Ph=256;65536>Bb.A>>>0;){pd.A=a.ma(Bb,2);if(null==Bb.A||!Ph--)break;if(!(pd.A&1)){for(var Qh=a,jc=pd,Tf=null,Cb=jc.A,Uf=Cb,qd=1;6>=qd&&Cb;qd++){if(2< +qd){jc.A=Cb;var kc=hh(Qh,jc);if(0<=kc.indexOf("JSR")){var Vf=kc.indexOf(" ");if(Cb+(kc.indexOf(" ",Vf+1)-Vf-1)/2==Uf){Tf=kc;break}}}Cb-=2}jc.A=Uf;if(Ea=Tf)break}}if(!Ea||null==Ea)break;var Wf=null;if("ks"==Oh){var Xf=Ea.match(/[0-9A-F]+$/);Xf&&(Wf=oh(a,Xf[0]))}Ea=ua(Ea,50)+" ;"+(Wf||"stack="+J(a,Bb.A));a.j(Ea);od++}od||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){oh(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var xa=0;if("all"== +F)xa=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in Gb)if(F==ja){xa=Gb[ja];ka=!!(a.ka&xa);break}if(!xa){a.j("unknown message category: "+F);break a}}if(xa)if("on"==g[2])a.ka|=xa,ka=!0;else if("off"==g[2]&&(a.ka&=~xa,ka=!1,1073741824==xa)){for(var rd=0;rd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;buh){if(wh(d,this.I)){this.D=new N(this,"1.30.1","failsafe");wh(this.D)&&(Bh(this,d),a=2,Ch(this.D));this.D.set("timestamp",Aa());Dh(this.D);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ah(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?wh(d,g):("error"== +f&&"no machine state"!=g?(this.pa("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Ch(d),wh(d)?(c=Ah(d),e=!0):c=!1))}e&&zh(this,c?d:null)}else 2==a&&d.clear()}else zh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ia=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Eh(this,this.b,b,c,a),this.b.lb());this.T&&(Bh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; +function Bh(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} +function rh(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=Aa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var l=kb(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Fa(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +function Wh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],g);Wh(a,b,c)}})}else c(a,null)} -function Xh(a,b,c,d){function e(a){if(void 0===l){var b=g&&B(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ua(a))}function f(a){e("Error: "+a);m&&(--Ih||ab(!0));m=!1}var g,l,m=!0;Ih++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,l){l?Uh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Ih||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Ih||ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Uh(b,a,d,!0,e,p):Vh(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){ab(!1);return Xh(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map +function Xh(a,b,c,d){function e(a){if(void 0===l){var b=g&&B(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Ih||Va(!0));m=!1}var g,l,m=!0;Ih++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,l){l?Uh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Ih||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Ih||Va(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Uh(b,a,d,!0,e,p):Vh(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return Xh(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 7fd52ef1b..f0fa902d5 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -29,157 +29,158 @@ http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ for(var g,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da>=3;return""+c}function h(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +ha!=ga&&null!=ha&&aa(ba,fa,{configurable:!0,writable:!0,value:ha});function ia(a,b){var c="";b?11>=3;return""+c}function ja(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function ka(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function pa(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},sa=Date.now||function(){return+new Date}; function ta(){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 m(a,b,c,d){var e=0,f=null,k=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)}),k;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var n="",r;for(r in b)b.hasOwnProperty(r)&&(n&&(n+="&"),n+=r+"="+encodeURIComponent(b[r]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),k=[f,e]);return k}function na(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function p(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){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}va=a}return va}function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} -function ya(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function za(a){if(window){var b=window?window.navigator.userAgent:"";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}var q={init:[],show:[],exit:[]},Aa=!1,Ba=!1,Ca=!0;function Da(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){q.init.push(a)} -function Ea(a){if(Ca)try{for(var b=0;bb?this.Ea=this.id:(this.Ua=this.id.substr(0,b),this.Ea=this.id.substr(b+1));this[a]=c;this.h={ready:!1,bd:!1,cd:!1,L:!1,error:!1};this.Oa=null;this.h.error=!1;this.v={};this.G=null;w.push(this)}var Ha=void 0,Ia={}; -if(window){Ha||(Ha=window.location.search.substr(1));for(var Ja,Ka=/\+/g,La=/([^&=]+)=?([^&]*)/g;Ja=La.exec(Ha);)Ia[decodeURIComponent(Ja[1].replace(Ka," "))]=decodeURIComponent(Ja[2].replace(Ka," "))}function Ma(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 x(a,b){b||(b=v);a.prototype=Ma(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Na=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Na={},w=[];function Oa(a,b,c){Na[a]&&b&&(Na[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>8&255;else if(e=k.data)for(d.K=Array(4*e.length),f=c=0;c>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=k;d.Y=k.symbols;d.K.length?1==d.K.length&&(m(d.K[0]),d=null):(m("Empty resource: "+ +a),d=null)}catch(l){m("Resource data error: "+l.message),d=null}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),d.K=Array(a.length),c=0;cb?this.Ga=this.id:(this.Ha=this.id.substr(0,b),this.Ga=this.id.substr(b+1));this[a]=c;this.i={ready:!1,fd:!1,gd:!1,M:!1,error:!1};this.Ra=null;this.i.error=!1;this.v={};this.G=null;v.push(this)}var Ia=void 0,Ja={}; +if(window){Ia||(Ia=window.location.search.substr(1));for(var Ka,La=/\+/g,Ma=/([^&=]+)=?([^&]*)/g;Ka=Ma.exec(Ia);)Ja[decodeURIComponent(Ka[1].replace(La," "))]=decodeURIComponent(Ka[2].replace(La," "))}function Na(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 w(a,b){b||(b=u);a.prototype=Na(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Oa=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Oa={},v=[];function Pa(a,b,c){Oa[a]&&b&&(Oa[a][b]=c)}function x(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.g=this.c-1;this.w=this.A/this.c|0;this.ia=[];this.R=0;this.o=[];this.vb=[$a,ab,bb,cb];a=new F(this);db(a,this.G);this.b=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ia[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=fb(d,b)}function ab(a,b,c){var d=!1,e=this.controller,f=e.ia[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ia[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||fb(e,c)} -function bb(a,b){var c=-1,d=this.controller;(a=d.ia[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=fb(d,b)}function cb(a,b,c){var d=!1,e=this.controller;if(a=e.ia[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||fb(e,c)}function gb(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.l;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.za)return n.Qa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Qa){t=n.size-(f-r);t>k&&(t=k);n.Qa=f-n.za+t;f=r+a.c;k-=t;l++;continue}}return lb(1,f,k)}f=new F(a,f,t,a.c,d,e);db(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var D;e="";D?10>>=a.l;0>>=a.l;0>>a.l].Ya(b&a.g,b)}function ob(a,b){return a.b[(b&a.i)>>>a.l].S(b&a.g,b)}Za.prototype.bb=function(a,b){this.R++;this.b[(a&this.i)>>>this.l].sb(a&this.g,b&255,a);this.R--}; -function pb(a,b,c){a.b[(b&a.i)>>>a.l].Ra(b&a.g,c&65535,b)}function qb(a){for(var b=0,c=[],d=0;da.a.Ia)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));rb(a,e,e,k,l,n,r,f[4])}}}function tb(a,b){a.o.push(b)}function ub(a,b){a.R||G(a.a,4,b)} -function lb(a,b,c){p("Memory block error ("+a+": "+h(b)+","+h(c)+")");return!1}function H(a){v.call(this,"Device",a,H);this.c={data:0,ad:0,Pa:20,pc:0};this.b={dd:0,cb:-1}}x(H);g=H.prototype;g.ca=function(a,b,c,d){this.l=b;this.a=c;this.G=d;var e=this;this.b.cb=vb(c,function(){e.b.la|=128;e.b.la&64&&(wb(e.a,e.b.qc),xb(e.a,e.b.cb,1E3/60))});this.b.qc=yb(64,6);sb(b,this,I);tb(b,this.reset.bind(this));C(this)};g.reset=function(){this.c.Pa=this.c.Pa&-120|20;this.b.la=0}; -g.Lb=function(){var a=this.b.la;this.b.la&=-129;return a};g.zc=function(a){this.b.la=a;a&64&&xb(this.a,this.b.cb,1E3/60);this.b.la=a&-129};g.Eb=function(a){return(a?this.c.pc:this.c.data)&65535};g.sc=function(a){this.c.data=a};g.Nb=function(){var a=this.a;return a.A&62337|a.Fa<<5|a.Ga<<1};g.Bc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Fa=a>>5&3;b.Ga=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,zb(b))}Ab(this)}; -g.Ob=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Pb=function(){return this.a.$a};g.Qb=function(){return this.a.na};g.Cc=function(a){var b=this.a;1170>b.Ia&&(a&=-49);b.na!=a&&(b.na=a,a&16?(b.Wa=4194303,b.Ha=3915776):(b.Wa=262143,b.Ha=253952),zb(b));Ab(this)};function Ab(a){a.c.Pa=a.c.Pa&-8|(a.a.Ba?a.a.na&16?1:2:4)}g.dc=function(a){return this.a.C[1][a>>1&7]};g.Qc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.bc=function(a){return this.a.C[1][(a>>1&7)+8]}; -g.Oc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.cc=function(a){return this.a.P[1][a>>1&7]};g.Pc=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.ac=function(a){return this.a.P[1][(a>>1&7)+8]};g.Nc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Kb=function(a){return this.a.C[0][a>>1&7]};g.yc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Ib=function(a){return this.a.C[0][(a>>1&7)+8]};g.wc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295}; -g.Jb=function(a){return this.a.P[0][a>>1&7]};g.xc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Hb=function(a){return this.a.P[0][(a>>1&7)+8]};g.vc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.jc=function(a){return this.a.C[3][a>>1&7]};g.Wc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.hc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Uc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.ic=function(a){return this.a.P[3][a>>1&7]}; -g.Vc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.gc=function(a){return this.a.P[3][(a>>1&7)+8]};g.Tc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.ua=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Vb=function(){return this.a.u&49152?this.a.Z[0]:this.a.f[6]};g.Hc=function(a){this.a.u&49152?this.a.Z[0]=a:this.a.f[6]=a};g.Yb=function(){return this.a.f[7]}; -g.Kc=function(a){this.a.f[7]=a};g.va=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.xa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a};g.Wb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.Z[1]};g.Ic=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.Z[1]=a};g.Xb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.Z[3]};g.Jc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.Z[3]=a};g.Gb=function(a){return this.a.pb[a-65504>>1]}; -g.uc=function(a,b){this.a.pb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.ub=function(){};g.fc=function(){return 1};g.Sc=function(){};g.Fb=function(){return this.a.F};g.tc=function(){this.a.F=0};g.Mb=function(){return this.a.ob};g.Ac=function(a,b){b&1||(a&=255);this.a.ob=a};g.Rb=function(a){return a?this.a.ab:0};g.Dc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ab=a;b.j|=2};g.ec=function(a){return a?this.a.oa&65280:0};g.Rc=function(a){this.a.oa=a|255}; -g.Ub=function(){return Ya(this.a)};g.Gc=function(a){Bb(this.a,a&-1809|Ya(this.a)&1808);this.a.j|=128};g.tb=function(){}; -var J={},I=(J[62592]=[null,null,H.prototype.dc,H.prototype.Qc,"SISDR",1145],J[62608]=[null,null,H.prototype.bc,H.prototype.Oc,"SDSDR",1145],J[62624]=[null,null,H.prototype.cc,H.prototype.Pc,"SISAR",1145],J[62640]=[null,null,H.prototype.ac,H.prototype.Nc,"SDSAR",1145],J[62656]=[null,null,H.prototype.Kb,H.prototype.yc,"KISDR",1145],J[62672]=[null,null,H.prototype.Ib,H.prototype.wc,"KDSDR",1145],J[62688]=[null,null,H.prototype.Jb,H.prototype.xc,"KISAR",1145],J[62704]=[null,null,H.prototype.Hb,H.prototype.vc, -"KDSAR",1145],J[62798]=[null,null,H.prototype.Qb,H.prototype.Cc,"MMR3",1145],J[65382]=[null,null,H.prototype.Lb,H.prototype.zc,"LKS"],J[65400]=[null,null,H.prototype.Eb,H.prototype.sc,"CNSL"],J[65402]=[null,null,H.prototype.Nb,H.prototype.Bc,"MMR0",1145],J[65404]=[null,null,H.prototype.Ob,H.prototype.tb,"MMR1",1145],J[65406]=[null,null,H.prototype.Pb,H.prototype.tb,"MMR2",1145],J[65408]=[null,null,H.prototype.jc,H.prototype.Wc,"UISDR",1145],J[65424]=[null,null,H.prototype.hc,H.prototype.Uc,"UDSDR", -1145],J[65440]=[null,null,H.prototype.ic,H.prototype.Vc,"UISAR",1145],J[65456]=[null,null,H.prototype.gc,H.prototype.Tc,"UDSAR",1145],J[65472]=[null,null,H.prototype.ua,H.prototype.wa,"R0SET0"],J[65473]=[null,null,H.prototype.ua,H.prototype.wa,"R1SET0"],J[65474]=[null,null,H.prototype.ua,H.prototype.wa,"R2SET0"],J[65475]=[null,null,H.prototype.ua,H.prototype.wa,"R3SET0"],J[65476]=[null,null,H.prototype.ua,H.prototype.wa,"R4SET0"],J[65477]=[null,null,H.prototype.ua,H.prototype.wa,"R5SET0"],J[65478]= -[null,null,H.prototype.Vb,H.prototype.Hc,"R6KERNEL"],J[65479]=[null,null,H.prototype.Yb,H.prototype.Kc,"R7KERNEL"],J[65480]=[null,null,H.prototype.va,H.prototype.xa,"R0SET1",1145],J[65481]=[null,null,H.prototype.va,H.prototype.xa,"R1SET1",1145],J[65482]=[null,null,H.prototype.va,H.prototype.xa,"R2SET1",1145],J[65483]=[null,null,H.prototype.va,H.prototype.xa,"R3SET1",1145],J[65484]=[null,null,H.prototype.va,H.prototype.xa,"R4SET1",1145],J[65485]=[null,null,H.prototype.va,H.prototype.xa,"R5SET1",1145], -J[65486]=[null,null,H.prototype.Wb,H.prototype.Ic,"R6SUPER",1145],J[65487]=[null,null,H.prototype.Xb,H.prototype.Jc,"R6USER",1145],J[65504]=[null,null,H.prototype.Gb,H.prototype.uc,"CTRL",1170],J[65520]=[null,null,H.prototype.nb,H.prototype.ub,"LSIZE",1170],J[65522]=[null,null,H.prototype.nb,H.prototype.ub,"HSIZE",1170],J[65524]=[null,null,H.prototype.fc,H.prototype.Sc,"SYSID",1170],J[65526]=[null,null,H.prototype.Fb,H.prototype.tc,"CPUERR",1170],J[65528]=[null,null,H.prototype.Mb,H.prototype.Ac, -"MB",1170],J[65530]=[null,null,H.prototype.Rb,H.prototype.Dc,"PIR"],J[65532]=[null,null,H.prototype.ec,H.prototype.Rc,"SL"],J[65534]=[null,null,H.prototype.Ub,H.prototype.Gc,"PSW"],J);I[62594]=I[62592];I[62596]=I[62592];I[62598]=I[62592];I[62600]=I[62592];I[62602]=I[62592];I[62604]=I[62592];I[62606]=I[62592];I[62610]=I[62608];I[62612]=I[62608];I[62614]=I[62608];I[62616]=I[62608];I[62618]=I[62608];I[62620]=I[62608];I[62622]=I[62608];I[62626]=I[62624];I[62628]=I[62624];I[62630]=I[62624];I[62632]=I[62624]; -I[62634]=I[62624];I[62636]=I[62624];I[62638]=I[62624];I[62642]=I[62640];I[62644]=I[62640];I[62646]=I[62640];I[62648]=I[62640];I[62650]=I[62640];I[62652]=I[62640];I[62654]=I[62640];I[62658]=I[62656];I[62660]=I[62656];I[62662]=I[62656];I[62664]=I[62656];I[62666]=I[62656];I[62668]=I[62656];I[62670]=I[62656];I[62674]=I[62672];I[62676]=I[62672];I[62678]=I[62672];I[62680]=I[62672];I[62682]=I[62672];I[62684]=I[62672];I[62686]=I[62672];I[62690]=I[62688];I[62692]=I[62688];I[62694]=I[62688];I[62696]=I[62688]; -I[62698]=I[62688];I[62700]=I[62688];I[62702]=I[62688];I[62706]=I[62704];I[62708]=I[62704];I[62710]=I[62704];I[62712]=I[62704];I[62714]=I[62704];I[62716]=I[62704];I[62718]=I[62704];I[65410]=I[65408];I[65412]=I[65408];I[65414]=I[65408];I[65416]=I[65408];I[65418]=I[65408];I[65420]=I[65408];I[65422]=I[65408];I[65426]=I[65424];I[65428]=I[65424];I[65430]=I[65424];I[65432]=I[65424];I[65434]=I[65424];I[65436]=I[65424];I[65438]=I[65424];I[65442]=I[65440];I[65444]=I[65440];I[65446]=I[65440];I[65448]=I[65440]; -I[65450]=I[65440];I[65452]=I[65440];I[65454]=I[65440];I[65458]=I[65456];I[65460]=I[65456];I[65462]=I[65456];I[65464]=I[65456];I[65466]=I[65456];I[65468]=I[65456];I[65470]=I[65456];I[65506]=I[65504];I[65508]=I[65504];I[65510]=I[65504];I[65512]=I[65504];I[65514]=I[65504];I[65516]=I[65504];I[65518]=I[65504];u(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),Ib(this,Eb?Jb:Kb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},$:function(a,b){a&1&&ub(this.l,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},fa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ja=!0},H:function(a,b){return this.I(a,b)}, -R:function(a,b){return this.V(a,b)},ba:function(a,b,c){this.v||this.sb(a,b,c)},ha:function(a,b,c){this.v||this.pa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},N:function(a,b){a&1&&ub(this.l,b);return this.g.getUint16(a,!0)},W:function(a,b){a&1&&ub(this.l,b);return this.o[a>>1]},aa:function(a,b){this.c[a]=b;this.ja=!0},ea:function(a,b){this.c[a]=b;this.ja=!0},ga:function(a,b,c){a&1&&ub(this.l,c);this.g.setUint16(a,b,!0);this.ja=!0},qa:function(a,b,c){a&1&&ub(this.l,c);this.o[a>> -1]=b;this.ja=!0}};function db(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&Mb(a,Nb,!1),(a.m=c.m)&&Ob(a,Nb,!1))}function Ob(a,b,c){c&&a.m||(a.eb=!a.v&&b[1]||a.A,a.Ra=!a.v&&b[3]||a.B);if(c||void 0===c)a.sb=b[1]||a.A,a.pa=b[3]||a.B}function Mb(a,b,c){c&&a.i||(a.Ya=b[0]||a.w,a.S=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.V=b[2]||a.s}function Ib(a,b){b||(b=Pb);Mb(a,b,void 0);Ob(a,b,void 0)} -var Pb=[],Lb=[F.prototype.M,F.prototype.fa,F.prototype.$,F.prototype.ra],Nb=[F.prototype.H,F.prototype.ba,F.prototype.R,F.prototype.ha];if(Sa)var Kb=[F.prototype.D,F.prototype.aa,F.prototype.N,F.prototype.ga],Jb=[F.prototype.J,F.prototype.ea,F.prototype.W,F.prototype.qa]; -function Qb(a,b){v.call(this,"CPU",a,Qb);var c=a.multiplier||1;this.La=a.cycles||b;this.ba=c;this.Va=Math.round(this.La/1E4)/100;this.ea=this.Va*this.ba;this.h.T=!1;this.h.qb=!1;this.h.Aa=a.autoStart;this.h.Ma=!1;this.Ja=this.ga=0;this.Ka=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.H=[];this.mb=this.oc.bind(this);C(this)}x(Qb);var Rb=["power","reset"];g=Qb.prototype; -g.ca=function(a,b,c,d){this.w=a;this.l=b;this.G=d;for(b=0;ba.$/a.ea&&(b=1),a.ba=b,b=a.Va*a.ba,a.ea!=b)){a.ea=b;b=a.ea.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.O("target speed: "+b)}a.J+=a.V;a.V=0;a.N=sa();a.aa=0;Xb(a)}function vb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function xb(a,b,c){0<=b&&ba.H[b][0]&&(c=a.La*a.ba/1E3*c|0,a.H[b][0]=c+Zb(a))}function Zb(a,b){var c=a.fa-=a.a;a.a=0;b&&(a.fa=0);return c} -g.oc=function(){if(this.h.T){this.Xa>=this.La&&Xb(this,!0);this.ya=0;this.Da=sa();if(this.aa){var a=this.Da-this.aa;a>this.kb&&(this.N+=a,this.N>this.Da&&(this.N=this.Da))}try{do{for(var b,c=this.h.Ma?1:this.Na,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.rb(b)}catch(n){if("number"!=typeof n)throw n;}b=Zb(this,!0);this.ya+=b;this.V+=b;a=b;if(this.h.Ma){var f=!1;this.Ja=this.Ja+this.hb()|0;this.ga-=a;0>=this.ga&&(this.ga+=this.pa,f=!0);0<=this.qa&&this.qa<=Yb(this)&& -(this.pa=this.qa=-1,Ub(this),Wa(this),f=!0);f&&this.O(Yb(this)+" cycles: checksum="+h(this.Ja))}for(var a=b,k=this.H.length-1;0<=k;k--){var l=this.H[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ra-=b;if(0>=this.ra){this.ra+=this.Na;15<=++this.lb&&(this.w&&this.w.da(),this.lb=0);break}}while(this.h.T)}catch(n){Wa(this);this.w&&this.w.stop(sa(),Yb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.mb;this.aa=sa();d=this.kb;this.ya&&(d=Math.round(d*this.ya/ -this.Na));d-=this.aa-this.Da;if(e=this.aa-this.N)this.$=Math.round(this.V/(10*e))/100,864E5<=e&&(this.J=0,Wb(this));if(0>d||this.$d&&(this.N-=d),d=0;this.Xa+=this.ya;this.aa+=d;b(c,d)}}};function Vb(a){var b;a.h.error?(a.O(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.O(a.toString()+" busy");else{Wb(a);a.h.T=!0;a.h.qb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.N,Yb(a));setTimeout(a.mb,0)}}g.rb=function(){return 0}; -function Wa(a){if(a.h.T){Zb(a);a.J+=a.V;a.V=0;a.h.T=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(sa(),Yb(a))}a.h.complete=void 0}function $b(a){this.Ia=+a.model||1170;this.Cb=a.resetAddr||0;Qb.call(this,a,6666667);this.decode=1120==this.Ia?ac.bind(this):bc.bind(this);cc(this);this.R=0;this.W=null;this.h.complete=this.h.wb=!1}x($b,Qb);g=$b.prototype;g.reset=function(){this.status("model "+this.Ia);this.h.T&&Wa(this);cc(this);Tb(this);this.h.error=!1;this.parent.reset.call(this)}; -function cc(a){a.m=65536;a.g=32768;a.i=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.Cb];a.sa=[0,0,0,0,0,0];a.Z=[0,0,0,0];a.s=0;a.Ga=0;a.Ab=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Db=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.pb=[0,0,0,0,0,0,0,0];a.ob=0;a.j=0;a.B=a.D=0;a.c=a.b=a.Ta=0;a.ha=-1;dc(a)}function dc(a){a.oa=255;a.F=0;a.ab=0;a.A=0;a.ma=0;a.$a=0;a.na=0;a.Ba=0;a.Fa=0;a.Wa=262143;a.Ha=253952;a.j|=2;a.l&&zb(a)}function zb(a){a.Ba?(a.M=65536,a.I=a.zb,a.S=a.lc,a.Ra=a.Yc,gb(a.l,a.na&16?22:18)):(a.M=0,a.I=a.yb,a.S=a.kc,a.Ra=a.Xc,gb(a.l,16))}g.hb=function(){return 0}; -g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.J,this.ba]);a.set(2,qb(this.l));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Wb(this,b[3]);a:{b=this.l;a=a[2];var c;for(c=0;c>14&3;c=a.u>>14&3;a.s!=c&&(a.Z[c]=a.f[6],a.f[6]=a.Z[a.s]);a.u=b;a.j|=2}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function fc(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function gc(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))} -function G(a,b,c){if(!a.R){var d=!1;0>a.ha?a.ha=Ya(a):a.s||(b=4,d=!0);a.A&57344||(a.ma=63222,a.$a=b);a.s=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);Bb(a,f&-12289|a.ha>>2&12288);d&&(a.F|=4,a.f[6]=4);hc(a,a.ha);hc(a,a.f[7]);a.f[7]=e&65535;a.j&=-113;a.ha=-1;if(26!=c)throw b;}}function ic(a){var b=jc(a),c=jc(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;Bb(a,c);a.j&=-17} -function kc(a,b,c){var d,e,f,k=0;d=b>>13;a.na&a.Ab[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Db[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ha&&4186112>f&&(a.F|=32,G(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: -128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Fa=a.s,a.Ga=d;k&&(k&57344&&(0<=a.ha&&(k|=128),a.A&57344||(a.A=a.A|k|a.Fa<<5|a.Ga<<1),G(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.l].eb(b&a.g,c&255,b)}function jc(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b} -function hc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.ma=a.ma<<8|246);!a.s&&c<=a.oa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.S(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.S(e)|k;a.a-= -8;break;case 6:return e=ec(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=ec(a),e=e+a.f[c]&65535,e=a.S(e|a.M)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.ma=a.ma<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.F|=4,a.f[6]=4,G(a,4,24)):(a.F|=8,a.j|=64));return e}g.bb=function(a,b){this.Ba?(this.R++,lc(this,kc(this,a,5),b),this.R--):this.l.bb(a,b)};g.yb=function(a,b,c){return mc(this,a,b,c)};g.zb=function(a,b,c){return kc(this,mc(this,a,b,c),c)}; -g.kc=function(a){return ob(this.l,a)};g.lc=function(a){return ob(this.l,kc(this,a,2))};g.Xc=function(a,b){pb(this.l,a,b&65535)};g.Yc=function(a,b){pb(this.l,kc(this,a,4),b)};function nc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=mc(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.S(d|c&a.M),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.Z[a.u>>12&3];return c} -function oc(a,b,c,d){a.A&57344||(a.ma=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=mc(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=kc(a,e|c&65536,4),a.s=a.u>>14&3,pb(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.Z[a.u>>12&3]=d}function pc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=nb(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?ob(a.l,a.I(b,c,2)):a.f[c]}function qc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return mc(a,b,c,8)} -function rc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=nb(a.l,c)):a=a.f[c]&255;return a}function sc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?ob(a.l,a.I(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Ta=a.I(b,e,7),lc(a,e,d.call(a,c,nb(a.l,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),pb(a.l,e,d.call(a,c,ob(a.l,e)))):a.f[e]=d.call(a,c,a.f[e])} -function tc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?lc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?pb(a.l,a.I(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} -g.rb=function(a){this.h.complete=!0;this.h.wb=!1;this.h.qb=!1;this.fa=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?G(this,168,28):this.j&64?G(this,4,30):this.j&16&&G(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.ab&224)>>5;if(a=this.W&&this.W.ta>c?this.W:null)b=a.rc,c=a.ta;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),G(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j& -1&&this.j++;this.A&57344||(this.ma=0,this.$a=this.f[7]);this.j=this.j&7|this.u&16;this.decode(ec(this))}while(0>1|b<<16;P(this,a);return a&65535}function Ac(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function Bc(a,b){a=b&~a;N(this,a);return a}function Cc(a,b){a=b&~a;N(this,a<<8);return a}function Dc(a,b){a|=b;N(this,a);return a}function Ec(a,b){a|=b;N(this,a<<8);return a}function Fc(a,b){a=~b|65536;O(this,a);return a&65535}function Gc(a,b){a=~b|256;O(this,a<<8);return a&255} -function Hc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function Ic(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function Jc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function Kc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function Lc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Mc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} -function Nc(a,b){a=b<<1|this.m>>16&1;P(this,a);return a&65535}function Oc(a,b){a=b<<1|this.m>>16&1;P(this,a<<8);return a&255}function Pc(a,b){a=(this.m&65536|b)>>1|b<<16;P(this,a);return a&65535}function Qc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Rc(a,b){var c=b-a;gc(this,c,a,b);return c&65535}function Sc(a,b){var c=b-a;gc(this,c<<8,a<<8,b<<8);return c&255}function Tc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535} -function Uc(a,b){a^=b;N(this,a);return a&65535}function Vc(a){S(this,a,Q(this,a),vc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Wc(a){var b=sc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b} -function Xc(a){var b=sc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Yc(a){T(this,a,!M(this))}function Zc(a){T(this,a,M(this))} -function $c(a){S(this,a,Q(this,a),Bc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ad(a){R(this,a,pc(this,a),Cc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function bd(a){S(this,a,Q(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function cd(a){R(this,a,pc(this,a),Ec);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function dd(a){N(this,Q(this,a)&sc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ed(a){N(this,(pc(this,a)&rc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){T(this,a,this.i&65535?0:4)}function gd(a){T(this,a,!this.ka()==!(this.g&32768))}function hd(a){T(this,a,!!(this.i&65535)&&!this.ka()==!(this.g&32768))}function id(a){T(this,a,!M(this)&&!!(this.i&65535))} -function jd(a){T(this,a,(this.i&65535?0:4)||!this.ka()!=!(this.g&32768))}function kd(a){T(this,a,M(this)||(this.i&65535?0:4))}function ld(a){T(this,a,!this.ka()!=!(this.g&32768))}function md(a){T(this,a,this.ka())}function nd(a){T(this,a,!!(this.i&65535))}function od(a){T(this,a,!this.ka())}function pd(){G(this,12,1);this.a-=5}function qd(a){T(this,a,!0)}function rd(a){T(this,a,!(this.g&32768))}function sd(a){T(this,a,this.g&32768?2:0)} -function U(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}function td(a){var b=Q(this,a);a=sc(this,a);gc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ud(a){var b=pc(this,a)<<8;a=rc(this,a)<<8;gc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} -function vd(a){var b=sc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.m=65536,this.a-=7}function wd(){G(this,24,2);this.a-=25}function xd(){this.u&49152?(this.F|=128,G(this,4,3)):Wa(this);this.a-=7} -function yd(){G(this,16,4);this.a-=25}var zd=[0,7,7,10,7,11,9,13];function V(a){var b=this.a;a=qc(this,a);this.f[7]=a&65535;this.a=b-zd[this.c]}var Ad=[0,14,14,17,14,18,16,20];function Bd(a){var b=this.a,c=qc(this,a);a=a>>6&7;hc(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Ad[this.c]}var Cd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dd(a){var b=Q(this,a),c=this.a;N(this,uc(this,a,b));this.a=c-Cd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)} -function Ed(a){var b=pc(this,a);N(this,tc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Fd=[7,13,13,17,14,18,17,21];function Gd(a){var b=sc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Md(a){S(this,a,Q(this,a),Rc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function X(a){S(this,a,0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){G(this,28,5);this.a-=5}function Pd(){this.j&4||this.w.da();this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Qd(a){S(this,a,Q(this,a),Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){G(this,8,6)}function ac(a){Rd[a>>12].call(this,a)}function Sd(a){Td[a>>6&3].call(this,a)}function Ud(a){Vd[a>>6&3].call(this,a)}function Wd(a){Xd[a>>6&3].call(this,a)}function Yd(a){Zd[a&15].call(this,a)} -function $d(a){ae[a&15].call(this,a)}function be(a){ce[a>>6&3].call(this,a)}function de(a){ee[a>>6&3].call(this,a)}function fe(a){ge[a>>6&3].call(this,a)} -var Rd=[function(a){he[a>>8&15].call(this,a)},Dd,td,dd,$c,bd,Vc,Y,function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Md,Y],he=[function(a){je[a>>4&15].call(this,a)},qd,nd,fd,gd,ld,hd,jd,Bd,Bd,Sd,Ud,Wd,Y,Y,Y],Td=[function(a){O(this,uc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Hc);this.a-=this.c?9:3+(7==this.b?2:0)}],Vd=[function(a){S(this,a,0,Lc); -this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=sc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Xd=[function(a){S(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Nc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)}],je=[function(a){ke[a& -15].call(this,a)},Y,Y,Y,V,V,V,V,Kd,Y,Yd,$d,X,X,X,X],ke=[xd,Pd,Jd,pd,yd,Id,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Zd=[Hd,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.i=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],ae=[Hd,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],ie=[od,md,id,kd,rd,sd,Yc,Zc,wd,Od,be,de,fe,Y,Y,Y],ce=[function(a){O(this,tc(this,a,0)); -this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],ee=[function(a){R(this,a,0,Mc);this.a-=this.c?11:6},function(a){R(this,a,M(this)?1:0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,M(this)?1:0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=rc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],ge= -[function(a){R(this,a,0,Qc);this.a-=this.c?9+(this.Ta&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Ac);this.a-=this.c?9+(this.Ta&1):3+(7==this.b?2:0)},function(a){R(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)}];function bc(a){le[a>>12].call(this,a)} -var le=[function(a){me[a>>8&15].call(this,a)},Dd,td,dd,$c,bd,Vc,function(a){ne[a>>8&15].call(this,a)},function(a){oe[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Md,Y],me=[function(a){pe[a>>4&15].call(this,a)},qd,nd,fd,gd,ld,hd,jd,Bd,Bd,Sd,Ud,Wd,function(a){qe[a>>6&3].call(this,a)},Y,Y],qe=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.M);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=nc(this,a,0);hc(this,a);N(this,a);this.a-=11},function(a){var b=jc(this), -c=this.a;oc(this,a,0,b);N(this,b);this.a=c-Fd[this.c]},function(a){N(this,uc(this,a,this.ka?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],pe=[function(a){re[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Kd,function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):G(this,8,6)},Yd,$d,X,X,X,X],re=[xd,Pd,Jd,pd,yd,Id,function(){ic(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],ne=[Gd,Gd,vd,vd,Wc,Wc,Xc,Xc,Qd,Qd,Y,Y,Y,Y,Ld,Ld],oe=[od,md,id,kd,rd,sd,Yc,Zc,wd,Od,be,de,fe,function(a){se[a>>6&3].call(this, -a)},Y,Y],se=[Y,function(a){a=nc(this,a,65536);hc(this,a);N(this,a);this.a-=11},function(a){var b=jc(this),c=this.a;oc(this,a,65536,b);N(this,b);this.a=c-Fd[this.c]},Y];function te(a){v.call(this,"ROM",a,te);this.b=null;this.o=a.addr;this.c=a.size;this.w=a.writable;this.g=a.alias;this.i=a.file;this.s=ka(this.i);if(this.i){a=this.i;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){ue(c,a,b,f)})}}x(te); -te.prototype.ca=function(a,b,c,d){this.l=b;this.a=c;this.G=d;ve(this)};te.prototype.Y=function(){this.m&&(this.G&&this.G.a(this.id,this.o,this.c,this.m),delete this.m);return!0};te.prototype.X=function(){return!0}; -function ue(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Oa(a.Ua,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,k,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),k=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),k=e=0;e>8&255,a.b[k++]=f[e]>>16&255,a.b[k++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){p("Empty ROM: "+b); -return}if(1==a.b.length){p(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ea)return;b=qa(b[1]);if(this.s=Pa(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.Y=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -g.X=function(a){return a?this.save():!0};g.reset=function(){Ae(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return Ae(this)};function Ae(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.Za=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.O(this.m), -this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;xb(this.a,this.J,1)}};var Be={},ze=(Be[65392]=[null,null,Z.prototype.$b,Z.prototype.Mc,"RCSR"],Be[65394]=[null,null,Z.prototype.Zb,Z.prototype.Lc,"RBUF"],Be[65396]=[null,null,Z.prototype.nc,Z.prototype.$c,"XCSR"],Be[65398]=[null,null,Z.prototype.mc,Z.prototype.Zc,"XBUF"],Be);u(function(){for(var a=B(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.O("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bGe){if(Ie(d,this.s)){this.m=new L(this,"1.30.1","failsafe");Ie(this.m)&&(Ne(this,d),a=2,Oe(this.m));this.m.set("timestamp",ta());Pe(this.m);var e=this.b&&!this.o;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Me(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Ie(d,k):("error"== -f&&"no machine state"!=k?(this.K("Error: "+k),"unable to verify user"==k&&(ya("user",""),this.c=null)):this.O(f+": "+k),Oe(d),Ie(d)?(c=Me(d),e=!0):c=!1))}e&&Le(this,c?d:null)}else 2==a&&d.clear()}else Le(this);delete this.s;delete this.A}e=y(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.h.L=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Qe(this,this.a,b,c,a),this.a.Aa());this.H&&(Ne(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0}; -function Ne(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.N;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}} -function Re(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),k=new L(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.X&&(c&&Wa(a.a),d=a.a.X(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],k);Ye(a,b,c)}})}else c(a,null)} -function Ze(a,b,c,d){function e(a){if(void 0===l){var b=k&&B(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--Ve||Fa(!0));n=!1}var k,l,n=!0;Ve++;Na[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=r:D.appendChild(document.createTextNode(r));t.appendChild(D)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?We(c,null,null,!1,e,function(d,n){n?(Oa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--Ve||Fa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--Ve||Fa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?We(b,a,d,!0,e,r):Xe(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Nd){f(Nd.message)}return n}window.embedPDP11=function(a,b,c,d){Fa(!1);return Ze(a,b,c,d)};window.enableEvents=Fa;window.sendEvent=Ga;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map +Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ta="undefined"!==typeof ArrayBuffer;function Ua(a){u.call(this,"Panel",a,Ua);this.b=0;this.i.jb=!0}w(Ua);g=Ua.prototype; +g.V=function(a,b,c,d){if(this.w&&this.w.V(a,b,c,d)||this.a&&this.a.V(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.V.call(this,a,b,c,d)}};g.ea=function(a,b,c,d){this.w=a;this.m=b;this.a=c;this.G=d};g.$=function(a,b){b||Va();return!0};g.Z=function(){return!0}; +function Wa(a,b,c,d){if(a.v[b]){void 0===c&&(a.i.error=!0,a.L("Value for "+b+" is invalid"),Xa(a.a));var e=a.G&&a.G.b||8;c=!a.a.i.U||a.i.jb?8==e?ia(c,d):ja(c,d):"--------".substr(0,d||4);a.v[b].textContent!=c&&(a.v[b].textContent=c)}}function Ya(a,b,c,d){for(var e=0;e>2;this.g=this.c-1;this.w=this.A/this.c|0;this.ka=[];this.S=0;this.o=[];this.Ab=[ab,bb,cb,db];a=new E(this);eb(a,this.G);this.b=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=gb(d,b)}function bb(a,b,c){var d=!1,e=this.controller,f=e.ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||gb(e,c)} +function cb(a,b){var c=-1,d=this.controller;(a=d.ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=gb(d,b)}function db(a,b,c){var d=!1,e=this.controller;if(a=e.ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||gb(e,c)}function hb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.m;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.Ba)return n.Ua+=n.Ba-f,n.Ba=f,!0;if(f>=n.Ba+n.Ua){t=n.size-(f-r);t>k&&(t=k);n.Ua=f-n.Ba+t;f=r+a.c;k-=t;l++;continue}}return mb(1,f,k)}f=new E(a,f,t,a.c,d,e);eb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var C;e="";C?10>>=a.m;0>>=a.m;0>>a.m].cb(b&a.g,b)}function pb(a,b){return a.b[(b&a.h)>>>a.m].T(b&a.g,b)}$a.prototype.Ta=function(a,b){this.S++;this.b[(a&this.h)>>>this.m].xb(a&this.g,b&255,a);this.S--}; +function qb(a,b,c){a.b[(b&a.h)>>>a.m].Va(b&a.g,c&65535,b)}function rb(a){for(var b=0,c=[],d=0;da.a.Fa)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));sb(a,e,e,k,l,n,r,f[4])}}}function ub(a,b){a.o.push(b)}function vb(a,b){a.S||F(a.a,4,b)} +function mb(a,b,c){m("Memory block error ("+a+": "+ja(b)+","+ja(c)+")");return!1}function G(a){u.call(this,"Device",a,G);this.c={data:0,ed:0,Sa:20,tc:0};this.b={hd:0,hb:-1}}w(G);g=G.prototype;g.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;var e=this;this.b.hb=wb(c,function(){e.b.na|=128;e.b.na&64&&(xb(e.a,e.b.uc),yb(e.a,e.b.hb,1E3/60))});this.b.uc=zb(64,6);tb(b,this,H);ub(b,this.reset.bind(this));B(this)};g.reset=function(){this.c.Sa=this.c.Sa&-120|20;this.b.na=0}; +g.Pb=function(){var a=this.b.na;this.b.na&=-129;return a};g.Dc=function(a){this.b.na=a;a&64&&yb(this.a,this.b.hb,1E3/60);this.b.na=a&-129};g.Ib=function(a){return(a?this.c.tc:this.c.data)&65535};g.wc=function(a){this.c.data=a};g.Rb=function(){var a=this.a;return a.A&62337|a.Ia<<5|a.Ja<<1};g.Fc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Ia=a>>5&3;b.Ja=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Da!=c&&(b.Da=c,Ab(b))}Bb(this)}; +g.Sb=function(){var a=this.a.oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Tb=function(){return this.a.fb};g.Ub=function(){return this.a.pa};g.Gc=function(a){var b=this.a;1170>b.Fa&&(a&=-49);b.pa!=a&&(b.pa=a,a&16?(b.Za=4194303,b.Ka=3915776):(b.Za=262143,b.Ka=253952),Ab(b));Bb(this)};function Bb(a){a.c.Sa=a.c.Sa&-8|(a.a.Da?a.a.pa&16?1:2:4)}g.hc=function(a){return this.a.C[1][a>>1&7]};g.Uc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.fc=function(a){return this.a.C[1][(a>>1&7)+8]}; +g.Sc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.a.R[1][a>>1&7]};g.Tc=function(a,b){b=b>>1&7;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.ec=function(a){return this.a.R[1][(a>>1&7)+8]};g.Rc=function(a,b){b=(b>>1&7)+8;this.a.R[1][b]=a;this.a.C[1][b]&=65295};g.Ob=function(a){return this.a.C[0][a>>1&7]};g.Cc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Mb=function(a){return this.a.C[0][(a>>1&7)+8]};g.Ac=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295}; +g.Nb=function(a){return this.a.R[0][a>>1&7]};g.Bc=function(a,b){b=b>>1&7;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.Lb=function(a){return this.a.R[0][(a>>1&7)+8]};g.zc=function(a,b){b=(b>>1&7)+8;this.a.R[0][b]=a;this.a.C[0][b]&=65295};g.nc=function(a){return this.a.C[3][a>>1&7]};g.$c=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.lc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Yc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.mc=function(a){return this.a.R[3][a>>1&7]}; +g.Zc=function(a,b){b=b>>1&7;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.kc=function(a){return this.a.R[3][(a>>1&7)+8]};g.Xc=function(a,b){b=(b>>1&7)+8;this.a.R[3][b]=a;this.a.C[3][b]&=65295};g.wa=function(a){a&=7;return this.a.u&2048?this.a.ua[a]:this.a.f[a]};g.ya=function(a,b){b&=7;this.a.u&2048?this.a.ua[b]=a:this.a.f[b]=a};g.Zb=function(){return this.a.u&49152?this.a.aa[0]:this.a.f[6]};g.Lc=function(a){this.a.u&49152?this.a.aa[0]=a:this.a.f[6]=a};g.bc=function(){return this.a.f[7]}; +g.Oc=function(a){this.a.f[7]=a};g.xa=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.ua[a]};g.za=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.ua[b]=a};g.$b=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Mc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.ac=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Nc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Kb=function(a){return this.a.ub[a-65504>>1]}; +g.yc=function(a,b){this.a.ub[b-65504>>1]=a};g.sb=function(a){return 65520==a?61183:0};g.zb=function(){};g.jc=function(){return 1};g.Wc=function(){};g.Jb=function(){return this.a.F};g.xc=function(){this.a.F=0};g.Qb=function(){return this.a.tb};g.Ec=function(a,b){b&1||(a&=255);this.a.tb=a};g.Vb=function(a){return a?this.a.gb:0};g.Hc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.gb=a;b.l|=2};g.ic=function(a){return a?this.a.qa&65280:0};g.Vc=function(a){this.a.qa=a|255}; +g.Yb=function(){return Za(this.a)};g.Kc=function(a){Cb(this.a,a&-1809|Za(this.a)&1808);this.a.l|=128};g.yb=function(){}; +var I={},H=(I[62592]=[null,null,G.prototype.hc,G.prototype.Uc,"SISDR",1145],I[62608]=[null,null,G.prototype.fc,G.prototype.Sc,"SDSDR",1145],I[62624]=[null,null,G.prototype.gc,G.prototype.Tc,"SISAR",1145],I[62640]=[null,null,G.prototype.ec,G.prototype.Rc,"SDSAR",1145],I[62656]=[null,null,G.prototype.Ob,G.prototype.Cc,"KISDR",1145],I[62672]=[null,null,G.prototype.Mb,G.prototype.Ac,"KDSDR",1145],I[62688]=[null,null,G.prototype.Nb,G.prototype.Bc,"KISAR",1145],I[62704]=[null,null,G.prototype.Lb,G.prototype.zc, +"KDSAR",1145],I[62798]=[null,null,G.prototype.Ub,G.prototype.Gc,"MMR3",1145],I[65382]=[null,null,G.prototype.Pb,G.prototype.Dc,"LKS"],I[65400]=[null,null,G.prototype.Ib,G.prototype.wc,"CNSL"],I[65402]=[null,null,G.prototype.Rb,G.prototype.Fc,"MMR0",1145],I[65404]=[null,null,G.prototype.Sb,G.prototype.yb,"MMR1",1145],I[65406]=[null,null,G.prototype.Tb,G.prototype.yb,"MMR2",1145],I[65408]=[null,null,G.prototype.nc,G.prototype.$c,"UISDR",1145],I[65424]=[null,null,G.prototype.lc,G.prototype.Yc,"UDSDR", +1145],I[65440]=[null,null,G.prototype.mc,G.prototype.Zc,"UISAR",1145],I[65456]=[null,null,G.prototype.kc,G.prototype.Xc,"UDSAR",1145],I[65472]=[null,null,G.prototype.wa,G.prototype.ya,"R0SET0"],I[65473]=[null,null,G.prototype.wa,G.prototype.ya,"R1SET0"],I[65474]=[null,null,G.prototype.wa,G.prototype.ya,"R2SET0"],I[65475]=[null,null,G.prototype.wa,G.prototype.ya,"R3SET0"],I[65476]=[null,null,G.prototype.wa,G.prototype.ya,"R4SET0"],I[65477]=[null,null,G.prototype.wa,G.prototype.ya,"R5SET0"],I[65478]= +[null,null,G.prototype.Zb,G.prototype.Lc,"R6KERNEL"],I[65479]=[null,null,G.prototype.bc,G.prototype.Oc,"R7KERNEL"],I[65480]=[null,null,G.prototype.xa,G.prototype.za,"R0SET1",1145],I[65481]=[null,null,G.prototype.xa,G.prototype.za,"R1SET1",1145],I[65482]=[null,null,G.prototype.xa,G.prototype.za,"R2SET1",1145],I[65483]=[null,null,G.prototype.xa,G.prototype.za,"R3SET1",1145],I[65484]=[null,null,G.prototype.xa,G.prototype.za,"R4SET1",1145],I[65485]=[null,null,G.prototype.xa,G.prototype.za,"R5SET1",1145], +I[65486]=[null,null,G.prototype.$b,G.prototype.Mc,"R6SUPER",1145],I[65487]=[null,null,G.prototype.ac,G.prototype.Nc,"R6USER",1145],I[65504]=[null,null,G.prototype.Kb,G.prototype.yc,"CTRL",1170],I[65520]=[null,null,G.prototype.sb,G.prototype.zb,"LSIZE",1170],I[65522]=[null,null,G.prototype.sb,G.prototype.zb,"HSIZE",1170],I[65524]=[null,null,G.prototype.jc,G.prototype.Wc,"SYSID",1170],I[65526]=[null,null,G.prototype.Jb,G.prototype.xc,"CPUERR",1170],I[65528]=[null,null,G.prototype.Qb,G.prototype.Ec, +"MB",1170],I[65530]=[null,null,G.prototype.Vb,G.prototype.Hc,"PIR"],I[65532]=[null,null,G.prototype.ic,G.prototype.Vc,"SL"],I[65534]=[null,null,G.prototype.Yb,G.prototype.Kc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608];H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624]; +H[62634]=H[62624];H[62636]=H[62624];H[62638]=H[62624];H[62642]=H[62640];H[62644]=H[62640];H[62646]=H[62640];H[62648]=H[62640];H[62650]=H[62640];H[62652]=H[62640];H[62654]=H[62640];H[62658]=H[62656];H[62660]=H[62656];H[62662]=H[62656];H[62664]=H[62656];H[62666]=H[62656];H[62668]=H[62656];H[62670]=H[62656];H[62674]=H[62672];H[62676]=H[62672];H[62678]=H[62672];H[62680]=H[62672];H[62682]=H[62672];H[62684]=H[62672];H[62686]=H[62672];H[62690]=H[62688];H[62692]=H[62688];H[62694]=H[62688];H[62696]=H[62688]; +H[62698]=H[62688];H[62700]=H[62688];H[62702]=H[62688];H[62706]=H[62704];H[62708]=H[62704];H[62710]=H[62704];H[62712]=H[62704];H[62714]=H[62704];H[62716]=H[62704];H[62718]=H[62704];H[65410]=H[65408];H[65412]=H[65408];H[65414]=H[65408];H[65416]=H[65408];H[65418]=H[65408];H[65420]=H[65408];H[65422]=H[65408];H[65426]=H[65424];H[65428]=H[65424];H[65430]=H[65424];H[65432]=H[65424];H[65434]=H[65424];H[65436]=H[65424];H[65438]=H[65424];H[65442]=H[65440];H[65444]=H[65440];H[65446]=H[65440];H[65448]=H[65440]; +H[65450]=H[65440];H[65452]=H[65440];H[65454]=H[65440];H[65458]=H[65456];H[65460]=H[65456];H[65462]=H[65456];H[65464]=H[65456];H[65466]=H[65456];H[65468]=H[65456];H[65470]=H[65456];H[65506]=H[65504];H[65508]=H[65504];H[65510]=H[65504];H[65512]=H[65504];H[65514]=H[65504];H[65516]=H[65504];H[65518]=H[65504];q(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),Jb(this,Fb?Kb:Lb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&vb(this.m,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ha:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.la=!0},H:function(a,b){return this.I(a,b)}, +S:function(a,b){return this.W(a,b)},da:function(a,b,c){this.v||this.xb(a,b,c)},ja:function(a,b,c){this.v||this.ra(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},O:function(a,b){a&1&&vb(this.m,b);return this.g.getUint16(a,!0)},X:function(a,b){a&1&&vb(this.m,b);return this.o[a>>1]},ca:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&vb(this.m,c);this.g.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&vb(this.m,c);this.o[a>> +1]=b;this.la=!0}};function eb(a,b,c){a.G=b;a.h=a.j=0;c&&((a.h=c.h)&&Nb(a,Ob,!1),(a.j=c.j)&&Pb(a,Ob,!1))}function Pb(a,b,c){c&&a.j||(a.ib=!a.v&&b[1]||a.A,a.Va=!a.v&&b[3]||a.B);if(c||void 0===c)a.xb=b[1]||a.A,a.ra=b[3]||a.B}function Nb(a,b,c){c&&a.h||(a.cb=b[0]||a.w,a.T=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.W=b[2]||a.s}function Jb(a,b){b||(b=Qb);Nb(a,b,void 0);Pb(a,b,void 0)} +var Qb=[],Mb=[E.prototype.N,E.prototype.ha,E.prototype.ba,E.prototype.ta],Ob=[E.prototype.H,E.prototype.da,E.prototype.S,E.prototype.ja];if(Ta)var Lb=[E.prototype.D,E.prototype.ca,E.prototype.O,E.prototype.ia],Kb=[E.prototype.J,E.prototype.ga,E.prototype.X,E.prototype.sa]; +function Rb(a,b){u.call(this,"CPU",a,Rb);var c=a.multiplier||1;this.Pa=a.cycles||b;this.da=c;this.Ya=Math.round(this.Pa/1E4)/100;this.ga=this.Ya*this.da;this.i.U=!1;this.i.vb=!1;this.i.Ca=a.autoStart;this.i.Oa=!1;this.Ma=this.ia=0;this.Na=a.csStart;this.ra=a.csInterval;this.sa=a.csStop;this.H=[];this.rb=this.sc.bind(this);B(this)}w(Rb);var Sb=["power","reset"];g=Rb.prototype; +g.ea=function(a,b,c,d){this.w=a;this.m=b;this.G=d;for(b=0;ba.ba/a.ga&&(b=1),a.da=b,b=a.Ya*a.da,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.P("target speed: "+b)}a.J+=a.W;a.W=0;a.O=sa();a.ca=0;Yb(a)}function wb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function yb(a,b,c){0<=b&&ba.H[b][0]&&(c=a.Pa*a.da/1E3*c|0,a.H[b][0]=c+$b(a))}function $b(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c} +g.sc=function(){if(this.i.U){this.$a>=this.Pa&&Yb(this,!0);this.Aa=0;this.La=sa();if(this.ca){var a=this.La-this.ca;a>this.pb&&(this.O+=a,this.O>this.La&&(this.O=this.La))}try{do{for(var b,c=this.i.Oa?1:this.Qa,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wb(b)}catch(n){if("number"!=typeof n)throw n;}b=$b(this,!0);this.Aa+=b;this.W+=b;a=b;if(this.i.Oa){var f=!1;this.Ma=this.Ma+this.lb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.ra,f=!0);0<=this.sa&&this.sa<=Zb(this)&& +(this.ra=this.sa=-1,Vb(this),Xa(this),f=!0);f&&this.P(Zb(this)+" cycles: checksum="+ja(this.Ma))}for(var a=b,k=this.H.length-1;0<=k;k--){var l=this.H[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ta-=b;if(0>=this.ta){this.ta+=this.Qa;15<=++this.qb&&(this.w&&this.w.fa(),this.qb=0);break}}while(this.i.U)}catch(n){Xa(this);this.w&&this.w.stop(sa(),Zb(this));b=n.stack||n.message;this.i.error=!0;this.L(b);return}if(this.i.U){b=setTimeout;c=this.rb;this.ca=sa();d=this.pb;this.Aa&&(d=Math.round(d* +this.Aa/this.Qa));d-=this.ca-this.La;if(e=this.ca-this.O)this.ba=Math.round(this.W/(10*e))/100,864E5<=e&&(this.J=0,Xb(this));if(0>d||this.bad&&(this.O-=d),d=0;this.$a+=this.Aa;this.ca+=d;b(c,d)}}};function Wb(a){var b;a.i.error?(a.P(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.U)a.P(a.toString()+" busy");else{Xb(a);a.i.U=!0;a.i.vb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.O,Zb(a));setTimeout(a.rb,0)}}g.wb=function(){return 0}; +function Xa(a){if(a.i.U){$b(a);a.J+=a.W;a.W=0;a.i.U=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(sa(),Zb(a))}a.i.complete=void 0}function ac(a){this.Fa=+a.model||1170;this.nb=a.addrReset||0;Rb.call(this,a,6666667);this.decode=1120==this.Fa?bc.bind(this):cc.bind(this);dc(this);this.S=0;this.X=null;this.i.complete=this.i.Bb=!1}w(ac,Rb);g=ac.prototype;g.reset=function(){this.status("model "+this.Fa);this.i.U&&Xa(this);dc(this);Ub(this);this.i.error=!1;this.parent.reset.call(this)}; +function dc(a){a.j=65536;a.g=32768;a.h=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.nb];a.ua=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.s=0;a.Ja=0;a.Fb=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.ub=[0,0,0,0,0,0,0,0];a.tb=0;a.l=0;a.B=a.D=0;a.c=a.b=a.Xa=0;a.ja=-1;ec(a)}function ec(a){a.qa=255;a.F=0;a.gb=0;a.A=0;a.oa=0;a.fb=0;a.pa=0;a.Da=0;a.Ia=0;a.Za=262143;a.Ka=253952;a.l|=2;a.m&&Ab(a)}function Ab(a){a.Da?(a.N=65536,a.I=a.Eb,a.T=a.pc,a.Va=a.bd,hb(a.m,a.pa&16?22:18)):(a.N=0,a.I=a.Db,a.T=a.oc,a.Va=a.ad,hb(a.m,16))}g.lb=function(){return 0}; +g.save=function(){var a=new K(this);a.set(0,[]);a.set(1,[this.J,this.da]);a.set(2,rb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Xb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c>14&3;c=a.u>>14&3;a.s!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.s]);a.u=b;a.l|=2}function N(a,b){a.l&128||(a.o=a.h=b,a.g=0)}function O(a,b,c){a.l&128||(a.o=a.h=a.j=b,a.g=c||0)}function gc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^b)&(d^b))}function P(a,b){a.l&128||(a.o=a.h=a.j=b,a.g=a.o^a.j>>1)}function hc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^d)&(d^b))} +function F(a,b,c){if(!a.S){var d=!1;0>a.ja?a.ja=Za(a):a.s||(b=4,d=!0);a.A&57344||(a.oa=63222,a.fb=b);a.s=0;var e=a.T(b|a.N),f=a.T(b+2&65535|a.N);Cb(a,f&-12289|a.ja>>2&12288);d&&(a.F|=4,a.f[6]=4);ic(a,a.ja);ic(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function jc(a){var b=kc(a),c=kc(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);M(a,b);Cb(a,c);a.l&=-17} +function lc(a,b,c){var d,e,f,k=0;d=b>>13;a.pa&a.Fb[a.s]||(d&=7);e=a.C[a.s][d];f=(a.R[a.s][d]<<6)+(b&8191)&a.Za;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Hb[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ka&&4186112>f&&(a.F|=32,F(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: +128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Ia=a.s,a.Ja=d;k&&(k&57344&&(0<=a.ja&&(k|=128),a.A&57344||(a.A=a.A|k|a.Ia<<5|a.Ja<<1),F(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.m].ib(b&a.g,c&255,b)}function kc(a){var b=a.T(a.f[6]|a.N);a.f[6]=a.f[6]+2&65535;return b} +function ic(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.oa=a.oa<<8|246);!a.s&&c<=a.qa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.T(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.T(e)|k;a.a-= +8;break;case 6:return e=fc(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=fc(a),e=e+a.f[c]&65535,e=a.T(e|a.N)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.F|=4,a.f[6]=4,F(a,4,24)):(a.F|=8,a.l|=64));return e}g.Ta=function(a,b){this.Da?(this.S++,mc(this,lc(this,a,5),b),this.S--):this.m.Ta(a,b)};g.Db=function(a,b,c){return nc(this,a,b,c)};g.Eb=function(a,b,c){return lc(this,nc(this,a,b,c),c)}; +g.oc=function(a){return pb(this.m,a)};g.pc=function(a){return pb(this.m,lc(this,a,2))};g.ad=function(a,b){qb(this.m,a,b&65535)};g.bd=function(a,b){qb(this.m,lc(this,a,4),b)};function oc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=nc(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.T(d|c&a.N),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.aa[a.u>>12&3];return c} +function pc(a,b,c,d){a.A&57344||(a.oa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=nc(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=lc(a,e|c&65536,4),a.s=a.u>>14&3,qb(a.m,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.aa[a.u>>12&3]=d}function qc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?pb(a.m,a.I(b,c,2)):a.f[c]}function rc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return nc(a,b,c,8)} +function sc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=ob(a.m,c)):a=a.f[c]&255;return a}function tc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.m,a.I(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Xa=a.I(b,e,7),mc(a,e,d.call(a,c,ob(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),qb(a.m,e,d.call(a,c,pb(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} +function uc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?mc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.m,a.I(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} +g.wb=function(a){this.i.complete=!0;this.i.Bb=!1;this.i.vb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?F(this,168,28):this.l&64?F(this,4,30):this.l&16&&F(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.gb&224)>>5;if(a=this.X&&this.X.va>c?this.X:null)b=a.vc,c=a.va;c>(this.u&224)>>5?(this.l&4&&(this.f[7]=this.f[7]+2&65535,this.l&=-5),F(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.X,c==a)this.X=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l& +1&&this.l++;this.A&57344||(this.oa=0,this.fb=this.f[7]);this.l=this.l&7|this.u&16;this.decode(fc(this))}while(0>1|b<<16;P(this,a);return a&65535}function Bc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function Cc(a,b){a=b&~a;N(this,a);return a}function Dc(a,b){a=b&~a;N(this,a<<8);return a}function Ec(a,b){a|=b;N(this,a);return a}function Fc(a,b){a|=b;N(this,a<<8);return a}function Gc(a,b){a=~b|65536;O(this,a);return a&65535}function Hc(a,b){a=~b|256;O(this,a<<8);return a&255} +function Ic(a,b){a=b-a;this.l&128||(this.o=this.h=a,this.g=b&(b^a));return a&65535}function Jc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.o=this.h=c,this.g=b&(b^c));return a&255}function Kc(a,b){a=b+a;this.l&128||(this.o=this.h=a,this.g=a&(b^a));return a&65535}function Lc(a,b){a=b+a;var c=a<<8;this.l&128||(this.o=this.h=c,this.g=c&(b<<8^c));return a&255}function Mc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Nc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} +function Oc(a,b){a=b<<1|this.j>>16&1;P(this,a);return a&65535}function Pc(a,b){a=b<<1|this.j>>16&1;P(this,a<<8);return a&255}function Qc(a,b){a=(this.j&65536|b)>>1|b<<16;P(this,a);return a&65535}function Rc(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Sc(a,b){var c=b-a;hc(this,c,a,b);return c&65535}function Tc(a,b){var c=b-a;hc(this,c<<8,a<<8,b<<8);return c&255}function Uc(a,b){this.l&128||(this.o=this.h=b&65280,this.g=this.j=0);return(b<<8|b>>8)&65535} +function Vc(a,b){a^=b;N(this,a);return a&65535}function Wc(a){S(this,a,Q(this,a),wc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Xc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.j=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.h=c;this.a-=(this.c?6:7)+b} +function Yc(a){var b=tc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function Zc(a){T(this,a,!L(this))}function $c(a){T(this,a,L(this))} +function ad(a){S(this,a,Q(this,a),Cc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function bd(a){R(this,a,qc(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function cd(a){S(this,a,Q(this,a),Ec);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function dd(a){R(this,a,qc(this,a),Fc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function ed(a){N(this,Q(this,a)&tc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){N(this,(qc(this,a)&sc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function gd(a){T(this,a,this.h&65535?0:4)}function hd(a){T(this,a,!this.ma()==!(this.g&32768))}function id(a){T(this,a,!!(this.h&65535)&&!this.ma()==!(this.g&32768))}function jd(a){T(this,a,!L(this)&&!!(this.h&65535))} +function kd(a){T(this,a,(this.h&65535?0:4)||!this.ma()!=!(this.g&32768))}function ld(a){T(this,a,L(this)||(this.h&65535?0:4))}function md(a){T(this,a,!this.ma()!=!(this.g&32768))}function nd(a){T(this,a,this.ma())}function od(a){T(this,a,!!(this.h&65535))}function pd(a){T(this,a,!this.ma())}function qd(){F(this,12,1);this.a-=5}function rd(a){T(this,a,!0)}function sd(a){T(this,a,!(this.g&32768))}function td(a){T(this,a,this.g&32768?2:0)} +function U(a){a&1&&(this.j=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.o=0);this.a-=5}function ud(a){var b=Q(this,a);a=tc(this,a);hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function vd(a){var b=qc(this,a)<<8;a=sc(this,a)<<8;hc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} +function wd(a){var b=tc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.o=d>>16):(this.g=32768,this.h=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.o=0,this.g=32768,this.j=65536,this.a-=7}function xd(){F(this,24,2);this.a-=25}function yd(){this.u&49152?(this.F|=128,F(this,4,3)):Xa(this);this.a-=7} +function zd(){F(this,16,4);this.a-=25}var Ad=[0,7,7,10,7,11,9,13];function V(a){var b=this.a;M(this,rc(this,a));this.a=b-Ad[this.c]}var Bd=[0,14,14,17,14,18,16,20];function Cd(a){var b=this.a,c=rc(this,a);a=a>>6&7;ic(this,this.f[a]);this.f[a]=this.f[7];M(this,c);this.a=b-Bd[this.c]}var Dd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ed(a){var b=Q(this,a),c=this.a;N(this,vc(this,a,b));this.a=c-Dd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)} +function Fd(a){var b=qc(this,a);N(this,uc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Gd=[7,13,13,17,14,18,17,21];function Hd(a){var b=tc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.o=b>>16,this.h=this.o|b,this.g=0,this.j=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Nd(a){S(this,a,Q(this,a),Sc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function X(a){S(this,a,0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){F(this,28,5);this.a-=5}function Qd(){this.l&4||this.w.fa();this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Rd(a){S(this,a,Q(this,a),Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Sd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a>>6&3].call(this,a)}function Zd(a){$d[a&15].call(this,a)} +function ae(a){be[a&15].call(this,a)}function ce(a){de[a>>6&3].call(this,a)}function ee(a){fe[a>>6&3].call(this,a)}function ge(a){he[a>>6&3].call(this,a)} +var Sd=[function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,Y,function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ie=[function(a){ke[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,Y,Y,Y],Ud=[function(a){O(this,vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Mc); +this.a-=this.c?11:6},function(a){S(this,a,L(this)?1:0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,L(this)?1:0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=tc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Yd=[function(a){S(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)}],ke=[function(a){le[a& +15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,Y,Zd,ae,X,X,X,X],le=[yd,Qd,Kd,qd,zd,Jd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],$d=[Id,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.h=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],be=[Id,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.h=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],je=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,Y,Y,Y],de=[function(a){O(this,uc(this,a,0)); +this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],fe=[function(a){R(this,a,0,Nc);this.a-=this.c?11:6},function(a){R(this,a,L(this)?1:0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,L(this)?1:0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=sc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],he= +[function(a){R(this,a,0,Rc);this.a-=this.c?9+(this.Xa&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Bc);this.a-=this.c?9+(this.Xa&1):3+(7==this.b?2:0)},function(a){R(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}];function cc(a){me[a>>12].call(this,a)} +var me=[function(a){ne[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Wc,function(a){oe[a>>8&15].call(this,a)},function(a){pe[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Nd,Y],ne=[function(a){qe[a>>4&15].call(this,a)},rd,od,gd,hd,md,id,kd,Cd,Cd,Td,Vd,Xd,function(a){re[a>>6&3].call(this,a)},Y,Y],re=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.T(a|this.N);M(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=oc(this,a,0);ic(this,a);N(this,a);this.a-=11},function(a){var b=kc(this),c=this.a; +pc(this,a,0,b);N(this,b);this.a=c-Gd[this.c]},function(a){N(this,vc(this,a,this.ma?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],qe=[function(a){se[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Ld,function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.l|=1),this.a-=5):F(this,8,6)},Zd,ae,X,X,X,X],se=[yd,Qd,Kd,qd,zd,Jd,function(){jc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],oe=[Hd,Hd,wd,wd,Xc,Xc,Yc,Yc,Rd,Rd,Y,Y,Y,Y,Md,Md],pe=[pd,nd,jd,ld,sd,td,Zc,$c,xd,Od,ce,ee,ge,function(a){te[a>>6&3].call(this,a)},Y, +Y],te=[Y,function(a){a=oc(this,a,65536);ic(this,a);N(this,a);this.a-=11},function(a){var b=kc(this),c=this.a;pc(this,a,65536,b);N(this,b);this.a=c-Gd[this.c]},Y]; +function ue(a){u.call(this,"ROM",a,ue);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;h(a,null,!0,function(a,b,f){f?c.L("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.Ha,a,b),(a=ua(a,b))?(c.b=a.K,c.Y=a.Y):c.g=null,ve(c))})}}w(ue);ue.prototype.ea=function(a,b,c,d){this.m=b;this.a=c;this.G=d;ve(this)}; +ue.prototype.$=function(){this.Y&&(this.G&&this.G.a(this.id,this.j,this.c,this.Y),delete this.Y);return!0};ue.prototype.Z=function(){return!0}; +function ve(a){if(!Sa(a)){if(a.g){if(!a.b||!a.m)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.i.error=!0;a.L(b)}else{b=a.j;if(kb(a.m,b,a.c,Ib)){var c;for(c=0;c=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ga)return;b=qa(b[1]);if(this.s=Qa(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ha+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.mb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +g.Z=function(a){return a?this.save():!0};g.reset=function(){Be(this)};g.save=function(){var a=new K(this);a.set(0,[]);return a.data()};g.restore=function(){return Be(this)};function Be(a){a.D=0;a.b=0;a.c=128;a.h=[];return!0}g.eb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j), +this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;yb(this.a,this.J,1)}};var Ce={},Ae=(Ce[65392]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RCSR"],Ce[65394]=[null,null,Z.prototype.cc,Z.prototype.Pc,"RBUF"],Ce[65396]=[null,null,Z.prototype.rc,Z.prototype.dd,"XCSR"],Ce[65398]=[null,null,Z.prototype.qc,Z.prototype.cd,"XBUF"],Ce);q(function(){for(var a=A(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bHe){if(Je(d,this.s)){this.j=new K(this,"1.30.1","failsafe");Je(this.j)&&(Oe(this,d),a=2,Pe(this.j));this.j.set("timestamp",ta());Qe(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ne(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Je(d,k):("error"== +f&&"no machine state"!=k?(this.L("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),Pe(d),Je(d)?(c=Ne(d),e=!0):c=!1))}e&&Me(this,c?d:null)}else 2==a&&d.clear()}else Me(this);delete this.s;delete this.A}e=x(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.i.M=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Re(this,this.a,b,c,a),this.a.Ca());this.H&&(Oe(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +function Oe(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}} +function Se(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.M=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);Ze(a,b,c)}})}else c(a,null)} +function $e(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--We||Ga(!0));n=!1}var k,l,n=!0;We++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css";C.styleSheet?C.styleSheet.cssText=r:C.appendChild(document.createTextNode(r));t.appendChild(C)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?Xe(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--We||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--We||Ga(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xe(b,a,d,!0,e,r):Ye(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Pd){f(Pd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return $e(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map