From aaf46034cae7edd594d5e90a1bf0c87ceb59df23 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Wed, 30 Nov 2016 10:19:47 -0800 Subject: [PATCH] Cleaned up DEBUG code in the disk controllers --- devices/pdp11/rl11/README.md | 9 ++-- modules/pdp11/lib/rk11.js | 11 ++++- modules/pdp11/lib/rl11.js | 41 +++++++++++++----- versions/pdpjs/1.30.5/pdp11-dbg.js | 46 ++++++++++---------- versions/pdpjs/1.30.5/pdp11.js | 68 +++++++++++++++--------------- 5 files changed, 101 insertions(+), 74 deletions(-) diff --git a/devices/pdp11/rl11/README.md b/devices/pdp11/rl11/README.md index e02c58118..35702dba8 100644 --- a/devices/pdp11/rl11/README.md +++ b/devices/pdp11/rl11/README.md @@ -7,16 +7,17 @@ permalink: /devices/pdp11/rl11/ RL11 Disk Controller -------------------- -The RL11 Disk Controller controls up to four RL01 or RL02 disk drives, which in turn read/write RL01K or -[RL02K](/disks/dec/rl02k/) disk cartridges. +The RL11 Disk Controller controls up to four RL01 or RL02 disk drives, which in turn read/write +[RL01K](/disks/dec/rl01k/) or [RL02K](/disks/dec/rl02k/) disk cartridges. Machines containing the [RL11 Component](/modules/pdp11/lib/pc11.js) include: - [PDP-11/70 Boot Monitor](/devices/pdp11/machine/1170/monitor/) (with [Debugger](/devices/pdp11/machine/1170/monitor/debugger/)) - [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/)) -PCjs has archived a selection of [RL02K Disk Images](/disks/dec/rl02k/) from [Paul Nankervis](http://skn.noip.me/pdp11/) -for use by those machines, which are listed in the following RL11 Device XML file: +PCjs has archived a selection of [RL01K](/disks/dec/rl01k/) and [RL02K](/disks/dec/rl02k/) disk images +from [Paul Nankervis](http://skn.noip.me/pdp11/) for use by those machines, which are also listed in the +following RL11 Device XML file: - [Default](/devices/pdp11/rl11/default.xml) diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index cd2d544c1..78e5bf055 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -46,6 +46,13 @@ if (NODE) { * * autoMount: one or more JSON-encoded objects, each containing 'name' and 'path' properties * + * The RK11 Disk Controller controls up to eight RK05 disk drives, which in turn read/write RK03-KA + * disk cartridges. See [RK11 Disk Controller Configuration Files](/devices/pdp11/rk11/). + * + * RK03 (or more precisely, RK03-KA) disks are single-platter cartridges with 203 tracks per side, + * 12 sectors per track, and a sector size of 256 words (512 bytes), for a total capacity of 2.38Mb + * (2,494,464 bytes). See [RK03-KA Disk Images](/disks/dec/rk03/). + * * @constructor * @extends Component * @param {Object} parms @@ -931,9 +938,9 @@ RK11.prototype.processCommand = function() } addr = (((this.csr & PDP11.RK11.RKCS.MEX)) << (16 - PDP11.RK11.RKCS.SHIFT.MEX)) | this.bar; nWords = (0x10000 - this.wcr) & 0xffff; - if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (DEBUG && (this.messageEnabled(MessagesPDP11.READ) || this.messageEnabled(MessagesPDP11.WRITE))) { var pos = ((((iCylinder << 1) + iHead) * drive.nSectors) + iSector) * 256; - console.log((fnReadWrite == this.readData? "readData" : "writeData") + "(pos=" + pos + ",addr=" + str.toOct(addr) + ",bytes=" + (nWords * 2) + ")", true, true); + console.log((fnReadWrite == this.readData? "readData" : "writeData") + "(pos=" + pos + ",addr=" + str.toOct(addr) + ",bytes=" + (nWords * 2) + ")"); } fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, this.endReadWrite.bind(this)); break; diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index 884b4c5e7..746671c68 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -46,6 +46,15 @@ if (NODE) { * * autoMount: one or more JSON-encoded objects, each containing 'name' and 'path' properties * + * The RL11 Disk Controller controls up to four RL01 or RL02 disk drives, which in turn read/write RL01K or + * RL02K disk cartridges. See [RL11 Disk Controller Configuration Files](/devices/pdp11/rl11/). + * + * RL01K disks are single-platter cartridges with 256 tracks per side, 40 sectors per track, and a sector size + * of 256 bytes, for a total capacity of 5Mb (5,242,880 bytes). See [RL01K Disk Images](/disks/dec/rl01k/). + * + * RL02K disks are single-platter cartridges with 512 tracks per side, 40 sectors per track, and a sector size + * of 256 bytes, for a total capacity of 10Mb (10,485,760 bytes). See [RL02K Disk Images](/disks/dec/rl02k/). + * * @constructor * @extends Component * @param {Object} parms @@ -957,10 +966,10 @@ RL11.prototype.processCommand = function() addr = (((this.ber & PDP11.RL11.RLBE.MASK)) << 16) | this.bar; // 22 bit mode nWords = (0x10000 - this.mpr) & 0xffff; var pos = ((((iCylinder << 1) + iHead) * drive.nSectors) + iSector) * 128; - if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (DEBUG && (this.messageEnabled(MessagesPDP11.READ) || this.messageEnabled(MessagesPDP11.WRITE))) { console.log((fnReadWrite == this.readData? "readData" : "writeData") + "(pos=" + pos + ",addr=" + str.toOct(addr) + ",bytes=" + (nWords * 2) + ")"); } - fInterrupt = fnReadWrite.call(this, drive, pos, iCylinder, iHead, iSector, nWords, addr, this.endReadWrite.bind(this)); + fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, this.endReadWrite.bind(this)); break; default: @@ -1000,11 +1009,10 @@ RL11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a }; /** - * readData(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) + * readData(drive, iCylinder, iHead, iSector, nWords, addr, done) * * @this {RL11} * @param {Object} drive - * @param {number} pos * @param {number} iCylinder * @param {number} iHead * @param {number} iSector @@ -1013,7 +1021,7 @@ RL11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a * @param {function(...)} done * @return {boolean} true if complete, false if queued */ -RL11.prototype.readData = function(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) +RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, addr, done) { var err = 0; var checksum = 0; @@ -1040,8 +1048,14 @@ RL11.prototype.readData = function(drive, pos, iCylinder, iHead, iSector, nWords err = PDP11.RL11.ERRC.HNF; break; } + /* + * Apparently (unlike the RK and RP controllers), this controller treats all 22-bit addresses as + * being in the UNIBUS address space (ie, the top 256Kb), which means we must call mapUnibus() on + * the address REGARDLESS whether it is actually >= BusPDP11.UNIBUS_22BIT. TODO: This is inherited + * code, so let's review the documentation on this. + */ this.bus.setWordDirect(this.cpu.mapUnibus(addr), data = b0 | (b1 << 8)); - if (MAXDEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { if (!sWords) sWords = str.toOct(addr) + ": "; sWords += str.toOct(data) + ' '; if (sWords.length >= 64) { @@ -1078,11 +1092,10 @@ RL11.prototype.readData = function(drive, pos, iCylinder, iHead, iSector, nWords }; /** - * writeData(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) + * writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) * * @this {RL11} * @param {Object} drive - * @param {number} pos * @param {number} iCylinder * @param {number} iHead * @param {number} iSector @@ -1091,7 +1104,7 @@ RL11.prototype.readData = function(drive, pos, iCylinder, iHead, iSector, nWords * @param {function(...)} done * @return {boolean} true if complete, false if queued */ -RL11.prototype.writeData = function(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) +RL11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, addr, done) { var err = 0; var checksum = 0; @@ -1105,12 +1118,18 @@ RL11.prototype.writeData = function(drive, pos, iCylinder, iHead, iSector, nWord var sWords = ""; while (nWords--) { + /* + * Apparently (unlike the RK and RP controllers), this controller treats all 22-bit addresses as + * being in the UNIBUS address space (ie, the top 256Kb), which means we must call mapUnibus() on + * the address REGARDLESS whether it is actually >= BusPDP11.UNIBUS_22BIT. TODO: This is inherited + * code, so let's review the documentation on this. + */ var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr)); if (this.bus.checkFault()) { err = PDP11.RL11.ERRC.NXM; break; } - if (MAXDEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (DEBUG && this.messageEnabled(MessagesPDP11.WRITE)) { if (!sWords) sWords = str.toOct(addr) + ": "; sWords += str.toOct(data) + ' '; if (sWords.length >= 64) { @@ -1147,7 +1166,7 @@ RL11.prototype.writeData = function(drive, pos, iCylinder, iHead, iSector, nWord } } - if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (DEBUG && this.messageEnabled(MessagesPDP11.WRITE)) { console.log("checksum: " + (checksum|0)); } diff --git a/versions/pdpjs/1.30.5/pdp11-dbg.js b/versions/pdpjs/1.30.5/pdp11-dbg.js index 88b9d5cdf..7c191aacd 100644 --- a/versions/pdpjs/1.30.5/pdp11-dbg.js +++ b/versions/pdpjs/1.30.5/pdp11-dbg.js @@ -44,8 +44,8 @@ function ta(a,b){return(a+" ").slice(0,b) function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ea(a,b){var c,d={ia:null,ja:null,Ta:null,Sa: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.Ta=g.load;d.Sa=g.exec;if(e=g.bytes)d.ia=e;else if(e=g.words)for(d.ia=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ia=Array(4*e.length),f=c=0;c>8&255,d.ia[f++]=e[c]>>16&255,d.ia[f++]=e[c]>>24&255;else d.ia=g;d.ja=g.symbols;d.ia.length?1==d.ia.length&&(w(d.ia[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ta=g.load;d.Sa=g.exec;if(e=g.bytes)d.ha=e;else if(e=g.words)for(d.ha=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ha=Array(4*e.length),f=c=0;c>8&255,d.ha[f++]=e[c]>>16&255,d.ha[f++]=e[c]>>24&255;else d.ha=g;d.ja=g.symbols;d.ha.length?1==d.ha.length&&(w(d.ha[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c>8&15].call(this,a)},Zf,Nf,wf,sf,uf,nf,function(a){Kg[a>>8&15].call(this,a)},function(a){Lg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,ig,X],Jg=[function(a){Mg[a>>4&15].call(this,a)},Jf,Gf,yf,zf,Ef,Af,Cf,Xf,Xf,og,qg,sg,function(a){Ng[a>>6&3].call(this,a)},X,X],Ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Aa(a|this.S);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Be(this,a,0);we(this,a);U(this,a);this.b-=11},function(a){var b=ye(this);this.L= this.b;Ce(this,a,0,b);U(this,b);this.b=this.L-ag[this.g]},function(a){U(this,Ke(this,a,Ud(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Mg=[function(a){Og[a&15].call(this,a)},X,X,X,Vf,Vf,Vf,Vf,eg,function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.I|=1,this.I&=-3),this.b-=5):X.call(this,a)},ug,wg,jg,jg,jg,jg],Og=[Rf,lg,function(){xe(this);this.I|=this.P&16;this.b-=13},If,Tf,dg,fg,function(){this.sa(8,0,-8)},X,X,X,X,X,X,X,X],Kg=[bg,bg,Pf,Pf,of,of,pf,pf,mg,mg,X,X,X,X,hg,hg],Lg= [Hf,Ff,Bf,Df,Kf,Lf,qf,rf,Qf,kg,yg,Ag,Cg,function(a){Pg[a>>6&3].call(this,a)},X,X],Pg=[X,function(a){a=Be(this,a,65536);we(this,a);U(this,a);this.b-=11},function(a){var b=ye(this);this.L=this.b;Ce(this,a,65536,b);U(this,b);this.b=this.L-ag[this.g]},X]; -function Qg(a){x.call(this,"ROM",a,Qg,128);this.ja=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.hb,a,b),(a=Ea(a,b))?(c.A=a.ia,c.ja=a.ja):c.g=null);Rg(c)})}}B(Qg);k=Qg.prototype; +function Qg(a){x.call(this,"ROM",a,Qg,128);this.ja=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.hb,a,b),(a=Ea(a,b))?(c.A=a.ha,c.ja=a.ja):c.g=null);Rg(c)})}}B(Qg);k=Qg.prototype; k.Ga=function(a,b,c,d){this.v=b;this.b=c;this.j=d;Rg(this)};k.Ja=function(){this.ja&&(this.j&&Sg(this.j,this.id,this.B,this.f,this.ja),delete this.ja);return!0};k.Ia=function(){return!0}; function Rg(a){if(!yb(a)){if(a.g){if(!a.A||!a.v)return;a.f||(a.f=a.A.length);if(a.A.length!=a.f)Ab(a,"ROM size ("+p(a.A.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+uc){var c={};b=(c[b]=[Qg.prototype.me,Qg.prototype.kf,null,null,null,a.f>>1],c);if(Jb(a.v,a,b)){b=a.F=!0;break a}}else if(Ac(a.v,b,a.f,pd)){for(c=0;c>>f.oa;0>>=f.oa;0>>a.oa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= @@ -188,31 +188,31 @@ k.Ia=function(a){return a?this.save():!0};k.reset=function(){$g(this)};k.save=fu k.$d=function(){return this.f&65534};k.Xe=function(a){this.f=this.f&-112|a&111};k.Zd=function(){this.f&=-129;return this.K};k.We=function(){};k.Ae=function(){return this.g};k.zf=function(a){this.g&128&&(a&64?Oc(this.b,this.N):Tc(this.b,this.N));this.g=this.g&-70|a&69};k.ze=function(){return 0}; k.yf=function(a){a&=255;G(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.J,a);a&=127;if(this.w)if(13==a)this.F=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.U||8,c=a-this.F%a,this.U&&(b=ta("",c)));this.T&&!this.F&&c&&(b=String.fromCharCode(this.T)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.F+=c}}else if(null!=this.B){if(10==a||1024<= this.B.length)this.i(this.B),this.B="";10!=a&&(this.B+=String.fromCharCode(a))}Pc(this.b,this.ua,1E3/Math.round(this.ta/10));this.g&=-129};var ah={},Zg=(ah[65392]=[null,null,Xg.prototype.$d,Xg.prototype.Xe,"RCSR"],ah[65394]=[null,null,Xg.prototype.Zd,Xg.prototype.We,"RBUF"],ah[65396]=[null,null,Xg.prototype.Ae,Xg.prototype.zf,"XCSR"],ah[65398]=[null,null,Xg.prototype.ze,Xg.prototype.yf,"XBUF"],ah); -bb(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= function(){var a=d.D.listTapes;a&&xh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.S){c.parentNode.removeChild(c);break}this.D[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;xh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;this.aa=yh(a);var e=this;if((this.g=Cd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.T=Qc(56,4,4096);this.ga=Nc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.ma;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.hb,e,f),(e=Ea(e,f))&&Hh(a,b,c,d,e.ia,e.Ta, +function Dh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.w!=d)g++,Fh(a,!0),a.C.jb?a.O("PC11 busy"):(e&&(a.F++,I(a)&&G(a,"auto-loading tape: "+b)),Gh(a,b,c,d,f)?g++:a.C.jb=!0);g&&Hh(a,a.N,a.B,a.w,a.ha,a.Ta,a.Sa)} +function Gh(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),Hh(a,b,c,d,e),a.G="?");Eh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.ma;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.hb,e,f),(e=Ea(e,f))&&Hh(a,b,c,d,e.ha,e.Ta, e.Sa));a.C.jb=!1;a.F&&(a.F--,a.F||J(a));Eh(a)})}function Bh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;d>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(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"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.$b?"":e)+"&format=json"));return!!Da(f, null,!0,function(b,c,d){Oh(a,b,c,d)})} function Oh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.ma;if(d)a.controller.O('Unable to load disk "'+a.Ua+'" (error '+d+": "+b+")",f);else{mb(a.controller.hb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)w(h[0]);else{a.la=h.length;a.qa=h[0].length;a.ha=h[0][0].length;var l=h[0][0][0];a.za=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,A=t.length;A>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,A=t.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Wa+a.Ma&&(a.Ma+=f-(a.Wa+a.Ma)+1):(a.Wa=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+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(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Ua+": "+c);return b}; k.toJSON=function(){var a;a=0;for(var b;b=Rh(this,a++);)Uh(b);a=JSON.stringify(this.b,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")}; @@ -228,10 +228,10 @@ function bi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&& k.Wc=function(a,b,c,d,e){var f;a.wb=!1;b&&(f=Qh(b),b&&f[0]>a.la||f[1]>a.qa)&&(this.O('Disk "'+c+'" too large for drive '+("RK"+a.xb)),b=null);b?(a.Y=b,a.Ua=c,a.Ka=d,this.O('Mounted disk "'+c+'" in drive '+("RK"+a.xb),a.vb||e),this.A&&this.A.ob()):a.cb=!1;a.vb&&(a.vb=!1,--this.F||J(this));Vh(this,a.xb)}; function Zh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.G=65536-e&65535;a&&(this.B=this.B|a|32768,this.M|=49152);return!0};k.Xc=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=32;break}Yb(this.v,f,r|t<<8);if(Mc(this.v)){h=1024;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ha&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; -k.Yc=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){var r=mc(this.v,f);if(Mc(this.v)){h=1024;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=32;break}if(n>=l.za&&(m=null,++d>=l.ha&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.ee=function(){return this.L};k.bf=function(){};k.fe=function(){return this.B};k.cf=function(){};k.be=function(){return this.M&61438}; -k.Ze=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.B=0;this.M=128;this.f=0;break;case 4:b=this.Xc;case 2:b||(b=this.Yc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.B|=32832,this.M|=49152):g>=d.ha?(this.B|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.G&65535,c=b.call(this,d,e,f,g,c,h,this.Vc.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= +function Xh(a,b){var c=0;b||(b=[]);a.L=b[c++]||2496;a.B=b[c++]||0;a.M=b[c++]||128;a.G=b[c++]||0;a.w=b[c++]||0;a.f=b[c++]||0;a.N=b[c]||0;for(b=0;b>12&48;this.G=65536-e&65535;a&&(this.B=this.B|a|32768,this.M|=49152);return!0};k.Xc=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=32;break}Yb(this.v,f,r|t<<8);if(Mc(this.v)){h=1024;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; +k.Yc=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){var r=mc(this.v,f);if(Mc(this.v)){h=1024;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=32;break}if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.ee=function(){return this.L};k.bf=function(){};k.fe=function(){return this.B};k.cf=function(){};k.be=function(){return this.M&61438}; +k.Ze=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.B=0;this.M=128;this.f=0;break;case 4:b=this.Xc;case 2:b||(b=this.Yc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.B|=32832,this.M|=49152):g>=d.ia?(this.B|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.G&65535,c=b.call(this,d,e,f,g,c,h,this.Vc.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= -2,this.M|=128,this.M&64&&Oc(this.b,this.Db))}};k.ge=function(){return this.G};k.df=function(a){this.G=a};k.ae=function(){return this.w};k.Ye=function(a){this.w=a};k.ce=function(){return this.f};k.$e=function(a){this.f=a};k.de=function(){return this.N};k.af=function(a){this.N=a}; var ci={},Yh=(ci[65280]=[null,null,Q.prototype.ee,Q.prototype.bf,"RKDS"],ci[65282]=[null,null,Q.prototype.fe,Q.prototype.cf,"RKER"],ci[65284]=[null,null,Q.prototype.be,Q.prototype.Ze,"RKCS"],ci[65286]=[null,null,Q.prototype.ge,Q.prototype.df,"RKWC"],ci[65288]=[null,null,Q.prototype.ae,Q.prototype.Ye,"RKBA"],ci[65290]=[null,null,Q.prototype.ce,Q.prototype.$e,"RKDA"],ci[65294]=[null,null,Q.prototype.de,Q.prototype.af,"RKDB"],ci); function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.J=0;this.g=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; @@ -246,12 +246,12 @@ function ki(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&& k.$c=function(a,b,c,d,e){var f;a.wb=!1;b&&(f=Qh(b),b&&f[0]>a.la||f[1]>a.qa)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.xb)),b=null);b?(a.Y=b,a.Ua=c,a.Ka=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.xb),a.vb||e),this.A&&this.A.ob()):a.cb=!1;a.vb&&(a.vb=!1,--this.J||J(this));di(this,a.xb)}; function hi(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.B=this.f=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; -k.ad=function(a,b,c,d,e,f,g,h){b=0;var l=a.Y,m=null,n;l||(b=5120,f=0);for(;f--;){if(!m){m=a.Y.seek(c,d,e+1);if(!m){b=5120;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){b=5120;break}Yb(this.v,this.b.Oa(g),r|t<<8);if(Mc(this.v)){b=8192;break}g+=2;if(n>=l.za&&(m=null,++e>=l.ha&&(e=0,++d>=l.qa&&(d=0,++c>=l.la)))){b=5120;break}}return h(b,c,d,e,f,g)}; -k.bd=function(a,b,c,d,e,f,g,h){b=0;var l=a.Y,m=null,n;l||(b=5120,f=0);for(;f--;){var r=mc(this.v,this.b.Oa(g));if(Mc(this.v)){b=8192;break}g+=2;if(!m){m=a.Y.seek(c,d,e+1,!0);if(!m){b=5120;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){b=5120;break}if(n>=l.za&&(m=null,++e>=l.ha&&(e=0,++d>=l.qa&&(d=0,++c>=l.la)))){b=5120;break}}return h(b,c,d,e,f,g)};k.je=function(){return this.M&65535}; -k.gf=function(a){this.M=this.M&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.G&8&&(this.M&=63);this.G=c.status|this.B&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.B=this.f&4?this.B+b:this.B-b,this.f=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.ad;case 10:b||(b=this.bd),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ha?this.M|=37888:(g=(this.F& -63)<<16|this.w,a=65536-this.G&65535,a=b.call(this,c,128*(((d<<1)+e)*c.ha+f),d,e,f,a,g,this.Zc.bind(this)))}a&&(this.M|=129,this.M&64&&Oc(this.b,this.Db))}};k.he=function(){return this.w};k.ef=function(a){this.w=a&65534};k.ke=function(){return this.f};k.hf=function(a){this.f=a};k.le=function(){return this.G};k.jf=function(a){this.G=a};k.ie=function(){return this.F};k.ff=function(a){this.F=a&63;this.M=this.M&-49|(this.F&3)<<4}; +k.ad=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=5120;break}Yb(this.v,this.b.Oa(f),r|t<<8);if(Mc(this.v)){h=8192;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.bd=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=5120,e=0);for(;e--;){var r=mc(this.v,this.b.Oa(f));if(Mc(this.v)){h=8192;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=5120;break}if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)};k.je=function(){return this.M&65535}; +k.gf=function(a){this.M=this.M&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.G&8&&(this.M&=63);this.G=c.status|this.B&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.B=this.f&4?this.B+b:this.B-b,this.f=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.ad;case 10:b||(b=this.bd),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ia?this.M|=37888:(g=(this.F& +63)<<16|this.w,a=65536-this.G&65535,a=b.call(this,c,d,e,f,a,g,this.Zc.bind(this)))}a&&(this.M|=129,this.M&64&&Oc(this.b,this.Db))}};k.he=function(){return this.w};k.ef=function(a){this.w=a&65534};k.ke=function(){return this.f};k.hf=function(a){this.f=a};k.le=function(){return this.G};k.jf=function(a){this.G=a};k.ie=function(){return this.F};k.ff=function(a){this.F=a&63;this.M=this.M&-49|(this.F&3)<<4}; var li={},gi=(li[63744]=[null,null,P.prototype.je,P.prototype.gf,"RLCS"],li[63746]=[null,null,P.prototype.he,P.prototype.ef,"RLBA"],li[63748]=[null,null,P.prototype.ke,P.prototype.hf,"RLDA"],li[63750]=[null,null,P.prototype.le,P.prototype.jf,"RLMP"],li[63752]=[null,null,P.prototype.ie,P.prototype.ff,"RLBE"],li);function mi(a){x.call(this,"Debugger",a,mi);this.ta=a.base||16;this.La=!1;this.K=0;this.U=!1;this.B=-1;this.g=[];this.fa={}}B(mi); var ni={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};mi.prototype.Gc=function(){return-1};mi.prototype.Hc=function(){}; function oi(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.U?b="end":b=a.g[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} diff --git a/versions/pdpjs/1.30.5/pdp11.js b/versions/pdpjs/1.30.5/pdp11.js index 758fff109..cf6818e84 100644 --- a/versions/pdpjs/1.30.5/pdp11.js +++ b/versions/pdpjs/1.30.5/pdp11.js @@ -44,8 +44,8 @@ function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function w(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var 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="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function sa(a,b){var c,d={O:null,ca:null,na:null,ma: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.na=g.load;d.ma=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ca=g.symbols;d.O.length?1==d.O.length&&(x(d.O[0]),d=null):(x("Empty resource: "+a),d=null)}catch(k){x("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.na=g.load;d.ma=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>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ca=g.symbols;d.N.length?1==d.N.length&&(x(d.N[0]),d=null):(x("Empty resource: "+a),d=null)}catch(k){x("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a][1]=0&1<a.a.Ra?8:16,c=65472<=a.ja&&a.ja<65472+b,b=c?1:2,c=c?15:a.g.Da;bb(a,"STEP")||(b=-b);xb(a,a.ja&~c|a.ja+b&c)}function xb(a,b){a.ja=b&a.g.Da;b=a.ja;for(var c=0;22>c;c++)yb(a,"A"+c,b&1<c;c++)yb(a,"D"+c,b&1<>2;this.l=this.c-1;this.v=this.B/this.c|0;this.Ca=[];this.m=0;this.s=!1;this.w=[];this.xc=[Cb,Db,Eb,Fb];a=new H(this);Gb(a,this.G);this.g=Array(this.v);this.h=Array(this.v);for(b=0;b>>this.b;this.D=0;this.i=this.Da;F(this)}A(Ab); +function Ab(a,b,c){y.call(this,"Bus",a,Ab,16);this.a=b;this.G=c;this.M=a.busWidth||16;this.B=1<>2;this.l=this.c-1;this.v=this.B/this.c|0;this.Ca=[];this.m=0;this.s=!1;this.w=[];this.xc=[Cb,Db,Eb,Fb];a=new H(this);Gb(a,this.G);this.g=Array(this.v);this.h=Array(this.v);for(b=0;b>>this.b;this.D=0;this.i=this.Da;F(this)}A(Ab); var Bb=8192,Jb=Bb-1;function Cb(a,b){var c=-1,d=this.controller,e=d.Ca[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.Ca[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} function Db(a,b,c){var d=!1,e=this.controller,f=e.Ca[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.Ca[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Eb(a,b){var c=-1,d=this.controller;a=d.Ca[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} function Fb(a,b,c){var d=!1,e=this.controller;a=e.Ca[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Kb(a,b){if(b!=a.D){for(var c=0;c>>a.b,a.h[a.J]=a.g[a.H])}}Ab.prototype.reset=function(){for(var a=0;a>1),this.a=new Int32Array(this.b,0,this.size>>2),mc(this,ic?nc:oc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&I(this.g,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&I(this.g,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ua=!0},H:function(a,b){return this.J(a,b)},V:function(a,b){return this.cc(a,b)},ya:function(a,b,c){this.l?this.h(a,b,c):this.Pb(a,b,c)},ta:function(a,b,c){this.l?this.h(a,b,c):this.ic(a,b,c)},D:function(a){return this.j[a]},K:function(a){return this.j[a]},U:function(a,b){a&1&&I(this.g,b,64);return this.c.getUint16(a,!0)},ka:function(a,b){a&1&&I(this.g,b,64);return this.s[a>>1]},xa:function(a,b){this.j[a]=b;this.ua=!0},za:function(a,b){this.j[a]=b;this.ua=!0},sa:function(a,b,c){a&1&&I(this.g, c,64);this.c.setUint16(a,b,!0);this.ua=!0},Aa:function(a,b,c){a&1&&I(this.g,c,64);this.s[a>>1]=b;this.ua=!0}};function Gb(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.m=c.m)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.m||(a.yb=!a.l&&b[1]||a.h,a.zb=!a.l&&b[3]||a.w);if(c||void 0===c)a.Pb=b[1]||a.h,a.ic=b[3]||a.w}function sc(a,b,c){c&&a.i||(a.Lb=b[0]||a.v,a.Y=b[2]||a.B);if(c||void 0===c)a.J=b[0]||a.v,a.cc=b[2]||a.B}function mc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} -var vc=[],pc=[H.prototype.N,H.prototype.ra,H.prototype.la,H.prototype.Ba],tc=[H.prototype.H,H.prototype.ya,H.prototype.V,H.prototype.ta];if(Za)var oc=[H.prototype.D,H.prototype.xa,H.prototype.U,H.prototype.sa],nc=[H.prototype.K,H.prototype.za,H.prototype.ka,H.prototype.Aa]; -function wc(a,b){y.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Bb=0;this.pb=b;this.sa=c;this.Ab=Math.round(this.pb/1E4)/100;this.La=this.Ab*this.sa;this.o.T=!1;this.o.Nb=!1;this.o.eb=a.autoStart;this.o.sb=!1;this.nb=this.Ma=0;this.ob=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.N=[];this.ac=this.Sd.bind(this);F(this)}A(wc);var xc=["power","reset"];h=wc.prototype; +var vc=[],pc=[H.prototype.M,H.prototype.ra,H.prototype.la,H.prototype.Ba],tc=[H.prototype.H,H.prototype.ya,H.prototype.V,H.prototype.ta];if(Za)var oc=[H.prototype.D,H.prototype.xa,H.prototype.U,H.prototype.sa],nc=[H.prototype.K,H.prototype.za,H.prototype.ka,H.prototype.Aa]; +function wc(a,b){y.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Bb=0;this.pb=b;this.sa=c;this.Ab=Math.round(this.pb/1E4)/100;this.La=this.Ab*this.sa;this.o.T=!1;this.o.Nb=!1;this.o.eb=a.autoStart;this.o.sb=!1;this.nb=this.Ma=0;this.ob=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.M=[];this.ac=this.Sd.bind(this);F(this)}A(wc);var xc=["power","reset"];h=wc.prototype; h.ga=function(a,b,c,d){this.l=a;this.g=b;this.G=d;this.B=a.B;for(b=0;b=a.Ma&&(a.Ma+=a.Za,c=!0);0<=a.$a&&a.$a<=Bc(a)&&(a.Za=a.$a=-1,Ac(a),G(a),c=!0);c&&a.X(Bc(a)+" cycles: checksum="+r(a.nb))}} h.ba=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.l)if(a=d.l,a.o.R)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Ba/a.La&&(b=1);a.sa=b;b=a.Ab*a.sa;if(a.La!=b){a.La=b;b=a.La.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.l&&Ec(a.l)}qb(a,a.la);a.la=0;a.ka=qa();a.za=0;Dc(a)}function Wb(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.N[b][0])&&(c=a.pb*a.sa/1E3*c|0,a.o.T&&(c+=Fc(a)),a.N[b][0]=c)} -function pb(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ra-=a.a;a.a=a.K=0;b&&(a.ra=0);return c} -h.Sd=function(){if(this.o.T){this.Eb>=this.pb&&Dc(this,!0);this.bb=0;this.mb=qa();if(this.za){var a=this.mb-this.za;a>this.Yb&&(this.ka+=a,this.ka>this.mb&&(this.ka=this.mb))}try{do{for(var b,c=this.o.sb?1:this.qb,d=this.N.length-1;0<=d;d--){var e=this.N[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.bb+=b;this.la+=b;rb(this,b);pb(this,b);this.ab-=b;if(0>=this.ab){this.ab+=this.qb;15<=++this.Zb&&(this.wa(),this.Zb=0);break}}while(this.o.T)}catch(f){G(this); +function Cc(a,b,c){if(void 0!==b){.8>a.Ba/a.La&&(b=1);a.sa=b;b=a.Ab*a.sa;if(a.La!=b){a.La=b;b=a.La.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.l&&Ec(a.l)}qb(a,a.la);a.la=0;a.ka=qa();a.za=0;Dc(a)}function Wb(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.pb*a.sa/1E3*c|0,a.o.T&&(c+=Fc(a)),a.M[b][0]=c)} +function pb(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ra-=a.a;a.a=a.K=0;b&&(a.ra=0);return c} +h.Sd=function(){if(this.o.T){this.Eb>=this.pb&&Dc(this,!0);this.bb=0;this.mb=qa();if(this.za){var a=this.mb-this.za;a>this.Yb&&(this.ka+=a,this.ka>this.mb&&(this.ka=this.mb))}try{do{for(var b,c=this.o.sb?1:this.qb,d=this.M.length-1;0<=d;d--){var e=this.M[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.bb+=b;this.la+=b;rb(this,b);pb(this,b);this.ab-=b;if(0>=this.ab){this.ab+=this.qb;15<=++this.Zb&&(this.wa(),this.Zb=0);break}}while(this.o.T)}catch(f){G(this); this.l&&this.l.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.T){a=setTimeout;b=this.ac;this.za=qa();c=this.Yb;this.bb&&(c=Math.round(c*this.bb/this.qb));c-=this.za-this.mb;if(d=this.za-this.ka)this.Ba=Math.round(this.la/(10*d))/100,864E5<=d&&(this.ta=0,Cc(this));if(0>c||this.Bac&&(this.ka-=c),c=0;this.Eb+=this.bb;this.za+=c;a(b,c)}}}; function ob(a){var b;a.o.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.T)a.X(a.toString()+" busy");else{Cc(a);a.o.T=!0;a.o.Nb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.ka,Bc(a));setTimeout(a.ac,0)}}h.xb=function(){return 0};function G(a){var b=!1;if(a.o.T){Fc(a);qb(a,a.la);a.la=0;a.o.T=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(qa(),Bc(a));b=!0}a.o.complete=void 0;return b} function Gc(a){this.Ra=+a.model||1170;this.Ub=a.addrReset||0;wc.call(this,a,6666667);this.rb=0;this.Wb=255;1120==this.Ra?(this.decode=Hc.bind(this),this.Aa=this.Bc,this.rb=8,this.Wb=-1):(this.decode=Ic.bind(this),this.Aa=this.Cc);Jc(this);this.Na=0;this.J=null;this.o.complete=!1}A(Gc,wc);h=Gc.prototype;h.reset=function(){this.status("model "+this.Ra);this.o.T&&G(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; @@ -155,11 +155,11 @@ this.b?2:0)}],Se=[function(a){S(this,a,0,Ad);this.a-=this.c?9+(this.Db&1):3+(7== var Xe=[function(a){Ye[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,Fd,function(a){Ze[a>>8&15].call(this,a)},function(a){$e[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,xe,Y],Ye=[function(a){af[a>>4&15].call(this,a)},ae,Yd,Qd,Rd,Wd,Sd,Ud,me,me,De,Fe,He,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.Y(a|this.V);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Xc(this,a,0);Sc(this,a);R(this,a);this.a-=11},function(a){var b=Uc(this);this.K= this.a;Yc(this,a,0,b);R(this,b);this.a=this.K-qe[this.c]},function(a){R(this,ed(this,a,Kc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],af=[function(a){cf[a&15].call(this,a)},Y,Y,Y,ke,ke,ke,ke,ue,function(a){a&8?(this.F&49152||(this.F=this.F&-2017|(a&7)<<5,this.u|=1,this.u&=-3),this.a-=5):J(this,8,0,-8)},Je,Le,ye,ye,ye,ye],cf=[he,Ae,function(){Tc(this);this.u|=this.F&16;this.a-=13},$d,ie,te,ve,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ze=[re,re,fe,fe,Gd,Gd,Hd,Hd,Be,Be,Y,Y,Y,Y,we,we],$e=[Zd, Xd,Td,Vd,be,ce,Id,Jd,ge,ze,Ne,Pe,Re,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[Y,function(a){a=Xc(this,a,65536);Sc(this,a);R(this,a);this.a-=11},function(a){var b=Uc(this);this.K=this.a;Yc(this,a,65536,b);R(this,b);this.a=this.K-qe[this.c]},Y]; -function ef(a){y.call(this,"ROM",a,ef,128);this.ca=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.h=a.alias;this.l=a.file;this.s=t(this.l);if(this.l){a=this.l;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.ya,a,b),(a=sa(a,b))?(c.c=a.O,c.ca=a.ca):c.l=null);ff(c)})}}A(ef);h=ef.prototype; +function ef(a){y.call(this,"ROM",a,ef,128);this.ca=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.h=a.alias;this.l=a.file;this.s=t(this.l);if(this.l){a=this.l;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.ya,a,b),(a=sa(a,b))?(c.c=a.N,c.ca=a.ca):c.l=null);ff(c)})}}A(ef);h=ef.prototype; h.ga=function(a,b,c,d){this.g=b;this.a=c;this.G=d;ff(this)};h.ia=function(){this.ca&&(this.G&&this.G.a(this.id,this.i,this.b,this.ca),delete this.ca);return!0};h.ha=function(){return!0}; function ff(a){if(!Xa(a)){if(a.l){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Bb){var c={};b=(c[b]=[ef.prototype.Dd,ef.prototype.Be,null,null,null,a.b>>1],c);if(eb(a.g,a,b)){b=a.m=!0;break a}}else if(Hb(a.g,b,a.b,lc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)Pb(a.g,p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Qb&&c<=m.wc&&(b=c-(m.Qb-m.kc));b&&(a.preventDefault&&a.preventDefault(),d.vb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.mc&&(b=m.lc);d.vb(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.vb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;var e=this;this.V=Zb(48,4,262144);this.N=Wb(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.U&&97<=a&&122>a&&(a-=32),Yb(e.a,e.N,1E3/Math.round(e.H/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&Xb(c,e.V))});this.D=Zb(52,4,262144);this.la=Wb(this.a,function(){e.c|=128;e.c&64&&Xb(c,e.D)});eb(b,this,mf);gb(b,this.reset.bind(this));F(this)}; +h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;var e=this;this.V=Zb(48,4,262144);this.M=Wb(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.U&&97<=a&&122>a&&(a-=32),Yb(e.a,e.M,1E3/Math.round(e.H/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&Xb(c,e.V))});this.D=Zb(52,4,262144);this.la=Wb(this.a,function(){e.c|=128;e.c&64&&Xb(c,e.D)});eb(b,this,mf);gb(b,this.reset.bind(this));F(this)}; h.$b=function(){if(!this.v){var a=yc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.xa)return;b=oa(b[1]);if(this.v=Ua(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.w=d.receiveData){this.status(this.ya+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ia=function(a,b){if(!b)if(this.$b(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ha=function(a){return a?this.save():!0};h.reset=function(){nf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return nf(this)};function nf(a){a.B=0;a.b=0;a.c=128;a.s=[];return!0}h.vb=function(a){if("number"==typeof a)this.s.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.K||8,c=a-this.m%a,this.K&&(b=" ".slice(0,c)));this.J&&!this.m&&c&&(b=String.fromCharCode(this.J)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!=this.i){if(10==a|| 1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Yb(this.a,this.la,1E3/Math.round(this.ka/10));this.c&=-129};var of={},mf=(of[65392]=[null,null,Z.prototype.qd,Z.prototype.oe,"RCSR"],of[65394]=[null,null,Z.prototype.pd,Z.prototype.ne,"RBUF"],of[65396]=[null,null,Z.prototype.Rd,Z.prototype.Pe,"XCSR"],of[65398]=[null,null,Z.prototype.Qd,Z.prototype.Oe,"XBUF"],of); -Ia(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.j[b]=c,c.onclick= function(){var a=d.j.listTapes;a&&rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.H){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;rf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1}; -h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;this.N=sf(a);var e=this;if((this.c=yc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){x("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.J=Zb(56,4,4096);this.V=Wb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.R;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.ya,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.O,e.na,e.ma)); +function rf(a,b,c,d,e){if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;xf(a,b,c,d,!1,e)}else zf(a,!1)}function xf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.h!=d)g++,zf(a,!0),a.o.Ga?a.C("PC11 busy"):(e&&a.m++,Af(a,b,c,d,f)?g++:a.o.Ga=!0);g&&Bf(a,a.D,a.i,a.h,a.N,a.na,a.ma)} +function Af(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),Bf(a,b,c,d,e),a.s="?");yf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.R;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.ya,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.N,e.na,e.ma)); a.o.Ga=!1;a.m&&(a.m--,a.m||F(a));yf(a)})}function vf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.P);for(d=0;d>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.P);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.tb?"":e)+"&format=json"));return!!w(f, null,!0,function(b,c,d){If(a,b,c,d)})} function If(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.R;if(d)a.controller.C('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{Ta(a.controller.ya,b,c);try{if(0g&&0c.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)x(k[0]);else{a.P=k.length;a.S=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.W=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var T=n<<2,za=v.length;za>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var T=n<<2,za=v.length;za>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.fa?f=a.pa+a.fa&&(a.fa+=f-(a.pa+a.fa)+1):(a.pa=f,a.fa=1);d[f]=d[f]&~(255<g)break;e|=g<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ b+" changes applied)";b=-1;break}if(this.c){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][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.oa+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=Lf(this,a++);)Of(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")}; @@ -211,10 +211,10 @@ function Wf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&& h.pc=function(a,b,c,d,e){var f;a.Ia=!1;b&&(f=Kf(b),b&&f[0]>a.P||f[1]>a.S)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);b?(a.L=b,a.oa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ja),a.Ha||e),this.l&&Ec(this.l)):a.va=!1;a.Ha&&(a.Ha=!1,--this.m||F(this));Pf(this,a.Ja)}; function Tf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.s=65536-e&65535;a&&(this.i=this.i|a|32768,this.A|=49152);return!0}; -h.qc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){if(!n){n=a.L.seek(b,c,d+1);if(!n){k=4096;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){k=32;break}ub(this.g,f,u|v<<8);if(Vb(this.g)){k=1024;break}f+=2;if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)}; -h.rc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){var u=wb(this.g,f);if(Vb(this.g)){k=1024;break}f+=2;if(!n){n=a.L.seek(b,c,d+1,!0);if(!n){k=4096;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){k=32;break}if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)};h.vd=function(){return this.w};h.te=function(){};h.wd=function(){return this.i};h.ue=function(){};h.sd=function(){return this.A&61438}; -h.qe=function(a){this.A=this.A&-3968|a&3967;if(this.A&1){var b,c=!0;a=(this.b&57344)>>13;var d=this.c[a],e,f,g,k;this.A&=-129;switch(this.A&14){case 0:this.w=d.status;this.i=0;this.A=128;this.b=0;break;case 4:b=this.qc;case 2:b||(b=this.rc),e=(this.b&8160)>>5,f=(this.b&16)>>4,g=this.b&15,e>=d.P?(this.i|=32832,this.A|=49152):g>=d.M?(this.i|=32800,this.A|=49152):(k=(this.A&48)<<12|this.h,c=65536-this.s&65535,c=b.call(this,d,e,f,g,c,k,this.oc.bind(this)))}this.w=d.status|a<<13|this.b%9&15;c&&(this.A&= +function Rf(a,b){var c=0;b||(b=[]);a.w=b[c++]||2496;a.i=b[c++]||0;a.A=b[c++]||128;a.s=b[c++]||0;a.h=b[c++]||0;a.b=b[c++]||0;a.D=b[c]||0;for(b=0;b>12&48;this.s=65536-e&65535;a&&(this.i=this.i|a|32768,this.A|=49152);return!0}; +h.qc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){if(!n){n=a.L.seek(b,c,d+1);if(!n){k=4096;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){k=32;break}ub(this.g,f,u|v<<8);if(Vb(this.g)){k=1024;break}f+=2;if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)}; +h.rc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){var u=wb(this.g,f);if(Vb(this.g)){k=1024;break}f+=2;if(!n){n=a.L.seek(b,c,d+1,!0);if(!n){k=4096;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){k=32;break}if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)};h.vd=function(){return this.w};h.te=function(){};h.wd=function(){return this.i};h.ue=function(){};h.sd=function(){return this.A&61438}; +h.qe=function(a){this.A=this.A&-3968|a&3967;if(this.A&1){var b,c=!0;a=(this.b&57344)>>13;var d=this.c[a],e,f,g,k;this.A&=-129;switch(this.A&14){case 0:this.w=d.status;this.i=0;this.A=128;this.b=0;break;case 4:b=this.qc;case 2:b||(b=this.rc),e=(this.b&8160)>>5,f=(this.b&16)>>4,g=this.b&15,e>=d.P?(this.i|=32832,this.A|=49152):g>=d.O?(this.i|=32800,this.A|=49152):(k=(this.A&48)<<12|this.h,c=65536-this.s&65535,c=b.call(this,d,e,f,g,c,k,this.oc.bind(this)))}this.w=d.status|a<<13|this.b%9&15;c&&(this.A&= -2,this.A|=128,this.A&64&&Xb(this.a,this.Pa))}};h.xd=function(){return this.s};h.ve=function(a){this.s=a};h.rd=function(){return this.h};h.pe=function(a){this.h=a};h.td=function(){return this.b};h.re=function(a){this.b=a};h.ud=function(){return this.D};h.se=function(a){this.D=a}; var Xf={},Sf=(Xf[65280]=[null,null,N.prototype.vd,N.prototype.te,"RKDS"],Xf[65282]=[null,null,N.prototype.wd,N.prototype.ue,"RKER"],Xf[65284]=[null,null,N.prototype.sd,N.prototype.qe,"RKCS"],Xf[65286]=[null,null,N.prototype.xd,N.prototype.ve,"RKWC"],Xf[65288]=[null,null,N.prototype.rd,N.prototype.pe,"RKBA"],Xf[65290]=[null,null,N.prototype.td,N.prototype.re,"RKDA"],Xf[65294]=[null,null,N.prototype.ud,N.prototype.se,"RKDB"],Xf); function M(a){y.call(this,"RL11",a,M,131072);this.B=a.autoMount||{};this.v=0;this.c=Array(4);this.w=!Ba("Mobi")&&window&&"FileReader"in window}A(M);h=M.prototype; @@ -229,14 +229,14 @@ function eg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&& h.tc=function(a,b,c,d,e){var f;a.Ia=!1;b&&(f=Kf(b),b&&f[0]>a.P||f[1]>a.S)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.L=b,a.oa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ja),a.Ha||e),this.l&&Ec(this.l)):a.va=!1;a.Ha&&(a.Ha=!1,--this.v||F(this));Yf(this,a.Ja)}; function bg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.m=f>>16&63;this.i=this.b=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.A=this.A|a|32768);return!0}; -h.uc=function(a,b,c,d,e,f,g,k){b=0;var l=a.L,n=null,p;l||(b=5120,f=0);for(;f--;){if(!n){n=a.L.seek(c,d,e+1);if(!n){b=5120;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){b=5120;break}ub(this.g,Vc(this.a,g),u|v<<8);if(Vb(this.g)){b=8192;break}g+=2;if(p>=l.W&&(n=null,++e>=l.M&&(e=0,++d>=l.S&&(d=0,++c>=l.P)))){b=5120;break}}return k(b,c,d,e,f,g)}; -h.vc=function(a,b,c,d,e,f,g,k){b=0;var l=a.L,n=null,p;l||(b=5120,f=0);for(;f--;){var u=wb(this.g,Vc(this.a,g));if(Vb(this.g)){b=8192;break}g+=2;if(!n){n=a.L.seek(c,d,e+1,!0);if(!n){b=5120;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){b=5120;break}if(p>=l.W&&(n=null,++e>=l.M&&(e=0,++d>=l.S&&(d=0,++c>=l.P)))){b=5120;break}}return k(b,c,d,e,f,g)};h.Ad=function(){return this.A&65535}; -h.ye=function(a){this.A=this.A&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.A&128)){var b;a=!0;var c=this.c[(this.A&768)>>8],d,e,f,g;this.A&=-2;switch(this.A&14){case 4:this.s&8&&(this.A&=63);this.s=c.status|this.i&64;break;case 6:1==(this.b&3)&&(b=this.b&65408,c=(this.b&16)<<2,this.i=this.b&4?this.i+b:this.i-b,this.b=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.uc;case 10:b||(b=this.vc),d=this.b>>7,e=this.b&64?1:0,f=this.b&63,d>=c.P||f>=c.M?this.A|=37888:(g=(this.m& -63)<<16|this.h,a=65536-this.s&65535,a=b.call(this,c,128*(((d<<1)+e)*c.M+f),d,e,f,a,g,this.sc.bind(this)))}a&&(this.A|=129,this.A&64&&Xb(this.a,this.Pa))}};h.yd=function(){return this.h};h.we=function(a){this.h=a&65534};h.Bd=function(){return this.b};h.ze=function(a){this.b=a};h.Cd=function(){return this.s};h.Ae=function(a){this.s=a};h.zd=function(){return this.m};h.xe=function(a){this.m=a&63;this.A=this.A&-49|(this.m&3)<<4}; +h.uc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.L.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){k=5120;break}ub(this.g,Vc(this.a,f),u|v<<8);if(Vb(this.g)){k=8192;break}f+=2;if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.vc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=5120,e=0);for(;e--;){var u=wb(this.g,Vc(this.a,f));if(Vb(this.g)){k=8192;break}f+=2;if(!n){n=a.L.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){k=5120;break}if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Ad=function(){return this.A&65535}; +h.ye=function(a){this.A=this.A&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.A&128)){var b;a=!0;var c=this.c[(this.A&768)>>8],d,e,f,g;this.A&=-2;switch(this.A&14){case 4:this.s&8&&(this.A&=63);this.s=c.status|this.i&64;break;case 6:1==(this.b&3)&&(b=this.b&65408,c=(this.b&16)<<2,this.i=this.b&4?this.i+b:this.i-b,this.b=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.uc;case 10:b||(b=this.vc),d=this.b>>7,e=this.b&64?1:0,f=this.b&63,d>=c.P||f>=c.O?this.A|=37888:(g=(this.m& +63)<<16|this.h,a=65536-this.s&65535,a=b.call(this,c,d,e,f,a,g,this.sc.bind(this)))}a&&(this.A|=129,this.A&64&&Xb(this.a,this.Pa))}};h.yd=function(){return this.h};h.we=function(a){this.h=a&65534};h.Bd=function(){return this.b};h.ze=function(a){this.b=a};h.Cd=function(){return this.s};h.Ae=function(a){this.s=a};h.zd=function(){return this.m};h.xe=function(a){this.m=a&63;this.A=this.A&-49|(this.m&3)<<4}; var fg={},ag=(fg[63744]=[null,null,M.prototype.Ad,M.prototype.ye,"RLCS"],fg[63746]=[null,null,M.prototype.yd,M.prototype.we,"RLBA"],fg[63748]=[null,null,M.prototype.Bd,M.prototype.ze,"RLDA"],fg[63750]=[null,null,M.prototype.Cd,M.prototype.Ae,"RLMP"],fg[63752]=[null,null,M.prototype.zd,M.prototype.xe,"RLBE"],fg); -function gg(a,b,c){y.call(this,"Computer",a,gg,33554432);this.o.R=!1;hg(this,b);this.w=yc(this,"autoPower",a);this.l=0;this.N=a.busWidth||a.buswidth;this.b=ig;this.s=null;this.i=this.J=!1;this.U=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=jg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.g=new Ab({id:this.ya+".bus",busWidth:this.N},this.a,this.G);var d,e=B(this.id);if((this.B=Va("Panel",this.id))&&this.B.fb)for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b