Minor annotation and name changes; the PDP11 emulator "branded" as PDP11js now, since PDP11 is too generic
This commit is contained in:
parent
f0d18af735
commit
483d247491
13 changed files with 137 additions and 135 deletions
|
|
@ -806,8 +806,8 @@ Ma.exit.push(function(){for(var a=pb(document,"pcx86","computer"),b=0;b<a.length
|
|||
lf.prototype={constructor:lf,value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.A=!0):this.A?!0:Ea()&&(a=Fa(this.key))?(this[this.id]=a,this.A=!0):!1},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Yr(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 Yr(a,b){a[a.id]={};b&&N(a,"parms",b);a.A=!1}function Zr(a){var b=!0;if(Ea()){var c=JSON.stringify(a[a.id]);Ga(a.key,c)||(w("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Vr(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){w(c.message||c),b=!1}return b}function Wr(a,b){return a[a.id][b]||null}function N(a,b,c){try{a[a.id][b]=c}catch(d){}}var ds=0;
|
||||
function es(a,b,c,d,e,f){e("Loading "+a+"...");xa(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):fs(h,a,b,c,d,e,f)})}
|
||||
function fs(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){hb(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));
|
||||
h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){h=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?rs(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function fs(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){hb(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PCx86$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){h=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?rs(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function rs(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");xa(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],l,n=/( [a-z]+=)(['"])(.*?)\2/g;l=n.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);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);rs(a,b,c)}})}else c(a,null)}
|
||||
function ss(a,b,c,d){function e(a){if(void 0===h){var b=g&&pb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=la(a))}function f(a){e("Error: "+a);k&&(--ds||Ua(!0));k=!1}var g,h,k=!0;ds++;gb[a]={};try{if(g=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=l:q.appendChild(document.createTextNode(l));n.appendChild(q)}c||
|
||||
|
|
|
|||
|
|
@ -626,8 +626,8 @@ Ca.exit.push(function(){for(var a=bb(document,"pcx86","computer"),b=0;b<a.length
|
|||
ee.prototype={constructor:ee,value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.A=!0):this.A?!0:xa()&&(a=ya(this.key))?(this[this.id]=a,this.A=!0):!1},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){vn(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 vn(a,b){a[a.id]={};b&&C(a,"parms",b);a.A=!1}function wn(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function sn(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function tn(a,b){return a[a.id][b]||null}function C(a,b,c){try{a[a.id][b]=c}catch(d){}}var Cn=0;
|
||||
function Dn(a,b,c,d,e,f){e("Loading "+a+"...");ra(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):En(h,a,b,c,d,e,f)})}
|
||||
function En(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){Va(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));
|
||||
h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(x){h=null,a=x.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?Fn(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function En(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){Va(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PCx86$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(x){h=null,a=x.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?Fn(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Fn(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ra(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,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.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);Fn(a,b,c)}})}else c(a,null)}
|
||||
function Gn(a,b,c,d){function e(a){if(void 0===h){var b=g&&bb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ja(a))}function f(a){e("Error: "+a);k&&(--Cn||Ja(!0));k=!1}var g,h,k=!0;Cn++;Ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],x=document.createElement("style");x.type="text/css";x.styleSheet?x.styleSheet.cssText=m:x.appendChild(document.createTextNode(m));n.appendChild(x)}c||
|
||||
|
|
|
|||
|
|
@ -73,28 +73,15 @@ function CPUStatePDP11(parmsCPU)
|
|||
|
||||
CPUPDP11.call(this, parmsCPU, nCyclesDefault);
|
||||
|
||||
/*
|
||||
* Initialize processor operation to match the requested model
|
||||
*/
|
||||
this.initProcessor();
|
||||
|
||||
/*
|
||||
* A variety of stepCPU() state variables that don't strictly need to be initialized before the first
|
||||
* stepCPU() call, but it's good form to do so.
|
||||
*/
|
||||
this.resetCycles();
|
||||
this.flags.fComplete = this.flags.fDebugCheck = false;
|
||||
|
||||
/*
|
||||
* If there are no live registers to display, then updateStatus() can skip a bit....
|
||||
*/
|
||||
this.cLiveRegs = 0;
|
||||
|
||||
/*
|
||||
* This initRegs() call is important to create all the registers, so that if/when we call restore(),
|
||||
* it will have something to fill in.
|
||||
* Initialize processor operation to match the requested model
|
||||
*/
|
||||
this.initRegs();
|
||||
this.initProcessor();
|
||||
}
|
||||
|
||||
Component.subclass(CPUStatePDP11, CPUPDP11);
|
||||
|
|
@ -113,6 +100,13 @@ Component.subclass(CPUStatePDP11, CPUPDP11);
|
|||
CPUStatePDP11.prototype.initProcessor = function()
|
||||
{
|
||||
this.aOps = PDP11.aOpsPDP1170;
|
||||
this.initRegs();
|
||||
/*
|
||||
* A variety of stepCPU() state variables that don't strictly need to be initialized before the first
|
||||
* stepCPU() call, but it's good form to do so.
|
||||
*/
|
||||
this.resetCycles();
|
||||
this.flags.fComplete = this.flags.fDebugCheck = false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -269,7 +263,6 @@ CPUStatePDP11.prototype.setBinding = function(sHTMLType, sBinding, control, sVal
|
|||
switch (sBinding) {
|
||||
case "PC":
|
||||
case "PSW":
|
||||
case "IF":
|
||||
case "SF":
|
||||
case "ZF":
|
||||
case "CF":
|
||||
|
|
@ -298,11 +291,11 @@ CPUStatePDP11.prototype.clearCF = function()
|
|||
* getCF()
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @return {number} 0 or 1 (PDP11.PS.CF)
|
||||
* @return {number} 0 or 1 (PDP11.PSW.CF)
|
||||
*/
|
||||
CPUStatePDP11.prototype.getCF = function()
|
||||
{
|
||||
return (this.resultZeroCarry & 0x100)? PDP11.PS.CF : 0;
|
||||
return (this.resultZeroCarry & 0x100)? PDP11.PSW.CF : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -340,11 +333,11 @@ CPUStatePDP11.prototype.clearZF = function()
|
|||
* getZF()
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @return {number} 0 or PDP11.PS.ZF
|
||||
* @return {number} 0 or PDP11.PSW.ZF
|
||||
*/
|
||||
CPUStatePDP11.prototype.getZF = function()
|
||||
{
|
||||
return (this.resultZeroCarry & 0xff)? 0 : PDP11.PS.ZF;
|
||||
return (this.resultZeroCarry & 0xff)? 0 : PDP11.PSW.ZF;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -371,11 +364,11 @@ CPUStatePDP11.prototype.clearSF = function()
|
|||
* getSF()
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @return {number} 0 or PDP11.PS.SF
|
||||
* @return {number} 0 or PDP11.PSW.SF
|
||||
*/
|
||||
CPUStatePDP11.prototype.getSF = function()
|
||||
{
|
||||
// return (this.resultParitySign & 0x80)? PDP11.PS.SF : 0;
|
||||
// return (this.resultParitySign & 0x80)? PDP11.PSW.SF : 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
|
@ -419,7 +412,7 @@ CPUStatePDP11.prototype.setPC = function(addr)
|
|||
*/
|
||||
CPUStatePDP11.prototype.getPSW = function()
|
||||
{
|
||||
return (this.PSW & ~PDP11.PS.RESULT) | (this.getSF() | this.getZF() | this.getCF());
|
||||
return (this.PSW & ~PDP11.PSW.RESULT) | (this.getSF() | this.getZF() | this.getCF());
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -513,11 +506,11 @@ CPUStatePDP11.prototype.updateStatus = function(fForce)
|
|||
{
|
||||
if (this.cLiveRegs) {
|
||||
if (fForce || !this.flags.fRunning || this.flags.fDisplayLiveRegs) {
|
||||
var regPS = this.getPSW();
|
||||
this.updateReg("PSW", regPS, 4);
|
||||
this.updateReg("SF", (regPS & PDP11.PS.SF)? 1 : 0, 1);
|
||||
this.updateReg("ZF", (regPS & PDP11.PS.ZF)? 1 : 0, 1);
|
||||
this.updateReg("CF", (regPS & PDP11.PS.CF)? 1 : 0, 1);
|
||||
var regPSW = this.getPSW();
|
||||
this.updateReg("PSW", regPSW, 4);
|
||||
this.updateReg("SF", (regPSW & PDP11.PSW.SF)? 1 : 0, 1);
|
||||
this.updateReg("ZF", (regPSW & PDP11.PSW.ZF)? 1 : 0, 1);
|
||||
this.updateReg("CF", (regPSW & PDP11.PSW.CF)? 1 : 0, 1);
|
||||
}
|
||||
}
|
||||
var controlSpeed = this.bindings["speed"];
|
||||
|
|
@ -535,10 +528,11 @@ CPUStatePDP11.prototype.updateStatus = function(fForce)
|
|||
* If the current state is WAIT (runState === 2) then skip any delay and
|
||||
* go into RUN state.
|
||||
*
|
||||
* @param delay
|
||||
* @param priority
|
||||
* @param vector
|
||||
* @param callback
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} delay
|
||||
* @param {number} priority
|
||||
* @param {number} vector
|
||||
* @param {function()} callback
|
||||
*/
|
||||
CPUStatePDP11.prototype.interrupt = function(delay, priority, vector, callback)
|
||||
{
|
||||
|
|
@ -603,14 +597,14 @@ CPUStatePDP11.prototype.writePSW = function(newPSW)
|
|||
for (i = 0; i < 6; i++) {
|
||||
j = this.registerVal[i];
|
||||
this.registerVal[i] = this.registerAlt[i];
|
||||
this.registerAlt[i] = j; // swap to alternate register set
|
||||
this.registerAlt[i] = j; // swap to alternate register set
|
||||
}
|
||||
}
|
||||
if ((this.mmuMode = (newPSW >> 14) & 3) !== (j = (this.PSW >> 14) & 3)) {
|
||||
if ((this.mmuMode = (newPSW >> 14) & 3) !== ((this.PSW >> 14) & 3)) {
|
||||
this.stackPointer[j] = this.registerVal[6];
|
||||
this.registerVal[6] = this.stackPointer[this.mmuMode]; // swap to new mode SP
|
||||
}
|
||||
this.priorityReview = 2; // trigger check of priority levels
|
||||
this.priorityReview = 2; // trigger check of priority levels
|
||||
this.PSW = newPSW;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -39,13 +39,14 @@
|
|||
var APPCLASS = "pdp11"; // 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 = "PDP11"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
|
||||
var APPNAME = "PDP11js"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
|
||||
|
||||
/**
|
||||
* @define {boolean}
|
||||
*
|
||||
* 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
|
||||
|
|
@ -55,16 +56,18 @@ var APPNAME = "PDP11"; // this @define is the default application name
|
|||
* 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
|
||||
|
||||
/**
|
||||
* @define {boolean}
|
||||
*
|
||||
* BYTEARRAYS is a Closure Compiler compile-time option that allocates an Array of numbers for every Memory block,
|
||||
* where each a number represents ONE byte; very wasteful, but potentially slightly faster.
|
||||
*
|
||||
* See the Memory component for details.
|
||||
*
|
||||
* @define {boolean}
|
||||
*/
|
||||
var BYTEARRAYS = false;
|
||||
|
||||
|
|
@ -121,9 +124,9 @@ var PDP11 = {
|
|||
ADDR_INVALID: -1,
|
||||
|
||||
/*
|
||||
* Processor Status flag definitions (stored in regPS)
|
||||
* Processor Status flag definitions (stored in regPSW)
|
||||
*/
|
||||
PS: {
|
||||
PSW: {
|
||||
CF: 0x0001, // bit 0: Carry Flag
|
||||
OF: 0x0002, // bit 1: Overflow Flag
|
||||
ZF: 0x0004, // bit 2: Zero Flag
|
||||
|
|
@ -165,10 +168,10 @@ var PDP11 = {
|
|||
};
|
||||
|
||||
/*
|
||||
* PS "arithmetic" flags are NOT stored in the PS register; they are maintained across separate result registers,
|
||||
* PSW "arithmetic" flags are NOT stored in the PSW register; they are maintained across separate result registers,
|
||||
* hence the RESULT designation.
|
||||
*/
|
||||
PDP11.PS.RESULT = (PDP11.PS.CF | PDP11.PS.ZF | PDP11.PS.SF);
|
||||
PDP11.PSW.RESULT = (PDP11.PSW.CF | PDP11.PSW.ZF | PDP11.PSW.SF);
|
||||
|
||||
if (NODE) {
|
||||
global.APPCLASS = APPCLASS;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
if (NODE) {
|
||||
var Component = require("./component");
|
||||
var str = require("./strlib");
|
||||
var web = require("./weblib");
|
||||
var str = require("./strlib");
|
||||
var web = require("./weblib");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -55,7 +55,7 @@ var fAsync = true;
|
|||
var cAsyncMachines = 0;
|
||||
|
||||
/**
|
||||
* loadXML(sFile, idMachine, sAppClass, sParms, fResolve, display, done)
|
||||
* loadXML(sFile, idMachine, sAppName, sAppClass, sParms, fResolve, display, done)
|
||||
*
|
||||
* This is the preferred way to load all XML and XSL files. It uses getResource()
|
||||
* to load them as strings, which parseXML() can massage before parsing/transforming them.
|
||||
|
|
@ -80,13 +80,14 @@ var cAsyncMachines = 0;
|
|||
*
|
||||
* @param {string} sXMLFile
|
||||
* @param {string|null|undefined} idMachine
|
||||
* @param {string|null|undefined} sAppName
|
||||
* @param {string|null|undefined} sAppClass
|
||||
* @param {string|null|undefined} sParms
|
||||
* @param {boolean} fResolve is true to resolve any "ref" attributes
|
||||
* @param {function(string)} display
|
||||
* @param {function(string,Object)} done (string contains the unparsed XML string data, and Object contains a parsed XML object)
|
||||
*/
|
||||
function loadXML(sXMLFile, idMachine, sAppClass, sParms, fResolve, display, done)
|
||||
function loadXML(sXMLFile, idMachine, sAppName, sAppClass, sParms, fResolve, display, done)
|
||||
{
|
||||
var doneLoadXML = function(sURLName, sXML, nErrorCode) {
|
||||
if (nErrorCode) {
|
||||
|
|
@ -94,14 +95,14 @@ function loadXML(sXMLFile, idMachine, sAppClass, sParms, fResolve, display, done
|
|||
done(sXML, null);
|
||||
return;
|
||||
}
|
||||
parseXML(sXML, sXMLFile, idMachine, sAppClass, sParms, fResolve, display, done);
|
||||
parseXML(sXML, sXMLFile, idMachine, sAppName, sAppClass, sParms, fResolve, display, done);
|
||||
};
|
||||
display("Loading " + sXMLFile + "...");
|
||||
web.getResource(sXMLFile, null, fAsync, doneLoadXML);
|
||||
}
|
||||
|
||||
/**
|
||||
* parseXML(sXML, sXMLFile, idMachine, sAppClass, sParms, fResolve, display, done)
|
||||
* parseXML(sXML, sXMLFile, idMachine, sAppName, sAppClass, sParms, fResolve, display, done)
|
||||
*
|
||||
* Generates an XML document from an XML string. This function also provides a work-around for XSLT's
|
||||
* lack of support for the document() function (at least on some browsers), by replacing every reference
|
||||
|
|
@ -110,13 +111,14 @@ function loadXML(sXMLFile, idMachine, sAppClass, sParms, fResolve, display, done
|
|||
* @param {string} sXML
|
||||
* @param {string|null} sXMLFile
|
||||
* @param {string|null|undefined} idMachine
|
||||
* @param {string|null|undefined} sAppName
|
||||
* @param {string|null|undefined} sAppClass
|
||||
* @param {string|null|undefined} sParms
|
||||
* @param {boolean} fResolve is true to resolve any "ref" attributes; default is false
|
||||
* @param {function(string)} display
|
||||
* @param {function(string,Object)} done (string contains the unparsed XML string data, and Object contains a parsed XML object)
|
||||
*/
|
||||
function parseXML(sXML, sXMLFile, idMachine, sAppClass, sParms, fResolve, display, done)
|
||||
function parseXML(sXML, sXMLFile, idMachine, sAppName, sAppClass, sParms, fResolve, display, done)
|
||||
{
|
||||
var buildXML = function(sXML, sError) {
|
||||
if (sError) {
|
||||
|
|
@ -166,7 +168,6 @@ function parseXML(sXML, sXMLFile, idMachine, sAppClass, sParms, fResolve, displa
|
|||
* I'm trying to switch to a shared components.xsl (at least for all PC-class machines),
|
||||
* but in the interim, that means hacking the XSL file on the fly to reflect the actual class.
|
||||
*/
|
||||
var sAppName = sAppClass.toUpperCase().replace("X86", "x86").replace("JS", "js");
|
||||
sXML = sXML.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/, "$1" + sAppName + "$2");
|
||||
sXML = sXML.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/, "$1" + sAppClass + "$2");
|
||||
|
||||
|
|
@ -329,11 +330,12 @@ function resolveXML(sXML, display, done)
|
|||
}
|
||||
|
||||
/**
|
||||
* embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
||||
* embedMachine(sAppName, sAppClass, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
||||
*
|
||||
* This allows to you embed a machine on a web page, by transforming the machine XML into HTML.
|
||||
*
|
||||
* @param {string} sName is the app name (eg, "PCjs")
|
||||
* @param {string} sAppName is the app name (eg, "PCx86")
|
||||
* @param {string} sAppClass is the app class (eg, "pcx86"); also known as the machine class
|
||||
* @param {string} sVersion is the app version (eg, "1.15.7")
|
||||
* @param {string} idMachine
|
||||
* @param {string} sXMLFile
|
||||
|
|
@ -341,7 +343,7 @@ function resolveXML(sXML, display, done)
|
|||
* @param {string} [sParms]
|
||||
* @return {boolean} true if successful, false if error
|
||||
*/
|
||||
function embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
||||
function embedMachine(sAppName, sAppClass, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
||||
{
|
||||
var eMachine, eWarning, fSuccess = true;
|
||||
|
||||
|
|
@ -402,7 +404,6 @@ function embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
|||
head.appendChild(style);
|
||||
}
|
||||
|
||||
var sAppClass = sName.toLowerCase(); // eg, "pcx86" or "c1pjs"
|
||||
if (!sXSLFile) {
|
||||
/*
|
||||
* Now that PCjs is an open-source project, we can make the following test more flexible,
|
||||
|
|
@ -518,13 +519,13 @@ function embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
|||
displayError("unable to transform XML: unsupported browser");
|
||||
}
|
||||
};
|
||||
loadXML(sXSLFile, null, sAppClass, null, false, displayMessage, transformXML);
|
||||
loadXML(sXSLFile, null, sAppName, sAppClass, null, false, displayMessage, transformXML);
|
||||
};
|
||||
|
||||
if (sXMLFile.charAt(0) != '<') {
|
||||
loadXML(sXMLFile, idMachine, sAppClass, sParms, true, displayMessage, processXML);
|
||||
loadXML(sXMLFile, idMachine, sAppName, sAppClass, sParms, true, displayMessage, processXML);
|
||||
} else {
|
||||
parseXML(sXMLFile, null, idMachine, sAppClass, sParms, false, displayMessage, processXML);
|
||||
parseXML(sXMLFile, null, idMachine, sAppName, sAppClass, sParms, false, displayMessage, processXML);
|
||||
}
|
||||
} else {
|
||||
displayError("missing machine element: " + idMachine);
|
||||
|
|
@ -546,7 +547,7 @@ function embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
|
|||
function embedC1P(idMachine, sXMLFile, sXSLFile)
|
||||
{
|
||||
if (fAsync) web.enablePageEvents(false);
|
||||
return embedMachine("C1Pjs", APPVERSION, idMachine, sXMLFile, sXSLFile);
|
||||
return embedMachine("C1Pjs", "c1pjs", APPVERSION, idMachine, sXMLFile, sXSLFile);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -561,7 +562,7 @@ function embedC1P(idMachine, sXMLFile, sXSLFile)
|
|||
function embedPCx86(idMachine, sXMLFile, sXSLFile, sParms)
|
||||
{
|
||||
if (fAsync) web.enablePageEvents(false);
|
||||
return embedMachine("PCx86", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
|
||||
return embedMachine("PCx86", "pcx86", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -576,7 +577,7 @@ function embedPCx86(idMachine, sXMLFile, sXSLFile, sParms)
|
|||
function embedPC8080(idMachine, sXMLFile, sXSLFile, sParms)
|
||||
{
|
||||
if (fAsync) web.enablePageEvents(false);
|
||||
return embedMachine("PC8080", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
|
||||
return embedMachine("PC8080", "pc8080", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -591,12 +592,11 @@ function embedPC8080(idMachine, sXMLFile, sXSLFile, sParms)
|
|||
function embedPDP11(idMachine, sXMLFile, sXSLFile, sParms)
|
||||
{
|
||||
if (fAsync) web.enablePageEvents(false);
|
||||
return embedMachine("PDP11", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
|
||||
return embedMachine("PDP11js", "pdp11", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the Closure Compiler from renaming functions we want to export,
|
||||
* by adding them as (named) properties of a global object.
|
||||
* Prevent the Closure Compiler from renaming functions we want to export, by adding them as global properties.
|
||||
*/
|
||||
if (APPNAME == "C1Pjs") {
|
||||
window['embedC1P'] = embedC1P;
|
||||
|
|
@ -608,7 +608,7 @@ if (APPNAME == "PCx86") {
|
|||
if (APPNAME == "PC8080") {
|
||||
window['embedPC8080'] = embedPC8080;
|
||||
}
|
||||
if (APPNAME == "PDP11") {
|
||||
if (APPNAME == "PDP11js") {
|
||||
window['embedPDP11'] = embedPDP11;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,10 +157,11 @@ Z.prototype.start=function(){for(var a in this.Y)if("cpu"!=a)for(var b=0;b<this.
|
|||
function yb(a){var b=null,c;for(c in a.Y)for(var d=0;d<a.Y[c].length;d++){var e=a.Y[c][d];if(e){if(!K(e)){K(e,function(a){return function(){yb(a)}}(a));return}"cpu"==c?b=e:e.ia&&e.ia(!0,a)}}a.X();a.l("C1Pjs v1.24.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>");b&&b.ia(!0,a)}
|
||||
x(function(){for(var a=G(document,"c1pjs","computer"),b=0;b<a.length;b++){for(var c=a[b],d=E(c),e,g={},h,k=0,l=0,m=0;m<d.modules.length;m++){var n=d.modules[m];if(!m){if("cpu"!=n.type)break;k=n.start;l=n.end;h=Array(l+1-k);for(e=k;e<h.length;e++)h[e]=0}if(e=ta(n.refID,d.id)){var y=n.type;void 0===g[y]&&(g[y]=[]);g[y].push(e);e.ba&&void 0!==n.start&&e.ba(h,n.start,n.end,g.cpu[0])}else{u('no component for <module refid="'+n.refID+'">');return}}if(void 0===h){u('<module type="cpu"> definition must appear first in the <computer> specification');
|
||||
break}if(e=ta("debugger",d.id))g["debugger"]=[e],e.ba&&e.ba(h,k,l,g.cpu[0]);k=new Z(d,g);if(l=ta("panel",d.id))if(g.panel=[l],l.hb){e=d.id;d=void 0;g=[];e&&(e=0<(d=e.indexOf("."))?e.substr(0,d+1):"");for(d=0;d<B.length;d++)m=B[d],e&&m.id.indexOf(e)||g.push(m);d=g;for(g=0;g<d.length;g++)e=d[g],e!=l&&(e.$a=l.$a,e.l=l.l,e.hb=l.hb)}F(k,c);yb(k)}});var zb=0;function Ab(a,b,c,d,e,g){e("Loading "+a+"...");t(a,function(h,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),g(k,null)):Cb(k,a,b,c,d,e,g)})}
|
||||
function Cb(a,b,c,d,e,g,h){function k(a,g){if(g)h(g,null);else{if(c){D[c]&&b&&(D[c][b]=a);var k=b;k&&0>k.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(k=window.location.pathname+k);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+k+'"}';"object"==typeof resources&&(k=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(k?' url="'+k+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,
|
||||
"$1c1pjs$2"));k=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(k=new window.ActiveXObject("Microsoft.XMLDOM"),k.async=!1,k.loadXML(a)):k=(new window.DOMParser).parseFromString(a,"text/xml")}catch(y){k=null,a=y.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,k)}}a?e?Db(a,g,k):k(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Db(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");t(e,function(g,h,k){if(k||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(g=d[3])if(k=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(h=h.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);Db(a,b,c)}})}else c(a,null)}
|
||||
function Cb(a,b,c,d,e,g,h){function k(a,g){if(g)h(g,null);else{if(c){D[c]&&b&&(D[c][b]=a);var k=b;k&&0>k.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(k=window.location.pathname+k);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+k+'"}';"object"==typeof resources&&(k=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(k?' url="'+k+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,
|
||||
"$1C1Pjs$2"),a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1c1pjs$2"));k=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(k=new window.ActiveXObject("Microsoft.XMLDOM"),k.async=!1,k.loadXML(a)):k=(new window.DOMParser).parseFromString(a,"text/xml")}catch(y){k=null,a=y.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,k)}}a?e?Db(a,g,k):k(a,null):h("no data"+(b?" for file: "+
|
||||
b:""),null)}
|
||||
function Db(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");t(e,function(g,h,k){if(k||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(g=d[3])if(k=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(h=h.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
||||
a=a.replace(d[0],h);Db(a,b,c)}})}else c(a,null)}
|
||||
function Eb(a,b,c){function d(a){if(void 0===h){var b=g&&G(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=da(a))}function e(a){d("Error: "+a);k&&(--zb||z(!0));k=!1}var g,h,k=!0;zb++;D[a]={};try{if(g=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var m=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";n.styleSheet?n.styleSheet.cssText=l:n.appendChild(document.createTextNode(l));m.appendChild(n)}c||(c=
|
||||
"/versions/c1pjs/1.24.2/components.xsl");l=function(h,k){k?Ab(c,null,null,!1,d,function(h,l){if(l)if(D[a]&&c&&(D[a][c]=h),d("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var m=k.transformNode(l);m?(g.outerHTML=m,--zb||z(!0)):e("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(m=new XSLTProcessor,m.importStylesheet(l),(m=m.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--zb||z(!0)):e("invalid machine element: "+
|
||||
a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser");else e(h)}):e(h)};"<"!=b.charAt(0)?Ab(b,a,void 0,!0,d,l):Cb(b,null,a,void 0,!1,d,l)}else e("missing machine element: "+a)}catch(y){e(y.message)}return k}window.embedC1P=function(a,b,c){z(!1);return Eb(a,b,c)};window.enableEvents=z;window.sendEvent=ma;})();
|
||||
|
|
|
|||
|
|
@ -118,10 +118,11 @@ Y.prototype.reset=function(a){var b=null,c;for(c in this.M)for(var d=0;d<this.M[
|
|||
Y.prototype.J=function(a,b,c){switch(b){case "reset":return this.A[b]=c,c.onclick=function(a){return function(){a.reset()}}(this),!0}return!1};function L(a,b){return a.M[b]?a.M[b][0]:null}function ab(a){var b=null,c;for(c in a.M)for(var d=0;d<a.M[c].length;d++){var f=a.M[c][d];if(f){if(!J(f)){J(f,function(a){return function(){ab(a)}}(a));return}"cpu"==c?b=f:f.$&&f.$(!0,a)}}a.N();a.F("C1Pjs v1.24.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>");b&&b.$(!0,a)}
|
||||
y(function(){for(var a=I(document,"c1pjs","computer"),b=0;b<a.length;b++){for(var c=a[b],d=G(c),f,g={},k,h=0,l=0,m=0;m<d.modules.length;m++){var n=d.modules[m];if(!m){if("cpu"!=n.type)break;h=n.start;l=n.end;k=Array(l+1-h);for(f=h;f<k.length;f++)k[f]=0}if(f=F(n.refID,d.id)){var u=n.type;void 0===g[u]&&(g[u]=[]);g[u].push(f);f.X&&void 0!==n.start&&f.X(k,n.start,n.end,g.cpu[0])}else{t('no component for <module refid="'+n.refID+'">');return}}if(void 0===k){t('<module type="cpu"> definition must appear first in the <computer> specification');
|
||||
break}if(f=F("debugger",d.id))g["debugger"]=[f],f.X&&f.X(k,h,l,g.cpu[0]);h=new Y(d,g);if(l=F("panel",d.id))if(g.panel=[l],l.za){f=d.id;d=void 0;g=[];f&&(f=0<(d=f.indexOf("."))?f.substr(0,d+1):"");for(d=0;d<C.length;d++)m=C[d],f&&m.id.indexOf(f)||g.push(m);d=g;for(g=0;g<d.length;g++)f=d[g],f!=l&&(f.wa=l.wa,f.F=l.F,f.za=l.za)}H(h,c);ab(h)}});var Z=0;function bb(a,b,c,d,f,g){f("Loading "+a+"...");r(a,function(k,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),g(h,null)):cb(h,a,b,c,d,f,g)})}
|
||||
function cb(a,b,c,d,f,g,k){function h(a,g){if(g)k(g,null);else{if(c){E[c]&&b&&(E[c][b]=a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}f||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,
|
||||
"$1c1pjs$2"));h=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(u){h=null,a=u.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,h)}}a?f?db(a,g,h):h(a,null):k("no data"+(b?" for file: "+b:""),null)}
|
||||
function db(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var f=d[2];b("Loading "+f+"...");r(f,function(g,k,h){if(h||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(k=k.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],k);db(a,b,c)}})}else c(a,null)}
|
||||
function cb(a,b,c,d,f,g,k){function h(a,g){if(g)k(g,null);else{if(c){E[c]&&b&&(E[c][b]=a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}f||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,
|
||||
"$1C1Pjs$2"),a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1c1pjs$2"));h=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(u){h=null,a=u.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,h)}}a?f?db(a,g,h):h(a,null):k("no data"+(b?" for file: "+
|
||||
b:""),null)}
|
||||
function db(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var f=d[2];b("Loading "+f+"...");r(f,function(g,k,h){if(h||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(k=k.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
||||
a=a.replace(d[0],k);db(a,b,c)}})}else c(a,null)}
|
||||
function fb(a,b,c){function d(a){if(void 0===k){var b=g&&I(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=da(a))}function f(a){d("Error: "+a);h&&(--Z||A(!0));h=!1}var g,k,h=!0;Z++;E[a]={};try{if(g=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var m=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";n.styleSheet?n.styleSheet.cssText=l:n.appendChild(document.createTextNode(l));m.appendChild(n)}c||(c="/versions/c1pjs/1.24.2/components.xsl");
|
||||
l=function(h,k){k?bb(c,null,null,!1,d,function(h,l){if(l)if(E[a]&&c&&(E[a][c]=h),d("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var m=k.transformNode(l);m?(g.outerHTML=m,--Z||A(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(m=new XSLTProcessor,m.importStylesheet(l),(m=m.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Z||A(!0)):f("invalid machine element: "+a):f("transformToFragment failed")):
|
||||
f("unable to transform XML: unsupported browser");else f(h)}):f(h)};"<"!=b.charAt(0)?bb(b,a,void 0,!0,d,l):cb(b,null,a,void 0,!1,d,l)}else f("missing machine element: "+a)}catch(u){f(u.message)}return h}window.embedC1P=function(a,b,c){A(!1);return fb(a,b,c)};window.enableEvents=A;window.sendEvent=ha;})();
|
||||
|
|
|
|||
|
|
@ -236,10 +236,11 @@ Da.exit.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length
|
|||
H.prototype={constructor:H,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){dg(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 dg(a,b){a[a.id]={};b&&I(a,"parms",b);a.b=!1}function eg(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(v("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ag(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){v(c.message||c),b=!1}return b}function Xf(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:xa()&&(b=ya(a.key))?(a[a.id]=b,a.b=!0):!1}function bg(a,b){return a[a.id][b]||null}function I(a,b,c){try{a[a.id][b]=c}catch(d){}}var jg=0;
|
||||
function xg(a,b,c,d,e,f){e("Loading "+a+"...");sa(a,null,!0,function(h,g,k){k?(g||(g="unable to load "+a+" ("+k+")"),f(g,null)):yg(g,a,b,c,d,e,f)})}
|
||||
function yg(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){db(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
|
||||
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?zg(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function zg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");sa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,p=/( [a-z]+=)(['"])(.*?)\2/g;l=p.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);zg(a,b,c)}})}else c(a,null)}
|
||||
function yg(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){db(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PC8080$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?zg(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),
|
||||
null)}
|
||||
function zg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");sa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,p=/( [a-z]+=)(['"])(.*?)\2/g;l=p.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
||||
a=a.replace(d[0],h);zg(a,b,c)}})}else c(a,null)}
|
||||
function Ag(a,b,c,d){function e(a){if(void 0===g){var b=h&&C(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ka(a))}function f(a){e("Error: "+a);k&&(--jg||Pa(!0));k=!1}var h,g,k=!0;jg++;cb[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=l:q.appendChild(document.createTextNode(l));p.appendChild(q)}c||
|
||||
(c="/versions/pc8080/1.24.2/components.xsl");l=function(d,g){g?xg(c,null,null,!1,e,function(d,k){if(k)if(db(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--jg||Pa(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--jg||Pa(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,l):yg(b,null,a,d,!1,e,l)}else f("missing machine element: "+a)}catch(x){f(x.message)}return k}window.embedPC8080=function(a,b,c,d){Pa(!1);return Ag(a,b,c,d)};window.enableEvents=Pa;window.sendEvent=Qa;})();
|
||||
|
|
|
|||
|
|
@ -153,10 +153,11 @@ ta.exit.push(function(){for(var a=A(document,"pc8080","computer"),b=0;b<a.length
|
|||
F.prototype={constructor:F,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){fd(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 fd(a,b){a[a.id]={};b&&G(a,"parms",b);a.a=!1}function gd(a){var b=!0;if(pa()){var c=JSON.stringify(a[a.id]);ra(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function cd(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function Zc(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:pa()&&(b=qa(a.key))?(a[a.id]=b,a.a=!0):!1}function dd(a,b){return a[a.id][b]||null}function G(a,b,c){try{a[a.id][b]=c}catch(d){}}var md=0;
|
||||
function nd(a,b,c,d,e,f){e("Loading "+a+"...");ma(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):od(g,a,b,c,d,e,f)})}
|
||||
function od(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){La(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
|
||||
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){g=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?pd(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function pd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ma(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],n,x=/( [a-z]+=)(['"])(.*?)\2/g;n=x.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[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);pd(a,b,c)}})}else c(a,null)}
|
||||
function od(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){La(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PC8080$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){g=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?pd(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),
|
||||
null)}
|
||||
function pd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ma(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],n,x=/( [a-z]+=)(['"])(.*?)\2/g;n=x.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[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);pd(a,b,c)}})}else c(a,null)}
|
||||
function qd(a,b,c,d){function e(a){if(void 0===g){var b=h&&A(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function f(a){e("Error: "+a);l&&(--md||Ba(!0));l=!1}var h,g,l=!0;md++;Ka[a]={};try{if(h=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var x=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));x.appendChild(t)}c||
|
||||
(c="/versions/pc8080/1.24.2/components.xsl");n=function(d,g){g?nd(c,null,null,!1,e,function(d,l){if(l)if(La(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var n=g.transformNode(l);n?(h.outerHTML=n,--md||Ba(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(n=new XSLTProcessor,n.importStylesheet(l),(n=n.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--md||Ba(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?nd(b,a,d,!0,e,n):od(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(B){f(B.message)}return l}window.embedPC8080=function(a,b,c,d){Ba(!1);return qd(a,b,c,d)};window.enableEvents=Ba;window.sendEvent=Da;})();
|
||||
|
|
|
|||
|
|
@ -806,8 +806,8 @@ Ma.exit.push(function(){for(var a=pb(document,"pcx86","computer"),b=0;b<a.length
|
|||
lf.prototype={constructor:lf,value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.A=!0):this.A?!0:Ea()&&(a=Fa(this.key))?(this[this.id]=a,this.A=!0):!1},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Yr(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 Yr(a,b){a[a.id]={};b&&N(a,"parms",b);a.A=!1}function Zr(a){var b=!0;if(Ea()){var c=JSON.stringify(a[a.id]);Ga(a.key,c)||(w("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Vr(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){w(c.message||c),b=!1}return b}function Wr(a,b){return a[a.id][b]||null}function N(a,b,c){try{a[a.id][b]=c}catch(d){}}var ds=0;
|
||||
function es(a,b,c,d,e,f){e("Loading "+a+"...");xa(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):fs(h,a,b,c,d,e,f)})}
|
||||
function fs(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){hb(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));
|
||||
h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){h=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?rs(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function fs(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){hb(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PCx86$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){h=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?rs(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function rs(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");xa(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],l,n=/( [a-z]+=)(['"])(.*?)\2/g;l=n.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);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);rs(a,b,c)}})}else c(a,null)}
|
||||
function ss(a,b,c,d){function e(a){if(void 0===h){var b=g&&pb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=la(a))}function f(a){e("Error: "+a);k&&(--ds||Ua(!0));k=!1}var g,h,k=!0;ds++;gb[a]={};try{if(g=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=l:q.appendChild(document.createTextNode(l));n.appendChild(q)}c||
|
||||
|
|
|
|||
|
|
@ -626,8 +626,8 @@ Ca.exit.push(function(){for(var a=bb(document,"pcx86","computer"),b=0;b<a.length
|
|||
ee.prototype={constructor:ee,value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.A=!0):this.A?!0:xa()&&(a=ya(this.key))?(this[this.id]=a,this.A=!0):!1},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){vn(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 vn(a,b){a[a.id]={};b&&C(a,"parms",b);a.A=!1}function wn(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function sn(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function tn(a,b){return a[a.id][b]||null}function C(a,b,c){try{a[a.id][b]=c}catch(d){}}var Cn=0;
|
||||
function Dn(a,b,c,d,e,f){e("Loading "+a+"...");ra(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):En(h,a,b,c,d,e,f)})}
|
||||
function En(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){Va(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));
|
||||
h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(x){h=null,a=x.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?Fn(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function En(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{if(c){Va(c,b,a);var h=b;h&&0>h.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+h+'"}';"object"==typeof resources&&(h=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PCx86$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(x){h=null,a=x.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,h)}}a?e?Fn(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Fn(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ra(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,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.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);Fn(a,b,c)}})}else c(a,null)}
|
||||
function Gn(a,b,c,d){function e(a){if(void 0===h){var b=g&&bb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ja(a))}function f(a){e("Error: "+a);k&&(--Cn||Ja(!0));k=!1}var g,h,k=!0;Cn++;Ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],x=document.createElement("style");x.type="text/css";x.styleSheet?x.styleSheet.cssText=m:x.appendChild(document.createTextNode(m));n.appendChild(x)}c||
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ function lc(a,b,c){var d=!1;if(void 0!==b){.8>a.S/a.Aa?b=1:d=!0;a.Ba=b;b=a.Ma*a.
|
|||
m.Ca=function(a){if(ob(this,!0)){if(!this.A.Z){lc(this);this.D&&this.D.start(this.N,jc(this));this.A.Z=!0;this.A.bb=!0;this.ja&&this.ja.start();var b=this.K.run;b&&(b.textContent="Halt");this.D&&(this.D.ia(!0),a&&this.D.Ta(!0))}this.eb>=this.cb&&nc(this,!0);this.ka=0;this.na=ua();this.T&&(a=this.na-this.T,a>this.ub&&(this.N+=a,this.N>this.na&&(this.N=this.na)));try{do{for(var c=this.A.Fa?1:this.wa,d=this.oa.length-1;0<=d;d--){var e=this.oa[d];0>e[0]||c>e[0]&&(c=e[0])}this.Ka(c);var f=this.U-this.R;
|
||||
a=f;for(var h=this.oa.length-1;0<=h;h--){var g=this.oa[h];0>g[0]||(g[0]-=a,0>=g[0]&&(g[0]=-1,g[1]()))}this.ka+=f;this.O+=f;mc(this,0,!0);ic(this,f);this.da-=f;if(0>=this.da){this.da+=this.wa;15<=++this.vb&&(this.D&&this.D.ia(),this.vb=0);break}}while(this.A.Z)}catch(k){this.ba();F(this);this.D&&this.D.stop(ua(),jc(this));ob(this,!1);rb(this,k.stack||k.message);return}c=setTimeout;d=this.Ib;this.T=ua();e=this.ub;this.ka&&(e=Math.round(e*this.ka/this.wa));e=e-(this.T-this.na);if(f=this.T-this.N)this.S=
|
||||
Math.round(this.O/(10*f))/100,864E5<=f&&(this.V=0,lc(this));if(0>e||this.S<this.Aa)-1E3>e&&(this.N-=e),e=0;this.eb+=this.ka;this.T+=e;c(d,e)}else F(this),this.D&&this.D.stop(ua(),jc(this))};m.Ka=function(){return 0};m.ba=function(a){pb(this,!0);Ac(this);mc(this,this.O);this.O=0;if(this.A.Z){this.A.Z=!1;this.ja&&this.ja.stop();var b=this.K.run;b&&(b.textContent="Run")}this.A.Wa=a};function F(a,b){a.D&&a.D.ia(b)}
|
||||
function Bc(a){this.rb=+a.model||1170;bc.call(this,a,1E6);ec(this);this.A.Wa=this.A.Eb=!1;this.nb=0;this.w=65536;this.i=this.b=32768;this.j=65535;this.I=15;this.g=[0,0,0,0,0,0,0,0];this.zb=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.memory=[];this.J=[];this.fb=this.wb=0;this.W=2;this.$=255;this.G=0;this.ga=-1;this.tb=this.Na=this.sb=this.C=this.Da=this.M=this.L=0;this.pa=[7,7,7,7];this.Oa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Kb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}v(Bc,bc);m=Bc.prototype;m.reset=function(){this.A.Z&&this.ba();Cc(this);ec(this);this.A.Ga=!1;this.parent.reset.call(this)};
|
||||
function Bc(a){this.rb=+a.model||1170;bc.call(this,a,1E6);this.nb=0;this.w=65536;this.i=this.b=32768;this.j=65535;this.I=15;this.g=[0,0,0,0,0,0,0,0];this.zb=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.memory=[];this.J=[];this.fb=this.wb=0;this.W=2;this.$=255;this.G=0;this.ga=-1;this.tb=this.Na=this.sb=this.C=this.Da=this.M=this.L=0;this.pa=[7,7,7,7];this.Oa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,
|
||||
65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Kb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];ec(this);this.A.Wa=this.A.Eb=!1}v(Bc,bc);m=Bc.prototype;m.reset=function(){this.A.Z&&this.ba();Cc(this);ec(this);this.A.Ga=!1;this.parent.reset.call(this)};
|
||||
function Cc(a){a.$=255;a.J=[];a.wb=0;a.L=a.M=a.Da=a.sb=0;a.pa[0]=a.pa[1]=a.pa[3]=7;a.Na=0}m.mb=function(){return 0};m.save=function(){var a=new G(this);H(a,0,[]);H(a,1,[this.qb,this.V,this.Ba]);for(var b=this.H,c=0,d=[],e=0;e<b.H;e++){var f=b.P[e];if(f.va||f.Fb){d[c++]=e;var h=c++;a:if(f=f.save()){for(var g=0,k=0,l=[];g<f.length;){for(var n=f[g],p=g+1;p<f.length&&f[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}if(l.length<f.length){f=l;break a}}d[h]=f}}H(a,2,d);return a.data()};
|
||||
m.restore=function(a){var b=a[1];this.qb=b[0];this.V=b[1];lc(this,b[3]);a:{b=this.H;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.C){for(var f=0,h=Array(b.C),g=0;g<e.length-1;)for(var k=e[g++],l=e[g++];k--;)h[f++]=l;e=h}f=b.P[d];if(!f||!f.restore(e)){r("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||
m.ha=function(a,b,c){var d=!1;switch(b){case "PC":case "PSW":case "IF":case "SF":case "ZF":case "CF":this.K[b]=c;this.nb++;d=!0;break;default:d=this.parent.ha.call(this,a,b,c)}return d};m.ia=function(a){this.nb&&(a||!this.A.Z||this.A.lb)&&(a=this.I&-14|0|(this.ta&255?0:4)|(this.ta&256?1:0),kc(this,"PSW",a,4),kc(this,"SF",a&8?1:0,1),kc(this,"ZF",a&4?1:0,1),kc(this,"CF",a&1?1:0,1));if(a=this.K.speed)a.textContent=this.A.Z&&this.S?this.S.toFixed(2)+"Mhz":"Stopped"};
|
||||
function Dc(a,b){var c,d;a.b=b<<12;a.j=~b&4;a.i=b<<14;a.w=b<<16;if((b^a.I)&2048)for(c=0;6>c;c++)d=a.g[c],a.g[c]=a.zb[c],a.zb[c]=d;(a.C=b>>14&3)!==(d=a.I>>14&3)&&(a.fa[d]=a.g[6],a.g[6]=a.fa[a.C]);a.W=2;a.I=b}
|
||||
m.ha=function(a,b,c){var d=!1;switch(b){case "PC":case "PSW":case "SF":case "ZF":case "CF":this.K[b]=c;this.nb++;d=!0;break;default:d=this.parent.ha.call(this,a,b,c)}return d};m.ia=function(a){this.nb&&(a||!this.A.Z||this.A.lb)&&(a=this.I&-14|0|(this.ta&255?0:4)|(this.ta&256?1:0),kc(this,"PSW",a,4),kc(this,"SF",a&8?1:0,1),kc(this,"ZF",a&4?1:0,1),kc(this,"CF",a&1?1:0,1));if(a=this.K.speed)a.textContent=this.A.Z&&this.S?this.S.toFixed(2)+"Mhz":"Stopped"};
|
||||
function Dc(a,b){var c,d;a.b=b<<12;a.j=~b&4;a.i=b<<14;a.w=b<<16;if((b^a.I)&2048)for(c=0;6>c;c++)d=a.g[c],a.g[c]=a.zb[c],a.zb[c]=d;(a.C=b>>14&3)!==(a.I>>14&3)&&(a.fa[d]=a.g[6],a.g[6]=a.fa[a.C]);a.W=2;a.I=b}
|
||||
function I(a,b){var c,d,e=0;0>a.ga?(a.I=a.I&63728|a.b>>12&8|a.i>>14&2|a.w>>16&1,a.j&65535||(a.I|=4),a.ga=a.I):a.C||(b=4,e=1);a.L&57344||(a.M=63222);a.C=0;0<=(c=L(a,b|65536))&&0<=(d=L(a,b+2&65535|65536))&&(Dc(a,d&53247|a.ga>>2&12288),e&&(a.g[6]=4),0<=Ec(a,a.ga)&&0<=Ec(a,a.g[7])&&(a.g[7]=c));a.G=0;return a.ga=-1}
|
||||
function Fc(a,b,c){var d,e,f,h=0;if(c&a.sb){d=b>>13&a.pa[a.C];e=a.Oa[a.C][d];f=(a.Oa[a.C][d+16]<<6)+(b&8191)&4194303;if(a.Da&16){if(3932160<=f&&4186112>f){f=f&262143;var g=f>>13&31;31>g?a.Da&32&&(f=a.Kb[g]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}}else f&=262143,253952<=f&&(f|=4186112);if(3932160>f&&(3915776<=f||f&1&&!(c&1)))return I(a,4);switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:128;break;
|
||||
default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.Oa[a.C][d]=e;if(4194170!==f||a.C)a.Na=a.C,a.tb=d;if(h){if(h&57344)return 0<=a.ga&&(h|=128),a.L&57344||(a.L=a.L|h|a.Na<<5|a.tb<<1),I(a,168);a.L&61440||!(4191360>f||4194239<f)||(a.L|=4096,a.L&512&&(a.G|=2))}}else if(f=b&65535,57344<=f)f|=4186112;else if(f&1&&!(c&1))return I(a,4);return f}function M(a,b){return 4194304<=b?a.g[b-4194304]:3932160<=b?-1:0<=b?a.memory[b>>1]:b}
|
||||
|
|
@ -136,23 +136,24 @@ Pd+1)-Pd-1)/2==Od){Nd=Mb;break}}}jb--}Lb.B=Od;if(sa=Nd)break}if(!sa||null==sa)br
|
|||
"kbd"==x&&(x="keyboard");for(ba in C)if(x==ba){ha=C[ba];ca=!!(a.Y&ha);break}if(!ha){a.u("unknown message category: "+x);break a}}if(ha)if("on"==f[2])a.Y|=ha,ca=!0;else if("off"==f[2]&&(a.Y&=~ha,ca=!1,1073741824==ha)){for(var yc=0;yc<a.fa.length;yc++)a.u(a.fa[yc]);a.fa=[]}}var Ce=0,ia="";for(ba in C)if(!x||x==ba){var De=!!(a.Y&C[ba]);if(null===ca||ca==De)ia&&(ia+=","),++Ce%10||(ia+="\n\t"),"key"==ba&&(ba="keys"),ia+=ba}void 0===x&&a.u("message commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.u((null!==ca?ca?"messages on: ":"messages off: ":"message categories:\n\t")+(ia||"none"));Sc(a)}break;case "p":if("print"==f[0]){$d(a,b.substr(5));break}var Ee="pr"==f[0]?1:0;if(a.U)a.u("step in progress");else{var Sd=V(a.b.g[7]);a.ua(Sd);a.U?(a.xa(a.i,Sd,!0),a.Ca()||(a.D&&a.D.Ta(),a.U=0)):ae(a,Ee?"tr":"t")}break;case "r":if("reset"==b){a.D&&a.D.reset();break}kd(a,f);break;case "s":a:switch(f[1]){case "cs":var kb;void 0!==f[3]&&(kb=+f[3]);switch(f[2]){case "int":a.b.Ia=kb;break;case "start":a.b.Qa=
|
||||
kb;break;case "stop":a.b.Ja=kb;break;default:a.u("unknown cs option");break a}void 0!==kb&&fc(a.b);a.u("checksums "+(a.b.A.Fa?"enabled":"disabled"));break;case "sp":void 0!==f[2]&&(lc(a.b,+f[2])||a.u("warning: using 1x multiplier, previous target not reached"));a.u("target speed: "+(a.b.Aa.toFixed(2)+"Mhz")+" ("+a.b.Ba+"x)");break;case "?":a.u("debugger options:");a.u("\tcs int #\tset checksum cycle interval to #");a.u("\tcs start #\tset checksum cycle start count to #");a.u("\tcs stop #\tset checksum cycle stop count to #");
|
||||
a.u("\tsp #\t\tset speed multiplier to #");break;default:f[1]&&a.u("unknown option: "+f[1])}break;case "t":ae(a,f[0],f[1]);break;case "u":ld(a,f[1],f[2],8);break;case "v":if("var"==f[0]){Yd(a,b.substr(3))||(d=!1);break}a.u("PDP11 version 1.24.2 ("+a.b.rb+",RELEASE"+(sb?",TYPEDARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break;case "?":if(f[1]){$d(a,b.substr(1));break}var lb="commands:",zc;for(zc in Uc)lb+="\n"+oa(zc,9)+Uc[zc];Jc(a)||(lb+="\nnote: frequency/history disabled if no exec breakpoints");
|
||||
a.u("\tsp #\t\tset speed multiplier to #");break;default:f[1]&&a.u("unknown option: "+f[1])}break;case "t":ae(a,f[0],f[1]);break;case "u":ld(a,f[1],f[2],8);break;case "v":if("var"==f[0]){Yd(a,b.substr(3))||(d=!1);break}a.u("PDP11js version 1.24.2 ("+a.b.rb+",RELEASE"+(sb?",TYPEDARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break;case "?":if(f[1]){$d(a,b.substr(1));break}var lb="commands:",zc;for(zc in Uc)lb+="\n"+oa(zc,9)+Uc[zc];Jc(a)||(lb+="\nnote: frequency/history disabled if no exec breakpoints");
|
||||
a.u(lb);break;default:a.u("unknown command: "+b),d=!1}}}catch(Td){a.u("debugger error: "+(Td.stack||Td.message)),d=!1}return d}function gc(a,b,c){b=ed(a,b,c);for(var d in b)if(!qd(a,b[d]))return!1;return!0}Qa(function(){for(var a=y(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=w(c),d=new Qc(d);mb(d,c)}});
|
||||
function ce(a,b,c){t.call(this,"Computer",a,ce,67108864);this.A.X=!1;de(this,b);this.N=dc(this,"autoPower",a);this.w=0;this.U=a.busWidth||a.buswidth;this.i=ee;this.L=null;this.G=this.S=!1;this.V=dc(this,"url")||"";(Math.random()+.1).toString(36);this.j=fe(this);if(this.b=cb("CPU",this.id)){this.F=cb("Debugger",this.id);this.H=new vb({id:this.pb+".bus",busWidth:this.U},this.b,this.F);var d,e=bb(this.id);if((this.D=cb("Panel",this.id))&&this.D.ya)for(b=0;b<e.length;b++)d=e[b],d.ea=this.D.ea,d.u=this.D.u,
|
||||
d.ya=this.D.ya;this.u("PDP11 v1.24.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.za&&d.za(this,this.H,this.b,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.J=d:this.i=parseInt(d,10));var f;if(a=dc(this,"state")||(f=!0,a.state))b=this.O=a,f||(this.G=!0,this.i=ee),this.i&&(this.M=new G(this,"1.24.2"),ge(this.M)?b=null:delete this.M);!b&&this.i&&(b=he(this))&&(this.G=!0);if(b){var h=
|
||||
this;xa(b,null,!0,function(a,b,c){c?(h.J=null,h.G=!1,h.ea("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(h.L=b,h.S=!0);A(h)})}else A(this);this.K.power||(this.N=!0);!c&&this.N&&ie(this,this.Ra)}else r("Unable to find CPU component")}v(ce);var ee=0;function de(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.T=b}
|
||||
function dc(a,b,c){var d=b.toLowerCase(),d=Va[b]||Va[d];void 0===d&&a.T&&(d=a.T[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ie(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!qb(f)){qb(f,function(){ie(a,b,c)});return}}b.call(a,c)}
|
||||
d.ya=this.D.ya;this.u("PDP11js v1.24.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.u("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.za&&d.za(this,this.H,this.b,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.J=d:this.i=parseInt(d,10));var f;if(a=dc(this,"state")||(f=!0,a.state))b=this.O=a,f||(this.G=!0,this.i=ee),this.i&&(this.M=
|
||||
new G(this,"1.24.2"),ge(this.M)?b=null:delete this.M);!b&&this.i&&(b=he(this))&&(this.G=!0);if(b){var h=this;xa(b,null,!0,function(a,b,c){c?(h.J=null,h.G=!1,h.ea("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(h.L=b,h.S=!0);A(h)})}else A(this);this.K.power||(this.N=!0);!c&&this.N&&ie(this,this.Ra)}else r("Unable to find CPU component")}v(ce);var ee=0;
|
||||
function de(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.T=b}function dc(a,b,c){var d=b.toLowerCase(),d=Va[b]||Va[d];void 0===d&&a.T&&(d=a.T[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ie(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!qb(f)){qb(f,function(){ie(a,b,c)});return}}b.call(a,c)}
|
||||
function je(a,b){var c=new G(a,"1.24.2","validate");if(ge(c)&&ke(c)){var d=le(c,"timestamp"),e=b?le(b,"timestamp"):"unknown";d!=e&&(a.ea("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}m=ce.prototype;
|
||||
m.Ra=function(a){void 0===a&&(a=this.i||(this.L?1:ee));if(!this.w){this.w++;var b=!1,c=!1;this.R=!1;var d=this.M||new G(this,"1.24.2");if(-1==a)b=!0;else if(a>ee){if(ge(d,this.L)){this.C=new G(this,"1.24.2","failsafe");ge(this.C)&&(me(this,d),a=2,ne(this.C));H(this.C,"timestamp",va());oe(this.C);var e=this.i&&!this.G;if(1==a||ya("Click OK to restore the previous PDP11 machine state, or CANCEL to reset the machine.")){if(c=ke(d)){var f=le(d,"code"),h=le(d,"data");f&&("ok"==f?ge(d,h):("error"==f&&"no machine state"!=
|
||||
h?(this.ea("Error: "+h),"unable to verify user"==h&&(Ha("user",""),this.j=null)):this.u(f+": "+h),ne(d),ge(d)?(c=ke(d),e=!0):c=!1))}e&&je(this,c?d:null)}else 2==a&&d.clear()}else je(this);delete this.L;delete this.M}e=bb(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.b&&(c=pe(this,h,d,b,c));b=[d,a,c];-1!=a?ie(this,this.jb,b):this.jb(b)}};
|
||||
m.Ra=function(a){void 0===a&&(a=this.i||(this.L?1:ee));if(!this.w){this.w++;var b=!1,c=!1;this.R=!1;var d=this.M||new G(this,"1.24.2");if(-1==a)b=!0;else if(a>ee){if(ge(d,this.L)){this.C=new G(this,"1.24.2","failsafe");ge(this.C)&&(me(this,d),a=2,ne(this.C));H(this.C,"timestamp",va());oe(this.C);var e=this.i&&!this.G;if(1==a||ya("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=ke(d)){var f=le(d,"code"),h=le(d,"data");f&&("ok"==f?ge(d,h):("error"==f&&
|
||||
"no machine state"!=h?(this.ea("Error: "+h),"unable to verify user"==h&&(Ha("user",""),this.j=null)):this.u(f+": "+h),ne(d),ge(d)?(c=ke(d),e=!0):c=!1))}e&&je(this,c?d:null)}else 2==a&&d.clear()}else je(this);delete this.L;delete this.M}e=bb(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.b&&(c=pe(this,h,d,b,c));b=[d,a,c];-1!=a?ie(this,this.jb,b):this.jb(b)}};
|
||||
function pe(a,b,c,d,e){if(!b.A.X){b.A.X=!0;if(b.sa){var f=null;e&&((f=le(c,b.id))||(f=le(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.sa(f,d)&&f&&(r("Unable to restore state for "+b.type),a.O&&!a.S?(c.clear(),a.i=ee,window&&window.location.reload()):a.R=!0,b.sa(null),e=!1)}if(!d&&b.ob)for(a=b.ob.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
m.jb=function(a){var b=a[0],c=0>a[1];a=a[2];this.W=!0;this.A.X=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(pe(this,this.b,b,c,a),hc(this.b));this.R&&(me(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.w=0};
|
||||
function me(a,b){if(ya("There may be a problem with your PDP11 machine.\n\nTo help us diagnose it, click OK to send this PDP11 machine state to http://www.pcjs.org.")){var c=a.j||"",d=b.toString(),e={app:"PDP11",ver:"1.24.2"};e.url=a.V;e.user=c;e.type="bug";e.data=d;xa("http://www.pcjs.org/api/v1/report",e,!0)}}
|
||||
function me(a,b){if(ya("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var c=a.j||"",d=b.toString(),e={app:"PDP11js",ver:"1.24.2"};e.url=a.V;e.user=c;e.type="bug";e.data=d;xa("http://www.pcjs.org/api/v1/report",e,!0)}}
|
||||
function be(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new G(a,"1.24.2"),h=new G(a,"1.24.2","validate"),g=va();H(h,"timestamp",g);H(f,"timestamp",g);H(f,"version","1.24.2");H(f,"url",window?window.location.href:null);H(f,"browser",window?window.navigator.userAgent:"");a.b&&a.b.ra&&(c&&a.b.ba(),d=a.b.ra(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.A.X=!1,!1===d&&(e=null)));for(var g=bb(a.id),k=0;k<g.length;k++){var l=g[k];l.A.X&&(l.ra&&(d=l.ra(b,c),"object"===typeof d&&H(f,l.id,d)),c&&
|
||||
(l.A.X=!1,!1===d&&(e=null)))}e&&(c?(g=d=!1,b?(a.j&&qe(a,a.j,f.toString()),oe(h)&&oe(f)||(e=null,d=g=!0)):a.i&&(d=!0,g=3==a.i),d&&f.clear(g)):e=f.toString());c&&(a.A.X=!1,b=a.K.power)&&(b.textContent="Power");a.w=0;return e}m.reset=function(){this.H&&this.H.reset&&(this.F&&nb(this,0)&&this.F.message("Resetting "+this.H.type,void 0),this.H.reset());for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.H&&c.reset&&(this.F&&nb(this,0)&&this.F.message("Resetting "+c.type,void 0),c.reset())}};
|
||||
m.start=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};m.stop=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||
m.ha=function(a,b,c){var d=this;switch(b){case "power":return this.K[b]=c,c.onclick=function(){d.w||(d.A.X?be(d,!1,!0):ie(d,d.Ra))},!0;case "reset":return this.K[b]=c,c.onclick=function(){if(d.A.X&&!d.w)if(d.i&&!d.J){var a=ya("Click OK to save changes to this PDP11 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");be(d,a,!0);!a&&d.O?window&&window.location.reload():d.Ra(ee)}else d.reset(),d.b&&hc(d.b)},!0;case "save":if(ka()){c.parentNode.removeChild(c);break}this.K[b]=c;c.onclick=
|
||||
function(){var a=fe(d,!0);if(a){var b=!!(d.i&&!d.J||d.O),c=be(d,b);b?qe(d,a,c):d.ea("Resume disabled, machine state not saved")}};return!0}return!1};function fe(a,b){var c=a.j;c||(c=Ga("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=re(a,c))||a.ea("The user ID is invalid."))):b&&a.ea("Browser local storage is not available"));return c}
|
||||
m.ha=function(a,b,c){var d=this;switch(b){case "power":return this.K[b]=c,c.onclick=function(){d.w||(d.A.X?be(d,!1,!0):ie(d,d.Ra))},!0;case "reset":return this.K[b]=c,c.onclick=function(){if(d.A.X&&!d.w)if(d.i&&!d.J){var a=ya("Click OK to save changes to this PDP11js machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");be(d,a,!0);!a&&d.O?window&&window.location.reload():d.Ra(ee)}else d.reset(),d.b&&hc(d.b)},!0;case "save":if(ka()){c.parentNode.removeChild(c);break}this.K[b]=c;
|
||||
c.onclick=function(){var a=fe(d,!0);if(a){var b=!!(d.i&&!d.J||d.O),c=be(d,b);b?qe(d,a,c):d.ea("Resume disabled, machine state not saved")}};return!0}return!1};
|
||||
function fe(a,b){var c=a.j;c||(c=Ga("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=re(a,c))||a.ea("The user ID is invalid."))):b&&a.ea("Browser local storage is not available"));return c}
|
||||
function re(a,b){a.j=null;var c=xa(la()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(Ha("user",c.data),a.j=c.data)}catch(e){r(e.message+" ("+d+")")}return a.j}function he(a){var b=null;a.j&&(b=la()+"/api/v1/user?req=load&user="+a.j+"&state="+se(a,"1.24.2"));return b}
|
||||
function qe(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=se(a,"1.24.2");d.data=c;b=xa(la()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.ea("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.ea(c),Ha("user",""),a.j=null)}}m.Ta=function(){};
|
||||
m.ia=function(a){this.b&&this.b.ia(a);this.D&&this.D.ia(a)};Qa(function(){for(var a=y(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=w(c),c=y(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],h=w(f),h=new ce(h,d,!0);mb(h,f);h.N&&ie(h,h.Ra)}});La.show.push(function(){for(var a=y(document,"pdp11","computer"),b=0;b<a.length;b++){var c=w(a[b]);(c=cb("Computer",c.id))&&c.W&&!c.A.X&&c.Ra(-1)}});
|
||||
|
|
@ -160,8 +161,8 @@ La.exit.push(function(){for(var a=y(document,"pdp11","computer"),b=0;b<a.length;
|
|||
G.prototype={constructor:G,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){ne(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 ne(a,b){a[a.id]={};b&&H(a,"parms",b);a.b=!1}function oe(a){var b=!0;if(Fa()){var c=JSON.stringify(a[a.id]);Ha(a.key,c)||(r("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ke(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){r(c.message||c),b=!1}return b}function ge(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Fa()&&(b=Ga(a.key))?(a[a.id]=b,a.b=!0):!1}function le(a,b){return a[a.id][b]||null}function H(a,b,c){try{a[a.id][b]=c}catch(d){}}var te=0;
|
||||
function Fe(a,b,c,d,e,f){e("Loading "+a+"...");xa(a,null,!0,function(h,g,k){k?(g||(g="unable to load "+a+" ("+k+")"),f(g,null)):Ge(g,a,b,c,d,e,f)})}
|
||||
function Ge(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){ab(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));
|
||||
g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?He(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Ge(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){ab(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDP11js$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?He(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function He(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");xa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,n=/( [a-z]+=)(['"])(.*?)\2/g;l=n.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);He(a,b,c)}})}else c(a,null)}
|
||||
function Ie(a,b,c,d){function e(a){if(void 0===g){var b=h&&y(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=na(a))}function f(a){e("Error: "+a);k&&(--te||Sa(!0));k=!1}var h,g,k=!0;te++;$a[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=l:p.appendChild(document.createTextNode(l));n.appendChild(p)}c||
|
||||
|
|
|
|||
|
|
@ -12,34 +12,34 @@ function y(a,b){b||(b=w);a.prototype=za(b.prototype);a.prototype.constructor=a;a
|
|||
function Ca(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<x.length;d++)if(c)c==x[d]&&(c=null);else if(!(a!=x[d].type||b&&x[d].id.indexOf(b)))return x[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
||||
function C(a,b){for(var c=D(b.parentNode,"pdp11-control"),d=0;d<c.length;d++)for(var f=c[d].childNodes,e=0;e<f.length;e++){var h=f[e];if(1===h.nodeType){var g=h.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(h))&&g.binding&&a.L(g.type,g.binding,h,g.value),l=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 f=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)f.test(a[b].className)&&c.push(a[b]);return c}
|
||||
w.prototype={constructor:w,parent:null,toString:function(){return this.name?this.name:this.id||this.type},L:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.xa=this.o[b]=c,c.value="",this.K=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.A=function(a){this.K(a,this.va)}),!0;default:return!1}},log:function(){},K:function(){},status:function(a){this.K(this.va+": "+a)},A:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},Y:function(){return this.h.w=!0},X:function(a,b){b&&(this.h.w=!1);return!0}};function Da(a,b){if(a.h.Ba)return a.h.ia&&(a.h.ia=!1),a.h.Ba=!1;if(a.h.da)return a.K(a.toString()+" error"),!1;a.h.ia=b;return a.h.ia}function E(a){if(!a.h.da&&(a.h.fa=!0,a.h.fa)){var b=a.sa;a.sa=null;b&&b()}}
|
||||
w.prototype={constructor:w,parent:null,toString:function(){return this.name?this.name:this.id||this.type},L:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.xa=this.o[b]=c,c.value="",this.H=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.A=function(a){this.H(a,this.va)}),!0;default:return!1}},log:function(){},H:function(){},status:function(a){this.H(this.va+": "+a)},A:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},Y:function(){return this.h.w=!0},X:function(a,b){b&&(this.h.w=!1);return!0}};function Da(a,b){if(a.h.Ba)return a.h.ia&&(a.h.ia=!1),a.h.Ba=!1;if(a.h.da)return a.H(a.toString()+" error"),!1;a.h.ia=b;return a.h.ia}function E(a){if(!a.h.da&&(a.h.fa=!0,a.h.fa)){var b=a.sa;a.sa=null;b&&b()}}
|
||||
function Ea(a,b){b&&(a.h.fa?b():a.sa=b);return a.h.fa}var Fa="undefined"!==typeof ArrayBuffer;function Ga(a){w.call(this,"Panel",a,Ga)}y(Ga);m=Ga.prototype;m.L=function(a,b,c,d){return this.l&&this.l.L(a,b,c,d)||this.a&&this.a.L(a,b,c,d)?!0:this.parent.L.call(this,a,b,c,d)};m.ga=function(a,b,c,d){this.l=a;this.u=b;this.a=c;this.B=d};m.Y=function(a,b){b||Ha();return!0};m.X=function(){return!0};m.ea=function(){};
|
||||
function Ha(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],f=B(d),e;a:{e=f.id;if(void 0!==e)for(var h=void 0,h=0;h<x.length;h++)if(x[h].id===e){e=x[h];break a}e=null}e||(a=!0,e=new Ga(f));C(e,d);a&&E(e)}}v(Ha);
|
||||
function Ia(a,b,c){w.call(this,"Bus",a,Ia);this.a=b;this.B=c;this.g=a.busWidth||16;this.j=Math.pow(2,this.g);this.u=this.j-1|0;this.f=16>=this.g?10:20>=this.g?12:24>=this.g?14:15;this.c=1<<this.f;this.l=this.c>>2;this.m=this.c-1;this.i=this.j/this.c|0;a=new F;Ja(a,this.B);this.b=Array(this.i);for(b=0;b<this.i;b++)this.b[b]=a;E(this)}y(Ia);Ia.prototype.reset=function(){};Ia.prototype.Y=function(a,b){b||this.reset();return!0};
|
||||
function Ka(a,b,c,d){for(var f=b,e=c,h=f>>>a.f;0<e&&h<a.b.length;){var g=a.b[h],k=h*a.c,l=a.c-(f-k);l>e&&(l=e);if(g&&g.size){if(g.type==d){if(f+e<=g.ha)return g.ta+=g.ha-f,g.ha=f,!0;if(f>=g.ha+g.ta){l=g.size-(f-k);l>e&&(l=e);g.ta=f-g.ha+l;f=k+a.c;e-=l;h++;continue}}return La(1,f,e)}f=new F(f,l,a.c,d);Ja(f,a.B,g);a.b[h++]=f;f=k+a.c;e-=l}return 0>=e?(a.status(Math.floor(c/1024)+"Kb "+Ma[d]+" at "+("0x"+n(b,4))),!0):La(2,b,c)}
|
||||
function La(a,b,c){t("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Na;if(Fa){var Oa=new ArrayBuffer(2);(new DataView(Oa)).setUint16(0,256,!0);Na=256===(new Uint16Array(Oa))[0]}else Na=!1;var Pa=Na;
|
||||
function F(a,b,c,d){this.id=Qa+=2;this.a=null;this.ha=a;this.ta=b;this.size=c||0;this.type=d||Ra;this.o=d==Sa;Ja(this);this.W=this.Za=!1;if(c)if(Fa)this.c=new ArrayBuffer(c),this.f=new DataView(this.c,0,c),this.b=new Uint8Array(this.c,0,c),this.j=new Uint16Array(this.c,0,c>>1),this.a=new Int32Array(this.c,0,c>>2),Ta(this,Pa?Ua:Va);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;Ta(this,Wa)}else Ta(this)}var Ra=0,Sa=2,Ma=["NONE","RAM","ROM","VID","H/W"],Qa=0;
|
||||
F.prototype={constructor:F,parent:null,save:function(){var a,b;if(Fa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.f.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(Fa)for(b=0;b<a.length;b++)this.f.setInt32(b<<2,a[b],!0);else this.a=a;return this.W=!0}return!1},m:function(){return 255},s:function(){},J:function(a,b){return this.l(a++,b++)|this.l(a,b)<<8},$:function(a,b,c){this.u(a++,b&255,c++);this.u(a,b>>8,c)},G:function(a){return this.a[a>>
|
||||
2]>>>((a&3)<<3)&255},P:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},U:function(a,b){var c=a>>2,d=(a&3)<<3;this.a[c]=this.a[c]&~(255<<d)|b<<d;this.W=!0},ca:function(a,b){var c=a>>2,d=(a&3)<<3;24>d?this.a[c]=this.a[c]&~(65535<<d)|b<<d:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.W=!0},C:function(a,b){return this.D(a,b)},I:function(a,b){return this.N(a,b)},S:function(a,b,c){this.o||this.Xa(a,b,c)},Z:function(a,b,c){this.o||
|
||||
this.aa(a,b,c)},v:function(a){return this.b[a]},F:function(a){return this.b[a]},H:function(a){return this.f.getUint16(a,!0)},O:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.j[a>>1]},R:function(a,b){this.b[a]=b;this.W=!0},T:function(a,b){this.b[a]=b;this.W=!0},V:function(a,b){this.f.setUint16(a,b,!0);this.W=!0},ba:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.j[a>>1]=b;this.W=!0}};function Ja(a,b,c){a.B=b;a.g=a.i=0;c&&((a.g=c.g)&&Xa(a,Ya,!1),(a.i=c.i)&&Za(a,Ya,!1))}
|
||||
function Za(a,b,c){c&&a.i||(a.u=!a.o&&b[2]||a.s);if(c||void 0===c)a.Xa=b[2]||a.s,a.aa=b[3]||a.$}function Xa(a,b,c){c&&a.g||(a.l=b[0]||a.m);if(c||void 0===c)a.D=b[0]||a.m,a.N=b[1]||a.J}function Ta(a,b){b||(b=$a);Xa(a,b,void 0);Za(a,b,void 0)}var $a=[],Wa=[F.prototype.G,F.prototype.P,F.prototype.U,F.prototype.ca],Ya=[F.prototype.C,F.prototype.I,F.prototype.S,F.prototype.Z];if(Fa)var Va=[F.prototype.v,F.prototype.H,F.prototype.R,F.prototype.V],Ua=[F.prototype.F,F.prototype.O,F.prototype.T,F.prototype.ba];
|
||||
F.prototype={constructor:F,parent:null,save:function(){var a,b;if(Fa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.f.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(a&&this.size==a.length<<2){var b;if(Fa)for(b=0;b<a.length;b++)this.f.setInt32(b<<2,a[b],!0);else this.a=a;return this.W=!0}return!1},m:function(){return 255},s:function(){},K:function(a,b){return this.l(a++,b++)|this.l(a,b)<<8},$:function(a,b,c){this.u(a++,b&255,c++);this.u(a,b>>8,c)},G:function(a){return this.a[a>>
|
||||
2]>>>((a&3)<<3)&255},P:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},U:function(a,b){var c=a>>2,d=(a&3)<<3;this.a[c]=this.a[c]&~(255<<d)|b<<d;this.W=!0},ca:function(a,b){var c=a>>2,d=(a&3)<<3;24>d?this.a[c]=this.a[c]&~(65535<<d)|b<<d:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.W=!0},C:function(a,b){return this.D(a,b)},J:function(a,b){return this.N(a,b)},S:function(a,b,c){this.o||this.Xa(a,b,c)},Z:function(a,b,c){this.o||
|
||||
this.aa(a,b,c)},v:function(a){return this.b[a]},F:function(a){return this.b[a]},I:function(a){return this.f.getUint16(a,!0)},O:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.j[a>>1]},R:function(a,b){this.b[a]=b;this.W=!0},T:function(a,b){this.b[a]=b;this.W=!0},V:function(a,b){this.f.setUint16(a,b,!0);this.W=!0},ba:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.j[a>>1]=b;this.W=!0}};function Ja(a,b,c){a.B=b;a.g=a.i=0;c&&((a.g=c.g)&&Xa(a,Ya,!1),(a.i=c.i)&&Za(a,Ya,!1))}
|
||||
function Za(a,b,c){c&&a.i||(a.u=!a.o&&b[2]||a.s);if(c||void 0===c)a.Xa=b[2]||a.s,a.aa=b[3]||a.$}function Xa(a,b,c){c&&a.g||(a.l=b[0]||a.m);if(c||void 0===c)a.D=b[0]||a.m,a.N=b[1]||a.K}function Ta(a,b){b||(b=$a);Xa(a,b,void 0);Za(a,b,void 0)}var $a=[],Wa=[F.prototype.G,F.prototype.P,F.prototype.U,F.prototype.ca],Ya=[F.prototype.C,F.prototype.J,F.prototype.S,F.prototype.Z];if(Fa)var Va=[F.prototype.v,F.prototype.I,F.prototype.R,F.prototype.V],Ua=[F.prototype.F,F.prototype.O,F.prototype.T,F.prototype.ba];
|
||||
function ab(a,b){w.call(this,"CPU",a,ab);var c=a.multiplier||1;this.Ca=a.cycles||b;this.T=c;this.wa=Math.round(this.Ca/1E4)/100;this.R=this.wa*this.T;this.h.M=!1;this.h.Ka=!1;this.h.Ia=a.autoStart;this.h.Ja=!1;this.h.qa=!1;this.oa=this.S=0;this.pa=a.csStart;this.$=a.csInterval;this.aa=a.csStop;this.la=[];this.bb=this.Fa.bind(this);E(this)}y(ab);var bb=["power","reset"];m=ab.prototype;
|
||||
m.ga=function(a,b,c,d){this.l=a;this.u=b;this.B=d;for(b=0;b<bb.length;b++)(c=this.o[bb[b]])&&this.l.L(null,bb[b],c);this.Z=null;a=cb(a,"autoStart");null!=a&&(this.h.Ia="true"==a?!0:"false"==a?!1:!!a);E(this)};m.reset=function(){};m.save=function(){return null};m.restore=function(){return!1};m.Y=function(a,b){if(!b){if(a&&this.restore){db(this);if(!this.restore(a))return!1;eb(this)}else this.reset();this.K("No debugger detected")}fb(this);return!0};m.X=function(a){return a?this.save():!0};
|
||||
m.ga=function(a,b,c,d){this.l=a;this.u=b;this.B=d;for(b=0;b<bb.length;b++)(c=this.o[bb[b]])&&this.l.L(null,bb[b],c);this.Z=null;a=cb(a,"autoStart");null!=a&&(this.h.Ia="true"==a?!0:"false"==a?!1:!!a);E(this)};m.reset=function(){};m.save=function(){return null};m.restore=function(){return!1};m.Y=function(a,b){if(!b){if(a&&this.restore){db(this);if(!this.restore(a))return!1;eb(this)}else this.reset();this.H("No debugger detected")}fb(this);return!0};m.X=function(a){return a?this.save():!0};
|
||||
function gb(a){(a.h.Ia||void 0===a.o.run)&&a.Fa()}m.La=function(){return 0};function eb(a){void 0===a.pa&&(a.pa=0);void 0===a.$&&(a.$=-1);void 0===a.aa&&(a.aa=-1);a.h.qa=0<=a.pa&&0<a.$;a.h.qa&&(a.oa=0,a.S=a.pa-a.N)}function hb(a,b,c,d){a.o[b]&&(void 0===c&&(a.h.da=!0,a.A("Value for "+b+" is invalid"),G(a)),c=!a.h.M||a.h.Ja?n(c,d):"--------".substr(0,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
|
||||
m.L=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.o[b]=c;a=!0;break;case "run":this.o[b]=c;c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.h.w)a=!0;else{var b=null,c,g=A(a.id);for(c=0;c<g.length&&(b=g[c],b===a||b.h.fa);c++);if(c==g.length)for(c=0;c<g.length&&(b=g[c],b===a||b.h.w);c++);c==g.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.h.fa?"powered yet":"ready yet"+(b.sa?" (waiting for notification)":""))+".");a=!1}a&&(d.h.M?G(d):d.Fa())};a=!0;break;case "speed":this.o[b]=
|
||||
c;a=!0;break;case "setSpeed":this.o[b]=c,c.onclick=function(){ib(d,d.T<<1)},c.textContent=this.R.toFixed(2)+"Mhz",a=!0}return a};function jb(a,b,c){a.N+=b;c&&(a.J=a.G=0)}function kb(a,b){var c=1;b&&1<a.T&&a.H&&(c=a.H/a.wa);a.Sa=Math.round(1E3/30);a.ka=Math.floor(a.Ca/30*c);b||(a.ba=a.ka);a.Da=0}function lb(a){return a.N+a.F+a.J-a.G}function db(a){a.H=0;a.Ta=0;a.N=a.F=a.J=a.G=0;eb(a);ib(a,1)}
|
||||
function ib(a,b){if(void 0!==b){.8>a.H/a.R&&(b=1);a.T=b;var c=a.wa*a.T;if(a.R!=c){a.R=c;var c=a.R.toFixed(2)+"Mhz",d=a.o.setSpeed;d&&(d.textContent=c);a.K("target speed: "+c)}}jb(a,a.F);a.F=0;a.D=q();a.I=0;kb(a)}function mb(a){a.J-=a.G;a.G=0}
|
||||
m.Fa=function(){if(Da(this,!0)){if(!this.h.M){ib(this);this.l&&this.l.start(this.D,lb(this));this.h.M=!0;this.h.Ka=!0;this.Z&&this.Z.start();var a=this.o.run;a&&(a.textContent="Halt");this.l&&this.l.ea(!0)}this.Da>=this.Ca&&kb(this,!0);this.ca=0;this.na=q();this.I&&(a=this.na-this.I,a>this.Sa&&(this.D+=a,this.D>this.na&&(this.D=this.na)));try{do{for(var b=this.h.qa?1:this.ka,c=this.la.length-1;0<=c;c--){var d=this.la[c];0>d[0]||b>d[0]&&(b=d[0])}this.Wa(b);for(var f=this.J-this.G,a=f,e=this.la.length-
|
||||
1;0<=e;e--){var h=this.la[e];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ca+=f;this.F+=f;jb(this,0,!0);a=f;if(this.h.qa){var g=!1;this.oa=this.oa+this.La()|0;this.S-=a;0>=this.S&&(this.S+=this.$,g=!0);0<=this.aa&&this.aa<=lb(this)&&(this.$=this.aa=-1,eb(this),G(this),g=!0);g&&this.K(lb(this)+" cycles: checksum="+n(this.oa))}this.ba-=f;if(0>=this.ba){this.ba+=this.ka;15<=++this.Ta&&(this.l&&this.l.ea(),this.Ta=0);break}}while(this.h.M)}catch(k){G(this);fb(this);this.l&&this.l.stop(q(),lb(this));
|
||||
Da(this,!1);b=k.stack||k.message;this.h.da=!0;this.A(b);return}b=setTimeout;c=this.bb;this.I=q();d=this.Sa;this.ca&&(d=Math.round(d*this.ca/this.ka));d=d-(this.I-this.na);if(f=this.I-this.D)this.H=Math.round(this.F/(10*f))/100,864E5<=f&&(this.N=0,ib(this));if(0>d||this.H<this.R)-1E3>d&&(this.D-=d),d=0;this.Da+=this.ca;this.I+=d;b(c,d)}else fb(this),this.l&&this.l.stop(q(),lb(this))};m.Wa=function(){return 0};
|
||||
c;a=!0;break;case "setSpeed":this.o[b]=c,c.onclick=function(){ib(d,d.T<<1)},c.textContent=this.R.toFixed(2)+"Mhz",a=!0}return a};function jb(a,b,c){a.N+=b;c&&(a.K=a.G=0)}function kb(a,b){var c=1;b&&1<a.T&&a.I&&(c=a.I/a.wa);a.Sa=Math.round(1E3/30);a.ka=Math.floor(a.Ca/30*c);b||(a.ba=a.ka);a.Da=0}function lb(a){return a.N+a.F+a.K-a.G}function db(a){a.I=0;a.Ta=0;a.N=a.F=a.K=a.G=0;eb(a);ib(a,1)}
|
||||
function ib(a,b){if(void 0!==b){.8>a.I/a.R&&(b=1);a.T=b;var c=a.wa*a.T;if(a.R!=c){a.R=c;var c=a.R.toFixed(2)+"Mhz",d=a.o.setSpeed;d&&(d.textContent=c);a.H("target speed: "+c)}}jb(a,a.F);a.F=0;a.D=q();a.J=0;kb(a)}function mb(a){a.K-=a.G;a.G=0}
|
||||
m.Fa=function(){if(Da(this,!0)){if(!this.h.M){ib(this);this.l&&this.l.start(this.D,lb(this));this.h.M=!0;this.h.Ka=!0;this.Z&&this.Z.start();var a=this.o.run;a&&(a.textContent="Halt");this.l&&this.l.ea(!0)}this.Da>=this.Ca&&kb(this,!0);this.ca=0;this.na=q();this.J&&(a=this.na-this.J,a>this.Sa&&(this.D+=a,this.D>this.na&&(this.D=this.na)));try{do{for(var b=this.h.qa?1:this.ka,c=this.la.length-1;0<=c;c--){var d=this.la[c];0>d[0]||b>d[0]&&(b=d[0])}this.Wa(b);for(var f=this.K-this.G,a=f,e=this.la.length-
|
||||
1;0<=e;e--){var h=this.la[e];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ca+=f;this.F+=f;jb(this,0,!0);a=f;if(this.h.qa){var g=!1;this.oa=this.oa+this.La()|0;this.S-=a;0>=this.S&&(this.S+=this.$,g=!0);0<=this.aa&&this.aa<=lb(this)&&(this.$=this.aa=-1,eb(this),G(this),g=!0);g&&this.H(lb(this)+" cycles: checksum="+n(this.oa))}this.ba-=f;if(0>=this.ba){this.ba+=this.ka;15<=++this.Ta&&(this.l&&this.l.ea(),this.Ta=0);break}}while(this.h.M)}catch(k){G(this);fb(this);this.l&&this.l.stop(q(),lb(this));
|
||||
Da(this,!1);b=k.stack||k.message;this.h.da=!0;this.A(b);return}b=setTimeout;c=this.bb;this.J=q();d=this.Sa;this.ca&&(d=Math.round(d*this.ca/this.ka));d=d-(this.J-this.na);if(f=this.J-this.D)this.I=Math.round(this.F/(10*f))/100,864E5<=f&&(this.N=0,ib(this));if(0>d||this.I<this.R)-1E3>d&&(this.D-=d),d=0;this.Da+=this.ca;this.J+=d;b(c,d)}else fb(this),this.l&&this.l.stop(q(),lb(this))};m.Wa=function(){return 0};
|
||||
function G(a){a.h.ia&&(a.h.Ba=!0);mb(a);jb(a,a.F);a.F=0;if(a.h.M){a.h.M=!1;a.Z&&a.Z.stop();var b=a.o.run;b&&(b.textContent="Run")}a.h.ra=void 0}function fb(a){a.l&&a.l.ea(void 0)}
|
||||
function nb(a){this.ab=+a.model||1170;ab.call(this,a,1E6);db(this);this.h.ra=this.h.Ya=!1;this.Ma=0;this.g=65536;this.c=this.b=32768;this.f=65535;this.i=15;this.a=[0,0,0,0,0,0,0,0];this.Va=[0,0,0,0,0,0];this.U=[0,0,0,0];this.memory=[];this.s=[];this.Ea=this.Ua=0;this.O=2;this.P=255;this.m=0;this.V=-1;this.Ra=this.ya=this.Qa=this.j=this.ua=this.C=this.v=0;this.ma=[7,7,7,7];this.Aa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.fb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}y(nb,ab);m=nb.prototype;m.reset=function(){this.h.M&&G(this);ob(this);db(this);this.h.da=!1;this.parent.reset.call(this)};
|
||||
function nb(a){this.ab=+a.model||1170;ab.call(this,a,1E6);this.Ma=0;this.g=65536;this.c=this.b=32768;this.f=65535;this.i=15;this.a=[0,0,0,0,0,0,0,0];this.Va=[0,0,0,0,0,0];this.U=[0,0,0,0];this.memory=[];this.s=[];this.Ea=this.Ua=0;this.O=2;this.P=255;this.m=0;this.V=-1;this.Ra=this.ya=this.Qa=this.j=this.ua=this.C=this.v=0;this.ma=[7,7,7,7];this.Aa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,
|
||||
65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.fb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];db(this);this.h.ra=this.h.Ya=!1}y(nb,ab);m=nb.prototype;m.reset=function(){this.h.M&&G(this);ob(this);db(this);this.h.da=!1;this.parent.reset.call(this)};
|
||||
function ob(a){a.P=255;a.s=[];a.Ua=0;a.v=a.C=a.ua=a.Qa=0;a.ma[0]=a.ma[1]=a.ma[3]=7;a.ya=0}m.La=function(){return 0};m.save=function(){var a=new H(this);I(a,0,[]);I(a,1,[this.Pa,this.N,this.T]);for(var b=this.u,c=0,d=[],f=0;f<b.i;f++){var e=b.b[f];if(e.W||e.Za){d[c++]=f;var h=c++;a:if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var Q=e[g],z=g+1;z<e.length&&e[z]===Q;)z++;l[k++]=z-g;l[k++]=Q;g=z}if(l.length<e.length){e=l;break a}}d[h]=e}}I(a,2,d);return a.data()};
|
||||
m.restore=function(a){var b=a[1];this.Pa=b[0];this.N=b[1];ib(this,b[3]);a:{b=this.u;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],f=a[c+1];if(f&&f.length<b.l){for(var e=0,h=Array(b.l),g=0;g<f.length-1;)for(var k=f[g++],l=f[g++];k--;)h[e++]=l;f=h}e=b.b[d];if(!e||!e.restore(f)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||
m.L=function(a,b,c){var d=!1;switch(b){case "PC":case "PSW":case "IF":case "SF":case "ZF":case "CF":this.o[b]=c;this.Ma++;d=!0;break;default:d=this.parent.L.call(this,a,b,c)}return d};m.ea=function(a){this.Ma&&(a||!this.h.M||this.h.Ja)&&(a=this.i&-14|0|(this.eb&255?0:4)|(this.eb&256?1:0),hb(this,"PSW",a,4),hb(this,"SF",a&8?1:0,1),hb(this,"ZF",a&4?1:0,1),hb(this,"CF",a&1?1:0,1));if(a=this.o.speed)a.textContent=this.h.M&&this.H?this.H.toFixed(2)+"Mhz":"Stopped"};
|
||||
function pb(a,b){var c,d;a.b=b<<12;a.f=~b&4;a.c=b<<14;a.g=b<<16;if((b^a.i)&2048)for(c=0;6>c;c++)d=a.a[c],a.a[c]=a.Va[c],a.Va[c]=d;(a.j=b>>14&3)!==(d=a.i>>14&3)&&(a.U[d]=a.a[6],a.a[6]=a.U[a.j]);a.O=2;a.i=b}
|
||||
m.L=function(a,b,c){var d=!1;switch(b){case "PC":case "PSW":case "SF":case "ZF":case "CF":this.o[b]=c;this.Ma++;d=!0;break;default:d=this.parent.L.call(this,a,b,c)}return d};m.ea=function(a){this.Ma&&(a||!this.h.M||this.h.Ja)&&(a=this.i&-14|0|(this.eb&255?0:4)|(this.eb&256?1:0),hb(this,"PSW",a,4),hb(this,"SF",a&8?1:0,1),hb(this,"ZF",a&4?1:0,1),hb(this,"CF",a&1?1:0,1));if(a=this.o.speed)a.textContent=this.h.M&&this.I?this.I.toFixed(2)+"Mhz":"Stopped"};
|
||||
function pb(a,b){var c,d;a.b=b<<12;a.f=~b&4;a.c=b<<14;a.g=b<<16;if((b^a.i)&2048)for(c=0;6>c;c++)d=a.a[c],a.a[c]=a.Va[c],a.Va[c]=d;(a.j=b>>14&3)!==(a.i>>14&3)&&(a.U[d]=a.a[6],a.a[6]=a.U[a.j]);a.O=2;a.i=b}
|
||||
function J(a,b){var c,d,f=0;0>a.V?(a.i=a.i&63728|a.b>>12&8|a.c>>14&2|a.g>>16&1,a.f&65535||(a.i|=4),a.V=a.i):a.j||(b=4,f=1);a.v&57344||(a.C=63222);a.j=0;0<=(c=K(a,b|65536))&&0<=(d=K(a,b+2&65535|65536))&&(pb(a,d&53247|a.V>>2&12288),f&&(a.a[6]=4),0<=L(a,a.V)&&0<=L(a,a.a[7])&&(a.a[7]=c));a.m=0;return a.V=-1}
|
||||
function qb(a,b,c){var d,f,e,h=0;if(c&a.Qa){d=b>>13&a.ma[a.j];f=a.Aa[a.j][d];e=(a.Aa[a.j][d+16]<<6)+(b&8191)&4194303;if(a.ua&16){if(3932160<=e&&4186112>e){e=e&262143;var g=e>>13&31;31>g?a.ua&32&&(e=a.fb[g]+(e&8190)&4194302,3932160<=e&&4186112>e&&console.log("panic(898)")):e|=4186112}}else e&=262143,253952<=e&&(e|=4186112);if(3932160>e&&(3915776<=e||e&1&&!(c&1)))return J(a,4);switch(f&7){case 1:h=4096;case 2:f|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:f|=c&4?192:128;break;
|
||||
default:h=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(h|=16384):(b&8128)>(f>>2&8128)&&(h|=16384));a.Aa[a.j][d]=f;if(4194170!==e||a.j)a.ya=a.j,a.Ra=d;if(h){if(h&57344)return 0<=a.V&&(h|=128),a.v&57344||(a.v=a.v|h|a.ya<<5|a.Ra<<1),J(a,168);a.v&61440||!(4191360>e||4194239<e)||(a.v|=4096,a.v&512&&(a.m|=2))}}else if(e=b&65535,57344<=e)e|=4186112;else if(e&1&&!(c&1))return J(a,4);return e}function M(a,b){return 4194304<=b?a.a[b-4194304]:3932160<=b?-1:0<=b?a.memory[b>>1]:b}
|
||||
|
|
@ -48,7 +48,7 @@ function rb(a){var b=K(a,a.a[6]|65536);0<=b&&(a.a[6]=a.a[6]+2&65535);return b}fu
|
|||
function R(a,b,c){var d,f,e=b&7;switch(b>>3&7){case 0:return J(a,4);case 1:if(6===e&&!a.j&&c&4&&(a.a[6]<=a.P||65534<=a.a[6])){if(a.a[6]<=a.P-32||65534<=a.a[6])return a.a[6]=4,J(a,4);a.m|=4}return 7===e?a.a[e]:a.a[e]|65536;case 2:f=2;d=a.a[e];7!==e&&(d|=65536,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.a[e];7!==e&&(d|=65536);if(0>(d=K(a,d)))return d;d|=65536;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.a[e]+f&65535;7!==e&&(d|=65536);break;case 5:f=-2;d=a.a[e]-2&65535;7!==e&&(d|=65536);if(0>(d=K(a,d)))return d;
|
||||
d|=65536;break;case 6:if(0>(d=K(a,a.a[7])))return d;a.a[7]=a.a[7]+2&65535;d=d+a.a[e]&65535;return d|65536;case 7:if(0>(d=K(a,a.a[7])))return d;a.a[7]=a.a[7]+2&65535;d=d+a.a[e]&65535;return 0>(d=K(a,d|65536))?d:d|65536}a.a[e]=a.a[e]+f&65535;a.v&57344||(a.C=a.C<<8|f<<3&248|e);if(6===e&&!a.j&&c&4&&0>=f&&(a.a[6]<=a.P||65534<=a.a[6])){if(a.a[6]<=a.P-32)return a.a[6]=4,J(a,4);a.m|=4}return d}function S(a,b,c){var d;return b&56?(0<=(d=R(a,b,c))&&(d=qb(a,d,c)),d):4194304+(b&7)}
|
||||
function T(a,b){var c;b&56?0<=(c=S(a,b,2))&&(c=M(a,c)):c=a.a[b&7];return c}function U(a,b){var c;b&56?0<=(c=S(a,b,3))&&(c=O(a,c)):c=a.a[b&7]&255;return c}function V(a,b){return((b&128?b|65280:b&255)<<1)+a&65535}
|
||||
m.Wa=function(a){this.h.ra=!0;this.h.Ya=!1;this.h.Ka=!1;this.J=this.G=a;this.Pa&256?(mb(this),a=!1):a=!0;if(a){do{var b,c,d,f,e;if(this.O)if(1===this.O)this.O=2;else{this.O=0;e=-1;b=this.Ua&224;if(0<(a=this.s.length))for(;0<a--;){if(0<this.s[a].za){this.s[a].za--;this.O=2;break}if(this.s[a].Ga){if(!this.s[a].Ga()){this.s.splice(a,1);e--;continue}this.s[a].Ga=null}this.s[a].$a>b&&(b=this.s[a].$a,e=a)}b>(this.i&224)&&(0>e?J(this,160):(J(this,this.s[e].gb),this.s.splice(e,1)))}this.v&57344||(this.C=
|
||||
m.Wa=function(a){this.h.ra=!0;this.h.Ya=!1;this.h.Ka=!1;this.K=this.G=a;this.Pa&256?(mb(this),a=!1):a=!0;if(a){do{var b,c,d,f,e;if(this.O)if(1===this.O)this.O=2;else{this.O=0;e=-1;b=this.Ua&224;if(0<(a=this.s.length))for(;0<a--;){if(0<this.s[a].za){this.s[a].za--;this.O=2;break}if(this.s[a].Ga){if(!this.s[a].Ga()){this.s.splice(a,1);e--;continue}this.s[a].Ga=null}this.s[a].$a>b&&(b=this.s[a].$a,e=a)}b>(this.i&224)&&(0>e?J(this,160):(J(this,this.s[e].gb),this.s.splice(e,1)))}this.v&57344||(this.C=
|
||||
0);this.m=this.i&16;if(0<=(a=K(this,this.a[7])))switch(this.a[7]=this.a[7]+2&65535,a&61440){case 4096:0<=(b=T(this,a>>6))&&(a&56?0<=(d=S(this,a,4))&&0<=N(this,d,b)&&(this.b=this.f=b,this.c=0):(this.b=this.f=this.a[a&7]=b,this.c=0));break;case 8192:0<=(b=T(this,a>>6))&&0<=(c=T(this,a))&&(this.b=this.f=this.g=a=b-c,this.c=(b^c)&(b^a));break;case 12288:0<=(b=T(this,a>>6))&&0<=(c=T(this,a))&&(this.b=this.f=b&c,this.c=0);break;case 16384:0<=(b=T(this,a>>6))&&(a&56?0<=(c=M(this,d=S(this,a,6)))&&(a=c&~b,
|
||||
0<=N(this,d,a)&&(this.b=this.f=a,this.c=0)):(this.b=this.f=a=this.a[a&7]&=~b,this.c=0));break;case 20480:0<=(b=T(this,a>>6))&&(a&56?0<=(c=M(this,d=S(this,a,6)))&&(a=c|b,0<=N(this,d,a)&&(this.b=this.f=a,this.c=0)):(this.b=this.f=a=this.a[a&7]|=b,this.c=0));break;case 24576:0<=(b=T(this,a>>6))&&(a&56?0<=(c=M(this,d=S(this,a,6)))&&(a=b+c,0<=N(this,d,a)&&(this.b=this.f=this.g=a,this.c=(b^a)&(c^a))):(e=a&7,c=this.a[e],this.a[e]=(a=b+c)&65535,this.b=this.f=this.g=a,this.c=(b^a)&(c^a)));break;case 36864:0<=
|
||||
(b=U(this,a>>6))&&(a&56?0<=(d=S(this,a,5))&&0<=P(this,d,b)&&(this.b=this.f=b<<8,this.c=0):(b&128&&(b|=65280),this.b=this.f=this.a[a&7]=b,this.c=0));break;case 40960:0<=(b=U(this,a>>6))&&0<=(c=U(this,a))&&(a=b-c,this.b=this.f=this.g=a<<8,this.c=((b^c)&(b^a))<<8);break;case 45056:0<=(b=U(this,a>>6))&&0<=(c=U(this,a))&&(this.b=this.f=(b&c)<<8,this.c=0);break;case 49152:0<=(b=U(this,a>>6))&&0<=(c=O(this,d=S(this,a,7)))&&(a=c&~b,0<=P(this,d,a)&&(this.b=this.f=a<<8,this.c=0));break;case 53248:0<=(b=U(this,
|
||||
|
|
@ -70,7 +70,7 @@ break;case 35584:0<=(c=O(this,d=S(this,a,7)))&&(a=-c,0<=P(this,d,a)&&(this.g=thi
|
|||
a,0))&&(this.j=this.i>>12&3,0<=(b=K(this,f|65536))&&(this.j=this.i>>14&3,0<=L(this,b)&&(this.b=this.f=b,this.c=0))):(e=a&7,b=6!==e||(this.i>>2&12288)===(this.i&12288)?this.a[e]:this.U[this.i>>12&3],0<=L(this,b)&&(this.b=this.f=b,this.c=0));break;case 36224:0<=(c=rb(this))&&((this.v&57344||(this.C=22),a&56)?0<=(f=R(this,a,0))&&(this.j=this.i>>12&3,0<=(d=qb(this,f|65536,4))&&(this.j=this.i>>14&3,0<=N(this,d,c)&&(this.b=this.f=c,this.c=0))):(e=a&7,6!==e||(this.i>>2&12288)===(this.i&12288)?this.a[e]=
|
||||
c:this.U[this.i>>12&3]=c,this.b=this.f=c,this.c=0));break;default:switch(a&65528){case 128:0<=(b=rb(this))&&(e=a&7,this.a[7]=this.a[e],this.a[e]=b);break;case 152:this.i&49152||(this.i=this.i&63519|(a&7)<<5,this.O=1);break;case 160:case 168:a&1&&(this.g=0);a&2&&(this.c=0);a&4&&(this.f=1);a&8&&(this.b=0);break;case 176:case 184:a&1&&(this.g=65536);a&2&&(this.c=32768);a&4&&(this.f=0);a&8&&(this.b=32768);break;default:switch(a){case 0:49152&this.i?J(this,4):(this.Ea=3,mb(this),console.log("HALT at "+
|
||||
this.a[7].toString(8)));break;case 1:e=0;if(0<(a=this.s.length))for(;0<a--;)e+=this.s[a].za,this.s[a].za=0;0===e&&0===this.Ea&&(this.Ea=2,mb(this));break;case 3:J(this,12);break;case 4:J(this,16);break;case 5:this.i&49152||ob(this);break;case 2:case 6:d=this.a[6];0<=(f=K(this,d|65536))&&(d=d+2&65535,0<=(b=K(this,d|65536))&&(this.a[6]=d+2&65535,b&=63743,this.i&49152&&(b=b&63519|this.i&63712),this.a[7]=f,pb(this,b),this.m&=-17,2===a&&(this.m|=this.i&16)));break;default:J(this,8)}}}}}}this.m&&(this.m&
|
||||
2?J(this,168):this.m&4?J(this,4):this.m&16&&J(this,12),this.m=0)}while(0<this.G)}return this.h.ra?this.J-this.G:void 0===this.h.ra?0:-1};v(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new nb(d);C(d,c)}});
|
||||
2?J(this,168):this.m&4?J(this,4):this.m&16&&J(this,12),this.m=0)}while(0<this.G)}return this.h.ra?this.K-this.G:void 0===this.h.ra?0:-1};v(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new nb(d);C(d,c)}});
|
||||
function W(a){w.call(this,"ROM",a,W);this.b=null;this.j=a.addr;this.c=a.size;this.l=a.writable;this.f=a.alias;this.g=a.file;this.m=ba(this.g);if(this.g){a=this.g;var b=ca(this.m);"json"!=b&&"hex"!=b&&(a=p()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,e){sb(c,a,b,e)})}}y(W);W.prototype.ga=function(a,b,c,d){this.u=b;this.a=c;this.B=d;tb(this)};W.prototype.Y=function(){this.i&&(this.B&&this.B.a(this.id,this.j,this.c,this.i),delete this.i);return!0};
|
||||
W.prototype.X=function(){return!0};
|
||||
function sb(a,b,c,d){if(d)a.A("Unable to load system ROM (error "+d+": "+b+")");else{Ba(a.Oa,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var f=eval("("+c+")"),e=f.bytes,h=f.data;if(e)a.b=e;else if(h)for(a.b=Array(4*h.length),d=c=0;c<h.length;c++)a.b[d++]=h[c]&255,a.b[d++]=h[c]>>8&255,a.b[d++]=h[c]>>16&255,a.b[d++]=h[c]>>24&255;else a.b=f;a.i=f.symbols;if(!a.b.length){t("Empty ROM: "+b);return}if(1==a.b.length){t(a.b[0]);return}}catch(g){a.A("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm,
|
||||
|
|
@ -79,30 +79,30 @@ function tb(a){if(!Ea(a))if(!a.g)E(a);else if(a.b&&a.u){a.c||(a.c=a.b.length);if
|
|||
f.b.length;)g.push(f.b[k++]),h-=f.c;f=e.u;e=e.c;h=0;for(d>>>=f.f;0<e&&d<f.b.length;){k=g[h++];if(!k)break;f.b[d++]=k;e-=f.c}}delete a.b}}E(a)}}v(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new W(d);C(d,c)}});function ub(a){w.call(this,"RAM",a,ub);this.f=a.addr;this.c=a.size;this.b=!1}y(ub);m=ub.prototype;m.ga=function(a,b,c,d){this.u=b;this.a=c;this.B=d;E(this)};m.Y=function(a,b){b||this.reset();return!0};m.X=function(a){return a?this.save():!0};
|
||||
m.reset=function(){!this.b&&this.c&&Ka(this.u,this.f,this.c,1)&&(this.b=!0);this.b||t("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};v(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ub(d);C(d,c)}});function vb(a){w.call(this,"Keyboard",a,vb);E(this)}y(vb);vb.prototype.L=function(){return!1};vb.prototype.ga=function(a,b,c,d){this.l=a;this.a=c;this.B=d;this.Z=null};
|
||||
v(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new vb(d);C(d,c)}});
|
||||
function wb(a,b,c){w.call(this,"Computer",a,wb);this.h.w=!1;xb(this,b);this.v=cb(this,"autoPower",a);this.f=0;this.H=a.busWidth||a.buswidth;this.b=X;this.m=null;this.j=this.F=!1;this.I=cb(this,"url")||"";(Math.random()+.1).toString(36);this.c=yb(this);if(this.a=Ca("CPU",this.id)){this.B=Ca("Debugger",this.id);this.u=new Ia({id:this.Oa+".bus",busWidth:this.H},this.a,this.B);var d,f=A(this.id);if((this.g=Ca("Panel",this.id))&&this.g.xa)for(b=0;b<f.length;b++)d=f[b],d.A=this.g.A,d.K=this.g.K,d.xa=this.g.xa;
|
||||
this.K("PDP11 v1.24.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<f.length;b++)d=f[b],d.ga&&d.ga(this,this.u,this.a,this.B);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.l=d:this.b=parseInt(d,10));var e;if(a=cb(this,"state")||(e=!0,a.state))b=this.C=a,e||(this.j=!0,this.b=X),this.b&&(this.s=new H(this,"1.24.2"),Y(this.s)?b=null:delete this.s);!b&&this.b&&(b=zb(this))&&(this.j=!0);if(b){var h=this;r(b,null,
|
||||
!0,function(a,b,c){c?(h.l=null,h.j=!1,h.A("Unable to load machine state from server (error "+c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):(h.m=b,h.F=!0);E(h)})}else E(this);this.o.power||(this.v=!0);!c&&this.v&&Ab(this,this.ja)}else t("Unable to find CPU component")}y(wb);var X=0;function xb(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.G=b}
|
||||
function cb(a,b,c){var d=b.toLowerCase(),d=va[b]||va[d];void 0===d&&a.G&&(d=a.G[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ab(a,b,c){for(var d=A(a.id),f=0;f<=d.length;f++){var e=f<d.length?d[f]:a;if(!Ea(e)){Ea(e,function(){Ab(a,b,c)});return}}b.call(a,c)}
|
||||
function wb(a,b,c){w.call(this,"Computer",a,wb);this.h.w=!1;xb(this,b);this.v=cb(this,"autoPower",a);this.f=0;this.I=a.busWidth||a.buswidth;this.b=X;this.m=null;this.j=this.F=!1;this.J=cb(this,"url")||"";(Math.random()+.1).toString(36);this.c=yb(this);if(this.a=Ca("CPU",this.id)){this.B=Ca("Debugger",this.id);this.u=new Ia({id:this.Oa+".bus",busWidth:this.I},this.a,this.B);var d,f=A(this.id);if((this.g=Ca("Panel",this.id))&&this.g.xa)for(b=0;b<f.length;b++)d=f[b],d.A=this.g.A,d.H=this.g.H,d.xa=this.g.xa;
|
||||
this.H("PDP11js v1.24.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.H("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<f.length;b++)d=f[b],d.ga&&d.ga(this,this.u,this.a,this.B);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.l=d:this.b=parseInt(d,10));var e;if(a=cb(this,"state")||(e=!0,a.state))b=this.C=a,e||(this.j=!0,this.b=X),this.b&&(this.s=new H(this,
|
||||
"1.24.2"),Y(this.s)?b=null:delete this.s);!b&&this.b&&(b=zb(this))&&(this.j=!0);if(b){var h=this;r(b,null,!0,function(a,b,c){c?(h.l=null,h.j=!1,h.A("Unable to load machine state from server (error "+c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):(h.m=b,h.F=!0);E(h)})}else E(this);this.o.power||(this.v=!0);!c&&this.v&&Ab(this,this.ja)}else t("Unable to find CPU component")}y(wb);var X=0;
|
||||
function xb(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.G=b}function cb(a,b,c){var d=b.toLowerCase(),d=va[b]||va[d];void 0===d&&a.G&&(d=a.G[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ab(a,b,c){for(var d=A(a.id),f=0;f<=d.length;f++){var e=f<d.length?d[f]:a;if(!Ea(e)){Ea(e,function(){Ab(a,b,c)});return}}b.call(a,c)}
|
||||
function Bb(a,b){var c=new H(a,"1.24.2","validate");if(Y(c)&&Cb(c)){var d=Z(c,"timestamp"),f=b?Z(b,"timestamp"):"unknown";d!=f&&(a.A("Machine state may be out-of-date\n("+d+" vs. "+f+")\nCheck your browser's local storage limits"),b||c.clear())}}m=wb.prototype;
|
||||
m.ja=function(a){void 0===a&&(a=this.b||(this.m?1:X));if(!this.f){this.f++;var b=!1,c=!1;this.D=!1;var d=this.s||new H(this,"1.24.2");if(-1==a)b=!0;else if(a>X){if(Y(d,this.m)){this.i=new H(this,"1.24.2","failsafe");Y(this.i)&&(Db(this,d),a=2,Eb(this.i));I(this.i,"timestamp",ga());Fb(this.i);var f=this.b&&!this.j;if(1==a||ha("Click OK to restore the previous PDP11 machine state, or CANCEL to reset the machine.")){if(c=Cb(d)){var e=Z(d,"code"),h=Z(d,"data");e&&("ok"==e?Y(d,h):("error"==e&&"no machine state"!=
|
||||
h?(this.A("Error: "+h),"unable to verify user"==h&&(la("user",""),this.c=null)):this.K(e+": "+h),Eb(d),Y(d)?(c=Cb(d),f=!0):c=!1))}f&&Bb(this,c?d:null)}else 2==a&&d.clear()}else Bb(this);delete this.m;delete this.s}f=A(this.id);for(e=0;e<f.length;e++)h=f[e],h!==this&&h!=this.a&&(c=Gb(this,h,d,b,c));b=[d,a,c];-1!=a?Ab(this,this.Ha,b):this.Ha(b)}};
|
||||
m.ja=function(a){void 0===a&&(a=this.b||(this.m?1:X));if(!this.f){this.f++;var b=!1,c=!1;this.D=!1;var d=this.s||new H(this,"1.24.2");if(-1==a)b=!0;else if(a>X){if(Y(d,this.m)){this.i=new H(this,"1.24.2","failsafe");Y(this.i)&&(Db(this,d),a=2,Eb(this.i));I(this.i,"timestamp",ga());Fb(this.i);var f=this.b&&!this.j;if(1==a||ha("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Cb(d)){var e=Z(d,"code"),h=Z(d,"data");e&&("ok"==e?Y(d,h):("error"==e&&"no machine state"!=
|
||||
h?(this.A("Error: "+h),"unable to verify user"==h&&(la("user",""),this.c=null)):this.H(e+": "+h),Eb(d),Y(d)?(c=Cb(d),f=!0):c=!1))}f&&Bb(this,c?d:null)}else 2==a&&d.clear()}else Bb(this);delete this.m;delete this.s}f=A(this.id);for(e=0;e<f.length;e++)h=f[e],h!==this&&h!=this.a&&(c=Gb(this,h,d,b,c));b=[d,a,c];-1!=a?Ab(this,this.Ha,b):this.Ha(b)}};
|
||||
function Gb(a,b,c,d,f){if(!b.h.w){b.h.w=!0;if(b.Y){var e=null;f&&((e=Z(c,b.id))||(e=Z(c,b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof e&&(e=null);!b.Y(e,d)&&e&&(t("Unable to restore state for "+b.type),a.C&&!a.F?(c.clear(),a.b=X,window&&window.location.reload()):a.D=!0,b.Y(null),f=!1)}if(!d&&b.Na)for(a=b.Na.split("|"),c=0;c<a.length;c++)b.status(a[c])}return f}
|
||||
m.Ha=function(a){var b=a[0],c=0>a[1];a=a[2];this.J=!0;this.h.w=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Gb(this,this.a,b,c,a),gb(this.a));this.D&&(Db(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0};
|
||||
function Db(a,b){if(ha("There may be a problem with your PDP11 machine.\n\nTo help us diagnose it, click OK to send this PDP11 machine state to http://www.pcjs.org.")){var c=a.c||"",d=b.toString(),f={app:"PDP11",ver:"1.24.2"};f.url=a.I;f.user=c;f.type="bug";f.data=d;r("http://www.pcjs.org/api/v1/report",f,!0)}}
|
||||
m.Ha=function(a){var b=a[0],c=0>a[1];a=a[2];this.K=!0;this.h.w=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Gb(this,this.a,b,c,a),gb(this.a));this.D&&(Db(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.f=0};
|
||||
function Db(a,b){if(ha("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var c=a.c||"",d=b.toString(),f={app:"PDP11js",ver:"1.24.2"};f.url=a.J;f.user=c;f.type="bug";f.data=d;r("http://www.pcjs.org/api/v1/report",f,!0)}}
|
||||
function Hb(a,b,c){var d,f="none";if(a.f)return null;a.f--;var e=new H(a,"1.24.2"),h=new H(a,"1.24.2","validate"),g=ga();I(h,"timestamp",g);I(e,"timestamp",g);I(e,"version","1.24.2");I(e,"url",window?window.location.href:null);I(e,"browser",window?window.navigator.userAgent:"");a.a&&a.a.X&&(c&&G(a.a),d=a.a.X(b,c),"object"===typeof d&&I(e,a.a.id,d),c&&(a.a.h.w=!1,!1===d&&(f=null)));for(var g=A(a.id),k=0;k<g.length;k++){var l=g[k];l.h.w&&(l.X&&(d=l.X(b,c),"object"===typeof d&&I(e,l.id,d)),c&&(l.h.w=
|
||||
!1,!1===d&&(f=null)))}f&&(c?(g=d=!1,b?(a.c&&Ib(a,a.c,e.toString()),Fb(h)&&Fb(e)||(f=null,d=g=!0)):a.b&&(d=!0,g=3==a.b),d&&e.clear(g)):f=e.toString());c&&(a.h.w=!1,b=a.o.power)&&(b.textContent="Power");a.f=0;return f}m.reset=function(){this.u&&this.u.reset&&this.u.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.u&&c.reset&&c.reset()}};m.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var f=c[d];"CPU"!=f.type&&f!==this&&f.start&&f.start(a,b)}};
|
||||
m.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var f=c[d];"CPU"!=f.type&&f!==this&&f.stop&&f.stop(a,b)}};
|
||||
m.L=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.f||(d.h.w?Hb(d,!1,!0):Ab(d,d.ja))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.h.w&&!d.f)if(d.b&&!d.l){var a=ha("Click OK to save changes to this PDP11 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Hb(d,a,!0);!a&&d.C?window&&window.location.reload():d.ja(X)}else d.reset(),d.a&&gb(d.a)},!0;case "save":if(da()){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=
|
||||
m.L=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.f||(d.h.w?Hb(d,!1,!0):Ab(d,d.ja))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.h.w&&!d.f)if(d.b&&!d.l){var a=ha("Click OK to save changes to this PDP11js machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Hb(d,a,!0);!a&&d.C?window&&window.location.reload():d.ja(X)}else d.reset(),d.a&&gb(d.a)},!0;case "save":if(da()){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=
|
||||
function(){var a=yb(d,!0);if(a){var b=!!(d.b&&!d.l||d.C),c=Hb(d,b);b?Ib(d,a,c):d.A("Resume disabled, machine state not saved")}};return!0}return!1};function yb(a,b){var c=a.c;c||(c=ka("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=Jb(a,c))||a.A("The user ID is invalid."))):b&&a.A("Browser local storage is not available"));return c}
|
||||
function Jb(a,b){a.c=null;var c=r(p()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(la("user",c.data),a.c=c.data)}catch(f){t(f.message+" ("+d+")")}return a.c}function zb(a){var b=null;a.c&&(b=p()+"/api/v1/user?req=load&user="+a.c+"&state="+Kb(a,"1.24.2"));return b}
|
||||
function Ib(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Kb(a,"1.24.2");d.data=c;b=r(p()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var f=d.indexOf("\n");0<f&&(d=d.substr(0,f));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.A("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.A(c),la("user",""),a.c=null)}}
|
||||
m.ea=function(a){this.a&&this.a.ea(a);this.g&&this.g.ea(a)};v(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),f=0;f<c.length;f++){var e=c[f],h=B(e),h=new wb(h,d,!0);C(h,e);h.v&&Ab(h,h.ja)}});u.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ca("Computer",c.id))&&c.J&&!c.h.w&&c.ja(-1)}});
|
||||
m.ea=function(a){this.a&&this.a.ea(a);this.g&&this.g.ea(a)};v(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),f=0;f<c.length;f++){var e=c[f],h=B(e),h=new wb(h,d,!0);C(h,e);h.v&&Ab(h,h.ja)}});u.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ca("Computer",c.id))&&c.K&&!c.h.w&&c.ja(-1)}});
|
||||
u.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ca("Computer",c.id))&&c.h.w&&Hb(c,!(!c.b||c.l),!0)}});function H(a,b,c){this.id=a.id;this.key=Kb(a,b,c);this.B=a.B;Eb(this,a.cb)}function Kb(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}
|
||||
H.prototype={constructor:H,value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Eb(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(f){}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(f){}b.splice(c,1);c=0}}};
|
||||
function Eb(a,b){a[a.id]={};b&&I(a,"parms",b);a.a=!1}function Fb(a){var b=!0;if(ja()){var c=JSON.stringify(a[a.id]);la(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Cb(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Y(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:ja()&&(b=ka(a.key))?(a[a.id]=b,a.a=!0):!1}function Z(a,b){return a[a.id][b]||null}function I(a,b,c){try{a[a.id][b]=c}catch(d){}}var Lb=0;
|
||||
function Mb(a,b,c,d,f,e){f("Loading "+a+"...");r(a,null,!0,function(h,g,k){k?(g||(g="unable to load "+a+" ("+k+")"),e(g,null)):Nb(g,a,b,c,d,f,e)})}
|
||||
function Nb(a,b,c,d,f,e,h){function g(a,e){if(e)h(e,null);else{if(c){Ba(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}f||(a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));
|
||||
g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(z){g=null,a=z.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?f?Ob(a,e,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Nb(a,b,c,d,f,e,h){function g(a,e){if(e)h(e,null);else{if(c){Ba(c,b,a);var g=b;g&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{";d+='url:"'+g+'"}';"object"==typeof resources&&(g=null);a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}f||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDP11js$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(z){g=null,a=z.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?f?Ob(a,e,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Ob(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var f=d[2];b("Loading "+f+"...");r(f,null,!0,function(e,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(e=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,Q=/( [a-z]+=)(['"])(.*?)\2/g;l=Q.exec(e);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+f);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);Ob(a,b,c)}})}else c(a,null)}
|
||||
function Pb(a,b,c,d){function f(a){if(void 0===g){var b=h&&D(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=fa(a))}function e(a){f("Error: "+a);k&&(--Lb||sa(!0));k=!1}var h,g,k=!0;Lb++;Aa[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var Q=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=l:z.appendChild(document.createTextNode(l));Q.appendChild(z)}c||
|
||||
|
|
|
|||
Loading…
Reference in a new issue