|
|
|
|
@ -39,47 +39,47 @@ var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[4
|
|
|
|
|
"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,kc:65,Hf:66,Jf:67,fg:68,E:69,gg:70,hg:71,ig:72,jg:73,kg:74,lg:75,mg:76,ng:77,og:78,pg:79,qg:80,Q:81,rg:82,sg:83,tg:84,ug:85,vg:86,wg:87,xg:88,yg:89,Xc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,zg:97,Ag:98,Bg:99,d:100,e:101,Dg:102,Eg:103,Fg:104,Gg:105,Jg:106,k:107,Kg:108,Lg:109,n:110,Mg:111,p:112,q:113,r:114,Ng:115,t:116,Og:117,Pg:118,Qg:119,x:120,y:121,z:122,"{":123,
|
|
|
|
|
"|":124,"}":125,"~":126,Mc:127};
|
|
|
|
|
function r(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
|
|
|
|
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ja(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function u(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
|
|
|
|
function v(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function la(a,b){return-1!==a.indexOf(b,a.length-b.length)}function ma(a){return a.replace(/[&<>"']/g,function(a){return na[a]})}function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
|
|
|
|
var na={"&":"&","<":"<",">":">",'"':""","'":"'"},pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function qa(){return Date.now()||+new Date}
|
|
|
|
|
function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
|
|
|
|
function x(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
|
|
|
|
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ja(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function ka(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
|
|
|
|
function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function la(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}function na(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})}function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
|
|
|
|
var oa={"&":"&","<":"<",">":">",'"':""","'":"'"},qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function ra(){return Date.now()||+new Date}
|
|
|
|
|
function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
|
|
|
|
function v(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
|
|
|
|
f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
|
|
|
|
function sa(a,b){var c,d={N:null,ea:null,ja:null,ia:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ja=g.load;d.ia=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&255,d.N[f++]=e[c]>>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&
|
|
|
|
|
255,d.N[f++]=e[c]>>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ea=g.symbols;d.N.length?1==d.N.length&&(z(d.N[0]),d=null):(z("Empty resource: "+a),d=null)}catch(k){z("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){z("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.N=e)}return d}
|
|
|
|
|
function ta(){return"http://"+(window?window.location.host:"www.pcjs.org")}function z(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function va(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}
|
|
|
|
|
function ta(a,b){var c,d={N:null,ea:null,ja:null,ia:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ja=g.load;d.ia=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&255,d.N[f++]=e[c]>>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&
|
|
|
|
|
255,d.N[f++]=e[c]>>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ea=g.symbols;d.N.length?1==d.N.length&&(y(d.N[0]),d=null):(y("Empty resource: "+a),d=null)}catch(k){y("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){y("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.N=e)}return d}
|
|
|
|
|
function ua(){return"http://"+(window?window.location.host:"www.pcjs.org")}function y(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}function wa(){if(null==xa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}xa=a}return xa}
|
|
|
|
|
function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
|
|
|
|
|
function Ca(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}
|
|
|
|
|
function Da(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ea(a){Fa.init.push(a)}function Ga(a){if(Ha)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){z(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ha&&a?(Ha=!0,Ja&&Ka("init"),La&&Ka("show")):Ha=a}function Ka(a){Fa[a]&&Ga(Fa[a])}var Fa={init:[],show:[],exit:[]},Ja=!1,La=!1,Ha=!0,wa=null;
|
|
|
|
|
function Da(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ea(a){Fa.init.push(a)}function Ga(a){if(Ha)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){y(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ha&&a?(Ha=!0,Ja&&Ka("init"),La&&Ka("show")):Ha=a}function Ka(a){Fa[a]&&Ga(Fa[a])}var Fa={init:[],show:[],exit:[]},Ja=!1,La=!1,Ha=!0,xa=null;
|
|
|
|
|
Da("onload",function(){Ja=!0;Ga(Fa.init)});Da("onpageshow",function(){La=!0;Ga(Fa.show)});Da(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ga(Fa.exit)});
|
|
|
|
|
function A(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pc=b.comment;this.Uc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Ga=this.id:(this.Ha=this.id.substr(0,a),this.Ga=this.id.substr(a+1));this.l={ready:!1,Pa:!1,Yb:!1,R:!1,error:!1};this.xb=null;this.l.error=!1;this.j={};this.Nc=d||0;this.D=this.c=this.s=this.A=this.ab=null;B.push(this)}function Ma(a,b,c){Na[a]&&b&&(Na[a][b]=c)}
|
|
|
|
|
function C(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<B.length;b++){var d=B[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Oa(a){if(void 0!==a){var b;for(b=0;b<B.length;b++)if(B[b].id===a)return B[b]}return null}function Pa(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<B.length;d++)if(c)c==B[d]&&(c=null);else if(!(a!=B[d].type||b&&B[d].id.indexOf(b)))return B[d]}return null}
|
|
|
|
|
function D(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){z(c.message+" ("+a+")")}return b}function E(a,b){b=F(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=D(f))&&g.binding&&a.aa(g.type,g.binding,f,g.value),l=k.length}}}}
|
|
|
|
|
function F(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}h=A.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
|
|
|
|
function z(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pc=b.comment;this.Uc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Ga=this.id:(this.Ha=this.id.substr(0,a),this.Ga=this.id.substr(a+1));this.l={ready:!1,Pa:!1,Yb:!1,R:!1,error:!1};this.xb=null;this.l.error=!1;this.j={};this.Nc=d||0;this.D=this.c=this.s=this.A=this.ab=null;A.push(this)}function Ma(a,b,c){Na[a]&&b&&(Na[a][b]=c)}
|
|
|
|
|
function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<A.length;b++){var d=A[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Oa(a){if(void 0!==a){var b;for(b=0;b<A.length;b++)if(A[b].id===a)return A[b]}return null}function Pa(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<A.length;d++)if(c)c==A[d]&&(c=null);else if(!(a!=A[d].type||b&&A[d].id.indexOf(b)))return A[d]}return null}
|
|
|
|
|
function C(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){y(c.message+" ("+a+")")}return b}function D(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=C(f))&&g.binding&&a.aa(g.type,g.binding,f,g.value),l=k.length}}}}
|
|
|
|
|
function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}h=z.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
|
|
|
|
h.aa=function(a,b,c){switch(b){case "clear":return this.j[b]||(this.j[b]=c,c.onclick=function(a){return function(){a.j.print&&(a.j.print.value="")}}(this)),!0;case "print":return this.j[b]||(this.ab=this.j[b]=c,c.value="",this.U=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.B=function(a){this.U(a,this.Ga)}),!0;default:return!1}};h.log=function(){};h.U=function(){};
|
|
|
|
|
h.status=function(a){this.U(this.Ga+": "+a)};h.B=function(a,b,c){c=c||this.type;b||z((c?c+": ":"")+a)};function Qa(a,b){a.l.error=!0;a.B(b)}function Ra(a,b){b&&(a.l.ready?b():a.xb=b);return a.l.ready}function G(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.xb,a.xb=null,b&&b()))}function Sa(a,b){a.l.Yb?(a.l.Pa=!1,a.l.Yb=!1):a.l.error?a.U(a.toString()+" error"):a.l.Pa=b}h.Y=function(){return this.l.R=!0};h.ga=function(a,b){b&&(this.l.R=!1);return!0};var Ta=void 0,Ua={};
|
|
|
|
|
if(window){Ta||(Ta=window.location.search.substr(1));for(var Va,Wa=/\+/g,Xa=/([^&=]+)=?([^&]*)/g;Va=Xa.exec(Ta);)Ua[decodeURIComponent(Va[1].replace(Wa," "))]=decodeURIComponent(Va[2].replace(Wa," "))}window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var Na=window?window.PCjs.Machines:{},B=window?window.PCjs.Components:[];
|
|
|
|
|
h.status=function(a){this.U(this.Ga+": "+a)};h.B=function(a,b,c){c=c||this.type;b||y((c?c+": ":"")+a)};function Qa(a,b){a.l.error=!0;a.B(b)}function Ra(a,b){b&&(a.l.ready?b():a.xb=b);return a.l.ready}function F(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.xb,a.xb=null,b&&b()))}function Sa(a,b){a.l.Yb?(a.l.Pa=!1,a.l.Yb=!1):a.l.error?a.U(a.toString()+" error"):a.l.Pa=b}h.Y=function(){return this.l.R=!0};h.ga=function(a,b){b&&(this.l.R=!1);return!0};var Ta=void 0,Ua={};
|
|
|
|
|
if(window){Ta||(Ta=window.location.search.substr(1));for(var Va,Wa=/\+/g,Xa=/([^&=]+)=?([^&]*)/g;Va=Xa.exec(Ta);)Ua[decodeURIComponent(Va[1].replace(Wa," "))]=decodeURIComponent(Va[2].replace(Wa," "))}window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var Na=window?window.PCjs.Machines:{},A=window?window.PCjs.Components:[];
|
|
|
|
|
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
|
|
|
|
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ya="undefined"!==typeof ArrayBuffer,Za={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"};
|
|
|
|
|
function $a(a){A.call(this,"Panel",a,0,512);this.ha=this.g=this.b=this.h=this.i=this.m=0;this.u=this.v=this.o=!1;this.w=ab;this.f={};this.a={START:[1,1,!0,!1,this.pd],STEP:[1,1,!1,!1,this.qd],ENABLE:[1,1,!1,!1,this.ld],CONT:[1,1,!0,!1,this.jd],DEP:[0,0,!0,!1,this.kd],EXAM:[1,1,!0,!1,this.md],LOAD:[1,1,!0,!1,this.od],TEST:[0,0,!0,!1,this.nd]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.rd,a];this.D=this.c=this.s=this.A=null}n($a,A);h=$a.prototype;h.reset=function(){this.stop()};
|
|
|
|
|
function $a(a){z.call(this,"Panel",a,0,512);this.ha=this.g=this.b=this.h=this.i=this.m=0;this.u=this.v=this.o=!1;this.w=ab;this.f={};this.a={START:[1,1,!0,!1,this.pd],STEP:[1,1,!1,!1,this.qd],ENABLE:[1,1,!1,!1,this.ld],CONT:[1,1,!0,!1,this.jd],DEP:[0,0,!0,!1,this.kd],EXAM:[1,1,!0,!1,this.md],LOAD:[1,1,!0,!1,this.od],TEST:[0,0,!0,!1,this.nd]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.rd,a];this.D=this.c=this.s=this.A=null}n($a,z);h=$a.prototype;h.reset=function(){this.stop()};
|
|
|
|
|
h.aa=function(a,b,c,d){if(this.A&&this.A.aa(a,b,c,d)||this.c&&this.c.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){bb(a,
|
|
|
|
|
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){cb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){bb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){cb(a,b)}}(this,b),!0):A.prototype.aa.call(this,a,b,c,d)}};h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;db(b,this,eb);fb(b,this.reset.bind(this));gb(this);hb(this)};h.Y=function(a,b){b||(ib(),this.reset());return!0};h.ga=function(){return!0};
|
|
|
|
|
function jb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function gb(a,b){for(var c in a.f)jb(a,c,null!=b?b:a.f[c])}function kb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hb(a){for(var b in a.a)kb(a,b,a.a[b][1])}function lb(a,b,c,d){a.j[b]&&(void 0===c&&(Qa(a,"Value for "+b+" is invalid"),H(a.c)),c=8==(a.D&&a.D.h||8)?ja(c,d):u(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
|
|
|
|
|
function bb(a,b){var c=a.a[b];kb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mb&&(a.u=b==nb,a.v=b==ob)}function cb(a,b){var c=a.a[b];c[2]&&c[3]&&(kb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.pd=function(a){a||this.c.l.P||(a=this.c,a.s.reset(),pb(a),this.a[qb]&&this.a[qb][1]&&rb(this.c))};h.qd=function(){};h.ld=function(a){a||H(this.c)};
|
|
|
|
|
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){cb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){bb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){cb(a,b)}}(this,b),!0):z.prototype.aa.call(this,a,b,c,d)}};h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;db(b,this,eb);fb(b,this.reset.bind(this));gb(this);hb(this)};h.Y=function(a,b){b||(ib(),this.reset());return!0};h.ga=function(){return!0};
|
|
|
|
|
function jb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function gb(a,b){for(var c in a.f)jb(a,c,null!=b?b:a.f[c])}function kb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hb(a){for(var b in a.a)kb(a,b,a.a[b][1])}function lb(a,b,c,d){a.j[b]&&(void 0===c&&(Qa(a,"Value for "+b+" is invalid"),G(a.c)),c=8==(a.D&&a.D.h||8)?ja(c,d):ka(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
|
|
|
|
|
function bb(a,b){var c=a.a[b];kb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mb&&(a.u=b==nb,a.v=b==ob)}function cb(a,b){var c=a.a[b];c[2]&&c[3]&&(kb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.pd=function(a){a||this.c.l.P||(a=this.c,a.s.reset(),pb(a),this.a[qb]&&this.a[qb][1]&&rb(this.c))};h.qd=function(){};h.ld=function(a){a||G(this.c)};
|
|
|
|
|
h.jd=function(a){if(!a&&!this.c.l.P)if(this.a[qb]&&this.a[qb][1])rb(this.c);else{a=this.D;var b;if(b=a)a.l.Pa&&(a.l.Yb=!0),b=!a.l.Pa;if(b)Sa(a,!0),a.f(0,null),Sa(a,!1);else try{var c=this.c.Rb(1);0<c&&(sb(this.c,c),tb(this.c,c,!0),ub(this.c,c))}catch(d){"number"!=typeof d&&Qa(this.c,d.stack||d.message)}this.stop();this.A&&vb(this.A)}};h.kd=function(a){if(a&&!this.c.l.P)if(this.u&&wb(this),a=xb(this,this.b),this.w==ab)yb(this.s,this.ha,a);else{var b=this.c,c=this.ha;b.$a++;b.s.ub(zb(b,c,4),a);b.$a--}};
|
|
|
|
|
h.md=function(a){if(!a&&!this.c.l.P){this.v&&wb(this);if(this.w==ab)a=Ab(this.s,this.ha);else{a=this.c;var b=this.ha;a.$a++;b=a.s.tb(zb(a,b,2));a.$a--;a=b}xb(this,a)}};h.od=function(a){a||this.c.l.P||Bb(this,this.b)};h.nd=function(a){if(a)this.o=!0,gb(this,!0);else if(this.o=!1,gb(this),void 0!==this.j[Cb]){for(a=this.b=0;22>a;a++)this.a["S"+a][1]=0&1<<a?1:0;hb(this)}};h.rd=function(a,b){this.b=a?this.b|1<<b:this.b&~(1<<b)};
|
|
|
|
|
function wb(a){var b=1145>a.c.wa?8:16,c=65472<=a.ha&&a.ha<65472+b,b=c?1:2,c=c?15:a.s.i;a.a[mb]&&a.a[mb][1]||(b=-b);Bb(a,a.ha&~c|a.ha+b&c)}function Bb(a,b){a.ha=b&a.s.i;b=a.ha;for(var c=0;22>c;c++)Db(a,"A"+c,b&1<<c)}function xb(a,b){a.g=b&65535;b=a.g;for(var c=0;16>c;c++)Db(a,"D"+c,b&1<<c);return a.g}function Db(a,b,c){a.f[b]=c;a.o||jb(a,b,c)}h.stop=function(){Bb(this,this.c.b[7])};h.setData=function(a,b){b?this.h=a:this.g=a};h.wd=function(a,b){return(b?this.h:this.b)&65535};
|
|
|
|
|
h.Ge=function(a){this.h=a};function ib(){for(var a=!1,b=F(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=D(d),f=Oa(e.id);f||(a=!0,f=new $a(e));E(f,d);a&&G(f)}}var ab=7,Cb="S0",nb="DEP",qb="ENABLE",ob="EXAM",mb="STEP",Eb={},eb=(Eb[65400]=[null,null,$a.prototype.wd,$a.prototype.Ge,"CNSW"],Eb);Ea(ib);
|
|
|
|
|
function Fb(a,b,c){A.call(this,"Bus",a,0,16);this.c=b;this.D=c;this.M=a.busWidth||16;this.F=1<<this.M;this.i=this.F-1;this.f=Gb;this.b=Math.log2(this.f);this.K=this.f>>2;this.h=this.f-1;this.v=this.F/this.f|0;this.Ba=[];this.o=0;this.u=!1;this.G=[];this.Yc=[Hb,Ib,Jb,Kb];this.a=this.g=[];this.C=this.w=this.m=this.H=this.I=0;a=new I(this);Lb(a);this.a=Array(this.v);this.g=Array(this.v);for(b=0;b<this.v;b++)this.a[b]=this.g[b]=a;this.C=this.F-Gb;Mb(this,this.C,Gb,Nb,this);this.I=this.H=(this.C&this.i)>>>
|
|
|
|
|
this.b;this.w=0;this.m=this.i;G(this)}n(Fb,A);function Ob(a,b){if(b!=a.w){for(var c=0;c<a.v;c++)a.g[c]=a.a[c];a.w=0;a.m=a.i;b&&(a.w=b,b=1<<b,a.m=b-1,b-=Gb,a.I=(b&a.m)>>>a.b,a.g[a.I]=a.a[a.H])}}h=Fb.prototype;h.reset=function(){for(var a=0;a<this.G.length;a++)this.G[a]();Ob(this,16)};h.Y=function(a,b){b||this.reset();return!0};
|
|
|
|
|
function Mb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.b;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.f,p=a.f-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Oa)return l.rb+=l.Oa-f,l.Oa=f,!0;if(f>=l.Oa+l.rb){p=l.size-(f-m);p>g&&(p=g);l.rb=f-l.Oa+p;f=m+a.f;g-=p;k++;continue}}return Pb(Qb,f,g)}f=new I(a,f,p,a.f,d,e);Lb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Rb[d]+" at "+ja(b)),!0):Pb(Sb,b,c)}h.Hc=function(a){return this.g[(a&this.m)>>>this.b].Fb(a&this.h,a)};
|
|
|
|
|
h.Ge=function(a){this.h=a};function ib(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Oa(e.id);f||(a=!0,f=new $a(e));D(f,d);a&&F(f)}}var ab=7,Cb="S0",nb="DEP",qb="ENABLE",ob="EXAM",mb="STEP",Eb={},eb=(Eb[65400]=[null,null,$a.prototype.wd,$a.prototype.Ge,"CNSW"],Eb);Ea(ib);
|
|
|
|
|
function Fb(a,b,c){z.call(this,"Bus",a,0,16);this.c=b;this.D=c;this.M=a.busWidth||16;this.F=1<<this.M;this.i=this.F-1;this.f=Gb;this.b=Math.log2(this.f);this.K=this.f>>2;this.h=this.f-1;this.v=this.F/this.f|0;this.Ba=[];this.o=0;this.u=!1;this.G=[];this.Yc=[Hb,Ib,Jb,Kb];this.a=this.g=[];this.C=this.w=this.m=this.H=this.I=0;a=new H(this);Lb(a);this.a=Array(this.v);this.g=Array(this.v);for(b=0;b<this.v;b++)this.a[b]=this.g[b]=a;this.C=this.F-Gb;Mb(this,this.C,Gb,Nb,this);this.I=this.H=(this.C&this.i)>>>
|
|
|
|
|
this.b;this.w=0;this.m=this.i;F(this)}n(Fb,z);function Ob(a,b){if(b!=a.w){for(var c=0;c<a.v;c++)a.g[c]=a.a[c];a.w=0;a.m=a.i;b&&(a.w=b,b=1<<b,a.m=b-1,b-=Gb,a.I=(b&a.m)>>>a.b,a.g[a.I]=a.a[a.H])}}h=Fb.prototype;h.reset=function(){for(var a=0;a<this.G.length;a++)this.G[a]();Ob(this,16)};h.Y=function(a,b){b||this.reset();return!0};
|
|
|
|
|
function Mb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.b;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.f,p=a.f-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Oa)return l.rb+=l.Oa-f,l.Oa=f,!0;if(f>=l.Oa+l.rb){p=l.size-(f-m);p>g&&(p=g);l.rb=f-l.Oa+p;f=m+a.f;g-=p;k++;continue}}return Pb(Qb,f,g)}f=new H(a,f,p,a.f,d,e);Lb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Rb[d]+" at "+ja(b)),!0):Pb(Sb,b,c)}h.Hc=function(a){return this.g[(a&this.m)>>>this.b].Fb(a&this.h,a)};
|
|
|
|
|
h.tb=function(a){return this.g[(a&this.m)>>>this.b].V(a&this.h,a)};h.Ic=function(a,b){this.g[(a&this.m)>>>this.b].Nb(a&this.h,b,a)};h.ub=function(a,b){this.g[(a&this.m)>>>this.b].jb(a&this.h,b,a)};function Ab(a,b){a.u=!1;a.o++;b=a.a[(b&a.i)>>>a.b].bc(b&a.h,b);a.o--;return b}function Tb(a,b,c){a.u=!1;a.o++;a.a[(b&a.i)>>>a.b].Ob(b&a.h,c&255,b);a.o--}function yb(a,b,c){a.u=!1;a.o++;a.a[(b&a.i)>>>a.b].gc(b&a.h,c&65535,b);a.o--}
|
|
|
|
|
function Ub(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.a[d];if(e.ua||e.dd){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;l[k++]=p-g;l[k++]=m;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Vb(a){for(var b=Wb,c=0,d=0;d<a.a.length;d++){var e=a.a[d];e.type==b&&(c=e.Oa+e.rb)}return c}
|
|
|
|
|
function Xb(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&Yb;if(void 0!==a.Ba[p])return z("I/O address already registered: "+u(b,8,!0)),!1;var t=l||"unknown";t&&0<=m&&(t+=m++);a.Ba[p]=[d,e,f,g,t,k||16,!1]}return!0}
|
|
|
|
|
function db(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.wa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],w=g[5]||1,y=0;y<w;y++,f+=2)if(t&&1<w&&(t=g[4]+y),!Xb(a,f,f,k,l,m,p,g[7]||b.Nc,t||b.Ga))return!1}}return!0}
|
|
|
|
|
function fb(a,b){a.G.push(b)}function J(a,b,c){a.u=!0;a.o||(c&&(a.c.G|=c),K(a.c,4,0,b))}function Zb(a){var b=a.u;a.u=!1;return b}function Pb(a,b,c){z("Memory block error ("+a+": "+u(b)+","+u(c)+")");return!1}var Gb=8192,Yb=Gb-1,Qb=1,Sb=2;function Hb(a,b){var c=-1,d=this.controller,e=d.Ba[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
|
|
|
|
|
function Ib(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Jb(a,b){var c=-1,d=this.controller;a=d.Ba[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
|
|
|
|
|
function Kb(a,b,c){var d=!1,e=this.controller;a=e.Ba[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function L(a){A.call(this,"Device",a,0,256);this.a={Cg:0,dc:-1}}n(L,A);h=L.prototype;h.X=function(a,b,c,d){this.s=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.dc=ac(c,function(){e.a.cb|=128;e.a.cb&64&&M(e.c,e.a.Da);e.A&&vb(e.A,1);bc(e.c,e.a.dc,1E3/60)});this.a.Da=cc(c,64,6,524288);db(b,this,dc);fb(b,this.reset.bind(this));G(this)};
|
|
|
|
|
function Xb(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&Yb;if(void 0!==a.Ba[p])return y("I/O address already registered: "+ka(b,8,!0)),!1;var t=l||"unknown";t&&0<=m&&(t+=m++);a.Ba[p]=[d,e,f,g,t,k||16,!1]}return!0}
|
|
|
|
|
function db(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.wa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w<x;w++,f+=2)if(t&&1<x&&(t=g[4]+w),!Xb(a,f,f,k,l,m,p,g[7]||b.Nc,t||b.Ga))return!1}}return!0}
|
|
|
|
|
function fb(a,b){a.G.push(b)}function I(a,b,c){a.u=!0;a.o||(c&&(a.c.G|=c),J(a.c,4,0,b))}function Zb(a){var b=a.u;a.u=!1;return b}function Pb(a,b,c){y("Memory block error ("+a+": "+ka(b)+","+ka(c)+")");return!1}var Gb=8192,Yb=Gb-1,Qb=1,Sb=2;function Hb(a,b){var c=-1,d=this.controller,e=d.Ba[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255}
|
|
|
|
|
function Ib(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Jb(a,b){var c=-1,d=this.controller;a=d.Ba[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535}
|
|
|
|
|
function Kb(a,b,c){var d=!1,e=this.controller;a=e.Ba[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function K(a){z.call(this,"Device",a,0,256);this.a={Cg:0,dc:-1}}n(K,z);h=K.prototype;h.X=function(a,b,c,d){this.s=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.dc=ac(c,function(){e.a.cb|=128;e.a.cb&64&&L(e.c,e.a.Da);e.A&&vb(e.A,1);bc(e.c,e.a.dc,1E3/60)});this.a.Da=cc(c,64,6,524288);db(b,this,dc);fb(b,this.reset.bind(this));F(this)};
|
|
|
|
|
h.reset=function(){this.a.cb=128;bc(this.c,this.a.dc,1E3/60,!0)};h.Dd=function(){return this.a.cb};h.Ne=function(a){this.a.cb=a&192;this.a.cb&64||(a=this.a.Da)&&ec(this.c,a)};h.Fd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Wa<<5|a.Xa<<1);return b};h.Pe=function(a){fc(this.c,a&-129|this.c.H&128)};h.Gd=function(){var a=this.c;a.H&57344||(a.ob=a.F>>16&65535);a=a.ob;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hd=function(){var a=this.c;a.H&57344||(a.pb=a.F&65535);return a.pb};h.Id=function(){return this.c.na};
|
|
|
|
|
h.Qe=function(a){var b=this.c;1170>b.wa&&(a&=-49);b.na!=a&&(b.na=a,b.Ka=a&16?4194303:262143,gc(b))};h.pe=function(a){a=a>>1&63;var b=this.c.Na[a>>1];return a&1?b>>16:b&65535};h.zf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Na[c]=b&1?this.c.Na[c]&65535|(a&63)<<16:this.c.Na[c]&-65536|a&65534};h.ie=function(a){return this.c.u[1][a>>1&7]};h.sf=function(a,b){this.c.u[1][b>>1&7]=a&65295};h.ge=function(a){return this.c.u[1][(a>>1&7)+8]};h.qf=function(a,b){this.c.u[1][(b>>1&7)+8]=a&65295};
|
|
|
|
|
h.he=function(a){return this.c.I[1][a>>1&7]};h.rf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.u[1][b]&=65295};h.fe=function(a){return this.c.I[1][(a>>1&7)+8]};h.pf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.u[1][b]&=65295};h.Cd=function(a){return this.c.u[0][a>>1&7]};h.Me=function(a,b){this.c.u[0][b>>1&7]=a&65295};h.Ad=function(a){return this.c.u[0][(a>>1&7)+8]};h.Ke=function(a,b){this.c.u[0][(b>>1&7)+8]=a&65295};h.Bd=function(a){return this.c.I[0][a>>1&7]};
|
|
|
|
|
@ -88,118 +88,118 @@ h.le=function(a){return this.c.I[3][(a>>1&7)+8]};h.vf=function(a,b){b=(b>>1&7)+8
|
|
|
|
|
h.gb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ta[a]};h.ib=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ta[b]=a};h.Od=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.da[1]};h.We=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.da[1]=a};h.Pd=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.da[3]};h.Xe=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.da[3]=a};h.yd=function(a){return this.c.Mb[a-65504>>1]};
|
|
|
|
|
h.Ie=function(a,b){this.c.Mb[b-65504>>1]=a};h.Cc=function(a){return 65520==a?(Vb(this.s)>>6)-1:0};h.Fc=function(){};h.ke=function(){return 1};h.uf=function(){};h.xd=function(){return this.c.G};h.He=function(){this.c.G=0};h.Ed=function(){return this.c.Lb};h.Oe=function(a,b){b&1||(a&=255);this.c.Lb=a};h.Jd=function(a,b){return b?0:this.c.bb};h.Re=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.bb=a};h.je=function(a,b){return b?0:this.c.Ma&65280};
|
|
|
|
|
h.tf=function(a){this.c.Ma=a|255};h.Md=function(){return hc(this.c)};h.Ue=function(a){ic(this.c,a)};h.Ec=function(){};
|
|
|
|
|
var N={},dc=(N[61568]=[null,null,L.prototype.pe,L.prototype.zf,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.ie,L.prototype.sf,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.ge,L.prototype.qf,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.he,L.prototype.rf,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.fe,L.prototype.pf,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.Cd,L.prototype.Me,"KIPDR",8,1145,64],N[62672]=[null,null,L.prototype.Ad,L.prototype.Ke,"KDPDR",8,1145,64],N[62688]=
|
|
|
|
|
[null,null,L.prototype.Bd,L.prototype.Le,"KIPAR",8,1145,64],N[62704]=[null,null,L.prototype.zd,L.prototype.Je,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.Id,L.prototype.Qe,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.Dd,L.prototype.Ne,"LKS"],N[65402]=[null,null,L.prototype.Fd,L.prototype.Pe,"MMR0",1,1145,64],N[65404]=[null,null,L.prototype.Gd,L.prototype.Ec,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.Hd,L.prototype.Ec,"MMR2",1,1145,64],N[65408]=[null,null,L.prototype.oe,L.prototype.yf,
|
|
|
|
|
"UIPDR",8,1145,64],N[65424]=[null,null,L.prototype.me,L.prototype.wf,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.ne,L.prototype.xf,"UIPAR",8,1145,64],N[65456]=[null,null,L.prototype.le,L.prototype.vf,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.fb,L.prototype.hb,"R0SET0"],N[65473]=[null,null,L.prototype.fb,L.prototype.hb,"R1SET0"],N[65474]=[null,null,L.prototype.fb,L.prototype.hb,"R2SET0"],N[65475]=[null,null,L.prototype.fb,L.prototype.hb,"R3SET0"],N[65476]=[null,null,L.prototype.fb,
|
|
|
|
|
L.prototype.hb,"R4SET0"],N[65477]=[null,null,L.prototype.fb,L.prototype.hb,"R5SET0"],N[65478]=[null,null,L.prototype.Nd,L.prototype.Ve,"R6KERNEL"],N[65479]=[null,null,L.prototype.Qd,L.prototype.Ye,"R7KERNEL"],N[65480]=[null,null,L.prototype.gb,L.prototype.ib,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.gb,L.prototype.ib,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.gb,L.prototype.ib,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.gb,L.prototype.ib,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.gb,
|
|
|
|
|
L.prototype.ib,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.gb,L.prototype.ib,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Od,L.prototype.We,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Pd,L.prototype.Xe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.yd,L.prototype.Ie,"CTRL",8,1170],N[65520]=[null,null,L.prototype.Cc,L.prototype.Fc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.Cc,L.prototype.Fc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ke,L.prototype.uf,"SYSID",1,1170],N[65526]=
|
|
|
|
|
[null,null,L.prototype.xd,L.prototype.He,"ERR",1,1170],N[65528]=[null,null,L.prototype.Ed,L.prototype.Oe,"MBR",1,1170],N[65530]=[null,null,L.prototype.Jd,L.prototype.Re,"PIR"],N[65532]=[null,null,L.prototype.je,L.prototype.tf,"SLR"],N[65534]=[null,null,L.prototype.Md,L.prototype.Ue,"PSW"],N);
|
|
|
|
|
Ea(function(){for(var a=F(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=D(d);switch(c.type){case "default":c=new L(c);E(c,d);break;case "pc11":c=new jc(c);E(c,d);break;case "rl11":c=new O(c);E(c,d);break;case "rk11":c=new P(c),E(c,d)}}});
|
|
|
|
|
function I(a,b,c,d,e,f){this.a=a;this.id=kc+=2;this.c=null;this.Oa=b;this.rb=c;this.size=d||0;this.type=e||lc;this.h=e==mc;this.controller=null;this.Fb=this.i=this.$b;this.V=this.bc=this.ac;this.Nb=this.Ob=this.sb;this.jb=this.gc=this.fc;this.f=this.g=0;Lb(this);this.ua=this.dd=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],nc(this,f.Yc);else if(Ya)this.j=new ArrayBuffer(this.size),this.s=new DataView(this.j,0,this.size),this.b=new Uint8Array(this.j,0,this.size),this.A=new Uint16Array(this.j,
|
|
|
|
|
0,this.size>>1),this.c=new Int32Array(this.j,0,this.size>>2),nc(this,oc?pc:qc);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;nc(this,rc)}else nc(this)}h=I.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(Ya)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.s.getInt32(b<<2,!0);else a=this.c;return a};
|
|
|
|
|
var M={},dc=(M[61568]=[null,null,K.prototype.pe,K.prototype.zf,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.ie,K.prototype.sf,"SIPDR",8,1145,64],M[62608]=[null,null,K.prototype.ge,K.prototype.qf,"SDPDR",8,1145,64],M[62624]=[null,null,K.prototype.he,K.prototype.rf,"SIPAR",8,1145,64],M[62640]=[null,null,K.prototype.fe,K.prototype.pf,"SDPAR",8,1145,64],M[62656]=[null,null,K.prototype.Cd,K.prototype.Me,"KIPDR",8,1145,64],M[62672]=[null,null,K.prototype.Ad,K.prototype.Ke,"KDPDR",8,1145,64],M[62688]=
|
|
|
|
|
[null,null,K.prototype.Bd,K.prototype.Le,"KIPAR",8,1145,64],M[62704]=[null,null,K.prototype.zd,K.prototype.Je,"KDPAR",8,1145,64],M[62798]=[null,null,K.prototype.Id,K.prototype.Qe,"MMR3",1,1145,64],M[65382]=[null,null,K.prototype.Dd,K.prototype.Ne,"LKS"],M[65402]=[null,null,K.prototype.Fd,K.prototype.Pe,"MMR0",1,1145,64],M[65404]=[null,null,K.prototype.Gd,K.prototype.Ec,"MMR1",1,1145,64],M[65406]=[null,null,K.prototype.Hd,K.prototype.Ec,"MMR2",1,1145,64],M[65408]=[null,null,K.prototype.oe,K.prototype.yf,
|
|
|
|
|
"UIPDR",8,1145,64],M[65424]=[null,null,K.prototype.me,K.prototype.wf,"UDPDR",8,1145,64],M[65440]=[null,null,K.prototype.ne,K.prototype.xf,"UIPAR",8,1145,64],M[65456]=[null,null,K.prototype.le,K.prototype.vf,"UDPAR",8,1145,64],M[65472]=[null,null,K.prototype.fb,K.prototype.hb,"R0SET0"],M[65473]=[null,null,K.prototype.fb,K.prototype.hb,"R1SET0"],M[65474]=[null,null,K.prototype.fb,K.prototype.hb,"R2SET0"],M[65475]=[null,null,K.prototype.fb,K.prototype.hb,"R3SET0"],M[65476]=[null,null,K.prototype.fb,
|
|
|
|
|
K.prototype.hb,"R4SET0"],M[65477]=[null,null,K.prototype.fb,K.prototype.hb,"R5SET0"],M[65478]=[null,null,K.prototype.Nd,K.prototype.Ve,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qd,K.prototype.Ye,"R7KERNEL"],M[65480]=[null,null,K.prototype.gb,K.prototype.ib,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.gb,K.prototype.ib,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.gb,K.prototype.ib,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.gb,K.prototype.ib,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.gb,
|
|
|
|
|
K.prototype.ib,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.gb,K.prototype.ib,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Od,K.prototype.We,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Pd,K.prototype.Xe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.yd,K.prototype.Ie,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Cc,K.prototype.Fc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Cc,K.prototype.Fc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.ke,K.prototype.uf,"SYSID",1,1170],M[65526]=
|
|
|
|
|
[null,null,K.prototype.xd,K.prototype.He,"ERR",1,1170],M[65528]=[null,null,K.prototype.Ed,K.prototype.Oe,"MBR",1,1170],M[65530]=[null,null,K.prototype.Jd,K.prototype.Re,"PIR"],M[65532]=[null,null,K.prototype.je,K.prototype.tf,"SLR"],M[65534]=[null,null,K.prototype.Md,K.prototype.Ue,"PSW"],M);
|
|
|
|
|
Ea(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=C(d);switch(c.type){case "default":c=new K(c);D(c,d);break;case "pc11":c=new jc(c);D(c,d);break;case "rl11":c=new N(c);D(c,d);break;case "rk11":c=new O(c),D(c,d)}}});
|
|
|
|
|
function H(a,b,c,d,e,f){this.a=a;this.id=kc+=2;this.c=null;this.Oa=b;this.rb=c;this.size=d||0;this.type=e||lc;this.h=e==mc;this.controller=null;this.Fb=this.i=this.$b;this.V=this.bc=this.ac;this.Nb=this.Ob=this.sb;this.jb=this.gc=this.fc;this.f=this.g=0;Lb(this);this.ua=this.dd=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],nc(this,f.Yc);else if(Ya)this.j=new ArrayBuffer(this.size),this.s=new DataView(this.j,0,this.size),this.b=new Uint8Array(this.j,0,this.size),this.A=new Uint16Array(this.j,
|
|
|
|
|
0,this.size>>1),this.c=new Int32Array(this.j,0,this.size>>2),nc(this,oc?pc:qc);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;nc(this,rc)}else nc(this)}h=H.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(Ya)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.s.getInt32(b<<2,!0);else a=this.c;return a};
|
|
|
|
|
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ya)for(b=0;b<a.length;b++)this.s.setInt32(b<<2,a[b],!0);else this.c=a;return this.ua=!0}return!1};function nc(a,b){b||(b=sc);uc(a,b,void 0);vc(a,b,void 0)}function uc(a,b,c){c&&a.f||(a.Fb=b[0]||a.$b,a.V=b[2]||a.ac);if(c||void 0===c)a.i=b[0]||a.$b,a.bc=b[2]||a.ac}function vc(a,b,c){c&&a.g||(a.Nb=!a.h&&b[1]||a.sb,a.jb=!a.h&&b[3]||a.fc);if(c||void 0===c)a.Ob=b[1]||a.sb,a.gc=b[3]||a.fc}
|
|
|
|
|
function Lb(a,b){a.f=a.g=0;b&&((a.f=b.f)&&uc(a,wc,!1),(a.g=b.g)&&vc(a,wc,!1))}h.$b=function(a,b){J(this.a,b,32);return 255};h.sb=function(a,b,c){J(this.a,c,32)};h.ac=function(a,b){return this.Fb(a++,b++)|this.Fb(a,b)<<8};h.fc=function(a,b,c){this.Nb(a++,b&255,c++);this.Nb(a,b>>8,c)};h.vd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.ue=function(a,b){a&1&&J(this.a,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8};
|
|
|
|
|
h.Fe=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.ua=!0};h.Df=function(a,b,c){a&1&&J(this.a,c,64);c=a>>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<<a)|b<<a:(this.c[c]=this.c[c]&16777215|b<<24,c++,this.c[c]=this.c[c]&-256|b>>8);this.ua=!0};h.td=function(a,b){return this.i(a,b)};h.re=function(a,b){return this.bc(a,b)};h.De=function(a,b,c){this.h?this.sb(0,0,c):this.Ob(a,b,c)};h.Bf=function(a,b,c){this.h?this.sb(0,0,c):this.gc(a,b,c)};h.sd=function(a){return this.b[a]};
|
|
|
|
|
h.ud=function(a){return this.b[a]};h.qe=function(a,b){a&1&&J(this.a,b,64);return this.s.getUint16(a,!0)};h.te=function(a,b){a&1&&J(this.a,b,64);return this.A[a>>1]};h.Ce=function(a,b){this.b[a]=b;this.ua=!0};h.Ee=function(a,b){this.b[a]=b;this.ua=!0};h.Af=function(a,b,c){a&1&&J(this.a,c,64);this.s.setUint16(a,b,!0);this.ua=!0};h.Cf=function(a,b,c){a&1&&J(this.a,c,64);this.A[a>>1]=b;this.ua=!0};
|
|
|
|
|
var lc=0,Wb=1,mc=2,Nb=4,Rb=["NONE","RAM","ROM","VID","H/W"],kc=0,sc=[],rc=[I.prototype.vd,I.prototype.Fe,I.prototype.ue,I.prototype.Df],wc=[I.prototype.td,I.prototype.De,I.prototype.re,I.prototype.Bf];if(Ya)var qc=[I.prototype.sd,I.prototype.Ce,I.prototype.qe,I.prototype.Af],pc=[I.prototype.ud,I.prototype.Ee,I.prototype.te,I.prototype.Cf];var xc;if(Ya){var yc=new ArrayBuffer(2);(new DataView(yc)).setUint16(0,256,!0);xc=256===(new Uint16Array(yc))[0]}else xc=!1;var oc=xc;
|
|
|
|
|
function zc(a,b){A.call(this,"CPU",a,0,1);b=a.cycles||b;var c=a.multiplier||1;this.hc=0;this.Ib=b;this.La=c;this.Ub=Math.round(this.Ib/1E4)/100;this.Va=this.Ub*this.La;this.Vb=this.nb=this.Ya=this.Jb=0;this.l.P=!1;this.l.cc=!1;this.l.Ca=a.autoStart;this.l.vb=!1;this.Db=this.Ta=0;this.Eb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.pa=[];this.sc=this.ye.bind(this);this.za=this.sa=this.ya=this.a=this.W=this.ra=this.kb=this.xa=this.Za=this.Wb=this.Ia=0;this.la=null;G(this)}n(zc,A);h=zc.prototype;
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.D=d;this.la=a.f;for(a=0;a<Ac.length;a++)(b=this.j[Ac[a]])&&this.A.aa(null,Ac[a],b);G(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.Y=function(a,b){var c=Bc(this.A,"autoStart");null!=c?this.l.Ca="true"==c?!0:"false"==c?!1:!!c:null==this.l.Ca&&(this.l.Ca=void 0===this.j.run);if(!b){if(a&&this.restore){Cc(this);if(!this.restore(a))return!1;Dc(this)}else this.reset();this.U("No debugger detected");this.l.Ca||this.U("CPU will not be auto-started, click Run to start")}return!0};
|
|
|
|
|
h.ga=function(a){return a?this.save():!0};h.Ca=function(){return this.l.P?!0:this.l.Ca?(rb(this),!0):!1};h.zc=function(){return 0};function Dc(a){void 0===a.Eb&&(a.Eb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.l.vb=0<=a.Eb&&0<a.lb;a.l.vb&&(a.Db=0,a.Ta=a.Eb-a.za)}function ub(a,b){if(a.l.vb){var c=!1;a.Db=a.Db+a.zc()|0;a.Ta-=b;0>=a.Ta&&(a.Ta+=a.lb,c=!0);0<=a.mb&&a.mb<=Ec(a)&&(a.lb=a.mb=-1,Dc(a),H(a),c=!0);c&&a.U(Ec(a)+" cycles: checksum="+u(a.Db))}}
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.R)a=!0;else{var b=null,c,k=C(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.l.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.l.R);c++);c==k.length&&(b=a);z("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.xb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.P?H(d):rb(d))},!0;case "speed":return this.j[b]=
|
|
|
|
|
function Lb(a,b){a.f=a.g=0;b&&((a.f=b.f)&&uc(a,wc,!1),(a.g=b.g)&&vc(a,wc,!1))}h.$b=function(a,b){I(this.a,b,32);return 255};h.sb=function(a,b,c){I(this.a,c,32)};h.ac=function(a,b){return this.Fb(a++,b++)|this.Fb(a,b)<<8};h.fc=function(a,b,c){this.Nb(a++,b&255,c++);this.Nb(a,b>>8,c)};h.vd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.ue=function(a,b){a&1&&I(this.a,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8};
|
|
|
|
|
h.Fe=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.ua=!0};h.Df=function(a,b,c){a&1&&I(this.a,c,64);c=a>>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<<a)|b<<a:(this.c[c]=this.c[c]&16777215|b<<24,c++,this.c[c]=this.c[c]&-256|b>>8);this.ua=!0};h.td=function(a,b){return this.i(a,b)};h.re=function(a,b){return this.bc(a,b)};h.De=function(a,b,c){this.h?this.sb(0,0,c):this.Ob(a,b,c)};h.Bf=function(a,b,c){this.h?this.sb(0,0,c):this.gc(a,b,c)};h.sd=function(a){return this.b[a]};
|
|
|
|
|
h.ud=function(a){return this.b[a]};h.qe=function(a,b){a&1&&I(this.a,b,64);return this.s.getUint16(a,!0)};h.te=function(a,b){a&1&&I(this.a,b,64);return this.A[a>>1]};h.Ce=function(a,b){this.b[a]=b;this.ua=!0};h.Ee=function(a,b){this.b[a]=b;this.ua=!0};h.Af=function(a,b,c){a&1&&I(this.a,c,64);this.s.setUint16(a,b,!0);this.ua=!0};h.Cf=function(a,b,c){a&1&&I(this.a,c,64);this.A[a>>1]=b;this.ua=!0};
|
|
|
|
|
var lc=0,Wb=1,mc=2,Nb=4,Rb=["NONE","RAM","ROM","VID","H/W"],kc=0,sc=[],rc=[H.prototype.vd,H.prototype.Fe,H.prototype.ue,H.prototype.Df],wc=[H.prototype.td,H.prototype.De,H.prototype.re,H.prototype.Bf];if(Ya)var qc=[H.prototype.sd,H.prototype.Ce,H.prototype.qe,H.prototype.Af],pc=[H.prototype.ud,H.prototype.Ee,H.prototype.te,H.prototype.Cf];var xc;if(Ya){var yc=new ArrayBuffer(2);(new DataView(yc)).setUint16(0,256,!0);xc=256===(new Uint16Array(yc))[0]}else xc=!1;var oc=xc;
|
|
|
|
|
function zc(a,b){z.call(this,"CPU",a,0,1);b=a.cycles||b;var c=a.multiplier||1;this.hc=0;this.Ib=b;this.La=c;this.Ub=Math.round(this.Ib/1E4)/100;this.Va=this.Ub*this.La;this.Vb=this.nb=this.Ya=this.Jb=0;this.l.P=!1;this.l.cc=!1;this.l.Ca=a.autoStart;this.l.vb=!1;this.Db=this.Ta=0;this.Eb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.pa=[];this.sc=this.ye.bind(this);this.za=this.sa=this.ya=this.a=this.W=this.ra=this.kb=this.xa=this.Za=this.Wb=this.Ia=0;this.la=null;F(this)}n(zc,z);h=zc.prototype;
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.D=d;this.la=a.f;for(a=0;a<Ac.length;a++)(b=this.j[Ac[a]])&&this.A.aa(null,Ac[a],b);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.Y=function(a,b){var c=Bc(this.A,"autoStart");null!=c?this.l.Ca="true"==c?!0:"false"==c?!1:!!c:null==this.l.Ca&&(this.l.Ca=void 0===this.j.run);if(!b){if(a&&this.restore){Cc(this);if(!this.restore(a))return!1;Dc(this)}else this.reset();this.U("No debugger detected");this.l.Ca||this.U("CPU will not be auto-started, click Run to start")}return!0};
|
|
|
|
|
h.ga=function(a){return a?this.save():!0};h.Ca=function(){return this.l.P?!0:this.l.Ca?(rb(this),!0):!1};h.zc=function(){return 0};function Dc(a){void 0===a.Eb&&(a.Eb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.l.vb=0<=a.Eb&&0<a.lb;a.l.vb&&(a.Db=0,a.Ta=a.Eb-a.za)}function ub(a,b){if(a.l.vb){var c=!1;a.Db=a.Db+a.zc()|0;a.Ta-=b;0>=a.Ta&&(a.Ta+=a.lb,c=!0);0<=a.mb&&a.mb<=Ec(a)&&(a.lb=a.mb=-1,Dc(a),G(a),c=!0);c&&a.U(Ec(a)+" cycles: checksum="+ka(a.Db))}}
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.R)a=!0;else{var b=null,c,k=B(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.l.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.l.R);c++);c==k.length&&(b=a);y("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.xb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.P?G(d):rb(d))},!0;case "speed":return this.j[b]=
|
|
|
|
|
c,!0;case "setSpeed":return this.j[b]=c,c.onclick=function(){Fc(d,d.La<<1,!0)},c.textContent=this.Va.toFixed(2)+"Mhz",!0}return!1};function tb(a,b,c){a.za+=b;c&&(a.ya=a.a=a.W=0)}function Gc(a,b){var c=1;b&&1<a.La&&a.Ia&&(c=a.Ia/a.Ub);a.Vb=Math.round(1E3/Hc);a.nb=Math.floor(a.Ib/Hc*c);b||(a.Ya=a.nb);a.Jb=0}function Ec(a){return a.za+a.sa+a.ya-a.a}function Cc(a){a.Ia=0;a.Wb=0;a.za=a.sa=a.ya=a.a=a.W=0;Dc(a);Fc(a,1)}
|
|
|
|
|
function Fc(a,b,c){if(void 0!==b){.8>a.Ia/a.Va&&(b=1);a.La=b;b=a.Ub*a.La;if(a.Va!=b){a.Va=b;b=a.Va.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.A&&Ic(a.A)}tb(a,a.sa);a.sa=0;a.ra=qa();a.xa=0;Gc(a)}function ac(a,b){var c=a.pa.length;a.pa.push([-1,b]);return c}function bc(a,b,c,d){0<=b&&b<a.pa.length&&(d||0>a.pa[b][0])&&(c=a.Ib*a.La/1E3*c|0,a.l.P&&(c+=Jc(a)),a.pa[b][0]=c)}
|
|
|
|
|
function Fc(a,b,c){if(void 0!==b){.8>a.Ia/a.Va&&(b=1);a.La=b;b=a.Ub*a.La;if(a.Va!=b){a.Va=b;b=a.Va.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.A&&Ic(a.A)}tb(a,a.sa);a.sa=0;a.ra=ra();a.xa=0;Gc(a)}function ac(a,b){var c=a.pa.length;a.pa.push([-1,b]);return c}function bc(a,b,c,d){0<=b&&b<a.pa.length&&(d||0>a.pa[b][0])&&(c=a.Ib*a.La/1E3*c|0,a.l.P&&(c+=Jc(a)),a.pa[b][0]=c)}
|
|
|
|
|
function sb(a,b){for(var c=a.pa.length-1;0<=c;c--){var d=a.pa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Jc(a,b){var c=a.ya-=a.a;a.a=a.W=0;b&&(a.ya=0);return c}
|
|
|
|
|
h.ye=function(){if(this.l.P){this.Jb>=this.Ib&&Gc(this,!0);this.Za=0;this.kb=qa();if(this.xa){var a=this.kb-this.xa;a>this.Vb&&(this.ra+=a,this.ra>this.kb&&(this.ra=this.kb))}try{do{for(var b,c=this.l.vb?1:this.nb,d=this.pa.length-1;0<=d;d--){var e=this.pa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Rb(b)}catch(f){if("number"!=typeof f)throw f;}b=Jc(this,!0);this.Za+=b;this.sa+=b;ub(this,b);sb(this,b);this.Ya-=b;if(0>=this.Ya){this.Ya+=this.nb;++this.Wb>=Kc&&(this.A&&vb(this.A,void 0),this.Wb=0);break}}while(this.l.P)}catch(f){H(this);
|
|
|
|
|
this.A&&this.A.stop(qa(),Ec(this));Qa(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.sc;this.xa=qa();c=this.Vb;this.Za&&(c=Math.round(c*this.Za/this.nb));c-=this.xa-this.kb;if(d=this.xa-this.ra)this.Ia=Math.round(this.sa/(10*d))/100,864E5<=d&&(this.za=0,Fc(this));if(0>c||this.Ia<this.Va)-1E3>c&&(this.ra-=c),c=0;this.Jb+=this.Za;this.xa+=c;a(b,c)}}};
|
|
|
|
|
function rb(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.U(a.toString()+" busy");else{Fc(a);a.l.P=!0;a.l.cc=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ra,Ec(a));a.D||a.status("Started");setTimeout(a.sc,0)}}h.Rb=function(){return 0};function H(a){var b=!1;if(a.l.P){Jc(a);tb(a,a.sa);a.sa=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(qa(),Ec(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Hc=30,Kc=15,Ac=["power","reset"];
|
|
|
|
|
h.ye=function(){if(this.l.P){this.Jb>=this.Ib&&Gc(this,!0);this.Za=0;this.kb=ra();if(this.xa){var a=this.kb-this.xa;a>this.Vb&&(this.ra+=a,this.ra>this.kb&&(this.ra=this.kb))}try{do{for(var b,c=this.l.vb?1:this.nb,d=this.pa.length-1;0<=d;d--){var e=this.pa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Rb(b)}catch(f){if("number"!=typeof f)throw f;}b=Jc(this,!0);this.Za+=b;this.sa+=b;ub(this,b);sb(this,b);this.Ya-=b;if(0>=this.Ya){this.Ya+=this.nb;++this.Wb>=Kc&&(this.A&&vb(this.A,void 0),this.Wb=0);break}}while(this.l.P)}catch(f){G(this);
|
|
|
|
|
this.A&&this.A.stop(ra(),Ec(this));Qa(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.sc;this.xa=ra();c=this.Vb;this.Za&&(c=Math.round(c*this.Za/this.nb));c-=this.xa-this.kb;if(d=this.xa-this.ra)this.Ia=Math.round(this.sa/(10*d))/100,864E5<=d&&(this.za=0,Fc(this));if(0>c||this.Ia<this.Va)-1E3>c&&(this.ra-=c),c=0;this.Jb+=this.Za;this.xa+=c;a(b,c)}}};
|
|
|
|
|
function rb(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.U(a.toString()+" busy");else{Fc(a);a.l.P=!0;a.l.cc=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ra,Ec(a));a.D||a.status("Started");setTimeout(a.sc,0)}}h.Rb=function(){return 0};function G(a){var b=!1;if(a.l.P){Jc(a);tb(a,a.sa);a.sa=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ra(),Ec(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Hc=30,Kc=15,Ac=["power","reset"];
|
|
|
|
|
function Lc(a){var b=+a.model||1170;zc.call(this,a,6666667);this.wa=b;this.oc=a.addrReset||0;this.i=this.v=this.m=this.o=this.w=0;this.b=this.ta=this.da=[];this.C=0;this.qc=[];this.u=this.I=this.Na=this.Mb=[];this.Kb=this.Fa=this.F=this.nc=this.Ja=this.Wa=this.Xa=this.Ka=this.G=this.bb=this.Ma=this.H=this.ob=this.pb=this.na=this.Aa=this.h=this.f=this.Cb=this.K=this.M=this.g=this.Lb=0;this.rc=255;1120>=this.wa?(this.mc=Mc.bind(this),this.Ua=this.bd,this.Kb=8,this.rc=-1,this.uc=255,this.tc=0):(this.mc=
|
|
|
|
|
Nc.bind(this),this.Ua=this.cd,this.uc=~(1792|(1145>this.wa?2048:0))&65535,this.tc=1145<=this.wa?2048:0);this.$a=0;this.ca=null;this.Tb=[];this.l.complete=!1;this.zb=this.ic=this.ed;this.Ab=this.jc=this.gd;this.Pb=this.Qb=this.Ae;this.Bb=this.Sb=this.Be;this.qa=this.yb=0;this.ma=this.Ac;this.V=this.Dc;this.jb=this.Gc;this.Wc=this.Vc=0}n(Lc,zc);h=Lc.prototype;h.X=function(a,b,c,d){zc.prototype.X.call(this,a,b,c,d);this.ic=b.Hc.bind(b);this.jc=b.tb.bind(b);this.Qb=b.Ic.bind(b);this.Sb=b.ub.bind(b)};
|
|
|
|
|
h.Y=function(a,b){for(var c=192,d=0;d<this.Tb.length;d++){var e=this.Tb[d];0>e.ec&&(e.ec=c,c+=4)}return zc.prototype.Y.call(this,a,b)};
|
|
|
|
|
h.reset=function(){this.status("Model "+this.wa);this.l.P&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.oc,-1,-2,-3,-4,-5,-6,-7,-8];this.ta=[0,0,0,0,0,0];this.da=[0,0,0,0];this.C=0;this.qc=[4,2,0,1];this.u=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
|
|
|
|
h.reset=function(){this.status("Model "+this.wa);this.l.P&&G(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.oc,-1,-2,-3,-4,-5,-6,-7,-8];this.ta=[0,0,0,0,0,0];this.da=[0,0,0,0];this.C=0;this.qc=[4,2,0,1];this.u=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
|
|
|
|
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Na=[0,0,0,0,0,0,0,0,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.Mb=[0,0,0,0,0,0,0,0];this.h=this.f=this.Cb=this.K=this.M=this.g=this.Lb=0;this.Aa=-1;pb(this);Cc(this);this.l.error=!1;zc.prototype.reset.call(this)};function pb(a){a.H=0;a.ob=0;a.pb=0;a.na=0;a.G=0;a.bb=0;a.Ma=255;a.Ja=0;a.Wa=0;a.Xa=0;a.Ka=262143;a.Fa=a.b[7];a.F=0;a.ca=null;a.s&&(gc(a),a.nc=Vb(a.s))}
|
|
|
|
|
function gc(a){a.zb=a.ic;a.Ab=a.jc;a.Pb=a.Qb;a.Bb=a.Sb;a.Ja?(a.qa=65536,a.yb=a.na&16?4186112:253952,a.ma=a.Ac,a.V=a.Dc,a.jb=a.Gc,Ob(a.s,a.na&16?22:18)):(a.qa=0,a.yb=57344,a.ma=a.fd,a.V=a.se,a.jb=a.Ef,Ob(a.s,16))}function fc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.ob=a.F>>16&65535,a.pb=a.F&65535);a.H=b;a.Wa=(b&96)>>5;a.Xa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ja!=c&&(a.Ja=c,gc(a))}}
|
|
|
|
|
function Oc(a,b,c){a.oc=b;a.s.reset();pb(a);Q(a,b);ic(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||rb(a)}else a.D?H(a)||a.D.g():!1===c&&H(a);!a.l.P&&a.la&&a.la.stop()}h.zc=function(){return 0};h.save=function(){var a=new R(this);a.set(0,[this.b,this.ta,this.da,this.Na,this.Mb,this.G,this.Lb,this.bb,this.Ma,hc(this),this.Aa,this.C,this.g,this.H,this.ob,this.pb,this.na,this.Wa,this.Xa,this.u,this.I,this.Ja,this.Ka,this.Fa,this.F]);a.set(1,[this.za,this.La]);a.set(2,Ub(this.s));return a.data()};
|
|
|
|
|
h.restore=function(a){var b=a[1];this.za=b[1];Fc(this,b[3]);a:{b=this.s;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.K){for(var f=0,g=Array(b.K),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.a[d];if(!f||!f.restore(e)){z("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function S(a){return a.v&65536?1:0}function Pc(a){return a.w&32768?8:0}function Qc(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}
|
|
|
|
|
function T(a,b,c){c&&(Q(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function Q(a,b){a.b[7]=b&65535}function cc(a,b,c,d){c={ec:b,eb:c,message:d||0,next:null};c.name=Za[b];a.Tb.push(c);return c}function ec(a,b){var c=a.ca;if(c==b)a.ca=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ca&&(a.g|=1)}function M(a,b){if(b){if(b!=a.ca){var c=a.ca;if(!c||c.eb<=b.eb)b.next=c,a.ca=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}
|
|
|
|
|
function Rc(a){return a.g&64?(K(a,168,64,-6),!0):a.g&32?(K(a,4,32,-5),!0):a.g&16?(K(a,12,16,-7),!0):!1}function hc(a){return a.i=a.i&63728|Pc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|S(a)}function ic(a,b){b&=a.uc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.tc)for(var c=a.ta.length;0<=--c;){var d=a.b[c];a.b[c]=a.ta[c];a.ta[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.da[c]=a.b[6],a.b[6]=a.da[a.C]);a.i=b;a.g&=-3;a.g|=a.ca?2:1}h.ba=function(a){this.w=this.o=a;this.m=0};
|
|
|
|
|
h.Ea=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function Sc(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}function Tc(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function K(a,b,c,d){if(!a.$a){0>a.Aa?a.Aa=hc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.V(b|a.qa),f=a.V(b+2&65535|a.qa);ic(a,f&-12289|a.Aa>>2&12288);Uc(a,a.Aa);Uc(a,a.b[7]);Q(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Aa=-1;a.Wc=b;a.Vc=d;-1==d&&H(a);if(-4<=d)throw b;}}
|
|
|
|
|
function Vc(a){var b=Wc(a),c=Wc(a);a.i&49152&&(c=c&-225|a.i&63712);Q(a,b);ic(a,c);a.g&=-17}function Xc(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Na[c]+(b&8191)&4194303:b&-3932161);return b}
|
|
|
|
|
function zb(a,b,c){var d,e,f;if(!(c&a.Ja))return f=b&65535,57344<=f&&(f|=a.yb),f;d=b>>13;a.na&a.qc[a.C]||(d&=7);e=a.u[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ka;3932160<=f&&(f=Xc(a,f));if(a.$a)return f;f>=a.nc&&f<a.yb?(a.G|=32,K(a,4,0,f)):f&1&&!(c&1)&&(a.G|=64,K(a,4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&
|
|
|
|
|
(g|=16384));a.u[a.C][d]=e;if(f!=(4194170&a.Ka)||a.C)a.Wa=a.C,a.Xa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Wa<<5|a.Xa<<1,fc(a,a.H&-61695|g&61694)),K(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ka)||f>(4194239&a.Ka))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function Wc(a){var b=a.V(a.b[6]|a.qa);a.b[6]=a.b[6]+2&65535;return b}function Uc(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ua(4,-2,c);a.jb(c,b)}
|
|
|
|
|
function Yc(a,b,c,d){var e,f,g=d&8?0:a.qa;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ua(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ua(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ua(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,6==c&&a.Ua(d,0,
|
|
|
|
|
e),a.a-=6,e|g;case 7:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.qa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.bd=function(a,b,c){!this.C&&0>=b&&c<=this.Ma&&(this.g|=32)};h.cd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ma&&(c<=this.Ma-32?K(this,4,0,-4):(this.G|=8,this.g|=32)))};h.ed=function(a){return this.ic(a)};h.gd=function(a){return this.jc(a)};h.Ae=function(a,b){this.Qb(a,b)};h.Be=function(a,b){this.Sb(a,b)};
|
|
|
|
|
function Oc(a,b,c){a.oc=b;a.s.reset();pb(a);P(a,b);ic(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||rb(a)}else a.D?G(a)||a.D.g():!1===c&&G(a);!a.l.P&&a.la&&a.la.stop()}h.zc=function(){return 0};h.save=function(){var a=new Q(this);a.set(0,[this.b,this.ta,this.da,this.Na,this.Mb,this.G,this.Lb,this.bb,this.Ma,hc(this),this.Aa,this.C,this.g,this.H,this.ob,this.pb,this.na,this.Wa,this.Xa,this.u,this.I,this.Ja,this.Ka,this.Fa,this.F]);a.set(1,[this.za,this.La]);a.set(2,Ub(this.s));return a.data()};
|
|
|
|
|
h.restore=function(a){var b=a[1];this.za=b[1];Fc(this,b[3]);a:{b=this.s;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.K){for(var f=0,g=Array(b.K),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.a[d];if(!f||!f.restore(e)){y("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function R(a){return a.v&65536?1:0}function Pc(a){return a.w&32768?8:0}function Qc(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}
|
|
|
|
|
function S(a,b,c){c&&(P(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function P(a,b){a.b[7]=b&65535}function cc(a,b,c,d){c={ec:b,eb:c,message:d||0,next:null};c.name=Za[b];a.Tb.push(c);return c}function ec(a,b){var c=a.ca;if(c==b)a.ca=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ca&&(a.g|=1)}function L(a,b){if(b){if(b!=a.ca){var c=a.ca;if(!c||c.eb<=b.eb)b.next=c,a.ca=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}
|
|
|
|
|
function Rc(a){return a.g&64?(J(a,168,64,-6),!0):a.g&32?(J(a,4,32,-5),!0):a.g&16?(J(a,12,16,-7),!0):!1}function hc(a){return a.i=a.i&63728|Pc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|R(a)}function ic(a,b){b&=a.uc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.tc)for(var c=a.ta.length;0<=--c;){var d=a.b[c];a.b[c]=a.ta[c];a.ta[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.da[c]=a.b[6],a.b[6]=a.da[a.C]);a.i=b;a.g&=-3;a.g|=a.ca?2:1}h.ba=function(a){this.w=this.o=a;this.m=0};
|
|
|
|
|
h.Ea=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function Sc(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}function Tc(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function J(a,b,c,d){if(!a.$a){0>a.Aa?a.Aa=hc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.V(b|a.qa),f=a.V(b+2&65535|a.qa);ic(a,f&-12289|a.Aa>>2&12288);Uc(a,a.Aa);Uc(a,a.b[7]);P(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Aa=-1;a.Wc=b;a.Vc=d;-1==d&&G(a);if(-4<=d)throw b;}}
|
|
|
|
|
function Vc(a){var b=Wc(a),c=Wc(a);a.i&49152&&(c=c&-225|a.i&63712);P(a,b);ic(a,c);a.g&=-17}function Xc(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Na[c]+(b&8191)&4194303:b&-3932161);return b}
|
|
|
|
|
function zb(a,b,c){var d,e,f;if(!(c&a.Ja))return f=b&65535,57344<=f&&(f|=a.yb),f;d=b>>13;a.na&a.qc[a.C]||(d&=7);e=a.u[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ka;3932160<=f&&(f=Xc(a,f));if(a.$a)return f;f>=a.nc&&f<a.yb?(a.G|=32,J(a,4,0,f)):f&1&&!(c&1)&&(a.G|=64,J(a,4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&
|
|
|
|
|
(g|=16384));a.u[a.C][d]=e;if(f!=(4194170&a.Ka)||a.C)a.Wa=a.C,a.Xa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Wa<<5|a.Xa<<1,fc(a,a.H&-61695|g&61694)),J(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ka)||f>(4194239&a.Ka))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function Wc(a){var b=a.V(a.b[6]|a.qa);a.b[6]=a.b[6]+2&65535;return b}function Uc(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ua(4,-2,c);a.jb(c,b)}
|
|
|
|
|
function Yc(a,b,c,d){var e,f,g=d&8?0:a.qa;switch(b){case 0:return J(a,4,0,-3),0;case 1:return 6==c&&a.Ua(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ua(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ua(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,6==c&&a.Ua(d,0,
|
|
|
|
|
e),a.a-=6,e|g;case 7:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.qa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.bd=function(a,b,c){!this.C&&0>=b&&c<=this.Ma&&(this.g|=32)};h.cd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ma&&(c<=this.Ma-32?J(this,4,0,-4):(this.G|=8,this.g|=32)))};h.ed=function(a){return this.ic(a)};h.gd=function(a){return this.jc(a)};h.Ae=function(a,b){this.Qb(a,b)};h.Be=function(a,b){this.Sb(a,b)};
|
|
|
|
|
h.fd=function(a,b,c){return Yc(this,a,b,c)};h.Ac=function(a,b,c){return zb(this,Yc(this,a,b,c),c)};h.se=function(a){return this.s.tb(this.Fa=a)};h.Dc=function(a){return this.s.tb(this.Fa=zb(this,a,2))};h.Ef=function(a,b){this.s.ub(this.Fa=a,b)};h.Gc=function(a,b){this.s.ub(this.Fa=zb(this,a,4),b)};
|
|
|
|
|
function Zc(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=Yc(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.V(d|c&a.qa),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.da[a.i>>12&3];return c}function $c(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=Yc(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=zb(a,e|c&65536,4),a.C=a.i>>14&3,a.Bb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.da[a.i>>12&3]=d}
|
|
|
|
|
function ad(a,b){b>>=6;var c=a.M=b&7;return(b=a.K=(b&56)>>3)?a.zb(a.ma(b,c,3)):a.b[c+a.Kb]&a.rc}function bd(a,b){var c;b>>=6;var d=a.M=b&7;(b=a.K=(b&56)>>3)?c=a.Ab(a.ma(b,d,2)):c=a.b[d+a.Kb];return c}function cd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return Yc(a,b,c,8)}function dd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.zb(a.ma(b,c,3)):a.b[c]&255}function ed(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Ab(a.ma(b,d,2)):c=a.b[d];return c}
|
|
|
|
|
function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Cb=a.ma(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Pb(e,d.call(a,c,a.zb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ma(b,e,6),a.Bb(e,d.call(a,0>c?a.b[-c-1]:c,a.Ab(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])}
|
|
|
|
|
function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Cb=a.ma(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Pb(e,d.call(a,c,a.zb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ma(b,e,6),a.Bb(e,d.call(a,0>c?a.b[-c-1]:c,a.Ab(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])}
|
|
|
|
|
function fd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.ma(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Pb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function gd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ma(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Bb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))}
|
|
|
|
|
h.Rb=function(a){this.l.complete=!0;var b=a?this.l.cc?0:1:-1;this.l.cc=!1;this.ya=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.bb&224)>>5,e=this.ca&&this.ca.eb>d?this.ca:null;e&&(c=e.ec,d=e.eb);d>(this.i&224)>>5?(this.g&8&&(Qc(this,2),this.g&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&ec(this,e),a=!0);this.ca||this.bb||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&Rc(this)){if(this.g&
|
|
|
|
|
4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.mc(e)}while(0<this.a);return this.l.complete?this.ya-this.a:void 0===this.l.complete?0:-1};Ea(function(){for(var a=F(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Lc(d);E(d,c)}});function hd(a,b){var c=b+a;this.w=this.o=this.v=c;this.m=(a^c)&(b^c);return c&65535}
|
|
|
|
|
h.Rb=function(a){this.l.complete=!0;var b=a?this.l.cc?0:1:-1;this.l.cc=!1;this.ya=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.bb&224)>>5,e=this.ca&&this.ca.eb>d?this.ca:null;e&&(c=e.ec,d=e.eb);d>(this.i&224)>>5?(this.g&8&&(Qc(this,2),this.g&=-9),J(this,c,0,-10),d=!0):d=!1;d&&(e&&ec(this,e),a=!0);this.ca||this.bb||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){G(this);break}if(0>b)break}if(this.g&112&&Rc(this)){if(this.g&
|
|
|
|
|
4&&this.D.b(this.b[7],b)){G(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.mc(e)}while(0<this.a);return this.l.complete?this.ya-this.a:void 0===this.l.complete?0:-1};Ea(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Lc(d);D(d,c)}});function hd(a,b){var c=b+a;this.w=this.o=this.v=c;this.m=(a^c)&(b^c);return c&65535}
|
|
|
|
|
function id(a,b){var c=b+a,d=c<<8;this.w=this.o=this.v=d;this.m=(a<<8^d)&(b<<8^d);return c&255}function jd(a,b){a=b<<1;Sc(this,a);return a&65535}function kd(a,b){a=b<<1;Sc(this,a<<8);return a&255}function ld(a,b){a=b&32768|b>>1|b<<16;Sc(this,a);return a&65535}function md(a,b){a=b&128|b>>1|b<<8;Sc(this,a<<8);return a&255}function nd(a,b){a=b&~a;this.ba(a);return a}function od(a,b){a=b&~a;this.ba(a<<8);return a}function pd(a,b){a|=b;this.ba(a);return a}function qd(a,b){a|=b;this.ba(a<<8);return a}
|
|
|
|
|
function rd(a,b){a=~b|65536;this.Ea(a);return a&65535}function sd(a,b){a=~b|256;this.Ea(a<<8);return a&255}function td(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function ud(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function vd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function wd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function xd(a,b){a=-b;this.Ea(a,a&b&32768);return a&65535}
|
|
|
|
|
function yd(a,b){a=-b;this.Ea(a<<8,(a&b&128)<<8);return a&255}function zd(a,b){a=b<<1|this.v>>16&1;Sc(this,a);return a&65535}function Ad(a,b){a=b<<1|this.v>>16&1;Sc(this,a<<8);return a&255}function Bd(a,b){a=(this.v&65536|b)>>1|b<<16;Sc(this,a);return a&65535}function Cd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;Sc(this,a<<8);return a&255}function Dd(a,b){var c=b-a;Tc(this,c,a,b);return c&65535}function Ed(a,b){var c=b-a;Tc(this,c<<8,a<<8,b<<8);return c&255}
|
|
|
|
|
function Fd(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Gd(a,b){a^=b;this.ba(a);return a&65535}function Hd(a){V(this,a,bd(this,a),hd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function Fd(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Gd(a,b){a^=b;this.ba(a);return a&65535}function Hd(a){U(this,a,bd(this,a),hd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function Id(a){var b=ed(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.m=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.v=c<<17-b,c>>=b;else if(b)if(16<b)this.m=c,c=0;else{this.v=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b}
|
|
|
|
|
function Jd(a){var b=ed(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.v=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.m=32768)):d=c;this.b[a]=d>>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Kd(a){T(this,a,!S(this))}function Ld(a){T(this,a,S(this))}
|
|
|
|
|
function Md(a){V(this,a,bd(this,a),nd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Nd(a){U(this,a,ad(this,a),od);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Od(a){V(this,a,bd(this,a),pd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Pd(a){U(this,a,ad(this,a),qd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function Qd(a){var b=bd(this,a);a=ed(this,a);this.ba((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Rd(a){var b=ad(this,a);a=dd(this,a);this.ba(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Sd(a){T(this,a,this.o&65535?0:4)}function Td(a){T(this,a,!Pc(this)==!(this.m&32768))}function Ud(a){T(this,a,!!(this.o&65535)&&!Pc(this)==!(this.m&32768))}
|
|
|
|
|
function Vd(a){T(this,a,!S(this)&&!!(this.o&65535))}function Wd(a){T(this,a,(this.o&65535?0:4)||!Pc(this)!=!(this.m&32768))}function Xd(a){T(this,a,S(this)||(this.o&65535?0:4))}function Yd(a){T(this,a,!Pc(this)!=!(this.m&32768))}function Zd(a){T(this,a,Pc(this))}function $d(a){T(this,a,!!(this.o&65535))}function ae(a){T(this,a,!Pc(this))}function be(){K(this,12,0,-9)}function ce(a){T(this,a,!0)}function de(a){T(this,a,!(this.m&32768))}function ee(a){T(this,a,this.m&32768?2:0)}
|
|
|
|
|
function W(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function fe(a){var b=bd(this,a);a=ed(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ge(a){var b=ad(this,a);a=dd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
|
|
|
|
function he(a){var b=ed(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function ie(){K(this,24,0,-9);this.a-=20}
|
|
|
|
|
function je(){this.i&49152?(this.G|=128,K(this,4,0,-8)):(this.la&&1120==this.wa&&this.la.setData(this.b[0],!0),this.D?this.D.i():H(this));this.a-=7}function ke(){K(this,16,0,-9);this.a-=20}var le=[0,7,7,10,7,11,9,13];function me(a){this.W=this.a;Q(this,cd(this,a));this.a=this.W-le[this.h]}var ne=[0,14,14,17,14,18,16,20];function oe(a){this.W=this.a;var b=cd(this,a);a=a>>6&7;Uc(this,this.b[a]);this.b[a]=this.b[7];Q(this,b);this.a=this.W-ne[this.h]}var pe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
|
|
|
|
function Jd(a){var b=ed(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.v=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.m=32768)):d=c;this.b[a]=d>>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Kd(a){S(this,a,!R(this))}function Ld(a){S(this,a,R(this))}
|
|
|
|
|
function Md(a){U(this,a,bd(this,a),nd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Nd(a){T(this,a,ad(this,a),od);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Od(a){U(this,a,bd(this,a),pd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Pd(a){T(this,a,ad(this,a),qd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function Qd(a){var b=bd(this,a);a=ed(this,a);this.ba((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Rd(a){var b=ad(this,a);a=dd(this,a);this.ba(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Sd(a){S(this,a,this.o&65535?0:4)}function Td(a){S(this,a,!Pc(this)==!(this.m&32768))}function Ud(a){S(this,a,!!(this.o&65535)&&!Pc(this)==!(this.m&32768))}
|
|
|
|
|
function Vd(a){S(this,a,!R(this)&&!!(this.o&65535))}function Wd(a){S(this,a,(this.o&65535?0:4)||!Pc(this)!=!(this.m&32768))}function Xd(a){S(this,a,R(this)||(this.o&65535?0:4))}function Yd(a){S(this,a,!Pc(this)!=!(this.m&32768))}function Zd(a){S(this,a,Pc(this))}function $d(a){S(this,a,!!(this.o&65535))}function ae(a){S(this,a,!Pc(this))}function be(){J(this,12,0,-9)}function ce(a){S(this,a,!0)}function de(a){S(this,a,!(this.m&32768))}function ee(a){S(this,a,this.m&32768?2:0)}
|
|
|
|
|
function V(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function fe(a){var b=bd(this,a);a=ed(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ge(a){var b=ad(this,a);a=dd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
|
|
|
|
function he(a){var b=ed(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function ie(){J(this,24,0,-9);this.a-=20}
|
|
|
|
|
function je(){this.i&49152?(this.G|=128,J(this,4,0,-8)):(this.la&&1120==this.wa&&this.la.setData(this.b[0],!0),this.D?this.D.i():G(this));this.a-=7}function ke(){J(this,16,0,-9);this.a-=20}var le=[0,7,7,10,7,11,9,13];function me(a){this.W=this.a;P(this,cd(this,a));this.a=this.W-le[this.h]}var ne=[0,14,14,17,14,18,16,20];function oe(a){this.W=this.a;var b=cd(this,a);a=a>>6&7;Uc(this,this.b[a]);this.b[a]=this.b[7];P(this,b);this.a=this.W-ne[this.h]}var pe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
|
|
|
|
function qe(a){var b=bd(this,a);this.W=this.a;gd(this,a,b,this.ba);this.a=this.W-pe[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function re(a){var b=ad(this,a);fd(this,a,b,65535,this.ba);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var se=[7,13,13,17,14,18,17,21];
|
|
|
|
|
function te(a){var b=ed(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.b[a];c&32768&&(c|=-65536);b=~~(b*c);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767<b?65536:0;this.a-=23}function ue(){this.a-=5}function ve(){this.i&49152||(this.s.reset(),pb(this),this.la&&this.la.setData(this.b[0],!0));this.a-=667}function we(a){if(a&8)K(this,8,0,-9);else{var b=Wc(this);a&=7;7==a?Q(this,b):(Q(this,this.b[a]),this.b[a]=b);this.a-=9}}
|
|
|
|
|
function xe(){Vc(this);this.a-=13}function X(a){a&1&&(this.v=65536);a&2&&(this.m=32768);a&4&&(this.o=0);a&8&&(this.w=32768);this.a-=5}function ye(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)Q(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ze(a){V(this,a,bd(this,a),Dd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ae(a){V(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}function Be(){K(this,28,0,-9)}
|
|
|
|
|
function Ce(){this.la&&(this.la.ha=this.b[7],this.la.setData(this.b[0],!0));this.g|=8;Qc(this,-2);this.a-=3}function De(a){V(this,a,this.b[(a>>6&7)+this.Kb],Gd);this.a-=this.h?9:3+(7==this.f?2:0)}function Y(){K(this,8,0,-9)}function Mc(a){Ee[a>>12].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a&15].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)}
|
|
|
|
|
function te(a){var b=ed(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.b[a];c&32768&&(c|=-65536);b=~~(b*c);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767<b?65536:0;this.a-=23}function ue(){this.a-=5}function ve(){this.i&49152||(this.s.reset(),pb(this),this.la&&this.la.setData(this.b[0],!0));this.a-=667}function we(a){if(a&8)J(this,8,0,-9);else{var b=Wc(this);a&=7;7==a?P(this,b):(P(this,this.b[a]),this.b[a]=b);this.a-=9}}
|
|
|
|
|
function xe(){Vc(this);this.a-=13}function W(a){a&1&&(this.v=65536);a&2&&(this.m=32768);a&4&&(this.o=0);a&8&&(this.w=32768);this.a-=5}function ye(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)P(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ze(a){U(this,a,bd(this,a),Dd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ae(a){U(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}function Be(){J(this,28,0,-9)}
|
|
|
|
|
function Ce(){this.la&&(this.la.ha=this.b[7],this.la.setData(this.b[0],!0));this.g|=8;Qc(this,-2);this.a-=3}function De(a){U(this,a,this.b[(a>>6&7)+this.Kb],Gd);this.a-=this.h?9:3+(7==this.f?2:0)}function Y(){J(this,8,0,-9)}function Mc(a){Ee[a>>12].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a&15].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)}
|
|
|
|
|
function Re(a){Se[a>>6&3].call(this,a)}function Te(a){Ue[a>>6&3].call(this,a)}
|
|
|
|
|
var Ee=[function(a){Ve[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,Y,function(a){We[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],Ve=[function(a){Xe[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,Y,Y,Y],Ge=[function(a){gd(this,a,0,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,0,rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,1,vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,1,td);this.a-=this.h?9:3+(7==this.f?2:0)}],Ie=[function(a){V(this,a,0,xd);
|
|
|
|
|
this.a-=this.h?11:6},function(a){V(this,a,S(this)?1:0,hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,S(this)?1:0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=ed(this,a);this.Ea(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Ke=[function(a){V(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,0,zd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,0,ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){V(this,a,0,jd);this.a-=this.h?9:3+(7==this.f?2:0)}],Xe=[function(a){Ye[a&
|
|
|
|
|
15].call(this,a)},Y,Y,Y,me,me,me,me,we,Y,Le,Ne,Ae,Ae,Ae,Ae],Ye=[je,Ce,xe,be,ke,ve,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Me=[ue,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},W,function(){this.o=1;this.a-=5},W,W,W,function(){this.w=0;this.a-=5},W,W,W,W,W,W,W],Oe=[ue,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},X,function(){this.o=0;this.a-=5},X,X,X,function(){this.w=32768;this.a-=5},X,X,X,X,X,X,X],We=[ae,Zd,Vd,Xd,de,ee,Kd,Ld,ie,Be,Pe,Re,Te,Y,Y,Y],Qe=[function(a){fd(this,a,0,
|
|
|
|
|
255,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,ud);this.a-=this.h?9:3+(7==this.f?2:0)}],Se=[function(a){U(this,a,0,yd);this.a-=this.h?11:6},function(a){U(this,a,S(this)?1:0,id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,S(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=dd(this,a);this.Ea(a<<8);this.a-=this.h?4:3+(7==this.f?
|
|
|
|
|
2:0)}],Ue=[function(a){U(this,a,0,Cd);this.a-=this.h?9+(this.Cb&1):3+(7==this.f?2:0)},function(a){U(this,a,0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,md);this.a-=this.h?9+(this.Cb&1):3+(7==this.f?2:0)},function(a){U(this,a,0,kd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Nc(a){Ze[a>>12].call(this,a)}
|
|
|
|
|
var Ze=[function(a){$e[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,function(a){af[a>>8&15].call(this,a)},function(a){bf[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],$e=[function(a){cf[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.qa);Q(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=Zc(this,a,0);this.ba(a);Uc(this,a);this.a-=11},function(a){var b=Wc(this);this.W=
|
|
|
|
|
this.a;this.ba(b);$c(this,a,0,b);this.a=this.W-se[this.h]},function(a){gd(this,a,Pc(this)?65535:0,this.ba);this.a-=this.h?9:3+(7==this.f?2:0)}],cf=[function(a){ef[a&15].call(this,a)},Y,Y,Y,me,me,me,me,we,function(a){a&8?(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5):K(this,8,0,-9)},Le,Ne,Ae,Ae,Ae,Ae],ef=[je,Ce,function(){Vc(this);this.g|=this.i&16;this.a-=13},be,ke,ve,xe,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],af=[te,te,he,he,Id,Id,Jd,Jd,De,De,Y,Y,Y,Y,ye,ye],bf=[ae,
|
|
|
|
|
var Ee=[function(a){Ve[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,Y,function(a){We[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],Ve=[function(a){Xe[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,Y,Y,Y],Ge=[function(a){gd(this,a,0,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,td);this.a-=this.h?9:3+(7==this.f?2:0)}],Ie=[function(a){U(this,a,0,xd);
|
|
|
|
|
this.a-=this.h?11:6},function(a){U(this,a,R(this)?1:0,hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,R(this)?1:0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=ed(this,a);this.Ea(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Ke=[function(a){U(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,zd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,jd);this.a-=this.h?9:3+(7==this.f?2:0)}],Xe=[function(a){Ye[a&
|
|
|
|
|
15].call(this,a)},Y,Y,Y,me,me,me,me,we,Y,Le,Ne,Ae,Ae,Ae,Ae],Ye=[je,Ce,xe,be,ke,ve,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Me=[ue,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],Oe=[ue,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],We=[ae,Zd,Vd,Xd,de,ee,Kd,Ld,ie,Be,Pe,Re,Te,Y,Y,Y],Qe=[function(a){fd(this,a,0,
|
|
|
|
|
255,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ud);this.a-=this.h?9:3+(7==this.f?2:0)}],Se=[function(a){T(this,a,0,yd);this.a-=this.h?11:6},function(a){T(this,a,R(this)?1:0,id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,R(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=dd(this,a);this.Ea(a<<8);this.a-=this.h?4:3+(7==this.f?
|
|
|
|
|
2:0)}],Ue=[function(a){T(this,a,0,Cd);this.a-=this.h?9+(this.Cb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,md);this.a-=this.h?9+(this.Cb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,kd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Nc(a){Ze[a>>12].call(this,a)}
|
|
|
|
|
var Ze=[function(a){$e[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,function(a){af[a>>8&15].call(this,a)},function(a){bf[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],$e=[function(a){cf[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.qa);P(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=Zc(this,a,0);this.ba(a);Uc(this,a);this.a-=11},function(a){var b=Wc(this);this.W=
|
|
|
|
|
this.a;this.ba(b);$c(this,a,0,b);this.a=this.W-se[this.h]},function(a){gd(this,a,Pc(this)?65535:0,this.ba);this.a-=this.h?9:3+(7==this.f?2:0)}],cf=[function(a){ef[a&15].call(this,a)},Y,Y,Y,me,me,me,me,we,function(a){a&8?(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5):J(this,8,0,-9)},Le,Ne,Ae,Ae,Ae,Ae],ef=[je,Ce,function(){Vc(this);this.g|=this.i&16;this.a-=13},be,ke,ve,xe,function(){J(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],af=[te,te,he,he,Id,Id,Jd,Jd,De,De,Y,Y,Y,Y,ye,ye],bf=[ae,
|
|
|
|
|
Zd,Vd,Xd,de,ee,Kd,Ld,ie,Be,Pe,Re,Te,function(a){ff[a>>6&3].call(this,a)},Y,Y],ff=[Y,function(a){a=Zc(this,a,65536);this.ba(a);Uc(this,a);this.a-=11},function(a){var b=Wc(this);this.W=this.a;this.ba(b);$c(this,a,65536,b);this.a=this.W-se[this.h]},Y];
|
|
|
|
|
function gf(a){A.call(this,"ROM",a,0,128);this.ea=this.b=null;this.h=a.addr;this.a=a.size;this.i=!1;this.g=a.alias;this.f=a.file;this.m=v(this.f);if(this.f){a=this.f;var b=ka(this.m);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;x(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(Ma(c.Ha,a,b),(a=sa(a,b))?(c.b=a.N,c.ea=a.ea):c.f=null);hf(c)})}}n(gf,A);h=gf.prototype;
|
|
|
|
|
function gf(a){z.call(this,"ROM",a,0,128);this.ea=this.b=null;this.h=a.addr;this.a=a.size;this.i=!1;this.g=a.alias;this.f=a.file;this.m=u(this.f);if(this.f){a=this.f;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(Ma(c.Ha,a,b),(a=ta(a,b))?(c.b=a.N,c.ea=a.ea):c.f=null);hf(c)})}}n(gf,z);h=gf.prototype;
|
|
|
|
|
h.X=function(a,b,c,d){this.s=b;this.c=c;this.D=d;hf(this)};h.Y=function(){this.ea&&(this.D&&this.D.a(this.id,this.h,this.a,this.ea),delete this.ea);return!0};h.ga=function(){return!0};
|
|
|
|
|
function hf(a){if(!Ra(a)){if(a.f){if(!a.b||!a.s)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)Qa(a,"ROM size ("+u(a.b.length,8,!0)+") does not match specified size ("+u(a.a,8,!0)+")");else{var b;a:{b=a.h;a.status(a.a+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Gb){var c={};b=(c[b]=[gf.prototype.ee,gf.prototype.nf,null,null,null,a.a>>1],c);if(db(a.s,a,b)){b=a.i=!0;break a}}else if(Mb(a.s,b,a.a,mc)){for(c=0;c<a.b.length;c++)Tb(a.s,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?b.push(a.g):
|
|
|
|
|
null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.s,g=d.a,k=[],l=d.h>>>f.b;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.f;f=d.s;d=d.a;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.f}}a.i||delete a.b}}}G(a)}}h.ee=function(a){return this.b[a-this.h]};h.nf=function(){};Ea(function(){for(var a=F(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new gf(d);E(d,c)}});
|
|
|
|
|
function jf(a){A.call(this,"RAM",a);this.ea=this.b=null;this.f=a.addr;this.g=a.size;this.ja=a.load;this.ia=a.exec;this.h=!1;this.a=a.file;this.i=v(this.a);if(this.a){a=this.a;var b=ka(this.i);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;x(a,null,!0,function(a,b,f){f?(c.B("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(Ma(c.Ha,a,b),(a=sa(a,b))?(c.b=a.N,c.ea=a.ea,null==c.ja&&(c.ja=a.ja),null==c.ia&&(c.ia=a.ia)):c.a=null);kf(c)})}}
|
|
|
|
|
n(jf,A);jf.prototype.X=function(a,b,c,d){this.s=b;this.c=c;this.D=d;kf(this)};jf.prototype.Y=function(){this.ea&&(this.D&&this.D.a(this.id,this.f,this.g,this.ea),delete this.ea);return!0};jf.prototype.ga=function(){return!0};function kf(a){if(a.s&&(!a.h&&a.g&&(Mb(a.s,a.f,a.g,Wb)?a.h=!0:a.g=0),!Ra(a))){if(!a.h)z("No RAM allocated");else if(a.a){if(!a.b||!a.s)return;lf(a,a.b,a.ja,a.ia,a.f)}G(a)}}
|
|
|
|
|
function hf(a){if(!Ra(a)){if(a.f){if(!a.b||!a.s)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)Qa(a,"ROM size ("+ka(a.b.length,8,!0)+") does not match specified size ("+ka(a.a,8,!0)+")");else{var b;a:{b=a.h;a.status(a.a+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Gb){var c={};b=(c[b]=[gf.prototype.ee,gf.prototype.nf,null,null,null,a.a>>1],c);if(db(a.s,a,b)){b=a.i=!0;break a}}else if(Mb(a.s,b,a.a,mc)){for(c=0;c<a.b.length;c++)Tb(a.s,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?b.push(a.g):
|
|
|
|
|
null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.s,g=d.a,k=[],l=d.h>>>f.b;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.f;f=d.s;d=d.a;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.f}}a.i||delete a.b}}}F(a)}}h.ee=function(a){return this.b[a-this.h]};h.nf=function(){};Ea(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new gf(d);D(d,c)}});
|
|
|
|
|
function jf(a){z.call(this,"RAM",a);this.ea=this.b=null;this.f=a.addr;this.g=a.size;this.ja=a.load;this.ia=a.exec;this.h=!1;this.a=a.file;this.i=u(this.a);if(this.a){a=this.a;var b=la(this.i);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.B("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(Ma(c.Ha,a,b),(a=ta(a,b))?(c.b=a.N,c.ea=a.ea,null==c.ja&&(c.ja=a.ja),null==c.ia&&(c.ia=a.ia)):c.a=null);kf(c)})}}
|
|
|
|
|
n(jf,z);jf.prototype.X=function(a,b,c,d){this.s=b;this.c=c;this.D=d;kf(this)};jf.prototype.Y=function(){this.ea&&(this.D&&this.D.a(this.id,this.f,this.g,this.ea),delete this.ea);return!0};jf.prototype.ga=function(){return!0};function kf(a){if(a.s&&(!a.h&&a.g&&(Mb(a.s,a.f,a.g,Wb)?a.h=!0:a.g=0),!Ra(a))){if(!a.h)y("No RAM allocated");else if(a.a){if(!a.b||!a.s)return;lf(a,a.b,a.ja,a.ia,a.f)}F(a)}}
|
|
|
|
|
jf.prototype.reset=function(){if(this.h){for(var a=this.s,b=this.f,c=this.g,d=b&a.h,b=b>>>a.b;0<c&&b<a.a.length;){var e=a.a[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(Ya&&e.b)for(k=d;f--&&k<e.b.length;k++)e.b[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ob(d,g,e.Oa+d);c-=a.f;b++;d=0}this.b&&lf(this,this.b,this.ja,this.ia,this.f,!0)}};
|
|
|
|
|
function lf(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),w=l,y=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)Tb(a.s,t++,b[w++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
|
|
|
|
|
b.length;e++)Tb(a.s,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&Oc(a.c,d,f)}return k}Ea(function(){for(var a=F(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new jf(d);E(d,c)}});function mf(a){A.call(this,"Keyboard",a,0,1024);G(this)}n(mf,A);mf.prototype.aa=function(){return!1};mf.prototype.X=function(a,b,c,d){this.A=a;this.c=c;this.D=d};Ea(function(){for(var a=F(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new mf(d);E(d,c)}});
|
|
|
|
|
function Z(a){A.call(this,"SerialPort",a,0,262144);this.v=a.adapter;this.I=a.baudReceive||9600;this.da=a.baudTransmit||9600;this.ca=a.upperCase;this.f=this.i=null;this.M=a.tabSize;this.K=a.charBOL;this.m=0;this.u=!0;this.G=this.w=null;this.H=this.W=-1;this.o=this.a=this.b=0;this.g=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=nf;b&&(void 0===c&&(c="Panel"),(c=Pa(c,this.id))&&(b=c.j[b])&&this.aa(null,a,b))}this.h=this.C=this.F=null;this.exports={connect:this.Bc,receiveData:this.Gb,receiveStatus:this.xe}}
|
|
|
|
|
n(Z,A);h=Z.prototype;
|
|
|
|
|
function lf(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)Tb(a.s,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
|
|
|
|
|
b.length;e++)Tb(a.s,c+e,b[e]);k=!0}if(k){if(null==d||g)G(a.c),f=!1;null!=d&&Oc(a.c,d,f)}return k}Ea(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new jf(d);D(d,c)}});function mf(a){z.call(this,"Keyboard",a,0,1024);F(this)}n(mf,z);mf.prototype.aa=function(){return!1};mf.prototype.X=function(a,b,c,d){this.A=a;this.c=c;this.D=d};Ea(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new mf(d);D(d,c)}});
|
|
|
|
|
function Z(a){z.call(this,"SerialPort",a,0,262144);this.v=a.adapter;this.I=a.baudReceive||9600;this.da=a.baudTransmit||9600;this.ca=a.upperCase;this.f=this.i=null;this.M=a.tabSize;this.K=a.charBOL;this.m=0;this.u=!0;this.G=this.w=null;this.H=this.W=-1;this.o=this.a=this.b=0;this.g=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=nf;b&&(void 0===c&&(c="Panel"),(c=Pa(c,this.id))&&(b=c.j[b])&&this.aa(null,a,b))}this.h=this.C=this.F=null;this.exports={connect:this.Bc,receiveData:this.Gb,receiveStatus:this.xe}}
|
|
|
|
|
n(Z,z);h=Z.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case nf:return this.j[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.lc:q.Mc:46==c?b=q.lc:a.ctrlKey&&c>=q.kc&&c<=q.Xc&&(b=c-(q.kc-q.Jc));b&&(a.preventDefault&&a.preventDefault(),d.Gb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Lc&&(b=q.Kc);d.Gb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
|
|
|
|
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Gb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;var e=this;this.G=cc(this.c,this.v?-1:48,4,262144);this.H=ac(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.ca&&97<=a&&122>a&&(a-=32),bc(e.c,e.H,1E3/Math.round(e.I/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&M(c,e.G))});this.w=cc(this.c,this.v?-1:52,4,262144);this.W=ac(this.c,function(){e.b|=128;e.b&64&&M(c,e.w)});db(b,this,of,this.v?64832+8*(this.v-1)-65392:0);fb(b,this.reset.bind(this));G(this)};
|
|
|
|
|
h.Bc=function(a){if(!this.h){var b=Bc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.Ga)return;c=oa(c[1]);if(this.h=Oa(c)){var e=this.h.exports;if(e){var f=e.connect;f&&f.call(this.h,this.u);if(this.C=e.receiveData){this.u=a;this.F=e.receiveStatus;this.status(this.Ha+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
|
|
|
|
h.Y=function(a,b){if(!b)if(this.Bc(this.u),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){pf(this)};h.save=function(){var a=new R(this);a.set(0,[]);return a.data()};h.restore=function(){return pf(this)};function pf(a){a.o=0;a.a=8192;a.b=128;a.g=[];return!0}
|
|
|
|
|
h.Gb=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.g.push(b)}else this.g=this.g.concat(a);bc(this.c,this.H,1E3/Math.round(this.I/10));return!0};h.xe=function(a){var b=this.a;this.a&=-12289;a&32&&(this.a|=8192);a&256&&(this.a|=4096);b!=this.a&&(this.a|=32768,this.a&32&&M(this.c,this.G))};h.Sd=function(){var a=this.a&65534;this.a&=-32769;return a};
|
|
|
|
|
h.$e=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.F&&b&6&&(b=0,b=this.u?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.F.call(this.h,b))};h.Rd=function(){this.a&=-129;return this.o};h.Ze=function(){};h.we=function(){return this.b};h.Gf=function(a){if(this.b&128)if(a&64)M(this.c,this.w);else{var b=this.w;b&&ec(this.c,b)}this.b=this.b&-70|a&69};h.ve=function(){return 0};
|
|
|
|
|
h.Ff=function(a){a&=255;this.C&&this.C.call(this.h,a);a&=127;if(this.f)if(13==a)this.m=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.m&&this.m--;else{if(a){var b;13!=a&&10!=a&&(b=pa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.M||8,c=a-this.m%a,this.M&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;var e=this;this.G=cc(this.c,this.v?-1:48,4,262144);this.H=ac(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.ca&&97<=a&&122>a&&(a-=32),bc(e.c,e.H,1E3/Math.round(e.I/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&L(c,e.G))});this.w=cc(this.c,this.v?-1:52,4,262144);this.W=ac(this.c,function(){e.b|=128;e.b&64&&L(c,e.w)});db(b,this,of,this.v?64832+8*(this.v-1)-65392:0);fb(b,this.reset.bind(this));F(this)};
|
|
|
|
|
h.Bc=function(a){if(!this.h){var b=Bc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=pa(c[0]);if(d!=this.Ga)return;c=pa(c[1]);if(this.h=Oa(c)){var e=this.h.exports;if(e){var f=e.connect;f&&f.call(this.h,this.u);if(this.C=e.receiveData){this.u=a;this.F=e.receiveStatus;this.status(this.Ha+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
|
|
|
|
h.Y=function(a,b){if(!b)if(this.Bc(this.u),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){pf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return pf(this)};function pf(a){a.o=0;a.a=8192;a.b=128;a.g=[];return!0}
|
|
|
|
|
h.Gb=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.g.push(b)}else this.g=this.g.concat(a);bc(this.c,this.H,1E3/Math.round(this.I/10));return!0};h.xe=function(a){var b=this.a;this.a&=-12289;a&32&&(this.a|=8192);a&256&&(this.a|=4096);b!=this.a&&(this.a|=32768,this.a&32&&L(this.c,this.G))};h.Sd=function(){var a=this.a&65534;this.a&=-32769;return a};
|
|
|
|
|
h.$e=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.F&&b&6&&(b=0,b=this.u?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.F.call(this.h,b))};h.Rd=function(){this.a&=-129;return this.o};h.Ze=function(){};h.we=function(){return this.b};h.Gf=function(a){if(this.b&128)if(a&64)L(this.c,this.w);else{var b=this.w;b&&ec(this.c,b)}this.b=this.b&-70|a&69};h.ve=function(){return 0};
|
|
|
|
|
h.Ff=function(a){a&=255;this.C&&this.C.call(this.h,a);a&=127;if(this.f)if(13==a)this.m=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.m&&this.m--;else{if(a){var b;13!=a&&10!=a&&(b=qa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.M||8,c=a-this.m%a,this.M&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=
|
|
|
|
|
this.i){if(10==a||1024<=this.i.length)this.U(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}bc(this.c,this.W,1E3/Math.round(this.da/10));this.b&=-129};var nf="buffer",qf={},of=(qf[65392]=[null,null,Z.prototype.Sd,Z.prototype.$e,"RCSR"],qf[65394]=[null,null,Z.prototype.Rd,Z.prototype.Ze,"RBUF"],qf[65396]=[null,null,Z.prototype.we,Z.prototype.Gf,"XCSR"],qf[65398]=[null,null,Z.prototype.ve,Z.prototype.Ff,"XBUF"],qf);
|
|
|
|
|
Ea(function(){for(var a=F(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Z(d);E(d,c)}});function jc(a){A.call(this,"PC11",a);this.C=rf(this,a.autoMount);this.b=0;this.I=a.baudReceive||3600;this.m=this.o=this.a=0;this.i=[];this.h=sf;this.f=tf;this.w=this.g="";this.N=this.ja=this.ia=null;this.G=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window;this.u=null;this.H=-1;this.v=null}n(jc,A);
|
|
|
|
|
function rf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){z(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=jc.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this,e=tf;switch(b){case "listTapes":return this.j[b]=c,c.onchange=function(){var a=d.j.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){z("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=uf;case "loadTape":return e||(e=vf),this.j[b]=c,c.onclick=
|
|
|
|
|
function(){var a=d.j.listTapes;a&&wf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;wf(d,v(b,!0),b,vf,a)}return!1};return!0;case xf:return this.j[b]=c,!0}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;this.v=yf(a);var e=this;if(a=rf(this,Bc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.u=cc(this.c,56,4,4096);this.H=ac(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.m<e.i.length&&(e.o=e.i[e.m++]&255,zf(e,e.m/e.i.length*100),e.a|=128,e.a&=-2049,e.a&64&&M(e.c,e.u))});db(b,this,Af);fb(b,this.reset.bind(this));Bf(this,"None",sf,!0);this.F&&Bf(this,"Local Tape",Cf);Bf(this,"Remote Tape",Df);Ef(this)||G(this)};
|
|
|
|
|
h.Y=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){this.a&=-2241;this.o=0};function Ef(a){a.b=0;var b=a.C.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.j.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=v(c,!0)}c&&b?Ff(a,b,c,vf,!0):Gf(a)}return!!a.b}
|
|
|
|
|
function wf(a,b,c,d,e){if(c)if(c==Cf)a.B('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Df){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=v(c);a.status("Attempting to load "+c+' as "'+b+'"');a.h=Df}else a.h=c;Ff(a,b,c,d,!1,e)}else Hf(a,!1)}function Ff(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,Hf(a,!0),a.l.Pa?a.B("PC11 busy"):(e&&a.b++,If(a,b,c,d,f)?g++:a.l.Pa=!0);g&&Jf(a,a.w,a.g,a.f,a.N,a.ja,a.ia)}
|
|
|
|
|
function If(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Jf(a,b,c,d,e),a.h=Cf);Gf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!x(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ma(a.Ha,e,f),(e=sa(e,f))&&Jf(a,b,c,d,e.N,e.ja,e.ia));
|
|
|
|
|
a.l.Pa=!1;a.b&&(a.b--,a.b||G(a));Gf(a)})}function Bf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function Gf(a){var b=a.j.listTapes;if(b&&b.options){a=a.h||a.g;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
|
|
|
|
|
function zf(a,b){b|=0;if(b!==a.G){var c=a.j[xf];c&&(c=(c=F(c,Kf))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Jf(a,b,c,d,e,f,g){a.w=b;a.g=c;a.f=d;a.N=e;a.ja=f;a.ia=g;d==uf?a.v&&lf(a.v,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.B('No valid memory address for tape "'+b+'"'):(a.m=0,a.i=e,a.status('Loaded tape "'+b+'"'),zf(a,0))}function Hf(a,b){if(a.g||!1===b)a.w="",a.g="",b||(a.f&&a.status(a.f==vf?"tape detached":"tape unloaded"),a.h=sf,a.f=tf,Gf(a))}h.save=function(){return(new R(this)).data()};
|
|
|
|
|
h.restore=function(){return!0};h.Ld=function(){return this.a&65534};h.Te=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&M(this.c,this.u)):(this.a&=-129,this.a|=2048,this.o=0,bc(this.c,this.H,1E3/Math.round(this.I/10))));this.a=this.a&-66|a&65};h.Kd=function(){this.a&=-129;this.a|=2048;return this.o};h.Se=function(){};
|
|
|
|
|
Ea(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Z(d);D(d,c)}});function jc(a){z.call(this,"PC11",a);this.C=rf(this,a.autoMount);this.b=0;this.I=a.baudReceive||3600;this.m=this.o=this.a=0;this.i=[];this.h=sf;this.f=tf;this.w=this.g="";this.N=this.ja=this.ia=null;this.G=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window;this.u=null;this.H=-1;this.v=null}n(jc,z);
|
|
|
|
|
function rf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=jc.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this,e=tf;switch(b){case "listTapes":return this.j[b]=c,c.onchange=function(){var a=d.j.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){y("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=uf;case "loadTape":return e||(e=vf),this.j[b]=c,c.onclick=
|
|
|
|
|
function(){var a=d.j.listTapes;a&&wf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;wf(d,u(b,!0),b,vf,a)}return!1};return!0;case xf:return this.j[b]=c,!0}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;this.v=yf(a);var e=this;if(a=rf(this,Bc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.u=cc(this.c,56,4,4096);this.H=ac(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.m<e.i.length&&(e.o=e.i[e.m++]&255,zf(e,e.m/e.i.length*100),e.a|=128,e.a&=-2049,e.a&64&&L(e.c,e.u))});db(b,this,Af);fb(b,this.reset.bind(this));Bf(this,"None",sf,!0);this.F&&Bf(this,"Local Tape",Cf);Bf(this,"Remote Tape",Df);Ef(this)||F(this)};
|
|
|
|
|
h.Y=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){this.a&=-2241;this.o=0};function Ef(a){a.b=0;var b=a.C.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.j.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=u(c,!0)}c&&b?Ff(a,b,c,vf,!0):Gf(a)}return!!a.b}
|
|
|
|
|
function wf(a,b,c,d,e){if(c)if(c==Cf)a.B('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Df){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"');a.h=Df}else a.h=c;Ff(a,b,c,d,!1,e)}else Hf(a,!1)}function Ff(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,Hf(a,!0),a.l.Pa?a.B("PC11 busy"):(e&&a.b++,If(a,b,c,d,f)?g++:a.l.Pa=!0);g&&Jf(a,a.w,a.g,a.f,a.N,a.ja,a.ia)}
|
|
|
|
|
function If(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Jf(a,b,c,d,e),a.h=Cf);Gf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):ua()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!v(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ma(a.Ha,e,f),(e=ta(e,f))&&Jf(a,b,c,d,e.N,e.ja,e.ia));
|
|
|
|
|
a.l.Pa=!1;a.b&&(a.b--,a.b||F(a));Gf(a)})}function Bf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function Gf(a){var b=a.j.listTapes;if(b&&b.options){a=a.h||a.g;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
|
|
|
|
|
function zf(a,b){b|=0;if(b!==a.G){var c=a.j[xf];c&&(c=(c=E(c,Kf))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Jf(a,b,c,d,e,f,g){a.w=b;a.g=c;a.f=d;a.N=e;a.ja=f;a.ia=g;d==uf?a.v&&lf(a.v,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.B('No valid memory address for tape "'+b+'"'):(a.m=0,a.i=e,a.status('Loaded tape "'+b+'"'),zf(a,0))}function Hf(a,b){if(a.g||!1===b)a.w="",a.g="",b||(a.f&&a.status(a.f==vf?"tape detached":"tape unloaded"),a.h=sf,a.f=tf,Gf(a))}h.save=function(){return(new Q(this)).data()};
|
|
|
|
|
h.restore=function(){return!0};h.Ld=function(){return this.a&65534};h.Te=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&L(this.c,this.u)):(this.a&=-129,this.a|=2048,this.o=0,bc(this.c,this.H,1E3/Math.round(this.I/10))));this.a=this.a&-66|a&65};h.Kd=function(){this.a&=-129;this.a|=2048;return this.o};h.Se=function(){};
|
|
|
|
|
var sf="",Cf="?",Df="??",tf=0,vf=1,uf=2,xf="readProgress",Kf="pcjs-progress-bar",Lf={},Af=(Lf[65384]=[null,null,jc.prototype.Ld,jc.prototype.Te,"PRS"],Lf[65386]=[null,null,jc.prototype.Kd,jc.prototype.Se,"PRB"],Lf);
|
|
|
|
|
function Mf(a,b,c){A.call(this,"Disk",{id:a.Ha+".disk"+u(++Nf,4)},0,8192);this.controller=a;this.A=a.A;this.D=a.D;this.h=b;this.ka=b.name;this.Z=this.Hb="";this.wb=b.wb;this.J=this.O=this.L=this.T=this.mode=0;this.a=[];this.f=null;this.g=!1;Of(this,c,b.J,b.O,b.L,b.T);this.b=this.i=null;G(this)}n(Mf,A);h=Mf.prototype;h.X=function(a,b,c,d){this.D=d};
|
|
|
|
|
function Mf(a,b,c){z.call(this,"Disk",{id:a.Ha+".disk"+ka(++Nf,4)},0,8192);this.controller=a;this.A=a.A;this.D=a.D;this.h=b;this.ka=b.name;this.Z=this.Hb="";this.wb=b.wb;this.J=this.O=this.L=this.T=this.mode=0;this.a=[];this.f=null;this.g=!1;Of(this,c,b.J,b.O,b.L,b.T);this.b=this.i=null;F(this)}n(Mf,z);h=Mf.prototype;h.X=function(a,b,c,d){this.D=d};
|
|
|
|
|
function Of(a,b,c,d,e,f){a.mode=b;a.J=c;a.O=d;a.L=e;a.T=f;a.a=[];if("preload"!=a.mode){b=Array(a.J);for(c=0;c<b.length;c++){d=Array(a.O);for(e=0;e<d.length;e++){f=Array(a.L);for(var g=1;g<=f.length;g++)f[g-1]=Pf(null,c,e,g,a.T,0);d[e]=f}b[c]=d}a.a=b}a.f=null}
|
|
|
|
|
function Qf(a,b,c,d,e){var f=c;if(a.b)return!0;a.ka=b;a.Z=c;a.Hb=v(c);a.b=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.J=e[0];a.O=e[1];a.L=e[2];a.T=e[3]||512;c=a.T>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.O),y=0;y<w.length;y++)for(var xa=w[y]=Array(a.L),ya=0;ya<xa.length;ya++){for(var $b=Pf(null,d,y,ya+1,a.T,0),Mg=$b.data,tc=0;tc<c;tc++,f+=4)var Ng=Mg[tc]=b.getInt32(f,
|
|
|
|
|
!0),e=e+Ng&-1;$b.fa=c;xa[ya]=$b}a.f=e;c=a}else a.B("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.ka,a.Z),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!x(f,
|
|
|
|
|
function Qf(a,b,c,d,e){var f=c;if(a.b)return!0;a.ka=b;a.Z=c;a.Hb=u(c);a.b=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.J=e[0];a.O=e[1];a.L=e[2];a.T=e[3]||512;c=a.T>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;d<a.a.length;d++)for(var x=a.a[d]=Array(a.O),w=0;w<x.length;w++)for(var X=x[w]=Array(a.L),ya=0;ya<X.length;ya++){for(var $b=Pf(null,d,w,ya+1,a.T,0),Ng=$b.data,tc=0;tc<c;tc++,f+=4)var Og=Ng[tc]=b.getInt32(f,
|
|
|
|
|
!0),e=e+Og&-1;$b.fa=c;X[ya]=$b}a.f=e;c=a}else a.B("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.ka,a.Z),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=ua()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!v(f,
|
|
|
|
|
null,!0,function(b,c,d){Rf(a,b,c,d)})}
|
|
|
|
|
function Rf(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.R;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.ka+'" (error '+d+": "+b+")",f);else{Ma(a.controller.Ha,b,c);try{if(0<v(a.Hb,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ka]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
|
|
|
|
c+")");if(k.length)if(1==k.length)z(k[0]);else{a.J=k.length;a.O=k[0].length;a.L=k[0][0].length;var l=k[0][0][0];a.T=l&&l.length||512;for(d=c=0;d<a.J;d++)for(f=0;f<a.O;f++)for(g=0;g<a.L;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var y=m<<2,xa=w.length;xa<y;xa++)w[xa]=p;Sf(l,w)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Pf(l,d,f);for(y=
|
|
|
|
|
0;y<t.length;y++)c=c+t[y]&-1}a.a=k;a.f=c;e=a}else z("Empty disk image: "+a.ka)}catch(ya){z("Disk image error ("+b+"): "+ya.message)}}a.b&&(a.b.call(a.i,a.h,e,a.ka,a.Z),a.b=null)}function Pf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Hg=b;a.Ig=c;a.oa=a.fa=0;a.ua=!1;return a}
|
|
|
|
|
function Rf(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.R;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.ka+'" (error '+d+": "+b+")",f);else{Ma(a.controller.Ha,b,c);try{if(0<u(a.Hb,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ka]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
|
|
|
|
c+")");if(k.length)if(1==k.length)y(k[0]);else{a.J=k.length;a.O=k[0].length;a.L=k[0][0].length;var l=k[0][0][0];a.T=l&&l.length||512;for(d=c=0;d<a.J;d++)for(f=0;f<a.O;f++)for(g=0;g<a.L;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,X=x.length;X<w;X++)x[X]=p;Sf(l,x)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Pf(l,d,f);for(w=0;w<
|
|
|
|
|
t.length;w++)c=c+t[w]&-1}a.a=k;a.f=c;e=a}else y("Empty disk image: "+a.ka)}catch(ya){y("Disk image error ("+b+"): "+ya.message)}}a.b&&(a.b.call(a.i,a.h,e,a.ka,a.Z),a.b=null)}function Pf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Hg=b;a.Ig=c;a.oa=a.fa=0;a.ua=!1;return a}
|
|
|
|
|
h.seek=function(a,b,c,d,e){d=null;var f=this.h,g=this.a[a];if(g){var k=g[b];if(!k&&f.$c&&b<f.O)for(k=g[b]=Array(f.xc),g=0;g<k.length;g++)k[g]=Pf(null,a,b,g+1,f.Zb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.$c&&9==f.Xb&&(d=k[g]=Pf(null,a,b,f.Xb,f.Zb,0))}}e&&e(d,!1);return d};function Sf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
|
|
|
|
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.fa?f<a.oa?(a.fa+=a.oa-f,a.oa=f):f>=a.oa+a.fa&&(a.fa+=f-(a.oa+a.fa)+1):(a.oa=f,a.fa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
|
|
|
|
function Tf(a,b){var c=a.O*a.L,d=b/c|0;return d<a.J?(b%=c,a.seek(d,b/a.L|0,b%a.L+1)):null}function Uf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function Vf(a){for(var b="",c=0,d;d=Tf(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(Uf(a,d,e));return btoa(b)}
|
|
|
|
|
@ -207,72 +207,72 @@ h.save=function(){var a=0,b=[];b[a++]=[this.Z,this.f,this.J,this.O,this.L,this.T
|
|
|
|
|
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?Of(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
|
|
|
|
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.oa=e;for(k.fa=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.B("Unable to restore disk '"+this.ka+": "+c);return b};
|
|
|
|
|
h.toJSON=function(){var a;a=0;for(var b;b=Tf(this,a++);)Wf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
|
|
|
|
function Wf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Nf=0;function P(a){A.call(this,"RK11",a,0,65536);this.o=Xf(this,a.autoMount);this.m=0;this.b=Array(8);this.u=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.w=this.g=this.a=this.i=this.h=this.f=this.v=0}n(P,A);
|
|
|
|
|
function Xf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){z(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=P.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){z("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&Yf(d,a)},
|
|
|
|
|
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.vc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c);
|
|
|
|
|
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),z(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,v(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=Xf(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);$f(this);this.Da=cc(this.c,144,5,65536);db(b,this,ag);fb(b,this.reset.bind(this));bg(this,"None",cg,!0);this.u&&bg(this,"Local Disk",dg);bg(this,"Remote Disk",eg);fg(this)||G(this)};
|
|
|
|
|
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.b.length;a++)gg(this,a,!0);fg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new R(this)).data()};
|
|
|
|
|
h.restore=function(a){return $f(this,a[0])};function fg(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=v(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!hg(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.m}
|
|
|
|
|
function Zf(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==dg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==eg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=v(c);a.status("Attempting to load "+c+' as "'+b+'"')}hg(a,e,b,c,!1,d)}else gg(a,e)}
|
|
|
|
|
function hg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,gg(a,b,!0),k.Ra?a.B("RK11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.m++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.m||G(this));Yf(this,a.Sa)};
|
|
|
|
|
function Wf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var Nf=0;function O(a){z.call(this,"RK11",a,0,65536);this.o=Xf(this,a.autoMount);this.m=0;this.f=Array(8);this.u=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.w=this.b=this.a=this.i=this.h=this.g=this.v=0}n(O,z);
|
|
|
|
|
function Xf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=O.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&Yf(d,a)},
|
|
|
|
|
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.vc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c);
|
|
|
|
|
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),y(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=Xf(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);$f(this);this.Da=cc(this.c,144,5,65536);db(b,this,ag);fb(b,this.reset.bind(this));bg(this,"None",cg,!0);this.u&&bg(this,"Local Disk",dg);bg(this,"Remote Disk",eg);fg(this)||F(this)};
|
|
|
|
|
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.f.length;a++)gg(this,a,!0);fg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new Q(this)).data()};
|
|
|
|
|
h.restore=function(a){return $f(this,a[0])};function fg(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=u(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!hg(a,g,f,e,!0)&&b&&F(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.m}
|
|
|
|
|
function Zf(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==dg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==eg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}hg(a,e,b,c,!1,d)}else gg(a,e)}
|
|
|
|
|
function hg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,gg(a,b,!0),k.Ra?a.B("RK11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.m++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.m||F(this));Yf(this,a.Sa)};
|
|
|
|
|
function bg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function Yf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?dg:c.Z,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function gg(a,b,c){var d=a.b[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RK"+b+" unloaded",c),Yf(a,b))}
|
|
|
|
|
function $f(a,b){var c=0;b||(b=[]);a.w=b[c++]||2368;a.g=b[c++]||0;a.a=b[c++]||128;a.i=b[c++]||0;a.h=b[c++]||0;a.f=b[c++]||0;a.v=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=203;d.O=2;d.L=12;d.T=512;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=2368}return!0}
|
|
|
|
|
h.vc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}var w,y;if(0>(w=a.read(p,t++))||0>(y=a.read(p,t++))){m=32;break}if(!k&&(yb(this.s,Xc(this.c,f),w|y<<8),Zb(this.s))){m=1024;break}t>=a.T&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
|
|
|
|
h.Qc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){var w=Ab(this.s,Xc(this.c,f));if(Zb(this.s)){m=1024;break}f+=g;e--;if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}if(k){if(0>a.read(p,t++)||0>a.read(p,t++)){m=32;break}}else if(!a.write(p,t++,w&255)||!a.write(p,t++,w>>8)){m=32;break}t>=a.T&&(p=null)}return l?l(m,b,c,d,e,f):m};
|
|
|
|
|
h.Oc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.f=this.f&-16|d&15;a&&(this.g=this.g|a|32768,this.a|=49152);return!0};h.Xd=function(){return this.w};h.ef=function(){};h.Yd=function(){return this.g};h.ff=function(){};h.Ud=function(){return this.a&61438};
|
|
|
|
|
h.bf=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c=(this.f&57344)>>13,d=this.b[c],e,f,g,k,l,m;this.a&=-129;var p=this.a&14;switch(p){case 0:this.g=0;this.a=128;this.f=0;break;case 8:e=(this.f&8160)>>5;e>=d.J&&(this.g|=32832,this.a|=49152);break;case 10:case 4:b=this.vc;case 6:case 2:b||(b=this.Qc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,k=65536-this.i&65535,l=(this.a&48)<<12|this.h,m=this.a&2048?0:2,e>=d.J?(this.g|=32832,this.a|=49152):g>=d.L?(this.g|=32800,this.a|=49152):
|
|
|
|
|
a=b.call(this,d,e,f,g,k,l,m,6<=p,this.Oc.bind(this))}this.w=d.status|(d.S?128:0)|c<<13|this.f&15;a&&(this.a&=-2,this.a|=128,this.a&64&&M(this.c,this.Da))}};h.Zd=function(){return this.i};h.gf=function(a){this.i=a};h.Td=function(){return this.h};h.af=function(a){this.h=a};h.Vd=function(){return this.f};h.cf=function(a){this.f=a};h.Wd=function(){return this.v};h.df=function(a){this.v=a};
|
|
|
|
|
var cg="",dg="?",eg="??",ig={},ag=(ig[65280]=[null,null,P.prototype.Xd,P.prototype.ef,"RKDS"],ig[65282]=[null,null,P.prototype.Yd,P.prototype.ff,"RKER"],ig[65284]=[null,null,P.prototype.Ud,P.prototype.bf,"RKCS"],ig[65286]=[null,null,P.prototype.Zd,P.prototype.gf,"RKWC"],ig[65288]=[null,null,P.prototype.Td,P.prototype.af,"RKBA"],ig[65290]=[null,null,P.prototype.Vd,P.prototype.cf,"RKDA"],ig[65294]=[null,null,P.prototype.Wd,P.prototype.df,"RKDB"],ig);
|
|
|
|
|
function O(a){A.call(this,"RL11",a,0,131072);this.u=jg(this,a.autoMount);this.o=0;this.b=Array(4);this.v=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.a=this.m=this.f=this.g=this.i=this.h=0}n(O,A);function jg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){z(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=O.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){z("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&kg(d,a)},
|
|
|
|
|
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&lg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.wc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c);
|
|
|
|
|
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),z(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lg(d,v(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=jg(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.u[e]=a[e]);mg(this);this.Da=cc(this.c,112,5,131072);db(b,this,ng);fb(b,this.reset.bind(this));og(this,"None",pg,!0);this.v&&og(this,"Local Disk",qg);og(this,"Remote Disk",rg);sg(this)||G(this)};
|
|
|
|
|
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.b.length;a++)tg(this,a,!0);sg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";kg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){mg(this)};h.save=function(){return(new R(this)).data()};
|
|
|
|
|
h.restore=function(a){return mg(this,a[0])};function sg(a,b){b||(a.o=0);for(var c in a.u){var d=a.u[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=v(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!ug(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.o}
|
|
|
|
|
function lg(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==qg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==rg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=v(c);a.status("Attempting to load "+c+' as "'+b+'"')}ug(a,e,b,c,!1,d)}else tg(a,e)}
|
|
|
|
|
function ug(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,tg(a,b,!0),k.Ra?a.B("RL11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.o++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Sc)&&g++));return g}h.Sc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.o||G(this));kg(this,a.Sa)};
|
|
|
|
|
function og(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function kg(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?qg:c.Z,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function tg(a,b,c){var d=a.b[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RL"+b+" unloaded",c),kg(a,b))}
|
|
|
|
|
function mg(a,b){var c=0;b||(b=[]);a.a=b[c++]||129;a.m=b[c++]||0;a.f=b[c++]||0;a.g=b[c++]||0;a.i=b[c++]||0;a.h=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=512;d.O=2;d.L=40;d.T=256;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=29}return!0}
|
|
|
|
|
function Yf(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?dg:c.Z,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function gg(a,b,c){var d=a.f[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RK"+b+" unloaded",c),Yf(a,b))}
|
|
|
|
|
function $f(a,b){var c=0;b||(b=[]);a.w=b[c++]||2368;a.b=b[c++]||0;a.a=b[c++]||128;a.i=b[c++]||0;a.h=b[c++]||0;a.g=b[c++]||0;a.v=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=203;d.O=2;d.L=12;d.T=512;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=2368}return!0}
|
|
|
|
|
h.vc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(yb(this.s,Xc(this.c,f),x|w<<8),Zb(this.s))){m=1024;break}t>=a.T&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
|
|
|
|
h.Qc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){var x=Ab(this.s,Xc(this.c,f));if(Zb(this.s)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}if(k){var w,X;if(0>(w=a.read(p,t++))||0>(X=a.read(p,t++))){m=32;break}if(x!=(w|X<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.T&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
|
|
|
|
h.Oc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;ig(this);return!0};function ig(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Xd=function(){return this.w};h.ef=function(){};h.Yd=function(){return this.b};h.ff=function(){};h.Ud=function(){return this.a&61438};
|
|
|
|
|
h.bf=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.vc;case 6:case 2:b||(b=this.Qc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.i&65535;m=(this.a&48)<<12|this.h;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.L){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Oc.bind(this));break;case 8:f=(this.g&8160)>>
|
|
|
|
|
5;f<e.J?this.a|=8192:this.b|=64;break;case 12:this.b=this.g=0,this.a=8320}this.w=e.status|(e.S?128:0)|d<<13|this.g&15;ig(this);a&&(this.a&=-2,this.a|=128,this.a&64&&L(this.c,this.Da))}};h.Zd=function(){return this.i};h.gf=function(a){this.i=a};h.Td=function(){return this.h};h.af=function(a){this.h=a};h.Vd=function(){return this.g};h.cf=function(a){this.g=a};h.Wd=function(){return this.v};h.df=function(a){this.v=a};
|
|
|
|
|
var cg="",dg="?",eg="??",jg={},ag=(jg[65280]=[null,null,O.prototype.Xd,O.prototype.ef,"RKDS"],jg[65282]=[null,null,O.prototype.Yd,O.prototype.ff,"RKER"],jg[65284]=[null,null,O.prototype.Ud,O.prototype.bf,"RKCS"],jg[65286]=[null,null,O.prototype.Zd,O.prototype.gf,"RKWC"],jg[65288]=[null,null,O.prototype.Td,O.prototype.af,"RKBA"],jg[65290]=[null,null,O.prototype.Vd,O.prototype.cf,"RKDA"],jg[65294]=[null,null,O.prototype.Wd,O.prototype.df,"RKDB"],jg);
|
|
|
|
|
function N(a){z.call(this,"RL11",a,0,131072);this.u=kg(this,a.autoMount);this.o=0;this.b=Array(4);this.v=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.a=this.m=this.f=this.g=this.i=this.h=0}n(N,z);function kg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=N.prototype;
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&lg(d,a)},
|
|
|
|
|
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&mg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.wc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c);
|
|
|
|
|
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),y(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;mg(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
|
|
|
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=kg(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.u[e]=a[e]);ng(this);this.Da=cc(this.c,112,5,131072);db(b,this,og);fb(b,this.reset.bind(this));pg(this,"None",qg,!0);this.v&&pg(this,"Local Disk",rg);pg(this,"Remote Disk",sg);tg(this)||F(this)};
|
|
|
|
|
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.b.length;a++)ug(this,a,!0);tg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";lg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){ng(this)};h.save=function(){return(new Q(this)).data()};
|
|
|
|
|
h.restore=function(a){return ng(this,a[0])};function tg(a,b){b||(a.o=0);for(var c in a.u){var d=a.u[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=u(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!vg(a,g,f,e,!0)&&b&&F(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.o}
|
|
|
|
|
function mg(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==rg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==sg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}vg(a,e,b,c,!1,d)}else ug(a,e)}
|
|
|
|
|
function vg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,ug(a,b,!0),k.Ra?a.B("RL11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.o++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Sc)&&g++));return g}h.Sc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.o||F(this));lg(this,a.Sa)};
|
|
|
|
|
function pg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function lg(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?rg:c.Z,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ug(a,b,c){var d=a.b[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RL"+b+" unloaded",c),lg(a,b))}
|
|
|
|
|
function ng(a,b){var c=0;b||(b=[]);a.a=b[c++]||129;a.m=b[c++]||0;a.f=b[c++]||0;a.g=b[c++]||0;a.i=b[c++]||0;a.h=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=512;d.O=2;d.L=40;d.T=256;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=29}return!0}
|
|
|
|
|
h.wc=function(a,b,c,d,e,f,g){var k=0;a=a.S;var l=null,m;a||(k=5120,e=0);for(;e;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var p,t;if(0>(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}yb(this.s,Xc(this.c,f),p|t<<8);if(Zb(this.s)){k=8192;break}f+=2;e--;if(m>=a.T&&(l=null,++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
|
|
|
|
h.Tc=function(a,b,c,d,e,f,g){var k=0;a=a.S;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Ab(this.s,Xc(this.c,f));if(Zb(this.s)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.T&&(l=null,++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
|
|
|
|
h.Rc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.be=function(){return this.a&65535};
|
|
|
|
|
h.kf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.S,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.wc;case 10:b||(b=this.Tc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.L?
|
|
|
|
|
this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Rc.bind(this)))}a&&(this.a|=129,this.a&64&&M(this.c,this.Da))}};h.$d=function(){return this.m};h.hf=function(a){this.m=a&65534};h.ce=function(){return this.f};h.lf=function(a){this.f=a};h.de=function(){return this.i};h.mf=function(a){this.i=a};h.ae=function(){return this.h};h.jf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4};
|
|
|
|
|
var pg="",qg="?",rg="??",vg={},ng=(vg[63744]=[null,null,O.prototype.be,O.prototype.kf,"RLCS"],vg[63746]=[null,null,O.prototype.$d,O.prototype.hf,"RLBA"],vg[63748]=[null,null,O.prototype.ce,O.prototype.lf,"RLDA"],vg[63750]=[null,null,O.prototype.de,O.prototype.mf,"RLMP"],vg[63752]=[null,null,O.prototype.ae,O.prototype.jf,"RLBE"],vg);
|
|
|
|
|
function wg(a,b,c){A.call(this,"Computer",a,0,33554432);this.l.R=!1;this.F=null;xg(this,b);this.w=Bc(this,"autoPower",a);this.g=0;this.K=a.busWidth||a.buswidth;this.a=yg;this.u=null;this.H=this.i=this.C=this.m=this.I=!1;this.h=null;this.M=Bc(this,"url")||"";(Math.random()+.1).toString(36);this.b=zg(this);if(this.c=Pa("CPU",this.id)){this.D=Pa("Debugger",this.id);this.s=new Fb({id:this.Ha+".bus",busWidth:this.K},this.c,this.D);var d,e=C(this.id);if((this.f=Pa("Panel",this.id))&&this.f.ab)for(b=0;b<
|
|
|
|
|
this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Rc.bind(this)))}a&&(this.a|=129,this.a&64&&L(this.c,this.Da))}};h.$d=function(){return this.m};h.hf=function(a){this.m=a&65534};h.ce=function(){return this.f};h.lf=function(a){this.f=a};h.de=function(){return this.i};h.mf=function(a){this.i=a};h.ae=function(){return this.h};h.jf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4};
|
|
|
|
|
var qg="",rg="?",sg="??",wg={},og=(wg[63744]=[null,null,N.prototype.be,N.prototype.kf,"RLCS"],wg[63746]=[null,null,N.prototype.$d,N.prototype.hf,"RLBA"],wg[63748]=[null,null,N.prototype.ce,N.prototype.lf,"RLDA"],wg[63750]=[null,null,N.prototype.de,N.prototype.mf,"RLMP"],wg[63752]=[null,null,N.prototype.ae,N.prototype.jf,"RLBE"],wg);
|
|
|
|
|
function xg(a,b,c){z.call(this,"Computer",a,0,33554432);this.l.R=!1;this.F=null;yg(this,b);this.w=Bc(this,"autoPower",a);this.g=0;this.K=a.busWidth||a.buswidth;this.a=zg;this.u=null;this.H=this.i=this.C=this.m=this.I=!1;this.h=null;this.M=Bc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Ag(this);if(this.c=Pa("CPU",this.id)){this.D=Pa("Debugger",this.id);this.s=new Fb({id:this.Ha+".bus",busWidth:this.K},this.c,this.D);var d,e=B(this.id);if((this.f=Pa("Panel",this.id))&&this.f.ab)for(b=0;b<
|
|
|
|
|
e.length;b++)d=e[b],d.B=this.f.B,d.U=this.f.U,d.ab=this.f.ab;this.U("PDPjs v1.31.0\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.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.X&&d.X(this,this.s,this.c,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.o=d:this.a=parseInt(d,10));var f;if(a=Bc(this,"state")||(f=!0,a.state))b=this.G=
|
|
|
|
|
a,f||(this.m=!0,this.a=yg),this.a&&(this.v=new R(this,"1.31.0"),Ag(this.v)?b=null:delete this.v);!b&&this.a&&(b=Bg(this))&&(this.m=!0);if(b){var g=this;x(b,null,!0,function(a,b,c){c?(g.o=null,g.m=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.u=b,g.I=!0);G(g)})}else G(this);this.j.power||(this.w=!0);!c&&this.w&&Cg(this,this.qb)}else z("Unable to find CPU component")}n(wg,A);
|
|
|
|
|
function xg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){z(d.message+" ("+c+")")}}a.F=b}function Bc(a,b,c){var d=b.toLowerCase(),d=Ua[b]||Ua[d];void 0===d&&a.F&&(d=a.F[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Cg(a,b,c){for(var d=C(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Cg(a,b,c)});return}}b.call(a,c)}
|
|
|
|
|
function Dg(a,b){var c=new R(a,"1.31.0",Eg);if(Ag(c)&&Fg(c)){var d=c.get(Gg),e=b?b.get(Gg):"unknown";d!=e&&(a.B("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=wg.prototype;
|
|
|
|
|
h.qb=function(a){void 0===a&&(a=this.a||(this.u?Hg:yg));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.v||new R(this,"1.31.0");if(a==Ig)b=!0;else if(a>yg){if(Ag(d,this.u)){this.h=new R(this,"1.31.0",Jg);Ag(this.h)&&(Kg(this,d),a=Lg,Og(this.h));this.h.set(Gg,ra());Pg(this.h);var e=this.a&&!this.m;if(a==Hg||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Fg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ag(d,g):("error"==f&&"no machine state"!=
|
|
|
|
|
g?(this.B("Error: "+g),"unable to verify user"==g&&(Aa(Qg,""),this.b=null)):this.U(f+": "+g),Og(d),Ag(d)?(c=Fg(d),e=!0):c=!1))}e&&Dg(this,c?d:null)}else a==Lg&&d.clear()}else Dg(this);delete this.u;delete this.v}e=C(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=Rg(this,g,d,b,c));b=[d,a,c];a!=Ig?Cg(this,this.yc,b):this.yc(b)}};
|
|
|
|
|
function Rg(a,b,c,d,e){if(!b.l.R){b.l.R=!0;if(b.Y){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Y(f,d)&&f&&(z("Unable to restore state for "+b.type),a.G&&!a.I?(c.clear(),a.a=yg,window&&window.location.reload()):a.C=!0,b.Y(null),e=!1)}if(!d&&b.pc)for(a=b.pc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
|
|
|
h.yc=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.l.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(Rg(this,this.c,b,c,a),vb(this),this.c.Ca());this.C&&(Kg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
|
|
|
|
function Kg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.b||"";b=b.toString();var d={app:"PDPjs",ver:"1.31.0"};d.url=a.M;d.user=c;d.type="bug";d.data=b;x("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
|
|
|
function Sg(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new R(a,"1.31.0"),g=new R(a,"1.31.0",Eg),k=ra();g.set(Gg,k);f.set(Gg,k);f.set(Tg,"1.31.0");f.set(Ug,window?window.location.href:null);f.set(Vg,window?window.navigator.userAgent:"");a.c&&a.c.ga&&(c&&H(a.c),d=a.c.ga(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.R=!1,!1===d&&(e=null)));for(var k=C(a.id),l=0;l<k.length;l++){var m=k[l];m.l.R&&(m.ga&&(d=m.ga(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.l.R=!1,!1===d&&(e=null)))}e&&
|
|
|
|
|
(c?(k=d=!1,b?(a.b&&Wg(a,a.b,f.toString()),Pg(g)&&Pg(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==Xg),d&&f.clear(k)):e=f.toString());c&&(a.l.R=!1,b=a.j.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.s&&this.s.reset&&this.s.reset();this.c&&this.c.reset&&this.c.reset();for(var a=C(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.s&&c!==this.c&&c.reset&&c.reset()}vb(this,-1)};
|
|
|
|
|
h.start=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}vb(this,-1)};h.stop=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}vb(this,-1)};
|
|
|
|
|
a,f||(this.m=!0,this.a=zg),this.a&&(this.v=new Q(this,"1.31.0"),Bg(this.v)?b=null:delete this.v);!b&&this.a&&(b=Cg(this))&&(this.m=!0);if(b){var g=this;v(b,null,!0,function(a,b,c){c?(g.o=null,g.m=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.u=b,g.I=!0);F(g)})}else F(this);this.j.power||(this.w=!0);!c&&this.w&&Dg(this,this.qb)}else y("Unable to find CPU component")}n(xg,z);
|
|
|
|
|
function yg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.F=b}function Bc(a,b,c){var d=b.toLowerCase(),d=Ua[b]||Ua[d];void 0===d&&a.F&&(d=a.F[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Dg(a,b,c){for(var d=B(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Dg(a,b,c)});return}}b.call(a,c)}
|
|
|
|
|
function Eg(a,b){var c=new Q(a,"1.31.0",Fg);if(Bg(c)&&Gg(c)){var d=c.get(Hg),e=b?b.get(Hg):"unknown";d!=e&&(a.B("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=xg.prototype;
|
|
|
|
|
h.qb=function(a){void 0===a&&(a=this.a||(this.u?Ig:zg));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.v||new Q(this,"1.31.0");if(a==Jg)b=!0;else if(a>zg){if(Bg(d,this.u)){this.h=new Q(this,"1.31.0",Kg);Bg(this.h)&&(Lg(this,d),a=Mg,Pg(this.h));this.h.set(Hg,sa());Qg(this.h);var e=this.a&&!this.m;if(a==Ig||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Gg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bg(d,g):("error"==f&&"no machine state"!=
|
|
|
|
|
g?(this.B("Error: "+g),"unable to verify user"==g&&(Aa(Rg,""),this.b=null)):this.U(f+": "+g),Pg(d),Bg(d)?(c=Gg(d),e=!0):c=!1))}e&&Eg(this,c?d:null)}else a==Mg&&d.clear()}else Eg(this);delete this.u;delete this.v}e=B(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=Sg(this,g,d,b,c));b=[d,a,c];a!=Jg?Dg(this,this.yc,b):this.yc(b)}};
|
|
|
|
|
function Sg(a,b,c,d,e){if(!b.l.R){b.l.R=!0;if(b.Y){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Y(f,d)&&f&&(y("Unable to restore state for "+b.type),a.G&&!a.I?(c.clear(),a.a=zg,window&&window.location.reload()):a.C=!0,b.Y(null),e=!1)}if(!d&&b.pc)for(a=b.pc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
|
|
|
h.yc=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.l.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(Sg(this,this.c,b,c,a),vb(this),this.c.Ca());this.C&&(Lg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
|
|
|
|
function Lg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.b||"";b=b.toString();var d={app:"PDPjs",ver:"1.31.0"};d.url=a.M;d.user=c;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
|
|
|
function Tg(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new Q(a,"1.31.0"),g=new Q(a,"1.31.0",Fg),k=sa();g.set(Hg,k);f.set(Hg,k);f.set(Ug,"1.31.0");f.set(Vg,window?window.location.href:null);f.set(Wg,window?window.navigator.userAgent:"");a.c&&a.c.ga&&(c&&G(a.c),d=a.c.ga(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.R=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l<k.length;l++){var m=k[l];m.l.R&&(m.ga&&(d=m.ga(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.l.R=!1,!1===d&&(e=null)))}e&&
|
|
|
|
|
(c?(k=d=!1,b?(a.b&&Xg(a,a.b,f.toString()),Qg(g)&&Qg(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==Yg),d&&f.clear(k)):e=f.toString());c&&(a.l.R=!1,b=a.j.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.s&&this.s.reset&&this.s.reset();this.c&&this.c.reset&&this.c.reset();for(var a=B(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.s&&c!==this.c&&c.reset&&c.reset()}vb(this,-1)};
|
|
|
|
|
h.start=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}vb(this,-1)};h.stop=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}vb(this,-1)};
|
|
|
|
|
function vb(a,b){if(a.c){var c=a.c,d=b||0,e=c.j.speed;e&&(0>=d||30<=(c.hc+=d))&&(e.textContent=c.l.P?c.Ia.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.P;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;e<a.c.b.length;e++)lb(a,"R"+e,a.c.b[e]);e=hc(a.c);lb(a,"PS",e);lb(a,"NF",e&8?1:0,1);lb(a,"ZF",e&4?1:0,1);lb(a,"VF",e&2?1:0,1);lb(a,"CF",e&1?1:0,1);a.i=0}Bb(a,0<b&&c&&!d?a.c.Fa:a.ha);xb(a,a.h);b=a.c;b=b.Ja?b.na&16?1:2:4;Db(a,"B22",b&1);Db(a,"B18",b&2);Db(a,"B16",b&4)}}
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.g||(d.l.R?Sg(d,!1,!0):Cg(d,d.qb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.l.R&&!d.g)if(d.a&&!d.o){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Sg(d,a,!0);!a&&d.G?window&&window.location.reload():(a||(d.i=!0),d.qb(yg),d.i=!1)}else d.reset(),d.c&&d.c.Ca()},!0;case "save":if(la(ta(),"pcjs.org"))c.parentNode.removeChild(c);
|
|
|
|
|
else return this.j[b]=c,c.onclick=function(){var a=zg(d,!0);if(a){var b=!!(d.a&&!d.o||d.G),c=Sg(d,b);b?Wg(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
|
|
|
|
|
function zg(a,b){var c=a.b;c||((c=za(Qg),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Yg(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c}
|
|
|
|
|
function Yg(a,b){a.b=null;b=x(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa(Qg,b.data),a.b=b.data)}catch(d){z(d.message+" ("+c+")")}return a.b}function Bg(a){var b=null;a.b&&(b=ta()+"/api/v1/user?req=load&user="+a.b+"&state="+Zg(a,"1.31.0"));return b}
|
|
|
|
|
function Wg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Zg(a,"1.31.0");d.data=c;b=x(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.B("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.B(c),Aa(Qg,""),a.b=null)}}
|
|
|
|
|
function yf(a){var b;a=C(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function Ic(a){if(a.ab){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.ab.focus();window&&window.scrollTo(b,c)}}var Jg="failsafe",Eg="validate",Gg="timestamp",Tg="version",Ug="url",Vg="browser",Qg="user",Ig=-1,yg=0,Hg=1,Lg=2,Xg=3;
|
|
|
|
|
Ea(function(){for(var a=F(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=D(c),c=F(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=D(f),g=new wg(g,d,!0);E(g,f);g.w&&Cg(g,g.qb)}});Fa.show.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Pa("Computer",c.id))&&c.H&&!c.l.R&&c.qb(Ig)}});Fa.exit.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Pa("Computer",c.id))&&c.l.R&&Sg(c,!(!c.a||c.o),!0)}});
|
|
|
|
|
function R(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.j=!1;this.key=Zg(a,b,c);Og(this,a.Uc)}h=R.prototype;h.set=function(a,b){try{this.c[a]=b}catch(c){}};h.get=function(a){return this.c[a]||null};h.data=function(){return this.c};function Ag(a,b){return b?(a.a=b,a.b=!0,a.j=!1,!0):a.b?!0:va()&&(b=za(a.key))?(a.a=b,a.b=!0):!1}function Fg(a){var b=!0;if(!a.j)try{a.c=JSON.parse(a.a),a.j=!0}catch(c){z(c.message||c),b=!1}return b}
|
|
|
|
|
function Pg(a){var b=!0;if(va()){var c=JSON.stringify(a.c);Aa(a.key,c)||(z("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function Og(a,b){a.a="";a.c={};a.b=a.j=!1;b&&a.set("parms",b)}
|
|
|
|
|
h.clear=function(a){Og(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 Zg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var $g=0;
|
|
|
|
|
function ah(a,b,c,d,e,f){e("Loading "+a+"...");x(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):bh(k,a,b,c,d,e,f)})}
|
|
|
|
|
function bh(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ma(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
|
|
|
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?ch(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
|
|
|
function ch(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");x(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
|
|
|
|
"");a=a.replace(d[0],g);ch(a,b,c)}})}else c(a,null)}
|
|
|
|
|
function dh(a,b,c,d){function e(a){if(void 0===k){var b=g&&F(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ma(a))}function f(a){e("Error: "+a);l&&(--$g||Ia(!0));l=!1}var g,k,l=!0;$g++;Na[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c||
|
|
|
|
|
(c="/versions/pdpjs/1.31.0/components.xsl");m=function(d,k){k?ah(c,null,null,!1,e,function(d,l){l?(Ma(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--$g||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--$g||Ia(!0)):f("invalid machine element: "+
|
|
|
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ah(b,a,d,!0,e,m):bh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return dh(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.31.0/pdp11.map
|
|
|
|
|
h.aa=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.g||(d.l.R?Tg(d,!1,!0):Dg(d,d.qb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.l.R&&!d.g)if(d.a&&!d.o){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Tg(d,a,!0);!a&&d.G?window&&window.location.reload():(a||(d.i=!0),d.qb(zg),d.i=!1)}else d.reset(),d.c&&d.c.Ca()},!0;case "save":if(ma(ua(),"pcjs.org"))c.parentNode.removeChild(c);
|
|
|
|
|
else return this.j[b]=c,c.onclick=function(){var a=Ag(d,!0);if(a){var b=!!(d.a&&!d.o||d.G),c=Tg(d,b);b?Xg(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
|
|
|
|
|
function Ag(a,b){var c=a.b;c||((c=za(Rg),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Zg(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c}
|
|
|
|
|
function Zg(a,b){a.b=null;b=v(ua()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa(Rg,b.data),a.b=b.data)}catch(d){y(d.message+" ("+c+")")}return a.b}function Cg(a){var b=null;a.b&&(b=ua()+"/api/v1/user?req=load&user="+a.b+"&state="+$g(a,"1.31.0"));return b}
|
|
|
|
|
function Xg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=$g(a,"1.31.0");d.data=c;b=v(ua()+"/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.B("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.B(c),Aa(Rg,""),a.b=null)}}
|
|
|
|
|
function yf(a){var b;a=B(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function Ic(a){if(a.ab){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.ab.focus();window&&window.scrollTo(b,c)}}var Kg="failsafe",Fg="validate",Hg="timestamp",Ug="version",Vg="url",Wg="browser",Rg="user",Jg=-1,zg=0,Ig=1,Mg=2,Yg=3;
|
|
|
|
|
Ea(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=C(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=C(f),g=new xg(g,d,!0);D(g,f);g.w&&Dg(g,g.qb)}});Fa.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Pa("Computer",c.id))&&c.H&&!c.l.R&&c.qb(Jg)}});Fa.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Pa("Computer",c.id))&&c.l.R&&Tg(c,!(!c.a||c.o),!0)}});
|
|
|
|
|
function Q(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.j=!1;this.key=$g(a,b,c);Pg(this,a.Uc)}h=Q.prototype;h.set=function(a,b){try{this.c[a]=b}catch(c){}};h.get=function(a){return this.c[a]||null};h.data=function(){return this.c};function Bg(a,b){return b?(a.a=b,a.b=!0,a.j=!1,!0):a.b?!0:wa()&&(b=za(a.key))?(a.a=b,a.b=!0):!1}function Gg(a){var b=!0;if(!a.j)try{a.c=JSON.parse(a.a),a.j=!0}catch(c){y(c.message||c),b=!1}return b}
|
|
|
|
|
function Qg(a){var b=!0;if(wa()){var c=JSON.stringify(a.c);Aa(a.key,c)||(y("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function Pg(a,b){a.a="";a.c={};a.b=a.j=!1;b&&a.set("parms",b)}
|
|
|
|
|
h.clear=function(a){Pg(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 $g(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var ah=0;
|
|
|
|
|
function bh(a,b,c,d,e,f){e("Loading "+a+"...");v(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):ch(k,a,b,c,d,e,f)})}
|
|
|
|
|
function ch(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ma(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
|
|
|
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?dh(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
|
|
|
function dh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");v(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
|
|
|
|
"");a=a.replace(d[0],g);dh(a,b,c)}})}else c(a,null)}
|
|
|
|
|
function eh(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--ah||Ia(!0));l=!1}var g,k,l=!0;ah++;Na[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c||
|
|
|
|
|
(c="/versions/pdpjs/1.31.0/components.xsl");m=function(d,k){k?bh(c,null,null,!1,e,function(d,l){l?(Ma(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ah||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ah||Ia(!0)):f("invalid machine element: "+
|
|
|
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bh(b,a,d,!0,e,m):ch(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return eh(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.31.0/pdp11.map
|
|
|
|
|
|