284 lines
103 KiB
JavaScript
284 lines
103 KiB
JavaScript
(function(){/*
|
|
http://pcjs.org/modules/shared/es6/diskapi.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/dumpapi.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/reportapi.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/userapi.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/keys.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/strlib.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/weblib.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/messages.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/panel.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/device.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/cpu.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/rom.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/ram.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/state.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/embed.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/defines.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/usrlib.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/component.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/defines.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/bus.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/memory.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/cpustate.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/cpuops.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/serial.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/shared/es6/debugger.js (C) Jeff Parsons 2012-2017
|
|
http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017
|
|
*/
|
|
var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++}
|
|
function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ha(a){fa();a={next:a};a[ba.Symbol.iterator]=function(){return this};return a}
|
|
function n(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ia=ba,ja=["Math","log2"],ka=0;ka<ja.length-1;ka++){var la=ja[ka];la in ia||(ia[la]={});ia=ia[la]}var ma=ja[ja.length-1],na=ia[ma],oa=na?na:function(a){return Math.log(a)/Math.LN2};oa!=na&&null!=oa&&aa(ia,ma,{configurable:!0,writable:!0,value:oa});
|
|
var pa={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},q={Gf:0,Gc:1,If:2,Jf:3,Kf:4,Lf:5,Mf:6,Nf:7,ic:8,Of:9,Hc:10,Pf:11,Qf:12,Ic:13,Rf:14,Sf:15,Tf:16,Uf:17,Vf:18,Wf:19,Xf:20,Yf:21,Zf:22,$f:23,ag:24,bg:25,cg:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,
|
|
"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,hc:65,Ff:66,Hf:67,dg:68,E:69,eg:70,fg:71,gg:72,hg:73,ig:74,jg:75,kg:76,lg:77,mg:78,ng:79,og:80,Q:81,pg:82,qg:83,rg:84,sg:85,tg:86,ug:87,vg:88,wg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,xg:97,yg:98,zg:99,d:100,e:101,Bg:102,Cg:103,Dg:104,Eg:105,Hg:106,k:107,Ig:108,Jg:109,n:110,Kg:111,p:112,q:113,r:114,Lg:115,t:116,Mg:117,Ng:118,Og:119,x:120,y:121,z:122,"{":123,
|
|
"|":124,"}":125,"~":126,Jc: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 qa(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 ra(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 sa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ta(a,b){return-1!==a.indexOf(b,a.length-b.length)}function ua(a){return a.replace(/[&<>"']/g,function(a){return va[a]})}function wa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
|
var va={"&":"&","<":"<",">":">",'"':""","'":"'"},xa={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 ya(){return Date.now()||+new Date}
|
|
function za(){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 Aa(a,b){var c,d={N:null,fa:null,Z:null,Y: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.Z=g.load;d.Y=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.fa=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 Ba(){return"http://"+(window?window.location.host:"www.pcjs.org")}function z(a){window&&window.alert(a)}function Ca(a){var b=!1;window&&(b=window.confirm(a));return b}function Da(){if(null==Fa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Fa=a}return Fa}
|
|
function Ga(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ha(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ia(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
|
|
function Ja(a){if(!Ka){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Ka=c}return Ka[a]}
|
|
function La(a,b){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 Ma(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Na(a){Oa.init.push(a)}function Pa(a){if(Qa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){z&&z(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ra(a){!Qa&&a?(Qa=!0,Sa&&Ta("init"),Ua&&Ta("show")):Qa=a}function Ta(a){Oa[a]&&Pa(Oa[a])}var Ka=null,Oa={init:[],show:[],exit:[]},Sa=!1,Ua=!1,Qa=!0,Fa=null;
|
|
Ma("onload",function(){Sa=!0;Pa(Oa.init)});Ma("onpageshow",function(){Ua=!0;Pa(Oa.show)});Ma(Ia("Opera")||Ia("iOS")?"onunload":"onbeforeunload",function(){Pa(Oa.exit)});
|
|
function A(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.mc=b.comment;this.Rc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Ka=this.id:(this.La=this.id.substr(0,a),this.Ka=this.id.substr(a+1));this.l={ready:!1,Sa:!1,Xb:!1,R:!1,error:!1};this.Bb=null;this.l.error=!1;this.j={};this.Kc=d||0;this.D=this.c=this.u=this.A=this.ab=null;B.push(this)}function Va(a,b,c){Wa[a]&&b&&(Wa[a][b]=c)}function y(a){z&&z(a)}
|
|
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 Xa(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 Ya(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){y(c.message+" ("+a+")")}return b}function E(a,b){var c=F;b=G(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=D(g))&&k.binding&&a.ca(k.type,k.binding,g,k.value),m=l.length}}}}
|
|
function G(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};
|
|
h.ca=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.V=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.V(a,this.Ka)}),!0;default:return!1}};h.log=function(){};h.V=function(){};
|
|
h.status=function(a){this.V(this.Ka+": "+a)};h.B=function(a,b,c){c=c||this.type;!b&&z&&z((c?c+": ":"")+a)};function Za(a,b){a.l.error=!0;a.B(b)}function $a(a,b){b&&(a.l.ready?b():a.Bb=b);return a.l.ready}function H(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.Bb,a.Bb=null,b&&b()))}function ab(a,b){a.l.Xb?(a.l.Sa=!1,a.l.Xb=!1):a.l.error?a.V(a.toString()+" error"):a.l.Sa=b}h.ha=function(){return this.l.R=!0};h.ga=function(a,b){b&&(this.l.R=!1);return!0};
|
|
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var Wa=window?window.PCjs.Machines:{},B=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 bb="undefined"!==typeof ArrayBuffer,F="pdp11",cb="PDPjs",db=!0,eb=!0,fb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"},F="pdp11",cb="PDPjs",eb=db=!0;
|
|
function gb(a,b){A.call(this,"Panel",a,0,512);this.i=this.m=0;this.C=b;this.ja=this.g=this.b=this.h=0;this.s=this.v=this.o=!1;this.w=hb;this.f={};this.a={START:[1,1,!0,!1,this.md],STEP:[1,1,!1,!1,this.nd],ENABLE:[1,1,!1,!1,this.hd],CONT:[1,1,!0,!1,this.fd],DEP:[0,0,!0,!1,this.gd],EXAM:[1,1,!0,!1,this.jd],LOAD:[1,1,!0,!1,this.ld],TEST:[0,0,!0,!1,this.kd]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.od,a];this.D=this.c=this.u=this.A=null;H(this)}n(gb,A);h=gb.prototype;h.reset=function(){this.stop()};
|
|
h.ca=function(a,b,c,d){if(this.A&&this.A.ca(a,b,c,d)||this.c&&this.c.ca(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(){ib(a,
|
|
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){jb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ib(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){jb(a,b)}}(this,b),!0):A.prototype.ca.call(this,a,b,c,d)}};h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;kb(b,this,lb);mb(b,this.reset.bind(this));nb(this);ob(this)};h.ha=function(a,b){b||(this.C&&pb(),this.reset());return!0};h.ga=function(){return!0};
|
|
function qb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function nb(a,b){for(var c in a.f)qb(a,c,null!=b?b:a.f[c])}function rb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ob(a){for(var b in a.a)rb(a,b,a.a[b][1])}function sb(a,b,c,d){a.j[b]&&(void 0===c&&(Za(a,"Value for "+b+" is invalid"),I(a.c)),c=8==(a.D&&a.D.h||8)?qa(c,d):ra(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
|
|
function ib(a,b){var c=a.a[b];rb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=tb&&(a.s=b==ub,a.v=b==vb)}function jb(a,b){var c=a.a[b];c[2]&&c[3]&&(rb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.md=function(a){a||this.c.l.P||(a=this.c,a.u.reset(),wb(a),this.a[xb]&&this.a[xb][1]&&yb(this.c))};h.nd=function(){};h.hd=function(a){a||I(this.c)};
|
|
h.fd=function(a){if(!a&&!this.c.l.P)if(this.a[xb]&&this.a[xb][1])yb(this.c);else{a=this.D;var b;if(b=a)a.l.Sa&&(a.l.Xb=!0),b=!a.l.Sa;if(b)ab(a,!0),a.f(0,null),ab(a,!1);else try{var c=this.c.Qb(1);0<c&&(zb(this.c,c),Ab(this.c,c,!0),Bb(this.c,c))}catch(d){"number"!=typeof d&&Za(this.c,d.stack||d.message)}this.stop();this.A&&Cb(this.A)}};h.gd=function(a){if(a&&!this.c.l.P)if(this.s&&Db(this),a=Eb(this,this.b),this.w==hb)Fb(this.u,this.ja,a);else{var b=this.c,c=this.ja;b.bb++;b.u.yb(Gb(b,c,4),a);b.bb--}};
|
|
h.jd=function(a){if(!a&&!this.c.l.P){this.v&&Db(this);if(this.w==hb)a=Hb(this.u,this.ja);else{a=this.c;var b=this.ja;a.bb++;b=a.u.xb(Gb(a,b,2));a.bb--;a=b}Eb(this,a)}};h.ld=function(a){a||this.c.l.P||Ib(this,this.b)};h.kd=function(a){if(a)this.o=!0,nb(this,!0);else if(this.o=!1,nb(this),void 0!==this.j[Jb]){for(a=this.b=0;22>a;a++)this.a["S"+a][1]=0&1<<a?1:0;ob(this)}};h.od=function(a,b){this.b=a?this.b|1<<b:this.b&~(1<<b)};
|
|
function Db(a){var b=1140>=a.c.pa?8:16,c=65472<=a.ja&&a.ja<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[tb]&&a.a[tb][1]||(b=-b);Ib(a,a.ja&~c|a.ja+b&c)}function Ib(a,b){a.ja=b&a.u.v;b=a.ja;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<<c)}function Eb(a,b){a.g=b&65535;b=a.g;for(var c=0;16>c;c++)Kb(a,"D"+c,b&1<<c);return a.g}function Kb(a,b,c){a.f[b]=c;a.o||qb(a,b,c)}h.stop=function(){Ib(this,this.c.b[7])};h.setData=function(a,b){b?this.h=a:this.g=a};h.td=function(a,b){return(b?this.h:this.b)&65535};
|
|
h.Ee=function(a){this.h=a};function pb(){for(var a=G(document,F,"panel"),b=0;b<a.length;b++){var c=a[b],d=D(c),e=Xa(d.id);e||(e=new gb(d,!0));E(e,c)}}var hb=7,Jb="S0",ub="DEP",xb="ENABLE",vb="EXAM",tb="STEP",Lb={},lb=(Lb[65400]=[null,null,gb.prototype.td,gb.prototype.Ee,"CNSW"],Lb);Na(pb);
|
|
function Mb(a,b,c){A.call(this,"Bus",a,0,16);this.c=b;this.D=c;this.S=+a.busWidth||16;this.F=1<<this.S;this.v=this.F-1;this.g=Nb;this.h=Math.log2(this.g);this.K=this.g>>2;this.f=this.g-1;this.s=this.F/this.g|0;this.L=this.s-1;this.Ha=[];this.m=0;this.o=!1;this.G=[];this.Vc=[Ob,Pb,Qb,Rb];this.a=this.b=[];this.C=this.w=this.i=this.H=this.I=0;a=new J(this);Sb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b<this.s;b++)this.a[b]=this.b[b]=a;this.C=this.F-Nb;Tb(this,this.C,Nb,Ub,this);this.I=this.H=
|
|
(this.C&this.v)>>>this.h;this.w=0;this.i=this.v;H(this)}n(Mb,A);function Vb(a,b){if(b!=a.w){for(var c=0;c<a.s;c++)a.b[c]=a.a[c];a.w=0;a.i=a.v;b&&(a.w=b,b=1<<b,a.i=b-1,b-=Nb,a.I=(b&a.i)>>>a.h,a.b[a.I]=a.a[a.H])}}h=Mb.prototype;h.reset=function(){for(var a=0;a<this.G.length;a++)this.G[a]();Vb(this,16)};h.ha=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.save=function(){var a=new K(this);a.set(0,Wb(this));return a.data()};
|
|
h.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&d.length<this.K){for(var e=0,f=Array(this.K),g=0;g<d.length-1;)for(var k=d[g++],l=d[g++];k--;)f[e++]=l;d=f}e=this.a[c];if(!e||!e.restore(d)){y("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
|
function Tb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.g,p=a.g-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ra)return l.vb+=l.Ra-f,l.Ra=f,!0;if(f>=l.Ra+l.vb){p=l.size-(f-m);p>g&&(p=g);l.vb=f-l.Ra+p;f=m+a.g;g-=p;k++;continue}}return Xb(Yb,f,g)}f=new J(a,f,p,a.g,d,e);Sb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Zb[d]+" at "+qa(b)),!0):Xb($b,b,c)}h.Ec=function(a){return this.b[(a&this.i)>>>this.h].hb(a&this.f,a)};
|
|
h.xb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return eb||b!=this.f?this.b[c].W(b,a):this.b[c++].hb(b,a)|this.b[c&this.L].hb(0,a+1)<<8};h.Fc=function(a,b){this.b[(a&this.i)>>>this.h].kb(a&this.f,b,a)};h.yb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;eb||c!=this.f?this.b[d].nb(c,b,a):(this.b[d++].kb(c,b&255,a),this.b[d&this.L].kb(0,b>>8&255,a+1))};function ac(a,b){return a.a[(b&a.v)>>>a.h]}
|
|
function Hb(a,b){var c;a.o=!1;a.m++;var d=b&a.f,e=ac(a,b);eb||d!=a.f?c=e.D(d,b):c=e.i(d,b)|ac(a,b+1).i(0,b+1)<<8;a.m--;return c}function bc(a,b,c){a.o=!1;a.m++;ac(a,b).j(b&a.f,c&255,b);a.m--}function Fb(a,b,c){a.o=!1;a.m++;var d=b&a.f,e=ac(a,b);eb||d!=a.f?e.m(d,c&65535,b):(e.j(d,c&255,b),ac(a,b+1).j(0,c>>8&255,b+1));a.m--}
|
|
function Wb(a){for(var b=0,c=[],d=0;d<a.s;d++){var e=a.a[d];if(e.xa||e.ad){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 cc(a){for(var b=dc,c=0,d=0;d<a.a.length;d++){var e=a.a[d];e.type==b&&(c=e.Ra+e.vb)}return c}
|
|
function ec(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&fc;if(void 0!==a.Ha[p])return z&&z("I/O address already registered: "+ra(b,8,!0)),!1;var t=l||"unknown";t&&0<=m&&(t+=m++);a.Ha[p]=[d,e,f,g,t,k||16,!1]}return!0}
|
|
function kb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.pa)){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),!ec(a,f,f,k,l,m,p,g[7]||b.Kc,t||b.Ka))return!1}}return!0}
|
|
function mb(a,b){a.G.push(b)}function L(a,b,c){a.o=!0;a.m||(c&&(a.c.G|=c),M(a.c,4,0,b))}function hc(a){var b=a.o;a.o=!1;return b}function Xb(a,b,c){y("Memory block error ("+a+": "+ra(b)+","+ra(c)+")");return!1}var Nb=8192,fc=Nb-1,Yb=1,$b=2;function Ob(a,b){var c=-1,d=this.controller,e=d.Ha[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.Ha[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;L(d,b,16);return 255}
|
|
function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[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.Ha[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||L(e,c,16)}function Qb(a,b){var c=-1,d=this.controller;a=d.Ha[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;L(d,b,16);return 65535}
|
|
function Rb(a,b,c){var d=!1,e=this.controller;a=e.Ha[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||L(e,c,16)}function N(a){A.call(this,"Device",a,0,256);this.a={Ag:0,bc:-1}}n(N,A);h=N.prototype;h.aa=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.bc=ic(c,function(){e.a.fb|=128;e.a.fb&64&&jc(e.c,e.a.Ia);e.A&&Cb(e.A,1);kc(e.c,e.a.bc,1E3/60)});this.a.Ia=lc(c,64,6,524288);kb(b,this,mc);mb(b,this.reset.bind(this));H(this)};
|
|
h.reset=function(){this.a.fb=128;kc(this.c,this.a.bc,1E3/60,!0)};h.Ad=function(){return this.a.fb};h.Le=function(a){this.a.fb=a&192;this.a.fb&64||(a=this.a.Ia)&&nc(this.c,a)};h.Cd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Na<<5|a.Oa<<1);return b};h.Ne=function(a){oc(this.c,a&-129|this.c.H&128)};h.Dd=function(){var a=this.c;a.H&57344||(a.cb=a.F>>16&65535);a=a.cb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ed=function(){var a=this.c;a.H&57344||(a.eb=a.F&65535);return a.eb};h.Fd=function(){return this.c.la};
|
|
h.Oe=function(a){var b=this.c;1170>b.pa&&(a&=-49);b.la!=a&&(b.la=a,b.Ba=a&16?4194303:262143,pc(b))};h.me=function(a){a=a>>1&63;var b=this.c.Ga[a>>1];return a&1?b>>16:b&65535};h.xf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ga[c]=b&1?this.c.Ga[c]&65535|(a&63)<<16:this.c.Ga[c]&-65536|a&65534};h.fe=function(a){return this.c.s[1][a>>1&7]};h.qf=function(a,b){this.c.s[1][b>>1&7]=a&65295};h.de=function(a){return this.c.s[1][(a>>1&7)+8]};h.nf=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};
|
|
h.ee=function(a){return this.c.I[1][a>>1&7]};h.pf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.ce=function(a){return this.c.I[1][(a>>1&7)+8]};h.mf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.s[1][b]&=65295};h.zd=function(a){return this.c.s[0][a>>1&7]};h.Ke=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.xd=function(a){return this.c.s[0][(a>>1&7)+8]};h.Ie=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.yd=function(a){return this.c.I[0][a>>1&7]};
|
|
h.Je=function(a,b){b=b>>1&7;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.wd=function(a){return this.c.I[0][(a>>1&7)+8]};h.He=function(a,b){b=(b>>1&7)+8;this.c.I[0][b]=a;this.c.s[0][b]&=65295};h.le=function(a){return this.c.s[3][a>>1&7]};h.wf=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.je=function(a){return this.c.s[3][(a>>1&7)+8]};h.uf=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};h.ke=function(a){return this.c.I[3][a>>1&7]};h.vf=function(a,b){b=b>>1&7;this.c.I[3][b]=a;this.c.s[3][b]&=65295};
|
|
h.ie=function(a){return this.c.I[3][(a>>1&7)+8]};h.tf=function(a,b){b=(b>>1&7)+8;this.c.I[3][b]=a;this.c.s[3][b]&=65295};h.ib=function(a){a&=7;return this.c.i&2048?this.c.qa[a]:this.c.b[a]};h.lb=function(a,b){b&=7;this.c.i&2048?this.c.qa[b]=a:this.c.b[b]=a};h.Kd=function(){return this.c.i&49152?this.c.X[0]:this.c.b[6]};h.Te=function(a){this.c.i&49152?this.c.X[0]=a:this.c.b[6]=a};h.Nd=function(){return this.c.b[7]};h.We=function(a){this.c.b[7]=a};
|
|
h.jb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.qa[a]};h.mb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.qa[b]=a};h.Ld=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.X[1]};h.Ue=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.X[1]=a};h.Md=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.X[3]};h.Ve=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.X[3]=a};h.vd=function(a){return this.c.tb[a-65504>>1]};
|
|
h.Ge=function(a,b){this.c.tb[b-65504>>1]=a};h.zc=function(a){return 65520==a?(cc(this.u)>>6)-1:0};h.Cc=function(){};h.he=function(){return 1};h.sf=function(){};h.ud=function(){return this.c.G};h.Fe=function(){this.c.G=0};h.Bd=function(){return this.c.sb};h.Me=function(a,b){b&1||(a&=255);this.c.sb=a};h.Gd=function(a,b){return b?0:this.c.Qa};h.Pe=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Qa=a};h.ge=function(a,b){return b?0:this.c.Fa&65280};
|
|
h.rf=function(a){this.c.Fa=a|255};h.Jd=function(){return qc(this.c)};h.Se=function(a){rc(this.c,a)};h.Bc=function(){};
|
|
var O={},mc=(O[61568]=[null,null,N.prototype.me,N.prototype.xf,"UNIMAP",64,1170],O[62592]=[null,null,N.prototype.fe,N.prototype.qf,"SIPDR",8,1145,64],O[62608]=[null,null,N.prototype.de,N.prototype.nf,"SDPDR",8,1145,64],O[62624]=[null,null,N.prototype.ee,N.prototype.pf,"SIPAR",8,1145,64],O[62640]=[null,null,N.prototype.ce,N.prototype.mf,"SDPAR",8,1145,64],O[62656]=[null,null,N.prototype.zd,N.prototype.Ke,"KIPDR",8,1140,64],O[62672]=[null,null,N.prototype.xd,N.prototype.Ie,"KDPDR",8,1145,64],O[62688]=
|
|
[null,null,N.prototype.yd,N.prototype.Je,"KIPAR",8,1140,64],O[62704]=[null,null,N.prototype.wd,N.prototype.He,"KDPAR",8,1145,64],O[62798]=[null,null,N.prototype.Fd,N.prototype.Oe,"MMR3",1,1145,64],O[65382]=[null,null,N.prototype.Ad,N.prototype.Le,"LKS"],O[65402]=[null,null,N.prototype.Cd,N.prototype.Ne,"MMR0",1,1140,64],O[65404]=[null,null,N.prototype.Dd,N.prototype.Bc,"MMR1",1,1145,64],O[65406]=[null,null,N.prototype.Ed,N.prototype.Bc,"MMR2",1,1140,64],O[65408]=[null,null,N.prototype.le,N.prototype.wf,
|
|
"UIPDR",8,1140,64],O[65424]=[null,null,N.prototype.je,N.prototype.uf,"UDPDR",8,1145,64],O[65440]=[null,null,N.prototype.ke,N.prototype.vf,"UIPAR",8,1140,64],O[65456]=[null,null,N.prototype.ie,N.prototype.tf,"UDPAR",8,1145,64],O[65472]=[null,null,N.prototype.ib,N.prototype.lb,"R0SET0"],O[65473]=[null,null,N.prototype.ib,N.prototype.lb,"R1SET0"],O[65474]=[null,null,N.prototype.ib,N.prototype.lb,"R2SET0"],O[65475]=[null,null,N.prototype.ib,N.prototype.lb,"R3SET0"],O[65476]=[null,null,N.prototype.ib,
|
|
N.prototype.lb,"R4SET0"],O[65477]=[null,null,N.prototype.ib,N.prototype.lb,"R5SET0"],O[65478]=[null,null,N.prototype.Kd,N.prototype.Te,"R6KERNEL"],O[65479]=[null,null,N.prototype.Nd,N.prototype.We,"R7KERNEL"],O[65480]=[null,null,N.prototype.jb,N.prototype.mb,"R0SET1",1,1145],O[65481]=[null,null,N.prototype.jb,N.prototype.mb,"R1SET1",1,1145],O[65482]=[null,null,N.prototype.jb,N.prototype.mb,"R2SET1",1,1145],O[65483]=[null,null,N.prototype.jb,N.prototype.mb,"R3SET1",1,1145],O[65484]=[null,null,N.prototype.jb,
|
|
N.prototype.mb,"R4SET1",1,1145],O[65485]=[null,null,N.prototype.jb,N.prototype.mb,"R5SET1",1,1145],O[65486]=[null,null,N.prototype.Ld,N.prototype.Ue,"R6SUPER",1,1145],O[65487]=[null,null,N.prototype.Md,N.prototype.Ve,"R6USER",1,1145],O[65504]=[null,null,N.prototype.vd,N.prototype.Ge,"CTRL",8,1170],O[65520]=[null,null,N.prototype.zc,N.prototype.Cc,"LSIZE",1,1170],O[65522]=[null,null,N.prototype.zc,N.prototype.Cc,"HSIZE",1,1170],O[65524]=[null,null,N.prototype.he,N.prototype.sf,"SYSID",1,1170],O[65526]=
|
|
[null,null,N.prototype.ud,N.prototype.Fe,"ERR",1,1170],O[65528]=[null,null,N.prototype.Bd,N.prototype.Me,"MBR",1,1170],O[65530]=[null,null,N.prototype.Gd,N.prototype.Pe,"PIR"],O[65532]=[null,null,N.prototype.ge,N.prototype.rf,"SLR"],O[65534]=[null,null,N.prototype.Jd,N.prototype.Se,"PSW"],O);
|
|
Na(function(){for(var a=G(document,F,"device"),b=0;b<a.length;b++){var c,d=a[b];c=D(d);switch(c.type){case "default":c=new N(c);E(c,d);break;case "pc11":c=new sc(c);E(c,d);break;case "rl11":c=new P(c);E(c,d);break;case "rk11":c=new Q(c),E(c,d)}}});
|
|
function J(a,b,c,d,e,f){this.b=a;this.id=tc+=2;this.c=null;this.Ra=b;this.vb=c;this.size=d||0;this.type=e||uc;this.A=e==vc;this.controller=null;this.hb=this.i=this.Zb;this.W=this.D=this.$b;this.kb=this.j=this.wb;this.nb=this.m=this.dc;this.g=this.h=0;Sb(this);this.xa=this.ad=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],wc(this,f.Vc);else if(bb)this.f=new ArrayBuffer(this.size),this.u=new DataView(this.f,0,this.size),this.a=new Uint8Array(this.f,0,this.size),this.o=new Uint16Array(this.f,
|
|
0,this.size>>1),this.c=new Int32Array(this.f,0,this.size>>2),wc(this,xc?yc:zc);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;wc(this,Bc)}else wc(this)}h=J.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(bb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.u.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(bb)for(b=0;b<a.length;b++)this.u.setInt32(b<<2,a[b],!0);else this.c=a;return this.xa=!0}return!1};function wc(a,b){b||(b=Cc);Dc(a,b,void 0);Ec(a,b,void 0)}function Dc(a,b,c){c&&a.g||(a.hb=b[0]||a.Zb,a.W=b[2]||a.$b);if(c||void 0===c)a.i=b[0]||a.Zb,a.D=b[2]||a.$b}function Ec(a,b,c){c&&a.h||(a.kb=!a.A&&b[1]||a.wb,a.nb=!a.A&&b[3]||a.dc);if(c||void 0===c)a.j=b[1]||a.wb,a.m=b[3]||a.dc}
|
|
function Sb(a,b){a.g=a.h=0;b&&((a.g=b.g)&&Dc(a,Fc,!1),(a.h=b.h)&&Ec(a,Fc,!1))}h.Zb=function(a,b){L(this.b,b,32);return 255};h.wb=function(a,b,c){L(this.b,c,32)};h.$b=function(a,b){return this.hb(a++,b++)|this.hb(a,b)<<8};h.dc=function(a,b,c){this.kb(a++,b&255,c++);this.kb(a,b>>8,c)};h.sd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.re=function(a,b){db&&a&1&&L(this.b,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.De=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.xa=!0};h.Bf=function(a,b,c){db&&a&1&&L(this.b,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.xa=!0};h.qd=function(a,b){return this.i(a,b)};h.oe=function(a,b){return this.D(a,b)};h.Be=function(a,b,c){this.A?this.wb(0,0,c):this.j(a,b,c)};h.zf=function(a,b,c){this.A?this.wb(0,0,c):this.m(a,b,c)};h.pd=function(a){return this.a[a]};
|
|
h.rd=function(a){return this.a[a]};h.ne=function(a,b){db&&a&1&&L(this.b,b,64);return this.u.getUint16(a,!0)};h.qe=function(a,b){db&&a&1&&L(this.b,b,64);return!eb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Ae=function(a,b){this.a[a]=b;this.xa=!0};h.Ce=function(a,b){this.a[a]=b;this.xa=!0};h.yf=function(a,b,c){db&&a&1&&L(this.b,c,64);this.u.setUint16(a,b,!0);this.xa=!0};h.Af=function(a,b,c){db&&a&1&&L(this.b,c,64);!eb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.xa=!0};
|
|
var uc=0,dc=1,vc=2,Ub=4,Zb=["NONE","RAM","ROM","VID","H/W"],tc=0,Cc=[],Bc=[J.prototype.sd,J.prototype.De,J.prototype.re,J.prototype.Bf],Fc=[J.prototype.qd,J.prototype.Be,J.prototype.oe,J.prototype.zf];if(bb)var zc=[J.prototype.pd,J.prototype.Ae,J.prototype.ne,J.prototype.yf],yc=[J.prototype.rd,J.prototype.Ce,J.prototype.qe,J.prototype.Af];var Gc;if(bb){var Hc=new ArrayBuffer(2);(new DataView(Hc)).setUint16(0,256,!0);Gc=256===(new Uint16Array(Hc))[0]}else Gc=!1;var xc=Gc;
|
|
function Ic(a,b){A.call(this,"CPU",a,0,1);b=+a.cycles||b;var c=+a.multiplier||1;this.ec=0;this.Lb=b;this.Pa=c;this.Tb=Math.round(this.Lb/1E4)/100;this.Wa=this.Tb*this.Pa;this.Ub=this.rb=this.Za=this.Mb=0;this.l.P=!1;this.l.ac=!1;this.l.ma=a.autoStart;"string"==typeof this.l.ma&&(this.l.ma="true"==this.l.ma);this.l.zb=!1;this.Jb=this.Ya=0;this.Kb=+a.csStart;this.pb=+a.csInterval;this.qb=+a.csStop;this.sa=[];this.pc=this.ve.bind(this);this.Ea=this.va=this.Da=this.a=this.S=this.ua=this.ob=this.Ca=this.$a=
|
|
this.Vb=this.Ma=0;this.ka=null;H(this)}n(Ic,A);h=Ic.prototype;h.aa=function(a,b,c,d){this.A=a;this.u=b;this.D=d;this.ka=a.f;for(a=0;a<Jc.length;a++)(b=this.j[Jc[a]])&&this.A.ca(null,Jc[a],b);H(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
|
h.ha=function(a,b){var c=Kc(this.A,"autoStart");null!=c?this.l.ma="true"==c?!0:"false"==c?!1:!!c:null==this.l.ma&&(this.l.ma=void 0===this.j.run);if(!b){if(a){Lc(this);if(!this.restore(a))return!1;Mc(this)}else this.reset();this.V("No debugger detected");this.l.ma||this.V("CPU will not be auto-started "+(this.ka?"(click Run to start)":"(type 'go' to start)"))}return!0};h.ga=function(a){return a?this.save():!0};h.ma=function(){return this.l.P?!0:this.l.ma?(yb(this),!0):!1};h.wc=function(){return 0};
|
|
function Mc(a){void 0===a.Kb&&(a.Kb=0);void 0===a.pb&&(a.pb=-1);void 0===a.qb&&(a.qb=-1);a.l.zb=0<=a.Kb&&0<a.pb;a.l.zb&&(a.Jb=0,a.Ya=a.Kb-a.Ea)}function Bb(a,b){if(a.l.zb){var c=!1;a.Jb=a.Jb+a.wc()|0;a.Ya-=b;0>=a.Ya&&(a.Ya+=a.pb,c=!0);0<=a.qb&&a.qb<=Nc(a)&&(a.pb=a.qb=-1,Mc(a),I(a),c=!0);c&&a.V(Nc(a)+" cycles: checksum="+ra(a.Jb))}}
|
|
h.ca=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.Bb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.P?I(d):yb(d))},!0;case "speed":return this.j[b]=
|
|
c,!0;case "setSpeed":return this.j[b]=c,c.onclick=function(){Oc(d,d.Pa<<1,!0)},c.textContent=this.Wa.toFixed(2)+"Mhz",!0}return!1};function Ab(a,b,c){a.Ea+=b;c&&(a.Da=a.a=a.S=0)}function Pc(a,b){var c=1;b&&1<a.Pa&&a.Ma&&(c=a.Ma/a.Tb);a.Ub=Math.round(1E3/Qc);a.rb=Math.floor(a.Lb/Qc*c);b||(a.Za=a.rb);a.Mb=0}function Nc(a){return a.Ea+a.va+a.Da-a.a}function Lc(a){a.Ma=0;a.Vb=0;a.Ea=a.va=a.Da=a.a=a.S=0;Mc(a);Oc(a,1)}
|
|
function Oc(a,b,c){if(void 0!==b){.8>a.Ma/a.Wa&&(b=1);a.Pa=b;b=a.Tb*a.Pa;if(a.Wa!=b){a.Wa=b;b=a.Wa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.A&&Rc(a.A)}Ab(a,a.va);a.va=0;a.ua=ya();a.Ca=0;Pc(a)}function ic(a,b){var c=a.sa.length;a.sa.push([-1,b]);return c}function kc(a,b,c,d){0<=b&&b<a.sa.length&&(d||0>a.sa[b][0])&&(c=a.Lb*a.Pa/1E3*c|0,a.l.P&&(c+=Sc(a)),a.sa[b][0]=c)}
|
|
function zb(a,b){for(var c=a.sa.length-1;0<=c;c--){var d=a.sa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Sc(a,b){var c=a.Da-=a.a;a.a=a.S=0;b&&(a.Da=0);return c}
|
|
h.ve=function(){if(this.l.P){this.Mb>=this.Lb&&Pc(this,!0);this.$a=0;this.ob=ya();if(this.Ca){var a=this.ob-this.Ca;a>this.Ub&&(this.ua+=a,this.ua>this.ob&&(this.ua=this.ob))}try{do{for(var b,c=this.l.zb?1:this.rb,d=this.sa.length-1;0<=d;d--){var e=this.sa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Qb(b)}catch(f){if("number"!=typeof f)throw f;}b=Sc(this,!0);this.$a+=b;this.va+=b;Bb(this,b);zb(this,b);this.Za-=b;if(0>=this.Za){this.Za+=this.rb;++this.Vb>=Tc&&(this.A&&Cb(this.A,void 0),this.Vb=0);break}}while(this.l.P)}catch(f){I(this);
|
|
this.A&&this.A.stop(ya(),Nc(this));Za(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.pc;this.Ca=ya();c=this.Ub;this.$a&&(c=Math.round(c*this.$a/this.rb));c-=this.Ca-this.ob;if(d=this.Ca-this.ua)this.Ma=Math.round(this.va/(10*d))/100,864E5<=d&&(this.Ea=0,Oc(this));if(0>c||this.Ma<this.Wa)-1E3>c&&(this.ua-=c),c=0;this.Mb+=this.$a;this.Ca+=c;a(b,c)}}};
|
|
function yb(a){var b;a.l.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.V(a.toString()+" busy");else{Oc(a);a.l.P=!0;a.l.ac=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ua,Nc(a));a.D||a.status("Started");setTimeout(a.pc,0)}}h.Qb=function(){return 0};function I(a){var b=!1;if(a.l.P){Sc(a);Ab(a,a.va);a.va=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ya(),Nc(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Qc=30,Tc=15,Jc=["power","reset"];
|
|
function Uc(a){var b=+a.model||1170;Ic.call(this,a,6666667);this.pa=b;this.lc=+a.addrReset||0;this.i=this.v=this.m=this.o=this.w=0;this.b=this.qa=this.X=[];this.C=0;this.nc=[];this.s=this.I=this.Ga=this.tb=[];this.Nb=this.za=this.F=this.kc=this.Aa=this.Na=this.Oa=this.Ba=this.G=this.Qa=this.Fa=this.H=this.cb=this.eb=this.la=this.wa=this.h=this.f=this.Gb=this.K=this.L=this.g=this.sb=0;this.oc=255;1120>=this.pa?(this.jc=Vc.bind(this),this.Xa=this.Zc,this.Nb=8,this.oc=-1,this.rc=255,this.qc=0):(this.jc=
|
|
Wc.bind(this),this.Xa=this.$c,this.rc=~(1792|(1140>=this.pa?2048:0))&65535,this.qc=1140<this.pa?2048:0);this.bb=0;this.ea=null;this.Sb=[];this.l.complete=!1;this.Db=this.fc=this.bd;this.Eb=this.gc=this.dd;this.Ob=this.Pb=this.xe;this.Fb=this.Rb=this.ze;this.ta=this.Cb=0;this.oa=this.xc;this.W=this.Ac;this.nb=this.Dc;this.Tc=this.Sc=0}n(Uc,Ic);h=Uc.prototype;h.aa=function(a,b,c,d){Ic.prototype.aa.call(this,a,b,c,d);this.fc=b.Ec.bind(b);this.gc=b.xb.bind(b);this.Pb=b.Fc.bind(b);this.Rb=b.yb.bind(b)};
|
|
h.ha=function(a,b){for(var c=192,d=0;d<this.Sb.length;d++){var e=this.Sb[d];0>e.cc&&(e.cc=c,c+=4)}return Ic.prototype.ha.call(this,a,b)};
|
|
h.reset=function(){this.status("Model "+this.pa);this.l.P&&I(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.lc,-1,-2,-3,-4,-5,-6,-7,-8];this.qa=[0,0,0,0,0,0];this.X=[0,0,0,0];this.C=0;this.nc=[4,2,0,1];this.s=[[0,0,0,0,0,0,0,0,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.Ga=[0,0,0,0,0,0,0,0,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.tb=[0,0,0,0,0,0,0,0];this.h=this.f=this.Gb=this.K=this.L=this.g=this.sb=0;this.wa=-1;wb(this);Lc(this);this.l.error=!1;Ic.prototype.reset.call(this)};function wb(a){a.H=0;a.cb=0;a.eb=0;a.la=0;a.G=0;a.Qa=0;a.Fa=255;a.Aa=0;a.Na=0;a.Oa=0;a.Ba=262143;a.za=a.b[7];a.F=0;a.ea=null;a.u&&(pc(a),a.kc=cc(a.u))}
|
|
function pc(a){a.Db=a.fc;a.Eb=a.gc;a.Ob=a.Pb;a.Fb=a.Rb;a.Aa?(a.ta=65536,a.Cb=a.la&16?4186112:253952,a.oa=a.xc,a.W=a.Ac,a.nb=a.Dc,Vb(a.u,a.la&16?22:18)):(a.ta=0,a.Cb=57344,a.oa=a.cd,a.W=a.pe,a.nb=a.Cf,Vb(a.u,16))}function oc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.cb=a.F>>16&65535,a.eb=a.F&65535);a.H=b;a.Na=(b&96)>>5;a.Oa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Aa!=c&&(a.Aa=c,pc(a))}}
|
|
function Xc(a,b,c){a.lc=b;a.u.reset();wb(a);R(a,b);rc(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||yb(a)}else a.D?I(a)||a.D.g():!1===c&&I(a);!a.l.P&&a.ka&&a.ka.stop()}h.wc=function(){return 0};h.save=function(){var a=new K(this);a.set(0,[this.b,this.qa,this.X,this.Ga,this.tb,this.G,this.sb,this.Qa,this.Fa,this.wa,this.C,this.g,this.H,this.cb,this.eb,this.la,this.Na,this.Oa,this.s,this.I,this.Aa,this.Ba,this.za,this.F]);a.set(1,[qc(this)]);a.set(2,[this.Ea,this.Pa]);return a.data()};
|
|
h.restore=function(a){var b;b=a[0];fa();ca();fa();var c=b[Symbol.iterator];b=c?c.call(b):ga(b);this.b=b.next().value;this.qa=b.next().value;this.X=b.next().value;this.Ga=b.next().value;this.tb=b.next().value;this.G=b.next().value;this.sb=b.next().value;this.Qa=b.next().value;this.Fa=b.next().value;this.wa=b.next().value;this.C=b.next().value;this.g=b.next().value;this.H=b.next().value;this.cb=b.next().value;this.eb=b.next().value;this.la=b.next().value;this.Na=b.next().value;this.Oa=b.next().value;
|
|
this.s=b.next().value;this.I=b.next().value;this.Aa=b.next().value;this.Ba=b.next().value;this.za=b.next().value;this.F=b.next().value;b=a[1];rc(this,b[0]);b=a[2];this.Ea=b[0];Oc(this,b[1]);return!0};function Yc(a){return a.v&65536?1:0}function Zc(a){return a.w&32768?8:0}function $c(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}function S(a,b,c){c&&(R(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function R(a,b){a.b[7]=b&65535}
|
|
function lc(a,b,c,d){c={cc:b,gb:c,message:d||0,next:null};c.name=fb[b];a.Sb.push(c);return c}function nc(a,b){var c=a.ea;if(c==b)a.ea=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ea&&(a.g|=1)}function jc(a,b){if(b){if(b!=a.ea){var c=a.ea;if(!c||c.gb<=b.gb)b.next=c,a.ea=b;else{do{var d=c.next;if(!d||d.gb<=b.gb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function ad(a){return a.g&64?(M(a,168,64,-6),!0):a.g&32?(M(a,4,32,-5),!0):a.g&16?(M(a,12,16,-7),!0):!1}
|
|
function qc(a){return a.i=a.i&63728|Zc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|Yc(a)}function rc(a,b){b&=a.rc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.qc)for(var c=a.qa.length;0<=--c;){var d=a.b[c];a.b[c]=a.qa[c];a.qa[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.X[c]=a.b[6],a.b[6]=a.X[a.C]);a.i=b;a.g&=-3;a.g|=a.ea?2:1}h.da=function(a){this.w=this.o=a;this.m=0};h.Ja=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function bd(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}
|
|
function cd(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function M(a,b,c,d){if(!a.bb){0>a.wa?a.wa=qc(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.W(b|a.ta),f=a.W(b+2&65535|a.ta);rc(a,f&-12289|a.wa>>2&12288);dd(a,a.wa);dd(a,a.b[7]);R(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.wa=-1;a.Tc=b;a.Sc=d;-1==d&&I(a);if(-4<=d)throw b;}}function ed(a){var b=fd(a),c=fd(a);a.i&49152&&(c=c&-225|a.i&63712);R(a,b);rc(a,c);a.g&=-17}
|
|
function gd(a,b){var c=b>>13&31;31>c&&(b=a.la&32?a.Ga[c]+(b&8191)&4194303:b&-3932161);return b}
|
|
function Gb(a,b,c){var d,e,f;if(!(c&a.Aa))return f=b&65535,57344<=f&&(f|=a.Cb),f;d=b>>13;a.la&a.nc[a.C]||(d&=7);e=a.s[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ba;3932160<=f&&(f=gd(a,f));if(a.bb)return f;f>=a.kc&&f<a.Cb?(a.G|=32,M(a,4,0,f)):f&1&&!(c&1)&&(a.G|=64,M(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.s[a.C][d]=e;if(f!=(4194170&a.Ba)||a.C)a.Na=a.C,a.Oa=d;g&&(g&57344&&(0<=a.wa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Na<<5|a.Oa<<1,oc(a,a.H&-61695|g&61694)),M(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ba)||f>(4194239&a.Ba))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function fd(a){var b=a.W(a.b[6]|a.ta);a.b[6]=a.b[6]+2&65535;return b}function dd(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.Xa(4,-2,c);a.nb(c,b)}
|
|
function hd(a,b,c,d){var e,f,g=d&8?0:a.ta;switch(b){case 0:return M(a,4,0,-3),0;case 1:return 6==c&&a.Xa(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.Xa(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.W(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.Xa(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.W(e)|g;a.a-=8;break;case 6:return e=a.W($c(a,2)),e=e+a.b[c]&65535,6==c&&a.Xa(d,0,
|
|
e),a.a-=6,e|g;case 7:return e=a.W($c(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.ta),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.Zc=function(a,b,c){!this.C&&0>=b&&c<=this.Fa&&(this.g|=32)};h.$c=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Fa&&(c<=this.Fa-32?M(this,4,0,-4):(this.G|=8,this.g|=32)))};h.bd=function(a){return this.fc(a)};h.dd=function(a){return this.gc(a)};h.xe=function(a,b){this.Pb(a,b)};h.ze=function(a,b){this.Rb(a,b)};
|
|
h.cd=function(a,b,c){return hd(this,a,b,c)};h.xc=function(a,b,c){return Gb(this,hd(this,a,b,c),c)};h.pe=function(a){return this.u.xb(this.za=a)};h.Ac=function(a){return this.u.xb(this.za=Gb(this,a,2))};h.Cf=function(a,b){this.u.yb(this.za=a,b)};h.Dc=function(a,b){this.u.yb(this.za=Gb(this,a,4),b)};
|
|
function id(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=hd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.W(d|c&a.ta),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.X[a.i>>12&3];return c}function jd(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=hd(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=Gb(a,e|c&65536,4),a.C=a.i>>14&3,a.Fb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.X[a.i>>12&3]=d}
|
|
function kd(a,b){b>>=6;var c=a.L=b&7;return(b=a.K=(b&56)>>3)?a.Db(a.oa(b,c,3)):a.b[c+a.Nb]&a.oc}function ld(a,b){var c;b>>=6;var d=a.L=b&7;(b=a.K=(b&56)>>3)?c=a.Eb(a.oa(b,d,2)):c=a.b[d+a.Nb];return c}function md(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return hd(a,b,c,8)}function nd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Db(a.oa(b,c,3)):a.b[c]&255}function od(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Eb(a.oa(b,d,2)):c=a.b[d];return c}
|
|
function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Gb=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Ob(e,d.call(a,c,a.Db(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.oa(b,e,6),a.Fb(e,d.call(a,0>c?a.b[-c-1]:c,a.Eb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])}
|
|
function pd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Ob(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 qd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Fb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))}
|
|
h.Qb=function(a){this.l.complete=!0;var b=a?this.l.ac?0:1:-1;this.l.ac=!1;this.Da=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.Qa&224)>>5,e=this.ea&&this.ea.gb>d?this.ea:null;e&&(c=e.cc,d=e.gb);d>(this.i&224)>>5?(this.g&8&&($c(this,2),this.g&=-9),M(this,c,0,-10),d=!0):d=!1;d&&(e&&nc(this,e),a=!0);this.ea||this.Qa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}if(this.g&112&&ad(this)){if(this.g&
|
|
4&&this.D.b(this.b[7],b)){I(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.jc(e)}while(0<this.a);return this.l.complete?this.Da-this.a:void 0===this.l.complete?0:-1};Na(function(){for(var a=G(document,F,"cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Uc(d);E(d,c)}});function rd(a,b){var c=b+a;this.w=this.o=this.v=c;this.m=(a^c)&(b^c);return c&65535}
|
|
function sd(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 td(a,b){a=b<<1;bd(this,a);return a&65535}function ud(a,b){a=b<<1;bd(this,a<<8);return a&255}function vd(a,b){a=b&32768|b>>1|b<<16;bd(this,a);return a&65535}function wd(a,b){a=b&128|b>>1|b<<8;bd(this,a<<8);return a&255}function xd(a,b){a=b&~a;this.da(a);return a}function yd(a,b){a=b&~a;this.da(a<<8);return a}function zd(a,b){a|=b;this.da(a);return a}function Ad(a,b){a|=b;this.da(a<<8);return a}
|
|
function Bd(a,b){a=~b|65536;this.Ja(a);return a&65535}function Cd(a,b){a=~b|256;this.Ja(a<<8);return a&255}function Dd(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function Ed(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 Fd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function Gd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function Hd(a,b){a=-b;this.Ja(a,a&b&32768);return a&65535}
|
|
function Id(a,b){a=-b;this.Ja(a<<8,(a&b&128)<<8);return a&255}function Jd(a,b){a=b<<1|this.v>>16&1;bd(this,a);return a&65535}function Kd(a,b){a=b<<1|this.v>>16&1;bd(this,a<<8);return a&255}function Ld(a,b){a=(this.v&65536|b)>>1|b<<16;bd(this,a);return a&65535}function Md(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;bd(this,a<<8);return a&255}function Nd(a,b){var c=b-a;cd(this,c,a,b);return c&65535}function Od(a,b){var c=b-a;cd(this,c<<8,a<<8,b<<8);return c&255}
|
|
function Pd(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Qd(a,b){a^=b;this.da(a);return a&65535}function Rd(a){U(this,a,ld(this,a),rd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
|
function Sd(a){var b=od(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 Td(a){var b=od(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 Ud(a){S(this,a,!Yc(this))}function Vd(a){S(this,a,Yc(this))}
|
|
function Wd(a){U(this,a,ld(this,a),xd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xd(a){T(this,a,kd(this,a),yd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Yd(a){U(this,a,ld(this,a),zd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Zd(a){T(this,a,kd(this,a),Ad);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
|
function $d(a){var b=ld(this,a);a=od(this,a);this.da((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ae(a){var b=kd(this,a);a=nd(this,a);this.da(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function be(a){S(this,a,this.o&65535?0:4)}function ce(a){S(this,a,!Zc(this)==!(this.m&32768))}function de(a){S(this,a,!!(this.o&65535)&&!Zc(this)==!(this.m&32768))}
|
|
function ee(a){S(this,a,!Yc(this)&&!!(this.o&65535))}function fe(a){S(this,a,(this.o&65535?0:4)||!Zc(this)!=!(this.m&32768))}function ge(a){S(this,a,Yc(this)||(this.o&65535?0:4))}function he(a){S(this,a,!Zc(this)!=!(this.m&32768))}function ie(a){S(this,a,Zc(this))}function je(a){S(this,a,!!(this.o&65535))}function ke(a){S(this,a,!Zc(this))}function le(){M(this,12,0,-9)}function me(a){S(this,a,!0)}function ne(a){S(this,a,!(this.m&32768))}function oe(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 pe(a){var b=ld(this,a);a=od(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;cd(this,c,a,b);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function qe(a){var b=kd(this,a);a=nd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);cd(this,c,a,b);this.a-=this.h?4+(this.L&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
|
function re(a){var b=od(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 se(){M(this,24,0,-9);this.a-=20}
|
|
function te(){this.i&49152?(this.G|=128,M(this,4,0,-8)):(this.ka&&1120==this.pa&&this.ka.setData(this.b[0],!0),this.D?this.D.i():I(this));this.a-=7}function ue(){M(this,16,0,-9);this.a-=20}var ve=[0,7,7,10,7,11,9,13];function we(a){this.S=this.a;R(this,md(this,a));this.a=this.S-ve[this.h]}var xe=[0,14,14,17,14,18,16,20];function ye(a){this.S=this.a;var b=md(this,a);a=a>>6&7;dd(this,this.b[a]);this.b[a]=this.b[7];R(this,b);this.a=this.S-xe[this.h]}var ze=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
|
function Ae(a){var b=ld(this,a);this.S=this.a;qd(this,a,b,this.da);this.a=this.S-ze[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Be(a){var b=kd(this,a);pd(this,a,b,65535,this.da);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Ce=[7,13,13,17,14,18,17,21];
|
|
function De(a){var b=od(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 Ee(){this.a-=5}function Fe(){this.i&49152||(this.u.reset(),wb(this),this.ka&&this.ka.setData(this.b[0],!0));this.a-=667}function Ge(a){if(a&8)M(this,8,0,-9);else{var b=fd(this);a&=7;7==a?R(this,b):(R(this,this.b[a]),this.b[a]=b);this.a-=9}}
|
|
function He(){ed(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 Ie(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)R(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Je(a){U(this,a,ld(this,a),Nd);this.a-=this.h?9+(this.L&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ke(a){U(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)}function Le(){M(this,28,0,-9)}
|
|
function Me(){this.ka&&(this.ka.ja=this.b[7],this.ka.setData(this.b[0],!0));this.g|=8;$c(this,-2);this.a-=3}function Ne(a){U(this,a,this.b[(a>>6&7)+this.Nb],Qd);this.a-=this.h?9:3+(7==this.f?2:0)}function X(){M(this,8,0,-9)}function Vc(a){Oe[a>>12].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)}function Ve(a){We[a&15].call(this,a)}function Xe(a){Ye[a&15].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}
|
|
function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}
|
|
var Oe=[function(a){ef[a>>8&15].call(this,a)},Ae,pe,$d,Wd,Yd,Rd,X,function(a){ff[a>>8&15].call(this,a)},Be,qe,ae,Xd,Zd,Je,X],ef=[function(a){gf[a>>4&15].call(this,a)},me,je,be,ce,he,de,fe,ye,ye,Pe,Re,Te,X,X,X],Qe=[function(a){qd(this,a,0,this.Ja);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,Dd);this.a-=this.h?9:3+(7==this.f?2:0)}],Se=[function(a){U(this,a,0,Hd);
|
|
this.a-=this.h?11:6},function(a){U(this,a,Yc(this)?1:0,rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,Yc(this)?1:0,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=od(this,a);this.Ja(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Ue=[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)},function(a){U(this,a,0,vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,td);this.a-=this.h?9:3+(7==this.f?2:0)}],gf=
|
|
[function(a){hf[a&15].call(this,a)},X,X,X,we,we,we,we,Ge,X,Ve,Xe,Ke,Ke,Ke,Ke],hf=[te,Me,He,le,ue,Fe,X,X,X,X,X,X,X,X,X,X],We=[Ee,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],Ye=[Ee,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],ff=[ke,ie,ee,ge,ne,oe,Ud,Vd,se,Le,Ze,af,cf,X,X,X],$e=[function(a){pd(this,
|
|
a,0,255,this.Ja);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Cd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Gd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Ed);this.a-=this.h?9:3+(7==this.f?2:0)}],bf=[function(a){T(this,a,0,Id);this.a-=this.h?11:6},function(a){T(this,a,Yc(this)?1:0,sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,Yc(this)?1:0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=nd(this,a);this.Ja(a<<8);this.a-=this.h?4:3+
|
|
(7==this.f?2:0)}],df=[function(a){T(this,a,0,Md);this.a-=this.h?9+(this.Gb&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(a){T(this,a,0,wd);this.a-=this.h?9+(this.Gb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,ud);this.a-=this.h?9:3+(7==this.f?2:0)}];function Wc(a){jf[a>>12].call(this,a)}
|
|
var jf=[function(a){kf[a>>8&15].call(this,a)},Ae,pe,$d,Wd,Yd,Rd,function(a){lf[a>>8&15].call(this,a)},function(a){mf[a>>8&15].call(this,a)},Be,qe,ae,Xd,Zd,Je,X],kf=[function(a){nf[a>>4&15].call(this,a)},me,je,be,ce,he,de,fe,ye,ye,Pe,Re,Te,function(a){of[a>>6&3].call(this,a)},X,X],of=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.ta);R(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=id(this,a,0);this.da(a);dd(this,a);this.a-=11},function(a){var b=fd(this);this.S=
|
|
this.a;this.da(b);jd(this,a,0,b);this.a=this.S-Ce[this.h]},function(a){qd(this,a,Zc(this)?65535:0,this.da);this.a-=this.h?9:3+(7==this.f?2:0)}],nf=[function(a){pf[a&15].call(this,a)},X,X,X,we,we,we,we,Ge,function(a){!(a&8)||1145>this.pa?M(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},Ve,Xe,Ke,Ke,Ke,Ke],pf=[te,Me,function(){ed(this);this.g|=this.i&16;this.a-=13},le,ue,Fe,He,function(){M(this,8,0,-9)},X,X,X,X,X,X,X,X],lf=[De,De,re,re,Sd,Sd,Td,Td,Ne,Ne,X,
|
|
X,X,X,Ie,Ie],mf=[ke,ie,ee,ge,ne,oe,Ud,Vd,se,Le,Ze,af,cf,function(a){1145>this.pa?M(this,8,0,-9):qf[a>>6&3].call(this,a)},X,X],qf=[function(){M(this,8,0,-9)},function(a){a=id(this,a,65536);this.da(a);dd(this,a);this.a-=11},function(a){var b=fd(this);this.S=this.a;this.da(b);jd(this,a,65536,b);this.a=this.S-Ce[this.h]},function(){M(this,8,0,-9)}];
|
|
function rf(a){A.call(this,"ROM",a,0,128);this.fa=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=u(this.g);if(this.g){a=this.g;var b=sa(this.m);"json"!=b&&"hex"!=b&&(a=Ba()+"/api/v1/dump?file="+this.g+"&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.g=null):(Va(c.La,a,b),(a=Aa(a,b))?(c.b=a.N,c.fa=a.fa):c.g=null);sf(c)})}}n(rf,A);
|
|
h=rf.prototype;h.aa=function(a,b,c,d){this.u=b;this.c=c;this.D=d;sf(this)};h.ha=function(){this.fa&&(this.D&&this.D.a(this.id,this.h,this.a,this.fa),delete this.fa);return!0};h.ga=function(){return!0};
|
|
function sf(a){if(!$a(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)Za(a,"ROM size ("+ra(a.b.length,8,!0)+") does not match specified size ("+ra(a.a,8,!0)+")");else{var b;a:{b=a.h;a.status(a.a+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+Nb){var c={};b=(c[b]=[rf.prototype.be,rf.prototype.lf,null,null,null,a.a>>1],c);if(kb(a.u,a,b)){b=a.i=!0;break a}}else if(Tb(a.u,b,a.a,vc)){for(c=0;c<a.b.length;c++)bc(a.u,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.f?b.push(a.f):
|
|
null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.u,g=d.a,k=[],l=d.h>>>f.h;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.g;f=d.u;d=d.a;g=0;for(e>>>=f.h;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.g}}a.i||delete a.b}}}H(a)}}h.be=function(a){return this.b[a-this.h]};h.lf=function(){};Na(function(){for(var a=G(document,F,"rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new rf(d);E(d,c)}});
|
|
function tf(a){A.call(this,"RAM",a);this.fa=this.b=null;this.f=+a.addr;this.g=+a.size;this.Z=a.load;this.Y=a.exec;null!=this.Z&&(this.Z=+this.Z);null!=this.Y&&(this.Y=+this.Y);this.h=!1;this.a=a.file;this.i=u(this.a);if(this.a){a=this.a;var b=sa(this.i);"json"!=b&&"hex"!=b&&(a=Ba()+"/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):(Va(c.La,a,b),(a=Aa(a,b))?(c.b=a.N,c.fa=a.fa,null==c.Z&&
|
|
(c.Z=a.Z),null==c.Y&&(c.Y=a.Y)):c.a=null);uf(c)})}}n(tf,A);tf.prototype.aa=function(a,b,c,d){this.u=b;this.c=c;this.D=d;uf(this)};tf.prototype.ha=function(){this.fa&&(this.D&&this.D.a(this.id,this.f,this.g,this.fa),delete this.fa);return!0};tf.prototype.ga=function(){return!0};
|
|
function uf(a){if(a.u&&(!a.h&&a.g&&(Tb(a.u,a.f,a.g,dc)?a.h=!0:a.g=0),!$a(a))){if(!a.h)y("No RAM allocated");else if(a.a){if(!a.b||!a.u)return;vf(a,a.b,a.Z,a.Y,a.f)?a.status('Loaded image "'+a.i+'"'):a.B('Error loading image "'+a.i+'"')}H(a)}}
|
|
tf.prototype.reset=function(){if(this.h){for(var a=this.u,b=this.f,c=this.g,d=b&a.f,b=b>>>a.h;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(bb&&e.a)for(k=d;f--&&k<e.a.length;k++)e.a[k]=g;else for(k=d;f--&&k<e.size;k++)e.j(d,g,e.Ra+d);c-=a.g;b++;d=0}this.b&&vf(this,this.b,this.Z,this.Y,this.f,!0)}};
|
|
function vf(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--;)bc(a.u,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++)bc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)I(a.c),f=!1;null!=d&&Xc(a.c,d,f)}return k}Na(function(){for(var a=G(document,F,"ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new tf(d);E(d,c)}});function wf(a){A.call(this,"Keyboard",a,0,1024);H(this)}n(wf,A);wf.prototype.ca=function(){return!1};wf.prototype.aa=function(a,b,c,d){this.A=a;this.c=c;this.D=d};Na(function(){for(var a=G(document,F,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new wf(d);E(d,c)}});
|
|
function Y(a){A.call(this,"SerialPort",a,0,262144);this.C=+a.adapter;this.K=+a.baudReceive||9600;this.ea=+a.baudTransmit||9600;this.w=a.upperCase;"string"==typeof this.w&&(this.w="true"==this.w);this.g=this.i=null;this.S=+a.tabSize;this.L=+a.charBOL;this.m=0;this.v=!0;this.H=this.F=null;this.I=this.X=-1;this.o=this.a=this.b=0;this.h=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=xf;b&&(void 0===c&&(c="Panel"),(c=Ya(c,this.id))&&(b=c.j[b])&&this.ca(null,a,b))}this.f=this.s=this.G=null;this.exports=
|
|
{connect:this.yc,receiveData:this.Hb,receiveStatus:this.ue,setConnection:this.ye}}n(Y,A);h=Y.prototype;
|
|
h.ca=function(a,b,c){var d=this;switch(b){case xf:return this.j[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.ic:q.Jc:46==c?b=q.ic:a.ctrlKey&&c>=q.hc&&c<=q.Uc&&(b=c-(q.hc-q.Gc));b&&(a.preventDefault&&a.preventDefault(),d.Hb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Ic&&(b=q.Hc);d.Hb(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.Hb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
|
h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;var e=this;this.H=lc(this.c,this.C?-1:48,4,262144);this.I=ic(this.c,function(){var a;a=-1;e.h.length&&(a=e.h.shift()&255,e.w&&97<=a&&122>a&&(a-=32),kc(e.c,e.I,1E3/Math.round(e.K/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&jc(c,e.H))});this.F=lc(this.c,this.C?-1:52,4,262144);this.X=ic(this.c,function(){e.b|=128;e.b&64&&jc(c,e.F)});kb(b,this,yf,this.C?64832+8*(this.C-1)-65392:0);mb(b,this.reset.bind(this));H(this)};
|
|
h.yc=function(a){if(!this.f){var b=Kc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=wa(c[0]);if(d!=this.Ka)return;c=wa(c[1]);if(this.f=Xa(c)){var e=this.f.exports;if(e){var f=e.connect;f&&f.call(this.f,this.v);if(this.s=e.receiveData){this.v=a;this.G=e.receiveStatus;this.status(this.La+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
|
h.ha=function(a,b){if(!b)if(this.yc(this.v),!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(){zf(this)};h.save=function(){var a=new K(this);a.set(0,[]);return a.data()};h.restore=function(){return zf(this)};function zf(a){a.o=0;a.a=8192;a.b=128;a.h=[];return!0}
|
|
h.Hb=function(a){if("number"==typeof a)this.h.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.h.push(b)}else this.h=this.h.concat(a);kc(this.c,this.I,1E3/Math.round(this.K/10));return!0};h.ue=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&&jc(this.c,this.H))};h.ye=function(a,b){return this.f?!1:(this.f=a,this.s=b,!0)};
|
|
h.Pd=function(){var a=this.a&65534;this.a&=-32769;return a};h.Ye=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.G&&b&6&&(b=0,b=this.v?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.G.call(this.f,b))};h.Od=function(){this.a&=-129;return this.o};h.Xe=function(){};h.te=function(){return this.b};h.Ef=function(a){if(this.b&128)if(a&64)jc(this.c,this.F);else{var b=this.F;b&&nc(this.c,b)}this.b=this.b&-70|a&69};h.se=function(){return 0};
|
|
h.Df=function(a){a&=255;this.s&&this.s.call(this.f,a);a&=127;if(this.g)if(13==a)this.m=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.m&&this.m--;else{if(a){var b;13!=a&&10!=a&&(b=xa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}}else if(null!=
|
|
this.i){if(10==a||1024<=this.i.length)this.V(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}kc(this.c,this.X,1E3/Math.round(this.ea/10));this.b&=-129};var xf="buffer",Af={},yf=(Af[65392]=[null,null,Y.prototype.Pd,Y.prototype.Ye,"RCSR"],Af[65394]=[null,null,Y.prototype.Od,Y.prototype.Xe,"RBUF"],Af[65396]=[null,null,Y.prototype.te,Y.prototype.Ef,"XCSR"],Af[65398]=[null,null,Y.prototype.se,Y.prototype.Df,"XBUF"],Af);
|
|
Na(function(){for(var a=G(document,F,"serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Y(d);E(d,c)}});function sc(a){A.call(this,"PC11",a);this.C=Bf(this,a.autoMount);this.b=0;this.I=+a.baudReceive||3600;this.m=this.o=this.a=0;this.i=[];this.h=Cf;this.f=Df;this.w=this.g="";this.N=this.Z=this.Y=null;this.G=-1;this.F=!Ia("Mobi")&&window&&"FileReader"in window;this.s=null;this.H=-1;this.v=null}n(sc,A);
|
|
function Bf(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=sc.prototype;
|
|
h.ca=function(a,b,c){var d=this,e=Df;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=Ef;case "loadTape":return e||(e=Ff),this.j[b]=c,c.onclick=
|
|
function(){var a=d.j.listTapes;a&&Gf(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;Gf(d,u(b,!0),b,Ff,a)}return!1};return!0;case Hf:return this.j[b]=c,!0}return!1};
|
|
h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;this.v=If(a);var e=this;if(a=Bf(this,Kc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=lc(this.c,56,4,4096);this.H=ic(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.m<e.i.length&&(e.o=e.i[e.m++]&255,Jf(e,e.m/e.i.length*100),e.a|=128,e.a&=-2049,e.a&64&&jc(e.c,e.s))});kb(b,this,Kf);mb(b,this.reset.bind(this));Lf(this,"None",Cf,!0);this.F&&Lf(this,"Local Tape",Mf);Lf(this,"Remote Tape",Nf);Of(this)||H(this)};
|
|
h.ha=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 Of(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?Pf(a,b,c,Ff,!0):Qf(a)}return!!a.b}
|
|
function Gf(a,b,c,d,e){if(c)if(c==Mf)a.B('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Nf){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=Nf}else a.h=c;Pf(a,b,c,d,!1,e)}else Rf(a,!1)}function Pf(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,Rf(a,!0),a.l.Sa?a.B("PC11 busy"):(e&&a.b++,Sf(a,b,c,d,f)?g++:a.l.Sa=!0);g&&Tf(a,a.w,a.g,a.f,a.N,a.Z,a.Y)}
|
|
function Sf(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),Tf(a,b,c,d,e),a.h=Mf);Qf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Ba()+"/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):(Va(a.La,e,f),(e=Aa(e,f))&&Tf(a,b,c,d,e.N,e.Z,e.Y));
|
|
a.l.Sa=!1;a.b&&(a.b--,a.b||H(a));Qf(a)})}function Lf(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 Qf(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 Jf(a,b){b|=0;if(b!==a.G){var c=a.j[Hf];c&&(c=(c=G(c,Uf))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Tf(a,b,c,d,e,f,g){a.w=b;a.g=c;a.f=d;a.N=e;a.Z=f;a.Y=g;d==Ef?a.v&&vf(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+'"'),Jf(a,0))}function Rf(a,b){if(a.g||!1===b)a.w="",a.g="",b||(a.f&&a.status(a.f==Ff?"tape detached":"tape unloaded"),a.h=Cf,a.f=Df,Qf(a))}h.save=function(){return(new K(this)).data()};
|
|
h.restore=function(){return!0};h.Id=function(){return this.a&65534};h.Re=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&jc(this.c,this.s)):(this.a&=-129,this.a|=2048,this.o=0,kc(this.c,this.H,1E3/Math.round(this.I/10))));this.a=this.a&-66|a&65};h.Hd=function(){this.a&=-129;this.a|=2048;return this.o};h.Qe=function(){};
|
|
var Cf="",Mf="?",Nf="??",Df=0,Ff=1,Ef=2,Hf="readProgress",Uf="pcjs-progress-bar",Vf={},Kf=(Vf[65384]=[null,null,sc.prototype.Id,sc.prototype.Re,"PRS"],Vf[65386]=[null,null,sc.prototype.Hd,sc.prototype.Qe,"PRB"],Vf);
|
|
function Wf(a,b,c){A.call(this,"Disk",{id:a.La+".disk"+ra(++Xf,4)},0,8192);this.controller=a;this.A=a.A;this.D=a.D;this.h=b;this.na=b.name;this.ba=this.Ib="";this.Ab=b.Ab;this.J=this.O=this.M=this.U=this.mode=0;this.a=[];this.f=null;this.g=!1;Yf(this,c,b.J,b.O,b.M,b.U);this.b=this.i=null;H(this)}n(Wf,A);h=Wf.prototype;h.aa=function(a,b,c,d){this.D=d};
|
|
function Yf(a,b,c,d,e,f){a.mode=b;a.J=c;a.O=d;a.M=e;a.U=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.M);for(var g=1;g<=f.length;g++)f[g-1]=Zf(null,c,e,g,a.U,0);d[e]=f}b[c]=d}a.a=b}a.f=null}
|
|
function $f(a,b,c,d,e){var f=c;if(a.b)return!0;a.na=b;a.ba=c;a.Ib=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=pa[d];if(e){a.J=e[0];a.O=e[1];a.M=e[2];a.U=e[3]||512;c=a.U>>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 Z=x[w]=Array(a.M),Ea=0;Ea<Z.length;Ea++){for(var gc=Zf(null,d,w,Ea+1,a.U,0),Xg=gc.data,Ac=0;Ac<c;Ac++,f+=4)var Yg=Xg[Ac]=b.getInt32(f,
|
|
!0),e=e+Yg&-1;gc.ia=c;Z[Ea]=gc}a.f=e;c=a}else a.B("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.na,a.ba),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(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"):ta(c,"/")&&(d="dir"),f=Ba()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Ab?"":e)+"&format=json"));return!!v(f,
|
|
null,!0,function(b,c,d){ag(a,b,c,d)})}
|
|
function ag(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.na+'" (error '+d+": "+b+")",f);else{Va(a.controller.La,b,c);try{if(0<u(a.Ib,!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.na]: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.M=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d<a.J;d++)for(f=0;f<a.O;f++)for(g=0;g<a.M;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,Z=x.length;Z<w;Z++)x[Z]=p;bg(l,x)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Zf(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.na)}catch(Ea){y("Disk image error ("+b+"): "+Ea.message)}}a.b&&(a.b.call(a.i,a.h,e,a.na,a.ba),a.b=null)}function Zf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Fg=b;a.Gg=c;a.ra=a.ia=0;a.xa=!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.Xc&&b<f.O)for(k=g[b]=Array(f.uc),g=0;g<k.length;g++)k[g]=Zf(null,a,b,g+1,f.Yb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Xc&&9==f.Wb&&(d=k[g]=Zf(null,a,b,f.Wb,f.Yb,0))}}e&&e(d,!1);return d};function bg(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.ia?f<a.ra?(a.ia+=a.ra-f,a.ra=f):f>=a.ra+a.ia&&(a.ia+=f-(a.ra+a.ia)+1):(a.ra=f,a.ia=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
|
function cg(a,b){var c=a.O*a.M,d=b/c|0;return d<a.J?(b%=c,a.seek(d,b/a.M|0,b%a.M+1)):null}function dg(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 eg(a){for(var b="",c=0,d;d=cg(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(dg(a,d,e));return btoa(b)}
|
|
h.save=function(){var a=0,b=[];b[a++]=[this.ba,this.f,this.J,this.O,this.M,this.U];if(!this.g)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ia){for(var k=[],l=0,m=g.ra,p=g.ra+g.ia;m<p;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.ra,k]}}return b};
|
|
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?Yf(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.ra=e;for(k.ia=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.B("Unable to restore disk '"+this.na+": "+c);return b};
|
|
h.toJSON=function(){var a;a=0;for(var b;b=cg(this,a++);)fg(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 fg(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 Xf=0;function Q(a){A.call(this,"RK11",a,0,65536);this.o=gg(this,a.autoMount);this.m=0;this.f=Array(8);this.s=!Ia("Mobi")&&window&&"FileReader"in window;this.Ia=null;this.w=this.b=this.a=this.i=this.h=this.g=this.v=0}n(Q,A);
|
|
function gg(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=Q.prototype;
|
|
h.ca=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&&hg(d,a)},
|
|
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&ig(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.T?(Xc(d.c,0,!0),(a=d.sc(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.s){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.T)?(a=La(eg(a),a.Ib.replace(".json",".img")),z(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.s)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;ig(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;if(a=gg(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);jg(this);this.Ia=lc(this.c,144,5,65536);kb(b,this,kg);mb(b,this.reset.bind(this));lg(this,"None",mg,!0);this.s&&lg(this,"Local Disk",ng);lg(this,"Remote Disk",og);pg(this)||H(this)};
|
|
h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.m){for(a=0;a<this.f.length;a++)qg(this,a,!0);pg(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";hg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){jg(this)};h.save=function(){return(new K(this)).data()};
|
|
h.restore=function(a){return jg(this,a[0])};function pg(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)){!rg(a,g,f,e,!0)&&b&&H(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.m}
|
|
function ig(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==ng)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==og){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+'"')}rg(a,e,b,c,!1,d)}else qg(a,e)}
|
|
function rg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.ba.toLowerCase()!=d.toLowerCase()&&(g++,qg(a,b,!0),k.Ua?a.B("RK11 busy"):(k.Ua=!0,e&&(k.Ta=!0,a.m++),k.ya=!!f,$f(new Wf(a,k,"preload"),c,d,f,a.Mc)&&g++));return g}h.Mc=function(a,b,c,d,e){a.Ua=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Va)),b=null);b?(a.T=b,a.na=c,a.ba=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Va),a.Ta||e),this.A&&Rc(this.A)):a.ya=!1;a.Ta&&(a.Ta=!1,--this.m||H(this));hg(this,a.Va)};
|
|
function lg(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 hg(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.ya?ng:c.ba,!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 qg(a,b,c){var d=a.f[b];if(d.T||!1===c)d.na="",d.ba="",d.T=null,d.ya=!1,c||(a.B("Drive RK"+b+" unloaded",c),hg(a,b))}
|
|
function jg(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.Va=b;d.name=c.Ka;d.Ua=d.ya=!1;d.J=203;d.O=2;d.M=12;d.U=512;d.Ab=!0;d.Yc=0;d.Wc=0;d.Wb=1;d.uc=d.M;d.Yb=d.U;d.ed=0;d.we=null;d.T||(d.ba="");d.status=2368}return!0}
|
|
h.sc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.T;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.M&&(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&&(Fb(this.u,gd(this.c,f),x|w<<8),hc(this.u))){m=1024;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
|
h.Nc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.T;var p=null,t;a||(m=128,e=0);for(;e;){var x=Hb(this.u,gd(this.c,f));if(hc(this.u)){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.M&&(d=0,++c>=a.O&&(c=0,++b))}if(k){var w,Z;if(0>(w=a.read(p,t++))||0>(Z=a.read(p,t++))){m=32;break}if(x!=(w|Z<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.U&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
|
h.Lc=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;sg(this);return!0};function sg(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Ud=function(){return this.w};h.cf=function(){};h.Vd=function(){return this.b};h.df=function(){};h.Rd=function(){return this.a&61438};
|
|
h.$e=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.sc;case 6:case 2:b||(b=this.Nc);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.M){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Lc.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.T?128:0)|d<<13|this.g&15;sg(this);a&&(this.a&=-2,this.a|=128,this.a&64&&jc(this.c,this.Ia))}};h.Wd=function(){return this.i};h.ef=function(a){this.i=a};h.Qd=function(){return this.h};h.Ze=function(a){this.h=a};h.Sd=function(){return this.g};h.af=function(a){this.g=a};h.Td=function(){return this.v};h.bf=function(a){this.v=a};
|
|
var mg="",ng="?",og="??",tg={},kg=(tg[65280]=[null,null,Q.prototype.Ud,Q.prototype.cf,"RKDS"],tg[65282]=[null,null,Q.prototype.Vd,Q.prototype.df,"RKER"],tg[65284]=[null,null,Q.prototype.Rd,Q.prototype.$e,"RKCS"],tg[65286]=[null,null,Q.prototype.Wd,Q.prototype.ef,"RKWC"],tg[65288]=[null,null,Q.prototype.Qd,Q.prototype.Ze,"RKBA"],tg[65290]=[null,null,Q.prototype.Sd,Q.prototype.af,"RKDA"],tg[65294]=[null,null,Q.prototype.Td,Q.prototype.bf,"RKDB"],tg);
|
|
function P(a){A.call(this,"RL11",a,0,131072);this.s=ug(this,a.autoMount);this.o=0;this.b=Array(4);this.v=!Ia("Mobi")&&window&&"FileReader"in window;this.Ia=null;this.a=this.m=this.f=this.g=this.i=this.h=0}n(P,A);function ug(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=P.prototype;
|
|
h.ca=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&&vg(d,a)},
|
|
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&wg(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.T?(Xc(d.c,0,!0),(a=d.tc(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.T)?(a=La(eg(a),a.Ib.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;wg(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
h.aa=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;if(a=ug(this,Kc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.s[e]=a[e]);xg(this);this.Ia=lc(this.c,112,5,131072);kb(b,this,yg);mb(b,this.reset.bind(this));zg(this,"None",Ag,!0);this.v&&zg(this,"Local Disk",Bg);zg(this,"Remote Disk",Cg);Dg(this)||H(this)};
|
|
h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.m){for(a=0;a<this.b.length;a++)Eg(this,a,!0);Dg(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";vg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){xg(this)};h.save=function(){return(new K(this)).data()};
|
|
h.restore=function(a){return xg(this,a[0])};function Dg(a,b){b||(a.o=0);for(var c in a.s){var d=a.s[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)){!Fg(a,g,f,e,!0)&&b&&H(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.o}
|
|
function wg(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==Bg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Cg){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+'"')}Fg(a,e,b,c,!1,d)}else Eg(a,e)}
|
|
function Fg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.ba.toLowerCase()!=d.toLowerCase()&&(g++,Eg(a,b,!0),k.Ua?a.B("RL11 busy"):(k.Ua=!0,e&&(k.Ta=!0,a.o++),k.ya=!!f,$f(new Wf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ua=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Va)),b=null);b?(a.T=b,a.na=c,a.ba=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Va),a.Ta||e),this.A&&Rc(this.A)):a.ya=!1;a.Ta&&(a.Ta=!1,--this.o||H(this));vg(this,a.Va)};
|
|
function zg(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 vg(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.ya?Bg:c.ba,!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 Eg(a,b,c){var d=a.b[b];if(d.T||!1===c)d.na="",d.ba="",d.T=null,d.ya=!1,c||(a.B("Drive RL"+b+" unloaded",c),vg(a,b))}
|
|
function xg(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.Va=b;d.name=c.Ka;d.Ua=d.ya=!1;d.J=512;d.O=2;d.M=40;d.U=256;d.Ab=!0;d.Yc=0;d.Wc=0;d.Wb=1;d.uc=d.M;d.Yb=d.U;d.ed=0;d.we=null;d.T||(d.ba="");d.status=29}return!0}
|
|
h.tc=function(a,b,c,d,e,f,g){var k=0;a=a.T;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}Fb(this.u,gd(this.c,f),p|t<<8);if(hc(this.u)){k=8192;break}f+=2;e--;if(m>=a.U&&(l=null,++d>=a.M&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
|
h.Qc=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Hb(this.u,gd(this.c,f));if(hc(this.u)){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.U&&(l=null,++d>=a.M&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
|
h.Oc=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.Zd=function(){return this.a&65535};
|
|
h.hf=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.T,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.tc;case 10:b||(b=this.Qc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.M?
|
|
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.Oc.bind(this)))}a&&(this.a|=129,this.a&64&&jc(this.c,this.Ia))}};h.Xd=function(){return this.m};h.ff=function(a){this.m=a&65534};h.$d=function(){return this.f};h.jf=function(a){this.f=a};h.ae=function(){return this.i};h.kf=function(a){this.i=a};h.Yd=function(){return this.h};h.gf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4};
|
|
var Ag="",Bg="?",Cg="??",Gg={},yg=(Gg[63744]=[null,null,P.prototype.Zd,P.prototype.hf,"RLCS"],Gg[63746]=[null,null,P.prototype.Xd,P.prototype.ff,"RLBA"],Gg[63748]=[null,null,P.prototype.$d,P.prototype.jf,"RLDA"],Gg[63750]=[null,null,P.prototype.ae,P.prototype.kf,"RLMP"],Gg[63752]=[null,null,P.prototype.Yd,P.prototype.gf,"RLBE"],Gg);
|
|
function Hg(a,b,c){A.call(this,"Computer",a,0,33554432);this.l.R=!1;this.G=null;Ig(this,b);this.C=Kc(this,"autoPower",a,6);this.g=0;this.K=+a.busWidth||+a.buswidth;this.v=this.s=this.w=null;this.o=this.I=!1;this.i=this.h=null;this.H=this.m=this.F=!1;this.L=Kc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Jg(this);if(this.c=Ya("CPU",this.id)){this.D=Ya("Debugger",this.id);this.u=new Mb({id:this.La+".bus",busWidth:this.K},this.c,this.D);var d,e=C(this.id);if((this.f=Ya("Panel",this.id))&&this.f.ab)for(b=
|
|
0;b<e.length;b++)d=e[b],d.B=this.f.B,d.V=this.f.V,d.ab=this.f.ab;this.V(cb+" v1.32.0\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.V("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.aa&&d.aa(this,this.u,this.c,this.D);this.a=Kc(this,"resume",a,4,Kg);var f;b=null;if(a=Kc(this,"state")||(f=!0,a.state))this.w=b=a,f||(this.o=!0,this.a=Kg),this.a&&
|
|
(this.i=new K(this,"1.32.0"),Lg(this.i)?b=null:delete this.i);!b&&this.a&&(b=Mg(this))&&(this.o=!0);if(b){var g=this;v(b,null,!0,function(a,b,c){c?(g.s=null,g.o=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+wa(b):"")+")")):(g.v=b,g.I=!0);H(g)})}else H(this);this.j.power||(this.C=!0);!c&&this.C&&Ng(this,this.ub)}else y("Unable to find CPU component")}n(Hg,A);
|
|
function Ig(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.G=b}function Kc(a,b,c,d,e){var f=b.toLowerCase(),f=Ja(b)||Ja(f);void 0===f&&a.G&&(f=a.G[b]);void 0===f&&c&&(f=c[b]);void 0===f&&"object"==typeof resources&&resources[b]&&(f=b);void 0===f&&(f=e);if("string"==typeof f&&d)switch(d){case 4:f=+f;isNaN(f)&&(f=e||0);break;case 6:f="true"==f}return f}
|
|
function Ng(a,b,c){for(var d=C(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!$a(f)){$a(f,function(){Ng(a,b,c)});return}}b.call(a,c)}function Og(a,b){var c=new K(a,"1.32.0",Pg);if(Lg(c)&&Qg(c)){var d=c.get(Rg),e=b?b.get(Rg):"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=Hg.prototype;
|
|
h.ub=function(a){void 0===a&&(a=this.a||(this.v?Sg:Kg));if(!this.g){this.g++;var b=!1,c=!1;this.F=!1;var d=this.i||new K(this,"1.32.0");if(a==Tg)b=!0;else if(a>Kg){if(Lg(d,this.v)){this.h=new K(this,"1.32.0",Ug);Lg(this.h)&&(Vg(this,d),a=Wg,Zg(this.h));this.h.set(Rg,za());$g(this.h);var e=this.a&&!this.o;if(a==Sg||Ca("Click OK to restore the previous "+cb+" machine state, or CANCEL to reset the machine.")){if(c=Qg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Lg(d,g):("error"==f&&"no machine state"!=
|
|
g?(this.B("Error: "+g),"unable to verify user"==g&&(Ha(ah,""),this.b=null)):this.V(f+": "+g),Zg(d),Lg(d)?(c=Qg(d),e=!0):c=!1))}e&&Og(this,c?d:null)}else a==Wg&&d.clear()}else Og(this);delete this.v;delete this.i}e=C(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=bh(this,g,d,b,c));b=[d,a,c];a!=Tg?Ng(this,this.vc,b):this.vc(b)}};
|
|
function bh(a,b,c,d,e){if(!b.l.R){b.l.R=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.ha(f,d)&&f&&(y("Unable to restore state for "+b.type),a.w&&!a.I?(c.clear(),a.a=Kg,window&&window.location.reload()):a.F=!0,b.ha(null),e=!1),!d&&b.mc){var g=b.mc.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){y("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
|
|
h.vc=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&&(bh(this,this.c,b,c,a),Cb(this),this.c.ma());this.F&&(Vg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
|
function Vg(a,b){if(Ca("There may be a problem with your "+cb+" machine.\n\nTo help us diagnose it, click OK to send this "+cb+" machine state to http://www.pcjs.org.")){var c=a.L;a=a.b||"";b=b.toString();var d={};d.app=cb;d.ver="1.32.0";d.url=c;d.user=a;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
function ch(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.32.0"),g=new K(a,"1.32.0",Pg),k=za();g.set(Rg,k);f.set(Rg,k);f.set(dh,"1.32.0");f.set(eh,window?window.location.href:null);f.set(fh,window?window.navigator.userAgent:"");a.c&&a.c.ga&&(c&&I(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&&gh(a,a.b,f.toString()),$g(g)&&$g(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==hh),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.u&&this.u.reset&&this.u.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.u&&c!==this.c&&c.reset&&c.reset()}Cb(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)}Cb(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)}Cb(this,-1)};
|
|
function Cb(a,b){if(a.c){var c=a.c,d=b||0,e=c.j.speed;e&&(0>=d||30<=(c.ec+=d))&&(e.textContent=c.l.P?c.Ma.toFixed(2)+"Mhz":"Stopped",c.ec=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++)sb(a,"R"+e,a.c.b[e]);e=qc(a.c);sb(a,"PS",e);sb(a,"NF",e&8?1:0,1);sb(a,"ZF",e&4?1:0,1);sb(a,"VF",e&2?1:0,1);sb(a,"CF",e&1?1:0,1);a.i=0}Ib(a,0<b&&c&&!d?a.c.za:a.ja);Eb(a,a.h);b=a.c;b=b.Aa?b.la&16?1:2:4;Kb(a,"B22",b&1);Kb(a,"B18",b&2);Kb(a,"B16",b&4)}}
|
|
h.ca=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.g||(d.l.R?ch(d,!1,!0):Ng(d,d.ub))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.l.R&&!d.g)if(d.a&&!d.s){var a=Ca("Click OK to save changes to this "+cb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ch(d,a,!0);!a&&d.w?window&&window.location.reload():(a||(d.m=!0),d.ub(Kg),d.m=!1)}else d.reset(),d.c&&d.c.ma()},!0;case "save":if(ta(Ba(),"pcjs.org"))c.parentNode.removeChild(c);
|
|
else return this.j[b]=c,c.onclick=function(){var a=Jg(d,!0);if(a){var b=!!(d.a&&!d.s||d.w),c=ch(d,b);b?gh(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
|
|
function Jg(a,b){var c=a.b;c||((c=Ga(ah),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=ih(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c}
|
|
function ih(a,b){a.b=null;b=v(Ba()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ha(ah,b.data),a.b=b.data)}catch(d){y(d.message+" ("+c+")")}return a.b}function Mg(a){var b=null;a.b&&(b=Ba()+"/api/v1/user?req=load&user="+a.b+"&state="+jh(a,"1.32.0"));return b}
|
|
function gh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=jh(a,"1.32.0");d.data=c;b=v(Ba()+"/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),Ha(ah,""),a.b=null)}}
|
|
function If(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 Rc(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 Ug="failsafe",Pg="validate",Rg="timestamp",dh="version",eh="url",fh="browser",ah="user",Tg=-1,Kg=0,Sg=1,Wg=2,hh=3;
|
|
Na(function(){for(var a=G(document,F+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=D(c),c=G(c,F,"computer"),e=0;e<c.length;e++){var f=c[e],g=D(f),g=new Hg(g,d,!0);E(g,f);g.C&&Ng(g,g.ub)}});Oa.show.push(function(){for(var a=G(document,F,"computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Ya("Computer",c.id))&&c.H&&!c.l.R&&c.ub(Tg)}});Oa.exit.push(function(){for(var a=G(document,F,"computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Ya("Computer",c.id))&&c.l.R&&ch(c,!(!c.a||c.s),!0)}});
|
|
function K(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.j=!1;this.key=jh(a,b,c);Zg(this,a.Rc)}h=K.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 Lg(a,b){return b?(a.a=b,a.b=!0,a.j=!1,!0):a.b?!0:Da()&&(b=Ga(a.key))?(a.a=b,a.b=!0):!1}function Qg(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 $g(a){var b=!0;if(Da()){var c=JSON.stringify(a.c);Ha(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 Zg(a,b){a.a="";a.c={};a.b=a.j=!1;b&&a.set("parms",b)}
|
|
h.clear=function(a){Zg(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 jh(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 kh=0;
|
|
function lh(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)):mh(k,a,b,c,d,e,f)})}
|
|
function mh(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Va(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?nh(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
function nh(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);nh(a,b,c)}})}else c(a,null)}
|
|
function oh(a,b,c,d){function e(a){if(void 0===k){var b=g&&G(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ua(a))}function f(a){e("Error: "+a);l&&(--kh||Ra(!0));l=!1}var g,k,l=!0;kh++;Wa[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.32.0/components.xsl");m=function(d,k){k?lh(c,null,null,!1,e,function(d,l){l?(Va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--kh||Ra(!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),--kh||Ra(!0)):f("invalid machine element: "+
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?lh(b,a,d,!0,e,m):mh(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){Ra(!1);return oh(a,b,c,d)};window.enableEvents=Ra;window.sendEvent=Ta;})();//# sourceMappingURL=/tmp/pdpjs/1.32.0/pdp11.map
|