Merge branch 'master' into gh-pages

This commit is contained in:
Jeff Parsons 2017-02-22 15:39:06 -08:00
commit 48120dc08f
52 changed files with 13670 additions and 371 deletions

View file

@ -114,6 +114,7 @@ module.exports = function(grunt) {
* @property {Array.<string>} c1pJSFiles
* @property {Array.<string>} pcX86Files
* @property {Array.<string>} pc8080Files
* @property {Array.<string>} pdp10Files
* @property {Array.<string>} pdp11Files
* @property {Array.<string>} closureCompilerExterns
*/
@ -122,6 +123,7 @@ module.exports = function(grunt) {
var tmpC1Pjs = "./tmp/c1pjs/" + pkg.version + "/c1p.js";
var tmpPCx86 = "./tmp/pcx86/" + pkg.version + "/pcx86.js";
var tmpPC8080 = "./tmp/pc8080/" + pkg.version + "/pc8080.js";
var tmpPDP10 = "./tmp/pdpjs/" + pkg.version + "/pdp10.js";
var tmpPDP11 = "./tmp/pdpjs/" + pkg.version + "/pdp11.js";
grunt.initConfig({
@ -176,6 +178,19 @@ module.exports = function(grunt) {
src: pkg.pc8080Files,
dest: "./versions/pc8080/" + pkg.version + "/pc8080-dbg.js"
},
"pdp10.js": {
src: pkg.pdp10Files,
dest: "./versions/pdpjs/" + pkg.version + "/pdp10.js",
options: {
process: function(src, filepath) {
return (path.basename(filepath) == "debugger.js"? "" : src);
}
}
},
"pdp10-dbg.js": {
src: pkg.pdp10Files,
dest: "./versions/pdpjs/" + pkg.version + "/pdp10-dbg.js"
},
"pdp11.js": {
src: pkg.pdp11Files,
dest: "./versions/pdpjs/" + pkg.version + "/pdp11.js",
@ -243,6 +258,24 @@ module.exports = function(grunt) {
}
}
},
"tmp-pdp10": {
src: pkg.pdp10Files,
dest: tmpPDP10,
options: {
banner: '"use strict";\n\n',
process: function(src, filepath) {
return "/**\n * @copyright " + filepath.replace(/^\./, "http://pcjs.org") + " (C) Jeff Parsons 2012-2017\n */\n\n" +
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?/g, '')
.replace(/^(import|export)[ \t]+[^\n]*\n/gm, '')
.replace(/^[ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);/gm, '')
.replace(/^[ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;/gm, '')
.replace(/\/\*\*\s*\*\s*@fileoverview[\s\S]*?\*\/\s*/g, '')
.replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
.replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '')
.replace(/[ \t]*[A-Za-z_][A-Za-z0-9_.]*\.assert\([^\n]*\);[^\n]*/g, '');
}
}
},
"tmp-pdp11": {
src: pkg.pdp11Files,
dest: tmpPDP11,
@ -281,11 +314,14 @@ module.exports = function(grunt) {
src: pkg.pc8080Files,
dest: tmpPC8080
},
"pdp10.js": {
src: pkg.pdp10Files,
dest: tmpPDP10
},
"pdp11.js": {
src: pkg.pdp11Files,
dest: tmpPDP11
}
},
closureCompiler: {
options: {
@ -293,7 +329,7 @@ module.exports = function(grunt) {
compilerFile: "./bin/compiler.jar",
// [OPTIONAL] set to true if you want to check if files were modified before starting compilation
checkModified: grunt.option("rebuild")? false : true,
checkModified: !grunt.option("rebuild"),
// [OPTIONAL] Set Closure Compiler Directives here
compilerOpts: {
@ -420,6 +456,33 @@ module.exports = function(grunt) {
src: tmpPC8080,
dest: "./versions/pc8080/" + pkg.version + "/pc8080-dbg.js"
},
"pdp10.js": {
TEMPcompilerOpts: {
create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp10.map",
define: ["\"APPVERSION='" + pkg.version + "'\"",
"\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=false"],
output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pdpjs/" + pkg.version + "/pdp10.map\""
// output_wrapper: "\"(function(){%output%})();\""
},
// src: pkg.pdp10Files,
src: tmpPDP10,
dest: "./versions/pdpjs/" + pkg.version + "/pdp10.js"
},
"pdp10-dbg.js": {
/*
* Technically, this is the one case we don't need to override the default 'define' settings, but maybe it's best to be explicit.
*/
TEMPcompilerOpts: {
create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp10-dbg.map",
define: ["\"APPVERSION='" + pkg.version + "'\"",
"\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=true"],
output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pdpjs/" + pkg.version + "/pdp10-dbg.map\""
// output_wrapper: "\"(function(){%output%})();\""
},
// src: pkg.pdp10Files,
src: tmpPDP10,
dest: "./versions/pdpjs/" + pkg.version + "/pdp10-dbg.js"
},
"pdp11.js": {
TEMPcompilerOpts: {
create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp11.map",
@ -522,6 +585,26 @@ module.exports = function(grunt) {
}
}
},
"pdp10": {
files: [
{
cwd: "modules/shared/templates/",
src: ["common.css", "common.xsl", "components.*", "document.css", "document.xsl", "machine.xsl", "manifest.xsl", "outline.xsl"],
dest: "versions/pdpjs/<%= pkg.version %>/",
expand: true
}
],
options: {
process: function(content, srcPath) {
var s = content.replace(/(<xsl:variable name="APPCLASS">)[^<]*(<\/xsl:variable>)/g, "$1pdp10$2");
s = s.replace(/(<xsl:variable name="APPNAME">)[^<]*(<\/xsl:variable>)/g, "$1PDPjs$2");
s = s.replace(/(<xsl:variable name="APPVERSION">)[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2");
s = s.replace(/"[^"]*\/?(common.css|common.xsl|components.css|components.xsl|document.css|document.xsl)"/g, '"/versions/pdpjs/' + pkg.version + '/$1"');
s = s.replace(/[ \t]*\/\*[^*][\s\S]*?\*\//g, "").replace(/[ \t]*<!--[^@]*?-->[ \t]*\n?/g, "");
return s;
}
}
},
"pdp11": {
files: [
{
@ -667,7 +750,7 @@ module.exports = function(grunt) {
grunt.loadTasks("modules/grunts/prepjs/tasks");
grunt.registerTask("preCompiler", grunt.option("rebuild")? ["concat:tmp-c1pjs", "concat:tmp-pcx86", "concat:tmp-pc8080", "concat:tmp-pdp11"] : ["newer:concat:tmp-c1pjs", "newer:concat:tmp-pcx86", "newer:concat:tmp-pc8080", "newer:concat:tmp-pdp11"]);
grunt.registerTask("preCompiler", grunt.option("rebuild")? ["concat:tmp-c1pjs", "concat:tmp-pcx86", "concat:tmp-pc8080", "concat:tmp-pdp10", "concat:tmp-pdp11"] : ["newer:concat:tmp-c1pjs", "newer:concat:tmp-pcx86", "newer:concat:tmp-pc8080", "newer:concat:tmp-pdp10", "newer:concat:tmp-pdp11"]);
grunt.registerTask("compile", ["preCompiler", "closureCompiler", "replace:fix-source-maps"]);

View file

@ -6,6 +6,7 @@ redirect_from:
- /configs/pc/machines/5150/cga/64kb/donkey/
- /configs/pc/machines/5150/cga/64kb/donkey/machine.xml/
- /demos/pc/donkey/
- /devices/pc/machine/5150/cga/64kb/donkey/
machines:
- type: pcx86
id: ibm5150

View file

@ -3,10 +3,13 @@ layout: page
title: IBM PC XT (Model 5160, 256Kb, 10Mb Drive, Color Display) running Windows 1.01
permalink: /devices/pcx86/machine/5160/cga/256kb/win101/
redirect_from:
- /configs/pc/machines/5160/cga/win101/
- /configs/pc/machines/5160/cga/256kb/win101/
- /configs/pc/machines/5160/cga/256kb/win101/machine.xml/
- /demos/pc/cga-win101/xt-cga-win101.xml/
- /demos/pc/cga-win101/
- /devices/pc/machine/5160/cga/256kb/win101/
- /devices/pc/machine/5160/cga/256kb/win101/machine.xml/
machines:
- type: pcx86
id: ibm5160

View file

@ -2,6 +2,8 @@
layout: page
title: "IBM PC (Model 5150) running Zork I"
permalink: /disks/pcx86/games/infocom/zork1/
redirect_from:
- /disks/pc/games/infocom/zork1/
machines:
- type: pcx86
id: ibm5150-zork1

View file

@ -2,6 +2,8 @@
layout: page
title: Microsoft Macro Assembler 1.00
permalink: /disks/pcx86/tools/microsoft/masm/1.00/
redirect_from:
- /disks/pc/tools/microsoft/masm/1.00/
---
Microsoft Macro Assembler 1.00

View file

@ -6,6 +6,7 @@ redirect_from:
- /configs/pc/machines/5160/ega/640kb/win101/
- /devices/pc/machine/5160/ega/640kb/win101/
- /devices/pc/machine/5160/ega/640kb/win101/debugger/
- /disks/pc/windows/1.01/
machines:
- type: pcx86
id: ibm5160

View file

@ -2,6 +2,8 @@
layout: page
title: Microsoft Windows 3.10
permalink: /disks/pcx86/windows/3.10/
redirect_from:
- /disks/pc/windows/3.10/
machines:
- type: pcx86
id: ibm5170-win310

View file

@ -44,9 +44,9 @@
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
*/
var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={lp:0,np:1,op:2,hl:3,pp:4,qp:5,rp:6,sp:7,tp:8,up:9,vp:10,wp:11,xp:12,yp:13,zp:14,Ap:15,Bp:16,Cp:17,Dp:18,Ep:19,Fp:20,Gp:21,Hp:22,Ip:23,Jp:24,Kp:25,Lp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,dn:108,hn:109,n:110,qn:111,p:112,q:113,r:114,No:115,t:116,Qo:117,Ro:118,So:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Mp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];
fa[191]=n["?"];fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"];
function ga(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ha(a,b){var c,d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function ia(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=ha(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
@ -106,39 +106,39 @@ l.fc=function(a,b){this.aa[(a&this.C)>>>this.A].Dc(a&this.D,b&255,a)};function B
function Cc(a,b){var c=0,d=[],e=!a.J&&a.N==a.C;e||fc(a,!0);for(var f=0;f<a.M;f++){var g=a.aa[f];if(b&&g.type!=vc||g.Oa||g.qj){d[c++]=f;var h=c++;if(g=g.save()){for(var k=0,m=0,p=[];k<g.length;){for(var w=g[k],u=k+1;u<g.length&&g[u]===w;)u++;p[m++]=u-k;p[m++]=w;k=u}p.length<g.length&&(g=p)}d[h]=g}}e||fc(a,!1);d[c]=e;return d}function Dc(a,b){if(null==b)return a.K=!a.K,a.K;void 0===a.F[b]&&(a.F[b]=[null,!1]);a.F[b][1]=!a.F[b][1];return a.F[b][1]}
function Ec(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.F[k]?Wa("Input port "+ka(k)+" already registered"):f.F[k]=[h,!1]}}function Fc(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.F[b],h=a.Y[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g?(g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k),a.ba&&a.K!=g[1]&&Gc(a.ba,b,m)):a.ba&&(Db(a.ba,a,b,null,d),a.K&&Gc(a.ba,b,m));e|=m<<f;f+=h<<3;b+=h;c-=h}return e}
function Hc(a,b){if(null==b)return a.L=!a.L,a.L;void 0===a.G[b]&&(a.G[b]=[null,!1]);a.G[b][1]=!a.G[b][1];return a.G[b][1]}function Ic(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.G[k]?Wa("Output port "+ka(k)+" already registered"):f.G[k]=[h,!1]}}
function Jc(a,b,c,d,e){for(var f=0;0<c;){var g=a.G[b],h=a.Z[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,e);a.ba&&a.L!=g[1]&&Kc(a.ba,b,k)}else a.ba&&(Db(a.ba,a,b,k,e),a.L&&Kc(a.ba,b,k));f+=h<<3;b+=h;c-=h}}function hc(a,b,c,d,e){b="Memory block error ("+b+": "+q(c)+","+q(d)+")";e?a.ba?a.ba.message(b):a.log(b):Wa(b);return!1}var Ub,Lc={Hk:20,count:8,Zp:1,type:3},Nc=0,Oc;for(Oc in Lc){var Pc=Lc[Oc];Lc[Oc]={nh:(1<<Pc)-1<<Nc,shift:Nc};Nc+=Pc}Ub=Lc;
function Jc(a,b,c,d,e){for(var f=0;0<c;){var g=a.G[b],h=a.Z[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,e);a.ba&&a.L!=g[1]&&Kc(a.ba,b,k)}else a.ba&&(Db(a.ba,a,b,k,e),a.L&&Kc(a.ba,b,k));f+=h<<3;b+=h;c-=h}}function hc(a,b,c,d,e){b="Memory block error ("+b+": "+q(c)+","+q(d)+")";e?a.ba?a.ba.message(b):a.log(b):Wa(b);return!1}var Ub,Lc={Hk:20,count:8,aq:1,type:3},Nc=0,Oc;for(Oc in Lc){var Pc=Lc[Oc];Lc[Oc]={nh:(1<<Pc)-1<<Nc,shift:Nc};Nc+=Pc}Ub=Lc;
var ic=1,lc=2,oc=3,qc=4,tc=5,Qc;if(Eb){var Rc=new ArrayBuffer(2);(new DataView(Rc)).setUint16(0,256,!0);Qc=256===(new Uint16Array(Rc))[0]}else Qc=!1;var wc=Qc;
function x(a,b,c,d,e,f){this.id=Sc+=2;this.X=null;this.H=0;this.xa=a;this.ve=b;this.size=c||0;this.type=d||Tc;this.D=d==vc;this.controller=null;this.C=f;ec(this);this.Oa=this.qj=!1;if(c)if(e)this.controller=e,a=e.vj(a),this.X=a[0],this.H=a[1],pc(this,e.fh());else if(Eb)this.I=new ArrayBuffer(c),this.G=new DataView(this.I,0,c),this.Pa=new Uint8Array(this.I,0,c),this.Rd=new Uint16Array(this.I,0,c>>1),this.X=new Int32Array(this.I,0,c>>2),pc(this,wc?xc:yc);else{this.X=Array(c>>2);for(e=0;e<this.X.length;e++)this.X[e]=
0;pc(this,zc)}else pc(this)}l=x.prototype;l.ih=function(a){this.xa=a};l.save=function(){var a,b;if(this.controller)a=null;else if(Eb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.getInt32(b<<2,!0);else a=this.X;return a};l.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Eb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.X=a;return this.Oa=!0}return!1};function pc(a,b,c){b||(b=a.type==Uc?Vc:a.type==Wc?Xc:Yc);Zc(a,b,c);$c(a,b,c)}
function Zc(a,b,c){c&&a.he||(a.Bc=b[0]||a.Tk,a.Mf=b[2]||a.Uk,a.Nd=b[4]||a.Rk);if(c||void 0===c)a.Zd=b[0]||a.Tk,a.Nf=b[2]||a.Uk,a.ji=b[4]||a.Rk}function $c(a,b,c){c&&a.ie||(a.Dc=!a.D&&b[1]||a.cf,a.Tf=!a.D&&b[3]||a.pi,a.Sf=!a.D&&b[5]||a.oi);if(c||void 0===c)a.bf=b[1]||a.cf,a.ri=b[3]||a.pi,a.K=b[5]||a.oi}function ad(a){a.Bc=a.Zd;a.Mf=a.Nf;a.Nd=a.ji}function bd(a){a.Dc=a.D?a.cf:a.bf;a.Tf=a.D?a.pi:a.ri;a.Sf=a.D?a.oi:a.K}
l.Gd=function(a,b,c){b?this.ie++||(c&&(this.C=c),$c(this,cd,!1)):this.he++||(c&&(this.C=c),Zc(this,cd,!1))};function ec(a,b,c){a.ba=b;a.he=a.ie=0;c&&(c.C&&(a.C=c.C),(a.he=c.he)&&Zc(a,cd,!1),(a.ie=c.ie)&&$c(a,cd,!1))}l.Tk=function(a,b){this.ba&&t(this.ba,129)&&this.ba.message("attempt to read invalid block %"+q(b),!0);return 255};l.cf=function(a,b,c){this.ba&&t(this.ba,129)&&this.ba.message("attempt to write "+ka(b)+" to invalid block %"+q(c),!0)};
l.Uk=function(a,b){return this.Bc(a++,b++)|this.Bc(a,b)<<8};l.Rk=function(a,b){return this.Bc(a++,b++)|this.Bc(a++,b++)<<8|this.Bc(a++,b++)<<16|this.Bc(a,b)<<24};l.pi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a,b>>8,c)};l.oi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a++,b>>8&255,c++);this.Dc(a++,b>>16&255,c++);this.Dc(a,b>>>24,c)};l.vo=function(a){return this.X[a>>2]>>>((a&3)<<3)&255};
l.Ho=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b]>>a;return 24>a?c&65535:c&255|(this.X[b+1]&255)<<8};l.Bo=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b];a&&(c=c>>>a|this.X[b+1]<<32-a);return c};l.To=function(a,b){var c=a>>2;a=(a&3)<<3;this.X[c]=this.X[c]&~(255<<a)|b<<a;this.Oa=!0};l.fp=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.X[c]=this.X[c]&~(65535<<a)|b<<a:(this.X[c]=this.X[c]&16777215|b<<24,c++,this.X[c]=this.X[c]&-256|b>>8);this.Oa=!0};
l.Zo=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.X[c]=this.X[c]&~d|b<<a;c++;this.X[c]=this.X[c]&d|b>>>32-a}else this.X[c]=b;this.Oa=!0};l.uo=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a)||this.C&&ed(this.C,b,1,!1);return this.Zd(a,b)};l.Go=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,2)||this.C&&ed(this.C,b,2,!1);return this.Nf(a,b)};l.Ao=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,4)||this.C&&ed(this.C,b,4,!1);return this.ji(a,b)};
l.So=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a)||this.C&&ed(this.C,c,1,!0);this.D?this.cf(0,b,c):this.bf(a,b,c)};l.ep=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,2)||this.C&&ed(this.C,c,2,!0);this.D?this.cf(0,b,c):this.ri(a,b,c)};l.Yo=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,4)||this.C&&ed(this.C,c,4,!0);this.D?this.cf(0,b,c):this.K(a,b,c)};l.xo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Bc(a,b)};
l.Jo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Mf(a,b)};l.Do=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Nd(a,b)};l.Vo=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Dc(a,b,c)};l.hp=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Tf(a,b,c)};l.ap=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Sf(a,b,c)};
l.yo=function(a,b){return gd(this.C,b,!1).Bc(a,b)};l.Ko=function(a,b){return gd(this.C,b,!1).Mf(a,b)};l.Eo=function(a,b){return gd(this.C,b,!1).Nd(a,b)};l.Wo=function(a,b,c){gd(this.C,c,!0).Dc(a,b,c)};l.ip=function(a,b,c){gd(this.C,c,!0).Tf(a,b,c)};l.bp=function(a,b,c){gd(this.C,c,!0).Sf(a,b,c)};l.to=function(a){return this.Pa[a]};l.Qk=function(a){return this.Pa[a]};l.wo=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Bc=this.Qk;return this.Pa[a]};
l.Fo=function(a){return this.G.getUint16(a,!0)};l.Vk=function(a){return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.Io=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Mf=this.Vk;return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.zo=function(a){return this.G.getInt32(a,!0)};l.Sk=function(a){return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};
l.Co=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Nd=this.Sk;return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};l.Ro=function(a,b){this.Pa[a]=b;this.Oa=!0};l.el=function(a,b){this.Pa[a]=b;this.Oa=!0};l.Uo=function(a,b){this.Pa[a]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Dc=this.el;this.pd.Oa=!0};l.cp=function(a,b){this.G.setUint16(a,b,!0);this.Oa=!0};l.gl=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.Oa=!0};
l.gp=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Tf=this.gl;this.pd.Oa=!0};l.Xo=function(a,b){this.G.setInt32(a,b,!0);this.Oa=!0};l.fl=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.Oa=!0};
l.$o=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Sf=this.fl;this.pd.Oa=!0};function hd(a){Eb&&!wc&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var Tc=0,vc=2,Uc=5,Wc=6,id=["black","blue","green","cyan"],kc="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),Sc=0,Yc=[],zc=[x.prototype.vo,x.prototype.To,x.prototype.Ho,x.prototype.fp,x.prototype.Bo,x.prototype.Zo],cd=[x.prototype.uo,x.prototype.So,x.prototype.Go,x.prototype.ep,x.prototype.Ao,x.prototype.Yo],Xc=[x.prototype.xo,x.prototype.Vo,x.prototype.Jo,x.prototype.hp,x.prototype.Do,x.prototype.ap],Vc=[x.prototype.yo,x.prototype.Wo,x.prototype.Ko,x.prototype.ip,x.prototype.Eo,x.prototype.bp];
if(Eb)var yc=[x.prototype.to,x.prototype.Ro,x.prototype.Fo,x.prototype.cp,x.prototype.zo,x.prototype.Xo],xc=[x.prototype.Qk,x.prototype.el,x.prototype.Vk,x.prototype.gl,x.prototype.Sk,x.prototype.fl],nd=[x.prototype.wo,x.prototype.Uo,x.prototype.Io,x.prototype.gp,x.prototype.Co,x.prototype.$o];
l.Uk=function(a,b){return this.Bc(a++,b++)|this.Bc(a,b)<<8};l.Rk=function(a,b){return this.Bc(a++,b++)|this.Bc(a++,b++)<<8|this.Bc(a++,b++)<<16|this.Bc(a,b)<<24};l.pi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a,b>>8,c)};l.oi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a++,b>>8&255,c++);this.Dc(a++,b>>16&255,c++);this.Dc(a,b>>>24,c)};l.xo=function(a){return this.X[a>>2]>>>((a&3)<<3)&255};
l.Jo=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b]>>a;return 24>a?c&65535:c&255|(this.X[b+1]&255)<<8};l.Do=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b];a&&(c=c>>>a|this.X[b+1]<<32-a);return c};l.Vo=function(a,b){var c=a>>2;a=(a&3)<<3;this.X[c]=this.X[c]&~(255<<a)|b<<a;this.Oa=!0};l.hp=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.X[c]=this.X[c]&~(65535<<a)|b<<a:(this.X[c]=this.X[c]&16777215|b<<24,c++,this.X[c]=this.X[c]&-256|b>>8);this.Oa=!0};
l.ap=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.X[c]=this.X[c]&~d|b<<a;c++;this.X[c]=this.X[c]&d|b>>>32-a}else this.X[c]=b;this.Oa=!0};l.wo=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a)||this.C&&ed(this.C,b,1,!1);return this.Zd(a,b)};l.Io=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,2)||this.C&&ed(this.C,b,2,!1);return this.Nf(a,b)};l.Co=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,4)||this.C&&ed(this.C,b,4,!1);return this.ji(a,b)};
l.Uo=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a)||this.C&&ed(this.C,c,1,!0);this.D?this.cf(0,b,c):this.bf(a,b,c)};l.gp=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,2)||this.C&&ed(this.C,c,2,!0);this.D?this.cf(0,b,c):this.ri(a,b,c)};l.$o=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,4)||this.C&&ed(this.C,c,4,!0);this.D?this.cf(0,b,c):this.K(a,b,c)};l.zo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Bc(a,b)};
l.Lo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Mf(a,b)};l.Fo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Nd(a,b)};l.Xo=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Dc(a,b,c)};l.jp=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Tf(a,b,c)};l.cp=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Sf(a,b,c)};
l.Ao=function(a,b){return gd(this.C,b,!1).Bc(a,b)};l.Mo=function(a,b){return gd(this.C,b,!1).Mf(a,b)};l.Go=function(a,b){return gd(this.C,b,!1).Nd(a,b)};l.Yo=function(a,b,c){gd(this.C,c,!0).Dc(a,b,c)};l.kp=function(a,b,c){gd(this.C,c,!0).Tf(a,b,c)};l.ep=function(a,b,c){gd(this.C,c,!0).Sf(a,b,c)};l.vo=function(a){return this.Pa[a]};l.Qk=function(a){return this.Pa[a]};l.yo=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Bc=this.Qk;return this.Pa[a]};
l.Ho=function(a){return this.G.getUint16(a,!0)};l.Vk=function(a){return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.Ko=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Mf=this.Vk;return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.Bo=function(a){return this.G.getInt32(a,!0)};l.Sk=function(a){return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};
l.Eo=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Nd=this.Sk;return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};l.To=function(a,b){this.Pa[a]=b;this.Oa=!0};l.el=function(a,b){this.Pa[a]=b;this.Oa=!0};l.Wo=function(a,b){this.Pa[a]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Dc=this.el;this.pd.Oa=!0};l.fp=function(a,b){this.G.setUint16(a,b,!0);this.Oa=!0};l.gl=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.Oa=!0};
l.ip=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Tf=this.gl;this.pd.Oa=!0};l.Zo=function(a,b){this.G.setInt32(a,b,!0);this.Oa=!0};l.fl=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.Oa=!0};
l.bp=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Sf=this.fl;this.pd.Oa=!0};function hd(a){Eb&&!wc&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var Tc=0,vc=2,Uc=5,Wc=6,id=["black","blue","green","cyan"],kc="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),Sc=0,Yc=[],zc=[x.prototype.xo,x.prototype.Vo,x.prototype.Jo,x.prototype.hp,x.prototype.Do,x.prototype.ap],cd=[x.prototype.wo,x.prototype.Uo,x.prototype.Io,x.prototype.gp,x.prototype.Co,x.prototype.$o],Xc=[x.prototype.zo,x.prototype.Xo,x.prototype.Lo,x.prototype.jp,x.prototype.Fo,x.prototype.cp],Vc=[x.prototype.Ao,x.prototype.Yo,x.prototype.Mo,x.prototype.kp,x.prototype.Go,x.prototype.ep];
if(Eb)var yc=[x.prototype.vo,x.prototype.To,x.prototype.Ho,x.prototype.fp,x.prototype.Bo,x.prototype.Zo],xc=[x.prototype.Qk,x.prototype.el,x.prototype.Vk,x.prototype.gl,x.prototype.Sk,x.prototype.fl],nd=[x.prototype.yo,x.prototype.Wo,x.prototype.Ko,x.prototype.ip,x.prototype.Eo,x.prototype.bp];
function od(a,b){ab.call(this,"CPU",a,1);b=a.cycles||b;var c=a.multiplier||1;this.T={};this.T.sd=b;this.T.Kd=c;this.T.rg=Math.round(this.T.sd/1E4)/100;this.T.oe=this.T.rg*this.T.Kd;this.ea.vb=!1;this.ea.ni=!1;this.ea.lf=a.autoStart;this.ea.kj=!1;this.ea.He=!1;this.T.uf=this.T.Te=0;this.T.wf=a.csStart;this.T.Se=a.csInterval;this.T.Ue=a.csStop;this.Ql=this.Uf.bind(this);zb(this)}ba(od,ab);l=od.prototype;
l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.ba=d;for(b=0;b<pd.length;b++)(c=this.na[pd[b]])&&this.pa.Cb(null,pd[b],c);this.Tc=Ob(a,"FPU");this.W=Ob(a,"ChipSet");a=qd(a,"autoStart");null!=a&&(this.ea.lf="true"==a?!0:"false"==a?!1:!!a);zb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.Xb=function(a,b){if(!b){if(a&&this.restore){rd(this);if(!this.restore(a))return!1;sd(this)}else this.reset();this.ba?this.ba.ih():this.P("No debugger detected")}td(this);return!0};l.Wb=function(a){return a?this.save():!0};l.lf=function(){return this.ea.lf||!this.ba&&void 0===this.na.run?(this.Uf(),!0):!1};l.uj=function(){return 0};
function sd(a){void 0===a.T.wf&&(a.T.wf=0);void 0===a.T.Se&&(a.T.Se=-1);void 0===a.T.Ue&&(a.T.Ue=-1);a.ea.He=0<=a.T.wf&&0<a.T.Se;a.ea.He&&(a.T.uf=0,a.T.Te=a.T.wf-a.Dd)}function ud(a,b){if(a.ea.He){var c=!1;a.T.uf=a.T.uf+a.uj()|0;a.T.Te-=b;0>=a.T.Te&&(a.T.Te+=a.T.Se,c=!0);0<=a.T.Ue&&a.T.Ue<=vd(a)&&(a.T.Se=a.T.Ue=-1,sd(a),a.Jb(),c=!0);c&&a.P(vd(a)+" cycles: checksum="+q(a.T.uf))}}
l.Cb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.na[b]=c;a=!0;break;case "run":this.na[b]=c;c.onclick=function(){var a;if(a=d.pa)if(a=d.pa,a.ea.Yb)a=!0;else{var b=null,c,h=jb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.ea.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.ea.Yb);c++);c==h.length&&(b=a);Wa("The "+b.type+" component ("+b.id+") is not "+(b.ea.ready?"powered yet":"ready yet"+(b.pg?" (waiting for notification)":""))+".");a=!1}a&&(d.ea.vb?d.Jb(!0):
d.Uf(!0))};a=!0;break;case "speed":this.na[b]=c;a=!0;break;case "setSpeed":this.na[b]=c,c.onclick=function(){wd(d,d.T.Kd<<1,!0)},c.textContent=this.T.oe.toFixed(2)+"Mhz",a=!0}return a};function xd(a,b){a.ea.vb&&(b=a.A-b,a.A-=b,a.zc-=b)}function yd(a,b,c){a.Dd+=b;c&&(a.zc=a.A=0)}
function zd(a,b){var c=Ad;c<Bd&&(c=Bd);c<Cd&&(c=Cd);var d=1;b&&1<a.T.Kd&&a.T.Wd&&(d=a.T.Wd/a.T.rg);a.T.Dj=Math.round(1E3/Ad);a.T.kn=Math.floor(a.T.sd/c*d);a.T.sh=Math.floor(a.T.sd/Ad*d);a.T.Fj=Math.floor(a.T.sd/Bd*d);a.T.Ej=Math.floor(a.T.sd/Cd*d);b||(a.T.Ve=a.T.sh,a.T.yf=a.T.Fj,a.T.xf=a.T.Ej);a.T.th=0}function vd(a,b){var c=a.Dd+a.md+a.zc-a.A;b&&1<a.T.Kd&&a.T.Wd>a.T.rg&&(c=Math.round(c/a.T.Kd));return c}function rd(a){a.T.Wd=0;a.Dd=a.md=a.zc=a.A=0;sd(a);wd(a,1)}
function zd(a,b){var c=Ad;c<Bd&&(c=Bd);c<Cd&&(c=Cd);var d=1;b&&1<a.T.Kd&&a.T.Wd&&(d=a.T.Wd/a.T.rg);a.T.Dj=Math.round(1E3/Ad);a.T.nn=Math.floor(a.T.sd/c*d);a.T.sh=Math.floor(a.T.sd/Ad*d);a.T.Fj=Math.floor(a.T.sd/Bd*d);a.T.Ej=Math.floor(a.T.sd/Cd*d);b||(a.T.Ve=a.T.sh,a.T.yf=a.T.Fj,a.T.xf=a.T.Ej);a.T.th=0}function vd(a,b){var c=a.Dd+a.md+a.zc-a.A;b&&1<a.T.Kd&&a.T.Wd>a.T.rg&&(c=Math.round(c/a.T.Kd));return c}function rd(a){a.T.Wd=0;a.Dd=a.md=a.zc=a.A=0;sd(a);wd(a,1)}
function wd(a,b,c){var d=!1;if(void 0!==b){.8>a.T.Wd/a.T.oe?b=1:d=!0;a.T.Kd=b;b=a.T.rg*a.T.Kd;if(a.T.oe!=b){a.T.oe=b;b=a.T.oe.toFixed(2)+"Mhz";var e=a.na.setSpeed;e&&(e.textContent=b);a.P("target speed: "+b)}c&&a.pa&&a.pa.ld()}yd(a,a.md);a.md=0;a.T.Xd=Ba();a.T.pe=0;zd(a);return d}
l.Uf=function(a){if(Bb(this,!0)){if(!this.ea.vb){wd(this);this.pa&&this.pa.start(this.T.Xd,vd(this));this.ea.vb=!0;this.ea.ni=!0;this.W&&this.W.start();var b=this.na.run;b&&(b.textContent="Halt");this.pa&&(Dd(this.pa,!0),a&&this.pa.ld(!0))}this.T.th>=this.T.sd&&zd(this,!0);this.T.zf=0;this.T.sg=Ba();this.T.pe&&(a=this.T.sg-this.T.pe,a>this.T.Dj&&(this.T.Xd+=a,this.T.Xd>this.T.sg&&(this.T.Xd=this.T.sg)));try{do{var c=this.ea.He?1:this.T.kn;if(this.W){Ed(this.W);var d=this.W;a=c;var e=d.G[0];if(e.le){var f=
l.Uf=function(a){if(Bb(this,!0)){if(!this.ea.vb){wd(this);this.pa&&this.pa.start(this.T.Xd,vd(this));this.ea.vb=!0;this.ea.ni=!0;this.W&&this.W.start();var b=this.na.run;b&&(b.textContent="Halt");this.pa&&(Dd(this.pa,!0),a&&this.pa.ld(!0))}this.T.th>=this.T.sd&&zd(this,!0);this.T.zf=0;this.T.sg=Ba();this.T.pe&&(a=this.T.sg-this.T.pe,a>this.T.Dj&&(this.T.Xd+=a,this.T.Xd>this.T.sg&&(this.T.Xd=this.T.sg)));try{do{var c=this.ea.He?1:this.T.nn;if(this.W){Ed(this.W);var d=this.W;a=c;var e=d.G[0];if(e.le){var f=
(vd(d.H,d.O)-e.jd)/d.Ba|0,g=Fd(d,0)-f;e.mode==Gd&&(g-=f);var h=g*d.Ba|0;e.mode==Gd&&(h>>=1);a>h&&(a=h)}var c=a,k=this.W;a=c;if(k.A&&k.A[Hd]&Id){var m=k.Z-vd(k.H,k.O);0<m&&a>m&&(a=m)}c=a}try{this.Lg(c)}catch(w){if("number"!=typeof w)throw w;}var p=this.zc-this.A;this.md+=p;this.T.zf+=p;yd(this,0,!0);ud(this,p);this.T.yf-=p;0>=this.T.yf&&(this.T.yf+=this.T.Fj,this.pa&&Jd(this.pa));this.T.xf-=p;0>=this.T.xf&&(this.T.xf+=this.T.Ej,this.pa&&Dd(this.pa));this.T.Ve-=p;if(0>=this.T.Ve){this.T.Ve+=this.T.sh;
break}}while(this.ea.vb)}catch(w){this.Jb();td(this);this.pa&&this.pa.stop(Ba(),vd(this));Bb(this,!1);wb(this,w.stack||w.message);return}c=setTimeout;d=this.Ql;this.T.pe=Ba();e=this.T.Dj;this.T.zf&&(e=Math.round(e*this.T.zf/this.T.sh));e-=this.T.pe-this.T.sg;if(f=this.T.pe-this.T.Xd)this.T.Wd=Math.round(this.md/(10*f))/100,864E5<=f&&(this.Dd=0,this.W&&Ed(this.W,!0),wd(this));if(0>e||this.T.Wd<this.T.oe)-1E3>e&&(this.T.Xd-=e),e=0;this.T.th+=this.T.zf;this.T.pe+=e;c(d,e)}else td(this),this.pa&&this.pa.stop(Ba(),
vd(this))};l.Lg=function(){return 0};l.Jb=function(a){Ab(this,!0);this.zc-=this.A;this.A=0;yd(this,this.md);this.md=0;if(this.ea.vb){this.ea.vb=!1;this.W&&this.W.stop();var b=this.na.run;b&&(b.textContent="Run")}this.ea.complete=a};function td(a,b){a.pa&&(Jd(a.pa,b),Dd(a.pa,b))}var Ad=30,Bd=60,Cd=2,pd=["power","reset"];
function Kd(a,b,c,d){this.gc=a;this.ba=a.ba;this.id=b;this.$b=c||"";this.U=0;this.Ka=65535;this.Nb=this.Ka+1;this.Ab=this.qc=this.ext=this.jb=this.type=this.ua=0;this.Lb=-1;this.V=this.Jc=2;this.R=this.wa=65535;this.G=this.mh;this.D=this.dj;this.F=this.fj;this.A={U:-1,ua:0,Ka:0,jb:0,type:0,ext:0,Lb:-1};1==this.id&&(this.Jf=0,this.C=null,this.Pe=!1,this.H=Array(32),this.B=[]);Md(this,!0,d)}function Nd(a,b){a.B.push(b);return[a.B.length,Od]}l=Kd.prototype;
l.mh=function(a){this.U=a&65535;return this.ua=this.U<<4};l.qg=function(a,b){var c,d,e=this.gc;a&=65535;a&4?(c=e.Eb.ua,d=c+e.Eb.Ka|0):(c=e.Kb,d=e.Pc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,Pd(this,c,a,b);this.id<Qd&&y.call(e,b&&this.id==Rd?10:13,a&65532)}return-1};l.en=function(a){var b=this.gc;a=b.Pb+(a<<2);var c=b.ja(a);b.O&=-769;return this.load(b.ja(a+2))+c|0};
l.dn=function(a){var b=this.gc;a<<=3;var c=b.Pb+a|0;if(7<=(b.cd-c|0))return this.C=!0,a=Pd(this,c,a),-1!==a&&(a+=this.Jf),a;y.call(b,13,a|2);return-1};l.dj=function(a){return this.ua+a|0};l.fj=function(a){return this.ua+a|0};l.cj=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.kg()};l.zl=function(a,b){return(a>>>0)+b>this.Nb?this.ua+a|0:this.kg()};l.kg=function(){y.call(this.gc,13,0);return-1};l.ej=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.lg()};
l.mh=function(a){this.U=a&65535;return this.ua=this.U<<4};l.qg=function(a,b){var c,d,e=this.gc;a&=65535;a&4?(c=e.Eb.ua,d=c+e.Eb.Ka|0):(c=e.Kb,d=e.Pc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,Pd(this,c,a,b);this.id<Qd&&y.call(e,b&&this.id==Rd?10:13,a&65532)}return-1};l.gn=function(a){var b=this.gc;a=b.Pb+(a<<2);var c=b.ja(a);b.O&=-769;return this.load(b.ja(a+2))+c|0};
l.fn=function(a){var b=this.gc;a<<=3;var c=b.Pb+a|0;if(7<=(b.cd-c|0))return this.C=!0,a=Pd(this,c,a),-1!==a&&(a+=this.Jf),a;y.call(b,13,a|2);return-1};l.dj=function(a){return this.ua+a|0};l.fj=function(a){return this.ua+a|0};l.cj=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.kg()};l.zl=function(a,b){return(a>>>0)+b>this.Nb?this.ua+a|0:this.kg()};l.kg=function(){y.call(this.gc,13,0);return-1};l.ej=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.lg()};
l.Al=function(a,b){return(a>>>0)+b>this.Nb?this.ua+a|0:this.lg()};l.lg=function(){y.call(this.gc,13,0);return-1};function Td(a,b,c,d,e){a.U=b;a.ua=d;a.Ka=e;a.Nb=(e>>>0)+1;a.jb=c;a.type=c&7936;a.ext=c>>16&192;a.Lb=(b&4?a.gc.Eb.ua:a.gc.Kb)+(b&65528)|0;a.id<Ud&&Md(a,!0)}function Vd(a,b,c){var d=a.gc,e=d.ja(b+2),f=d.ja(b)|(e&255)<<16,d=d.ja(b+4);a.U=c;a.ua=f;a.Ka=d;a.Nb=(d>>>0)+1;a.jb=e;a.type=e&7936;a.ext=0;a.Lb=b;a.id<Ud&&Md(a,!0)}
function Pd(a,b,c,d){var e=a.gc;if(!d&&c===a.A.U)return a.U=c,a.ua=a.A.ua,a.Ka=a.A.Ka,a.Nb=(a.A.Ka>>>0)+1,a.jb=a.A.jb,a.type=a.A.type,a.ext=a.A.ext,a.Lb=a.A.Lb,a.A.U=-1,Md(a,!0,!0,!1),a.ua;a.A.U=-1;var f=e.ja(b+0),g=e.ja(b+4),h=g&7936,k=e.ja(b+2)|(g&255)<<16,m=e.ja(b+6),p=c&65528;if(80386<=e.ca){var w=f,k=k|(m&65280)<<16,f=f|(m&15)<<16;m&128&&(f=f<<12|4095)}switch(a.id){case Wd:var u=a.C;a.Pe=!1;if(u&&c==Od&&a.B.length){var F=a.B[a.Jf-1];if(F&&!F())return-1}var K=c&3,H=(g&24576)>>13,F=-1,I,T;p||b>=
e.Kb&&b<e.Pc&&(h=0);if(6144<=h)null!=d?F=0:!1!==u?(h&1024?H<=a.Ab&&(F=0):K<=a.Ab&&H==a.Ab&&(F=0),F||(c=c&-4|a.Ab&3)):K>=a.Ab&&(K>a.Ab&&(F=Xd(e),Yd(e,Xd(e),!0),Zd(e,F),a.Pe=!0),F=0);else{if(256==h||2304==h)return $d(a,c,u)?a.ua:-1;if(1024==h)F=2,T=0,K<a.Ab&&(K=a.Ab);else if(3072==h)F=4,T=0,K<a.Ab&&(K=a.Ab);else if(1536==h)F=2,T=148224;else if(3584==h)F=4,T=148224;else if(1792==h)F=2,T=147712;else if(3840==h)F=4,T=147712;else if(1280==h)return $d(a,k&65535,u)?a.ua:-1}0<F&&!(g&32768)&&(F=0);if(0<F&&
@ -149,8 +149,8 @@ function $d(a,b,c){var d=a.gc,e=a.Ab,f=d.la.U,g=d.la.ua;if(!c){if(!(d.la.type&51
34,d.oa.U),d.fb(g+36,d.Z.U),d.fb(g+38,d.Y.U),d.fb(g+40,d.Ca.U),d.Eb.load(d.ja(h+42)),je(d,d.ja(h+16)|(c?16384:0)),d.D=d.ja(h+18),d.I=d.ja(h+20),d.L=d.ja(h+22),d.G=d.ja(h+24),d.M=d.ja(h+28),d.K=d.ja(h+30),d.J=d.ja(h+32),d.oa.load(d.ja(h+34)),d.Ca.load(d.ja(h+40)),ke(d,d.ja(h+14),d.ja(h+36)),b=38,g=26,a.Ab<e&&(g=(a.Ab<<2)+2,b=g+2),Yd(d,d.ja(h+b),!0),Zd(d,d.ja(h+g))):(d.ab(g+28,d.Wc),d.ab(g+32,A(d)),d.ab(g+36,ie(d)),d.ab(g+40,d.D),d.ab(g+44,d.I),d.ab(g+48,d.L),d.ab(g+52,d.G),d.ab(g+56,z(d)),d.ab(g+60,
d.M),d.ab(g+64,d.K),d.ab(g+68,d.J),d.ab(g+72,d.oa.U),d.ab(g+76,d.Z.U),d.ab(g+80,d.Y.U),d.ab(g+84,d.Ca.U),d.ab(g+88,d.Ga.U),d.ab(g+92,d.Ha.U),le.call(d,d.ia(h+28)),d.Eb.load(d.ja(h+96)),je(d,d.ia(h+36)|(c?16384:0)),d.D=d.ia(h+40),d.I=d.ia(h+44),d.L=d.ia(h+48),d.G=d.ia(h+52),d.M=d.ia(h+60),d.K=d.ia(h+64),d.J=d.ia(h+68),d.oa.load(d.ja(h+72)),d.Ca.load(d.ja(h+84)),d.Ga.load(d.ja(h+88)),d.Ha.load(d.ja(h+92)),ke(d,d.ia(h+32),d.ja(h+76)),b=80,g=56,a.Ab<e&&(g=(a.Ab<<3)+4,b=g+4),Yd(d,d.ja(h+b),!0),Zd(d,d.ia(h+
g)));c&&d.fb(h+0,f);d.qa|=8;return!0}l.save=function(){return[this.U,this.ua,this.Ka,this.jb,this.id,this.$b,this.Ab,this.qc,this.Lb,this.Jc,this.wa,this.V,this.R,this.type,this.Nb]};l.restore=function(a){"number"==typeof a?this.load(a):(this.U=a[0],this.ua=a[1],this.Ka=a[2],this.jb=a[3],this.id=a[4],this.$b=a[5],this.Ab=a[6],this.qc=a[7],this.Lb=a[8],this.Jc=a[9]||2,this.wa=a[10]||65535,this.V=a[11]||2,this.R=a[12]||65535,this.type=a[13]||this.jb&7936,this.Nb=a[14]||(this.Ka>>>0)+1)};
function Md(a,b,c,d){void 0===c&&(c=!!(a.gc.qa&1));a.Oc=!1;if(c)if(a.load=a.qg,a.Cj=a.dn,a.bc=a.cj,a.cc=a.ej,void 0===d&&(d=!!(a.gc.O&131072)),d)a.load=a.G,a.bc=a.D,a.cc=a.F,a.Ab=a.qc=3,a.V=2,a.R=a.wa=65535,a.Ka=65535,a.Nb=a.Ka+1,a.Jc=a.V,a.Lb=-1,a.Pe=!1;else{if(!(a.U&-4))a.bc=a.kg,a.cc=a.lg;else if(a.type&4096){6144==(a.type&6656)&&(a.bc=a.kg);if(a.type&2048||!(a.type&512))a.cc=a.lg;1024==(a.type&3072)&&(a.bc==a.cj&&(a.bc=a.zl),a.cc==a.ej&&(a.cc=a.Al),a.Oc=!0);b&&a.id<Qd&&a.U&-4&&-1!==a.Lb&&(c=a.Lb+
5,d=a.gc.Ia(c),d&1||a.gc.fc(c,d|1))}b&&(a.Ab=a.U&3,a.qc=(a.jb&24576)>>13,80386>a.gc.ca||!(a.ext&64)?(a.V=2,a.R=65535):(a.V=4,a.R=-1),a.Jc=a.V,a.wa=a.R)}else a.load=a.mh,a.Cj=a.en,a.bc=a.dj,a.cc=a.fj,a.Ab=a.qc=0,a.Lb=-1,a.Pe=!1}var Wd=1,he=2,Rd=3,Ud=4,Qd=6,Od=1;
function Md(a,b,c,d){void 0===c&&(c=!!(a.gc.qa&1));a.Oc=!1;if(c)if(a.load=a.qg,a.Cj=a.fn,a.bc=a.cj,a.cc=a.ej,void 0===d&&(d=!!(a.gc.O&131072)),d)a.load=a.G,a.bc=a.D,a.cc=a.F,a.Ab=a.qc=3,a.V=2,a.R=a.wa=65535,a.Ka=65535,a.Nb=a.Ka+1,a.Jc=a.V,a.Lb=-1,a.Pe=!1;else{if(!(a.U&-4))a.bc=a.kg,a.cc=a.lg;else if(a.type&4096){6144==(a.type&6656)&&(a.bc=a.kg);if(a.type&2048||!(a.type&512))a.cc=a.lg;1024==(a.type&3072)&&(a.bc==a.cj&&(a.bc=a.zl),a.cc==a.ej&&(a.cc=a.Al),a.Oc=!0);b&&a.id<Qd&&a.U&-4&&-1!==a.Lb&&(c=a.Lb+
5,d=a.gc.Ia(c),d&1||a.gc.fc(c,d|1))}b&&(a.Ab=a.U&3,a.qc=(a.jb&24576)>>13,80386>a.gc.ca||!(a.ext&64)?(a.V=2,a.R=65535):(a.V=4,a.R=-1),a.Jc=a.V,a.wa=a.R)}else a.load=a.mh,a.Cj=a.gn,a.bc=a.dj,a.cc=a.fj,a.Ab=a.qc=0,a.Lb=-1,a.Pe=!1}var Wd=1,he=2,Rd=3,Ud=4,Qd=6,Od=1;
function me(a){var b=+a.model||8088,c;switch(b){default:c=4772727;break;case 80286:c=6E6;break;case 80386:c=16E6}od.call(this,a,c);this.ca=b;a=a.stepping;this.we=b+(a?ga(a,16):0);this.Ri=61442;this.Qd=1792;this.si=28672;this.Vf=4;this.Ta=255;this.B=80286<=this.ca?Gb:Fb;this.va=ne;this.bj=oe;this.ij=pe;this.nj=qe;if(80186<=this.ca&&(this.va=ne.slice(),this.bj=oe.slice(),this.ij=pe.slice(),this.Ta=31,this.va[15]=re,this.va[96]=se,this.va[97]=te,this.va[98]=ue,this.va[99]=re,this.va[100]=re,this.va[101]=
re,this.va[102]=re,this.va[103]=re,this.va[104]=ze,this.va[105]=Ae,this.va[106]=Be,this.va[107]=Ce,this.va[108]=De,this.va[109]=Ee,this.va[110]=Fe,this.va[111]=Ge,this.va[192]=He,this.va[193]=Ie,this.va[200]=Je,this.va[201]=Ke,this.va[241]=Le,this.bj[7]=Me,this.ij[7]=Me,80286<=this.ca)){this.Ri=2;this.Qd|=28672;this.Vf=0;this.va[15]=Ne;this.Pd=Oe.slice();for(b=0;b<this.Pd.length;b++)this.Pd[b]||(this.Pd[b]=Pe);this.va[84]=Qe;this.va[99]=Re;if(80386<=this.ca){var d;this.si=0;this.Qd|=196608;this.va[100]=
Se;this.va[101]=Te;this.va[102]=Ue;this.va[103]=Ve;for(d in B)this.Pd[+d]=B[+d];80546<=this.we&&80562>=this.we&&(this.Pd[166]=We,this.Pd[167]=Xe)}}this.Yf=[];this.Zf=[];this.ag=0;rd(this);this.ea.complete=this.ea.jj=!1;this.tj=0;this.sc=this.aa=[];this.qb=this.Ng=this.Db=this.Wf=this.df=this.ef=this.ed=0;Ye(this)}ba(me,od);function Ze(a,b,c,d){b=(d?a.sc:a.aa)[b>>>a.qb];c?--b.ie||bd(b):--b.he||ad(b);d&&jc(a)}
@ -158,8 +158,8 @@ function $e(a){var b;if(a.aa===a.sc){a.aa=Array(a.Wf);a.$f=new x(null,0,0,Uc,nul
function gd(a,b,c,d){var e=(b&-4194304)>>>20,f=a.sc[(a.Wc+e&a.ef)>>>a.qb],g=f.Nd(e);if(!(g&1))return d||ef.call(a,b,!1,c),a.ff;if(!(g&4)&&3==a.Ma)return d||ef.call(a,b,!0,c),a.ff;var h=(b&4190208)>>>10,g=a.sc[((g&-4096)+h&a.ef)>>>a.qb],k=g.Nd(h);if(!(k&1))return d||ef.call(a,b,!1,c),a.ff;if(!(k&4)&&3==a.Ma)return d||ef.call(a,b,!0,c),a.ff;c=a.sc[((k&-4096)+(b&4095)&a.ef)>>>a.qb];if(d)return c;d=b>>>a.qb;k=a.aa[d];b&=-4096;var m;0<a.bg?(m=a.Zi[--a.bg],m.ih(b)):m=new x(b,0,0,Wc);b=m;b.pd=c;b.lb=f;b.A=
e>>2;b.mb=g;b.B=h>>2;Eb&&wc&&c.X&&!c.controller&&!c.he&&!c.ie?(b.Pa=c.Pa,b.Rd=c.Rd,b.X=c.X,pc(b,nd)):(b.F=c?hd(32):0,b.J=c?hd(96):0,pc(b,Xc));ec(b,a.ba,k);a.aa[d]=b;a.Xf.push(d);return b}function ff(a){a.aa!==a.sc&&(a.aa=a.sc,a.$f=null,a.Xf=null,a.ff=null)}l=me.prototype;l.reset=function(){this.ea.vb&&this.Jb();Ye(this);rd(this);this.ea.error=!1};
function gf(a,b){var c;switch(b){case 0:c=a.D;break;case 1:c=a.I;break;case 2:c=a.L;break;case 3:c=a.G;break;case 4:c=z(a);break;case 5:c=a.M;break;case 6:c=a.K;break;case 7:c=a.J}return c}function hf(a,b,c){switch(b){case 0:a.D=c;break;case 1:a.I=c;break;case 2:a.L=c;break;case 3:a.G=c;break;case 4:Zd(a,c);break;case 5:a.M=c;break;case 6:a.K=c;break;case 7:a.J=c}}
function Ye(a){a.D=0;a.G=0;a.I=0;a.L=0;a.Hc=0;a.M=0;a.K=0;a.J=0;a.vc=!1;a.Ba=a.$a=0;a.ya=0;a.sj=0;a.ga=0;a.qa=65520;a.Pb=0;a.cd=1023;a.O=a.lc=0;a.ze=a.hf=a.ye=a.Ae=0;a.Uc=-1;a.Ad=a.Vc=-1;a.Bd=a.ta=-1;a.Z=new Kd(a,Wd,"CS");a.Ca=new Kd(a,he,"DS");a.oa=new Kd(a,he,"ES");a.Y=new Kd(a,Rd,"SS");Zd(a,0);Yd(a,0);if(80386<=a.ca){switch(a.we){case 80562:case 80563:a.L=771;break;case 80578:a.L=772;break;case 80594:a.L=773;break;case 80595:case 80596:a.L=776}a.qa=16;a.Og=0;a.Cd=0;a.Wc=0;a.Qb=[0,0,0,0,null,null,
0,0];a.dg=[null,null,null,null,null,null,0,0];a.Ga=new Kd(a,he,"FS");a.Ha=new Kd(a,he,"GS");ff(a)}a.Qg=new Kd(a,0,"NULL");a.Da=a.Ca;a.Rb=a.Y;a.N=a.ha=0;a.C=a.F=-1;a.eb=a.Qg;a.Za=0;if(80286>a.ca)ke(a,0,65535);else{a.Kb=0;a.Pc=65535;a.Eb=new Kd(a,5,"LDT",!0);a.la=new Kd(a,Ud,"TSS",!0);a.xb=new Kd(a,Qd,"VER",!0);ke(a,65520,61440);var b,c=A(a);b=a.Z;var d=-65536;80386>b.gc.ca&&(d&=16777215);b=b.ua=d;a.da=b+c|0;a.Pg=(b>>>0)+(a.Z.Ka>>>0)+1}je(a,0);ae(a)}
function Ye(a){a.D=0;a.G=0;a.I=0;a.L=0;a.Hc=0;a.M=0;a.K=0;a.J=0;a.vc=!1;a.Ba=a.$a=0;a.bn=[0,0];a.cn=[0,0];a.ya=0;a.sj=0;a.ga=0;a.qa=65520;a.Pb=0;a.cd=1023;a.O=a.lc=0;a.ze=a.hf=a.ye=a.Ae=0;a.Uc=-1;a.Ad=a.Vc=-1;a.Bd=a.ta=-1;a.Z=new Kd(a,Wd,"CS");a.Ca=new Kd(a,he,"DS");a.oa=new Kd(a,he,"ES");a.Y=new Kd(a,Rd,"SS");Zd(a,0);Yd(a,0);if(80386<=a.ca){switch(a.we){case 80562:case 80563:a.L=771;break;case 80578:a.L=772;break;case 80594:a.L=773;break;case 80595:case 80596:a.L=776}a.qa=16;a.Og=0;a.Cd=0;a.Wc=0;
a.Qb=[0,0,0,0,null,null,0,0];a.dg=[null,null,null,null,null,null,0,0];a.Ga=new Kd(a,he,"FS");a.Ha=new Kd(a,he,"GS");ff(a)}a.Qg=new Kd(a,0,"NULL");a.Da=a.Ca;a.Rb=a.Y;a.N=a.ha=0;a.C=a.F=-1;a.eb=a.Qg;a.Za=0;if(80286>a.ca)ke(a,0,65535);else{a.Kb=0;a.Pc=65535;a.Eb=new Kd(a,5,"LDT",!0);a.la=new Kd(a,Ud,"TSS",!0);a.xb=new Kd(a,Qd,"VER",!0);ke(a,65520,61440);var b,c=A(a);b=a.Z;var d=-65536;80386>b.gc.ca&&(d&=16777215);b=b.ua=d;a.da=b+c|0;a.Pg=(b>>>0)+(a.Z.Ka>>>0)+1}je(a,0);ae(a)}
function jf(a){2==a.Jc?(a.Sb=a.ja,a.kc=kf,a.tc=lf,a.kd=rf,2==a.V?(a.ma=sf,a.za=tf,a.rb=uf):(a.ma=vf,a.za=wf,a.rb=xf)):(a.Sb=a.ia,a.kc=yf,a.tc=zf,a.kd=Af,2==a.V?(a.ma=Bf,a.za=Cf,a.rb=Df):(a.ma=Ef,a.za=Ff,a.rb=Gf))}function be(a,b){a.V!=b&&(a.ha|=1024,a.V=b,a.R=2==b?65535:-1,Hf(a))}function Hf(a){2==a.V?(a.Fb=32768,a.hb=a.ja,a.yb=a.fb,2==a.Jc?(a.ma=sf,a.za=tf,a.rb=uf):(a.ma=Bf,a.za=Cf,a.rb=Df)):(a.Fb=-2147483648,a.hb=a.ia,a.yb=a.ab,2==a.Jc?(a.ma=vf,a.za=wf,a.rb=xf):(a.ma=Ef,a.za=Ff,a.rb=Gf))}
function If(a){a.Jc=a.Z.Jc;a.wa=a.Z.wa;jf(a);a.V=a.Z.V;a.R=a.Z.R;Hf(a);a.ha&=-3073}l.uj=function(){var a=this.D+this.G+this.I+this.L+z(this)+this.M+this.K+this.J|0;return a=a+A(this)+this.Z.U+this.Ca.U+this.Y.U+this.oa.U+ie(this)|0};function Jf(a,b,c){void 0===a.Yf[b]&&(a.Yf[b]=[]);a.Yf[b].push(c)}function Kf(a,b,c){c&&(null==a.Zf[b]&&a.ag++,a.Zf[b]=c)}function Lf(a,b){var c=a.Zf[b];null!=c&&(c(--a.ag),delete a.Zf[b])}
function Mf(a,b){for(var c=a.Qb[7],d=c>>16,e=0;4>e;e++){if(c&3){var f=!!(d&1),g=a.Qb[e],g=g&~(d>>2&3);b?a.aa[g>>>a.qb].Gd(g&a.Db,f,a):(g=a.aa[g>>>a.qb],f?--g.ie||bd(g):--g.he||ad(g))}c>>=2;d>>=4}}function ed(a,b,c,d){if(!(a.N&8192)&&a.Qb[7]&255){c--;var e=a.Qb[7],f=e>>16;d=d?1:0==d?3:0;for(var g=0;4>g;g++){if(e&3&&(f&3)==d){var h=f>>2;if(b+c>=a.Qb[g]&&b<=a.Qb[g]+h){a.Qb[6]|=1<<g;a.Za|=2;break}}e>>=2;f>>=4}}}
@ -237,7 +237,7 @@ function Fj(a,b){var c=a-b|0;Uf(this,a,b,c,this.Fb|63,!0);this.A-=-1===this.F?-1
function Jj(a,b){return b>>(this.D&this.R)&(1<<(this.I&31))-1&this.R}function Kj(a,b){if(-1===this.C){switch(this.ga&7){case 0:this.D=this.D&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.L=this.L&-256|a;break;case 3:this.G=this.G&-256|a;break;case 4:this.D=this.D&-65281|a<<8;break;case 5:this.I=this.I&-65281|a<<8;break;case 6:this.L=this.L&-65281|a<<8;break;case 7:this.G=this.G&-65281|a<<8}this.A-=this.B.di}else this.F=this.C,vg(this,a),this.A-=this.B.ci;return b}
function Lj(a,b){if(-1===this.C){switch(this.ga&7){case 0:this.D=this.D&~this.R|a;break;case 1:this.I=this.I&~this.R|a;break;case 2:this.L=this.L&~this.R|a;break;case 3:this.G=this.G&~this.R|a;break;case 4:Zd(this,z(this)&~this.R|a);break;case 5:this.M=this.G&~this.R|a;break;case 6:this.K=this.K&~this.R|a;break;case 7:this.J=this.J&~this.R|a}this.A-=this.B.di}else this.F=this.C,this.N&2||this.yb(this.eb.cc(this.wb,this.V),a),this.A-=this.B.ci;return b}
function Mj(a,b){a^=b;ag(this,a,128);this.A-=-1===this.F?-1===this.C?this.B.mc:this.B.Ib:this.B.Ac;return a}function Nj(a,b){this.A-=-1===this.F?-1===this.C?this.B.mc:this.B.Ib:this.B.Ac;return ag(this,a^b,this.Fb)&this.R}function Oj(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function Pj(a){var b=a-1|0;Uf(this,a,1,b,this.Fb|62,!0);this.A-=2;return a&~this.R|b&this.R}
function Qj(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1;c=[c>>>0,0];for(a=[a>>>0,b>>>0];0<Oj(a,c);){var f=b=c;b[0]+=f[0];b[1]+=f[1];4294967295<b[0]&&(b[0]>>>=0,b[1]++);e+=e}do 0<=Oj(a,c)&&(b=a,f=c,b[0]-=f[0],b[1]-=f[1],0>b[0]&&(b[0]>>>=0,b[1]--),d+=e),b=c,b[0]>>>=1,b[1]&1&&(b[0]=(b[0]|2147483648)>>>0),b[1]>>>=1,e/=2;while(1<=e);this.Ba=d;this.$a=a[0];return!0}function Rj(a){var b=a+1|0;Uf(this,a,1,b,this.Fb|62);this.A-=2;return a&~this.R|b&this.R}
function Qj(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1,f=this.bn;f[0]=c>>>0;f[1]=0;c=this.cn;c[0]=a>>>0;for(c[1]=b>>>0;0<Oj(c,f);)b=a=f,a[0]+=b[0],a[1]+=b[1],4294967295<a[0]&&(a[0]>>>=0,a[1]++),e+=e;do 0<=Oj(c,f)&&(a=c,b=f,a[0]-=b[0],a[1]-=b[1],0>a[0]&&(a[0]>>>=0,a[1]--),d+=e),a=f,a[0]>>>=1,a[1]&1&&(a[0]=(a[0]|2147483648)>>>0),a[1]>>>=1,e/=2;while(1<=e);this.Ba=d;this.$a=c[0];return!0}function Rj(a){var b=a+1|0;Uf(this,a,1,b,this.Fb|62);this.A-=2;return a&~this.R|b&this.R}
function Sj(a){this.qa=a;ae(this);this.qa&-2147483648?$e(this):ff(this)}function le(a){this.Wc=a;jc(this)}function Tj(a){this.N|=1;this.tc.call(this,a);this.A-=-1===this.C?4:5}function tj(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a<<c-1;a=(d<<1|b>>>16-c)&65535;ag(this,a,32768,d&32768)}return a}function vj(a,b,c){if(c){var d=a<<c-1;a=d<<1|b>>>32-c;ag(this,a,-2147483648,d&-2147483648)}return a}
function zj(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a>>>c-1;a=(d>>>1|b<<16-c)&65535;ag(this,a,32768,d&1)}return a}function Bj(a,b,c){if(c){var d=a>>>c-1;a=d>>>1|b<<32-c;ag(this,a,-2147483648,d&1)}return a}function Uj(){this.A-=-1===this.C?2:this.B.Fk;return 1}function Vj(){var a=this.I&255;this.A-=(-1===this.C?this.B.Vh:this.B.Uh)+(a<<this.B.Wh);return a}function Wj(){var a=this.ra();this.A-=(-1===this.C?this.B.Vh:this.B.Uh)+(a<<this.B.Wh);return a}function Xj(){return null}
function Yj(){return this.ya}function Zj(a,b){this.Ad=this.Z.U;this.Vc=this.Y.U;this.ta=this.Aa;var c=A(this),d=this.V;null!=ke(this,a,b,!0)&&(de(this,this.Ad,d,2),de(this,c,d,d));this.Ad=this.Vc=this.ta=-1}function ak(a,b,c){this.A-=this.B.ck+(c||0);c=ie(this);var d=this.Z.U,e=A(this);a=this.Z.Cj(a);-1!==a&&(ge(this,c),ge(this,d),ge(this,e),null!=b&&ge(this,b),this.Uc=-1,Rf(this,a))}
@ -426,12 +426,12 @@ l.reset=function(a){var b;wl(this);this.F=Array(this.za);for(b=0;b<this.za;b++)x
Pl|Ql;this.Y=Array(8);this.W=0;a&&(this.A=Array(tl));Rl(this,this.Ma);for(a=Sl;a<=Tl;a++)this.A[a]=0;for(a=Ul;a<Vl;a++)void 0===this.A[a]&&(this.A[a]=0);a=0|+Kl(this,Zk,void 0)<<Wl.Mg&Wl.yc;a|=+Kl(this,el,void 0)?Xl:0;b=+Kl(this,Yk,void 0);a|=b?b-1<<Yl.Mg&Yl.yc|Yl.ol:0;this.A[Zl]=a;this.A[$l]=am(this,0)<<4|am(this,1);bm(this)}};
function Rl(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.P("CMOS date invalid ("+b+"), using "+c)):b&&a.P("CMOS date: "+c);a.A[cm]=c.getSeconds();a.A[dm]=0;a.A[em]=c.getMinutes();a.A[fm]=0;a.A[gm]=c.getHours();a.A[hm]=0;a.A[im]=c.getDay()+1;a.A[Am]=c.getDate();a.A[Bm]=c.getMonth()+1;b=c.getFullYear();a.A[Cm]=b%100;b/=100;a.A[Dm]=b%10|b/10<<4;a.A[Em]=38;a.A[Hd]=Fm;a.A[Gm]=0;a.A[ul]=Hm;a.ma=a.Z=0;a.Ha=a.Aa=null}
function vl(a,b){var c=a.A[b];if(b<Em){var d=!1;b!=gm&&b!=hm||a.A[Hd]&Fm||(12>c?c=c?c:12:c=(c-=12)?c+128:140,d=!0);a.A[Hd]&Im||(d&&128<c&&(c-=48),c=c%10|c/10<<4)}else b==Em&&(a.A[b]^=Jm);return c}function Km(a){var b;void 0===b&&(b=a.Aa);a.Z=vd(a.H,a.O)+b;a.A[Hd]&Id&&xd(a.H,b)}function bm(a){for(var b=0,c=$l;c<Vl;c++)b+=a.A[c];a.A[Lm]=b&255;a.A[Vl]=b>>8}
l.save=function(){var a=new Of(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.F;c++){for(var d=this.F[c],e=d,f=[],g=0;g<e.oc.length;g++){var h=e.oc[g];f[g]=[h.ne,h.fg,h.pc,h.sb,h.nb,h.mode,h.hg,h.Mo,h.No]}b[c]=[d.Mb,d.Xg,d.Xi,d.zb,f,d.Yi]}a.set(1,[b]);b=[];for(c=0;c<this.hc.length;c++)d=this.hc[c],b[c]=[d.We,d.Kc,d.Ld,d.od,d.ac,d.Ec,d.ge,d.nf];a.set(2,[b]);b=[];for(c=0;c<this.G.length;c++)d=this.G[c],b[c]=[d.pc,d.Mc,d.nb,d.je,d.Zg,d.mode,d.Qf,d.rd,d.ad,d.gd,d.Me,d.le,d.jd,d.Mb,d.Qe];a.set(3,[this.ta,
l.save=function(){var a=new Of(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.F;c++){for(var d=this.F[c],e=d,f=[],g=0;g<e.oc.length;g++){var h=e.oc[g];f[g]=[h.ne,h.fg,h.pc,h.sb,h.nb,h.mode,h.hg,h.Oo,h.Po]}b[c]=[d.Mb,d.Xg,d.Xi,d.zb,f,d.Yi]}a.set(1,[b]);b=[];for(c=0;c<this.hc.length;c++)d=this.hc[c],b[c]=[d.We,d.Kc,d.Ld,d.od,d.ac,d.Ec,d.ge,d.nf];a.set(2,[b]);b=[];for(c=0;c<this.G.length;c++)d=this.G[c],b[c]=[d.pc,d.Mc,d.nb,d.je,d.Zg,d.mode,d.Qf,d.rd,d.ad,d.gd,d.Me,d.le,d.jd,d.Mb,d.Qe];a.set(3,[this.ta,
b,this.va]);a.set(4,[this.ya,this.J,this.Ca,this.ga,this.da]);this.ca>=Kg&&(a.set(5,[this.D,this.L,this.K,this.oa,this.M,this.qa]),a.set(6,[this.Y[7],this.Y,this.W,this.A,this.ma,this.Z]));return a.data()};
l.restore=function(a){var b,c;b=a[0];Array.isArray(b[0])?this.C=b[0]:(this.C[0][0]=b[0],this.C[1][0]=b[1]&15,this.C[0][1]=b[2],this.C[1][1]=b[3]&15);wl(this);b=a[1];for(c=0;c<this.za;c++)xl(this,c,1==b.length?b[0][c]:b);b=a[2];for(c=0;c<this.ha;c++)yl(this,c,c?Cl:Al,b[0][c]);b=a[3];this.ta=b[0];this.va=b[2];for(c=0;c<this.G.length;c++)Dl(this,c,b[1][c]);b=a[4];this.ya=b[0];this.J=b[1];this.Ca=b[2];this.ga=b[3];this.da=b[4];if(b=a[5])this.D=b[0],this.L=b[1],this.K=b[2],this.oa=b[3],this.M=b[4],this.qa=
b[5];if(b=a[6])this.Y=b[1],this.Y[7]=b[0],this.W=b[2],this.A=b[3],this.ma=b[4],this.Z=b[5],Rl(this);return!0};l.start=function(){Mm(this)};l.stop=function(){Mm(this)};function xl(a,b,c){var d=a.F[b];d||(d={oc:Array(4)});c=c&&5<=c.length?c:Nm;d.Mb=c[0];d.Xg=c[1];d.Xi=c[2];d.zb=c[3];d.gn=b<<2;for(var e=0;e<d.oc.length;e++)Om(d,e,c[4][e]);d.Yi=c[5]||0;a.F[b]=d}
function Om(a,b,c){var d=a.oc[b];d||(d={fg:[0,0],pc:[0,0],sb:[0,0],nb:[0,0]});c=c&&8==c.length?c:Pm;d.ne=c[0];d.fg[0]=c[1][0];d.fg[1]=c[1][1];d.pc[0]=c[2][0];d.pc[1]=c[2][1];d.sb[0]=c[3][0];d.sb[1]=c[3][1];d.nb[0]=c[4][0];d.nb[1]=c[4][1];d.mode=c[5];d.hg=c[6];d.controller=a;d.yj=b;Qm(d,c[8],c[9]);a.oc[b]=d}function Qm(a,b,c,d){"string"==typeof b&&(b=kb(b));b&&(a.done=null,a.Mo=b.id,a.No=c,a.mg=b,a.eh=b[c],a.Ag=d)}
function yl(a,b,c,d){var e=a.hc[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Rm;e.port=c;e.$p=b<<3;e.We=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.Ld=d[2];e.od=d[3];e.ac=d[4];e.Ec=d[5];e.ge=d[6];e.nf=d[7];a.hc[b]=e}
b[5];if(b=a[6])this.Y=b[1],this.Y[7]=b[0],this.W=b[2],this.A=b[3],this.ma=b[4],this.Z=b[5],Rl(this);return!0};l.start=function(){Mm(this)};l.stop=function(){Mm(this)};function xl(a,b,c){var d=a.F[b];d||(d={oc:Array(4)});c=c&&5<=c.length?c:Nm;d.Mb=c[0];d.Xg=c[1];d.Xi=c[2];d.zb=c[3];d.jn=b<<2;for(var e=0;e<d.oc.length;e++)Om(d,e,c[4][e]);d.Yi=c[5]||0;a.F[b]=d}
function Om(a,b,c){var d=a.oc[b];d||(d={fg:[0,0],pc:[0,0],sb:[0,0],nb:[0,0]});c=c&&8==c.length?c:Pm;d.ne=c[0];d.fg[0]=c[1][0];d.fg[1]=c[1][1];d.pc[0]=c[2][0];d.pc[1]=c[2][1];d.sb[0]=c[3][0];d.sb[1]=c[3][1];d.nb[0]=c[4][0];d.nb[1]=c[4][1];d.mode=c[5];d.hg=c[6];d.controller=a;d.yj=b;Qm(d,c[8],c[9]);a.oc[b]=d}function Qm(a,b,c,d){"string"==typeof b&&(b=kb(b));b&&(a.done=null,a.Oo=b.id,a.Po=c,a.mg=b,a.eh=b[c],a.Ag=d)}
function yl(a,b,c,d){var e=a.hc[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Rm;e.port=c;e.bq=b<<3;e.We=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.Ld=d[2];e.od=d[3];e.ac=d[4];e.Ec=d[5];e.ge=d[6];e.nf=d[7];a.hc[b]=e}
function Dl(a,b,c){var d=a.G[b];d||(d={pc:[0,0],Mc:[0,0],nb:[0,0],je:[0,0]});c=c&&13<=c.length?c:Sm;d.pc[0]=c[0][0];d.pc[1]=c[0][1];d.Mc[0]=c[1][0];d.Mc[1]=c[1][1];d.nb[0]=c[2][0];d.nb[1]=c[2][1];d.je[0]=c[3][0];d.je[1]=c[3][1];d.Zg=c[4];d.mode=c[5];d.Qf=c[6];d.rd=c[7];d.ad=c[8];d.gd=c[9];d.Me=c[10];d.le=c[11];d.jd=c[12];d.Mb=c[13]||0;d.Qe=c[14]||!1;a.G[b]=d}
function al(a,b,c){for(var d="",e=a.na[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||(g+=" pcjs-bitCellLeft");d+='<div id="'+(c+"-"+f)+'" class="'+g+'" data-value="0">'+f+"</div>\n"}e.innerHTML=d;Tm(a,b,c,!0)}function Um(a,b,c){if(b=(a=Vm[a.ca|0])&&a[b])for(var d in b)if(a=b[d],a.yc&1<<c)return a;return null}
function Kl(a,b,c){for(var d=null,e=Vm[a.ca]||Vm[a.ca|0]||Vm[bl],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.C[f][c?0:1]&g.yc;for(var h in g.Zc)if(g.Zc[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function am(a,b){if(b<+Kl(a,Yk,void 0)){if(!a.N)return Wm;if(b<a.N.length)switch(a.N[b]){case 160:case 180:case 320:case 360:return Wm;case 720:return Xm;case 1200:return Ym;case 1440:return Zm}}return $m}function Il(a,b){return+Kl(a,an,b)+ +Kl(a,bn,b)}
@ -440,7 +440,7 @@ function Tm(a,b,c,d){if(c=a.na[c]){d=d?a.C[b][0]:a.C[b][1]=a.C[b][0];c=pb(c,"pcj
function dn(a){var b=a.na[dl];if(null!=b){var c;c=""+(Il(a,!0)+"Kb");c+=", "+(+ +Kl(a,el,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Kl(a,Zk,!0)]+" Monitor";c+=", "+ +Kl(a,Yk,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
function en(a,b,c,d,e){var f=a.F[b],g=f.oc[c],h=g.sb[f.zb];t(a,768)&&v(a,d,null,e,"DMA"+b+".CHANNEL"+c+".ADDR["+f.zb+"]",h,!0);f.zb^=1;b||c!=fn||f.zb||(g.sb[0]++,255<g.sb[0]&&(g.sb[0]=0,g.sb[1]++,255<g.sb[1]&&(g.sb[1]=0)));return h}function gn(a,b,c,d,e,f){var g=a.F[b];t(a,768)&&v(a,d,e,f,"DMA"+b+".CHANNEL"+c+".ADDR["+g.zb+"]",null,!0);a=g.oc[c];a.sb[g.zb]=a.fg[g.zb]=e;g.zb^=1}
function hn(a,b,c,d,e){var f=a.F[b],g=f.oc[c],h=g.nb[f.zb];t(a,768)&&v(a,d,null,e,"DMA"+b+".CHANNEL"+c+".COUNT["+f.zb+"]",h,!0);f.zb^=1;b||c!=fn||f.zb||(g.nb[0]--,0>g.nb[0]&&(g.nb[0]=255,g.nb[1]--,0>g.nb[1]&&(g.nb[1]=255)));return h}function jn(a,b,c,d,e,f){var g=a.F[b];t(a,768)&&v(a,d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.zb+"]",null,!0);a=g.oc[c];a.nb[g.zb]=a.pc[g.zb]=e;g.zb^=1}function kn(a,b,c,d){var e=a.F[b],f=e.Mb|ln;e.Mb&=~mn;t(a,768)&&v(a,c,null,d,"DMA"+b+".STATUS",f,!0);return f}
function nn(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Mb=f.Mb&~(16<<a)|(d&4)<<a+2;f.Xi=d}function on(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".MASK",null,!0);b=d&pn;c=f.oc[b];c.ne=!!(d&qn);c.ne||rn(a,f.gn+b)}function sn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA"+b+".MODE",null,!0);a.F[b].oc[d&tn].mode=d}function un(a,b,c,d){var e=a.F[b].Yi;t(a,768)&&v(a,c,null,d,"DMA"+b+".TEMP",e,!0);return e}
function nn(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Mb=f.Mb&~(16<<a)|(d&4)<<a+2;f.Xi=d}function on(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".MASK",null,!0);b=d&pn;c=f.oc[b];c.ne=!!(d&qn);c.ne||rn(a,f.jn+b)}function sn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA"+b+".MODE",null,!0);a.F[b].oc[d&tn].mode=d}function un(a,b,c,d){var e=a.F[b].Yi;t(a,768)&&v(a,c,null,d,"DMA"+b+".TEMP",e,!0);return e}
function vn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA"+b+".MASTER_CLEAR",null,!0);a=a.F[b];for(b=0;b<a.oc.length;b++)Om(a,b)}function wn(a,b,c,d,e){var f=a.F[b].oc[c].hg;t(a,768)&&v(a,d,null,e,"DMA"+b+".CHANNEL"+c+".PAGE",f,!0);return f}function xn(a,b,c,d,e,f){t(a,768)&&v(a,d,e,f,"DMA"+b+".CHANNEL"+c+".PAGE",null,!0);a.F[b].oc[c].hg=e}function yn(a,b,c,d){var e=a.Y[b];t(a,768)&&v(a,c,null,d,"DMA.SPARE"+b+".PAGE",e,!0);return e}
function zn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA.SPARE"+b+".PAGE",null,!0);a.Y[b]=d}function An(a,b,c,d,e){Qm(a.F[b>>2].oc[b&3],c,d,e)}function rn(a,b,c){b=a.F[b>>2].oc[b&3];b.mg&&b.eh&&b.Ag?(c&&(b.done=c),b.ne||Bn(a,b,!0)):c&&c(!0)}
function Bn(a,b,c){c&&(b.count=b.nb[1]<<8|b.nb[0],b.type=b.mode&Cn,b.rj=b.ng=!1);for(var d=!1;0<=b.count&&(c=b.hg<<16|b.sb[1]<<8|b.sb[0],b.type==Dn?(d=!0,function(c){b.eh.call(b.mg,b.Ag,-1,function(e,g){0>e&&(b.rj||(b.rj=!0),e=255);b.ne||a.ka.fc(c,e);(d=g)&&setTimeout(function(){En(b)||Bn(a,b)},0)})}(c)):b.type==Fn?(c=a.ka.Ia(c),0>b.eh.call(b.mg,b.Ag,c)&&(b.ng=!0)):b.type!=Gn&&(b.ng=!0)),!d&&!En(b););}
@ -454,20 +454,20 @@ function po(a,b,c,d,e){v(a,c,d,e,"PIT"+b+".CTRL",null,2048);e=0;c=d&qo;b?(e=3,a.
a.J==(Do|Eo|Fo|Go)&&(b=a.G[0],b.Mc[0]=b.pc[0],b.Mc[1]=b.pc[1],b.jd=vd(a.H,a.O))}}}function mo(a,b){a=a.G[b];(b=a.pc[1]<<8|a.pc[0])||(b=1==a.ad?256:65536);return b}function Fd(a,b){a=a.G[b];(b=a.Mc[1]<<8|a.Mc[0])||(b=1==a.ad?256:65536);return b}function xo(a,b){sl(a,b);var c=a.G[b];c.je[0]=c.nb[0];c.je[1]=c.nb[1];c.Me=!0;fo(a,b)}function fo(a,b){a=a.G[b];a.rd=a.Qf==Ho?1:0;a.ad=a.Qf==Io?2:1}
function sl(a,b,c){var d=a.G[b];if(d.le&&(b!=no||a.J&Do)){var e=vd(a.H,a.O),f=(e-d.jd)/a.Ba|0;0>f&&(d.jd=e,f=0);var g=mo(a,b),h=Fd(a,b)-f;d.mode==ho?(0>=h&&(h=0),h||(d.gd=!0,d.le=!1,b||Zg(a,lo))):d.mode==Jo?(d.gd=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.Mc[0]=h&255,d.Mc[1]=h>>8&255,d.jd=e,!b&&d.gd&&Zg(a,lo))):d.mode==Gd&&(h-=f,0>=h&&(d.gd=!d.gd,h=g+h,0>=h&&(h=g),d.Mc[0]=h&255,d.Mc[1]=h>>8&255,d.jd=e,!b&&d.gd&&Zg(a,lo)));d.nb[0]=h&255;d.nb[1]=h>>8&255;c&&(a.jd=0)}return d}
function Ed(a,b){for(var c=0;c<a.G.length;c++)sl(a,c,b);if(a.ca>=Kg){b=a.H.T.sd;c=vd(a.H,a.O);null==a.Aa&&(a.ma=vd(a.H,a.O),a.Ha=1024,a.Aa=Math.floor(a.H.T.sd/a.Ha),Km(a));c>=a.Z&&(a.A[Gm]|=Ko,a.A[Hd]&Id&&(a.A[Gm]|=Lo,Zg(a,Mo)),a.Z=c+a.Aa);a.A[cm]==a.A[dm]&&a.A[em]==a.A[fm]&&a.A[gm]==a.A[hm]&&(a.A[Gm]|=No,a.A[Hd]&Oo&&(a.A[Gm]|=Lo,Zg(a,Mo)));var d=c-a.ma,e=Math.floor(d/b);if(e&&!(a.A[Hd]&Po)){for(;e--;)if(60<=++a.A[cm]&&(a.A[cm]=0,60<=++a.A[em]&&(a.A[em]=0,24<=++a.A[gm]))){a.A[gm]=0;a.A[im]=a.A[im]%
7+1;var f;f=a.A[Cm];var g=Aa[a.A[Bm]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[Am]>f&&(a.A[Am]=1,12<++a.A[Bm]&&(a.A[Bm]=1,a.A[Cm]=(a.A[Cm]+1)%100))}a.A[Gm]|=Qo;a.A[Hd]&Ro&&(a.A[Gm]|=Lo,Zg(a,Mo))}a.ma=c-d%b}}l.Gm=function(a,b){var c=this.ya;this.ga&So&&(this.J&To?c=this.C[0][1]:this.B&&(c=Uo(this.B)));v(this,a,null,b,"PPI_A",c);return c};l.ho=function(a,b,c){v(this,a,b,c,"PPI_A");this.ya=b};l.Hm=function(a,b){var c=this.J;v(this,a,null,b,"PPI_B",c);return c};
l.io=function(a,b,c){v(this,a,b,c,"PPI_B");Vo(this,b)};function Vo(a,b){var c=!!(b&Wo),d=!!(a.J&Wo);a.J=b;a.B&&Xo(a.B,!(b&To),!!(b&Go));c!=d&&Mm(a,c)}l.Im=function(a,b){var c=0,c=(this.ca|0)==bl?this.J&Eo?c|this.C[1][1]&Yo:c|this.C[1][1]>>4&1:this.J&Zo?c|this.C[0][1]>>4:c|this.C[0][1]&15;this.J&Do&&sl(this,no).gd&&(c=this.J&Wo?c|$o:c|ap);v(this,a,null,b,"PPI_C",c,32896);return c};l.jo=function(a,b,c){v(this,a,b,c,"PPI_C");this.Ca=b};l.Jm=function(a,b){var c=this.ga;v(this,a,null,b,"PPI_CTRL",c);return c};
l.ko=function(a,b,c){v(this,a,b,c,"PPI_CTRL");this.ga=b};l.Sl=function(a,b){var c=this.B?Uo(this.B):0;v(this,a,null,b,"8041_KBD",c);this.aa&=~bp;return c};l.rn=function(a,b,c){v(this,a,b,c,"8041_KBD")};l.Rl=function(a,b){var c=this.J;v(this,a,null,b,"8041_CTRL",c);return c};l.qn=function(a,b,c){v(this,a,b,c,"8041_CTRL");Vo(this,b)};l.Tl=function(a,b){var c=this.aa;v(this,a,null,b,"8041_STATUS",c);return c};
7+1;var f;f=a.A[Cm];var g=Aa[a.A[Bm]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[Am]>f&&(a.A[Am]=1,12<++a.A[Bm]&&(a.A[Bm]=1,a.A[Cm]=(a.A[Cm]+1)%100))}a.A[Gm]|=Qo;a.A[Hd]&Ro&&(a.A[Gm]|=Lo,Zg(a,Mo))}a.ma=c-d%b}}l.Gm=function(a,b){var c=this.ya;this.ga&So&&(this.J&To?c=this.C[0][1]:this.B&&(c=Uo(this.B)));v(this,a,null,b,"PPI_A",c);return c};l.jo=function(a,b,c){v(this,a,b,c,"PPI_A");this.ya=b};l.Hm=function(a,b){var c=this.J;v(this,a,null,b,"PPI_B",c);return c};
l.ko=function(a,b,c){v(this,a,b,c,"PPI_B");Vo(this,b)};function Vo(a,b){var c=!!(b&Wo),d=!!(a.J&Wo);a.J=b;a.B&&Xo(a.B,!(b&To),!!(b&Go));c!=d&&Mm(a,c)}l.Im=function(a,b){var c=0,c=(this.ca|0)==bl?this.J&Eo?c|this.C[1][1]&Yo:c|this.C[1][1]>>4&1:this.J&Zo?c|this.C[0][1]>>4:c|this.C[0][1]&15;this.J&Do&&sl(this,no).gd&&(c=this.J&Wo?c|$o:c|ap);v(this,a,null,b,"PPI_C",c,32896);return c};l.lo=function(a,b,c){v(this,a,b,c,"PPI_C");this.Ca=b};l.Jm=function(a,b){var c=this.ga;v(this,a,null,b,"PPI_CTRL",c);return c};
l.mo=function(a,b,c){v(this,a,b,c,"PPI_CTRL");this.ga=b};l.Sl=function(a,b){var c=this.B?Uo(this.B):0;v(this,a,null,b,"8041_KBD",c);this.aa&=~bp;return c};l.tn=function(a,b,c){v(this,a,b,c,"8041_KBD")};l.Rl=function(a,b){var c=this.J;v(this,a,null,b,"8041_CTRL",c);return c};l.sn=function(a,b,c){v(this,a,b,c,"8041_CTRL");Vo(this,b)};l.Tl=function(a,b){var c=this.aa;v(this,a,null,b,"8041_STATUS",c);return c};
l.Ul=function(a,b){var c=this.oa;v(this,a,null,b,"8042_OUTBUFF",c,16384);this.D&=~(bp|cp);this.B&&dp(this.B);return c};
l.tn=function(a,b,c){v(this,a,b,c,"8042_INBUF.DATA",null,16384);if(this.D&ep)switch(this.L){case fp:gp(this,b);break;case hp:ip(this,b);break;default:if(gp(this,this.K&~Fl),this.B){a=this.B;c=b;var d=-1;t(a)&&Cb(a,"sendCmd("+r(c)+")");switch(a.F||c){case jp:d=kp;lp(a);break;case mp:a.F&&(c=0);np(a,kp);a.F=c;break;case op:a.F&&(c=0);np(a,kp);a.F=c;break;default:Cb(a,"sendCmd(): unrecognized command")}pp(this,d)}}this.L=b;this.D&=~ep};
l.Vl=function(a,b){var c=this.J&~(qp|rp)|(vd(this.H)&64?rp:0);v(this,a,null,b,"8042_RWREG",c,16384);return c};l.un=function(a,b,c){v(this,a,b,c,"8042_RWREG",null,16384);Vo(this,b)};l.Wl=function(a,b){v(this,a,null,b,"8042_STATUS",this.D,16384);a=this.D&255;this.D&cp&&(this.D|=bp,this.D&=~cp);return a};
l.sn=function(a,b,c){v(this,a,b,c,"8042_INBUFF.CMD",null,16384);this.L=b;this.D|=ep;a=0;this.L>=sp&&(a=this.L^15,this.L=sp);switch(this.L){case tp:pp(this,this.K);break;case up:gp(this,this.K|Fl);break;case vp:gp(this,this.K&~Fl);this.B&&dp(this.B);break;case wp:this.B&&(a=this.B,a.A=[],t(a)&&Cb(a,"scan codes flushed"));gp(this,this.K|Fl);pp(this,xp);ip(this,Pl|Ql);break;case yp:pp(this,zp);break;case Ap:pp(this,this.M);break;case Bp:pp(this,this.qa);break;case Cp:pp(this,this.K&Fl?0:Dp);break;case sp:a&
l.vn=function(a,b,c){v(this,a,b,c,"8042_INBUF.DATA",null,16384);if(this.D&ep)switch(this.L){case fp:gp(this,b);break;case hp:ip(this,b);break;default:if(gp(this,this.K&~Fl),this.B){a=this.B;c=b;var d=-1;t(a)&&Cb(a,"sendCmd("+r(c)+")");switch(a.F||c){case jp:d=kp;lp(a);break;case mp:a.F&&(c=0);np(a,kp);a.F=c;break;case op:a.F&&(c=0);np(a,kp);a.F=c;break;default:Cb(a,"sendCmd(): unrecognized command")}pp(this,d)}}this.L=b;this.D&=~ep};
l.Vl=function(a,b){var c=this.J&~(qp|rp)|(vd(this.H)&64?rp:0);v(this,a,null,b,"8042_RWREG",c,16384);return c};l.wn=function(a,b,c){v(this,a,b,c,"8042_RWREG",null,16384);Vo(this,b)};l.Wl=function(a,b){v(this,a,null,b,"8042_STATUS",this.D,16384);a=this.D&255;this.D&cp&&(this.D|=bp,this.D&=~cp);return a};
l.un=function(a,b,c){v(this,a,b,c,"8042_INBUFF.CMD",null,16384);this.L=b;this.D|=ep;a=0;this.L>=sp&&(a=this.L^15,this.L=sp);switch(this.L){case tp:pp(this,this.K);break;case up:gp(this,this.K|Fl);break;case vp:gp(this,this.K&~Fl);this.B&&dp(this.B);break;case wp:this.B&&(a=this.B,a.A=[],t(a)&&Cb(a,"scan codes flushed"));gp(this,this.K|Fl);pp(this,xp);ip(this,Pl|Ql);break;case yp:pp(this,zp);break;case Ap:pp(this,this.M);break;case Bp:pp(this,this.qa);break;case Cp:pp(this,this.K&Fl?0:Dp);break;case sp:a&
1&&Ye(this.H)}};function gp(a,b){a.K=b;a.D=a.D&~Ep|b&Fp;a.B&&Xo(a.B,!!(b&Gp),!(b&Fl))}function pp(a,b,c){0<=b&&(a.oa=b,c?a.D|=bp:(a.D&=~bp,a.D|=cp))}function ip(a,b){a.qa=b;fc(a.ka,!!(b&Ql));b&Pl||Ye(a.H)}function Hp(a,b){a.ca<Kg?(Zg(a,Ip,4),a.aa|=bp):a.K&Fl||a.D&(bp|cp)||(pp(a,b,!0),Jp(a.B),Zg(a,Ip,120))}function Kp(a,b,c,d){var e=a.C[b][1];v(a,c,null,d,"DIPSW-"+b,e,32768);return e}l.jm=function(a,b){v(this,a,null,b,"CMOS.ADDR",this.W,4096);return this.W};
l.In=function(a,b,c){v(this,a,b,c,"CMOS.ADDR",null,4096);this.W=b;this.da=b&Lp?$g:Mp};l.km=function(a,b){var c=this.W&Np,d=c<=ul?vl(this,c):this.A[c];t(this,4352)&&v(this,a,null,b,"CMOS.DATA["+r(c)+"]",d,!0);null!=b&&c==Gm&&(this.A[c]&=Op,d&Lo&&Lg(this,Mo),d&Ko&&this.A[Hd]&Id&&Km(this));return d};
l.Jn=function(a,b,c){var d=this.W&Np;t(this,4352)&&v(this,a,b,c,"CMOS.DATA["+r(d)+"]",null,!0);a=b^this.A[d];if(d<=ul){if(c=b,d<Em){var e=!1;this.A[Hd]&Im||(c=10*(c>>4)+(c&15),e=!0);if(d==gm||d==hm)e&&23<c&&(c+=48),this.A[Hd]&Fm||(12>=c?c=12==c?0:c:(c-=116,c=24==c?12:c))}}else c=b;this.A[d]=c;d==Hd&&a&Id&&b&Id&&Km(this)};l.Nk=function(a,b,c){v(this,a,b,c,"NMI");this.da=b};l.Tn=function(a,b,c){v(this,a,b,c,"FPU.CLEAR")};l.Un=function(a,b,c){v(this,a,b,c,"FPU.RESET");this.Tc&&Fg(this.Tc)};
l.Kn=function(a,b,c){v(this,a,b,c,"CMOS.ADDR",null,4096);this.W=b;this.da=b&Lp?$g:Mp};l.km=function(a,b){var c=this.W&Np,d=c<=ul?vl(this,c):this.A[c];t(this,4352)&&v(this,a,null,b,"CMOS.DATA["+r(c)+"]",d,!0);null!=b&&c==Gm&&(this.A[c]&=Op,d&Lo&&Lg(this,Mo),d&Ko&&this.A[Hd]&Id&&Km(this));return d};
l.Ln=function(a,b,c){var d=this.W&Np;t(this,4352)&&v(this,a,b,c,"CMOS.DATA["+r(d)+"]",null,!0);a=b^this.A[d];if(d<=ul){if(c=b,d<Em){var e=!1;this.A[Hd]&Im||(c=10*(c>>4)+(c&15),e=!0);if(d==gm||d==hm)e&&23<c&&(c+=48),this.A[Hd]&Fm||(12>=c?c=12==c?0:c:(c-=116,c=24==c?12:c))}}else c=b;this.A[d]=c;d==Hd&&a&Id&&b&Id&&Km(this)};l.Nk=function(a,b,c){v(this,a,b,c,"NMI");this.da=b};l.Vn=function(a,b,c){v(this,a,b,c,"FPU.CLEAR")};l.Wn=function(a,b,c){v(this,a,b,c,"FPU.RESET");this.Tc&&Fg(this.Tc)};
l.Xm=function(a){if(t(this,16)&&Nk(this.ba,26,a)){var b=this.H.D>>8;Kf(this.H,a,function(a,d){return function(c){d=vd(a.H)-d;var e,g=a.H.L&255,h=a.H.L>>8,k=a.H.L&255,m=a.H.L>>8;if(2==b||3==b)e=" CH(hour)="+ka(h)+" CL(min)="+r(g)+" DH(sec)="+r(m);else if(4==b||5==b)e=" CX(year)="+ka(a.H.I)+" DH(month)="+r(m)+" DL(day)="+r(k);g=a.ba;h=d;g.message("INT "+r(26)+": C="+(Vf(g.H)?1:0)+(e||"")+" (cycles="+h+(c?",level="+(c+1):"")+")")}}(this,vd(this.H)))}return!0};
function Mm(a,b){if(a.la)try{void 0!==b?a.Ga=b:b=!!(a.Ga&&a.H&&a.H.ea.vb);var c=Math.round(fl/mo(a,no));if(20>c||2E4<c)b=!1;b?a.I?(a.I.frequency.value=c,t(a,33554432)&&Cb(a,"speaker set to "+c+"hz",!0)):(a.I=a.la.createOscillator(),a.I&&(a.I.type="number"==typeof a.I.type?1:"square",a.I.connect(a.la.destination),a.I.frequency.value=c,"start"in a.I?a.I.start(0):a.I.noteOn(0),t(a,33554432)&&Cb(a,"speaker on at "+c+"hz",!0))):a.I&&("stop"in a.I?a.I.stop(0):a.I.noteOff(0),a.I.disconnect(),delete a.I,
t(a,33554432)&&Cb(a,"speaker off at "+c+"hz",!0))}catch(d){a.Fa("AudioContext exception: "+d.message),a.la=null}else b&&Cb(a,"BEEP",33554432)}var bl=5150,Uk=5150.9,Kg=5170,cl=5160.101,ol=5180,Tk={5150:bl,5160:5160,5170:Kg,att6300:cl,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Uk};Tk.deskpro386=ol;
var Wk="sw1",$k="sw2",dl="swdesc",Ll=3,ln=1,mn=15,pn=3,qn=4,tn=3,Cn=12,Gn=0,Dn=4,Fn=8,In=16,Hn=32,fn=0,zl=0,Al=32,Bl=1,Cl=160,On=16,bo=1,ao=2,Vn=7,Sn=224,Tn=32,Un=96,Xn=128,Yn=192,Pn=8,Ln=2,Mn=3,Kn=3,Qn=4,Rn=96,lo=0,Ip=1,co=2,Mo=8,Yg=13,jo=0,ko=0,no=2,zo=1,Ao=14,ho=0,Jo=4,Gd=6,io=8,Bo=48,Co=0,Ho=32,Io=48,qo=192,ro=192,yo=6,to=2,so=16,wo=32,uo=64,vo=128,fl=1193181,Do=1,Wo=2,Eo=4,Fo=8,Zo=8,Go=64,To=128,Yo=15,ap=16,$o=32,So=16,Yl={ol:1,ONE:0,Xp:64,Vp:128,Mp:192,yc:192,Mg:6},Xl=2,Wl={Wp:16,kp:32,Np:48,
var Wk="sw1",$k="sw2",dl="swdesc",Ll=3,ln=1,mn=15,pn=3,qn=4,tn=3,Cn=12,Gn=0,Dn=4,Fn=8,In=16,Hn=32,fn=0,zl=0,Al=32,Bl=1,Cl=160,On=16,bo=1,ao=2,Vn=7,Sn=224,Tn=32,Un=96,Xn=128,Yn=192,Pn=8,Ln=2,Mn=3,Kn=3,Qn=4,Rn=96,lo=0,Ip=1,co=2,Mo=8,Yg=13,jo=0,ko=0,no=2,zo=1,Ao=14,ho=0,Jo=4,Gd=6,io=8,Bo=48,Co=0,Ho=32,Io=48,qo=192,ro=192,yo=6,to=2,so=16,wo=32,uo=64,vo=128,fl=1193181,Do=1,Wo=2,Eo=4,Fo=8,Zo=8,Go=64,To=128,Yo=15,ap=16,$o=32,So=16,Yl={ol:1,ONE:0,Zp:64,Xp:128,Op:192,yc:192,Mg:6},Xl=2,Wl={Yp:16,mp:32,Pp:48,
yc:48,Mg:4},Yk=1,el=3,Zk=4,an=5,bn=6,Vm={};Vm[bl]=[{},{}];Vm[bl][0][Yk]={yc:192,Zc:{1:0,2:64,3:128,4:192},Ed:"Number of Floppy Drives"};Vm[bl][0][el]={yc:2,Zc:{0:0,1:2},Ed:"FPU"};Vm[bl][0][Zk]={yc:48,Zc:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},Ed:"Monitor Type"};Vm[bl][0][an]={yc:12,Zc:{16:0,32:4,48:8,64:12},Ed:"Base Memory (16Kb Increments)"};
Vm[bl][1][bn]={yc:31,Zc:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},Ed:"Expansion Memory (32Kb Increments)"};Vm[5160]=[{},{}];Vm[5160][0][Yk]=Vm[bl][0][Yk];Vm[5160][0][el]=Vm[bl][0][el];Vm[5160][0][Zk]=Vm[bl][0][Zk];Vm[5160][0][an]={yc:12,Zc:{64:0,128:4,192:8,256:12},Ed:"Base Memory (64Kb Increments)"};Vm[5160][1][bn]=Vm[bl][1][bn];Vm[cl]=[{},{}];Vm[cl][0][an]={yc:143,Zc:{128:1,256:130,512:8,640:141},Ed:"Base Memory (128Kb Increments)"};
Vm[cl][0][el]={yc:16,Zc:{0:0,1:16},Ed:"FPU"};Vm[cl][1][2]={yc:1,Zc:{0:0,1:1},Ed:"Floppy Type"};Vm[cl][1][Yk]=Vm[bl][0][Yk];Vm[cl][1][Zk]=Vm[bl][0][Zk];
@ -478,10 +478,10 @@ zl,b)},33:function(a,b){return Zn(this,zl,b)},64:function(a,b){return eo(this,jo
6,a,b)},143:function(a,b){return wn(this,1,0,a,b)},160:function(a,b){return Jn(this,Bl,b)},161:function(a,b){return Zn(this,Bl,b)},192:function(a,b){return en(this,1,0,a,b)},194:function(a,b){return hn(this,1,0,a,b)},196:function(a,b){return en(this,1,1,a,b)},198:function(a,b){return hn(this,1,1,a,b)},200:function(a,b){return en(this,1,2,a,b)},202:function(a,b){return hn(this,1,2,a,b)},204:function(a,b){return en(this,1,3,a,b)},206:function(a,b){return hn(this,1,3,a,b)},208:function(a,b){return kn(this,
1,a,b)},218:function(a,b){return un(this,1,a,b)}},kl={96:Sk.prototype.Sl,97:Sk.prototype.Rl,100:Sk.prototype.Tl,102:function(a,b){return Kp(this,0,a,b)},103:function(a,b){return Kp(this,1,a,b)}},pl={72:function(a,b){return eo(this,1,0,a,b)},73:function(a,b){return eo(this,1,1,a,b)},74:function(a,b){return eo(this,1,2,a,b)},75:function(a,b){return oo(this,1,a,b)}},hl={0:function(a,b,c){gn(this,0,0,a,b,c)},1:function(a,b,c){jn(this,0,0,a,b,c)},2:function(a,b,c){gn(this,0,1,a,b,c)},3:function(a,b,c){jn(this,
0,1,a,b,c)},4:function(a,b,c){gn(this,0,2,a,b,c)},5:function(a,b,c){jn(this,0,2,a,b,c)},6:function(a,b,c){gn(this,0,3,a,b,c)},7:function(a,b,c){jn(this,0,3,a,b,c)},8:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA0.CMD",null,!0);this.F[0].Xg=b},9:function(a,b,c){nn(this,0,a,b,c)},10:function(a,b,c){on(this,0,a,b,c)},11:function(a,b,c){sn(this,0,a,b,c)},12:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA0.RESET_FF",null,!0);this.F[0].zb=0},13:function(a,b,c){vn(this,0,a,b,c)},32:function(a,b,c){Nn(this,
zl,b,c)},33:function(a,b,c){$n(this,zl,b,c)},64:function(a,b,c){go(this,jo,ko,a,b,c)},65:function(a,b,c){go(this,jo,1,a,b,c)},66:function(a,b,c){go(this,jo,no,a,b,c)},67:function(a,b,c){po(this,jo,a,b,c)},129:function(a,b,c){xn(this,0,2,a,b,c)},130:function(a,b,c){xn(this,0,3,a,b,c)},131:function(a,b,c){xn(this,0,1,a,b,c)},135:function(a,b,c){xn(this,0,0,a,b,c)}},jl={96:Sk.prototype.ho,97:Sk.prototype.io,98:Sk.prototype.jo,99:Sk.prototype.ko,160:Sk.prototype.Nk},nl={96:Sk.prototype.tn,97:Sk.prototype.un,
100:Sk.prototype.sn,112:Sk.prototype.In,113:Sk.prototype.Jn,128:function(a,b,c){zn(this,7,a,b,c)},132:function(a,b,c){zn(this,0,a,b,c)},133:function(a,b,c){zn(this,1,a,b,c)},134:function(a,b,c){zn(this,2,a,b,c)},136:function(a,b,c){zn(this,3,a,b,c)},137:function(a,b,c){xn(this,1,2,a,b,c)},138:function(a,b,c){xn(this,1,3,a,b,c)},139:function(a,b,c){xn(this,1,1,a,b,c)},140:function(a,b,c){zn(this,4,a,b,c)},141:function(a,b,c){zn(this,5,a,b,c)},142:function(a,b,c){zn(this,6,a,b,c)},143:function(a,b,
zl,b,c)},33:function(a,b,c){$n(this,zl,b,c)},64:function(a,b,c){go(this,jo,ko,a,b,c)},65:function(a,b,c){go(this,jo,1,a,b,c)},66:function(a,b,c){go(this,jo,no,a,b,c)},67:function(a,b,c){po(this,jo,a,b,c)},129:function(a,b,c){xn(this,0,2,a,b,c)},130:function(a,b,c){xn(this,0,3,a,b,c)},131:function(a,b,c){xn(this,0,1,a,b,c)},135:function(a,b,c){xn(this,0,0,a,b,c)}},jl={96:Sk.prototype.jo,97:Sk.prototype.ko,98:Sk.prototype.lo,99:Sk.prototype.mo,160:Sk.prototype.Nk},nl={96:Sk.prototype.vn,97:Sk.prototype.wn,
100:Sk.prototype.un,112:Sk.prototype.Kn,113:Sk.prototype.Ln,128:function(a,b,c){zn(this,7,a,b,c)},132:function(a,b,c){zn(this,0,a,b,c)},133:function(a,b,c){zn(this,1,a,b,c)},134:function(a,b,c){zn(this,2,a,b,c)},136:function(a,b,c){zn(this,3,a,b,c)},137:function(a,b,c){xn(this,1,2,a,b,c)},138:function(a,b,c){xn(this,1,3,a,b,c)},139:function(a,b,c){xn(this,1,1,a,b,c)},140:function(a,b,c){zn(this,4,a,b,c)},141:function(a,b,c){zn(this,5,a,b,c)},142:function(a,b,c){zn(this,6,a,b,c)},143:function(a,b,
c){xn(this,1,0,a,b,c)},160:function(a,b,c){Nn(this,Bl,b,c)},161:function(a,b,c){$n(this,Bl,b,c)},192:function(a,b,c){gn(this,1,0,a,b,c)},194:function(a,b,c){jn(this,1,0,a,b,c)},196:function(a,b,c){gn(this,1,1,a,b,c)},198:function(a,b,c){jn(this,1,1,a,b,c)},200:function(a,b,c){gn(this,1,2,a,b,c)},202:function(a,b,c){jn(this,1,2,a,b,c)},204:function(a,b,c){gn(this,1,3,a,b,c)},206:function(a,b,c){jn(this,1,3,a,b,c)},208:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA1.CMD",null,!0);this.F[1].Xg=b},210:function(a,
b,c){nn(this,1,a,b,c)},212:function(a,b,c){on(this,1,a,b,c)},214:function(a,b,c){sn(this,1,a,b,c)},216:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA1.RESET_FF",null,!0);this.F[1].zb=0},218:function(a,b,c){vn(this,1,a,b,c)},240:Sk.prototype.Tn,241:Sk.prototype.Un},ll={96:Sk.prototype.rn,97:Sk.prototype.qn,160:Sk.prototype.Nk},ql={72:function(a,b,c){go(this,1,0,a,b,c)},73:function(a,b,c){go(this,1,1,a,b,c)},74:function(a,b,c){go(this,1,2,a,b,c)},75:function(a,b,c){po(this,1,a,b,c)}};
b,c){nn(this,1,a,b,c)},212:function(a,b,c){on(this,1,a,b,c)},214:function(a,b,c){sn(this,1,a,b,c)},216:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA1.RESET_FF",null,!0);this.F[1].zb=0},218:function(a,b,c){vn(this,1,a,b,c)},240:Sk.prototype.Vn,241:Sk.prototype.Wn},ll={96:Sk.prototype.tn,97:Sk.prototype.sn,160:Sk.prototype.Nk},ql={72:function(a,b,c){go(this,1,0,a,b,c)},73:function(a,b,c){go(this,1,1,a,b,c)},74:function(a,b,c){go(this,1,2,a,b,c)},75:function(a,b,c){po(this,1,a,b,c)}};
Ra(function(){for(var a=pb(document,"pcx86","chipset"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new Sk(d);ob(d,c);dn(d)}});
function Pp(a){ab.call(this,"ROM",a);this.A=null;this.F=a.addr;this.C=a.size;this.D=a.alias;this.G=a.file;this.B=a.notify;this.I=null;if(this.B&&(a=this.B.indexOf("["),0<a)){try{this.I=eval(this.B.substr(a))}catch(d){}this.B=this.B.substr(0,a)}if(this.G){a=this.G;var b=ma(la(a));"json"!=b&&"hex"!=b&&(a=Da()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var c=this;Ca(a,null,!0,function(a,b,f){Qp(c,a,b,f)})}}ba(Pp,ab);Pp.prototype.uc=function(a,b,c,d){this.ka=b;this.H=c;this.ba=d;Rp(this)};
Pp.prototype.Xb=function(){this.Fd&&(this.ba&&Sp(this.ba,this.id,0,this.F>>>4,0,this.F,this.C,this.Fd),delete this.Fd);return!0};Pp.prototype.Wb=function(){return!0};
@ -511,14 +511,14 @@ e.A.push(f),1==e.A.length&&e.W&&Hp(e.W,f)):(e.A.length==Zq&&e.A.push($q),Cb(e,"s
var qq={TAB:1009,ESC:1027,F1:1112,F2:1113,F3:1114,F4:1115,F5:1116,F6:1117,F7:1118,F8:1119,F9:1120,F10:1121,LEFT:1037,UP:1038,RIGHT:1039,DOWN:1040,SYSREQ:4027,CTRL_C:ar,CTRL_BREAK:Mq,CTRL_ALT_DEL:4046,CTRL_ALT_INS:4045,CTRL_ALT_ENTER:4013},sq={esc:1027,1:n["1"],2:n["2"],3:n["3"],4:n["4"],5:n["5"],6:n["6"],7:n["7"],8:n["8"],9:n["9"],0:n["0"],"-":n["-"],"=":n["="],bs:1008,tab:1009,q:n.Q,w:n.Mi,e:n.E,r:n.Hi,t:n.Ji,y:n.Oi,u:n.Ki,i:n.zi,o:n.Fi,p:n.Gi,"[":n["["],"]":n["]"],enter:13,ctrl:1017,a:n.ce,s:n.Ii,
d:n.vi,f:n.wi,g:n.xi,h:n.yi,j:n.Ai,k:n.Bi,l:n.Ci,";":n[";"],quote:n["'"],"`":n["`"],shift:1016,"\\":n["\\"],z:n.eg,x:n.Ni,c:n.ui,v:n.Li,b:n.ti,n:n.Ei,m:n.Di,",":n[","],".":n["."],"/":n["/"],"right-shift":3016,prtsc:1044,alt:1018,space:1032,"caps-lock":nq,f1:1112,f2:1113,f3:1114,f4:1115,f5:1116,f6:1117,f7:1118,f8:1119,f9:1120,f10:1121,"num-lock":oq,"scroll-lock":pq,"num-home":1036,"num-up":1038,"num-pgup":1033,"num-sub":1109,"num-left":1037,"num-center":1101,"num-right":1039,"num-add":1107,"num-end":1035,
"num-down":1040,"num-pgdn":1034,"num-ins":1045,"num-del":1046,sysreq:84},Dq={"caps-lock":Jq,"num-lock":1024,"scroll-lock":2048},O={1027:1};O[n["1"]]=2;O[n["!"]]=2|P<<8;O[n["2"]]=3;O[n["@"]]=3|P<<8;O[n["3"]]=4;O[n["#"]]=4|P<<8;O[n["4"]]=5;O[n.$]=5|P<<8;O[n["5"]]=6;O[n["%"]]=6|P<<8;O[n["6"]]=7;O[n["^"]]=7|P<<8;O[n["7"]]=8;O[n["&"]]=8|P<<8;O[n["8"]]=9;O[n["*"]]=9|P<<8;O[n["9"]]=10;O[n["("]]=10|P<<8;O[n["0"]]=11;O[n[")"]]=11|P<<8;O[n["-"]]=12;O[n._]=12|P<<8;O[n["="]]=13;O[n["+"]]=13|P<<8;O[1008]=Qq;
O[1009]=15;O[n.q]=16;O[n.Q]=16|P<<8;O[n.Qo]=17;O[n.Mi]=17|P<<8;O[n.e]=18;O[n.E]=18|P<<8;O[n.r]=19;O[n.Hi]=19|P<<8;O[n.t]=20;O[n.Ji]=20|P<<8;O[n.y]=21;O[n.Oi]=21|P<<8;O[n.Oo]=22;O[n.Ki]=22|P<<8;O[n.Kl]=23;O[n.zi]=23|P<<8;O[n.on]=24;O[n.Fi]=24|P<<8;O[n.p]=25;O[n.Gi]=25|P<<8;O[n["["]]=26;O[n["{"]]=26|P<<8;O[n["]"]]=27;O[n["}"]]=27|P<<8;O[13]=28;O[1017]=Vq;O[n.de]=30;O[n.ce]=30|P<<8;O[n.Lo]=31;O[n.Ii]=31|P<<8;O[n.d]=32;O[n.vi]=32|P<<8;O[n.Hl]=33;O[n.wi]=33|P<<8;O[n.Il]=34;O[n.xi]=34|P<<8;O[n.Jl]=35;
O[n.yi]=35|P<<8;O[n.an]=36;O[n.Ai]=36|P<<8;O[n.k]=37;O[n.Bi]=37|P<<8;O[n.bn]=38;O[n.Ci]=38|P<<8;O[n[";"]]=39;O[n[":"]]=39|P<<8;O[n["'"]]=40;O[n['"']]=40|P<<8;O[n["`"]]=41;O[n["~"]]=41|P<<8;O[1016]=P;O[n["\\"]]=43;O[n["|"]]=43|P<<8;O[n.z]=44;O[n.eg]=44|P<<8;O[n.x]=45;O[n.Ni]=45|P<<8;O[n.xl]=46;O[n.ui]=46|P<<8;O[n.Po]=47;O[n.Li]=47|P<<8;O[n.vl]=48;O[n.ti]=48|P<<8;O[n.n]=49;O[n.Ei]=49|P<<8;O[n.fn]=50;O[n.Di]=50|P<<8;O[n[","]]=51;O[n["<"]]=51|P<<8;O[n["."]]=52;O[n[">"]]=52|P<<8;O[n["/"]]=53;
O[1009]=15;O[n.q]=16;O[n.Q]=16|P<<8;O[n.So]=17;O[n.Mi]=17|P<<8;O[n.e]=18;O[n.E]=18|P<<8;O[n.r]=19;O[n.Hi]=19|P<<8;O[n.t]=20;O[n.Ji]=20|P<<8;O[n.y]=21;O[n.Oi]=21|P<<8;O[n.Qo]=22;O[n.Ki]=22|P<<8;O[n.Kl]=23;O[n.zi]=23|P<<8;O[n.qn]=24;O[n.Fi]=24|P<<8;O[n.p]=25;O[n.Gi]=25|P<<8;O[n["["]]=26;O[n["{"]]=26|P<<8;O[n["]"]]=27;O[n["}"]]=27|P<<8;O[13]=28;O[1017]=Vq;O[n.de]=30;O[n.ce]=30|P<<8;O[n.No]=31;O[n.Ii]=31|P<<8;O[n.d]=32;O[n.vi]=32|P<<8;O[n.Hl]=33;O[n.wi]=33|P<<8;O[n.Il]=34;O[n.xi]=34|P<<8;O[n.Jl]=35;
O[n.yi]=35|P<<8;O[n.an]=36;O[n.Ai]=36|P<<8;O[n.k]=37;O[n.Bi]=37|P<<8;O[n.dn]=38;O[n.Ci]=38|P<<8;O[n[";"]]=39;O[n[":"]]=39|P<<8;O[n["'"]]=40;O[n['"']]=40|P<<8;O[n["`"]]=41;O[n["~"]]=41|P<<8;O[1016]=P;O[n["\\"]]=43;O[n["|"]]=43|P<<8;O[n.z]=44;O[n.eg]=44|P<<8;O[n.x]=45;O[n.Ni]=45|P<<8;O[n.xl]=46;O[n.ui]=46|P<<8;O[n.Ro]=47;O[n.Li]=47|P<<8;O[n.vl]=48;O[n.ti]=48|P<<8;O[n.n]=49;O[n.Ei]=49|P<<8;O[n.hn]=50;O[n.Di]=50|P<<8;O[n[","]]=51;O[n["<"]]=51|P<<8;O[n["."]]=52;O[n[">"]]=52|P<<8;O[n["/"]]=53;
O[n["?"]]=53|P<<8;O[3016]=54;O[1044]=55;O[1018]=Xq;O[1032]=57;O[nq]=58;O[1112]=59;O[1113]=60;O[1114]=61;O[1115]=62;O[1116]=63;O[1117]=64;O[1118]=65;O[1119]=66;O[1120]=67;O[1121]=68;O[oq]=69;O[pq]=70;O[1036]=71;O[1038]=72;O[1033]=73;O[1109]=74;O[1037]=75;O[1101]=76;O[1039]=77;O[1107]=78;O[1035]=79;O[1040]=80;O[1034]=81;O[1045]=82;O[1046]=Rq;O[4027]=84;O[1122]=87;O[1123]=88;O[1091]=91;O[1093]=93;O[1224]=91;O[ar]=46|Vq<<8;O[Mq]=70|Vq<<8;O[4046]=Rq|Vq<<8|Xq<<16;O[4045]=82|Vq<<8|Xq<<16;
O[4013]=28|Vq<<8|Xq<<16;var jp=255,mp=243,op=237,xq=170,kp=250,$q=255,Zq=20;Ra(function(){for(var a=pb(document,"pcx86","keyboard"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new iq(d);ob(d,c)}});
function br(a,b,c,d){if(void 0!==b&&(!c||c.length)){this.video=a;var e=cr[b],f=a.ga||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(b<Tp?dr:er)];this.ba=a.ba;this.type=e[0];this.port=e[1];this.La=b;this.bb=e[2];this.Ob=e[3];this.qd=d||e[4];65536<=this.qd&&720896<=this.bb&&(this.Ob=Math.min(this.qd>>2,32768));this.rc=c[0];this.Xc=c[1];this.Ze=c[2];this.fa=c[3];this.ec=c[4]&255;this.Fg=c[4]>>8&255;this.Wa=c[5];this.oh=dr;this.gg=fr;if(b>=Tp){this.oh=er;this.gg=gr;(b=c[6])||(b=[!1,0,Array(hr),0,f==
Ll?0:ir,0,0,Array(jr),0,0,0,Array(kr),0,[this.bb,this.Ob,this.qd],Array(this.qd>>2),lr|mr|nr|or|pr,0,-1,0,-1,0,-1,0,0,0,0,qr,rr,0,0,sr,Array(tr)]);this.Ke=b[0];this.wd=b[1];this.Cc=b[2];this.Tg=ur;this.Ig=b[3];this.af=b[4];this.Pf=b[5];this.zd=b[6];this.$d=b[7];this.Vg=vr;this.Wk=b[8];this.Xk=b[9];this.yd=b[10];this.xd=b[11];this.Ug=wr;this.tb=b[12];d=b[13];"number"==typeof d&&(d=[this.bb,this.Ob,d]);this.bb=d[0];this.Ob=d[1];d=this.qd>>2;if((this.fd=b[14])&&this.fd.length<d){for(var e=this.fd,g=
0,h=Array(d),k=0;k<e.length-1;){for(var m=e[k++],p=e[k++];m--;)h[g]=p,g+=2;g==d&&(g=1)}this.fd=h}(d=b[15])&&(d&pr?d&=~pr:d=xr[d&65280]|xr[d&255]);this.Kg(d);this.ei=b[16];this.gb=b[17];this.Qc=b[18];this.Bb=b[19];this.Hf=b[20];this.Md=b[21];this.Yd=b[22];this.ph=b[23];this.qh=b[24];this.vd=b[25];this.fi=this.Ye=0;this.La==Vp&&(this.ki=b[26],this.Gg=b[27],this.dd=b[28],this.xc=b[29],this.Hg=b[30],this.$e=b[31])}f=yr[f]||yr[Ll];this.rh=a.H.T.sd/f.xg|0;this.jn=this.rh*f.Dg/100|0;this.uh=this.rh*f.wg|
0;this.mn=this.uh*f.Eg/100|0;this.wh=c[7]||0}}
0,h=Array(d),k=0;k<e.length-1;){for(var m=e[k++],p=e[k++];m--;)h[g]=p,g+=2;g==d&&(g=1)}this.fd=h}(d=b[15])&&(d&pr?d&=~pr:d=xr[d&65280]|xr[d&255]);this.Kg(d);this.ei=b[16];this.gb=b[17];this.Qc=b[18];this.Bb=b[19];this.Hf=b[20];this.Md=b[21];this.Yd=b[22];this.ph=b[23];this.qh=b[24];this.vd=b[25];this.fi=this.Ye=0;this.La==Vp&&(this.ki=b[26],this.Gg=b[27],this.dd=b[28],this.xc=b[29],this.Hg=b[30],this.$e=b[31])}f=yr[f]||yr[Ll];this.rh=a.H.T.sd/f.xg|0;this.mn=this.rh*f.Dg/100|0;this.uh=this.rh*f.wg|
0;this.on=this.uh*f.Eg/100|0;this.wh=c[7]||0}}
function zr(a){var b=[];if(void 0!==a.La){b[0]=a.rc;b[1]=a.Xc;b[2]=a.Ze;b[3]=a.fa;b[4]=a.ec|a.Fg<<8;b[5]=a.Wa;if(a.La>=Tp){var c=[];c[0]=a.Ke;c[1]=a.wd;c[2]=a.Cc;c[3]=a.Ig;c[4]=a.af;c[5]=a.Pf;c[6]=a.zd;c[7]=a.$d;c[8]=a.Wk;c[9]=a.Xk;c[10]=a.yd;c[11]=a.xd;c[12]=a.tb;c[13]=[a.bb,a.Ob,a.qd];var d;if(d=a.fd){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var k=d[h],m=h+2;m<d.length&&d[m]===k;)m+=2;f[e++]=m-h>>1;f[e++]=k;h=m}f.length<d.length&&(d=f)}c[14]=d;c[15]=a.tg|pr;
c[16]=a.ei;c[17]=a.gb;c[18]=a.Qc;c[19]=a.Bb;c[20]=a.Hf;c[21]=a.Md;c[22]=a.Yd;c[23]=a.ph;c[24]=a.qh;c[25]=a.vd;a.La==Vp&&(c[26]=a.ki,c[27]=a.Gg,c[28]=a.dd,c[29]=a.xc,c[30]=a.Hg,c[31]=a.$e);b[6]=c}b[7]=a.wh}return b}function Ar(a,b,c,d,e){if(d){var f,g="";for(f=0;f<e.length;f++){var h=d===a.Wa?Br(a,f):d[f];g&&(g+="\n");g+=b+"["+q(f,2)+"]: "+qa(e[f],18)+(f===c?"*":" ")+q(h,255<h?4:2);null!=h&&(g+=" ("+h+".)")}a.ba.P(g)}else a.ba.P(b+": "+q(c,2))}br.prototype.vj=function(a){return[this.fd,a-this.bb]};
br.prototype.fh=function(){return this.A};br.prototype.Kg=function(a){if(null!=a&&a!=this.tg){var b=a&Cr,c=Dr[b];c||b&mr&&(c=Dr[mr]);var b=a&Er,d=Dr[b];d||b&or&&(d=Dr[or]);this.A||(this.A=Array(6));this.A[0]=c;this.A[1]=d;this.tg=a}};
@ -575,32 +575,32 @@ function qs(a,b){if(a.ea.Yb){var c=!1,d=a.C;d&&(d!==a.A?d.Xc&8&&(c=!0):d.wd&32&&
a.M[d]=p,f++),c+=2,d++;a.ma=!0;f&&a.Ca&&a.L.drawImage(a.Ba,0,0,a.$a,a.eb,a.vc,a.zc,a.Qb,a.Rb);Ts(a)}}else if(a.Pb){var g=k,u,k=c,d=a.ya=0,f=a.Eb,e=16==f?65536:196608,h=16==f?1:2;b=Hs(a,h);for(var p=m=0,w=a.F,F=0,K=a.J,H=0;k<g;){u=Ac(a.ka,k);if(a.ma&&u===a.M[d])m+=f;else{a.M[d]=u;u=u>>8|(u&255)<<8;var I=e,T=16;m<w&&(w=m);for(var L=0;L<f;L++){var ua=(u&(I>>=h))>>(T-=h);Ss(a.Ha,m++,p,b[ua])}m>F&&(F=m);p<K&&(K=p);p>=H&&(H=p+1)}k+=2;d++;if(m>=a.F){m=0;p+=2;if(p>a.J)break;p==a.J&&(p=1,k=c+a.Pb)}}a.ma=!0;
w<a.F&&(a.Ca.putImageData(a.Ha,0,0,w,K,F-w,H-K),a.L.drawImage(a.Ba,0,0,a.F,a.J,0,0,a.Z,a.la))}else if(a.Pc){g=h;f=a.ya=0;e=Hs(a,8);h=a.C.fd;m=b=0;p=a.F;w=0;F=a.J;K=0;H=a.C.$d[4]&8?4:1;u=a.C.Cc[19]&15;for(I=a.Ma>a.F?a.Ma-a.F-u>>3:0;c<k;){d=h[c-g];L=4;u||(a.ma&&d===a.M[f]?(b+=L,L=0):a.M[f]=d,f++);if(L){b<p&&(p=b);for(T=0;T<L;T++)Ss(a.Ha,b++,m,e[d&255]),d>>=8;b>w&&(w=b);m<F&&(F=m);m>=K&&(K=m+1)}c+=H;if(b>=a.F){b=0;if(++m>a.J)break;c+=I}}u||(a.ma=!0);p<a.F&&(a.Ca.putImageData(a.Ha,0,0,p,F,w-p,K-F),a.L.drawImage(a.Ba,
0,0,a.F,a.J,0,0,a.Z,a.la))}else{g=h;d=a.ya=0;f=Hs(a);e=a.C.fd;b=h=0;m=a.F;p=0;w=a.J;F=0;K=a.C.Cc[19]&15;for(H=a.Ma>a.F?a.Ma-a.F-K>>3:0;c<k;){u=c++-g;u=e[u];T=8;K?h?(I=a.F-h,T>I&&(T=I)):(u<<=K,T-=K,a.ma=!1):(a.ma&&u===a.M[d]?(h+=T,T=0):a.M[d]=u,d++);if(T){h<m&&(m=h);for(I=0;I<T;I++)L=Pt[u&2155905152]||0,Ss(a.Ha,h++,b,f[L]),u<<=1;h>p&&(p=h);b<w&&(w=b);b>=F&&(F=b+1)}if(h>=a.F){h=0;if(++b>a.J)break;c+=H}}K||(a.ma=!0);m<a.F&&(a.Ca.putImageData(a.Ha,0,0,m,w,p-m,F-w),a.L.drawImage(a.Ba,0,0,a.F,a.J,0,0,a.Z,
a.la))}}}}function Ot(a,b){var c=0;a=vd(a.H)-b.wh;0>a&&(b.wh=a,a=-a|0);a%b.rh>b.jn&&(c|=1);a%b.uh>b.mn&&(c|=9);b.fi=a/b.uh|0;return c}l.Cm=function(a,b){return Qt(this,this.Y,a,b)};l.co=function(a,b,c){var d=this.Y;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.Bm=function(a,b){return Rt(this,this.Y,a,b)};l.bo=function(a,b,c){St(this,this.Y,a,b,c)};l.Dm=function(a,b){return Tt(this,this.Y,b)};l.eo=function(a,b,c){a=this.Y;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};
a.la))}}}}function Ot(a,b){var c=0;a=vd(a.H)-b.wh;0>a&&(b.wh=a,a=-a|0);a%b.rh>b.mn&&(c|=1);a%b.uh>b.on&&(c|=9);b.fi=a/b.uh|0;return c}l.Cm=function(a,b){return Qt(this,this.Y,a,b)};l.fo=function(a,b,c){var d=this.Y;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.Bm=function(a,b){return Rt(this,this.Y,a,b)};l.eo=function(a,b,c){St(this,this.Y,a,b,c)};l.Dm=function(a,b){return Tt(this,this.Y,b)};l.ho=function(a,b,c){a=this.Y;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};
l.Em=function(a,b){return Ut(this,this.Y,b)};l.Mk=function(a,b,c){this.A.Pf=this.A.Pf&-4|b&3;v(this,a,b,c,"FEAT")};l.am=function(a,b){a=this.A.wd;b&&!t(this)||v(this,960,null,b,"ATC.INDX",a);return a};l.rl=function(a,b){a=this.A.Cc[this.A.wd&31];b&&!t(this)||v(this,960,null,b,"ATC."+this.A.Tg[this.A.wd&31],a);return a};
l.Lk=function(a,b,c){var d=this.A,e=d.wd&32;if(d.Ke){d.Ke=!1;var f=d.wd&31;if(16<=f||!e)if(Vt||d.Cc[f]!==b)c&&!t(this)||v(this,a,b,c,"ATC."+d.Tg[f]),d.Cc[f]=b,Lt(this,!1)}else d.wd=b,v(this,a,b,c,"ATC.INDX"),d.Ke=!0,b&32&&!e&&xs(this,!0)&&qs(this,!0),a=(d.Wa[12]<<8)+d.Wa[13]|0,d.vd!=a&&(d.vd=a,Lt(this)),d.Ye=0};
l.Om=function(a,b){a=0;if(this.La==Tp)a=3-((this.A.af&12)>>2),a=(this.xb&1<<a)<<4-a;else{var c=this.A.$e[0];45!=(c&63)&&2880!=(c&4032)&&184320!=(c&258048)&&(a|=16)}a|=this.A.Ig&-17;this.A.Ig=a;v(this,962,null,b,"STATUS0",a);return a};l.fo=function(a,b,c){this.A.af=b;ws(this);v(this,962,b,c,"MISC")};l.Pm=function(a,b){a=this.A.ki;v(this,963,null,b,"VGA_ENABLE",a);return a};l.oo=function(a,b,c){this.A.ki=b;v(this,963,b,c,"VGA_ENABLE")};
l.Mm=function(a,b){a=this.A.zd;v(this,964,null,b,"SEQ.INDX",a);return a};l.mo=function(a,b,c){this.A.zd=b;v(this,964,b,c,"SEQ.INDX")};l.Lm=function(a,b){a=this.A.$d[this.A.zd];b&&!t(this)||v(this,965,null,b,"SEQ."+this.A.Vg[this.A.zd],a);return a};l.lo=function(a,b,c){if(Vt||this.A.$d[this.A.zd]!==b)c&&!t(this)||v(this,965,b,c,"SEQ."+this.A.Vg[this.A.zd]),this.A.$d[this.A.zd]=b;switch(this.A.zd){case 2:this.A.gb=Yr[b&15];break;case 4:Ys(this,Xs(this))&&qs(this,!0)}};
l.nm=function(a,b){a=this.A.Gg;b&&!t(this)||v(this,966,null,b,"DAC.MASK",a);return a};l.Mn=function(a,b,c){if(Vt||this.A.Gg!==b)c&&!t(this)||v(this,966,b,c,"DAC.MASK"),this.A.Gg=b};l.om=function(a,b){a=this.A.Hg;b&&!t(this)||v(this,967,null,b,"DAC.STATE",a);return a};l.Nn=function(a,b,c){c&&!t(this)||v(this,967,b,c,"DAC.READ");this.A.dd=b;this.A.Hg=3;this.A.xc=0};l.On=function(a,b,c){c&&!t(this)||v(this,968,b,c,"DAC.WRITE");this.A.dd=b;this.A.Hg=sr;this.A.xc=0};
l.mm=function(a,b){a=this.A.$e[this.A.dd]>>this.A.xc&63;b&&!t(this)||v(this,969,null,b,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]",a);this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1);return a};l.Ln=function(a,b,c){a=this.A.$e[this.A.dd];c&&!t(this)||v(this,969,b,c,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]");b=a&~(63<<this.A.xc)|(b&63)<<this.A.xc;a!==b&&(this.A.$e[this.A.dd]=b,Lt(this,!1));this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1)};
l.Qm=function(a,b){a=this.A.Pf;v(this,970,null,b,"FEAT",a);return a};l.Yn=function(a,b,c){this.A.Xk=b;v(this,970,b,c,"GRC2")};l.Rm=function(a,b){a=this.A.af;v(this,972,null,b,"MISC",a);return a};l.Xn=function(a,b,c){this.A.Wk=b;v(this,972,b,c,"GRC1")};l.vm=function(a,b){a=this.A.yd;v(this,974,null,b,"GRC.INDX",a);return a};l.Wn=function(a,b,c){this.A.yd=b;v(this,974,b,c,"GRC.INDX")};l.um=function(a,b){a=this.A.xd[this.A.yd];b&&!t(this)||v(this,975,null,b,"GRC."+this.A.Ug[this.A.yd],a);return a};
l.Vn=function(a,b,c){if(Vt||this.A.xd[this.A.yd]!==b)c&&!t(this)||v(this,975,b,c,"GRC."+this.A.Ug[this.A.yd]),this.A.xd[this.A.yd]=b;switch(this.A.yd){case 0:this.A.Hf=Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 1:this.A.Md=~Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 2:this.A.ph=Yr[b&15]&-2139062144;break;case 3:case 5:Ys(this,Xs(this));break;case 4:this.A.ei=(b&3)<<3;break;case 6:Fs(this,!1);break;case 7:this.A.qh=Yr[b&15]&-2139062144;break;case 8:this.A.Bb=b|b<<8|b<<16|b<<24}};
l.gm=function(a,b){return Qt(this,this.K,a,b)};l.Gn=function(a,b,c){var d=this.K;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.fm=function(a,b){return Rt(this,this.K,a,b)};l.Fn=function(a,b,c){St(this,this.K,a,b,c)};l.hm=function(a,b){return Tt(this,this.K,b)};l.Hn=function(a,b,c){a=this.K;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};l.em=function(a,b){var c=this.K.Ze;b&&!t(this)||v(this,a,null,b,this.K.type+".COLOR",c);return c};
l.En=function(a,b,c){c&&!t(this)||v(this,a,b,c,this.K.type+".COLOR");this.K.Ze!==b&&(this.K.Ze=b,Lt(this,!1))};l.im=function(a,b){return Ut(this,this.K,b)};function Qt(a,b,c,d){var e;b.rc&&(e=b.ec);v(a,c,null,d,"CRTC.INDX",e);return e}function Rt(a,b,c,d){var e;b.rc&&b.ec<b.oh&&(e=b.Wa[b.ec]);d&&!t(a)||v(a,c,null,d,"CRTC."+b.gg[b.ec],e);return e}
l.Om=function(a,b){a=0;if(this.La==Tp)a=3-((this.A.af&12)>>2),a=(this.xb&1<<a)<<4-a;else{var c=this.A.$e[0];45!=(c&63)&&2880!=(c&4032)&&184320!=(c&258048)&&(a|=16)}a|=this.A.Ig&-17;this.A.Ig=a;v(this,962,null,b,"STATUS0",a);return a};l.io=function(a,b,c){this.A.af=b;ws(this);v(this,962,b,c,"MISC")};l.Pm=function(a,b){a=this.A.ki;v(this,963,null,b,"VGA_ENABLE",a);return a};l.qo=function(a,b,c){this.A.ki=b;v(this,963,b,c,"VGA_ENABLE")};
l.Mm=function(a,b){a=this.A.zd;v(this,964,null,b,"SEQ.INDX",a);return a};l.oo=function(a,b,c){this.A.zd=b;v(this,964,b,c,"SEQ.INDX")};l.Lm=function(a,b){a=this.A.$d[this.A.zd];b&&!t(this)||v(this,965,null,b,"SEQ."+this.A.Vg[this.A.zd],a);return a};l.no=function(a,b,c){if(Vt||this.A.$d[this.A.zd]!==b)c&&!t(this)||v(this,965,b,c,"SEQ."+this.A.Vg[this.A.zd]),this.A.$d[this.A.zd]=b;switch(this.A.zd){case 2:this.A.gb=Yr[b&15];break;case 4:Ys(this,Xs(this))&&qs(this,!0)}};
l.nm=function(a,b){a=this.A.Gg;b&&!t(this)||v(this,966,null,b,"DAC.MASK",a);return a};l.On=function(a,b,c){if(Vt||this.A.Gg!==b)c&&!t(this)||v(this,966,b,c,"DAC.MASK"),this.A.Gg=b};l.om=function(a,b){a=this.A.Hg;b&&!t(this)||v(this,967,null,b,"DAC.STATE",a);return a};l.Pn=function(a,b,c){c&&!t(this)||v(this,967,b,c,"DAC.READ");this.A.dd=b;this.A.Hg=3;this.A.xc=0};l.Qn=function(a,b,c){c&&!t(this)||v(this,968,b,c,"DAC.WRITE");this.A.dd=b;this.A.Hg=sr;this.A.xc=0};
l.mm=function(a,b){a=this.A.$e[this.A.dd]>>this.A.xc&63;b&&!t(this)||v(this,969,null,b,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]",a);this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1);return a};l.Nn=function(a,b,c){a=this.A.$e[this.A.dd];c&&!t(this)||v(this,969,b,c,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]");b=a&~(63<<this.A.xc)|(b&63)<<this.A.xc;a!==b&&(this.A.$e[this.A.dd]=b,Lt(this,!1));this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1)};
l.Qm=function(a,b){a=this.A.Pf;v(this,970,null,b,"FEAT",a);return a};l.$n=function(a,b,c){this.A.Xk=b;v(this,970,b,c,"GRC2")};l.Rm=function(a,b){a=this.A.af;v(this,972,null,b,"MISC",a);return a};l.Zn=function(a,b,c){this.A.Wk=b;v(this,972,b,c,"GRC1")};l.vm=function(a,b){a=this.A.yd;v(this,974,null,b,"GRC.INDX",a);return a};l.Yn=function(a,b,c){this.A.yd=b;v(this,974,b,c,"GRC.INDX")};l.um=function(a,b){a=this.A.xd[this.A.yd];b&&!t(this)||v(this,975,null,b,"GRC."+this.A.Ug[this.A.yd],a);return a};
l.Xn=function(a,b,c){if(Vt||this.A.xd[this.A.yd]!==b)c&&!t(this)||v(this,975,b,c,"GRC."+this.A.Ug[this.A.yd]),this.A.xd[this.A.yd]=b;switch(this.A.yd){case 0:this.A.Hf=Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 1:this.A.Md=~Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 2:this.A.ph=Yr[b&15]&-2139062144;break;case 3:case 5:Ys(this,Xs(this));break;case 4:this.A.ei=(b&3)<<3;break;case 6:Fs(this,!1);break;case 7:this.A.qh=Yr[b&15]&-2139062144;break;case 8:this.A.Bb=b|b<<8|b<<16|b<<24}};
l.gm=function(a,b){return Qt(this,this.K,a,b)};l.In=function(a,b,c){var d=this.K;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.fm=function(a,b){return Rt(this,this.K,a,b)};l.Hn=function(a,b,c){St(this,this.K,a,b,c)};l.hm=function(a,b){return Tt(this,this.K,b)};l.Jn=function(a,b,c){a=this.K;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};l.em=function(a,b){var c=this.K.Ze;b&&!t(this)||v(this,a,null,b,this.K.type+".COLOR",c);return c};
l.Gn=function(a,b,c){c&&!t(this)||v(this,a,b,c,this.K.type+".COLOR");this.K.Ze!==b&&(this.K.Ze=b,Lt(this,!1))};l.im=function(a,b){return Ut(this,this.K,b)};function Qt(a,b,c,d){var e;b.rc&&(e=b.ec);v(a,c,null,d,"CRTC.INDX",e);return e}function Rt(a,b,c,d){var e;b.rc&&b.ec<b.oh&&(e=b.Wa[b.ec]);d&&!t(a)||v(a,c,null,d,"CRTC."+b.gg[b.ec],e);return e}
function St(a,b,c,d,e){if(b.ec<b.oh){if(Vt||b.Wa[b.ec]!==d)e&&!t(a)||v(a,c,d,e,"CRTC."+b.gg[b.ec]),b.Wa[b.ec]=d;if(12==b.ec||13==b.ec)Ot(a,b)&1?(c=(b.Wa[12]<<8)+b.Wa[13]|0,b.vd!==c&&(b.vd=c,Lt(a))):b.Ye||(b.Ye=b.fi);(9==b.ec&&8!=b.Fg||b.ec==Nr&&223==d)&&Fs(a,!0);Gs(a)}}function Tt(a,b,c){var d=b.Xc;v(a,b.port+4,null,c,"MODE",d);return d}function Ut(a,b,c){var d=Ot(a,b);b===a.A?(d|=b.fa&48^48,b.Ke=!1):d=(b.fa^=9)|240;b.fa=d;v(a,b.port+6,null,c,b===a.A?"STATUS1":"STATUS",d);return d}
var Vt=!0,Jt=1,bt=2,ts=3,kt=5,jt=6,vs=7,ft=13,gt=14,$s=15,at=16,ht=17,it=18,ct=19,dt=20,et=21,Zs=255,Os=1,Ns=3,gs=Os,ds=Ns,Tp=5,Vp=7,Zr={mda:[gs,vs],cga:[ds,ts],ega:[Tp,ts],vga:[Vp,ts]},yr={2:{xg:15700,wg:208,Dg:85,Eg:96}};yr[Ll]={xg:18432,wg:364,Dg:85,Eg:96};yr[4]={xg:21850,wg:364,Dg:85,Eg:96};yr[7]={xg:16700,wg:480,Dg:85,Eg:83};var us={6:[1,Ll,!0],7:[2,Ll,!0],8:[6,Ll,!0],9:[4,Ll,!0],10:[Ll,1,!0],11:[Ll,2,!0],0:[1,Ll,!1],1:[2,Ll,!1],2:[6,Ll,!1],3:[4,Ll,!1],4:[Ll,1,!1],5:[Ll,2,!1]},$r=[];
$r[Jt]=[40,25,1,0,Ns];$r[ts]=[80,25,1,0,Ns];$r[4]=[320,200,8,192];$r[jt]=[640,200,16,192];$r[vs]=[80,25,1,0,Os];$r[ft]=[320,200,8];$r[gt]=[640,200,8];$r[$s]=[640,350,8];$r[at]=[640,350,8];$r[ht]=[640,480,8];$r[it]=[640,480,8];$r[ct]=[320,200,1];$r[dt]=[320,240,4];$r[et]=[320,400,4];$r[0]=$r[Jt];$r[bt]=$r[ts];$r[kt]=$r[4];
var Cs=0,As=7,Es=8,Bs=0,Ds=112,zs=128,Nt=256,Vs=512,Ps=[[0,0,0,255],[127,192,127,255],[127,192,127,255],[127,255,127,255],[127,255,127,255]],Qs=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],Is=[[0,0,0,255],[0,0,170,255],[0,170,0,255],[0,170,170,255],[170,0,0,255],[170,0,170,255],[170,85,0,255],[170,170,170,255],[85,85,85,255],[85,85,255,255],[85,255,85,255],[85,255,255,255],[255,85,85,255],[255,85,255,255],[255,255,85,255],[255,255,255,255]],Ks=[2,4,6],Js=[3,5,As],Ls=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],
Yr=[0,255,65280,65535,16711680,16711935,16776960,16777215,-16777216,-16776961,-16711936,-16711681,-65536,-65281,-256,-1],Pt=[0];Pt[128]=1;Pt[32768]=2;Pt[32896]=3;Pt[8388608]=4;Pt[8388736]=5;Pt[8421376]=6;Pt[8421504]=7;Pt[-2147483648]=8;Pt[-2147483520]=9;Pt[-2147450880]=10;Pt[-2147450752]=11;Pt[-2139095040]=12;Pt[-2139094912]=13;Pt[-2139062272]=14;Pt[-2139062144]=15;var cr=[];cr[gs]=["MDA",948,720896,4096,0,Ll];cr[ds]=["CGA",980,753664,16384,0,2];cr[Tp]=["EGA",980,753664,16384,65536,4];
cr[Vp]=["VGA",980,753664,16384,262144,7];
var as=0,ps=1,os=2,es={948:Q.prototype.Cm,949:Q.prototype.Bm,952:Q.prototype.Dm,954:Q.prototype.Em},fs={948:Q.prototype.co,949:Q.prototype.bo,952:Q.prototype.eo},hs={980:Q.prototype.gm,981:Q.prototype.fm,984:Q.prototype.hm,985:Q.prototype.em,986:Q.prototype.im},is={980:Q.prototype.Gn,981:Q.prototype.Fn,984:Q.prototype.Hn,985:Q.prototype.En},js={960:Q.prototype.am,961:Q.prototype.rl,962:Q.prototype.Om,964:Q.prototype.Mm,965:Q.prototype.Lm,974:Q.prototype.vm,975:Q.prototype.um},ks={954:Q.prototype.Mk,
960:Q.prototype.Lk,961:Q.prototype.Lk,962:Q.prototype.fo,964:Q.prototype.mo,965:Q.prototype.lo,970:Q.prototype.Yn,972:Q.prototype.Xn,974:Q.prototype.Wn,975:Q.prototype.Vn,986:Q.prototype.Mk},ls={963:Q.prototype.Pm,966:Q.prototype.nm,967:Q.prototype.om,969:Q.prototype.mm,970:Q.prototype.Qm,972:Q.prototype.Rm},ms={963:Q.prototype.oo,966:Q.prototype.Mn,967:Q.prototype.Nn,968:Q.prototype.On,969:Q.prototype.Ln};
var as=0,ps=1,os=2,es={948:Q.prototype.Cm,949:Q.prototype.Bm,952:Q.prototype.Dm,954:Q.prototype.Em},fs={948:Q.prototype.fo,949:Q.prototype.eo,952:Q.prototype.ho},hs={980:Q.prototype.gm,981:Q.prototype.fm,984:Q.prototype.hm,985:Q.prototype.em,986:Q.prototype.im},is={980:Q.prototype.In,981:Q.prototype.Hn,984:Q.prototype.Jn,985:Q.prototype.Gn},js={960:Q.prototype.am,961:Q.prototype.rl,962:Q.prototype.Om,964:Q.prototype.Mm,965:Q.prototype.Lm,974:Q.prototype.vm,975:Q.prototype.um},ks={954:Q.prototype.Mk,
960:Q.prototype.Lk,961:Q.prototype.Lk,962:Q.prototype.io,964:Q.prototype.oo,965:Q.prototype.no,970:Q.prototype.$n,972:Q.prototype.Zn,974:Q.prototype.Yn,975:Q.prototype.Xn,986:Q.prototype.Mk},ls={963:Q.prototype.Pm,966:Q.prototype.nm,967:Q.prototype.om,969:Q.prototype.mm,970:Q.prototype.Qm,972:Q.prototype.Rm},ms={963:Q.prototype.qo,966:Q.prototype.On,967:Q.prototype.Pn,968:Q.prototype.Qn,969:Q.prototype.Nn};
Ra(function(){for(var a=pb(document,"pcx86","video"),b=0;b<a.length;b++){var c=a[b],d=mb(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=Ea().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||Ka("aspect"));f&&.3<=f&&3.33>=f&&(Pa("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");Ja("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"),f.style.fontSize="16px");c.appendChild(f);var g=e.getContext("2d"),d=new Q(d,e,g,f,c);ob(d,c)}});
function Wt(a){ab.call(this,"ParallelPort",a,4194304);this.G=a.adapter;switch(this.G){case 1:this.D=956;this.C=7;break;case 2:this.D=888;this.C=7;break;case 3:this.D=632;this.C=5;break;default:Wa("Unrecognized parallel adapter #"+this.G);return}this.A=this.B=null;a=a.binding;"console"==a?this.B="":nb(this,a,Xt)}ba(Wt,ab);l=Wt.prototype;l.Cb=function(a,b,c){switch(b){case Xt:return this.na[b]=this.A=c,!0}return!1};
l.uc=function(a,b,c,d){this.ka=b;this.H=c;this.ba=d;this.W=Ob(a,"ChipSet");Ec(b,this,Yt,this.D);Ic(b,this,Zt,this.D);zb(this)};l.Xb=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Wb=function(a){return a?this.save():!0};l.reset=function(){$t(this)};l.save=function(){var a=new Of(this),b=0,c=[];c[b++]=this.F;c[b++]=this.Mb;c[b]=this.mf;a.set(0,c);return a.data()};l.restore=function(a){return $t(this,a[0])};
function $t(a,b){var c=0;b||(b=[0,0,0]);a.F=b[c++];a.Mb=b[c++];a.mf=b[c];return!0}l.pm=function(a,b){var c=this.F;v(this,a,null,b,"DATA",c);return c};l.Nm=function(a,b){var c=this.Mb;v(this,a,null,b,"STAT",c);return c};l.lm=function(a,b){var c=this.mf;v(this,a,null,b,"CTRL",c);return c};
l.Pn=function(a,b,c){v(this,a,b,c,"DATA");this.F=b;this.Mb|=au;a=!1;Cb(this,"transmitByte("+r(b)+")");this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.P(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.Mb&=~au);bu(this)};l.Kn=function(a,b,c){v(this,a,b,c,"CTRL");this.mf=b;bu(this)};
function bu(a){a.W&&a.C&&(a.mf&cu&&!(a.Mb&au)?Zg(a.W,a.C):Lg(a.W,a.C))}var Xt="buffer",au=64,cu=16,Yt={0:Wt.prototype.pm,1:Wt.prototype.Nm,2:Wt.prototype.lm},Zt={0:Wt.prototype.Pn,2:Wt.prototype.Kn};Ra(function(){for(var a=pb(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new Wt(d);ob(d,c)}});
l.Rn=function(a,b,c){v(this,a,b,c,"DATA");this.F=b;this.Mb|=au;a=!1;Cb(this,"transmitByte("+r(b)+")");this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.P(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.Mb&=~au);bu(this)};l.Mn=function(a,b,c){v(this,a,b,c,"CTRL");this.mf=b;bu(this)};
function bu(a){a.W&&a.C&&(a.mf&cu&&!(a.Mb&au)?Zg(a.W,a.C):Lg(a.W,a.C))}var Xt="buffer",au=64,cu=16,Yt={0:Wt.prototype.pm,1:Wt.prototype.Nm,2:Wt.prototype.lm},Zt={0:Wt.prototype.Rn,2:Wt.prototype.Mn};Ra(function(){for(var a=pb(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new Wt(d);ob(d,c)}});
function du(a){ab.call(this,"SerialPort",a,8388608);this.ha=a.adapter;switch(this.ha){case 1:this.da=1016;this.M=4;break;case 2:this.da=760;this.M=3;break;default:Wa("Unrecognized serial adapter #"+this.ha);return}this.F=this.I=null;this.oa=a.tabSize;this.ma=a.charBOL;this.K=0;this.qa=eu|fu;this.O=!0;a=a.binding;"console"==a?this.I="":nb(this,a,gu);this.D=this.aa=this.Y=null;this.exports={connect:this.zj,receiveData:this.Of,receiveStatus:this.ql}}ba(du,ab);l=du.prototype;
l.Vi=function(a,b,c){var d=null;a!=this.be||this.D||(this.D=b,this.Y=c,this.O=!1,d=this);return d};l.Cb=function(a,b,c){var d=this;switch(b){case gu:return this.na[b]=this.F=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<b&&(b-=64),d.Of(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Of(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.H=c;this.ba=d;this.W=Ob(a,"ChipSet");Ec(b,this,hu,this.da);Ic(b,this,iu,this.da);zb(this)};
@ -609,10 +609,10 @@ l.Xb=function(a,b){if(!b)if(this.zj(this.O),!a||!this.restore)this.reset();else
function ju(a,b){var c=0;b||(b=[0,0,ku,0,lu,0,0,mu|nu,a.qa,[]]);a.ga=b[c++];a.la=b[c++];a.L=b[c++];a.N=b[c++];a.G=b[c++];a.C=b[c++];a.Z=b[c++];a.B=b[c++];a.A=b[c++];a.J=b[c];return!0}l.Of=function(a){if("number"==typeof a)this.J.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.J.push(a.charCodeAt(b));else this.J=this.J.concat(a);ou(this);return!0};l.ql=function(a){var b=this.A;this.A&=~(eu|fu);a&32&&(this.A=this.A|eu|pu);a&64&&(this.A=this.A|fu|qu);b!=this.A&&ru(this)};
function ou(a){0<a.J.length&&!(a.B&su)&&(a.ga=a.J.shift(),a.B|=su);ru(a)}l.Km=function(a,b){var c=this.C&tu?this.L&255:this.ga;v(this,a,null,b,this.C&tu?"DLL":"RBR",c);this.B&=~su;ou(this);return c};l.wm=function(a,b){var c=this.C&tu?this.L>>8:this.N;v(this,a,null,b,this.C&tu?"DLM":"IER",c);return c};l.xm=function(a,b){var c=this.G;v(this,a,null,b,"IIR",c);return c};l.ym=function(a,b){var c=this.C;v(this,a,null,b,"LCR",c);return c};l.Am=function(a,b){var c=this.Z;v(this,a,null,b,"MCR",c);return c};
l.zm=function(a,b){var c=this.B;v(this,a,null,b,"LSR",c);return c};l.Fm=function(a,b){var c=this.A;this.A&=~(pu|qu);v(this,a,null,b,"MSR",c);return c};
l.no=function(a,b,c){v(this,a,b,c,this.C&tu?"DLL":"THR");if(this.C&tu)this.L=this.L&-256|b;else{this.la=b;this.B&=~(mu|nu);a=!1;Cb(this,"transmitByte("+r(b)+")");this.aa&&this.aa.call(this.D,b)&&(a=!0);if(this.F){if(13==b)this.K=0;else if(8==b)this.F.value=this.F.value.slice(0,-1),0<this.K&&this.K--;else{var d;13!=b&&10!=b&&(d=sa[b]);d=d?"<"+d+">":String.fromCharCode(b);a=d.length;32>b&&1==a&&(a=0);9==b&&(b=this.oa||8,a=b-this.K%b,this.oa&&(d=qa("",a)));this.ma&&!this.K&&a&&(d=String.fromCharCode(this.ma)+
d);this.F.value+=d;this.F.scrollTop=this.F.scrollHeight;this.K+=a}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.P(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|mu|nu)}};l.Zn=function(a,b,c){v(this,a,b,c,this.C&tu?"DLM":"IER");this.C&tu?this.L=this.L&255|b<<8:this.N=b};l.$n=function(a,b,c){v(this,a,b,c,"LCR");this.C=b};
l.ao=function(a,b,c){var d=b^this.Z;v(this,a,b,c,"MCR");this.Z=b;d&(uu|vu)&&this.Y&&(a=0,this.O?(a|=b&vu?32:0,a|=b&uu?320:0):(a|=b&vu?16:0,a|=b&uu?1048576:0),this.Y.call(this.D,a))};function ru(a){var b=-1;a.B&su&&a.N&wu?b=xu:a.A&(pu|qu)&&a.N&yu&&(b=zu);0<=b?(a.G&=~(lu|Au),a.G|=b,a.W&&a.M&&Zg(a.W,a.M,100)):(a.G|=lu,a.W&&a.M&&Lg(a.W,a.M))}
var gu="buffer",ku=384,wu=1,yu=8,lu=1,xu=4,zu=0,Au=6,tu=128,uu=1,vu=2,su=1,mu=32,nu=64,pu=1,qu=2,eu=16,fu=32,hu={0:du.prototype.Km,1:du.prototype.wm,2:du.prototype.xm,3:du.prototype.ym,4:du.prototype.Am,5:du.prototype.zm,6:du.prototype.Fm},iu={0:du.prototype.no,1:du.prototype.Zn,3:du.prototype.$n,4:du.prototype.ao};Ra(function(){for(var a=pb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new du(d);ob(d,c)}});
l.po=function(a,b,c){v(this,a,b,c,this.C&tu?"DLL":"THR");if(this.C&tu)this.L=this.L&-256|b;else{this.la=b;this.B&=~(mu|nu);a=!1;Cb(this,"transmitByte("+r(b)+")");this.aa&&this.aa.call(this.D,b)&&(a=!0);if(this.F){if(13==b)this.K=0;else if(8==b)this.F.value=this.F.value.slice(0,-1),0<this.K&&this.K--;else{var d;13!=b&&10!=b&&(d=sa[b]);d=d?"<"+d+">":String.fromCharCode(b);a=d.length;32>b&&1==a&&(a=0);9==b&&(b=this.oa||8,a=b-this.K%b,this.oa&&(d=qa("",a)));this.ma&&!this.K&&a&&(d=String.fromCharCode(this.ma)+
d);this.F.value+=d;this.F.scrollTop=this.F.scrollHeight;this.K+=a}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.P(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|mu|nu)}};l.ao=function(a,b,c){v(this,a,b,c,this.C&tu?"DLM":"IER");this.C&tu?this.L=this.L&255|b<<8:this.N=b};l.bo=function(a,b,c){v(this,a,b,c,"LCR");this.C=b};
l.co=function(a,b,c){var d=b^this.Z;v(this,a,b,c,"MCR");this.Z=b;d&(uu|vu)&&this.Y&&(a=0,this.O?(a|=b&vu?32:0,a|=b&uu?320:0):(a|=b&vu?16:0,a|=b&uu?1048576:0),this.Y.call(this.D,a))};function ru(a){var b=-1;a.B&su&&a.N&wu?b=xu:a.A&(pu|qu)&&a.N&yu&&(b=zu);0<=b?(a.G&=~(lu|Au),a.G|=b,a.W&&a.M&&Zg(a.W,a.M,100)):(a.G|=lu,a.W&&a.M&&Lg(a.W,a.M))}
var gu="buffer",ku=384,wu=1,yu=8,lu=1,xu=4,zu=0,Au=6,tu=128,uu=1,vu=2,su=1,mu=32,nu=64,pu=1,qu=2,eu=16,fu=32,hu={0:du.prototype.Km,1:du.prototype.wm,2:du.prototype.xm,3:du.prototype.ym,4:du.prototype.Am,5:du.prototype.zm,6:du.prototype.Fm},iu={0:du.prototype.po,1:du.prototype.ao,3:du.prototype.bo,4:du.prototype.co};Ra(function(){for(var a=pb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new du(d);ob(d,c)}});
function Bu(a){ab.call(this,"Mouse",a,16777216);if(this.O=a.serial)this.W="SerialPort";this.N=this.M=this.rc=!1;this.C=[];this.B=[];zb(this)}ba(Bu,ab);l=Bu.prototype;l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.H=c;this.ba=d;for(b=null;b=Ob(a,"Video",b);)this.C.push(b)};
l.Xb=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.W&&!this.D){for(a=null;(a=Ob(this.pa,this.W,a))&&(!a.Vi||!(this.D=a.Vi(this.O,this,this.pl))););if(this.D)for(this.B=[],a=0;a<this.C.length;a++)b=this.C[a],b.G=this,(b=b.D)&&this.B.push(b);else Wa(this.id+": "+this.W+" "+this.O+" unavailable")}this.rc?Cu(this):Du(this)}return!0};l.Wb=function(a){return a?this.save():!0};l.reset=function(){Eu(this)};
l.save=function(){var a=new Of(this),b=0,c=[];c[b++]=this.rc;c[b++]=this.F;c[b++]=this.G;c[b++]=this.I;c[b++]=this.J;c[b++]=this.K;c[b++]=this.L;c[b]=this.A;a.set(0,c);return a.data()};l.restore=function(a){return Eu(this,a[0])};function Eu(a,b){var c=0;b||(b=[!1,-1,-1,0,0,!1,!1,0]);var d=b[c++];a.rc=d;a.F=b[c++];a.G=b[c++];a.I=b[c++];a.J=b[c++];a.K=b[c++];a.L=b[c++];a.A=b[c];a.A&(uu|vu)&&(a.A=(a.A&uu?1048576:0)|(a.A&vu?16:0));return!0}l.If=function(a){this.M=a};
@ -630,11 +630,11 @@ b;ua++,e+=4)var ca=L[ua]=a.getInt32(e,!0),d=d+ca&-1;T.Lc=b;H[I]=T}g.L=d;b=g}else
function Su(a,b,c,d){var e=null;a.Re=!1;var f=!(!(0>d&&a.pa)||a.pa.ea.Yb);if(a.og)d?a.controller.Fa('Unable to connect to disk "'+a.I+'" (error '+d+": "+c+")",f):(a.D=!0,Tu(a),e=a);else if(d)a.controller.Fa('Unable to load disk "'+a.F+'" (error '+d+": "+b+")",f);else{eb(a.controller.xe,b,c);try{if(0<la(a.Jg,!0).toLowerCase().indexOf("-readonly"))a.Re=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.Re=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+
a.F]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+c+")");if(h.length)if(1==h.length)Wa(h[0]);else{a.ob=h.length;a.ib=h[0].length;a.Ya=h[0][0].length;var k=h[0][0][0];a.Na=k&&k.length||512;for(d=c=0;d<a.ob;d++)for(f=0;f<a.ib;f++)for(g=0;g<a.Ya;g++)if(k=h[d][f][g]){var m=k.length;void 0===m&&(m=k.length=512);var m=m>>2,p=k.pattern;void 0===p&&(p=k.pattern=0);var w=k.data;if(void 0===w){var u=k.bytes;if(void 0!==u&&u.length){for(var F=
m<<2,K=u.length;K<F;K++)u[K]=p;Uu(k,u,0)}else w=[],p=k.pattern=p|p<<8|p<<16|p<<24,k.data=w;delete k.bytes}Qu(k,d,f);for(F=0;F<w.length;F++)c=c+w[F]&-1}a.A=h;a.L=c;Tu(a);e=a}else Wa("Empty disk image: "+a.F)}catch(H){Wa("Disk image error ("+b+"): "+H.message)}}a.K&&(a.K.call(a.W,a.B,e,a.F,a.I),a.K=null)}
function Tu(a){var b,c,d={},e;if(a.C&&a.C.length)for(b=a.A,c=0;c<b.length;c++)for(var f=0;f<b[c].length;f++)for(e=0;e<b[c][f].length;e++){var g=b[c][f][e];g&&(delete g.file,delete g.pn)}a.C=[];d.Kf=d.sf=0;b=a.ob*a.ib*a.Ya*a.Na;a.D&&a.log("ignore any synchronous XMLHttpRequest warnings here (for now)");if(e=Vu(a,0)){d.Na=Wu(a,e,11,2);if(d.Na!=a.Na){f=!1;d.rf=1;d.vg=12;d.lh=d.rf+2;d.vf=1;d.Na=a.Na;if(163840==b&&254==Xu(a,d,0,0))d.sf=320,d.vh=64,f=!0;else if(327680==b&&255==Xu(a,d,0,0))d.sf=640,d.vh=
112,d.vf++,f=!0;else for(c=446,b=0;4>b;b++){if(128==Wu(a,e,c+0,1)){d.Kf=Wu(a,e,c+8,4);(e=Vu(a,d.Kf))&&(f=!0);break}c+=16}if(!f)return}d.sf||(d.sf=Wu(a,e,19,2)||Wu(a,e,32,4),d.rf=Wu(a,e,14,2),d.lh=d.rf+Wu(a,e,22,2)*Wu(a,e,16,1),d.vh=Wu(a,e,17,2),d.vf=Wu(a,e,13,1));d.jh=d.lh+((32*d.vh+(d.Na-1))/d.Na|0);d.hn=(d.sf-d.jh)/d.vf|0;d.vg=4084>=d.hn?12:16;d.Nl=12==d.vg?4086:65526;b=[];for(e=d.lh;e<d.jh;e++)b.push(d.Kf+e);Yu(a,d,a.Jg,"",b);for(b=0;b<a.C.length;b++){d=a.C[b];for(e=c=0;e<d.fe.length;e++){var f=
d.fe[e],g=c,h=a.ib*a.Ya,k=f%h,m=k/a.Ya|0,k=k%a.Ya,p=void 0,w=void 0,u=void 0;(p=a.A[f/h|0])&&(w=p[m])&&(u=w[k])&&!u.file&&(u.file=d,u.pn=g);c+=a.Na}e=d;if((na(e.$b,".EXE")||na(e.$b,".DLL")||na(e.$b,".DRV"))&&Zu(e,$u)==av&&Zu(e,bv)==cv&&(c=Zu(e,dv),Zu(e,ev,c)==fv)){m=Zu(e,gv,c);g=Zu(e,hv,c);h=Zu(e,iv,c);if(g&&m){d=e;f=g+c;g=m;h=h||0;m=1;d.nd=[];for(d.A=[];g--;){if(k=jv(d,f)<<h)p=jv(d,f+2)||65536,d.nd[m++]={gi:k,Ik:k+p-1,ee:[]};f+=8}d.nd[254]={gi:0,Ik:0,ee:[]}}g=Zu(e,kv,c);h=Zu(e,lv,c);if(g&&h)for(d=
function Tu(a){var b,c,d={},e;if(a.C&&a.C.length)for(b=a.A,c=0;c<b.length;c++)for(var f=0;f<b[c].length;f++)for(e=0;e<b[c][f].length;e++){var g=b[c][f][e];g&&(delete g.file,delete g.rn)}a.C=[];d.Kf=d.sf=0;b=a.ob*a.ib*a.Ya*a.Na;a.D&&a.log("ignore any synchronous XMLHttpRequest warnings here (for now)");if(e=Vu(a,0)){d.Na=Wu(a,e,11,2);if(d.Na!=a.Na){f=!1;d.rf=1;d.vg=12;d.lh=d.rf+2;d.vf=1;d.Na=a.Na;if(163840==b&&254==Xu(a,d,0,0))d.sf=320,d.vh=64,f=!0;else if(327680==b&&255==Xu(a,d,0,0))d.sf=640,d.vh=
112,d.vf++,f=!0;else for(c=446,b=0;4>b;b++){if(128==Wu(a,e,c+0,1)){d.Kf=Wu(a,e,c+8,4);(e=Vu(a,d.Kf))&&(f=!0);break}c+=16}if(!f)return}d.sf||(d.sf=Wu(a,e,19,2)||Wu(a,e,32,4),d.rf=Wu(a,e,14,2),d.lh=d.rf+Wu(a,e,22,2)*Wu(a,e,16,1),d.vh=Wu(a,e,17,2),d.vf=Wu(a,e,13,1));d.jh=d.lh+((32*d.vh+(d.Na-1))/d.Na|0);d.kn=(d.sf-d.jh)/d.vf|0;d.vg=4084>=d.kn?12:16;d.Nl=12==d.vg?4086:65526;b=[];for(e=d.lh;e<d.jh;e++)b.push(d.Kf+e);Yu(a,d,a.Jg,"",b);for(b=0;b<a.C.length;b++){d=a.C[b];for(e=c=0;e<d.fe.length;e++){var f=
d.fe[e],g=c,h=a.ib*a.Ya,k=f%h,m=k/a.Ya|0,k=k%a.Ya,p=void 0,w=void 0,u=void 0;(p=a.A[f/h|0])&&(w=p[m])&&(u=w[k])&&!u.file&&(u.file=d,u.rn=g);c+=a.Na}e=d;if((na(e.$b,".EXE")||na(e.$b,".DLL")||na(e.$b,".DRV"))&&Zu(e,$u)==av&&Zu(e,bv)==cv&&(c=Zu(e,dv),Zu(e,ev,c)==fv)){m=Zu(e,gv,c);g=Zu(e,hv,c);h=Zu(e,iv,c);if(g&&m){d=e;f=g+c;g=m;h=h||0;m=1;d.nd=[];for(d.A=[];g--;){if(k=jv(d,f)<<h)p=jv(d,f+2)||65536,d.nd[m++]={gi:k,Ik:k+p-1,ee:[]};f+=8}d.nd[254]={gi:0,Ik:0,ee:[]}}g=Zu(e,kv,c);h=Zu(e,lv,c);if(g&&h)for(d=
e,f=g+=c,g+=h,h=1;f<g;){k=jv(d,f);m=k&255;if(!m)break;k>>=8;f+=2;if(k)for(;m--;)jv(d,f,1),254>=k?(p=k,w=jv(d,f+1),f+=3):(p=jv(d,f+3,1),w=jv(d,f+4),f+=6),d.nd[p]&&(d.nd[p].ee[h]=[w]),d.A[h]=[p,w],h++;else h+=m}(g=Zu(e,mv,c))&&nv(e,g+c);g=Zu(e,ov,c);h=Zu(e,pv,c);g&&h&&nv(e,g,g+h)}}}}
function Yu(a,b,c,d,e){var f,g=a.C.length,h=b.Na/32|0;b.aq=d+"\\";for(var k=0;k<e.length;k++)for(var m=e[k],p=0;p<h;p++){var w=a,u=b;f=p;u.ae&&u.ii&&u.ii==m||(u.ii=m,u.ae=Vu(w,u.ii));if(u.ae){f*=32;var F=Wu(w,u.ae,f,1);if(F){if(229==F)u.$b=null;else{u.$b=ra(qv(w,u.ae,f+0,8));F=ra(qv(w,u.ae,f+8,3));F.length&&(u.$b+="."+F);u.Wg=Wu(w,u.ae,f+11,1);u.aj=Wu(w,u.ae,f+28,2);u.Ml=Wu(w,u.ae,f+26,2);f=u;var F=[],K=u.Ml;if(K){do{if(2>K)break;for(var H=u.jh+(K-2)*u.vf,I=0;I<u.vf;I++)F.push(u.Kf+H++);K=Xu(w,u,
function Yu(a,b,c,d,e){var f,g=a.C.length,h=b.Na/32|0;b.cq=d+"\\";for(var k=0;k<e.length;k++)for(var m=e[k],p=0;p<h;p++){var w=a,u=b;f=p;u.ae&&u.ii&&u.ii==m||(u.ii=m,u.ae=Vu(w,u.ii));if(u.ae){f*=32;var F=Wu(w,u.ae,f,1);if(F){if(229==F)u.$b=null;else{u.$b=ra(qv(w,u.ae,f+0,8));F=ra(qv(w,u.ae,f+8,3));F.length&&(u.$b+="."+F);u.Wg=Wu(w,u.ae,f+11,1);u.aj=Wu(w,u.ae,f+28,2);u.Ml=Wu(w,u.ae,f+26,2);f=u;var F=[],K=u.Ml;if(K){do{if(2>K)break;for(var H=u.jh+(K-2)*u.vf,I=0;I<u.vf;I++)F.push(u.Kf+H++);K=Xu(w,u,
K,0)|Xu(w,u,K,1)}while(K<=u.Nl)}f.fe=F}f=!0}else f=!1}else f=!1;if(!f){k=e.length;break}null!=b.$b&&"."!=b.$b&&".."!=b.$b&&(f=new rv(a,0,b.$b,b.Wg,b.aj,b.fe),a.C.push(f))}for(e=a.C.length;g<e;g++)f=a.C[g],f.Wg&16&&f.fe.length&&Yu(a,b,c,d+"\\"+f.$b,f.fe)}function Xu(a,b,c,d){var e=0,f=8*b.Na;c=b.vg*c+(d?8:0);var g=c/f|0;b.li&&b.kh&&b.kh==b.rf+g||(b.kh=b.rf+g,b.li=Vu(a,b.Kf+b.kh));b.li&&(c=c%f|0,e=Wu(a,b.li,c>>3,1),d?e=16==b.vg?e<<8:c&7?e<<4:(e&15)<<8:c&7&&(e>>=4));return e}
function Vu(a,b){var c=a.ib*a.Ya,d=b/c|0;return d<a.ob?(b%=c,a.seek(d,b/a.Ya|0,b%a.Ya+1)):null}function Wu(a,b,c,d){for(var e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function qv(a,b,c,d){for(var e="";d--;){var f=a.read(b,c++);if(0>=f)break;e+=String.fromCharCode(f)}return e}function Qu(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ol=b;a.Pl=c;a.hd=a.Lc=0;a.Oa=!1;return a}
function Ru(a,b){b="action=open&volume="+b+("&mode="+a.mode);b+="&chs="+a.ob+":"+a.ib+":"+a.Ya+":"+a.Na;b+="&machine="+Ou(a.controller);b+="&user="+Pu(a.controller);return Da()+"/api/v1/disk?"+b}
@ -670,16 +670,16 @@ function Bv(a,b,c,d){var e,f=a.na.listDrives;if(f&&!isNaN(e=ga(f.value,10))&&0<=
l.lj=function(a,b,c,d,e){var f;a.Le=!1;b&&(f=b.info(),b&&f[0]>a.ob||f[1]>a.ib)&&(this.Fa('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.Ua)),b=null);b?(a.sa=b,a.Zk=c,a.te=d,Nv(this,c,d,b),f=b.info(),this.I|=Rv,this.Fa('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.Ua),a.ke||e),a.ug=f[0],a.Af=f[1],a.Bf=f[2],this.pa&&this.pa.ld()):a.Ne=!1;a.ke&&(a.ke=!1,--this.K||zb(this));Av(this,a.Ua)};
function Fv(a,b,c,d){if((a=a.na.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Av(a,b){if(0<=b&&b<a.A.length){var c=a.A[b],d=a.na.listDisks;a=a.na.listDrives;if(d&&a&&d.options&&a.options&&(a=ga(a.value,10),c=c.Ne?"?":c.te,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Hv(a,b,c,d){var e=a.A[b];e.sa&&(Pv(a,e.te,e.sa),e.Zk="",e.te="",e.sa=null,e.Ne=!1,a.I|=Rv,d||a.Fa("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||Av(a,b))}
function Nv(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function Pv(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.Sn=function(a,b,c){v(this,a,b,c,"OUTPUT");b&Sv?this.J&Sv||this.J&Tv&&this.W&&Zg(this.W,6):Cv(this);this.J=b};l.rm=function(a,b){v(this,a,null,b,"DIAG",80);return 80};l.tm=function(a,b){v(this,a,null,b,"STATUS",this.fa);return this.fa};
function Nv(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function Pv(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.Un=function(a,b,c){v(this,a,b,c,"OUTPUT");b&Sv?this.J&Sv||this.J&Tv&&this.W&&Zg(this.W,6):Cv(this);this.J=b};l.rm=function(a,b){v(this,a,null,b,"DIAG",80);return 80};l.tm=function(a,b){v(this,a,null,b,"STATUS",this.fa);return this.fa};
l.qm=function(a,b){var c=0;this.D<this.C&&(c=this.F[this.D]);this.J&Tv&&this.W&&Lg(this.W,6);t(this)&&v(this,a,null,b,"DATA["+this.D+"]",c);++this.D>=this.C&&(this.fa&=~(Uv|Vv),this.D=this.C=0);return c};
l.Rn=function(a,b,c){t(this)&&v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]&Wv;if(void 0!==Xv[a]&&this.C>=Xv[a].Id){b=!1;this.D=0;a=Yv(this);var d,e,f,g,h=a&Wv;switch(h){case Zv:Yv(this);Yv(this);$v(this);break;case aw:c=Yv(this);this.Ua=c&3;d=this.A[this.Ua];$v(this);bw(this,(d.pb&cw)>>>24);break;case dw:case ew:c=Yv(this);b=c>>2&1;this.Ua=c&3;d=this.A[this.Ua];d.Xa=b;c=d.Gb=Yv(this);e=Yv(this);f=d.kb=Yv(this);g=Yv(this);d.ub=128<<g;d.Td=Yv(this);Yv(this);
l.Tn=function(a,b,c){t(this)&&v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]&Wv;if(void 0!==Xv[a]&&this.C>=Xv[a].Id){b=!1;this.D=0;a=Yv(this);var d,e,f,g,h=a&Wv;switch(h){case Zv:Yv(this);Yv(this);$v(this);break;case aw:c=Yv(this);this.Ua=c&3;d=this.A[this.Ua];$v(this);bw(this,(d.pb&cw)>>>24);break;case dw:case ew:c=Yv(this);b=c>>2&1;this.Ua=c&3;d=this.A[this.Ua];d.Xa=b;c=d.Gb=Yv(this);e=Yv(this);f=d.kb=Yv(this);g=Yv(this);d.ub=128<<g;d.Td=Yv(this);Yv(this);
Yv(this);h==ew?(h=d,h.pb=fw|gw,h.sa&&(h.cb=null,h.pb=Qv,this.W&&(An(this.W,2,this,"dmaRead",h),rn(this.W,2)))):(h=d,h.pb=fw|gw,h.sa&&(h.sa.Re?h.pb=hw|gw:(h.cb=null,h.pb=Qv,this.W&&(An(this.W,2,this,"dmaWrite",h),rn(this.W,2)))));iw(this,d,a,b,c,e,f,g);b=!0;break;case jw:c=Yv(this);this.Ua=c&3;d=this.A[this.Ua];d.Gb=d.Sd=0;d.pb=kw|lw;$v(this);b=!0;break;case mw:d=this.A[this.Ua];d.Xa=0;$v(this);bw(this,d.Ua|d.Xa<<2|d.pb&nw);bw(this,d.Gb);this.Ua=this.Ua+1&3;break;case ow:c=Yv(this);b=c>>2&1;this.Ua=
c&3;d=this.A[this.Ua];c=d.Gb;e=d.Xa=b;f=d.kb=1;g=0;d.pb=Qv;d.sa&&(d.cb=d.sa.seek(d.Gb,d.Xa,d.kb))?g=d.cb.length>>8:d.pb=fw|gw;iw(this,d,a,b,c,e,f,g);b=!0;break;case pw:c=Yv(this);b=c>>2&1;this.Ua=c&3;d=this.A[this.Ua];c=d.Gb;e=d.Xa=b;f=1;g=Yv(this);d.ub=128<<g;d.Td=Yv(this);Yv(this);d.Wi=Yv(this);h=d;h.pb=fw|gw;h.sa&&(h.cb=null,h.pb=Qv,this.W&&(h.Ge=0,h.$c=Array(4),h.Yg=!0,h.jg=0,An(this.W,2,this,"dmaFormat",h),rn(this.W,2),h.Yg=!1));iw(this,d,a,b,c,e,f,g);b=!0;break;case qw:c=Yv(this),this.Ua=c&
3,d=this.A[this.Ua],d.Xa=c>>2&1,c=Yv(this),d.Gb+=c-d.Sd,0>d.Gb&&(d.Gb=0),d.Gb>=d.ob&&(d.Gb=d.ob-1),d.Sd=c,d.pb=kw,d.Gb||(d.pb|=lw),$v(this),b=!0}0<this.C&&(this.fa=this.fa|Uv|Vv);this.J&Tv&&(!d||d.pb&fw||!b||this.W&&Zg(this.W,6))}};l.sm=function(a,b){var c=this.I;this.I&=~Rv;v(this,a,null,b,"INPUT",c);return c};l.Qn=function(a,b,c){v(this,a,b,c,"CONTROL");this.Zb=b};
3,d=this.A[this.Ua],d.Xa=c>>2&1,c=Yv(this),d.Gb+=c-d.Sd,0>d.Gb&&(d.Gb=0),d.Gb>=d.ob&&(d.Gb=d.ob-1),d.Sd=c,d.pb=kw,d.Gb||(d.pb|=lw),$v(this),b=!0}0<this.C&&(this.fa=this.fa|Uv|Vv);this.J&Tv&&(!d||d.pb&fw||!b||this.W&&Zg(this.W,6))}};l.sm=function(a,b){var c=this.I;this.I&=~Rv;v(this,a,null,b,"INPUT",c);return c};l.Sn=function(a,b,c){v(this,a,b,c,"CONTROL");this.Zb=b};
function iw(a,b,c,d,e,f,g,h){$v(a);bw(a,b.Ua|b.Xa<<2|b.pb&nw);bw(a,(b.pb&rw)>>>8);bw(a,(b.pb&sw)>>>16);var k=0;if(e!=b.Gb||f!=b.Xa)k=g=1;c&tw&&(f^=k,d||(k=0));bw(a,e+k);bw(a,f);bw(a,g);bw(a,h)}function Yv(a){var b=a.F[a.D];a.D++;return b}function $v(a){a.D=a.C=0}function bw(a,b){a.F[a.C++]=b}l.jl=function(a,b,c){void 0===b||0>b?this.se(a,c):c(-1,!1)};l.kl=function(a,b){return void 0!==b&&0<=b?uw(a,b):-1};
l.Cl=function(a,b){if(void 0!==b&&0<=b)a:if(a.pb)a=-1;else{a.$c[a.Ge++]=b;if(a.Ge==a.$c.length){a.Gb=a.$c[0];a.Xa=a.$c[1];a.kb=a.$c[2];a.ub=128<<a.$c[3];for(var c=a.Ge=0;c<a.ub;c++)if(0>uw(a,a.Wi)){a=-1;break a}a.jg++}a.jg>=a.Td&&(b=-1);a=b}else a=-1;return a};l.se=function(a,b){var c=-1,d=null,e=0;if(!a.pb&&a.sa){do{if(a.cb&&(e=a.Sa,0<=(c=a.sa.read(a.cb,a.Sa++)))){d=a.cb;break}a.cb=a.sa.seek(a.Gb,a.Xa,a.kb);if(!a.cb){a.pb=vw|gw;break}a.Sa=0;ww(a)}while(1)}b(c,!1,d,e)};
function uw(a,b){if(a.pb||!a.sa)return-1;do{if(a.cb&&a.sa.write(a.cb,a.Sa++,b))break;a.cb=a.sa.seek(a.Gb,a.Xa,a.kb);if(!a.cb){a.pb=xw|gw;b=-1;break}a.Sa=0;ww(a)}while(1);return b}function ww(a){a.kb++;a.kb>=a.Bf+1&&(a.kb=1,a.Xa++,a.Xa>=a.Af&&(a.Xa=0,a.Gb++))}var Lv="Floppy Drive",Sv=4,Tv=8,Vv=16,Uv=64,Jv=128,Zv=3,aw=4,dw=5,ew=6,jw=7,mw=8,ow=10,pw=13,qw=15,Wv=31,tw=128,Qv=0,fw=8,kw=32,gw=64,Kv=192,nw=255,hw=512,vw=1024,xw=8192,rw=65280,sw=16711680,lw=268435456,cw=-16777216,Rv=128,Ov=0;aa={};
var Xv={3:{Id:3,Ud:0,name:aa.Up},4:{Id:2,Ud:1,name:aa.Sp},5:{Id:9,Ud:7,name:aa.Yp},6:{Id:9,Ud:7,name:aa.Op},7:{Id:2,Ud:0,name:aa.Qp},8:{Id:1,Ud:2,name:aa.Tp},10:{Id:2,Ud:7,name:aa.Pp},13:{Id:6,Ud:7,name:aa.Lp},15:{Id:3,Ud:0,name:aa.Rp}},Dv={1009:zv.prototype.rm,1012:zv.prototype.tm,1013:zv.prototype.qm,1015:zv.prototype.sm},Ev={1010:zv.prototype.Sn,1013:zv.prototype.Rn,1015:zv.prototype.Qn};
var Xv={3:{Id:3,Ud:0,name:aa.Wp},4:{Id:2,Ud:1,name:aa.Up},5:{Id:9,Ud:7,name:aa.$p},6:{Id:9,Ud:7,name:aa.Qp},7:{Id:2,Ud:0,name:aa.Sp},8:{Id:1,Ud:2,name:aa.Vp},10:{Id:2,Ud:7,name:aa.Rp},13:{Id:6,Ud:7,name:aa.Np},15:{Id:3,Ud:0,name:aa.Tp}},Dv={1009:zv.prototype.rm,1012:zv.prototype.tm,1013:zv.prototype.qm,1015:zv.prototype.sm},Ev={1010:zv.prototype.Un,1013:zv.prototype.Tn,1015:zv.prototype.Sn};
Ra(function(){for(var a=pb(document,"pcx86","fdc"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new zv(d);ob(d,c)}});function yw(a){ab.call(this,"HDC",a,1048576);this.dmaRead=yw.prototype.ll;this.dmaWrite=yw.prototype.ml;this.dmaWriteBuffer=yw.prototype.Dl;this.dmaWriteFormat=yw.prototype.El;this.Z=[];this.la=a.drives;this.M="at"==a.type}ba(yw,ab);l=yw.prototype;
l.Cb=function(a,b,c){var d=this;switch(b){case "saveHD0":case "saveHD1":return this.na[b]=c,c.onclick=function(a){return function(){var b=d.A&&d.A[a];b&&b.sa?(b=b.sa,b=Ma(xv(b),"octet-stream",!0,b.Jg.replace(".json",".img")),Wa(b)):d.Fa("Hard drive "+a+" is not available.")}}(+b.slice(-1)),!0}return!1};
l.uc=function(a,b,c,d){this.ka=b;this.H=c;this.ba=d;this.pa=a;if(d=qd(a,"drives"))this.Z=d;else if(this.la)try{this.Z=eval("("+this.la+")")}catch(e){Wa("HDC drive configuration error: "+e.message+" ("+this.la+")")}this.W=Ob(a,"ChipSet");this.G=0;this.ma=3;Ec(b,this,this.M?zw:Aw);Ic(b,this,this.M?Bw:Cw);this.M&&(this.G++,this.W&&this.W.ca==ol&&this.G++,this.ma=2,b.Y[Dw]=2,b.Z[Dw]=2);Jf(c,19,this.Vm.bind(this));Jf(c,64,this.Wm.bind(this));this.reset();Ew(this)||zb(this)};
@ -693,12 +693,12 @@ null;e[g]=m}c[b]=e;return c}l.hj=function(a){var b;a=this.A[a];if(void 0!==a){b=
l.$k=function(a,b,c){if(a.sa){var d=a.sa.info(),e=d[0];if(e){var f=d[2],g=d[1]*f;if(b+c<=e*g)return a.Od=Math.floor(b/g),b%=g,a.Xa=Math.floor(b/f),a.kb=b%f,a.ub=c*d[3],a.errorCode=Jw,!0}}return!1};
function Ew(a,b){b||(a.K=0);for(var c=0;c<a.A.length;c++){var d=a.A[c];if(d.name&&d.path){if(!(b&&d.sa&&d.sa.og)){var e;e=a;var f=d.name,d=d.path,g=e.A[c];g.Le?(e.Fa("Drive "+c+" busy"),e=!0):(g.Le=!0,g.ke=!0,e.K++,t(e)&&Cb(e,"loading "+f),(g.sa||new Ku(e,g,g.mode)).load(f,d,null,e.Fl),e=!1);!e&&b&&zb(a,!1)}}else b&&void 0!==d.type&&(d.sa=null,Mw(a,d,d.type))}return!!a.K}
l.Fl=function(a,b,c){a.Le=!1;if(a.sa=b)this.Fa('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.Ua),a.ke),b=b.info(),b[0]==a.ob&&b[1]==a.ib&&b[2]==a.Ya&&b[3]==a.Na||this.Fa("Warning: disk geometry ("+b[0]+":"+b[1]+":"+b[2]+") does not match "+Nw[this.G]+" drive type "+a.type+" ("+a.ob+":"+a.ib+":"+a.Ya+")");a.ke&&(a.ke=!1,--this.K||zb(this))};
l.Tm=function(a,b){var c=0;this.D<this.C&&(c=this.F[this.D]);this.W&&Lg(this.W,5);this.fa&=~Ow;v(this,a,null,b,"DATA["+this.D+"]",c);++this.D>=this.C&&(this.D=this.C=0,this.fa&=~(Pw|Qw|Rw));return c};l.po=function(a,b,c){v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]!=Sw?6:this.F.length;6==this.C&&(this.fa&=~Tw);this.C>=a&&(this.fa|=Pw,this.fa&=~Tw,Uw(this))};l.Um=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.D<this.C&&(this.fa|=Tw);return c};
l.so=function(a,b,c){v(this,a,b,c,"RESET");this.ta=b;this.W&&Lg(this.W,5);Fw(this)};l.Sm=function(a,b){v(this,a,null,b,"CONFIG",this.O);return this.O};l.ro=function(a,b,c){v(this,a,b,c,"PULSE");this.qa=b;this.fa=Tw|Qw|Rw};l.qo=function(a,b,c){v(this,a,b,c,"PATTERN");this.oa=b};l.hi=function(a,b,c){v(this,a,b,c,"NOISE")};
l.Tm=function(a,b){var c=0;this.D<this.C&&(c=this.F[this.D]);this.W&&Lg(this.W,5);this.fa&=~Ow;v(this,a,null,b,"DATA["+this.D+"]",c);++this.D>=this.C&&(this.D=this.C=0,this.fa&=~(Pw|Qw|Rw));return c};l.ro=function(a,b,c){v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]!=Sw?6:this.F.length;6==this.C&&(this.fa&=~Tw);this.C>=a&&(this.fa|=Pw,this.fa&=~Tw,Uw(this))};l.Um=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.D<this.C&&(this.fa|=Tw);return c};
l.uo=function(a,b,c){v(this,a,b,c,"RESET");this.ta=b;this.W&&Lg(this.W,5);Fw(this)};l.Sm=function(a,b){v(this,a,null,b,"CONFIG",this.O);return this.O};l.to=function(a,b,c){v(this,a,b,c,"PULSE");this.qa=b;this.fa=Tw|Qw|Rw};l.so=function(a,b,c){v(this,a,b,c,"PATTERN");this.oa=b};l.hi=function(a,b,c){v(this,a,b,c,"NOISE")};
function Vw(a,b,c){var d=-1;a.B&&(d=a.se(a.B,function(){}),1==a.B.Sa||a.B.Sa==a.B.Na)&&(t(a,1048832)&&v(a,b,null,c,"DATA["+a.B.Sa+"]",d),1<a.B.Sa&&(a.B.ub-=a.B.Na,a.J=a.J-1&255,a.B.ub>=a.B.Na?(a.fa=Ww,a.se(a.B,function(b){0<=b?(Xw(a),a.W&&a.W.ca==ol&&(a.fa=0),a.fa=a.fa|Hw|Yw|Zw):(a.fa=$w,a.I=ax)},!1)):a.fa=Hw|Yw));return d}l.nl=function(a,b){return Vw(this,a,b)|Vw(this,a,b)<<8};
function bx(a,b,c,d){if(a.B&&a.B.ub>=a.B.Na)if(0>cx(a.B,c))a.fa=$w,a.I=ax;else if(1==a.B.Sa||a.B.Sa==a.B.Na)t(a,1048832)&&v(a,b,c,d,"DATA["+a.B.Sa+"]"),1<a.B.Sa&&(a.B.ub-=a.B.Na,a.J=a.J-1&255,Xw(a),a.fa=Hw|Yw,a.B.ub>=a.B.Na&&(a.fa|=Zw))}l.yn=function(a,b,c){bx(this,a,b&255,c);bx(this,a,b>>8&255,c)};l.$l=function(a,b){var c=this.I;v(this,a,null,b,"ERROR",c);return c};l.Dn=function(a,b,c){v(this,a,b,c,"WPREC");this.va=b};l.bm=function(a,b){var c=this.J;v(this,a,null,b,"SECCNT",c);return c};
l.Bn=function(a,b,c){v(this,a,b,c,"SECCNT");this.J=b};l.cm=function(a,b){var c=this.ga;v(this,a,null,b,"SECNUM",c);return c};l.Cn=function(a,b,c){v(this,a,b,c,"SECNUM");this.ga=b};l.Yl=function(a,b){var c=this.da;v(this,a,null,b,"CYLLO",c);return c};l.xn=function(a,b,c){v(this,a,b,c,"CYLLO");this.da=b};l.Xl=function(a,b){var c=this.aa;v(this,a,null,b,"CYLHI",c);return c};l.wn=function(a,b,c){v(this,a,b,c,"CYLHI");this.aa=b};l.Zl=function(a,b){var c=this.Y;v(this,a,null,b,"DRVHD",c);return c};
l.zn=function(a,b,c){v(this,a,b,c,"DRVHD");this.Y=b;this.fa=this.A[this.Y&dx?1:0]?this.fa|Hw|Yw:this.fa&~Hw};l.dm=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.fa&Hw&&(this.fa&=~Ww);return c};l.vn=function(a,b,c){v(this,a,b,c,"COMMAND");this.ha=b;this.W&&Lg(this.W,14);ex(this)};l.An=function(a,b,c){v(this,a,b,c,"FDR");this.L&fx&&!(b&fx)&&(this.I=gx);this.L=b};
function bx(a,b,c,d){if(a.B&&a.B.ub>=a.B.Na)if(0>cx(a.B,c))a.fa=$w,a.I=ax;else if(1==a.B.Sa||a.B.Sa==a.B.Na)t(a,1048832)&&v(a,b,c,d,"DATA["+a.B.Sa+"]"),1<a.B.Sa&&(a.B.ub-=a.B.Na,a.J=a.J-1&255,Xw(a),a.fa=Hw|Yw,a.B.ub>=a.B.Na&&(a.fa|=Zw))}l.An=function(a,b,c){bx(this,a,b&255,c);bx(this,a,b>>8&255,c)};l.$l=function(a,b){var c=this.I;v(this,a,null,b,"ERROR",c);return c};l.Fn=function(a,b,c){v(this,a,b,c,"WPREC");this.va=b};l.bm=function(a,b){var c=this.J;v(this,a,null,b,"SECCNT",c);return c};
l.Dn=function(a,b,c){v(this,a,b,c,"SECCNT");this.J=b};l.cm=function(a,b){var c=this.ga;v(this,a,null,b,"SECNUM",c);return c};l.En=function(a,b,c){v(this,a,b,c,"SECNUM");this.ga=b};l.Yl=function(a,b){var c=this.da;v(this,a,null,b,"CYLLO",c);return c};l.zn=function(a,b,c){v(this,a,b,c,"CYLLO");this.da=b};l.Xl=function(a,b){var c=this.aa;v(this,a,null,b,"CYLHI",c);return c};l.yn=function(a,b,c){v(this,a,b,c,"CYLHI");this.aa=b};l.Zl=function(a,b){var c=this.Y;v(this,a,null,b,"DRVHD",c);return c};
l.Bn=function(a,b,c){v(this,a,b,c,"DRVHD");this.Y=b;this.fa=this.A[this.Y&dx?1:0]?this.fa|Hw|Yw:this.fa&~Hw};l.dm=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.fa&Hw&&(this.fa&=~Ww);return c};l.xn=function(a,b,c){v(this,a,b,c,"COMMAND");this.ha=b;this.W&&Lg(this.W,14);ex(this)};l.Cn=function(a,b,c){v(this,a,b,c,"FDR");this.L&fx&&!(b&fx)&&(this.I=gx);this.L=b};
function ex(a){var b=!1,c=a.ha,d=a.Y&dx?1:0,e=a.Y&hx,f=a.da|(a.aa&ix)<<8,g=a.ga,h=a.J||256;a.Ua=-1;a.B=null;a.I=jx;a.fa=Hw|Yw;var k=a.A[d];k?(k.Od=f,k.Xa=e,k.kb=g,k.ub=h*k.Na,c=c>=kx?c:c&lx,k.cb=null,k.Sa=0,k.errorCode=0,a.Ua=d,a.B=k):c=-1;switch(c&lx){case mx:b=!0;break;case nx:a.fa=Ww;a.se(k,function(b){0<=b&&a.W?(Xw(a),a.fa=Hw|Yw|Zw):(a.fa=$w,a.I=ax)},!1);break;case ox:a.fa=Zw;break;case px:b=!0;break;case qx:b=!0;break;case kx:a.I=gx;b=!0;break;case rx:k.ib=e+1,k.Ya=h,b=!0}b&&Xw(a)}
function Xw(a){!a.W||a.L&sx||Zg(a.W,14,120)}
function Uw(a){a.D=0;var b=tx(a),c=tx(a),d=c&32,e=d>>5,f=c&31,g=tx(a),h=tx(a),k=g<<2&768|h,m=g&63,p=tx(a),w=tx(a),u=a.A[e];u&&(u.Od=k,u.Xa=f,u.kb=m,u.ub=p*u.Na);switch(b){case ux:vx(a,u?u.errorCode:wx);xx(a,c);xx(a,g);xx(a,h);xx(a,yx|d);b=-1;break;case Sw:for(c=0;0<=(b=tx(a));)u&&c<u.De.length&&(u.De[c++]=b);u&&Mw(a,u);b=yx;u||a.N!=e||(a.N=-1,b=zx);vx(a,b|d);b=-1;break;case Ax:case Bx:vx(a,yx|d),b=-1}if(0<=b)switch(void 0===u?b=-1:(u.errorCode=Jw,u.al=0),b){case Cx:vx(a,yx|d);break;case Dx:u.mf=w;
@ -710,15 +710,15 @@ l.se=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;
function cx(a,b){if(a.errorCode)return-1;do{if(a.cb&&a.sa.write(a.cb,a.Sa++,b))break;a.sa&&a.sa.seek(a.Od,a.Xa,a.kb+a.ig,!0,function(b){a.cb=b});if(!a.cb){a.errorCode=Lx;b=-1;break}a.Sa=0;Mx(a)}while(1);return b}function Mx(a){a.kb++;var b=1-a.ig;a.kb>=a.Ya+b&&(a.kb=b,a.Xa++,a.Xa>=a.ib&&(a.Xa=0,a.Od++))}l.Vm=function(){var a=this.H.L&255;!(this.H.D>>8)&&128<a&&(this.N=a-128);return!0};l.Wm=function(){var a;(a=this.H.D>>8||!this.W)||(a=!(this.W.hc[0].od&64));return a?!0:!1};
var Kw="Hard Drive",Nw=["XTC","ATC","COMPAQ"],Lw=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7],16:[612,4],17:[977,5],18:[977,7],19:[1024,7],20:[733,5],21:[733,7],22:[733,5],23:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[1023,8],5:[940,6],6:[697,5],7:[462,8],8:[925,5],9:[900,15],10:[980,5],11:[925,7],12:[925,9],13:[612,8],14:[980,4],16:[612,4],17:[980,5],18:[966,
6],19:[1023,8],20:[733,5],21:[733,7],22:[524,4,40],23:[924,8],24:[966,14],25:[966,16],26:[1023,14],27:[832,6,33],28:[1222,15,34],29:[1240,7,34],30:[615,4,25],31:[615,8,25],32:[905,9,25],33:[832,8,33],34:[966,7,34],35:[966,8,34],36:[966,9,34],37:[966,5,34],38:[612,16,63],39:[1023,11,33],40:[1023,15,34],41:[1630,15,52],42:[1023,16,63],43:[805,4,26],44:[805,2,26],45:[748,8,33],46:[748,6,33],47:[966,5,25]}],Dw=496,gx=1,jx=0,ax=16,ix=3,hx=15,dx=16,$w=1,Zw=8,Yw=16,Hw=64,Ww=128,mx=16,nx=32,ox=48,px=64,qx=
112,kx=144,rx=145,lx=240,sx=2,fx=4,yx=0,zx=2,Cx=0,Dx=1,ux=3,Ex=5,Fx=8,Hx=10,Sw=12,Jx=15,Ax=224,Bx=228,Jw=0,wx=4,Lx=20,Iw=0,Tw=1,Pw=2,Qw=4,Rw=8,Ow=32,Aw={800:yw.prototype.Tm,801:yw.prototype.Um,802:yw.prototype.Sm},zw={496:yw.prototype.nl,497:yw.prototype.$l,498:yw.prototype.bm,499:yw.prototype.cm,500:yw.prototype.Yl,501:yw.prototype.Xl,502:yw.prototype.Zl,503:yw.prototype.dm},Cw={800:yw.prototype.po,801:yw.prototype.so,802:yw.prototype.ro,803:yw.prototype.qo,807:yw.prototype.hi,811:yw.prototype.hi,
815:yw.prototype.hi},Bw={496:yw.prototype.yn,497:yw.prototype.Dn,498:yw.prototype.Bn,499:yw.prototype.Cn,500:yw.prototype.xn,501:yw.prototype.wn,502:yw.prototype.zn,503:yw.prototype.vn,1014:yw.prototype.An};Ra(function(){for(var a=pb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new yw(d);ob(d,c)}});function Nx(a){ab.call(this,"Debugger",a);this.ya=+a.base||16;this.W=this.ga=this.L=0;this.aa=!1;this.A=-1;this.C=[];this.da={}}ba(Nx,ab);Nx.prototype.gh=function(){return-1};
112,kx=144,rx=145,lx=240,sx=2,fx=4,yx=0,zx=2,Cx=0,Dx=1,ux=3,Ex=5,Fx=8,Hx=10,Sw=12,Jx=15,Ax=224,Bx=228,Jw=0,wx=4,Lx=20,Iw=0,Tw=1,Pw=2,Qw=4,Rw=8,Ow=32,Aw={800:yw.prototype.Tm,801:yw.prototype.Um,802:yw.prototype.Sm},zw={496:yw.prototype.nl,497:yw.prototype.$l,498:yw.prototype.bm,499:yw.prototype.cm,500:yw.prototype.Yl,501:yw.prototype.Xl,502:yw.prototype.Zl,503:yw.prototype.dm},Cw={800:yw.prototype.ro,801:yw.prototype.uo,802:yw.prototype.to,803:yw.prototype.so,807:yw.prototype.hi,811:yw.prototype.hi,
815:yw.prototype.hi},Bw={496:yw.prototype.An,497:yw.prototype.Fn,498:yw.prototype.Dn,499:yw.prototype.En,500:yw.prototype.zn,501:yw.prototype.yn,502:yw.prototype.Bn,503:yw.prototype.xn,1014:yw.prototype.Cn};Ra(function(){for(var a=pb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new yw(d);ob(d,c)}});function Nx(a){ab.call(this,"Debugger",a);this.ya=+a.base||16;this.W=this.ga=this.L=0;this.aa=!1;this.A=-1;this.C=[];this.da={}}ba(Nx,ab);Nx.prototype.gh=function(){return-1};
Nx.prototype.hh=function(){};Nx.prototype.Pk=function(a,b){return a.replace("["+b+"]","unimplemented")};Nx.prototype.Cg=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.aa?a="end":a=this.C[this.A+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(ra(a.substring(d,f))),d=f+1}}return b};
function Ox(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
function Px(a,b,c){var d;if(b){b=Qx(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var p=m[e++],w=p.length,p=ra(p);if(!p){f=!0;break}p=Rx(a,p,null,!1===c);if(void 0===p){f=!0;c=!1;break}h.push(p);if(e==m.length)break;var p=m[e++],u=p.length;k.length&&Sx[p]<Sx[k[k.length-1]]&&Ox(h,k,1);k.push(p);b=b.substr(w+u)}Ox(h,k)&&1==h.length||(f=!0);f?c&&a.P("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Tx(a,null,
d))}return d}function Qx(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=Px(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?Ux(a,e):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=a.Pk(b,c[1]);for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.W-a.ga}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
function Rx(a,b,c,d){var e;null!=b?(e=a.gh(b),0<=e?e=a.hh(e):(e=a.da[b],null==e&&(e=ga(b,a.ya))),null!=e||d||a.P("invalid "+(c?c:"value")+": "+b)):d||a.P("missing "+(c||"value"));return e}function Tx(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d=q(c,0,!0)+" "+c+". "+ja(c,0,!0)+" "+ia(c,4,!0),32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'"));a.P((null!=b?b+": ":"")+d);return e}function Vx(a,b){if(b)return Tx(a,b,a.da[b]);var c=0;for(b in a.da)Tx(a,b,a.da[b]),c++;return 0<c}
function Ux(a,b){switch(a.ya){case 8:a=ja(b,NaN);break;case 10:a=b.toString();break;default:a=q(b,NaN)}return a}var Sx={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Ux(a,b){var c;c=void 0===c?0:c;switch(a.ya){case 8:a=ja(b,3*c);break;case 10:a=b.toString();break;default:a=q(b,2*c)}return a}var Sx={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Wx(a){Nx.call(this,a);this.oa=4;this.ha=5;this.wa=1048575;this.K=Xx(this);this.Ga=Xx(this);this.Z=Xx(this);this.D=[];this.B=this.Y=this.M=[];Yx(this);this.ta=0;Zx(this);this.za={};$x(this,a.messages);this.Ca=a.commands;var b=this;window?void 0===window.pcx86&&(window.pcx86=function(a){return ay(b,a)}):void 0===global.pcx86&&(global.pcx86=function(a){return ay(b,a)})}ba(Wx,Nx);l=Wx.prototype;
l.uc=function(a,b,c,d){this.ka=b;this.H=c;this.pa=a;this.Za=Ob(a,"FDC");this.Ha=Ob(a,"HDC");this.Tc=Ob(a,"FPU");this.G=Ob(a,"Mouse");(a=qd(a,"messages"))&&$x(this,a);this.ha=b.I>>2;this.wa=b.N;this.Ta=new Kd(this.H,7,"DBG");this.ma=by;80186<=this.H.ca&&(this.ma=by.slice(),this.ma[15]=cy,80286<=this.H.ca&&(this.ma[15]=dy,80386<=this.H.ca&&(this.oa=8)));rl(this,64,function(a){ey(d,d.H.sc,a[0])});rl(this,4,function(a){if(a=a[0]){var b=Rx(d,a);if(void 0===b)d.P("invalid selector: "+a);else if(a=fy(d,
b,gy),d.P("dumpSel("+ka(a?a.U:b)+"): %"+q(a?a.Lb:null,d.ha)),a){var c,b=!1;if(a.type&4096)a.type&2048?(c="code"+(a.type&512?",readable":",execonly"),a.type&1024&&(c+=",conforming")):(c="data"+(a.type&512?",writable":",readonly"),a.type&1024&&(c+=",expdown")),a.type&256&&(c+=",accessed");else{var e=hy[a.type];e&&(c=e[0],b=e[1])}!c||a.jb&32768||(c+=",not present");d.P((b?"seg="+ka(a.ua&65535)+" off="+ka(a.Ka):"base="+q(a.ua,d.ha)+" limit="+iy(a.Ka))+" type="+r(a.type>>8)+" ("+c+") ext="+ka(a.ext&-65296)+
@ -774,8 +774,8 @@ function JA(a,b){switch(b){case "V":a=$f(a.H);break;case "D":a=a.H.O&1024;break;
function LA(a,b,c){return b.$b+"="+q(b.U,4)+(c?"["+q(b.ua,a.ha)+","+iy(b.Ka)+"]":"")}function MA(a,b,c,d,e){return b+"="+(null!=c?q(c,4):"")+"["+q(d,a.ha)+","+q(e-d,4)+"]"}
function NA(a,b){var c;void 0===b&&(b=wy(a));c=KA(a,Uy)+KA(a,Xy)+KA(a,Vy)+KA(a,Wy)+(4<a.oa?"\n":"")+KA(a,Yy)+KA(a,Zy)+KA(a,$y)+KA(a,az)+"\n"+LA(a,a.H.Y,b)+" "+LA(a,a.H.Ca,b)+" "+LA(a,a.H.oa,b)+" ";if(b){var d="TR="+q(a.H.la.U,4),e=a.ka,e="A20="+(e.J||e.N!=e.C?"OFF ":"ON ");80386>a.H.ca&&(d="\n"+d,c+=e,e="");c+="\n"+LA(a,a.H.Z,b)+" ";80386<=a.H.ca&&(e+="\n",c+=LA(a,a.H.Ga,b)+" "+LA(a,a.H.Ha,b)+"\n");c+=MA(a,"LD",a.H.Eb.U,a.H.Eb.ua,a.H.Eb.ua+a.H.Eb.Ka)+" "+MA(a,"GD",null,a.H.Kb,a.H.Pc)+" "+MA(a,"ID",
null,a.H.Pb,a.H.cd)+" ";c=c+(d+" "+e)+KA(a,rz);80386<=a.H.ca&&(c+=KA(a,tz)+KA(a,uz))}else 80386<=a.H.ca&&(c+=LA(a,a.H.Ga,b)+" "+LA(a,a.H.Ha,b)+" ");return c+=KA(a,wz)+JA(a,"V")+JA(a,"D")+JA(a,"I")+JA(a,"T")+JA(a,"S")+JA(a,"Z")+JA(a,"A")+JA(a,"P")+JA(a,"C")}l.gj=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function Sp(a,b,c,d,e,f,g,h){var k={},m=[],p;for(p in h){var w=h[p];"number"==typeof w&&(h[p]=w={o:w});var u=w.o,F=w.s,K=w.a;if(void 0!==u){void 0!==F&&(k.Ja=u,k.U=F,k.xa=null,a.Sb(k),(k.xa&-65536)==(a.ka.N&-65536)&&(k.xa&=1048575),w.p=k.xa);var F=m,u=[u>>>0,p],H=ta(F,u,a.gj);0>H&&F.splice(-(H+1),0,u)}K&&(w.a=K.replace(/''/g,'"'))}a.D.push({Rf:b,nn:c,U:d,Ja:e,xa:f,cn:g,Fd:h,Pi:m})}
function sy(a,b,c){for(var d=0;d<a.D.length;d++){var e=a.D[d];if(!b||e.Rf==b)if(b&&c==e.nn||!b&&c==e.U){a.D.splice(d,1);break}}}function sA(a,b,c){for(var d=[],e=b.Ja>>>0,f=a.Sb(b)>>>0,g=0;g<a.D.length;g++){var h=a.D[g],k=h.U,m=h.Ja>>>0,p=h.xa;null!=p&&(p>>>=0);var w=h.cn;48==k&&(k=40);if(k==b.U&&e>=m&&e<m+w||null!=p&&f>=p&&f<p+w){b=ta(h.Pi,[e],a.gj);0<=b?OA(a,g,b,d):c&&(b=~b,OA(a,g,b-1,d),OA(a,g,b,d));break}}!d.length&&(a=a.ka.wj(f,!0))&&(d.push(a),d.push(f));return d}
function Sp(a,b,c,d,e,f,g,h){var k={},m=[],p;for(p in h){var w=h[p];"number"==typeof w&&(h[p]=w={o:w});var u=w.o,F=w.s,K=w.a;if(void 0!==u){void 0!==F&&(k.Ja=u,k.U=F,k.xa=null,a.Sb(k),(k.xa&-65536)==(a.ka.N&-65536)&&(k.xa&=1048575),w.p=k.xa);var F=m,u=[u>>>0,p],H=ta(F,u,a.gj);0>H&&F.splice(-(H+1),0,u)}K&&(w.a=K.replace(/''/g,'"'))}a.D.push({Rf:b,pn:c,U:d,Ja:e,xa:f,en:g,Fd:h,Pi:m})}
function sy(a,b,c){for(var d=0;d<a.D.length;d++){var e=a.D[d];if(!b||e.Rf==b)if(b&&c==e.pn||!b&&c==e.U){a.D.splice(d,1);break}}}function sA(a,b,c){for(var d=[],e=b.Ja>>>0,f=a.Sb(b)>>>0,g=0;g<a.D.length;g++){var h=a.D[g],k=h.U,m=h.Ja>>>0,p=h.xa;null!=p&&(p>>>=0);var w=h.en;48==k&&(k=40);if(k==b.U&&e>=m&&e<m+w||null!=p&&f>=p&&f<p+w){b=ta(h.Pi,[e],a.gj);0<=b?OA(a,g,b,d):c&&(b=~b,OA(a,g,b-1,d),OA(a,g,b,d));break}}!d.length&&(a=a.ka.wj(f,!0))&&(d.push(a),d.push(f));return d}
function OA(a,b,c,d){var e={},f=a.D[b].Pi,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.D[b].Fd[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function PA(a){a.Ie&&(a.Ie.value="")}
function QA(a,b){if("?"==b)a.P("frequency commands:"),a.P("\tclear\tclear all frequency counts");else{var c=0;if(a.J)if("clear"==b){for(b=0;b<a.J.length;b++)a.J[b]=[b,0];a.P("frequency data cleared");c++}else if(void 0!==b)a.P("unknown frequency command: "+b),c++;else{var d=a.J.slice();d.sort(function(a,b){return b[1]-a[1]});for(b=0;b<d.length;b++){var e=d[b][0],f=d[b][1];f&&(a.P((Nz[a.ma[e][0]]+" ").substr(0,5)+" ("+r(e)+"): "+f+" times"),c++)}}c||a.P("no frequency data available")}}
function RA(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Vx(a)||a.P("no variables"),!0;if(!c[2])return Vx(a,c[1]);if(!c[3])return delete a.da[c[1]],!0;b=Px(a,c[3]);return void 0!==b?(a.da[c[1]]=b,!0):!1}a.P("invalid assignment:"+b);return!1}

View file

@ -44,9 +44,9 @@
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
*/
var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Nn:0,Pn:1,Qn:2,Zj:3,Rn:4,Sn:5,Tn:6,Un:7,Vn:8,Wn:9,Xn:10,Yn:11,Zn:12,$n:13,ao:14,bo:15,co:16,eo:17,fo:18,ho:19,io:20,jo:21,ko:22,lo:23,mo:24,no:25,oo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Pl:109,n:110,Vl:111,p:112,q:113,r:114,pn:115,t:116,sn:117,tn:118,un:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,po:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];
p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
function fa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ga(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
@ -93,35 +93,35 @@ l.Dc=function(a,b){this.X[(a&this.D)>>>this.B].nc(a&this.C,b&255,a)};function ac
function bc(a,b){var c=0,d=[],e=!a.G&&a.W==a.D;e||Gb(a,!0);for(var f=0;f<a.H;f++){var g=a.X[f];if(b&&g.type!=Vb||g.Da||g.mi){d[c++]=f;var h=c++;if(g=g.save()){for(var k=0,m=0,q=[];k<g.length;){for(var y=g[k],w=k+1;w<g.length&&g[w]===y;)w++;q[m++]=w-k;q[m++]=y;k=w}q.length<g.length&&(g=q)}d[h]=g}}e||Gb(a,!1);d[c]=e;return d}
function cc(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.I[k]?r("Input port "+ga(k,4,!0)+" already registered"):f.I[k]=[h,!1]}}function dc(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.I[b],h=a.M[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g&&g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k);e|=m<<f;f+=h<<3;b+=h;c-=h}return e}
function ec(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.J[k]?r("Output port "+ga(k,4,!0)+" already registered"):f.J[k]=[h,!1]}}function fc(a,b,c,d,e){for(var f=0;0<c;){var g=a.J[b],h=a.N[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g&&g[0])g[0](b,k,e);f+=h<<3;b+=h;c-=h}}function Ib(a,b,c,d,e){b="Memory block error ("+b+": "+ga(c)+","+ga(d)+")";e?a.Ea?a.Ea.message(b):a.log(b):r(b);return!1}
var tb,gc={Dj:20,count:8,Co:1,type:3},hc=0,ic;for(ic in gc){var jc=gc[ic];gc[ic]={qg:(1<<jc)-1<<hc,shift:hc};hc+=jc}tb=gc;var Jb=1,Nb=2,Qb=3,Sb=4,Ub=5,kc;if(gb){var lc=new ArrayBuffer(2);(new DataView(lc)).setUint16(0,256,!0);kc=256===(new Uint16Array(lc))[0]}else kc=!1;var Wb=kc;
var tb,gc={Dj:20,count:8,Eo:1,type:3},hc=0,ic;for(ic in gc){var jc=gc[ic];gc[ic]={qg:(1<<jc)-1<<hc,shift:hc};hc+=jc}tb=gc;var Jb=1,Nb=2,Qb=3,Sb=4,Ub=5,kc;if(gb){var lc=new ArrayBuffer(2);(new DataView(lc)).setUint16(0,256,!0);kc=256===(new Uint16Array(lc))[0]}else kc=!1;var Wb=kc;
function u(a,b,c,d,e,f){this.id=mc+=2;this.T=null;this.G=0;this.de=a;this.we=b;this.size=c||0;this.type=d||nc;this.H=d==Vb;this.controller=null;this.F=f;Fb(this);this.Da=this.mi=!1;if(c)if(e)this.controller=e,a=e.si(a),this.T=a[0],this.G=a[1],Rb(this,e.pg());else if(gb)this.L=new ArrayBuffer(c),this.K=new DataView(this.L,0,c),this.Fa=new Uint8Array(this.L,0,c),this.qd=new Uint16Array(this.L,0,c>>1),this.T=new Int32Array(this.L,0,c>>2),Rb(this,Wb?Xb:Yb);else{this.T=Array(c>>2);for(e=0;e<this.T.length;e++)this.T[e]=
0;Rb(this,Zb)}else Rb(this)}l=u.prototype;l.Gl=function(a){this.de=a};l.save=function(){var a,b;if(this.controller)a=null;else if(gb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.K.getInt32(b<<2,!0);else a=this.T;return a};l.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(gb)for(b=0;b<a.length;b++)this.K.setInt32(b<<2,a[b],!0);else this.T=a;return this.Da=!0}return!1};function Rb(a,b,c){b||(b=a.type==pc?qc:a.type==rc?sc:tc);uc(a,b,c);vc(a,b,c)}
function uc(a,b,c){c&&a.ee||(a.mc=b[0]||a.Lj,a.af=b[2]||a.Mj,a.Md=b[4]||a.Jj);if(c||void 0===c)a.zd=b[0]||a.Lj,a.bf=b[2]||a.Mj,a.mh=b[4]||a.Jj}function vc(a,b,c){c&&a.fe||(a.nc=!a.H&&b[1]||a.sh,a.jf=!a.H&&b[3]||a.th,a.hf=!a.H&&b[5]||a.rh);if(c||void 0===c)a.gf=b[1]||a.sh,a.uh=b[3]||a.th,a.U=b[5]||a.rh}function Fb(a,b,c){a.Ea=b;a.ee=a.fe=0;c&&(c.F&&(a.F=c.F),(a.ee=c.ee)&&uc(a,wc,!1),(a.fe=c.fe)&&vc(a,wc,!1))}l.Lj=function(){return 255};l.sh=function(){};
l.Mj=function(a,b){return this.mc(a++,b++)|this.mc(a,b)<<8};l.Jj=function(a,b){return this.mc(a++,b++)|this.mc(a++,b++)<<8|this.mc(a++,b++)<<16|this.mc(a,b)<<24};l.th=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a,b>>8,c)};l.rh=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a++,b>>8&255,c++);this.nc(a++,b>>16&255,c++);this.nc(a,b>>>24,c)};l.Xm=function(a){return this.T[a>>2]>>>((a&3)<<3)&255};
l.jn=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b]>>a;return 24>a?c&65535:c&255|(this.T[b+1]&255)<<8};l.cn=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b];a&&(c=c>>>a|this.T[b+1]<<32-a);return c};l.vn=function(a,b){var c=a>>2;a=(a&3)<<3;this.T[c]=this.T[c]&~(255<<a)|b<<a;this.Da=!0};l.Hn=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.T[c]=this.T[c]&~(65535<<a)|b<<a:(this.T[c]=this.T[c]&16777215|b<<24,c++,this.T[c]=this.T[c]&-256|b>>8);this.Da=!0};
l.Bn=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.T[c]=this.T[c]&~d|b<<a;c++;this.T[c]=this.T[c]&d|b>>>32-a}else this.T[c]=b;this.Da=!0};l.Wm=function(a,b){this.F&&xc(this.F,b,1,!1);return this.zd(a,b)};l.hn=function(a,b){this.F&&xc(this.F,b,2,!1);return this.bf(a,b)};l.bn=function(a,b){this.F&&xc(this.F,b,4,!1);return this.mh(a,b)};l.un=function(a,b,c){this.F&&xc(this.F,c,1,!0);this.H||this.gf(a,b,c)};l.Gn=function(a,b,c){this.F&&xc(this.F,c,2,!0);this.H||this.uh(a,b,c)};
l.An=function(a,b,c){this.F&&xc(this.F,c,4,!0);this.H||this.U(a,b,c)};l.Zm=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.mc(a,b)};l.ln=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.af(a,b)};l.en=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.Md(a,b)};l.xn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.nc(a,b,c)};
l.Jn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.jf(a,b,c)};l.Dn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.hf(a,b,c)};l.$m=function(a,b){return yc(this.F,b,!1).mc(a,b)};l.mn=function(a,b){return yc(this.F,b,!1).af(a,b)};l.fn=function(a,b){return yc(this.F,b,!1).Md(a,b)};l.yn=function(a,b,c){yc(this.F,c,!0).nc(a,b,c)};l.Kn=function(a,b,c){yc(this.F,c,!0).jf(a,b,c)};l.En=function(a,b,c){yc(this.F,c,!0).hf(a,b,c)};l.Vm=function(a){return this.Fa[a]};
l.Ij=function(a){return this.Fa[a]};l.Ym=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.mc=this.Ij;return this.Fa[a]};l.gn=function(a){return this.K.getUint16(a,!0)};l.Nj=function(a){return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.kn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.af=this.Nj;return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.an=function(a){return this.K.getInt32(a,!0)};
l.Kj=function(a){return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.dn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.Md=this.Kj;return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.tn=function(a,b){this.Fa[a]=b;this.Da=!0};l.Wj=function(a,b){this.Fa[a]=b;this.Da=!0};l.wn=function(a,b){this.Fa[a]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.nc=this.Wj;this.J.Da=!0};
l.Fn=function(a,b){this.K.setUint16(a,b,!0);this.Da=!0};l.Yj=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.Da=!0};l.In=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.jf=this.Yj;this.J.Da=!0};l.zn=function(a,b){this.K.setInt32(a,b,!0);this.Da=!0};l.Xj=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.Da=!0};
l.Cn=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.hf=this.Xj;this.J.Da=!0};function zc(a){gb&&!Wb&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var nc=0,Vb=2,pc=5,rc=6,Ac=["black","blue","green","cyan"],Mb="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),mc=0,tc=[],Zb=[u.prototype.Xm,u.prototype.vn,u.prototype.jn,u.prototype.Hn,u.prototype.cn,u.prototype.Bn],wc=[u.prototype.Wm,u.prototype.un,u.prototype.hn,u.prototype.Gn,u.prototype.bn,u.prototype.An],sc=[u.prototype.Zm,u.prototype.xn,u.prototype.ln,u.prototype.Jn,u.prototype.en,u.prototype.Dn],qc=[u.prototype.$m,u.prototype.yn,u.prototype.mn,u.prototype.Kn,u.prototype.fn,u.prototype.En];
if(gb)var Yb=[u.prototype.Vm,u.prototype.tn,u.prototype.gn,u.prototype.Fn,u.prototype.an,u.prototype.zn],Xb=[u.prototype.Ij,u.prototype.Wj,u.prototype.Nj,u.prototype.Yj,u.prototype.Kj,u.prototype.Xj],Bc=[u.prototype.Ym,u.prototype.wn,u.prototype.kn,u.prototype.In,u.prototype.dn,u.prototype.Cn];
l.Mj=function(a,b){return this.mc(a++,b++)|this.mc(a,b)<<8};l.Jj=function(a,b){return this.mc(a++,b++)|this.mc(a++,b++)<<8|this.mc(a++,b++)<<16|this.mc(a,b)<<24};l.th=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a,b>>8,c)};l.rh=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a++,b>>8&255,c++);this.nc(a++,b>>16&255,c++);this.nc(a,b>>>24,c)};l.Zm=function(a){return this.T[a>>2]>>>((a&3)<<3)&255};
l.ln=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b]>>a;return 24>a?c&65535:c&255|(this.T[b+1]&255)<<8};l.en=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b];a&&(c=c>>>a|this.T[b+1]<<32-a);return c};l.xn=function(a,b){var c=a>>2;a=(a&3)<<3;this.T[c]=this.T[c]&~(255<<a)|b<<a;this.Da=!0};l.Jn=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.T[c]=this.T[c]&~(65535<<a)|b<<a:(this.T[c]=this.T[c]&16777215|b<<24,c++,this.T[c]=this.T[c]&-256|b>>8);this.Da=!0};
l.Dn=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.T[c]=this.T[c]&~d|b<<a;c++;this.T[c]=this.T[c]&d|b>>>32-a}else this.T[c]=b;this.Da=!0};l.Ym=function(a,b){this.F&&xc(this.F,b,1,!1);return this.zd(a,b)};l.kn=function(a,b){this.F&&xc(this.F,b,2,!1);return this.bf(a,b)};l.dn=function(a,b){this.F&&xc(this.F,b,4,!1);return this.mh(a,b)};l.wn=function(a,b,c){this.F&&xc(this.F,c,1,!0);this.H||this.gf(a,b,c)};l.In=function(a,b,c){this.F&&xc(this.F,c,2,!0);this.H||this.uh(a,b,c)};
l.Cn=function(a,b,c){this.F&&xc(this.F,c,4,!0);this.H||this.U(a,b,c)};l.an=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.mc(a,b)};l.nn=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.af(a,b)};l.gn=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.Md(a,b)};l.zn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.nc(a,b,c)};
l.Ln=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.jf(a,b,c)};l.Fn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.hf(a,b,c)};l.bn=function(a,b){return yc(this.F,b,!1).mc(a,b)};l.on=function(a,b){return yc(this.F,b,!1).af(a,b)};l.hn=function(a,b){return yc(this.F,b,!1).Md(a,b)};l.An=function(a,b,c){yc(this.F,c,!0).nc(a,b,c)};l.Mn=function(a,b,c){yc(this.F,c,!0).jf(a,b,c)};l.Gn=function(a,b,c){yc(this.F,c,!0).hf(a,b,c)};l.Xm=function(a){return this.Fa[a]};
l.Ij=function(a){return this.Fa[a]};l.$m=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.mc=this.Ij;return this.Fa[a]};l.jn=function(a){return this.K.getUint16(a,!0)};l.Nj=function(a){return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.mn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.af=this.Nj;return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.cn=function(a){return this.K.getInt32(a,!0)};
l.Kj=function(a){return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.fn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.Md=this.Kj;return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.vn=function(a,b){this.Fa[a]=b;this.Da=!0};l.Wj=function(a,b){this.Fa[a]=b;this.Da=!0};l.yn=function(a,b){this.Fa[a]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.nc=this.Wj;this.J.Da=!0};
l.Hn=function(a,b){this.K.setUint16(a,b,!0);this.Da=!0};l.Yj=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.Da=!0};l.Kn=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.jf=this.Yj;this.J.Da=!0};l.Bn=function(a,b){this.K.setInt32(a,b,!0);this.Da=!0};l.Xj=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.Da=!0};
l.En=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.hf=this.Xj;this.J.Da=!0};function zc(a){gb&&!Wb&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var nc=0,Vb=2,pc=5,rc=6,Ac=["black","blue","green","cyan"],Mb="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),mc=0,tc=[],Zb=[u.prototype.Zm,u.prototype.xn,u.prototype.ln,u.prototype.Jn,u.prototype.en,u.prototype.Dn],wc=[u.prototype.Ym,u.prototype.wn,u.prototype.kn,u.prototype.In,u.prototype.dn,u.prototype.Cn],sc=[u.prototype.an,u.prototype.zn,u.prototype.nn,u.prototype.Ln,u.prototype.gn,u.prototype.Fn],qc=[u.prototype.bn,u.prototype.An,u.prototype.on,u.prototype.Mn,u.prototype.hn,u.prototype.Gn];
if(gb)var Yb=[u.prototype.Xm,u.prototype.vn,u.prototype.jn,u.prototype.Hn,u.prototype.cn,u.prototype.Bn],Xb=[u.prototype.Ij,u.prototype.Wj,u.prototype.Nj,u.prototype.Yj,u.prototype.Kj,u.prototype.Xj],Bc=[u.prototype.$m,u.prototype.yn,u.prototype.mn,u.prototype.Kn,u.prototype.fn,u.prototype.En];
function Cc(a,b){t.call(this,"CPU",a);b=a.cycles||b;var c=a.multiplier||1;this.R={};this.R.Wc=b;this.R.xd=c;this.R.Hf=Math.round(this.R.Wc/1E4)/100;this.R.qe=this.R.Hf*this.R.xd;this.ca.Ib=!1;this.ca.Tj=!1;this.ca.Ee=a.autoStart;this.ca.ii=!1;this.ca.Af=!1;this.R.Jf=this.R.re=0;this.R.Kf=a.csStart;this.R.Je=a.csInterval;this.R.Ke=a.csStop;this.Kl=this.$f.bind(this);eb(this)}ba(Cc,t);l=Cc.prototype;
l.hc=function(a,b,c,d){this.oa=a;this.ma=b;this.Ea=d;for(b=0;b<Dc.length;b++)(c=this.ia[Dc[b]])&&this.oa.wb(null,Dc[b],c);this.Ud=nb(a,"FPU");this.V=nb(a,"ChipSet");a=Ec(a,"autoStart");null!=a&&(this.ca.Ee="true"==a?!0:"false"==a?!1:!!a);eb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.Ob=function(a,b){if(!b){if(a&&this.restore){Fc(this);if(!this.restore(a))return!1;Gc(this)}else this.reset();this.lc("No debugger detected")}Hc(this);return!0};
l.Nb=function(a){return a?this.save():!0};l.Ee=function(){return this.ca.Ee||void 0===this.ia.run?(this.$f(),!0):!1};l.ri=function(){return 0};function Gc(a){void 0===a.R.Kf&&(a.R.Kf=0);void 0===a.R.Je&&(a.R.Je=-1);void 0===a.R.Ke&&(a.R.Ke=-1);a.ca.Af=0<=a.R.Kf&&0<a.R.Je;a.ca.Af&&(a.R.Jf=0,a.R.re=a.R.Kf-a.ld)}
l.wb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.ia[b]=c;a=!0;break;case "run":this.ia[b]=c;c.onclick=function(){var a;if(a=d.oa)if(a=d.oa,a.ca.Pb)a=!0;else{var b=null,c,h=Qa(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.ca.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.ca.Pb);c++);c==h.length&&(b=a);r("The "+b.type+" component ("+b.id+") is not "+(b.ca.ready?"powered yet":"ready yet"+(b.Ff?" (waiting for notification)":""))+".");a=!1}a&&(d.ca.Ib?Ic(d,!0):
d.$f(!0))};a=!0;break;case "speed":this.ia[b]=c;a=!0;break;case "setSpeed":this.ia[b]=c,c.onclick=function(){Jc(d,d.R.xd<<1,!0)},c.textContent=this.R.qe.toFixed(2)+"Mhz",a=!0}return a};function Kc(a,b){a.ca.Ib&&(b=a.A-b,a.A-=b,a.Hc-=b)}function Lc(a,b,c){a.ld+=b;c&&(a.Hc=a.A=0)}
function Mc(a,b){var c=Nc;c<Oc&&(c=Oc);c<Pc&&(c=Pc);var d=1;b&&1<a.R.xd&&a.R.vd&&(d=a.R.vd/a.R.Hf);a.R.Ai=Math.round(1E3/Nc);a.R.Rl=Math.floor(a.R.Wc/c*d);a.R.xg=Math.floor(a.R.Wc/Nc*d);a.R.Ci=Math.floor(a.R.Wc/Oc*d);a.R.Bi=Math.floor(a.R.Wc/Pc*d);b||(a.R.Ne=a.R.xg,a.R.Me=a.R.Ci,a.R.Le=a.R.Bi);a.R.yg=0}function Qc(a,b){var c=a.ld+a.Rc+a.Hc-a.A;b&&1<a.R.xd&&a.R.vd>a.R.Hf&&(c=Math.round(c/a.R.xd));return c}function Fc(a){a.R.vd=0;a.ld=a.Rc=a.Hc=a.A=0;Gc(a);Jc(a,1)}
function Mc(a,b){var c=Nc;c<Oc&&(c=Oc);c<Pc&&(c=Pc);var d=1;b&&1<a.R.xd&&a.R.vd&&(d=a.R.vd/a.R.Hf);a.R.Ai=Math.round(1E3/Nc);a.R.Tl=Math.floor(a.R.Wc/c*d);a.R.xg=Math.floor(a.R.Wc/Nc*d);a.R.Ci=Math.floor(a.R.Wc/Oc*d);a.R.Bi=Math.floor(a.R.Wc/Pc*d);b||(a.R.Ne=a.R.xg,a.R.Me=a.R.Ci,a.R.Le=a.R.Bi);a.R.yg=0}function Qc(a,b){var c=a.ld+a.Rc+a.Hc-a.A;b&&1<a.R.xd&&a.R.vd>a.R.Hf&&(c=Math.round(c/a.R.xd));return c}function Fc(a){a.R.vd=0;a.ld=a.Rc=a.Hc=a.A=0;Gc(a);Jc(a,1)}
function Jc(a,b,c){if(void 0!==b){.8>a.R.vd/a.R.qe&&(b=1);a.R.xd=b;b=a.R.Hf*a.R.xd;if(a.R.qe!=b){a.R.qe=b;b=a.R.qe.toFixed(2)+"Mhz";var d=a.ia.setSpeed;d&&(d.textContent=b);a.lc("target speed: "+b)}c&&a.oa&&Rc(a.oa)}Lc(a,a.Rc);a.Rc=0;a.R.wd=sa();a.R.Jd=0;Mc(a)}
l.$f=function(a){if(fb(this,!0)){if(!this.ca.Ib){Jc(this);this.oa&&this.oa.start(this.R.wd,Qc(this));this.ca.Ib=!0;this.ca.Tj=!0;this.V&&this.V.start();var b=this.ia.run;b&&(b.textContent="Halt");this.oa&&(Sc(this.oa,!0),a&&Rc(this.oa,!0))}this.R.yg>=this.R.Wc&&Mc(this,!0);this.R.Oe=0;this.R.If=sa();this.R.Jd&&(a=this.R.If-this.R.Jd,a>this.R.Ai&&(this.R.wd+=a,this.R.wd>this.R.If&&(this.R.wd=this.R.If)));try{do{var c=this.ca.Af?1:this.R.Rl;if(this.V){Tc(this.V);var d=this.V;a=c;var e=d.H[0];if(e.Gd){var f=
l.$f=function(a){if(fb(this,!0)){if(!this.ca.Ib){Jc(this);this.oa&&this.oa.start(this.R.wd,Qc(this));this.ca.Ib=!0;this.ca.Tj=!0;this.V&&this.V.start();var b=this.ia.run;b&&(b.textContent="Halt");this.oa&&(Sc(this.oa,!0),a&&Rc(this.oa,!0))}this.R.yg>=this.R.Wc&&Mc(this,!0);this.R.Oe=0;this.R.If=sa();this.R.Jd&&(a=this.R.If-this.R.Jd,a>this.R.Ai&&(this.R.wd+=a,this.R.wd>this.R.If&&(this.R.wd=this.R.If)));try{do{var c=this.ca.Af?1:this.R.Tl;if(this.V){Tc(this.V);var d=this.V;a=c;var e=d.H[0];if(e.Gd){var f=
(Qc(d.U,d.V)-e.fd)/d.za|0,g=Uc(d,0)-f;e.mode==Vc&&(g-=f);var h=g*d.za|0;e.mode==Vc&&(h>>=1);a>h&&(a=h)}var c=a,k=this.V;a=c;if(k.A&&k.A[Wc]&Xc){var m=k.X-Qc(k.U,k.V);0<m&&a>m&&(a=m)}c=a}try{this.yh(c)}catch(y){if("number"!=typeof y)throw y;}var q=this.Hc-this.A;this.Rc+=q;this.R.Oe+=q;Lc(this,0,!0);a=q;this.ca.Af&&(b=!1,this.R.Jf=this.R.Jf+this.ri()|0,this.R.re-=a,0>=this.R.re&&(this.R.re+=this.R.Je,b=!0),0<=this.R.Ke&&this.R.Ke<=Qc(this)&&(this.R.Je=this.R.Ke=-1,Gc(this),Ic(this),b=!0),b&&this.lc(Qc(this)+
" cycles: checksum="+ga(this.R.Jf)));this.R.Me-=q;0>=this.R.Me&&(this.R.Me+=this.R.Ci,this.oa&&Yc(this.oa));this.R.Le-=q;0>=this.R.Le&&(this.R.Le+=this.R.Bi,this.oa&&Sc(this.oa));this.R.Ne-=q;if(0>=this.R.Ne){this.R.Ne+=this.R.xg;break}}while(this.ca.Ib)}catch(y){Ic(this);Hc(this);this.oa&&this.oa.stop(sa(),Qc(this));fb(this,!1);cb(this,y.stack||y.message);return}c=setTimeout;d=this.Kl;this.R.Jd=sa();e=this.R.Ai;this.R.Oe&&(e=Math.round(e*this.R.Oe/this.R.xg));e-=this.R.Jd-this.R.If;if(f=this.R.Jd-
this.R.wd)this.R.vd=Math.round(this.Rc/(10*f))/100,864E5<=f&&(this.ld=0,this.V&&Tc(this.V,!0),Jc(this));if(0>e||this.R.vd<this.R.qe)-1E3>e&&(this.R.wd-=e),e=0;this.R.yg+=this.R.Oe;this.R.Jd+=e;c(d,e)}else Hc(this),this.oa&&this.oa.stop(sa(),Qc(this))};l.yh=function(){return 0};function Ic(a,b){a.ca.wf&&(a.ca.lg=!0);a.Hc-=a.A;a.A=0;Lc(a,a.Rc);a.Rc=0;if(a.ca.Ib){a.ca.Ib=!1;a.V&&a.V.stop();var c=a.ia.run;c&&(c.textContent="Run")}a.ca.complete=b}
function Hc(a){a.oa&&(Yc(a.oa,void 0),Sc(a.oa,void 0))}var Nc=30,Oc=60,Pc=2,Dc=["power","reset"];function Zc(a,b,c,d){this.B=a;this.Ea=a.Ea;this.id=b;this.Yf=c||"";this.ha=0;this.Ta=65535;this.C=this.Ta+1;this.ob=this.gc=this.ext=this.jb=this.type=this.va=0;this.$b=-1;this.S=this.Jc=2;this.O=this.ra=65535;this.J=this.zi;this.H=this.ei;this.I=this.gi;this.A={ha:-1,va:0,Ta:0,jb:0,type:0,ext:0,$b:-1};1==this.id&&(this.Ze=0,this.D=null,this.ne=!1,this.G=Array(32),this.F=[]);$c(this,!0,d)}l=Zc.prototype;
l.zi=function(a){this.ha=a&65535;return this.va=this.ha<<4};l.Gf=function(a,b){var c,d,e=this.B;a&=65535;a&4?(c=e.jc.va,d=c+e.jc.Ta|0):(c=e.Kb,d=e.Oc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,ad(this,c,a,b);this.id<bd&&v.call(e,b&&this.id==cd?10:13,a&65532)}return-1};l.Nl=function(a){var b=this.B;a=b.Tb+(a<<2);var c=b.fa(a);b.N&=-769;return this.load(b.fa(a+2))+c|0};
l.Ml=function(a){var b=this.B;a<<=3;var c=b.Tb+a|0;if(7<=(b.Pc-c|0))return this.D=!0,a=ad(this,c,a),-1!==a&&(a+=this.Ze),a;v.call(b,13,a|2);return-1};l.ei=function(a){return this.va+a|0};l.gi=function(a){return this.va+a|0};l.di=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.yf()};l.lk=function(a,b){return(a>>>0)+b>this.C?this.va+a|0:this.yf()};l.yf=function(){v.call(this.B,13,0);return-1};l.fi=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.zf()};
l.zi=function(a){this.ha=a&65535;return this.va=this.ha<<4};l.Gf=function(a,b){var c,d,e=this.B;a&=65535;a&4?(c=e.jc.va,d=c+e.jc.Ta|0):(c=e.Kb,d=e.Oc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,ad(this,c,a,b);this.id<bd&&v.call(e,b&&this.id==cd?10:13,a&65532)}return-1};l.Ol=function(a){var b=this.B;a=b.Tb+(a<<2);var c=b.fa(a);b.N&=-769;return this.load(b.fa(a+2))+c|0};
l.Nl=function(a){var b=this.B;a<<=3;var c=b.Tb+a|0;if(7<=(b.Pc-c|0))return this.D=!0,a=ad(this,c,a),-1!==a&&(a+=this.Ze),a;v.call(b,13,a|2);return-1};l.ei=function(a){return this.va+a|0};l.gi=function(a){return this.va+a|0};l.di=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.yf()};l.lk=function(a,b){return(a>>>0)+b>this.C?this.va+a|0:this.yf()};l.yf=function(){v.call(this.B,13,0);return-1};l.fi=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.zf()};
l.mk=function(a,b){return(a>>>0)+b>this.C?this.va+a|0:this.zf()};l.zf=function(){v.call(this.B,13,0);return-1};function dd(a,b,c,d,e){a.ha=b;a.va=d;a.Ta=e;a.C=(e>>>0)+1;a.jb=c;a.type=c&7936;a.ext=c>>16&192;a.$b=(b&4?a.B.jc.va:a.B.Kb)+(b&65528)|0;a.id<ed&&$c(a,!0)}function fd(a,b,c){var d=a.B,e=d.fa(b+2),f=d.fa(b)|(e&255)<<16,d=d.fa(b+4);a.ha=c;a.va=f;a.Ta=d;a.C=(d>>>0)+1;a.jb=e;a.type=e&7936;a.ext=0;a.$b=b;a.id<ed&&$c(a,!0)}
function ad(a,b,c,d){var e=a.B;if(!d&&c===a.A.ha)return a.ha=c,a.va=a.A.va,a.Ta=a.A.Ta,a.C=(a.A.Ta>>>0)+1,a.jb=a.A.jb,a.type=a.A.type,a.ext=a.A.ext,a.$b=a.A.$b,a.A.ha=-1,$c(a,!0,!0,!1),a.va;a.A.ha=-1;var f=e.fa(b+0),g=e.fa(b+4),h=g&7936,k=e.fa(b+2)|(g&255)<<16,m=e.fa(b+6),q=c&65528;if(80386<=e.aa){var y=f,k=k|(m&65280)<<16,f=f|(m&15)<<16;m&128&&(f=f<<12|4095)}switch(a.id){case gd:var w=a.D;a.ne=!1;if(w&&c==hd&&a.F.length){var z=a.F[a.Ze-1];if(z&&!z())return-1}var B=c&3,S=(g&24576)>>13,z=-1,X,ca;q||
b>=e.Kb&&b<e.Oc&&(h=0);if(6144<=h)null!=d?z=0:!1!==w?(h&1024?S<=a.ob&&(z=0):B<=a.ob&&S==a.ob&&(z=0),z||(c=c&-4|a.ob&3)):B>=a.ob&&(B>a.ob&&(z=x(e),id(e,x(e),!0),A(e,z),a.ne=!0),z=0);else{if(256==h||2304==h)return jd(a,c,w)?a.va:-1;if(1024==h)z=2,ca=0,B<a.ob&&(B=a.ob);else if(3072==h)z=4,ca=0,B<a.ob&&(B=a.ob);else if(1536==h)z=2,ca=148224;else if(3584==h)z=4,ca=148224;else if(1792==h)z=2,ca=147712;else if(3840==h)z=4,ca=147712;else if(1280==h)return jd(a,k&65535,w)?a.va:-1}0<z&&!(g&32768)&&(z=0);if(0<
@ -132,8 +132,8 @@ function jd(a,b,c){var d=a.B,e=a.ob,f=d.la.ha,g=d.la.va;if(!c){if(!(d.la.type&51
34,d.ua.ha),d.Wa(g+36,d.ga.ha),d.Wa(g+38,d.W.ha),d.Wa(g+40,d.Ca.ha),d.jc.load(d.fa(h+42)),td(d,d.fa(h+16)|(c?16384:0)),d.F=d.fa(h+18),d.H=d.fa(h+20),d.K=d.fa(h+22),d.G=d.fa(h+24),d.L=d.fa(h+28),d.J=d.fa(h+30),d.I=d.fa(h+32),d.ua.load(d.fa(h+34)),d.Ca.load(d.fa(h+40)),ud(d,d.fa(h+14),d.fa(h+36)),b=38,g=26,a.ob<e&&(g=(a.ob<<2)+2,b=g+2),id(d,d.fa(h+b),!0),A(d,d.fa(h+g))):(d.Pa(g+28,d.md),d.Pa(g+32,E(d)),d.Pa(g+36,sd(d)),d.Pa(g+40,d.F),d.Pa(g+44,d.H),d.Pa(g+48,d.K),d.Pa(g+52,d.G),d.Pa(g+56,C(d)),d.Pa(g+
60,d.L),d.Pa(g+64,d.J),d.Pa(g+68,d.I),d.Pa(g+72,d.ua.ha),d.Pa(g+76,d.ga.ha),d.Pa(g+80,d.W.ha),d.Pa(g+84,d.Ca.ha),d.Pa(g+88,d.qb.ha),d.Pa(g+92,d.rb.ha),vd.call(d,d.da(h+28)),d.jc.load(d.fa(h+96)),td(d,d.da(h+36)|(c?16384:0)),d.F=d.da(h+40),d.H=d.da(h+44),d.K=d.da(h+48),d.G=d.da(h+52),d.L=d.da(h+60),d.J=d.da(h+64),d.I=d.da(h+68),d.ua.load(d.fa(h+72)),d.Ca.load(d.fa(h+84)),d.qb.load(d.fa(h+88)),d.rb.load(d.fa(h+92)),ud(d,d.da(h+32),d.fa(h+76)),b=80,g=56,a.ob<e&&(g=(a.ob<<3)+4,b=g+4),id(d,d.fa(h+b),!0),
A(d,d.da(h+g)));c&&d.Wa(h+0,f);d.pa|=8;return!0}l.save=function(){return[this.ha,this.va,this.Ta,this.jb,this.id,this.Yf,this.ob,this.gc,this.$b,this.Jc,this.ra,this.S,this.O,this.type,this.C]};l.restore=function(a){"number"==typeof a?this.load(a):(this.ha=a[0],this.va=a[1],this.Ta=a[2],this.jb=a[3],this.id=a[4],this.Yf=a[5],this.ob=a[6],this.gc=a[7],this.$b=a[8],this.Jc=a[9]||2,this.ra=a[10]||65535,this.S=a[11]||2,this.O=a[12]||65535,this.type=a[13]||this.jb&7936,this.C=a[14]||(this.Ta>>>0)+1)};
function $c(a,b,c,d){void 0===c&&(c=!!(a.B.pa&1));a.ud=!1;if(c)if(a.load=a.Gf,a.yi=a.Ml,a.Lb=a.di,a.Mb=a.fi,void 0===d&&(d=!!(a.B.N&131072)),d)a.load=a.J,a.Lb=a.H,a.Mb=a.I,a.ob=a.gc=3,a.S=2,a.O=a.ra=65535,a.Ta=65535,a.C=a.Ta+1,a.Jc=a.S,a.$b=-1,a.ne=!1;else{if(!(a.ha&-4))a.Lb=a.yf,a.Mb=a.zf;else if(a.type&4096){6144==(a.type&6656)&&(a.Lb=a.yf);if(a.type&2048||!(a.type&512))a.Mb=a.zf;1024==(a.type&3072)&&(a.Lb==a.di&&(a.Lb=a.lk),a.Mb==a.fi&&(a.Mb=a.mk),a.ud=!0);b&&a.id<bd&&a.ha&-4&&-1!==a.$b&&(c=a.$b+
5,d=a.B.Eb(c),d&1||a.B.Dc(c,d|1))}b&&(a.ob=a.ha&3,a.gc=(a.jb&24576)>>13,80386>a.B.aa||!(a.ext&64)?(a.S=2,a.O=65535):(a.S=4,a.O=-1),a.Jc=a.S,a.ra=a.O)}else a.load=a.zi,a.yi=a.Nl,a.Lb=a.ei,a.Mb=a.gi,a.ob=a.gc=0,a.$b=-1,a.ne=!1}var gd=1,rd=2,cd=3,ed=4,bd=6,hd=1;
function $c(a,b,c,d){void 0===c&&(c=!!(a.B.pa&1));a.ud=!1;if(c)if(a.load=a.Gf,a.yi=a.Nl,a.Lb=a.di,a.Mb=a.fi,void 0===d&&(d=!!(a.B.N&131072)),d)a.load=a.J,a.Lb=a.H,a.Mb=a.I,a.ob=a.gc=3,a.S=2,a.O=a.ra=65535,a.Ta=65535,a.C=a.Ta+1,a.Jc=a.S,a.$b=-1,a.ne=!1;else{if(!(a.ha&-4))a.Lb=a.yf,a.Mb=a.zf;else if(a.type&4096){6144==(a.type&6656)&&(a.Lb=a.yf);if(a.type&2048||!(a.type&512))a.Mb=a.zf;1024==(a.type&3072)&&(a.Lb==a.di&&(a.Lb=a.lk),a.Mb==a.fi&&(a.Mb=a.mk),a.ud=!0);b&&a.id<bd&&a.ha&-4&&-1!==a.$b&&(c=a.$b+
5,d=a.B.Eb(c),d&1||a.B.Dc(c,d|1))}b&&(a.ob=a.ha&3,a.gc=(a.jb&24576)>>13,80386>a.B.aa||!(a.ext&64)?(a.S=2,a.O=65535):(a.S=4,a.O=-1),a.Jc=a.S,a.ra=a.O)}else a.load=a.zi,a.yi=a.Ol,a.Lb=a.ei,a.Mb=a.gi,a.ob=a.gc=0,a.$b=-1,a.ne=!1}var gd=1,rd=2,cd=3,ed=4,bd=6,hd=1;
function wd(a){var b=+a.model||8088,c;switch(b){default:c=4772727;break;case 80286:c=6E6;break;case 80386:c=16E6}Cc.call(this,a,c);this.aa=b;a=a.stepping;this.od=b+(a?fa(a,16):0);this.Uh=61442;this.nd=1792;this.Th=28672;this.kf=4;this.Ha=255;this.B=80286<=this.aa?ib:hb;this.qa=xd;this.ci=yd;this.hi=zd;this.li=Ad;if(80186<=this.aa&&(this.qa=xd.slice(),this.ci=yd.slice(),this.hi=zd.slice(),this.Ha=31,this.qa[15]=Bd,this.qa[96]=Cd,this.qa[97]=Dd,this.qa[98]=Ed,this.qa[99]=Bd,this.qa[100]=Bd,this.qa[101]=
Bd,this.qa[102]=Bd,this.qa[103]=Bd,this.qa[104]=Fd,this.qa[105]=Gd,this.qa[106]=Hd,this.qa[107]=Id,this.qa[108]=Jd,this.qa[109]=Kd,this.qa[110]=Ld,this.qa[111]=Md,this.qa[192]=Nd,this.qa[193]=Od,this.qa[200]=Pd,this.qa[201]=Qd,this.qa[241]=Rd,this.ci[7]=Sd,this.hi[7]=Sd,80286<=this.aa)){this.Uh=2;this.nd|=28672;this.kf=0;this.qa[15]=Td;this.kd=Ud.slice();for(b=0;b<this.kd.length;b++)this.kd[b]||(this.kd[b]=Vd);this.qa[84]=Wd;this.qa[99]=Xd;if(80386<=this.aa){var d;this.Th=0;this.nd|=196608;this.qa[100]=
Yd;this.qa[101]=Zd;this.qa[102]=$d;this.qa[103]=ae;for(d in F)this.kd[+d]=F[+d];80546<=this.od&&80562>=this.od&&(this.kd[166]=be,this.kd[167]=ce)}}this.nf=[];this.ai=[];this.bg=0;Fc(this);this.ca.complete=this.ca.pk=!1;this.pi=0;this.Nc=this.X=[];this.yb=this.vh=this.xb=this.lf=this.xe=this.ye=this.Ic=0;de(this)}ba(wd,Cc);
@ -141,8 +141,8 @@ function Lb(a){var b;if(a.X===a.Nc){a.X=Array(a.lf);a.pf=new u(null,0,0,pc,null,
function yc(a,b,c,d){var e=(b&-4194304)>>>20,f=a.Nc[(a.md+e&a.ye)>>>a.yb],g=f.Md(e);if(!(g&1))return d||fe.call(a,b,!1,c),a.ze;if(!(g&4)&&3==a.Ga)return d||fe.call(a,b,!0,c),a.ze;var h=(b&4190208)>>>10,g=a.Nc[((g&-4096)+h&a.ye)>>>a.yb],k=g.Md(h);if(!(k&1))return d||fe.call(a,b,!1,c),a.ze;if(!(k&4)&&3==a.Ga)return d||fe.call(a,b,!0,c),a.ze;c=a.Nc[((k&-4096)+(b&4095)&a.ye)>>>a.yb];if(d)return c;d=b>>>a.yb;k=a.X[d];b&=-4096;var m;0<a.qf?(m=a.Wh[--a.qf],m.Gl(b)):m=new u(b,0,0,rc);b=m;b.J=c;b.A=f;b.C=
e>>2;b.B=g;b.D=h>>2;gb&&Wb&&c.T&&!c.controller&&!c.ee&&!c.fe?(b.Fa=c.Fa,b.qd=c.qd,b.T=c.T,Rb(b,Bc)):(b.I=c?zc(32):0,b.M=c?zc(96):0,Rb(b,sc));Fb(b,a.Ea,k);a.X[d]=b;a.mf.push(d);return b}function ge(a){a.X!==a.Nc&&(a.X=a.Nc,a.pf=null,a.mf=null,a.ze=null)}l=wd.prototype;l.reset=function(){this.ca.Ib&&Ic(this);de(this);Fc(this);this.ca.error=!1};
function he(a,b){var c;switch(b){case 0:c=a.F;break;case 1:c=a.H;break;case 2:c=a.K;break;case 3:c=a.G;break;case 4:c=C(a);break;case 5:c=a.L;break;case 6:c=a.J;break;case 7:c=a.I}return c}function ie(a,b,c){switch(b){case 0:a.F=c;break;case 1:a.H=c;break;case 2:a.K=c;break;case 3:a.G=c;break;case 4:A(a,c);break;case 5:a.L=c;break;case 6:a.J=c;break;case 7:a.I=c}}
function de(a){a.F=0;a.G=0;a.H=0;a.K=0;a.ic=0;a.L=0;a.J=0;a.I=0;a.cc=!1;a.za=a.Va=0;a.ta=0;a.oi=0;a.Z=0;a.pa=65520;a.Tb=0;a.Pc=1023;a.N=a.Wb=0;a.Yd=a.Be=a.Xd=a.Zd=0;a.xc=-1;a.Sc=a.yc=-1;a.ad=a.na=-1;a.ga=new Zc(a,gd,"CS");a.Ca=new Zc(a,rd,"DS");a.ua=new Zc(a,rd,"ES");a.W=new Zc(a,cd,"SS");A(a,0);id(a,0);if(80386<=a.aa){switch(a.od){case 80562:case 80563:a.K=771;break;case 80578:a.K=772;break;case 80594:a.K=773;break;case 80595:case 80596:a.K=776}a.pa=16;a.xi=0;a.Wd=0;a.md=0;a.Bb=[0,0,0,0,null,null,
0,0];a.rf=[null,null,null,null,null,null,0,0];a.qb=new Zc(a,rd,"FS");a.rb=new Zc(a,rd,"GS");ge(a)}a.eg=new Zc(a,0,"NULL");a.Ba=a.Ca;a.Db=a.W;a.M=a.ba=0;a.C=a.D=-1;a.Xa=a.eg;a.Ka=0;if(80286>a.aa)ud(a,0,65535);else{a.Kb=0;a.Oc=65535;a.jc=new Zc(a,5,"LDT",!0);a.la=new Zc(a,ed,"TSS",!0);a.bb=new Zc(a,bd,"VER",!0);ud(a,65520,61440);var b,c=E(a);b=a.ga;var d=-65536;80386>b.B.aa&&(d&=16777215);b=b.va=d;a.ea=b+c|0;a.cg=(b>>>0)+(a.ga.Ta>>>0)+1}td(a,0);kd(a)}
function de(a){a.F=0;a.G=0;a.H=0;a.K=0;a.ic=0;a.L=0;a.J=0;a.I=0;a.cc=!1;a.za=a.Va=0;a.Ml=[0,0];a.Ql=[0,0];a.ta=0;a.oi=0;a.Z=0;a.pa=65520;a.Tb=0;a.Pc=1023;a.N=a.Wb=0;a.Yd=a.Be=a.Xd=a.Zd=0;a.xc=-1;a.Sc=a.yc=-1;a.ad=a.na=-1;a.ga=new Zc(a,gd,"CS");a.Ca=new Zc(a,rd,"DS");a.ua=new Zc(a,rd,"ES");a.W=new Zc(a,cd,"SS");A(a,0);id(a,0);if(80386<=a.aa){switch(a.od){case 80562:case 80563:a.K=771;break;case 80578:a.K=772;break;case 80594:a.K=773;break;case 80595:case 80596:a.K=776}a.pa=16;a.xi=0;a.Wd=0;a.md=0;
a.Bb=[0,0,0,0,null,null,0,0];a.rf=[null,null,null,null,null,null,0,0];a.qb=new Zc(a,rd,"FS");a.rb=new Zc(a,rd,"GS");ge(a)}a.eg=new Zc(a,0,"NULL");a.Ba=a.Ca;a.Db=a.W;a.M=a.ba=0;a.C=a.D=-1;a.Xa=a.eg;a.Ka=0;if(80286>a.aa)ud(a,0,65535);else{a.Kb=0;a.Oc=65535;a.jc=new Zc(a,5,"LDT",!0);a.la=new Zc(a,ed,"TSS",!0);a.bb=new Zc(a,bd,"VER",!0);ud(a,65520,61440);var b,c=E(a);b=a.ga;var d=-65536;80386>b.B.aa&&(d&=16777215);b=b.va=d;a.ea=b+c|0;a.cg=(b>>>0)+(a.ga.Ta>>>0)+1}td(a,0);kd(a)}
function je(a){2==a.Jc?(a.vi=a.fa,a.Vb=ke,a.bc=le,a.Qc=me,2==a.S?(a.ja=ne,a.wa=oe,a.$a=pe):(a.ja=qe,a.wa=re,a.$a=se)):(a.vi=a.da,a.Vb=te,a.bc=ue,a.Qc=ve,2==a.S?(a.ja=we,a.wa=xe,a.$a=ye):(a.ja=ze,a.wa=Ae,a.$a=Be))}function ld(a,b){a.S!=b&&(a.ba|=1024,a.S=b,a.O=2==b?65535:-1,Ce(a))}function Ce(a){2==a.S?(a.sb=32768,a.ib=a.fa,a.nb=a.Wa,2==a.Jc?(a.ja=ne,a.wa=oe,a.$a=pe):(a.ja=we,a.wa=xe,a.$a=ye)):(a.sb=-2147483648,a.ib=a.da,a.nb=a.Pa,2==a.Jc?(a.ja=qe,a.wa=re,a.$a=se):(a.ja=ze,a.wa=Ae,a.$a=Be))}
function De(a){a.Jc=a.ga.Jc;a.ra=a.ga.ra;je(a);a.S=a.ga.S;a.O=a.ga.O;Ce(a);a.ba&=-3073}l.ri=function(){var a=this.F+this.G+this.H+this.K+C(this)+this.L+this.J+this.I|0;return a=a+E(this)+this.ga.ha+this.Ca.ha+this.W.ha+this.ua.ha+sd(this)|0};function Ee(a,b,c){void 0===a.nf[b]&&(a.nf[b]=[]);a.nf[b].push(c)}function Fe(a,b){var c=a.ai[b];null!=c&&(c(--a.bg),delete a.ai[b])}
function Ge(a,b){for(var c=a.Bb[7],d=c>>16,e=0;4>e;e++){if(c&3){var f=!!(d&1),g=a.Bb[e],g=g&~(d>>2&3);if(b){var g=a.X[g>>>a.yb],h=a;f?g.fe++||(h&&(g.F=h),vc(g,wc,!1)):g.ee++||(h&&(g.F=h),uc(g,wc,!1))}else g=a.X[g>>>a.yb],f?--g.fe||(f=g,f.nc=f.H?f.sh:f.gf,f.jf=f.H?f.th:f.uh,f.hf=f.H?f.rh:f.U):--g.ee||(f=g,f.mc=f.zd,f.af=f.bf,f.Md=f.mh)}c>>=2;d>>=4}}
@ -219,7 +219,7 @@ function Zh(a,b){var c=a-b|0;Oe(this,a,b,c,this.sb|63,!0);this.A-=-1===this.D?-1
function ci(a,b){return b>>(this.F&this.O)&(1<<(this.H&31))-1&this.O}function di(a,b){if(-1===this.C){switch(this.Z&7){case 0:this.F=this.F&-256|a;break;case 1:this.H=this.H&-256|a;break;case 2:this.K=this.K&-256|a;break;case 3:this.G=this.G&-256|a;break;case 4:this.F=this.F&-65281|a<<8;break;case 5:this.H=this.H&-65281|a<<8;break;case 6:this.K=this.K&-65281|a<<8;break;case 7:this.G=this.G&-65281|a<<8}this.A-=this.B.ih}else this.D=this.C,kf(this,a),this.A-=this.B.hh;return b}
function ei(a,b){if(-1===this.C){switch(this.Z&7){case 0:this.F=this.F&~this.O|a;break;case 1:this.H=this.H&~this.O|a;break;case 2:this.K=this.K&~this.O|a;break;case 3:this.G=this.G&~this.O|a;break;case 4:A(this,C(this)&~this.O|a);break;case 5:this.L=this.G&~this.O|a;break;case 6:this.J=this.J&~this.O|a;break;case 7:this.I=this.I&~this.O|a}this.A-=this.B.ih}else this.D=this.C,this.M&2||this.nb(this.Xa.Mb(this.ab,this.S),a),this.A-=this.B.hh;return b}
function fi(a,b){a^=b;H(this,a,128);this.A-=-1===this.D?-1===this.C?this.B.Xb:this.B.vb:this.B.kc;return a}function gi(a,b){this.A-=-1===this.D?-1===this.C?this.B.Xb:this.B.vb:this.B.kc;return H(this,a^b,this.sb)&this.O}function hi(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function ii(a){var b=a-1|0;Oe(this,a,1,b,this.sb|62,!0);this.A-=2;return a&~this.O|b&this.O}
function ji(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1;c=[c>>>0,0];for(a=[a>>>0,b>>>0];0<hi(a,c);){var f=b=c;b[0]+=f[0];b[1]+=f[1];4294967295<b[0]&&(b[0]>>>=0,b[1]++);e+=e}do 0<=hi(a,c)&&(b=a,f=c,b[0]-=f[0],b[1]-=f[1],0>b[0]&&(b[0]>>>=0,b[1]--),d+=e),b=c,b[0]>>>=1,b[1]&1&&(b[0]=(b[0]|2147483648)>>>0),b[1]>>>=1,e/=2;while(1<=e);this.za=d;this.Va=a[0];return!0}function ki(a){var b=a+1|0;Oe(this,a,1,b,this.sb|62);this.A-=2;return a&~this.O|b&this.O}
function ji(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1,f=this.Ml;f[0]=c>>>0;f[1]=0;c=this.Ql;c[0]=a>>>0;for(c[1]=b>>>0;0<hi(c,f);)b=a=f,a[0]+=b[0],a[1]+=b[1],4294967295<a[0]&&(a[0]>>>=0,a[1]++),e+=e;do 0<=hi(c,f)&&(a=c,b=f,a[0]-=b[0],a[1]-=b[1],0>a[0]&&(a[0]>>>=0,a[1]--),d+=e),a=f,a[0]>>>=1,a[1]&1&&(a[0]=(a[0]|2147483648)>>>0),a[1]>>>=1,e/=2;while(1<=e);this.za=d;this.Va=c[0];return!0}function ki(a){var b=a+1|0;Oe(this,a,1,b,this.sb|62);this.A-=2;return a&~this.O|b&this.O}
function vd(a){this.md=a;this.pa&-2147483648&&Lb(this)}function li(a){this.M|=1;this.bc.call(this,a);this.A-=-1===this.C?4:5}function Kh(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a<<c-1;a=(d<<1|b>>>16-c)&65535;H(this,a,32768,d&32768)}return a}function Ph(a,b,c){if(c){var d=a<<c-1;a=d<<1|b>>>32-c;H(this,a,-2147483648,d&-2147483648)}return a}function Th(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a>>>c-1;a=(d>>>1|b<<16-c)&65535;H(this,a,32768,d&1)}return a}
function Vh(a,b,c){if(c){var d=a>>>c-1;a=d>>>1|b<<32-c;H(this,a,-2147483648,d&1)}return a}function mi(){this.A-=-1===this.C?2:this.B.Bj;return 1}function ni(){var a=this.H&255;this.A-=(-1===this.C?this.B.Zg:this.B.Yg)+(a<<this.B.$g);return a}function oi(){var a=this.ka();this.A-=(-1===this.C?this.B.Zg:this.B.Yg)+(a<<this.B.$g);return a}function pi(){return null}function qi(){return this.ta}
function ri(a,b){this.Sc=this.ga.ha;this.yc=this.W.ha;this.na=this.xa;var c=E(this),d=this.S;null!=ud(this,a,b,!0)&&(nd(this,this.Sc,d,2),nd(this,c,d,d));this.Sc=this.yc=this.na=-1}function si(a,b,c){this.A-=this.B.$i+(c||0);c=sd(this);var d=this.ga.ha,e=E(this);a=this.ga.yi(a);-1!==a&&(D(this,c),D(this,d),D(this,e),null!=b&&D(this,b),this.xc=-1,Le(this,a))}
@ -406,12 +406,12 @@ l.reset=function(a){var b;Hj(this);this.D=Array(this.wa);for(b=0;b<this.wa;b++)I
bk;this.G=Array(8);this.W=0;a&&(this.A=Array(ck));dk(this,this.Ka);for(a=ek;a<=fk;a++)this.A[a]=0;for(a=gk;a<hk;a++)void 0===this.A[a]&&(this.A[a]=0);a=0|+Vj(this,oj,void 0)<<ik.ag&ik.fc;a|=+Vj(this,uj,void 0)?jk:0;b=+Vj(this,nj,void 0);a|=b?b-1<<kk.ag&kk.fc|kk.ek:0;this.A[lk]=a;this.A[mk]=nk(this,0)<<4|nk(this,1);ok(this)}};
function dk(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.lc("CMOS date invalid ("+b+"), using "+c)):b&&a.lc("CMOS date: "+c);a.A[pk]=c.getSeconds();a.A[qk]=0;a.A[rk]=c.getMinutes();a.A[sk]=0;a.A[tk]=c.getHours();a.A[uk]=0;a.A[vk]=c.getDay()+1;a.A[wk]=c.getDate();a.A[xk]=c.getMonth()+1;b=c.getFullYear();a.A[yk]=b%100;b/=100;a.A[zk]=b%10|b/10<<4;a.A[Ak]=38;a.A[Wc]=Bk;a.A[Ck]=0;a.A[Dk]=Ek;a.na=a.X=0;a.Ha=a.xa=null}
function Fk(a){var b;void 0===b&&(b=a.xa);a.X=Qc(a.U,a.V)+b;a.A[Wc]&Xc&&Kc(a.U,b)}function ok(a){for(var b=0,c=mk;c<hk;c++)b+=a.A[c];a.A[Gk]=b&255;a.A[hk]=b>>8}
l.save=function(){var a=new Ie(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.D;c++){for(var d=this.D[c],e=d,f=[],g=0;g<e.Qb.length;g++){var h=e.Qb[g];f[g]=[h.Id,h.tf,h.ac,h.cb,h.eb,h.mode,h.uf,h.on,h.pn]}b[c]=[d.zb,d.hg,d.$h,d.Cb,f,d.jg]}a.set(1,[b]);b=[];for(c=0;c<this.Zb.length;c++)d=this.Zb[c],b[c]=[d.Pe,d.Kc,d.gd,d.Tc,d.Rb,d.tc,d.Dd,d.Ge];a.set(2,[b]);b=[];for(c=0;c<this.H.length;c++)d=this.H[c],b[c]=[d.ac,d.vc,d.eb,d.Ed,d.kg,d.mode,d.ff,d.Vc,d.ed,d.Lc,d.ke,d.Gd,d.fd,d.zb,d.oe];a.set(3,[this.ta,
l.save=function(){var a=new Ie(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.D;c++){for(var d=this.D[c],e=d,f=[],g=0;g<e.Qb.length;g++){var h=e.Qb[g];f[g]=[h.Id,h.tf,h.ac,h.cb,h.eb,h.mode,h.uf,h.qn,h.rn]}b[c]=[d.zb,d.hg,d.$h,d.Cb,f,d.jg]}a.set(1,[b]);b=[];for(c=0;c<this.Zb.length;c++)d=this.Zb[c],b[c]=[d.Pe,d.Kc,d.gd,d.Tc,d.Rb,d.tc,d.Dd,d.Ge];a.set(2,[b]);b=[];for(c=0;c<this.H.length;c++)d=this.H[c],b[c]=[d.ac,d.vc,d.eb,d.Ed,d.kg,d.mode,d.ff,d.Vc,d.ed,d.Lc,d.ke,d.Gd,d.fd,d.zb,d.oe];a.set(3,[this.ta,
b,this.ea]);a.set(4,[this.ua,this.J,this.Ba,this.ga,this.ba]);this.aa>=wf&&(a.set(5,[this.F,this.L,this.K,this.pa,this.M,this.qa]),a.set(6,[this.G[7],this.G,this.W,this.A,this.na,this.X]));return a.data()};
l.restore=function(a){var b,c;b=a[0];Array.isArray(b[0])?this.C=b[0]:(this.C[0][0]=b[0],this.C[1][0]=b[1]&15,this.C[0][1]=b[2],this.C[1][1]=b[3]&15);Hj(this);b=a[1];for(c=0;c<this.wa;c++)Ij(this,c,1==b.length?b[0][c]:b);b=a[2];for(c=0;c<this.ja;c++)Jj(this,c,c?Nj:Lj,b[0][c]);b=a[3];this.ta=b[0];this.ea=b[2];for(c=0;c<this.H.length;c++)Oj(this,c,b[1][c]);b=a[4];this.ua=b[0];this.J=b[1];this.Ba=b[2];this.ga=b[3];this.ba=b[4];if(b=a[5])this.F=b[0],this.L=b[1],this.K=b[2],this.pa=b[3],this.M=b[4],this.qa=
b[5];if(b=a[6])this.G=b[1],this.G[7]=b[0],this.W=b[2],this.A=b[3],this.na=b[4],this.X=b[5],dk(this);return!0};l.start=function(){Hk(this)};l.stop=function(){Hk(this)};function Ij(a,b,c){var d=a.D[b];d||(d={Qb:Array(4)});c=c&&5<=c.length?c:Ik;d.zb=c[0];d.hg=c[1];d.$h=c[2];d.Cb=c[3];d.Pl=b<<2;for(var e=0;e<d.Qb.length;e++)Jk(d,e,c[4][e]);d.jg=c[5]||0;a.D[b]=d}
function Jk(a,b,c){var d=a.Qb[b];d||(d={tf:[0,0],ac:[0,0],cb:[0,0],eb:[0,0]});c=c&&8==c.length?c:Kk;d.Id=c[0];d.tf[0]=c[1][0];d.tf[1]=c[1][1];d.ac[0]=c[2][0];d.ac[1]=c[2][1];d.cb[0]=c[3][0];d.cb[1]=c[3][1];d.eb[0]=c[4][0];d.eb[1]=c[4][1];d.mode=c[5];d.uf=c[6];d.controller=a;d.ui=b;Lk(d,c[8],c[9]);a.Qb[b]=d}function Lk(a,b,c,d){"string"==typeof b&&(b=Ra(b));b&&(a.done=null,a.on=b.id,a.pn=c,a.Bf=b,a.og=b[c],a.Qf=d)}
function Jj(a,b,c,d){var e=a.Zb[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Mk;e.port=c;e.Do=b<<3;e.Pe=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.gd=d[2];e.Tc=d[3];e.Rb=d[4];e.tc=d[5];e.Dd=d[6];e.Ge=d[7];a.Zb[b]=e}
b[5];if(b=a[6])this.G=b[1],this.G[7]=b[0],this.W=b[2],this.A=b[3],this.na=b[4],this.X=b[5],dk(this);return!0};l.start=function(){Hk(this)};l.stop=function(){Hk(this)};function Ij(a,b,c){var d=a.D[b];d||(d={Qb:Array(4)});c=c&&5<=c.length?c:Ik;d.zb=c[0];d.hg=c[1];d.$h=c[2];d.Cb=c[3];d.Rl=b<<2;for(var e=0;e<d.Qb.length;e++)Jk(d,e,c[4][e]);d.jg=c[5]||0;a.D[b]=d}
function Jk(a,b,c){var d=a.Qb[b];d||(d={tf:[0,0],ac:[0,0],cb:[0,0],eb:[0,0]});c=c&&8==c.length?c:Kk;d.Id=c[0];d.tf[0]=c[1][0];d.tf[1]=c[1][1];d.ac[0]=c[2][0];d.ac[1]=c[2][1];d.cb[0]=c[3][0];d.cb[1]=c[3][1];d.eb[0]=c[4][0];d.eb[1]=c[4][1];d.mode=c[5];d.uf=c[6];d.controller=a;d.ui=b;Lk(d,c[8],c[9]);a.Qb[b]=d}function Lk(a,b,c,d){"string"==typeof b&&(b=Ra(b));b&&(a.done=null,a.qn=b.id,a.rn=c,a.Bf=b,a.og=b[c],a.Qf=d)}
function Jj(a,b,c,d){var e=a.Zb[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Mk;e.port=c;e.Fo=b<<3;e.Pe=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.gd=d[2];e.Tc=d[3];e.Rb=d[4];e.tc=d[5];e.Dd=d[6];e.Ge=d[7];a.Zb[b]=e}
function Oj(a,b,c){var d=a.H[b];d||(d={ac:[0,0],vc:[0,0],eb:[0,0],Ed:[0,0]});c=c&&13<=c.length?c:Nk;d.ac[0]=c[0][0];d.ac[1]=c[0][1];d.vc[0]=c[1][0];d.vc[1]=c[1][1];d.eb[0]=c[2][0];d.eb[1]=c[2][1];d.Ed[0]=c[3][0];d.Ed[1]=c[3][1];d.kg=c[4];d.mode=c[5];d.ff=c[6];d.Vc=c[7];d.ed=c[8];d.Lc=c[9];d.ke=c[10];d.Gd=c[11];d.fd=c[12];d.zb=c[13]||0;d.oe=c[14]||!1;a.H[b]=d}
function qj(a,b,c){for(var d="",e=a.ia[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||(g+=" pcjs-bitCellLeft");d+='<div id="'+(c+"-"+f)+'" class="'+g+'" data-value="0">'+f+"</div>\n"}e.innerHTML=d;Ok(a,b,c,!0)}function Pk(a,b,c){if(b=(a=U[a.aa|0])&&a[b])for(var d in b)if(a=b[d],a.fc&1<<c)return a;return null}
function Vj(a,b,c){for(var d=null,e=U[a.aa]||U[a.aa|0]||U[rj],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.C[f][c?0:1]&g.fc;for(var h in g.Ec)if(g.Ec[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function nk(a,b){if(b<+Vj(a,nj,void 0)){if(!a.N)return Qk;if(b<a.N.length)switch(a.N[b]){case 160:case 180:case 320:case 360:return Qk;case 720:return Rk;case 1200:return Sk;case 1440:return Tk}}return Uk}function Tj(a,b){return+Vj(a,Vk,b)+ +Vj(a,Wk,b)}
@ -419,7 +419,7 @@ function kj(a,b){if(a){b=0;for(var c=1,d=0;d<a.length;d++)"0"==a.charAt(d)&&(b|=
function Ok(a,b,c,d){if(c=a.ia[c]){d=d?a.C[b][0]:a.C[b][1]=a.C[b][0];c=Wa(c,"pcjs-bitCell");for(var e=0;e<c.length;e++){var f=Pk(a,b,e);c[e].setAttribute("title",f&&f.bd||"Reserved");Xk(c[e],!(d&1<<e));c[e].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");Xk(b,c);var d=b.getAttribute("id").split("-"),e=1<<+d[1]-1;switch(d[0]){case lj:a.C[0][0]=a.C[0][0]&~e|(c?0:e);break;case pj:a.C[1][0]=a.C[1][0]&~e|(c?0:e)}Yk(a)}}(a,c[e])}}}
function Yk(a){var b=a.ia[tj];if(null!=b){var c;c=""+(Tj(a,!0)+"Kb");c+=", "+(+ +Vj(a,uj,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Vj(a,oj,!0)]+" Monitor";c+=", "+ +Vj(a,nj,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
function Zk(a,b,c){a=a.D[b];var d=a.Qb[c],e=d.cb[a.Cb];a.Cb^=1;b||c!=$k||a.Cb||(d.cb[0]++,255<d.cb[0]&&(d.cb[0]=0,d.cb[1]++,255<d.cb[1]&&(d.cb[1]=0)));return e}function al(a,b,c,d){a=a.D[b];c=a.Qb[c];c.cb[a.Cb]=c.tf[a.Cb]=d;a.Cb^=1}function bl(a,b,c){a=a.D[b];var d=a.Qb[c],e=d.eb[a.Cb];a.Cb^=1;b||c!=$k||a.Cb||(d.eb[0]--,0>d.eb[0]&&(d.eb[0]=255,d.eb[1]--,0>d.eb[1]&&(d.eb[1]=255)));return e}function cl(a,b,c,d){a=a.D[b];c=a.Qb[c];c.eb[a.Cb]=c.ac[a.Cb]=d;a.Cb^=1}
function dl(a,b){a=a.D[b];b=a.zb|el;a.zb&=~fl;return b}function gl(a,b,c){a=a.D[b];b=c&3;a.zb=a.zb&~(16<<b)|(c&4)<<b+2;a.$h=c}function hl(a,b,c){b=a.D[b];var d=c&il,e=b.Qb[d];e.Id=!!(c&jl);e.Id||kl(a,b.Pl+d)}function ll(a,b){a=a.D[b];for(b=0;b<a.Qb.length;b++)Jk(a,b)}function ml(a,b,c){return a.D[b].Qb[c].uf}function nl(a,b,c,d){a.D[b].Qb[c].uf=d}function ol(a,b,c,d,e){Lk(a.D[b>>2].Qb[b&3],c,d,e)}function kl(a,b,c){b=a.D[b>>2].Qb[b&3];b.Bf&&b.og&&b.Qf?(c&&(b.done=c),b.Id||pl(a,b,!0)):c&&c(!0)}
function dl(a,b){a=a.D[b];b=a.zb|el;a.zb&=~fl;return b}function gl(a,b,c){a=a.D[b];b=c&3;a.zb=a.zb&~(16<<b)|(c&4)<<b+2;a.$h=c}function hl(a,b,c){b=a.D[b];var d=c&il,e=b.Qb[d];e.Id=!!(c&jl);e.Id||kl(a,b.Rl+d)}function ll(a,b){a=a.D[b];for(b=0;b<a.Qb.length;b++)Jk(a,b)}function ml(a,b,c){return a.D[b].Qb[c].uf}function nl(a,b,c,d){a.D[b].Qb[c].uf=d}function ol(a,b,c,d,e){Lk(a.D[b>>2].Qb[b&3],c,d,e)}function kl(a,b,c){b=a.D[b>>2].Qb[b&3];b.Bf&&b.og&&b.Qf?(c&&(b.done=c),b.Id||pl(a,b,!0)):c&&c(!0)}
function pl(a,b,c){c&&(b.count=b.eb[1]<<8|b.eb[0],b.type=b.mode&ql,b.ni=b.Df=!1);for(var d=!1;0<=b.count&&(c=b.uf<<16|b.cb[1]<<8|b.cb[0],b.type==rl?(d=!0,function(c){b.og.call(b.Bf,b.Qf,-1,function(e,g){0>e&&(b.ni||(b.ni=!0),e=255);b.Id||a.ma.Dc(c,e);(d=g)&&setTimeout(function(){sl(b)||pl(a,b)},0)})}(c)):b.type==tl?(c=a.ma.Eb(c),0>b.og.call(b.Bf,b.Qf,c)&&(b.Df=!0)):b.type!=ul&&(b.Df=!0)),!d&&!sl(b););}
function sl(a){if(!a.Df&&0<=--a.count&&(a.mode&vl?(a.cb[0]--,0>a.cb[0]&&(a.cb[0]=255,a.cb[1]--,0>a.cb[1]&&(a.cb[1]=255))):(a.cb[0]++,255<a.cb[0]&&(a.cb[0]=0,a.cb[1]++,255<a.cb[1]&&(a.cb[1]=0))),!a.Id))return!1;var b=a.controller;b.zb=b.zb&~(16<<a.ui)|1<<a.ui;a.mode&wl||(a.Id=!0,a.Bf=a.Qf=null);a.done&&(a.done(!a.Df),a.done=null);return!0}function xl(a,b){var c=0;a=a.Zb[b];if(null!=a.Ge)switch(a.Ge&yl){case zl:c=a.Rb;break;case Al:c=a.tc}return c}
function Bl(a,b,c){b=a.Zb[b];if(c&Cl)b.gd=0,b.Kc[b.gd++]=c,b.Tc=0,b.Dd=7,b.Rb=b.tc=0,b.Ge=Dl|zl;else if(c&Dl)b.Ge=c;else{var d=c&El;if(d&Fl){var e=0;if((d&Gl)==Gl)c&=Hl,e=1<<c;else for(c=b.Dd+1;;){c&=7;d=1<<c;if(b.tc&d){e=d;break}if(c++==b.Dd)break}b.tc&e&&(b.tc&=~e,Il(a))}else d==Jl&&(b.Dd=c&Hl)}}function Kl(a,b,c){var d=a.Zb[b];d.gd<d.Kc.length?(d.Kc[d.gd++]=c,2==d.gd&&d.Kc[0]&Ll&&d.gd++,3!=d.gd||d.Kc[0]&Ml||d.gd++):(d.Tc=c,d=a.U,d.M|=4,Il(a,b||253!=c?0:6))}
@ -430,17 +430,17 @@ function Zl(a,b,c){var d=0,e=c&$l;b?(d=3,a.ea=c):a.ta=c;if(e==am){if(!(c&bm))for
e.vc[0]=e.ac[0],e.vc[1]=e.ac[1],e.fd=Qc(a.U,a.V))}}}function Xl(a,b){a=a.H[b];(b=a.ac[1]<<8|a.ac[0])||(b=1==a.ed?256:65536);return b}function Uc(a,b){a=a.H[b];(b=a.vc[1]<<8|a.vc[0])||(b=1==a.ed?256:65536);return b}function gm(a,b){Ql(a,b);var c=a.H[b];c.Ed[0]=c.eb[0];c.Ed[1]=c.eb[1];c.ke=!0;Pl(a,b)}function Pl(a,b){a=a.H[b];a.Vc=a.ff==qm?1:0;a.ed=a.ff==rm?2:1}
function Ql(a,b,c){var d=a.H[b];if(d.Gd&&(b!=Yl||a.J&mm)){var e=Qc(a.U,a.V),f=(e-d.fd)/a.za|0;0>f&&(d.fd=e,f=0);var g=Xl(a,b),h=Uc(a,b)-f;d.mode==Sl?(0>=h&&(h=0),h||(d.Lc=!0,d.Gd=!1,b||zf(a,Wl))):d.mode==sm?(d.Lc=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.vc[0]=h&255,d.vc[1]=h>>8&255,d.fd=e,!b&&d.Lc&&zf(a,Wl))):d.mode==Vc&&(h-=f,0>=h&&(d.Lc=!d.Lc,h=g+h,0>=h&&(h=g),d.vc[0]=h&255,d.vc[1]=h>>8&255,d.fd=e,!b&&d.Lc&&zf(a,Wl)));d.eb[0]=h&255;d.eb[1]=h>>8&255;c&&(a.fd=0)}return d}
function Tc(a,b){for(var c=0;c<a.H.length;c++)Ql(a,c,b);if(a.aa>=wf){b=a.U.R.Wc;c=Qc(a.U,a.V);null==a.xa&&(a.na=Qc(a.U,a.V),a.Ha=1024,a.xa=Math.floor(a.U.R.Wc/a.Ha),Fk(a));c>=a.X&&(a.A[Ck]|=tm,a.A[Wc]&Xc&&(a.A[Ck]|=um,zf(a,vm)),a.X=c+a.xa);a.A[pk]==a.A[qk]&&a.A[rk]==a.A[sk]&&a.A[tk]==a.A[uk]&&(a.A[Ck]|=wm,a.A[Wc]&xm&&(a.A[Ck]|=um,zf(a,vm)));var d=c-a.na,e=Math.floor(d/b);if(e&&!(a.A[Wc]&ym)){for(;e--;)if(60<=++a.A[pk]&&(a.A[pk]=0,60<=++a.A[rk]&&(a.A[rk]=0,24<=++a.A[tk]))){a.A[tk]=0;a.A[vk]=a.A[vk]%
7+1;var f;f=a.A[yk];var g=ra[a.A[xk]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[wk]>f&&(a.A[wk]=1,12<++a.A[xk]&&(a.A[xk]=1,a.A[yk]=(a.A[yk]+1)%100))}a.A[Ck]|=zm;a.A[Wc]&Am&&(a.A[Ck]|=um,zf(a,vm))}a.na=c-d%b}}l.rl=function(){var a=this.ua;this.ga&Fm&&(this.J&Gm?a=this.C[0][1]:this.B&&(a=Hm(this.B)));return a};l.Jm=function(a,b){this.ua=b};l.sl=function(){return this.J};l.Km=function(a,b){Im(this,b)};
function Im(a,b){var c=!!(b&Jm),d=!!(a.J&Jm);a.J=b;a.B&&Km(a.B,!(b&Gm),!!(b&pm));c!=d&&Hk(a,c)}l.tl=function(){var a=0,a=(this.aa|0)==rj?this.J&nm?a|this.C[1][1]&Lm:a|this.C[1][1]>>4&1:this.J&Mm?a|this.C[0][1]>>4:a|this.C[0][1]&15;this.J&mm&&Ql(this,Yl).Lc&&(a=this.J&Jm?a|Nm:a|Om);return a};l.Lm=function(a,b){this.Ba=b};l.ul=function(){return this.ga};l.Mm=function(a,b){this.ga=b};l.Dk=function(){var a=this.B?Hm(this.B):0;this.Z&=~Pm;return a};l.Vl=function(){};l.Ck=function(){return this.J};
l.Ul=function(a,b){Im(this,b)};l.Ek=function(){return this.Z};l.Fk=function(){var a=this.pa;this.F&=~(Pm|Qm);this.B&&Rm(this.B);return a};l.Xl=function(a,b){if(this.F&Sm)switch(this.L){case Tm:Um(this,b);break;case Vm:Wm(this,b);break;default:if(Um(this,this.K&~Qj),this.B){a=this.B;var c=b,d=-1;switch(a.D||c){case Xm:d=Ym;a.Jb=[];Zm(a,$m);break;case an:a.D&&(c=0);Zm(a,Ym);a.D=c;break;case bn:a.D&&(c=0),Zm(a,Ym),a.D=c}cn(this,d)}}this.L=b;this.F&=~Sm};
l.Gk=function(){return this.J&~(dn|en)|(Qc(this.U)&64?en:0)};l.Yl=function(a,b){Im(this,b)};l.Hk=function(){var a=this.F&255;this.F&Qm&&(this.F|=Pm,this.F&=~Qm);return a};
l.Wl=function(a,b){this.L=b;this.F|=Sm;a=0;this.L>=fn&&(a=this.L^15,this.L=fn);switch(this.L){case gn:cn(this,this.K);break;case hn:Um(this,this.K|Qj);break;case jn:Um(this,this.K&~Qj);this.B&&Rm(this.B);break;case kn:this.B&&(this.B.Jb=[]);Um(this,this.K|Qj);cn(this,ln);Wm(this,ak|bk);break;case mn:cn(this,nn);break;case on:cn(this,this.M);break;case pn:cn(this,this.qa);break;case qn:cn(this,this.K&Qj?0:rn);break;case fn:a&1&&de(this.U)}};
function Um(a,b){a.K=b;a.F=a.F&~sn|b&tn;a.B&&Km(a.B,!!(b&un),!(b&Qj))}function cn(a,b,c){0<=b&&(a.pa=b,c?a.F|=Pm:(a.F&=~Pm,a.F|=Qm))}function Wm(a,b){a.qa=b;Gb(a.ma,!!(b&bk));b&ak||de(a.U)}function vn(a,b){a.aa<wf?(zf(a,wn,4),a.Z|=Pm):a.K&Qj||a.F&(Pm|Qm)||(cn(a,b,!0),xn(a.B),zf(a,wn,120))}l.Vk=function(){return this.W};l.lm=function(a,b){this.W=b;this.ba=b&yn?Af:zn};
7+1;var f;f=a.A[yk];var g=ra[a.A[xk]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[wk]>f&&(a.A[wk]=1,12<++a.A[xk]&&(a.A[xk]=1,a.A[yk]=(a.A[yk]+1)%100))}a.A[Ck]|=zm;a.A[Wc]&Am&&(a.A[Ck]|=um,zf(a,vm))}a.na=c-d%b}}l.rl=function(){var a=this.ua;this.ga&Fm&&(this.J&Gm?a=this.C[0][1]:this.B&&(a=Hm(this.B)));return a};l.Lm=function(a,b){this.ua=b};l.sl=function(){return this.J};l.Mm=function(a,b){Im(this,b)};
function Im(a,b){var c=!!(b&Jm),d=!!(a.J&Jm);a.J=b;a.B&&Km(a.B,!(b&Gm),!!(b&pm));c!=d&&Hk(a,c)}l.tl=function(){var a=0,a=(this.aa|0)==rj?this.J&nm?a|this.C[1][1]&Lm:a|this.C[1][1]>>4&1:this.J&Mm?a|this.C[0][1]>>4:a|this.C[0][1]&15;this.J&mm&&Ql(this,Yl).Lc&&(a=this.J&Jm?a|Nm:a|Om);return a};l.Nm=function(a,b){this.Ba=b};l.ul=function(){return this.ga};l.Om=function(a,b){this.ga=b};l.Dk=function(){var a=this.B?Hm(this.B):0;this.Z&=~Pm;return a};l.Xl=function(){};l.Ck=function(){return this.J};
l.Wl=function(a,b){Im(this,b)};l.Ek=function(){return this.Z};l.Fk=function(){var a=this.pa;this.F&=~(Pm|Qm);this.B&&Rm(this.B);return a};l.Zl=function(a,b){if(this.F&Sm)switch(this.L){case Tm:Um(this,b);break;case Vm:Wm(this,b);break;default:if(Um(this,this.K&~Qj),this.B){a=this.B;var c=b,d=-1;switch(a.D||c){case Xm:d=Ym;a.Jb=[];Zm(a,$m);break;case an:a.D&&(c=0);Zm(a,Ym);a.D=c;break;case bn:a.D&&(c=0),Zm(a,Ym),a.D=c}cn(this,d)}}this.L=b;this.F&=~Sm};
l.Gk=function(){return this.J&~(dn|en)|(Qc(this.U)&64?en:0)};l.$l=function(a,b){Im(this,b)};l.Hk=function(){var a=this.F&255;this.F&Qm&&(this.F|=Pm,this.F&=~Qm);return a};
l.Yl=function(a,b){this.L=b;this.F|=Sm;a=0;this.L>=fn&&(a=this.L^15,this.L=fn);switch(this.L){case gn:cn(this,this.K);break;case hn:Um(this,this.K|Qj);break;case jn:Um(this,this.K&~Qj);this.B&&Rm(this.B);break;case kn:this.B&&(this.B.Jb=[]);Um(this,this.K|Qj);cn(this,ln);Wm(this,ak|bk);break;case mn:cn(this,nn);break;case on:cn(this,this.M);break;case pn:cn(this,this.qa);break;case qn:cn(this,this.K&Qj?0:rn);break;case fn:a&1&&de(this.U)}};
function Um(a,b){a.K=b;a.F=a.F&~sn|b&tn;a.B&&Km(a.B,!!(b&un),!(b&Qj))}function cn(a,b,c){0<=b&&(a.pa=b,c?a.F|=Pm:(a.F&=~Pm,a.F|=Qm))}function Wm(a,b){a.qa=b;Gb(a.ma,!!(b&bk));b&ak||de(a.U)}function vn(a,b){a.aa<wf?(zf(a,wn,4),a.Z|=Pm):a.K&Qj||a.F&(Pm|Qm)||(cn(a,b,!0),xn(a.B),zf(a,wn,120))}l.Vk=function(){return this.W};l.nm=function(a,b){this.W=b;this.ba=b&yn?Af:zn};
l.Wk=function(a,b){a=this.W&An;var c;if(a<=Dk)if(c=this.A[a],a<Ak){var d=!1;a!=tk&&a!=uk||this.A[Wc]&Bk||(12>c?c=c?c:12:c=(c-=12)?c+128:140,d=!0);this.A[Wc]&Bn||(d&&128<c&&(c-=48),c=c%10|c/10<<4)}else a==Ak&&(this.A[a]^=Cn);else c=this.A[a];null!=b&&a==Ck&&(this.A[a]&=Dn,c&um&&xf(this,vm),c&tm&&this.A[Wc]&Xc&&Fk(this));return c};
l.mm=function(a,b){a=this.W&An;var c=b^this.A[a],d;if(a<=Dk){if(d=b,a<Ak){var e=!1;this.A[Wc]&Bn||(d=10*(d>>4)+(d&15),e=!0);if(a==tk||a==uk)e&&23<d&&(d+=48),this.A[Wc]&Bk||(12>=d?d=12==d?0:d:(d-=116,d=24==d?12:d))}}else d=b;this.A[a]=d;a==Wc&&c&Xc&&b&Xc&&Fk(this)};l.Gj=function(a,b){this.ba=b};l.wm=function(){};l.xm=function(){this.Ud&&sf(this.Ud)};
l.om=function(a,b){a=this.W&An;var c=b^this.A[a],d;if(a<=Dk){if(d=b,a<Ak){var e=!1;this.A[Wc]&Bn||(d=10*(d>>4)+(d&15),e=!0);if(a==tk||a==uk)e&&23<d&&(d+=48),this.A[Wc]&Bk||(12>=d?d=12==d?0:d:(d-=116,d=24==d?12:d))}}else d=b;this.A[a]=d;a==Wc&&c&Xc&&b&Xc&&Fk(this)};l.Gj=function(a,b){this.ba=b};l.ym=function(){};l.zm=function(){this.Ud&&sf(this.Ud)};
function Hk(a,b){if(a.la)try{void 0!==b?a.Ga=b:b=!!(a.Ga&&a.U&&a.U.ca.Ib);var c=Math.round(vj/Xl(a,Yl));if(20>c||2E4<c)b=!1;b?a.I?a.I.frequency.value=c:(a.I=a.la.createOscillator(),a.I&&(a.I.type="number"==typeof a.I.type?1:"square",a.I.connect(a.la.destination),a.I.frequency.value=c,"start"in a.I?a.I.start(0):a.I.noteOn(0))):a.I&&("stop"in a.I?a.I.stop(0):a.I.noteOff(0),a.I.disconnect(),delete a.I)}catch(d){a.Aa("AudioContext exception: "+d.message),a.la=null}}
var rj=5150,jj=5150.9,wf=5170,sj=5160.101,Ej=5180,ij={5150:rj,5160:5160,5170:wf,att6300:sj,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:jj};ij.deskpro386=Ej;
var lj="sw1",pj="sw2",tj="swdesc",Wj=3,el=1,fl=15,il=3,jl=4,ql=12,ul=0,rl=4,tl=8,wl=16,vl=32,$k=0,Kj=0,Lj=32,Mj=1,Nj=160,Cl=16,Ml=1,Ll=2,Hl=7,El=224,Fl=32,Gl=96,Jl=192,Dl=8,zl=2,Al=3,yl=3,Wl=0,wn=1,Nl=2,vm=8,yf=13,Ul=0,Vl=0,Yl=2,im=1,jm=14,Sl=0,sm=4,Vc=6,Tl=8,km=48,lm=0,qm=32,rm=48,$l=192,am=192,hm=6,cm=2,bm=16,fm=32,dm=64,em=128,vj=1193181,mm=1,Jm=2,nm=4,om=8,Mm=8,pm=64,Gm=128,Lm=15,Om=16,Nm=32,Fm=16,kk={ek:1,ONE:0,Ao:64,yo:128,po:192,fc:192,ag:6},jk=2,ik={zo:16,Mn:32,qo:48,fc:48,ag:4},nj=1,uj=3,
var lj="sw1",pj="sw2",tj="swdesc",Wj=3,el=1,fl=15,il=3,jl=4,ql=12,ul=0,rl=4,tl=8,wl=16,vl=32,$k=0,Kj=0,Lj=32,Mj=1,Nj=160,Cl=16,Ml=1,Ll=2,Hl=7,El=224,Fl=32,Gl=96,Jl=192,Dl=8,zl=2,Al=3,yl=3,Wl=0,wn=1,Nl=2,vm=8,yf=13,Ul=0,Vl=0,Yl=2,im=1,jm=14,Sl=0,sm=4,Vc=6,Tl=8,km=48,lm=0,qm=32,rm=48,$l=192,am=192,hm=6,cm=2,bm=16,fm=32,dm=64,em=128,vj=1193181,mm=1,Jm=2,nm=4,om=8,Mm=8,pm=64,Gm=128,Lm=15,Om=16,Nm=32,Fm=16,kk={ek:1,ONE:0,Co:64,Ao:128,ro:192,fc:192,ag:6},jk=2,ik={Bo:16,On:32,so:48,fc:48,ag:4},nj=1,uj=3,
oj=4,Vk=5,Wk=6,U={};U[rj]=[{},{}];U[rj][0][nj]={fc:192,Ec:{1:0,2:64,3:128,4:192},bd:"Number of Floppy Drives"};U[rj][0][uj]={fc:2,Ec:{0:0,1:2},bd:"FPU"};U[rj][0][oj]={fc:48,Ec:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},bd:"Monitor Type"};U[rj][0][Vk]={fc:12,Ec:{16:0,32:4,48:8,64:12},bd:"Base Memory (16Kb Increments)"};U[rj][1][Wk]={fc:31,Ec:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},bd:"Expansion Memory (32Kb Increments)"};
U[5160]=[{},{}];U[5160][0][nj]=U[rj][0][nj];U[5160][0][uj]=U[rj][0][uj];U[5160][0][oj]=U[rj][0][oj];U[5160][0][Vk]={fc:12,Ec:{64:0,128:4,192:8,256:12},bd:"Base Memory (64Kb Increments)"};U[5160][1][Wk]=U[rj][1][Wk];U[sj]=[{},{}];U[sj][0][Vk]={fc:143,Ec:{128:1,256:130,512:8,640:141},bd:"Base Memory (128Kb Increments)"};U[sj][0][uj]={fc:16,Ec:{0:0,1:16},bd:"FPU"};U[sj][1][2]={fc:1,Ec:{0:0,1:1},bd:"Floppy Type"};U[sj][1][nj]=U[rj][0][nj];U[sj][1][oj]=U[rj][0][oj];
var tn=4,un=8,Qj=16,ln=85,nn=0,Yj=4,Zj=8,Uj=16,Rj=32,Xj=64,Sj=128,ak=1,bk=2,rn=1,en=16,dn=192,gn=32,Tm=96,kn=170,mn=171,hn=173,jn=174,on=192,pn=208,Vm=209,qn=224,fn=240,Pm=1,sn=4,Sm=8,Pj=16,Qm=256,pk=0,qk=1,rk=2,sk=3,tk=4,uk=5,vk=6,wk=7,xk=8,yk=9,Ak=10,Wc=11,Ck=12,Dk=13,gk=14,mk=16,lk=20,ek=21,fk=24,hk=46,Gk=47,zk=50,An=63,ck=64,yn=128,Cn=128,ym=128,Xc=64,xm=32,Am=16,Bn=4,Bk=2,um=128,tm=64,wm=32,zm=16,Dn=15,Ek=128,Uk=0,Qk=1,Sk=2,Rk=3,Tk=4,zn=128,Af=0,Ik=[0,null,null,0,Array(4),0],Kk=[!0,[0,0],[0,
@ -449,9 +449,9 @@ Ul,Vl)},65:function(){return Ol(this,Ul,1)},66:function(){return Ol(this,Ul,Yl)}
133:function(){return this.G[1]},134:function(){return this.G[2]},136:function(){return this.G[3]},137:function(){return ml(this,1,2)},138:function(){return ml(this,1,3)},139:function(){return ml(this,1,1)},140:function(){return this.G[4]},141:function(){return this.G[5]},142:function(){return this.G[6]},143:function(){return ml(this,1,0)},160:function(){return xl(this,Mj)},161:function(){return this.Zb[Mj].Tc},192:function(){return Zk(this,1,0)},194:function(){return bl(this,1,0)},196:function(){return Zk(this,
1,1)},198:function(){return bl(this,1,1)},200:function(){return Zk(this,1,2)},202:function(){return bl(this,1,2)},204:function(){return Zk(this,1,3)},206:function(){return bl(this,1,3)},208:function(){return dl(this,1)},218:function(){return this.D[1].jg}},Aj={96:T.prototype.Dk,97:T.prototype.Ck,100:T.prototype.Ek,102:function(){return this.C[0][1]},103:function(){return this.C[1][1]}},Fj={72:function(){return Ol(this,1,0)},73:function(){return Ol(this,1,1)},74:function(){return Ol(this,1,2)},75:function(){return this.ea}},
xj={0:function(a,b){al(this,0,0,b)},1:function(a,b){cl(this,0,0,b)},2:function(a,b){al(this,0,1,b)},3:function(a,b){cl(this,0,1,b)},4:function(a,b){al(this,0,2,b)},5:function(a,b){cl(this,0,2,b)},6:function(a,b){al(this,0,3,b)},7:function(a,b){cl(this,0,3,b)},8:function(a,b){this.D[0].hg=b},9:function(a,b){gl(this,0,b)},10:function(a,b){hl(this,0,b)},11:function(a,b){this.D[0].Qb[b&3].mode=b},12:function(){this.D[0].Cb=0},13:function(){ll(this,0)},32:function(a,b){Bl(this,Kj,b)},33:function(a,b){Kl(this,
Kj,b)},64:function(a,b){Rl(this,Ul,Vl,b)},65:function(a,b){Rl(this,Ul,1,b)},66:function(a,b){Rl(this,Ul,Yl,b)},67:function(a,b){Zl(this,Ul,b)},129:function(a,b){nl(this,0,2,b)},130:function(a,b){nl(this,0,3,b)},131:function(a,b){nl(this,0,1,b)},135:function(a,b){nl(this,0,0,b)}},zj={96:T.prototype.Jm,97:T.prototype.Km,98:T.prototype.Lm,99:T.prototype.Mm,160:T.prototype.Gj},Dj={96:T.prototype.Xl,97:T.prototype.Yl,100:T.prototype.Wl,112:T.prototype.lm,113:T.prototype.mm,128:function(a,b){this.G[7]=
Kj,b)},64:function(a,b){Rl(this,Ul,Vl,b)},65:function(a,b){Rl(this,Ul,1,b)},66:function(a,b){Rl(this,Ul,Yl,b)},67:function(a,b){Zl(this,Ul,b)},129:function(a,b){nl(this,0,2,b)},130:function(a,b){nl(this,0,3,b)},131:function(a,b){nl(this,0,1,b)},135:function(a,b){nl(this,0,0,b)}},zj={96:T.prototype.Lm,97:T.prototype.Mm,98:T.prototype.Nm,99:T.prototype.Om,160:T.prototype.Gj},Dj={96:T.prototype.Zl,97:T.prototype.$l,100:T.prototype.Yl,112:T.prototype.nm,113:T.prototype.om,128:function(a,b){this.G[7]=
b},132:function(a,b){this.G[0]=b},133:function(a,b){this.G[1]=b},134:function(a,b){this.G[2]=b},136:function(a,b){this.G[3]=b},137:function(a,b){nl(this,1,2,b)},138:function(a,b){nl(this,1,3,b)},139:function(a,b){nl(this,1,1,b)},140:function(a,b){this.G[4]=b},141:function(a,b){this.G[5]=b},142:function(a,b){this.G[6]=b},143:function(a,b){nl(this,1,0,b)},160:function(a,b){Bl(this,Mj,b)},161:function(a,b){Kl(this,Mj,b)},192:function(a,b){al(this,1,0,b)},194:function(a,b){cl(this,1,0,b)},196:function(a,
b){al(this,1,1,b)},198:function(a,b){cl(this,1,1,b)},200:function(a,b){al(this,1,2,b)},202:function(a,b){cl(this,1,2,b)},204:function(a,b){al(this,1,3,b)},206:function(a,b){cl(this,1,3,b)},208:function(a,b){this.D[1].hg=b},210:function(a,b){gl(this,1,b)},212:function(a,b){hl(this,1,b)},214:function(a,b){this.D[1].Qb[b&3].mode=b},216:function(){this.D[1].Cb=0},218:function(){ll(this,1)},240:T.prototype.wm,241:T.prototype.xm},Bj={96:T.prototype.Vl,97:T.prototype.Ul,160:T.prototype.Gj},Gj={72:function(a,
b){al(this,1,1,b)},198:function(a,b){cl(this,1,1,b)},200:function(a,b){al(this,1,2,b)},202:function(a,b){cl(this,1,2,b)},204:function(a,b){al(this,1,3,b)},206:function(a,b){cl(this,1,3,b)},208:function(a,b){this.D[1].hg=b},210:function(a,b){gl(this,1,b)},212:function(a,b){hl(this,1,b)},214:function(a,b){this.D[1].Qb[b&3].mode=b},216:function(){this.D[1].Cb=0},218:function(){ll(this,1)},240:T.prototype.ym,241:T.prototype.zm},Bj={96:T.prototype.Xl,97:T.prototype.Wl,160:T.prototype.Gj},Gj={72:function(a,
b){Rl(this,1,0,b)},73:function(a,b){Rl(this,1,1,b)},74:function(a,b){Rl(this,1,2,b)},75:function(a,b){Zl(this,1,b)}};Ea(function(){for(var a=Wa(document,"pcx86","chipset"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new T(d);Va(d,c);Yk(d)}});
function En(a){t.call(this,"ROM",a);this.A=null;this.F=a.addr;this.C=a.size;this.D=a.alias;this.G=a.file;this.B=a.notify;this.I=null;if(this.B&&(a=this.B.indexOf("["),0<a)){try{this.I=eval(this.B.substr(a))}catch(d){}this.B=this.B.substr(0,a)}if(this.G){a=this.G;var b=ia(ha(a));"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var c=this;ta(a,null,!0,function(a,b,f){Fn(c,a,b,f)})}}ba(En,t);En.prototype.hc=function(a,b,c,d){this.ma=b;this.U=c;this.Ea=d;Gn(this)};
En.prototype.Ob=function(){this.H&&(this.Ea&&this.Ea.A(this.id,0,this.F>>>4,0,this.F,this.C,this.H),delete this.H);return!0};En.prototype.Nb=function(){return!0};
@ -480,13 +480,13 @@ vn(e.V,f)):e.Jb.length==No&&e.Jb.push(Oo));d=!0}return d}var lo=["US83","US84","
var fo={TAB:1009,ESC:1027,F1:1112,F2:1113,F3:1114,F4:1115,F5:1116,F6:1117,F7:1118,F8:1119,F9:1120,F10:1121,LEFT:1037,UP:1038,RIGHT:1039,DOWN:1040,SYSREQ:4027,CTRL_C:Po,CTRL_BREAK:Ao,CTRL_ALT_DEL:4046,CTRL_ALT_INS:4045,CTRL_ALT_ENTER:4013},ho={esc:1027,1:n["1"],2:n["2"],3:n["3"],4:n["4"],5:n["5"],6:n["6"],7:n["7"],8:n["8"],9:n["9"],0:n["0"],"-":n["-"],"=":n["="],bs:1008,tab:1009,q:n.Q,w:n.Qh,e:n.E,r:n.Lh,t:n.Nh,y:n.Sh,u:n.Oh,i:n.Dh,o:n.Jh,p:n.Kh,"[":n["["],"]":n["]"],enter:13,ctrl:1017,a:n.Bd,s:n.Mh,
d:n.zh,f:n.Ah,g:n.Bh,h:n.Ch,j:n.Eh,k:n.Fh,l:n.Gh,";":n[";"],quote:n["'"],"`":n["`"],shift:1016,"\\":n["\\"],z:n.sf,x:n.Rh,c:n.xh,v:n.Ph,b:n.wh,n:n.Ih,m:n.Hh,",":n[","],".":n["."],"/":n["/"],"right-shift":3016,prtsc:1044,alt:1018,space:1032,"caps-lock":bo,f1:1112,f2:1113,f3:1114,f4:1115,f5:1116,f6:1117,f7:1118,f8:1119,f9:1120,f10:1121,"num-lock":co,"scroll-lock":eo,"num-home":1036,"num-up":1038,"num-pgup":1033,"num-sub":1109,"num-left":1037,"num-center":1101,"num-right":1039,"num-add":1107,"num-end":1035,
"num-down":1040,"num-pgdn":1034,"num-ins":1045,"num-del":1046,sysreq:84},ro={"caps-lock":xo,"num-lock":1024,"scroll-lock":2048},V={1027:1};V[n["1"]]=2;V[n["!"]]=2|W<<8;V[n["2"]]=3;V[n["@"]]=3|W<<8;V[n["3"]]=4;V[n["#"]]=4|W<<8;V[n["4"]]=5;V[n.$]=5|W<<8;V[n["5"]]=6;V[n["%"]]=6|W<<8;V[n["6"]]=7;V[n["^"]]=7|W<<8;V[n["7"]]=8;V[n["&"]]=8|W<<8;V[n["8"]]=9;V[n["*"]]=9|W<<8;V[n["9"]]=10;V[n["("]]=10|W<<8;V[n["0"]]=11;V[n[")"]]=11|W<<8;V[n["-"]]=12;V[n._]=12|W<<8;V[n["="]]=13;V[n["+"]]=13|W<<8;V[1008]=Eo;
V[1009]=15;V[n.q]=16;V[n.Q]=16|W<<8;V[n.sn]=17;V[n.Qh]=17|W<<8;V[n.e]=18;V[n.E]=18|W<<8;V[n.r]=19;V[n.Lh]=19|W<<8;V[n.t]=20;V[n.Nh]=20|W<<8;V[n.y]=21;V[n.Sh]=21|W<<8;V[n.qn]=22;V[n.Oh]=22|W<<8;V[n.yk]=23;V[n.Dh]=23|W<<8;V[n.Tl]=24;V[n.Jh]=24|W<<8;V[n.p]=25;V[n.Kh]=25|W<<8;V[n["["]]=26;V[n["{"]]=26|W<<8;V[n["]"]]=27;V[n["}"]]=27|W<<8;V[13]=28;V[1017]=Jo;V[n.Cd]=30;V[n.Bd]=30|W<<8;V[n.nn]=31;V[n.Mh]=31|W<<8;V[n.d]=32;V[n.zh]=32|W<<8;V[n.vk]=33;V[n.Ah]=33|W<<8;V[n.wk]=34;V[n.Bh]=34|W<<8;V[n.xk]=35;
V[n.Ch]=35|W<<8;V[n.Jl]=36;V[n.Eh]=36|W<<8;V[n.k]=37;V[n.Fh]=37|W<<8;V[n.Ll]=38;V[n.Gh]=38|W<<8;V[n[";"]]=39;V[n[":"]]=39|W<<8;V[n["'"]]=40;V[n['"']]=40|W<<8;V[n["`"]]=41;V[n["~"]]=41|W<<8;V[1016]=W;V[n["\\"]]=43;V[n["|"]]=43|W<<8;V[n.z]=44;V[n.sf]=44|W<<8;V[n.x]=45;V[n.Rh]=45|W<<8;V[n.kk]=46;V[n.xh]=46|W<<8;V[n.rn]=47;V[n.Ph]=47|W<<8;V[n.jk]=48;V[n.wh]=48|W<<8;V[n.n]=49;V[n.Ih]=49|W<<8;V[n.Ol]=50;V[n.Hh]=50|W<<8;V[n[","]]=51;V[n["<"]]=51|W<<8;V[n["."]]=52;V[n[">"]]=52|W<<8;V[n["/"]]=53;
V[1009]=15;V[n.q]=16;V[n.Q]=16|W<<8;V[n.un]=17;V[n.Qh]=17|W<<8;V[n.e]=18;V[n.E]=18|W<<8;V[n.r]=19;V[n.Lh]=19|W<<8;V[n.t]=20;V[n.Nh]=20|W<<8;V[n.y]=21;V[n.Sh]=21|W<<8;V[n.sn]=22;V[n.Oh]=22|W<<8;V[n.yk]=23;V[n.Dh]=23|W<<8;V[n.Vl]=24;V[n.Jh]=24|W<<8;V[n.p]=25;V[n.Kh]=25|W<<8;V[n["["]]=26;V[n["{"]]=26|W<<8;V[n["]"]]=27;V[n["}"]]=27|W<<8;V[13]=28;V[1017]=Jo;V[n.Cd]=30;V[n.Bd]=30|W<<8;V[n.pn]=31;V[n.Mh]=31|W<<8;V[n.d]=32;V[n.zh]=32|W<<8;V[n.vk]=33;V[n.Ah]=33|W<<8;V[n.wk]=34;V[n.Bh]=34|W<<8;V[n.xk]=35;
V[n.Ch]=35|W<<8;V[n.Jl]=36;V[n.Eh]=36|W<<8;V[n.k]=37;V[n.Fh]=37|W<<8;V[n.Ll]=38;V[n.Gh]=38|W<<8;V[n[";"]]=39;V[n[":"]]=39|W<<8;V[n["'"]]=40;V[n['"']]=40|W<<8;V[n["`"]]=41;V[n["~"]]=41|W<<8;V[1016]=W;V[n["\\"]]=43;V[n["|"]]=43|W<<8;V[n.z]=44;V[n.sf]=44|W<<8;V[n.x]=45;V[n.Rh]=45|W<<8;V[n.kk]=46;V[n.xh]=46|W<<8;V[n.tn]=47;V[n.Ph]=47|W<<8;V[n.jk]=48;V[n.wh]=48|W<<8;V[n.n]=49;V[n.Ih]=49|W<<8;V[n.Pl]=50;V[n.Hh]=50|W<<8;V[n[","]]=51;V[n["<"]]=51|W<<8;V[n["."]]=52;V[n[">"]]=52|W<<8;V[n["/"]]=53;
V[n["?"]]=53|W<<8;V[3016]=54;V[1044]=55;V[1018]=Lo;V[1032]=57;V[bo]=58;V[1112]=59;V[1113]=60;V[1114]=61;V[1115]=62;V[1116]=63;V[1117]=64;V[1118]=65;V[1119]=66;V[1120]=67;V[1121]=68;V[co]=69;V[eo]=70;V[1036]=71;V[1038]=72;V[1033]=73;V[1109]=74;V[1037]=75;V[1101]=76;V[1039]=77;V[1107]=78;V[1035]=79;V[1040]=80;V[1034]=81;V[1045]=82;V[1046]=Fo;V[4027]=84;V[1122]=87;V[1123]=88;V[1091]=91;V[1093]=93;V[1224]=91;V[Po]=46|Jo<<8;V[Ao]=70|Jo<<8;V[4046]=Fo|Jo<<8|Lo<<16;V[4045]=82|Jo<<8|Lo<<16;
V[4013]=28|Jo<<8|Lo<<16;var Xm=255,an=243,bn=237,$m=170,Ym=250,Oo=255,No=20;Ea(function(){for(var a=Wa(document,"pcx86","keyboard"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new Xn(d);Va(d,c)}});
function Qo(a,b,c,d){if(void 0!==b&&(!c||c.length)){this.video=a;var e=Ro[b],f=a.ea||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(b<Hn?So:To)];this.Ma=b;this.Ya=e[2];this.Ab=e[3];this.Uc=d||e[4];65536<=this.Uc&&720896<=this.Ya&&(this.Ab=Math.min(this.Uc>>2,32768));this.Ub=c[0];this.Cc=c[1];this.df=c[2];this.Y=c[3];this.ec=c[4]&255;this.Uf=c[4]>>8&255;this.Qa=c[5];this.tg=So;if(b>=Hn){this.tg=To;(b=c[6])||(b=[!1,0,Array(Uo),0,f==Wj?0:Vo,0,0,Array(Wo),0,0,0,Array(Xo),0,[this.Ya,this.Ab,this.Uc],
Array(this.Uc>>2),Yo|Zo|$o|ap|bp,0,-1,0,-1,0,-1,0,0,0,0,cp,dp,0,0,ep,Array(fp)]);this.He=b[0];this.Nd=b[1];this.rc=b[2];this.nh=b[3];this.ef=b[4];this.Xf=b[5];this.Qd=b[6];this.Pd=b[7];this.Oj=b[8];this.Pj=b[9];this.Od=b[10];this.jd=b[11];this.mb=b[12];d=b[13];"number"==typeof d&&(d=[this.Ya,this.Ab,d]);this.Ya=d[0];this.Ab=d[1];d=this.Uc>>2;if((this.pd=b[14])&&this.pd.length<d){for(var e=this.pd,g=0,h=Array(d),k=0;k<e.length-1;){for(var m=e[k++],q=e[k++];m--;)h[g]=q,g+=2;g==d&&(g=1)}this.pd=h}(d=
b[15])&&(d&bp?d&=~bp:d=gp[d&65280]|gp[d&255]);this.Zf(d);this.jh=b[16];this.Ua=b[17];this.zc=b[18];this.pb=b[19];this.Xe=b[20];this.hd=b[21];this.yd=b[22];this.ug=b[23];this.vg=b[24];this.Zc=b[25];this.kh=this.te=0;this.Ma==Jn&&(this.oh=b[26],this.Vf=b[27],this.$c=b[28],this.sc=b[29],this.Wf=b[30],this.ve=b[31])}f=hp[f]||hp[Wj];this.wg=a.U.R.Wc/f.Nf|0;this.Ql=this.wg*f.Sf/100|0;this.zg=this.wg*f.Mf|0;this.Sl=this.zg*f.Tf/100|0;this.Ag=c[7]||0}}
b[15])&&(d&bp?d&=~bp:d=gp[d&65280]|gp[d&255]);this.Zf(d);this.jh=b[16];this.Ua=b[17];this.zc=b[18];this.pb=b[19];this.Xe=b[20];this.hd=b[21];this.yd=b[22];this.ug=b[23];this.vg=b[24];this.Zc=b[25];this.kh=this.te=0;this.Ma==Jn&&(this.oh=b[26],this.Vf=b[27],this.$c=b[28],this.sc=b[29],this.Wf=b[30],this.ve=b[31])}f=hp[f]||hp[Wj];this.wg=a.U.R.Wc/f.Nf|0;this.Sl=this.wg*f.Sf/100|0;this.zg=this.wg*f.Mf|0;this.Ul=this.zg*f.Tf/100|0;this.Ag=c[7]||0}}
function ip(a){var b=[];if(void 0!==a.Ma){b[0]=a.Ub;b[1]=a.Cc;b[2]=a.df;b[3]=a.Y;b[4]=a.ec|a.Uf<<8;b[5]=a.Qa;if(a.Ma>=Hn){var c=[];c[0]=a.He;c[1]=a.Nd;c[2]=a.rc;c[3]=a.nh;c[4]=a.ef;c[5]=a.Xf;c[6]=a.Qd;c[7]=a.Pd;c[8]=a.Oj;c[9]=a.Pj;c[10]=a.Od;c[11]=a.jd;c[12]=a.mb;c[13]=[a.Ya,a.Ab,a.Uc];var d;if(d=a.pd){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var k=d[h],m=h+2;m<d.length&&d[m]===k;)m+=2;f[e++]=m-h>>1;f[e++]=k;h=m}f.length<d.length&&(d=f)}c[14]=d;c[15]=a.sg|bp;
c[16]=a.jh;c[17]=a.Ua;c[18]=a.zc;c[19]=a.pb;c[20]=a.Xe;c[21]=a.hd;c[22]=a.yd;c[23]=a.ug;c[24]=a.vg;c[25]=a.Zc;a.Ma==Jn&&(c[26]=a.oh,c[27]=a.Vf,c[28]=a.$c,c[29]=a.sc,c[30]=a.Wf,c[31]=a.ve);b[6]=c}b[7]=a.Ag}return b}Qo.prototype.si=function(a){return[this.pd,a-this.Ya]};Qo.prototype.pg=function(){return this.A};Qo.prototype.Zf=function(a){if(null!=a&&a!=this.sg){var b=a&jp,c=kp[b];c||b&Zo&&(c=kp[Zo]);var b=a&lp,d=kp[b];d||b&ap&&(d=kp[ap]);this.A||(this.A=Array(6));this.A[0]=c;this.A[1]=d;this.sg=a}};
function mp(a,b){var c=a.Qa[b];if(null!=c&&a.Ma>=Hn){var d=0,e=0,f=0;switch(b){case np:d=op;a.Ma==Jn&&(e=pp);break;case qp:a.Ma==Hn&&(d=rp);break;case sp:d=tp;a.Ma==Jn&&(e=up);break;case vp:d=wp;a.Ma==Jn&&(e=xp);break;case yp:d=zp;a.Ma==Jn&&(f=Ap);break;case Bp:d=Cp,a.Ma==Jn&&(f=Dp)}d&&(c|=a.Qa[Ep]&d?256:0,c|=a.Qa[Ep]&e?512:0,c|=a.Qa[Fp]&f?512:0)}return c}
@ -537,28 +537,28 @@ function Zp(a,b){if(a.ca.Pb){var c=!1,d=a.C;d&&(d!==a.A?d.Cc&8&&(c=!0):d.Nd&32&&
q,f++),c+=2,d++;a.la=!0;f&&a.Ba&&a.J.drawImage(a.za,0,0,a.$a,a.ab,a.ic,a.jc,a.Kb,a.Tb);Bq(a)}}else if(a.Db){var g=k,w,k=c,d=a.ua=0,f=a.xb,e=16==f?65536:196608,h=16==f?1:2;b=pq(a,h);for(var q=m=0,y=a.F,z=0,B=a.H,S=0;k<g;){w=$b(a.ma,k);if(a.la&&w===a.L[d])m+=f;else{a.L[d]=w;w=w>>8|(w&255)<<8;var X=e,ca=16;m<y&&(y=m);for(var $a=0;$a<f;$a++){var zb=(w&(X>>=h))>>(ca-=h);Aq(a.Ha,m++,q,b[zb])}m>z&&(z=m);q<B&&(B=q);q>=S&&(S=q+1)}k+=2;d++;if(m>=a.F){m=0;q+=2;if(q>a.H)break;q==a.H&&(q=1,k=c+a.Db)}}a.la=!0;
y<a.F&&(a.Ba.putImageData(a.Ha,0,0,y,B,z-y,S-B),a.J.drawImage(a.za,0,0,a.F,a.H,0,0,a.X,a.ja))}else if(a.yc){g=h;f=a.ua=0;e=pq(a,8);h=a.C.pd;m=b=0;q=a.F;y=0;z=a.H;B=0;S=a.C.Pd[4]&8?4:1;w=a.C.rc[19]&15;for(X=a.Ka>a.F?a.Ka-a.F-w>>3:0;c<k;){d=h[c-g];$a=4;w||(a.la&&d===a.L[f]?(b+=$a,$a=0):a.L[f]=d,f++);if($a){b<q&&(q=b);for(ca=0;ca<$a;ca++)Aq(a.Ha,b++,m,e[d&255]),d>>=8;b>y&&(y=b);m<z&&(z=m);m>=B&&(B=m+1)}c+=S;if(b>=a.F){b=0;if(++m>a.H)break;c+=X}}w||(a.la=!0);q<a.F&&(a.Ba.putImageData(a.Ha,0,0,q,z,y-q,
B-z),a.J.drawImage(a.za,0,0,a.F,a.H,0,0,a.X,a.ja))}else{g=h;d=a.ua=0;f=pq(a);e=a.C.pd;b=h=0;m=a.F;q=0;y=a.H;z=0;B=a.C.rc[19]&15;for(S=a.Ka>a.F?a.Ka-a.F-B>>3:0;c<k;){w=c++-g;w=e[w];ca=8;B?h?(X=a.F-h,ca>X&&(ca=X)):(w<<=B,ca-=B,a.la=!1):(a.la&&w===a.L[d]?(h+=ca,ca=0):a.L[d]=w,d++);if(ca){h<m&&(m=h);for(X=0;X<ca;X++)$a=Zq[w&2155905152]||0,Aq(a.Ha,h++,b,f[$a]),w<<=1;h>q&&(q=h);b<y&&(y=b);b>=z&&(z=b+1)}if(h>=a.F){h=0;if(++b>a.H)break;c+=S}}B||(a.la=!0);m<a.F&&(a.Ba.putImageData(a.Ha,0,0,m,y,q-m,z-y),a.J.drawImage(a.za,
0,0,a.F,a.H,0,0,a.X,a.ja))}}}}function Yq(a,b){var c=0;a=Qc(a.U)-b.Ag;0>a&&(b.Ag=a,a=-a|0);a%b.wg>b.Ql&&(c|=1);a%b.zg>b.Sl&&(c|=9);b.kh=a/b.zg|0;return c}l.nl=function(){var a=this.W,b;a.Ub&&(b=a.ec);return b};l.Gm=function(a,b){a=this.W;a.Uf=a.ec;a.ec=b&31};l.ml=function(){return $q(this.W)};l.Fm=function(a,b){ar(this,this.W,b)};l.ol=function(){return this.W.Cc};l.Hm=function(a,b){this.W.Cc=b;nq(this,!1)};l.pl=function(){return br(this,this.W)};l.Fj=function(a,b){this.A.Xf=this.A.Xf&-4|b&3};
0,0,a.F,a.H,0,0,a.X,a.ja))}}}}function Yq(a,b){var c=0;a=Qc(a.U)-b.Ag;0>a&&(b.Ag=a,a=-a|0);a%b.wg>b.Sl&&(c|=1);a%b.zg>b.Ul&&(c|=9);b.kh=a/b.zg|0;return c}l.nl=function(){var a=this.W,b;a.Ub&&(b=a.ec);return b};l.Im=function(a,b){a=this.W;a.Uf=a.ec;a.ec=b&31};l.ml=function(){return $q(this.W)};l.Hm=function(a,b){ar(this,this.W,b)};l.ol=function(){return this.W.Cc};l.Jm=function(a,b){this.W.Cc=b;nq(this,!1)};l.pl=function(){return br(this,this.W)};l.Fj=function(a,b){this.A.Xf=this.A.Xf&-4|b&3};
l.Mk=function(){return this.A.Nd};l.hk=function(){return this.A.rc[this.A.Nd&31]};l.Ej=function(a,b){a=this.A;var c=a.Nd&32;if(a.He){a.He=!1;var d=a.Nd&31;if(16<=d||!c)if(cr||a.rc[d]!==b)a.rc[d]=b,Vq(this,!1)}else a.Nd=b,a.He=!0,b&32&&!c&&fq(this,!0)&&Zp(this,!0),b=(a.Qa[12]<<8)+a.Qa[13]|0,a.Zc!=b&&(a.Zc=b,Vq(this)),a.te=0};
l.zl=function(){var a=0;if(this.Ma==Hn)a=3-((this.A.ef&12)>>2),a=(this.qb&1<<a)<<4-a;else{var b=this.A.ve[0];45!=(b&63)&&2880!=(b&4032)&&184320!=(b&258048)&&(a|=16)}a|=this.A.nh&-17;return this.A.nh=a};l.Im=function(a,b){this.A.ef=b;eq(this)};l.Al=function(){return this.A.oh};l.Qm=function(a,b){this.A.oh=b};l.xl=function(){return this.A.Qd};l.Om=function(a,b){this.A.Qd=b};l.wl=function(){return this.A.Pd[this.A.Qd]};
l.Nm=function(a,b){if(cr||this.A.Pd[this.A.Qd]!==b)this.A.Pd[this.A.Qd]=b;switch(this.A.Qd){case 2:this.A.Ua=Gp[b&15];break;case 4:Gq(this,Fq(this))&&Zp(this,!0)}};l.Zk=function(){return this.A.Vf};l.pm=function(a,b){if(cr||this.A.Vf!==b)this.A.Vf=b};l.$k=function(){return this.A.Wf};l.qm=function(a,b){this.A.$c=b;this.A.Wf=3;this.A.sc=0};l.rm=function(a,b){this.A.$c=b;this.A.Wf=ep;this.A.sc=0};
l.Yk=function(){var a=this.A.ve[this.A.$c]>>this.A.sc&63;this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1);return a};l.om=function(a,b){a=this.A.ve[this.A.$c];b=a&~(63<<this.A.sc)|(b&63)<<this.A.sc;a!==b&&(this.A.ve[this.A.$c]=b,Vq(this,!1));this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1)};l.Bl=function(){return this.A.Xf};l.Bm=function(a,b){this.A.Pj=b};l.Cl=function(){return this.A.ef};l.Am=function(a,b){this.A.Oj=b};l.gl=function(){return this.A.Od};
l.zm=function(a,b){this.A.Od=b};l.fl=function(){return this.A.jd[this.A.Od]};
l.ym=function(a,b){if(cr||this.A.jd[this.A.Od]!==b)this.A.jd[this.A.Od]=b;switch(this.A.Od){case 0:this.A.Xe=Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 1:this.A.hd=~Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 2:this.A.ug=Gp[b&15]&-2139062144;break;case 3:case 5:Gq(this,Fq(this));break;case 4:this.A.jh=(b&3)<<3;break;case 6:nq(this,!1);break;case 7:this.A.vg=Gp[b&15]&-2139062144;break;case 8:this.A.pb=b|b<<8|b<<16|b<<24}};l.Sk=function(){var a=this.I,b;a.Ub&&(b=a.ec);return b};
l.jm=function(a,b){a=this.I;a.Uf=a.ec;a.ec=b&31};l.Rk=function(){return $q(this.I)};l.im=function(a,b){ar(this,this.I,b)};l.Tk=function(){return this.I.Cc};l.km=function(a,b){this.I.Cc=b;nq(this,!1)};l.Qk=function(){return this.I.df};l.hm=function(a,b){this.I.df!==b&&(this.I.df=b,Vq(this,!1))};l.Uk=function(){return br(this,this.I)};function $q(a){var b;a.Ub&&a.ec<a.tg&&(b=a.Qa[a.ec]);return b}
l.zl=function(){var a=0;if(this.Ma==Hn)a=3-((this.A.ef&12)>>2),a=(this.qb&1<<a)<<4-a;else{var b=this.A.ve[0];45!=(b&63)&&2880!=(b&4032)&&184320!=(b&258048)&&(a|=16)}a|=this.A.nh&-17;return this.A.nh=a};l.Km=function(a,b){this.A.ef=b;eq(this)};l.Al=function(){return this.A.oh};l.Sm=function(a,b){this.A.oh=b};l.xl=function(){return this.A.Qd};l.Qm=function(a,b){this.A.Qd=b};l.wl=function(){return this.A.Pd[this.A.Qd]};
l.Pm=function(a,b){if(cr||this.A.Pd[this.A.Qd]!==b)this.A.Pd[this.A.Qd]=b;switch(this.A.Qd){case 2:this.A.Ua=Gp[b&15];break;case 4:Gq(this,Fq(this))&&Zp(this,!0)}};l.Zk=function(){return this.A.Vf};l.rm=function(a,b){if(cr||this.A.Vf!==b)this.A.Vf=b};l.$k=function(){return this.A.Wf};l.sm=function(a,b){this.A.$c=b;this.A.Wf=3;this.A.sc=0};l.tm=function(a,b){this.A.$c=b;this.A.Wf=ep;this.A.sc=0};
l.Yk=function(){var a=this.A.ve[this.A.$c]>>this.A.sc&63;this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1);return a};l.qm=function(a,b){a=this.A.ve[this.A.$c];b=a&~(63<<this.A.sc)|(b&63)<<this.A.sc;a!==b&&(this.A.ve[this.A.$c]=b,Vq(this,!1));this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1)};l.Bl=function(){return this.A.Xf};l.Dm=function(a,b){this.A.Pj=b};l.Cl=function(){return this.A.ef};l.Cm=function(a,b){this.A.Oj=b};l.gl=function(){return this.A.Od};
l.Bm=function(a,b){this.A.Od=b};l.fl=function(){return this.A.jd[this.A.Od]};
l.Am=function(a,b){if(cr||this.A.jd[this.A.Od]!==b)this.A.jd[this.A.Od]=b;switch(this.A.Od){case 0:this.A.Xe=Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 1:this.A.hd=~Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 2:this.A.ug=Gp[b&15]&-2139062144;break;case 3:case 5:Gq(this,Fq(this));break;case 4:this.A.jh=(b&3)<<3;break;case 6:nq(this,!1);break;case 7:this.A.vg=Gp[b&15]&-2139062144;break;case 8:this.A.pb=b|b<<8|b<<16|b<<24}};l.Sk=function(){var a=this.I,b;a.Ub&&(b=a.ec);return b};
l.lm=function(a,b){a=this.I;a.Uf=a.ec;a.ec=b&31};l.Rk=function(){return $q(this.I)};l.km=function(a,b){ar(this,this.I,b)};l.Tk=function(){return this.I.Cc};l.mm=function(a,b){this.I.Cc=b;nq(this,!1)};l.Qk=function(){return this.I.df};l.jm=function(a,b){this.I.df!==b&&(this.I.df=b,Vq(this,!1))};l.Uk=function(){return br(this,this.I)};function $q(a){var b;a.Ub&&a.ec<a.tg&&(b=a.Qa[a.ec]);return b}
function ar(a,b,c){if(b.ec<b.tg){if(cr||b.Qa[b.ec]!==c)b.Qa[b.ec]=c;if(12==b.ec||13==b.ec)if(Yq(a,b)&1){var d=(b.Qa[12]<<8)+b.Qa[13]|0;b.Zc!==d&&(b.Zc=d,Vq(a))}else b.te||(b.te=b.kh);(9==b.ec&&8!=b.Uf||b.ec==vp&&223==c)&&nq(a,!0);oq(a)}}function br(a,b){var c=Yq(a,b);b===a.A?(c|=b.Y&48^48,b.He=!1):c=(b.Y^=9)|240;return b.Y=c}
var cr=!0,Uq=1,Kq=2,bq=3,Tq=5,Sq=6,dq=7,Oq=13,Pq=14,Iq=15,Jq=16,Qq=17,Rq=18,Lq=19,Mq=20,Nq=21,Hq=255,wq=1,vq=3,Pp=wq,Mp=vq,Hn=5,Jn=7,Hp={mda:[Pp,dq],cga:[Mp,bq],ega:[Hn,bq],vga:[Jn,bq]},hp={2:{Nf:15700,Mf:208,Sf:85,Tf:96}};hp[Wj]={Nf:18432,Mf:364,Sf:85,Tf:96};hp[4]={Nf:21850,Mf:364,Sf:85,Tf:96};hp[7]={Nf:16700,Mf:480,Sf:85,Tf:83};var cq={6:[1,Wj,!0],7:[2,Wj,!0],8:[6,Wj,!0],9:[4,Wj,!0],10:[Wj,1,!0],11:[Wj,2,!0],0:[1,Wj,!1],1:[2,Wj,!1],2:[6,Wj,!1],3:[4,Wj,!1],4:[Wj,1,!1],5:[Wj,2,!1]},Ip=[];
Ip[Uq]=[40,25,1,0,vq];Ip[bq]=[80,25,1,0,vq];Ip[4]=[320,200,8,192];Ip[Sq]=[640,200,16,192];Ip[dq]=[80,25,1,0,wq];Ip[Oq]=[320,200,8];Ip[Pq]=[640,200,8];Ip[Iq]=[640,350,8];Ip[Jq]=[640,350,8];Ip[Qq]=[640,480,8];Ip[Rq]=[640,480,8];Ip[Lq]=[320,200,1];Ip[Mq]=[320,240,4];Ip[Nq]=[320,400,4];Ip[0]=Ip[Uq];Ip[Kq]=Ip[bq];Ip[Tq]=Ip[4];
var kq=0,iq=7,mq=8,jq=0,lq=112,hq=128,Xq=256,Dq=512,xq=[[0,0,0,255],[127,192,127,255],[127,192,127,255],[127,255,127,255],[127,255,127,255]],yq=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],qq=[[0,0,0,255],[0,0,170,255],[0,170,0,255],[0,170,170,255],[170,0,0,255],[170,0,170,255],[170,85,0,255],[170,170,170,255],[85,85,85,255],[85,85,255,255],[85,255,85,255],[85,255,255,255],[255,85,85,255],[255,85,255,255],[255,255,85,255],[255,255,255,255]],sq=[2,4,6],rq=[3,5,iq],tq=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],
Gp=[0,255,65280,65535,16711680,16711935,16776960,16777215,-16777216,-16776961,-16711936,-16711681,-65536,-65281,-256,-1],Zq=[0];Zq[128]=1;Zq[32768]=2;Zq[32896]=3;Zq[8388608]=4;Zq[8388736]=5;Zq[8421376]=6;Zq[8421504]=7;Zq[-2147483648]=8;Zq[-2147483520]=9;Zq[-2147450880]=10;Zq[-2147450752]=11;Zq[-2139095040]=12;Zq[-2139094912]=13;Zq[-2139062272]=14;Zq[-2139062144]=15;var Ro=[];Ro[Pp]=["MDA",948,720896,4096,0,Wj];Ro[Mp]=["CGA",980,753664,16384,0,2];Ro[Hn]=["EGA",980,753664,16384,65536,4];
Ro[Jn]=["VGA",980,753664,16384,262144,7];
var Jp=0,Yp=1,Xp=2,Np={948:Y.prototype.nl,949:Y.prototype.ml,952:Y.prototype.ol,954:Y.prototype.pl},Op={948:Y.prototype.Gm,949:Y.prototype.Fm,952:Y.prototype.Hm},Qp={980:Y.prototype.Sk,981:Y.prototype.Rk,984:Y.prototype.Tk,985:Y.prototype.Qk,986:Y.prototype.Uk},Rp={980:Y.prototype.jm,981:Y.prototype.im,984:Y.prototype.km,985:Y.prototype.hm},Sp={960:Y.prototype.Mk,961:Y.prototype.hk,962:Y.prototype.zl,964:Y.prototype.xl,965:Y.prototype.wl,974:Y.prototype.gl,975:Y.prototype.fl},Tp={954:Y.prototype.Fj,
960:Y.prototype.Ej,961:Y.prototype.Ej,962:Y.prototype.Im,964:Y.prototype.Om,965:Y.prototype.Nm,970:Y.prototype.Bm,972:Y.prototype.Am,974:Y.prototype.zm,975:Y.prototype.ym,986:Y.prototype.Fj},Up={963:Y.prototype.Al,966:Y.prototype.Zk,967:Y.prototype.$k,969:Y.prototype.Yk,970:Y.prototype.Bl,972:Y.prototype.Cl},Vp={963:Y.prototype.Qm,966:Y.prototype.pm,967:Y.prototype.qm,968:Y.prototype.rm,969:Y.prototype.om};
var Jp=0,Yp=1,Xp=2,Np={948:Y.prototype.nl,949:Y.prototype.ml,952:Y.prototype.ol,954:Y.prototype.pl},Op={948:Y.prototype.Im,949:Y.prototype.Hm,952:Y.prototype.Jm},Qp={980:Y.prototype.Sk,981:Y.prototype.Rk,984:Y.prototype.Tk,985:Y.prototype.Qk,986:Y.prototype.Uk},Rp={980:Y.prototype.lm,981:Y.prototype.km,984:Y.prototype.mm,985:Y.prototype.jm},Sp={960:Y.prototype.Mk,961:Y.prototype.hk,962:Y.prototype.zl,964:Y.prototype.xl,965:Y.prototype.wl,974:Y.prototype.gl,975:Y.prototype.fl},Tp={954:Y.prototype.Fj,
960:Y.prototype.Ej,961:Y.prototype.Ej,962:Y.prototype.Km,964:Y.prototype.Qm,965:Y.prototype.Pm,970:Y.prototype.Dm,972:Y.prototype.Cm,974:Y.prototype.Bm,975:Y.prototype.Am,986:Y.prototype.Fj},Up={963:Y.prototype.Al,966:Y.prototype.Zk,967:Y.prototype.$k,969:Y.prototype.Yk,970:Y.prototype.Bl,972:Y.prototype.Cl},Vp={963:Y.prototype.Sm,966:Y.prototype.rm,967:Y.prototype.sm,968:Y.prototype.tm,969:Y.prototype.qm};
Ea(function(){for(var a=Wa(document,"pcx86","video"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Aa("aspect"));f&&.3<=f&&3.33>=f&&(Da("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");za("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"),f.style.fontSize="16px");c.appendChild(f);var g=e.getContext("2d"),d=new Y(d,e,g,f,c);Va(d,c)}});
function dr(a){t.call(this,"ParallelPort",a);this.G=a.adapter;switch(this.G){case 1:this.D=956;this.C=7;break;case 2:this.D=888;this.C=7;break;case 3:this.D=632;this.C=5;break;default:r("Unrecognized parallel adapter #"+this.G);return}this.A=this.B=null;a=a.binding;"console"==a?this.B="":Ua(this,a,er)}ba(dr,t);l=dr.prototype;l.wb=function(a,b,c){switch(b){case er:return this.ia[b]=this.A=c,!0}return!1};
l.hc=function(a,b,c,d){this.ma=b;this.U=c;this.Ea=d;this.V=nb(a,"ChipSet");cc(b,this,fr,this.D);ec(b,this,gr,this.D);eb(this)};l.Ob=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Nb=function(a){return a?this.save():!0};l.reset=function(){hr(this)};l.save=function(){var a=new Ie(this),b=0,c=[];c[b++]=this.F;c[b++]=this.zb;c[b]=this.Fe;a.set(0,c);return a.data()};l.restore=function(a){return hr(this,a[0])};
function hr(a,b){var c=0;b||(b=[0,0,0]);a.F=b[c++];a.zb=b[c++];a.Fe=b[c];return!0}l.al=function(){return this.F};l.yl=function(){return this.zb};l.Xk=function(){return this.Fe};l.sm=function(a,b){this.F=b;this.zb|=ir;a=!1;this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.lc(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.zb&=~ir);jr(this)};
l.nm=function(a,b){this.Fe=b;jr(this)};function jr(a){a.V&&a.C&&(a.Fe&kr&&!(a.zb&ir)?zf(a.V,a.C):xf(a.V,a.C))}var er="buffer",ir=64,kr=16,fr={0:dr.prototype.al,1:dr.prototype.yl,2:dr.prototype.Xk},gr={0:dr.prototype.sm,2:dr.prototype.nm};Ea(function(){for(var a=Wa(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new dr(d);Va(d,c)}});
function hr(a,b){var c=0;b||(b=[0,0,0]);a.F=b[c++];a.zb=b[c++];a.Fe=b[c];return!0}l.al=function(){return this.F};l.yl=function(){return this.zb};l.Xk=function(){return this.Fe};l.um=function(a,b){this.F=b;this.zb|=ir;a=!1;this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.lc(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.zb&=~ir);jr(this)};
l.pm=function(a,b){this.Fe=b;jr(this)};function jr(a){a.V&&a.C&&(a.Fe&kr&&!(a.zb&ir)?zf(a.V,a.C):xf(a.V,a.C))}var er="buffer",ir=64,kr=16,fr={0:dr.prototype.al,1:dr.prototype.yl,2:dr.prototype.Xk},gr={0:dr.prototype.um,2:dr.prototype.pm};Ea(function(){for(var a=Wa(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new dr(d);Va(d,c)}});
function lr(a){t.call(this,"SerialPort",a);this.ga=a.adapter;switch(this.ga){case 1:this.ba=1016;this.L=4;break;case 2:this.ba=760;this.L=3;break;default:r("Unrecognized serial adapter #"+this.ga);return}this.D=this.G=null;this.na=a.tabSize;this.la=a.charBOL;this.J=0;this.pa=mr|nr;this.N=!0;a=a.binding;"console"==a?this.G="":Ua(this,a,or);this.C=this.Z=this.W=null;this.exports={connect:this.wi,receiveData:this.cf,receiveStatus:this.gk}}ba(lr,t);l=lr.prototype;
l.Yh=function(a,b,c){var d=null;a!=this.Td||this.C||(this.C=b,this.W=c,this.N=!1,d=this);return d};l.wb=function(a,b,c){var d=this;switch(b){case or:return this.ia[b]=this.D=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<b&&(b-=64),d.cf(b);return!0},c.onkeypress=function(a){a=a||window.event;d.cf(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
l.hc=function(a,b,c,d){this.oa=a;this.ma=b;this.U=c;this.Ea=d;this.V=nb(a,"ChipSet");cc(b,this,pr,this.ba);ec(b,this,qr,this.ba);eb(this)};
@ -566,9 +566,9 @@ l.wi=function(a){if(!this.C){var b=Ec(this.oa,"connection");if(b){var c=b.split(
l.Ob=function(a,b){if(!b)if(this.wi(this.N),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Nb=function(a){return a?this.save():!0};l.reset=function(){rr(this)};l.save=function(){var a=new Ie(this),b=0,c=[];c[b++]=this.ea;c[b++]=this.ja;c[b++]=this.K;c[b++]=this.M;c[b++]=this.F;c[b++]=this.I;c[b++]=this.X;c[b++]=this.B;c[b++]=this.A;c[b]=this.H;a.set(0,c);return a.data()};l.restore=function(a){return rr(this,a[0])};
function rr(a,b){var c=0;b||(b=[0,0,sr,0,tr,0,0,ur|vr,a.pa,[]]);a.ea=b[c++];a.ja=b[c++];a.K=b[c++];a.M=b[c++];a.F=b[c++];a.I=b[c++];a.X=b[c++];a.B=b[c++];a.A=b[c++];a.H=b[c];return!0}l.cf=function(a){if("number"==typeof a)this.H.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.H.push(a.charCodeAt(b));else this.H=this.H.concat(a);wr(this);return!0};l.gk=function(a){var b=this.A;this.A&=~(mr|nr);a&32&&(this.A=this.A|mr|xr);a&64&&(this.A=this.A|nr|yr);b!=this.A&&zr(this)};
function wr(a){0<a.H.length&&!(a.B&Ar)&&(a.ea=a.H.shift(),a.B|=Ar);zr(a)}l.vl=function(){var a=this.I&Br?this.K&255:this.ea;this.B&=~Ar;wr(this);return a};l.hl=function(){return this.I&Br?this.K>>8:this.M};l.il=function(){return this.F};l.jl=function(){return this.I};l.ll=function(){return this.X};l.kl=function(){return this.B};l.ql=function(){var a=this.A;this.A&=~(xr|yr);return a};
l.Pm=function(a,b){if(this.I&Br)this.K=this.K&-256|b;else{this.ja=b;this.B&=~(ur|vr);a=!1;this.Z&&this.Z.call(this.C,b)&&(a=!0);if(this.D){if(13==b)this.J=0;else if(8==b)this.D.value=this.D.value.slice(0,-1),0<this.J&&this.J--;else{var c;13!=b&&10!=b&&(c=na[b]);c=c?"<"+c+">":String.fromCharCode(b);a=c.length;32>b&&1==a&&(a=0);9==b&&(b=this.na||8,a=b-this.J%b,this.na&&(c=" ".slice(0,a)));this.la&&!this.J&&a&&(c=String.fromCharCode(this.la)+c);this.D.value+=c;
this.D.scrollTop=this.D.scrollHeight;this.J+=a}a=!0}else if(null!=this.G){if(10==b||1024<=this.G.length)this.lc(this.G),this.G="";10!=b&&(this.G+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|ur|vr)}};l.Cm=function(a,b){this.I&Br?this.K=this.K&255|b<<8:this.M=b};l.Dm=function(a,b){this.I=b};l.Em=function(a,b){a=b^this.X;this.X=b;a&(Cr|Dr)&&this.W&&(a=0,this.N?(a|=b&Dr?32:0,a|=b&Cr?320:0):(a|=b&Dr?16:0,a|=b&Cr?1048576:0),this.W.call(this.C,a))};
function zr(a){var b=-1;a.B&Ar&&a.M&Er?b=Fr:a.A&(xr|yr)&&a.M&Gr&&(b=Hr);0<=b?(a.F&=~(tr|Ir),a.F|=b,a.V&&a.L&&zf(a.V,a.L,100)):(a.F|=tr,a.V&&a.L&&xf(a.V,a.L))}var or="buffer",sr=384,Er=1,Gr=8,tr=1,Fr=4,Hr=0,Ir=6,Br=128,Cr=1,Dr=2,Ar=1,ur=32,vr=64,xr=1,yr=2,mr=16,nr=32,pr={0:lr.prototype.vl,1:lr.prototype.hl,2:lr.prototype.il,3:lr.prototype.jl,4:lr.prototype.ll,5:lr.prototype.kl,6:lr.prototype.ql},qr={0:lr.prototype.Pm,1:lr.prototype.Cm,3:lr.prototype.Dm,4:lr.prototype.Em};
l.Rm=function(a,b){if(this.I&Br)this.K=this.K&-256|b;else{this.ja=b;this.B&=~(ur|vr);a=!1;this.Z&&this.Z.call(this.C,b)&&(a=!0);if(this.D){if(13==b)this.J=0;else if(8==b)this.D.value=this.D.value.slice(0,-1),0<this.J&&this.J--;else{var c;13!=b&&10!=b&&(c=na[b]);c=c?"<"+c+">":String.fromCharCode(b);a=c.length;32>b&&1==a&&(a=0);9==b&&(b=this.na||8,a=b-this.J%b,this.na&&(c=" ".slice(0,a)));this.la&&!this.J&&a&&(c=String.fromCharCode(this.la)+c);this.D.value+=c;
this.D.scrollTop=this.D.scrollHeight;this.J+=a}a=!0}else if(null!=this.G){if(10==b||1024<=this.G.length)this.lc(this.G),this.G="";10!=b&&(this.G+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|ur|vr)}};l.Em=function(a,b){this.I&Br?this.K=this.K&255|b<<8:this.M=b};l.Fm=function(a,b){this.I=b};l.Gm=function(a,b){a=b^this.X;this.X=b;a&(Cr|Dr)&&this.W&&(a=0,this.N?(a|=b&Dr?32:0,a|=b&Cr?320:0):(a|=b&Dr?16:0,a|=b&Cr?1048576:0),this.W.call(this.C,a))};
function zr(a){var b=-1;a.B&Ar&&a.M&Er?b=Fr:a.A&(xr|yr)&&a.M&Gr&&(b=Hr);0<=b?(a.F&=~(tr|Ir),a.F|=b,a.V&&a.L&&zf(a.V,a.L,100)):(a.F|=tr,a.V&&a.L&&xf(a.V,a.L))}var or="buffer",sr=384,Er=1,Gr=8,tr=1,Fr=4,Hr=0,Ir=6,Br=128,Cr=1,Dr=2,Ar=1,ur=32,vr=64,xr=1,yr=2,mr=16,nr=32,pr={0:lr.prototype.vl,1:lr.prototype.hl,2:lr.prototype.il,3:lr.prototype.jl,4:lr.prototype.ll,5:lr.prototype.kl,6:lr.prototype.ql},qr={0:lr.prototype.Rm,1:lr.prototype.Em,3:lr.prototype.Fm,4:lr.prototype.Gm};
Ea(function(){for(var a=Wa(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new lr(d);Va(d,c)}});function Jr(a){t.call(this,"Mouse",a);if(this.N=a.serial)this.V="SerialPort";this.M=this.L=this.Ub=!1;this.C=[];this.B=[];eb(this)}ba(Jr,t);l=Jr.prototype;l.hc=function(a,b,c,d){this.oa=a;this.ma=b;this.U=c;this.Ea=d;for(b=null;b=nb(a,"Video",b);)this.C.push(b)};
l.Ob=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.V&&!this.D){for(a=null;(a=nb(this.oa,this.V,a))&&(!a.Yh||!(this.D=a.Yh(this.N,this,this.fk))););if(this.D)for(this.B=[],a=0;a<this.C.length;a++)b=this.C[a],b.K=this,(b=b.D)&&this.B.push(b);else r(this.id+": "+this.V+" "+this.N+" unavailable")}this.Ub?Kr(this):Lr(this)}return!0};l.Nb=function(a){return a?this.save():!0};l.reset=function(){Mr(this)};
l.save=function(){var a=new Ie(this),b=0,c=[];c[b++]=this.Ub;c[b++]=this.F;c[b++]=this.G;c[b++]=this.H;c[b++]=this.I;c[b++]=this.J;c[b++]=this.K;c[b]=this.A;a.set(0,c);return a.data()};l.restore=function(a){return Mr(this,a[0])};function Mr(a,b){var c=0;b||(b=[!1,-1,-1,0,0,!1,!1,0]);var d=b[c++];a.Ub=d;a.F=b[c++];a.G=b[c++];a.H=b[c++];a.I=b[c++];a.J=b[c++];a.K=b[c++];a.A=b[c];a.A&(Cr|Dr)&&(a.A=(a.A&Cr?1048576:0)|(a.A&Dr?16:0));return!0}l.Ye=function(a){this.L=a};
@ -614,15 +614,15 @@ function ms(a,b,c,d){var e,f=a.ia.listDrives;if(f&&!isNaN(e=fa(f.value,10))&&0<=
l.ji=function(a,b,c,d,e){var f;a.je=!1;b&&(f=b.info(),b&&f[0]>a.fb||f[1]>a.gb)&&(this.Aa('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.La)),b=null);b?(a.sa=b,a.Qj=c,a.Rd=d,ys(this,c,d,b),f=b.info(),this.I|=Bs,this.Aa('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.La),a.Fd||e),a.Lf=f[0],a.Qe=f[1],a.Re=f[2],this.oa&&Rc(this.oa)):a.le=!1;a.Fd&&(a.Fd=!1,--this.J||eb(this));ls(this,a.La)};
function qs(a,b,c,d){if((a=a.ia.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function ls(a,b){if(0<=b&&b<a.A.length){var c=a.A[b],d=a.ia.listDisks;a=a.ia.listDrives;if(d&&a&&d.options&&a.options&&(a=fa(a.value,10),c=c.le?"?":c.Rd,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ss(a,b,c,d){var e=a.A[b];e.sa&&(As(a,e.Rd,e.sa),e.Qj="",e.Rd="",e.sa=null,e.le=!1,a.I|=Bs,d||a.Aa("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||ls(a,b))}
function ys(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function As(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.vm=function(a,b){b&Cs?this.K&Cs||this.K&Ds&&this.V&&zf(this.V,6):ns(this);this.K=b};l.cl=function(){return 80};l.el=function(){return this.Y};l.bl=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.K&Ds&&this.V&&xf(this.V,6);++this.D>=this.C&&(this.Y&=~(Es|Fs),this.D=this.C=0);return a};
l.um=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]&Gs;if(void 0!==Hs[a]&&this.C>=Hs[a].dd){b=!1;this.D=0;a=Is(this);var c,d,e,f,g,h=a&Gs;switch(h){case Js:Is(this);Is(this);Ks(this);break;case Ls:d=Is(this);this.La=d&3;c=this.A[this.La];Ks(this);Ms(this,(c.hb&Ns)>>>24);break;case Os:case Ps:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];c.Sa=b;d=c.ub=Is(this);e=Is(this);f=c.kb=Is(this);g=Is(this);c.tb=128<<g;c.sd=Is(this);Is(this);Is(this);h==Ps?(h=c,h.hb=Qs|Rs,h.sa&&(h.Ra=
function ys(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function As(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.xm=function(a,b){b&Cs?this.K&Cs||this.K&Ds&&this.V&&zf(this.V,6):ns(this);this.K=b};l.cl=function(){return 80};l.el=function(){return this.Y};l.bl=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.K&Ds&&this.V&&xf(this.V,6);++this.D>=this.C&&(this.Y&=~(Es|Fs),this.D=this.C=0);return a};
l.wm=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]&Gs;if(void 0!==Hs[a]&&this.C>=Hs[a].dd){b=!1;this.D=0;a=Is(this);var c,d,e,f,g,h=a&Gs;switch(h){case Js:Is(this);Is(this);Ks(this);break;case Ls:d=Is(this);this.La=d&3;c=this.A[this.La];Ks(this);Ms(this,(c.hb&Ns)>>>24);break;case Os:case Ps:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];c.Sa=b;d=c.ub=Is(this);e=Is(this);f=c.kb=Is(this);g=Is(this);c.tb=128<<g;c.sd=Is(this);Is(this);Is(this);h==Ps?(h=c,h.hb=Qs|Rs,h.sa&&(h.Ra=
null,h.hb=Ss,this.V&&(ol(this.V,2,this,"dmaRead",h),kl(this.V,2)))):(h=c,h.hb=Qs|Rs,h.sa&&(h.sa.pe?h.hb=Ts|Rs:(h.Ra=null,h.hb=Ss,this.V&&(ol(this.V,2,this,"dmaWrite",h),kl(this.V,2)))));Us(this,c,a,b,d,e,f,g);b=!0;break;case Vs:d=Is(this);this.La=d&3;c=this.A[this.La];c.ub=c.rd=0;c.hb=Ws|Xs;Ks(this);b=!0;break;case Ys:c=this.A[this.La];c.Sa=0;Ks(this);Ms(this,c.La|c.Sa<<2|c.hb&Zs);Ms(this,c.ub);this.La=this.La+1&3;break;case $s:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];d=c.ub;e=c.Sa=b;f=c.kb=
1;g=0;c.hb=Ss;c.sa&&(c.Ra=c.sa.seek(c.ub,c.Sa,c.kb))?g=c.Ra.length>>8:c.hb=Qs|Rs;Us(this,c,a,b,d,e,f,g);b=!0;break;case at:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];d=c.ub;e=c.Sa=b;f=1;g=Is(this);c.tb=128<<g;c.sd=Is(this);Is(this);c.Zh=Is(this);h=c;h.hb=Qs|Rs;h.sa&&(h.Ra=null,h.hb=Ss,this.V&&(h.ge=0,h.Fc=Array(4),h.ig=!0,h.xf=0,ol(this.V,2,this,"dmaFormat",h),kl(this.V,2),h.ig=!1));Us(this,c,a,b,d,e,f,g);b=!0;break;case bt:d=Is(this),this.La=d&3,c=this.A[this.La],c.Sa=d>>2&1,d=Is(this),c.ub+=
d-c.rd,0>c.ub&&(c.ub=0),c.ub>=c.fb&&(c.ub=c.fb-1),c.rd=d,c.hb=Ws,c.ub||(c.hb|=Xs),Ks(this),b=!0}0<this.C&&(this.Y=this.Y|Es|Fs);this.K&Ds&&(!c||c.hb&Qs||!b||this.V&&zf(this.V,6))}};l.dl=function(){var a=this.I;this.I&=~Bs;return a};l.tm=function(a,b){this.F=b};function Us(a,b,c,d,e,f,g,h){Ks(a);Ms(a,b.La|b.Sa<<2|b.hb&Zs);Ms(a,(b.hb&ct)>>>8);Ms(a,(b.hb&dt)>>>16);var k=0;if(e!=b.ub||f!=b.Sa)k=g=1;c&et&&(f^=k,d||(k=0));Ms(a,e+k);Ms(a,f);Ms(a,g);Ms(a,h)}function Is(a){var b=a.G[a.D];a.D++;return b}
d-c.rd,0>c.ub&&(c.ub=0),c.ub>=c.fb&&(c.ub=c.fb-1),c.rd=d,c.hb=Ws,c.ub||(c.hb|=Xs),Ks(this),b=!0}0<this.C&&(this.Y=this.Y|Es|Fs);this.K&Ds&&(!c||c.hb&Qs||!b||this.V&&zf(this.V,6))}};l.dl=function(){var a=this.I;this.I&=~Bs;return a};l.vm=function(a,b){this.F=b};function Us(a,b,c,d,e,f,g,h){Ks(a);Ms(a,b.La|b.Sa<<2|b.hb&Zs);Ms(a,(b.hb&ct)>>>8);Ms(a,(b.hb&dt)>>>16);var k=0;if(e!=b.ub||f!=b.Sa)k=g=1;c&et&&(f^=k,d||(k=0));Ms(a,e+k);Ms(a,f);Ms(a,g);Ms(a,h)}function Is(a){var b=a.G[a.D];a.D++;return b}
function Ks(a){a.D=a.C=0}function Ms(a,b){a.G[a.C++]=b}l.$j=function(a,b,c){void 0===b||0>b?this.ue(a,c):c(-1,!1)};l.ak=function(a,b){return void 0!==b&&0<=b?ft(a,b):-1};l.qk=function(a,b){if(void 0!==b&&0<=b)a:if(a.hb)a=-1;else{a.Fc[a.ge++]=b;if(a.ge==a.Fc.length){a.ub=a.Fc[0];a.Sa=a.Fc[1];a.kb=a.Fc[2];a.tb=128<<a.Fc[3];for(var c=a.ge=0;c<a.tb;c++)if(0>ft(a,a.Zh)){a=-1;break a}a.xf++}a.xf>=a.sd&&(b=-1);a=b}else a=-1;return a};
l.ue=function(a,b){var c=-1,d=null,e=0;if(!a.hb&&a.sa){do{if(a.Ra&&(e=a.Oa,0<=(c=a.sa.read(a.Ra,a.Oa++)))){d=a.Ra;break}a.Ra=a.sa.seek(a.ub,a.Sa,a.kb);if(!a.Ra){a.hb=gt|Rs;break}a.Oa=0;ht(a)}while(1)}b(c,!1,d,e)};function ft(a,b){if(a.hb||!a.sa)return-1;do{if(a.Ra&&a.sa.write(a.Ra,a.Oa++,b))break;a.Ra=a.sa.seek(a.ub,a.Sa,a.kb);if(!a.Ra){a.hb=it|Rs;b=-1;break}a.Oa=0;ht(a)}while(1);return b}function ht(a){a.kb++;a.kb>=a.Re+1&&(a.kb=1,a.Sa++,a.Sa>=a.Qe&&(a.Sa=0,a.ub++))}
var ws="Floppy Drive",Cs=4,Ds=8,Fs=16,Es=64,us=128,Js=3,Ls=4,Os=5,Ps=6,Vs=7,Ys=8,$s=10,at=13,bt=15,Gs=31,et=128,Ss=0,Qs=8,Ws=32,Rs=64,vs=192,Zs=255,Ts=512,gt=1024,it=8192,ct=65280,dt=16711680,Xs=268435456,Ns=-16777216,Bs=128,zs=0;aa={};
var Hs={3:{dd:3,td:0,name:aa.xo},4:{dd:2,td:1,name:aa.vo},5:{dd:9,td:7,name:aa.Bo},6:{dd:9,td:7,name:aa.ro},7:{dd:2,td:0,name:aa.to},8:{dd:1,td:2,name:aa.wo},10:{dd:2,td:7,name:aa.so},13:{dd:6,td:7,name:aa.oo},15:{dd:3,td:0,name:aa.uo}},os={1009:ks.prototype.cl,1012:ks.prototype.el,1013:ks.prototype.bl,1015:ks.prototype.dl},ps={1010:ks.prototype.vm,1013:ks.prototype.um,1015:ks.prototype.tm};
var Hs={3:{dd:3,td:0,name:aa.zo},4:{dd:2,td:1,name:aa.xo},5:{dd:9,td:7,name:aa.Do},6:{dd:9,td:7,name:aa.to},7:{dd:2,td:0,name:aa.vo},8:{dd:1,td:2,name:aa.yo},10:{dd:2,td:7,name:aa.uo},13:{dd:6,td:7,name:aa.qo},15:{dd:3,td:0,name:aa.wo}},os={1009:ks.prototype.cl,1012:ks.prototype.el,1013:ks.prototype.bl,1015:ks.prototype.dl},ps={1010:ks.prototype.xm,1013:ks.prototype.wm,1015:ks.prototype.vm};
Ea(function(){for(var a=Wa(document,"pcx86","fdc"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new ks(d);Va(d,c)}});function Z(a){t.call(this,"HDC",a);this.dmaRead=Z.prototype.bk;this.dmaWrite=Z.prototype.ck;this.dmaWriteBuffer=Z.prototype.rk;this.dmaWriteFormat=Z.prototype.sk;this.X=[];this.ja=a.drives;this.L="at"==a.type}ba(Z,t);l=Z.prototype;
l.wb=function(a,b,c){var d=this;switch(b){case "saveHD0":case "saveHD1":return this.ia[b]=c,c.onclick=function(a){return function(){var b=d.A&&d.A[a];b&&b.sa?(b=b.sa,b=Ca(is(b),"octet-stream",!0,b.ph.replace(".json",".img")),r(b)):d.Aa("Hard drive "+a+" is not available.")}}(+b.slice(-1)),!0}return!1};
l.hc=function(a,b,c,d){this.ma=b;this.U=c;this.Ea=d;this.oa=a;if(d=Ec(a,"drives"))this.X=d;else if(this.ja)try{this.X=eval("("+this.ja+")")}catch(e){r("HDC drive configuration error: "+e.message+" ("+this.ja+")")}this.V=nb(a,"ChipSet");this.F=0;this.la=3;cc(b,this,this.L?jt:kt);ec(b,this,this.L?lt:mt);this.L&&(this.F++,this.V&&this.V.aa==Ej&&this.F++,this.la=2,b.M[nt]=2,b.N[nt]=2);Ee(c,19,this.Hl.bind(this));Ee(c,64,this.Il.bind(this));this.reset();ot(this)||eb(this)};
@ -635,10 +635,10 @@ function qt(a){var b=0,c=[];a.L?(c[b++]=a.H,c[b++]=a.ta,c[b++]=a.I,c[b++]=a.ea,c
e[g]=m}c[b]=e;return c}function wt(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.be[2])?e=b.be[0]<<8|b.be[1]:c=b.type);null==c||d||(d=vt[a.F][c][1],e=vt[a.F][c][0]);d&&((c=vt[a.F][b.type])&&e!=c[0]&&d!=c[1]&&a.Aa("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.fb=e,b.gb=d,null==b.sa&&(b.sa=new Sr(a,b,b.mode)))}}
function ot(a,b){b||(a.J=0);for(var c=0;c<a.A.length;c++){var d=a.A[c];if(d.name&&d.path){if(!(b&&d.sa&&d.sa.Ef)){var e;e=a;var f=d.name,d=d.path,g=e.A[c];g.je?(e.Aa("Drive "+c+" busy"),e=!0):(g.je=!0,g.Fd=!0,e.J++,(g.sa||new Sr(e,g,g.mode)).load(f,d,null,e.tk),e=!1);!e&&b&&eb(a,!1)}}else b&&void 0!==d.type&&(d.sa=null,wt(a,d,d.type))}return!!a.J}
l.tk=function(a,b,c){a.je=!1;if(a.sa=b)this.Aa('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.La),a.Fd),b=b.info(),b[0]==a.fb&&b[1]==a.gb&&b[2]==a.Za&&b[3]==a.lb||this.Aa("Warning: disk geometry ("+b[0]+":"+b[1]+":"+b[2]+") does not match "+xt[this.F]+" drive type "+a.type+" ("+a.fb+":"+a.gb+":"+a.Za+")");a.Fd&&(a.Fd=!1,--this.J||eb(this))};
l.El=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.V&&xf(this.V,5);this.Y&=~yt;++this.D>=this.C&&(this.D=this.C=0,this.Y&=~(zt|Dt|Et));return a};l.Rm=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]!=Ft?6:this.G.length;6==this.C&&(this.Y&=~Gt);this.C>=a&&(this.Y|=zt,this.Y&=~Gt,Ht(this))};l.Fl=function(){var a=this.Y;this.D<this.C&&(this.Y|=Gt);return a};l.Um=function(a,b){this.qa=b;this.V&&xf(this.V,5);pt(this)};l.Dl=function(){return this.W};
l.Tm=function(a,b){this.pa=b;this.Y=Gt|Dt|Et};l.Sm=function(a,b){this.na=b};l.lh=function(){};function It(a){var b=-1;a.B&&(b=a.ue(a.B,function(){}),(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,a.B.tb>=a.B.lb?(a.Y=Jt,a.ue(a.B,function(b){0<=b?(Kt(a),a.V&&a.V.aa==Ej&&(a.Y=0),a.Y=a.Y|rt|Lt|Mt):(a.Y=Nt,a.H=Ot)},!1)):a.Y=rt|Lt));return b}l.dk=function(){return It(this)|It(this)<<8};
function Pt(a,b){a.B&&a.B.tb>=a.B.lb&&(0>Qt(a.B,b)?(a.Y=Nt,a.H=Ot):(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,Kt(a),a.Y=rt|Lt,a.B.tb>=a.B.lb&&(a.Y|=Mt)))}l.bm=function(a,b){Pt(this,b&255);Pt(this,b>>8&255)};l.Lk=function(){return this.H};l.gm=function(a,b){this.ta=b};l.Nk=function(){return this.I};l.em=function(a,b){this.I=b};l.Ok=function(){return this.ea};l.fm=function(a,b){this.ea=b};l.Jk=function(){return this.ba};l.am=function(a,b){this.ba=b};l.Ik=function(){return this.Z};
l.$l=function(a,b){this.Z=b};l.Kk=function(){return this.N};l.cm=function(a,b){this.N=b;this.Y=this.A[this.N&Rt?1:0]?this.Y|rt|Lt:this.Y&~rt};l.Pk=function(){var a=this.Y;this.Y&rt&&(this.Y&=~Jt);return a};l.Zl=function(a,b){this.ga=b;this.V&&xf(this.V,14);St(this)};l.dm=function(a,b){this.K&Tt&&!(b&Tt)&&(this.H=Ut);this.K=b};
l.El=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.V&&xf(this.V,5);this.Y&=~yt;++this.D>=this.C&&(this.D=this.C=0,this.Y&=~(zt|Dt|Et));return a};l.Tm=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]!=Ft?6:this.G.length;6==this.C&&(this.Y&=~Gt);this.C>=a&&(this.Y|=zt,this.Y&=~Gt,Ht(this))};l.Fl=function(){var a=this.Y;this.D<this.C&&(this.Y|=Gt);return a};l.Wm=function(a,b){this.qa=b;this.V&&xf(this.V,5);pt(this)};l.Dl=function(){return this.W};
l.Vm=function(a,b){this.pa=b;this.Y=Gt|Dt|Et};l.Um=function(a,b){this.na=b};l.lh=function(){};function It(a){var b=-1;a.B&&(b=a.ue(a.B,function(){}),(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,a.B.tb>=a.B.lb?(a.Y=Jt,a.ue(a.B,function(b){0<=b?(Kt(a),a.V&&a.V.aa==Ej&&(a.Y=0),a.Y=a.Y|rt|Lt|Mt):(a.Y=Nt,a.H=Ot)},!1)):a.Y=rt|Lt));return b}l.dk=function(){return It(this)|It(this)<<8};
function Pt(a,b){a.B&&a.B.tb>=a.B.lb&&(0>Qt(a.B,b)?(a.Y=Nt,a.H=Ot):(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,Kt(a),a.Y=rt|Lt,a.B.tb>=a.B.lb&&(a.Y|=Mt)))}l.dm=function(a,b){Pt(this,b&255);Pt(this,b>>8&255)};l.Lk=function(){return this.H};l.im=function(a,b){this.ta=b};l.Nk=function(){return this.I};l.gm=function(a,b){this.I=b};l.Ok=function(){return this.ea};l.hm=function(a,b){this.ea=b};l.Jk=function(){return this.ba};l.cm=function(a,b){this.ba=b};l.Ik=function(){return this.Z};
l.bm=function(a,b){this.Z=b};l.Kk=function(){return this.N};l.em=function(a,b){this.N=b;this.Y=this.A[this.N&Rt?1:0]?this.Y|rt|Lt:this.Y&~rt};l.Pk=function(){var a=this.Y;this.Y&rt&&(this.Y&=~Jt);return a};l.am=function(a,b){this.ga=b;this.V&&xf(this.V,14);St(this)};l.fm=function(a,b){this.K&Tt&&!(b&Tt)&&(this.H=Ut);this.K=b};
function St(a){var b=!1,c=a.ga,d=a.N&Rt?1:0,e=a.N&Vt,f=a.ba|(a.Z&Wt)<<8,g=a.ea,h=a.I||256;a.La=-1;a.B=null;a.H=Xt;a.Y=rt|Lt;var k=a.A[d];k?(k.Ad=f,k.Sa=e,k.kb=g,k.tb=h*k.lb,c=c>=Yt?c:c&Zt,k.Ra=null,k.Oa=0,k.errorCode=0,a.La=d,a.B=k):c=-1;switch(c&Zt){case $t:b=!0;break;case au:a.Y=Jt;a.ue(k,function(b){0<=b&&a.V?(Kt(a),a.Y=rt|Lt|Mt):(a.Y=Nt,a.H=Ot)},!1);break;case bu:a.Y=Mt;break;case cu:b=!0;break;case du:b=!0;break;case Yt:a.H=Ut;b=!0;break;case eu:k.gb=e+1,k.Za=h,b=!0}b&&Kt(a)}
function Kt(a){!a.V||a.K&fu||zf(a.V,14,120)}
function Ht(a){a.D=0;var b=gu(a),c=gu(a),d=c&32,e=d>>5,f=c&31,g=gu(a),h=gu(a),k=g<<2&768|h,m=g&63,q=gu(a),y=gu(a),w=a.A[e];w&&(w.Ad=k,w.Sa=f,w.kb=m,w.tb=q*w.lb);switch(b){case hu:iu(a,w?w.errorCode:ju);ku(a,c);ku(a,g);ku(a,h);ku(a,lu|d);b=-1;break;case Ft:for(c=0;0<=(b=gu(a));)w&&c<w.be.length&&(w.be[c++]=b);w&&wt(a,w);b=lu;w||a.M!=e||(a.M=-1,b=mu);iu(a,b|d);b=-1;break;case nu:case ou:iu(a,lu|d),b=-1}if(0<=b)switch(void 0===w?b=-1:(w.errorCode=tt,w.Rj=0),b){case pu:iu(a,lu|d);break;case qu:w.Fe=y;
@ -650,8 +650,8 @@ l.ue=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;
function Qt(a,b){if(a.errorCode)return-1;do{if(a.Ra&&a.sa.write(a.Ra,a.Oa++,b))break;a.sa&&a.sa.seek(a.Ad,a.Sa,a.kb+a.vf,!0,function(b){a.Ra=b});if(!a.Ra){a.errorCode=yu;b=-1;break}a.Oa=0;zu(a)}while(1);return b}function zu(a){a.kb++;var b=1-a.vf;a.kb>=a.Za+b&&(a.kb=b,a.Sa++,a.Sa>=a.gb&&(a.Sa=0,a.Ad++))}l.Hl=function(){var a=this.U.K&255;!(this.U.F>>8)&&128<a&&(this.M=a-128);return!0};l.Il=function(){var a;(a=this.U.F>>8||!this.V)||(a=!(this.V.Zb[0].Tc&64));return a?!0:!1};
var ut="Hard Drive",xt=["XTC","ATC","COMPAQ"],vt=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7],16:[612,4],17:[977,5],18:[977,7],19:[1024,7],20:[733,5],21:[733,7],22:[733,5],23:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[1023,8],5:[940,6],6:[697,5],7:[462,8],8:[925,5],9:[900,15],10:[980,5],11:[925,7],12:[925,9],13:[612,8],14:[980,4],16:[612,4],17:[980,5],18:[966,
6],19:[1023,8],20:[733,5],21:[733,7],22:[524,4,40],23:[924,8],24:[966,14],25:[966,16],26:[1023,14],27:[832,6,33],28:[1222,15,34],29:[1240,7,34],30:[615,4,25],31:[615,8,25],32:[905,9,25],33:[832,8,33],34:[966,7,34],35:[966,8,34],36:[966,9,34],37:[966,5,34],38:[612,16,63],39:[1023,11,33],40:[1023,15,34],41:[1630,15,52],42:[1023,16,63],43:[805,4,26],44:[805,2,26],45:[748,8,33],46:[748,6,33],47:[966,5,25]}],nt=496,Ut=1,Xt=0,Ot=16,Wt=3,Vt=15,Rt=16,Nt=1,Mt=8,Lt=16,rt=64,Jt=128,$t=16,au=32,bu=48,cu=64,du=
112,Yt=144,eu=145,Zt=240,fu=2,Tt=4,lu=0,mu=2,pu=0,qu=1,hu=3,ru=5,su=8,uu=10,Ft=12,wu=15,nu=224,ou=228,tt=0,ju=4,yu=20,st=0,Gt=1,zt=2,Dt=4,Et=8,yt=32,kt={800:Z.prototype.El,801:Z.prototype.Fl,802:Z.prototype.Dl},jt={496:Z.prototype.dk,497:Z.prototype.Lk,498:Z.prototype.Nk,499:Z.prototype.Ok,500:Z.prototype.Jk,501:Z.prototype.Ik,502:Z.prototype.Kk,503:Z.prototype.Pk},mt={800:Z.prototype.Rm,801:Z.prototype.Um,802:Z.prototype.Tm,803:Z.prototype.Sm,807:Z.prototype.lh,811:Z.prototype.lh,815:Z.prototype.lh},
lt={496:Z.prototype.bm,497:Z.prototype.gm,498:Z.prototype.em,499:Z.prototype.fm,500:Z.prototype.am,501:Z.prototype.$l,502:Z.prototype.cm,503:Z.prototype.Zl,1014:Z.prototype.dm};Ea(function(){for(var a=Wa(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new Z(d);Va(d,c)}});
112,Yt=144,eu=145,Zt=240,fu=2,Tt=4,lu=0,mu=2,pu=0,qu=1,hu=3,ru=5,su=8,uu=10,Ft=12,wu=15,nu=224,ou=228,tt=0,ju=4,yu=20,st=0,Gt=1,zt=2,Dt=4,Et=8,yt=32,kt={800:Z.prototype.El,801:Z.prototype.Fl,802:Z.prototype.Dl},jt={496:Z.prototype.dk,497:Z.prototype.Lk,498:Z.prototype.Nk,499:Z.prototype.Ok,500:Z.prototype.Jk,501:Z.prototype.Ik,502:Z.prototype.Kk,503:Z.prototype.Pk},mt={800:Z.prototype.Tm,801:Z.prototype.Wm,802:Z.prototype.Vm,803:Z.prototype.Um,807:Z.prototype.lh,811:Z.prototype.lh,815:Z.prototype.lh},
lt={496:Z.prototype.dm,497:Z.prototype.im,498:Z.prototype.gm,499:Z.prototype.hm,500:Z.prototype.cm,501:Z.prototype.bm,502:Z.prototype.em,503:Z.prototype.am,1014:Z.prototype.fm};Ea(function(){for(var a=Wa(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new Z(d);Va(d,c)}});
function Au(a,b,c){t.call(this,"Computer",a);this.ca.Pb=!1;Bu(this,b);this.M=Ec(this,"autoPower",a);this.C=0;this.Z=a.busWidth||a.buswidth;this.A=Cu;this.K=null;this.H=this.X=!1;this.ba=Ec(this,"url")||"";this.ga=(Math.random()+.1).toString(36).substr(2,12);this.B=Du(this);if(this.U=Sa("CPU",this.id)){this.Ea=Sa("Debugger",this.id);this.G=[];for(b=null;b=nb(this,"Video",b);)this.G.push(b);this.ma=new Eb({id:this.Vd+".bus",busWidth:this.Z},this.U,this.Ea);var d,e=Qa(this.id);if((this.D=Sa("Panel",
this.id))&&this.D.Cf)for(b=0;b<e.length;b++)d=e[b],d.Aa=this.D.Aa,d.lc=this.D.lc,d.Cf=this.D.Cf;this.lc("PCx86 v1.34.0\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.hc&&d.hc(this,this.ma,this.U,this.Ea);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.J=d:this.A=parseInt(d,10));var f;if(a=Ec(this,"state")||(f=!0,a.state))b=this.V=a,f||(this.H=!0,this.A=Cu),this.A&&(this.L=new Ie(this,"1.34.0"),
this.L.load()?b=null:delete this.L);!b&&this.A&&(b=Eu(this))&&(this.H=!0);if(b){var g=this;ta(b,null,!0,function(a,b,c){c?(g.J=null,g.H=!1,g.Aa("Unable to load machine state from server (error "+c+(b?": "+ma(b):"")+")")):(g.K=b,g.X=!0);eb(g)})}else eb(this);this.ia.power||(this.M=!0);!c&&this.M&&Fu(this,this.$e)}else r("Unable to find CPU component")}ba(Au,t);

View file

@ -1050,6 +1050,8 @@ class X86CPU extends CPU {
*/
this.fMDSet = false; // regMDHi and/or regMDLo are invalid unless fMDSet is true
this.regMDLo = this.regMDHi = 0;
this.r64Div = [0, 0];
this.r64Rem = [0, 0];
this.regXX = 0; // for internal use only (eg, assists with ModRM helper functions)
/*

View file

@ -1773,6 +1773,9 @@ X86.fnMULb = function(dst, src)
*
* This sets regMDHi:regMDLo to the 64-bit result of dst * src, both of which are treated as unsigned.
*
* The algorithm is based on the traditional "by hand" multiplication method, by treating the two inputs
* (dst and src) as two 2-digit numbers, where each digit is a base-65536 digit.
*
* @this {X86CPU}
* @param {number} dst (any 32-bit number, treated as unsigned)
* @param {number} src (any 32-bit number, treated as unsigned)

View file

@ -35,81 +35,85 @@ if (NODE) {
}
/**
* helpAdd64(dst, src)
* helpAdd64(r64Dst, r64Src)
*
* Adds src to dst.
* Adds r64Src to r64Dst.
*
* @param {Array} dst is a 64-bit value
* @param {Array} src is a 64-bit value
* @param {Array.<number>} r64Dst is a 64-bit value
* @param {Array.<number>} r64Src is a 64-bit value
*/
X86.helpAdd64 = function(dst, src)
X86.helpAdd64 = function(r64Dst, r64Src)
{
dst[0] += src[0];
dst[1] += src[1];
if (dst[0] > 0xffffffff) {
dst[0] >>>= 0; // truncate dst[0] to 32 bits AND keep it unsigned
dst[1]++;
r64Dst[0] += r64Src[0];
r64Dst[1] += r64Src[1];
if (r64Dst[0] > 0xffffffff) {
r64Dst[0] >>>= 0; // truncate r64Dst[0] to 32 bits AND keep it unsigned
r64Dst[1]++;
}
};
/**
* helpCmp64(dst, src)
* helpCmp64(r64Dst, r64Src)
*
* Compares dst to src, by computing dst - src.
* Compares r64Dst to r64Src, by computing r64Dst - r64Src.
*
* @param {Array} dst is a 64-bit value
* @param {Array} src is a 64-bit value
* @return {number} > 0 if dst > src, == 0 if dst == src, < 0 if dst < src
* @param {Array.<number>} r64Dst is a 64-bit value
* @param {Array.<number>} r64Src is a 64-bit value
* @return {number} > 0 if r64Dst > r64Src, == 0 if r64Dst == r64Src, < 0 if r64Dst < r64Src
*/
X86.helpCmp64 = function(dst, src)
X86.helpCmp64 = function(r64Dst, r64Src)
{
var result = dst[1] - src[1];
if (!result) result = dst[0] - src[0];
var result = r64Dst[1] - r64Src[1];
if (!result) result = r64Dst[0] - r64Src[0];
return result;
};
/**
* helpSet64(lo, hi)
* helpSet64(r64Dst, lo, hi)
*
* @param {Array.<number>} r64Dst
* @param {number} lo
* @param {number} hi
* @return {Array.<number>}
*/
X86.helpSet64 = function(lo, hi)
X86.helpSet64 = function(r64Dst, lo, hi)
{
return [lo >>> 0, hi >>> 0];
r64Dst[0] = lo >>> 0;
r64Dst[1] = hi >>> 0;
return r64Dst;
};
/**
* helpShr64(dst)
* helpShr64(r64Dst)
*
* Shifts dst right one bit.
* Shifts r64Dst right one bit.
*
* @param {Array} dst is a 64-bit value
* @param {Array.<number>} r64Dst is a 64-bit value
*/
X86.helpShr64 = function(dst)
X86.helpShr64 = function(r64Dst)
{
dst[0] >>>= 1;
if (dst[1] & 0x1) {
dst[0] = (dst[0] | 0x80000000) >>> 0;
r64Dst[0] >>>= 1;
if (r64Dst[1] & 0x1) {
r64Dst[0] = (r64Dst[0] | 0x80000000) >>> 0;
}
dst[1] >>>= 1;
r64Dst[1] >>>= 1;
};
/**
* helpSub64(dst, src)
* helpSub64(r64Dst, r64Src)
*
* Subtracts src from dst.
* Subtracts r64Src from r64Dst.
*
* @param {Array} dst is a 64-bit value
* @param {Array} src is a 64-bit value
* @param {Array.<number>} r64Dst is a 64-bit value
* @param {Array.<number>} r64Src is a 64-bit value
*/
X86.helpSub64 = function(dst, src)
X86.helpSub64 = function(r64Dst, r64Src)
{
dst[0] -= src[0];
dst[1] -= src[1];
if (dst[0] < 0) {
dst[0] >>>= 0; // truncate dst[0] to 32 bits AND keep it unsigned
dst[1]--;
r64Dst[0] -= r64Src[0];
r64Dst[1] -= r64Src[1];
if (r64Dst[0] < 0) {
r64Dst[0] >>>= 0; // truncate r64Dst[0] to 32 bits AND keep it unsigned
r64Dst[1]--;
}
};
@ -144,32 +148,33 @@ X86.helpDECreg = function(w)
X86.helpDIV32 = function(dstLo, dstHi, src)
{
src >>>= 0;
if (!src || src <= (dstHi >>> 0)) {
return false;
}
var result = 0, bit = 1;
var div = X86.helpSet64(src, 0);
var rem = X86.helpSet64(dstLo, dstHi);
var r64Div = X86.helpSet64(this.r64Div, src, 0);
var r64Rem = X86.helpSet64(this.r64Rem, dstLo, dstHi);
while (X86.helpCmp64(rem, div) > 0) {
X86.helpAdd64(div, div);
while (X86.helpCmp64(r64Rem, r64Div) > 0) {
X86.helpAdd64(r64Div, r64Div);
bit += bit;
}
do {
if (X86.helpCmp64(rem, div) >= 0) {
X86.helpSub64(rem, div);
if (X86.helpCmp64(r64Rem, r64Div) >= 0) {
X86.helpSub64(r64Rem, r64Div);
result += bit;
}
X86.helpShr64(div);
X86.helpShr64(r64Div);
bit /= 2;
} while (bit >= 1);
this.assert(result <= 0xffffffff && !rem[1]);
this.assert(result <= 0xffffffff && !r64Rem[1]);
this.regMDLo = result; // result is the quotient, which callers expect in the low MD register
this.regMDHi = rem[0]; // rem[0] is the remainder, which callers expect in the high MD register
this.regMDLo = result; // result is the quotient, which callers expect in the low MD register
this.regMDHi = r64Rem[0]; // r64Rem[0] is the remainder, which callers expect in the high MD register
return true;
};

717
modules/pdp10/lib/bus.js Normal file
View file

@ -0,0 +1,717 @@
/**
* @fileoverview Implements the PDP-10 Bus component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
if (NODE) {
var Str = require("../../shared/lib/strlib");
var Usr = require("../../shared/lib/usrlib");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
var PDP10 = require("./defines");
var MemoryPDP10 = require("./memory");
var MessagesPDP10 = require("./messages");
}
/*
* Data types used by scanMemory()
*/
/**
* This defines the BlockInfo bit fields used by scanMemory() when it creates the aBlocks array.
*
* @typedef {{
* num: BitField,
* count: BitField,
* btmod: BitField,
* type: BitField
* }}
*/
var BlockInfoPDP10 = Usr.defineBitFields({num:20, count:8, btmod:1, type:3});
/**
* BusInfoPDP10 object definition (returned by scanMemory())
*
* cbTotal: total bytes allocated
* cBlocks: total Memory blocks allocated
* aBlocks: array of allocated Memory block numbers
*
* @typedef {{
* cbTotal: number,
* cBlocks: number,
* aBlocks: Array.<BlockInfoPDP10>
* }}
*/
var BusInfoPDP10;
class BusPDP10 extends Component {
/**
* BusPDP10(parmsBus, cpu, dbg)
*
* The BusPDP10 component manages physical memory and I/O address spaces.
*
* The BusPDP10 component has no UI elements, so it does not require an init() handler,
* but it still inherits from the Component class and must be allocated like any
* other device component. It's currently allocated by the Computer's init() handler,
* which then calls the initBus() method of all the other components.
*
* For memory beyond the simple needs of the ROM and RAM components (ie, memory-mapped
* devices), the address space must still be allocated through the BusPDP10 component via
* addMemory(). If the component needs something more than simple read/write storage,
* it must provide a custom controller.
*
* @param {Object} parmsBus
* @param {CPUStatePDP10} cpu
* @param {DebuggerPDP10} dbg
*/
constructor(parmsBus, cpu, dbg)
{
super("Bus", parmsBus, MessagesPDP10.BUS);
this.cpu = cpu;
this.dbg = dbg;
/*
* Supported values for nBusWidth: 18 (default). This represents the maximum size of the bus for the
* life of the machine, regardless what memory management mode the CPU has enabled.
*/
this.nBusWidth = +parmsBus['busWidth'] || 18;
/*
* Compute all BusPDP10 memory block parameters now, based on the width of the bus.
*
* Note that all PCjs machines divide their address space into blocks, using a block size appropriate for
* the machine's bus width. This allows us to efficiently allocate the entire address space, by reusing blocks
* as appropriate, and to define to different address behaviors on a block-granular level.
*/
this.addrTotal = 1 << this.nBusWidth;
this.nBusMask = (this.addrTotal - 1);
this.nBlockSize = 16384;
this.nBlockShift = Math.log2(this.nBlockSize); // ES6 ALERT (alternatively: Math.log(this.nBlockSize) / Math.LN2)
this.nBlockLen = this.nBlockSize >> 2;
this.nBlockLimit = this.nBlockSize - 1;
this.nBlockTotal = (this.addrTotal / this.nBlockSize) | 0;
this.nBlockMask = this.nBlockTotal - 1;
this.assert(this.nBlockMask <= BlockInfoPDP10.num.mask);
/*
* Define all the properties to be initialized by initMemory()
*/
this.aBusBlocks = [];
/*
* We're ready to allocate empty Memory blocks to span the entire physical address space.
*/
this.initMemory();
this.setReady();
}
/**
* initMemory()
*
* Allocate enough (empty) Memory blocks to span the entire physical address space.
*
* @this {BusPDP10}
*/
initMemory()
{
var block = new MemoryPDP10(this);
block.copyBreakpoints(this.dbg);
this.aBusBlocks = new Array(this.nBlockTotal);
for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
this.aBusBlocks[iBlock] = block;
}
}
/**
* reset()
*
* @this {BusPDP10}
*/
reset()
{
}
/**
* getWidth()
*
* @this {BusPDP10}
* @return {number}
*/
getWidth()
{
return this.nBusWidth;
}
/**
* powerUp(data, fRepower)
*
* @this {BusPDP10}
* @param {Object|null} data (always null because we supply no powerDown() handler)
* @param {boolean} [fRepower]
* @return {boolean} true if successful, false if failure
*/
powerUp(data, fRepower)
{
if (!fRepower) {
if (!data) {
this.reset();
} else {
if (!this.restore(data)) return false;
}
}
return true;
}
/**
* powerDown(fSave, fShutdown)
*
* @this {BusPDP10}
* @param {boolean} [fSave]
* @param {boolean} [fShutdown]
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
*/
powerDown(fSave, fShutdown)
{
return fSave? this.save() : true;
}
/**
* save()
*
* @this {BusPDP10}
* @return {Object|null}
*/
save()
{
var state = new State(this);
state.set(0, this.saveMemory());
return state.data();
}
/**
* restore(data)
*
* @this {BusPDP10}
* @param {Object} data
* @return {boolean} true if restore successful, false if not
*/
restore(data)
{
return this.restoreMemory(data[0]);
}
/**
* addMemory(addr, size, type)
*
* Adds new Memory blocks to the specified address range. Any Memory blocks previously
* added to that range must first be removed via removeMemory(); otherwise, you'll get
* an allocation conflict error. This helps prevent address calculation errors, redundant
* allocations, etc.
*
* We've relaxed some of the original requirements (ie, that addresses must start at a
* block-granular address, or that sizes must be equal to exactly one or more blocks),
* because machines with large block sizes can make it impossible to load certain ROMs at
* their required addresses. Every allocation still allocates a whole number of blocks.
*
* Even so, BusPDP10 memory management does NOT provide a general-purpose heap. Most memory
* allocations occur during machine initialization and never change. In particular, there
* is NO support for removing partial-block allocations.
*
* Each Memory block keeps track of a start address (addr) and length (used), indicating
* the used space within the block; any free space that precedes or follows that used space
* can be allocated later, by simply extending the beginning or ending of the previously used
* space. However, any holes that might have existed between the original allocation and an
* extension are subsumed by the extension.
*
* @this {BusPDP10}
* @param {number} addr is the starting physical address of the request
* @param {number} size of the request, in bytes
* @param {number} type is one of the MemoryPDP10.TYPE constants
* @return {boolean} true if successful, false if not
*/
addMemory(addr, size, type)
{
var addrNext = addr;
var sizeLeft = size;
var iBlock = addrNext >>> this.nBlockShift;
while (sizeLeft > 0 && iBlock < this.aBusBlocks.length) {
var block = this.aBusBlocks[iBlock];
var addrBlock = iBlock * this.nBlockSize;
var sizeBlock = this.nBlockSize - (addrNext - addrBlock);
if (sizeBlock > sizeLeft) sizeBlock = sizeLeft;
if (block && block.size) {
if (block.type == type) {
/*
* Where there is already a similar block with a non-zero size, we allow the allocation only if:
*
* 1) addrNext + sizeLeft <= block.addr (the request precedes the used portion of the current block), or
* 2) addrNext >= block.addr + block.used (the request follows the used portion of the current block)
*/
if (addrNext + sizeLeft <= block.addr) {
block.used += (block.addr - addrNext);
block.addr = addrNext;
return true;
}
if (addrNext >= block.addr + block.used) {
var sizeAvail = block.size - (addrNext - addrBlock);
if (sizeAvail > sizeLeft) sizeAvail = sizeLeft;
block.used = addrNext - block.addr + sizeAvail;
addrNext = addrBlock + this.nBlockSize;
sizeLeft -= sizeAvail;
iBlock++;
continue;
}
}
return this.reportError(BusPDP10.ERROR.RANGE_INUSE, addrNext, sizeLeft);
}
var blockNew = new MemoryPDP10(this, addrNext, sizeBlock, this.nBlockSize, type);
blockNew.copyBreakpoints(this.dbg, block);
this.aBusBlocks[iBlock++] = blockNew;
addrNext = addrBlock + this.nBlockSize;
sizeLeft -= sizeBlock;
}
if (sizeLeft <= 0) {
this.status("Added " + (size >> 10) + "Kb " + MemoryPDP10.TYPE_NAMES[type] + " at " + Str.toOct(addr));
return true;
}
return this.reportError(BusPDP10.ERROR.RANGE_INVALID, addr, size);
}
/**
* cleanMemory(addr, size)
*
* @this {BusPDP10}
* @param {number} addr
* @param {number} size
* @return {boolean} true if all blocks were clean, false if dirty; all blocks are cleaned in the process
*/
cleanMemory(addr, size)
{
var fClean = true;
var iBlock = addr >>> this.nBlockShift;
while (size > 0 && iBlock < this.aBusBlocks.length) {
if (this.aBusBlocks[iBlock].fDirty) {
this.aBusBlocks[iBlock].fDirty = fClean = false;
this.aBusBlocks[iBlock].fDirtyEver = true;
}
size -= this.nBlockSize;
iBlock++;
}
return fClean;
}
/**
* zeroMemory(addr, size, pattern)
*
* @this {BusPDP10}
* @param {number} addr
* @param {number} size
* @param {number} [pattern]
*/
zeroMemory(addr, size, pattern)
{
var off = addr & this.nBlockLimit;
var iBlock = addr >>> this.nBlockShift;
while (size > 0 && iBlock < this.aBusBlocks.length) {
this.aBusBlocks[iBlock].zero(off, size, pattern);
size -= this.nBlockSize;
iBlock++;
off = 0;
}
}
/**
* scanMemory(info, addr, size)
*
* Returns a BusInfoPDP10 object for the specified address range.
*
* @this {BusPDP10}
* @param {BusInfoPDP10} [info] previous BusInfoPDP10, if any
* @param {number} [addr] starting address of range (0 if none provided)
* @param {number} [size] size of range, in bytes (up to end of address space if none provided)
* @return {BusInfoPDP10} updated info (or new info if no previous info provided)
*/
scanMemory(info, addr, size)
{
if (addr == null) addr = 0;
if (size == null) size = (this.addrTotal - addr) | 0;
if (info == null) info = {cbTotal: 0, cBlocks: 0, aBlocks: []};
var iBlock = addr >>> this.nBlockShift;
var iBlockMax = ((addr + size - 1) >>> this.nBlockShift);
info.cbTotal = 0;
info.cBlocks = 0;
while (iBlock <= iBlockMax) {
var block = this.aBusBlocks[iBlock];
info.cbTotal += block.size;
if (block.size) {
info.aBlocks.push(/** @type {BlockInfoPDP10} */ (Usr.initBitFields(BlockInfoPDP10, iBlock, 0, 0, block.type)));
info.cBlocks++
}
iBlock++;
}
return info;
}
/**
* removeMemory(addr, size)
*
* Replaces every block in the specified address range with empty Memory blocks that ignore all reads/writes.
*
* TODO: Update the removeMemory() interface to reflect the relaxed requirements of the addMemory() interface.
*
* @this {BusPDP10}
* @param {number} addr
* @param {number} size
* @return {boolean} true if successful, false if not
*/
removeMemory(addr, size)
{
if (!(addr & this.nBlockLimit) && size && !(size & this.nBlockLimit)) {
var iBlock = addr >>> this.nBlockShift;
while (size > 0) {
var blockOld = this.aBusBlocks[iBlock];
var blockNew = new MemoryPDP10(this, addr);
blockNew.copyBreakpoints(this.dbg, blockOld);
this.aBusBlocks[iBlock++] = blockNew;
addr = iBlock * this.nBlockSize;
size -= this.nBlockSize;
}
return true;
}
return this.reportError(BusPDP10.ERROR.RANGE_INVALID, addr, size);
}
/**
* getMemoryBlocks(addr, size)
*
* @this {BusPDP10}
* @param {number} addr is the starting physical address
* @param {number} size of the request, in bytes
* @return {Array} of Memory blocks
*/
getMemoryBlocks(addr, size)
{
var aBlocks = [];
var iBlock = addr >>> this.nBlockShift;
while (size > 0 && iBlock < this.aBusBlocks.length) {
aBlocks.push(this.aBusBlocks[iBlock++]);
size -= this.nBlockSize;
}
return aBlocks;
}
/**
* setMemoryBlocks(addr, size, aBlocks, type)
*
* If no type is specified, then specified address range uses all the provided blocks as-is;
* this form of setMemoryBlocks() is used for complete physical aliases.
*
* Otherwise, new blocks are allocated with the specified type; the underlying memory from the
* provided blocks is still used, but the new blocks may have different access to that memory.
*
* @this {BusPDP10}
* @param {number} addr is the starting physical address
* @param {number} size of the request, in bytes
* @param {Array} aBlocks as returned by getMemoryBlocks()
* @param {number} [type] is one of the MemoryPDP10.TYPE constants
*/
setMemoryBlocks(addr, size, aBlocks, type)
{
var i = 0;
var iBlock = addr >>> this.nBlockShift;
while (size > 0 && iBlock < this.aBusBlocks.length) {
var block = aBlocks[i++];
this.assert(block);
if (!block) break;
if (type !== undefined) {
var blockNew = new MemoryPDP10(this, addr);
blockNew.clone(block, type, this.dbg);
block = blockNew;
}
this.aBusBlocks[iBlock++] = block;
size -= this.nBlockSize;
}
}
/**
* getWord(addr)
*
* @this {BusPDP10}
* @param {number} addr is a physical address
* @return {number} word (16-bit) value at that address
*/
getWord(addr)
{
var off = addr & this.nBlockLimit;
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
return this.aBusBlocks[iBlock].readWord(off, addr);
}
/**
* setWord(addr, w)
*
* @this {BusPDP10}
* @param {number} addr is a physical address
* @param {number} w is the word (16-bit) value to write
*/
setWord(addr, w)
{
var off = addr & this.nBlockLimit;
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
this.aBusBlocks[iBlock].writeWord(off, w, addr);
}
/**
* getBlockDirect(addr)
*
* @this {BusPDP10}
* @param {number} addr is a physical address
* @return {MemoryPDP10}
*/
getBlockDirect(addr)
{
return this.aBusBlocks[(addr & this.nBusMask) >>> this.nBlockShift];
}
/**
* getWordDirect(addr)
*
* This is used for device I/O and Debugger physical memory requests, not the CPU.
*
* @this {BusPDP10}
* @param {number} addr is a physical address
* @return {number} word (16-bit) value at that address
*/
getWordDirect(addr)
{
var w;
var off = addr & this.nBlockLimit;
var block = this.getBlockDirect(addr);
w = block.readWordDirect(off, addr);
return w;
}
/**
* setWordDirect(addr, w)
*
* This is used for device I/O and Debugger physical memory requests, not the CPU.
*
* @this {BusPDP10}
* @param {number} addr is a physical address
* @param {number} w is the word (16-bit) value to write (we truncate it to 16 bits to be safe)
*/
setWordDirect(addr, w)
{
var off = addr & this.nBlockLimit;
var block = this.getBlockDirect(addr);
block.writeWordDirect(off, w & 0xffff, addr);
}
/**
* addMemBreak(addr, fWrite)
*
* @this {BusPDP10}
* @param {number} addr
* @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint
*/
addMemBreak(addr, fWrite)
{
if (DEBUGGER) {
var iBlock = addr >>> this.nBlockShift;
this.aBusBlocks[iBlock].addBreakpoint(addr & this.nBlockLimit, fWrite);
}
}
/**
* removeMemBreak(addr, fWrite)
*
* @this {BusPDP10}
* @param {number} addr
* @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint
*/
removeMemBreak(addr, fWrite)
{
if (DEBUGGER) {
var iBlock = addr >>> this.nBlockShift;
this.aBusBlocks[iBlock].removeBreakpoint(addr & this.nBlockLimit, fWrite);
}
}
/**
* saveMemory(fAll)
*
* The only memory blocks we save are those marked as dirty, but most likely all of RAM will have been marked dirty,
* and even if our dirty-memory flags were as smart as our dirty-sector flags (ie, were set only when a write changed
* what was already there), it's unlikely that would reduce the number of RAM blocks we must save/restore. At least
* all the ROM blocks should be clean (except in the unlikely event that the Debugger was used to modify them).
*
* All dirty blocks will be stored in a single array, as pairs of block numbers and data arrays, like so:
*
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
*
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
* surprised to see negative numbers in the data.
*
* The above example assumes "uncompressed" data arrays. If we choose to use "compressed" data arrays, the data arrays
* will look like:
*
* [count0, dw0, count1, dw1, ...]
*
* where each count indicates how many times the following DWORD value occurs. A data array length less than 1K indicates
* that it's compressed, since we'll only store them in compressed form if they actually shrank, and we'll use State
* helper methods compress() and decompress() to create and expand the compressed data arrays.
*
* @this {BusPDP10}
* @param {boolean} [fAll] (true to save all non-ROM memory blocks, regardless of their dirty flags)
* @return {Array} a
*/
saveMemory(fAll)
{
var i = 0;
var a = [];
for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) {
var block = this.aBusBlocks[iBlock];
/*
* We have to check both fDirty and fDirtyEver, because we may have called cleanMemory() on some of
* the memory blocks (eg, video memory), and while cleanMemory() will clear a dirty block's fDirty flag,
* it also sets the dirty block's fDirtyEver flag, which is left set for the lifetime of the machine.
*/
if (fAll && block.type != MemoryPDP10.TYPE.ROM || block.fDirty || block.fDirtyEver) {
a[i++] = iBlock;
a[i++] = State.compress(block.save());
}
}
return a;
}
/**
* restoreMemory(a)
*
* This restores the contents of all Memory blocks; called by CPUState.restore().
*
* In theory, we ONLY have to save/restore block contents. Other block attributes,
* like the type, the memory controller (if any), and the active memory access functions,
* should already be restored, since every component (re)allocates all the memory blocks
* it was using when it's restored. And since the CPU is guaranteed to be the last
* component to be restored, all those blocks (and their attributes) should be in place now.
*
* See saveMemory() for more information on how the memory block contents are saved.
*
* @this {BusPDP10}
* @param {Array} a
* @return {boolean} true if successful, false if not
*/
restoreMemory(a)
{
var i;
for (i = 0; i < a.length - 1; i += 2) {
var iBlock = a[i];
var adw = a[i+1];
if (adw && adw.length < this.nBlockLen) {
adw = State.decompress(adw, this.nBlockLen);
}
var block = this.aBusBlocks[iBlock];
if (!block || !block.restore(adw)) {
/*
* Either the block to restore hasn't been allocated, indicating a change in the machine
* configuration since it was last saved (the most likely explanation) or there's some internal
* inconsistency (eg, the block size is wrong).
*/
Component.error("Unable to restore memory block " + iBlock);
return false;
}
}
return true;
}
/**
* getMemoryLimit(type)
*
* @this {BusPDP10}
* @param {number} type is one of the MemoryPDP10.TYPE constants
* @return {number} (the limiting address of the specified memory type, zero if none)
*/
getMemoryLimit(type)
{
var addr = 0;
for (var iBlock = 0; iBlock < this.aBusBlocks.length; iBlock++) {
var block = this.aBusBlocks[iBlock];
if (block.type == type) {
addr = block.addr + block.used;
}
}
return addr;
}
/**
* reportError(errNum, addr, size, fQuiet)
*
* @this {BusPDP10}
* @param {number} errNum
* @param {number} addr
* @param {number} size
* @param {boolean} [fQuiet] (true if any error should be quietly logged)
* @return {boolean} false
*/
reportError(errNum, addr, size, fQuiet)
{
var sError = "Memory block error (" + errNum + ": " + Str.toHex(addr) + "," + Str.toHex(size) + ")";
if (fQuiet) {
if (this.dbg) {
this.dbg.message(sError);
} else {
this.log(sError);
}
} else {
Component.error(sError);
}
return false;
}
}
BusPDP10.ERROR = {
RANGE_INUSE: 1,
RANGE_INVALID: 2
};
if (NODE) module.exports = BusPDP10;

File diff suppressed because it is too large Load diff

1274
modules/pdp10/lib/cpu.js Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,802 @@
/**
* @fileoverview Implements the PDP-10 CPU component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
if (NODE) {
var Str = require("../../shared/lib/strlib");
var Web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
var PDP10 = require("./defines");
var BusPDP10 = require("./bus");
var CPUPDP10 = require("./cpu");
var MessagesPDP10 = require("./messages");
var MemoryPDP10 = require("./memory");
}
/*
* Overview of Device Interrupt Support
*
* Originally, the CPU maintained a queue of requested interrupts. Entries in this queue recorded a device's
* priority, vector, and delay (ie, a number of instructions to execute before dispatching the interrupt). This
* queue would constantly grow and shrink as requests were issued and dispatched, and as long as there was something
* in the queue, the CPU was constantly examining it.
*
* Now we are trying something more efficient. First, for devices that require delays (like the SerialPort's receiver
* and transmitter buffer registers, which are supposed to "clock" the data in and out at a specific baud rate), the
* CPU offers timer services that will "fire" a callback after a specified delay, which are much more efficient than
* requiring the CPU to dive into an interrupt queue and decrement delay counts on every instruction.
*
* Second, devices that generate interrupts will allocate an IRQ object during initialization; we will no longer
* be creating and destroying interrupt event objects and inserting/deleting them in a constantly changing queue.
* Each IRQ contains properties that never change (eg, the vector and priority), along with a "next" pointer that's
* only used when the IRQ is active.
*
* When a device decides it's time to interrupt (either at the end of some I/O operation or when a timer has fired),
* it will simply set the IRQ, which basically means that the IRQ will be linked onto a list of active IRQs, in
* priority order, so that when the CPU is ready to acknowledge interrupts, it need only check the top of the active
* IRQ list.
*/
/**
* @typedef {{
* vector: number,
* priority: number,
* message: number,
* name: (string|null),
* next: (IRQ|null)
* }}
*/
var IRQ;
/**
* @class CPUStatePDP10
* @unrestricted
*/
class CPUStatePDP10 extends CPUPDP10 {
/**
* CPUStatePDP10(parmsCPU)
*
* The CPUStatePDP10 class uses the following (parmsCPU) properties:
*
* model: a number (eg, 1001) that should match one of the PDP10.MODEL_* values
* 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)
* CPU model number.
*
* @param {Object} parmsCPU
*/
constructor(parmsCPU)
{
var nCyclesDefault = 0;
var model = +parmsCPU['model'] || PDP10.MODEL_KA10;
switch(model) {
case PDP10.MODEL_KA10:
default:
nCyclesDefault = 6666667;
break;
}
/*
* ES6 ALERT: Classes cannot access "this" until all superclasses have been initialized as well.
*/
super(parmsCPU, nCyclesDefault);
this.model = model;
this.addrReset = +parmsCPU['addrReset'] || 0;
/** @type {IRQ|null} */
this.irqNext = null; // the head of the active IRQ list, in priority order
/** @type {Array.<IRQ>} */
this.aIRQs = []; // list of all IRQs, active or not (to be used for auto-configuration)
this.flags.complete = false;
}
/**
* initBus(cmp, bus, cpu, dbg)
*
* Called once the Bus has been initialized.
*
* @this {CPUStatePDP10}
* @param {ComputerPDP10} cmp
* @param {BusPDP10} bus
* @param {CPUPDP10} cpu
* @param {DebuggerPDP10} dbg
*/
initBus(cmp, bus, cpu, dbg)
{
super.initBus(cmp, bus, cpu, dbg);
}
/**
* reset()
*
* @this {CPUStatePDP10}
*/
reset()
{
this.status("Model " + this.model);
if (this.flags.running) this.stopCPU();
this.initCPU();
this.resetCycles();
this.clearError(); // clear any fatal error/exception that setError() may have flagged
super.reset();
}
/**
* initCPU()
*
* @this {CPUStatePDP10}
*/
initCPU()
{
this.regPC = this.pcLast = this.addrReset;
/*
* This is queried and displayed by the Panel when it's not displaying its own ADDRESS register
* (which takes precedence when, for example, you've manually halted the CPU and are independently
* examining the contents of other addresses).
*
* We initialize it to the current PC.
*/
this.addrLast = this.regPC;
/*
* opFlags contains various conditions that stepCPU() needs to be aware of.
*/
this.opFlags = 0;
this.setMemoryAccess();
this.resetIRQs();
}
/**
* setMemoryAccess()
*
* @this {CPUStatePDP10}
*/
setMemoryAccess()
{
this.readWord = this.readWordFromPhysical;
this.writeWord = this.writeWordToPhysical;
}
/**
* setReset(addr, fStart, bUnit, addrStack)
*
* @this {CPUStatePDP10}
* @param {number} addr
* @param {boolean} [fStart] (true if a "startable" image was just loaded, false if not)
* @param {number} [bUnit] (boot unit #)
* @param {number} [addrStack]
*/
setReset(addr, fStart, bUnit, addrStack)
{
this.addrReset = addr;
this.setPC(addr);
if (fStart) {
if (!this.flags.powered) {
this.flags.autoStart = true;
}
else if (!this.flags.running) {
this.startCPU();
}
}
else {
if (this.dbg && this.flags.powered) {
/*
* TODO: Review the decision to always stop the CPU if the Debugger is loaded. Note that
* when stopCPU() stops a running CPU, the Debugger gets notified, so no need to notify it again.
*
* TODO: There are more serious problems to deal with if another component is slamming a new PC down
* the CPU's throat (presumably while also dropping some new code into RAM) while the CPU is running;
* we should probably force a complete reset, but for now, it's up to the user to hit the reset button
* themselves.
*/
if (!this.stopCPU() && !this.cmp.flags.reset) {
this.dbg.updateStatus();
this.cmp.updateDisplays(-1);
}
}
else if (fStart === false) {
this.stopCPU();
}
}
if (!this.isRunning() && this.panel) this.panel.stop();
}
/**
* getChecksum()
*
* TODO: Implement
*
* @this {CPUStatePDP10}
* @return {number} a 32-bit summation of key elements of the current CPU state (used by the CPU checksum code)
*/
getChecksum()
{
return 0;
}
/**
* save()
*
* @this {CPUStatePDP10}
* @return {Object|null}
*/
save()
{
var state = new State(this);
state.set(0, [
this.regPC,
this.pcLast,
this.addrLast,
this.opFlags
]);
state.set(1, []);
state.set(2, [this.nTotalCycles, this.getSpeed(), this.flags.autoStart]);
state.set(3, this.saveIRQs());
state.set(4, this.saveTimers());
return state.data();
}
/**
* restore(data)
*
* @this {CPUStatePDP10}
* @param {Object} data
* @return {boolean} true if restore successful, false if not
*/
restore(data)
{
/*
* ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse
* of what save() does when it collects a bunch of object properties into an array.
*/
[
this.regPC,
this.pcLast,
this.addrLast,
this.opFlags
] = data[0];
var a = data[2];
this.nTotalCycles = a[0];
this.setSpeed(a[1]);
this.flags.autoStart = a[2];
this.restoreIRQs(data[3]);
this.restoreTimers(data[4]);
return true;
}
/**
* getOpcode()
*
* NOTE: This function is nothing more than a convenience, and we fully expect it to be inlined at runtime.
*
* @this {CPUStatePDP10}
* @return {number}
*/
getOpcode()
{
var pc = this.regPC;
var opCode = this.readWord(pc);
this.regPC = (pc + 1) % PDP10.ADDR_LIMIT;
return opCode;
}
/**
* advancePC(off)
*
* NOTE: This function is nothing more than a convenience, and we fully expect it to be inlined at runtime.
*
* @this {CPUStatePDP10}
* @param {number} off
* @return {number} (original PC)
*/
advancePC(off)
{
var pc = this.regPC;
this.regPC = (pc + off) % PDP10.ADDR_LIMIT;
return pc;
}
/**
* getPC()
*
* NOTE: This function is nothing more than a convenience, and we fully expect it to be inlined at runtime.
*
* @this {CPUStatePDP10}
* @return {number}
*/
getPC()
{
return this.regPC;
}
/**
* getLastAddr()
*
* @this {CPUStatePDP10}
* @return {number}
*/
getLastAddr()
{
return this.addrLast;
}
/**
* getLastPC()
*
* @this {CPUStatePDP10}
* @return {number}
*/
getLastPC()
{
return this.pcLast;
}
/**
* setPC()
*
* NOTE: Unlike other PCjs emulators, such as PCx86, where all PC updates MUST go through the setPC()
* function, this function is nothing more than a convenience, because in the PDP-11, the PC can be loaded
* like any other general register. We fully expect this function to be inlined at runtime.
*
* @this {CPUStatePDP10}
* @param {number} addr
*/
setPC(addr)
{
this.regPC = addr % PDP10.ADDR_LIMIT;
}
/**
* addIRQ(vector, priority, message)
*
* @this {CPUStatePDP10}
* @param {number} vector (-1 for floating vector)
* @param {number} priority
* @param {number} [message]
* @return {IRQ}
*/
addIRQ(vector, priority, message)
{
var irq = {vector: vector, priority: priority, message: message || 0, name: null, next: null};
this.aIRQs.push(irq);
return irq;
}
/**
* insertIRQ(irq)
*
* @this {CPUStatePDP10}
* @param {IRQ} irq
*/
insertIRQ(irq)
{
if (irq != this.irqNext) {
var irqPrev = this.irqNext;
if (!irqPrev || irqPrev.priority <= irq.priority) {
irq.next = irqPrev;
this.irqNext = irq;
} else {
do {
var irqNext = irqPrev.next;
if (!irqNext || irqNext.priority <= irq.priority) {
irq.next = irqNext;
irqPrev.next = irq;
break;
}
irqPrev = irqNext;
} while (irqPrev);
}
}
/*
* See the writeXCSR() function for an explanation of why signalling an IRQ hardware interrupt
* should be done using IRQ_DELAY rather than setting IRQ directly.
*/
this.opFlags |= PDP10.OPFLAG.IRQ_DELAY;
}
/**
* removeIRQ(irq)
*
* @this {CPUStatePDP10}
* @param {IRQ} irq
*/
removeIRQ(irq)
{
var irqPrev = this.irqNext;
if (irqPrev == irq) {
this.irqNext = irq.next;
} else {
while (irqPrev) {
var irqNext = irqPrev.next;
if (irqNext == irq) {
irqPrev.next = irqNext.next;
break;
}
irqPrev = irqNext;
}
}
/*
* We could also set irq.next to null now, but strictly speaking, that shouldn't be necessary.
*
* Last but not least, if there's still an IRQ on the active IRQ list, we need to make sure IRQ_DELAY
* is still set.
*/
if (this.irqNext) {
this.opFlags |= PDP10.OPFLAG.IRQ_DELAY;
}
}
/**
* setIRQ(irq)
*
* @this {CPUStatePDP10}
* @param {IRQ|null} irq
*/
setIRQ(irq)
{
if (irq) {
this.insertIRQ(irq);
if (irq.message && this.messageEnabled(irq.message | MessagesPDP10.INT)) {
this.printMessage("setIRQ(vector=" + Str.toOct(irq.vector) + ",priority=" + irq.priority + ")", true, true);
}
}
}
/**
* clearIRQ(irq)
*
* @this {CPUStatePDP10}
* @param {IRQ|null} irq
*/
clearIRQ(irq)
{
if (irq) {
this.removeIRQ(irq);
if (irq.message && this.messageEnabled(irq.message | MessagesPDP10.INT)) {
this.printMessage("clearIRQ(vector=" + Str.toOct(irq.vector) + ",priority=" + irq.priority + ")", true, true);
}
}
}
/**
* findIRQ(vector)
*
* @this {CPUStatePDP10}
* @param {number} vector
* @return {IRQ|null}
*/
findIRQ(vector)
{
for (var i = 0; i < this.aIRQs.length; i++) {
var irq = this.aIRQs[i];
if (irq.vector === vector) return irq;
}
return null;
}
/**
* checkIRQs(priority)
*
* @this {CPUStatePDP10}
* @param {number} priority
* @return {IRQ|null}
*/
checkIRQs(priority)
{
return (this.irqNext && this.irqNext.priority > priority)? this.irqNext : null;
}
/**
* resetIRQs(priority)
*
* @this {CPUStatePDP10}
*/
resetIRQs()
{
this.irqNext = null;
}
/**
* saveIRQs()
*
* @this {CPUStatePDP10}
* @return {Array.<number>}
*/
saveIRQs()
{
var aIRQVectors = [];
var irq = this.irqNext;
while (irq) {
aIRQVectors.push(irq.vector);
irq = irq.next;
}
return aIRQVectors;
}
/**
* restoreIRQs(aIRQVectors)
*
* @this {CPUStatePDP10}
* @param {Array.<number>} aIRQVectors
*/
restoreIRQs(aIRQVectors)
{
for (var i = aIRQVectors.length - 1; i >= 0; i--) {
var irq = this.findIRQ(aIRQVectors[i]);
this.assert(irq != null);
if (irq) {
irq.next = this.irqNext;
this.irqNext = irq;
}
}
}
/**
* checkInterrupts()
*
* @this {CPUStatePDP10}
* @return {boolean} true if an interrupt was dispatched, false if not
*/
checkInterrupts()
{
var fInterrupt = false;
if (this.opFlags & PDP10.OPFLAG.IRQ) {
// var vector = PDP10.TRAP.PIRQ;
// var priority = (this.regPIR & PDP10.PSW.PRI) >> PDP10.PSW.SHIFT.PRI;
//
// var irq = this.checkIRQs(priority);
// if (irq) {
// vector = irq.vector;
// priority = irq.priority;
// }
//
// if (this.dispatchInterrupt(vector, priority)) {
// if (irq) this.removeIRQ(irq);
// fInterrupt = true;
// }
if (!this.irqNext) {
this.opFlags &= ~PDP10.OPFLAG.IRQ;
}
}
else if (this.opFlags & PDP10.OPFLAG.IRQ_DELAY) {
/*
* We know that IRQ (bit 2) is clear, so since IRQ_DELAY (bit 0) is set, incrementing opFlags
* will eventually transform IRQ_DELAY into IRQ, without affecting any other (higher) bits.
*/
this.opFlags++;
}
return fInterrupt;
}
/**
* dispatchInterrupt(vector, priority)
*
* TODO: The process of dispatching an interrupt MUST cost some cycles; either trap() needs to assess
* that cost, or we do.
*
* @this {CPUStatePDP10}
* @param {number} vector
* @param {number} priority
* @return {boolean} (true if dispatched, false if not)
*/
dispatchInterrupt(vector, priority)
{
return false;
}
/**
* isWaiting()
*
* @this {CPUStatePDP10}
* @return {boolean} (true if OPFLAG.WAIT is set, false otherwise)
*/
isWaiting()
{
return !!(this.opFlags & PDP10.OPFLAG.WAIT);
}
/**
* readWordFromPhysical(addr)
*
* This is a handler set up by setMemoryAccess(). All calls should go through readWord().
*
* @this {CPUStatePDP10}
* @param {number} addr
* @return {number}
*/
readWordFromPhysical(addr)
{
return this.bus.getWord(this.addrLast = addr);
}
/**
* writeWordToPhysical(addr, data)
*
* This is a handler set up by setMemoryAccess(). All calls should go through writeWord().
*
* @this {CPUStatePDP10}
* @param {number} addr
* @param {number} data
*/
writeWordToPhysical(addr, data)
{
this.bus.setWord(this.addrLast = addr, data);
}
/**
* stepCPU(nMinCycles)
*
* NOTE: Single-stepping should not be confused with the Trap flag; single-stepping is a Debugger
* operation that's completely independent of Trap status. The CPU can go in and out of Trap mode,
* in and out of h/w interrupt service routines (ISRs), etc, but from the Debugger's perspective,
* they're all one continuous stream of instructions that can be stepped or run at will. Moreover,
* stepping vs. running should never change the behavior of the simulation.
*
* @this {CPUStatePDP10}
* @param {number} nMinCycles (0 implies a single-step, and therefore breakpoints should be ignored)
* @return {number} of cycles executed; 0 indicates a pre-execution condition (ie, an execution breakpoint
* was hit), -1 indicates a post-execution condition (eg, a read or write breakpoint was hit), and a positive
* number indicates successful completion of that many cycles (which should always be >= nMinCycles).
*/
stepCPU(nMinCycles)
{
/*
* The Debugger uses complete to determine if the instruction completed (true) or was interrupted
* by a breakpoint or some other exceptional condition (false). NOTE: this does NOT include JavaScript
* exceptions, which stepCPU() expects the caller to catch using its own exception handler.
*
* The CPU relies on the use of stopCPU() rather than complete, because the CPU never single-steps
* (ie, nMinCycles is always some large number), whereas the Debugger does. And conversely, when the
* Debugger is single-stepping (even when performing multiple single-steps), fRunning is never set,
* so stopCPU() would have no effect as far as the Debugger is concerned.
*/
this.flags.complete = true;
/*
* nDebugCheck is 1 if we want the Debugger's checkInstruction() to check every instruction,
* -1 if we want it to check just the first instruction, and 0 if there's no need for any checks.
*/
var nDebugCheck = (DEBUGGER && this.dbg)? (this.dbg.checksEnabled()? 1 : (this.flags.starting? -1 : 0)) : 0;
/*
* nDebugState is needed only when nDebugCheck is non-zero; it is -1 if this is a single-step, 0 if
* this is the start of a new run, and 1 if this is a continuation of a previous run. It is used by
* checkInstruction() to determine if it should skip breakpoint checks and/or HALT instructions (ie,
* if nDebugState is <= zero).
*/
var nDebugState = (!nMinCycles)? -1 : (this.flags.starting? 0 : 1);
this.flags.starting = false; // we've moved beyond "starting" and have officially "started" now
/*
* We move the minimum cycle count to nStepCycles (the number of cycles left to step), so that other
* functions have the ability to force that number to zero (eg, stopCPU()), and thus we don't have to check
* any other criteria to determine whether we should continue stepping or not.
*/
this.nBurstCycles = this.nStepCycles = nMinCycles;
/*
* And finally, move the nDebugCheck state to an OPFLAG bit, so that the loop need check only one variable.
*/
this.opFlags = (this.opFlags & ~PDP10.OPFLAG.DEBUGGER) | (nDebugCheck? PDP10.OPFLAG.DEBUGGER : 0);
do {
if (this.opFlags) {
/*
* NOTE: We still check DEBUGGER to ensure that this code will be compiled out of existence in
* non-DEBUGGER builds.
*/
if (DEBUGGER && (this.opFlags & PDP10.OPFLAG.DEBUGGER)) {
if (this.dbg.checkInstruction(this.getPC(), nDebugState)) {
this.stopCPU();
break;
}
if (!++nDebugCheck) this.opFlags &= ~PDP10.OPFLAG.DEBUGGER;
if (!nDebugState) nDebugState++;
}
/*
* If we're in the IRQ or WAIT state, check for any pending interrupts.
*
* NOTE: It's no coincidence that we're checking this BEFORE any pending traps, because in rare
* cases (including some presented by those pesky "TRAP TEST" diagnostics), the process of dispatching
* an interrupt can trigger a TRAP_SP stack overflow condition, which must be dealt with BEFORE we
* execute the first instruction of the interrupt handler.
*/
if ((this.opFlags & (PDP10.OPFLAG.IRQ_MASK | PDP10.OPFLAG.WAIT)) /* && nDebugState >= 0 */) {
if (this.checkInterrupts()) {
if ((this.opFlags & PDP10.OPFLAG.DEBUGGER) && this.dbg.checkInstruction(this.getPC(), nDebugState)) {
this.stopCPU();
break;
}
/*
* Since an interrupt was just dispatched, altering the normal flow of time and changing
* the future as we knew it, let's break out immediately if we're single-stepping, so that
* the Debugger gets to see the first instruction of the interrupt handler. NOTE: This
* assumes that we've still commented out the nDebugState check above that used to bypass
* checkInterrupts() when single-stepping.
*/
if (nDebugState < 0) break;
}
}
}
this.opFlags &= PDP10.OPFLAG.PRESERVE;
var opCode = this.getOpcode();
// this.decode(opCode);
} while (this.nStepCycles > 0);
return (this.flags.complete? this.nBurstCycles - this.nStepCycles : (this.flags.complete === false? -1 : 0));
}
/**
* CPUStatePDP10.init()
*
* This function operates on every HTML element of class "cpu", extracting the
* JSON-encoded parameters for the CPUStatePDP10 constructor from the element's "data-value"
* attribute, invoking the constructor (which in turn invokes the CPU constructor)
* to create a CPUStatePDP10 component, and then binding any associated HTML controls to the
* new component.
*/
static init()
{
var aeCPUs = Component.getElementsByClass(document, PDP10.APPCLASS, "cpu");
for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new CPUStatePDP10(parmsCPU);
Component.bindComponentControls(cpu, eCPU, PDP10.APPCLASS);
}
}
}
/*
* Initialize every CPU module on the page
*/
Web.onInit(CPUStatePDP10.init);
if (NODE) module.exports = CPUStatePDP10;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,148 @@
/**
* @fileoverview PDP10-specific compile-time definitions.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
/**
* @define {string}
*/
var APPCLASS = "pdp10"; // this @define is the default application class (eg, "pcx86", "c1pjs")
/**
* APPNAME is used more for display purposes than anything else now. APPCLASS is what matters in terms
* of folder and file names, CSS styles, etc.
*
* @define {string}
*/
var APPNAME = "PDPjs"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
/**
* WARNING: DEBUGGER needs to accurately reflect whether or not the Debugger component is (or will be) loaded.
* In the compiled case, we rely on the Closure Compiler to override DEBUGGER as appropriate. When it's *false*,
* nearly all of debugger.js will be conditionally removed by the compiler, reducing it to little more than a
* "type skeleton", which also solves some type-related warnings we would otherwise have if we tried to remove
* debugger.js from the compilation process altogether.
*
* However, when we're in "development mode" and running uncompiled code in debugger-less configurations,
* I would like to skip loading debugger.js altogether. When doing that, we must ALSO arrange for an additional file
* (nodebugger.js) to be loaded immediately after this file, which *explicitly* overrides DEBUGGER with *false*.
*
* @define {boolean}
*/
var DEBUGGER = true; // this @define is overridden by the Closure Compiler to remove Debugger-related support
/*
* Combine all the shared globals and machine-specific globals into one machine-specific global object,
* which all machine components should start using; eg: "if (PDP10.DEBUG) ..." instead of "if (DEBUG) ...".
*/
var PDP10 = {
APPCLASS: APPCLASS,
APPNAME: APPNAME,
APPVERSION: APPVERSION, // shared
COMPILED: COMPILED, // shared
CSSCLASS: CSSCLASS, // shared
DEBUG: DEBUG, // shared
DEBUGGER: DEBUGGER,
MAXDEBUG: MAXDEBUG, // shared
PRIVATE: PRIVATE, // shared
SITEHOST: SITEHOST, // shared
XMLVERSION: XMLVERSION, // shared
/*
* CPU model numbers (supported)
*
* The 11/20 includes the 11/10, which is not identified separately because there was
* nothing functionally different about it.
*
* The 11/40 added the MODE bits to the PSW (but only KERNEL=00 and USER=11) and 18-bit
* addressing via an MMU; there was still only one register set.
*
* The 11/45 added REGSET bit to the PSW (to support a second register set), SUPER=01
* mode to the existing KERNEL=00 and USER=11 modes, separate I/D spaces, and other MMU
* extensions (eg, MMR1 and MMR3).
*
* The 11/70 added 22-bit addressing and corresponding extensions to the MMU.
*/
MODEL_KA10: 1001,
/*
* This constant is used to mark points in the code where the physical address being returned
* is invalid and should not be used.
*
* In a 32-bit CPU, -1 (ie, 0xffffffff) could actually be a valid address, so consider changing
* ADDR_INVALID to NaN or null (which is also why all ADDR_INVALID tests should use strict equality
* operators).
*
* The main reason I'm NOT using NaN or null now is my concern that, by mixing non-numbers
* (specifically, values outside the range of signed 32-bit integers), performance may suffer.
*
* WARNING: Like many of the properties defined here, ADDR_INVALID is a common constant, which the
* Closure Compiler will happily inline (with or without @const annotations; in fact, I've yet to
* see a @const annotation EVER improve automatic inlining). However, if you don't make ABSOLUTELY
* certain that this file is included BEFORE the first reference to any of these properties, that
* automatic inlining will no longer occur.
*/
ADDR_INVALID: -1,
ADDR_LIMIT: Math.pow(2, 18),
DATA_INVALID: 0,
DATA_LIMIT: Math.pow(2, 36),
/*
* Assorted common opcodes
*/
OPCODE: {
HALT: 0o000000000000, // TODO: Resolve
INVALID: 0o777777777777 // TODO: Resolve
},
/*
* Internal operation state flags
*/
OPFLAG: {
IRQ_DELAY: 0x0001, // incremented until it becomes IRQ
IRQ: 0x0002, // time to call checkInterrupts()
IRQ_MASK: 0x0003,
DEBUGGER: 0x0004, // set if the Debugger wants to perform checks
WAIT: 0x0008, // WAIT operation in progress
PRESERVE: 0x000F, // OPFLAG bits to preserve prior to the next instruction
}
};
/*
* Combine all the shared globals and machine-specific globals into one machine-specific global object,
* which all machine components should start using; eg: "if (PDP10.DEBUGGER)" instead of "if (DEBUGGER)".
*/
PDP10.APPCLASS = APPCLASS;
PDP10.APPNAME = APPNAME;
PDP10.DEBUGGER = DEBUGGER;
if (NODE) {
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.PDP10 = PDP10;
module.exports = PDP10;
}

172
modules/pdp10/lib/device.js Normal file
View file

@ -0,0 +1,172 @@
/**
* @fileoverview Implements PDP-10 device support.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
if (NODE) {
var Str = require("../../shared/lib/strlib");
var Web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
var PDP10 = require("./defines");
var BusPDP10 = require("./bus");
var MemoryPDP10 = require("./memory");
var MessagesPDP10 = require("./messages");
}
class DevicePDP10 extends Component {
/**
* DevicePDP10(parmsDevice)
*
* @param {Object} parmsDevice
*/
constructor(parmsDevice)
{
super("Device", parmsDevice, MessagesPDP10.DEVICE);
}
/**
* initBus(cmp, bus, cpu, dbg)
*
* @this {DevicePDP10}
* @param {ComputerPDP10} cmp
* @param {BusPDP10} bus
* @param {CPUStatePDP10} cpu
* @param {DebuggerPDP10} dbg
*/
initBus(cmp, bus, cpu, dbg)
{
this.bus = bus;
this.cmp = cmp;
this.cpu = cpu;
this.dbg = dbg;
this.setReady();
}
/**
* powerUp(data, fRepower)
*
* @this {DevicePDP10}
* @param {Object|null} data
* @param {boolean} [fRepower]
* @return {boolean} true if successful, false if failure
*/
powerUp(data, fRepower)
{
if (!fRepower) {
if (!data) {
this.reset();
} else {
if (!this.restore(data)) return false;
}
}
return true;
}
/**
* powerDown(fSave, fShutdown)
*
* @this {DevicePDP10}
* @param {boolean} [fSave]
* @param {boolean} [fShutdown]
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
*/
powerDown(fSave, fShutdown)
{
return fSave? this.save() : true;
}
/**
* reset()
*
* @this {DevicePDP10}
*/
reset()
{
}
/**
* save()
*
* This implements save support for the DevicePDP10 component.
*
* @this {DevicePDP10}
* @return {Object}
*/
save()
{
var state = new State(this);
return state.data();
}
/**
* restore(data)
*
* This implements restore support for the DevicePDP10 component.
*
* @this {DevicePDP10}
* @param {Object} data
* @return {boolean} true if successful, false if failure
*/
restore(data)
{
return true;
}
/**
* DevicePDP10.init()
*
* This function operates on every HTML element of class "device", extracting the
* JSON-encoded parameters for the DevicePDP10 constructor from the element's "data-value"
* attribute, invoking the constructor to create a DevicePDP10 component, and then binding
* any associated HTML controls to the new component.
*/
static init()
{
var aeDevice = Component.getElementsByClass(document, PDP10.APPCLASS, "device");
for (var iDevice = 0; iDevice < aeDevice.length; iDevice++) {
var device;
var eDevice = aeDevice[iDevice];
var parmsDevice = Component.getComponentParms(eDevice);
switch(parmsDevice['type']) {
case 'default':
device = new DevicePDP10(parmsDevice);
Component.bindComponentControls(device, eDevice, PDP10.APPCLASS);
break;
}
}
}
}
/*
* Initialize all the DevicePDP10 modules on the page.
*/
Web.onInit(DevicePDP10.init);
if (NODE) module.exports = DevicePDP10;

640
modules/pdp10/lib/memory.js Normal file
View file

@ -0,0 +1,640 @@
/**
* @fileoverview Implements the PDP-10 Memory component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
if (NODE) {
var Component = require("../../shared/lib/component");
var Int36 = require("../../shared/lib/int36");
var PDP10 = require("./defines");
var MessagesPDP10 = require("./messages");
}
/**
* @class DataView
* @property {function(number,boolean):number} getUint8
* @property {function(number,number,boolean)} setUint8
* @property {function(number,boolean):number} getUint16
* @property {function(number,number,boolean)} setUint16
* @property {function(number,boolean):number} getInt32
* @property {function(number,number,boolean)} setInt32
*/
class MemoryPDP10 {
/**
* MemoryPDP10(bus, addr, used, size, type)
*
* The Bus component allocates Memory objects so that each has a memory buffer with a
* block-granular starting address and an address range equal to bus.nBlockSize; however,
* the size of any given Memory object's underlying buffer can be either zero or bus.nBlockSize;
* memory read/write functions for empty (buffer-less) blocks are mapped to readNone/writeNone.
*
* The Bus allocates empty blocks for the entire address space during initialization, so that
* any reads/writes to undefined addresses will have no effect. Later, the ROM and RAM
* components will ask the Bus to allocate memory for specific ranges, and the Bus will allocate
* as many new blockSize Memory objects as the ranges require. Partial Memory blocks could
* also be supported in theory, but in practice, they're not.
*
* WARNING: Since Memory blocks are low-level objects that have no UI requirements, they
* do not inherit from the Component class, so if you want to use any Component class methods,
* such as Component.assert(), use the corresponding Debugger methods instead (assuming a debugger
* is available).
*
* @param {BusPDP10} bus
* @param {number|null} [addr] of lowest used address in block
* @param {number} [used] portion of block in words (0 for none)
* @param {number} [size] of block's buffer in words (0 for none)
* @param {number} [type] is one of the MemoryPDP10.TYPE constants (default is MemoryPDP10.TYPE.NONE)
*/
constructor(bus, addr, used, size, type)
{
var a, i;
this.bus = bus;
this.id = (MemoryPDP10.idBlock += 2);
this.adw = null;
this.offset = 0;
this.addr = addr;
this.used = used;
this.size = size || 0;
this.type = type || MemoryPDP10.TYPE.NONE;
this.fReadOnly = (type == MemoryPDP10.TYPE.ROM);
this.dbg = null;
this.readBits = this.readBitsDirect = this.readNone;
this.readWord = this.readWordDirect = this.readWordDefault;
this.writeBits = this.writeBitsDirect = this.writeNone;
this.writeWord = this.writeWordDirect = this.writeWordDefault;
this.cReadBreakpoints = this.cWriteBreakpoints = 0;
this.copyBreakpoints(); // initialize the block's Debugger info; the caller will reinitialize
/*
* TODO: Study the impact of dirty block tracking. The original purposes were to allow saveMemory()
* to save only dirty blocks, and to enable the Video component to quickly detect changes to the video buffer.
*
* However, a quick test with dirty block tracking disabled didn't yield a noticeable improvement in performance,
* so I think the overhead of our block-based architecture is swamping the impact of these micro-updates.
*/
this.fDirty = this.fDirtyEver = false;
/*
* For empty memory blocks, all we need to do is ensure all access functions are mapped to "none" handlers.
*/
if (!this.size) {
this.setAccess();
return;
}
/*
* This is the normal case: allocate a buffer that provides a word of data per address;
* no controller is required because our default memory access functions (see afnMemory)
* know how to deal with this simple 1-1 mapping of addresses to words.
*
* TODO: Consider initializing the memory array to random (or pseudo-random) values in DEBUG
* mode; pseudo-random might be best, to help make any bugs reproducible.
*/
a = this.aw = new Array(this.size);
for (i = 0; i < a.length; i++) a[i] = 0;
this.setAccess(MemoryPDP10.afnMemory);
}
/**
* init(addr)
*
* Quick reinitializer when reusing a Memory block.
*
* @this {MemoryPDP10}
* @param {number} addr
*/
init(addr)
{
this.addr = addr;
}
/**
* clone(mem, type, dbg)
*
* Converts the current Memory block (this) into a clone of the given Memory block (mem),
* and optionally overrides the current block's type with the specified type.
*
* @this {MemoryPDP10}
* @param {MemoryPDP10} mem
* @param {number} [type]
* @param {DebuggerPDP10} [dbg]
*/
clone(mem, type, dbg)
{
/*
* Original memory block IDs are even; cloned memory block IDs are odd;
* the original ID of the current block is lost, but that's OK, since it was presumably
* produced merely to become a clone.
*/
this.id = mem.id | 0x1;
this.used = mem.used;
this.size = mem.size;
if (type) {
this.type = type;
this.fReadOnly = (type == MemoryPDP10.TYPE.ROM);
}
this.aw = mem.aw;
this.setAccess(MemoryPDP10.afnMemory);
this.copyBreakpoints(dbg, mem);
}
/**
* save()
*
* This gets the contents of a Memory block as an array of numeric values; used by Bus.saveMemory(),
* which in turn is called by CPUState.save().
*
* @this {MemoryPDP10}
* @return {Array.<number>|null}
*/
save()
{
return this.aw;
}
/**
* restore(aw)
*
* This restores the contents of a Memory block from an array of numeric values; used by Bus.restoreMemory(),
* which is called by CPUState.restore(), after all other components have been restored and thus all Memory
* blocks have been allocated by their respective components.
*
* @this {MemoryPDP10}
* @param {Array.<number>|null} aw
* @return {boolean} true if successful, false if block size mismatch
*/
restore(aw)
{
if (aw && this.size == aw.length) {
this.aw = aw;
this.fDirty = true;
return true;
}
return false;
}
/**
* zero(off, len, pattern)
*
* @this {MemoryPDP10}
* @param {number} [off] (optional starting word offset within block)
* @param {number} [len] (optional maximum number of words; default is the entire block)
* @param {number} [pattern]
*/
zero(off, len, pattern)
{
var i;
off = off || 0;
pattern = Int36.validate(pattern || 0);
/*
* NOTE: If len happens to be larger than the block, that's OK, because we also bounds-check the index.
*/
if (len === undefined) len = this.size;
Component.assert(off >= 0 && off < this.size);
for (i = off; len-- && i < this.size; i++) this.writeWordDirect(off, pattern, this.addr + off);
}
/**
* setAccess(afn, fDirect)
*
* The afn parameter should be a 4-entry function table containing two bits handlers and
* two word handlers. See the static afnMemory table for an example.
*
* If no function table is specified, a default is selected based on the Memory type;
* similarly, any undefined entries in the table are filled with default handlers that fall
* back to the bits handlers, and if one or both bits handlers are undefined, they default
* to handlers that simply ignore the access.
*
* fDirect indicates that both the default AND the direct handlers should be updated. Direct
* handlers normally match the default handlers, except when "checked" handlers are installed;
* this allows "checked" handlers to know where to dispatch the call after performing checks.
* Examples of checks are read/write breakpoints, but it's really up to the Debugger to decide
* what the check consists of.
*
* @this {MemoryPDP10}
* @param {Array.<function()>} [afn] function table
* @param {boolean} [fDirect] (true to update direct access functions as well; default is true)
*/
setAccess(afn, fDirect)
{
if (!afn) {
Component.assert(this.type == MemoryPDP10.TYPE.NONE);
afn = MemoryPDP10.afnNone;
}
this.setReadAccess(afn, fDirect);
this.setWriteAccess(afn, fDirect);
}
/**
* setReadAccess(afn, fDirect)
*
* @this {MemoryPDP10}
* @param {Array.<function()>} afn
* @param {boolean} [fDirect]
*/
setReadAccess(afn, fDirect)
{
if (!fDirect || !this.cReadBreakpoints) {
this.readBits = afn[0] || this.readNone;
this.readWord = afn[2] || this.readWordDefault;
}
if (fDirect || fDirect === undefined) {
this.readBitsDirect = afn[0] || this.readNone;
this.readWordDirect = afn[2] || this.readWordDefault;
}
}
/**
* setWriteAccess(afn, fDirect)
*
* @this {MemoryPDP10}
* @param {Array.<function()>} afn
* @param {boolean} [fDirect]
*/
setWriteAccess(afn, fDirect)
{
if (!fDirect || !this.cWriteBreakpoints) {
this.writeBits = !this.fReadOnly && afn[1] || this.writeNone;
this.writeWord = !this.fReadOnly && afn[3] || this.writeWordDefault;
}
if (fDirect || fDirect === undefined) {
this.writeBitsDirect = afn[1] || this.writeNone;
this.writeWordDirect = afn[3] || this.writeWordDefault;
}
}
/**
* resetReadAccess()
*
* @this {MemoryPDP10}
*/
resetReadAccess()
{
this.readBits = this.readBitsDirect;
this.readWord = this.readWordDirect;
}
/**
* resetWriteAccess()
*
* @this {MemoryPDP10}
*/
resetWriteAccess()
{
this.writeBits = this.fReadOnly? this.writeNone : this.writeBitsDirect;
this.writeWord = this.fReadOnly? this.writeWordDefault : this.writeWordDirect;
}
/**
* printAddr(sMessage)
*
* @this {MemoryPDP10}
* @param {string} sMessage
*/
printAddr(sMessage)
{
if (DEBUG && this.dbg && this.dbg.messageEnabled(MessagesPDP10.MEMORY)) {
this.dbg.printMessage(sMessage + ' ' + (this.addr != null? ('@' + this.dbg.toStrBase(this.addr)) : '#' + this.id), true);
}
}
/**
* addBreakpoint(off, fWrite)
*
* @this {MemoryPDP10}
* @param {number} off
* @param {boolean} fWrite
*/
addBreakpoint(off, fWrite)
{
if (!fWrite) {
if (this.cReadBreakpoints++ === 0) {
this.setReadAccess(MemoryPDP10.afnChecked, false);
}
if (DEBUG) this.printAddr("read breakpoint added to memory block");
}
else {
if (this.cWriteBreakpoints++ === 0) {
this.setWriteAccess(MemoryPDP10.afnChecked, false);
}
if (DEBUG) this.printAddr("write breakpoint added to memory block");
}
}
/**
* removeBreakpoint(off, fWrite)
*
* @this {MemoryPDP10}
* @param {number} off
* @param {boolean} fWrite
*/
removeBreakpoint(off, fWrite)
{
if (!fWrite) {
if (--this.cReadBreakpoints === 0) {
this.resetReadAccess();
if (DEBUG) this.printAddr("all read breakpoints removed from memory block");
}
Component.assert(this.cReadBreakpoints >= 0);
}
else {
if (--this.cWriteBreakpoints === 0) {
this.resetWriteAccess();
if (DEBUG) this.printAddr("all write breakpoints removed from memory block");
}
Component.assert(this.cWriteBreakpoints >= 0);
}
}
/**
* copyBreakpoints(dbg, mem)
*
* @this {MemoryPDP10}
* @param {DebuggerPDP10} [dbg]
* @param {MemoryPDP10} [mem] (outgoing MemoryPDP10 block to copy breakpoints from, if any)
*/
copyBreakpoints(dbg, mem)
{
this.dbg = dbg;
this.cReadBreakpoints = this.cWriteBreakpoints = 0;
if (mem) {
if ((this.cReadBreakpoints = mem.cReadBreakpoints)) {
this.setReadAccess(MemoryPDP10.afnChecked, false);
}
if ((this.cWriteBreakpoints = mem.cWriteBreakpoints)) {
this.setWriteAccess(MemoryPDP10.afnChecked, false);
}
}
}
/**
* readNone(off)
*
* @this {MemoryPDP10}
* @param {number} off
* @param {number} addr
* @return {number}
*/
readNone(off, addr)
{
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP10.MEMORY) /* && !off */) {
this.dbg.printMessage("attempt to read invalid address " + this.dbg.toStrBase(addr), true);
}
return 0;
}
/**
* writeNone(v, off, addr)
*
* @this {MemoryPDP10}
* @param {number} v
* @param {number} off
* @param {number} addr
*/
writeNone(v, off, addr)
{
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP10.MEMORY) /* && !off */) {
this.dbg.printMessage("attempt to write " + this.dbg.toStrBase(v) + " to invalid addresses " + this.dbg.toStrBase(addr), true);
}
}
/**
* readWordDefault(off, addr)
*
* @this {MemoryPDP10}
* @param {number} off
* @param {number} addr
* @return {number}
*/
readWordDefault(off, addr)
{
return this.readWord(off, addr);
}
/**
* writeWordDefault(w, off, addr)
*
* @this {MemoryPDP10}
* @param {number} w
* @param {number} off
* @param {number} addr
*/
writeWordDefault(w, off, addr)
{
this.writeWord(w, off, addr);
}
/**
* readBitsMemory(offBits, lenBits, off, addr)
*
* @this {MemoryPDP10}
* @param {number} offBits (the bit position of the right-most bit of the result, using modern bit numbering)
* @param {number} lenBits
* @param {number} off
* @param {number} addr
* @return {number}
*/
readBitsMemory(offBits, lenBits, off, addr)
{
var w = this.aw[off];
if (offBits + lenBits <= 32) {
w = (w >> offBits) & ((1 << lenBits) - 1);
} else {
w = Math.trunc(w / Math.pow(2, offBits)) % Math.pow(2, lenBits);
}
return w;
}
/**
* readWordMemory(off, addr)
*
* @this {MemoryPDP10}
* @param {number} off
* @param {number} addr
* @return {number}
*/
readWordMemory(off, addr)
{
return this.aw[off];
}
/**
* writeBitsMemory(offBits, lenBits, bits, off, addr)
*
* @this {MemoryPDP10}
* @param {number} offBits (the bit position of the right-most bit of the result, using modern bit numbering)
* @param {number} lenBits
* @param {number} bits (only the right-most lenBits of bits are used, so this value doesn't need to be pre-masked)
* @param {number} off
* @param {number} addr
*/
writeBitsMemory(offBits, lenBits, bits, off, addr)
{
var w = this.aw[off];
var shiftBits = Math.pow(2, offBits);
bits %= Math.pow(2, lenBits);
var v = (w % Math.pow(2, offBits + lenBits));
w = (w - v) + (bits * shiftBits) + (v % shiftBits);
if (this.aw[off] != w) {
this.aw[off] = w;
this.fDirty = true;
}
}
/**
* writeWordMemory(w, off, addr)
*
* @this {MemoryPDP10}
* @param {number} w
* @param {number} off
* @param {number} addr
*/
writeWordMemory(w, off, addr)
{
this.aw[off] = w;
this.fDirty = true;
}
/**
* readBitsChecked(offBits, lenBits, off, addr)
*
* @this {MemoryPDP10}
* @param {number} offBits (the bit position of the right-most bit of the result, using modern bit numbering)
* @param {number} lenBits
* @param {number} off
* @param {number} addr
* @return {number}
*/
readBitsChecked(offBits, lenBits, off, addr)
{
if (DEBUGGER && this.dbg && this.addr != null) {
this.dbg.checkMemoryRead(this.addr + off);
}
return this.readBitsDirect(offBits, lenBits, off, addr);
}
/**
* readWordChecked(off, addr)
*
* @this {MemoryPDP10}
* @param {number} off
* @param {number} addr
* @return {number}
*/
readWordChecked(off, addr)
{
if (DEBUGGER && this.dbg && this.addr != null) {
this.dbg.checkMemoryRead(this.addr + off, 2);
}
return this.readWordDirect(off, addr);
}
/**
* writeBitsChecked(offBits, lenBits, bits, off, addr)
*
* @this {MemoryPDP10}
* @param {number} offBits (the bit position of the right-most bit of the result, using modern bit numbering)
* @param {number} lenBits
* @param {number} bits
* @param {number} off
* @param {number} addr
*/
writeBitsChecked(offBits, lenBits, bits, off, addr)
{
if (DEBUGGER && this.dbg && this.addr != null) {
this.dbg.checkMemoryWrite(this.addr + off);
}
if (this.fReadOnly) this.writeNone(bits, off, addr); else this.writeBitsDirect(offBits, lenBits, bits, off, addr);
}
/**
* writeWordChecked(w, off, addr)
*
* @this {MemoryPDP10}
* @param {number} w
* @param {number} off
* @param {number} addr
*/
writeWordChecked(w, off, addr)
{
if (DEBUGGER && this.dbg && this.addr != null) {
this.dbg.checkMemoryWrite(this.addr + off, 2)
}
if (this.fReadOnly) this.writeNone(w, off, addr); else this.writeWordDirect(w, off, addr);
}
}
/*
* Basic memory types
*
* RAM is the most conventional memory type, providing full read/write capability. ROM is equally
* conventional, except that the fReadOnly property is set. ROM can be written using the Bus setWordDirect()
* interface (which in turn uses the Memory writeWordDirect() interface), allowing the ROM component to
* initialize its own memory.
*/
MemoryPDP10.TYPE = {
NONE: 0,
RAM: 1,
ROM: 2
};
MemoryPDP10.TYPE_COLORS = ["black", "blue", "green"];
MemoryPDP10.TYPE_NAMES = ["NONE", "RAM", "ROM"];
/*
* Last used block ID (used for debugging only)
*/
MemoryPDP10.idBlock = 0;
/*
* This is the effective definition of afnNone, but we need not fully define it, because setAccess()
* uses these defaults when any of the 4 handlers (ie, 2 bits handlers and 2 word handlers) are undefined.
*
MemoryPDP10.afnNone = [
MemoryPDP10.prototype.readNone,
MemoryPDP10.prototype.writeNone,
MemoryPDP10.prototype.readWordDefault,
MemoryPDP10.prototype.writeWordDefault
];
*/
MemoryPDP10.afnNone = [];
MemoryPDP10.afnMemory = [
MemoryPDP10.prototype.readBitsMemory,
MemoryPDP10.prototype.writeBitsMemory,
MemoryPDP10.prototype.readWordMemory,
MemoryPDP10.prototype.writeWordMemory
];
MemoryPDP10.afnChecked = [
MemoryPDP10.prototype.readBitsChecked,
MemoryPDP10.prototype.writeBitsChecked,
MemoryPDP10.prototype.readWordChecked,
MemoryPDP10.prototype.writeWordChecked
];
if (NODE) module.exports = MemoryPDP10;

View file

@ -0,0 +1,104 @@
/**
* @fileoverview Defines PDP-10 message categories.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
var MessagesPDP10 = {
CPU: 0x00000001,
TRAP: 0x00000002,
FAULT: 0x00000004,
INT: 0x00000008,
BUS: 0x00000010,
MEMORY: 0x00000020,
MMU: 0x00000040,
ROM: 0x00000080,
DEVICE: 0x00000100,
PANEL: 0x00000200,
KEYBOARD: 0x00000400,
KEYS: 0x00000800,
PAPER: 0x00001000,
READ: 0x00004000,
WRITE: 0x00008000,
SERIAL: 0x00100000,
TIMER: 0x00200000,
SPEAKER: 0x01000000,
COMPUTER: 0x02000000,
LOG: 0x10000000,
WARN: 0x20000000,
BUFFER: 0x40000000,
HALT: 0x80000000|0
};
/*
* Message categories supported by the messageEnabled() function and other assorted message
* functions. Each category has a corresponding bit value that can be combined (ie, OR'ed) as
* needed. The Debugger's message command ("m") is used to turn message categories on and off,
* like so:
*
* m port on
* m port off
* ...
*
* NOTE: The order of these categories can be rearranged, alphabetized, etc, as desired; just be
* aware that changing the bit values could break saved Debugger states (not a huge concern, just
* something to be aware of).
*/
MessagesPDP10.CATEGORIES = {
"cpu": MessagesPDP10.CPU,
"trap": MessagesPDP10.TRAP,
"fault": MessagesPDP10.FAULT,
"int": MessagesPDP10.INT,
"bus": MessagesPDP10.BUS,
"memory": MessagesPDP10.MEMORY,
"mmu": MessagesPDP10.MMU,
"rom": MessagesPDP10.ROM,
"device": MessagesPDP10.DEVICE,
"panel": MessagesPDP10.PANEL,
"keyboard": MessagesPDP10.KEYBOARD, // "kbd" is also allowed as shorthand for "keyboard"; see doMessages()
"key": MessagesPDP10.KEYS, // using "key" instead of "keys", since the latter is a method on JavasScript objects
"paper": MessagesPDP10.PAPER,
"read": MessagesPDP10.READ,
"write": MessagesPDP10.WRITE,
"serial": MessagesPDP10.SERIAL,
"timer": MessagesPDP10.TIMER,
"speaker": MessagesPDP10.SPEAKER,
"computer": MessagesPDP10.COMPUTER,
"log": MessagesPDP10.LOG,
"warn": MessagesPDP10.WARN,
/*
* Now we turn to message actions rather than message types; for example, setting "halt"
* on or off doesn't enable "halt" messages, but rather halts the CPU on any message above.
*
* Similarly, "m buffer on" turns on message buffering, deferring the display of all messages
* until "m buffer off" is issued.
*/
"buffer": MessagesPDP10.BUFFER,
"halt": MessagesPDP10.HALT
};
if (NODE) module.exports = MessagesPDP10;

View file

@ -0,0 +1,43 @@
/**
* @fileoverview Compile-time definitions for Debugger-less configurations.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
/*
* WARNING: DEBUGGER needs to accurately reflect whether or not the Debugger component is (or will be) loaded.
* In the compiled case, we rely on the Closure Compiler to override DEBUGGER as appropriate. When it's *false*,
* nearly all of debugger.js will be conditionally removed by the compiler, reducing it to little more than a
* "type skeleton", which also solves some type-related warnings we would otherwise have if we tried to remove
* debugger.js from the compilation process altogether.
*
* However, when we're in "development mode" and running uncompiled code in debugger-less configurations,
* I would still like to skip loading debugger.js altogether. To do that, we must arrange for this additional file,
* nodebugger.js, to be loaded immediately after defines.js, *explicitly* overriding the previously defined value
* of DEBUGGER with *false*.
*/
DEBUGGER = false;

1266
modules/pdp10/lib/panel.js Normal file

File diff suppressed because it is too large Load diff

413
modules/pdp10/lib/ram.js Normal file
View file

@ -0,0 +1,413 @@
/**
* @fileoverview Implements the PDP-10 RAM component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
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 PDP10 = require("./defines");
var MemoryPDP10 = require("./memory");
var MessagesPDP10 = require("./messages");
}
class RAMPDP10 extends Component {
/**
* RAMPDP10(parmsRAM)
*
* The RAMPDP10 component expects the following (parmsRAM) properties:
*
* 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().
*
* @param {Object} parmsRAM
*/
constructor(parmsRAM)
{
super("RAM", parmsRAM);
this.abInit = null;
this.aSymbols = null;
this.addrRAM = +parmsRAM['addr'];
this.sizeRAM = +parmsRAM['size'];
this.addrLoad = parmsRAM['load'];
this.addrExec = parmsRAM['exec'];
if (this.addrLoad != null) this.addrLoad = +this.addrLoad;
if (this.addrExec != null) this.addrExec = +this.addrExec;
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 doneLoad(sURL, sResponse, nErrorCode) {
ram.finishLoad(sURL, sResponse, nErrorCode);
});
}
}
/**
* initBus(cmp, bus, cpu, dbg)
*
* @this {RAMPDP10}
* @param {ComputerPDP10} cmp
* @param {BusPDP10} bus
* @param {CPUStatePDP10} cpu
* @param {DebuggerPDP10} dbg
*/
initBus(cmp, bus, cpu, dbg)
{
this.bus = bus;
this.cpu = cpu;
this.dbg = dbg;
this.initRAM();
}
/**
* powerUp(data, fRepower)
*
* @this {RAMPDP10}
* @param {Object|null} data
* @param {boolean} [fRepower]
* @return {boolean} true if successful, false if failure
*/
powerUp(data, fRepower)
{
if (this.aSymbols) {
if (this.dbg) {
this.dbg.addSymbols(this.id, this.addrRAM, this.sizeRAM, this.aSymbols);
}
/*
* Our only role in the handling of symbols is to hand them off to the Debugger at our
* first opportunity. Now that we've done that, our copy of the symbols, if any, are toast.
*/
delete this.aSymbols;
}
if (!fRepower) {
/*
* Since we use the Bus to allocate all our memory, memory contents are already restored for us,
* so we don't save any state, and therefore no state should be restored. Just do a reset().
*/
this.assert(!data);
this.reset();
}
return true;
}
/**
* powerDown(fSave, fShutdown)
*
* @this {RAMPDP10}
* @param {boolean} [fSave]
* @param {boolean} [fShutdown]
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
*/
powerDown(fSave, fShutdown)
{
/*
* The Computer powers down the CPU first, at which point CPUState state is saved,
* which includes the Bus state, and since we use the Bus component to allocate all
* our memory, memory contents are already saved for us, so we don't need the usual
* save logic.
*/
return true;
}
/**
* finishLoad(sURL, sData, nErrorCode)
*
* @this {RAMPDP10}
* @param {string} sURL
* @param {string} sData
* @param {number} nErrorCode (response from server if anything other than 200)
*/
finishLoad(sURL, sData, nErrorCode)
{
if (nErrorCode) {
this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")");
this.sFilePath = null;
}
else {
Component.addMachineResource(this.idMachine, sURL, sData);
var resource = Web.parseMemoryResource(sURL, sData);
if (resource) {
this.abInit = resource.aBytes;
this.aSymbols = resource.aSymbols;
if (this.addrLoad == null) this.addrLoad = resource.addrLoad;
if (this.addrExec == null) this.addrExec = resource.addrExec;
} else {
this.sFilePath = null;
}
}
this.initRAM();
}
/**
* initRAM()
*
* This function is called by both initBus() and finishLoad(), but it cannot copy the initial data into place
* until after initBus() has received the Bus component AND finishLoad() has received the data. When both those
* criteria are satisfied, the component becomes "ready".
*
* @this {RAMPDP10}
*/
initRAM()
{
if (!this.bus) return;
if (!this.fAllocated && this.sizeRAM) {
if (this.bus.addMemory(this.addrRAM, this.sizeRAM, MemoryPDP10.TYPE.RAM)) {
this.fAllocated = true;
} else {
this.sizeRAM = 0; // don't bother trying again (it just results in redundant error messages)
}
}
if (!this.isReady()) {
if (!this.fAllocated) {
Component.error("No RAM allocated");
}
else if (this.sFilePath) {
/*
* Too early...
*/
if (!this.abInit || !this.bus) return;
if (this.loadImage(this.abInit, this.addrLoad, this.addrExec, this.addrRAM)) {
this.status('Loaded image "' + this.sFileName + '"');
} else {
this.notice('Error loading image "' + this.sFileName + '"');
}
/*
* NOTE: We now retain this data, so that reset() can return the RAM to its predefined state.
*
* delete this.abInit;
*/
}
this.setReady();
}
}
/**
* reset()
*
* @this {RAMPDP10}
*/
reset()
{
if (this.fAllocated) {
/*
* TODO: Add a configuration parameter for selecting the byte pattern on reset?
* Note that when memory blocks are originally created, they are currently always
* zero-initialized, so this would only affect resets.
*/
this.bus.zeroMemory(this.addrRAM, this.sizeRAM, 0);
if (this.abInit) {
this.loadImage(this.abInit, this.addrLoad, this.addrExec, this.addrRAM, !this.dbg);
}
}
}
/**
* loadImage(aBytes, addrLoad, addrExec, addrInit, fStart)
*
* If the array contains a PAPER tape image in the "Absolute Format," load it as specified
* by the format; otherwise, load it as-is using the address(es) supplied.
*
* @this {RAMPDP10}
* @param {Array|Uint8Array} aBytes
* @param {number|null} [addrLoad]
* @param {number|null} [addrExec] (this CAN override any starting address INSIDE the image)
* @param {number|null} [addrInit]
* @param {boolean} [fStart]
* @return {boolean} (true if loaded, false if not)
*/
loadImage(aBytes, addrLoad, addrExec, addrInit, fStart)
{
var fStop = false;
var fLoaded = false;
/*
* Data on tapes in the "Absolute Format" is organized into blocks; each block begins with
* a 6-byte header:
*
* 2-byte signature (0x0001)
* 2-byte block length (N + 6, because it includes the 6-byte header)
* 2-byte load address
*
* followed by N data bytes. If N is zero, then the 2-byte load address is the exec address,
* unless the address is odd (usually 1). DEC's Absolute Loader jumps to the exec address
* in former case, halts in the latter.
*
* All values are stored "little endian" (low byte followed by high byte), just like the
* PDP-11's memory architecture.
*
* After the data bytes, there is a single checksum byte. The 8-bit sum of all the bytes in
* the block (including the header bytes and checksum byte) should be zero.
*
* ANOMALIES: Tape files don't always begin with a signature word, so I allow any number of
* leading zeros before the first signature. Tape files don't always end cleanly either, so as
* soon as I see an invalid signature, I break out of the loop without signalling an error, as
* long as at least ONE block was successfully processed. In fact, it's possible that as
* soon as a block with ZERO data bytes is encountered, processing is supposed to stop, but
* I haven't examined enough tapes (or the Absolute Loader code) to know for sure.
*/
if (addrLoad == null) {
var off = 0, fError = false;
while (off < aBytes.length - 1) {
var w = (aBytes[off] & 0xff) | ((aBytes[off+1] & 0xff) << 8);
if (!w) { // ignore pairs of leading zeros
off += 2;
continue;
}
if (!(w & 0xff)) { // as well as single bytes of zero
off++;
continue;
}
var offBlock = off;
if (w != 0x0001) {
this.printMessage("invalid signature (" + Str.toHexWord(w) + ") at offset " + Str.toHexWord(offBlock), MessagesPDP10.PAPER);
break;
}
if (off + 6 >= aBytes.length) {
this.printMessage("invalid block at offset " + Str.toHexWord(offBlock), MessagesPDP10.PAPER);
break;
}
off += 2;
var checksum = w;
var len = (aBytes[off++] & 0xff) | ((aBytes[off++] & 0xff) << 8);
var addr = (aBytes[off++] & 0xff) | ((aBytes[off++] & 0xff) << 8);
checksum += (len & 0xff) + (len >> 8) + (addr & 0xff) + (addr >> 8);
var offData = off, cbData = len -= 6;
while (len > 0 && off < aBytes.length) {
checksum += aBytes[off++] & 0xff;
len--;
}
if (len != 0 || off >= aBytes.length) {
this.printMessage("insufficient data for block at offset " + Str.toHexWord(offBlock), MessagesPDP10.PAPER);
break;
}
checksum += aBytes[off++] & 0xff;
if (checksum & 0xff) {
this.printMessage("invalid checksum (" + Str.toHexByte(checksum) + ") for block at offset " + Str.toHexWord(offBlock), MessagesPDP10.PAPER);
break;
}
if (!cbData) {
if (addr & 0x1) {
fStop = true;
} else {
if (addrExec == null) addrExec = addr;
}
if (addrExec != null) this.printMessage("starting address: " + Str.toHexWord(addrExec), MessagesPDP10.PAPER);
} else {
this.printMessage("loading " + Str.toHexWord(cbData) + " bytes at " + Str.toHexWord(addr) + "-" + Str.toHexWord(addr + cbData), MessagesPDP10.PAPER);
while (cbData--) {
this.bus.setWordDirect(addr++, aBytes[offData++]);
}
}
fLoaded = true;
}
}
if (!fLoaded) {
if (addrLoad == null) addrLoad = addrInit;
if (addrLoad != null) {
for (var i = 0; i < aBytes.length; i++) {
this.bus.setWordDirect(addrLoad + i, aBytes[i]);
}
fLoaded = true;
}
}
if (fLoaded) {
/*
* Set the start address to whatever the caller provided, or failing that, whatever start
* address was specified inside the image.
*
* For example, the diagnostic "MAINDEC-11-D0AA-PB" doesn't include a start address inside the
* image, but we know that the directions for that diagnostic say to "Start and Restart at 200",
* so we have manually inserted an "exec":128 in the JSON containing the image.
*/
if (addrExec == null || fStop) {
this.cpu.stopCPU();
fStart = false;
}
if (addrExec != null) {
this.cpu.setReset(addrExec, fStart);
}
}
return fLoaded;
}
/**
* RAMPDP10.init()
*
* This function operates on every HTML element of class "ram", extracting the
* JSON-encoded parameters for the RAMPDP10 constructor from the element's "data-value"
* attribute, invoking the constructor to create a RAMPDP10 component, and then binding
* any associated HTML controls to the new component.
*/
static init()
{
var aeRAM = Component.getElementsByClass(document, PDP10.APPCLASS, "ram");
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new RAMPDP10(parmsRAM);
Component.bindComponentControls(ram, eRAM, PDP10.APPCLASS);
}
}
}
/*
* Initialize all the RAMPDP10 modules on the page.
*/
Web.onInit(RAMPDP10.init);
if (NODE) module.exports = RAMPDP10;

339
modules/pdp10/lib/rom.js Normal file
View file

@ -0,0 +1,339 @@
/**
* @fileoverview Implements the PDP-10 ROM component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
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 PDP10 = require("./defines");
var BusPDP10 = require("./bus");
var MemoryPDP10 = require("./memory");
var MessagesPDP10 = require("./messages");
}
class ROMPDP10 extends Component {
/**
* ROMPDP10(parmsROM)
*
* The ROMPDP10 component expects the following (parmsROM) properties:
*
* addr: physical address of ROM
* size: amount of ROM, in bytes
* alias: physical alias address (null if none)
* file: name of ROM data file
*
* 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 finishLoad()).
*
* Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM
* you received is the ROM you expected.
*
* @param {Object} parmsROM
*/
constructor(parmsROM)
{
super("ROM", parmsROM, MessagesPDP10.ROM);
this.abInit = null;
this.aSymbols = null;
this.addrROM = +parmsROM['addr'];
this.sizeROM = +parmsROM['size'];
this.fRetainROM = false;
/*
* The new 'alias' property can now be EITHER a single physical address (like 'addr') OR an array of
* physical addresses; eg:
*
* [0xf0000,0xffff0000,0xffff8000]
*
* We could have overloaded 'addr' to accomplish the same thing, but I think it's better to have any
* aliased locations listed under a separate property.
*
* Most ROMs are not aliased, in which case the 'alias' property should have the default value of null.
*/
this.addrAlias = parmsROM['alias'];
if (typeof this.addrAlias == "string") {
this.addrAlias = eval(this.addrAlias);
}
this.sFilePath = parmsROM['file'];
this.sFileName = Str.getBaseName(this.sFilePath);
if (this.sFilePath) {
var sFileURL = this.sFilePath;
if (DEBUG) this.log('load("' + sFileURL + '")');
/*
* If the selected ROM file has a ".json" extension, then we assume it's pre-converted
* JSON-encoded ROM data, so we load it as-is; ditto for ROM files with a ".hex" extension.
* Otherwise, we ask our server-side ROM 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 rom = this;
Web.getResource(sFileURL, null, true, function doneLoad(sURL, sResponse, nErrorCode) {
rom.finishLoad(sURL, sResponse, nErrorCode);
});
}
}
/**
* initBus(cmp, bus, cpu, dbg)
*
* @this {ROMPDP10}
* @param {ComputerPDP10} cmp
* @param {BusPDP10} bus
* @param {CPUStatePDP10} cpu
* @param {DebuggerPDP10} dbg
*/
initBus(cmp, bus, cpu, dbg)
{
this.bus = bus;
this.cpu = cpu;
this.dbg = dbg;
this.initROM();
}
/**
* powerUp(data, fRepower)
*
* @this {ROMPDP10}
* @param {Object|null} data
* @param {boolean} [fRepower]
* @return {boolean} true if successful, false if failure
*/
powerUp(data, fRepower)
{
if (this.aSymbols) {
if (this.dbg) {
this.dbg.addSymbols(this.id, this.addrROM, this.sizeROM, this.aSymbols);
}
/*
* Our only role in the handling of symbols is to hand them off to the Debugger at our
* first opportunity. Now that we've done that, our copy of the symbols, if any, are toast.
*/
delete this.aSymbols;
}
return true;
}
/**
* powerDown(fSave, fShutdown)
*
* Since we have nothing to do on powerDown(), and no state to return, we could simply omit
* this function. But it doesn't hurt anything, and maybe we'll use our state to save something
* useful down the road, like user-defined symbols (ie, symbols that the Debugger may have
* created, above and beyond those symbols we automatically loaded, if any, along with the ROM).
*
* @this {ROMPDP10}
* @param {boolean} [fSave]
* @param {boolean} [fShutdown]
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
*/
powerDown(fSave, fShutdown)
{
return true;
}
/**
* finishLoad(sURL, sData, nErrorCode)
*
* @this {ROMPDP10}
* @param {string} sURL
* @param {string} sData
* @param {number} nErrorCode (response from server if anything other than 200)
*/
finishLoad(sURL, sData, nErrorCode)
{
if (nErrorCode) {
this.notice("Unable to load ROM resource (error " + nErrorCode + ": " + sURL + ")");
this.sFilePath = null;
}
else {
Component.addMachineResource(this.idMachine, sURL, sData);
var resource = Web.parseMemoryResource(sURL, sData);
if (resource) {
this.abInit = resource.aBytes;
this.aSymbols = resource.aSymbols;
} else {
this.sFilePath = null;
}
}
this.initROM();
}
/**
* initROM()
*
* This function is called by both initBus() and finishLoad(), but it cannot copy the initial data into place
* until after initBus() has received the Bus component AND finishLoad() has received the data. When both those
* criteria are satisfied, the component becomes "ready".
*
* @this {ROMPDP10}
*/
initROM()
{
if (!this.isReady()) {
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.abInit.length;
}
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.abInit.length) + ") does not match specified size (" + Str.toHexLong(this.sizeROM) + ")");
}
else if (this.addROM(this.addrROM)) {
var aliases = [];
if (typeof this.addrAlias == "number") {
aliases.push(this.addrAlias);
} else if (this.addrAlias != null && this.addrAlias.length) {
aliases = this.addrAlias;
}
for (var i = 0; i < aliases.length; i++) {
this.cloneROM(aliases[i]);
}
/*
* 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.
*
* TODO: Consider an option to retain the ROM data, and give the user some way of restoring ROMs.
* That may be useful for "resumable" machines that save/restore all dirty block of memory, regardless
* 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.
*/
if (!this.fRetainROM) {
delete this.abInit;
}
}
}
this.setReady();
}
}
/**
* addROM(addr)
*
* @this {ROMPDP10}
* @param {number} addr
* @return {boolean}
*/
addROM(addr)
{
if (this.bus.addMemory(addr, this.sizeROM, MemoryPDP10.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.abInit.length; i++) {
this.bus.setWordDirect(addr + i, this.abInit[i]);
}
return true;
}
/*
* We don't need to report an error here, because addMemory() already takes care of that.
*/
return false;
}
/**
* cloneROM(addr)
*
* For ROMs with one or more alias addresses, we used to call addROM() for each address. However,
* that obviously wasted memory, since each alias was an independent copy, and if you used the
* Debugger to edit the ROM in one location, the changes would not appear in the other location(s).
*
* Now that the Bus component provides low-level getMemoryBlocks() and setMemoryBlocks() methods
* to manually get and set the blocks of any memory range, it is now possible to create true aliases.
*
* @this {ROMPDP10}
* @param {number} addr
*/
cloneROM(addr)
{
var aBlocks = this.bus.getMemoryBlocks(this.addrROM, this.sizeROM);
this.bus.setMemoryBlocks(addr, this.sizeROM, aBlocks);
}
/**
* ROMPDP10.init()
*
* This function operates on every HTML element of class "rom", extracting the
* JSON-encoded parameters for the ROMPDP10 constructor from the element's "data-value"
* attribute, invoking the constructor to create a ROMPDP10 component, and then binding
* any associated HTML controls to the new component.
*/
static init()
{
var aeROM = Component.getElementsByClass(document, PDP10.APPCLASS, "rom");
for (var iROM = 0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new ROMPDP10(parmsROM);
Component.bindComponentControls(rom, eROM, PDP10.APPCLASS);
}
}
}
/*
* 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.
*
* OK, well, I take that back, because the Debugger, if installed, has the ability to modify
* ROM contents, so in that case, having a reset() function that restores the original ROM data
* might be useful; then again, it might not, depending on what you're trying to debug.
*
* If we do add reset(), then we'll want to change initROM() to hang onto the original
* ROM data; currently, we release it after copying it into the read-only memory allocated
* via bus.addMemory().
*/
/*
* Initialize all the ROMPDP10 modules on the page.
*/
Web.onInit(ROMPDP10.init);
if (NODE) module.exports = ROMPDP10;

670
modules/pdp10/lib/serial.js Normal file
View file

@ -0,0 +1,670 @@
/**
* @fileoverview Implements the PDP-10 SerialPort component
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
if (NODE) {
var Str = require("../../shared/lib/strlib");
var Web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var Keys = require("../../shared/lib/keys");
var State = require("../../shared/lib/state");
var PDP10 = require("./defines");
var MessagesPDP10 = require("./messages");
}
/**
* Since the Closure Compiler treats ES6 classes as @struct rather than @dict by default,
* it deters us from defining named properties on our components; eg:
*
* this['exports'] = {...}
*
* results in an error:
*
* Cannot do '[]' access on a struct
*
* So, in order to define 'exports', we must override the @struct assumption by annotating
* the class as @unrestricted (or @dict). Note that this must be done both here and in the
* Component class, because otherwise the Compiler won't allow us to *reference* the named
* property either.
*
* TODO: Consider marking ALL our classes unrestricted, because otherwise it forces us to
* define every single property the class uses in its constructor, which results in a fair
* bit of redundant initialization, since many properties aren't (and don't need to be) fully
* initialized until the appropriate init(), reset(), restore(), etc. function is called.
*
* The upside, however, may be that since the structure of the class is completely defined by
* the constructor, JavaScript engines may be able to optimize and run more efficiently.
*
* @unrestricted
*/
class SerialPortPDP10 extends Component {
/**
* SerialPortPDP10(parmsSerial)
*
* The SerialPort component has the following component-specific (parmsSerial) properties:
*
* adapter: adapter number; 0 if not defined (the PCx86 SerialPort component uses this
* value to set the device's internal COM number, which in turn determines other properties,
* such as I/O ports and IRQ; for the PDP-10, this currently has no defined use)
*
* binding: name of a control (based on its "binding" attribute) to bind to this port's I/O
*
* tabSize: set to a non-zero number to convert tabs to spaces (applies only to output to
* the above binding); default is 0 (no conversion)
*
* upperCase: if true, all received input is upper-cased; it is normally the responsibility
* of the sending device to ensure this, but sometimes it's more convenient to enforce
* on the receiving end.
*
* @param {Object} parmsSerial
*/
constructor(parmsSerial)
{
super("SerialPort", parmsSerial, MessagesPDP10.SERIAL);
this.iAdapter = +parmsSerial['adapter'];
this.fUpperCase = parmsSerial['upperCase'];
if (typeof this.fUpperCase == "string") this.fUpperCase = (this.fUpperCase == "true");
/**
* consoleOutput becomes a string that records serial port output if the 'binding' property is set to the
* reserved name "console". Nothing is written to the console, however, until a linefeed (0x0A) is output
* or the string length reaches a threshold (currently, 1024 characters).
*
* @type {string|null}
*/
this.consoleOutput = null;
/**
* controlIOBuffer is a DOM element bound to the port (currently used for output only; see transmitByte()).
*
* Example: CTTY COM2
*
* The CTTY DOS command redirects all CON I/O to the specified serial port (eg, COM2), which it assumes is
* connected to a serial terminal, and therefore anything it *transmits* via COM2 will be displayed by the
* terminal. It further assumes that anything typed on such a terminal is NOT displayed, so as DOS *receives*
* serial input, DOS *transmits* the appropriate characters back to the terminal via COM2.
*
* As a result, controlIOBuffer only needs to be updated by the transmitByte() function.
*
* @type {Object}
*/
this.controlIOBuffer = null;
/*
* If controlIOBuffer is being used AND 'tabSize' is set, then we make an attempt to monitor the characters
* being echoed via transmitByte(), maintain a logical column position, and convert any tabs into the appropriate
* number of spaces.
*
* charBOL, if nonzero, is a character to automatically output at the beginning of every line. This probably
* isn't generally useful; I use it internally to preformat serial output.
*/
this.tabSize = +parmsSerial['tabSize'];
this.charBOL = +parmsSerial['charBOL'];
this.iLogicalCol = 0;
this.fNullModem = true;
this.abReceive = [];
var sBinding = parmsSerial['binding'];
if (sBinding == "console") {
this.consoleOutput = "";
} else {
/*
* NOTE: If sBinding is not the name of a valid Control Panel DOM element, this call does nothing.
*/
Component.bindExternalControl(this, sBinding, SerialPortPDP10.sIOBuffer);
}
/*
* No connection until initConnection() is called.
*/
this.sDataReceived = "";
this.connection = this.sendData = this.updateStatus = null;
/*
* Export all functions required by initConnection().
*/
this['exports'] = {
'connect': this.initConnection,
'receiveData': this.receiveData,
'receiveStatus': this.receiveStatus,
'setConnection': this.setConnection
};
}
/**
* setBinding(sType, sBinding, control, sValue)
*
* @this {SerialPortPDP10}
* @param {string|null} sType is the type of the HTML control (eg, "button", "textarea", "register", "flag", "rled", etc)
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "buffer")
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
* @param {string} [sValue] optional data value
* @return {boolean} true if binding was successful, false if unrecognized binding request
*/
setBinding(sType, sBinding, control, sValue)
{
var serial = this;
switch (sBinding) {
case SerialPortPDP10.sIOBuffer:
this.bindings[sBinding] = this.controlIOBuffer = control;
/*
* An onkeydown handler is required for certain keys that browsers tend to consume themselves;
* for example, BACKSPACE is often defined as going back to the previous web page, and certain
* CTRL keys are often used for browser shortcuts (usually on Windows-based browsers).
*
* NOTE: We don't bother with a keyUp handler, because for the most part, we're only intercepting
* keys that require special treatment; in general, we're content with keyPress events.
*/
control.onkeydown = function onKeyDown(event) {
event = event || window.event;
var bASCII = 0;
var keyCode = event.keyCode;
/*
* Perform the same remapping of BACKSPACE and DELETE that our VT100 emulation performs,
* for PCjs-wide consistency; see the KEYMAP table in /modules/pc8080/lib/keyboard.js for
* the rationale. Ditto for ALT-DELETE; see onKeyDown() in /modules/pc8080/lib/keyboard.js
* for details.
*
* NOTE: keyDown (and keyUp) events supply us with KEYCODE values, which are NOT the same as
* ASCII values, which is why we are comparing with KEYCODE values but assigning ASCII values,
* because receiveData() requires ASCII values.
*/
if (keyCode == Keys.KEYCODE.BS) {
bASCII = event.altKey? Keys.ASCII.CTRL_H : Keys.ASCII.DEL;
}
else if (keyCode == Keys.KEYCODE.DEL) {
bASCII = Keys.ASCII.CTRL_H;
}
else if (event.ctrlKey && keyCode >= Keys.ASCII.A && keyCode <= Keys.ASCII.Z) {
bASCII = keyCode - (Keys.ASCII.A - Keys.ASCII.CTRL_A);
}
if (bASCII) {
if (event.preventDefault) event.preventDefault();
serial.receiveData(bASCII);
}
return true;
};
control.onkeypress = function onKeyPress(event) {
/*
* NOTE: Unlike keyDown events, keyPress events generally supply us with ASCII values,
* despite the fact that, as above, they come to us via the keyCode property. Yes, it's
* brilliant (or rather, the opposite of brilliant), but that's life.
*/
event = event || window.event;
/*
* Not sure why COMMAND-key combinations are coming through here (on Safari at least),
* but in any case, let's make sure we don't act on them.
*/
if (!event.metaKey) {
var bASCII = event.which || event.keyCode;
/*
* Perform the same remapping of ALT-ENTER (to LINE-FEED) that our VT100 emulation performs,
* for PCjs-wide consistency; see onKeyDown() in /modules/pc8080/lib/keyboard.js for details.
*/
if (event.altKey) {
if (bASCII == Keys.ASCII.CTRL_M) {
bASCII = Keys.ASCII.CTRL_J;
}
}
serial.receiveData(bASCII);
/*
* Since we're going to remove the "readonly" attribute from the <textarea> control
* (so that the soft keyboard activates on iOS), instead of calling preventDefault() for
* selected keys (eg, the SPACE key, whose default behavior is to scroll the page), we must
* now call it for *all* keys, so that the keyCode isn't added to the control immediately,
* on top of whatever the machine is echoing back, resulting in double characters.
*/
if (event.preventDefault) event.preventDefault();
}
return true;
};
control.onpaste = function onKeyPress(event) {
if (event.stopPropagation) event.stopPropagation();
if (event.preventDefault) event.preventDefault();
var clipboardData = event.clipboardData || window.clipboardData;
if (clipboardData) {
/*
* NOTE: Multiple lines of pasted text will (at least on macOS) contain LFs instead of CRs;
* this is dealt with in receiveData() whenever it receives a string of characters.
*/
serial.receiveData(clipboardData.getData('Text'));
}
};
/*
* Now that we've added an onkeypress handler that calls preventDefault() for ALL keys, the control
* itself no longer needs the "readonly" attribute; we primarily need to remove it for iOS browsers,
* so that the soft keyboard will activate, but it shouldn't hurt to remove the attribute for all browsers.
*/
control.removeAttribute("readonly");
return true;
default:
break;
}
return false;
}
/**
* initBus(cmp, bus, cpu, dbg)
*
* @this {SerialPortPDP10}
* @param {ComputerPDP10} cmp
* @param {BusPDP10} bus
* @param {CPUStatePDP10} cpu
* @param {DebuggerPDP10} dbg
*/
initBus(cmp, bus, cpu, dbg)
{
this.cmp = cmp;
this.bus = bus;
this.cpu = cpu;
this.dbg = dbg;
this.setReady();
}
/**
* initConnection(fNullModem)
*
* If a machine 'connection' parameter exists of the form "{sourcePort}->{targetMachine}.{targetPort}",
* and "{sourcePort}" matches our idComponent, then look for a component with id "{targetMachine}.{targetPort}".
*
* If the target component is found, then verify that it has exported functions with the following names:
*
* receiveData(data): called when we have data to transmit; aliased internally to sendData(data)
* receiveStatus(pins): called when our control signals have changed; aliased internally to updateStatus(pins)
*
* For now, we're not going to worry about communication in the other direction, because when the target component
* performs its own initConnection(), it will find our receiveData() and receiveStatus() functions, at which point
* communication in both directions should be established, and the circle of life complete.
*
* For added robustness, if the target machine initializes much more slowly than we do, and our connection attempt
* fails, that's OK, because when it finally initializes, its initConnection() will call our initConnection();
* if we've already initialized, no harm done.
*
* @this {SerialPortPDP10}
* @param {boolean} [fNullModem] (caller's null-modem setting, to ensure our settings are in agreement)
*/
initConnection(fNullModem)
{
if (!this.connection) {
var sConnection = this.cmp.getMachineParm("connection");
if (sConnection) {
var asParts = sConnection.split('->');
if (asParts.length == 2) {
var sSourceID = Str.trim(asParts[0]);
if (sSourceID != this.idComponent) return; // this connection string is intended for another instance
var sTargetID = Str.trim(asParts[1]);
this.connection = Component.getComponentByID(sTargetID);
if (this.connection) {
var exports = this.connection['exports'];
if (exports) {
var fnConnect = exports['connect'];
if (fnConnect) fnConnect.call(this.connection, this.fNullModem);
this.sendData = exports['receiveData'];
if (this.sendData) {
this.fNullModem = fNullModem;
this.updateStatus = exports['receiveStatus'];
this.status("Connected " + this.idMachine + '.' + sSourceID + " to " + sTargetID);
return;
}
}
}
}
/*
* Changed from notice() to status() because sometimes a connection fails simply because one of us is a laggard.
*/
this.status("Unable to establish connection: " + sConnection);
}
}
}
/**
* powerUp(data, fRepower)
*
* @this {SerialPortPDP10}
* @param {Object|null} data
* @param {boolean} [fRepower]
* @return {boolean} true if successful, false if failure
*/
powerUp(data, fRepower)
{
if (!fRepower) {
/*
* This is as late as we can currently wait to make our first inter-machine connection attempt;
* even so, the target machine's initialization process may still be ongoing, so any connection
* may be not fully resolved until the target machine performs its own initConnection(), which will
* in turn invoke our initConnection() again.
*/
this.initConnection(this.fNullModem);
if (!data) {
this.reset();
} else {
if (!this.restore(data)) return false;
}
}
return true;
}
/**
* powerDown(fSave, fShutdown)
*
* @this {SerialPortPDP10}
* @param {boolean} [fSave]
* @param {boolean} [fShutdown]
* @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure
*/
powerDown(fSave, fShutdown)
{
return fSave? this.save() : true;
}
/**
* reset()
*
* @this {SerialPortPDP10}
*/
reset()
{
this.initState();
}
/**
* save()
*
* This implements save support for the SerialPort component.
*
* @this {SerialPortPDP10}
* @return {Object}
*/
save()
{
var state = new State(this);
state.set(0, this.saveRegisters());
return state.data();
}
/**
* restore(data)
*
* This implements restore support for the SerialPort component.
*
* @this {SerialPortPDP10}
* @param {Object} data
* @return {boolean} true if successful, false if failure
*/
restore(data)
{
return this.initState(data[0]);
}
/**
* initState(a)
*
* @this {SerialPortPDP10}
* @param {Array} [a]
* @return {boolean} true if successful, false if failure
*/
initState(a)
{
return true;
}
/**
* saveRegisters()
*
* Basically, the inverse of initState().
*
* @this {SerialPortPDP10}
* @return {Array}
*/
saveRegisters()
{
return [];
}
/**
* receiveData(data)
*
* This replaces the old sendRBR() function, which expected an Array of bytes. We still support that,
* but in order to support connections with other SerialPort components (ie, the PC8080 SerialPort), we
* have added support for numbers and strings as well.
*
* @this {SerialPortPDP10}
* @param {number|string|Array} data
* @return {boolean} true if received, false if not
*/
receiveData(data)
{
if (typeof data == "number") {
this.abReceive.push(data);
}
else if (typeof data == "string") {
var bASCII = 0, bASCIIPrev;
for (var i = 0; i < data.length; i++) {
bASCIIPrev = bASCII;
bASCII = data.charCodeAt(i);
/*
* NOTE: Multiple lines of pasted text will (at least on macOS) contain LFs instead of CRs;
* we convert them to CRs below. Windows may do something different, but in the worst case,
* even if we receive CR/LF pairs, this code should keep the CRs and lose the LFs.
*/
if (bASCII == Str.ASCII.LF) {
if (bASCIIPrev == Str.ASCII.CR) continue;
bASCII = Str.ASCII.CR;
}
this.abReceive.push(bASCII);
}
}
else {
this.abReceive = this.abReceive.concat(data);
}
return true; // for now, return true regardless, since we're buffering everything anyway
}
/**
* receiveByte()
*
* @this {SerialPortPDP10}
* @return {number} (0x00-0xff if byte available, -1 if not)
*/
receiveByte()
{
var b = -1;
if (this.abReceive.length) {
/*
* Here, as elsewhere (eg, the PC11 component), even if I trusted all incoming data
* to be byte values (which I don't), there's also the risk that it could be signed data
* (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask
* the data assigned to RBUF with 0xff.
*/
b = this.abReceive.shift() & 0xff;
this.printMessage("receiveByte(" + Str.toHexByte(b) + ")");
if (this.fUpperCase) {
/*
* Automatically transform lower-case ASCII codes to upper-case; fUpperCase should
* only be set when a terminal or some sort of pseudo-display is being used and we don't
* trust it to have its CAPS-LOCK setting correct.
*/
if (b >= 0x61 && b < 0x7A) b -= 0x20;
}
}
return b;
}
/**
* receiveStatus(pins)
*
* @this {SerialPortPDP10}
* @param {number} pins
*/
receiveStatus(pins)
{
}
/**
* setConnection(component, fn)
*
* @this {SerialPortPDP10}
* @param {Object|null} component
* @param {function(number)} fn
* @return {boolean}
*/
setConnection(component, fn)
{
if (!this.connection) {
this.connection = component;
this.sendData = fn;
return true;
}
return false;
}
/**
* transmitByte(b)
*
* @this {SerialPortPDP10}
* @param {number} b
* @return {boolean} true if transmitted, false if not
*/
transmitByte(b)
{
var fTransmitted = false;
if (MAXDEBUG) this.printMessage("transmitByte(" + Str.toHexByte(b) + ")");
if (this.sendData) {
if (this.sendData.call(this.connection, b)) {
fTransmitted = true;
}
}
/*
* TODO: Why do DEC diagnostics like to output bytes with bit 7 set?
*/
b &= 0x7F;
if (this.controlIOBuffer) {
if (b == 0x0D) {
this.iLogicalCol = 0;
}
else if (b == 0x08) {
this.controlIOBuffer.value = this.controlIOBuffer.value.slice(0, -1);
/*
* TODO: Back up the correct number of columns if the character erased was a tab.
*/
if (this.iLogicalCol > 0) this.iLogicalCol--;
}
else if (b) {
/*
* RT-11 outputs lots of NULL characters, at least after a "D 56=5015" (0x0A0D) command has
* been issued, hence the "if (b)" check above.
*
* TODO: Also consider a check for Keys.ASCII.CTRL_C, because by default, RT-11 outputs "raw"
* CTRL_C characters, which we capture below and render as <ETX>. RT-11 does this for other keys
* as well, such as CTRL_K (<VT>) and CTRL_L (<FF>).
*/
var s = Str.toASCIICode(b); // formerly: String.fromCharCode(b);
var nChars = s.length; // formerly: (b >= 0x20? 1 : 0);
if (b < 0x20 && nChars == 1) nChars = 0;
if (b == 0x09) {
var tabSize = this.tabSize || 8;
nChars = tabSize - (this.iLogicalCol % tabSize);
if (this.tabSize) s = Str.pad("", nChars);
}
if (this.charBOL && !this.iLogicalCol && nChars) s = String.fromCharCode(this.charBOL) + s;
this.controlIOBuffer.value += s;
this.controlIOBuffer.scrollTop = this.controlIOBuffer.scrollHeight;
this.iLogicalCol += nChars;
}
fTransmitted = true;
}
else if (this.consoleOutput != null) {
if (b == 0x0A || this.consoleOutput.length >= 1024) {
this.println(this.consoleOutput);
this.consoleOutput = "";
}
if (b != 0x0A) {
this.consoleOutput += String.fromCharCode(b);
}
fTransmitted = true;
}
return fTransmitted;
}
/**
* SerialPortPDP10.init()
*
* This function operates on every HTML element of class "serial", extracting the
* JSON-encoded parameters for the SerialPort constructor from the element's "data-value"
* attribute, invoking the constructor to create a SerialPort component, and then binding
* any associated HTML controls to the new component.
*/
static init()
{
var aeSerial = Component.getElementsByClass(document, PDP10.APPCLASS, "serial");
for (var iSerial = 0; iSerial < aeSerial.length; iSerial++) {
var eSerial = aeSerial[iSerial];
var parmsSerial = Component.getComponentParms(eSerial);
var serial = new SerialPortPDP10(parmsSerial);
Component.bindComponentControls(serial, eSerial, PDP10.APPCLASS);
}
}
}
/*
* Internal name used for the I/O buffer control, if any, that we bind to the SerialPort.
*
* Alternatively, if SerialPort wants to use another component's control (eg, the Panel's
* "print" control), it can specify the name of that control with the 'binding' property.
*
* For that binding to succeed, we also need to know the target component; for now, that's
* been hard-coded to "Panel", in part because that's one of the few components we can rely
* upon initializing before we do, but it would be a simple matter to include a component type
* or ID as part of the 'binding' property as well, if we need more flexibility later.
*/
SerialPortPDP10.sIOBuffer = "buffer";
/*
* Initialize every SerialPort module on the page.
*/
Web.onInit(SerialPortPDP10.init);
if (NODE) module.exports = SerialPortPDP10;

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 Bus component.
* @fileoverview Implements the PDP-11 Bus component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 Computer component.
* @fileoverview Implements the PDP-11 Computer component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Controls the PDP11 CPU component.
* @fileoverview Controls the PDP-11 CPU component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PDP11 opcode handlers.
* @fileoverview Implements PDP-11 opcode handlers.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 CPU component.
* @fileoverview Implements the PDP-11 CPU component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 Debugger component.
* @fileoverview Implements the PDP-11 Debugger component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview PDP11-specific compile-time definitions.
* @fileoverview PDP-11 compile-time definitions.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PDP11 device support.
* @fileoverview Implements PDP-11 device support.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements a generic disk drive controller
* @fileoverview Implements a generic disk drive controller.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 Keyboard component.
* @fileoverview Implements the PDP-11 Keyboard component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 Memory component.
* @fileoverview Implements the PDP-11 Memory component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
@ -738,8 +738,8 @@ class MemoryPDP11 {
*
* @this {MemoryPDP11}
* @param {number} off
* @param {number} addr
* @param {number} b
* @param {number} addr
*/
writeByteChecked(off, b, addr)
{
@ -754,8 +754,8 @@ class MemoryPDP11 {
*
* @this {MemoryPDP11}
* @param {number} off
* @param {number} addr
* @param {number} w
* @param {number} addr
*/
writeWordChecked(off, w, addr)
{
@ -859,8 +859,8 @@ class MemoryPDP11 {
*
* @this {MemoryPDP11}
* @param {number} off
* @param {number} addr
* @param {number} b
* @param {number} addr
*/
writeByteLE(off, b, addr)
{
@ -876,8 +876,8 @@ class MemoryPDP11 {
*
* @this {MemoryPDP11}
* @param {number} off
* @param {number} addr
* @param {number} w
* @param {number} addr
*/
writeWordBE(off, w, addr)
{
@ -893,8 +893,8 @@ class MemoryPDP11 {
*
* @this {MemoryPDP11}
* @param {number} off
* @param {number} addr
* @param {number} w
* @param {number} addr
*/
writeWordLE(off, w, addr)
{

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Defines PDP11 message categories.
* @fileoverview Defines PDP-11 message categories.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 Panel component.
* @fileoverview Implements the PDP-11 Panel component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 RAM component.
* @fileoverview Implements the PDP-11 RAM component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PDP11 ROM component.
* @fileoverview Implements the PDP-11 ROM component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*

159
modules/shared/bin/int36 Normal file
View file

@ -0,0 +1,159 @@
#!/usr/bin/env node
/**
* @fileoverview Test the Int36 class
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
* @suppress {missingProperties}
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
var repl = require("repl");
var Defines = require("../lib/defines");
var Int36 = require("../lib/int36");
var i36Reg = new Int36();
/**
* dumpInt36(i36)
*
* @param {Int36} i36
* @return {string}
*/
function dumpInt36(i36)
{
return i36.toString() + " [" + i36.toString(8, true) + "]";
}
/**
* test(sCmd, fREPL)
*
* @param {string} sCmd
* @param {boolean} [fREPL]
* @return {*}
*/
function test(sCmd, fREPL)
{
var aTokens = sCmd.split(' ');
var sOp = aTokens[0];
var sNum1 = aTokens[1] && aTokens[1].replace(/,/g, '');
var sNum2 = aTokens[2];
if (!sNum2) {
sNum2 = sNum1;
sNum1 = undefined;
}
var i36Op = new Int36(+sNum2, +sNum1);
if (sNum2 != null) console.log(sOp + " " + dumpInt36(i36Op));
switch(sOp) {
case "set":
i36Reg = new Int36(i36Op);
break;
case "add":
i36Reg.add(i36Op);
break;
case "sub":
i36Reg.sub(i36Op);
break;
case "mul":
i36Reg.mul(i36Op);
break;
case "div":
i36Reg.div(i36Op);
break;
default:
console.log("unrecognized command: " + sCmd);
return false;
}
console.log(" = " + dumpInt36(i36Reg));
return true;
}
/**
* onCommand(cmd, context, filename, callback)
*
* @param {string} cmd
* @param {Object} context
* @param {string} filename
* @param {function(Object|null, Object)} callback
*/
var onCommand = function (cmd, context, filename, callback)
{
var result = false;
var match = cmd.match(/^\(?\s*([\S\s]*?)\s*\)?$/);
if (match && match[1]) result = test(match[1], true);
callback(null, result);
};
test("set -34,359,738,368");
test("sub 1");
test("add 1");
test("add 0");
for (let i = 0; i <= 12; i++) {
test("set 34,000,000,000");
test("mul " + Math.pow(8, i));
}
for (let i = 0; i <= 12; i++) {
test("set -34,000,000,000");
test("mul " + Math.pow(8, i));
}
test("set 100");
test("div 3");
test("set 4001");
test("div -5");
test("set 0o037777777777 0o777777777777");
test("set 0o047777777777 0o777777777777");
test("set 0o057777777777 0o777777777777");
test("set 0o067777777777 0o777777777777");
test("set 0o077777777777 0o777777777777");
test("set 0o177777777777 0o777777777777");
test("set 0o277777777777 0o777777777777");
test("set 0o377777777777 0o777777777777");
test("set 0o477777777777 0o777777777777");
test("set 0o577777777777 0o777777777777");
test("set 0o677777777777 0o777777777777");
test("set 0o777777777777 0o777777777777");
repl.start({
prompt: "int36> ",
input: process.stdin,
output: process.stdout,
eval: onCommand
});

View file

@ -657,11 +657,11 @@ class Debugger extends Component {
* @param {boolean} [fStripLeadingZeros]
* @return {string}
*/
toStrBase(n, nBytes, fStripLeadingZeros) {
toStrBase(n, nBytes = 0, fStripLeadingZeros = false) {
var s;
switch(this.nBase) {
case 8:
s = Str.toOct(n, nBytes * 3 - (nBytes > 2? 1 : 0));
s = Str.toOct(n, nBytes * 3 /* - (nBytes > 2? 1 : 0) */);
break;
case 10:
s = n.toString();

874
modules/shared/lib/int36.js Normal file
View file

@ -0,0 +1,874 @@
/**
* @fileoverview Support for 36-bit integers (using unsigned JavaScript numbers)
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (@jeffpar)
* @copyright © Jeff Parsons 2012-2017
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCjs. If not,
* see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every modified copy of this work
* and to display that copyright notice when the software starts running; see COPYRIGHT in
* <http://pcjs.org/modules/shared/lib/defines.js>.
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
"use strict";
/*
From the "PDP-10 System Reference Manual", May 1968, p. 1-4:
1.1 NUMBER SYSTEM
The program can interpret a data word as a 36-digit, unsigned binary number, or the left and right
halves of a word can be taken as separate 18-bit numbers. The PDP-10 repertoire includes instructions
that effectively add or subtract one from both halves of a word, so the right half can be used for
address modification when the word is addressed as an index register, while the left half is used to
keep a control count.
The standard arithmetic instructions in the PDP-10 use twos complement, fixed point conventions to do
binary arithmetic. In a word used as a number, bit 0 (the leftmost bit) represents the sign, 0 for positive,
1 for negative. In a positive number the remaining 35 bits are the magnitude in ordinary binary notation.
The negative of a number is obtained by taking its twos complement. If x is an n-digit binary number, its
twos complement is 2^n - x, and its ones complement is (2^n - 1) - x, or equivalently (2^n - x) - 1.
Subtracting a number from 2^n - 1 (ie, from all 1s) is equivalent to performing the logical complement,
ie changing all 0s to 1s and all 1s to 0s. Therefore, to form the twos complement one takes the logical
complement (usually referred to merely as the complement) of the entire word including the sign, and adds
1 to the result. In a negative number the sign bit is 1, and the remaining bits are the twos complement
of the magnitude.
Zero is represented by a word containing all 0s. Complementing this number produces all 1s, and adding
1 to that produces all 0s again. Hence there is only one zero representation and its sign is positive.
Since the numbers are symmetrical in magnitude about a single zero representation, all even numbers both
positive and negative end in 0, all odd numbers in 1 (a number all 1s represents -1). But since there are
the same number of positive and negative numbers and zero is positive, there is one more negative number
than there are nonzero positive numbers. This is the most negative number and it cannot be produced by
negating any positive number (its octal representation is 400000 000000 and its magnitude is one greater
than the largest positive number).
If ones complements were used for negatives one could read a negative number by attaching significance
to the as instead of the 1s. In twos complement notation each negative number is one greater than the
complement of the positive number of the same magnitude, so one can read a negative number by attaching
significance to the rightmost 1 and attaching significance to the 0s at the left of it (the negative number
of largest magnitude has a 1 in only the sign position). In a negative integer, 1s may be discarded at the
left, just as leading 0s may be dropped in a positive integer. In a negative fraction, 0s may be discarded
at the right. So long as only 0s are discarded, the number remains in twos complement form because it
still has a 1 that possesses significance; but if a portion including the rightmost 1 is discarded, the
remaining part of the fraction is now a ones complement.
The computer does not keep track of a binary point - the programmer must adopt a point convention and shift
the magnitude of the result to conform to the convention used. Two common conventions are to regard a number
as an integer (binary point at the right) or as a proper fraction (binary point at the left); in these two
cases the range of numbers represented by a single word is -2^35 to 2^35 - 1, or -1 to 1 - 2^35. Since
multiplication and division make use of double length numbers, there are special instructions for performing
these operations with integral operands.
SIDEBAR: Multiplication produces a double length product, and the programmer must remember that discarding
the low order part of a double length negative leaves the high order part in correct twos complement form
only if the low order part is null.
...
2.5 FIXED POINT ARITHMETIC
For fixed point arithmetic the PDP-10 has instructions for arithmetic shifting (which is essentially
multiplication by a power of 2) as well as for performing addition, subtraction, multiplication and division
of numbers in fixed point format [§ 1.1]. In such numbers the position of the binary point is arbitrary
(the programmer may adopt any point convention). The add and subtract instructions involve only single length
numbers, whereas multiply supplies a double length product, and divide uses a double length dividend. The high
and low order words respectively of a double length fixed point number are in accumulators A and A+1 (mod 20),
where the magnitude is the 70-bit string in bits 1-35 of the two words and the signs of the two are identical.
There are also integer multiply and divide instructions that involve only single length numbers and are
especially suited for handling smaller integers, particularly those of eighteen bits or less such as addresses
(of course they can be used for small fractions as well provided the programmer keeps track of the binary point).
For convenience in the following, all operands are assumed to be integers (binary point at the right).
The processor has four flags, Overflow, Carry 0, Carry 1 and No Divide, that indicate when the magnitude of a
number is or would be larger than can be accommodated. Carry 0 and Carry 1 actually detect carries out of bits
0 and 1 in certain instructions that employ fixed point arithmetic operations: the add and subtract instructions
treated here, the move instructions that produce the negative or magnitude of the word moved [§ 2.2], and the
arithmetic test instructions that increment or decrement the test word [§ 2.7]. In these instructions an
incorrect result is indicated - and the Overflow flag set - if the carries are different, ie if there is a carry
into the sign but not out of it, or vice versa. The Overflow flag is also set by No Divide being set, which
means the processor has failed to perform a division because the magnitude of the dividend is greater than or
equal to that of the divisor, or in integer divide, simply that the divisor is zero. In other overflow cases
only Overflow itself is set: these include too large a product in multiplication, and loss of significant bits
in left arithmetic shifting.
SIDEBAR: Overflow is determined directly from the carries, not from the carry flags, as their states may reflect
events in previous instructions.
*/
/**
* @class Int36
* @property {number} value
* @property {number|null} extended
* @property {number|null} remainder
* @property {number} error
* @unrestricted
*
* The 'value' property stores the 36-bit value as an unsigned integer. When the value should be
* interpreted as a signed quantity, subtract BIT36 whenever value > MAXPOS.
*
* The 'extended' property stores an additional 36 bits of data from a multiplication, and can also
* provide an additional 36 bits of data to a division. Internally, it should be null whenever the
* value is not extended.
*
* The 'remainder' property stores the remainder from the last division. You should assume it will
* be set to null by any other operation.
*
* The 'error' property records any error(s) from the last operation.
*
* NOTE: What we call extended Int36 values DEC refers to as "double length numbers", and they refer
* to the 'extended' portion as the "low order part" and the 'value' portion as the "high order part",
* presumably because they number the left-most significant bit 0.
*/
class Int36 {
/**
* Int36(obj, extended)
*
* The constructor, which simply calls set(), creates an Int36 from either:
*
* 1) another Int36
* 2) a single 36-bit value, with an optional 36-bit extension
* 3) nothing (initial value will be zero)
*
* All internal Int36 values (ie, the value and any extension) are unsigned values in the range:
*
* 0 <= i <= Math.pow(2, 36) - 1
*
* The lower bound is ZERO and the upper bound is Int36.MAXVAL. Whenever an Int36 value should be
* interpreted as a signed value, values above Int36.MAXPOS (ie, values with bit 35 set) should be
* converted to their signed counterpart by subtracting the value from Int36.BIT36 (aka MAXVAL + 1);
* the easiest way to do that is call isNegative() to check the sign bit and then call negate() as
* appropriate.
*
* NOTE: We use modern bit numbering, where bit 0 is the right-most (least-significant) bit and
* bit 35 is the left-most bit. This is opposite of the PDP-10 convention, which defined bit 0 as the
* left-most bit and bit 35 as the right-most bit.
*
* Although the integer precision of JavaScript floating-point (IEEE 754 double-precision) numbers is:
*
* -Math.pow(2, 53) <= i <= Math.pow(2, 53)
*
* it seems unwise to ever permit our internal values to creep outside the 36-bit range, because
* floating-point operations will drop least-significant bits in favor of most-significant bits when a
* result becomes too large, which is the opposite of what integer operations traditionally do. There
* might be some optimization benefits to performing our internal 36-bit truncation "lazily", but at
* least initially, I prefer to truncate() the results of all 36-bit arithmetic operations immediately.
*
* Most of the Int36 operations come in two flavors: those that accept numbers, and those that accept
* another Int36. The latter are more efficient, because (as just explained) an Int36's internal value
* should always be in range, whereas external numbers could be out of range OR have a fractional value
* OR be something else entirely (NaN, Infinity, -Infinity, undefined, etc), so numeric inputs are
* always passed through the static validate() function.
*
* We could eliminate the two flavors and check each parameter's type, like we do in the constructor,
* but constructor calls are infrequent (if they're not, you're doing something wrong), whereas Int36-only
* operations should be as fast and unchecked as possible.
*
* @this {Int36}
* @param {Int36|number} [obj] (if omitted, the default is zero)
* @param {number|null} [extended]
*/
constructor(obj, extended)
{
this.set(obj, extended);
}
/**
* set(obj, extended)
*
* @this {Int36}
* @param {Int36|number} [obj] (if omitted, the default is zero)
* @param {number|null} [extended]
*/
set(obj = 0, extended)
{
if (obj instanceof Int36) {
this.value = obj.value;
this.extended = obj.extended;
this.remainder = obj.remainder;
}
else {
this.value = Int36.validate(obj || 0);
this.extended = null;
/*
* NOTE: Surprisingly, isNaN(null) is false, whereas isNaN(undefined) is true. Go figure.
*/
if (extended != null && !isNaN(extended)) {
this.extended = Int36.validate(extended);
}
this.remainder = null;
}
this.error = Int36.ERROR.NONE;
}
/**
* toDecimal(fUnsigned)
*
* @this {Int36}
* @param {boolean} fUnsigned
* @return {string}
*/
toDecimal(fUnsigned)
{
var s = "", fNeg = false;
var i36Div = new Int36(10000000000);
var i36Rem = new Int36();
var i36Tmp = new Int36(this.value, this.extended);
if (!fUnsigned && i36Tmp.isNegative()) {
i36Tmp.negate();
fNeg = true;
}
/*
* Conversion of any 72-bit value should take no more than 3 divisions by 10,000,000,000.
*/
var nMaxDivs = 3;
do {
i36Tmp.div(i36Div);
/*
* In a perfect world, there would be no errors, because all calculations at this point
* are within known bounds. But let's make sure we don't produce garbage or spin our wheels.
*/
if (i36Tmp.error || i36Tmp.remainder >= 10000000000 || !nMaxDivs--) {
s = "error";
break;
}
var quotient = i36Tmp.value || i36Tmp.extended;
var nMinDigits = (quotient? 10 : 1);
i36Rem.set(i36Tmp.remainder);
do {
i36Rem.divNum(10);
if (i36Rem.remainder < 0 || i36Rem.remainder > 9) {
quotient = 0;
s = "error";
break;
}
s = String.fromCharCode(0x30 + i36Rem.remainder) + s;
} while (--nMinDigits > 0 || i36Rem.value);
} while (quotient);
if (fNeg) s = '-' + s;
return s;
}
/**
* toString(radix, fUnsigned)
*
* @this {Int36}
* @param {number} [radix] (default is 10)
* @param {boolean} [fUnsigned] (default is signed for radix 10, unsigned for any other radix)
* @return {string}
*/
toString(radix = 10, fUnsigned = false)
{
if (radix == 10) {
return this.toDecimal(fUnsigned);
}
var value = this.value;
var extended = this.extended;
if (radix == 8) {
var s = Int36.octal(value);
if (extended) {
s = Int36.octal(extended) + ',' + s;
}
if (this.remainder) {
s += ':' + Int36.octal(this.remainder);
}
if (DEBUG && this.error) {
if (this.error & Int36.ERROR.OVERFLOW) {
s += " overflow";
}
if (this.error & Int36.ERROR.UNDERFLOW) {
s += " underflow";
}
if (this.error & Int36.ERROR.DIVZERO) {
s += " divide-by-zero";
}
}
return s;
}
if (extended != null) {
/*
* TODO: Need a radix-independent solution for these extended (up to 72-bit) values,
* because after 52 bits, JavaScript will start dropping least-significant bits. Until
* then, you're better off sticking with octal (see above).
*/
value = extended * Int36.BIT36 + value;
}
return value.toString(radix);
}
/**
* truncate(result, operand, fSub)
*
* The range of valid results (0 - MAXVAL) is divided into two equal sub-ranges: 0 to MAXPOS,
* where the sign bit is zero (the bottom range), and MAXPOS+1 to MAXVAL (the top range), where
* the sign bit is one. During a single arithmetic operation, the result can "wrap around" from
* the bottom range to the top, or from the top range to the bottom, but it's an overflow/underflow
* error ONLY if the result "wraps across" the midpoint between the two ranges, producing an
* unnaturally small delta (<= MAXPOS).
*
* This can be confirmed independently by examining the sign bits (BIT35) of the original value
* (V), the operand (O), the result (R), as well as two intermediate calculations, VR = (V ^ R)
* and OR = (O ^ R), and a final calculation, E = (VR & OR). If E is set, then overflow (V == 0)
* or underflow (V == 1) occurred.
*
* In the case of subtraction (when fSub is true), consult the second table, which replaces OR
* with OV (O ^ V).
*
* V O R VR OR E
* - - - -- -- -
* 0 0 0 0 0 0
* 0 0 1 1 1 1 (adding positive to positive yielded negative: overflow)
* 0 1 0 0 1 0
* 0 1 1 1 0 0
* 1 0 0 1 0 0
* 1 0 1 0 1 0
* 1 1 0 1 1 1 (adding negative to negative yielded positive: underflow)
* 1 1 1 0 0 0
*
* V O R VR OV E
* - - - -- -- -
* 0 0 0 0 0 0
* 0 0 1 1 0 0
* 0 1 0 0 1 0
* 0 1 1 1 1 1 (subtracting negative from positive yielded negative: overflow)
* 1 0 0 1 1 1 (subtracting positive from negative yielded positive: underflow)
* 1 0 1 0 1 0
* 1 1 0 1 0 0
* 1 1 1 0 0 0
*
* NOTE: This function's job is to truncate the result of an operation to 36-bit accuracy,
* not to remove any fractional portion that might also exist. If an operation could have produced
* a non-integer result (eg, div()), it's the caller's responsibility to deal with that first.
*
* @this {Int36}
* @param {number} result
* @param {number} [operand]
* @param {boolean} [fSub] (true if operand was subtracted)
* @return {number}
*/
truncate(result, operand, fSub)
{
if (DEBUG && result !== Math.trunc(result)) {
console.log("Int36.truncate(" + result + " is not an integer)");
}
this.extended = null;
this.remainder = null;
this.error = Int36.ERROR.NONE;
if (result < 0) {
result += Int36.BIT36;
}
result %= Int36.BIT36;
/*
* We don't actually need to know what the operand was to determine overflow or underflow
* for addition or subtraction, just the original value (this.value) the new value (result).
*
* We do, however, need to know the operand if we want to confirm our error calculation using
* the truth table above, which requires examining the sign bits of all the inputs and outputs.
*/
if (operand !== undefined) {
/*
* Calculating V, R, O, and E as described above is somewhat tedious, because bits
* above bit 31 cannot be accessed directly; we shift all the sign bits down to bit 0
* using division first. We don't need to truncate the results, because the subsequent
* bit-wise operations perform truncation automatically.
*/
var e = 0;
if (DEBUG) {
var v = this.value / Int36.BIT35, r = result / Int36.BIT35, o = operand / Int36.BIT35;
e = ((v ^ r) & (o ^ (fSub? v : r))) & 1;
}
if ((result > Int36.MAXPOS) != (this.value > Int36.MAXPOS)) {
var delta = result - this.value;
if (Math.abs(delta) <= Int36.MAXPOS) {
this.error |= (delta > 0 ? Int36.ERROR.OVERFLOW : Int36.ERROR.UNDERFLOW);
if (DEBUG && (delta > 0) != !(e & v)) e = 0;
}
}
if (DEBUG && (!this.error) != (!e)) console.log("overflow inconsistency");
}
return result;
}
/**
* add(i36)
*
* @this {Int36}
* @param {Int36} i36
*/
add(i36)
{
this.value = this.truncate(this.value + i36.value, i36.value);
}
/**
* addNum(num)
*
* @this {Int36}
* @param {number} num
*/
addNum(num)
{
num = Int36.validate(num);
this.value = this.truncate(this.value + num, num);
}
/**
* sub(i36)
*
* @this {Int36}
* @param {Int36} i36
*/
sub(i36)
{
this.value = this.truncate(this.value - i36.value, i36.value, true);
}
/**
* subNum(num)
*
* @this {Int36}
* @param {number} num
*/
subNum(num)
{
num = Int36.validate(num);
this.value = this.truncate(this.value - num, num, true);
}
/**
* mul(i36)
*
* @this {Int36}
* @param {Int36} i36
*/
mul(i36)
{
this.mulExtended(i36.value);
}
/**
* mulNum(num)
*
* @this {Int36}
* @param {number} num
*/
mulNum(num)
{
this.mulExtended(Int36.validate(num));
}
/**
* mulExtended(value)
*
* To support 72-bit results, we perform the multiplication process as you would "by hand",
* treating the operands to be multiplied as two 2-digit numbers, where each "digit" is an 18-bit
* number (base 2^18). Each individual multiplication of these 18-bit "digits" will produce
* a result within 2^36, well within JavaScript integer accuracy.
*
* @this {Int36}
* @param {number} value
*/
mulExtended(value)
{
var fNeg = false, extended;
var n1 = this.value, n2 = value;
if (n1 > Int36.MAXPOS) {
n1 = Int36.BIT36 - n1;
fNeg = !fNeg;
}
if (n2 > Int36.MAXPOS) {
n2 = Int36.BIT36 - n2;
fNeg = !fNeg;
}
if (n1 < Int36.BIT18 && n2 < Int36.BIT18) {
value = n1 * n2;
extended = 0;
}
else {
var n1d1 = (n1 % Int36.BIT18);
var n1d2 = Math.trunc(n1 / Int36.BIT18);
var n2d1 = (n2 % Int36.BIT18);
var n2d2 = Math.trunc(n2 / Int36.BIT18);
var m1d1 = n1d1 * n2d1;
var m1d2 = (n1d2 * n2d1) + Math.trunc(m1d1 / Int36.BIT18);
extended = Math.trunc(m1d2 / Int36.BIT18);
m1d2 = (m1d2 % Int36.BIT18) + (n1d1 * n2d2);
value = (m1d2 * Int36.BIT18) + (m1d1 % Int36.BIT18);
extended += Math.trunc(m1d2 / Int36.BIT18) + (n1d2 * n2d2);
}
this.value = this.truncate(value);
this.extended = this.truncate(extended);
if (fNeg) this.negate();
}
/**
* div(i36)
*
* @this {Int36}
* @param {Int36} i36
*/
div(i36)
{
this.divExtended(i36.value);
}
/**
* divNum(num)
*
* @this {Int36}
* @param {number} num
*/
divNum(num)
{
this.divExtended(Int36.validate(num));
}
/**
* divExtended(divisor)
*
* We disallow a divisor of zero; however, we no longer disallow a divisor smaller than the
* extended portion of the dividend, even though such a divisor would produce a quotient larger
* than 36 bits. Instead, we support extended quotients, because some of our internal functions
* (eg, toDecimal()) require it.
*
* For callers that can only handle 36-bit quotients, they can either perform their own preliminary
* check of the divisor against any extended dividend, or they can simply allow all divisions to
* proceed, check for an extended quotient afterward, and report the appropriate error.
*
* @this {Int36}
* @param {number} divisor
*/
divExtended(divisor)
{
if (!divisor) {
this.error |= Int36.ERROR.DIVZERO;
return;
}
var fNegQ = false, fNegR = false;
if (divisor > Int36.MAXPOS) {
divisor = Int36.BIT36 - divisor;
fNegQ = !fNegQ;
}
if (this.isNegative()) {
this.negate();
fNegR = true; fNegQ = !fNegQ;
}
this.extend();
/*
* Initialize the four double-length 72-bit "bits" values we need for the division process.
*
* The process involves shifting the divisor left 1 bit (ie, doubling it) until it equals
* or exceeds the dividend, and then repeatedly subtracting the divisor from the dividend and
* shifting the divisor right 1 bit until the divisor is "exhausted" (no bits left), with an
* "early out" if the dividend gets "exhausted" first.
*
* Note that each element of these "bits" arrays is a 36-bit value, so it's rarely a good idea
* to use bit-wise operators on them, because those would operate on only the low 32 bits.
* Stick with the "bits" worker functions I've created, and trust your JavaScript engine to
* inline/optimize the code.
*
* TODO: Profile this code to determine if individual variables (eg, bitsResLo and bitsResHi)
* instead of 2-element arrays is faster and/or less impactful on garbage collection. I prefer
* both the simplified syntax of arrays as well as their extensibility if we ever want/need
* to go beyond 72 bits.
*/
var bitsRes = [0, 0];
var bitsPow = [1, 0];
var bitsDiv = [divisor, 0];
var bitsRem = [this.value, this.extended];
while (Int36.cmpBits(bitsRem, bitsDiv) > 0) {
Int36.addBits(bitsDiv, bitsDiv);
Int36.addBits(bitsPow, bitsPow);
}
do {
if (Int36.cmpBits(bitsRem, bitsDiv) >= 0) {
Int36.subBits(bitsRem, bitsDiv);
Int36.addBits(bitsRes, bitsPow);
if (Int36.zeroBits(bitsRem)) break;
}
Int36.shrBits(bitsDiv);
Int36.shrBits(bitsPow);
} while (!Int36.zeroBits(bitsPow));
/*
* Since divisors are limited to 36-bit values, something's wrong if we have an extended remainder.
*/
if (DEBUG && bitsRem[1]) {
console.log("divExtended() assertion failure");
}
this.value = bitsRes[0];
this.extended = bitsRes[1];
this.remainder = bitsRem[0];
if (fNegQ) this.negate();
this.reduce();
if (fNegR && this.remainder) {
this.remainder = Int36.BIT36 - this.remainder;
}
}
/**
* extend()
*
* Sets extended to match the sign of value (if not already set).
*/
extend()
{
if (this.extended == null) {
this.extended = (this.value > Int36.MAXPOS? Int36.MAXVAL : 0);
}
}
/**
* reduce()
*
* Unsets extended if it's superfluous; opposite of extend().
*
* It's worth noting DEC's SIDEBAR comment (from above):
*
* Multiplication produces a double length product, and the programmer must remember that discarding
* the low order part ['extended'] of a double length negative leaves the high order part ['value'] in
* correct twos complement form only if the low order part ['extended'] is null.
*
* is not entirely applicable to us. For one thing, when value is MINNEG and extended is ZERO, we interpret
* that extended value as 34,359,738,368; we cannot simply eliminate the extended portion, otherwise value
* would be interpreted as -34,359,738,368.
*
* DEC can say that because each of the words in a PDP-10 double-length product contains its own sign bit,
* resulting in only 70 bits of magnitude. However, we don't store our extended (double-length) results that
* way, so be aware of these mismatches in both terminology and format when converting an Int36 to/from PDP-10
* registers/memory.
*/
reduce()
{
if (this.extended == 0 && this.value <= Int36.MAXPOS || this.extended == Int36.MAXVAL && this.value > Int36.MAXPOS) {
this.extended = null;
}
}
/**
* isNegative()
*
* @return {boolean}
*/
isNegative()
{
return (this.extended > Int36.MAXPOS || this.extended == null && this.value > Int36.MAXPOS);
}
/**
* negate()
*
* negate() MUST automatically extend the value, because the two's complement of the most negative
* number (MINNEG) still has its sign bit set, so we must rely on the sign of the extended value to
* compensate.
*
* This is handled below by setting extended first, based on the opposite of the value's current sign;
* we could negate extended AFTER negating value, but then we'd need a special test for the MINNEG value.
*/
negate()
{
if (this.extended == null) {
/*
* Set extended to the OPPOSITE of the current value.
*/
this.extended = (this.value > Int36.MAXPOS? 0 : Int36.MAXVAL);
}
else if (this.value) {
/*
* Perform one's complement on the extended value.
*/
this.extended = Int36.MAXVAL - this.extended;
}
else {
/*
* Perform two's complement on the extended value.
*/
if (this.extended) this.extended = Int36.BIT36 - this.extended;
}
/*
* Perform two's complement on the value.
*/
if (this.value) {
this.value = Int36.BIT36 - this.value;
}
this.error = Int36.ERROR.NONE;
}
/**
* addBits(bitsDst, bitsSrc)
*
* Adds bitsSrc to bitsDst.
*
* @param {Array.<number>} bitsDst
* @param {Array.<number>} bitsSrc
*/
static addBits(bitsDst, bitsSrc)
{
bitsDst[0] += bitsSrc[0];
bitsDst[1] += bitsSrc[1];
if (bitsDst[0] >= Int36.BIT36) {
bitsDst[0] %= Int36.BIT36;
bitsDst[1]++;
}
}
/**
* cmpBits(bitsDst, bitsSrc)
*
* Compares bitsDst to bitsSrc, by computing bitsDst - bitsSrc.
*
* @param {Array.<number>} bitsDst
* @param {Array.<number>} bitsSrc
* @return {number} > 0 if bitsDst > bitsSrc, == 0 if bitsDst == bitsSrc, < 0 if bitsDst < bitsSrc
*/
static cmpBits(bitsDst, bitsSrc)
{
var result = bitsDst[1] - bitsSrc[1];
if (!result) result = bitsDst[0] - bitsSrc[0];
return result;
}
/**
* shrBits(bitsDst)
*
* Shifts bitsDst right one bit.
*
* @param {Array.<number>} bitsDst
*/
static shrBits(bitsDst)
{
if (bitsDst[1] % 2) {
bitsDst[0] += Int36.BIT36;
}
bitsDst[0] = Math.trunc(bitsDst[0] / 2);
bitsDst[1] = Math.trunc(bitsDst[1] / 2);
}
/**
* subBits(bitsDst, bitsSrc)
*
* Subtracts bitsSrc from bitsDst.
*
* @param {Array.<number>} bitsDst
* @param {Array.<number>} bitsSrc
*/
static subBits(bitsDst, bitsSrc)
{
bitsDst[0] -= bitsSrc[0];
bitsDst[1] -= bitsSrc[1];
if (bitsDst[0] < 0) {
bitsDst[0] += Int36.BIT36;
bitsDst[1]--;
}
}
/**
* zeroBits(bits)
*
* True if bits are all zero, false otherwise.
*
* @param {Array.<number>} bits
*/
static zeroBits(bits)
{
return !bits[0] && !bits[1];
}
/**
* octal(value)
*
* @param {number} value
* @return {string}
*/
static octal(value)
{
if (value < 0) value += Int36.BIT36;
return ("00000000000" + value.toString(8)).slice(-12);
}
/**
* validate(num)
*
* This ensures that any incoming (external) 36-bit values conform to our internal requirements.
*
* @param {number} num
* @return {number}
*/
static validate(num)
{
/*
* Although it's expected that most callers will supply unsigned 36-bit values, we're nice about
* converting any signed values to their unsigned (two's complement) counterpart, provided they are
* within the acceptable range. Any values outside that range will be dealt with afterward.
*/
if (num < 0 && num >= Int36.MINNEG) {
num += Int36.BIT36;
}
var value = Math.trunc(Math.abs(num)) % Int36.BIT36;
if (DEBUG && num !== value) {
console.log("Int36.validate(" + num + " out of range, truncated to " + value + ")");
}
return value;
}
}
Int36.ERROR = {
NONE: 0x0,
OVERFLOW: 0x1,
UNDERFLOW: 0x2,
DIVZERO: 0x4
};
Int36.BIT18 = Math.pow(2, 18); // 262,144
Int36.BIT35 = Math.pow(2, 35); // 34,359,738,368 (aka the sign bit)
Int36.BIT36 = Math.pow(2, 36); // 68,719,476,736
Int36.MAXPOS = Math.pow(2, 35) - 1; // 34,359,738,367
Int36.MINNEG = -Math.pow(2, 35); // -34,359,738,368
Int36.MAXVAL = Math.pow(2, 36) - 1; // 68,719,476,735
if (NODE) module.exports = Int36;

View file

@ -174,6 +174,35 @@
"./modules/shared/lib/state.js",
"./modules/shared/lib/embed.js"
],
"pdp10Files": [
"./modules/shared/lib/defines.js",
"./modules/shared/lib/diskapi.js",
"./modules/shared/lib/dumpapi.js",
"./modules/shared/lib/reportapi.js",
"./modules/shared/lib/userapi.js",
"./modules/shared/lib/int36.js",
"./modules/shared/lib/keys.js",
"./modules/shared/lib/component.js",
"./modules/shared/lib/strlib.js",
"./modules/shared/lib/usrlib.js",
"./modules/shared/lib/weblib.js",
"./modules/pdp10/lib/defines.js",
"./modules/pdp10/lib/messages.js",
"./modules/pdp10/lib/panel.js",
"./modules/pdp10/lib/bus.js",
"./modules/pdp10/lib/device.js",
"./modules/pdp10/lib/memory.js",
"./modules/pdp10/lib/cpu.js",
"./modules/pdp10/lib/cpustate.js",
"./modules/pdp10/lib/rom.js",
"./modules/pdp10/lib/ram.js",
"./modules/pdp10/lib/serial.js",
"./modules/shared/lib/debugger.js",
"./modules/pdp10/lib/debugger.js",
"./modules/pdp10/lib/computer.js",
"./modules/shared/lib/state.js",
"./modules/shared/lib/embed.js"
],
"pdp11Files": [
"./modules/shared/lib/defines.js",
"./modules/shared/lib/diskapi.js",

View file

@ -202,7 +202,7 @@ function Vf(a,b,c){var d;if(b){b=Wf(a,b);for(var e=0,f=!1,g=b,h=[],k=[],p=b.spli
d))}return d}function Wf(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=Vf(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?$f(a,e):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.N-a.Y}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
function Xf(a,b,c,d){var e;null!=b?(e=a.Kb(b),0<=e?e=a.Lb(e):(e=a.S[b],null==e&&(e=Ha(b,a.na))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
function Zf(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var k=d&255,p=void 0,u=8,v="";u?32<u&&(u=32):u=32;for(var B=null==k||isNaN(k),y=p=p||u;0<u--;)y||(v=","+v,y=p),v=(B?"?":k&1?"1":"0")+v,k>>=1,y--;g=v+g;d>>=8}d=t(c,0,!0)+" "+c+". "+Ia(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}
function ag(a,b){if(b)return Zf(a,b,a.S[b]);var c=0;for(b in a.S)Zf(a,b,a.S[b]),c++;return 0<c}function $f(a,b){switch(a.na){case 8:a=Ia(b,NaN);break;case 10:a=b.toString();break;default:a=t(b,NaN)}return a}var Yf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function ag(a,b){if(b)return Zf(a,b,a.S[b]);var c=0;for(b in a.S)Zf(a,b,a.S[b]),c++;return 0<c}function $f(a,b){var c;c=void 0===c?0:c;switch(a.na){case 8:a=Ia(b,3*c);break;case 10:a=b.toString();break;default:a=t(b,2*c)}return a}var Yf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function bg(a){Tf.call(this,a);this.style=cg;this.F=dg();this.la=dg();this.O=dg();this.A=[];this.j=this.I=this.w=[];eg(this);this.W=0;fg(this);this.Z={};gg(this,a.messages);this.ea=a.commands;var b=this;window?void 0===window.pc8080&&(window.pc8080=function(a){return Fc(b,a)}):void 0===global.pc8080&&(global.pc8080=function(a){return Fc(b,a)})}aa(bg,Tf);l=bg.prototype;
l.Ea=function(a,b,c,d){this.H=b;this.u=c;this.R=a;(a=Bc(a,"messages"))&&gg(this,a);this.ga=hg;Sd(this,64,function(a){a:{var b=d.H.b,c=a[0],e=a=0,k=b.length;if(c){a=ig(jg(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.H.g;k=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;k--;){var u=b[e];u.type==c?p++||d.i("..."):(c=u.type,p=Ib[c],u&&d.i(t(u.id)+" %"+t(e<<d.H.g)+" %%"+t(u.J)+" "+x(u.pb)+" "+
x(u.size)+" "+p),c!=dc&&(c=-1),p=0);a+=d.H.w;e++}}});Aa(this)};

View file

@ -44,9 +44,9 @@
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
*/
var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={lp:0,np:1,op:2,hl:3,pp:4,qp:5,rp:6,sp:7,tp:8,up:9,vp:10,wp:11,xp:12,yp:13,zp:14,Ap:15,Bp:16,Cp:17,Dp:18,Ep:19,Fp:20,Gp:21,Hp:22,Ip:23,Jp:24,Kp:25,Lp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,dn:108,hn:109,n:110,qn:111,p:112,q:113,r:114,No:115,t:116,Qo:117,Ro:118,So:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Mp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];
fa[191]=n["?"];fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"];
function ga(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ha(a,b){var c,d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function ia(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=ha(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
@ -106,39 +106,39 @@ l.fc=function(a,b){this.aa[(a&this.C)>>>this.A].Dc(a&this.D,b&255,a)};function B
function Cc(a,b){var c=0,d=[],e=!a.J&&a.N==a.C;e||fc(a,!0);for(var f=0;f<a.M;f++){var g=a.aa[f];if(b&&g.type!=vc||g.Oa||g.qj){d[c++]=f;var h=c++;if(g=g.save()){for(var k=0,m=0,p=[];k<g.length;){for(var w=g[k],u=k+1;u<g.length&&g[u]===w;)u++;p[m++]=u-k;p[m++]=w;k=u}p.length<g.length&&(g=p)}d[h]=g}}e||fc(a,!1);d[c]=e;return d}function Dc(a,b){if(null==b)return a.K=!a.K,a.K;void 0===a.F[b]&&(a.F[b]=[null,!1]);a.F[b][1]=!a.F[b][1];return a.F[b][1]}
function Ec(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.F[k]?Wa("Input port "+ka(k)+" already registered"):f.F[k]=[h,!1]}}function Fc(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.F[b],h=a.Y[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g?(g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k),a.ba&&a.K!=g[1]&&Gc(a.ba,b,m)):a.ba&&(Db(a.ba,a,b,null,d),a.K&&Gc(a.ba,b,m));e|=m<<f;f+=h<<3;b+=h;c-=h}return e}
function Hc(a,b){if(null==b)return a.L=!a.L,a.L;void 0===a.G[b]&&(a.G[b]=[null,!1]);a.G[b][1]=!a.G[b][1];return a.G[b][1]}function Ic(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.G[k]?Wa("Output port "+ka(k)+" already registered"):f.G[k]=[h,!1]}}
function Jc(a,b,c,d,e){for(var f=0;0<c;){var g=a.G[b],h=a.Z[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,e);a.ba&&a.L!=g[1]&&Kc(a.ba,b,k)}else a.ba&&(Db(a.ba,a,b,k,e),a.L&&Kc(a.ba,b,k));f+=h<<3;b+=h;c-=h}}function hc(a,b,c,d,e){b="Memory block error ("+b+": "+q(c)+","+q(d)+")";e?a.ba?a.ba.message(b):a.log(b):Wa(b);return!1}var Ub,Lc={Hk:20,count:8,Zp:1,type:3},Nc=0,Oc;for(Oc in Lc){var Pc=Lc[Oc];Lc[Oc]={nh:(1<<Pc)-1<<Nc,shift:Nc};Nc+=Pc}Ub=Lc;
function Jc(a,b,c,d,e){for(var f=0;0<c;){var g=a.G[b],h=a.Z[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,e);a.ba&&a.L!=g[1]&&Kc(a.ba,b,k)}else a.ba&&(Db(a.ba,a,b,k,e),a.L&&Kc(a.ba,b,k));f+=h<<3;b+=h;c-=h}}function hc(a,b,c,d,e){b="Memory block error ("+b+": "+q(c)+","+q(d)+")";e?a.ba?a.ba.message(b):a.log(b):Wa(b);return!1}var Ub,Lc={Hk:20,count:8,aq:1,type:3},Nc=0,Oc;for(Oc in Lc){var Pc=Lc[Oc];Lc[Oc]={nh:(1<<Pc)-1<<Nc,shift:Nc};Nc+=Pc}Ub=Lc;
var ic=1,lc=2,oc=3,qc=4,tc=5,Qc;if(Eb){var Rc=new ArrayBuffer(2);(new DataView(Rc)).setUint16(0,256,!0);Qc=256===(new Uint16Array(Rc))[0]}else Qc=!1;var wc=Qc;
function x(a,b,c,d,e,f){this.id=Sc+=2;this.X=null;this.H=0;this.xa=a;this.ve=b;this.size=c||0;this.type=d||Tc;this.D=d==vc;this.controller=null;this.C=f;ec(this);this.Oa=this.qj=!1;if(c)if(e)this.controller=e,a=e.vj(a),this.X=a[0],this.H=a[1],pc(this,e.fh());else if(Eb)this.I=new ArrayBuffer(c),this.G=new DataView(this.I,0,c),this.Pa=new Uint8Array(this.I,0,c),this.Rd=new Uint16Array(this.I,0,c>>1),this.X=new Int32Array(this.I,0,c>>2),pc(this,wc?xc:yc);else{this.X=Array(c>>2);for(e=0;e<this.X.length;e++)this.X[e]=
0;pc(this,zc)}else pc(this)}l=x.prototype;l.ih=function(a){this.xa=a};l.save=function(){var a,b;if(this.controller)a=null;else if(Eb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.getInt32(b<<2,!0);else a=this.X;return a};l.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Eb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.X=a;return this.Oa=!0}return!1};function pc(a,b,c){b||(b=a.type==Uc?Vc:a.type==Wc?Xc:Yc);Zc(a,b,c);$c(a,b,c)}
function Zc(a,b,c){c&&a.he||(a.Bc=b[0]||a.Tk,a.Mf=b[2]||a.Uk,a.Nd=b[4]||a.Rk);if(c||void 0===c)a.Zd=b[0]||a.Tk,a.Nf=b[2]||a.Uk,a.ji=b[4]||a.Rk}function $c(a,b,c){c&&a.ie||(a.Dc=!a.D&&b[1]||a.cf,a.Tf=!a.D&&b[3]||a.pi,a.Sf=!a.D&&b[5]||a.oi);if(c||void 0===c)a.bf=b[1]||a.cf,a.ri=b[3]||a.pi,a.K=b[5]||a.oi}function ad(a){a.Bc=a.Zd;a.Mf=a.Nf;a.Nd=a.ji}function bd(a){a.Dc=a.D?a.cf:a.bf;a.Tf=a.D?a.pi:a.ri;a.Sf=a.D?a.oi:a.K}
l.Gd=function(a,b,c){b?this.ie++||(c&&(this.C=c),$c(this,cd,!1)):this.he++||(c&&(this.C=c),Zc(this,cd,!1))};function ec(a,b,c){a.ba=b;a.he=a.ie=0;c&&(c.C&&(a.C=c.C),(a.he=c.he)&&Zc(a,cd,!1),(a.ie=c.ie)&&$c(a,cd,!1))}l.Tk=function(a,b){this.ba&&t(this.ba,129)&&this.ba.message("attempt to read invalid block %"+q(b),!0);return 255};l.cf=function(a,b,c){this.ba&&t(this.ba,129)&&this.ba.message("attempt to write "+ka(b)+" to invalid block %"+q(c),!0)};
l.Uk=function(a,b){return this.Bc(a++,b++)|this.Bc(a,b)<<8};l.Rk=function(a,b){return this.Bc(a++,b++)|this.Bc(a++,b++)<<8|this.Bc(a++,b++)<<16|this.Bc(a,b)<<24};l.pi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a,b>>8,c)};l.oi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a++,b>>8&255,c++);this.Dc(a++,b>>16&255,c++);this.Dc(a,b>>>24,c)};l.vo=function(a){return this.X[a>>2]>>>((a&3)<<3)&255};
l.Ho=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b]>>a;return 24>a?c&65535:c&255|(this.X[b+1]&255)<<8};l.Bo=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b];a&&(c=c>>>a|this.X[b+1]<<32-a);return c};l.To=function(a,b){var c=a>>2;a=(a&3)<<3;this.X[c]=this.X[c]&~(255<<a)|b<<a;this.Oa=!0};l.fp=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.X[c]=this.X[c]&~(65535<<a)|b<<a:(this.X[c]=this.X[c]&16777215|b<<24,c++,this.X[c]=this.X[c]&-256|b>>8);this.Oa=!0};
l.Zo=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.X[c]=this.X[c]&~d|b<<a;c++;this.X[c]=this.X[c]&d|b>>>32-a}else this.X[c]=b;this.Oa=!0};l.uo=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a)||this.C&&ed(this.C,b,1,!1);return this.Zd(a,b)};l.Go=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,2)||this.C&&ed(this.C,b,2,!1);return this.Nf(a,b)};l.Ao=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,4)||this.C&&ed(this.C,b,4,!1);return this.ji(a,b)};
l.So=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a)||this.C&&ed(this.C,c,1,!0);this.D?this.cf(0,b,c):this.bf(a,b,c)};l.ep=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,2)||this.C&&ed(this.C,c,2,!0);this.D?this.cf(0,b,c):this.ri(a,b,c)};l.Yo=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,4)||this.C&&ed(this.C,c,4,!0);this.D?this.cf(0,b,c):this.K(a,b,c)};l.xo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Bc(a,b)};
l.Jo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Mf(a,b)};l.Do=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Nd(a,b)};l.Vo=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Dc(a,b,c)};l.hp=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Tf(a,b,c)};l.ap=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Sf(a,b,c)};
l.yo=function(a,b){return gd(this.C,b,!1).Bc(a,b)};l.Ko=function(a,b){return gd(this.C,b,!1).Mf(a,b)};l.Eo=function(a,b){return gd(this.C,b,!1).Nd(a,b)};l.Wo=function(a,b,c){gd(this.C,c,!0).Dc(a,b,c)};l.ip=function(a,b,c){gd(this.C,c,!0).Tf(a,b,c)};l.bp=function(a,b,c){gd(this.C,c,!0).Sf(a,b,c)};l.to=function(a){return this.Pa[a]};l.Qk=function(a){return this.Pa[a]};l.wo=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Bc=this.Qk;return this.Pa[a]};
l.Fo=function(a){return this.G.getUint16(a,!0)};l.Vk=function(a){return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.Io=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Mf=this.Vk;return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.zo=function(a){return this.G.getInt32(a,!0)};l.Sk=function(a){return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};
l.Co=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Nd=this.Sk;return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};l.Ro=function(a,b){this.Pa[a]=b;this.Oa=!0};l.el=function(a,b){this.Pa[a]=b;this.Oa=!0};l.Uo=function(a,b){this.Pa[a]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Dc=this.el;this.pd.Oa=!0};l.cp=function(a,b){this.G.setUint16(a,b,!0);this.Oa=!0};l.gl=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.Oa=!0};
l.gp=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Tf=this.gl;this.pd.Oa=!0};l.Xo=function(a,b){this.G.setInt32(a,b,!0);this.Oa=!0};l.fl=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.Oa=!0};
l.$o=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Sf=this.fl;this.pd.Oa=!0};function hd(a){Eb&&!wc&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var Tc=0,vc=2,Uc=5,Wc=6,id=["black","blue","green","cyan"],kc="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),Sc=0,Yc=[],zc=[x.prototype.vo,x.prototype.To,x.prototype.Ho,x.prototype.fp,x.prototype.Bo,x.prototype.Zo],cd=[x.prototype.uo,x.prototype.So,x.prototype.Go,x.prototype.ep,x.prototype.Ao,x.prototype.Yo],Xc=[x.prototype.xo,x.prototype.Vo,x.prototype.Jo,x.prototype.hp,x.prototype.Do,x.prototype.ap],Vc=[x.prototype.yo,x.prototype.Wo,x.prototype.Ko,x.prototype.ip,x.prototype.Eo,x.prototype.bp];
if(Eb)var yc=[x.prototype.to,x.prototype.Ro,x.prototype.Fo,x.prototype.cp,x.prototype.zo,x.prototype.Xo],xc=[x.prototype.Qk,x.prototype.el,x.prototype.Vk,x.prototype.gl,x.prototype.Sk,x.prototype.fl],nd=[x.prototype.wo,x.prototype.Uo,x.prototype.Io,x.prototype.gp,x.prototype.Co,x.prototype.$o];
l.Uk=function(a,b){return this.Bc(a++,b++)|this.Bc(a,b)<<8};l.Rk=function(a,b){return this.Bc(a++,b++)|this.Bc(a++,b++)<<8|this.Bc(a++,b++)<<16|this.Bc(a,b)<<24};l.pi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a,b>>8,c)};l.oi=function(a,b,c){this.Dc(a++,b&255,c++);this.Dc(a++,b>>8&255,c++);this.Dc(a++,b>>16&255,c++);this.Dc(a,b>>>24,c)};l.xo=function(a){return this.X[a>>2]>>>((a&3)<<3)&255};
l.Jo=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b]>>a;return 24>a?c&65535:c&255|(this.X[b+1]&255)<<8};l.Do=function(a){var b=a>>2;a=(a&3)<<3;var c=this.X[b];a&&(c=c>>>a|this.X[b+1]<<32-a);return c};l.Vo=function(a,b){var c=a>>2;a=(a&3)<<3;this.X[c]=this.X[c]&~(255<<a)|b<<a;this.Oa=!0};l.hp=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.X[c]=this.X[c]&~(65535<<a)|b<<a:(this.X[c]=this.X[c]&16777215|b<<24,c++,this.X[c]=this.X[c]&-256|b>>8);this.Oa=!0};
l.ap=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.X[c]=this.X[c]&~d|b<<a;c++;this.X[c]=this.X[c]&d|b>>>32-a}else this.X[c]=b;this.Oa=!0};l.wo=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a)||this.C&&ed(this.C,b,1,!1);return this.Zd(a,b)};l.Io=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,2)||this.C&&ed(this.C,b,2,!1);return this.Nf(a,b)};l.Co=function(a,b){this.ba&&null!=this.xa&&dd(this.ba,this.xa+a,4)||this.C&&ed(this.C,b,4,!1);return this.ji(a,b)};
l.Uo=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a)||this.C&&ed(this.C,c,1,!0);this.D?this.cf(0,b,c):this.bf(a,b,c)};l.gp=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,2)||this.C&&ed(this.C,c,2,!0);this.D?this.cf(0,b,c):this.ri(a,b,c)};l.$o=function(a,b,c){this.ba&&null!=this.xa&&fd(this.ba,this.xa+a,4)||this.C&&ed(this.C,c,4,!0);this.D?this.cf(0,b,c):this.K(a,b,c)};l.zo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Bc(a,b)};
l.Lo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Mf(a,b)};l.Fo=function(a,b){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.F;return this.pd.Nd(a,b)};l.Xo=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Dc(a,b,c)};l.jp=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Tf(a,b,c)};l.cp=function(a,b,c){this.lb.X[this.A]|=this.F;this.mb.X[this.B]|=this.J;this.pd.Sf(a,b,c)};
l.Ao=function(a,b){return gd(this.C,b,!1).Bc(a,b)};l.Mo=function(a,b){return gd(this.C,b,!1).Mf(a,b)};l.Go=function(a,b){return gd(this.C,b,!1).Nd(a,b)};l.Yo=function(a,b,c){gd(this.C,c,!0).Dc(a,b,c)};l.kp=function(a,b,c){gd(this.C,c,!0).Tf(a,b,c)};l.ep=function(a,b,c){gd(this.C,c,!0).Sf(a,b,c)};l.vo=function(a){return this.Pa[a]};l.Qk=function(a){return this.Pa[a]};l.yo=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Bc=this.Qk;return this.Pa[a]};
l.Ho=function(a){return this.G.getUint16(a,!0)};l.Vk=function(a){return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.Ko=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Mf=this.Vk;return a&1?this.Pa[a]|this.Pa[a+1]<<8:this.Rd[a>>1]};l.Bo=function(a){return this.G.getInt32(a,!0)};l.Sk=function(a){return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};
l.Eo=function(a){this.lb.X[this.A]|=32;this.mb.X[this.B]|=32;this.Nd=this.Sk;return a&3?this.Pa[a]|this.Pa[a+1]<<8|this.Pa[a+2]<<16|this.Pa[a+3]<<24:this.X[a>>2]};l.To=function(a,b){this.Pa[a]=b;this.Oa=!0};l.el=function(a,b){this.Pa[a]=b;this.Oa=!0};l.Wo=function(a,b){this.Pa[a]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Dc=this.el;this.pd.Oa=!0};l.fp=function(a,b){this.G.setUint16(a,b,!0);this.Oa=!0};l.gl=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.Oa=!0};
l.ip=function(a,b){a&1?(this.Pa[a]=b,this.Pa[a+1]=b>>8):this.Rd[a>>1]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Tf=this.gl;this.pd.Oa=!0};l.Zo=function(a,b){this.G.setInt32(a,b,!0);this.Oa=!0};l.fl=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.Oa=!0};
l.bp=function(a,b){a&3?(this.Pa[a]=b,this.Pa[a+1]=b>>8,this.Pa[a+2]=b>>16,this.Pa[a+3]=b>>24):this.X[a>>2]=b;this.lb.X[this.A]|=32;this.mb.X[this.B]|=96;this.Sf=this.fl;this.pd.Oa=!0};function hd(a){Eb&&!wc&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var Tc=0,vc=2,Uc=5,Wc=6,id=["black","blue","green","cyan"],kc="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),Sc=0,Yc=[],zc=[x.prototype.xo,x.prototype.Vo,x.prototype.Jo,x.prototype.hp,x.prototype.Do,x.prototype.ap],cd=[x.prototype.wo,x.prototype.Uo,x.prototype.Io,x.prototype.gp,x.prototype.Co,x.prototype.$o],Xc=[x.prototype.zo,x.prototype.Xo,x.prototype.Lo,x.prototype.jp,x.prototype.Fo,x.prototype.cp],Vc=[x.prototype.Ao,x.prototype.Yo,x.prototype.Mo,x.prototype.kp,x.prototype.Go,x.prototype.ep];
if(Eb)var yc=[x.prototype.vo,x.prototype.To,x.prototype.Ho,x.prototype.fp,x.prototype.Bo,x.prototype.Zo],xc=[x.prototype.Qk,x.prototype.el,x.prototype.Vk,x.prototype.gl,x.prototype.Sk,x.prototype.fl],nd=[x.prototype.yo,x.prototype.Wo,x.prototype.Ko,x.prototype.ip,x.prototype.Eo,x.prototype.bp];
function od(a,b){ab.call(this,"CPU",a,1);b=a.cycles||b;var c=a.multiplier||1;this.T={};this.T.sd=b;this.T.Kd=c;this.T.rg=Math.round(this.T.sd/1E4)/100;this.T.oe=this.T.rg*this.T.Kd;this.ea.vb=!1;this.ea.ni=!1;this.ea.lf=a.autoStart;this.ea.kj=!1;this.ea.He=!1;this.T.uf=this.T.Te=0;this.T.wf=a.csStart;this.T.Se=a.csInterval;this.T.Ue=a.csStop;this.Ql=this.Uf.bind(this);zb(this)}ba(od,ab);l=od.prototype;
l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.ba=d;for(b=0;b<pd.length;b++)(c=this.na[pd[b]])&&this.pa.Cb(null,pd[b],c);this.Tc=Ob(a,"FPU");this.W=Ob(a,"ChipSet");a=qd(a,"autoStart");null!=a&&(this.ea.lf="true"==a?!0:"false"==a?!1:!!a);zb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.Xb=function(a,b){if(!b){if(a&&this.restore){rd(this);if(!this.restore(a))return!1;sd(this)}else this.reset();this.ba?this.ba.ih():this.P("No debugger detected")}td(this);return!0};l.Wb=function(a){return a?this.save():!0};l.lf=function(){return this.ea.lf||!this.ba&&void 0===this.na.run?(this.Uf(),!0):!1};l.uj=function(){return 0};
function sd(a){void 0===a.T.wf&&(a.T.wf=0);void 0===a.T.Se&&(a.T.Se=-1);void 0===a.T.Ue&&(a.T.Ue=-1);a.ea.He=0<=a.T.wf&&0<a.T.Se;a.ea.He&&(a.T.uf=0,a.T.Te=a.T.wf-a.Dd)}function ud(a,b){if(a.ea.He){var c=!1;a.T.uf=a.T.uf+a.uj()|0;a.T.Te-=b;0>=a.T.Te&&(a.T.Te+=a.T.Se,c=!0);0<=a.T.Ue&&a.T.Ue<=vd(a)&&(a.T.Se=a.T.Ue=-1,sd(a),a.Jb(),c=!0);c&&a.P(vd(a)+" cycles: checksum="+q(a.T.uf))}}
l.Cb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.na[b]=c;a=!0;break;case "run":this.na[b]=c;c.onclick=function(){var a;if(a=d.pa)if(a=d.pa,a.ea.Yb)a=!0;else{var b=null,c,h=jb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.ea.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.ea.Yb);c++);c==h.length&&(b=a);Wa("The "+b.type+" component ("+b.id+") is not "+(b.ea.ready?"powered yet":"ready yet"+(b.pg?" (waiting for notification)":""))+".");a=!1}a&&(d.ea.vb?d.Jb(!0):
d.Uf(!0))};a=!0;break;case "speed":this.na[b]=c;a=!0;break;case "setSpeed":this.na[b]=c,c.onclick=function(){wd(d,d.T.Kd<<1,!0)},c.textContent=this.T.oe.toFixed(2)+"Mhz",a=!0}return a};function xd(a,b){a.ea.vb&&(b=a.A-b,a.A-=b,a.zc-=b)}function yd(a,b,c){a.Dd+=b;c&&(a.zc=a.A=0)}
function zd(a,b){var c=Ad;c<Bd&&(c=Bd);c<Cd&&(c=Cd);var d=1;b&&1<a.T.Kd&&a.T.Wd&&(d=a.T.Wd/a.T.rg);a.T.Dj=Math.round(1E3/Ad);a.T.kn=Math.floor(a.T.sd/c*d);a.T.sh=Math.floor(a.T.sd/Ad*d);a.T.Fj=Math.floor(a.T.sd/Bd*d);a.T.Ej=Math.floor(a.T.sd/Cd*d);b||(a.T.Ve=a.T.sh,a.T.yf=a.T.Fj,a.T.xf=a.T.Ej);a.T.th=0}function vd(a,b){var c=a.Dd+a.md+a.zc-a.A;b&&1<a.T.Kd&&a.T.Wd>a.T.rg&&(c=Math.round(c/a.T.Kd));return c}function rd(a){a.T.Wd=0;a.Dd=a.md=a.zc=a.A=0;sd(a);wd(a,1)}
function zd(a,b){var c=Ad;c<Bd&&(c=Bd);c<Cd&&(c=Cd);var d=1;b&&1<a.T.Kd&&a.T.Wd&&(d=a.T.Wd/a.T.rg);a.T.Dj=Math.round(1E3/Ad);a.T.nn=Math.floor(a.T.sd/c*d);a.T.sh=Math.floor(a.T.sd/Ad*d);a.T.Fj=Math.floor(a.T.sd/Bd*d);a.T.Ej=Math.floor(a.T.sd/Cd*d);b||(a.T.Ve=a.T.sh,a.T.yf=a.T.Fj,a.T.xf=a.T.Ej);a.T.th=0}function vd(a,b){var c=a.Dd+a.md+a.zc-a.A;b&&1<a.T.Kd&&a.T.Wd>a.T.rg&&(c=Math.round(c/a.T.Kd));return c}function rd(a){a.T.Wd=0;a.Dd=a.md=a.zc=a.A=0;sd(a);wd(a,1)}
function wd(a,b,c){var d=!1;if(void 0!==b){.8>a.T.Wd/a.T.oe?b=1:d=!0;a.T.Kd=b;b=a.T.rg*a.T.Kd;if(a.T.oe!=b){a.T.oe=b;b=a.T.oe.toFixed(2)+"Mhz";var e=a.na.setSpeed;e&&(e.textContent=b);a.P("target speed: "+b)}c&&a.pa&&a.pa.ld()}yd(a,a.md);a.md=0;a.T.Xd=Ba();a.T.pe=0;zd(a);return d}
l.Uf=function(a){if(Bb(this,!0)){if(!this.ea.vb){wd(this);this.pa&&this.pa.start(this.T.Xd,vd(this));this.ea.vb=!0;this.ea.ni=!0;this.W&&this.W.start();var b=this.na.run;b&&(b.textContent="Halt");this.pa&&(Dd(this.pa,!0),a&&this.pa.ld(!0))}this.T.th>=this.T.sd&&zd(this,!0);this.T.zf=0;this.T.sg=Ba();this.T.pe&&(a=this.T.sg-this.T.pe,a>this.T.Dj&&(this.T.Xd+=a,this.T.Xd>this.T.sg&&(this.T.Xd=this.T.sg)));try{do{var c=this.ea.He?1:this.T.kn;if(this.W){Ed(this.W);var d=this.W;a=c;var e=d.G[0];if(e.le){var f=
l.Uf=function(a){if(Bb(this,!0)){if(!this.ea.vb){wd(this);this.pa&&this.pa.start(this.T.Xd,vd(this));this.ea.vb=!0;this.ea.ni=!0;this.W&&this.W.start();var b=this.na.run;b&&(b.textContent="Halt");this.pa&&(Dd(this.pa,!0),a&&this.pa.ld(!0))}this.T.th>=this.T.sd&&zd(this,!0);this.T.zf=0;this.T.sg=Ba();this.T.pe&&(a=this.T.sg-this.T.pe,a>this.T.Dj&&(this.T.Xd+=a,this.T.Xd>this.T.sg&&(this.T.Xd=this.T.sg)));try{do{var c=this.ea.He?1:this.T.nn;if(this.W){Ed(this.W);var d=this.W;a=c;var e=d.G[0];if(e.le){var f=
(vd(d.H,d.O)-e.jd)/d.Ba|0,g=Fd(d,0)-f;e.mode==Gd&&(g-=f);var h=g*d.Ba|0;e.mode==Gd&&(h>>=1);a>h&&(a=h)}var c=a,k=this.W;a=c;if(k.A&&k.A[Hd]&Id){var m=k.Z-vd(k.H,k.O);0<m&&a>m&&(a=m)}c=a}try{this.Lg(c)}catch(w){if("number"!=typeof w)throw w;}var p=this.zc-this.A;this.md+=p;this.T.zf+=p;yd(this,0,!0);ud(this,p);this.T.yf-=p;0>=this.T.yf&&(this.T.yf+=this.T.Fj,this.pa&&Jd(this.pa));this.T.xf-=p;0>=this.T.xf&&(this.T.xf+=this.T.Ej,this.pa&&Dd(this.pa));this.T.Ve-=p;if(0>=this.T.Ve){this.T.Ve+=this.T.sh;
break}}while(this.ea.vb)}catch(w){this.Jb();td(this);this.pa&&this.pa.stop(Ba(),vd(this));Bb(this,!1);wb(this,w.stack||w.message);return}c=setTimeout;d=this.Ql;this.T.pe=Ba();e=this.T.Dj;this.T.zf&&(e=Math.round(e*this.T.zf/this.T.sh));e-=this.T.pe-this.T.sg;if(f=this.T.pe-this.T.Xd)this.T.Wd=Math.round(this.md/(10*f))/100,864E5<=f&&(this.Dd=0,this.W&&Ed(this.W,!0),wd(this));if(0>e||this.T.Wd<this.T.oe)-1E3>e&&(this.T.Xd-=e),e=0;this.T.th+=this.T.zf;this.T.pe+=e;c(d,e)}else td(this),this.pa&&this.pa.stop(Ba(),
vd(this))};l.Lg=function(){return 0};l.Jb=function(a){Ab(this,!0);this.zc-=this.A;this.A=0;yd(this,this.md);this.md=0;if(this.ea.vb){this.ea.vb=!1;this.W&&this.W.stop();var b=this.na.run;b&&(b.textContent="Run")}this.ea.complete=a};function td(a,b){a.pa&&(Jd(a.pa,b),Dd(a.pa,b))}var Ad=30,Bd=60,Cd=2,pd=["power","reset"];
function Kd(a,b,c,d){this.gc=a;this.ba=a.ba;this.id=b;this.$b=c||"";this.U=0;this.Ka=65535;this.Nb=this.Ka+1;this.Ab=this.qc=this.ext=this.jb=this.type=this.ua=0;this.Lb=-1;this.V=this.Jc=2;this.R=this.wa=65535;this.G=this.mh;this.D=this.dj;this.F=this.fj;this.A={U:-1,ua:0,Ka:0,jb:0,type:0,ext:0,Lb:-1};1==this.id&&(this.Jf=0,this.C=null,this.Pe=!1,this.H=Array(32),this.B=[]);Md(this,!0,d)}function Nd(a,b){a.B.push(b);return[a.B.length,Od]}l=Kd.prototype;
l.mh=function(a){this.U=a&65535;return this.ua=this.U<<4};l.qg=function(a,b){var c,d,e=this.gc;a&=65535;a&4?(c=e.Eb.ua,d=c+e.Eb.Ka|0):(c=e.Kb,d=e.Pc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,Pd(this,c,a,b);this.id<Qd&&y.call(e,b&&this.id==Rd?10:13,a&65532)}return-1};l.en=function(a){var b=this.gc;a=b.Pb+(a<<2);var c=b.ja(a);b.O&=-769;return this.load(b.ja(a+2))+c|0};
l.dn=function(a){var b=this.gc;a<<=3;var c=b.Pb+a|0;if(7<=(b.cd-c|0))return this.C=!0,a=Pd(this,c,a),-1!==a&&(a+=this.Jf),a;y.call(b,13,a|2);return-1};l.dj=function(a){return this.ua+a|0};l.fj=function(a){return this.ua+a|0};l.cj=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.kg()};l.zl=function(a,b){return(a>>>0)+b>this.Nb?this.ua+a|0:this.kg()};l.kg=function(){y.call(this.gc,13,0);return-1};l.ej=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.lg()};
l.mh=function(a){this.U=a&65535;return this.ua=this.U<<4};l.qg=function(a,b){var c,d,e=this.gc;a&=65535;a&4?(c=e.Eb.ua,d=c+e.Eb.Ka|0):(c=e.Kb,d=e.Pc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,Pd(this,c,a,b);this.id<Qd&&y.call(e,b&&this.id==Rd?10:13,a&65532)}return-1};l.gn=function(a){var b=this.gc;a=b.Pb+(a<<2);var c=b.ja(a);b.O&=-769;return this.load(b.ja(a+2))+c|0};
l.fn=function(a){var b=this.gc;a<<=3;var c=b.Pb+a|0;if(7<=(b.cd-c|0))return this.C=!0,a=Pd(this,c,a),-1!==a&&(a+=this.Jf),a;y.call(b,13,a|2);return-1};l.dj=function(a){return this.ua+a|0};l.fj=function(a){return this.ua+a|0};l.cj=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.kg()};l.zl=function(a,b){return(a>>>0)+b>this.Nb?this.ua+a|0:this.kg()};l.kg=function(){y.call(this.gc,13,0);return-1};l.ej=function(a,b){return(a>>>0)+b<=this.Nb?this.ua+a|0:this.lg()};
l.Al=function(a,b){return(a>>>0)+b>this.Nb?this.ua+a|0:this.lg()};l.lg=function(){y.call(this.gc,13,0);return-1};function Td(a,b,c,d,e){a.U=b;a.ua=d;a.Ka=e;a.Nb=(e>>>0)+1;a.jb=c;a.type=c&7936;a.ext=c>>16&192;a.Lb=(b&4?a.gc.Eb.ua:a.gc.Kb)+(b&65528)|0;a.id<Ud&&Md(a,!0)}function Vd(a,b,c){var d=a.gc,e=d.ja(b+2),f=d.ja(b)|(e&255)<<16,d=d.ja(b+4);a.U=c;a.ua=f;a.Ka=d;a.Nb=(d>>>0)+1;a.jb=e;a.type=e&7936;a.ext=0;a.Lb=b;a.id<Ud&&Md(a,!0)}
function Pd(a,b,c,d){var e=a.gc;if(!d&&c===a.A.U)return a.U=c,a.ua=a.A.ua,a.Ka=a.A.Ka,a.Nb=(a.A.Ka>>>0)+1,a.jb=a.A.jb,a.type=a.A.type,a.ext=a.A.ext,a.Lb=a.A.Lb,a.A.U=-1,Md(a,!0,!0,!1),a.ua;a.A.U=-1;var f=e.ja(b+0),g=e.ja(b+4),h=g&7936,k=e.ja(b+2)|(g&255)<<16,m=e.ja(b+6),p=c&65528;if(80386<=e.ca){var w=f,k=k|(m&65280)<<16,f=f|(m&15)<<16;m&128&&(f=f<<12|4095)}switch(a.id){case Wd:var u=a.C;a.Pe=!1;if(u&&c==Od&&a.B.length){var F=a.B[a.Jf-1];if(F&&!F())return-1}var K=c&3,H=(g&24576)>>13,F=-1,I,T;p||b>=
e.Kb&&b<e.Pc&&(h=0);if(6144<=h)null!=d?F=0:!1!==u?(h&1024?H<=a.Ab&&(F=0):K<=a.Ab&&H==a.Ab&&(F=0),F||(c=c&-4|a.Ab&3)):K>=a.Ab&&(K>a.Ab&&(F=Xd(e),Yd(e,Xd(e),!0),Zd(e,F),a.Pe=!0),F=0);else{if(256==h||2304==h)return $d(a,c,u)?a.ua:-1;if(1024==h)F=2,T=0,K<a.Ab&&(K=a.Ab);else if(3072==h)F=4,T=0,K<a.Ab&&(K=a.Ab);else if(1536==h)F=2,T=148224;else if(3584==h)F=4,T=148224;else if(1792==h)F=2,T=147712;else if(3840==h)F=4,T=147712;else if(1280==h)return $d(a,k&65535,u)?a.ua:-1}0<F&&!(g&32768)&&(F=0);if(0<F&&
@ -149,8 +149,8 @@ function $d(a,b,c){var d=a.gc,e=a.Ab,f=d.la.U,g=d.la.ua;if(!c){if(!(d.la.type&51
34,d.oa.U),d.fb(g+36,d.Z.U),d.fb(g+38,d.Y.U),d.fb(g+40,d.Ca.U),d.Eb.load(d.ja(h+42)),je(d,d.ja(h+16)|(c?16384:0)),d.D=d.ja(h+18),d.I=d.ja(h+20),d.L=d.ja(h+22),d.G=d.ja(h+24),d.M=d.ja(h+28),d.K=d.ja(h+30),d.J=d.ja(h+32),d.oa.load(d.ja(h+34)),d.Ca.load(d.ja(h+40)),ke(d,d.ja(h+14),d.ja(h+36)),b=38,g=26,a.Ab<e&&(g=(a.Ab<<2)+2,b=g+2),Yd(d,d.ja(h+b),!0),Zd(d,d.ja(h+g))):(d.ab(g+28,d.Wc),d.ab(g+32,A(d)),d.ab(g+36,ie(d)),d.ab(g+40,d.D),d.ab(g+44,d.I),d.ab(g+48,d.L),d.ab(g+52,d.G),d.ab(g+56,z(d)),d.ab(g+60,
d.M),d.ab(g+64,d.K),d.ab(g+68,d.J),d.ab(g+72,d.oa.U),d.ab(g+76,d.Z.U),d.ab(g+80,d.Y.U),d.ab(g+84,d.Ca.U),d.ab(g+88,d.Ga.U),d.ab(g+92,d.Ha.U),le.call(d,d.ia(h+28)),d.Eb.load(d.ja(h+96)),je(d,d.ia(h+36)|(c?16384:0)),d.D=d.ia(h+40),d.I=d.ia(h+44),d.L=d.ia(h+48),d.G=d.ia(h+52),d.M=d.ia(h+60),d.K=d.ia(h+64),d.J=d.ia(h+68),d.oa.load(d.ja(h+72)),d.Ca.load(d.ja(h+84)),d.Ga.load(d.ja(h+88)),d.Ha.load(d.ja(h+92)),ke(d,d.ia(h+32),d.ja(h+76)),b=80,g=56,a.Ab<e&&(g=(a.Ab<<3)+4,b=g+4),Yd(d,d.ja(h+b),!0),Zd(d,d.ia(h+
g)));c&&d.fb(h+0,f);d.qa|=8;return!0}l.save=function(){return[this.U,this.ua,this.Ka,this.jb,this.id,this.$b,this.Ab,this.qc,this.Lb,this.Jc,this.wa,this.V,this.R,this.type,this.Nb]};l.restore=function(a){"number"==typeof a?this.load(a):(this.U=a[0],this.ua=a[1],this.Ka=a[2],this.jb=a[3],this.id=a[4],this.$b=a[5],this.Ab=a[6],this.qc=a[7],this.Lb=a[8],this.Jc=a[9]||2,this.wa=a[10]||65535,this.V=a[11]||2,this.R=a[12]||65535,this.type=a[13]||this.jb&7936,this.Nb=a[14]||(this.Ka>>>0)+1)};
function Md(a,b,c,d){void 0===c&&(c=!!(a.gc.qa&1));a.Oc=!1;if(c)if(a.load=a.qg,a.Cj=a.dn,a.bc=a.cj,a.cc=a.ej,void 0===d&&(d=!!(a.gc.O&131072)),d)a.load=a.G,a.bc=a.D,a.cc=a.F,a.Ab=a.qc=3,a.V=2,a.R=a.wa=65535,a.Ka=65535,a.Nb=a.Ka+1,a.Jc=a.V,a.Lb=-1,a.Pe=!1;else{if(!(a.U&-4))a.bc=a.kg,a.cc=a.lg;else if(a.type&4096){6144==(a.type&6656)&&(a.bc=a.kg);if(a.type&2048||!(a.type&512))a.cc=a.lg;1024==(a.type&3072)&&(a.bc==a.cj&&(a.bc=a.zl),a.cc==a.ej&&(a.cc=a.Al),a.Oc=!0);b&&a.id<Qd&&a.U&-4&&-1!==a.Lb&&(c=a.Lb+
5,d=a.gc.Ia(c),d&1||a.gc.fc(c,d|1))}b&&(a.Ab=a.U&3,a.qc=(a.jb&24576)>>13,80386>a.gc.ca||!(a.ext&64)?(a.V=2,a.R=65535):(a.V=4,a.R=-1),a.Jc=a.V,a.wa=a.R)}else a.load=a.mh,a.Cj=a.en,a.bc=a.dj,a.cc=a.fj,a.Ab=a.qc=0,a.Lb=-1,a.Pe=!1}var Wd=1,he=2,Rd=3,Ud=4,Qd=6,Od=1;
function Md(a,b,c,d){void 0===c&&(c=!!(a.gc.qa&1));a.Oc=!1;if(c)if(a.load=a.qg,a.Cj=a.fn,a.bc=a.cj,a.cc=a.ej,void 0===d&&(d=!!(a.gc.O&131072)),d)a.load=a.G,a.bc=a.D,a.cc=a.F,a.Ab=a.qc=3,a.V=2,a.R=a.wa=65535,a.Ka=65535,a.Nb=a.Ka+1,a.Jc=a.V,a.Lb=-1,a.Pe=!1;else{if(!(a.U&-4))a.bc=a.kg,a.cc=a.lg;else if(a.type&4096){6144==(a.type&6656)&&(a.bc=a.kg);if(a.type&2048||!(a.type&512))a.cc=a.lg;1024==(a.type&3072)&&(a.bc==a.cj&&(a.bc=a.zl),a.cc==a.ej&&(a.cc=a.Al),a.Oc=!0);b&&a.id<Qd&&a.U&-4&&-1!==a.Lb&&(c=a.Lb+
5,d=a.gc.Ia(c),d&1||a.gc.fc(c,d|1))}b&&(a.Ab=a.U&3,a.qc=(a.jb&24576)>>13,80386>a.gc.ca||!(a.ext&64)?(a.V=2,a.R=65535):(a.V=4,a.R=-1),a.Jc=a.V,a.wa=a.R)}else a.load=a.mh,a.Cj=a.gn,a.bc=a.dj,a.cc=a.fj,a.Ab=a.qc=0,a.Lb=-1,a.Pe=!1}var Wd=1,he=2,Rd=3,Ud=4,Qd=6,Od=1;
function me(a){var b=+a.model||8088,c;switch(b){default:c=4772727;break;case 80286:c=6E6;break;case 80386:c=16E6}od.call(this,a,c);this.ca=b;a=a.stepping;this.we=b+(a?ga(a,16):0);this.Ri=61442;this.Qd=1792;this.si=28672;this.Vf=4;this.Ta=255;this.B=80286<=this.ca?Gb:Fb;this.va=ne;this.bj=oe;this.ij=pe;this.nj=qe;if(80186<=this.ca&&(this.va=ne.slice(),this.bj=oe.slice(),this.ij=pe.slice(),this.Ta=31,this.va[15]=re,this.va[96]=se,this.va[97]=te,this.va[98]=ue,this.va[99]=re,this.va[100]=re,this.va[101]=
re,this.va[102]=re,this.va[103]=re,this.va[104]=ze,this.va[105]=Ae,this.va[106]=Be,this.va[107]=Ce,this.va[108]=De,this.va[109]=Ee,this.va[110]=Fe,this.va[111]=Ge,this.va[192]=He,this.va[193]=Ie,this.va[200]=Je,this.va[201]=Ke,this.va[241]=Le,this.bj[7]=Me,this.ij[7]=Me,80286<=this.ca)){this.Ri=2;this.Qd|=28672;this.Vf=0;this.va[15]=Ne;this.Pd=Oe.slice();for(b=0;b<this.Pd.length;b++)this.Pd[b]||(this.Pd[b]=Pe);this.va[84]=Qe;this.va[99]=Re;if(80386<=this.ca){var d;this.si=0;this.Qd|=196608;this.va[100]=
Se;this.va[101]=Te;this.va[102]=Ue;this.va[103]=Ve;for(d in B)this.Pd[+d]=B[+d];80546<=this.we&&80562>=this.we&&(this.Pd[166]=We,this.Pd[167]=Xe)}}this.Yf=[];this.Zf=[];this.ag=0;rd(this);this.ea.complete=this.ea.jj=!1;this.tj=0;this.sc=this.aa=[];this.qb=this.Ng=this.Db=this.Wf=this.df=this.ef=this.ed=0;Ye(this)}ba(me,od);function Ze(a,b,c,d){b=(d?a.sc:a.aa)[b>>>a.qb];c?--b.ie||bd(b):--b.he||ad(b);d&&jc(a)}
@ -158,8 +158,8 @@ function $e(a){var b;if(a.aa===a.sc){a.aa=Array(a.Wf);a.$f=new x(null,0,0,Uc,nul
function gd(a,b,c,d){var e=(b&-4194304)>>>20,f=a.sc[(a.Wc+e&a.ef)>>>a.qb],g=f.Nd(e);if(!(g&1))return d||ef.call(a,b,!1,c),a.ff;if(!(g&4)&&3==a.Ma)return d||ef.call(a,b,!0,c),a.ff;var h=(b&4190208)>>>10,g=a.sc[((g&-4096)+h&a.ef)>>>a.qb],k=g.Nd(h);if(!(k&1))return d||ef.call(a,b,!1,c),a.ff;if(!(k&4)&&3==a.Ma)return d||ef.call(a,b,!0,c),a.ff;c=a.sc[((k&-4096)+(b&4095)&a.ef)>>>a.qb];if(d)return c;d=b>>>a.qb;k=a.aa[d];b&=-4096;var m;0<a.bg?(m=a.Zi[--a.bg],m.ih(b)):m=new x(b,0,0,Wc);b=m;b.pd=c;b.lb=f;b.A=
e>>2;b.mb=g;b.B=h>>2;Eb&&wc&&c.X&&!c.controller&&!c.he&&!c.ie?(b.Pa=c.Pa,b.Rd=c.Rd,b.X=c.X,pc(b,nd)):(b.F=c?hd(32):0,b.J=c?hd(96):0,pc(b,Xc));ec(b,a.ba,k);a.aa[d]=b;a.Xf.push(d);return b}function ff(a){a.aa!==a.sc&&(a.aa=a.sc,a.$f=null,a.Xf=null,a.ff=null)}l=me.prototype;l.reset=function(){this.ea.vb&&this.Jb();Ye(this);rd(this);this.ea.error=!1};
function gf(a,b){var c;switch(b){case 0:c=a.D;break;case 1:c=a.I;break;case 2:c=a.L;break;case 3:c=a.G;break;case 4:c=z(a);break;case 5:c=a.M;break;case 6:c=a.K;break;case 7:c=a.J}return c}function hf(a,b,c){switch(b){case 0:a.D=c;break;case 1:a.I=c;break;case 2:a.L=c;break;case 3:a.G=c;break;case 4:Zd(a,c);break;case 5:a.M=c;break;case 6:a.K=c;break;case 7:a.J=c}}
function Ye(a){a.D=0;a.G=0;a.I=0;a.L=0;a.Hc=0;a.M=0;a.K=0;a.J=0;a.vc=!1;a.Ba=a.$a=0;a.ya=0;a.sj=0;a.ga=0;a.qa=65520;a.Pb=0;a.cd=1023;a.O=a.lc=0;a.ze=a.hf=a.ye=a.Ae=0;a.Uc=-1;a.Ad=a.Vc=-1;a.Bd=a.ta=-1;a.Z=new Kd(a,Wd,"CS");a.Ca=new Kd(a,he,"DS");a.oa=new Kd(a,he,"ES");a.Y=new Kd(a,Rd,"SS");Zd(a,0);Yd(a,0);if(80386<=a.ca){switch(a.we){case 80562:case 80563:a.L=771;break;case 80578:a.L=772;break;case 80594:a.L=773;break;case 80595:case 80596:a.L=776}a.qa=16;a.Og=0;a.Cd=0;a.Wc=0;a.Qb=[0,0,0,0,null,null,
0,0];a.dg=[null,null,null,null,null,null,0,0];a.Ga=new Kd(a,he,"FS");a.Ha=new Kd(a,he,"GS");ff(a)}a.Qg=new Kd(a,0,"NULL");a.Da=a.Ca;a.Rb=a.Y;a.N=a.ha=0;a.C=a.F=-1;a.eb=a.Qg;a.Za=0;if(80286>a.ca)ke(a,0,65535);else{a.Kb=0;a.Pc=65535;a.Eb=new Kd(a,5,"LDT",!0);a.la=new Kd(a,Ud,"TSS",!0);a.xb=new Kd(a,Qd,"VER",!0);ke(a,65520,61440);var b,c=A(a);b=a.Z;var d=-65536;80386>b.gc.ca&&(d&=16777215);b=b.ua=d;a.da=b+c|0;a.Pg=(b>>>0)+(a.Z.Ka>>>0)+1}je(a,0);ae(a)}
function Ye(a){a.D=0;a.G=0;a.I=0;a.L=0;a.Hc=0;a.M=0;a.K=0;a.J=0;a.vc=!1;a.Ba=a.$a=0;a.bn=[0,0];a.cn=[0,0];a.ya=0;a.sj=0;a.ga=0;a.qa=65520;a.Pb=0;a.cd=1023;a.O=a.lc=0;a.ze=a.hf=a.ye=a.Ae=0;a.Uc=-1;a.Ad=a.Vc=-1;a.Bd=a.ta=-1;a.Z=new Kd(a,Wd,"CS");a.Ca=new Kd(a,he,"DS");a.oa=new Kd(a,he,"ES");a.Y=new Kd(a,Rd,"SS");Zd(a,0);Yd(a,0);if(80386<=a.ca){switch(a.we){case 80562:case 80563:a.L=771;break;case 80578:a.L=772;break;case 80594:a.L=773;break;case 80595:case 80596:a.L=776}a.qa=16;a.Og=0;a.Cd=0;a.Wc=0;
a.Qb=[0,0,0,0,null,null,0,0];a.dg=[null,null,null,null,null,null,0,0];a.Ga=new Kd(a,he,"FS");a.Ha=new Kd(a,he,"GS");ff(a)}a.Qg=new Kd(a,0,"NULL");a.Da=a.Ca;a.Rb=a.Y;a.N=a.ha=0;a.C=a.F=-1;a.eb=a.Qg;a.Za=0;if(80286>a.ca)ke(a,0,65535);else{a.Kb=0;a.Pc=65535;a.Eb=new Kd(a,5,"LDT",!0);a.la=new Kd(a,Ud,"TSS",!0);a.xb=new Kd(a,Qd,"VER",!0);ke(a,65520,61440);var b,c=A(a);b=a.Z;var d=-65536;80386>b.gc.ca&&(d&=16777215);b=b.ua=d;a.da=b+c|0;a.Pg=(b>>>0)+(a.Z.Ka>>>0)+1}je(a,0);ae(a)}
function jf(a){2==a.Jc?(a.Sb=a.ja,a.kc=kf,a.tc=lf,a.kd=rf,2==a.V?(a.ma=sf,a.za=tf,a.rb=uf):(a.ma=vf,a.za=wf,a.rb=xf)):(a.Sb=a.ia,a.kc=yf,a.tc=zf,a.kd=Af,2==a.V?(a.ma=Bf,a.za=Cf,a.rb=Df):(a.ma=Ef,a.za=Ff,a.rb=Gf))}function be(a,b){a.V!=b&&(a.ha|=1024,a.V=b,a.R=2==b?65535:-1,Hf(a))}function Hf(a){2==a.V?(a.Fb=32768,a.hb=a.ja,a.yb=a.fb,2==a.Jc?(a.ma=sf,a.za=tf,a.rb=uf):(a.ma=Bf,a.za=Cf,a.rb=Df)):(a.Fb=-2147483648,a.hb=a.ia,a.yb=a.ab,2==a.Jc?(a.ma=vf,a.za=wf,a.rb=xf):(a.ma=Ef,a.za=Ff,a.rb=Gf))}
function If(a){a.Jc=a.Z.Jc;a.wa=a.Z.wa;jf(a);a.V=a.Z.V;a.R=a.Z.R;Hf(a);a.ha&=-3073}l.uj=function(){var a=this.D+this.G+this.I+this.L+z(this)+this.M+this.K+this.J|0;return a=a+A(this)+this.Z.U+this.Ca.U+this.Y.U+this.oa.U+ie(this)|0};function Jf(a,b,c){void 0===a.Yf[b]&&(a.Yf[b]=[]);a.Yf[b].push(c)}function Kf(a,b,c){c&&(null==a.Zf[b]&&a.ag++,a.Zf[b]=c)}function Lf(a,b){var c=a.Zf[b];null!=c&&(c(--a.ag),delete a.Zf[b])}
function Mf(a,b){for(var c=a.Qb[7],d=c>>16,e=0;4>e;e++){if(c&3){var f=!!(d&1),g=a.Qb[e],g=g&~(d>>2&3);b?a.aa[g>>>a.qb].Gd(g&a.Db,f,a):(g=a.aa[g>>>a.qb],f?--g.ie||bd(g):--g.he||ad(g))}c>>=2;d>>=4}}function ed(a,b,c,d){if(!(a.N&8192)&&a.Qb[7]&255){c--;var e=a.Qb[7],f=e>>16;d=d?1:0==d?3:0;for(var g=0;4>g;g++){if(e&3&&(f&3)==d){var h=f>>2;if(b+c>=a.Qb[g]&&b<=a.Qb[g]+h){a.Qb[6]|=1<<g;a.Za|=2;break}}e>>=2;f>>=4}}}
@ -237,7 +237,7 @@ function Fj(a,b){var c=a-b|0;Uf(this,a,b,c,this.Fb|63,!0);this.A-=-1===this.F?-1
function Jj(a,b){return b>>(this.D&this.R)&(1<<(this.I&31))-1&this.R}function Kj(a,b){if(-1===this.C){switch(this.ga&7){case 0:this.D=this.D&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.L=this.L&-256|a;break;case 3:this.G=this.G&-256|a;break;case 4:this.D=this.D&-65281|a<<8;break;case 5:this.I=this.I&-65281|a<<8;break;case 6:this.L=this.L&-65281|a<<8;break;case 7:this.G=this.G&-65281|a<<8}this.A-=this.B.di}else this.F=this.C,vg(this,a),this.A-=this.B.ci;return b}
function Lj(a,b){if(-1===this.C){switch(this.ga&7){case 0:this.D=this.D&~this.R|a;break;case 1:this.I=this.I&~this.R|a;break;case 2:this.L=this.L&~this.R|a;break;case 3:this.G=this.G&~this.R|a;break;case 4:Zd(this,z(this)&~this.R|a);break;case 5:this.M=this.G&~this.R|a;break;case 6:this.K=this.K&~this.R|a;break;case 7:this.J=this.J&~this.R|a}this.A-=this.B.di}else this.F=this.C,this.N&2||this.yb(this.eb.cc(this.wb,this.V),a),this.A-=this.B.ci;return b}
function Mj(a,b){a^=b;ag(this,a,128);this.A-=-1===this.F?-1===this.C?this.B.mc:this.B.Ib:this.B.Ac;return a}function Nj(a,b){this.A-=-1===this.F?-1===this.C?this.B.mc:this.B.Ib:this.B.Ac;return ag(this,a^b,this.Fb)&this.R}function Oj(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function Pj(a){var b=a-1|0;Uf(this,a,1,b,this.Fb|62,!0);this.A-=2;return a&~this.R|b&this.R}
function Qj(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1;c=[c>>>0,0];for(a=[a>>>0,b>>>0];0<Oj(a,c);){var f=b=c;b[0]+=f[0];b[1]+=f[1];4294967295<b[0]&&(b[0]>>>=0,b[1]++);e+=e}do 0<=Oj(a,c)&&(b=a,f=c,b[0]-=f[0],b[1]-=f[1],0>b[0]&&(b[0]>>>=0,b[1]--),d+=e),b=c,b[0]>>>=1,b[1]&1&&(b[0]=(b[0]|2147483648)>>>0),b[1]>>>=1,e/=2;while(1<=e);this.Ba=d;this.$a=a[0];return!0}function Rj(a){var b=a+1|0;Uf(this,a,1,b,this.Fb|62);this.A-=2;return a&~this.R|b&this.R}
function Qj(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1,f=this.bn;f[0]=c>>>0;f[1]=0;c=this.cn;c[0]=a>>>0;for(c[1]=b>>>0;0<Oj(c,f);)b=a=f,a[0]+=b[0],a[1]+=b[1],4294967295<a[0]&&(a[0]>>>=0,a[1]++),e+=e;do 0<=Oj(c,f)&&(a=c,b=f,a[0]-=b[0],a[1]-=b[1],0>a[0]&&(a[0]>>>=0,a[1]--),d+=e),a=f,a[0]>>>=1,a[1]&1&&(a[0]=(a[0]|2147483648)>>>0),a[1]>>>=1,e/=2;while(1<=e);this.Ba=d;this.$a=c[0];return!0}function Rj(a){var b=a+1|0;Uf(this,a,1,b,this.Fb|62);this.A-=2;return a&~this.R|b&this.R}
function Sj(a){this.qa=a;ae(this);this.qa&-2147483648?$e(this):ff(this)}function le(a){this.Wc=a;jc(this)}function Tj(a){this.N|=1;this.tc.call(this,a);this.A-=-1===this.C?4:5}function tj(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a<<c-1;a=(d<<1|b>>>16-c)&65535;ag(this,a,32768,d&32768)}return a}function vj(a,b,c){if(c){var d=a<<c-1;a=d<<1|b>>>32-c;ag(this,a,-2147483648,d&-2147483648)}return a}
function zj(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a>>>c-1;a=(d>>>1|b<<16-c)&65535;ag(this,a,32768,d&1)}return a}function Bj(a,b,c){if(c){var d=a>>>c-1;a=d>>>1|b<<32-c;ag(this,a,-2147483648,d&1)}return a}function Uj(){this.A-=-1===this.C?2:this.B.Fk;return 1}function Vj(){var a=this.I&255;this.A-=(-1===this.C?this.B.Vh:this.B.Uh)+(a<<this.B.Wh);return a}function Wj(){var a=this.ra();this.A-=(-1===this.C?this.B.Vh:this.B.Uh)+(a<<this.B.Wh);return a}function Xj(){return null}
function Yj(){return this.ya}function Zj(a,b){this.Ad=this.Z.U;this.Vc=this.Y.U;this.ta=this.Aa;var c=A(this),d=this.V;null!=ke(this,a,b,!0)&&(de(this,this.Ad,d,2),de(this,c,d,d));this.Ad=this.Vc=this.ta=-1}function ak(a,b,c){this.A-=this.B.ck+(c||0);c=ie(this);var d=this.Z.U,e=A(this);a=this.Z.Cj(a);-1!==a&&(ge(this,c),ge(this,d),ge(this,e),null!=b&&ge(this,b),this.Uc=-1,Rf(this,a))}
@ -426,12 +426,12 @@ l.reset=function(a){var b;wl(this);this.F=Array(this.za);for(b=0;b<this.za;b++)x
Pl|Ql;this.Y=Array(8);this.W=0;a&&(this.A=Array(tl));Rl(this,this.Ma);for(a=Sl;a<=Tl;a++)this.A[a]=0;for(a=Ul;a<Vl;a++)void 0===this.A[a]&&(this.A[a]=0);a=0|+Kl(this,Zk,void 0)<<Wl.Mg&Wl.yc;a|=+Kl(this,el,void 0)?Xl:0;b=+Kl(this,Yk,void 0);a|=b?b-1<<Yl.Mg&Yl.yc|Yl.ol:0;this.A[Zl]=a;this.A[$l]=am(this,0)<<4|am(this,1);bm(this)}};
function Rl(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.P("CMOS date invalid ("+b+"), using "+c)):b&&a.P("CMOS date: "+c);a.A[cm]=c.getSeconds();a.A[dm]=0;a.A[em]=c.getMinutes();a.A[fm]=0;a.A[gm]=c.getHours();a.A[hm]=0;a.A[im]=c.getDay()+1;a.A[Am]=c.getDate();a.A[Bm]=c.getMonth()+1;b=c.getFullYear();a.A[Cm]=b%100;b/=100;a.A[Dm]=b%10|b/10<<4;a.A[Em]=38;a.A[Hd]=Fm;a.A[Gm]=0;a.A[ul]=Hm;a.ma=a.Z=0;a.Ha=a.Aa=null}
function vl(a,b){var c=a.A[b];if(b<Em){var d=!1;b!=gm&&b!=hm||a.A[Hd]&Fm||(12>c?c=c?c:12:c=(c-=12)?c+128:140,d=!0);a.A[Hd]&Im||(d&&128<c&&(c-=48),c=c%10|c/10<<4)}else b==Em&&(a.A[b]^=Jm);return c}function Km(a){var b;void 0===b&&(b=a.Aa);a.Z=vd(a.H,a.O)+b;a.A[Hd]&Id&&xd(a.H,b)}function bm(a){for(var b=0,c=$l;c<Vl;c++)b+=a.A[c];a.A[Lm]=b&255;a.A[Vl]=b>>8}
l.save=function(){var a=new Of(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.F;c++){for(var d=this.F[c],e=d,f=[],g=0;g<e.oc.length;g++){var h=e.oc[g];f[g]=[h.ne,h.fg,h.pc,h.sb,h.nb,h.mode,h.hg,h.Mo,h.No]}b[c]=[d.Mb,d.Xg,d.Xi,d.zb,f,d.Yi]}a.set(1,[b]);b=[];for(c=0;c<this.hc.length;c++)d=this.hc[c],b[c]=[d.We,d.Kc,d.Ld,d.od,d.ac,d.Ec,d.ge,d.nf];a.set(2,[b]);b=[];for(c=0;c<this.G.length;c++)d=this.G[c],b[c]=[d.pc,d.Mc,d.nb,d.je,d.Zg,d.mode,d.Qf,d.rd,d.ad,d.gd,d.Me,d.le,d.jd,d.Mb,d.Qe];a.set(3,[this.ta,
l.save=function(){var a=new Of(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.F;c++){for(var d=this.F[c],e=d,f=[],g=0;g<e.oc.length;g++){var h=e.oc[g];f[g]=[h.ne,h.fg,h.pc,h.sb,h.nb,h.mode,h.hg,h.Oo,h.Po]}b[c]=[d.Mb,d.Xg,d.Xi,d.zb,f,d.Yi]}a.set(1,[b]);b=[];for(c=0;c<this.hc.length;c++)d=this.hc[c],b[c]=[d.We,d.Kc,d.Ld,d.od,d.ac,d.Ec,d.ge,d.nf];a.set(2,[b]);b=[];for(c=0;c<this.G.length;c++)d=this.G[c],b[c]=[d.pc,d.Mc,d.nb,d.je,d.Zg,d.mode,d.Qf,d.rd,d.ad,d.gd,d.Me,d.le,d.jd,d.Mb,d.Qe];a.set(3,[this.ta,
b,this.va]);a.set(4,[this.ya,this.J,this.Ca,this.ga,this.da]);this.ca>=Kg&&(a.set(5,[this.D,this.L,this.K,this.oa,this.M,this.qa]),a.set(6,[this.Y[7],this.Y,this.W,this.A,this.ma,this.Z]));return a.data()};
l.restore=function(a){var b,c;b=a[0];Array.isArray(b[0])?this.C=b[0]:(this.C[0][0]=b[0],this.C[1][0]=b[1]&15,this.C[0][1]=b[2],this.C[1][1]=b[3]&15);wl(this);b=a[1];for(c=0;c<this.za;c++)xl(this,c,1==b.length?b[0][c]:b);b=a[2];for(c=0;c<this.ha;c++)yl(this,c,c?Cl:Al,b[0][c]);b=a[3];this.ta=b[0];this.va=b[2];for(c=0;c<this.G.length;c++)Dl(this,c,b[1][c]);b=a[4];this.ya=b[0];this.J=b[1];this.Ca=b[2];this.ga=b[3];this.da=b[4];if(b=a[5])this.D=b[0],this.L=b[1],this.K=b[2],this.oa=b[3],this.M=b[4],this.qa=
b[5];if(b=a[6])this.Y=b[1],this.Y[7]=b[0],this.W=b[2],this.A=b[3],this.ma=b[4],this.Z=b[5],Rl(this);return!0};l.start=function(){Mm(this)};l.stop=function(){Mm(this)};function xl(a,b,c){var d=a.F[b];d||(d={oc:Array(4)});c=c&&5<=c.length?c:Nm;d.Mb=c[0];d.Xg=c[1];d.Xi=c[2];d.zb=c[3];d.gn=b<<2;for(var e=0;e<d.oc.length;e++)Om(d,e,c[4][e]);d.Yi=c[5]||0;a.F[b]=d}
function Om(a,b,c){var d=a.oc[b];d||(d={fg:[0,0],pc:[0,0],sb:[0,0],nb:[0,0]});c=c&&8==c.length?c:Pm;d.ne=c[0];d.fg[0]=c[1][0];d.fg[1]=c[1][1];d.pc[0]=c[2][0];d.pc[1]=c[2][1];d.sb[0]=c[3][0];d.sb[1]=c[3][1];d.nb[0]=c[4][0];d.nb[1]=c[4][1];d.mode=c[5];d.hg=c[6];d.controller=a;d.yj=b;Qm(d,c[8],c[9]);a.oc[b]=d}function Qm(a,b,c,d){"string"==typeof b&&(b=kb(b));b&&(a.done=null,a.Mo=b.id,a.No=c,a.mg=b,a.eh=b[c],a.Ag=d)}
function yl(a,b,c,d){var e=a.hc[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Rm;e.port=c;e.$p=b<<3;e.We=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.Ld=d[2];e.od=d[3];e.ac=d[4];e.Ec=d[5];e.ge=d[6];e.nf=d[7];a.hc[b]=e}
b[5];if(b=a[6])this.Y=b[1],this.Y[7]=b[0],this.W=b[2],this.A=b[3],this.ma=b[4],this.Z=b[5],Rl(this);return!0};l.start=function(){Mm(this)};l.stop=function(){Mm(this)};function xl(a,b,c){var d=a.F[b];d||(d={oc:Array(4)});c=c&&5<=c.length?c:Nm;d.Mb=c[0];d.Xg=c[1];d.Xi=c[2];d.zb=c[3];d.jn=b<<2;for(var e=0;e<d.oc.length;e++)Om(d,e,c[4][e]);d.Yi=c[5]||0;a.F[b]=d}
function Om(a,b,c){var d=a.oc[b];d||(d={fg:[0,0],pc:[0,0],sb:[0,0],nb:[0,0]});c=c&&8==c.length?c:Pm;d.ne=c[0];d.fg[0]=c[1][0];d.fg[1]=c[1][1];d.pc[0]=c[2][0];d.pc[1]=c[2][1];d.sb[0]=c[3][0];d.sb[1]=c[3][1];d.nb[0]=c[4][0];d.nb[1]=c[4][1];d.mode=c[5];d.hg=c[6];d.controller=a;d.yj=b;Qm(d,c[8],c[9]);a.oc[b]=d}function Qm(a,b,c,d){"string"==typeof b&&(b=kb(b));b&&(a.done=null,a.Oo=b.id,a.Po=c,a.mg=b,a.eh=b[c],a.Ag=d)}
function yl(a,b,c,d){var e=a.hc[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Rm;e.port=c;e.bq=b<<3;e.We=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.Ld=d[2];e.od=d[3];e.ac=d[4];e.Ec=d[5];e.ge=d[6];e.nf=d[7];a.hc[b]=e}
function Dl(a,b,c){var d=a.G[b];d||(d={pc:[0,0],Mc:[0,0],nb:[0,0],je:[0,0]});c=c&&13<=c.length?c:Sm;d.pc[0]=c[0][0];d.pc[1]=c[0][1];d.Mc[0]=c[1][0];d.Mc[1]=c[1][1];d.nb[0]=c[2][0];d.nb[1]=c[2][1];d.je[0]=c[3][0];d.je[1]=c[3][1];d.Zg=c[4];d.mode=c[5];d.Qf=c[6];d.rd=c[7];d.ad=c[8];d.gd=c[9];d.Me=c[10];d.le=c[11];d.jd=c[12];d.Mb=c[13]||0;d.Qe=c[14]||!1;a.G[b]=d}
function al(a,b,c){for(var d="",e=a.na[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||(g+=" pcjs-bitCellLeft");d+='<div id="'+(c+"-"+f)+'" class="'+g+'" data-value="0">'+f+"</div>\n"}e.innerHTML=d;Tm(a,b,c,!0)}function Um(a,b,c){if(b=(a=Vm[a.ca|0])&&a[b])for(var d in b)if(a=b[d],a.yc&1<<c)return a;return null}
function Kl(a,b,c){for(var d=null,e=Vm[a.ca]||Vm[a.ca|0]||Vm[bl],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.C[f][c?0:1]&g.yc;for(var h in g.Zc)if(g.Zc[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function am(a,b){if(b<+Kl(a,Yk,void 0)){if(!a.N)return Wm;if(b<a.N.length)switch(a.N[b]){case 160:case 180:case 320:case 360:return Wm;case 720:return Xm;case 1200:return Ym;case 1440:return Zm}}return $m}function Il(a,b){return+Kl(a,an,b)+ +Kl(a,bn,b)}
@ -440,7 +440,7 @@ function Tm(a,b,c,d){if(c=a.na[c]){d=d?a.C[b][0]:a.C[b][1]=a.C[b][0];c=pb(c,"pcj
function dn(a){var b=a.na[dl];if(null!=b){var c;c=""+(Il(a,!0)+"Kb");c+=", "+(+ +Kl(a,el,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Kl(a,Zk,!0)]+" Monitor";c+=", "+ +Kl(a,Yk,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
function en(a,b,c,d,e){var f=a.F[b],g=f.oc[c],h=g.sb[f.zb];t(a,768)&&v(a,d,null,e,"DMA"+b+".CHANNEL"+c+".ADDR["+f.zb+"]",h,!0);f.zb^=1;b||c!=fn||f.zb||(g.sb[0]++,255<g.sb[0]&&(g.sb[0]=0,g.sb[1]++,255<g.sb[1]&&(g.sb[1]=0)));return h}function gn(a,b,c,d,e,f){var g=a.F[b];t(a,768)&&v(a,d,e,f,"DMA"+b+".CHANNEL"+c+".ADDR["+g.zb+"]",null,!0);a=g.oc[c];a.sb[g.zb]=a.fg[g.zb]=e;g.zb^=1}
function hn(a,b,c,d,e){var f=a.F[b],g=f.oc[c],h=g.nb[f.zb];t(a,768)&&v(a,d,null,e,"DMA"+b+".CHANNEL"+c+".COUNT["+f.zb+"]",h,!0);f.zb^=1;b||c!=fn||f.zb||(g.nb[0]--,0>g.nb[0]&&(g.nb[0]=255,g.nb[1]--,0>g.nb[1]&&(g.nb[1]=255)));return h}function jn(a,b,c,d,e,f){var g=a.F[b];t(a,768)&&v(a,d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.zb+"]",null,!0);a=g.oc[c];a.nb[g.zb]=a.pc[g.zb]=e;g.zb^=1}function kn(a,b,c,d){var e=a.F[b],f=e.Mb|ln;e.Mb&=~mn;t(a,768)&&v(a,c,null,d,"DMA"+b+".STATUS",f,!0);return f}
function nn(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Mb=f.Mb&~(16<<a)|(d&4)<<a+2;f.Xi=d}function on(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".MASK",null,!0);b=d&pn;c=f.oc[b];c.ne=!!(d&qn);c.ne||rn(a,f.gn+b)}function sn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA"+b+".MODE",null,!0);a.F[b].oc[d&tn].mode=d}function un(a,b,c,d){var e=a.F[b].Yi;t(a,768)&&v(a,c,null,d,"DMA"+b+".TEMP",e,!0);return e}
function nn(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Mb=f.Mb&~(16<<a)|(d&4)<<a+2;f.Xi=d}function on(a,b,c,d,e){var f=a.F[b];t(a,768)&&v(a,c,d,e,"DMA"+b+".MASK",null,!0);b=d&pn;c=f.oc[b];c.ne=!!(d&qn);c.ne||rn(a,f.jn+b)}function sn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA"+b+".MODE",null,!0);a.F[b].oc[d&tn].mode=d}function un(a,b,c,d){var e=a.F[b].Yi;t(a,768)&&v(a,c,null,d,"DMA"+b+".TEMP",e,!0);return e}
function vn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA"+b+".MASTER_CLEAR",null,!0);a=a.F[b];for(b=0;b<a.oc.length;b++)Om(a,b)}function wn(a,b,c,d,e){var f=a.F[b].oc[c].hg;t(a,768)&&v(a,d,null,e,"DMA"+b+".CHANNEL"+c+".PAGE",f,!0);return f}function xn(a,b,c,d,e,f){t(a,768)&&v(a,d,e,f,"DMA"+b+".CHANNEL"+c+".PAGE",null,!0);a.F[b].oc[c].hg=e}function yn(a,b,c,d){var e=a.Y[b];t(a,768)&&v(a,c,null,d,"DMA.SPARE"+b+".PAGE",e,!0);return e}
function zn(a,b,c,d,e){t(a,768)&&v(a,c,d,e,"DMA.SPARE"+b+".PAGE",null,!0);a.Y[b]=d}function An(a,b,c,d,e){Qm(a.F[b>>2].oc[b&3],c,d,e)}function rn(a,b,c){b=a.F[b>>2].oc[b&3];b.mg&&b.eh&&b.Ag?(c&&(b.done=c),b.ne||Bn(a,b,!0)):c&&c(!0)}
function Bn(a,b,c){c&&(b.count=b.nb[1]<<8|b.nb[0],b.type=b.mode&Cn,b.rj=b.ng=!1);for(var d=!1;0<=b.count&&(c=b.hg<<16|b.sb[1]<<8|b.sb[0],b.type==Dn?(d=!0,function(c){b.eh.call(b.mg,b.Ag,-1,function(e,g){0>e&&(b.rj||(b.rj=!0),e=255);b.ne||a.ka.fc(c,e);(d=g)&&setTimeout(function(){En(b)||Bn(a,b)},0)})}(c)):b.type==Fn?(c=a.ka.Ia(c),0>b.eh.call(b.mg,b.Ag,c)&&(b.ng=!0)):b.type!=Gn&&(b.ng=!0)),!d&&!En(b););}
@ -454,20 +454,20 @@ function po(a,b,c,d,e){v(a,c,d,e,"PIT"+b+".CTRL",null,2048);e=0;c=d&qo;b?(e=3,a.
a.J==(Do|Eo|Fo|Go)&&(b=a.G[0],b.Mc[0]=b.pc[0],b.Mc[1]=b.pc[1],b.jd=vd(a.H,a.O))}}}function mo(a,b){a=a.G[b];(b=a.pc[1]<<8|a.pc[0])||(b=1==a.ad?256:65536);return b}function Fd(a,b){a=a.G[b];(b=a.Mc[1]<<8|a.Mc[0])||(b=1==a.ad?256:65536);return b}function xo(a,b){sl(a,b);var c=a.G[b];c.je[0]=c.nb[0];c.je[1]=c.nb[1];c.Me=!0;fo(a,b)}function fo(a,b){a=a.G[b];a.rd=a.Qf==Ho?1:0;a.ad=a.Qf==Io?2:1}
function sl(a,b,c){var d=a.G[b];if(d.le&&(b!=no||a.J&Do)){var e=vd(a.H,a.O),f=(e-d.jd)/a.Ba|0;0>f&&(d.jd=e,f=0);var g=mo(a,b),h=Fd(a,b)-f;d.mode==ho?(0>=h&&(h=0),h||(d.gd=!0,d.le=!1,b||Zg(a,lo))):d.mode==Jo?(d.gd=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.Mc[0]=h&255,d.Mc[1]=h>>8&255,d.jd=e,!b&&d.gd&&Zg(a,lo))):d.mode==Gd&&(h-=f,0>=h&&(d.gd=!d.gd,h=g+h,0>=h&&(h=g),d.Mc[0]=h&255,d.Mc[1]=h>>8&255,d.jd=e,!b&&d.gd&&Zg(a,lo)));d.nb[0]=h&255;d.nb[1]=h>>8&255;c&&(a.jd=0)}return d}
function Ed(a,b){for(var c=0;c<a.G.length;c++)sl(a,c,b);if(a.ca>=Kg){b=a.H.T.sd;c=vd(a.H,a.O);null==a.Aa&&(a.ma=vd(a.H,a.O),a.Ha=1024,a.Aa=Math.floor(a.H.T.sd/a.Ha),Km(a));c>=a.Z&&(a.A[Gm]|=Ko,a.A[Hd]&Id&&(a.A[Gm]|=Lo,Zg(a,Mo)),a.Z=c+a.Aa);a.A[cm]==a.A[dm]&&a.A[em]==a.A[fm]&&a.A[gm]==a.A[hm]&&(a.A[Gm]|=No,a.A[Hd]&Oo&&(a.A[Gm]|=Lo,Zg(a,Mo)));var d=c-a.ma,e=Math.floor(d/b);if(e&&!(a.A[Hd]&Po)){for(;e--;)if(60<=++a.A[cm]&&(a.A[cm]=0,60<=++a.A[em]&&(a.A[em]=0,24<=++a.A[gm]))){a.A[gm]=0;a.A[im]=a.A[im]%
7+1;var f;f=a.A[Cm];var g=Aa[a.A[Bm]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[Am]>f&&(a.A[Am]=1,12<++a.A[Bm]&&(a.A[Bm]=1,a.A[Cm]=(a.A[Cm]+1)%100))}a.A[Gm]|=Qo;a.A[Hd]&Ro&&(a.A[Gm]|=Lo,Zg(a,Mo))}a.ma=c-d%b}}l.Gm=function(a,b){var c=this.ya;this.ga&So&&(this.J&To?c=this.C[0][1]:this.B&&(c=Uo(this.B)));v(this,a,null,b,"PPI_A",c);return c};l.ho=function(a,b,c){v(this,a,b,c,"PPI_A");this.ya=b};l.Hm=function(a,b){var c=this.J;v(this,a,null,b,"PPI_B",c);return c};
l.io=function(a,b,c){v(this,a,b,c,"PPI_B");Vo(this,b)};function Vo(a,b){var c=!!(b&Wo),d=!!(a.J&Wo);a.J=b;a.B&&Xo(a.B,!(b&To),!!(b&Go));c!=d&&Mm(a,c)}l.Im=function(a,b){var c=0,c=(this.ca|0)==bl?this.J&Eo?c|this.C[1][1]&Yo:c|this.C[1][1]>>4&1:this.J&Zo?c|this.C[0][1]>>4:c|this.C[0][1]&15;this.J&Do&&sl(this,no).gd&&(c=this.J&Wo?c|$o:c|ap);v(this,a,null,b,"PPI_C",c,32896);return c};l.jo=function(a,b,c){v(this,a,b,c,"PPI_C");this.Ca=b};l.Jm=function(a,b){var c=this.ga;v(this,a,null,b,"PPI_CTRL",c);return c};
l.ko=function(a,b,c){v(this,a,b,c,"PPI_CTRL");this.ga=b};l.Sl=function(a,b){var c=this.B?Uo(this.B):0;v(this,a,null,b,"8041_KBD",c);this.aa&=~bp;return c};l.rn=function(a,b,c){v(this,a,b,c,"8041_KBD")};l.Rl=function(a,b){var c=this.J;v(this,a,null,b,"8041_CTRL",c);return c};l.qn=function(a,b,c){v(this,a,b,c,"8041_CTRL");Vo(this,b)};l.Tl=function(a,b){var c=this.aa;v(this,a,null,b,"8041_STATUS",c);return c};
7+1;var f;f=a.A[Cm];var g=Aa[a.A[Bm]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[Am]>f&&(a.A[Am]=1,12<++a.A[Bm]&&(a.A[Bm]=1,a.A[Cm]=(a.A[Cm]+1)%100))}a.A[Gm]|=Qo;a.A[Hd]&Ro&&(a.A[Gm]|=Lo,Zg(a,Mo))}a.ma=c-d%b}}l.Gm=function(a,b){var c=this.ya;this.ga&So&&(this.J&To?c=this.C[0][1]:this.B&&(c=Uo(this.B)));v(this,a,null,b,"PPI_A",c);return c};l.jo=function(a,b,c){v(this,a,b,c,"PPI_A");this.ya=b};l.Hm=function(a,b){var c=this.J;v(this,a,null,b,"PPI_B",c);return c};
l.ko=function(a,b,c){v(this,a,b,c,"PPI_B");Vo(this,b)};function Vo(a,b){var c=!!(b&Wo),d=!!(a.J&Wo);a.J=b;a.B&&Xo(a.B,!(b&To),!!(b&Go));c!=d&&Mm(a,c)}l.Im=function(a,b){var c=0,c=(this.ca|0)==bl?this.J&Eo?c|this.C[1][1]&Yo:c|this.C[1][1]>>4&1:this.J&Zo?c|this.C[0][1]>>4:c|this.C[0][1]&15;this.J&Do&&sl(this,no).gd&&(c=this.J&Wo?c|$o:c|ap);v(this,a,null,b,"PPI_C",c,32896);return c};l.lo=function(a,b,c){v(this,a,b,c,"PPI_C");this.Ca=b};l.Jm=function(a,b){var c=this.ga;v(this,a,null,b,"PPI_CTRL",c);return c};
l.mo=function(a,b,c){v(this,a,b,c,"PPI_CTRL");this.ga=b};l.Sl=function(a,b){var c=this.B?Uo(this.B):0;v(this,a,null,b,"8041_KBD",c);this.aa&=~bp;return c};l.tn=function(a,b,c){v(this,a,b,c,"8041_KBD")};l.Rl=function(a,b){var c=this.J;v(this,a,null,b,"8041_CTRL",c);return c};l.sn=function(a,b,c){v(this,a,b,c,"8041_CTRL");Vo(this,b)};l.Tl=function(a,b){var c=this.aa;v(this,a,null,b,"8041_STATUS",c);return c};
l.Ul=function(a,b){var c=this.oa;v(this,a,null,b,"8042_OUTBUFF",c,16384);this.D&=~(bp|cp);this.B&&dp(this.B);return c};
l.tn=function(a,b,c){v(this,a,b,c,"8042_INBUF.DATA",null,16384);if(this.D&ep)switch(this.L){case fp:gp(this,b);break;case hp:ip(this,b);break;default:if(gp(this,this.K&~Fl),this.B){a=this.B;c=b;var d=-1;t(a)&&Cb(a,"sendCmd("+r(c)+")");switch(a.F||c){case jp:d=kp;lp(a);break;case mp:a.F&&(c=0);np(a,kp);a.F=c;break;case op:a.F&&(c=0);np(a,kp);a.F=c;break;default:Cb(a,"sendCmd(): unrecognized command")}pp(this,d)}}this.L=b;this.D&=~ep};
l.Vl=function(a,b){var c=this.J&~(qp|rp)|(vd(this.H)&64?rp:0);v(this,a,null,b,"8042_RWREG",c,16384);return c};l.un=function(a,b,c){v(this,a,b,c,"8042_RWREG",null,16384);Vo(this,b)};l.Wl=function(a,b){v(this,a,null,b,"8042_STATUS",this.D,16384);a=this.D&255;this.D&cp&&(this.D|=bp,this.D&=~cp);return a};
l.sn=function(a,b,c){v(this,a,b,c,"8042_INBUFF.CMD",null,16384);this.L=b;this.D|=ep;a=0;this.L>=sp&&(a=this.L^15,this.L=sp);switch(this.L){case tp:pp(this,this.K);break;case up:gp(this,this.K|Fl);break;case vp:gp(this,this.K&~Fl);this.B&&dp(this.B);break;case wp:this.B&&(a=this.B,a.A=[],t(a)&&Cb(a,"scan codes flushed"));gp(this,this.K|Fl);pp(this,xp);ip(this,Pl|Ql);break;case yp:pp(this,zp);break;case Ap:pp(this,this.M);break;case Bp:pp(this,this.qa);break;case Cp:pp(this,this.K&Fl?0:Dp);break;case sp:a&
l.vn=function(a,b,c){v(this,a,b,c,"8042_INBUF.DATA",null,16384);if(this.D&ep)switch(this.L){case fp:gp(this,b);break;case hp:ip(this,b);break;default:if(gp(this,this.K&~Fl),this.B){a=this.B;c=b;var d=-1;t(a)&&Cb(a,"sendCmd("+r(c)+")");switch(a.F||c){case jp:d=kp;lp(a);break;case mp:a.F&&(c=0);np(a,kp);a.F=c;break;case op:a.F&&(c=0);np(a,kp);a.F=c;break;default:Cb(a,"sendCmd(): unrecognized command")}pp(this,d)}}this.L=b;this.D&=~ep};
l.Vl=function(a,b){var c=this.J&~(qp|rp)|(vd(this.H)&64?rp:0);v(this,a,null,b,"8042_RWREG",c,16384);return c};l.wn=function(a,b,c){v(this,a,b,c,"8042_RWREG",null,16384);Vo(this,b)};l.Wl=function(a,b){v(this,a,null,b,"8042_STATUS",this.D,16384);a=this.D&255;this.D&cp&&(this.D|=bp,this.D&=~cp);return a};
l.un=function(a,b,c){v(this,a,b,c,"8042_INBUFF.CMD",null,16384);this.L=b;this.D|=ep;a=0;this.L>=sp&&(a=this.L^15,this.L=sp);switch(this.L){case tp:pp(this,this.K);break;case up:gp(this,this.K|Fl);break;case vp:gp(this,this.K&~Fl);this.B&&dp(this.B);break;case wp:this.B&&(a=this.B,a.A=[],t(a)&&Cb(a,"scan codes flushed"));gp(this,this.K|Fl);pp(this,xp);ip(this,Pl|Ql);break;case yp:pp(this,zp);break;case Ap:pp(this,this.M);break;case Bp:pp(this,this.qa);break;case Cp:pp(this,this.K&Fl?0:Dp);break;case sp:a&
1&&Ye(this.H)}};function gp(a,b){a.K=b;a.D=a.D&~Ep|b&Fp;a.B&&Xo(a.B,!!(b&Gp),!(b&Fl))}function pp(a,b,c){0<=b&&(a.oa=b,c?a.D|=bp:(a.D&=~bp,a.D|=cp))}function ip(a,b){a.qa=b;fc(a.ka,!!(b&Ql));b&Pl||Ye(a.H)}function Hp(a,b){a.ca<Kg?(Zg(a,Ip,4),a.aa|=bp):a.K&Fl||a.D&(bp|cp)||(pp(a,b,!0),Jp(a.B),Zg(a,Ip,120))}function Kp(a,b,c,d){var e=a.C[b][1];v(a,c,null,d,"DIPSW-"+b,e,32768);return e}l.jm=function(a,b){v(this,a,null,b,"CMOS.ADDR",this.W,4096);return this.W};
l.In=function(a,b,c){v(this,a,b,c,"CMOS.ADDR",null,4096);this.W=b;this.da=b&Lp?$g:Mp};l.km=function(a,b){var c=this.W&Np,d=c<=ul?vl(this,c):this.A[c];t(this,4352)&&v(this,a,null,b,"CMOS.DATA["+r(c)+"]",d,!0);null!=b&&c==Gm&&(this.A[c]&=Op,d&Lo&&Lg(this,Mo),d&Ko&&this.A[Hd]&Id&&Km(this));return d};
l.Jn=function(a,b,c){var d=this.W&Np;t(this,4352)&&v(this,a,b,c,"CMOS.DATA["+r(d)+"]",null,!0);a=b^this.A[d];if(d<=ul){if(c=b,d<Em){var e=!1;this.A[Hd]&Im||(c=10*(c>>4)+(c&15),e=!0);if(d==gm||d==hm)e&&23<c&&(c+=48),this.A[Hd]&Fm||(12>=c?c=12==c?0:c:(c-=116,c=24==c?12:c))}}else c=b;this.A[d]=c;d==Hd&&a&Id&&b&Id&&Km(this)};l.Nk=function(a,b,c){v(this,a,b,c,"NMI");this.da=b};l.Tn=function(a,b,c){v(this,a,b,c,"FPU.CLEAR")};l.Un=function(a,b,c){v(this,a,b,c,"FPU.RESET");this.Tc&&Fg(this.Tc)};
l.Kn=function(a,b,c){v(this,a,b,c,"CMOS.ADDR",null,4096);this.W=b;this.da=b&Lp?$g:Mp};l.km=function(a,b){var c=this.W&Np,d=c<=ul?vl(this,c):this.A[c];t(this,4352)&&v(this,a,null,b,"CMOS.DATA["+r(c)+"]",d,!0);null!=b&&c==Gm&&(this.A[c]&=Op,d&Lo&&Lg(this,Mo),d&Ko&&this.A[Hd]&Id&&Km(this));return d};
l.Ln=function(a,b,c){var d=this.W&Np;t(this,4352)&&v(this,a,b,c,"CMOS.DATA["+r(d)+"]",null,!0);a=b^this.A[d];if(d<=ul){if(c=b,d<Em){var e=!1;this.A[Hd]&Im||(c=10*(c>>4)+(c&15),e=!0);if(d==gm||d==hm)e&&23<c&&(c+=48),this.A[Hd]&Fm||(12>=c?c=12==c?0:c:(c-=116,c=24==c?12:c))}}else c=b;this.A[d]=c;d==Hd&&a&Id&&b&Id&&Km(this)};l.Nk=function(a,b,c){v(this,a,b,c,"NMI");this.da=b};l.Vn=function(a,b,c){v(this,a,b,c,"FPU.CLEAR")};l.Wn=function(a,b,c){v(this,a,b,c,"FPU.RESET");this.Tc&&Fg(this.Tc)};
l.Xm=function(a){if(t(this,16)&&Nk(this.ba,26,a)){var b=this.H.D>>8;Kf(this.H,a,function(a,d){return function(c){d=vd(a.H)-d;var e,g=a.H.L&255,h=a.H.L>>8,k=a.H.L&255,m=a.H.L>>8;if(2==b||3==b)e=" CH(hour)="+ka(h)+" CL(min)="+r(g)+" DH(sec)="+r(m);else if(4==b||5==b)e=" CX(year)="+ka(a.H.I)+" DH(month)="+r(m)+" DL(day)="+r(k);g=a.ba;h=d;g.message("INT "+r(26)+": C="+(Vf(g.H)?1:0)+(e||"")+" (cycles="+h+(c?",level="+(c+1):"")+")")}}(this,vd(this.H)))}return!0};
function Mm(a,b){if(a.la)try{void 0!==b?a.Ga=b:b=!!(a.Ga&&a.H&&a.H.ea.vb);var c=Math.round(fl/mo(a,no));if(20>c||2E4<c)b=!1;b?a.I?(a.I.frequency.value=c,t(a,33554432)&&Cb(a,"speaker set to "+c+"hz",!0)):(a.I=a.la.createOscillator(),a.I&&(a.I.type="number"==typeof a.I.type?1:"square",a.I.connect(a.la.destination),a.I.frequency.value=c,"start"in a.I?a.I.start(0):a.I.noteOn(0),t(a,33554432)&&Cb(a,"speaker on at "+c+"hz",!0))):a.I&&("stop"in a.I?a.I.stop(0):a.I.noteOff(0),a.I.disconnect(),delete a.I,
t(a,33554432)&&Cb(a,"speaker off at "+c+"hz",!0))}catch(d){a.Fa("AudioContext exception: "+d.message),a.la=null}else b&&Cb(a,"BEEP",33554432)}var bl=5150,Uk=5150.9,Kg=5170,cl=5160.101,ol=5180,Tk={5150:bl,5160:5160,5170:Kg,att6300:cl,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Uk};Tk.deskpro386=ol;
var Wk="sw1",$k="sw2",dl="swdesc",Ll=3,ln=1,mn=15,pn=3,qn=4,tn=3,Cn=12,Gn=0,Dn=4,Fn=8,In=16,Hn=32,fn=0,zl=0,Al=32,Bl=1,Cl=160,On=16,bo=1,ao=2,Vn=7,Sn=224,Tn=32,Un=96,Xn=128,Yn=192,Pn=8,Ln=2,Mn=3,Kn=3,Qn=4,Rn=96,lo=0,Ip=1,co=2,Mo=8,Yg=13,jo=0,ko=0,no=2,zo=1,Ao=14,ho=0,Jo=4,Gd=6,io=8,Bo=48,Co=0,Ho=32,Io=48,qo=192,ro=192,yo=6,to=2,so=16,wo=32,uo=64,vo=128,fl=1193181,Do=1,Wo=2,Eo=4,Fo=8,Zo=8,Go=64,To=128,Yo=15,ap=16,$o=32,So=16,Yl={ol:1,ONE:0,Xp:64,Vp:128,Mp:192,yc:192,Mg:6},Xl=2,Wl={Wp:16,kp:32,Np:48,
var Wk="sw1",$k="sw2",dl="swdesc",Ll=3,ln=1,mn=15,pn=3,qn=4,tn=3,Cn=12,Gn=0,Dn=4,Fn=8,In=16,Hn=32,fn=0,zl=0,Al=32,Bl=1,Cl=160,On=16,bo=1,ao=2,Vn=7,Sn=224,Tn=32,Un=96,Xn=128,Yn=192,Pn=8,Ln=2,Mn=3,Kn=3,Qn=4,Rn=96,lo=0,Ip=1,co=2,Mo=8,Yg=13,jo=0,ko=0,no=2,zo=1,Ao=14,ho=0,Jo=4,Gd=6,io=8,Bo=48,Co=0,Ho=32,Io=48,qo=192,ro=192,yo=6,to=2,so=16,wo=32,uo=64,vo=128,fl=1193181,Do=1,Wo=2,Eo=4,Fo=8,Zo=8,Go=64,To=128,Yo=15,ap=16,$o=32,So=16,Yl={ol:1,ONE:0,Zp:64,Xp:128,Op:192,yc:192,Mg:6},Xl=2,Wl={Yp:16,mp:32,Pp:48,
yc:48,Mg:4},Yk=1,el=3,Zk=4,an=5,bn=6,Vm={};Vm[bl]=[{},{}];Vm[bl][0][Yk]={yc:192,Zc:{1:0,2:64,3:128,4:192},Ed:"Number of Floppy Drives"};Vm[bl][0][el]={yc:2,Zc:{0:0,1:2},Ed:"FPU"};Vm[bl][0][Zk]={yc:48,Zc:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},Ed:"Monitor Type"};Vm[bl][0][an]={yc:12,Zc:{16:0,32:4,48:8,64:12},Ed:"Base Memory (16Kb Increments)"};
Vm[bl][1][bn]={yc:31,Zc:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},Ed:"Expansion Memory (32Kb Increments)"};Vm[5160]=[{},{}];Vm[5160][0][Yk]=Vm[bl][0][Yk];Vm[5160][0][el]=Vm[bl][0][el];Vm[5160][0][Zk]=Vm[bl][0][Zk];Vm[5160][0][an]={yc:12,Zc:{64:0,128:4,192:8,256:12},Ed:"Base Memory (64Kb Increments)"};Vm[5160][1][bn]=Vm[bl][1][bn];Vm[cl]=[{},{}];Vm[cl][0][an]={yc:143,Zc:{128:1,256:130,512:8,640:141},Ed:"Base Memory (128Kb Increments)"};
Vm[cl][0][el]={yc:16,Zc:{0:0,1:16},Ed:"FPU"};Vm[cl][1][2]={yc:1,Zc:{0:0,1:1},Ed:"Floppy Type"};Vm[cl][1][Yk]=Vm[bl][0][Yk];Vm[cl][1][Zk]=Vm[bl][0][Zk];
@ -478,10 +478,10 @@ zl,b)},33:function(a,b){return Zn(this,zl,b)},64:function(a,b){return eo(this,jo
6,a,b)},143:function(a,b){return wn(this,1,0,a,b)},160:function(a,b){return Jn(this,Bl,b)},161:function(a,b){return Zn(this,Bl,b)},192:function(a,b){return en(this,1,0,a,b)},194:function(a,b){return hn(this,1,0,a,b)},196:function(a,b){return en(this,1,1,a,b)},198:function(a,b){return hn(this,1,1,a,b)},200:function(a,b){return en(this,1,2,a,b)},202:function(a,b){return hn(this,1,2,a,b)},204:function(a,b){return en(this,1,3,a,b)},206:function(a,b){return hn(this,1,3,a,b)},208:function(a,b){return kn(this,
1,a,b)},218:function(a,b){return un(this,1,a,b)}},kl={96:Sk.prototype.Sl,97:Sk.prototype.Rl,100:Sk.prototype.Tl,102:function(a,b){return Kp(this,0,a,b)},103:function(a,b){return Kp(this,1,a,b)}},pl={72:function(a,b){return eo(this,1,0,a,b)},73:function(a,b){return eo(this,1,1,a,b)},74:function(a,b){return eo(this,1,2,a,b)},75:function(a,b){return oo(this,1,a,b)}},hl={0:function(a,b,c){gn(this,0,0,a,b,c)},1:function(a,b,c){jn(this,0,0,a,b,c)},2:function(a,b,c){gn(this,0,1,a,b,c)},3:function(a,b,c){jn(this,
0,1,a,b,c)},4:function(a,b,c){gn(this,0,2,a,b,c)},5:function(a,b,c){jn(this,0,2,a,b,c)},6:function(a,b,c){gn(this,0,3,a,b,c)},7:function(a,b,c){jn(this,0,3,a,b,c)},8:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA0.CMD",null,!0);this.F[0].Xg=b},9:function(a,b,c){nn(this,0,a,b,c)},10:function(a,b,c){on(this,0,a,b,c)},11:function(a,b,c){sn(this,0,a,b,c)},12:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA0.RESET_FF",null,!0);this.F[0].zb=0},13:function(a,b,c){vn(this,0,a,b,c)},32:function(a,b,c){Nn(this,
zl,b,c)},33:function(a,b,c){$n(this,zl,b,c)},64:function(a,b,c){go(this,jo,ko,a,b,c)},65:function(a,b,c){go(this,jo,1,a,b,c)},66:function(a,b,c){go(this,jo,no,a,b,c)},67:function(a,b,c){po(this,jo,a,b,c)},129:function(a,b,c){xn(this,0,2,a,b,c)},130:function(a,b,c){xn(this,0,3,a,b,c)},131:function(a,b,c){xn(this,0,1,a,b,c)},135:function(a,b,c){xn(this,0,0,a,b,c)}},jl={96:Sk.prototype.ho,97:Sk.prototype.io,98:Sk.prototype.jo,99:Sk.prototype.ko,160:Sk.prototype.Nk},nl={96:Sk.prototype.tn,97:Sk.prototype.un,
100:Sk.prototype.sn,112:Sk.prototype.In,113:Sk.prototype.Jn,128:function(a,b,c){zn(this,7,a,b,c)},132:function(a,b,c){zn(this,0,a,b,c)},133:function(a,b,c){zn(this,1,a,b,c)},134:function(a,b,c){zn(this,2,a,b,c)},136:function(a,b,c){zn(this,3,a,b,c)},137:function(a,b,c){xn(this,1,2,a,b,c)},138:function(a,b,c){xn(this,1,3,a,b,c)},139:function(a,b,c){xn(this,1,1,a,b,c)},140:function(a,b,c){zn(this,4,a,b,c)},141:function(a,b,c){zn(this,5,a,b,c)},142:function(a,b,c){zn(this,6,a,b,c)},143:function(a,b,
zl,b,c)},33:function(a,b,c){$n(this,zl,b,c)},64:function(a,b,c){go(this,jo,ko,a,b,c)},65:function(a,b,c){go(this,jo,1,a,b,c)},66:function(a,b,c){go(this,jo,no,a,b,c)},67:function(a,b,c){po(this,jo,a,b,c)},129:function(a,b,c){xn(this,0,2,a,b,c)},130:function(a,b,c){xn(this,0,3,a,b,c)},131:function(a,b,c){xn(this,0,1,a,b,c)},135:function(a,b,c){xn(this,0,0,a,b,c)}},jl={96:Sk.prototype.jo,97:Sk.prototype.ko,98:Sk.prototype.lo,99:Sk.prototype.mo,160:Sk.prototype.Nk},nl={96:Sk.prototype.vn,97:Sk.prototype.wn,
100:Sk.prototype.un,112:Sk.prototype.Kn,113:Sk.prototype.Ln,128:function(a,b,c){zn(this,7,a,b,c)},132:function(a,b,c){zn(this,0,a,b,c)},133:function(a,b,c){zn(this,1,a,b,c)},134:function(a,b,c){zn(this,2,a,b,c)},136:function(a,b,c){zn(this,3,a,b,c)},137:function(a,b,c){xn(this,1,2,a,b,c)},138:function(a,b,c){xn(this,1,3,a,b,c)},139:function(a,b,c){xn(this,1,1,a,b,c)},140:function(a,b,c){zn(this,4,a,b,c)},141:function(a,b,c){zn(this,5,a,b,c)},142:function(a,b,c){zn(this,6,a,b,c)},143:function(a,b,
c){xn(this,1,0,a,b,c)},160:function(a,b,c){Nn(this,Bl,b,c)},161:function(a,b,c){$n(this,Bl,b,c)},192:function(a,b,c){gn(this,1,0,a,b,c)},194:function(a,b,c){jn(this,1,0,a,b,c)},196:function(a,b,c){gn(this,1,1,a,b,c)},198:function(a,b,c){jn(this,1,1,a,b,c)},200:function(a,b,c){gn(this,1,2,a,b,c)},202:function(a,b,c){jn(this,1,2,a,b,c)},204:function(a,b,c){gn(this,1,3,a,b,c)},206:function(a,b,c){jn(this,1,3,a,b,c)},208:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA1.CMD",null,!0);this.F[1].Xg=b},210:function(a,
b,c){nn(this,1,a,b,c)},212:function(a,b,c){on(this,1,a,b,c)},214:function(a,b,c){sn(this,1,a,b,c)},216:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA1.RESET_FF",null,!0);this.F[1].zb=0},218:function(a,b,c){vn(this,1,a,b,c)},240:Sk.prototype.Tn,241:Sk.prototype.Un},ll={96:Sk.prototype.rn,97:Sk.prototype.qn,160:Sk.prototype.Nk},ql={72:function(a,b,c){go(this,1,0,a,b,c)},73:function(a,b,c){go(this,1,1,a,b,c)},74:function(a,b,c){go(this,1,2,a,b,c)},75:function(a,b,c){po(this,1,a,b,c)}};
b,c){nn(this,1,a,b,c)},212:function(a,b,c){on(this,1,a,b,c)},214:function(a,b,c){sn(this,1,a,b,c)},216:function(a,b,c){t(this,768)&&v(this,a,b,c,"DMA1.RESET_FF",null,!0);this.F[1].zb=0},218:function(a,b,c){vn(this,1,a,b,c)},240:Sk.prototype.Vn,241:Sk.prototype.Wn},ll={96:Sk.prototype.tn,97:Sk.prototype.sn,160:Sk.prototype.Nk},ql={72:function(a,b,c){go(this,1,0,a,b,c)},73:function(a,b,c){go(this,1,1,a,b,c)},74:function(a,b,c){go(this,1,2,a,b,c)},75:function(a,b,c){po(this,1,a,b,c)}};
Ra(function(){for(var a=pb(document,"pcx86","chipset"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new Sk(d);ob(d,c);dn(d)}});
function Pp(a){ab.call(this,"ROM",a);this.A=null;this.F=a.addr;this.C=a.size;this.D=a.alias;this.G=a.file;this.B=a.notify;this.I=null;if(this.B&&(a=this.B.indexOf("["),0<a)){try{this.I=eval(this.B.substr(a))}catch(d){}this.B=this.B.substr(0,a)}if(this.G){a=this.G;var b=ma(la(a));"json"!=b&&"hex"!=b&&(a=Da()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var c=this;Ca(a,null,!0,function(a,b,f){Qp(c,a,b,f)})}}ba(Pp,ab);Pp.prototype.uc=function(a,b,c,d){this.ka=b;this.H=c;this.ba=d;Rp(this)};
Pp.prototype.Xb=function(){this.Fd&&(this.ba&&Sp(this.ba,this.id,0,this.F>>>4,0,this.F,this.C,this.Fd),delete this.Fd);return!0};Pp.prototype.Wb=function(){return!0};
@ -511,14 +511,14 @@ e.A.push(f),1==e.A.length&&e.W&&Hp(e.W,f)):(e.A.length==Zq&&e.A.push($q),Cb(e,"s
var qq={TAB:1009,ESC:1027,F1:1112,F2:1113,F3:1114,F4:1115,F5:1116,F6:1117,F7:1118,F8:1119,F9:1120,F10:1121,LEFT:1037,UP:1038,RIGHT:1039,DOWN:1040,SYSREQ:4027,CTRL_C:ar,CTRL_BREAK:Mq,CTRL_ALT_DEL:4046,CTRL_ALT_INS:4045,CTRL_ALT_ENTER:4013},sq={esc:1027,1:n["1"],2:n["2"],3:n["3"],4:n["4"],5:n["5"],6:n["6"],7:n["7"],8:n["8"],9:n["9"],0:n["0"],"-":n["-"],"=":n["="],bs:1008,tab:1009,q:n.Q,w:n.Mi,e:n.E,r:n.Hi,t:n.Ji,y:n.Oi,u:n.Ki,i:n.zi,o:n.Fi,p:n.Gi,"[":n["["],"]":n["]"],enter:13,ctrl:1017,a:n.ce,s:n.Ii,
d:n.vi,f:n.wi,g:n.xi,h:n.yi,j:n.Ai,k:n.Bi,l:n.Ci,";":n[";"],quote:n["'"],"`":n["`"],shift:1016,"\\":n["\\"],z:n.eg,x:n.Ni,c:n.ui,v:n.Li,b:n.ti,n:n.Ei,m:n.Di,",":n[","],".":n["."],"/":n["/"],"right-shift":3016,prtsc:1044,alt:1018,space:1032,"caps-lock":nq,f1:1112,f2:1113,f3:1114,f4:1115,f5:1116,f6:1117,f7:1118,f8:1119,f9:1120,f10:1121,"num-lock":oq,"scroll-lock":pq,"num-home":1036,"num-up":1038,"num-pgup":1033,"num-sub":1109,"num-left":1037,"num-center":1101,"num-right":1039,"num-add":1107,"num-end":1035,
"num-down":1040,"num-pgdn":1034,"num-ins":1045,"num-del":1046,sysreq:84},Dq={"caps-lock":Jq,"num-lock":1024,"scroll-lock":2048},O={1027:1};O[n["1"]]=2;O[n["!"]]=2|P<<8;O[n["2"]]=3;O[n["@"]]=3|P<<8;O[n["3"]]=4;O[n["#"]]=4|P<<8;O[n["4"]]=5;O[n.$]=5|P<<8;O[n["5"]]=6;O[n["%"]]=6|P<<8;O[n["6"]]=7;O[n["^"]]=7|P<<8;O[n["7"]]=8;O[n["&"]]=8|P<<8;O[n["8"]]=9;O[n["*"]]=9|P<<8;O[n["9"]]=10;O[n["("]]=10|P<<8;O[n["0"]]=11;O[n[")"]]=11|P<<8;O[n["-"]]=12;O[n._]=12|P<<8;O[n["="]]=13;O[n["+"]]=13|P<<8;O[1008]=Qq;
O[1009]=15;O[n.q]=16;O[n.Q]=16|P<<8;O[n.Qo]=17;O[n.Mi]=17|P<<8;O[n.e]=18;O[n.E]=18|P<<8;O[n.r]=19;O[n.Hi]=19|P<<8;O[n.t]=20;O[n.Ji]=20|P<<8;O[n.y]=21;O[n.Oi]=21|P<<8;O[n.Oo]=22;O[n.Ki]=22|P<<8;O[n.Kl]=23;O[n.zi]=23|P<<8;O[n.on]=24;O[n.Fi]=24|P<<8;O[n.p]=25;O[n.Gi]=25|P<<8;O[n["["]]=26;O[n["{"]]=26|P<<8;O[n["]"]]=27;O[n["}"]]=27|P<<8;O[13]=28;O[1017]=Vq;O[n.de]=30;O[n.ce]=30|P<<8;O[n.Lo]=31;O[n.Ii]=31|P<<8;O[n.d]=32;O[n.vi]=32|P<<8;O[n.Hl]=33;O[n.wi]=33|P<<8;O[n.Il]=34;O[n.xi]=34|P<<8;O[n.Jl]=35;
O[n.yi]=35|P<<8;O[n.an]=36;O[n.Ai]=36|P<<8;O[n.k]=37;O[n.Bi]=37|P<<8;O[n.bn]=38;O[n.Ci]=38|P<<8;O[n[";"]]=39;O[n[":"]]=39|P<<8;O[n["'"]]=40;O[n['"']]=40|P<<8;O[n["`"]]=41;O[n["~"]]=41|P<<8;O[1016]=P;O[n["\\"]]=43;O[n["|"]]=43|P<<8;O[n.z]=44;O[n.eg]=44|P<<8;O[n.x]=45;O[n.Ni]=45|P<<8;O[n.xl]=46;O[n.ui]=46|P<<8;O[n.Po]=47;O[n.Li]=47|P<<8;O[n.vl]=48;O[n.ti]=48|P<<8;O[n.n]=49;O[n.Ei]=49|P<<8;O[n.fn]=50;O[n.Di]=50|P<<8;O[n[","]]=51;O[n["<"]]=51|P<<8;O[n["."]]=52;O[n[">"]]=52|P<<8;O[n["/"]]=53;
O[1009]=15;O[n.q]=16;O[n.Q]=16|P<<8;O[n.So]=17;O[n.Mi]=17|P<<8;O[n.e]=18;O[n.E]=18|P<<8;O[n.r]=19;O[n.Hi]=19|P<<8;O[n.t]=20;O[n.Ji]=20|P<<8;O[n.y]=21;O[n.Oi]=21|P<<8;O[n.Qo]=22;O[n.Ki]=22|P<<8;O[n.Kl]=23;O[n.zi]=23|P<<8;O[n.qn]=24;O[n.Fi]=24|P<<8;O[n.p]=25;O[n.Gi]=25|P<<8;O[n["["]]=26;O[n["{"]]=26|P<<8;O[n["]"]]=27;O[n["}"]]=27|P<<8;O[13]=28;O[1017]=Vq;O[n.de]=30;O[n.ce]=30|P<<8;O[n.No]=31;O[n.Ii]=31|P<<8;O[n.d]=32;O[n.vi]=32|P<<8;O[n.Hl]=33;O[n.wi]=33|P<<8;O[n.Il]=34;O[n.xi]=34|P<<8;O[n.Jl]=35;
O[n.yi]=35|P<<8;O[n.an]=36;O[n.Ai]=36|P<<8;O[n.k]=37;O[n.Bi]=37|P<<8;O[n.dn]=38;O[n.Ci]=38|P<<8;O[n[";"]]=39;O[n[":"]]=39|P<<8;O[n["'"]]=40;O[n['"']]=40|P<<8;O[n["`"]]=41;O[n["~"]]=41|P<<8;O[1016]=P;O[n["\\"]]=43;O[n["|"]]=43|P<<8;O[n.z]=44;O[n.eg]=44|P<<8;O[n.x]=45;O[n.Ni]=45|P<<8;O[n.xl]=46;O[n.ui]=46|P<<8;O[n.Ro]=47;O[n.Li]=47|P<<8;O[n.vl]=48;O[n.ti]=48|P<<8;O[n.n]=49;O[n.Ei]=49|P<<8;O[n.hn]=50;O[n.Di]=50|P<<8;O[n[","]]=51;O[n["<"]]=51|P<<8;O[n["."]]=52;O[n[">"]]=52|P<<8;O[n["/"]]=53;
O[n["?"]]=53|P<<8;O[3016]=54;O[1044]=55;O[1018]=Xq;O[1032]=57;O[nq]=58;O[1112]=59;O[1113]=60;O[1114]=61;O[1115]=62;O[1116]=63;O[1117]=64;O[1118]=65;O[1119]=66;O[1120]=67;O[1121]=68;O[oq]=69;O[pq]=70;O[1036]=71;O[1038]=72;O[1033]=73;O[1109]=74;O[1037]=75;O[1101]=76;O[1039]=77;O[1107]=78;O[1035]=79;O[1040]=80;O[1034]=81;O[1045]=82;O[1046]=Rq;O[4027]=84;O[1122]=87;O[1123]=88;O[1091]=91;O[1093]=93;O[1224]=91;O[ar]=46|Vq<<8;O[Mq]=70|Vq<<8;O[4046]=Rq|Vq<<8|Xq<<16;O[4045]=82|Vq<<8|Xq<<16;
O[4013]=28|Vq<<8|Xq<<16;var jp=255,mp=243,op=237,xq=170,kp=250,$q=255,Zq=20;Ra(function(){for(var a=pb(document,"pcx86","keyboard"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new iq(d);ob(d,c)}});
function br(a,b,c,d){if(void 0!==b&&(!c||c.length)){this.video=a;var e=cr[b],f=a.ga||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(b<Tp?dr:er)];this.ba=a.ba;this.type=e[0];this.port=e[1];this.La=b;this.bb=e[2];this.Ob=e[3];this.qd=d||e[4];65536<=this.qd&&720896<=this.bb&&(this.Ob=Math.min(this.qd>>2,32768));this.rc=c[0];this.Xc=c[1];this.Ze=c[2];this.fa=c[3];this.ec=c[4]&255;this.Fg=c[4]>>8&255;this.Wa=c[5];this.oh=dr;this.gg=fr;if(b>=Tp){this.oh=er;this.gg=gr;(b=c[6])||(b=[!1,0,Array(hr),0,f==
Ll?0:ir,0,0,Array(jr),0,0,0,Array(kr),0,[this.bb,this.Ob,this.qd],Array(this.qd>>2),lr|mr|nr|or|pr,0,-1,0,-1,0,-1,0,0,0,0,qr,rr,0,0,sr,Array(tr)]);this.Ke=b[0];this.wd=b[1];this.Cc=b[2];this.Tg=ur;this.Ig=b[3];this.af=b[4];this.Pf=b[5];this.zd=b[6];this.$d=b[7];this.Vg=vr;this.Wk=b[8];this.Xk=b[9];this.yd=b[10];this.xd=b[11];this.Ug=wr;this.tb=b[12];d=b[13];"number"==typeof d&&(d=[this.bb,this.Ob,d]);this.bb=d[0];this.Ob=d[1];d=this.qd>>2;if((this.fd=b[14])&&this.fd.length<d){for(var e=this.fd,g=
0,h=Array(d),k=0;k<e.length-1;){for(var m=e[k++],p=e[k++];m--;)h[g]=p,g+=2;g==d&&(g=1)}this.fd=h}(d=b[15])&&(d&pr?d&=~pr:d=xr[d&65280]|xr[d&255]);this.Kg(d);this.ei=b[16];this.gb=b[17];this.Qc=b[18];this.Bb=b[19];this.Hf=b[20];this.Md=b[21];this.Yd=b[22];this.ph=b[23];this.qh=b[24];this.vd=b[25];this.fi=this.Ye=0;this.La==Vp&&(this.ki=b[26],this.Gg=b[27],this.dd=b[28],this.xc=b[29],this.Hg=b[30],this.$e=b[31])}f=yr[f]||yr[Ll];this.rh=a.H.T.sd/f.xg|0;this.jn=this.rh*f.Dg/100|0;this.uh=this.rh*f.wg|
0;this.mn=this.uh*f.Eg/100|0;this.wh=c[7]||0}}
0,h=Array(d),k=0;k<e.length-1;){for(var m=e[k++],p=e[k++];m--;)h[g]=p,g+=2;g==d&&(g=1)}this.fd=h}(d=b[15])&&(d&pr?d&=~pr:d=xr[d&65280]|xr[d&255]);this.Kg(d);this.ei=b[16];this.gb=b[17];this.Qc=b[18];this.Bb=b[19];this.Hf=b[20];this.Md=b[21];this.Yd=b[22];this.ph=b[23];this.qh=b[24];this.vd=b[25];this.fi=this.Ye=0;this.La==Vp&&(this.ki=b[26],this.Gg=b[27],this.dd=b[28],this.xc=b[29],this.Hg=b[30],this.$e=b[31])}f=yr[f]||yr[Ll];this.rh=a.H.T.sd/f.xg|0;this.mn=this.rh*f.Dg/100|0;this.uh=this.rh*f.wg|
0;this.on=this.uh*f.Eg/100|0;this.wh=c[7]||0}}
function zr(a){var b=[];if(void 0!==a.La){b[0]=a.rc;b[1]=a.Xc;b[2]=a.Ze;b[3]=a.fa;b[4]=a.ec|a.Fg<<8;b[5]=a.Wa;if(a.La>=Tp){var c=[];c[0]=a.Ke;c[1]=a.wd;c[2]=a.Cc;c[3]=a.Ig;c[4]=a.af;c[5]=a.Pf;c[6]=a.zd;c[7]=a.$d;c[8]=a.Wk;c[9]=a.Xk;c[10]=a.yd;c[11]=a.xd;c[12]=a.tb;c[13]=[a.bb,a.Ob,a.qd];var d;if(d=a.fd){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var k=d[h],m=h+2;m<d.length&&d[m]===k;)m+=2;f[e++]=m-h>>1;f[e++]=k;h=m}f.length<d.length&&(d=f)}c[14]=d;c[15]=a.tg|pr;
c[16]=a.ei;c[17]=a.gb;c[18]=a.Qc;c[19]=a.Bb;c[20]=a.Hf;c[21]=a.Md;c[22]=a.Yd;c[23]=a.ph;c[24]=a.qh;c[25]=a.vd;a.La==Vp&&(c[26]=a.ki,c[27]=a.Gg,c[28]=a.dd,c[29]=a.xc,c[30]=a.Hg,c[31]=a.$e);b[6]=c}b[7]=a.wh}return b}function Ar(a,b,c,d,e){if(d){var f,g="";for(f=0;f<e.length;f++){var h=d===a.Wa?Br(a,f):d[f];g&&(g+="\n");g+=b+"["+q(f,2)+"]: "+qa(e[f],18)+(f===c?"*":" ")+q(h,255<h?4:2);null!=h&&(g+=" ("+h+".)")}a.ba.P(g)}else a.ba.P(b+": "+q(c,2))}br.prototype.vj=function(a){return[this.fd,a-this.bb]};
br.prototype.fh=function(){return this.A};br.prototype.Kg=function(a){if(null!=a&&a!=this.tg){var b=a&Cr,c=Dr[b];c||b&mr&&(c=Dr[mr]);var b=a&Er,d=Dr[b];d||b&or&&(d=Dr[or]);this.A||(this.A=Array(6));this.A[0]=c;this.A[1]=d;this.tg=a}};
@ -575,32 +575,32 @@ function qs(a,b){if(a.ea.Yb){var c=!1,d=a.C;d&&(d!==a.A?d.Xc&8&&(c=!0):d.wd&32&&
a.M[d]=p,f++),c+=2,d++;a.ma=!0;f&&a.Ca&&a.L.drawImage(a.Ba,0,0,a.$a,a.eb,a.vc,a.zc,a.Qb,a.Rb);Ts(a)}}else if(a.Pb){var g=k,u,k=c,d=a.ya=0,f=a.Eb,e=16==f?65536:196608,h=16==f?1:2;b=Hs(a,h);for(var p=m=0,w=a.F,F=0,K=a.J,H=0;k<g;){u=Ac(a.ka,k);if(a.ma&&u===a.M[d])m+=f;else{a.M[d]=u;u=u>>8|(u&255)<<8;var I=e,T=16;m<w&&(w=m);for(var L=0;L<f;L++){var ua=(u&(I>>=h))>>(T-=h);Ss(a.Ha,m++,p,b[ua])}m>F&&(F=m);p<K&&(K=p);p>=H&&(H=p+1)}k+=2;d++;if(m>=a.F){m=0;p+=2;if(p>a.J)break;p==a.J&&(p=1,k=c+a.Pb)}}a.ma=!0;
w<a.F&&(a.Ca.putImageData(a.Ha,0,0,w,K,F-w,H-K),a.L.drawImage(a.Ba,0,0,a.F,a.J,0,0,a.Z,a.la))}else if(a.Pc){g=h;f=a.ya=0;e=Hs(a,8);h=a.C.fd;m=b=0;p=a.F;w=0;F=a.J;K=0;H=a.C.$d[4]&8?4:1;u=a.C.Cc[19]&15;for(I=a.Ma>a.F?a.Ma-a.F-u>>3:0;c<k;){d=h[c-g];L=4;u||(a.ma&&d===a.M[f]?(b+=L,L=0):a.M[f]=d,f++);if(L){b<p&&(p=b);for(T=0;T<L;T++)Ss(a.Ha,b++,m,e[d&255]),d>>=8;b>w&&(w=b);m<F&&(F=m);m>=K&&(K=m+1)}c+=H;if(b>=a.F){b=0;if(++m>a.J)break;c+=I}}u||(a.ma=!0);p<a.F&&(a.Ca.putImageData(a.Ha,0,0,p,F,w-p,K-F),a.L.drawImage(a.Ba,
0,0,a.F,a.J,0,0,a.Z,a.la))}else{g=h;d=a.ya=0;f=Hs(a);e=a.C.fd;b=h=0;m=a.F;p=0;w=a.J;F=0;K=a.C.Cc[19]&15;for(H=a.Ma>a.F?a.Ma-a.F-K>>3:0;c<k;){u=c++-g;u=e[u];T=8;K?h?(I=a.F-h,T>I&&(T=I)):(u<<=K,T-=K,a.ma=!1):(a.ma&&u===a.M[d]?(h+=T,T=0):a.M[d]=u,d++);if(T){h<m&&(m=h);for(I=0;I<T;I++)L=Pt[u&2155905152]||0,Ss(a.Ha,h++,b,f[L]),u<<=1;h>p&&(p=h);b<w&&(w=b);b>=F&&(F=b+1)}if(h>=a.F){h=0;if(++b>a.J)break;c+=H}}K||(a.ma=!0);m<a.F&&(a.Ca.putImageData(a.Ha,0,0,m,w,p-m,F-w),a.L.drawImage(a.Ba,0,0,a.F,a.J,0,0,a.Z,
a.la))}}}}function Ot(a,b){var c=0;a=vd(a.H)-b.wh;0>a&&(b.wh=a,a=-a|0);a%b.rh>b.jn&&(c|=1);a%b.uh>b.mn&&(c|=9);b.fi=a/b.uh|0;return c}l.Cm=function(a,b){return Qt(this,this.Y,a,b)};l.co=function(a,b,c){var d=this.Y;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.Bm=function(a,b){return Rt(this,this.Y,a,b)};l.bo=function(a,b,c){St(this,this.Y,a,b,c)};l.Dm=function(a,b){return Tt(this,this.Y,b)};l.eo=function(a,b,c){a=this.Y;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};
a.la))}}}}function Ot(a,b){var c=0;a=vd(a.H)-b.wh;0>a&&(b.wh=a,a=-a|0);a%b.rh>b.mn&&(c|=1);a%b.uh>b.on&&(c|=9);b.fi=a/b.uh|0;return c}l.Cm=function(a,b){return Qt(this,this.Y,a,b)};l.fo=function(a,b,c){var d=this.Y;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.Bm=function(a,b){return Rt(this,this.Y,a,b)};l.eo=function(a,b,c){St(this,this.Y,a,b,c)};l.Dm=function(a,b){return Tt(this,this.Y,b)};l.ho=function(a,b,c){a=this.Y;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};
l.Em=function(a,b){return Ut(this,this.Y,b)};l.Mk=function(a,b,c){this.A.Pf=this.A.Pf&-4|b&3;v(this,a,b,c,"FEAT")};l.am=function(a,b){a=this.A.wd;b&&!t(this)||v(this,960,null,b,"ATC.INDX",a);return a};l.rl=function(a,b){a=this.A.Cc[this.A.wd&31];b&&!t(this)||v(this,960,null,b,"ATC."+this.A.Tg[this.A.wd&31],a);return a};
l.Lk=function(a,b,c){var d=this.A,e=d.wd&32;if(d.Ke){d.Ke=!1;var f=d.wd&31;if(16<=f||!e)if(Vt||d.Cc[f]!==b)c&&!t(this)||v(this,a,b,c,"ATC."+d.Tg[f]),d.Cc[f]=b,Lt(this,!1)}else d.wd=b,v(this,a,b,c,"ATC.INDX"),d.Ke=!0,b&32&&!e&&xs(this,!0)&&qs(this,!0),a=(d.Wa[12]<<8)+d.Wa[13]|0,d.vd!=a&&(d.vd=a,Lt(this)),d.Ye=0};
l.Om=function(a,b){a=0;if(this.La==Tp)a=3-((this.A.af&12)>>2),a=(this.xb&1<<a)<<4-a;else{var c=this.A.$e[0];45!=(c&63)&&2880!=(c&4032)&&184320!=(c&258048)&&(a|=16)}a|=this.A.Ig&-17;this.A.Ig=a;v(this,962,null,b,"STATUS0",a);return a};l.fo=function(a,b,c){this.A.af=b;ws(this);v(this,962,b,c,"MISC")};l.Pm=function(a,b){a=this.A.ki;v(this,963,null,b,"VGA_ENABLE",a);return a};l.oo=function(a,b,c){this.A.ki=b;v(this,963,b,c,"VGA_ENABLE")};
l.Mm=function(a,b){a=this.A.zd;v(this,964,null,b,"SEQ.INDX",a);return a};l.mo=function(a,b,c){this.A.zd=b;v(this,964,b,c,"SEQ.INDX")};l.Lm=function(a,b){a=this.A.$d[this.A.zd];b&&!t(this)||v(this,965,null,b,"SEQ."+this.A.Vg[this.A.zd],a);return a};l.lo=function(a,b,c){if(Vt||this.A.$d[this.A.zd]!==b)c&&!t(this)||v(this,965,b,c,"SEQ."+this.A.Vg[this.A.zd]),this.A.$d[this.A.zd]=b;switch(this.A.zd){case 2:this.A.gb=Yr[b&15];break;case 4:Ys(this,Xs(this))&&qs(this,!0)}};
l.nm=function(a,b){a=this.A.Gg;b&&!t(this)||v(this,966,null,b,"DAC.MASK",a);return a};l.Mn=function(a,b,c){if(Vt||this.A.Gg!==b)c&&!t(this)||v(this,966,b,c,"DAC.MASK"),this.A.Gg=b};l.om=function(a,b){a=this.A.Hg;b&&!t(this)||v(this,967,null,b,"DAC.STATE",a);return a};l.Nn=function(a,b,c){c&&!t(this)||v(this,967,b,c,"DAC.READ");this.A.dd=b;this.A.Hg=3;this.A.xc=0};l.On=function(a,b,c){c&&!t(this)||v(this,968,b,c,"DAC.WRITE");this.A.dd=b;this.A.Hg=sr;this.A.xc=0};
l.mm=function(a,b){a=this.A.$e[this.A.dd]>>this.A.xc&63;b&&!t(this)||v(this,969,null,b,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]",a);this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1);return a};l.Ln=function(a,b,c){a=this.A.$e[this.A.dd];c&&!t(this)||v(this,969,b,c,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]");b=a&~(63<<this.A.xc)|(b&63)<<this.A.xc;a!==b&&(this.A.$e[this.A.dd]=b,Lt(this,!1));this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1)};
l.Qm=function(a,b){a=this.A.Pf;v(this,970,null,b,"FEAT",a);return a};l.Yn=function(a,b,c){this.A.Xk=b;v(this,970,b,c,"GRC2")};l.Rm=function(a,b){a=this.A.af;v(this,972,null,b,"MISC",a);return a};l.Xn=function(a,b,c){this.A.Wk=b;v(this,972,b,c,"GRC1")};l.vm=function(a,b){a=this.A.yd;v(this,974,null,b,"GRC.INDX",a);return a};l.Wn=function(a,b,c){this.A.yd=b;v(this,974,b,c,"GRC.INDX")};l.um=function(a,b){a=this.A.xd[this.A.yd];b&&!t(this)||v(this,975,null,b,"GRC."+this.A.Ug[this.A.yd],a);return a};
l.Vn=function(a,b,c){if(Vt||this.A.xd[this.A.yd]!==b)c&&!t(this)||v(this,975,b,c,"GRC."+this.A.Ug[this.A.yd]),this.A.xd[this.A.yd]=b;switch(this.A.yd){case 0:this.A.Hf=Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 1:this.A.Md=~Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 2:this.A.ph=Yr[b&15]&-2139062144;break;case 3:case 5:Ys(this,Xs(this));break;case 4:this.A.ei=(b&3)<<3;break;case 6:Fs(this,!1);break;case 7:this.A.qh=Yr[b&15]&-2139062144;break;case 8:this.A.Bb=b|b<<8|b<<16|b<<24}};
l.gm=function(a,b){return Qt(this,this.K,a,b)};l.Gn=function(a,b,c){var d=this.K;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.fm=function(a,b){return Rt(this,this.K,a,b)};l.Fn=function(a,b,c){St(this,this.K,a,b,c)};l.hm=function(a,b){return Tt(this,this.K,b)};l.Hn=function(a,b,c){a=this.K;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};l.em=function(a,b){var c=this.K.Ze;b&&!t(this)||v(this,a,null,b,this.K.type+".COLOR",c);return c};
l.En=function(a,b,c){c&&!t(this)||v(this,a,b,c,this.K.type+".COLOR");this.K.Ze!==b&&(this.K.Ze=b,Lt(this,!1))};l.im=function(a,b){return Ut(this,this.K,b)};function Qt(a,b,c,d){var e;b.rc&&(e=b.ec);v(a,c,null,d,"CRTC.INDX",e);return e}function Rt(a,b,c,d){var e;b.rc&&b.ec<b.oh&&(e=b.Wa[b.ec]);d&&!t(a)||v(a,c,null,d,"CRTC."+b.gg[b.ec],e);return e}
l.Om=function(a,b){a=0;if(this.La==Tp)a=3-((this.A.af&12)>>2),a=(this.xb&1<<a)<<4-a;else{var c=this.A.$e[0];45!=(c&63)&&2880!=(c&4032)&&184320!=(c&258048)&&(a|=16)}a|=this.A.Ig&-17;this.A.Ig=a;v(this,962,null,b,"STATUS0",a);return a};l.io=function(a,b,c){this.A.af=b;ws(this);v(this,962,b,c,"MISC")};l.Pm=function(a,b){a=this.A.ki;v(this,963,null,b,"VGA_ENABLE",a);return a};l.qo=function(a,b,c){this.A.ki=b;v(this,963,b,c,"VGA_ENABLE")};
l.Mm=function(a,b){a=this.A.zd;v(this,964,null,b,"SEQ.INDX",a);return a};l.oo=function(a,b,c){this.A.zd=b;v(this,964,b,c,"SEQ.INDX")};l.Lm=function(a,b){a=this.A.$d[this.A.zd];b&&!t(this)||v(this,965,null,b,"SEQ."+this.A.Vg[this.A.zd],a);return a};l.no=function(a,b,c){if(Vt||this.A.$d[this.A.zd]!==b)c&&!t(this)||v(this,965,b,c,"SEQ."+this.A.Vg[this.A.zd]),this.A.$d[this.A.zd]=b;switch(this.A.zd){case 2:this.A.gb=Yr[b&15];break;case 4:Ys(this,Xs(this))&&qs(this,!0)}};
l.nm=function(a,b){a=this.A.Gg;b&&!t(this)||v(this,966,null,b,"DAC.MASK",a);return a};l.On=function(a,b,c){if(Vt||this.A.Gg!==b)c&&!t(this)||v(this,966,b,c,"DAC.MASK"),this.A.Gg=b};l.om=function(a,b){a=this.A.Hg;b&&!t(this)||v(this,967,null,b,"DAC.STATE",a);return a};l.Pn=function(a,b,c){c&&!t(this)||v(this,967,b,c,"DAC.READ");this.A.dd=b;this.A.Hg=3;this.A.xc=0};l.Qn=function(a,b,c){c&&!t(this)||v(this,968,b,c,"DAC.WRITE");this.A.dd=b;this.A.Hg=sr;this.A.xc=0};
l.mm=function(a,b){a=this.A.$e[this.A.dd]>>this.A.xc&63;b&&!t(this)||v(this,969,null,b,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]",a);this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1);return a};l.Nn=function(a,b,c){a=this.A.$e[this.A.dd];c&&!t(this)||v(this,969,b,c,"DAC.DATA["+r(this.A.dd)+"]["+r(this.A.xc)+"]");b=a&~(63<<this.A.xc)|(b&63)<<this.A.xc;a!==b&&(this.A.$e[this.A.dd]=b,Lt(this,!1));this.A.xc+=6;12<this.A.xc&&(this.A.xc=0,this.A.dd=this.A.dd+1&tr-1)};
l.Qm=function(a,b){a=this.A.Pf;v(this,970,null,b,"FEAT",a);return a};l.$n=function(a,b,c){this.A.Xk=b;v(this,970,b,c,"GRC2")};l.Rm=function(a,b){a=this.A.af;v(this,972,null,b,"MISC",a);return a};l.Zn=function(a,b,c){this.A.Wk=b;v(this,972,b,c,"GRC1")};l.vm=function(a,b){a=this.A.yd;v(this,974,null,b,"GRC.INDX",a);return a};l.Yn=function(a,b,c){this.A.yd=b;v(this,974,b,c,"GRC.INDX")};l.um=function(a,b){a=this.A.xd[this.A.yd];b&&!t(this)||v(this,975,null,b,"GRC."+this.A.Ug[this.A.yd],a);return a};
l.Xn=function(a,b,c){if(Vt||this.A.xd[this.A.yd]!==b)c&&!t(this)||v(this,975,b,c,"GRC."+this.A.Ug[this.A.yd]),this.A.xd[this.A.yd]=b;switch(this.A.yd){case 0:this.A.Hf=Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 1:this.A.Md=~Yr[b&15];this.A.Yd=this.A.Hf&~this.A.Md;break;case 2:this.A.ph=Yr[b&15]&-2139062144;break;case 3:case 5:Ys(this,Xs(this));break;case 4:this.A.ei=(b&3)<<3;break;case 6:Fs(this,!1);break;case 7:this.A.qh=Yr[b&15]&-2139062144;break;case 8:this.A.Bb=b|b<<8|b<<16|b<<24}};
l.gm=function(a,b){return Qt(this,this.K,a,b)};l.In=function(a,b,c){var d=this.K;d.Fg=d.ec;d.ec=b&31;v(this,a,b,c,"CRTC.INDX")};l.fm=function(a,b){return Rt(this,this.K,a,b)};l.Hn=function(a,b,c){St(this,this.K,a,b,c)};l.hm=function(a,b){return Tt(this,this.K,b)};l.Jn=function(a,b,c){a=this.K;v(this,a.port+4,b,c,"MODE");a.Xc=b;Fs(this,!1)};l.em=function(a,b){var c=this.K.Ze;b&&!t(this)||v(this,a,null,b,this.K.type+".COLOR",c);return c};
l.Gn=function(a,b,c){c&&!t(this)||v(this,a,b,c,this.K.type+".COLOR");this.K.Ze!==b&&(this.K.Ze=b,Lt(this,!1))};l.im=function(a,b){return Ut(this,this.K,b)};function Qt(a,b,c,d){var e;b.rc&&(e=b.ec);v(a,c,null,d,"CRTC.INDX",e);return e}function Rt(a,b,c,d){var e;b.rc&&b.ec<b.oh&&(e=b.Wa[b.ec]);d&&!t(a)||v(a,c,null,d,"CRTC."+b.gg[b.ec],e);return e}
function St(a,b,c,d,e){if(b.ec<b.oh){if(Vt||b.Wa[b.ec]!==d)e&&!t(a)||v(a,c,d,e,"CRTC."+b.gg[b.ec]),b.Wa[b.ec]=d;if(12==b.ec||13==b.ec)Ot(a,b)&1?(c=(b.Wa[12]<<8)+b.Wa[13]|0,b.vd!==c&&(b.vd=c,Lt(a))):b.Ye||(b.Ye=b.fi);(9==b.ec&&8!=b.Fg||b.ec==Nr&&223==d)&&Fs(a,!0);Gs(a)}}function Tt(a,b,c){var d=b.Xc;v(a,b.port+4,null,c,"MODE",d);return d}function Ut(a,b,c){var d=Ot(a,b);b===a.A?(d|=b.fa&48^48,b.Ke=!1):d=(b.fa^=9)|240;b.fa=d;v(a,b.port+6,null,c,b===a.A?"STATUS1":"STATUS",d);return d}
var Vt=!0,Jt=1,bt=2,ts=3,kt=5,jt=6,vs=7,ft=13,gt=14,$s=15,at=16,ht=17,it=18,ct=19,dt=20,et=21,Zs=255,Os=1,Ns=3,gs=Os,ds=Ns,Tp=5,Vp=7,Zr={mda:[gs,vs],cga:[ds,ts],ega:[Tp,ts],vga:[Vp,ts]},yr={2:{xg:15700,wg:208,Dg:85,Eg:96}};yr[Ll]={xg:18432,wg:364,Dg:85,Eg:96};yr[4]={xg:21850,wg:364,Dg:85,Eg:96};yr[7]={xg:16700,wg:480,Dg:85,Eg:83};var us={6:[1,Ll,!0],7:[2,Ll,!0],8:[6,Ll,!0],9:[4,Ll,!0],10:[Ll,1,!0],11:[Ll,2,!0],0:[1,Ll,!1],1:[2,Ll,!1],2:[6,Ll,!1],3:[4,Ll,!1],4:[Ll,1,!1],5:[Ll,2,!1]},$r=[];
$r[Jt]=[40,25,1,0,Ns];$r[ts]=[80,25,1,0,Ns];$r[4]=[320,200,8,192];$r[jt]=[640,200,16,192];$r[vs]=[80,25,1,0,Os];$r[ft]=[320,200,8];$r[gt]=[640,200,8];$r[$s]=[640,350,8];$r[at]=[640,350,8];$r[ht]=[640,480,8];$r[it]=[640,480,8];$r[ct]=[320,200,1];$r[dt]=[320,240,4];$r[et]=[320,400,4];$r[0]=$r[Jt];$r[bt]=$r[ts];$r[kt]=$r[4];
var Cs=0,As=7,Es=8,Bs=0,Ds=112,zs=128,Nt=256,Vs=512,Ps=[[0,0,0,255],[127,192,127,255],[127,192,127,255],[127,255,127,255],[127,255,127,255]],Qs=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],Is=[[0,0,0,255],[0,0,170,255],[0,170,0,255],[0,170,170,255],[170,0,0,255],[170,0,170,255],[170,85,0,255],[170,170,170,255],[85,85,85,255],[85,85,255,255],[85,255,85,255],[85,255,255,255],[255,85,85,255],[255,85,255,255],[255,255,85,255],[255,255,255,255]],Ks=[2,4,6],Js=[3,5,As],Ls=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],
Yr=[0,255,65280,65535,16711680,16711935,16776960,16777215,-16777216,-16776961,-16711936,-16711681,-65536,-65281,-256,-1],Pt=[0];Pt[128]=1;Pt[32768]=2;Pt[32896]=3;Pt[8388608]=4;Pt[8388736]=5;Pt[8421376]=6;Pt[8421504]=7;Pt[-2147483648]=8;Pt[-2147483520]=9;Pt[-2147450880]=10;Pt[-2147450752]=11;Pt[-2139095040]=12;Pt[-2139094912]=13;Pt[-2139062272]=14;Pt[-2139062144]=15;var cr=[];cr[gs]=["MDA",948,720896,4096,0,Ll];cr[ds]=["CGA",980,753664,16384,0,2];cr[Tp]=["EGA",980,753664,16384,65536,4];
cr[Vp]=["VGA",980,753664,16384,262144,7];
var as=0,ps=1,os=2,es={948:Q.prototype.Cm,949:Q.prototype.Bm,952:Q.prototype.Dm,954:Q.prototype.Em},fs={948:Q.prototype.co,949:Q.prototype.bo,952:Q.prototype.eo},hs={980:Q.prototype.gm,981:Q.prototype.fm,984:Q.prototype.hm,985:Q.prototype.em,986:Q.prototype.im},is={980:Q.prototype.Gn,981:Q.prototype.Fn,984:Q.prototype.Hn,985:Q.prototype.En},js={960:Q.prototype.am,961:Q.prototype.rl,962:Q.prototype.Om,964:Q.prototype.Mm,965:Q.prototype.Lm,974:Q.prototype.vm,975:Q.prototype.um},ks={954:Q.prototype.Mk,
960:Q.prototype.Lk,961:Q.prototype.Lk,962:Q.prototype.fo,964:Q.prototype.mo,965:Q.prototype.lo,970:Q.prototype.Yn,972:Q.prototype.Xn,974:Q.prototype.Wn,975:Q.prototype.Vn,986:Q.prototype.Mk},ls={963:Q.prototype.Pm,966:Q.prototype.nm,967:Q.prototype.om,969:Q.prototype.mm,970:Q.prototype.Qm,972:Q.prototype.Rm},ms={963:Q.prototype.oo,966:Q.prototype.Mn,967:Q.prototype.Nn,968:Q.prototype.On,969:Q.prototype.Ln};
var as=0,ps=1,os=2,es={948:Q.prototype.Cm,949:Q.prototype.Bm,952:Q.prototype.Dm,954:Q.prototype.Em},fs={948:Q.prototype.fo,949:Q.prototype.eo,952:Q.prototype.ho},hs={980:Q.prototype.gm,981:Q.prototype.fm,984:Q.prototype.hm,985:Q.prototype.em,986:Q.prototype.im},is={980:Q.prototype.In,981:Q.prototype.Hn,984:Q.prototype.Jn,985:Q.prototype.Gn},js={960:Q.prototype.am,961:Q.prototype.rl,962:Q.prototype.Om,964:Q.prototype.Mm,965:Q.prototype.Lm,974:Q.prototype.vm,975:Q.prototype.um},ks={954:Q.prototype.Mk,
960:Q.prototype.Lk,961:Q.prototype.Lk,962:Q.prototype.io,964:Q.prototype.oo,965:Q.prototype.no,970:Q.prototype.$n,972:Q.prototype.Zn,974:Q.prototype.Yn,975:Q.prototype.Xn,986:Q.prototype.Mk},ls={963:Q.prototype.Pm,966:Q.prototype.nm,967:Q.prototype.om,969:Q.prototype.mm,970:Q.prototype.Qm,972:Q.prototype.Rm},ms={963:Q.prototype.qo,966:Q.prototype.On,967:Q.prototype.Pn,968:Q.prototype.Qn,969:Q.prototype.Nn};
Ra(function(){for(var a=pb(document,"pcx86","video"),b=0;b<a.length;b++){var c=a[b],d=mb(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=Ea().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||Ka("aspect"));f&&.3<=f&&3.33>=f&&(Pa("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");Ja("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"),f.style.fontSize="16px");c.appendChild(f);var g=e.getContext("2d"),d=new Q(d,e,g,f,c);ob(d,c)}});
function Wt(a){ab.call(this,"ParallelPort",a,4194304);this.G=a.adapter;switch(this.G){case 1:this.D=956;this.C=7;break;case 2:this.D=888;this.C=7;break;case 3:this.D=632;this.C=5;break;default:Wa("Unrecognized parallel adapter #"+this.G);return}this.A=this.B=null;a=a.binding;"console"==a?this.B="":nb(this,a,Xt)}ba(Wt,ab);l=Wt.prototype;l.Cb=function(a,b,c){switch(b){case Xt:return this.na[b]=this.A=c,!0}return!1};
l.uc=function(a,b,c,d){this.ka=b;this.H=c;this.ba=d;this.W=Ob(a,"ChipSet");Ec(b,this,Yt,this.D);Ic(b,this,Zt,this.D);zb(this)};l.Xb=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Wb=function(a){return a?this.save():!0};l.reset=function(){$t(this)};l.save=function(){var a=new Of(this),b=0,c=[];c[b++]=this.F;c[b++]=this.Mb;c[b]=this.mf;a.set(0,c);return a.data()};l.restore=function(a){return $t(this,a[0])};
function $t(a,b){var c=0;b||(b=[0,0,0]);a.F=b[c++];a.Mb=b[c++];a.mf=b[c];return!0}l.pm=function(a,b){var c=this.F;v(this,a,null,b,"DATA",c);return c};l.Nm=function(a,b){var c=this.Mb;v(this,a,null,b,"STAT",c);return c};l.lm=function(a,b){var c=this.mf;v(this,a,null,b,"CTRL",c);return c};
l.Pn=function(a,b,c){v(this,a,b,c,"DATA");this.F=b;this.Mb|=au;a=!1;Cb(this,"transmitByte("+r(b)+")");this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.P(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.Mb&=~au);bu(this)};l.Kn=function(a,b,c){v(this,a,b,c,"CTRL");this.mf=b;bu(this)};
function bu(a){a.W&&a.C&&(a.mf&cu&&!(a.Mb&au)?Zg(a.W,a.C):Lg(a.W,a.C))}var Xt="buffer",au=64,cu=16,Yt={0:Wt.prototype.pm,1:Wt.prototype.Nm,2:Wt.prototype.lm},Zt={0:Wt.prototype.Pn,2:Wt.prototype.Kn};Ra(function(){for(var a=pb(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new Wt(d);ob(d,c)}});
l.Rn=function(a,b,c){v(this,a,b,c,"DATA");this.F=b;this.Mb|=au;a=!1;Cb(this,"transmitByte("+r(b)+")");this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.P(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.Mb&=~au);bu(this)};l.Mn=function(a,b,c){v(this,a,b,c,"CTRL");this.mf=b;bu(this)};
function bu(a){a.W&&a.C&&(a.mf&cu&&!(a.Mb&au)?Zg(a.W,a.C):Lg(a.W,a.C))}var Xt="buffer",au=64,cu=16,Yt={0:Wt.prototype.pm,1:Wt.prototype.Nm,2:Wt.prototype.lm},Zt={0:Wt.prototype.Rn,2:Wt.prototype.Mn};Ra(function(){for(var a=pb(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new Wt(d);ob(d,c)}});
function du(a){ab.call(this,"SerialPort",a,8388608);this.ha=a.adapter;switch(this.ha){case 1:this.da=1016;this.M=4;break;case 2:this.da=760;this.M=3;break;default:Wa("Unrecognized serial adapter #"+this.ha);return}this.F=this.I=null;this.oa=a.tabSize;this.ma=a.charBOL;this.K=0;this.qa=eu|fu;this.O=!0;a=a.binding;"console"==a?this.I="":nb(this,a,gu);this.D=this.aa=this.Y=null;this.exports={connect:this.zj,receiveData:this.Of,receiveStatus:this.ql}}ba(du,ab);l=du.prototype;
l.Vi=function(a,b,c){var d=null;a!=this.be||this.D||(this.D=b,this.Y=c,this.O=!1,d=this);return d};l.Cb=function(a,b,c){var d=this;switch(b){case gu:return this.na[b]=this.F=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<b&&(b-=64),d.Of(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Of(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.H=c;this.ba=d;this.W=Ob(a,"ChipSet");Ec(b,this,hu,this.da);Ic(b,this,iu,this.da);zb(this)};
@ -609,10 +609,10 @@ l.Xb=function(a,b){if(!b)if(this.zj(this.O),!a||!this.restore)this.reset();else
function ju(a,b){var c=0;b||(b=[0,0,ku,0,lu,0,0,mu|nu,a.qa,[]]);a.ga=b[c++];a.la=b[c++];a.L=b[c++];a.N=b[c++];a.G=b[c++];a.C=b[c++];a.Z=b[c++];a.B=b[c++];a.A=b[c++];a.J=b[c];return!0}l.Of=function(a){if("number"==typeof a)this.J.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.J.push(a.charCodeAt(b));else this.J=this.J.concat(a);ou(this);return!0};l.ql=function(a){var b=this.A;this.A&=~(eu|fu);a&32&&(this.A=this.A|eu|pu);a&64&&(this.A=this.A|fu|qu);b!=this.A&&ru(this)};
function ou(a){0<a.J.length&&!(a.B&su)&&(a.ga=a.J.shift(),a.B|=su);ru(a)}l.Km=function(a,b){var c=this.C&tu?this.L&255:this.ga;v(this,a,null,b,this.C&tu?"DLL":"RBR",c);this.B&=~su;ou(this);return c};l.wm=function(a,b){var c=this.C&tu?this.L>>8:this.N;v(this,a,null,b,this.C&tu?"DLM":"IER",c);return c};l.xm=function(a,b){var c=this.G;v(this,a,null,b,"IIR",c);return c};l.ym=function(a,b){var c=this.C;v(this,a,null,b,"LCR",c);return c};l.Am=function(a,b){var c=this.Z;v(this,a,null,b,"MCR",c);return c};
l.zm=function(a,b){var c=this.B;v(this,a,null,b,"LSR",c);return c};l.Fm=function(a,b){var c=this.A;this.A&=~(pu|qu);v(this,a,null,b,"MSR",c);return c};
l.no=function(a,b,c){v(this,a,b,c,this.C&tu?"DLL":"THR");if(this.C&tu)this.L=this.L&-256|b;else{this.la=b;this.B&=~(mu|nu);a=!1;Cb(this,"transmitByte("+r(b)+")");this.aa&&this.aa.call(this.D,b)&&(a=!0);if(this.F){if(13==b)this.K=0;else if(8==b)this.F.value=this.F.value.slice(0,-1),0<this.K&&this.K--;else{var d;13!=b&&10!=b&&(d=sa[b]);d=d?"<"+d+">":String.fromCharCode(b);a=d.length;32>b&&1==a&&(a=0);9==b&&(b=this.oa||8,a=b-this.K%b,this.oa&&(d=qa("",a)));this.ma&&!this.K&&a&&(d=String.fromCharCode(this.ma)+
d);this.F.value+=d;this.F.scrollTop=this.F.scrollHeight;this.K+=a}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.P(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|mu|nu)}};l.Zn=function(a,b,c){v(this,a,b,c,this.C&tu?"DLM":"IER");this.C&tu?this.L=this.L&255|b<<8:this.N=b};l.$n=function(a,b,c){v(this,a,b,c,"LCR");this.C=b};
l.ao=function(a,b,c){var d=b^this.Z;v(this,a,b,c,"MCR");this.Z=b;d&(uu|vu)&&this.Y&&(a=0,this.O?(a|=b&vu?32:0,a|=b&uu?320:0):(a|=b&vu?16:0,a|=b&uu?1048576:0),this.Y.call(this.D,a))};function ru(a){var b=-1;a.B&su&&a.N&wu?b=xu:a.A&(pu|qu)&&a.N&yu&&(b=zu);0<=b?(a.G&=~(lu|Au),a.G|=b,a.W&&a.M&&Zg(a.W,a.M,100)):(a.G|=lu,a.W&&a.M&&Lg(a.W,a.M))}
var gu="buffer",ku=384,wu=1,yu=8,lu=1,xu=4,zu=0,Au=6,tu=128,uu=1,vu=2,su=1,mu=32,nu=64,pu=1,qu=2,eu=16,fu=32,hu={0:du.prototype.Km,1:du.prototype.wm,2:du.prototype.xm,3:du.prototype.ym,4:du.prototype.Am,5:du.prototype.zm,6:du.prototype.Fm},iu={0:du.prototype.no,1:du.prototype.Zn,3:du.prototype.$n,4:du.prototype.ao};Ra(function(){for(var a=pb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new du(d);ob(d,c)}});
l.po=function(a,b,c){v(this,a,b,c,this.C&tu?"DLL":"THR");if(this.C&tu)this.L=this.L&-256|b;else{this.la=b;this.B&=~(mu|nu);a=!1;Cb(this,"transmitByte("+r(b)+")");this.aa&&this.aa.call(this.D,b)&&(a=!0);if(this.F){if(13==b)this.K=0;else if(8==b)this.F.value=this.F.value.slice(0,-1),0<this.K&&this.K--;else{var d;13!=b&&10!=b&&(d=sa[b]);d=d?"<"+d+">":String.fromCharCode(b);a=d.length;32>b&&1==a&&(a=0);9==b&&(b=this.oa||8,a=b-this.K%b,this.oa&&(d=qa("",a)));this.ma&&!this.K&&a&&(d=String.fromCharCode(this.ma)+
d);this.F.value+=d;this.F.scrollTop=this.F.scrollHeight;this.K+=a}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.P(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|mu|nu)}};l.ao=function(a,b,c){v(this,a,b,c,this.C&tu?"DLM":"IER");this.C&tu?this.L=this.L&255|b<<8:this.N=b};l.bo=function(a,b,c){v(this,a,b,c,"LCR");this.C=b};
l.co=function(a,b,c){var d=b^this.Z;v(this,a,b,c,"MCR");this.Z=b;d&(uu|vu)&&this.Y&&(a=0,this.O?(a|=b&vu?32:0,a|=b&uu?320:0):(a|=b&vu?16:0,a|=b&uu?1048576:0),this.Y.call(this.D,a))};function ru(a){var b=-1;a.B&su&&a.N&wu?b=xu:a.A&(pu|qu)&&a.N&yu&&(b=zu);0<=b?(a.G&=~(lu|Au),a.G|=b,a.W&&a.M&&Zg(a.W,a.M,100)):(a.G|=lu,a.W&&a.M&&Lg(a.W,a.M))}
var gu="buffer",ku=384,wu=1,yu=8,lu=1,xu=4,zu=0,Au=6,tu=128,uu=1,vu=2,su=1,mu=32,nu=64,pu=1,qu=2,eu=16,fu=32,hu={0:du.prototype.Km,1:du.prototype.wm,2:du.prototype.xm,3:du.prototype.ym,4:du.prototype.Am,5:du.prototype.zm,6:du.prototype.Fm},iu={0:du.prototype.po,1:du.prototype.ao,3:du.prototype.bo,4:du.prototype.co};Ra(function(){for(var a=pb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new du(d);ob(d,c)}});
function Bu(a){ab.call(this,"Mouse",a,16777216);if(this.O=a.serial)this.W="SerialPort";this.N=this.M=this.rc=!1;this.C=[];this.B=[];zb(this)}ba(Bu,ab);l=Bu.prototype;l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.H=c;this.ba=d;for(b=null;b=Ob(a,"Video",b);)this.C.push(b)};
l.Xb=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.W&&!this.D){for(a=null;(a=Ob(this.pa,this.W,a))&&(!a.Vi||!(this.D=a.Vi(this.O,this,this.pl))););if(this.D)for(this.B=[],a=0;a<this.C.length;a++)b=this.C[a],b.G=this,(b=b.D)&&this.B.push(b);else Wa(this.id+": "+this.W+" "+this.O+" unavailable")}this.rc?Cu(this):Du(this)}return!0};l.Wb=function(a){return a?this.save():!0};l.reset=function(){Eu(this)};
l.save=function(){var a=new Of(this),b=0,c=[];c[b++]=this.rc;c[b++]=this.F;c[b++]=this.G;c[b++]=this.I;c[b++]=this.J;c[b++]=this.K;c[b++]=this.L;c[b]=this.A;a.set(0,c);return a.data()};l.restore=function(a){return Eu(this,a[0])};function Eu(a,b){var c=0;b||(b=[!1,-1,-1,0,0,!1,!1,0]);var d=b[c++];a.rc=d;a.F=b[c++];a.G=b[c++];a.I=b[c++];a.J=b[c++];a.K=b[c++];a.L=b[c++];a.A=b[c];a.A&(uu|vu)&&(a.A=(a.A&uu?1048576:0)|(a.A&vu?16:0));return!0}l.If=function(a){this.M=a};
@ -630,11 +630,11 @@ b;ua++,e+=4)var ca=L[ua]=a.getInt32(e,!0),d=d+ca&-1;T.Lc=b;H[I]=T}g.L=d;b=g}else
function Su(a,b,c,d){var e=null;a.Re=!1;var f=!(!(0>d&&a.pa)||a.pa.ea.Yb);if(a.og)d?a.controller.Fa('Unable to connect to disk "'+a.I+'" (error '+d+": "+c+")",f):(a.D=!0,Tu(a),e=a);else if(d)a.controller.Fa('Unable to load disk "'+a.F+'" (error '+d+": "+b+")",f);else{eb(a.controller.xe,b,c);try{if(0<la(a.Jg,!0).toLowerCase().indexOf("-readonly"))a.Re=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.Re=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+
a.F]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+c+")");if(h.length)if(1==h.length)Wa(h[0]);else{a.ob=h.length;a.ib=h[0].length;a.Ya=h[0][0].length;var k=h[0][0][0];a.Na=k&&k.length||512;for(d=c=0;d<a.ob;d++)for(f=0;f<a.ib;f++)for(g=0;g<a.Ya;g++)if(k=h[d][f][g]){var m=k.length;void 0===m&&(m=k.length=512);var m=m>>2,p=k.pattern;void 0===p&&(p=k.pattern=0);var w=k.data;if(void 0===w){var u=k.bytes;if(void 0!==u&&u.length){for(var F=
m<<2,K=u.length;K<F;K++)u[K]=p;Uu(k,u,0)}else w=[],p=k.pattern=p|p<<8|p<<16|p<<24,k.data=w;delete k.bytes}Qu(k,d,f);for(F=0;F<w.length;F++)c=c+w[F]&-1}a.A=h;a.L=c;Tu(a);e=a}else Wa("Empty disk image: "+a.F)}catch(H){Wa("Disk image error ("+b+"): "+H.message)}}a.K&&(a.K.call(a.W,a.B,e,a.F,a.I),a.K=null)}
function Tu(a){var b,c,d={},e;if(a.C&&a.C.length)for(b=a.A,c=0;c<b.length;c++)for(var f=0;f<b[c].length;f++)for(e=0;e<b[c][f].length;e++){var g=b[c][f][e];g&&(delete g.file,delete g.pn)}a.C=[];d.Kf=d.sf=0;b=a.ob*a.ib*a.Ya*a.Na;a.D&&a.log("ignore any synchronous XMLHttpRequest warnings here (for now)");if(e=Vu(a,0)){d.Na=Wu(a,e,11,2);if(d.Na!=a.Na){f=!1;d.rf=1;d.vg=12;d.lh=d.rf+2;d.vf=1;d.Na=a.Na;if(163840==b&&254==Xu(a,d,0,0))d.sf=320,d.vh=64,f=!0;else if(327680==b&&255==Xu(a,d,0,0))d.sf=640,d.vh=
112,d.vf++,f=!0;else for(c=446,b=0;4>b;b++){if(128==Wu(a,e,c+0,1)){d.Kf=Wu(a,e,c+8,4);(e=Vu(a,d.Kf))&&(f=!0);break}c+=16}if(!f)return}d.sf||(d.sf=Wu(a,e,19,2)||Wu(a,e,32,4),d.rf=Wu(a,e,14,2),d.lh=d.rf+Wu(a,e,22,2)*Wu(a,e,16,1),d.vh=Wu(a,e,17,2),d.vf=Wu(a,e,13,1));d.jh=d.lh+((32*d.vh+(d.Na-1))/d.Na|0);d.hn=(d.sf-d.jh)/d.vf|0;d.vg=4084>=d.hn?12:16;d.Nl=12==d.vg?4086:65526;b=[];for(e=d.lh;e<d.jh;e++)b.push(d.Kf+e);Yu(a,d,a.Jg,"",b);for(b=0;b<a.C.length;b++){d=a.C[b];for(e=c=0;e<d.fe.length;e++){var f=
d.fe[e],g=c,h=a.ib*a.Ya,k=f%h,m=k/a.Ya|0,k=k%a.Ya,p=void 0,w=void 0,u=void 0;(p=a.A[f/h|0])&&(w=p[m])&&(u=w[k])&&!u.file&&(u.file=d,u.pn=g);c+=a.Na}e=d;if((na(e.$b,".EXE")||na(e.$b,".DLL")||na(e.$b,".DRV"))&&Zu(e,$u)==av&&Zu(e,bv)==cv&&(c=Zu(e,dv),Zu(e,ev,c)==fv)){m=Zu(e,gv,c);g=Zu(e,hv,c);h=Zu(e,iv,c);if(g&&m){d=e;f=g+c;g=m;h=h||0;m=1;d.nd=[];for(d.A=[];g--;){if(k=jv(d,f)<<h)p=jv(d,f+2)||65536,d.nd[m++]={gi:k,Ik:k+p-1,ee:[]};f+=8}d.nd[254]={gi:0,Ik:0,ee:[]}}g=Zu(e,kv,c);h=Zu(e,lv,c);if(g&&h)for(d=
function Tu(a){var b,c,d={},e;if(a.C&&a.C.length)for(b=a.A,c=0;c<b.length;c++)for(var f=0;f<b[c].length;f++)for(e=0;e<b[c][f].length;e++){var g=b[c][f][e];g&&(delete g.file,delete g.rn)}a.C=[];d.Kf=d.sf=0;b=a.ob*a.ib*a.Ya*a.Na;a.D&&a.log("ignore any synchronous XMLHttpRequest warnings here (for now)");if(e=Vu(a,0)){d.Na=Wu(a,e,11,2);if(d.Na!=a.Na){f=!1;d.rf=1;d.vg=12;d.lh=d.rf+2;d.vf=1;d.Na=a.Na;if(163840==b&&254==Xu(a,d,0,0))d.sf=320,d.vh=64,f=!0;else if(327680==b&&255==Xu(a,d,0,0))d.sf=640,d.vh=
112,d.vf++,f=!0;else for(c=446,b=0;4>b;b++){if(128==Wu(a,e,c+0,1)){d.Kf=Wu(a,e,c+8,4);(e=Vu(a,d.Kf))&&(f=!0);break}c+=16}if(!f)return}d.sf||(d.sf=Wu(a,e,19,2)||Wu(a,e,32,4),d.rf=Wu(a,e,14,2),d.lh=d.rf+Wu(a,e,22,2)*Wu(a,e,16,1),d.vh=Wu(a,e,17,2),d.vf=Wu(a,e,13,1));d.jh=d.lh+((32*d.vh+(d.Na-1))/d.Na|0);d.kn=(d.sf-d.jh)/d.vf|0;d.vg=4084>=d.kn?12:16;d.Nl=12==d.vg?4086:65526;b=[];for(e=d.lh;e<d.jh;e++)b.push(d.Kf+e);Yu(a,d,a.Jg,"",b);for(b=0;b<a.C.length;b++){d=a.C[b];for(e=c=0;e<d.fe.length;e++){var f=
d.fe[e],g=c,h=a.ib*a.Ya,k=f%h,m=k/a.Ya|0,k=k%a.Ya,p=void 0,w=void 0,u=void 0;(p=a.A[f/h|0])&&(w=p[m])&&(u=w[k])&&!u.file&&(u.file=d,u.rn=g);c+=a.Na}e=d;if((na(e.$b,".EXE")||na(e.$b,".DLL")||na(e.$b,".DRV"))&&Zu(e,$u)==av&&Zu(e,bv)==cv&&(c=Zu(e,dv),Zu(e,ev,c)==fv)){m=Zu(e,gv,c);g=Zu(e,hv,c);h=Zu(e,iv,c);if(g&&m){d=e;f=g+c;g=m;h=h||0;m=1;d.nd=[];for(d.A=[];g--;){if(k=jv(d,f)<<h)p=jv(d,f+2)||65536,d.nd[m++]={gi:k,Ik:k+p-1,ee:[]};f+=8}d.nd[254]={gi:0,Ik:0,ee:[]}}g=Zu(e,kv,c);h=Zu(e,lv,c);if(g&&h)for(d=
e,f=g+=c,g+=h,h=1;f<g;){k=jv(d,f);m=k&255;if(!m)break;k>>=8;f+=2;if(k)for(;m--;)jv(d,f,1),254>=k?(p=k,w=jv(d,f+1),f+=3):(p=jv(d,f+3,1),w=jv(d,f+4),f+=6),d.nd[p]&&(d.nd[p].ee[h]=[w]),d.A[h]=[p,w],h++;else h+=m}(g=Zu(e,mv,c))&&nv(e,g+c);g=Zu(e,ov,c);h=Zu(e,pv,c);g&&h&&nv(e,g,g+h)}}}}
function Yu(a,b,c,d,e){var f,g=a.C.length,h=b.Na/32|0;b.aq=d+"\\";for(var k=0;k<e.length;k++)for(var m=e[k],p=0;p<h;p++){var w=a,u=b;f=p;u.ae&&u.ii&&u.ii==m||(u.ii=m,u.ae=Vu(w,u.ii));if(u.ae){f*=32;var F=Wu(w,u.ae,f,1);if(F){if(229==F)u.$b=null;else{u.$b=ra(qv(w,u.ae,f+0,8));F=ra(qv(w,u.ae,f+8,3));F.length&&(u.$b+="."+F);u.Wg=Wu(w,u.ae,f+11,1);u.aj=Wu(w,u.ae,f+28,2);u.Ml=Wu(w,u.ae,f+26,2);f=u;var F=[],K=u.Ml;if(K){do{if(2>K)break;for(var H=u.jh+(K-2)*u.vf,I=0;I<u.vf;I++)F.push(u.Kf+H++);K=Xu(w,u,
function Yu(a,b,c,d,e){var f,g=a.C.length,h=b.Na/32|0;b.cq=d+"\\";for(var k=0;k<e.length;k++)for(var m=e[k],p=0;p<h;p++){var w=a,u=b;f=p;u.ae&&u.ii&&u.ii==m||(u.ii=m,u.ae=Vu(w,u.ii));if(u.ae){f*=32;var F=Wu(w,u.ae,f,1);if(F){if(229==F)u.$b=null;else{u.$b=ra(qv(w,u.ae,f+0,8));F=ra(qv(w,u.ae,f+8,3));F.length&&(u.$b+="."+F);u.Wg=Wu(w,u.ae,f+11,1);u.aj=Wu(w,u.ae,f+28,2);u.Ml=Wu(w,u.ae,f+26,2);f=u;var F=[],K=u.Ml;if(K){do{if(2>K)break;for(var H=u.jh+(K-2)*u.vf,I=0;I<u.vf;I++)F.push(u.Kf+H++);K=Xu(w,u,
K,0)|Xu(w,u,K,1)}while(K<=u.Nl)}f.fe=F}f=!0}else f=!1}else f=!1;if(!f){k=e.length;break}null!=b.$b&&"."!=b.$b&&".."!=b.$b&&(f=new rv(a,0,b.$b,b.Wg,b.aj,b.fe),a.C.push(f))}for(e=a.C.length;g<e;g++)f=a.C[g],f.Wg&16&&f.fe.length&&Yu(a,b,c,d+"\\"+f.$b,f.fe)}function Xu(a,b,c,d){var e=0,f=8*b.Na;c=b.vg*c+(d?8:0);var g=c/f|0;b.li&&b.kh&&b.kh==b.rf+g||(b.kh=b.rf+g,b.li=Vu(a,b.Kf+b.kh));b.li&&(c=c%f|0,e=Wu(a,b.li,c>>3,1),d?e=16==b.vg?e<<8:c&7?e<<4:(e&15)<<8:c&7&&(e>>=4));return e}
function Vu(a,b){var c=a.ib*a.Ya,d=b/c|0;return d<a.ob?(b%=c,a.seek(d,b/a.Ya|0,b%a.Ya+1)):null}function Wu(a,b,c,d){for(var e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function qv(a,b,c,d){for(var e="";d--;){var f=a.read(b,c++);if(0>=f)break;e+=String.fromCharCode(f)}return e}function Qu(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ol=b;a.Pl=c;a.hd=a.Lc=0;a.Oa=!1;return a}
function Ru(a,b){b="action=open&volume="+b+("&mode="+a.mode);b+="&chs="+a.ob+":"+a.ib+":"+a.Ya+":"+a.Na;b+="&machine="+Ou(a.controller);b+="&user="+Pu(a.controller);return Da()+"/api/v1/disk?"+b}
@ -670,16 +670,16 @@ function Bv(a,b,c,d){var e,f=a.na.listDrives;if(f&&!isNaN(e=ga(f.value,10))&&0<=
l.lj=function(a,b,c,d,e){var f;a.Le=!1;b&&(f=b.info(),b&&f[0]>a.ob||f[1]>a.ib)&&(this.Fa('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.Ua)),b=null);b?(a.sa=b,a.Zk=c,a.te=d,Nv(this,c,d,b),f=b.info(),this.I|=Rv,this.Fa('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.Ua),a.ke||e),a.ug=f[0],a.Af=f[1],a.Bf=f[2],this.pa&&this.pa.ld()):a.Ne=!1;a.ke&&(a.ke=!1,--this.K||zb(this));Av(this,a.Ua)};
function Fv(a,b,c,d){if((a=a.na.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Av(a,b){if(0<=b&&b<a.A.length){var c=a.A[b],d=a.na.listDisks;a=a.na.listDrives;if(d&&a&&d.options&&a.options&&(a=ga(a.value,10),c=c.Ne?"?":c.te,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Hv(a,b,c,d){var e=a.A[b];e.sa&&(Pv(a,e.te,e.sa),e.Zk="",e.te="",e.sa=null,e.Ne=!1,a.I|=Rv,d||a.Fa("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||Av(a,b))}
function Nv(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function Pv(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.Sn=function(a,b,c){v(this,a,b,c,"OUTPUT");b&Sv?this.J&Sv||this.J&Tv&&this.W&&Zg(this.W,6):Cv(this);this.J=b};l.rm=function(a,b){v(this,a,null,b,"DIAG",80);return 80};l.tm=function(a,b){v(this,a,null,b,"STATUS",this.fa);return this.fa};
function Nv(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function Pv(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.Un=function(a,b,c){v(this,a,b,c,"OUTPUT");b&Sv?this.J&Sv||this.J&Tv&&this.W&&Zg(this.W,6):Cv(this);this.J=b};l.rm=function(a,b){v(this,a,null,b,"DIAG",80);return 80};l.tm=function(a,b){v(this,a,null,b,"STATUS",this.fa);return this.fa};
l.qm=function(a,b){var c=0;this.D<this.C&&(c=this.F[this.D]);this.J&Tv&&this.W&&Lg(this.W,6);t(this)&&v(this,a,null,b,"DATA["+this.D+"]",c);++this.D>=this.C&&(this.fa&=~(Uv|Vv),this.D=this.C=0);return c};
l.Rn=function(a,b,c){t(this)&&v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]&Wv;if(void 0!==Xv[a]&&this.C>=Xv[a].Id){b=!1;this.D=0;a=Yv(this);var d,e,f,g,h=a&Wv;switch(h){case Zv:Yv(this);Yv(this);$v(this);break;case aw:c=Yv(this);this.Ua=c&3;d=this.A[this.Ua];$v(this);bw(this,(d.pb&cw)>>>24);break;case dw:case ew:c=Yv(this);b=c>>2&1;this.Ua=c&3;d=this.A[this.Ua];d.Xa=b;c=d.Gb=Yv(this);e=Yv(this);f=d.kb=Yv(this);g=Yv(this);d.ub=128<<g;d.Td=Yv(this);Yv(this);
l.Tn=function(a,b,c){t(this)&&v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]&Wv;if(void 0!==Xv[a]&&this.C>=Xv[a].Id){b=!1;this.D=0;a=Yv(this);var d,e,f,g,h=a&Wv;switch(h){case Zv:Yv(this);Yv(this);$v(this);break;case aw:c=Yv(this);this.Ua=c&3;d=this.A[this.Ua];$v(this);bw(this,(d.pb&cw)>>>24);break;case dw:case ew:c=Yv(this);b=c>>2&1;this.Ua=c&3;d=this.A[this.Ua];d.Xa=b;c=d.Gb=Yv(this);e=Yv(this);f=d.kb=Yv(this);g=Yv(this);d.ub=128<<g;d.Td=Yv(this);Yv(this);
Yv(this);h==ew?(h=d,h.pb=fw|gw,h.sa&&(h.cb=null,h.pb=Qv,this.W&&(An(this.W,2,this,"dmaRead",h),rn(this.W,2)))):(h=d,h.pb=fw|gw,h.sa&&(h.sa.Re?h.pb=hw|gw:(h.cb=null,h.pb=Qv,this.W&&(An(this.W,2,this,"dmaWrite",h),rn(this.W,2)))));iw(this,d,a,b,c,e,f,g);b=!0;break;case jw:c=Yv(this);this.Ua=c&3;d=this.A[this.Ua];d.Gb=d.Sd=0;d.pb=kw|lw;$v(this);b=!0;break;case mw:d=this.A[this.Ua];d.Xa=0;$v(this);bw(this,d.Ua|d.Xa<<2|d.pb&nw);bw(this,d.Gb);this.Ua=this.Ua+1&3;break;case ow:c=Yv(this);b=c>>2&1;this.Ua=
c&3;d=this.A[this.Ua];c=d.Gb;e=d.Xa=b;f=d.kb=1;g=0;d.pb=Qv;d.sa&&(d.cb=d.sa.seek(d.Gb,d.Xa,d.kb))?g=d.cb.length>>8:d.pb=fw|gw;iw(this,d,a,b,c,e,f,g);b=!0;break;case pw:c=Yv(this);b=c>>2&1;this.Ua=c&3;d=this.A[this.Ua];c=d.Gb;e=d.Xa=b;f=1;g=Yv(this);d.ub=128<<g;d.Td=Yv(this);Yv(this);d.Wi=Yv(this);h=d;h.pb=fw|gw;h.sa&&(h.cb=null,h.pb=Qv,this.W&&(h.Ge=0,h.$c=Array(4),h.Yg=!0,h.jg=0,An(this.W,2,this,"dmaFormat",h),rn(this.W,2),h.Yg=!1));iw(this,d,a,b,c,e,f,g);b=!0;break;case qw:c=Yv(this),this.Ua=c&
3,d=this.A[this.Ua],d.Xa=c>>2&1,c=Yv(this),d.Gb+=c-d.Sd,0>d.Gb&&(d.Gb=0),d.Gb>=d.ob&&(d.Gb=d.ob-1),d.Sd=c,d.pb=kw,d.Gb||(d.pb|=lw),$v(this),b=!0}0<this.C&&(this.fa=this.fa|Uv|Vv);this.J&Tv&&(!d||d.pb&fw||!b||this.W&&Zg(this.W,6))}};l.sm=function(a,b){var c=this.I;this.I&=~Rv;v(this,a,null,b,"INPUT",c);return c};l.Qn=function(a,b,c){v(this,a,b,c,"CONTROL");this.Zb=b};
3,d=this.A[this.Ua],d.Xa=c>>2&1,c=Yv(this),d.Gb+=c-d.Sd,0>d.Gb&&(d.Gb=0),d.Gb>=d.ob&&(d.Gb=d.ob-1),d.Sd=c,d.pb=kw,d.Gb||(d.pb|=lw),$v(this),b=!0}0<this.C&&(this.fa=this.fa|Uv|Vv);this.J&Tv&&(!d||d.pb&fw||!b||this.W&&Zg(this.W,6))}};l.sm=function(a,b){var c=this.I;this.I&=~Rv;v(this,a,null,b,"INPUT",c);return c};l.Sn=function(a,b,c){v(this,a,b,c,"CONTROL");this.Zb=b};
function iw(a,b,c,d,e,f,g,h){$v(a);bw(a,b.Ua|b.Xa<<2|b.pb&nw);bw(a,(b.pb&rw)>>>8);bw(a,(b.pb&sw)>>>16);var k=0;if(e!=b.Gb||f!=b.Xa)k=g=1;c&tw&&(f^=k,d||(k=0));bw(a,e+k);bw(a,f);bw(a,g);bw(a,h)}function Yv(a){var b=a.F[a.D];a.D++;return b}function $v(a){a.D=a.C=0}function bw(a,b){a.F[a.C++]=b}l.jl=function(a,b,c){void 0===b||0>b?this.se(a,c):c(-1,!1)};l.kl=function(a,b){return void 0!==b&&0<=b?uw(a,b):-1};
l.Cl=function(a,b){if(void 0!==b&&0<=b)a:if(a.pb)a=-1;else{a.$c[a.Ge++]=b;if(a.Ge==a.$c.length){a.Gb=a.$c[0];a.Xa=a.$c[1];a.kb=a.$c[2];a.ub=128<<a.$c[3];for(var c=a.Ge=0;c<a.ub;c++)if(0>uw(a,a.Wi)){a=-1;break a}a.jg++}a.jg>=a.Td&&(b=-1);a=b}else a=-1;return a};l.se=function(a,b){var c=-1,d=null,e=0;if(!a.pb&&a.sa){do{if(a.cb&&(e=a.Sa,0<=(c=a.sa.read(a.cb,a.Sa++)))){d=a.cb;break}a.cb=a.sa.seek(a.Gb,a.Xa,a.kb);if(!a.cb){a.pb=vw|gw;break}a.Sa=0;ww(a)}while(1)}b(c,!1,d,e)};
function uw(a,b){if(a.pb||!a.sa)return-1;do{if(a.cb&&a.sa.write(a.cb,a.Sa++,b))break;a.cb=a.sa.seek(a.Gb,a.Xa,a.kb);if(!a.cb){a.pb=xw|gw;b=-1;break}a.Sa=0;ww(a)}while(1);return b}function ww(a){a.kb++;a.kb>=a.Bf+1&&(a.kb=1,a.Xa++,a.Xa>=a.Af&&(a.Xa=0,a.Gb++))}var Lv="Floppy Drive",Sv=4,Tv=8,Vv=16,Uv=64,Jv=128,Zv=3,aw=4,dw=5,ew=6,jw=7,mw=8,ow=10,pw=13,qw=15,Wv=31,tw=128,Qv=0,fw=8,kw=32,gw=64,Kv=192,nw=255,hw=512,vw=1024,xw=8192,rw=65280,sw=16711680,lw=268435456,cw=-16777216,Rv=128,Ov=0;aa={};
var Xv={3:{Id:3,Ud:0,name:aa.Up},4:{Id:2,Ud:1,name:aa.Sp},5:{Id:9,Ud:7,name:aa.Yp},6:{Id:9,Ud:7,name:aa.Op},7:{Id:2,Ud:0,name:aa.Qp},8:{Id:1,Ud:2,name:aa.Tp},10:{Id:2,Ud:7,name:aa.Pp},13:{Id:6,Ud:7,name:aa.Lp},15:{Id:3,Ud:0,name:aa.Rp}},Dv={1009:zv.prototype.rm,1012:zv.prototype.tm,1013:zv.prototype.qm,1015:zv.prototype.sm},Ev={1010:zv.prototype.Sn,1013:zv.prototype.Rn,1015:zv.prototype.Qn};
var Xv={3:{Id:3,Ud:0,name:aa.Wp},4:{Id:2,Ud:1,name:aa.Up},5:{Id:9,Ud:7,name:aa.$p},6:{Id:9,Ud:7,name:aa.Qp},7:{Id:2,Ud:0,name:aa.Sp},8:{Id:1,Ud:2,name:aa.Vp},10:{Id:2,Ud:7,name:aa.Rp},13:{Id:6,Ud:7,name:aa.Np},15:{Id:3,Ud:0,name:aa.Tp}},Dv={1009:zv.prototype.rm,1012:zv.prototype.tm,1013:zv.prototype.qm,1015:zv.prototype.sm},Ev={1010:zv.prototype.Un,1013:zv.prototype.Tn,1015:zv.prototype.Sn};
Ra(function(){for(var a=pb(document,"pcx86","fdc"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new zv(d);ob(d,c)}});function yw(a){ab.call(this,"HDC",a,1048576);this.dmaRead=yw.prototype.ll;this.dmaWrite=yw.prototype.ml;this.dmaWriteBuffer=yw.prototype.Dl;this.dmaWriteFormat=yw.prototype.El;this.Z=[];this.la=a.drives;this.M="at"==a.type}ba(yw,ab);l=yw.prototype;
l.Cb=function(a,b,c){var d=this;switch(b){case "saveHD0":case "saveHD1":return this.na[b]=c,c.onclick=function(a){return function(){var b=d.A&&d.A[a];b&&b.sa?(b=b.sa,b=Ma(xv(b),"octet-stream",!0,b.Jg.replace(".json",".img")),Wa(b)):d.Fa("Hard drive "+a+" is not available.")}}(+b.slice(-1)),!0}return!1};
l.uc=function(a,b,c,d){this.ka=b;this.H=c;this.ba=d;this.pa=a;if(d=qd(a,"drives"))this.Z=d;else if(this.la)try{this.Z=eval("("+this.la+")")}catch(e){Wa("HDC drive configuration error: "+e.message+" ("+this.la+")")}this.W=Ob(a,"ChipSet");this.G=0;this.ma=3;Ec(b,this,this.M?zw:Aw);Ic(b,this,this.M?Bw:Cw);this.M&&(this.G++,this.W&&this.W.ca==ol&&this.G++,this.ma=2,b.Y[Dw]=2,b.Z[Dw]=2);Jf(c,19,this.Vm.bind(this));Jf(c,64,this.Wm.bind(this));this.reset();Ew(this)||zb(this)};
@ -693,12 +693,12 @@ null;e[g]=m}c[b]=e;return c}l.hj=function(a){var b;a=this.A[a];if(void 0!==a){b=
l.$k=function(a,b,c){if(a.sa){var d=a.sa.info(),e=d[0];if(e){var f=d[2],g=d[1]*f;if(b+c<=e*g)return a.Od=Math.floor(b/g),b%=g,a.Xa=Math.floor(b/f),a.kb=b%f,a.ub=c*d[3],a.errorCode=Jw,!0}}return!1};
function Ew(a,b){b||(a.K=0);for(var c=0;c<a.A.length;c++){var d=a.A[c];if(d.name&&d.path){if(!(b&&d.sa&&d.sa.og)){var e;e=a;var f=d.name,d=d.path,g=e.A[c];g.Le?(e.Fa("Drive "+c+" busy"),e=!0):(g.Le=!0,g.ke=!0,e.K++,t(e)&&Cb(e,"loading "+f),(g.sa||new Ku(e,g,g.mode)).load(f,d,null,e.Fl),e=!1);!e&&b&&zb(a,!1)}}else b&&void 0!==d.type&&(d.sa=null,Mw(a,d,d.type))}return!!a.K}
l.Fl=function(a,b,c){a.Le=!1;if(a.sa=b)this.Fa('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.Ua),a.ke),b=b.info(),b[0]==a.ob&&b[1]==a.ib&&b[2]==a.Ya&&b[3]==a.Na||this.Fa("Warning: disk geometry ("+b[0]+":"+b[1]+":"+b[2]+") does not match "+Nw[this.G]+" drive type "+a.type+" ("+a.ob+":"+a.ib+":"+a.Ya+")");a.ke&&(a.ke=!1,--this.K||zb(this))};
l.Tm=function(a,b){var c=0;this.D<this.C&&(c=this.F[this.D]);this.W&&Lg(this.W,5);this.fa&=~Ow;v(this,a,null,b,"DATA["+this.D+"]",c);++this.D>=this.C&&(this.D=this.C=0,this.fa&=~(Pw|Qw|Rw));return c};l.po=function(a,b,c){v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]!=Sw?6:this.F.length;6==this.C&&(this.fa&=~Tw);this.C>=a&&(this.fa|=Pw,this.fa&=~Tw,Uw(this))};l.Um=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.D<this.C&&(this.fa|=Tw);return c};
l.so=function(a,b,c){v(this,a,b,c,"RESET");this.ta=b;this.W&&Lg(this.W,5);Fw(this)};l.Sm=function(a,b){v(this,a,null,b,"CONFIG",this.O);return this.O};l.ro=function(a,b,c){v(this,a,b,c,"PULSE");this.qa=b;this.fa=Tw|Qw|Rw};l.qo=function(a,b,c){v(this,a,b,c,"PATTERN");this.oa=b};l.hi=function(a,b,c){v(this,a,b,c,"NOISE")};
l.Tm=function(a,b){var c=0;this.D<this.C&&(c=this.F[this.D]);this.W&&Lg(this.W,5);this.fa&=~Ow;v(this,a,null,b,"DATA["+this.D+"]",c);++this.D>=this.C&&(this.D=this.C=0,this.fa&=~(Pw|Qw|Rw));return c};l.ro=function(a,b,c){v(this,a,b,c,"DATA["+this.C+"]");this.C<this.F.length&&(this.F[this.C++]=b);a=this.F[0]!=Sw?6:this.F.length;6==this.C&&(this.fa&=~Tw);this.C>=a&&(this.fa|=Pw,this.fa&=~Tw,Uw(this))};l.Um=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.D<this.C&&(this.fa|=Tw);return c};
l.uo=function(a,b,c){v(this,a,b,c,"RESET");this.ta=b;this.W&&Lg(this.W,5);Fw(this)};l.Sm=function(a,b){v(this,a,null,b,"CONFIG",this.O);return this.O};l.to=function(a,b,c){v(this,a,b,c,"PULSE");this.qa=b;this.fa=Tw|Qw|Rw};l.so=function(a,b,c){v(this,a,b,c,"PATTERN");this.oa=b};l.hi=function(a,b,c){v(this,a,b,c,"NOISE")};
function Vw(a,b,c){var d=-1;a.B&&(d=a.se(a.B,function(){}),1==a.B.Sa||a.B.Sa==a.B.Na)&&(t(a,1048832)&&v(a,b,null,c,"DATA["+a.B.Sa+"]",d),1<a.B.Sa&&(a.B.ub-=a.B.Na,a.J=a.J-1&255,a.B.ub>=a.B.Na?(a.fa=Ww,a.se(a.B,function(b){0<=b?(Xw(a),a.W&&a.W.ca==ol&&(a.fa=0),a.fa=a.fa|Hw|Yw|Zw):(a.fa=$w,a.I=ax)},!1)):a.fa=Hw|Yw));return d}l.nl=function(a,b){return Vw(this,a,b)|Vw(this,a,b)<<8};
function bx(a,b,c,d){if(a.B&&a.B.ub>=a.B.Na)if(0>cx(a.B,c))a.fa=$w,a.I=ax;else if(1==a.B.Sa||a.B.Sa==a.B.Na)t(a,1048832)&&v(a,b,c,d,"DATA["+a.B.Sa+"]"),1<a.B.Sa&&(a.B.ub-=a.B.Na,a.J=a.J-1&255,Xw(a),a.fa=Hw|Yw,a.B.ub>=a.B.Na&&(a.fa|=Zw))}l.yn=function(a,b,c){bx(this,a,b&255,c);bx(this,a,b>>8&255,c)};l.$l=function(a,b){var c=this.I;v(this,a,null,b,"ERROR",c);return c};l.Dn=function(a,b,c){v(this,a,b,c,"WPREC");this.va=b};l.bm=function(a,b){var c=this.J;v(this,a,null,b,"SECCNT",c);return c};
l.Bn=function(a,b,c){v(this,a,b,c,"SECCNT");this.J=b};l.cm=function(a,b){var c=this.ga;v(this,a,null,b,"SECNUM",c);return c};l.Cn=function(a,b,c){v(this,a,b,c,"SECNUM");this.ga=b};l.Yl=function(a,b){var c=this.da;v(this,a,null,b,"CYLLO",c);return c};l.xn=function(a,b,c){v(this,a,b,c,"CYLLO");this.da=b};l.Xl=function(a,b){var c=this.aa;v(this,a,null,b,"CYLHI",c);return c};l.wn=function(a,b,c){v(this,a,b,c,"CYLHI");this.aa=b};l.Zl=function(a,b){var c=this.Y;v(this,a,null,b,"DRVHD",c);return c};
l.zn=function(a,b,c){v(this,a,b,c,"DRVHD");this.Y=b;this.fa=this.A[this.Y&dx?1:0]?this.fa|Hw|Yw:this.fa&~Hw};l.dm=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.fa&Hw&&(this.fa&=~Ww);return c};l.vn=function(a,b,c){v(this,a,b,c,"COMMAND");this.ha=b;this.W&&Lg(this.W,14);ex(this)};l.An=function(a,b,c){v(this,a,b,c,"FDR");this.L&fx&&!(b&fx)&&(this.I=gx);this.L=b};
function bx(a,b,c,d){if(a.B&&a.B.ub>=a.B.Na)if(0>cx(a.B,c))a.fa=$w,a.I=ax;else if(1==a.B.Sa||a.B.Sa==a.B.Na)t(a,1048832)&&v(a,b,c,d,"DATA["+a.B.Sa+"]"),1<a.B.Sa&&(a.B.ub-=a.B.Na,a.J=a.J-1&255,Xw(a),a.fa=Hw|Yw,a.B.ub>=a.B.Na&&(a.fa|=Zw))}l.An=function(a,b,c){bx(this,a,b&255,c);bx(this,a,b>>8&255,c)};l.$l=function(a,b){var c=this.I;v(this,a,null,b,"ERROR",c);return c};l.Fn=function(a,b,c){v(this,a,b,c,"WPREC");this.va=b};l.bm=function(a,b){var c=this.J;v(this,a,null,b,"SECCNT",c);return c};
l.Dn=function(a,b,c){v(this,a,b,c,"SECCNT");this.J=b};l.cm=function(a,b){var c=this.ga;v(this,a,null,b,"SECNUM",c);return c};l.En=function(a,b,c){v(this,a,b,c,"SECNUM");this.ga=b};l.Yl=function(a,b){var c=this.da;v(this,a,null,b,"CYLLO",c);return c};l.zn=function(a,b,c){v(this,a,b,c,"CYLLO");this.da=b};l.Xl=function(a,b){var c=this.aa;v(this,a,null,b,"CYLHI",c);return c};l.yn=function(a,b,c){v(this,a,b,c,"CYLHI");this.aa=b};l.Zl=function(a,b){var c=this.Y;v(this,a,null,b,"DRVHD",c);return c};
l.Bn=function(a,b,c){v(this,a,b,c,"DRVHD");this.Y=b;this.fa=this.A[this.Y&dx?1:0]?this.fa|Hw|Yw:this.fa&~Hw};l.dm=function(a,b){var c=this.fa;v(this,a,null,b,"STATUS",c);this.fa&Hw&&(this.fa&=~Ww);return c};l.xn=function(a,b,c){v(this,a,b,c,"COMMAND");this.ha=b;this.W&&Lg(this.W,14);ex(this)};l.Cn=function(a,b,c){v(this,a,b,c,"FDR");this.L&fx&&!(b&fx)&&(this.I=gx);this.L=b};
function ex(a){var b=!1,c=a.ha,d=a.Y&dx?1:0,e=a.Y&hx,f=a.da|(a.aa&ix)<<8,g=a.ga,h=a.J||256;a.Ua=-1;a.B=null;a.I=jx;a.fa=Hw|Yw;var k=a.A[d];k?(k.Od=f,k.Xa=e,k.kb=g,k.ub=h*k.Na,c=c>=kx?c:c&lx,k.cb=null,k.Sa=0,k.errorCode=0,a.Ua=d,a.B=k):c=-1;switch(c&lx){case mx:b=!0;break;case nx:a.fa=Ww;a.se(k,function(b){0<=b&&a.W?(Xw(a),a.fa=Hw|Yw|Zw):(a.fa=$w,a.I=ax)},!1);break;case ox:a.fa=Zw;break;case px:b=!0;break;case qx:b=!0;break;case kx:a.I=gx;b=!0;break;case rx:k.ib=e+1,k.Ya=h,b=!0}b&&Xw(a)}
function Xw(a){!a.W||a.L&sx||Zg(a.W,14,120)}
function Uw(a){a.D=0;var b=tx(a),c=tx(a),d=c&32,e=d>>5,f=c&31,g=tx(a),h=tx(a),k=g<<2&768|h,m=g&63,p=tx(a),w=tx(a),u=a.A[e];u&&(u.Od=k,u.Xa=f,u.kb=m,u.ub=p*u.Na);switch(b){case ux:vx(a,u?u.errorCode:wx);xx(a,c);xx(a,g);xx(a,h);xx(a,yx|d);b=-1;break;case Sw:for(c=0;0<=(b=tx(a));)u&&c<u.De.length&&(u.De[c++]=b);u&&Mw(a,u);b=yx;u||a.N!=e||(a.N=-1,b=zx);vx(a,b|d);b=-1;break;case Ax:case Bx:vx(a,yx|d),b=-1}if(0<=b)switch(void 0===u?b=-1:(u.errorCode=Jw,u.al=0),b){case Cx:vx(a,yx|d);break;case Dx:u.mf=w;
@ -710,15 +710,15 @@ l.se=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;
function cx(a,b){if(a.errorCode)return-1;do{if(a.cb&&a.sa.write(a.cb,a.Sa++,b))break;a.sa&&a.sa.seek(a.Od,a.Xa,a.kb+a.ig,!0,function(b){a.cb=b});if(!a.cb){a.errorCode=Lx;b=-1;break}a.Sa=0;Mx(a)}while(1);return b}function Mx(a){a.kb++;var b=1-a.ig;a.kb>=a.Ya+b&&(a.kb=b,a.Xa++,a.Xa>=a.ib&&(a.Xa=0,a.Od++))}l.Vm=function(){var a=this.H.L&255;!(this.H.D>>8)&&128<a&&(this.N=a-128);return!0};l.Wm=function(){var a;(a=this.H.D>>8||!this.W)||(a=!(this.W.hc[0].od&64));return a?!0:!1};
var Kw="Hard Drive",Nw=["XTC","ATC","COMPAQ"],Lw=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7],16:[612,4],17:[977,5],18:[977,7],19:[1024,7],20:[733,5],21:[733,7],22:[733,5],23:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[1023,8],5:[940,6],6:[697,5],7:[462,8],8:[925,5],9:[900,15],10:[980,5],11:[925,7],12:[925,9],13:[612,8],14:[980,4],16:[612,4],17:[980,5],18:[966,
6],19:[1023,8],20:[733,5],21:[733,7],22:[524,4,40],23:[924,8],24:[966,14],25:[966,16],26:[1023,14],27:[832,6,33],28:[1222,15,34],29:[1240,7,34],30:[615,4,25],31:[615,8,25],32:[905,9,25],33:[832,8,33],34:[966,7,34],35:[966,8,34],36:[966,9,34],37:[966,5,34],38:[612,16,63],39:[1023,11,33],40:[1023,15,34],41:[1630,15,52],42:[1023,16,63],43:[805,4,26],44:[805,2,26],45:[748,8,33],46:[748,6,33],47:[966,5,25]}],Dw=496,gx=1,jx=0,ax=16,ix=3,hx=15,dx=16,$w=1,Zw=8,Yw=16,Hw=64,Ww=128,mx=16,nx=32,ox=48,px=64,qx=
112,kx=144,rx=145,lx=240,sx=2,fx=4,yx=0,zx=2,Cx=0,Dx=1,ux=3,Ex=5,Fx=8,Hx=10,Sw=12,Jx=15,Ax=224,Bx=228,Jw=0,wx=4,Lx=20,Iw=0,Tw=1,Pw=2,Qw=4,Rw=8,Ow=32,Aw={800:yw.prototype.Tm,801:yw.prototype.Um,802:yw.prototype.Sm},zw={496:yw.prototype.nl,497:yw.prototype.$l,498:yw.prototype.bm,499:yw.prototype.cm,500:yw.prototype.Yl,501:yw.prototype.Xl,502:yw.prototype.Zl,503:yw.prototype.dm},Cw={800:yw.prototype.po,801:yw.prototype.so,802:yw.prototype.ro,803:yw.prototype.qo,807:yw.prototype.hi,811:yw.prototype.hi,
815:yw.prototype.hi},Bw={496:yw.prototype.yn,497:yw.prototype.Dn,498:yw.prototype.Bn,499:yw.prototype.Cn,500:yw.prototype.xn,501:yw.prototype.wn,502:yw.prototype.zn,503:yw.prototype.vn,1014:yw.prototype.An};Ra(function(){for(var a=pb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new yw(d);ob(d,c)}});function Nx(a){ab.call(this,"Debugger",a);this.ya=+a.base||16;this.W=this.ga=this.L=0;this.aa=!1;this.A=-1;this.C=[];this.da={}}ba(Nx,ab);Nx.prototype.gh=function(){return-1};
112,kx=144,rx=145,lx=240,sx=2,fx=4,yx=0,zx=2,Cx=0,Dx=1,ux=3,Ex=5,Fx=8,Hx=10,Sw=12,Jx=15,Ax=224,Bx=228,Jw=0,wx=4,Lx=20,Iw=0,Tw=1,Pw=2,Qw=4,Rw=8,Ow=32,Aw={800:yw.prototype.Tm,801:yw.prototype.Um,802:yw.prototype.Sm},zw={496:yw.prototype.nl,497:yw.prototype.$l,498:yw.prototype.bm,499:yw.prototype.cm,500:yw.prototype.Yl,501:yw.prototype.Xl,502:yw.prototype.Zl,503:yw.prototype.dm},Cw={800:yw.prototype.ro,801:yw.prototype.uo,802:yw.prototype.to,803:yw.prototype.so,807:yw.prototype.hi,811:yw.prototype.hi,
815:yw.prototype.hi},Bw={496:yw.prototype.An,497:yw.prototype.Fn,498:yw.prototype.Dn,499:yw.prototype.En,500:yw.prototype.zn,501:yw.prototype.yn,502:yw.prototype.Bn,503:yw.prototype.xn,1014:yw.prototype.Cn};Ra(function(){for(var a=pb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=mb(c),d=new yw(d);ob(d,c)}});function Nx(a){ab.call(this,"Debugger",a);this.ya=+a.base||16;this.W=this.ga=this.L=0;this.aa=!1;this.A=-1;this.C=[];this.da={}}ba(Nx,ab);Nx.prototype.gh=function(){return-1};
Nx.prototype.hh=function(){};Nx.prototype.Pk=function(a,b){return a.replace("["+b+"]","unimplemented")};Nx.prototype.Cg=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.aa?a="end":a=this.C[this.A+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(ra(a.substring(d,f))),d=f+1}}return b};
function Ox(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
function Px(a,b,c){var d;if(b){b=Qx(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var p=m[e++],w=p.length,p=ra(p);if(!p){f=!0;break}p=Rx(a,p,null,!1===c);if(void 0===p){f=!0;c=!1;break}h.push(p);if(e==m.length)break;var p=m[e++],u=p.length;k.length&&Sx[p]<Sx[k[k.length-1]]&&Ox(h,k,1);k.push(p);b=b.substr(w+u)}Ox(h,k)&&1==h.length||(f=!0);f?c&&a.P("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Tx(a,null,
d))}return d}function Qx(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=Px(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?Ux(a,e):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=a.Pk(b,c[1]);for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.W-a.ga}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
function Rx(a,b,c,d){var e;null!=b?(e=a.gh(b),0<=e?e=a.hh(e):(e=a.da[b],null==e&&(e=ga(b,a.ya))),null!=e||d||a.P("invalid "+(c?c:"value")+": "+b)):d||a.P("missing "+(c||"value"));return e}function Tx(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d=q(c,0,!0)+" "+c+". "+ja(c,0,!0)+" "+ia(c,4,!0),32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'"));a.P((null!=b?b+": ":"")+d);return e}function Vx(a,b){if(b)return Tx(a,b,a.da[b]);var c=0;for(b in a.da)Tx(a,b,a.da[b]),c++;return 0<c}
function Ux(a,b){switch(a.ya){case 8:a=ja(b,NaN);break;case 10:a=b.toString();break;default:a=q(b,NaN)}return a}var Sx={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Ux(a,b){var c;c=void 0===c?0:c;switch(a.ya){case 8:a=ja(b,3*c);break;case 10:a=b.toString();break;default:a=q(b,2*c)}return a}var Sx={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Wx(a){Nx.call(this,a);this.oa=4;this.ha=5;this.wa=1048575;this.K=Xx(this);this.Ga=Xx(this);this.Z=Xx(this);this.D=[];this.B=this.Y=this.M=[];Yx(this);this.ta=0;Zx(this);this.za={};$x(this,a.messages);this.Ca=a.commands;var b=this;window?void 0===window.pcx86&&(window.pcx86=function(a){return ay(b,a)}):void 0===global.pcx86&&(global.pcx86=function(a){return ay(b,a)})}ba(Wx,Nx);l=Wx.prototype;
l.uc=function(a,b,c,d){this.ka=b;this.H=c;this.pa=a;this.Za=Ob(a,"FDC");this.Ha=Ob(a,"HDC");this.Tc=Ob(a,"FPU");this.G=Ob(a,"Mouse");(a=qd(a,"messages"))&&$x(this,a);this.ha=b.I>>2;this.wa=b.N;this.Ta=new Kd(this.H,7,"DBG");this.ma=by;80186<=this.H.ca&&(this.ma=by.slice(),this.ma[15]=cy,80286<=this.H.ca&&(this.ma[15]=dy,80386<=this.H.ca&&(this.oa=8)));rl(this,64,function(a){ey(d,d.H.sc,a[0])});rl(this,4,function(a){if(a=a[0]){var b=Rx(d,a);if(void 0===b)d.P("invalid selector: "+a);else if(a=fy(d,
b,gy),d.P("dumpSel("+ka(a?a.U:b)+"): %"+q(a?a.Lb:null,d.ha)),a){var c,b=!1;if(a.type&4096)a.type&2048?(c="code"+(a.type&512?",readable":",execonly"),a.type&1024&&(c+=",conforming")):(c="data"+(a.type&512?",writable":",readonly"),a.type&1024&&(c+=",expdown")),a.type&256&&(c+=",accessed");else{var e=hy[a.type];e&&(c=e[0],b=e[1])}!c||a.jb&32768||(c+=",not present");d.P((b?"seg="+ka(a.ua&65535)+" off="+ka(a.Ka):"base="+q(a.ua,d.ha)+" limit="+iy(a.Ka))+" type="+r(a.type>>8)+" ("+c+") ext="+ka(a.ext&-65296)+
@ -774,8 +774,8 @@ function JA(a,b){switch(b){case "V":a=$f(a.H);break;case "D":a=a.H.O&1024;break;
function LA(a,b,c){return b.$b+"="+q(b.U,4)+(c?"["+q(b.ua,a.ha)+","+iy(b.Ka)+"]":"")}function MA(a,b,c,d,e){return b+"="+(null!=c?q(c,4):"")+"["+q(d,a.ha)+","+q(e-d,4)+"]"}
function NA(a,b){var c;void 0===b&&(b=wy(a));c=KA(a,Uy)+KA(a,Xy)+KA(a,Vy)+KA(a,Wy)+(4<a.oa?"\n":"")+KA(a,Yy)+KA(a,Zy)+KA(a,$y)+KA(a,az)+"\n"+LA(a,a.H.Y,b)+" "+LA(a,a.H.Ca,b)+" "+LA(a,a.H.oa,b)+" ";if(b){var d="TR="+q(a.H.la.U,4),e=a.ka,e="A20="+(e.J||e.N!=e.C?"OFF ":"ON ");80386>a.H.ca&&(d="\n"+d,c+=e,e="");c+="\n"+LA(a,a.H.Z,b)+" ";80386<=a.H.ca&&(e+="\n",c+=LA(a,a.H.Ga,b)+" "+LA(a,a.H.Ha,b)+"\n");c+=MA(a,"LD",a.H.Eb.U,a.H.Eb.ua,a.H.Eb.ua+a.H.Eb.Ka)+" "+MA(a,"GD",null,a.H.Kb,a.H.Pc)+" "+MA(a,"ID",
null,a.H.Pb,a.H.cd)+" ";c=c+(d+" "+e)+KA(a,rz);80386<=a.H.ca&&(c+=KA(a,tz)+KA(a,uz))}else 80386<=a.H.ca&&(c+=LA(a,a.H.Ga,b)+" "+LA(a,a.H.Ha,b)+" ");return c+=KA(a,wz)+JA(a,"V")+JA(a,"D")+JA(a,"I")+JA(a,"T")+JA(a,"S")+JA(a,"Z")+JA(a,"A")+JA(a,"P")+JA(a,"C")}l.gj=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function Sp(a,b,c,d,e,f,g,h){var k={},m=[],p;for(p in h){var w=h[p];"number"==typeof w&&(h[p]=w={o:w});var u=w.o,F=w.s,K=w.a;if(void 0!==u){void 0!==F&&(k.Ja=u,k.U=F,k.xa=null,a.Sb(k),(k.xa&-65536)==(a.ka.N&-65536)&&(k.xa&=1048575),w.p=k.xa);var F=m,u=[u>>>0,p],H=ta(F,u,a.gj);0>H&&F.splice(-(H+1),0,u)}K&&(w.a=K.replace(/''/g,'"'))}a.D.push({Rf:b,nn:c,U:d,Ja:e,xa:f,cn:g,Fd:h,Pi:m})}
function sy(a,b,c){for(var d=0;d<a.D.length;d++){var e=a.D[d];if(!b||e.Rf==b)if(b&&c==e.nn||!b&&c==e.U){a.D.splice(d,1);break}}}function sA(a,b,c){for(var d=[],e=b.Ja>>>0,f=a.Sb(b)>>>0,g=0;g<a.D.length;g++){var h=a.D[g],k=h.U,m=h.Ja>>>0,p=h.xa;null!=p&&(p>>>=0);var w=h.cn;48==k&&(k=40);if(k==b.U&&e>=m&&e<m+w||null!=p&&f>=p&&f<p+w){b=ta(h.Pi,[e],a.gj);0<=b?OA(a,g,b,d):c&&(b=~b,OA(a,g,b-1,d),OA(a,g,b,d));break}}!d.length&&(a=a.ka.wj(f,!0))&&(d.push(a),d.push(f));return d}
function Sp(a,b,c,d,e,f,g,h){var k={},m=[],p;for(p in h){var w=h[p];"number"==typeof w&&(h[p]=w={o:w});var u=w.o,F=w.s,K=w.a;if(void 0!==u){void 0!==F&&(k.Ja=u,k.U=F,k.xa=null,a.Sb(k),(k.xa&-65536)==(a.ka.N&-65536)&&(k.xa&=1048575),w.p=k.xa);var F=m,u=[u>>>0,p],H=ta(F,u,a.gj);0>H&&F.splice(-(H+1),0,u)}K&&(w.a=K.replace(/''/g,'"'))}a.D.push({Rf:b,pn:c,U:d,Ja:e,xa:f,en:g,Fd:h,Pi:m})}
function sy(a,b,c){for(var d=0;d<a.D.length;d++){var e=a.D[d];if(!b||e.Rf==b)if(b&&c==e.pn||!b&&c==e.U){a.D.splice(d,1);break}}}function sA(a,b,c){for(var d=[],e=b.Ja>>>0,f=a.Sb(b)>>>0,g=0;g<a.D.length;g++){var h=a.D[g],k=h.U,m=h.Ja>>>0,p=h.xa;null!=p&&(p>>>=0);var w=h.en;48==k&&(k=40);if(k==b.U&&e>=m&&e<m+w||null!=p&&f>=p&&f<p+w){b=ta(h.Pi,[e],a.gj);0<=b?OA(a,g,b,d):c&&(b=~b,OA(a,g,b-1,d),OA(a,g,b,d));break}}!d.length&&(a=a.ka.wj(f,!0))&&(d.push(a),d.push(f));return d}
function OA(a,b,c,d){var e={},f=a.D[b].Pi,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.D[b].Fd[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function PA(a){a.Ie&&(a.Ie.value="")}
function QA(a,b){if("?"==b)a.P("frequency commands:"),a.P("\tclear\tclear all frequency counts");else{var c=0;if(a.J)if("clear"==b){for(b=0;b<a.J.length;b++)a.J[b]=[b,0];a.P("frequency data cleared");c++}else if(void 0!==b)a.P("unknown frequency command: "+b),c++;else{var d=a.J.slice();d.sort(function(a,b){return b[1]-a[1]});for(b=0;b<d.length;b++){var e=d[b][0],f=d[b][1];f&&(a.P((Nz[a.ma[e][0]]+" ").substr(0,5)+" ("+r(e)+"): "+f+" times"),c++)}}c||a.P("no frequency data available")}}
function RA(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Vx(a)||a.P("no variables"),!0;if(!c[2])return Vx(a,c[1]);if(!c[3])return delete a.da[c[1]],!0;b=Px(a,c[3]);return void 0!==b?(a.da[c[1]]=b,!0):!1}a.P("invalid assignment:"+b);return!1}

View file

@ -44,9 +44,9 @@
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
*/
var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];
var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Nn:0,Pn:1,Qn:2,Zj:3,Rn:4,Sn:5,Tn:6,Un:7,Vn:8,Wn:9,Xn:10,Yn:11,Zn:12,$n:13,ao:14,bo:15,co:16,eo:17,fo:18,ho:19,io:20,jo:21,ko:22,lo:23,mo:24,no:25,oo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Pl:109,n:110,Vl:111,p:112,q:113,r:114,pn:115,t:116,sn:117,tn:118,un:119,x:120,
y:121,z:122,"{":123,"|":124,"}":125,"~":126,po:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];
p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
function fa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ga(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
@ -93,35 +93,35 @@ l.Dc=function(a,b){this.X[(a&this.D)>>>this.B].nc(a&this.C,b&255,a)};function ac
function bc(a,b){var c=0,d=[],e=!a.G&&a.W==a.D;e||Gb(a,!0);for(var f=0;f<a.H;f++){var g=a.X[f];if(b&&g.type!=Vb||g.Da||g.mi){d[c++]=f;var h=c++;if(g=g.save()){for(var k=0,m=0,q=[];k<g.length;){for(var y=g[k],w=k+1;w<g.length&&g[w]===y;)w++;q[m++]=w-k;q[m++]=y;k=w}q.length<g.length&&(g=q)}d[h]=g}}e||Gb(a,!1);d[c]=e;return d}
function cc(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.I[k]?r("Input port "+ga(k,4,!0)+" already registered"):f.I[k]=[h,!1]}}function dc(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.I[b],h=a.M[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g&&g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k);e|=m<<f;f+=h<<3;b+=h;c-=h}return e}
function ec(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.J[k]?r("Output port "+ga(k,4,!0)+" already registered"):f.J[k]=[h,!1]}}function fc(a,b,c,d,e){for(var f=0;0<c;){var g=a.J[b],h=a.N[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g&&g[0])g[0](b,k,e);f+=h<<3;b+=h;c-=h}}function Ib(a,b,c,d,e){b="Memory block error ("+b+": "+ga(c)+","+ga(d)+")";e?a.Ea?a.Ea.message(b):a.log(b):r(b);return!1}
var tb,gc={Dj:20,count:8,Co:1,type:3},hc=0,ic;for(ic in gc){var jc=gc[ic];gc[ic]={qg:(1<<jc)-1<<hc,shift:hc};hc+=jc}tb=gc;var Jb=1,Nb=2,Qb=3,Sb=4,Ub=5,kc;if(gb){var lc=new ArrayBuffer(2);(new DataView(lc)).setUint16(0,256,!0);kc=256===(new Uint16Array(lc))[0]}else kc=!1;var Wb=kc;
var tb,gc={Dj:20,count:8,Eo:1,type:3},hc=0,ic;for(ic in gc){var jc=gc[ic];gc[ic]={qg:(1<<jc)-1<<hc,shift:hc};hc+=jc}tb=gc;var Jb=1,Nb=2,Qb=3,Sb=4,Ub=5,kc;if(gb){var lc=new ArrayBuffer(2);(new DataView(lc)).setUint16(0,256,!0);kc=256===(new Uint16Array(lc))[0]}else kc=!1;var Wb=kc;
function u(a,b,c,d,e,f){this.id=mc+=2;this.T=null;this.G=0;this.de=a;this.we=b;this.size=c||0;this.type=d||nc;this.H=d==Vb;this.controller=null;this.F=f;Fb(this);this.Da=this.mi=!1;if(c)if(e)this.controller=e,a=e.si(a),this.T=a[0],this.G=a[1],Rb(this,e.pg());else if(gb)this.L=new ArrayBuffer(c),this.K=new DataView(this.L,0,c),this.Fa=new Uint8Array(this.L,0,c),this.qd=new Uint16Array(this.L,0,c>>1),this.T=new Int32Array(this.L,0,c>>2),Rb(this,Wb?Xb:Yb);else{this.T=Array(c>>2);for(e=0;e<this.T.length;e++)this.T[e]=
0;Rb(this,Zb)}else Rb(this)}l=u.prototype;l.Gl=function(a){this.de=a};l.save=function(){var a,b;if(this.controller)a=null;else if(gb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.K.getInt32(b<<2,!0);else a=this.T;return a};l.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(gb)for(b=0;b<a.length;b++)this.K.setInt32(b<<2,a[b],!0);else this.T=a;return this.Da=!0}return!1};function Rb(a,b,c){b||(b=a.type==pc?qc:a.type==rc?sc:tc);uc(a,b,c);vc(a,b,c)}
function uc(a,b,c){c&&a.ee||(a.mc=b[0]||a.Lj,a.af=b[2]||a.Mj,a.Md=b[4]||a.Jj);if(c||void 0===c)a.zd=b[0]||a.Lj,a.bf=b[2]||a.Mj,a.mh=b[4]||a.Jj}function vc(a,b,c){c&&a.fe||(a.nc=!a.H&&b[1]||a.sh,a.jf=!a.H&&b[3]||a.th,a.hf=!a.H&&b[5]||a.rh);if(c||void 0===c)a.gf=b[1]||a.sh,a.uh=b[3]||a.th,a.U=b[5]||a.rh}function Fb(a,b,c){a.Ea=b;a.ee=a.fe=0;c&&(c.F&&(a.F=c.F),(a.ee=c.ee)&&uc(a,wc,!1),(a.fe=c.fe)&&vc(a,wc,!1))}l.Lj=function(){return 255};l.sh=function(){};
l.Mj=function(a,b){return this.mc(a++,b++)|this.mc(a,b)<<8};l.Jj=function(a,b){return this.mc(a++,b++)|this.mc(a++,b++)<<8|this.mc(a++,b++)<<16|this.mc(a,b)<<24};l.th=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a,b>>8,c)};l.rh=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a++,b>>8&255,c++);this.nc(a++,b>>16&255,c++);this.nc(a,b>>>24,c)};l.Xm=function(a){return this.T[a>>2]>>>((a&3)<<3)&255};
l.jn=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b]>>a;return 24>a?c&65535:c&255|(this.T[b+1]&255)<<8};l.cn=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b];a&&(c=c>>>a|this.T[b+1]<<32-a);return c};l.vn=function(a,b){var c=a>>2;a=(a&3)<<3;this.T[c]=this.T[c]&~(255<<a)|b<<a;this.Da=!0};l.Hn=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.T[c]=this.T[c]&~(65535<<a)|b<<a:(this.T[c]=this.T[c]&16777215|b<<24,c++,this.T[c]=this.T[c]&-256|b>>8);this.Da=!0};
l.Bn=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.T[c]=this.T[c]&~d|b<<a;c++;this.T[c]=this.T[c]&d|b>>>32-a}else this.T[c]=b;this.Da=!0};l.Wm=function(a,b){this.F&&xc(this.F,b,1,!1);return this.zd(a,b)};l.hn=function(a,b){this.F&&xc(this.F,b,2,!1);return this.bf(a,b)};l.bn=function(a,b){this.F&&xc(this.F,b,4,!1);return this.mh(a,b)};l.un=function(a,b,c){this.F&&xc(this.F,c,1,!0);this.H||this.gf(a,b,c)};l.Gn=function(a,b,c){this.F&&xc(this.F,c,2,!0);this.H||this.uh(a,b,c)};
l.An=function(a,b,c){this.F&&xc(this.F,c,4,!0);this.H||this.U(a,b,c)};l.Zm=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.mc(a,b)};l.ln=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.af(a,b)};l.en=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.Md(a,b)};l.xn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.nc(a,b,c)};
l.Jn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.jf(a,b,c)};l.Dn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.hf(a,b,c)};l.$m=function(a,b){return yc(this.F,b,!1).mc(a,b)};l.mn=function(a,b){return yc(this.F,b,!1).af(a,b)};l.fn=function(a,b){return yc(this.F,b,!1).Md(a,b)};l.yn=function(a,b,c){yc(this.F,c,!0).nc(a,b,c)};l.Kn=function(a,b,c){yc(this.F,c,!0).jf(a,b,c)};l.En=function(a,b,c){yc(this.F,c,!0).hf(a,b,c)};l.Vm=function(a){return this.Fa[a]};
l.Ij=function(a){return this.Fa[a]};l.Ym=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.mc=this.Ij;return this.Fa[a]};l.gn=function(a){return this.K.getUint16(a,!0)};l.Nj=function(a){return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.kn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.af=this.Nj;return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.an=function(a){return this.K.getInt32(a,!0)};
l.Kj=function(a){return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.dn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.Md=this.Kj;return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.tn=function(a,b){this.Fa[a]=b;this.Da=!0};l.Wj=function(a,b){this.Fa[a]=b;this.Da=!0};l.wn=function(a,b){this.Fa[a]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.nc=this.Wj;this.J.Da=!0};
l.Fn=function(a,b){this.K.setUint16(a,b,!0);this.Da=!0};l.Yj=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.Da=!0};l.In=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.jf=this.Yj;this.J.Da=!0};l.zn=function(a,b){this.K.setInt32(a,b,!0);this.Da=!0};l.Xj=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.Da=!0};
l.Cn=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.hf=this.Xj;this.J.Da=!0};function zc(a){gb&&!Wb&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var nc=0,Vb=2,pc=5,rc=6,Ac=["black","blue","green","cyan"],Mb="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),mc=0,tc=[],Zb=[u.prototype.Xm,u.prototype.vn,u.prototype.jn,u.prototype.Hn,u.prototype.cn,u.prototype.Bn],wc=[u.prototype.Wm,u.prototype.un,u.prototype.hn,u.prototype.Gn,u.prototype.bn,u.prototype.An],sc=[u.prototype.Zm,u.prototype.xn,u.prototype.ln,u.prototype.Jn,u.prototype.en,u.prototype.Dn],qc=[u.prototype.$m,u.prototype.yn,u.prototype.mn,u.prototype.Kn,u.prototype.fn,u.prototype.En];
if(gb)var Yb=[u.prototype.Vm,u.prototype.tn,u.prototype.gn,u.prototype.Fn,u.prototype.an,u.prototype.zn],Xb=[u.prototype.Ij,u.prototype.Wj,u.prototype.Nj,u.prototype.Yj,u.prototype.Kj,u.prototype.Xj],Bc=[u.prototype.Ym,u.prototype.wn,u.prototype.kn,u.prototype.In,u.prototype.dn,u.prototype.Cn];
l.Mj=function(a,b){return this.mc(a++,b++)|this.mc(a,b)<<8};l.Jj=function(a,b){return this.mc(a++,b++)|this.mc(a++,b++)<<8|this.mc(a++,b++)<<16|this.mc(a,b)<<24};l.th=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a,b>>8,c)};l.rh=function(a,b,c){this.nc(a++,b&255,c++);this.nc(a++,b>>8&255,c++);this.nc(a++,b>>16&255,c++);this.nc(a,b>>>24,c)};l.Zm=function(a){return this.T[a>>2]>>>((a&3)<<3)&255};
l.ln=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b]>>a;return 24>a?c&65535:c&255|(this.T[b+1]&255)<<8};l.en=function(a){var b=a>>2;a=(a&3)<<3;var c=this.T[b];a&&(c=c>>>a|this.T[b+1]<<32-a);return c};l.xn=function(a,b){var c=a>>2;a=(a&3)<<3;this.T[c]=this.T[c]&~(255<<a)|b<<a;this.Da=!0};l.Jn=function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.T[c]=this.T[c]&~(65535<<a)|b<<a:(this.T[c]=this.T[c]&16777215|b<<24,c++,this.T[c]=this.T[c]&-256|b>>8);this.Da=!0};
l.Dn=function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.T[c]=this.T[c]&~d|b<<a;c++;this.T[c]=this.T[c]&d|b>>>32-a}else this.T[c]=b;this.Da=!0};l.Ym=function(a,b){this.F&&xc(this.F,b,1,!1);return this.zd(a,b)};l.kn=function(a,b){this.F&&xc(this.F,b,2,!1);return this.bf(a,b)};l.dn=function(a,b){this.F&&xc(this.F,b,4,!1);return this.mh(a,b)};l.wn=function(a,b,c){this.F&&xc(this.F,c,1,!0);this.H||this.gf(a,b,c)};l.In=function(a,b,c){this.F&&xc(this.F,c,2,!0);this.H||this.uh(a,b,c)};
l.Cn=function(a,b,c){this.F&&xc(this.F,c,4,!0);this.H||this.U(a,b,c)};l.an=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.mc(a,b)};l.nn=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.af(a,b)};l.gn=function(a,b){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.I;return this.J.Md(a,b)};l.zn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.nc(a,b,c)};
l.Ln=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.jf(a,b,c)};l.Fn=function(a,b,c){this.A.T[this.C]|=this.I;this.B.T[this.D]|=this.M;this.J.hf(a,b,c)};l.bn=function(a,b){return yc(this.F,b,!1).mc(a,b)};l.on=function(a,b){return yc(this.F,b,!1).af(a,b)};l.hn=function(a,b){return yc(this.F,b,!1).Md(a,b)};l.An=function(a,b,c){yc(this.F,c,!0).nc(a,b,c)};l.Mn=function(a,b,c){yc(this.F,c,!0).jf(a,b,c)};l.Gn=function(a,b,c){yc(this.F,c,!0).hf(a,b,c)};l.Xm=function(a){return this.Fa[a]};
l.Ij=function(a){return this.Fa[a]};l.$m=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.mc=this.Ij;return this.Fa[a]};l.jn=function(a){return this.K.getUint16(a,!0)};l.Nj=function(a){return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.mn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.af=this.Nj;return a&1?this.Fa[a]|this.Fa[a+1]<<8:this.qd[a>>1]};l.cn=function(a){return this.K.getInt32(a,!0)};
l.Kj=function(a){return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.fn=function(a){this.A.T[this.C]|=32;this.B.T[this.D]|=32;this.Md=this.Kj;return a&3?this.Fa[a]|this.Fa[a+1]<<8|this.Fa[a+2]<<16|this.Fa[a+3]<<24:this.T[a>>2]};l.vn=function(a,b){this.Fa[a]=b;this.Da=!0};l.Wj=function(a,b){this.Fa[a]=b;this.Da=!0};l.yn=function(a,b){this.Fa[a]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.nc=this.Wj;this.J.Da=!0};
l.Hn=function(a,b){this.K.setUint16(a,b,!0);this.Da=!0};l.Yj=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.Da=!0};l.Kn=function(a,b){a&1?(this.Fa[a]=b,this.Fa[a+1]=b>>8):this.qd[a>>1]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.jf=this.Yj;this.J.Da=!0};l.Bn=function(a,b){this.K.setInt32(a,b,!0);this.Da=!0};l.Xj=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.Da=!0};
l.En=function(a,b){a&3?(this.Fa[a]=b,this.Fa[a+1]=b>>8,this.Fa[a+2]=b>>16,this.Fa[a+3]=b>>24):this.T[a>>2]=b;this.A.T[this.C]|=32;this.B.T[this.D]|=96;this.hf=this.Xj;this.J.Da=!0};function zc(a){gb&&!Wb&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
var nc=0,Vb=2,pc=5,rc=6,Ac=["black","blue","green","cyan"],Mb="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),mc=0,tc=[],Zb=[u.prototype.Zm,u.prototype.xn,u.prototype.ln,u.prototype.Jn,u.prototype.en,u.prototype.Dn],wc=[u.prototype.Ym,u.prototype.wn,u.prototype.kn,u.prototype.In,u.prototype.dn,u.prototype.Cn],sc=[u.prototype.an,u.prototype.zn,u.prototype.nn,u.prototype.Ln,u.prototype.gn,u.prototype.Fn],qc=[u.prototype.bn,u.prototype.An,u.prototype.on,u.prototype.Mn,u.prototype.hn,u.prototype.Gn];
if(gb)var Yb=[u.prototype.Xm,u.prototype.vn,u.prototype.jn,u.prototype.Hn,u.prototype.cn,u.prototype.Bn],Xb=[u.prototype.Ij,u.prototype.Wj,u.prototype.Nj,u.prototype.Yj,u.prototype.Kj,u.prototype.Xj],Bc=[u.prototype.$m,u.prototype.yn,u.prototype.mn,u.prototype.Kn,u.prototype.fn,u.prototype.En];
function Cc(a,b){t.call(this,"CPU",a);b=a.cycles||b;var c=a.multiplier||1;this.R={};this.R.Wc=b;this.R.xd=c;this.R.Hf=Math.round(this.R.Wc/1E4)/100;this.R.qe=this.R.Hf*this.R.xd;this.ca.Ib=!1;this.ca.Tj=!1;this.ca.Ee=a.autoStart;this.ca.ii=!1;this.ca.Af=!1;this.R.Jf=this.R.re=0;this.R.Kf=a.csStart;this.R.Je=a.csInterval;this.R.Ke=a.csStop;this.Kl=this.$f.bind(this);eb(this)}ba(Cc,t);l=Cc.prototype;
l.hc=function(a,b,c,d){this.oa=a;this.ma=b;this.Ea=d;for(b=0;b<Dc.length;b++)(c=this.ia[Dc[b]])&&this.oa.wb(null,Dc[b],c);this.Ud=nb(a,"FPU");this.V=nb(a,"ChipSet");a=Ec(a,"autoStart");null!=a&&(this.ca.Ee="true"==a?!0:"false"==a?!1:!!a);eb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.Ob=function(a,b){if(!b){if(a&&this.restore){Fc(this);if(!this.restore(a))return!1;Gc(this)}else this.reset();this.lc("No debugger detected")}Hc(this);return!0};
l.Nb=function(a){return a?this.save():!0};l.Ee=function(){return this.ca.Ee||void 0===this.ia.run?(this.$f(),!0):!1};l.ri=function(){return 0};function Gc(a){void 0===a.R.Kf&&(a.R.Kf=0);void 0===a.R.Je&&(a.R.Je=-1);void 0===a.R.Ke&&(a.R.Ke=-1);a.ca.Af=0<=a.R.Kf&&0<a.R.Je;a.ca.Af&&(a.R.Jf=0,a.R.re=a.R.Kf-a.ld)}
l.wb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.ia[b]=c;a=!0;break;case "run":this.ia[b]=c;c.onclick=function(){var a;if(a=d.oa)if(a=d.oa,a.ca.Pb)a=!0;else{var b=null,c,h=Qa(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.ca.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.ca.Pb);c++);c==h.length&&(b=a);r("The "+b.type+" component ("+b.id+") is not "+(b.ca.ready?"powered yet":"ready yet"+(b.Ff?" (waiting for notification)":""))+".");a=!1}a&&(d.ca.Ib?Ic(d,!0):
d.$f(!0))};a=!0;break;case "speed":this.ia[b]=c;a=!0;break;case "setSpeed":this.ia[b]=c,c.onclick=function(){Jc(d,d.R.xd<<1,!0)},c.textContent=this.R.qe.toFixed(2)+"Mhz",a=!0}return a};function Kc(a,b){a.ca.Ib&&(b=a.A-b,a.A-=b,a.Hc-=b)}function Lc(a,b,c){a.ld+=b;c&&(a.Hc=a.A=0)}
function Mc(a,b){var c=Nc;c<Oc&&(c=Oc);c<Pc&&(c=Pc);var d=1;b&&1<a.R.xd&&a.R.vd&&(d=a.R.vd/a.R.Hf);a.R.Ai=Math.round(1E3/Nc);a.R.Rl=Math.floor(a.R.Wc/c*d);a.R.xg=Math.floor(a.R.Wc/Nc*d);a.R.Ci=Math.floor(a.R.Wc/Oc*d);a.R.Bi=Math.floor(a.R.Wc/Pc*d);b||(a.R.Ne=a.R.xg,a.R.Me=a.R.Ci,a.R.Le=a.R.Bi);a.R.yg=0}function Qc(a,b){var c=a.ld+a.Rc+a.Hc-a.A;b&&1<a.R.xd&&a.R.vd>a.R.Hf&&(c=Math.round(c/a.R.xd));return c}function Fc(a){a.R.vd=0;a.ld=a.Rc=a.Hc=a.A=0;Gc(a);Jc(a,1)}
function Mc(a,b){var c=Nc;c<Oc&&(c=Oc);c<Pc&&(c=Pc);var d=1;b&&1<a.R.xd&&a.R.vd&&(d=a.R.vd/a.R.Hf);a.R.Ai=Math.round(1E3/Nc);a.R.Tl=Math.floor(a.R.Wc/c*d);a.R.xg=Math.floor(a.R.Wc/Nc*d);a.R.Ci=Math.floor(a.R.Wc/Oc*d);a.R.Bi=Math.floor(a.R.Wc/Pc*d);b||(a.R.Ne=a.R.xg,a.R.Me=a.R.Ci,a.R.Le=a.R.Bi);a.R.yg=0}function Qc(a,b){var c=a.ld+a.Rc+a.Hc-a.A;b&&1<a.R.xd&&a.R.vd>a.R.Hf&&(c=Math.round(c/a.R.xd));return c}function Fc(a){a.R.vd=0;a.ld=a.Rc=a.Hc=a.A=0;Gc(a);Jc(a,1)}
function Jc(a,b,c){if(void 0!==b){.8>a.R.vd/a.R.qe&&(b=1);a.R.xd=b;b=a.R.Hf*a.R.xd;if(a.R.qe!=b){a.R.qe=b;b=a.R.qe.toFixed(2)+"Mhz";var d=a.ia.setSpeed;d&&(d.textContent=b);a.lc("target speed: "+b)}c&&a.oa&&Rc(a.oa)}Lc(a,a.Rc);a.Rc=0;a.R.wd=sa();a.R.Jd=0;Mc(a)}
l.$f=function(a){if(fb(this,!0)){if(!this.ca.Ib){Jc(this);this.oa&&this.oa.start(this.R.wd,Qc(this));this.ca.Ib=!0;this.ca.Tj=!0;this.V&&this.V.start();var b=this.ia.run;b&&(b.textContent="Halt");this.oa&&(Sc(this.oa,!0),a&&Rc(this.oa,!0))}this.R.yg>=this.R.Wc&&Mc(this,!0);this.R.Oe=0;this.R.If=sa();this.R.Jd&&(a=this.R.If-this.R.Jd,a>this.R.Ai&&(this.R.wd+=a,this.R.wd>this.R.If&&(this.R.wd=this.R.If)));try{do{var c=this.ca.Af?1:this.R.Rl;if(this.V){Tc(this.V);var d=this.V;a=c;var e=d.H[0];if(e.Gd){var f=
l.$f=function(a){if(fb(this,!0)){if(!this.ca.Ib){Jc(this);this.oa&&this.oa.start(this.R.wd,Qc(this));this.ca.Ib=!0;this.ca.Tj=!0;this.V&&this.V.start();var b=this.ia.run;b&&(b.textContent="Halt");this.oa&&(Sc(this.oa,!0),a&&Rc(this.oa,!0))}this.R.yg>=this.R.Wc&&Mc(this,!0);this.R.Oe=0;this.R.If=sa();this.R.Jd&&(a=this.R.If-this.R.Jd,a>this.R.Ai&&(this.R.wd+=a,this.R.wd>this.R.If&&(this.R.wd=this.R.If)));try{do{var c=this.ca.Af?1:this.R.Tl;if(this.V){Tc(this.V);var d=this.V;a=c;var e=d.H[0];if(e.Gd){var f=
(Qc(d.U,d.V)-e.fd)/d.za|0,g=Uc(d,0)-f;e.mode==Vc&&(g-=f);var h=g*d.za|0;e.mode==Vc&&(h>>=1);a>h&&(a=h)}var c=a,k=this.V;a=c;if(k.A&&k.A[Wc]&Xc){var m=k.X-Qc(k.U,k.V);0<m&&a>m&&(a=m)}c=a}try{this.yh(c)}catch(y){if("number"!=typeof y)throw y;}var q=this.Hc-this.A;this.Rc+=q;this.R.Oe+=q;Lc(this,0,!0);a=q;this.ca.Af&&(b=!1,this.R.Jf=this.R.Jf+this.ri()|0,this.R.re-=a,0>=this.R.re&&(this.R.re+=this.R.Je,b=!0),0<=this.R.Ke&&this.R.Ke<=Qc(this)&&(this.R.Je=this.R.Ke=-1,Gc(this),Ic(this),b=!0),b&&this.lc(Qc(this)+
" cycles: checksum="+ga(this.R.Jf)));this.R.Me-=q;0>=this.R.Me&&(this.R.Me+=this.R.Ci,this.oa&&Yc(this.oa));this.R.Le-=q;0>=this.R.Le&&(this.R.Le+=this.R.Bi,this.oa&&Sc(this.oa));this.R.Ne-=q;if(0>=this.R.Ne){this.R.Ne+=this.R.xg;break}}while(this.ca.Ib)}catch(y){Ic(this);Hc(this);this.oa&&this.oa.stop(sa(),Qc(this));fb(this,!1);cb(this,y.stack||y.message);return}c=setTimeout;d=this.Kl;this.R.Jd=sa();e=this.R.Ai;this.R.Oe&&(e=Math.round(e*this.R.Oe/this.R.xg));e-=this.R.Jd-this.R.If;if(f=this.R.Jd-
this.R.wd)this.R.vd=Math.round(this.Rc/(10*f))/100,864E5<=f&&(this.ld=0,this.V&&Tc(this.V,!0),Jc(this));if(0>e||this.R.vd<this.R.qe)-1E3>e&&(this.R.wd-=e),e=0;this.R.yg+=this.R.Oe;this.R.Jd+=e;c(d,e)}else Hc(this),this.oa&&this.oa.stop(sa(),Qc(this))};l.yh=function(){return 0};function Ic(a,b){a.ca.wf&&(a.ca.lg=!0);a.Hc-=a.A;a.A=0;Lc(a,a.Rc);a.Rc=0;if(a.ca.Ib){a.ca.Ib=!1;a.V&&a.V.stop();var c=a.ia.run;c&&(c.textContent="Run")}a.ca.complete=b}
function Hc(a){a.oa&&(Yc(a.oa,void 0),Sc(a.oa,void 0))}var Nc=30,Oc=60,Pc=2,Dc=["power","reset"];function Zc(a,b,c,d){this.B=a;this.Ea=a.Ea;this.id=b;this.Yf=c||"";this.ha=0;this.Ta=65535;this.C=this.Ta+1;this.ob=this.gc=this.ext=this.jb=this.type=this.va=0;this.$b=-1;this.S=this.Jc=2;this.O=this.ra=65535;this.J=this.zi;this.H=this.ei;this.I=this.gi;this.A={ha:-1,va:0,Ta:0,jb:0,type:0,ext:0,$b:-1};1==this.id&&(this.Ze=0,this.D=null,this.ne=!1,this.G=Array(32),this.F=[]);$c(this,!0,d)}l=Zc.prototype;
l.zi=function(a){this.ha=a&65535;return this.va=this.ha<<4};l.Gf=function(a,b){var c,d,e=this.B;a&=65535;a&4?(c=e.jc.va,d=c+e.jc.Ta|0):(c=e.Kb,d=e.Oc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,ad(this,c,a,b);this.id<bd&&v.call(e,b&&this.id==cd?10:13,a&65532)}return-1};l.Nl=function(a){var b=this.B;a=b.Tb+(a<<2);var c=b.fa(a);b.N&=-769;return this.load(b.fa(a+2))+c|0};
l.Ml=function(a){var b=this.B;a<<=3;var c=b.Tb+a|0;if(7<=(b.Pc-c|0))return this.D=!0,a=ad(this,c,a),-1!==a&&(a+=this.Ze),a;v.call(b,13,a|2);return-1};l.ei=function(a){return this.va+a|0};l.gi=function(a){return this.va+a|0};l.di=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.yf()};l.lk=function(a,b){return(a>>>0)+b>this.C?this.va+a|0:this.yf()};l.yf=function(){v.call(this.B,13,0);return-1};l.fi=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.zf()};
l.zi=function(a){this.ha=a&65535;return this.va=this.ha<<4};l.Gf=function(a,b){var c,d,e=this.B;a&=65535;a&4?(c=e.jc.va,d=c+e.jc.Ta|0):(c=e.Kb,d=e.Oc);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,ad(this,c,a,b);this.id<bd&&v.call(e,b&&this.id==cd?10:13,a&65532)}return-1};l.Ol=function(a){var b=this.B;a=b.Tb+(a<<2);var c=b.fa(a);b.N&=-769;return this.load(b.fa(a+2))+c|0};
l.Nl=function(a){var b=this.B;a<<=3;var c=b.Tb+a|0;if(7<=(b.Pc-c|0))return this.D=!0,a=ad(this,c,a),-1!==a&&(a+=this.Ze),a;v.call(b,13,a|2);return-1};l.ei=function(a){return this.va+a|0};l.gi=function(a){return this.va+a|0};l.di=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.yf()};l.lk=function(a,b){return(a>>>0)+b>this.C?this.va+a|0:this.yf()};l.yf=function(){v.call(this.B,13,0);return-1};l.fi=function(a,b){return(a>>>0)+b<=this.C?this.va+a|0:this.zf()};
l.mk=function(a,b){return(a>>>0)+b>this.C?this.va+a|0:this.zf()};l.zf=function(){v.call(this.B,13,0);return-1};function dd(a,b,c,d,e){a.ha=b;a.va=d;a.Ta=e;a.C=(e>>>0)+1;a.jb=c;a.type=c&7936;a.ext=c>>16&192;a.$b=(b&4?a.B.jc.va:a.B.Kb)+(b&65528)|0;a.id<ed&&$c(a,!0)}function fd(a,b,c){var d=a.B,e=d.fa(b+2),f=d.fa(b)|(e&255)<<16,d=d.fa(b+4);a.ha=c;a.va=f;a.Ta=d;a.C=(d>>>0)+1;a.jb=e;a.type=e&7936;a.ext=0;a.$b=b;a.id<ed&&$c(a,!0)}
function ad(a,b,c,d){var e=a.B;if(!d&&c===a.A.ha)return a.ha=c,a.va=a.A.va,a.Ta=a.A.Ta,a.C=(a.A.Ta>>>0)+1,a.jb=a.A.jb,a.type=a.A.type,a.ext=a.A.ext,a.$b=a.A.$b,a.A.ha=-1,$c(a,!0,!0,!1),a.va;a.A.ha=-1;var f=e.fa(b+0),g=e.fa(b+4),h=g&7936,k=e.fa(b+2)|(g&255)<<16,m=e.fa(b+6),q=c&65528;if(80386<=e.aa){var y=f,k=k|(m&65280)<<16,f=f|(m&15)<<16;m&128&&(f=f<<12|4095)}switch(a.id){case gd:var w=a.D;a.ne=!1;if(w&&c==hd&&a.F.length){var z=a.F[a.Ze-1];if(z&&!z())return-1}var B=c&3,S=(g&24576)>>13,z=-1,X,ca;q||
b>=e.Kb&&b<e.Oc&&(h=0);if(6144<=h)null!=d?z=0:!1!==w?(h&1024?S<=a.ob&&(z=0):B<=a.ob&&S==a.ob&&(z=0),z||(c=c&-4|a.ob&3)):B>=a.ob&&(B>a.ob&&(z=x(e),id(e,x(e),!0),A(e,z),a.ne=!0),z=0);else{if(256==h||2304==h)return jd(a,c,w)?a.va:-1;if(1024==h)z=2,ca=0,B<a.ob&&(B=a.ob);else if(3072==h)z=4,ca=0,B<a.ob&&(B=a.ob);else if(1536==h)z=2,ca=148224;else if(3584==h)z=4,ca=148224;else if(1792==h)z=2,ca=147712;else if(3840==h)z=4,ca=147712;else if(1280==h)return jd(a,k&65535,w)?a.va:-1}0<z&&!(g&32768)&&(z=0);if(0<
@ -132,8 +132,8 @@ function jd(a,b,c){var d=a.B,e=a.ob,f=d.la.ha,g=d.la.va;if(!c){if(!(d.la.type&51
34,d.ua.ha),d.Wa(g+36,d.ga.ha),d.Wa(g+38,d.W.ha),d.Wa(g+40,d.Ca.ha),d.jc.load(d.fa(h+42)),td(d,d.fa(h+16)|(c?16384:0)),d.F=d.fa(h+18),d.H=d.fa(h+20),d.K=d.fa(h+22),d.G=d.fa(h+24),d.L=d.fa(h+28),d.J=d.fa(h+30),d.I=d.fa(h+32),d.ua.load(d.fa(h+34)),d.Ca.load(d.fa(h+40)),ud(d,d.fa(h+14),d.fa(h+36)),b=38,g=26,a.ob<e&&(g=(a.ob<<2)+2,b=g+2),id(d,d.fa(h+b),!0),A(d,d.fa(h+g))):(d.Pa(g+28,d.md),d.Pa(g+32,E(d)),d.Pa(g+36,sd(d)),d.Pa(g+40,d.F),d.Pa(g+44,d.H),d.Pa(g+48,d.K),d.Pa(g+52,d.G),d.Pa(g+56,C(d)),d.Pa(g+
60,d.L),d.Pa(g+64,d.J),d.Pa(g+68,d.I),d.Pa(g+72,d.ua.ha),d.Pa(g+76,d.ga.ha),d.Pa(g+80,d.W.ha),d.Pa(g+84,d.Ca.ha),d.Pa(g+88,d.qb.ha),d.Pa(g+92,d.rb.ha),vd.call(d,d.da(h+28)),d.jc.load(d.fa(h+96)),td(d,d.da(h+36)|(c?16384:0)),d.F=d.da(h+40),d.H=d.da(h+44),d.K=d.da(h+48),d.G=d.da(h+52),d.L=d.da(h+60),d.J=d.da(h+64),d.I=d.da(h+68),d.ua.load(d.fa(h+72)),d.Ca.load(d.fa(h+84)),d.qb.load(d.fa(h+88)),d.rb.load(d.fa(h+92)),ud(d,d.da(h+32),d.fa(h+76)),b=80,g=56,a.ob<e&&(g=(a.ob<<3)+4,b=g+4),id(d,d.fa(h+b),!0),
A(d,d.da(h+g)));c&&d.Wa(h+0,f);d.pa|=8;return!0}l.save=function(){return[this.ha,this.va,this.Ta,this.jb,this.id,this.Yf,this.ob,this.gc,this.$b,this.Jc,this.ra,this.S,this.O,this.type,this.C]};l.restore=function(a){"number"==typeof a?this.load(a):(this.ha=a[0],this.va=a[1],this.Ta=a[2],this.jb=a[3],this.id=a[4],this.Yf=a[5],this.ob=a[6],this.gc=a[7],this.$b=a[8],this.Jc=a[9]||2,this.ra=a[10]||65535,this.S=a[11]||2,this.O=a[12]||65535,this.type=a[13]||this.jb&7936,this.C=a[14]||(this.Ta>>>0)+1)};
function $c(a,b,c,d){void 0===c&&(c=!!(a.B.pa&1));a.ud=!1;if(c)if(a.load=a.Gf,a.yi=a.Ml,a.Lb=a.di,a.Mb=a.fi,void 0===d&&(d=!!(a.B.N&131072)),d)a.load=a.J,a.Lb=a.H,a.Mb=a.I,a.ob=a.gc=3,a.S=2,a.O=a.ra=65535,a.Ta=65535,a.C=a.Ta+1,a.Jc=a.S,a.$b=-1,a.ne=!1;else{if(!(a.ha&-4))a.Lb=a.yf,a.Mb=a.zf;else if(a.type&4096){6144==(a.type&6656)&&(a.Lb=a.yf);if(a.type&2048||!(a.type&512))a.Mb=a.zf;1024==(a.type&3072)&&(a.Lb==a.di&&(a.Lb=a.lk),a.Mb==a.fi&&(a.Mb=a.mk),a.ud=!0);b&&a.id<bd&&a.ha&-4&&-1!==a.$b&&(c=a.$b+
5,d=a.B.Eb(c),d&1||a.B.Dc(c,d|1))}b&&(a.ob=a.ha&3,a.gc=(a.jb&24576)>>13,80386>a.B.aa||!(a.ext&64)?(a.S=2,a.O=65535):(a.S=4,a.O=-1),a.Jc=a.S,a.ra=a.O)}else a.load=a.zi,a.yi=a.Nl,a.Lb=a.ei,a.Mb=a.gi,a.ob=a.gc=0,a.$b=-1,a.ne=!1}var gd=1,rd=2,cd=3,ed=4,bd=6,hd=1;
function $c(a,b,c,d){void 0===c&&(c=!!(a.B.pa&1));a.ud=!1;if(c)if(a.load=a.Gf,a.yi=a.Nl,a.Lb=a.di,a.Mb=a.fi,void 0===d&&(d=!!(a.B.N&131072)),d)a.load=a.J,a.Lb=a.H,a.Mb=a.I,a.ob=a.gc=3,a.S=2,a.O=a.ra=65535,a.Ta=65535,a.C=a.Ta+1,a.Jc=a.S,a.$b=-1,a.ne=!1;else{if(!(a.ha&-4))a.Lb=a.yf,a.Mb=a.zf;else if(a.type&4096){6144==(a.type&6656)&&(a.Lb=a.yf);if(a.type&2048||!(a.type&512))a.Mb=a.zf;1024==(a.type&3072)&&(a.Lb==a.di&&(a.Lb=a.lk),a.Mb==a.fi&&(a.Mb=a.mk),a.ud=!0);b&&a.id<bd&&a.ha&-4&&-1!==a.$b&&(c=a.$b+
5,d=a.B.Eb(c),d&1||a.B.Dc(c,d|1))}b&&(a.ob=a.ha&3,a.gc=(a.jb&24576)>>13,80386>a.B.aa||!(a.ext&64)?(a.S=2,a.O=65535):(a.S=4,a.O=-1),a.Jc=a.S,a.ra=a.O)}else a.load=a.zi,a.yi=a.Ol,a.Lb=a.ei,a.Mb=a.gi,a.ob=a.gc=0,a.$b=-1,a.ne=!1}var gd=1,rd=2,cd=3,ed=4,bd=6,hd=1;
function wd(a){var b=+a.model||8088,c;switch(b){default:c=4772727;break;case 80286:c=6E6;break;case 80386:c=16E6}Cc.call(this,a,c);this.aa=b;a=a.stepping;this.od=b+(a?fa(a,16):0);this.Uh=61442;this.nd=1792;this.Th=28672;this.kf=4;this.Ha=255;this.B=80286<=this.aa?ib:hb;this.qa=xd;this.ci=yd;this.hi=zd;this.li=Ad;if(80186<=this.aa&&(this.qa=xd.slice(),this.ci=yd.slice(),this.hi=zd.slice(),this.Ha=31,this.qa[15]=Bd,this.qa[96]=Cd,this.qa[97]=Dd,this.qa[98]=Ed,this.qa[99]=Bd,this.qa[100]=Bd,this.qa[101]=
Bd,this.qa[102]=Bd,this.qa[103]=Bd,this.qa[104]=Fd,this.qa[105]=Gd,this.qa[106]=Hd,this.qa[107]=Id,this.qa[108]=Jd,this.qa[109]=Kd,this.qa[110]=Ld,this.qa[111]=Md,this.qa[192]=Nd,this.qa[193]=Od,this.qa[200]=Pd,this.qa[201]=Qd,this.qa[241]=Rd,this.ci[7]=Sd,this.hi[7]=Sd,80286<=this.aa)){this.Uh=2;this.nd|=28672;this.kf=0;this.qa[15]=Td;this.kd=Ud.slice();for(b=0;b<this.kd.length;b++)this.kd[b]||(this.kd[b]=Vd);this.qa[84]=Wd;this.qa[99]=Xd;if(80386<=this.aa){var d;this.Th=0;this.nd|=196608;this.qa[100]=
Yd;this.qa[101]=Zd;this.qa[102]=$d;this.qa[103]=ae;for(d in F)this.kd[+d]=F[+d];80546<=this.od&&80562>=this.od&&(this.kd[166]=be,this.kd[167]=ce)}}this.nf=[];this.ai=[];this.bg=0;Fc(this);this.ca.complete=this.ca.pk=!1;this.pi=0;this.Nc=this.X=[];this.yb=this.vh=this.xb=this.lf=this.xe=this.ye=this.Ic=0;de(this)}ba(wd,Cc);
@ -141,8 +141,8 @@ function Lb(a){var b;if(a.X===a.Nc){a.X=Array(a.lf);a.pf=new u(null,0,0,pc,null,
function yc(a,b,c,d){var e=(b&-4194304)>>>20,f=a.Nc[(a.md+e&a.ye)>>>a.yb],g=f.Md(e);if(!(g&1))return d||fe.call(a,b,!1,c),a.ze;if(!(g&4)&&3==a.Ga)return d||fe.call(a,b,!0,c),a.ze;var h=(b&4190208)>>>10,g=a.Nc[((g&-4096)+h&a.ye)>>>a.yb],k=g.Md(h);if(!(k&1))return d||fe.call(a,b,!1,c),a.ze;if(!(k&4)&&3==a.Ga)return d||fe.call(a,b,!0,c),a.ze;c=a.Nc[((k&-4096)+(b&4095)&a.ye)>>>a.yb];if(d)return c;d=b>>>a.yb;k=a.X[d];b&=-4096;var m;0<a.qf?(m=a.Wh[--a.qf],m.Gl(b)):m=new u(b,0,0,rc);b=m;b.J=c;b.A=f;b.C=
e>>2;b.B=g;b.D=h>>2;gb&&Wb&&c.T&&!c.controller&&!c.ee&&!c.fe?(b.Fa=c.Fa,b.qd=c.qd,b.T=c.T,Rb(b,Bc)):(b.I=c?zc(32):0,b.M=c?zc(96):0,Rb(b,sc));Fb(b,a.Ea,k);a.X[d]=b;a.mf.push(d);return b}function ge(a){a.X!==a.Nc&&(a.X=a.Nc,a.pf=null,a.mf=null,a.ze=null)}l=wd.prototype;l.reset=function(){this.ca.Ib&&Ic(this);de(this);Fc(this);this.ca.error=!1};
function he(a,b){var c;switch(b){case 0:c=a.F;break;case 1:c=a.H;break;case 2:c=a.K;break;case 3:c=a.G;break;case 4:c=C(a);break;case 5:c=a.L;break;case 6:c=a.J;break;case 7:c=a.I}return c}function ie(a,b,c){switch(b){case 0:a.F=c;break;case 1:a.H=c;break;case 2:a.K=c;break;case 3:a.G=c;break;case 4:A(a,c);break;case 5:a.L=c;break;case 6:a.J=c;break;case 7:a.I=c}}
function de(a){a.F=0;a.G=0;a.H=0;a.K=0;a.ic=0;a.L=0;a.J=0;a.I=0;a.cc=!1;a.za=a.Va=0;a.ta=0;a.oi=0;a.Z=0;a.pa=65520;a.Tb=0;a.Pc=1023;a.N=a.Wb=0;a.Yd=a.Be=a.Xd=a.Zd=0;a.xc=-1;a.Sc=a.yc=-1;a.ad=a.na=-1;a.ga=new Zc(a,gd,"CS");a.Ca=new Zc(a,rd,"DS");a.ua=new Zc(a,rd,"ES");a.W=new Zc(a,cd,"SS");A(a,0);id(a,0);if(80386<=a.aa){switch(a.od){case 80562:case 80563:a.K=771;break;case 80578:a.K=772;break;case 80594:a.K=773;break;case 80595:case 80596:a.K=776}a.pa=16;a.xi=0;a.Wd=0;a.md=0;a.Bb=[0,0,0,0,null,null,
0,0];a.rf=[null,null,null,null,null,null,0,0];a.qb=new Zc(a,rd,"FS");a.rb=new Zc(a,rd,"GS");ge(a)}a.eg=new Zc(a,0,"NULL");a.Ba=a.Ca;a.Db=a.W;a.M=a.ba=0;a.C=a.D=-1;a.Xa=a.eg;a.Ka=0;if(80286>a.aa)ud(a,0,65535);else{a.Kb=0;a.Oc=65535;a.jc=new Zc(a,5,"LDT",!0);a.la=new Zc(a,ed,"TSS",!0);a.bb=new Zc(a,bd,"VER",!0);ud(a,65520,61440);var b,c=E(a);b=a.ga;var d=-65536;80386>b.B.aa&&(d&=16777215);b=b.va=d;a.ea=b+c|0;a.cg=(b>>>0)+(a.ga.Ta>>>0)+1}td(a,0);kd(a)}
function de(a){a.F=0;a.G=0;a.H=0;a.K=0;a.ic=0;a.L=0;a.J=0;a.I=0;a.cc=!1;a.za=a.Va=0;a.Ml=[0,0];a.Ql=[0,0];a.ta=0;a.oi=0;a.Z=0;a.pa=65520;a.Tb=0;a.Pc=1023;a.N=a.Wb=0;a.Yd=a.Be=a.Xd=a.Zd=0;a.xc=-1;a.Sc=a.yc=-1;a.ad=a.na=-1;a.ga=new Zc(a,gd,"CS");a.Ca=new Zc(a,rd,"DS");a.ua=new Zc(a,rd,"ES");a.W=new Zc(a,cd,"SS");A(a,0);id(a,0);if(80386<=a.aa){switch(a.od){case 80562:case 80563:a.K=771;break;case 80578:a.K=772;break;case 80594:a.K=773;break;case 80595:case 80596:a.K=776}a.pa=16;a.xi=0;a.Wd=0;a.md=0;
a.Bb=[0,0,0,0,null,null,0,0];a.rf=[null,null,null,null,null,null,0,0];a.qb=new Zc(a,rd,"FS");a.rb=new Zc(a,rd,"GS");ge(a)}a.eg=new Zc(a,0,"NULL");a.Ba=a.Ca;a.Db=a.W;a.M=a.ba=0;a.C=a.D=-1;a.Xa=a.eg;a.Ka=0;if(80286>a.aa)ud(a,0,65535);else{a.Kb=0;a.Oc=65535;a.jc=new Zc(a,5,"LDT",!0);a.la=new Zc(a,ed,"TSS",!0);a.bb=new Zc(a,bd,"VER",!0);ud(a,65520,61440);var b,c=E(a);b=a.ga;var d=-65536;80386>b.B.aa&&(d&=16777215);b=b.va=d;a.ea=b+c|0;a.cg=(b>>>0)+(a.ga.Ta>>>0)+1}td(a,0);kd(a)}
function je(a){2==a.Jc?(a.vi=a.fa,a.Vb=ke,a.bc=le,a.Qc=me,2==a.S?(a.ja=ne,a.wa=oe,a.$a=pe):(a.ja=qe,a.wa=re,a.$a=se)):(a.vi=a.da,a.Vb=te,a.bc=ue,a.Qc=ve,2==a.S?(a.ja=we,a.wa=xe,a.$a=ye):(a.ja=ze,a.wa=Ae,a.$a=Be))}function ld(a,b){a.S!=b&&(a.ba|=1024,a.S=b,a.O=2==b?65535:-1,Ce(a))}function Ce(a){2==a.S?(a.sb=32768,a.ib=a.fa,a.nb=a.Wa,2==a.Jc?(a.ja=ne,a.wa=oe,a.$a=pe):(a.ja=we,a.wa=xe,a.$a=ye)):(a.sb=-2147483648,a.ib=a.da,a.nb=a.Pa,2==a.Jc?(a.ja=qe,a.wa=re,a.$a=se):(a.ja=ze,a.wa=Ae,a.$a=Be))}
function De(a){a.Jc=a.ga.Jc;a.ra=a.ga.ra;je(a);a.S=a.ga.S;a.O=a.ga.O;Ce(a);a.ba&=-3073}l.ri=function(){var a=this.F+this.G+this.H+this.K+C(this)+this.L+this.J+this.I|0;return a=a+E(this)+this.ga.ha+this.Ca.ha+this.W.ha+this.ua.ha+sd(this)|0};function Ee(a,b,c){void 0===a.nf[b]&&(a.nf[b]=[]);a.nf[b].push(c)}function Fe(a,b){var c=a.ai[b];null!=c&&(c(--a.bg),delete a.ai[b])}
function Ge(a,b){for(var c=a.Bb[7],d=c>>16,e=0;4>e;e++){if(c&3){var f=!!(d&1),g=a.Bb[e],g=g&~(d>>2&3);if(b){var g=a.X[g>>>a.yb],h=a;f?g.fe++||(h&&(g.F=h),vc(g,wc,!1)):g.ee++||(h&&(g.F=h),uc(g,wc,!1))}else g=a.X[g>>>a.yb],f?--g.fe||(f=g,f.nc=f.H?f.sh:f.gf,f.jf=f.H?f.th:f.uh,f.hf=f.H?f.rh:f.U):--g.ee||(f=g,f.mc=f.zd,f.af=f.bf,f.Md=f.mh)}c>>=2;d>>=4}}
@ -219,7 +219,7 @@ function Zh(a,b){var c=a-b|0;Oe(this,a,b,c,this.sb|63,!0);this.A-=-1===this.D?-1
function ci(a,b){return b>>(this.F&this.O)&(1<<(this.H&31))-1&this.O}function di(a,b){if(-1===this.C){switch(this.Z&7){case 0:this.F=this.F&-256|a;break;case 1:this.H=this.H&-256|a;break;case 2:this.K=this.K&-256|a;break;case 3:this.G=this.G&-256|a;break;case 4:this.F=this.F&-65281|a<<8;break;case 5:this.H=this.H&-65281|a<<8;break;case 6:this.K=this.K&-65281|a<<8;break;case 7:this.G=this.G&-65281|a<<8}this.A-=this.B.ih}else this.D=this.C,kf(this,a),this.A-=this.B.hh;return b}
function ei(a,b){if(-1===this.C){switch(this.Z&7){case 0:this.F=this.F&~this.O|a;break;case 1:this.H=this.H&~this.O|a;break;case 2:this.K=this.K&~this.O|a;break;case 3:this.G=this.G&~this.O|a;break;case 4:A(this,C(this)&~this.O|a);break;case 5:this.L=this.G&~this.O|a;break;case 6:this.J=this.J&~this.O|a;break;case 7:this.I=this.I&~this.O|a}this.A-=this.B.ih}else this.D=this.C,this.M&2||this.nb(this.Xa.Mb(this.ab,this.S),a),this.A-=this.B.hh;return b}
function fi(a,b){a^=b;H(this,a,128);this.A-=-1===this.D?-1===this.C?this.B.Xb:this.B.vb:this.B.kc;return a}function gi(a,b){this.A-=-1===this.D?-1===this.C?this.B.Xb:this.B.vb:this.B.kc;return H(this,a^b,this.sb)&this.O}function hi(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function ii(a){var b=a-1|0;Oe(this,a,1,b,this.sb|62,!0);this.A-=2;return a&~this.O|b&this.O}
function ji(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1;c=[c>>>0,0];for(a=[a>>>0,b>>>0];0<hi(a,c);){var f=b=c;b[0]+=f[0];b[1]+=f[1];4294967295<b[0]&&(b[0]>>>=0,b[1]++);e+=e}do 0<=hi(a,c)&&(b=a,f=c,b[0]-=f[0],b[1]-=f[1],0>b[0]&&(b[0]>>>=0,b[1]--),d+=e),b=c,b[0]>>>=1,b[1]&1&&(b[0]=(b[0]|2147483648)>>>0),b[1]>>>=1,e/=2;while(1<=e);this.za=d;this.Va=a[0];return!0}function ki(a){var b=a+1|0;Oe(this,a,1,b,this.sb|62);this.A-=2;return a&~this.O|b&this.O}
function ji(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1,f=this.Ml;f[0]=c>>>0;f[1]=0;c=this.Ql;c[0]=a>>>0;for(c[1]=b>>>0;0<hi(c,f);)b=a=f,a[0]+=b[0],a[1]+=b[1],4294967295<a[0]&&(a[0]>>>=0,a[1]++),e+=e;do 0<=hi(c,f)&&(a=c,b=f,a[0]-=b[0],a[1]-=b[1],0>a[0]&&(a[0]>>>=0,a[1]--),d+=e),a=f,a[0]>>>=1,a[1]&1&&(a[0]=(a[0]|2147483648)>>>0),a[1]>>>=1,e/=2;while(1<=e);this.za=d;this.Va=c[0];return!0}function ki(a){var b=a+1|0;Oe(this,a,1,b,this.sb|62);this.A-=2;return a&~this.O|b&this.O}
function vd(a){this.md=a;this.pa&-2147483648&&Lb(this)}function li(a){this.M|=1;this.bc.call(this,a);this.A-=-1===this.C?4:5}function Kh(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a<<c-1;a=(d<<1|b>>>16-c)&65535;H(this,a,32768,d&32768)}return a}function Ph(a,b,c){if(c){var d=a<<c-1;a=d<<1|b>>>32-c;H(this,a,-2147483648,d&-2147483648)}return a}function Th(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a>>>c-1;a=(d>>>1|b<<16-c)&65535;H(this,a,32768,d&1)}return a}
function Vh(a,b,c){if(c){var d=a>>>c-1;a=d>>>1|b<<32-c;H(this,a,-2147483648,d&1)}return a}function mi(){this.A-=-1===this.C?2:this.B.Bj;return 1}function ni(){var a=this.H&255;this.A-=(-1===this.C?this.B.Zg:this.B.Yg)+(a<<this.B.$g);return a}function oi(){var a=this.ka();this.A-=(-1===this.C?this.B.Zg:this.B.Yg)+(a<<this.B.$g);return a}function pi(){return null}function qi(){return this.ta}
function ri(a,b){this.Sc=this.ga.ha;this.yc=this.W.ha;this.na=this.xa;var c=E(this),d=this.S;null!=ud(this,a,b,!0)&&(nd(this,this.Sc,d,2),nd(this,c,d,d));this.Sc=this.yc=this.na=-1}function si(a,b,c){this.A-=this.B.$i+(c||0);c=sd(this);var d=this.ga.ha,e=E(this);a=this.ga.yi(a);-1!==a&&(D(this,c),D(this,d),D(this,e),null!=b&&D(this,b),this.xc=-1,Le(this,a))}
@ -406,12 +406,12 @@ l.reset=function(a){var b;Hj(this);this.D=Array(this.wa);for(b=0;b<this.wa;b++)I
bk;this.G=Array(8);this.W=0;a&&(this.A=Array(ck));dk(this,this.Ka);for(a=ek;a<=fk;a++)this.A[a]=0;for(a=gk;a<hk;a++)void 0===this.A[a]&&(this.A[a]=0);a=0|+Vj(this,oj,void 0)<<ik.ag&ik.fc;a|=+Vj(this,uj,void 0)?jk:0;b=+Vj(this,nj,void 0);a|=b?b-1<<kk.ag&kk.fc|kk.ek:0;this.A[lk]=a;this.A[mk]=nk(this,0)<<4|nk(this,1);ok(this)}};
function dk(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.lc("CMOS date invalid ("+b+"), using "+c)):b&&a.lc("CMOS date: "+c);a.A[pk]=c.getSeconds();a.A[qk]=0;a.A[rk]=c.getMinutes();a.A[sk]=0;a.A[tk]=c.getHours();a.A[uk]=0;a.A[vk]=c.getDay()+1;a.A[wk]=c.getDate();a.A[xk]=c.getMonth()+1;b=c.getFullYear();a.A[yk]=b%100;b/=100;a.A[zk]=b%10|b/10<<4;a.A[Ak]=38;a.A[Wc]=Bk;a.A[Ck]=0;a.A[Dk]=Ek;a.na=a.X=0;a.Ha=a.xa=null}
function Fk(a){var b;void 0===b&&(b=a.xa);a.X=Qc(a.U,a.V)+b;a.A[Wc]&Xc&&Kc(a.U,b)}function ok(a){for(var b=0,c=mk;c<hk;c++)b+=a.A[c];a.A[Gk]=b&255;a.A[hk]=b>>8}
l.save=function(){var a=new Ie(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.D;c++){for(var d=this.D[c],e=d,f=[],g=0;g<e.Qb.length;g++){var h=e.Qb[g];f[g]=[h.Id,h.tf,h.ac,h.cb,h.eb,h.mode,h.uf,h.on,h.pn]}b[c]=[d.zb,d.hg,d.$h,d.Cb,f,d.jg]}a.set(1,[b]);b=[];for(c=0;c<this.Zb.length;c++)d=this.Zb[c],b[c]=[d.Pe,d.Kc,d.gd,d.Tc,d.Rb,d.tc,d.Dd,d.Ge];a.set(2,[b]);b=[];for(c=0;c<this.H.length;c++)d=this.H[c],b[c]=[d.ac,d.vc,d.eb,d.Ed,d.kg,d.mode,d.ff,d.Vc,d.ed,d.Lc,d.ke,d.Gd,d.fd,d.zb,d.oe];a.set(3,[this.ta,
l.save=function(){var a=new Ie(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.D;c++){for(var d=this.D[c],e=d,f=[],g=0;g<e.Qb.length;g++){var h=e.Qb[g];f[g]=[h.Id,h.tf,h.ac,h.cb,h.eb,h.mode,h.uf,h.qn,h.rn]}b[c]=[d.zb,d.hg,d.$h,d.Cb,f,d.jg]}a.set(1,[b]);b=[];for(c=0;c<this.Zb.length;c++)d=this.Zb[c],b[c]=[d.Pe,d.Kc,d.gd,d.Tc,d.Rb,d.tc,d.Dd,d.Ge];a.set(2,[b]);b=[];for(c=0;c<this.H.length;c++)d=this.H[c],b[c]=[d.ac,d.vc,d.eb,d.Ed,d.kg,d.mode,d.ff,d.Vc,d.ed,d.Lc,d.ke,d.Gd,d.fd,d.zb,d.oe];a.set(3,[this.ta,
b,this.ea]);a.set(4,[this.ua,this.J,this.Ba,this.ga,this.ba]);this.aa>=wf&&(a.set(5,[this.F,this.L,this.K,this.pa,this.M,this.qa]),a.set(6,[this.G[7],this.G,this.W,this.A,this.na,this.X]));return a.data()};
l.restore=function(a){var b,c;b=a[0];Array.isArray(b[0])?this.C=b[0]:(this.C[0][0]=b[0],this.C[1][0]=b[1]&15,this.C[0][1]=b[2],this.C[1][1]=b[3]&15);Hj(this);b=a[1];for(c=0;c<this.wa;c++)Ij(this,c,1==b.length?b[0][c]:b);b=a[2];for(c=0;c<this.ja;c++)Jj(this,c,c?Nj:Lj,b[0][c]);b=a[3];this.ta=b[0];this.ea=b[2];for(c=0;c<this.H.length;c++)Oj(this,c,b[1][c]);b=a[4];this.ua=b[0];this.J=b[1];this.Ba=b[2];this.ga=b[3];this.ba=b[4];if(b=a[5])this.F=b[0],this.L=b[1],this.K=b[2],this.pa=b[3],this.M=b[4],this.qa=
b[5];if(b=a[6])this.G=b[1],this.G[7]=b[0],this.W=b[2],this.A=b[3],this.na=b[4],this.X=b[5],dk(this);return!0};l.start=function(){Hk(this)};l.stop=function(){Hk(this)};function Ij(a,b,c){var d=a.D[b];d||(d={Qb:Array(4)});c=c&&5<=c.length?c:Ik;d.zb=c[0];d.hg=c[1];d.$h=c[2];d.Cb=c[3];d.Pl=b<<2;for(var e=0;e<d.Qb.length;e++)Jk(d,e,c[4][e]);d.jg=c[5]||0;a.D[b]=d}
function Jk(a,b,c){var d=a.Qb[b];d||(d={tf:[0,0],ac:[0,0],cb:[0,0],eb:[0,0]});c=c&&8==c.length?c:Kk;d.Id=c[0];d.tf[0]=c[1][0];d.tf[1]=c[1][1];d.ac[0]=c[2][0];d.ac[1]=c[2][1];d.cb[0]=c[3][0];d.cb[1]=c[3][1];d.eb[0]=c[4][0];d.eb[1]=c[4][1];d.mode=c[5];d.uf=c[6];d.controller=a;d.ui=b;Lk(d,c[8],c[9]);a.Qb[b]=d}function Lk(a,b,c,d){"string"==typeof b&&(b=Ra(b));b&&(a.done=null,a.on=b.id,a.pn=c,a.Bf=b,a.og=b[c],a.Qf=d)}
function Jj(a,b,c,d){var e=a.Zb[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Mk;e.port=c;e.Do=b<<3;e.Pe=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.gd=d[2];e.Tc=d[3];e.Rb=d[4];e.tc=d[5];e.Dd=d[6];e.Ge=d[7];a.Zb[b]=e}
b[5];if(b=a[6])this.G=b[1],this.G[7]=b[0],this.W=b[2],this.A=b[3],this.na=b[4],this.X=b[5],dk(this);return!0};l.start=function(){Hk(this)};l.stop=function(){Hk(this)};function Ij(a,b,c){var d=a.D[b];d||(d={Qb:Array(4)});c=c&&5<=c.length?c:Ik;d.zb=c[0];d.hg=c[1];d.$h=c[2];d.Cb=c[3];d.Rl=b<<2;for(var e=0;e<d.Qb.length;e++)Jk(d,e,c[4][e]);d.jg=c[5]||0;a.D[b]=d}
function Jk(a,b,c){var d=a.Qb[b];d||(d={tf:[0,0],ac:[0,0],cb:[0,0],eb:[0,0]});c=c&&8==c.length?c:Kk;d.Id=c[0];d.tf[0]=c[1][0];d.tf[1]=c[1][1];d.ac[0]=c[2][0];d.ac[1]=c[2][1];d.cb[0]=c[3][0];d.cb[1]=c[3][1];d.eb[0]=c[4][0];d.eb[1]=c[4][1];d.mode=c[5];d.uf=c[6];d.controller=a;d.ui=b;Lk(d,c[8],c[9]);a.Qb[b]=d}function Lk(a,b,c,d){"string"==typeof b&&(b=Ra(b));b&&(a.done=null,a.qn=b.id,a.rn=c,a.Bf=b,a.og=b[c],a.Qf=d)}
function Jj(a,b,c,d){var e=a.Zb[b];e||(e={Kc:[null,null,null,null]});d=d&&8==d.length?d:Mk;e.port=c;e.Fo=b<<3;e.Pe=d[0];e.Kc[0]=d[1][0];e.Kc[1]=d[1][1];e.Kc[2]=d[1][2];e.Kc[3]=d[1][3];e.gd=d[2];e.Tc=d[3];e.Rb=d[4];e.tc=d[5];e.Dd=d[6];e.Ge=d[7];a.Zb[b]=e}
function Oj(a,b,c){var d=a.H[b];d||(d={ac:[0,0],vc:[0,0],eb:[0,0],Ed:[0,0]});c=c&&13<=c.length?c:Nk;d.ac[0]=c[0][0];d.ac[1]=c[0][1];d.vc[0]=c[1][0];d.vc[1]=c[1][1];d.eb[0]=c[2][0];d.eb[1]=c[2][1];d.Ed[0]=c[3][0];d.Ed[1]=c[3][1];d.kg=c[4];d.mode=c[5];d.ff=c[6];d.Vc=c[7];d.ed=c[8];d.Lc=c[9];d.ke=c[10];d.Gd=c[11];d.fd=c[12];d.zb=c[13]||0;d.oe=c[14]||!1;a.H[b]=d}
function qj(a,b,c){for(var d="",e=a.ia[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||(g+=" pcjs-bitCellLeft");d+='<div id="'+(c+"-"+f)+'" class="'+g+'" data-value="0">'+f+"</div>\n"}e.innerHTML=d;Ok(a,b,c,!0)}function Pk(a,b,c){if(b=(a=U[a.aa|0])&&a[b])for(var d in b)if(a=b[d],a.fc&1<<c)return a;return null}
function Vj(a,b,c){for(var d=null,e=U[a.aa]||U[a.aa|0]||U[rj],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.C[f][c?0:1]&g.fc;for(var h in g.Ec)if(g.Ec[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function nk(a,b){if(b<+Vj(a,nj,void 0)){if(!a.N)return Qk;if(b<a.N.length)switch(a.N[b]){case 160:case 180:case 320:case 360:return Qk;case 720:return Rk;case 1200:return Sk;case 1440:return Tk}}return Uk}function Tj(a,b){return+Vj(a,Vk,b)+ +Vj(a,Wk,b)}
@ -419,7 +419,7 @@ function kj(a,b){if(a){b=0;for(var c=1,d=0;d<a.length;d++)"0"==a.charAt(d)&&(b|=
function Ok(a,b,c,d){if(c=a.ia[c]){d=d?a.C[b][0]:a.C[b][1]=a.C[b][0];c=Wa(c,"pcjs-bitCell");for(var e=0;e<c.length;e++){var f=Pk(a,b,e);c[e].setAttribute("title",f&&f.bd||"Reserved");Xk(c[e],!(d&1<<e));c[e].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");Xk(b,c);var d=b.getAttribute("id").split("-"),e=1<<+d[1]-1;switch(d[0]){case lj:a.C[0][0]=a.C[0][0]&~e|(c?0:e);break;case pj:a.C[1][0]=a.C[1][0]&~e|(c?0:e)}Yk(a)}}(a,c[e])}}}
function Yk(a){var b=a.ia[tj];if(null!=b){var c;c=""+(Tj(a,!0)+"Kb");c+=", "+(+ +Vj(a,uj,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Vj(a,oj,!0)]+" Monitor";c+=", "+ +Vj(a,nj,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
function Zk(a,b,c){a=a.D[b];var d=a.Qb[c],e=d.cb[a.Cb];a.Cb^=1;b||c!=$k||a.Cb||(d.cb[0]++,255<d.cb[0]&&(d.cb[0]=0,d.cb[1]++,255<d.cb[1]&&(d.cb[1]=0)));return e}function al(a,b,c,d){a=a.D[b];c=a.Qb[c];c.cb[a.Cb]=c.tf[a.Cb]=d;a.Cb^=1}function bl(a,b,c){a=a.D[b];var d=a.Qb[c],e=d.eb[a.Cb];a.Cb^=1;b||c!=$k||a.Cb||(d.eb[0]--,0>d.eb[0]&&(d.eb[0]=255,d.eb[1]--,0>d.eb[1]&&(d.eb[1]=255)));return e}function cl(a,b,c,d){a=a.D[b];c=a.Qb[c];c.eb[a.Cb]=c.ac[a.Cb]=d;a.Cb^=1}
function dl(a,b){a=a.D[b];b=a.zb|el;a.zb&=~fl;return b}function gl(a,b,c){a=a.D[b];b=c&3;a.zb=a.zb&~(16<<b)|(c&4)<<b+2;a.$h=c}function hl(a,b,c){b=a.D[b];var d=c&il,e=b.Qb[d];e.Id=!!(c&jl);e.Id||kl(a,b.Pl+d)}function ll(a,b){a=a.D[b];for(b=0;b<a.Qb.length;b++)Jk(a,b)}function ml(a,b,c){return a.D[b].Qb[c].uf}function nl(a,b,c,d){a.D[b].Qb[c].uf=d}function ol(a,b,c,d,e){Lk(a.D[b>>2].Qb[b&3],c,d,e)}function kl(a,b,c){b=a.D[b>>2].Qb[b&3];b.Bf&&b.og&&b.Qf?(c&&(b.done=c),b.Id||pl(a,b,!0)):c&&c(!0)}
function dl(a,b){a=a.D[b];b=a.zb|el;a.zb&=~fl;return b}function gl(a,b,c){a=a.D[b];b=c&3;a.zb=a.zb&~(16<<b)|(c&4)<<b+2;a.$h=c}function hl(a,b,c){b=a.D[b];var d=c&il,e=b.Qb[d];e.Id=!!(c&jl);e.Id||kl(a,b.Rl+d)}function ll(a,b){a=a.D[b];for(b=0;b<a.Qb.length;b++)Jk(a,b)}function ml(a,b,c){return a.D[b].Qb[c].uf}function nl(a,b,c,d){a.D[b].Qb[c].uf=d}function ol(a,b,c,d,e){Lk(a.D[b>>2].Qb[b&3],c,d,e)}function kl(a,b,c){b=a.D[b>>2].Qb[b&3];b.Bf&&b.og&&b.Qf?(c&&(b.done=c),b.Id||pl(a,b,!0)):c&&c(!0)}
function pl(a,b,c){c&&(b.count=b.eb[1]<<8|b.eb[0],b.type=b.mode&ql,b.ni=b.Df=!1);for(var d=!1;0<=b.count&&(c=b.uf<<16|b.cb[1]<<8|b.cb[0],b.type==rl?(d=!0,function(c){b.og.call(b.Bf,b.Qf,-1,function(e,g){0>e&&(b.ni||(b.ni=!0),e=255);b.Id||a.ma.Dc(c,e);(d=g)&&setTimeout(function(){sl(b)||pl(a,b)},0)})}(c)):b.type==tl?(c=a.ma.Eb(c),0>b.og.call(b.Bf,b.Qf,c)&&(b.Df=!0)):b.type!=ul&&(b.Df=!0)),!d&&!sl(b););}
function sl(a){if(!a.Df&&0<=--a.count&&(a.mode&vl?(a.cb[0]--,0>a.cb[0]&&(a.cb[0]=255,a.cb[1]--,0>a.cb[1]&&(a.cb[1]=255))):(a.cb[0]++,255<a.cb[0]&&(a.cb[0]=0,a.cb[1]++,255<a.cb[1]&&(a.cb[1]=0))),!a.Id))return!1;var b=a.controller;b.zb=b.zb&~(16<<a.ui)|1<<a.ui;a.mode&wl||(a.Id=!0,a.Bf=a.Qf=null);a.done&&(a.done(!a.Df),a.done=null);return!0}function xl(a,b){var c=0;a=a.Zb[b];if(null!=a.Ge)switch(a.Ge&yl){case zl:c=a.Rb;break;case Al:c=a.tc}return c}
function Bl(a,b,c){b=a.Zb[b];if(c&Cl)b.gd=0,b.Kc[b.gd++]=c,b.Tc=0,b.Dd=7,b.Rb=b.tc=0,b.Ge=Dl|zl;else if(c&Dl)b.Ge=c;else{var d=c&El;if(d&Fl){var e=0;if((d&Gl)==Gl)c&=Hl,e=1<<c;else for(c=b.Dd+1;;){c&=7;d=1<<c;if(b.tc&d){e=d;break}if(c++==b.Dd)break}b.tc&e&&(b.tc&=~e,Il(a))}else d==Jl&&(b.Dd=c&Hl)}}function Kl(a,b,c){var d=a.Zb[b];d.gd<d.Kc.length?(d.Kc[d.gd++]=c,2==d.gd&&d.Kc[0]&Ll&&d.gd++,3!=d.gd||d.Kc[0]&Ml||d.gd++):(d.Tc=c,d=a.U,d.M|=4,Il(a,b||253!=c?0:6))}
@ -430,17 +430,17 @@ function Zl(a,b,c){var d=0,e=c&$l;b?(d=3,a.ea=c):a.ta=c;if(e==am){if(!(c&bm))for
e.vc[0]=e.ac[0],e.vc[1]=e.ac[1],e.fd=Qc(a.U,a.V))}}}function Xl(a,b){a=a.H[b];(b=a.ac[1]<<8|a.ac[0])||(b=1==a.ed?256:65536);return b}function Uc(a,b){a=a.H[b];(b=a.vc[1]<<8|a.vc[0])||(b=1==a.ed?256:65536);return b}function gm(a,b){Ql(a,b);var c=a.H[b];c.Ed[0]=c.eb[0];c.Ed[1]=c.eb[1];c.ke=!0;Pl(a,b)}function Pl(a,b){a=a.H[b];a.Vc=a.ff==qm?1:0;a.ed=a.ff==rm?2:1}
function Ql(a,b,c){var d=a.H[b];if(d.Gd&&(b!=Yl||a.J&mm)){var e=Qc(a.U,a.V),f=(e-d.fd)/a.za|0;0>f&&(d.fd=e,f=0);var g=Xl(a,b),h=Uc(a,b)-f;d.mode==Sl?(0>=h&&(h=0),h||(d.Lc=!0,d.Gd=!1,b||zf(a,Wl))):d.mode==sm?(d.Lc=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.vc[0]=h&255,d.vc[1]=h>>8&255,d.fd=e,!b&&d.Lc&&zf(a,Wl))):d.mode==Vc&&(h-=f,0>=h&&(d.Lc=!d.Lc,h=g+h,0>=h&&(h=g),d.vc[0]=h&255,d.vc[1]=h>>8&255,d.fd=e,!b&&d.Lc&&zf(a,Wl)));d.eb[0]=h&255;d.eb[1]=h>>8&255;c&&(a.fd=0)}return d}
function Tc(a,b){for(var c=0;c<a.H.length;c++)Ql(a,c,b);if(a.aa>=wf){b=a.U.R.Wc;c=Qc(a.U,a.V);null==a.xa&&(a.na=Qc(a.U,a.V),a.Ha=1024,a.xa=Math.floor(a.U.R.Wc/a.Ha),Fk(a));c>=a.X&&(a.A[Ck]|=tm,a.A[Wc]&Xc&&(a.A[Ck]|=um,zf(a,vm)),a.X=c+a.xa);a.A[pk]==a.A[qk]&&a.A[rk]==a.A[sk]&&a.A[tk]==a.A[uk]&&(a.A[Ck]|=wm,a.A[Wc]&xm&&(a.A[Ck]|=um,zf(a,vm)));var d=c-a.na,e=Math.floor(d/b);if(e&&!(a.A[Wc]&ym)){for(;e--;)if(60<=++a.A[pk]&&(a.A[pk]=0,60<=++a.A[rk]&&(a.A[rk]=0,24<=++a.A[tk]))){a.A[tk]=0;a.A[vk]=a.A[vk]%
7+1;var f;f=a.A[yk];var g=ra[a.A[xk]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[wk]>f&&(a.A[wk]=1,12<++a.A[xk]&&(a.A[xk]=1,a.A[yk]=(a.A[yk]+1)%100))}a.A[Ck]|=zm;a.A[Wc]&Am&&(a.A[Ck]|=um,zf(a,vm))}a.na=c-d%b}}l.rl=function(){var a=this.ua;this.ga&Fm&&(this.J&Gm?a=this.C[0][1]:this.B&&(a=Hm(this.B)));return a};l.Jm=function(a,b){this.ua=b};l.sl=function(){return this.J};l.Km=function(a,b){Im(this,b)};
function Im(a,b){var c=!!(b&Jm),d=!!(a.J&Jm);a.J=b;a.B&&Km(a.B,!(b&Gm),!!(b&pm));c!=d&&Hk(a,c)}l.tl=function(){var a=0,a=(this.aa|0)==rj?this.J&nm?a|this.C[1][1]&Lm:a|this.C[1][1]>>4&1:this.J&Mm?a|this.C[0][1]>>4:a|this.C[0][1]&15;this.J&mm&&Ql(this,Yl).Lc&&(a=this.J&Jm?a|Nm:a|Om);return a};l.Lm=function(a,b){this.Ba=b};l.ul=function(){return this.ga};l.Mm=function(a,b){this.ga=b};l.Dk=function(){var a=this.B?Hm(this.B):0;this.Z&=~Pm;return a};l.Vl=function(){};l.Ck=function(){return this.J};
l.Ul=function(a,b){Im(this,b)};l.Ek=function(){return this.Z};l.Fk=function(){var a=this.pa;this.F&=~(Pm|Qm);this.B&&Rm(this.B);return a};l.Xl=function(a,b){if(this.F&Sm)switch(this.L){case Tm:Um(this,b);break;case Vm:Wm(this,b);break;default:if(Um(this,this.K&~Qj),this.B){a=this.B;var c=b,d=-1;switch(a.D||c){case Xm:d=Ym;a.Jb=[];Zm(a,$m);break;case an:a.D&&(c=0);Zm(a,Ym);a.D=c;break;case bn:a.D&&(c=0),Zm(a,Ym),a.D=c}cn(this,d)}}this.L=b;this.F&=~Sm};
l.Gk=function(){return this.J&~(dn|en)|(Qc(this.U)&64?en:0)};l.Yl=function(a,b){Im(this,b)};l.Hk=function(){var a=this.F&255;this.F&Qm&&(this.F|=Pm,this.F&=~Qm);return a};
l.Wl=function(a,b){this.L=b;this.F|=Sm;a=0;this.L>=fn&&(a=this.L^15,this.L=fn);switch(this.L){case gn:cn(this,this.K);break;case hn:Um(this,this.K|Qj);break;case jn:Um(this,this.K&~Qj);this.B&&Rm(this.B);break;case kn:this.B&&(this.B.Jb=[]);Um(this,this.K|Qj);cn(this,ln);Wm(this,ak|bk);break;case mn:cn(this,nn);break;case on:cn(this,this.M);break;case pn:cn(this,this.qa);break;case qn:cn(this,this.K&Qj?0:rn);break;case fn:a&1&&de(this.U)}};
function Um(a,b){a.K=b;a.F=a.F&~sn|b&tn;a.B&&Km(a.B,!!(b&un),!(b&Qj))}function cn(a,b,c){0<=b&&(a.pa=b,c?a.F|=Pm:(a.F&=~Pm,a.F|=Qm))}function Wm(a,b){a.qa=b;Gb(a.ma,!!(b&bk));b&ak||de(a.U)}function vn(a,b){a.aa<wf?(zf(a,wn,4),a.Z|=Pm):a.K&Qj||a.F&(Pm|Qm)||(cn(a,b,!0),xn(a.B),zf(a,wn,120))}l.Vk=function(){return this.W};l.lm=function(a,b){this.W=b;this.ba=b&yn?Af:zn};
7+1;var f;f=a.A[yk];var g=ra[a.A[xk]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[wk]>f&&(a.A[wk]=1,12<++a.A[xk]&&(a.A[xk]=1,a.A[yk]=(a.A[yk]+1)%100))}a.A[Ck]|=zm;a.A[Wc]&Am&&(a.A[Ck]|=um,zf(a,vm))}a.na=c-d%b}}l.rl=function(){var a=this.ua;this.ga&Fm&&(this.J&Gm?a=this.C[0][1]:this.B&&(a=Hm(this.B)));return a};l.Lm=function(a,b){this.ua=b};l.sl=function(){return this.J};l.Mm=function(a,b){Im(this,b)};
function Im(a,b){var c=!!(b&Jm),d=!!(a.J&Jm);a.J=b;a.B&&Km(a.B,!(b&Gm),!!(b&pm));c!=d&&Hk(a,c)}l.tl=function(){var a=0,a=(this.aa|0)==rj?this.J&nm?a|this.C[1][1]&Lm:a|this.C[1][1]>>4&1:this.J&Mm?a|this.C[0][1]>>4:a|this.C[0][1]&15;this.J&mm&&Ql(this,Yl).Lc&&(a=this.J&Jm?a|Nm:a|Om);return a};l.Nm=function(a,b){this.Ba=b};l.ul=function(){return this.ga};l.Om=function(a,b){this.ga=b};l.Dk=function(){var a=this.B?Hm(this.B):0;this.Z&=~Pm;return a};l.Xl=function(){};l.Ck=function(){return this.J};
l.Wl=function(a,b){Im(this,b)};l.Ek=function(){return this.Z};l.Fk=function(){var a=this.pa;this.F&=~(Pm|Qm);this.B&&Rm(this.B);return a};l.Zl=function(a,b){if(this.F&Sm)switch(this.L){case Tm:Um(this,b);break;case Vm:Wm(this,b);break;default:if(Um(this,this.K&~Qj),this.B){a=this.B;var c=b,d=-1;switch(a.D||c){case Xm:d=Ym;a.Jb=[];Zm(a,$m);break;case an:a.D&&(c=0);Zm(a,Ym);a.D=c;break;case bn:a.D&&(c=0),Zm(a,Ym),a.D=c}cn(this,d)}}this.L=b;this.F&=~Sm};
l.Gk=function(){return this.J&~(dn|en)|(Qc(this.U)&64?en:0)};l.$l=function(a,b){Im(this,b)};l.Hk=function(){var a=this.F&255;this.F&Qm&&(this.F|=Pm,this.F&=~Qm);return a};
l.Yl=function(a,b){this.L=b;this.F|=Sm;a=0;this.L>=fn&&(a=this.L^15,this.L=fn);switch(this.L){case gn:cn(this,this.K);break;case hn:Um(this,this.K|Qj);break;case jn:Um(this,this.K&~Qj);this.B&&Rm(this.B);break;case kn:this.B&&(this.B.Jb=[]);Um(this,this.K|Qj);cn(this,ln);Wm(this,ak|bk);break;case mn:cn(this,nn);break;case on:cn(this,this.M);break;case pn:cn(this,this.qa);break;case qn:cn(this,this.K&Qj?0:rn);break;case fn:a&1&&de(this.U)}};
function Um(a,b){a.K=b;a.F=a.F&~sn|b&tn;a.B&&Km(a.B,!!(b&un),!(b&Qj))}function cn(a,b,c){0<=b&&(a.pa=b,c?a.F|=Pm:(a.F&=~Pm,a.F|=Qm))}function Wm(a,b){a.qa=b;Gb(a.ma,!!(b&bk));b&ak||de(a.U)}function vn(a,b){a.aa<wf?(zf(a,wn,4),a.Z|=Pm):a.K&Qj||a.F&(Pm|Qm)||(cn(a,b,!0),xn(a.B),zf(a,wn,120))}l.Vk=function(){return this.W};l.nm=function(a,b){this.W=b;this.ba=b&yn?Af:zn};
l.Wk=function(a,b){a=this.W&An;var c;if(a<=Dk)if(c=this.A[a],a<Ak){var d=!1;a!=tk&&a!=uk||this.A[Wc]&Bk||(12>c?c=c?c:12:c=(c-=12)?c+128:140,d=!0);this.A[Wc]&Bn||(d&&128<c&&(c-=48),c=c%10|c/10<<4)}else a==Ak&&(this.A[a]^=Cn);else c=this.A[a];null!=b&&a==Ck&&(this.A[a]&=Dn,c&um&&xf(this,vm),c&tm&&this.A[Wc]&Xc&&Fk(this));return c};
l.mm=function(a,b){a=this.W&An;var c=b^this.A[a],d;if(a<=Dk){if(d=b,a<Ak){var e=!1;this.A[Wc]&Bn||(d=10*(d>>4)+(d&15),e=!0);if(a==tk||a==uk)e&&23<d&&(d+=48),this.A[Wc]&Bk||(12>=d?d=12==d?0:d:(d-=116,d=24==d?12:d))}}else d=b;this.A[a]=d;a==Wc&&c&Xc&&b&Xc&&Fk(this)};l.Gj=function(a,b){this.ba=b};l.wm=function(){};l.xm=function(){this.Ud&&sf(this.Ud)};
l.om=function(a,b){a=this.W&An;var c=b^this.A[a],d;if(a<=Dk){if(d=b,a<Ak){var e=!1;this.A[Wc]&Bn||(d=10*(d>>4)+(d&15),e=!0);if(a==tk||a==uk)e&&23<d&&(d+=48),this.A[Wc]&Bk||(12>=d?d=12==d?0:d:(d-=116,d=24==d?12:d))}}else d=b;this.A[a]=d;a==Wc&&c&Xc&&b&Xc&&Fk(this)};l.Gj=function(a,b){this.ba=b};l.ym=function(){};l.zm=function(){this.Ud&&sf(this.Ud)};
function Hk(a,b){if(a.la)try{void 0!==b?a.Ga=b:b=!!(a.Ga&&a.U&&a.U.ca.Ib);var c=Math.round(vj/Xl(a,Yl));if(20>c||2E4<c)b=!1;b?a.I?a.I.frequency.value=c:(a.I=a.la.createOscillator(),a.I&&(a.I.type="number"==typeof a.I.type?1:"square",a.I.connect(a.la.destination),a.I.frequency.value=c,"start"in a.I?a.I.start(0):a.I.noteOn(0))):a.I&&("stop"in a.I?a.I.stop(0):a.I.noteOff(0),a.I.disconnect(),delete a.I)}catch(d){a.Aa("AudioContext exception: "+d.message),a.la=null}}
var rj=5150,jj=5150.9,wf=5170,sj=5160.101,Ej=5180,ij={5150:rj,5160:5160,5170:wf,att6300:sj,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:jj};ij.deskpro386=Ej;
var lj="sw1",pj="sw2",tj="swdesc",Wj=3,el=1,fl=15,il=3,jl=4,ql=12,ul=0,rl=4,tl=8,wl=16,vl=32,$k=0,Kj=0,Lj=32,Mj=1,Nj=160,Cl=16,Ml=1,Ll=2,Hl=7,El=224,Fl=32,Gl=96,Jl=192,Dl=8,zl=2,Al=3,yl=3,Wl=0,wn=1,Nl=2,vm=8,yf=13,Ul=0,Vl=0,Yl=2,im=1,jm=14,Sl=0,sm=4,Vc=6,Tl=8,km=48,lm=0,qm=32,rm=48,$l=192,am=192,hm=6,cm=2,bm=16,fm=32,dm=64,em=128,vj=1193181,mm=1,Jm=2,nm=4,om=8,Mm=8,pm=64,Gm=128,Lm=15,Om=16,Nm=32,Fm=16,kk={ek:1,ONE:0,Ao:64,yo:128,po:192,fc:192,ag:6},jk=2,ik={zo:16,Mn:32,qo:48,fc:48,ag:4},nj=1,uj=3,
var lj="sw1",pj="sw2",tj="swdesc",Wj=3,el=1,fl=15,il=3,jl=4,ql=12,ul=0,rl=4,tl=8,wl=16,vl=32,$k=0,Kj=0,Lj=32,Mj=1,Nj=160,Cl=16,Ml=1,Ll=2,Hl=7,El=224,Fl=32,Gl=96,Jl=192,Dl=8,zl=2,Al=3,yl=3,Wl=0,wn=1,Nl=2,vm=8,yf=13,Ul=0,Vl=0,Yl=2,im=1,jm=14,Sl=0,sm=4,Vc=6,Tl=8,km=48,lm=0,qm=32,rm=48,$l=192,am=192,hm=6,cm=2,bm=16,fm=32,dm=64,em=128,vj=1193181,mm=1,Jm=2,nm=4,om=8,Mm=8,pm=64,Gm=128,Lm=15,Om=16,Nm=32,Fm=16,kk={ek:1,ONE:0,Co:64,Ao:128,ro:192,fc:192,ag:6},jk=2,ik={Bo:16,On:32,so:48,fc:48,ag:4},nj=1,uj=3,
oj=4,Vk=5,Wk=6,U={};U[rj]=[{},{}];U[rj][0][nj]={fc:192,Ec:{1:0,2:64,3:128,4:192},bd:"Number of Floppy Drives"};U[rj][0][uj]={fc:2,Ec:{0:0,1:2},bd:"FPU"};U[rj][0][oj]={fc:48,Ec:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},bd:"Monitor Type"};U[rj][0][Vk]={fc:12,Ec:{16:0,32:4,48:8,64:12},bd:"Base Memory (16Kb Increments)"};U[rj][1][Wk]={fc:31,Ec:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},bd:"Expansion Memory (32Kb Increments)"};
U[5160]=[{},{}];U[5160][0][nj]=U[rj][0][nj];U[5160][0][uj]=U[rj][0][uj];U[5160][0][oj]=U[rj][0][oj];U[5160][0][Vk]={fc:12,Ec:{64:0,128:4,192:8,256:12},bd:"Base Memory (64Kb Increments)"};U[5160][1][Wk]=U[rj][1][Wk];U[sj]=[{},{}];U[sj][0][Vk]={fc:143,Ec:{128:1,256:130,512:8,640:141},bd:"Base Memory (128Kb Increments)"};U[sj][0][uj]={fc:16,Ec:{0:0,1:16},bd:"FPU"};U[sj][1][2]={fc:1,Ec:{0:0,1:1},bd:"Floppy Type"};U[sj][1][nj]=U[rj][0][nj];U[sj][1][oj]=U[rj][0][oj];
var tn=4,un=8,Qj=16,ln=85,nn=0,Yj=4,Zj=8,Uj=16,Rj=32,Xj=64,Sj=128,ak=1,bk=2,rn=1,en=16,dn=192,gn=32,Tm=96,kn=170,mn=171,hn=173,jn=174,on=192,pn=208,Vm=209,qn=224,fn=240,Pm=1,sn=4,Sm=8,Pj=16,Qm=256,pk=0,qk=1,rk=2,sk=3,tk=4,uk=5,vk=6,wk=7,xk=8,yk=9,Ak=10,Wc=11,Ck=12,Dk=13,gk=14,mk=16,lk=20,ek=21,fk=24,hk=46,Gk=47,zk=50,An=63,ck=64,yn=128,Cn=128,ym=128,Xc=64,xm=32,Am=16,Bn=4,Bk=2,um=128,tm=64,wm=32,zm=16,Dn=15,Ek=128,Uk=0,Qk=1,Sk=2,Rk=3,Tk=4,zn=128,Af=0,Ik=[0,null,null,0,Array(4),0],Kk=[!0,[0,0],[0,
@ -449,9 +449,9 @@ Ul,Vl)},65:function(){return Ol(this,Ul,1)},66:function(){return Ol(this,Ul,Yl)}
133:function(){return this.G[1]},134:function(){return this.G[2]},136:function(){return this.G[3]},137:function(){return ml(this,1,2)},138:function(){return ml(this,1,3)},139:function(){return ml(this,1,1)},140:function(){return this.G[4]},141:function(){return this.G[5]},142:function(){return this.G[6]},143:function(){return ml(this,1,0)},160:function(){return xl(this,Mj)},161:function(){return this.Zb[Mj].Tc},192:function(){return Zk(this,1,0)},194:function(){return bl(this,1,0)},196:function(){return Zk(this,
1,1)},198:function(){return bl(this,1,1)},200:function(){return Zk(this,1,2)},202:function(){return bl(this,1,2)},204:function(){return Zk(this,1,3)},206:function(){return bl(this,1,3)},208:function(){return dl(this,1)},218:function(){return this.D[1].jg}},Aj={96:T.prototype.Dk,97:T.prototype.Ck,100:T.prototype.Ek,102:function(){return this.C[0][1]},103:function(){return this.C[1][1]}},Fj={72:function(){return Ol(this,1,0)},73:function(){return Ol(this,1,1)},74:function(){return Ol(this,1,2)},75:function(){return this.ea}},
xj={0:function(a,b){al(this,0,0,b)},1:function(a,b){cl(this,0,0,b)},2:function(a,b){al(this,0,1,b)},3:function(a,b){cl(this,0,1,b)},4:function(a,b){al(this,0,2,b)},5:function(a,b){cl(this,0,2,b)},6:function(a,b){al(this,0,3,b)},7:function(a,b){cl(this,0,3,b)},8:function(a,b){this.D[0].hg=b},9:function(a,b){gl(this,0,b)},10:function(a,b){hl(this,0,b)},11:function(a,b){this.D[0].Qb[b&3].mode=b},12:function(){this.D[0].Cb=0},13:function(){ll(this,0)},32:function(a,b){Bl(this,Kj,b)},33:function(a,b){Kl(this,
Kj,b)},64:function(a,b){Rl(this,Ul,Vl,b)},65:function(a,b){Rl(this,Ul,1,b)},66:function(a,b){Rl(this,Ul,Yl,b)},67:function(a,b){Zl(this,Ul,b)},129:function(a,b){nl(this,0,2,b)},130:function(a,b){nl(this,0,3,b)},131:function(a,b){nl(this,0,1,b)},135:function(a,b){nl(this,0,0,b)}},zj={96:T.prototype.Jm,97:T.prototype.Km,98:T.prototype.Lm,99:T.prototype.Mm,160:T.prototype.Gj},Dj={96:T.prototype.Xl,97:T.prototype.Yl,100:T.prototype.Wl,112:T.prototype.lm,113:T.prototype.mm,128:function(a,b){this.G[7]=
Kj,b)},64:function(a,b){Rl(this,Ul,Vl,b)},65:function(a,b){Rl(this,Ul,1,b)},66:function(a,b){Rl(this,Ul,Yl,b)},67:function(a,b){Zl(this,Ul,b)},129:function(a,b){nl(this,0,2,b)},130:function(a,b){nl(this,0,3,b)},131:function(a,b){nl(this,0,1,b)},135:function(a,b){nl(this,0,0,b)}},zj={96:T.prototype.Lm,97:T.prototype.Mm,98:T.prototype.Nm,99:T.prototype.Om,160:T.prototype.Gj},Dj={96:T.prototype.Zl,97:T.prototype.$l,100:T.prototype.Yl,112:T.prototype.nm,113:T.prototype.om,128:function(a,b){this.G[7]=
b},132:function(a,b){this.G[0]=b},133:function(a,b){this.G[1]=b},134:function(a,b){this.G[2]=b},136:function(a,b){this.G[3]=b},137:function(a,b){nl(this,1,2,b)},138:function(a,b){nl(this,1,3,b)},139:function(a,b){nl(this,1,1,b)},140:function(a,b){this.G[4]=b},141:function(a,b){this.G[5]=b},142:function(a,b){this.G[6]=b},143:function(a,b){nl(this,1,0,b)},160:function(a,b){Bl(this,Mj,b)},161:function(a,b){Kl(this,Mj,b)},192:function(a,b){al(this,1,0,b)},194:function(a,b){cl(this,1,0,b)},196:function(a,
b){al(this,1,1,b)},198:function(a,b){cl(this,1,1,b)},200:function(a,b){al(this,1,2,b)},202:function(a,b){cl(this,1,2,b)},204:function(a,b){al(this,1,3,b)},206:function(a,b){cl(this,1,3,b)},208:function(a,b){this.D[1].hg=b},210:function(a,b){gl(this,1,b)},212:function(a,b){hl(this,1,b)},214:function(a,b){this.D[1].Qb[b&3].mode=b},216:function(){this.D[1].Cb=0},218:function(){ll(this,1)},240:T.prototype.wm,241:T.prototype.xm},Bj={96:T.prototype.Vl,97:T.prototype.Ul,160:T.prototype.Gj},Gj={72:function(a,
b){al(this,1,1,b)},198:function(a,b){cl(this,1,1,b)},200:function(a,b){al(this,1,2,b)},202:function(a,b){cl(this,1,2,b)},204:function(a,b){al(this,1,3,b)},206:function(a,b){cl(this,1,3,b)},208:function(a,b){this.D[1].hg=b},210:function(a,b){gl(this,1,b)},212:function(a,b){hl(this,1,b)},214:function(a,b){this.D[1].Qb[b&3].mode=b},216:function(){this.D[1].Cb=0},218:function(){ll(this,1)},240:T.prototype.ym,241:T.prototype.zm},Bj={96:T.prototype.Xl,97:T.prototype.Wl,160:T.prototype.Gj},Gj={72:function(a,
b){Rl(this,1,0,b)},73:function(a,b){Rl(this,1,1,b)},74:function(a,b){Rl(this,1,2,b)},75:function(a,b){Zl(this,1,b)}};Ea(function(){for(var a=Wa(document,"pcx86","chipset"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new T(d);Va(d,c);Yk(d)}});
function En(a){t.call(this,"ROM",a);this.A=null;this.F=a.addr;this.C=a.size;this.D=a.alias;this.G=a.file;this.B=a.notify;this.I=null;if(this.B&&(a=this.B.indexOf("["),0<a)){try{this.I=eval(this.B.substr(a))}catch(d){}this.B=this.B.substr(0,a)}if(this.G){a=this.G;var b=ia(ha(a));"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var c=this;ta(a,null,!0,function(a,b,f){Fn(c,a,b,f)})}}ba(En,t);En.prototype.hc=function(a,b,c,d){this.ma=b;this.U=c;this.Ea=d;Gn(this)};
En.prototype.Ob=function(){this.H&&(this.Ea&&this.Ea.A(this.id,0,this.F>>>4,0,this.F,this.C,this.H),delete this.H);return!0};En.prototype.Nb=function(){return!0};
@ -480,13 +480,13 @@ vn(e.V,f)):e.Jb.length==No&&e.Jb.push(Oo));d=!0}return d}var lo=["US83","US84","
var fo={TAB:1009,ESC:1027,F1:1112,F2:1113,F3:1114,F4:1115,F5:1116,F6:1117,F7:1118,F8:1119,F9:1120,F10:1121,LEFT:1037,UP:1038,RIGHT:1039,DOWN:1040,SYSREQ:4027,CTRL_C:Po,CTRL_BREAK:Ao,CTRL_ALT_DEL:4046,CTRL_ALT_INS:4045,CTRL_ALT_ENTER:4013},ho={esc:1027,1:n["1"],2:n["2"],3:n["3"],4:n["4"],5:n["5"],6:n["6"],7:n["7"],8:n["8"],9:n["9"],0:n["0"],"-":n["-"],"=":n["="],bs:1008,tab:1009,q:n.Q,w:n.Qh,e:n.E,r:n.Lh,t:n.Nh,y:n.Sh,u:n.Oh,i:n.Dh,o:n.Jh,p:n.Kh,"[":n["["],"]":n["]"],enter:13,ctrl:1017,a:n.Bd,s:n.Mh,
d:n.zh,f:n.Ah,g:n.Bh,h:n.Ch,j:n.Eh,k:n.Fh,l:n.Gh,";":n[";"],quote:n["'"],"`":n["`"],shift:1016,"\\":n["\\"],z:n.sf,x:n.Rh,c:n.xh,v:n.Ph,b:n.wh,n:n.Ih,m:n.Hh,",":n[","],".":n["."],"/":n["/"],"right-shift":3016,prtsc:1044,alt:1018,space:1032,"caps-lock":bo,f1:1112,f2:1113,f3:1114,f4:1115,f5:1116,f6:1117,f7:1118,f8:1119,f9:1120,f10:1121,"num-lock":co,"scroll-lock":eo,"num-home":1036,"num-up":1038,"num-pgup":1033,"num-sub":1109,"num-left":1037,"num-center":1101,"num-right":1039,"num-add":1107,"num-end":1035,
"num-down":1040,"num-pgdn":1034,"num-ins":1045,"num-del":1046,sysreq:84},ro={"caps-lock":xo,"num-lock":1024,"scroll-lock":2048},V={1027:1};V[n["1"]]=2;V[n["!"]]=2|W<<8;V[n["2"]]=3;V[n["@"]]=3|W<<8;V[n["3"]]=4;V[n["#"]]=4|W<<8;V[n["4"]]=5;V[n.$]=5|W<<8;V[n["5"]]=6;V[n["%"]]=6|W<<8;V[n["6"]]=7;V[n["^"]]=7|W<<8;V[n["7"]]=8;V[n["&"]]=8|W<<8;V[n["8"]]=9;V[n["*"]]=9|W<<8;V[n["9"]]=10;V[n["("]]=10|W<<8;V[n["0"]]=11;V[n[")"]]=11|W<<8;V[n["-"]]=12;V[n._]=12|W<<8;V[n["="]]=13;V[n["+"]]=13|W<<8;V[1008]=Eo;
V[1009]=15;V[n.q]=16;V[n.Q]=16|W<<8;V[n.sn]=17;V[n.Qh]=17|W<<8;V[n.e]=18;V[n.E]=18|W<<8;V[n.r]=19;V[n.Lh]=19|W<<8;V[n.t]=20;V[n.Nh]=20|W<<8;V[n.y]=21;V[n.Sh]=21|W<<8;V[n.qn]=22;V[n.Oh]=22|W<<8;V[n.yk]=23;V[n.Dh]=23|W<<8;V[n.Tl]=24;V[n.Jh]=24|W<<8;V[n.p]=25;V[n.Kh]=25|W<<8;V[n["["]]=26;V[n["{"]]=26|W<<8;V[n["]"]]=27;V[n["}"]]=27|W<<8;V[13]=28;V[1017]=Jo;V[n.Cd]=30;V[n.Bd]=30|W<<8;V[n.nn]=31;V[n.Mh]=31|W<<8;V[n.d]=32;V[n.zh]=32|W<<8;V[n.vk]=33;V[n.Ah]=33|W<<8;V[n.wk]=34;V[n.Bh]=34|W<<8;V[n.xk]=35;
V[n.Ch]=35|W<<8;V[n.Jl]=36;V[n.Eh]=36|W<<8;V[n.k]=37;V[n.Fh]=37|W<<8;V[n.Ll]=38;V[n.Gh]=38|W<<8;V[n[";"]]=39;V[n[":"]]=39|W<<8;V[n["'"]]=40;V[n['"']]=40|W<<8;V[n["`"]]=41;V[n["~"]]=41|W<<8;V[1016]=W;V[n["\\"]]=43;V[n["|"]]=43|W<<8;V[n.z]=44;V[n.sf]=44|W<<8;V[n.x]=45;V[n.Rh]=45|W<<8;V[n.kk]=46;V[n.xh]=46|W<<8;V[n.rn]=47;V[n.Ph]=47|W<<8;V[n.jk]=48;V[n.wh]=48|W<<8;V[n.n]=49;V[n.Ih]=49|W<<8;V[n.Ol]=50;V[n.Hh]=50|W<<8;V[n[","]]=51;V[n["<"]]=51|W<<8;V[n["."]]=52;V[n[">"]]=52|W<<8;V[n["/"]]=53;
V[1009]=15;V[n.q]=16;V[n.Q]=16|W<<8;V[n.un]=17;V[n.Qh]=17|W<<8;V[n.e]=18;V[n.E]=18|W<<8;V[n.r]=19;V[n.Lh]=19|W<<8;V[n.t]=20;V[n.Nh]=20|W<<8;V[n.y]=21;V[n.Sh]=21|W<<8;V[n.sn]=22;V[n.Oh]=22|W<<8;V[n.yk]=23;V[n.Dh]=23|W<<8;V[n.Vl]=24;V[n.Jh]=24|W<<8;V[n.p]=25;V[n.Kh]=25|W<<8;V[n["["]]=26;V[n["{"]]=26|W<<8;V[n["]"]]=27;V[n["}"]]=27|W<<8;V[13]=28;V[1017]=Jo;V[n.Cd]=30;V[n.Bd]=30|W<<8;V[n.pn]=31;V[n.Mh]=31|W<<8;V[n.d]=32;V[n.zh]=32|W<<8;V[n.vk]=33;V[n.Ah]=33|W<<8;V[n.wk]=34;V[n.Bh]=34|W<<8;V[n.xk]=35;
V[n.Ch]=35|W<<8;V[n.Jl]=36;V[n.Eh]=36|W<<8;V[n.k]=37;V[n.Fh]=37|W<<8;V[n.Ll]=38;V[n.Gh]=38|W<<8;V[n[";"]]=39;V[n[":"]]=39|W<<8;V[n["'"]]=40;V[n['"']]=40|W<<8;V[n["`"]]=41;V[n["~"]]=41|W<<8;V[1016]=W;V[n["\\"]]=43;V[n["|"]]=43|W<<8;V[n.z]=44;V[n.sf]=44|W<<8;V[n.x]=45;V[n.Rh]=45|W<<8;V[n.kk]=46;V[n.xh]=46|W<<8;V[n.tn]=47;V[n.Ph]=47|W<<8;V[n.jk]=48;V[n.wh]=48|W<<8;V[n.n]=49;V[n.Ih]=49|W<<8;V[n.Pl]=50;V[n.Hh]=50|W<<8;V[n[","]]=51;V[n["<"]]=51|W<<8;V[n["."]]=52;V[n[">"]]=52|W<<8;V[n["/"]]=53;
V[n["?"]]=53|W<<8;V[3016]=54;V[1044]=55;V[1018]=Lo;V[1032]=57;V[bo]=58;V[1112]=59;V[1113]=60;V[1114]=61;V[1115]=62;V[1116]=63;V[1117]=64;V[1118]=65;V[1119]=66;V[1120]=67;V[1121]=68;V[co]=69;V[eo]=70;V[1036]=71;V[1038]=72;V[1033]=73;V[1109]=74;V[1037]=75;V[1101]=76;V[1039]=77;V[1107]=78;V[1035]=79;V[1040]=80;V[1034]=81;V[1045]=82;V[1046]=Fo;V[4027]=84;V[1122]=87;V[1123]=88;V[1091]=91;V[1093]=93;V[1224]=91;V[Po]=46|Jo<<8;V[Ao]=70|Jo<<8;V[4046]=Fo|Jo<<8|Lo<<16;V[4045]=82|Jo<<8|Lo<<16;
V[4013]=28|Jo<<8|Lo<<16;var Xm=255,an=243,bn=237,$m=170,Ym=250,Oo=255,No=20;Ea(function(){for(var a=Wa(document,"pcx86","keyboard"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new Xn(d);Va(d,c)}});
function Qo(a,b,c,d){if(void 0!==b&&(!c||c.length)){this.video=a;var e=Ro[b],f=a.ea||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(b<Hn?So:To)];this.Ma=b;this.Ya=e[2];this.Ab=e[3];this.Uc=d||e[4];65536<=this.Uc&&720896<=this.Ya&&(this.Ab=Math.min(this.Uc>>2,32768));this.Ub=c[0];this.Cc=c[1];this.df=c[2];this.Y=c[3];this.ec=c[4]&255;this.Uf=c[4]>>8&255;this.Qa=c[5];this.tg=So;if(b>=Hn){this.tg=To;(b=c[6])||(b=[!1,0,Array(Uo),0,f==Wj?0:Vo,0,0,Array(Wo),0,0,0,Array(Xo),0,[this.Ya,this.Ab,this.Uc],
Array(this.Uc>>2),Yo|Zo|$o|ap|bp,0,-1,0,-1,0,-1,0,0,0,0,cp,dp,0,0,ep,Array(fp)]);this.He=b[0];this.Nd=b[1];this.rc=b[2];this.nh=b[3];this.ef=b[4];this.Xf=b[5];this.Qd=b[6];this.Pd=b[7];this.Oj=b[8];this.Pj=b[9];this.Od=b[10];this.jd=b[11];this.mb=b[12];d=b[13];"number"==typeof d&&(d=[this.Ya,this.Ab,d]);this.Ya=d[0];this.Ab=d[1];d=this.Uc>>2;if((this.pd=b[14])&&this.pd.length<d){for(var e=this.pd,g=0,h=Array(d),k=0;k<e.length-1;){for(var m=e[k++],q=e[k++];m--;)h[g]=q,g+=2;g==d&&(g=1)}this.pd=h}(d=
b[15])&&(d&bp?d&=~bp:d=gp[d&65280]|gp[d&255]);this.Zf(d);this.jh=b[16];this.Ua=b[17];this.zc=b[18];this.pb=b[19];this.Xe=b[20];this.hd=b[21];this.yd=b[22];this.ug=b[23];this.vg=b[24];this.Zc=b[25];this.kh=this.te=0;this.Ma==Jn&&(this.oh=b[26],this.Vf=b[27],this.$c=b[28],this.sc=b[29],this.Wf=b[30],this.ve=b[31])}f=hp[f]||hp[Wj];this.wg=a.U.R.Wc/f.Nf|0;this.Ql=this.wg*f.Sf/100|0;this.zg=this.wg*f.Mf|0;this.Sl=this.zg*f.Tf/100|0;this.Ag=c[7]||0}}
b[15])&&(d&bp?d&=~bp:d=gp[d&65280]|gp[d&255]);this.Zf(d);this.jh=b[16];this.Ua=b[17];this.zc=b[18];this.pb=b[19];this.Xe=b[20];this.hd=b[21];this.yd=b[22];this.ug=b[23];this.vg=b[24];this.Zc=b[25];this.kh=this.te=0;this.Ma==Jn&&(this.oh=b[26],this.Vf=b[27],this.$c=b[28],this.sc=b[29],this.Wf=b[30],this.ve=b[31])}f=hp[f]||hp[Wj];this.wg=a.U.R.Wc/f.Nf|0;this.Sl=this.wg*f.Sf/100|0;this.zg=this.wg*f.Mf|0;this.Ul=this.zg*f.Tf/100|0;this.Ag=c[7]||0}}
function ip(a){var b=[];if(void 0!==a.Ma){b[0]=a.Ub;b[1]=a.Cc;b[2]=a.df;b[3]=a.Y;b[4]=a.ec|a.Uf<<8;b[5]=a.Qa;if(a.Ma>=Hn){var c=[];c[0]=a.He;c[1]=a.Nd;c[2]=a.rc;c[3]=a.nh;c[4]=a.ef;c[5]=a.Xf;c[6]=a.Qd;c[7]=a.Pd;c[8]=a.Oj;c[9]=a.Pj;c[10]=a.Od;c[11]=a.jd;c[12]=a.mb;c[13]=[a.Ya,a.Ab,a.Uc];var d;if(d=a.pd){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var k=d[h],m=h+2;m<d.length&&d[m]===k;)m+=2;f[e++]=m-h>>1;f[e++]=k;h=m}f.length<d.length&&(d=f)}c[14]=d;c[15]=a.sg|bp;
c[16]=a.jh;c[17]=a.Ua;c[18]=a.zc;c[19]=a.pb;c[20]=a.Xe;c[21]=a.hd;c[22]=a.yd;c[23]=a.ug;c[24]=a.vg;c[25]=a.Zc;a.Ma==Jn&&(c[26]=a.oh,c[27]=a.Vf,c[28]=a.$c,c[29]=a.sc,c[30]=a.Wf,c[31]=a.ve);b[6]=c}b[7]=a.Ag}return b}Qo.prototype.si=function(a){return[this.pd,a-this.Ya]};Qo.prototype.pg=function(){return this.A};Qo.prototype.Zf=function(a){if(null!=a&&a!=this.sg){var b=a&jp,c=kp[b];c||b&Zo&&(c=kp[Zo]);var b=a&lp,d=kp[b];d||b&ap&&(d=kp[ap]);this.A||(this.A=Array(6));this.A[0]=c;this.A[1]=d;this.sg=a}};
function mp(a,b){var c=a.Qa[b];if(null!=c&&a.Ma>=Hn){var d=0,e=0,f=0;switch(b){case np:d=op;a.Ma==Jn&&(e=pp);break;case qp:a.Ma==Hn&&(d=rp);break;case sp:d=tp;a.Ma==Jn&&(e=up);break;case vp:d=wp;a.Ma==Jn&&(e=xp);break;case yp:d=zp;a.Ma==Jn&&(f=Ap);break;case Bp:d=Cp,a.Ma==Jn&&(f=Dp)}d&&(c|=a.Qa[Ep]&d?256:0,c|=a.Qa[Ep]&e?512:0,c|=a.Qa[Fp]&f?512:0)}return c}
@ -537,28 +537,28 @@ function Zp(a,b){if(a.ca.Pb){var c=!1,d=a.C;d&&(d!==a.A?d.Cc&8&&(c=!0):d.Nd&32&&
q,f++),c+=2,d++;a.la=!0;f&&a.Ba&&a.J.drawImage(a.za,0,0,a.$a,a.ab,a.ic,a.jc,a.Kb,a.Tb);Bq(a)}}else if(a.Db){var g=k,w,k=c,d=a.ua=0,f=a.xb,e=16==f?65536:196608,h=16==f?1:2;b=pq(a,h);for(var q=m=0,y=a.F,z=0,B=a.H,S=0;k<g;){w=$b(a.ma,k);if(a.la&&w===a.L[d])m+=f;else{a.L[d]=w;w=w>>8|(w&255)<<8;var X=e,ca=16;m<y&&(y=m);for(var $a=0;$a<f;$a++){var zb=(w&(X>>=h))>>(ca-=h);Aq(a.Ha,m++,q,b[zb])}m>z&&(z=m);q<B&&(B=q);q>=S&&(S=q+1)}k+=2;d++;if(m>=a.F){m=0;q+=2;if(q>a.H)break;q==a.H&&(q=1,k=c+a.Db)}}a.la=!0;
y<a.F&&(a.Ba.putImageData(a.Ha,0,0,y,B,z-y,S-B),a.J.drawImage(a.za,0,0,a.F,a.H,0,0,a.X,a.ja))}else if(a.yc){g=h;f=a.ua=0;e=pq(a,8);h=a.C.pd;m=b=0;q=a.F;y=0;z=a.H;B=0;S=a.C.Pd[4]&8?4:1;w=a.C.rc[19]&15;for(X=a.Ka>a.F?a.Ka-a.F-w>>3:0;c<k;){d=h[c-g];$a=4;w||(a.la&&d===a.L[f]?(b+=$a,$a=0):a.L[f]=d,f++);if($a){b<q&&(q=b);for(ca=0;ca<$a;ca++)Aq(a.Ha,b++,m,e[d&255]),d>>=8;b>y&&(y=b);m<z&&(z=m);m>=B&&(B=m+1)}c+=S;if(b>=a.F){b=0;if(++m>a.H)break;c+=X}}w||(a.la=!0);q<a.F&&(a.Ba.putImageData(a.Ha,0,0,q,z,y-q,
B-z),a.J.drawImage(a.za,0,0,a.F,a.H,0,0,a.X,a.ja))}else{g=h;d=a.ua=0;f=pq(a);e=a.C.pd;b=h=0;m=a.F;q=0;y=a.H;z=0;B=a.C.rc[19]&15;for(S=a.Ka>a.F?a.Ka-a.F-B>>3:0;c<k;){w=c++-g;w=e[w];ca=8;B?h?(X=a.F-h,ca>X&&(ca=X)):(w<<=B,ca-=B,a.la=!1):(a.la&&w===a.L[d]?(h+=ca,ca=0):a.L[d]=w,d++);if(ca){h<m&&(m=h);for(X=0;X<ca;X++)$a=Zq[w&2155905152]||0,Aq(a.Ha,h++,b,f[$a]),w<<=1;h>q&&(q=h);b<y&&(y=b);b>=z&&(z=b+1)}if(h>=a.F){h=0;if(++b>a.H)break;c+=S}}B||(a.la=!0);m<a.F&&(a.Ba.putImageData(a.Ha,0,0,m,y,q-m,z-y),a.J.drawImage(a.za,
0,0,a.F,a.H,0,0,a.X,a.ja))}}}}function Yq(a,b){var c=0;a=Qc(a.U)-b.Ag;0>a&&(b.Ag=a,a=-a|0);a%b.wg>b.Ql&&(c|=1);a%b.zg>b.Sl&&(c|=9);b.kh=a/b.zg|0;return c}l.nl=function(){var a=this.W,b;a.Ub&&(b=a.ec);return b};l.Gm=function(a,b){a=this.W;a.Uf=a.ec;a.ec=b&31};l.ml=function(){return $q(this.W)};l.Fm=function(a,b){ar(this,this.W,b)};l.ol=function(){return this.W.Cc};l.Hm=function(a,b){this.W.Cc=b;nq(this,!1)};l.pl=function(){return br(this,this.W)};l.Fj=function(a,b){this.A.Xf=this.A.Xf&-4|b&3};
0,0,a.F,a.H,0,0,a.X,a.ja))}}}}function Yq(a,b){var c=0;a=Qc(a.U)-b.Ag;0>a&&(b.Ag=a,a=-a|0);a%b.wg>b.Sl&&(c|=1);a%b.zg>b.Ul&&(c|=9);b.kh=a/b.zg|0;return c}l.nl=function(){var a=this.W,b;a.Ub&&(b=a.ec);return b};l.Im=function(a,b){a=this.W;a.Uf=a.ec;a.ec=b&31};l.ml=function(){return $q(this.W)};l.Hm=function(a,b){ar(this,this.W,b)};l.ol=function(){return this.W.Cc};l.Jm=function(a,b){this.W.Cc=b;nq(this,!1)};l.pl=function(){return br(this,this.W)};l.Fj=function(a,b){this.A.Xf=this.A.Xf&-4|b&3};
l.Mk=function(){return this.A.Nd};l.hk=function(){return this.A.rc[this.A.Nd&31]};l.Ej=function(a,b){a=this.A;var c=a.Nd&32;if(a.He){a.He=!1;var d=a.Nd&31;if(16<=d||!c)if(cr||a.rc[d]!==b)a.rc[d]=b,Vq(this,!1)}else a.Nd=b,a.He=!0,b&32&&!c&&fq(this,!0)&&Zp(this,!0),b=(a.Qa[12]<<8)+a.Qa[13]|0,a.Zc!=b&&(a.Zc=b,Vq(this)),a.te=0};
l.zl=function(){var a=0;if(this.Ma==Hn)a=3-((this.A.ef&12)>>2),a=(this.qb&1<<a)<<4-a;else{var b=this.A.ve[0];45!=(b&63)&&2880!=(b&4032)&&184320!=(b&258048)&&(a|=16)}a|=this.A.nh&-17;return this.A.nh=a};l.Im=function(a,b){this.A.ef=b;eq(this)};l.Al=function(){return this.A.oh};l.Qm=function(a,b){this.A.oh=b};l.xl=function(){return this.A.Qd};l.Om=function(a,b){this.A.Qd=b};l.wl=function(){return this.A.Pd[this.A.Qd]};
l.Nm=function(a,b){if(cr||this.A.Pd[this.A.Qd]!==b)this.A.Pd[this.A.Qd]=b;switch(this.A.Qd){case 2:this.A.Ua=Gp[b&15];break;case 4:Gq(this,Fq(this))&&Zp(this,!0)}};l.Zk=function(){return this.A.Vf};l.pm=function(a,b){if(cr||this.A.Vf!==b)this.A.Vf=b};l.$k=function(){return this.A.Wf};l.qm=function(a,b){this.A.$c=b;this.A.Wf=3;this.A.sc=0};l.rm=function(a,b){this.A.$c=b;this.A.Wf=ep;this.A.sc=0};
l.Yk=function(){var a=this.A.ve[this.A.$c]>>this.A.sc&63;this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1);return a};l.om=function(a,b){a=this.A.ve[this.A.$c];b=a&~(63<<this.A.sc)|(b&63)<<this.A.sc;a!==b&&(this.A.ve[this.A.$c]=b,Vq(this,!1));this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1)};l.Bl=function(){return this.A.Xf};l.Bm=function(a,b){this.A.Pj=b};l.Cl=function(){return this.A.ef};l.Am=function(a,b){this.A.Oj=b};l.gl=function(){return this.A.Od};
l.zm=function(a,b){this.A.Od=b};l.fl=function(){return this.A.jd[this.A.Od]};
l.ym=function(a,b){if(cr||this.A.jd[this.A.Od]!==b)this.A.jd[this.A.Od]=b;switch(this.A.Od){case 0:this.A.Xe=Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 1:this.A.hd=~Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 2:this.A.ug=Gp[b&15]&-2139062144;break;case 3:case 5:Gq(this,Fq(this));break;case 4:this.A.jh=(b&3)<<3;break;case 6:nq(this,!1);break;case 7:this.A.vg=Gp[b&15]&-2139062144;break;case 8:this.A.pb=b|b<<8|b<<16|b<<24}};l.Sk=function(){var a=this.I,b;a.Ub&&(b=a.ec);return b};
l.jm=function(a,b){a=this.I;a.Uf=a.ec;a.ec=b&31};l.Rk=function(){return $q(this.I)};l.im=function(a,b){ar(this,this.I,b)};l.Tk=function(){return this.I.Cc};l.km=function(a,b){this.I.Cc=b;nq(this,!1)};l.Qk=function(){return this.I.df};l.hm=function(a,b){this.I.df!==b&&(this.I.df=b,Vq(this,!1))};l.Uk=function(){return br(this,this.I)};function $q(a){var b;a.Ub&&a.ec<a.tg&&(b=a.Qa[a.ec]);return b}
l.zl=function(){var a=0;if(this.Ma==Hn)a=3-((this.A.ef&12)>>2),a=(this.qb&1<<a)<<4-a;else{var b=this.A.ve[0];45!=(b&63)&&2880!=(b&4032)&&184320!=(b&258048)&&(a|=16)}a|=this.A.nh&-17;return this.A.nh=a};l.Km=function(a,b){this.A.ef=b;eq(this)};l.Al=function(){return this.A.oh};l.Sm=function(a,b){this.A.oh=b};l.xl=function(){return this.A.Qd};l.Qm=function(a,b){this.A.Qd=b};l.wl=function(){return this.A.Pd[this.A.Qd]};
l.Pm=function(a,b){if(cr||this.A.Pd[this.A.Qd]!==b)this.A.Pd[this.A.Qd]=b;switch(this.A.Qd){case 2:this.A.Ua=Gp[b&15];break;case 4:Gq(this,Fq(this))&&Zp(this,!0)}};l.Zk=function(){return this.A.Vf};l.rm=function(a,b){if(cr||this.A.Vf!==b)this.A.Vf=b};l.$k=function(){return this.A.Wf};l.sm=function(a,b){this.A.$c=b;this.A.Wf=3;this.A.sc=0};l.tm=function(a,b){this.A.$c=b;this.A.Wf=ep;this.A.sc=0};
l.Yk=function(){var a=this.A.ve[this.A.$c]>>this.A.sc&63;this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1);return a};l.qm=function(a,b){a=this.A.ve[this.A.$c];b=a&~(63<<this.A.sc)|(b&63)<<this.A.sc;a!==b&&(this.A.ve[this.A.$c]=b,Vq(this,!1));this.A.sc+=6;12<this.A.sc&&(this.A.sc=0,this.A.$c=this.A.$c+1&fp-1)};l.Bl=function(){return this.A.Xf};l.Dm=function(a,b){this.A.Pj=b};l.Cl=function(){return this.A.ef};l.Cm=function(a,b){this.A.Oj=b};l.gl=function(){return this.A.Od};
l.Bm=function(a,b){this.A.Od=b};l.fl=function(){return this.A.jd[this.A.Od]};
l.Am=function(a,b){if(cr||this.A.jd[this.A.Od]!==b)this.A.jd[this.A.Od]=b;switch(this.A.Od){case 0:this.A.Xe=Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 1:this.A.hd=~Gp[b&15];this.A.yd=this.A.Xe&~this.A.hd;break;case 2:this.A.ug=Gp[b&15]&-2139062144;break;case 3:case 5:Gq(this,Fq(this));break;case 4:this.A.jh=(b&3)<<3;break;case 6:nq(this,!1);break;case 7:this.A.vg=Gp[b&15]&-2139062144;break;case 8:this.A.pb=b|b<<8|b<<16|b<<24}};l.Sk=function(){var a=this.I,b;a.Ub&&(b=a.ec);return b};
l.lm=function(a,b){a=this.I;a.Uf=a.ec;a.ec=b&31};l.Rk=function(){return $q(this.I)};l.km=function(a,b){ar(this,this.I,b)};l.Tk=function(){return this.I.Cc};l.mm=function(a,b){this.I.Cc=b;nq(this,!1)};l.Qk=function(){return this.I.df};l.jm=function(a,b){this.I.df!==b&&(this.I.df=b,Vq(this,!1))};l.Uk=function(){return br(this,this.I)};function $q(a){var b;a.Ub&&a.ec<a.tg&&(b=a.Qa[a.ec]);return b}
function ar(a,b,c){if(b.ec<b.tg){if(cr||b.Qa[b.ec]!==c)b.Qa[b.ec]=c;if(12==b.ec||13==b.ec)if(Yq(a,b)&1){var d=(b.Qa[12]<<8)+b.Qa[13]|0;b.Zc!==d&&(b.Zc=d,Vq(a))}else b.te||(b.te=b.kh);(9==b.ec&&8!=b.Uf||b.ec==vp&&223==c)&&nq(a,!0);oq(a)}}function br(a,b){var c=Yq(a,b);b===a.A?(c|=b.Y&48^48,b.He=!1):c=(b.Y^=9)|240;return b.Y=c}
var cr=!0,Uq=1,Kq=2,bq=3,Tq=5,Sq=6,dq=7,Oq=13,Pq=14,Iq=15,Jq=16,Qq=17,Rq=18,Lq=19,Mq=20,Nq=21,Hq=255,wq=1,vq=3,Pp=wq,Mp=vq,Hn=5,Jn=7,Hp={mda:[Pp,dq],cga:[Mp,bq],ega:[Hn,bq],vga:[Jn,bq]},hp={2:{Nf:15700,Mf:208,Sf:85,Tf:96}};hp[Wj]={Nf:18432,Mf:364,Sf:85,Tf:96};hp[4]={Nf:21850,Mf:364,Sf:85,Tf:96};hp[7]={Nf:16700,Mf:480,Sf:85,Tf:83};var cq={6:[1,Wj,!0],7:[2,Wj,!0],8:[6,Wj,!0],9:[4,Wj,!0],10:[Wj,1,!0],11:[Wj,2,!0],0:[1,Wj,!1],1:[2,Wj,!1],2:[6,Wj,!1],3:[4,Wj,!1],4:[Wj,1,!1],5:[Wj,2,!1]},Ip=[];
Ip[Uq]=[40,25,1,0,vq];Ip[bq]=[80,25,1,0,vq];Ip[4]=[320,200,8,192];Ip[Sq]=[640,200,16,192];Ip[dq]=[80,25,1,0,wq];Ip[Oq]=[320,200,8];Ip[Pq]=[640,200,8];Ip[Iq]=[640,350,8];Ip[Jq]=[640,350,8];Ip[Qq]=[640,480,8];Ip[Rq]=[640,480,8];Ip[Lq]=[320,200,1];Ip[Mq]=[320,240,4];Ip[Nq]=[320,400,4];Ip[0]=Ip[Uq];Ip[Kq]=Ip[bq];Ip[Tq]=Ip[4];
var kq=0,iq=7,mq=8,jq=0,lq=112,hq=128,Xq=256,Dq=512,xq=[[0,0,0,255],[127,192,127,255],[127,192,127,255],[127,255,127,255],[127,255,127,255]],yq=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],qq=[[0,0,0,255],[0,0,170,255],[0,170,0,255],[0,170,170,255],[170,0,0,255],[170,0,170,255],[170,85,0,255],[170,170,170,255],[85,85,85,255],[85,85,255,255],[85,255,85,255],[85,255,255,255],[255,85,85,255],[255,85,255,255],[255,255,85,255],[255,255,255,255]],sq=[2,4,6],rq=[3,5,iq],tq=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],
Gp=[0,255,65280,65535,16711680,16711935,16776960,16777215,-16777216,-16776961,-16711936,-16711681,-65536,-65281,-256,-1],Zq=[0];Zq[128]=1;Zq[32768]=2;Zq[32896]=3;Zq[8388608]=4;Zq[8388736]=5;Zq[8421376]=6;Zq[8421504]=7;Zq[-2147483648]=8;Zq[-2147483520]=9;Zq[-2147450880]=10;Zq[-2147450752]=11;Zq[-2139095040]=12;Zq[-2139094912]=13;Zq[-2139062272]=14;Zq[-2139062144]=15;var Ro=[];Ro[Pp]=["MDA",948,720896,4096,0,Wj];Ro[Mp]=["CGA",980,753664,16384,0,2];Ro[Hn]=["EGA",980,753664,16384,65536,4];
Ro[Jn]=["VGA",980,753664,16384,262144,7];
var Jp=0,Yp=1,Xp=2,Np={948:Y.prototype.nl,949:Y.prototype.ml,952:Y.prototype.ol,954:Y.prototype.pl},Op={948:Y.prototype.Gm,949:Y.prototype.Fm,952:Y.prototype.Hm},Qp={980:Y.prototype.Sk,981:Y.prototype.Rk,984:Y.prototype.Tk,985:Y.prototype.Qk,986:Y.prototype.Uk},Rp={980:Y.prototype.jm,981:Y.prototype.im,984:Y.prototype.km,985:Y.prototype.hm},Sp={960:Y.prototype.Mk,961:Y.prototype.hk,962:Y.prototype.zl,964:Y.prototype.xl,965:Y.prototype.wl,974:Y.prototype.gl,975:Y.prototype.fl},Tp={954:Y.prototype.Fj,
960:Y.prototype.Ej,961:Y.prototype.Ej,962:Y.prototype.Im,964:Y.prototype.Om,965:Y.prototype.Nm,970:Y.prototype.Bm,972:Y.prototype.Am,974:Y.prototype.zm,975:Y.prototype.ym,986:Y.prototype.Fj},Up={963:Y.prototype.Al,966:Y.prototype.Zk,967:Y.prototype.$k,969:Y.prototype.Yk,970:Y.prototype.Bl,972:Y.prototype.Cl},Vp={963:Y.prototype.Qm,966:Y.prototype.pm,967:Y.prototype.qm,968:Y.prototype.rm,969:Y.prototype.om};
var Jp=0,Yp=1,Xp=2,Np={948:Y.prototype.nl,949:Y.prototype.ml,952:Y.prototype.ol,954:Y.prototype.pl},Op={948:Y.prototype.Im,949:Y.prototype.Hm,952:Y.prototype.Jm},Qp={980:Y.prototype.Sk,981:Y.prototype.Rk,984:Y.prototype.Tk,985:Y.prototype.Qk,986:Y.prototype.Uk},Rp={980:Y.prototype.lm,981:Y.prototype.km,984:Y.prototype.mm,985:Y.prototype.jm},Sp={960:Y.prototype.Mk,961:Y.prototype.hk,962:Y.prototype.zl,964:Y.prototype.xl,965:Y.prototype.wl,974:Y.prototype.gl,975:Y.prototype.fl},Tp={954:Y.prototype.Fj,
960:Y.prototype.Ej,961:Y.prototype.Ej,962:Y.prototype.Km,964:Y.prototype.Qm,965:Y.prototype.Pm,970:Y.prototype.Dm,972:Y.prototype.Cm,974:Y.prototype.Bm,975:Y.prototype.Am,986:Y.prototype.Fj},Up={963:Y.prototype.Al,966:Y.prototype.Zk,967:Y.prototype.$k,969:Y.prototype.Yk,970:Y.prototype.Bl,972:Y.prototype.Cl},Vp={963:Y.prototype.Sm,966:Y.prototype.rm,967:Y.prototype.sm,968:Y.prototype.tm,969:Y.prototype.qm};
Ea(function(){for(var a=Wa(document,"pcx86","video"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Aa("aspect"));f&&.3<=f&&3.33>=f&&(Da("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");za("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"),f.style.fontSize="16px");c.appendChild(f);var g=e.getContext("2d"),d=new Y(d,e,g,f,c);Va(d,c)}});
function dr(a){t.call(this,"ParallelPort",a);this.G=a.adapter;switch(this.G){case 1:this.D=956;this.C=7;break;case 2:this.D=888;this.C=7;break;case 3:this.D=632;this.C=5;break;default:r("Unrecognized parallel adapter #"+this.G);return}this.A=this.B=null;a=a.binding;"console"==a?this.B="":Ua(this,a,er)}ba(dr,t);l=dr.prototype;l.wb=function(a,b,c){switch(b){case er:return this.ia[b]=this.A=c,!0}return!1};
l.hc=function(a,b,c,d){this.ma=b;this.U=c;this.Ea=d;this.V=nb(a,"ChipSet");cc(b,this,fr,this.D);ec(b,this,gr,this.D);eb(this)};l.Ob=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Nb=function(a){return a?this.save():!0};l.reset=function(){hr(this)};l.save=function(){var a=new Ie(this),b=0,c=[];c[b++]=this.F;c[b++]=this.zb;c[b]=this.Fe;a.set(0,c);return a.data()};l.restore=function(a){return hr(this,a[0])};
function hr(a,b){var c=0;b||(b=[0,0,0]);a.F=b[c++];a.zb=b[c++];a.Fe=b[c];return!0}l.al=function(){return this.F};l.yl=function(){return this.zb};l.Xk=function(){return this.Fe};l.sm=function(a,b){this.F=b;this.zb|=ir;a=!1;this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.lc(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.zb&=~ir);jr(this)};
l.nm=function(a,b){this.Fe=b;jr(this)};function jr(a){a.V&&a.C&&(a.Fe&kr&&!(a.zb&ir)?zf(a.V,a.C):xf(a.V,a.C))}var er="buffer",ir=64,kr=16,fr={0:dr.prototype.al,1:dr.prototype.yl,2:dr.prototype.Xk},gr={0:dr.prototype.sm,2:dr.prototype.nm};Ea(function(){for(var a=Wa(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new dr(d);Va(d,c)}});
function hr(a,b){var c=0;b||(b=[0,0,0]);a.F=b[c++];a.zb=b[c++];a.Fe=b[c];return!0}l.al=function(){return this.F};l.yl=function(){return this.zb};l.Xk=function(){return this.Fe};l.um=function(a,b){this.F=b;this.zb|=ir;a=!1;this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.lc(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.zb&=~ir);jr(this)};
l.pm=function(a,b){this.Fe=b;jr(this)};function jr(a){a.V&&a.C&&(a.Fe&kr&&!(a.zb&ir)?zf(a.V,a.C):xf(a.V,a.C))}var er="buffer",ir=64,kr=16,fr={0:dr.prototype.al,1:dr.prototype.yl,2:dr.prototype.Xk},gr={0:dr.prototype.um,2:dr.prototype.pm};Ea(function(){for(var a=Wa(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new dr(d);Va(d,c)}});
function lr(a){t.call(this,"SerialPort",a);this.ga=a.adapter;switch(this.ga){case 1:this.ba=1016;this.L=4;break;case 2:this.ba=760;this.L=3;break;default:r("Unrecognized serial adapter #"+this.ga);return}this.D=this.G=null;this.na=a.tabSize;this.la=a.charBOL;this.J=0;this.pa=mr|nr;this.N=!0;a=a.binding;"console"==a?this.G="":Ua(this,a,or);this.C=this.Z=this.W=null;this.exports={connect:this.wi,receiveData:this.cf,receiveStatus:this.gk}}ba(lr,t);l=lr.prototype;
l.Yh=function(a,b,c){var d=null;a!=this.Td||this.C||(this.C=b,this.W=c,this.N=!1,d=this);return d};l.wb=function(a,b,c){var d=this;switch(b){case or:return this.ia[b]=this.D=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<b&&(b-=64),d.cf(b);return!0},c.onkeypress=function(a){a=a||window.event;d.cf(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
l.hc=function(a,b,c,d){this.oa=a;this.ma=b;this.U=c;this.Ea=d;this.V=nb(a,"ChipSet");cc(b,this,pr,this.ba);ec(b,this,qr,this.ba);eb(this)};
@ -566,9 +566,9 @@ l.wi=function(a){if(!this.C){var b=Ec(this.oa,"connection");if(b){var c=b.split(
l.Ob=function(a,b){if(!b)if(this.wi(this.N),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Nb=function(a){return a?this.save():!0};l.reset=function(){rr(this)};l.save=function(){var a=new Ie(this),b=0,c=[];c[b++]=this.ea;c[b++]=this.ja;c[b++]=this.K;c[b++]=this.M;c[b++]=this.F;c[b++]=this.I;c[b++]=this.X;c[b++]=this.B;c[b++]=this.A;c[b]=this.H;a.set(0,c);return a.data()};l.restore=function(a){return rr(this,a[0])};
function rr(a,b){var c=0;b||(b=[0,0,sr,0,tr,0,0,ur|vr,a.pa,[]]);a.ea=b[c++];a.ja=b[c++];a.K=b[c++];a.M=b[c++];a.F=b[c++];a.I=b[c++];a.X=b[c++];a.B=b[c++];a.A=b[c++];a.H=b[c];return!0}l.cf=function(a){if("number"==typeof a)this.H.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.H.push(a.charCodeAt(b));else this.H=this.H.concat(a);wr(this);return!0};l.gk=function(a){var b=this.A;this.A&=~(mr|nr);a&32&&(this.A=this.A|mr|xr);a&64&&(this.A=this.A|nr|yr);b!=this.A&&zr(this)};
function wr(a){0<a.H.length&&!(a.B&Ar)&&(a.ea=a.H.shift(),a.B|=Ar);zr(a)}l.vl=function(){var a=this.I&Br?this.K&255:this.ea;this.B&=~Ar;wr(this);return a};l.hl=function(){return this.I&Br?this.K>>8:this.M};l.il=function(){return this.F};l.jl=function(){return this.I};l.ll=function(){return this.X};l.kl=function(){return this.B};l.ql=function(){var a=this.A;this.A&=~(xr|yr);return a};
l.Pm=function(a,b){if(this.I&Br)this.K=this.K&-256|b;else{this.ja=b;this.B&=~(ur|vr);a=!1;this.Z&&this.Z.call(this.C,b)&&(a=!0);if(this.D){if(13==b)this.J=0;else if(8==b)this.D.value=this.D.value.slice(0,-1),0<this.J&&this.J--;else{var c;13!=b&&10!=b&&(c=na[b]);c=c?"<"+c+">":String.fromCharCode(b);a=c.length;32>b&&1==a&&(a=0);9==b&&(b=this.na||8,a=b-this.J%b,this.na&&(c=" ".slice(0,a)));this.la&&!this.J&&a&&(c=String.fromCharCode(this.la)+c);this.D.value+=c;
this.D.scrollTop=this.D.scrollHeight;this.J+=a}a=!0}else if(null!=this.G){if(10==b||1024<=this.G.length)this.lc(this.G),this.G="";10!=b&&(this.G+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|ur|vr)}};l.Cm=function(a,b){this.I&Br?this.K=this.K&255|b<<8:this.M=b};l.Dm=function(a,b){this.I=b};l.Em=function(a,b){a=b^this.X;this.X=b;a&(Cr|Dr)&&this.W&&(a=0,this.N?(a|=b&Dr?32:0,a|=b&Cr?320:0):(a|=b&Dr?16:0,a|=b&Cr?1048576:0),this.W.call(this.C,a))};
function zr(a){var b=-1;a.B&Ar&&a.M&Er?b=Fr:a.A&(xr|yr)&&a.M&Gr&&(b=Hr);0<=b?(a.F&=~(tr|Ir),a.F|=b,a.V&&a.L&&zf(a.V,a.L,100)):(a.F|=tr,a.V&&a.L&&xf(a.V,a.L))}var or="buffer",sr=384,Er=1,Gr=8,tr=1,Fr=4,Hr=0,Ir=6,Br=128,Cr=1,Dr=2,Ar=1,ur=32,vr=64,xr=1,yr=2,mr=16,nr=32,pr={0:lr.prototype.vl,1:lr.prototype.hl,2:lr.prototype.il,3:lr.prototype.jl,4:lr.prototype.ll,5:lr.prototype.kl,6:lr.prototype.ql},qr={0:lr.prototype.Pm,1:lr.prototype.Cm,3:lr.prototype.Dm,4:lr.prototype.Em};
l.Rm=function(a,b){if(this.I&Br)this.K=this.K&-256|b;else{this.ja=b;this.B&=~(ur|vr);a=!1;this.Z&&this.Z.call(this.C,b)&&(a=!0);if(this.D){if(13==b)this.J=0;else if(8==b)this.D.value=this.D.value.slice(0,-1),0<this.J&&this.J--;else{var c;13!=b&&10!=b&&(c=na[b]);c=c?"<"+c+">":String.fromCharCode(b);a=c.length;32>b&&1==a&&(a=0);9==b&&(b=this.na||8,a=b-this.J%b,this.na&&(c=" ".slice(0,a)));this.la&&!this.J&&a&&(c=String.fromCharCode(this.la)+c);this.D.value+=c;
this.D.scrollTop=this.D.scrollHeight;this.J+=a}a=!0}else if(null!=this.G){if(10==b||1024<=this.G.length)this.lc(this.G),this.G="";10!=b&&(this.G+=String.fromCharCode(b));a=!0}a&&(this.B=this.B|ur|vr)}};l.Em=function(a,b){this.I&Br?this.K=this.K&255|b<<8:this.M=b};l.Fm=function(a,b){this.I=b};l.Gm=function(a,b){a=b^this.X;this.X=b;a&(Cr|Dr)&&this.W&&(a=0,this.N?(a|=b&Dr?32:0,a|=b&Cr?320:0):(a|=b&Dr?16:0,a|=b&Cr?1048576:0),this.W.call(this.C,a))};
function zr(a){var b=-1;a.B&Ar&&a.M&Er?b=Fr:a.A&(xr|yr)&&a.M&Gr&&(b=Hr);0<=b?(a.F&=~(tr|Ir),a.F|=b,a.V&&a.L&&zf(a.V,a.L,100)):(a.F|=tr,a.V&&a.L&&xf(a.V,a.L))}var or="buffer",sr=384,Er=1,Gr=8,tr=1,Fr=4,Hr=0,Ir=6,Br=128,Cr=1,Dr=2,Ar=1,ur=32,vr=64,xr=1,yr=2,mr=16,nr=32,pr={0:lr.prototype.vl,1:lr.prototype.hl,2:lr.prototype.il,3:lr.prototype.jl,4:lr.prototype.ll,5:lr.prototype.kl,6:lr.prototype.ql},qr={0:lr.prototype.Rm,1:lr.prototype.Em,3:lr.prototype.Fm,4:lr.prototype.Gm};
Ea(function(){for(var a=Wa(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new lr(d);Va(d,c)}});function Jr(a){t.call(this,"Mouse",a);if(this.N=a.serial)this.V="SerialPort";this.M=this.L=this.Ub=!1;this.C=[];this.B=[];eb(this)}ba(Jr,t);l=Jr.prototype;l.hc=function(a,b,c,d){this.oa=a;this.ma=b;this.U=c;this.Ea=d;for(b=null;b=nb(a,"Video",b);)this.C.push(b)};
l.Ob=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.V&&!this.D){for(a=null;(a=nb(this.oa,this.V,a))&&(!a.Yh||!(this.D=a.Yh(this.N,this,this.fk))););if(this.D)for(this.B=[],a=0;a<this.C.length;a++)b=this.C[a],b.K=this,(b=b.D)&&this.B.push(b);else r(this.id+": "+this.V+" "+this.N+" unavailable")}this.Ub?Kr(this):Lr(this)}return!0};l.Nb=function(a){return a?this.save():!0};l.reset=function(){Mr(this)};
l.save=function(){var a=new Ie(this),b=0,c=[];c[b++]=this.Ub;c[b++]=this.F;c[b++]=this.G;c[b++]=this.H;c[b++]=this.I;c[b++]=this.J;c[b++]=this.K;c[b]=this.A;a.set(0,c);return a.data()};l.restore=function(a){return Mr(this,a[0])};function Mr(a,b){var c=0;b||(b=[!1,-1,-1,0,0,!1,!1,0]);var d=b[c++];a.Ub=d;a.F=b[c++];a.G=b[c++];a.H=b[c++];a.I=b[c++];a.J=b[c++];a.K=b[c++];a.A=b[c];a.A&(Cr|Dr)&&(a.A=(a.A&Cr?1048576:0)|(a.A&Dr?16:0));return!0}l.Ye=function(a){this.L=a};
@ -614,15 +614,15 @@ function ms(a,b,c,d){var e,f=a.ia.listDrives;if(f&&!isNaN(e=fa(f.value,10))&&0<=
l.ji=function(a,b,c,d,e){var f;a.je=!1;b&&(f=b.info(),b&&f[0]>a.fb||f[1]>a.gb)&&(this.Aa('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.La)),b=null);b?(a.sa=b,a.Qj=c,a.Rd=d,ys(this,c,d,b),f=b.info(),this.I|=Bs,this.Aa('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.La),a.Fd||e),a.Lf=f[0],a.Qe=f[1],a.Re=f[2],this.oa&&Rc(this.oa)):a.le=!1;a.Fd&&(a.Fd=!1,--this.J||eb(this));ls(this,a.La)};
function qs(a,b,c,d){if((a=a.ia.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function ls(a,b){if(0<=b&&b<a.A.length){var c=a.A[b],d=a.ia.listDisks;a=a.ia.listDrives;if(d&&a&&d.options&&a.options&&(a=fa(a.value,10),c=c.le?"?":c.Rd,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ss(a,b,c,d){var e=a.A[b];e.sa&&(As(a,e.Rd,e.sa),e.Qj="",e.Rd="",e.sa=null,e.le=!1,a.I|=Bs,d||a.Aa("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||ls(a,b))}
function ys(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function As(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.vm=function(a,b){b&Cs?this.K&Cs||this.K&Ds&&this.V&&zf(this.V,6):ns(this);this.K=b};l.cl=function(){return 80};l.el=function(){return this.Y};l.bl=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.K&Ds&&this.V&&xf(this.V,6);++this.D>=this.C&&(this.Y&=~(Es|Fs),this.D=this.C=0);return a};
l.um=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]&Gs;if(void 0!==Hs[a]&&this.C>=Hs[a].dd){b=!1;this.D=0;a=Is(this);var c,d,e,f,g,h=a&Gs;switch(h){case Js:Is(this);Is(this);Ks(this);break;case Ls:d=Is(this);this.La=d&3;c=this.A[this.La];Ks(this);Ms(this,(c.hb&Ns)>>>24);break;case Os:case Ps:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];c.Sa=b;d=c.ub=Is(this);e=Is(this);f=c.kb=Is(this);g=Is(this);c.tb=128<<g;c.sd=Is(this);Is(this);Is(this);h==Ps?(h=c,h.hb=Qs|Rs,h.sa&&(h.Ra=
function ys(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function As(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.xm=function(a,b){b&Cs?this.K&Cs||this.K&Ds&&this.V&&zf(this.V,6):ns(this);this.K=b};l.cl=function(){return 80};l.el=function(){return this.Y};l.bl=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.K&Ds&&this.V&&xf(this.V,6);++this.D>=this.C&&(this.Y&=~(Es|Fs),this.D=this.C=0);return a};
l.wm=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]&Gs;if(void 0!==Hs[a]&&this.C>=Hs[a].dd){b=!1;this.D=0;a=Is(this);var c,d,e,f,g,h=a&Gs;switch(h){case Js:Is(this);Is(this);Ks(this);break;case Ls:d=Is(this);this.La=d&3;c=this.A[this.La];Ks(this);Ms(this,(c.hb&Ns)>>>24);break;case Os:case Ps:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];c.Sa=b;d=c.ub=Is(this);e=Is(this);f=c.kb=Is(this);g=Is(this);c.tb=128<<g;c.sd=Is(this);Is(this);Is(this);h==Ps?(h=c,h.hb=Qs|Rs,h.sa&&(h.Ra=
null,h.hb=Ss,this.V&&(ol(this.V,2,this,"dmaRead",h),kl(this.V,2)))):(h=c,h.hb=Qs|Rs,h.sa&&(h.sa.pe?h.hb=Ts|Rs:(h.Ra=null,h.hb=Ss,this.V&&(ol(this.V,2,this,"dmaWrite",h),kl(this.V,2)))));Us(this,c,a,b,d,e,f,g);b=!0;break;case Vs:d=Is(this);this.La=d&3;c=this.A[this.La];c.ub=c.rd=0;c.hb=Ws|Xs;Ks(this);b=!0;break;case Ys:c=this.A[this.La];c.Sa=0;Ks(this);Ms(this,c.La|c.Sa<<2|c.hb&Zs);Ms(this,c.ub);this.La=this.La+1&3;break;case $s:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];d=c.ub;e=c.Sa=b;f=c.kb=
1;g=0;c.hb=Ss;c.sa&&(c.Ra=c.sa.seek(c.ub,c.Sa,c.kb))?g=c.Ra.length>>8:c.hb=Qs|Rs;Us(this,c,a,b,d,e,f,g);b=!0;break;case at:d=Is(this);b=d>>2&1;this.La=d&3;c=this.A[this.La];d=c.ub;e=c.Sa=b;f=1;g=Is(this);c.tb=128<<g;c.sd=Is(this);Is(this);c.Zh=Is(this);h=c;h.hb=Qs|Rs;h.sa&&(h.Ra=null,h.hb=Ss,this.V&&(h.ge=0,h.Fc=Array(4),h.ig=!0,h.xf=0,ol(this.V,2,this,"dmaFormat",h),kl(this.V,2),h.ig=!1));Us(this,c,a,b,d,e,f,g);b=!0;break;case bt:d=Is(this),this.La=d&3,c=this.A[this.La],c.Sa=d>>2&1,d=Is(this),c.ub+=
d-c.rd,0>c.ub&&(c.ub=0),c.ub>=c.fb&&(c.ub=c.fb-1),c.rd=d,c.hb=Ws,c.ub||(c.hb|=Xs),Ks(this),b=!0}0<this.C&&(this.Y=this.Y|Es|Fs);this.K&Ds&&(!c||c.hb&Qs||!b||this.V&&zf(this.V,6))}};l.dl=function(){var a=this.I;this.I&=~Bs;return a};l.tm=function(a,b){this.F=b};function Us(a,b,c,d,e,f,g,h){Ks(a);Ms(a,b.La|b.Sa<<2|b.hb&Zs);Ms(a,(b.hb&ct)>>>8);Ms(a,(b.hb&dt)>>>16);var k=0;if(e!=b.ub||f!=b.Sa)k=g=1;c&et&&(f^=k,d||(k=0));Ms(a,e+k);Ms(a,f);Ms(a,g);Ms(a,h)}function Is(a){var b=a.G[a.D];a.D++;return b}
d-c.rd,0>c.ub&&(c.ub=0),c.ub>=c.fb&&(c.ub=c.fb-1),c.rd=d,c.hb=Ws,c.ub||(c.hb|=Xs),Ks(this),b=!0}0<this.C&&(this.Y=this.Y|Es|Fs);this.K&Ds&&(!c||c.hb&Qs||!b||this.V&&zf(this.V,6))}};l.dl=function(){var a=this.I;this.I&=~Bs;return a};l.vm=function(a,b){this.F=b};function Us(a,b,c,d,e,f,g,h){Ks(a);Ms(a,b.La|b.Sa<<2|b.hb&Zs);Ms(a,(b.hb&ct)>>>8);Ms(a,(b.hb&dt)>>>16);var k=0;if(e!=b.ub||f!=b.Sa)k=g=1;c&et&&(f^=k,d||(k=0));Ms(a,e+k);Ms(a,f);Ms(a,g);Ms(a,h)}function Is(a){var b=a.G[a.D];a.D++;return b}
function Ks(a){a.D=a.C=0}function Ms(a,b){a.G[a.C++]=b}l.$j=function(a,b,c){void 0===b||0>b?this.ue(a,c):c(-1,!1)};l.ak=function(a,b){return void 0!==b&&0<=b?ft(a,b):-1};l.qk=function(a,b){if(void 0!==b&&0<=b)a:if(a.hb)a=-1;else{a.Fc[a.ge++]=b;if(a.ge==a.Fc.length){a.ub=a.Fc[0];a.Sa=a.Fc[1];a.kb=a.Fc[2];a.tb=128<<a.Fc[3];for(var c=a.ge=0;c<a.tb;c++)if(0>ft(a,a.Zh)){a=-1;break a}a.xf++}a.xf>=a.sd&&(b=-1);a=b}else a=-1;return a};
l.ue=function(a,b){var c=-1,d=null,e=0;if(!a.hb&&a.sa){do{if(a.Ra&&(e=a.Oa,0<=(c=a.sa.read(a.Ra,a.Oa++)))){d=a.Ra;break}a.Ra=a.sa.seek(a.ub,a.Sa,a.kb);if(!a.Ra){a.hb=gt|Rs;break}a.Oa=0;ht(a)}while(1)}b(c,!1,d,e)};function ft(a,b){if(a.hb||!a.sa)return-1;do{if(a.Ra&&a.sa.write(a.Ra,a.Oa++,b))break;a.Ra=a.sa.seek(a.ub,a.Sa,a.kb);if(!a.Ra){a.hb=it|Rs;b=-1;break}a.Oa=0;ht(a)}while(1);return b}function ht(a){a.kb++;a.kb>=a.Re+1&&(a.kb=1,a.Sa++,a.Sa>=a.Qe&&(a.Sa=0,a.ub++))}
var ws="Floppy Drive",Cs=4,Ds=8,Fs=16,Es=64,us=128,Js=3,Ls=4,Os=5,Ps=6,Vs=7,Ys=8,$s=10,at=13,bt=15,Gs=31,et=128,Ss=0,Qs=8,Ws=32,Rs=64,vs=192,Zs=255,Ts=512,gt=1024,it=8192,ct=65280,dt=16711680,Xs=268435456,Ns=-16777216,Bs=128,zs=0;aa={};
var Hs={3:{dd:3,td:0,name:aa.xo},4:{dd:2,td:1,name:aa.vo},5:{dd:9,td:7,name:aa.Bo},6:{dd:9,td:7,name:aa.ro},7:{dd:2,td:0,name:aa.to},8:{dd:1,td:2,name:aa.wo},10:{dd:2,td:7,name:aa.so},13:{dd:6,td:7,name:aa.oo},15:{dd:3,td:0,name:aa.uo}},os={1009:ks.prototype.cl,1012:ks.prototype.el,1013:ks.prototype.bl,1015:ks.prototype.dl},ps={1010:ks.prototype.vm,1013:ks.prototype.um,1015:ks.prototype.tm};
var Hs={3:{dd:3,td:0,name:aa.zo},4:{dd:2,td:1,name:aa.xo},5:{dd:9,td:7,name:aa.Do},6:{dd:9,td:7,name:aa.to},7:{dd:2,td:0,name:aa.vo},8:{dd:1,td:2,name:aa.yo},10:{dd:2,td:7,name:aa.uo},13:{dd:6,td:7,name:aa.qo},15:{dd:3,td:0,name:aa.wo}},os={1009:ks.prototype.cl,1012:ks.prototype.el,1013:ks.prototype.bl,1015:ks.prototype.dl},ps={1010:ks.prototype.xm,1013:ks.prototype.wm,1015:ks.prototype.vm};
Ea(function(){for(var a=Wa(document,"pcx86","fdc"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new ks(d);Va(d,c)}});function Z(a){t.call(this,"HDC",a);this.dmaRead=Z.prototype.bk;this.dmaWrite=Z.prototype.ck;this.dmaWriteBuffer=Z.prototype.rk;this.dmaWriteFormat=Z.prototype.sk;this.X=[];this.ja=a.drives;this.L="at"==a.type}ba(Z,t);l=Z.prototype;
l.wb=function(a,b,c){var d=this;switch(b){case "saveHD0":case "saveHD1":return this.ia[b]=c,c.onclick=function(a){return function(){var b=d.A&&d.A[a];b&&b.sa?(b=b.sa,b=Ca(is(b),"octet-stream",!0,b.ph.replace(".json",".img")),r(b)):d.Aa("Hard drive "+a+" is not available.")}}(+b.slice(-1)),!0}return!1};
l.hc=function(a,b,c,d){this.ma=b;this.U=c;this.Ea=d;this.oa=a;if(d=Ec(a,"drives"))this.X=d;else if(this.ja)try{this.X=eval("("+this.ja+")")}catch(e){r("HDC drive configuration error: "+e.message+" ("+this.ja+")")}this.V=nb(a,"ChipSet");this.F=0;this.la=3;cc(b,this,this.L?jt:kt);ec(b,this,this.L?lt:mt);this.L&&(this.F++,this.V&&this.V.aa==Ej&&this.F++,this.la=2,b.M[nt]=2,b.N[nt]=2);Ee(c,19,this.Hl.bind(this));Ee(c,64,this.Il.bind(this));this.reset();ot(this)||eb(this)};
@ -635,10 +635,10 @@ function qt(a){var b=0,c=[];a.L?(c[b++]=a.H,c[b++]=a.ta,c[b++]=a.I,c[b++]=a.ea,c
e[g]=m}c[b]=e;return c}function wt(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.be[2])?e=b.be[0]<<8|b.be[1]:c=b.type);null==c||d||(d=vt[a.F][c][1],e=vt[a.F][c][0]);d&&((c=vt[a.F][b.type])&&e!=c[0]&&d!=c[1]&&a.Aa("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.fb=e,b.gb=d,null==b.sa&&(b.sa=new Sr(a,b,b.mode)))}}
function ot(a,b){b||(a.J=0);for(var c=0;c<a.A.length;c++){var d=a.A[c];if(d.name&&d.path){if(!(b&&d.sa&&d.sa.Ef)){var e;e=a;var f=d.name,d=d.path,g=e.A[c];g.je?(e.Aa("Drive "+c+" busy"),e=!0):(g.je=!0,g.Fd=!0,e.J++,(g.sa||new Sr(e,g,g.mode)).load(f,d,null,e.tk),e=!1);!e&&b&&eb(a,!1)}}else b&&void 0!==d.type&&(d.sa=null,wt(a,d,d.type))}return!!a.J}
l.tk=function(a,b,c){a.je=!1;if(a.sa=b)this.Aa('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.La),a.Fd),b=b.info(),b[0]==a.fb&&b[1]==a.gb&&b[2]==a.Za&&b[3]==a.lb||this.Aa("Warning: disk geometry ("+b[0]+":"+b[1]+":"+b[2]+") does not match "+xt[this.F]+" drive type "+a.type+" ("+a.fb+":"+a.gb+":"+a.Za+")");a.Fd&&(a.Fd=!1,--this.J||eb(this))};
l.El=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.V&&xf(this.V,5);this.Y&=~yt;++this.D>=this.C&&(this.D=this.C=0,this.Y&=~(zt|Dt|Et));return a};l.Rm=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]!=Ft?6:this.G.length;6==this.C&&(this.Y&=~Gt);this.C>=a&&(this.Y|=zt,this.Y&=~Gt,Ht(this))};l.Fl=function(){var a=this.Y;this.D<this.C&&(this.Y|=Gt);return a};l.Um=function(a,b){this.qa=b;this.V&&xf(this.V,5);pt(this)};l.Dl=function(){return this.W};
l.Tm=function(a,b){this.pa=b;this.Y=Gt|Dt|Et};l.Sm=function(a,b){this.na=b};l.lh=function(){};function It(a){var b=-1;a.B&&(b=a.ue(a.B,function(){}),(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,a.B.tb>=a.B.lb?(a.Y=Jt,a.ue(a.B,function(b){0<=b?(Kt(a),a.V&&a.V.aa==Ej&&(a.Y=0),a.Y=a.Y|rt|Lt|Mt):(a.Y=Nt,a.H=Ot)},!1)):a.Y=rt|Lt));return b}l.dk=function(){return It(this)|It(this)<<8};
function Pt(a,b){a.B&&a.B.tb>=a.B.lb&&(0>Qt(a.B,b)?(a.Y=Nt,a.H=Ot):(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,Kt(a),a.Y=rt|Lt,a.B.tb>=a.B.lb&&(a.Y|=Mt)))}l.bm=function(a,b){Pt(this,b&255);Pt(this,b>>8&255)};l.Lk=function(){return this.H};l.gm=function(a,b){this.ta=b};l.Nk=function(){return this.I};l.em=function(a,b){this.I=b};l.Ok=function(){return this.ea};l.fm=function(a,b){this.ea=b};l.Jk=function(){return this.ba};l.am=function(a,b){this.ba=b};l.Ik=function(){return this.Z};
l.$l=function(a,b){this.Z=b};l.Kk=function(){return this.N};l.cm=function(a,b){this.N=b;this.Y=this.A[this.N&Rt?1:0]?this.Y|rt|Lt:this.Y&~rt};l.Pk=function(){var a=this.Y;this.Y&rt&&(this.Y&=~Jt);return a};l.Zl=function(a,b){this.ga=b;this.V&&xf(this.V,14);St(this)};l.dm=function(a,b){this.K&Tt&&!(b&Tt)&&(this.H=Ut);this.K=b};
l.El=function(){var a=0;this.D<this.C&&(a=this.G[this.D]);this.V&&xf(this.V,5);this.Y&=~yt;++this.D>=this.C&&(this.D=this.C=0,this.Y&=~(zt|Dt|Et));return a};l.Tm=function(a,b){this.C<this.G.length&&(this.G[this.C++]=b);a=this.G[0]!=Ft?6:this.G.length;6==this.C&&(this.Y&=~Gt);this.C>=a&&(this.Y|=zt,this.Y&=~Gt,Ht(this))};l.Fl=function(){var a=this.Y;this.D<this.C&&(this.Y|=Gt);return a};l.Wm=function(a,b){this.qa=b;this.V&&xf(this.V,5);pt(this)};l.Dl=function(){return this.W};
l.Vm=function(a,b){this.pa=b;this.Y=Gt|Dt|Et};l.Um=function(a,b){this.na=b};l.lh=function(){};function It(a){var b=-1;a.B&&(b=a.ue(a.B,function(){}),(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,a.B.tb>=a.B.lb?(a.Y=Jt,a.ue(a.B,function(b){0<=b?(Kt(a),a.V&&a.V.aa==Ej&&(a.Y=0),a.Y=a.Y|rt|Lt|Mt):(a.Y=Nt,a.H=Ot)},!1)):a.Y=rt|Lt));return b}l.dk=function(){return It(this)|It(this)<<8};
function Pt(a,b){a.B&&a.B.tb>=a.B.lb&&(0>Qt(a.B,b)?(a.Y=Nt,a.H=Ot):(1==a.B.Oa||a.B.Oa==a.B.lb)&&1<a.B.Oa&&(a.B.tb-=a.B.lb,a.I=a.I-1&255,Kt(a),a.Y=rt|Lt,a.B.tb>=a.B.lb&&(a.Y|=Mt)))}l.dm=function(a,b){Pt(this,b&255);Pt(this,b>>8&255)};l.Lk=function(){return this.H};l.im=function(a,b){this.ta=b};l.Nk=function(){return this.I};l.gm=function(a,b){this.I=b};l.Ok=function(){return this.ea};l.hm=function(a,b){this.ea=b};l.Jk=function(){return this.ba};l.cm=function(a,b){this.ba=b};l.Ik=function(){return this.Z};
l.bm=function(a,b){this.Z=b};l.Kk=function(){return this.N};l.em=function(a,b){this.N=b;this.Y=this.A[this.N&Rt?1:0]?this.Y|rt|Lt:this.Y&~rt};l.Pk=function(){var a=this.Y;this.Y&rt&&(this.Y&=~Jt);return a};l.am=function(a,b){this.ga=b;this.V&&xf(this.V,14);St(this)};l.fm=function(a,b){this.K&Tt&&!(b&Tt)&&(this.H=Ut);this.K=b};
function St(a){var b=!1,c=a.ga,d=a.N&Rt?1:0,e=a.N&Vt,f=a.ba|(a.Z&Wt)<<8,g=a.ea,h=a.I||256;a.La=-1;a.B=null;a.H=Xt;a.Y=rt|Lt;var k=a.A[d];k?(k.Ad=f,k.Sa=e,k.kb=g,k.tb=h*k.lb,c=c>=Yt?c:c&Zt,k.Ra=null,k.Oa=0,k.errorCode=0,a.La=d,a.B=k):c=-1;switch(c&Zt){case $t:b=!0;break;case au:a.Y=Jt;a.ue(k,function(b){0<=b&&a.V?(Kt(a),a.Y=rt|Lt|Mt):(a.Y=Nt,a.H=Ot)},!1);break;case bu:a.Y=Mt;break;case cu:b=!0;break;case du:b=!0;break;case Yt:a.H=Ut;b=!0;break;case eu:k.gb=e+1,k.Za=h,b=!0}b&&Kt(a)}
function Kt(a){!a.V||a.K&fu||zf(a.V,14,120)}
function Ht(a){a.D=0;var b=gu(a),c=gu(a),d=c&32,e=d>>5,f=c&31,g=gu(a),h=gu(a),k=g<<2&768|h,m=g&63,q=gu(a),y=gu(a),w=a.A[e];w&&(w.Ad=k,w.Sa=f,w.kb=m,w.tb=q*w.lb);switch(b){case hu:iu(a,w?w.errorCode:ju);ku(a,c);ku(a,g);ku(a,h);ku(a,lu|d);b=-1;break;case Ft:for(c=0;0<=(b=gu(a));)w&&c<w.be.length&&(w.be[c++]=b);w&&wt(a,w);b=lu;w||a.M!=e||(a.M=-1,b=mu);iu(a,b|d);b=-1;break;case nu:case ou:iu(a,lu|d),b=-1}if(0<=b)switch(void 0===w?b=-1:(w.errorCode=tt,w.Rj=0),b){case pu:iu(a,lu|d);break;case qu:w.Fe=y;
@ -650,8 +650,8 @@ l.ue=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;
function Qt(a,b){if(a.errorCode)return-1;do{if(a.Ra&&a.sa.write(a.Ra,a.Oa++,b))break;a.sa&&a.sa.seek(a.Ad,a.Sa,a.kb+a.vf,!0,function(b){a.Ra=b});if(!a.Ra){a.errorCode=yu;b=-1;break}a.Oa=0;zu(a)}while(1);return b}function zu(a){a.kb++;var b=1-a.vf;a.kb>=a.Za+b&&(a.kb=b,a.Sa++,a.Sa>=a.gb&&(a.Sa=0,a.Ad++))}l.Hl=function(){var a=this.U.K&255;!(this.U.F>>8)&&128<a&&(this.M=a-128);return!0};l.Il=function(){var a;(a=this.U.F>>8||!this.V)||(a=!(this.V.Zb[0].Tc&64));return a?!0:!1};
var ut="Hard Drive",xt=["XTC","ATC","COMPAQ"],vt=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7],16:[612,4],17:[977,5],18:[977,7],19:[1024,7],20:[733,5],21:[733,7],22:[733,5],23:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[1023,8],5:[940,6],6:[697,5],7:[462,8],8:[925,5],9:[900,15],10:[980,5],11:[925,7],12:[925,9],13:[612,8],14:[980,4],16:[612,4],17:[980,5],18:[966,
6],19:[1023,8],20:[733,5],21:[733,7],22:[524,4,40],23:[924,8],24:[966,14],25:[966,16],26:[1023,14],27:[832,6,33],28:[1222,15,34],29:[1240,7,34],30:[615,4,25],31:[615,8,25],32:[905,9,25],33:[832,8,33],34:[966,7,34],35:[966,8,34],36:[966,9,34],37:[966,5,34],38:[612,16,63],39:[1023,11,33],40:[1023,15,34],41:[1630,15,52],42:[1023,16,63],43:[805,4,26],44:[805,2,26],45:[748,8,33],46:[748,6,33],47:[966,5,25]}],nt=496,Ut=1,Xt=0,Ot=16,Wt=3,Vt=15,Rt=16,Nt=1,Mt=8,Lt=16,rt=64,Jt=128,$t=16,au=32,bu=48,cu=64,du=
112,Yt=144,eu=145,Zt=240,fu=2,Tt=4,lu=0,mu=2,pu=0,qu=1,hu=3,ru=5,su=8,uu=10,Ft=12,wu=15,nu=224,ou=228,tt=0,ju=4,yu=20,st=0,Gt=1,zt=2,Dt=4,Et=8,yt=32,kt={800:Z.prototype.El,801:Z.prototype.Fl,802:Z.prototype.Dl},jt={496:Z.prototype.dk,497:Z.prototype.Lk,498:Z.prototype.Nk,499:Z.prototype.Ok,500:Z.prototype.Jk,501:Z.prototype.Ik,502:Z.prototype.Kk,503:Z.prototype.Pk},mt={800:Z.prototype.Rm,801:Z.prototype.Um,802:Z.prototype.Tm,803:Z.prototype.Sm,807:Z.prototype.lh,811:Z.prototype.lh,815:Z.prototype.lh},
lt={496:Z.prototype.bm,497:Z.prototype.gm,498:Z.prototype.em,499:Z.prototype.fm,500:Z.prototype.am,501:Z.prototype.$l,502:Z.prototype.cm,503:Z.prototype.Zl,1014:Z.prototype.dm};Ea(function(){for(var a=Wa(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new Z(d);Va(d,c)}});
112,Yt=144,eu=145,Zt=240,fu=2,Tt=4,lu=0,mu=2,pu=0,qu=1,hu=3,ru=5,su=8,uu=10,Ft=12,wu=15,nu=224,ou=228,tt=0,ju=4,yu=20,st=0,Gt=1,zt=2,Dt=4,Et=8,yt=32,kt={800:Z.prototype.El,801:Z.prototype.Fl,802:Z.prototype.Dl},jt={496:Z.prototype.dk,497:Z.prototype.Lk,498:Z.prototype.Nk,499:Z.prototype.Ok,500:Z.prototype.Jk,501:Z.prototype.Ik,502:Z.prototype.Kk,503:Z.prototype.Pk},mt={800:Z.prototype.Tm,801:Z.prototype.Wm,802:Z.prototype.Vm,803:Z.prototype.Um,807:Z.prototype.lh,811:Z.prototype.lh,815:Z.prototype.lh},
lt={496:Z.prototype.dm,497:Z.prototype.im,498:Z.prototype.gm,499:Z.prototype.hm,500:Z.prototype.cm,501:Z.prototype.bm,502:Z.prototype.em,503:Z.prototype.am,1014:Z.prototype.fm};Ea(function(){for(var a=Wa(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=Ta(c),d=new Z(d);Va(d,c)}});
function Au(a,b,c){t.call(this,"Computer",a);this.ca.Pb=!1;Bu(this,b);this.M=Ec(this,"autoPower",a);this.C=0;this.Z=a.busWidth||a.buswidth;this.A=Cu;this.K=null;this.H=this.X=!1;this.ba=Ec(this,"url")||"";this.ga=(Math.random()+.1).toString(36).substr(2,12);this.B=Du(this);if(this.U=Sa("CPU",this.id)){this.Ea=Sa("Debugger",this.id);this.G=[];for(b=null;b=nb(this,"Video",b);)this.G.push(b);this.ma=new Eb({id:this.Vd+".bus",busWidth:this.Z},this.U,this.Ea);var d,e=Qa(this.id);if((this.D=Sa("Panel",
this.id))&&this.D.Cf)for(b=0;b<e.length;b++)d=e[b],d.Aa=this.D.Aa,d.lc=this.D.lc,d.Cf=this.D.Cf;this.lc("PCx86 v1.34.0\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.hc&&d.hc(this,this.ma,this.U,this.Ea);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.J=d:this.A=parseInt(d,10));var f;if(a=Ec(this,"state")||(f=!0,a.state))b=this.V=a,f||(this.H=!0,this.A=Cu),this.A&&(this.L=new Ie(this,"1.34.0"),
this.L.load()?b=null:delete this.L);!b&&this.A&&(b=Eu(this))&&(this.H=!0);if(b){var g=this;ta(b,null,!0,function(a,b,c){c?(g.J=null,g.H=!1,g.Aa("Unable to load machine state from server (error "+c+(b?": "+ma(b):"")+")")):(g.K=b,g.X=!0);eb(g)})}else eb(this);this.ia.power||(this.M=!0);!c&&this.M&&Fu(this,this.$e)}else r("Unable to find CPU component")}ba(Au,t);

View file

@ -12,7 +12,7 @@
<xsl:variable name="MACHINETYPE">pc</xsl:variable>
<xsl:variable name="CSSCLASS">pcjs</xsl:variable>
<xsl:variable name="APPCLASS">pdp11</xsl:variable>
<xsl:variable name="APPCLASS">pdp10</xsl:variable>
<xsl:variable name="APPNAME">PDPjs</xsl:variable>
<xsl:variable name="APPVERSION">1.34.0</xsl:variable>
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>

View file

@ -0,0 +1,204 @@
(function(){/*
http://pcjs.org/modules/shared/lib/diskapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/messages.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/device.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/rom.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/ram.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/computer.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/int36.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/defines.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/panel.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/bus.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/memory.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/cpu.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/cpustate.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/serial.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/debugger.js (C) Jeff Parsons 2012-2017
*/
var l,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;function ea(){ea=function(){};ba.Symbol||(ba.Symbol=fa)}var ga=0;function fa(a){return"jscomp_symbol_"+(a||"")+ga++}
function ha(){ea();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return oa(this)}});ha=function(){}}function oa(a){var b=0;return pa(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function pa(a){ha();a={next:a};a[ba.Symbol.iterator]=function(){return this};return a}
function q(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}function qa(a,b){if(b){var c=ba;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}
qa("Math.trunc",function(a){return a?a:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||!a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}});qa("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}});
var ra=Math.pow(2,36),sa=-Math.pow(2,35),t={Yb:0,nb:1,$b:2,ac:3,bc:4,cc:5,dc:6,ec:7,Ya:8,fc:9,ob:10,gc:11,hc:12,pb:13,ic:14,jc:15,kc:16,lc:17,mc:18,nc:19,oc:20,pc:21,qc:22,rc:23,sc:24,tc:25,uc: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,Xa:65,Xb:66,Zb:67,vc:68,E:69,wc:70,xc:71,yc:72,zc:73,Ac:74,Bc:75,Cc:76,Dc:77,Ec:78,Fc:79,Gc:80,Q:81,
Hc:82,Ic:83,Jc:84,Kc:85,Lc:86,Mc:87,Nc:88,Oc:89,sb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,Qc:98,Rc:99,d:100,e:101,Sc:102,Tc:103,Uc:104,Vc:105,Wc:106,k:107,Xc:108,Yc:109,n:110,Zc:111,p:112,q:113,r:114,$c:115,t:116,bd:117,cd:118,dd:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,qb:127};
function u(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.$a=b.comment;this.rb=b;this.exports={};this.F=this.bindings={};a=this.id.indexOf(".");0>a?this.Ja=this.id:(this.Ka=this.id.substr(0,a),this.Ja=this.id.substr(a+1));this.i={ready:!1,Ea:!1,Ua:!1,S:!1,error:!1};this.Na=null;this.i.error=!1;this.V=c||0;this.A=this.b=this.B=this.C=this.ja=null;v.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)}function va(){return Date.now()||+new Date}
function x(a){window&&window.alert(a)}function xa(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Ca(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}
function z(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){x(c.message+" ("+a+")")}return b}
function B(a,b){var c=C;b=D(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var h=g.getAttribute("class");if(h)for(var k=h.split(" "),m=0;m<k.length;m++)switch(h=k[m],h){case c+"-binding":(h=A(g))&&h.binding&&a.da(h.type,h.binding,g,h.value),m=k.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
function Da(a){for(var b=!0,c=Ea[a];c&&c.length;){var d=c.splice(0,1)[0],e=d[0],f=null;0<=Fa.indexOf(e)&&(f=function(){return function(){Da(a)}}());var g=Ga[e];if(g)if(!f)b=g(d[1],d[2],d[3]);else{if(!g(f,d[1],d[2],d[3]))break}else{var b=!1,h=z(d[1],a);if(h)if(g=Ha[e])b=g(h,d[2],d[3]);else{var k=h.exports;if(k&&(g=k[e]))if(b=!0,!f)b=g.call(h,d[2],d[3]);else if(!g.call(h,f,d[2],d[3]))break}}if(!b){x("Script error: "+e+(g?" failed":" unrecognized"));break}}c&&!c.length&&delete Ea[a];return b}l=u.prototype;
l.toString=function(){return this.name?this.name:this.id||this.type};
l.da=function(a,b,c){switch(b){case "clear":return this.F[b]||(this.F[b]=c,c.onclick=function(a){return function(){a.F.print&&(a.F.print.value="")}}(this)),!0;case "print":return this.F[b]||(this.ja=this.F[b]=c,c.value="",this.f=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.Y=function(a){this.f(a,this.Ja)}),!0;default:return!1}};l.log=function(){};l.f=function(){};
l.status=function(a){this.f(this.Ja+": "+a)};l.Y=function(a,b,c){c=c||this.type;b||x((c?c+": ":"")+a)};function Ia(a,b){a.i.error=!0;a.Y(b)}function Ja(a){return a.i.error?(a.f(a.toString()+" error"),!0):!1}function Ka(a,b){b&&(a.i.ready?b():a.Na=b);return a.i.ready}function F(a){if(!a.i.error&&(a.i.ready=!0,a.i.ready)){var b=a.Na;a.Na=null;b&&b()}}function La(a,b){a.i.Ea&&(b?a.i.Ua=!0:void 0===b&&a.f(a.toString()+" busy"));return a.i.Ea}
function Ma(a,b){if(a.i.Ua)return a.i.Ea=!1,a.i.Ua=!1;if(a.i.error)return a.f(a.toString()+" error"),!1;a.i.Ea=b;return a.i.Ea}l.la=function(){return this.i.S=!0};l.ca=function(a,b){b&&(this.i.S=!1);return!0};function Na(a,b){if(a.A){a===a.A?b|=0:b=b||a.V;var c=a.A.V&b;return!!b&&c===b||!!(c&a.A.fb)}return!1}function G(a,b,c){a.A&&(!0===c||Na(a,c|0))&&a.A.message(b,void 0)}
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]),window.PCjs.Commands||(window.PCjs.Commands={}));
var ua=window?window.PCjs.Machines:{},v=window?window.PCjs.Components:[],Ea=window?window.PCjs.Commands:{},Fa=["hold","sleep","wait"],Ga={alert:function(a){x(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},Ha={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
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});
function Oa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Pa(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function H(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
function I(a){return H(a,4,!0)}function Qa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function Ra(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function Sa(){var a=Ta();return-1!==a.indexOf("pcjs.org",a.length-8)}function Va(a){return a.replace(/[&<>"']/g,function(a){return gb[a]})}function hb(a,b){return(a+" ").slice(0,b)}
function ib(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var gb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function jb(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}function kb(){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 J(a,b,c,d){c=void 0===c?!1:c;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 k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}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 lb(a,b){var c,d={W:null,R:null,ia:null,ha:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ia=g.load;d.ha=g.exec;if(e=g.bytes)d.W=e;else if(e=g.words)for(d.W=Array(2*e.length),f=c=0;c<e.length;c++)d.W[f++]=e[c]&255,d.W[f++]=e[c]>>8&255;else if(e=g.data)for(d.W=Array(4*e.length),f=c=0;c<e.length;c++)d.W[f++]=e[c]&255,
d.W[f++]=e[c]>>8&255,d.W[f++]=e[c]>>16&255,d.W[f++]=e[c]>>24&255;else d.W=g;d.R=g.symbols;d.W.length?1==d.W.length&&(x(d.W[0]),d=null):(x("Empty resource: "+a),d=null)}catch(h){x("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){x("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.W=e)}return d}
function Ta(){return"http://"+(window?window.location.host:"www.pcjs.org")}function mb(){if(null==nb){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}nb=a}return nb}function ob(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
function pb(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function qb(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)}return!1}
function rb(a){if(!sb){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}sb=c}return sb[a]}function tb(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function ub(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}function vb(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function L(a){wb.init.push(a)}
function xb(a){if(yb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){x(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function zb(a){!yb&&a?(yb=!0,Ab&&Bb("init"),Gb&&Bb("show")):yb=a}function Bb(a){wb[a]&&xb(wb[a])}var sb=null,wb={init:[],show:[],exit:[]},Ab=!1,Gb=!1,yb=!0,nb=null;vb("onload",function(){Ab=!0;xb(wb.init)});vb("onpageshow",function(){Gb=!0;xb(wb.show)});vb(qb("Opera")||qb("iOS")?"onunload":"onbeforeunload",function(){xb(wb.exit)});
var C="pdp10",Hb="PDPjs",Ib=Math.pow(2,18),Jb=Math.pow(2,36),C="pdp10",Hb="PDPjs",M={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,paper:4096,read:16384,write:32768,serial:1048576,timer:2097152,speaker:16777216,computer:33554432,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
function Kb(a,b){u.call(this,"Panel",a,512);this.I=this.K=0;this.U=b;this.j=this.H=this.v=this.w=0;this.L=this.M=-1;this.N=this.O=this.G=!1;this.P=Lb;this.D={};this.g={START:[1,1,!0,!1,this.Eb],STEP:[1,1,!1,!1,this.Fb],ENABLE:[1,1,!1,!1,this.zb],CONT:[1,1,!0,!1,this.xb],DEP:[0,0,!0,!1,this.yb],EXAM:[1,1,!0,!1,this.Ab],LOAD:[1,1,!0,!1,this.Cb],TEST:[0,0,!0,!1,this.Bb]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.Db,a];this.A=this.b=this.B=this.C=null;this.exports={hold:this.vb,toggle:this.Qb,reset:this.Mb,
set:this.Pb};F(this)}q(Kb,u);l=Kb.prototype;l.reset=function(a){this.stop();a&&Mb(this,this.w=0)};
l.da=function(a,b,c,d){if(this.C&&this.C.da(a,b,c,d)||this.b&&this.b.da(a,b,c,d)||this.A&&this.A.da(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.F[b]=c,this.K++,!0;default:return"led"==a||"rled"==a?(this.F[b]=c,this.D[b]=d?1:0,this.K++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.F[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
b){return function(){Nb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ob(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Nb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ob(a,b)}}(this,b),!0):u.prototype.da.call(this,a,b,c,d)}};l.ta=function(a,b,c,d){this.C=a;this.B=b;this.b=c;this.A=d;Pb(this);Qb(this)};l.la=function(a,b){if(!b)if(this.U&&Rb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};
l.ca=function(a){return a?this.save():!0};l.save=function(){var a=new N(this);a.set(0,[this.j,this.w,this.v]);return a.data()};l.restore=function(a){if(a=a[0])Sb(this,this.j=a[0]),Mb(this,this.w=a[1]),Tb(this,a[2]);return!0};l.Mb=function(){for(var a in this.g){var b=this.g[a];b[1]=b[0]}Qb(this);return!0};function Ub(a,b,c){if(a=a.F[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Pb(a,b){for(var c in a.D)Ub(a,c,null!=b?b:a.D[c])}
function Vb(a,b,c){if(a=a.F[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Qb(a){for(var b in a.g)Vb(a,b,a.g[b][1])}l.vb=function(a,b,c){if(Nb(this,b)){if(c){var d=this;setTimeout(function(){Ob(d,b);a&&a()},+c);return!1}Ob(this,b)}return!0};l.Pb=function(a,b){if("SR"==a)return Tb(this,Oa(b,8));var c=this.g[a];return c?(c[1]=+b?1:0,Vb(this,a,c[1]),!0):!1};l.Qb=function(a){return Nb(this,a)?(Ob(this,a),!0):!1};
function Nb(a,b){var c=a.g[b];return c?(Vb(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=Wb&&(a.N=b==Xb,a.O=b==Yb),!0):!1}function Ob(a,b){var c=a.g[b];c&&(c[2]&&c[3]&&(Vb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}l.Eb=function(a){a||this.b.i.J||(this.b.g=this.j%Ib,this.g[Zb]&&this.g[Zb][1]&&$b(this.b))};l.Fb=function(){};l.zb=function(a){a||this.b.T()};
l.xb=function(a){if(!a&&!this.b.i.J)if(this.g[Zb]&&this.g[Zb][1])$b(this.b);else{if((a=this.A)&&!La(a,!0))Ma(a,!0),ac(a,0,null),Ma(a,!1);else try{var b=this.b.Ia(1);0<b&&(bc(this.b,b),cc(this.b,b,!0),dc(this.b,b))}catch(c){"number"!=typeof c&&Ia(this.b,c.stack||c.message)}this.stop();this.C&&P(this.C)}};l.yb=function(a){a&&!this.b.i.J&&(this.N&&ec(this),a=Mb(this,this.w=this.v),this.P==Lb?fc(this.B,this.j,a):this.b.Ca(this.j,a))};
l.Ab=function(a){if(!a&&!this.b.i.J){var b;this.O&&ec(this);this.P==Lb?b=gc(this.B,this.j):b=this.b.pa(this.j);Mb(this,this.w=b)}};l.Cb=function(a){a||this.b.i.J||Sb(this,this.v)};l.Bb=function(a){a?(this.G=!0,Pb(this,!0)):(this.G=!1,Pb(this),Tb(this,0))};l.Db=function(a,b){this.v=a?this.v|1<<b:this.v&~(1<<b)};function ec(a){var b=1,c=a.B.v;a.g[Wb]&&a.g[Wb][1]||(b=-b);Sb(a,a.j&~c|a.j+b&c)}
function Sb(a,b){a.j=b&a.B.v;if(a.L!==a.j){a.L=a.j;b=a.L;for(var c=0;22>c;c++){var d=a,e="A"+c,f=b&1<<c;d.D[e]=f;d.G||Ub(d,e,f)}}}function Mb(a,b){a.H=b%Jb;if(a.M!==a.H){a.M=a.H;b=a.M;for(var c=0;16>c;c++){var d=a,e="D"+c,f=b&1<<c;d.D[e]=f;d.G||Ub(d,e,f)}}return a.H}function Tb(a,b){a.v=b|0;for(b=0;22>b;b++)a.g["S"+b][1]=a.v&1<<b?1:0;Qb(a);return!0}l.stop=function(){Sb(this,this.b.g)};
function Rb(){for(var a=D(document,C,"panel"),b=0;b<a.length;b++){var c=a[b],d=A(c),e=Ca(d.id);e||(e=new Kb(d,!0));B(e,c)}}var Lb=7,Xb="DEP",Zb="ENABLE",Yb="EXAM",Wb="STEP";L(Rb);function hc(a,b,c){u.call(this,"Bus",a,16);this.b=b;this.A=c;this.G=+a.busWidth||18;this.D=1<<this.G;this.v=this.D-1;this.j=Math.log2(16384);this.w=this.D/16384|0;this.g=[];a=new V;ic(a,this.A);this.g=Array(this.w);for(b=0;b<this.w;b++)this.g[b]=a;F(this)}q(hc,u);l=hc.prototype;l.reset=function(){};
l.la=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.ca=function(a){return a?this.save():!0};l.save=function(){var a=new N(this);a.set(0,jc(this));return a.data()};l.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&4096>d.length){for(var e=0,f=Array(4096),g=0;g<d.length-1;)for(var h=d[g++],k=d[g++];h--;)f[e++]=k;d=f}e=this.g[c];if(!e||!e.restore(d)){x("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
function kc(a,b,c,d){for(var e=b,f=c,g=e>>>a.j;0<f&&g<a.g.length;){var h=a.g[g],k=16384*g,m=16384-(e-k);m>f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.u)return h.Ga+=h.u-e,h.u=e,!0;if(e>=h.u+h.Ga){m=h.size-(e-k);m>f&&(m=f);h.Ga=e-h.u+m;e=k+16384;f-=m;g++;continue}}return lc(mc,e,f)}e=new V(0,e,m,16384,d);ic(e,a.A,h);a.g[g++]=e;e=k+16384;f-=m}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+nc[d]+" at "+Pa(b)),!0):lc(oc,b,c)}function gc(a,b){return a.g[(b&a.v)>>>a.j].Oa(b&16383,b)}
function fc(a,b,c){a.g[(b&a.v)>>>a.j].Ha(b&16383,c&65535,b)}function jc(a){for(var b=0,c=[],d=0;d<a.w;d++){var e=a.g[d];if(e.Ma||e.tb){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,k=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;k[h++]=p-g;k[h++]=m;g=p}k.length<e.length&&(e=k)}c[f]=e}}return c}function lc(a,b,c){x("Memory block error ("+a+": "+H(b)+","+H(c)+")");return!1}var mc=1,oc=2;function Fc(a){u.call(this,"Device",a,256)}q(Fc,u);l=Fc.prototype;
l.ta=function(a,b,c,d){this.B=b;this.C=a;this.b=c;this.A=d;F(this)};l.la=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.ca=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){return(new N(this)).data()};l.restore=function(){return!0};L(function(){for(var a=D(document,C,"device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new Fc(c),B(c,d)}}});
function V(a,b,c,d,e){this.id=Gc+=2;this.u=b;this.Ga=c;this.size=d||0;this.type=e||Hc;this.F=e==Ic;this.b=null;this.g=this.mb;this.pa=this.Oa=this.Wa;this.j=this.Sa;this.Ca=this.Ha=this.Ta;this.B=this.C=0;ic(this);this.Ma=this.tb=!1;if(this.size){a=this.A=Array(this.size);for(b=0;b<a.length;b++)a[b]=0;Jc(this,Kc)}else Jc(this)}l=V.prototype;l.save=function(){return this.A};l.restore=function(a){return a&&this.size==a.length?(this.A=a,this.Ma=!0):!1};
function Jc(a,b){b||(b=Lc);Mc(a,b,void 0);Nc(a,b,void 0)}function Mc(a,b,c){c&&a.B||(a.pa=b[2]||a.Wa);if(c||void 0===c)a.g=b[0]||a.mb,a.Oa=b[2]||a.Wa}function Nc(a,b,c){c&&a.C||(a.Ca=!a.F&&b[3]||a.Ta);if(c||void 0===c)a.j=b[1]||a.Sa,a.Ha=b[3]||a.Ta}l.ua=function(a,b){b?this.C++||Nc(this,Oc,!1):this.B++||Mc(this,Oc,!1)};function Pc(a,b){b?--a.C||(a.Ca=a.F?a.Ta:a.Ha):--a.B||(a.pa=a.Oa)}function ic(a,b,c){a.b=b;a.B=a.C=0;c&&((a.B=c.B)&&Mc(a,Oc,!1),(a.C=c.C)&&Nc(a,Oc,!1))}
l.mb=function(a,b){this.b&&Na(this.b,32)&&G(this.b,"attempt to read invalid address "+W(this.b,b),!0);return 0};l.Sa=function(a,b,c){this.b&&Na(this.b,32)&&G(this.b,"attempt to write "+W(this.b,a)+" to invalid addresses "+W(this.b,c),!0)};l.Wa=function(a,b){return this.pa(a,b)};l.Ta=function(a,b,c){this.Ca(a,b,c)};l.Hb=function(a,b,c){c=this.A[c];return c=32>=a+b?c>>a&(1<<b)-1:Math.trunc(c/Math.pow(2,a))%Math.pow(2,b)};l.Kb=function(a){return this.A[a]};
l.Tb=function(a,b,c,d){var e=this.A[d],f=Math.pow(2,a);c%=Math.pow(2,b);a=e%Math.pow(2,a+b);e=e-a+c*f+a%f;this.A[d]!=e&&(this.A[d]=e,this.Ma=!0)};l.Vb=function(a,b){this.A[b]=a;this.Ma=!0};l.Gb=function(a,b,c,d){if(this.b&&null!=this.u){var e=this.b;Qc(e,this.u+c,1,e.K)&&e.T(!1)}return this.g(a,b,c,d)};l.Ib=function(a,b){if(this.b&&null!=this.u){var c=this.b;Qc(c,this.u+a,2,c.K)&&c.T(!1)}return this.Oa(a,b)};
l.Sb=function(a,b,c,d,e){if(this.b&&null!=this.u){var f=this.b;Qc(f,this.u+d,1,f.G)&&f.T(!1)}this.F?this.Sa(c,0,e):this.j(a,b,c,d,e)};l.Ub=function(a,b,c){if(this.b&&null!=this.u){var d=this.b;Qc(d,this.u+b,2,d.G)&&d.T(!1)}this.F?this.Sa(a,0,c):this.Ha(a,b,c)};var Hc=0,Ic=2,nc=["NONE","RAM","ROM"],Gc=0,Lc=[],Kc=[V.prototype.Hb,V.prototype.Tb,V.prototype.Kb,V.prototype.Vb],Oc=[V.prototype.Gb,V.prototype.Sb,V.prototype.Ib,V.prototype.Ub];
function Rc(a,b){u.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.wa=0;this.za=b;this.N=c;this.xa=Math.round(this.za/1E4)/100;this.M=this.xa*this.N;this.ya=this.oa=this.O=this.ra=0;this.i.J=this.i.Ra=!1;this.i.X=a.autoStart;"string"==typeof this.i.X&&(this.i.X="true"==this.i.X);this.i.Ba=!1;this.ma=this.U=0;this.na=+a.csStart;this.P=+a.csInterval;this.Z=+a.csStop;this.D=[];this.bb=this.Nb.bind(this);this.K=this.w=this.H=this.I=this.v=this.ga=this.G=this.aa=this.Aa=this.L=0;this.qa=
null;F(this)}q(Rc,u);l=Rc.prototype;l.ta=function(a,b,c,d){this.C=a;this.B=b;this.A=d;this.qa=a.v;for(a=0;a<Sc.length;a++)(b=this.F[Sc[a]])&&this.C.da(null,Sc[a],b);F(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.la=function(a,b){var c=Tc(this.C,"autoStart");null!=c?this.i.X="true"==c?!0:"false"==c?!1:!!c:null==this.i.X&&(this.i.X=!this.A&&void 0===this.F.run);if(!b){if(a){Uc(this);if(!this.restore(a))return!1;Vc(this)}else this.reset();this.A?(a=this.A,b=this.i.X,a.xa=!0,a.f("Type ? for help with PDPjs Debugger commands"),Wc(a),b||Xc(a),a.sa&&(b=a.sa,a.sa=null,Yc(a,b))):this.status("No debugger detected");this.i.X||this.f("CPU will not be auto-started "+(this.qa?"(click Run to start)":"(type 'go' to start)"))}return!0};
l.ca=function(a){return a?this.save():!0};l.X=function(){return this.i.J?!0:this.i.X?($b(this),!0):!1};l.ib=function(){return 0};function Vc(a){void 0===a.na&&(a.na=0);void 0===a.P&&(a.P=-1);void 0===a.Z&&(a.Z=-1);a.i.Ba=0<=a.na&&0<a.P;a.i.Ba&&(a.ma=0,a.U=a.na-a.K)}function dc(a,b){if(a.i.Ba){var c=!1;a.ma=a.ma+a.ib()|0;a.U-=b;0>=a.U&&(a.U+=a.P,c=!0);0<=a.Z&&a.Z<=Zc(a)&&(a.P=a.Z=-1,Vc(a),a.T(),c=!0);c&&a.f(Zc(a)+" cycles: checksum="+H(a.ma))}}
l.da=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.F[b]=c,!0;case "run":return this.F[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.i.S)a=!0;else{var b=null,c,h=y(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.i.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.i.S);c++);c==h.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.i.ready?"powered yet":"ready yet"+(b.Na?" (waiting for notification)":""))+".");a=!1}a&&(d.i.J?d.T():$b(d))},!0;case "speed":return this.F[b]=
c,!0;case "setSpeed":return this.F[b]=c,c.onclick=function(){$c(d,d.N<<1,!0)},c.textContent=this.M.toFixed(2)+"Mhz",!0}return!1};function cc(a,b,c){a.K+=b;c&&(a.H=a.I=0)}function ad(a,b){var c=1;b&&1<a.N&&a.L&&(c=a.L/a.xa);a.ya=Math.round(1E3/bd);a.oa=Math.floor(a.za/bd*c);b||(a.O=a.oa);a.ra=0}function Zc(a){return a.K+a.w+a.H-a.I}function Uc(a){a.L=0;a.Aa=0;a.K=a.w=a.H=a.I=0;Vc(a);$c(a,1)}
function $c(a,b,c){var d=!1;if(void 0!==b){.8>a.L/a.M?b=1:d=!0;a.N=b;b=a.xa*a.N;if(a.M!=b){a.M=b;b=a.M.toFixed(2)+"Mhz";var e=a.F.setSpeed;e&&(e.textContent=b);a.f("target speed: "+b)}c&&a.C&&cd(a.C)}cc(a,a.w);a.w=0;a.v=va();a.G=0;ad(a);return d}function dd(a,b){for(var c=a.D.length-1;0<=c;c--){var d=a.D[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ed(a){for(var b=[],c=0;c<a.D.length;c++)b.push(a.D[c][0]);return b}
function bc(a,b){for(var c=a.D.length-1;0<=c;c--){var d=a.D[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function fd(a,b){var c=a.H-=a.I;a.I=0;b&&(a.H=0);return c}
l.Nb=function(){if(this.i.J){this.ra>=this.za&&ad(this,!0);this.aa=0;this.ga=va();if(this.G){var a=this.ga-this.G;a>this.ya&&(this.v+=a,this.v>this.ga&&(this.v=this.ga))}try{do{var b=dd(this,this.i.Ba?1:this.oa);try{this.Ia(b)}catch(e){if("number"!=typeof e)throw e;}b=fd(this,!0);this.aa+=b;this.w+=b;dc(this,b);bc(this,b);this.O-=b;if(0>=this.O){this.O+=this.oa;++this.Aa>=gd&&(this.C&&P(this.C,void 0),this.Aa=0);break}}while(this.i.J)}catch(e){this.T();this.C&&this.C.stop(va(),Zc(this));Ia(this,e.stack||
e.message);return}if(this.i.J){a=setTimeout;b=this.bb;this.G=va();var c=this.ya;this.aa&&(c=Math.round(c*this.aa/this.oa));var c=c-(this.G-this.ga),d=this.G-this.v;d&&(this.L=Math.round(this.w/(10*d))/100,864E5<=d&&(this.K=0,$c(this)));if(0>c||this.L<this.M)-1E3>c&&(this.v-=c),c=0;this.ra+=this.aa;this.G+=c;a(b,c)}}};
function $b(a,b){if(!Ja(a))if(a.i.J)a.f(a.toString()+" busy");else{$c(a);a.i.J=!0;a.i.Ra=!0;var c=a.F.run;c&&(c.textContent="Halt");a.C&&(b&&cd(a.C,!0),a.C.start(a.v,Zc(a)));a.A||a.status("Started");setTimeout(a.bb,0)}}l.Ia=function(){return 0};l.T=function(a){var b=!1;if(this.i.J){fd(this);cc(this,this.w);this.w=0;this.i.J=!1;if(b=this.F.run)b.textContent="Run";this.C&&this.C.stop(va(),Zc(this));b=!0;this.A||this.status("Stopped")}this.i.complete=a;return b};var bd=30,gd=15,Sc=["power","reset"];
function hd(a){var b=+a.model||1001;Rc.call(this,a,6666667);this.ab=b;this.La=+a.addrReset||0;this.fa=null;this.Da=[];this.i.complete=!1}q(hd,Rc);l=hd.prototype;l.reset=function(){this.status("Model "+this.ab);this.i.J&&this.T();this.ea=this.g=this.sa=this.La;this.j=0;this.pa=this.Jb;this.Ca=this.Wb;this.fa=null;Uc(this);this.i.error=!1;Rc.prototype.reset.call(this)};l.ib=function(){return 0};
l.save=function(){var a=new N(this);a.set(0,[this.g,this.sa,this.ea,this.j]);a.set(1,[]);a.set(2,[this.K,this.N,this.i.X]);a.set(3,id(this));a.set(4,ed(this));return a.data()};
l.restore=function(a){var b;b=a[0];ha();ea();ha();var c=b[Symbol.iterator];b=c?c.call(b):oa(b);this.g=b.next().value;this.sa=b.next().value;this.ea=b.next().value;this.j=b.next().value;b=a[2];this.K=b[0];$c(this,b[1]);this.i.X=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.Da.length;d++){var e=this.Da[d];if(e.Rb===b[c]){d=e;break a}}d=null}d&&(d.next=this.fa,this.fa=d)}a=a[4];for(b=0;b<this.D.length&&b<a.length;b++)this.D[b][0]=a[b];return!0};
function id(a){var b=[];for(a=a.fa;a;)b.push(a.Rb),a=a.next;return b}l.Jb=function(a){var b=this.B;a=this.ea=a;return b.g[(a&b.v)>>>b.j].pa(a&16383,a)};l.Wb=function(a,b){var c=this.B;a=this.ea=a;c.g[(a&c.v)>>>c.j].Ca(a&16383,b,a)};
l.Ia=function(a){this.i.complete=!0;var b=this.A?jd(this.A)?1:this.i.Ra?-1:0:0,c=a?this.i.Ra?0:1:-1;this.i.Ra=!1;this.H=this.I=a;this.j=this.j&-5|(b?4:0);do{if(this.j){if(this.j&4){if(kd(this.A,this.g,c)){this.T();break}++b||(this.j&=-5);c||c++}if(a=this.j&11)this.j&2?this.fa||(this.j&=-3):this.j&1&&this.j++,a=!1;if(a){if(this.j&4&&kd(this.A,this.g,c)){this.T();break}if(0>c)break}}this.j&=15;a=this.g;this.pa(a);this.g=(a+1)%Ib}while(0<this.I);return this.i.complete?this.H-this.I:!1===this.i.complete?
-1:0};L(function(){for(var a=D(document,C,"cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new hd(d);B(d,c)}});
function ld(a){u.call(this,"ROM",a,128);this.R=this.g=null;this.D=+a.addr;this.v=+a.size;this.j=a.alias;"string"==typeof this.j&&(this.j=eval(this.j));this.w=a.file;this.G=Qa(this.w);if(this.w){a=this.w;var b=Ra(this.G);"json"!=b&&"hex"!=b&&(a=Ta()+"/api/v1/dump?file="+this.w+"&format=bytes&decimal=true");var c=this;J(a,null,!0,function(a,b,f){f?(c.Y("Unable to load ROM resource (error "+f+": "+a+")"),c.w=null):(ta(c.Ka,a,b),(a=lb(a,b))?(c.g=a.W,c.R=a.R):c.w=null);md(c)})}}q(ld,u);
ld.prototype.ta=function(a,b,c,d){this.B=b;this.b=c;this.A=d;md(this)};ld.prototype.la=function(){this.R&&(this.A&&nd(this.A,this.id,this.D,this.v,this.R),delete this.R);return!0};ld.prototype.ca=function(){return!0};
function md(a){if(!Ka(a)){if(a.w){if(!a.g||!a.B)return;a.v||(a.v=a.g.length);if(a.g.length!=a.v)Ia(a,"ROM size ("+H(a.g.length,8,!0)+") does not match specified size ("+H(a.v,8,!0)+")");else{var b;b=a.D;if(kc(a.B,b,a.v,Ic)){var c;for(c=0;c<a.g.length;c++)fc(a.B,b+c,a.g[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.j?b.push(a.j):null!=a.j&&a.j.length&&(b=a.j);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.B,g=d.v,h=[],k=d.D>>>f.j;0<g&&k<f.g.length;)h.push(f.g[k++]),g-=16384;f=d.B;d=d.v;g=0;for(e>>>=
f.j;0<d&&e<f.g.length;){k=h[g++];if(!k)break;f.g[e++]=k;d-=16384}}delete a.g}}}F(a)}}L(function(){for(var a=D(document,C,"rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new ld(d);B(d,c)}});
function od(a){u.call(this,"RAM",a);this.R=this.j=null;this.v=+a.addr;this.w=+a.size;this.ia=a.load;this.ha=a.exec;null!=this.ia&&(this.ia=+this.ia);null!=this.ha&&(this.ha=+this.ha);this.D=!1;this.g=a.file;this.G=Qa(this.g);if(this.g){a=this.g;var b=Ra(this.G);"json"!=b&&"hex"!=b&&(a=Ta()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;J(a,null,!0,function(a,b,f){f?(c.Y("Unable to load RAM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Ka,a,b),(a=lb(a,b))?(c.j=a.W,c.R=a.R,null==
c.ia&&(c.ia=a.ia),null==c.ha&&(c.ha=a.ha)):c.g=null);pd(c)})}}q(od,u);od.prototype.ta=function(a,b,c,d){this.B=b;this.b=c;this.A=d;pd(this)};od.prototype.la=function(a,b){this.R&&(this.A&&nd(this.A,this.id,this.v,this.w,this.R),delete this.R);b||this.reset();return!0};od.prototype.ca=function(){return!0};
function pd(a){if(a.B&&(!a.D&&a.w&&(kc(a.B,a.v,a.w,1)?a.D=!0:a.w=0),!Ka(a))){if(!a.D)x("No RAM allocated");else if(a.g){if(!a.j||!a.B)return;qd(a,a.j,a.ia,a.ha,a.v)?a.status('Loaded image "'+a.G+'"'):a.Y('Error loading image "'+a.G+'"')}F(a)}}
od.prototype.reset=function(){if(this.D){for(var a=this.B,b=this.v,c=this.w,d=b&16383,b=b>>>a.j;0<c&&b<a.g.length;){var e=a.g[b],f=c,g=0,h,d=d||0,g=g||0;0>g&&g>=sa&&(g+=ra);g=Math.trunc(Math.abs(g))%ra;void 0===f&&(f=e.size);for(h=d;f--&&h<e.size;h++)e.Ha(d,g,e.u+d);c-=16384;b++;d=0}this.j&&qd(this,this.j,this.ia,this.ha,this.v,!this.A)}};
function qd(a,b,c,d,e,f){var g=!1,h=!1;if(null==c)for(var k=0;k<b.length-1;){var m=b[k]&255|(b[k+1]&255)<<8;if(m)if(m&255){var p=k;if(1!=m){G(a,"invalid signature ("+I(m)+") at offset "+I(p),4096);break}if(k+6>=b.length){G(a,"invalid block at offset "+I(p),4096);break}for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,r=b[k++]&255|(b[k++]&255)<<8,m=m+((n&255)+(n>>8)+(r&255)+(r>>8)),Q=k,wa=n-=6;0<n&&k<b.length;)m+=b[k++]&255,n--;if(n||k>=b.length){G(a,"insufficient data for block at offset "+I(p),4096);break}m+=
b[k++]&255;if(m&255){G(a,"invalid checksum ("+H(m,2,!0)+") for block at offset "+I(p),4096);break}if(wa)for(G(a,"loading "+I(wa)+" bytes at "+I(r)+"-"+I(r+wa),4096);wa--;)fc(a.B,r++,b[Q++]);else r&1?g=!0:null==d&&(d=r),null!=d&&G(a,"starting address: "+I(d),4096);h=!0}else k++;else k+=2}if(!h&&(null==c&&(c=e),null!=c)){for(h=0;h<b.length;h++)fc(a.B,c+h,b[h]);h=!0}if(h){if(null==d||g)a.b.T(),f=!1;null!=d&&(a=a.b,a.La=d,a.g=d%Ib,f?a.i.S?a.i.J||$b(a):a.i.X=!0:a.A&&a.i.S?a.T()||a.C.i.reset||(Wc(a.A),
P(a.C,-1)):!1===f&&a.T(),!a.i.J&&a.qa&&a.qa.stop())}return h}L(function(){for(var a=D(document,C,"ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new od(d);B(d,c)}});
function rd(a){u.call(this,"SerialPort",a,1048576);this.w=a.upperCase;"string"==typeof this.w&&(this.w="true"==this.w);this.v=!0;this.j=[];var b=a.binding;if("console"!=b){var c;a=sd;b&&(void 0===c&&(c="Panel"),(c=z(c,this.id))&&(b=c.F[b])&&this.da(null,a,b))}this.g=this.D=null;this.exports={connect:this.lb,receiveData:this.Pa,receiveStatus:this.Lb,setConnection:this.Ob}}q(rd,u);l=rd.prototype;
l.da=function(a,b,c){var d=this;switch(b){case sd:return this.F[b]=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?t.Ya:t.qb:46==c?b=t.Ya:a.ctrlKey&&c>=t.Xa&&c<=t.sb&&(b=c-(t.Xa-t.nb));b&&(a.preventDefault&&a.preventDefault(),d.Pa(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==t.pb&&(b=t.ob);d.Pa(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Pa(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};l.ta=function(a,b,c,d){this.C=a;this.B=b;this.b=c;this.A=d;F(this)};
l.lb=function(a){if(!this.g){var b=Tc(this.C,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ib(c[0]);if(d!=this.Ja)return;c=ib(c[1]);if(this.g=Ca(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.v);if(this.D=e.receiveData){this.v=a;this.status("Connected "+this.Ka+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.la=function(a,b){if(!b)if(this.lb(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0};
l.ca=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){var a=new N(this);a.set(0,[]);return a.data()};l.restore=function(){return!0};l.Pa=function(a){if("number"==typeof a)this.j.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.j.push(b)}else this.j=this.j.concat(a);return!0};l.Lb=function(){};l.Ob=function(a,b){return this.g?!1:(this.g=a,this.D=b,!0)};var sd="buffer";
L(function(){for(var a=D(document,C,"serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new rd(d);B(d,c)}});function td(a){u.call(this,"Debugger",a);this.ba=+a.base||16;this.ma=!1;this.D=0;this.O=!1;this.w=-1;this.v=[];this.Z={}}q(td,u);td.prototype.jb=function(){return-1};td.prototype.kb=function(){};
function ud(a,b,c,d){if(c)if(b){0>a.w&&a.v.length&&(a.w=0);if(0>a.w||b!=a.v[a.w])a.v.splice(0,0,b),a.w=0;a.w--}else a.O?b="end":b=a.v[a.w+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(ib(b.substring(c,f))),c=f+1}}return a}
function vd(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
function wd(a,b,c){var d;if(b){b=xd(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var p=m[e++],n=p.length,p=ib(p);if(!p){f=!0;break}p=yd(a,p,null,!1===c);if(void 0===p){f=!0;c=!1;break}h.push(p);if(e==m.length)break;var p=m[e++],r=p.length;k.length&&zd[p]<zd[k[k.length-1]]&&vd(h,k,1);k.push(p);b=b.substr(n+r)}vd(h,k)&&1==h.length||(f=!0);f?c&&a.f("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Ad(a,null,
d))}return d}function xd(a,b){for(var c,d=a.ma?"(":"{",e=a.ma?")":"}",f=new RegExp(a.ma?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=wd(a,c[1]);b=b.replace(d+c[1]+e,null!=g?W(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
function yd(a,b,c,d){var e;null!=b?(e=a.jb(b),0<=e?e=a.kb(e):(e=a.Z[b],null==e&&(e=Oa(b,a.ba))),null!=e||d||a.f("invalid "+(c?c:"value")+": "+b)):d||a.f("missing "+(c||"value"));return e}
function Ad(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var k=d&255,m=void 0,p=8,n="";p?32<p&&(p=32):p=32;for(var r=null==k||isNaN(k),Q=m=m||p;0<p--;)Q||(n=","+n,Q=m),n=(r?"?":k&1?"1":"0")+n,k>>=1,Q--;g=n+g;d>>=8}d=H(c,0,!0)+" "+c+". "+Pa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.f((null!=b?b+": ":"")+d);return e}
function Bd(a,b){if(b)return Ad(a,b,a.Z[b]);var c=0;for(b in a.Z)Ad(a,b,a.Z[b]),c++;return 0<c}function W(a,b,c){c=void 0===c?0:c;switch(a.ba){case 8:a=Pa(b,3*c);break;case 10:a=b.toString();break;default:a=H(b,2*c)}return a}var zd={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Cd(a){td.call(this,a);this.xa=!1;this.ma=!0;this.I=X();this.wa=X();this.N=X();this.H=[];this.g=this.K=this.G=[];Dd(this);this.P=this.ga=0;this.j=[];this.qa=void 0;Ed(this);this.A=this;this.na={};this.V=this.fb=0;this.U=null;this.M=[];Fd(this,a.messages);this.sa=a.commands;this.Aa=Gd;this.La=[];this.L=0;this.Da=this.ra=null;this.D=this.za=this.ya=this.fa=this.oa=0;this.ea=this.aa=null;var b=this;window?void 0===window[C]&&(window[C]=function(a){return Yc(b,a)}):void 0===global[C]&&(global[C]=
function(a){return Yc(b,a)})}q(Cd,td);function Y(a){a=a&&a.u;null==a&&(a=-1);return a}function X(a,b,c){return{u:void 0===a?null:a,ub:void 0===b?!1:b,ka:!1,ba:c}}function Hd(a){return[a.u,a.ub,a.ba,a.ka,a.Qa]}function Id(a,b){var c=X(b[0],b[1],b[2]);c.ka=b[3];b[4]&&(c.cb=ud(a,c.Qa=b[4]));return c}l=Cd.prototype;
l.ta=function(a,b,c,d){this.B=b;this.C=a;this.b=c;this.ea=a.v;(a=Tc(a,"messages"))&&Fd(this,a);Jd(this,function(a){a:{var b=d.B.g,c=a[0],e=a=0,k=b.length;if(c){a=Y(Z(d,c));if(-1===a){d.f("invalid address: "+c);break a}e=a>>>d.B.j;k=1}d.f("blockid physical blockaddr used size type");d.f("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;k--;){var p=b[e];p.type==c?m++||d.f("..."):(c=p.type,m=nc[c],p&&d.f(H(p.id,8)+" %"+H(e<<d.B.j,8)+" %"+H(p.u,8)+" "+I(p.Ga)+" "+
I(p.size)+" "+m),c!=Hc&&(c=-1),m=0);a+=16384;e++}}});F(this)};
l.da=function(a,b,c){var d=this;switch(b){case "debugInput":return this.aa=this.F[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Yc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.w<d.v.length-1&&(b=d.v[++d.w])):40==a.keyCode&&(0<d.w?b=d.v[--d.w]:(b="",d.w=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.F[b]=c,ub(c,function(){if(d.aa){var a=d.aa.value;
d.aa.value="";Yc(d,a,!0);return!0}return!1}),!0;case "step":return this.F[b]=c,ub(c,function(a){var b=!1;La(d,!0)||(Ma(d,!0),b=ac(d,a?1:0,null),Ma(d,!1));return b}),!0}return!1};function Xc(a){if(a.aa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.aa.focus();window&&window.scrollTo(b,c)}}l.va=function(a,b){var c=0,d=Y(a);-1!==d&&(c=gc(this.B,d),b&&null!=a.u&&(a.u+=b||1));return c};l.Za=function(a,b,c){var d=Y(a);-1!==d&&(fc(this.B,d,b),c&&null!=a.u&&(a.u+=c||1),P(this.C,-1))};
function Z(a,b,c){var d;c=(c?a.I:a.wa).u;var e,f;if(void 0!==b){b=xd(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,h;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.H.length;c++){var k=a.H[c].R[d];if(null!=k){h=k.o;break}}null!=h&&(g=X(h));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=wd(a,b,void 0)}null!=c&&(d=X(c,e,f));return d}function Kd(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.cb=ud(a,b.Qa=c[2]))}
function Fd(a,b){a.A=a;a.V=a.fb=536870912;a.U=null;a.M=[];b=ud(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in M){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.V|=M[c],a.f(c+" messages enabled"))}}function Jd(a,b){for(var c in M)if(16==M[c]){a.na[c]=b;break}}l.jb=function(a){return Ld.indexOf(a.toUpperCase())};
l.kb=function(a){var b;switch(a){case Md:b=this.b.g}return b};l.message=function(a,b){b&&(a+=" @"+W(this,X(this.b.sa).u));if(!this.U||a!=this.U)if(this.U=a,this.V&1073741824)this.M.push(a);else{var c;if(this.V&-2147483648&&this.b&&(c=this.b.i.J)||La(this,!0))this.T(),c&&(a+=" (cpu halted)");this.f(a);this.b&&(a=this.b,fd(a),a.O=0,a.C&&P(a.C,void 0))}};
function Ed(a){var b;if(!jd(a))a.j&&a.j.length&&a.f("instruction history buffer freed"),a.P=0,a.j=[];else if(!a.j||!a.j.length){a.j=Array(Nd);for(b=0;b<a.j.length;b++)a.j[b]=X();a.P=0;a.f("instruction history buffer allocated")}}function Od(a,b,c){if(!Pd(a,c))return!1;$b(a.b,b);return!0}
function ac(a,b,c,d){if(!Pd(a))return!1;var e="";null===c&&(e=(c=!a.ra||"tr"==a.ra)?"tr":"t");a.D=0;b||jd(a)&&kd(a,a.b.g,0);try{b=dd(a.b,b);var f=a.b.Ia(b);0<f&&(bc(a.b,f),a.D+=f,cc(a.b,f,!0),dc(a.b,f),a.fa++)}catch(g){"number"!=typeof g&&(a.D=0,Ia(a.b,g.stack||g.message))}!1!==d&&(a.ea&&a.ea.stop(),P(a.C,-1));Wc(a,c||!1,e);return 0<a.D}l.T=function(a){this.b&&this.b.T(a)};function Wc(a,b,c){a.xa&&(void 0===b&&(b=!0),c&&a.f(Qd+c),a.I=X(a.b.g),b&&1!=a.L?Rd(a):qe(a))}
function Pd(a,b){var c;(c=!a.b||!Ka(a.b))||(c=a.b,c.i.S?c=!0:(c.f(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.i.J?(b||a.f("cpu busy or unavailable, command ignored"),!1):!Ja(a.b)}l.la=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0};l.ca=function(a,b){b&&this.f(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){Ed(this);this.fa=0;this.U=null;this.D=0;this.I=X(this.b.g);this.i.J=!1;se(this);a||Wc(this)};
l.save=function(){var a=new N(this);a.set(0,Hd(this.I));a.set(1,Hd(this.N));a.set(2,[this.v,this.O,this.V]);a.set(3,this.H);return a.data()};l.restore=function(a){var b=0;void 0!==a[2]&&(this.I=Id(this,a[b++]),this.N=Id(this,a[b++]),this.v=a[b][0],"string"==typeof this.v&&(this.v=[this.v]),this.O=a[b][1],this.V|=a[b][2]);a[3]&&(this.H=a[3]);return!0};l.start=function(a,b){this.L||this.f("running");this.i.J=!0;this.ya=a;this.za=b};
l.stop=function(a,b){if(this.i.J){this.i.J=!1;this.D=b-this.za;if(!this.L){b="stopped";if(this.D){a-=this.ya;var c=0<a?Math.round(1E3*this.D/a):0;b+=" (";jd(this)&&(b+=this.fa+" instructions, ",this.fa=0);b+=this.D+" cycles, "+a+" ms, "+c+" hz)"}else Na(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.f(b)}Wc(this,!0);Xc(this);se(this,this.b.g);this.U=null}};function jd(a){return 1<a.g.length||!!a.ga}
function kd(a,b,c){var d=-1;if(!c&&(d=a.b.pa(b),0==d&&a.b.sa==b)){b=a.b;var e=b.g;b.g=(e+1)%Ib;b=e}if(0<c&&(a.ga&&!--a.ga||Qc(a,b,1,a.g)))return!0;0<=c&&a.j.length&&(a.fa++,0>d&&(d=a.b.pa(b)),68719476735!=(d&65535)&&(c=a.j[a.P],c.u=b,c.ka=!1,c.ba=void 0,++a.P==a.j.length&&(a.P=0)));return!1}
function Dd(a){var b,c;a.g=["bp"];if(a.K)for(b=1;b<a.K.length;b++){c=a.K[b];c=Y(c);var d=a.B;Pc(d.g[c>>>d.j],!1)}a.K=["br"];if(a.G)for(b=1;b<a.G.length;b++)c=a.G[b],c=Y(c),d=a.B,Pc(d.g[c>>>d.j],!0);a.G=["bw"];a.oa=0;a.ga=0}l.ua=function(a,b,c){var d=!0;c||te(this,a,b,!1,!0);if(a!=this.g){var e=Y(b);if(-1===e)this.f("invalid address: "+W(this,b.u)),d=!1;else{var f=this.B;f.g[e>>>f.j].ua(e&16383,a==this.G)}}d&&(a.push(b),c?b.ka=!0:(ue(this,a,a.length-1,"set"),Ed(this)));return d};
function te(a,b,c,d,e){var f=!1;c=Y(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==Y(h)&&(!d||h.ka)){f=!0;h.ka||e||ue(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(d=a.B,Pc(d.g[c>>>d.j],b==a.G));h.ka||Ed(a);break}}return f}function ve(a,b){for(var c=1;c<b.length;c++)ue(a,b,c);return b.length-1}function ue(a,b,c,d){c=b[c];a.f(b[0]+" "+W(a,c.u)+(d?" "+d:c.Qa?' "'+c.Qa+'"':""))}
function se(a,b){if(void 0!==b)Qc(a,b,1,a.g,!0),a.L=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.ka){if(!te(a,a.g,c,!0))break;b=0}}}
function Qc(a,b,c,d,e){var f=!1;if(!a.oa++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.ka)for(var k=Y(h)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==k){var p,f=!0;h.ka&&(te(a,d,h,!0),e=!0);if(p=h.cb){for(var f=!1,n=0;n<p.length;n++)if(!we(a,p[n],!0)){if(p[n].indexOf("if")){f=!0;break}for(var r=n+1;r<p.length&&p[r].indexOf("else");r++)n++;if(r==p.length){f=!0;break}}a.b.i.J||(f=!0)}if(f){e||ue(a,d,g,"hit");break}}}a.oa--;return f}
function xe(a,b,c,d){var e=X(b.u),f=a.va(b,2),g,h;for(h in a.Aa)if(g=a.Aa[h][f&h])break;g||(g=ye);var k=g[0];0<=a.La.indexOf(k)&&(g=ye,k=g[0]);var m=h="",p=ze[k],n=g.length-1;k||n||(h=W(a,f));for(f=1;f<=n;f++)if(void 0!==g[f]){k="";if(!k||!k.length){h="INVALID";break}"string"!=typeof k&&(m=k[1],k=k[0]);0<h.length&&(h+=",");h+=k||"???"}g="";n=W(a,e.u)+":";if(-1!==e.u&&-1!==b.u){do if(g+=" "+W(a,a.va(e,2)),null==e.u)break;while(e.u!=b.u)}n+=hb(g,24);n+=hb(p,5);h&&(n+=" "+h);if(c||m)n=hb(n,60)+";"+(c||
""),n=a.b.i.Ba?n+("cycles="+Zc(a.b).toString()+" cs="+H(a.b.ma)):n+(null!=d?"="+d.toString():""),m&&(";"!=n.slice(-1)&&(n+=" "),n+=m);return n}l.gb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};function nd(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var p=f,k=[k>>>0,g],n=jb(p,k,a.gb);0>n&&p.splice(-(n+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({ad:b,u:c,wb:d,R:e,eb:f})}
function Ae(a,b,c){var d=[],e=Y(b)>>>0;for(b=0;b<a.H.length;b++){var f=a.H[b],g=f.u>>>0,h=f.wb;if(e>=g&&e<g+h){e=jb(f.eb,[e-g],a.gb);0<=e?Be(a,b,e,d):c&&(e=~e,Be(a,b,e-1,d),Be(a,b,e,d));break}}return d}function Be(a,b,c,d){var e={},f=a.H[b].eb,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.H[b].R[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
function Ce(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Bd(a)||a.f("no variables"),!0;if(!c[2])return Bd(a,c[1]);if(!c[3])return delete a.Z[c[1]],!0;b=wd(a,c[3]);return void 0!==b?(a.Z[c[1]]=b,!0):!1}a.f("invalid assignment:"+b);return!1}
function De(a,b,c){var d=null;if(b=Z(a,b,!0)){var e=Ae(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.u-e[1])&&(g=" + "+I(f)),f=e[0]+" ("+W(a,e[1])+")"+g,c&&a.f(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.u)&&(g=" - "+I(f)),f=e[4]+" ("+W(a,e[5])+")"+g,c&&a.f(f),d||(d=f))}else c&&a.f("no symbols")}return d}
function Rd(a,b){var c;if(b&&"?"==b[1])a.f("register commands:"),a.f("\tr\tdump registers"),a.f("\trm\tdump misc registers"),a.f("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.b;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.f("missing value for "+b[1]);return}g=wd(a,b);if(void 0===g)return;switch(f.toUpperCase()){case "PC":e.g=g%Ib;a.I=X(e.g);break;default:a.f("unknown register: "+
f);return}P(a.C);a.f("updated registers:")}}f=""+((Ld[Md]||"undefined")+" ");d&&(f+="\n");a.f(f);c&&(a.I=X(e.g),qe(a,W(a,a.I.u)))}}function Ee(a,b){b=ib(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.f(c[2]):Ad(a,null,c[2].charCodeAt(0)):wd(a,b,!0)}
function Fe(a,b,c){if("?"==c)a.f("trace commands:"),a.f("\tt [#]\ttrace # instructions"),a.f("\ttr [#]\ttrace # instructions with register updates"),a.f("\ttc [#]\ttrace # cycles"),a.f("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=yd(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.ra=b;tb(c,function(){return Ma(a,!0)&&ac(a,e,d,!1)},function(){a.ea&&a.ea.stop();P(a.C,-1);Ma(a,!1)})}}
function qe(a,b,c,d){if(b=Z(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=yd(a,c.substr(1)),null!=c&&(d=c);else{d=Z(a,c,!0);if(!d||d.u<b.u)return;e=d.u-b.u;if(256<e){a.f("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=La(a,!1)||a.L?a.D:null;var g=null!=f?"cycles":null,h=Ae(a,b),k=b.u;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.f(m)}h[3]&&(g=h[3],f=null);f=xe(a,b,g,f);a.f(f);a.I=b;e-=b.u-k;c++}}}
function we(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.f(Qd+b):(a.O&&(a.f("ended assemble at "+W(a,a.N.u)),a.I=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.U=null;if(Ka(a)&&0<b.length){a.O&&(b="a "+W(a,a.N.u)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],k=h.charAt(0),m=1;m<h.length;m++){var p=h.charAt(m);if("?"==k||"r"==k||"a">p||"z"<p){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var n=
Z(a,g[1],!0);if(n)if(a.N=n,void 0===g[2])a.f("begin assemble at "+W(a,n.u)),a.O=!0,P(a.C);else{var r;a.f("not supported yet");r=[];if(r.length){for(var Q=0;Q<r.length;Q++)a.Za(n,r[Q],1);a.f(xe(a,a.N))}}break;case "b":a:{var wa=g[0],ya=g[1],ef=b;if("?"==ya)a.f("breakpoint commands:"),a.f("\tbp #\tset exec breakpoint"),a.f("\tbr #\tset read breakpoint"),a.f("\tbw #\tset write breakpoint"),a.f("\tbc #\tclear breakpoint (* to clear all)"),a.f("\tbl\tlist all breakpoints"),a.f("\tbn [#]\tbreak after # instruction(s)");
else{var ia=wa.charAt(1);if("l"==ia){var pc;pc=0+ve(a,a.g);pc+=ve(a,a.K);(pc+=ve(a,a.G))||a.f("no breakpoints")}else if("n"==ia){var Sd=+ya||0;ya&&(a.ga=Sd);a.f("break after "+Sd+" instruction(s)")}else if(void 0===ya)a.f("missing breakpoint address");else{var E=X();if("*"!=ya&&(E=Z(a,ya,!0),!E))break a;"c"==ia?null==E.u?(Dd(a),a.f("all breakpoints cleared")):te(a,a.g,E)||te(a,a.K,E)||te(a,a.G,E)||a.f("breakpoint missing: "+W(a,E.u)):null!=E.u&&(Kd(a,E,ef),"p"==ia?a.ua(a.g,E):"r"==ia?a.ua(a.K,E):
"w"==ia?a.ua(a.G,E):a.f("unknown breakpoint command: "+ia))}}}break;case "c":a.ja&&(a.ja.value="");break;case "d":a:{var za,Ua=g[0],R=g[1],ca=g[2],ff=g[3];if("?"==R){var Aa="";for(za in M)a.na[za]&&(Aa&&(Aa+=","),Aa+=za);Aa+=",state,symbols";a.f("dump memory commands:");a.f("\tdw [a] [n] dump n words at address a");a.f("\tds [a] [n] dump n words at address a as JSON");a.f("\tdh [p] [n] dump n instructions from history position p");Aa.length&&a.f("dump extension commands:\n\t"+Aa)}else if("state"==
R){var qc=Ge(a.C,!0);"console"==ca?console.log(qc):(a.ja&&(a.ja.value=""),qc&&a.f(qc))}else if("symbols"==R)for(var rc=0;rc<a.H.length;rc++){var sc=a.H[rc],Ba;for(Ba in sc.R)if("."!=Ba.charAt(0)){var Td=sc.R[Ba].o;if(void 0!==Td){var Ud=sc.R[Ba].l;Ud&&(Ba=Ud);a.f(W(a,Td)+" "+Ba)}}}else{if("d"==Ua){for(za in M)if(g[1]==za){var Vd=a.na[za];Vd?(g.shift(),g.shift(),Vd(g)):a.f("no dump registered for "+R);break a}R||(Ua=a.Da||"dw")}else a.Da=Ua;if("dh"==Ua){var Wd=R,Xd=ca,Yd="",Zd=0,O=a.P,S=a.j;if(S.length){var K=
+Wd||a.qa,Wa=+Xd||10;isNaN(K)?K=Wa:Yd="more ";K>S.length&&(a.f("note: only "+S.length+" available"),K=S.length);O-=K;0>O&&(null==S[S.length-1].u?(K=O+K,O=0):O+=S.length);var tc=[];"call"==Xd&&(Wa=1E5,tc=["CALL"]);for(void 0!==Wd&&a.f(K+" instructions earlier:");0<Wa&&O!=a.P;){var $d=S[O++];if(null==$d.u)break;var Xa=X($d.u),gf=K--,ae=xe(a,Xa,"history",gf);(!tc.length||0<=ae.indexOf(tc[0]))&&a.f(ae);Xa.Va&&(O+=Xa.Va,Wa-=Xa.Va,K-=Xa.Va);O>=S.length&&(O=0);a.qa=K;Zd++;Wa--}}Zd||(a.f("no "+Yd+"history available"),
a.qa=void 0)}else{var ja=Z(a,R);if(ja){var ka=0,be="ds"==Ua;if(ca){if("l"==ca.charAt(0))ca=ca.substr(1)||ff,ka=yd(a,ca);else{var ce=Z(a,ca);ce&&(ka=ce.u-ja.u)}0>ka&&(ka=0);65536<ka&&(ka=65536)}var hf=a.ba;ja.ba&&(a.ba=ja.ba);for(var uc=ka||32,jf=(uc+4-1)/4|0||1,la="";jf--&&0<uc;){for(var ma="",vc="",R=W(a,ja.u),de=4;0<de--&&0<uc--;){var Ya=a.va(ja,1);be?(ma&&(ma+=","),ma+="0x"+H(Ya,9)):(ma+=W(a,Ya,4),ma+=" ");for(var kf=4;kf--;)var wc=Ya%256,vc=vc+(32<=wc&&128>wc?String.fromCharCode(wc):"."),Ya=Ya/
256}la&&(la+="\n");la=be?la+(ma+","):la+(R+": "+ma+(de?"":" "+vc))}la&&a.f(la);a.wa=ja;a.ba=hf}}}}break;case "e":if("else"==g[0])break;var Za,ee,fe,ge,he=g[0],xc=g[1];"e"==he||"ew"==he?(Za=2,ee=65535,fe=a.va,ge=a.Za):xc=null;if(null==xc)a.f("edit memory commands:"),a.f("\tew [a] [...] edit words at address a");else{var Cb=Z(a,xc);if(Cb)for(var Db=2;Db<g.length;Db++){var $a=wd(a,g[Db]);if(void 0===$a){a.f("unrecognized value: "+g[Db]);break}$a&~ee&&a.f("warning: "+H($a)+" exceeds "+Za+"-byte value");
a.f("changing "+W(a,Cb.u)+(Na(a,16)?"":" from "+W(a,fe.call(a,Cb),Za))+" to "+W(a,$a,Za));ge.call(a,Cb,$a,Za)}}break;case "g":a:{var ie=g[1],lf=b;if(void 0!==ie){var yc=Z(a,ie,!0);if(!yc)break a;Kd(a,yc,lf);a.ua(a.g,yc,!0)}Od(a,!0,c)}break;case "h":a.i.J?(c||a.f("halting"),a.T()):La(a,!0)||c||a.f("already halted");break;case "i":if("if"==g[0]){var zc;var ab=b.substr(2),ab=ib(ab);wd(a,ab)?(c||a.f("true: "+ab),zc=!0):(c||a.f("false: "+ab),zc=!1);zc||(d=!1);break}f=!0;break;case "k":var mf=g[0];if("?"==
g[1])a.f("stack trace commands:"),a.f("\tk\tshow frame addresses"),a.f("\tks\tshow symbol information");else{var Ac=0,Bc=X(),bb=X();for(a.f("stack trace for "+W(a,bb.u));10>Ac;){for(var na=null,nf=256;65536>bb.u>>>0;){Bc.u=a.va(bb,2);if(null==bb.u||!nf--)break;if(!(Bc.u&1)){for(var of=a,Eb=Bc,je=null,cb=Eb.u,ke=cb,Cc=1;6>=Cc&&cb;Cc++){if(2<Cc){Eb.u=cb;var Fb=xe(of,Eb);if(0<=Fb.indexOf("JSR")){var le=Fb.indexOf(" ");if(cb+(Fb.indexOf(" ",le+1)-le-1)/2==ke){je=Fb;break}}}cb-=2}Eb.u=ke;if(na=je)break}}if(!na||
null==na)break;var me=null;if("ks"==mf){var ne=na.match(/[0-9A-F]+$/);ne&&(me=De(a,ne[0]))}na=hb(na,50)+" ;"+(me||"stack="+W(a,bb.u));a.f(na);Ac++}Ac||a.f("no return addresses found")}break;case "l":if("ln"==g[0]){De(a,g[1],!0);break}f=!0;break;case "m":a:{var T,U=null,w=g[1];"?"==w&&(w=void 0);if(void 0!==w){var da=0;if("all"==w)da=1879046143,w=null;else if("on"==w)U=!0,w=null;else if("off"==w)U=!1,w=null;else{"keys"==w&&(w="key");"kbd"==w&&(w="keyboard");for(T in M)if(w==T){da=M[T];U=!!(a.V&da);
break}if(!da){a.f("unknown message category: "+w);break a}}if(da)if("on"==g[2])a.V|=da,U=!0;else if("off"==g[2]&&(a.V&=~da,U=!1,1073741824==da)){for(var oe=1E3<=a.M.length?a.M.length-1E3:0;oe<a.M.length;)a.f(a.M[oe++]);a.M=[]}}var pf=0,db="";for(T in M)if(!w||w==T){var qf=!!(a.V&M[T]);if(null===U||U==qf)db&&(db+=","),++pf%10||(db+="\n\t"),"key"==T&&(T="keys"),db+=T}void 0===w&&a.f("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.f((null!==U?U?"messages on: ":"messages off: ":
"message categories:\n\t")+(db||"none"));Ed(a)}break;case "p":if("print"==g[0]){Ee(a,b.substr(5));break}var rf=g[0];if("?"==g[1])a.f("step commands:"),a.f("\tp\tstep over instruction"),a.f("\tpr\tstep over instruction with register update");else{var sf="pr"==rf?1:0;if(a.L)a.f("step in progress");else{var pe=X(a.b.g);a.va(pe);a.L?(a.ua(a.g,pe,!0),Od(a)||(a.C&&cd(a.C),a.L=0)):Fe(a,sf?"tr":"t")}}break;case "r":if("reset"==b){a.C&&a.C.reset();break}Rd(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var eb=
+g[2];if(8==eb||10==eb||16==eb)a.ba=eb;else{a.f("invalid base: "+eb);break}}a.f("default base: "+a.ba);break;case "cs":var fb;void 0!==g[3]&&(fb=+g[3]);switch(g[2]){case "int":a.b.P=fb;break;case "start":a.b.na=fb;break;case "stop":a.b.Z=fb;break;default:a.f("unknown cs option");break a}void 0!==fb&&Vc(a.b);a.f("checksums "+(a.b.i.Ba?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&($c(a.b,+g[2])||a.f("warning: using 1x multiplier, previous target not reached"));a.f("target speed: "+(a.b.M.toFixed(2)+
"Mhz")+" ("+a.b.N+"x)");break;default:if(g[1]){a.f("unknown option: "+g[1]);break}case "?":a.f("debugger options:"),a.f("\tbase #\t\tset default base to #"),a.f("\tcs int #\tset checksum cycle interval to #"),a.f("\tcs start #\tset checksum cycle start count to #"),a.f("\tcs stop #\tset checksum cycle stop count to #"),a.f("\tsp #\t\tset speed multiplier to #")}break;case "t":Fe(a,g[0],g[1]);break;case "u":qe(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Ce(a,b.substr(3))||(d=!1);break}if("ver"==
g[0]){a.f((Hb||"PDP10")+" version 1.34.0 ("+a.b.ab+",RELEASE)");a.f(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){Ee(a,b.substr(1));break}var Dc="commands:",Ec;for(Ec in He)Dc+="\n"+hb(Ec,9)+He[Ec];jd(a)||(Dc+="\nnote: history disabled if no exec breakpoints");a.f(Dc);break;default:f=!0}f&&(a.f("unknown command: "+b),d=!1)}}catch(re){a.f("debugger error: "+(re.stack||re.message)),d=!1}return d}
function Yc(a,b,c){b=ud(a,b,c);for(var d in b)if(!we(a,b[+d]))return!1;return!0}
var He={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},ze=[".WORD"],Md=0,Ld=["PC"],Gd={},ye=[0],Nd=1E3,Qd=">> ";
L(function(){for(var a=D(document,C,"debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Cd(d);B(d,c)}});
function Ie(a,b,c){u.call(this,"Computer",a,33554432);this.i.S=!1;this.O=null;Je(this,b);this.M=Tc(this,"autoPower",a,6);this.w=0;this.Z=+a.busWidth||+a.buswidth;this.K=this.G=this.L=null;this.I=this.U=!1;this.H=this.D=null;this.P=this.N=!1;this.aa=Tc(this,"url")||"";(Math.random()+.1).toString(36);this.j=Ke(this);if(this.b=z("CPU",this.id)){this.A=z("Debugger",this.id);this.B=new hc({id:this.Ka+".bus",busWidth:this.Z},this.b,this.A);var d,e=y(this.id);if((this.v=z("Panel",this.id))&&this.v.ja)for(b=
0;b<e.length;b++)d=e[b],d.Y=this.v.Y,d.f=this.v.f,d.ja=this.v.ja;this.f(Hb+" v1.34.0\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.ta&&d.ta(this,this.B,this.b,this.A);b=null;d=Tc(this,"resume",a);void 0!==d&&(1<d.length?b=this.G=d:this.g=parseInt(d,10));var f;if(a=Tc(this,"state")||(f=!0,a.state))this.L=b=a,f||(this.I=!0,this.g=Le),this.g&&(this.H=new N(this,"1.34.0"),Me(this.H)?b=null:
delete this.H);!b&&this.g&&(b=Ne(this))&&(this.I=!0);if(b){var g=this;J(b,null,!0,function(a,b,c){c?(g.G=null,g.I=!1,g.Y("Unable to load machine state from server (error "+c+(b?": "+ib(b):"")+")")):(g.K=b,g.U=!0);F(g)})}else F(this);this.F.power||(this.M=!0);!c&&this.M&&Oe(this,this.Fa)}else x("Unable to find CPU component")}q(Ie,u);function Je(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){x(d.message+" ("+c+")")}}a.O=b}
function Tc(a,b,c,d){var e=b.toLowerCase(),e=rb(b)||rb(e);void 0===e&&a.O&&(e=a.O[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}function Oe(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ka(f)){Ka(f,function(){Oe(a,b,c)});return}}b.call(a,c)}
function Pe(a,b){var c=new N(a,"1.34.0",Qe);if(Me(c)&&Re(c)){var d=c.get(Se),e=b?b.get(Se):"unknown";d!=e&&(a.Y("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=Ie.prototype;
l.Fa=function(a){void 0===a&&(a=this.g||(this.K?Te:Le));if(!this.w){this.w++;var b=!1,c=!1;this.N=!1;var d=this.H||new N(this,"1.34.0");if(a==Ue)b=!0;else if(a>Le){if(Me(d,this.K)){this.D=new N(this,"1.34.0",Ve);Me(this.D)&&(We(this,d),a=Xe,Ye(this.D));this.D.set(Se,kb());Ze(this.D);var e=this.g&&!this.I;if(a==Te||xa("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Re(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Me(d,g):("error"==f&&"no machine state"!=
g?(this.Y("Error: "+g),"unable to verify user"==g&&(pb($e,""),this.j=null)):this.f(f+": "+g),Ye(d),Me(d)?(c=Re(d),e=!0):c=!1))}e&&Pe(this,c?d:null)}else a==Xe&&d.clear()}else Pe(this);delete this.K;delete this.H}e=y(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=af(this,g,d,b,c));b=[d,a,c];a!=Ue?Oe(this,this.hb,b):this.hb(b)}};
function af(a,b,c,d,e){if(!b.i.S){b.i.S=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.la(f,d)&&f&&(x("Unable to restore state for "+b.type),a.L&&!a.U?(c.clear(),a.g=Le,window&&window.location.reload()):a.N=!0,b.la(null),e=!1),!d&&b.$a){var g=b.$a.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(h){x("Error restoring state for "+b.type+" ("+h.message+")")}}return e}
l.hb=function(a){var b=a[0],c=0>a[1];a=a[2];this.P=!0;this.i.S=!0;var d=this.F.power;d&&(d.textContent="Shutdown");this.b&&(af(this,this.b,b,c,a),P(this,-2),this.b.X());this.N&&(We(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.w=0};
function We(a,b){if(xa("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.aa;a=a.j||"";b=b.toString();var d={};d.app=Hb;d.ver="1.34.0";d.url=c;d.user=a;d.type="bug";d.data=b;J("http://www.pcjs.org/api/v1/report",d,!0)}}
function Ge(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new N(a,"1.34.0"),g=new N(a,"1.34.0",Qe),h=kb();g.set(Se,h);f.set(Se,h);f.set(bf,"1.34.0");f.set(cf,window?window.location.href:null);f.set(df,window?window.navigator.userAgent:"");a.b&&a.b.ca&&(c&&(b&&(a.b.i.X=a.b.i.J),a.b.T()),d=a.b.ca(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.i.S=!1,!1===d&&(e=null)));for(var h=y(a.id),k=0;k<h.length;k++){var m=h[k];m.i.S&&(m.ca&&(d=m.ca(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.i.S=
!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.j&&tf(a,a.j,f.toString()),Ze(g)&&Ze(f)||(e=null,d=h=!0)):a.g&&(d=!0,h=a.g==uf),d&&f.clear(h)):e=f.toString());c&&(a.i.S=!1,b=a.F.power)&&(b.textContent="Power");a.w=0;return e}
l.reset=function(){this.i.reset=!0;this.B&&this.B.reset&&(G(this,"Resetting "+this.B.type),this.B.reset());this.b&&this.b.reset&&(G(this,"Resetting "+this.b.type),this.b.reset());for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.B&&c!==this.b&&c.reset&&(G(this,"Resetting "+c.type),c.reset())}this.i.reset=!1;P(this,-1)};l.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}P(this,-1)};
l.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}P(this,-1)};
function P(a,b){if(a.b){var c=a.b,d=b||0,e=c.F.speed;e&&(0>=d||30<=(c.wa+=d))&&(e.textContent=c.i.J?c.L.toFixed(2)+"Mhz":"Stopped",c.wa=0)}if(a.v&&(a=a.v,b=b||0,a.K)){c=a.b.i.J;d=!!(a.b.j&8);if(0>=b||60<=(a.I+=b)){e=a.b.g;if(a.F.PC){var f=a.A&&a.A.ba||8,e=e||0,e=8==f?Pa(e,void 0):H(e,void 0);a.F.PC.textContent!=e&&(a.F.PC.textContent=e)}a.I=0}-1>b?a.j=a.b.g:0<b&&c&&!d&&(a.j=a.b.ea);Sb(a,a.j);Mb(a,a.w)}}
l.da=function(a,b,c){var d=this;switch(b){case "power":return this.F[b]=c,c.onclick=function(){d.w||(d.i.S?Ge(d,!1,!0):Oe(d,d.Fa))},!0;case "reset":return this.F[b]=c,c.onclick=function(){if(d.i.S&&!d.w)if(d.g&&!d.G){var a=xa("Click OK to save changes to this "+Hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ge(d,a,!0);!a&&d.L?window&&window.location.reload():d.Fa(Le)}else d.reset(),d.b&&!d.A&&d.b.X()},!0;case "save":if(Sa())c.parentNode.removeChild(c);else return this.F[b]=
c,c.onclick=function(){var a=Ke(d,!0);if(a){var b=!!(d.g&&!d.G||d.L),c=Ge(d,b);b?tf(d,a,c):d.Y("Resume disabled, machine state not saved")}},!0}return!1};function Ke(a,b){var c=a.j;c||((c=ob($e),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=vf(a,c))||a.Y("The user ID is invalid.")):b&&a.Y("Browser local storage is not available"));return c}
function vf(a,b){a.j=null;b=J(Ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(pb($e,b.data),a.j=b.data)}catch(d){x(d.message+" ("+c+")")}return a.j}function Ne(a){var b=null;a.j&&(b=Ta()+"/api/v1/user?req=load&user="+a.j+"&state="+wf(a,"1.34.0"));return b}
function tf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=wf(a,"1.34.0");d.data=c;b=J(Ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Y("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Y(c),pb($e,""),a.j=null)}}
function cd(a,b){if(a.ja){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.ja.focus();!b&&window&&window.scrollTo(c,d)}}var Ve="failsafe",Qe="validate",Se="timestamp",bf="version",cf="url",df="browser",$e="user",Ue=-1,Le=0,Te=1,Xe=2,uf=3;L(function(){for(var a=D(document,C+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,C,"computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Ie(g,d,!0);B(g,f);g.M&&Oe(g,g.Fa)}});
wb.show.push(function(){for(var a=D(document,C,"computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.P&&!c.i.S&&c.Fa(Ue)}});wb.exit.push(function(){for(var a=D(document,C,"computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.i.S&&Ge(c,!(!c.g||c.G),!0)}});function N(a,b,c){this.id=a.id;this.A="";this.b={};this.B=this.C=!1;this.key=wf(a,b,c);Ye(this,a.rb)}l=N.prototype;l.set=function(a,b){try{this.b[a]=b}catch(c){}};l.get=function(a){return this.b[a]||null};
l.data=function(){return this.b};function Me(a,b){return b?(a.A=b,a.B=!0,a.C=!1,!0):a.B?!0:mb()&&(b=ob(a.key))?(a.A=b,a.B=!0):!1}function Re(a){var b=!0;if(!a.C)try{a.b=JSON.parse(a.A),a.C=!0}catch(c){x(c.message||c),b=!1}return b}function Ze(a){var b=!0;if(mb()){var c=JSON.stringify(a.b);pb(a.key,c)||(x("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}l.toString=function(){return this.b?JSON.stringify(this.b):this.A};
function Ye(a,b){a.A="";a.b={};a.B=a.C=!1;b&&a.set("parms",b)}l.clear=function(a){Ye(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function wf(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var xf=0;
function yf(a,b,c,d,e,f){e("Loading "+a+"...");J(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):zf(h,a,b,c,d,e,f)})}
function zf(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(ta(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Af(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function Af(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");J(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],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[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);Af(a,b,c)}})}else c(a,null)}
function Bf(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=Va(a))}function f(a){e("Error: "+a);k&&(--xf||zb(!0));k=!1}var g,h,k=!0;xf++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";n.styleSheet?n.styleSheet.cssText=m:n.appendChild(document.createTextNode(m));p.appendChild(n)}c||
(c="/versions/pdpjs/1.34.0/components.xsl");m=function(d,h){h?yf(c,null,null,!1,e,function(d,k){k?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--xf||zb(!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),--xf||zb(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?yf(b,a,d,!0,e,m):zf(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return k}window.embedPDP11=function(a,b,c,d){zb(!1);return Bf(a,b,c,d)};window.findMachineComponent=function(a,b){return z(b,a+".machine")};
window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!Ea[a]){for(var c=!0,d=Ea,e=a,f=b.length,g=[],h=[],k="",m=null,p=0;p<f;p++){var n=b[p];if('"'==n||"'"==n)m&&n!=m?k+=n:(m?m=null:m=n,k&&(h.push(k),k=""));else{if(!m){if("\r"==n||"\n"==n)n=";";if(" "==n||"\t"==n||";"==n){k&&(h.push(k),k="");";"==n&&h.length&&(g.push(h),h=[]);continue}}k+=n}}k&&h.push(k);h.length&&g.push(h);d[e]=g;Da(a)||(c=!1)}return c};window.enableEvents=zb;window.sendEvent=Bb;})();//# sourceMappingURL=/tmp/pdpjs/1.34.0/pdp10-dbg.map

View file

@ -0,0 +1,143 @@
(function(){/*
http://pcjs.org/modules/shared/lib/diskapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/messages.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/device.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/rom.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/ram.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/computer.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/int36.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/defines.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/panel.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/bus.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/memory.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/cpu.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/cpustate.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/serial.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2017
http://pcjs.org/modules/pdp10/lib/debugger.js (C) Jeff Parsons 2012-2017
*/
var k,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)},q="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ba(){ba=function(){};q.Symbol||(q.Symbol=ca)}var da=0;function ca(a){return"jscomp_symbol_"+(a||"")+da++}
function ea(){ba();var a=q.Symbol.iterator;a||(a=q.Symbol.iterator=q.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return fa(this)}});ea=function(){}}function fa(a){var b=0;return ga(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ga(a){ea();a={next:a};a[q.Symbol.iterator]=function(){return this};return a}
function r(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}function ha(a,b){if(b){var c=q;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}
ha("Math.trunc",function(a){return a?a:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||!a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}});ha("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}});
var ia=Math.pow(2,36),ja=-Math.pow(2,35),t={Ab:0,Qa:1,Cb:2,Db:3,Eb:4,Fb:5,Gb:6,Hb:7,Fa:8,Ib:9,Ra:10,Jb:11,Kb:12,Sa:13,Lb:14,Mb:15,Nb:16,Ob:17,Pb:18,Qb:19,Rb:20,Sb:21,Tb:22,Ub:23,Vb:24,Wb:25,Xb: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,Ea:65,zb:66,Bb:67,Yb:68,E:69,Zb:70,$b:71,ac:72,bc:73,cc:74,dc:75,ec:76,fc:77,gc:78,hc:79,ic:80,Q:81,
jc:82,kc:83,lc:84,mc:85,nc:86,oc:87,pc:88,qc:89,Wa:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,rc:97,sc:98,tc:99,d:100,e:101,uc:102,vc:103,wc:104,xc:105,yc:106,k:107,zc:108,Ac:109,n:110,Bc:111,p:112,q:113,r:114,Cc:115,t:116,Dc:117,Ec:118,Fc:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Ta:127};
function u(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ia=b.comment;this.Va=b;this.exports={};this.i=this.bindings={};a=this.id.indexOf(".");0>a?this.ha=this.id:(this.ia=this.id.substr(0,a),this.ha=this.id.substr(a+1));this.b={ready:!1,ma:!1,za:!1,w:!1,error:!1};this.pa=null;this.b.error=!1;this.o=this.c=this.j=this.m=this.Y=null;v.push(this)}function ka(a,b,c){la[a]&&b&&(la[a][b]=c)}function w(){return Date.now()||+new Date}
function x(a){window&&window.alert(a)}function ma(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}function na(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}
function z(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){x(c.message+" ("+a+")")}return b}
function B(a,b){var c=C;b=D(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var h=e[f];if(1===h.nodeType){var g=h.getAttribute("class");if(g)for(var l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case c+"-binding":(g=A(h))&&g.binding&&a.S(g.type,g.binding,h,g.value),m=l.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
function oa(a){for(var b=!0,c=pa[a];c&&c.length;){var d=c.splice(0,1)[0],e=d[0],f=null;0<=qa.indexOf(e)&&(f=function(){return function(){oa(a)}}());var h=ra[e];if(h)if(!f)b=h(d[1],d[2],d[3]);else{if(!h(f,d[1],d[2],d[3]))break}else{var b=!1,g=z(d[1],a);if(g)if(h=sa[e])b=h(g,d[2],d[3]);else{var l=g.exports;if(l&&(h=l[e]))if(b=!0,!f)b=h.call(g,d[2],d[3]);else if(!h.call(g,f,d[2],d[3]))break}}if(!b){x("Script error: "+e+(h?" failed":" unrecognized"));break}}c&&!c.length&&delete pa[a];return b}k=u.prototype;
k.toString=function(){return this.name?this.name:this.id||this.type};
k.S=function(a,b,c){switch(b){case "clear":return this.i[b]||(this.i[b]=c,c.onclick=function(a){return function(){a.i.print&&(a.i.print.value="")}}(this)),!0;case "print":return this.i[b]||(this.Y=this.i[b]=c,c.value="",this.J=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.C=function(a){this.J(a,this.ha)}),!0;default:return!1}};k.log=function(){};k.J=function(){};
k.status=function(a){this.J(this.ha+": "+a)};k.C=function(a,b,c){c=c||this.type;b||x((c?c+": ":"")+a)};function ta(a,b){b&&(a.b.ready?b():a.pa=b);return a.b.ready}function E(a){if(!a.b.error&&(a.b.ready=!0,a.b.ready)){var b=a.pa;a.pa=null;b&&b()}}function ua(a,b){a.b.za?(a.b.ma=!1,a.b.za=!1):a.b.error?a.J(a.toString()+" error"):a.b.ma=b}k.T=function(){return this.b.w=!0};k.N=function(a,b){b&&(this.b.w=!1);return!0};
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]),window.PCjs.Commands||(window.PCjs.Commands={}));
var la=window?window.PCjs.Machines:{},v=window?window.PCjs.Components:[],pa=window?window.PCjs.Commands:{},qa=["hold","sleep","wait"],ra={alert:function(a){x(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},sa={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
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});
function va(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function F(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function wa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}
function xa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ya(){var a=G();return-1!==a.indexOf("pcjs.org",a.length-8)}function za(a){return a.replace(/[&<>"']/g,function(a){return Aa[a]})}function Ba(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Aa={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};
function Ca(){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 H(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,h=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),h;var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(g.onreadystatechange=function(){4===g.readyState&&(f=g.responseText,200==g.status||!g.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=g.status||-1),d&&d(a,
f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");g.open("POST",a,c);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(l)}else g.open("GET",a,c),"bytes"==b&&g.overrideMimeType("text/plain; charset=x-user-defined"),g.send();c||(f=g.responseText,200!=g.status&&(e=g.status||-1),d&&d(a,f,e),h=[f,e]);return h}
function Da(a,b){var c,d={D:null,I:null,R:null,P:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,h;if("<"==b.substr(0,1))throw Error(b);h=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.R=h.load;d.P=h.exec;if(e=h.bytes)d.D=e;else if(e=h.words)for(d.D=Array(2*e.length),f=c=0;c<e.length;c++)d.D[f++]=e[c]&255,d.D[f++]=e[c]>>8&255;else if(e=h.data)for(d.D=Array(4*e.length),f=c=0;c<e.length;c++)d.D[f++]=e[c]&255,d.D[f++]=
e[c]>>8&255,d.D[f++]=e[c]>>16&255,d.D[f++]=e[c]>>24&255;else d.D=h;d.I=h.symbols;d.D.length?1==d.D.length&&(x(d.D[0]),d=null):(x("Empty resource: "+a),d=null)}catch(g){x("Resource data error ("+a+"): "+g.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){x("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.D=e)}return d}
function G(){return"http://"+(window?window.location.host:"www.pcjs.org")}function Ea(){if(null==Fa){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}Fa=a}return Fa}function Ga(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
function Ha(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ia(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)}return!1}
function Ja(a){if(!Ka){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Ka=c}return Ka[a]}function La(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function I(a){J.init.push(a)}
function Ma(a){if(Na)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){x(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function K(a){!Na&&a?(Na=!0,Oa&&Pa("init"),Ra&&Pa("show")):Na=a}function Pa(a){J[a]&&Ma(J[a])}var Ka=null,J={init:[],show:[],exit:[]},Oa=!1,Ra=!1,Na=!0,Fa=null;La("onload",function(){Oa=!0;Ma(J.init)});La("onpageshow",function(){Ra=!0;Ma(J.show)});La(Ia("Opera")||Ia("iOS")?"onunload":"onbeforeunload",function(){Ma(J.exit)});
var C="pdp10",L="PDPjs",Sa=Math.pow(2,18),Ta=Math.pow(2,36),C="pdp10",L="PDPjs";
function Ua(a,b){u.call(this,"Panel",a);this.A=this.B=0;this.O=b;this.f=this.v=this.g=this.h=0;this.F=this.H=-1;this.K=this.L=this.s=!1;this.M=Va;this.l={};this.a={START:[1,1,!0,!1,this.gb],STEP:[1,1,!1,!1,this.hb],ENABLE:[1,1,!1,!1,this.ab],CONT:[1,1,!0,!1,this.Za],DEP:[0,0,!0,!1,this.$a],EXAM:[1,1,!0,!1,this.bb],LOAD:[1,1,!0,!1,this.eb],TEST:[0,0,!0,!1,this.cb]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.fb,a];this.o=this.c=this.j=this.m=null;this.exports={hold:this.Ya,toggle:this.sb,reset:this.ob,
set:this.rb};E(this)}r(Ua,u);k=Ua.prototype;k.reset=function(a){this.stop();a&&M(this,this.h=0)};
k.S=function(a,b,c,d){if(this.m&&this.m.S(a,b,c,d)||this.c&&this.c.S(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.i[b]=c,this.B++,!0;default:return"led"==a||"rled"==a?(this.i[b]=c,this.l[b]=d?1:0,this.B++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.i[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){Wa(a,b)}}(this,
b),a.onmouseup=a.onmouseout=function(a,b){return function(){N(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Wa(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){N(a,b)}}(this,b),!0):u.prototype.S.call(this,a,b,c,d)}};k.U=function(a,b,c,d){this.m=a;this.j=b;this.c=c;this.o=d;Xa(this);Ya(this)};k.T=function(a,b){if(!b)if(this.O&&Za(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.N=function(a){return a?this.save():!0};
k.save=function(){var a=new O(this);a.set(0,[this.f,this.h,this.g]);return a.data()};k.restore=function(a){if(a=a[0])P(this,this.f=a[0]),M(this,this.h=a[1]),$a(this,a[2]);return!0};k.ob=function(){for(var a in this.a){var b=this.a[a];b[1]=b[0]}Ya(this);return!0};function ab(a,b,c){if(a=a.i[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Xa(a,b){for(var c in a.l)ab(a,c,null!=b?b:a.l[c])}
function bb(a,b,c){if(a=a.i[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Ya(a){for(var b in a.a)bb(a,b,a.a[b][1])}k.Ya=function(a,b,c){if(Wa(this,b)){if(c){var d=this;setTimeout(function(){N(d,b);a&&a()},+c);return!1}N(this,b)}return!0};
k.rb=function(a,b){if("SR"==a){a=b;b=8;var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):
2==e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return $a(this,c)}return(c=this.a[a])?(c[1]=+b?1:0,bb(this,a,c[1]),!0):!1};k.sb=function(a){return Wa(this,a)?(N(this,a),!0):!1};function Wa(a,b){var c=a.a[b];return c?(bb(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=cb&&(a.K=b==db,a.L=b==eb),!0):!1}function N(a,b){var c=a.a[b];c&&(c[2]&&c[3]&&(bb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}
k.gb=function(a){a||this.c.b.u||(this.c.f=this.f%Sa,this.a[fb]&&this.a[fb][1]&&Q(this.c))};k.hb=function(){};k.ab=function(a){a||R(this.c)};k.Za=function(a){if(!a&&!this.c.b.u)if(this.a[fb]&&this.a[fb][1])Q(this.c);else{a=this.o;var b;if(b=a)a.b.ma&&(a.b.za=!0),b=!a.b.ma;if(b)ua(a,!0),a.f(0,null),ua(a,!1);else try{var c=this.c.ta(1);0<c&&(gb(this.c,c),hb(this.c,c,!0),ib(this.c,c))}catch(d){"number"!=typeof d&&(c=this.c,a=d.stack||d.message,c.b.error=!0,c.C(a))}this.stop();this.m&&S(this.m)}};
k.$a=function(a){a&&!this.c.b.u&&(this.K&&jb(this),a=M(this,this.h=this.g),this.M==Va?kb(this.j,this.f,a):this.c.ca(this.f,a))};k.bb=function(a){if(!a&&!this.c.b.u){this.L&&jb(this);if(this.M==Va){a=this.j;var b=this.f;a=a.a[(b&a.g)>>>a.f].Ba(b&16383,b)}else a=this.c.Z(this.f);M(this,this.h=a)}};k.eb=function(a){a||this.c.b.u||P(this,this.g)};k.cb=function(a){a?(this.s=!0,Xa(this,!0)):(this.s=!1,Xa(this),$a(this,0))};k.fb=function(a,b){this.g=a?this.g|1<<b:this.g&~(1<<b)};
function jb(a){var b=1,c=a.j.g;a.a[cb]&&a.a[cb][1]||(b=-b);P(a,a.f&~c|a.f+b&c)}function P(a,b){a.f=b&a.j.g;if(a.F!==a.f){a.F=a.f;b=a.F;for(var c=0;22>c;c++){var d=a,e="A"+c,f=b&1<<c;d.l[e]=f;d.s||ab(d,e,f)}}}function M(a,b){a.v=b%Ta;if(a.H!==a.v){a.H=a.v;b=a.H;for(var c=0;16>c;c++){var d=a,e="D"+c,f=b&1<<c;d.l[e]=f;d.s||ab(d,e,f)}}return a.v}function $a(a,b){a.g=b|0;for(b=0;22>b;b++)a.a["S"+b][1]=a.g&1<<b?1:0;Ya(a);return!0}k.stop=function(){P(this,this.c.f)};
function Za(){for(var a=D(document,C,"panel"),b=0;b<a.length;b++){var c=a[b],d=A(c),e=na(d.id);e||(e=new Ua(d,!0));B(e,c)}}var Va=7,db="DEP",fb="ENABLE",eb="EXAM",cb="STEP";I(Za);function lb(a,b,c){u.call(this,"Bus",a);this.c=b;this.o=c;this.s=+a.busWidth||18;this.l=1<<this.s;this.g=this.l-1;this.f=Math.log2(16384);this.h=this.l/16384|0;this.a=[];a=new T;mb(a);this.a=Array(this.h);for(b=0;b<this.h;b++)this.a[b]=a;E(this)}r(lb,u);k=lb.prototype;k.reset=function(){};
k.T=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.N=function(a){return a?this.save():!0};k.save=function(){var a=new O(this);a.set(0,nb(this));return a.data()};k.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&4096>d.length){for(var e=0,f=Array(4096),h=0;h<d.length-1;)for(var g=d[h++],l=d[h++];g--;)f[e++]=l;d=f}e=this.a[c];if(!e||!e.restore(d)){x("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
function ob(a,b,c,d){for(var e=b,f=c,h=e>>>a.f;0<f&&h<a.a.length;){var g=a.a[h],l=16384*h,m=16384-(e-l);m>f&&(m=f);if(g&&g.size){if(g.type==d){if(e+f<=g.X)return g.ra+=g.X-e,g.X=e,!0;if(e>=g.X+g.ra){m=g.size-(e-l);m>f&&(m=f);g.ra=e-g.X+m;e=l+16384;f-=m;h++;continue}}return pb(qb,e,f)}e=new T(0,e,m,16384,d);mb(e,g);a.a[h++]=e;e=l+16384;f-=m}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+rb[d]+" at "+va(b)),!0):pb(sb,b,c)}function kb(a,b,c){a.a[(b&a.g)>>>a.f].sa(b&16383,c&65535,b)}
function nb(a){for(var b=0,c=[],d=0;d<a.h;d++){var e=a.a[d];if(e.oa||e.Xa){c[b++]=d;var f=b++;if(e=e.save()){for(var h=0,g=0,l=[];h<e.length;){for(var m=e[h],p=h+1;p<e.length&&e[p]===m;)p++;l[g++]=p-h;l[g++]=m;h=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function pb(a,b,c){x("Memory block error ("+a+": "+F(b)+","+F(c)+")");return!1}var qb=1,sb=2;function tb(a){u.call(this,"Device",a)}r(tb,u);k=tb.prototype;k.U=function(a,b,c,d){this.j=b;this.m=a;this.c=c;this.o=d;E(this)};
k.T=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.N=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){return(new O(this)).data()};k.restore=function(){return!0};I(function(){for(var a=D(document,C,"device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new tb(c),B(c,d)}}});
function T(a,b,c,d,e){this.id=ub+=2;this.X=b;this.ra=c;this.size=d||0;this.type=e||vb;this.m=e==wb;this.o=this.Oa;this.Z=this.Ba=this.Aa;this.a=this.Pa;this.ca=this.sa=this.Da;this.i=this.j=0;mb(this);this.oa=this.Xa=!1;if(this.size){a=this.c=Array(this.size);for(b=0;b<a.length;b++)a[b]=0;xb(this,yb)}else xb(this)}k=T.prototype;k.save=function(){return this.c};k.restore=function(a){return a&&this.size==a.length?(this.c=a,this.oa=!0):!1};function xb(a,b){b||(b=zb);Ab(a,b,void 0);Bb(a,b,void 0)}
function Ab(a,b,c){c&&a.i||(a.Z=b[2]||a.Aa);if(c||void 0===c)a.o=b[0]||a.Oa,a.Ba=b[2]||a.Aa}function Bb(a,b,c){c&&a.j||(a.ca=!a.m&&b[3]||a.Da);if(c||void 0===c)a.a=b[1]||a.Pa,a.sa=b[3]||a.Da}function mb(a,b){a.i=a.j=0;b&&((a.i=b.i)&&Ab(a,Cb,!1),(a.j=b.j)&&Bb(a,Cb,!1))}k.Oa=function(){return 0};k.Pa=function(){};k.Aa=function(a,b){return this.Z(a,b)};k.Da=function(a,b,c){this.ca(a,b,c)};k.jb=function(a,b,c){c=this.c[c];return c=32>=a+b?c>>a&(1<<b)-1:Math.trunc(c/Math.pow(2,a))%Math.pow(2,b)};
k.mb=function(a){return this.c[a]};k.vb=function(a,b,c,d){var e=this.c[d],f=Math.pow(2,a);c%=Math.pow(2,b);a=e%Math.pow(2,a+b);e=e-a+c*f+a%f;this.c[d]!=e&&(this.c[d]=e,this.oa=!0)};k.xb=function(a,b){this.c[b]=a;this.oa=!0};k.ib=function(a,b,c,d){return this.o(a,b,c,d)};k.kb=function(a,b){return this.Ba(a,b)};k.ub=function(a,b,c,d,e){this.m||this.a(a,b,c,d,e)};k.wb=function(a,b,c){this.m||this.sa(a,b,c)};
var vb=0,wb=2,rb=["NONE","RAM","ROM"],ub=0,zb=[],yb=[T.prototype.jb,T.prototype.vb,T.prototype.mb,T.prototype.xb],Cb=[T.prototype.ib,T.prototype.ub,T.prototype.kb,T.prototype.wb];
function U(a,b){u.call(this,"CPU",a);b=+a.cycles||b;var c=+a.multiplier||1;this.ua=0;this.xa=b;this.L=c;this.va=Math.round(this.xa/1E4)/100;this.H=this.va*this.L;this.wa=this.fa=this.M=this.la=0;this.b.u=this.b.Ca=!1;this.b.G=a.autoStart;"string"==typeof this.b.G&&(this.b.G="true"==this.b.G);this.b.na=!1;this.ja=this.K=0;this.ka=+a.csStart;this.da=+a.csInterval;this.ea=+a.csStop;this.l=[];this.Ja=this.pb.bind(this);this.B=this.h=this.v=this.A=this.g=this.ba=this.s=this.O=this.ya=this.F=0;this.ga=
null;E(this)}r(U,u);k=U.prototype;k.U=function(a,b,c,d){this.m=a;this.j=b;this.o=d;this.ga=a.g;for(a=0;a<Db.length;a++)(b=this.i[Db[a]])&&this.m.S(null,Db[a],b);E(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.T=function(a,b){var c=V(this.m,"autoStart");null!=c?this.b.G="true"==c?!0:"false"==c?!1:!!c:null==this.b.G&&(this.b.G=void 0===this.i.run);if(!b){if(a){Eb(this);if(!this.restore(a))return!1;Fb(this)}else this.reset();this.status("No debugger detected");this.b.G||this.J("CPU will not be auto-started "+(this.ga?"(click Run to start)":"(type 'go' to start)"))}return!0};k.N=function(a){return a?this.save():!0};k.G=function(){return this.b.u?!0:this.b.G?(Q(this),!0):!1};k.Ma=function(){return 0};
function Fb(a){void 0===a.ka&&(a.ka=0);void 0===a.da&&(a.da=-1);void 0===a.ea&&(a.ea=-1);a.b.na=0<=a.ka&&0<a.da;a.b.na&&(a.ja=0,a.K=a.ka-a.B)}function ib(a,b){if(a.b.na){var c=!1;a.ja=a.ja+a.Ma()|0;a.K-=b;0>=a.K&&(a.K+=a.da,c=!0);0<=a.ea&&a.ea<=W(a)&&(a.da=a.ea=-1,Fb(a),R(a),c=!0);c&&a.J(W(a)+" cycles: checksum="+F(a.ja))}}
k.S=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.i[b]=c,!0;case "run":return this.i[b]=c,c.onclick=function(){var a;if(a=d.m)if(a=d.m,a.b.w)a=!0;else{var b=null,c,g=y(a.id);for(c=0;c<g.length&&(b=g[c],b===a||b.b.ready);c++);if(c==g.length)for(c=0;c<g.length&&(b=g[c],b===a||b.b.w);c++);c==g.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.b.ready?"powered yet":"ready yet"+(b.pa?" (waiting for notification)":""))+".");a=!1}a&&(d.b.u?R(d):Q(d))},!0;case "speed":return this.i[b]=
c,!0;case "setSpeed":return this.i[b]=c,c.onclick=function(){X(d,d.L<<1,!0)},c.textContent=this.H.toFixed(2)+"Mhz",!0}return!1};function hb(a,b,c){a.B+=b;c&&(a.v=a.A=0)}function Hb(a,b){var c=1;b&&1<a.L&&a.F&&(c=a.F/a.va);a.wa=Math.round(1E3/Ib);a.fa=Math.floor(a.xa/Ib*c);b||(a.M=a.fa);a.la=0}function W(a){return a.B+a.h+a.v-a.A}function Eb(a){a.F=0;a.ya=0;a.B=a.h=a.v=a.A=0;Fb(a);X(a,1)}
function X(a,b,c){if(void 0!==b){.8>a.F/a.H&&(b=1);a.L=b;b=a.va*a.L;if(a.H!=b){a.H=b;b=a.H.toFixed(2)+"Mhz";var d=a.i.setSpeed;d&&(d.textContent=b);a.J("target speed: "+b)}c&&a.m&&(c=a.m,c.Y&&(d=b=0,window&&(b=window.scrollX,d=window.scrollY),c.Y.focus(),window&&window.scrollTo(b,d)))}hb(a,a.h);a.h=0;a.g=w();a.s=0;Hb(a)}function Jb(a){for(var b=[],c=0;c<a.l.length;c++)b.push(a.l[c][0]);return b}
function gb(a,b){for(var c=a.l.length-1;0<=c;c--){var d=a.l[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Kb(a,b){var c=a.v-=a.A;a.A=0;b&&(a.v=0);return c}
k.pb=function(){if(this.b.u){this.la>=this.xa&&Hb(this,!0);this.O=0;this.ba=w();if(this.s){var a=this.ba-this.s;a>this.wa&&(this.g+=a,this.g>this.ba&&(this.g=this.ba))}try{do{for(var b,c=this.b.na?1:this.fa,d=this.l.length-1;0<=d;d--){var e=this.l[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ta(b)}catch(f){if("number"!=typeof f)throw f;}b=Kb(this,!0);this.O+=b;this.h+=b;ib(this,b);gb(this,b);this.M-=b;if(0>=this.M){this.M+=this.fa;++this.ya>=Lb&&(this.m&&S(this.m,void 0),this.ya=0);break}}while(this.b.u)}catch(f){R(this);
this.m&&this.m.stop(w(),W(this));a=f.stack||f.message;this.b.error=!0;this.C(a);return}if(this.b.u){a=setTimeout;b=this.Ja;this.s=w();c=this.wa;this.O&&(c=Math.round(c*this.O/this.fa));c-=this.s-this.ba;if(d=this.s-this.g)this.F=Math.round(this.h/(10*d))/100,864E5<=d&&(this.B=0,X(this));if(0>c||this.F<this.H)-1E3>c&&(this.g-=c),c=0;this.la+=this.O;this.s+=c;a(b,c)}}};
function Q(a){var b;a.b.error?(a.J(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.b.u)a.J(a.toString()+" busy");else{X(a);a.b.u=!0;a.b.Ca=!0;if(b=a.i.run)b.textContent="Halt";a.m&&a.m.start(a.g,W(a));a.o||a.status("Started");setTimeout(a.Ja,0)}}k.ta=function(){return 0};function R(a){var b=!1;if(a.b.u){Kb(a);hb(a,a.h);a.h=0;a.b.u=!1;if(b=a.i.run)b.textContent="Run";a.m&&a.m.stop(w(),W(a));b=!0;a.o||a.status("Stopped")}a.b.complete=void 0;return b}var Ib=30,Lb=15,Db=["power","reset"];
function Mb(a){var b=+a.model||1001;U.call(this,a,6666667);this.Ua=b;this.Ha=+a.addrReset||0;this.W=null;this.Ga=[];this.b.complete=!1}r(Mb,U);k=Mb.prototype;k.reset=function(){this.status("Model "+this.Ua);this.b.u&&R(this);this.V=this.f=this.Ka=this.Ha;this.a=0;this.Z=this.lb;this.ca=this.yb;this.W=null;Eb(this);this.b.error=!1;U.prototype.reset.call(this)};k.Ma=function(){return 0};
k.save=function(){var a=new O(this);a.set(0,[this.f,this.Ka,this.V,this.a]);a.set(1,[]);a.set(2,[this.B,this.L,this.b.G]);a.set(3,Nb(this));a.set(4,Jb(this));return a.data()};
k.restore=function(a){var b;b=a[0];ea();ba();ea();var c=b[Symbol.iterator];b=c?c.call(b):fa(b);this.f=b.next().value;this.Ka=b.next().value;this.V=b.next().value;this.a=b.next().value;b=a[2];this.B=b[0];X(this,b[1]);this.b.G=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.Ga.length;d++){var e=this.Ga[d];if(e.tb===b[c]){d=e;break a}}d=null}d&&(d.next=this.W,this.W=d)}a=a[4];for(b=0;b<this.l.length&&b<a.length;b++)this.l[b][0]=a[b];return!0};
function Nb(a){var b=[];for(a=a.W;a;)b.push(a.tb),a=a.next;return b}k.lb=function(a){var b=this.j;a=this.V=a;return b.a[(a&b.g)>>>b.f].Z(a&16383,a)};k.yb=function(a,b){var c=this.j;a=this.V=a;c.a[(a&c.g)>>>c.f].ca(a&16383,b,a)};
k.ta=function(a){this.b.complete=!0;var b=a?this.b.Ca?0:1:-1;this.b.Ca=!1;this.v=this.A=a;this.a=this.a&-5|0;do{if(a=this.a)if(a=this.a&11)this.a&2?this.W||(this.a&=-3):this.a&1&&this.a++,a=!1;if(a){if(this.a&4&&this.o.h(this.f,b)){R(this);break}if(0>b)break}this.a&=15;a=this.f;this.Z(a);this.f=(a+1)%Sa}while(0<this.A);return this.b.complete?this.v-this.A:!1===this.b.complete?-1:0};I(function(){for(var a=D(document,C,"cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Mb(d);B(d,c)}});
function Ob(a){u.call(this,"ROM",a);this.I=this.a=null;this.l=+a.addr;this.g=+a.size;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.h=a.file;this.s=wa(this.h);if(this.h){a=this.h;var b=xa(this.s);"json"!=b&&"hex"!=b&&(a=G()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;H(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.h=null):(ka(c.ia,a,b),(a=Da(a,b))?(c.a=a.D,c.I=a.I):c.h=null);Pb(c)})}}r(Ob,u);
Ob.prototype.U=function(a,b,c,d){this.j=b;this.c=c;this.o=d;Pb(this)};Ob.prototype.T=function(){this.I&&(this.o&&this.o.a(this.id,this.l,this.g,this.I),delete this.I);return!0};Ob.prototype.N=function(){return!0};
function Pb(a){if(!ta(a)){if(a.h){if(!a.a||!a.j)return;a.g||(a.g=a.a.length);if(a.a.length!=a.g){var b="ROM size ("+F(a.a.length,8,!0)+") does not match specified size ("+F(a.g,8,!0)+")";a.b.error=!0;a.C(b)}else{b=a.l;if(ob(a.j,b,a.g,wb)){var c;for(c=0;c<a.a.length;c++)kb(a.j,b+c,a.a[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.j,h=d.g,g=[],l=d.l>>>f.f;0<h&&l<f.a.length;)g.push(f.a[l++]),h-=16384;f=d.j;
d=d.g;h=0;for(e>>>=f.f;0<d&&e<f.a.length;){l=g[h++];if(!l)break;f.a[e++]=l;d-=16384}}delete a.a}}}E(a)}}I(function(){for(var a=D(document,C,"rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ob(d);B(d,c)}});
function Y(a){u.call(this,"RAM",a);this.I=this.f=null;this.g=+a.addr;this.h=+a.size;this.R=a.load;this.P=a.exec;null!=this.R&&(this.R=+this.R);null!=this.P&&(this.P=+this.P);this.l=!1;this.a=a.file;this.s=wa(this.a);if(this.a){a=this.a;var b=xa(this.s);"json"!=b&&"hex"!=b&&(a=G()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;H(a,null,!0,function(a,b,f){f?(c.C("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(ka(c.ia,a,b),(a=Da(a,b))?(c.f=a.D,c.I=a.I,null==c.R&&
(c.R=a.R),null==c.P&&(c.P=a.P)):c.a=null);Qb(c)})}}r(Y,u);Y.prototype.U=function(a,b,c,d){this.j=b;this.c=c;this.o=d;Qb(this)};Y.prototype.T=function(a,b){this.I&&(this.o&&this.o.a(this.id,this.g,this.h,this.I),delete this.I);b||this.reset();return!0};Y.prototype.N=function(){return!0};
function Qb(a){if(a.j&&(!a.l&&a.h&&(ob(a.j,a.g,a.h,1)?a.l=!0:a.h=0),!ta(a))){if(!a.l)x("No RAM allocated");else if(a.a){if(!a.f||!a.j)return;Rb(a,a.f,a.R,a.P,a.g)?a.status('Loaded image "'+a.s+'"'):a.C('Error loading image "'+a.s+'"')}E(a)}}
Y.prototype.reset=function(){if(this.l){for(var a=this.j,b=this.g,c=this.h,d=b&16383,b=b>>>a.f;0<c&&b<a.a.length;){var e=a.a[b],f=c,h=0,g,d=d||0,h=h||0;0>h&&h>=ja&&(h+=ia);h=Math.trunc(Math.abs(h))%ia;void 0===f&&(f=e.size);for(g=d;f--&&g<e.size;g++)e.sa(d,h,e.X+d);c-=16384;b++;d=0}this.f&&Rb(this,this.f,this.R,this.P,this.g,!this.o)}};
function Rb(a,b,c,d,e,f){var h=!1,g=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,n=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(n&255)+(n>>8)),Qa=l,Gb=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(Gb)for(;Gb--;)kb(a.j,n++,b[Qa++]);else n&1?h=!0:null==d&&(d=n);g=!0}else l++;else l+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<
b.length;g++)kb(a.j,c+g,b[g]);g=!0}if(g){if(null==d||h)R(a.c),f=!1;null!=d&&(a=a.c,a.Ha=d,a.f=d%Sa,f?a.b.w?a.b.u||Q(a):a.b.G=!0:a.o&&a.b.w?R(a)||a.m.b.reset||(a.o.g(),S(a.m,-1)):!1===f&&R(a),!a.b.u&&a.ga&&a.ga.stop())}return g}I(function(){for(var a=D(document,C,"ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Y(d);B(d,c)}});
function Sb(a){u.call(this,"SerialPort",a);this.h=a.upperCase;"string"==typeof this.h&&(this.h="true"==this.h);this.g=!0;this.f=[];var b=a.binding;if("console"!=b){var c;a=Tb;b&&(void 0===c&&(c="Panel"),(c=z(c,this.id))&&(b=c.i[b])&&this.S(null,a,b))}this.a=this.l=null;this.exports={connect:this.Na,receiveData:this.qa,receiveStatus:this.nb,setConnection:this.qb}}r(Sb,u);k=Sb.prototype;
k.S=function(a,b,c){var d=this;switch(b){case Tb:return this.i[b]=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?t.Fa:t.Ta:46==c?b=t.Fa:a.ctrlKey&&c>=t.Ea&&c<=t.Wa&&(b=c-(t.Ea-t.Qa));b&&(a.preventDefault&&a.preventDefault(),d.qa(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==t.Sa&&(b=t.Ra);d.qa(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.qa(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};k.U=function(a,b,c,d){this.m=a;this.j=b;this.c=c;this.o=d;E(this)};
k.Na=function(a){if(!this.a){var b=V(this.m,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ba(c[0]);if(d!=this.ha)return;c=Ba(c[1]);if(this.a=na(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.g);if(this.l=e.receiveData){this.g=a;this.status("Connected "+this.ia+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};k.T=function(a,b){if(!b)if(this.Na(this.g),!a)this.reset();else if(!this.restore(a))return!1;return!0};
k.N=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.qa=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.f.push(b)}else this.f=this.f.concat(a);return!0};k.nb=function(){};k.qb=function(a,b){return this.a?!1:(this.a=a,this.l=b,!0)};var Tb="buffer";
I(function(){for(var a=D(document,C,"serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Sb(d);B(d,c)}});
function Ub(a,b,c){u.call(this,"Computer",a);this.b.w=!1;this.L=null;Vb(this,b);this.H=V(this,"autoPower",a,6);this.h=0;this.V=+a.busWidth||+a.buswidth;this.B=this.s=this.F=null;this.A=this.O=!1;this.v=this.l=null;this.M=this.K=!1;this.W=V(this,"url")||"";(Math.random()+.1).toString(36);this.f=Wb(this);if(this.c=z("CPU",this.id)){this.o=z("Debugger",this.id);this.j=new lb({id:this.ia+".bus",busWidth:this.V},this.c,this.o);var d,e=y(this.id);if((this.g=z("Panel",this.id))&&this.g.Y)for(b=0;b<e.length;b++)d=
e[b],d.C=this.g.C,d.J=this.g.J,d.Y=this.g.Y;this.J(L+" v1.34.0\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.U&&d.U(this,this.j,this.c,this.o);b=null;d=V(this,"resume",a);void 0!==d&&(1<d.length?b=this.s=d:this.a=parseInt(d,10));var f;if(a=V(this,"state")||(f=!0,a.state))this.F=b=a,f||(this.A=!0,this.a=Xb),this.a&&(this.v=new O(this,"1.34.0"),Z(this.v)?b=null:delete this.v);!b&&this.a&&
(b=Yb(this))&&(this.A=!0);if(b){var h=this;H(b,null,!0,function(a,b,c){c?(h.s=null,h.A=!1,h.C("Unable to load machine state from server (error "+c+(b?": "+Ba(b):"")+")")):(h.B=b,h.O=!0);E(h)})}else E(this);this.i.power||(this.H=!0);!c&&this.H&&Zb(this,this.aa)}else x("Unable to find CPU component")}r(Ub,u);function Vb(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){x(d.message+" ("+c+")")}}a.L=b}
function V(a,b,c,d){var e=b.toLowerCase(),e=Ja(b)||Ja(e);void 0===e&&a.L&&(e=a.L[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}function Zb(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ta(f)){ta(f,function(){Zb(a,b,c)});return}}b.call(a,c)}
function $b(a,b){var c=new O(a,"1.34.0",ac);if(Z(c)&&bc(c)){var d=c.get(cc),e=b?b.get(cc):"unknown";d!=e&&(a.C("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Ub.prototype;
k.aa=function(a){void 0===a&&(a=this.a||(this.B?dc:Xb));if(!this.h){this.h++;var b=!1,c=!1;this.K=!1;var d=this.v||new O(this,"1.34.0");if(a==ec)b=!0;else if(a>Xb){if(Z(d,this.B)){this.l=new O(this,"1.34.0",fc);Z(this.l)&&(gc(this,d),a=hc,ic(this.l));this.l.set(cc,Ca());jc(this.l);var e=this.a&&!this.A;if(a==dc||ma("Click OK to restore the previous "+L+" machine state, or CANCEL to reset the machine.")){if(c=bc(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?Z(d,h):("error"==f&&"no machine state"!=
h?(this.C("Error: "+h),"unable to verify user"==h&&(Ha(kc,""),this.f=null)):this.J(f+": "+h),ic(d),Z(d)?(c=bc(d),e=!0):c=!1))}e&&$b(this,c?d:null)}else a==hc&&d.clear()}else $b(this);delete this.B;delete this.v}e=y(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.c&&(c=lc(this,h,d,b,c));b=[d,a,c];a!=ec?Zb(this,this.La,b):this.La(b)}};
function lc(a,b,c,d,e){if(!b.b.w){b.b.w=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.T(f,d)&&f&&(x("Unable to restore state for "+b.type),a.F&&!a.O?(c.clear(),a.a=Xb,window&&window.location.reload()):a.K=!0,b.T(null),e=!1),!d&&b.Ia){var h=b.Ia.split("|");for(a=0;a<h.length;a++)b.status(h[a])}}catch(g){x("Error restoring state for "+b.type+" ("+g.message+")")}}return e}
k.La=function(a){var b=a[0],c=0>a[1];a=a[2];this.M=!0;this.b.w=!0;var d=this.i.power;d&&(d.textContent="Shutdown");this.c&&(lc(this,this.c,b,c,a),S(this,-2),this.c.G());this.K&&(gc(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.h=0};
function gc(a,b){if(ma("There may be a problem with your "+L+" machine.\n\nTo help us diagnose it, click OK to send this "+L+" machine state to http://www.pcjs.org.")){var c=a.W;a=a.f||"";b=b.toString();var d={};d.app=L;d.ver="1.34.0";d.url=c;d.user=a;d.type="bug";d.data=b;H("http://www.pcjs.org/api/v1/report",d,!0)}}
function mc(a,b,c){var d,e="none";if(a.h)return null;a.h--;var f=new O(a,"1.34.0"),h=new O(a,"1.34.0",ac),g=Ca();h.set(cc,g);f.set(cc,g);f.set(nc,"1.34.0");f.set(oc,window?window.location.href:null);f.set(pc,window?window.navigator.userAgent:"");a.c&&a.c.N&&(c&&(b&&(a.c.b.G=a.c.b.u),R(a.c)),d=a.c.N(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.b.w=!1,!1===d&&(e=null)));for(var g=y(a.id),l=0;l<g.length;l++){var m=g[l];m.b.w&&(m.N&&(d=m.N(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.b.w=!1,!1===
d&&(e=null)))}e&&(c?(g=d=!1,b?(a.f&&qc(a,a.f,f.toString()),jc(h)&&jc(f)||(e=null,d=g=!0)):a.a&&(d=!0,g=a.a==rc),d&&f.clear(g)):e=f.toString());c&&(a.b.w=!1,b=a.i.power)&&(b.textContent="Power");a.h=0;return e}k.reset=function(){this.b.reset=!0;this.j&&this.j.reset&&this.j.reset();this.c&&this.c.reset&&this.c.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.j&&c!==this.c&&c.reset&&c.reset()}this.b.reset=!1;S(this,-1)};
k.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}S(this,-1)};k.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}S(this,-1)};
function S(a,b){if(a.c){var c=a.c,d=b||0,e=c.i.speed;e&&(0>=d||30<=(c.ua+=d))&&(e.textContent=c.b.u?c.F.toFixed(2)+"Mhz":"Stopped",c.ua=0)}if(a.g&&(a=a.g,b=b||0,a.B)){c=a.c.b.u;d=!!(a.c.a&8);if(0>=b||60<=(a.A+=b)){e=a.c.f;if(a.i.PC){var f=a.o&&a.o.l||8,e=e||0,e=8==f?va(e,void 0):F(e,void 0);a.i.PC.textContent!=e&&(a.i.PC.textContent=e)}a.A=0}-1>b?a.f=a.c.f:0<b&&c&&!d&&(a.f=a.c.V);P(a,a.f);M(a,a.h)}}
k.S=function(a,b,c){var d=this;switch(b){case "power":return this.i[b]=c,c.onclick=function(){d.h||(d.b.w?mc(d,!1,!0):Zb(d,d.aa))},!0;case "reset":return this.i[b]=c,c.onclick=function(){if(d.b.w&&!d.h)if(d.a&&!d.s){var a=ma("Click OK to save changes to this "+L+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");mc(d,a,!0);!a&&d.F?window&&window.location.reload():d.aa(Xb)}else d.reset(),d.c&&!d.o&&d.c.G()},!0;case "save":if(ya())c.parentNode.removeChild(c);else return this.i[b]=
c,c.onclick=function(){var a=Wb(d,!0);if(a){var b=!!(d.a&&!d.s||d.F),c=mc(d,b);b?qc(d,a,c):d.C("Resume disabled, machine state not saved")}},!0}return!1};function Wb(a,b){var c=a.f;c||((c=Ga(kc),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=sc(a,c))||a.C("The user ID is invalid.")):b&&a.C("Browser local storage is not available"));return c}
function sc(a,b){a.f=null;b=H(G()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ha(kc,b.data),a.f=b.data)}catch(d){x(d.message+" ("+c+")")}return a.f}function Yb(a){var b=null;a.f&&(b=G()+"/api/v1/user?req=load&user="+a.f+"&state="+tc(a,"1.34.0"));return b}
function qc(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=tc(a,"1.34.0");d.data=c;b=H(G()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.C("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.C(c),Ha(kc,""),a.f=null)}}
var fc="failsafe",ac="validate",cc="timestamp",nc="version",oc="url",pc="browser",kc="user",ec=-1,Xb=0,dc=1,hc=2,rc=3;I(function(){for(var a=D(document,C+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,C,"computer"),e=0;e<c.length;e++){var f=c[e],h=A(f),h=new Ub(h,d,!0);B(h,f);h.H&&Zb(h,h.aa)}});J.show.push(function(){for(var a=D(document,C,"computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.M&&!c.b.w&&c.aa(ec)}});
J.exit.push(function(){for(var a=D(document,C,"computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.b.w&&mc(c,!(!c.a||c.s),!0)}});function O(a,b,c){this.id=a.id;this.i="";this.c={};this.j=this.m=!1;this.key=tc(a,b,c);ic(this,a.Va)}k=O.prototype;k.set=function(a,b){try{this.c[a]=b}catch(c){}};k.get=function(a){return this.c[a]||null};k.data=function(){return this.c};function Z(a,b){return b?(a.i=b,a.j=!0,a.m=!1,!0):a.j?!0:Ea()&&(b=Ga(a.key))?(a.i=b,a.j=!0):!1}
function bc(a){var b=!0;if(!a.m)try{a.c=JSON.parse(a.i),a.m=!0}catch(c){x(c.message||c),b=!1}return b}function jc(a){var b=!0;if(Ea()){var c=JSON.stringify(a.c);Ha(a.key,c)||(x("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}k.toString=function(){return this.c?JSON.stringify(this.c):this.i};function ic(a,b){a.i="";a.c={};a.j=a.m=!1;b&&a.set("parms",b)}
k.clear=function(a){ic(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function tc(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var uc=0;
function vc(a,b,c,d,e,f){e("Loading "+a+"...");H(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):wc(g,a,b,c,d,e,f)})}
function wc(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{c&&(ka(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?e?xc(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
function xc(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");H(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=g[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);g[0]!=l&&(h=h.replace(g[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);xc(a,b,c)}})}else c(a,null)}
function yc(a,b,c,d){function e(a){if(void 0===g){var b=h&&D(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=za(a))}function f(a){e("Error: "+a);l&&(--uc||K(!0));l=!1}var h,g,l=!0;uc++;la[a]={};try{if(h=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";n.styleSheet?n.styleSheet.cssText=m:n.appendChild(document.createTextNode(m));p.appendChild(n)}c||
(c="/versions/pdpjs/1.34.0/components.xsl");m=function(d,g){g?vc(c,null,null,!1,e,function(d,l){l?(ka(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=g.transformNode(l))?(h.outerHTML=l,--uc||K(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--uc||K(!0)):f("invalid machine element: "+a):
f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?vc(b,a,d,!0,e,m):wc(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(Qa){f(Qa.message)}return l}window.embedPDP11=function(a,b,c,d){K(!1);return yc(a,b,c,d)};window.findMachineComponent=function(a,b){return z(b,a+".machine")};
window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!pa[a]){for(var c=!0,d=pa,e=a,f=b.length,h=[],g=[],l="",m=null,p=0;p<f;p++){var n=b[p];if('"'==n||"'"==n)m&&n!=m?l+=n:(m?m=null:m=n,l&&(g.push(l),l=""));else{if(!m){if("\r"==n||"\n"==n)n=";";if(" "==n||"\t"==n||";"==n){l&&(g.push(l),l="");";"==n&&g.length&&(h.push(g),g=[]);continue}}l+=n}}l&&g.push(l);g.length&&h.push(g);d[e]=h;oa(a)||(c=!1)}return c};window.enableEvents=K;window.sendEvent=Pa;})();//# sourceMappingURL=/tmp/pdpjs/1.34.0/pdp10.map

View file

@ -292,7 +292,7 @@ case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d
function zj(a,b,c){var d;if(b){b=Aj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],q=n.length,n=Ya(n);if(!n){f=!0;break}n=Bj(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],t=n.length;l.length&&Cj[n]<Cj[l[l.length-1]]&&yj(k,l,1);l.push(n);b=b.substr(q+t)}yj(k,l)&&1==k.length||(f=!0);f?c&&a.v("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&Dj(a,null,
d))}return d}function Aj(a,b){for(var c,d=a.ia?"(":"{",e=a.ia?")":"}",f=new RegExp(a.ia?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=zj(a,c[1]);b=b.replace(d+c[1]+e,null!=g?K(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
function Bj(a,b,c,d){var e;null!=b?(e=a.qe(b),0<=e?e=a.re(e):(e=a.S[b],null==e&&(e=Ka(b,a.Ba))),null!=e||d||a.v("invalid "+(c?c:"value")+": "+b)):d||a.v("missing "+(c||"value"));return e}function Dj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=La(d&255,8)+g,d>>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e}
function Ej(a,b){if(b)return Dj(a,b,a.S[b]);var c=0;for(b in a.S)Dj(a,b,a.S[b]),c++;return 0<c}function K(a,b,c,d){switch(a.Ba){case 8:a=E(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=F(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var Cj={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Ej(a,b){if(b)return Dj(a,b,a.S[b]);var c=0;for(b in a.S)Dj(a,b,a.S[b]),c++;return 0<c}function K(a,b,c,d){c=void 0===c?0:c;switch(a.Ba){case 8:a=E(b,3*c);break;case 10:a=b.toString();break;default:a=F(b,2*c)}(void 0===d?0:d)?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var Cj={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
function Fj(a){wj.call(this,a);this.Ga=!1;this.ia=!0;this.G=X();this.xa=X();this.N=X();this.B=[];this.g=this.L=this.C=[];Gj(this);this.P=this.Y=0;this.i=[];this.pa=void 0;Hj(this);this.F=this;this.ka={};this.ha=this.je=0;this.R=null;this.M=[];Ij(this,a.messages);this.ta=a.commands;this.Ja=Jj;this.W=[];this.I=0;this.Ka=this.qa=null;this.w=this.Ia=this.Ha=this.X=this.la=0;this.b=this.U=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return ke(b,a)}):void 0===global[w]&&(global[w]=
function(a){return ke(b,a)})}p(Fj,wj);function Kj(a){a=a&&a.K;null==a&&(a=-1);return a}function X(a,b,c){return{K:void 0===a?null:a,Ma:void 0===b?!1:b,Va:!1,Ba:c}}h=Fj.prototype;h.Fd=function(a,b){a.K=b;a.Va=!1;a.Ba=void 0;return a};function Lj(a){return[a.K,a.Ma,a.Ba,a.Va,a.Pc]}function Mj(a,b){var c=X(b[0],b[1],b[2]);c.Va=b[3];b[4]&&(c.ge=xj(a,c.Pc=b[4]));return c}
h.Aa=function(a,b,c,d){this.D=b;this.J=a;this.f=c;this.b=a.i;(a=fe(a,"messages"))&&Ij(this,a);1140>this.f.ka&&(this.W=this.W.concat(Nj));1145>this.f.ka&&(this.W=this.W.concat(Oj));qd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=Kj(Pj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."):