From 297be4e92dbc9b0e7589f034747787a2fcef72b0 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 14 Nov 2016 16:48:49 -0800 Subject: [PATCH] Used finish instead of done for "finishing" methods --- modules/pdp11/lib/pc11.js | 18 +++++++++--------- modules/pdp11/lib/ram.js | 12 ++++++------ modules/pdp11/lib/rl11.js | 6 +++--- modules/pdp11/lib/rom.js | 14 +++++++------- versions/pdpjs/1.30.3/pdp11-dbg.js | 12 ++++++------ versions/pdpjs/1.30.3/pdp11.js | 12 ++++++------ 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index 7e74ceb60..53c761153 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -489,8 +489,8 @@ PC11.prototype.load = function(sTapeName, sTapePath, nTapeTarget, file) if (file) { var reader = new FileReader(); - reader.onload = function() { - pc11.doneRead(sTapeName, sTapePath, nTapeTarget, reader.result); + reader.onload = function doneRead() { + pc11.finishRead(sTapeName, sTapePath, nTapeTarget, reader.result); }; reader.readAsArrayBuffer(file); return true; @@ -515,13 +515,13 @@ PC11.prototype.load = function(sTapeName, sTapePath, nTapeTarget, file) } } - return !!web.getResource(sTapeURL, null, true, function(sURL, sResponse, nErrorCode) { - pc11.doneLoad(sTapeName, sTapePath, nTapeTarget, sResponse, sURL, nErrorCode); + return !!web.getResource(sTapeURL, null, true, function doneLoad(sURL, sResponse, nErrorCode) { + pc11.finishLoad(sTapeName, sTapePath, nTapeTarget, sResponse, sURL, nErrorCode); }); }; /** - * doneLoad(sTapeName, sTapePath, sTapeData, nTapeTarget, sURL, nErrorCode) + * finishLoad(sTapeName, sTapePath, sTapeData, nTapeTarget, sURL, nErrorCode) * * @this {PC11} * @param {string} sTapeName @@ -531,7 +531,7 @@ PC11.prototype.load = function(sTapeName, sTapePath, nTapeTarget, file) * @param {string} sURL * @param {number} nErrorCode (response from server if anything other than 200) */ -PC11.prototype.doneLoad = function(sTapeName, sTapePath, nTapeTarget, sTapeData, sURL, nErrorCode) +PC11.prototype.finishLoad = function(sTapeName, sTapePath, nTapeTarget, sTapeData, sURL, nErrorCode) { var fPrintOnly = (nErrorCode < 0 && this.cmp && !this.cmp.flags.powered); @@ -547,7 +547,7 @@ PC11.prototype.doneLoad = function(sTapeName, sTapePath, nTapeTarget, sTapeData, } else { if (DEBUG && this.messageEnabled()) { - this.printMessage('doneLoad("' + sTapePath + '")'); + this.printMessage('finishLoad("' + sTapePath + '")'); } Component.addMachineResource(this.idMachine, sURL, sTapeData); var resource = web.parseMemoryResource(sURL, sTapeData); @@ -564,7 +564,7 @@ PC11.prototype.doneLoad = function(sTapeName, sTapePath, nTapeTarget, sTapeData, }; /** - * doneRead(sTapeName, sTapePath, nTapeTarget, buffer) + * finishRead(sTapeName, sTapePath, nTapeTarget, buffer) * * @this {PC11} * @param {string} sTapeName @@ -572,7 +572,7 @@ PC11.prototype.doneLoad = function(sTapeName, sTapePath, nTapeTarget, sTapeData, * @param {number} nTapeTarget * @param {?} buffer (we KNOW this is an ArrayBuffer, but we can't seem to convince the Closure Compiler) */ -PC11.prototype.doneRead = function(sTapeName, sTapePath, nTapeTarget, buffer) +PC11.prototype.finishRead = function(sTapeName, sTapePath, nTapeTarget, buffer) { if (buffer) { var aBytes = new Uint8Array(buffer, 0, buffer.byteLength); diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index 2c79b4ff9..06190a5fd 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -92,8 +92,8 @@ function RAMPDP11(parmsRAM) sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true'; } var ram = this; - web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) { - ram.doneLoad(sURL, sResponse, nErrorCode); + web.getResource(sFileURL, null, true, function doneLoad(sURL, sResponse, nErrorCode) { + ram.finishLoad(sURL, sResponse, nErrorCode); }); } } @@ -166,14 +166,14 @@ RAMPDP11.prototype.powerDown = function(fSave, fShutdown) }; /** - * doneLoad(sURL, sData, nErrorCode) + * finishLoad(sURL, sData, nErrorCode) * * @this {RAMPDP11} * @param {string} sURL * @param {string} sData * @param {number} nErrorCode (response from server if anything other than 200) */ -RAMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode) +RAMPDP11.prototype.finishLoad = function(sURL, sData, nErrorCode) { if (nErrorCode) { this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")"); @@ -197,8 +197,8 @@ RAMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode) /** * initRAM() * - * This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place - * until after initBus() has received the Bus component AND doneLoad() has received the data. When both those + * This function is called by both initBus() and finishLoad(), but it cannot copy the initial data into place + * until after initBus() has received the Bus component AND finishLoad() has received the data. When both those * criteria are satisfied, the component becomes "ready". * * @this {RAMPDP11} diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index b1a3856a1..7e4ba3006 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -549,7 +549,7 @@ RL11.prototype.loadDrive = function(iDrive, sDiskName, sDiskPath, fAutoMount, fi } drive.fLocal = !!file; var disk = new DiskPDP11(this, drive, DiskAPI.MODE.PRELOAD); - if (disk.load(sDiskName, sDiskPath, file, this.doneLoadDrive)) { + if (disk.load(sDiskName, sDiskPath, file, this.finishLoadDrive)) { nResult++; } } @@ -558,7 +558,7 @@ RL11.prototype.loadDrive = function(iDrive, sDiskName, sDiskPath, fAutoMount, fi }; /** - * doneLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) + * finishLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) * * The disk parameter is set if the disk was successfully loaded, null if not. * @@ -569,7 +569,7 @@ RL11.prototype.loadDrive = function(iDrive, sDiskName, sDiskPath, fAutoMount, fi * @param {string} sDiskPath * @param {boolean} [fAutoMount] */ -RL11.prototype.doneLoadDrive = function onLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) +RL11.prototype.finishLoadDrive = function onLoadDrive(drive, disk, sDiskName, sDiskPath, fAutoMount) { var aDiskInfo; diff --git a/modules/pdp11/lib/rom.js b/modules/pdp11/lib/rom.js index 1fba864f4..822e5dcad 100644 --- a/modules/pdp11/lib/rom.js +++ b/modules/pdp11/lib/rom.js @@ -54,7 +54,7 @@ if (NODE) { * file: name of ROM data file * * NOTE: The ROM data will not be copied into place until the Bus is ready (see initBus()) AND - * the ROM data file has finished loading (see doneLoad()). + * the ROM data file has finished loading (see finishLoad()). * * Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM * you received is the ROM you expected. @@ -103,8 +103,8 @@ function ROMPDP11(parmsROM) sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true'; } var rom = this; - web.getResource(sFileURL, null, true, function(sURL, sResponse, nErrorCode) { - rom.doneLoad(sURL, sResponse, nErrorCode); + web.getResource(sFileURL, null, true, function doneLoad(sURL, sResponse, nErrorCode) { + rom.finishLoad(sURL, sResponse, nErrorCode); }); } } @@ -183,14 +183,14 @@ ROMPDP11.prototype.powerDown = function(fSave, fShutdown) }; /** - * doneLoad(sURL, sData, nErrorCode) + * finishLoad(sURL, sData, nErrorCode) * * @this {ROMPDP11} * @param {string} sURL * @param {string} sData * @param {number} nErrorCode (response from server if anything other than 200) */ -ROMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode) +ROMPDP11.prototype.finishLoad = function(sURL, sData, nErrorCode) { if (nErrorCode) { this.notice("Unable to load ROM resource (error " + nErrorCode + ": " + sURL + ")"); @@ -212,8 +212,8 @@ ROMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode) /** * initROM() * - * This function is called by both initBus() and doneLoad(), but it cannot copy the initial data into place - * until after initBus() has received the Bus component AND doneLoad() has received the data. When both those + * This function is called by both initBus() and finishLoad(), but it cannot copy the initial data into place + * until after initBus() has received the Bus component AND finishLoad() has received the data. When both those * criteria are satisfied, the component becomes "ready". * * @this {ROMPDP11} diff --git a/versions/pdpjs/1.30.3/pdp11-dbg.js b/versions/pdpjs/1.30.3/pdp11-dbg.js index 79cb0baf3..a9aa7a6b2 100644 --- a/versions/pdpjs/1.30.3/pdp11-dbg.js +++ b/versions/pdpjs/1.30.3/pdp11-dbg.js @@ -77,7 +77,7 @@ function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0>>=a.ja;0>>=a.ja;0>>this.ja].Vb(a&this.v,a)};k.Ub=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Na)>>>this.ja].gc(a&this.v,a);this.la--;return a}; k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].ra(a&this.v,a)};k.cb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].hc(b,a);this.la--;return a};k.Ab=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Na)>>>this.ja].Zb(a&this.v,b&255,a);this.la--}; k.gb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Pb(a&this.v,b&65535,a)};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Na)>>>this.ja;this.f=!1;this.la++;this.Y[d].mc(c,b&65535,a);this.la--}; -function Dc(a){for(var b=0,c=[],d=0;da.b.Wa)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y>1),this.b=new Int32Array(this.A,0,this.size>>2),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>> +function I(a,b,c,d,e,f){this.v=a;this.id=Zc+=2;this.b=null;this.F=b;this.Ob=c;this.size=d||0;this.type=e||$c;this.f=e==ad;this.controller=null;sc(this);this.Ta=this.Sc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],bd(this,f.Nc);else if(zb)this.A=new ArrayBuffer(this.size),this.D=new DataView(this.A,0,this.size),this.G=new Uint8Array(this.A,0,this.size),this.I=new Uint16Array(this.A,0,this.size>>1),this.b=new Int32Array(this.A,0,this.size>>2),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ @@ -215,16 +215,16 @@ k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.B=nd(this.C, k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.rc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";zh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){Bh(this)};k.save=function(){return(new N(this)).data()}; k.restore=function(a){return Bh(this,a[0])};function Eh(a,b){b||(a.H=0);if(a.B)for(var c in a.B){var d=a.B[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Gh(a,e,b,c,!1,d)}else Fh(a,e)} -function Gh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,Fh(a,b,!0),h.dc?a.P("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,th(new ph(a,h,"preload"),c,d,f,a.Rc)&&g++));return g} -k.Rc=function(a,b,c,d,e){var f;a.dc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Za=c,a.fb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.C&&this.C.sb()):a.Qb=!1;a.cc&&(a.cc=!1,--this.H||H(this));zh(this,a.fc)}; +function Gh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,Fh(a,b,!0),h.dc?a.P("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,th(new ph(a,h,"preload"),c,d,f,a.Tc)&&g++));return g} +k.Tc=function(a,b,c,d,e){var f;a.dc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.fc)),b=null);b?(a.Ca=b,a.Za=c,a.fb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.C&&this.C.sb()):a.Qb=!1;a.cc&&(a.cc=!1,--this.H||H(this));zh(this,a.fc)}; function Dh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.J=f>>16&63;this.A=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; +k.Rc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.J=f>>16&63;this.A=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.v.gb(f,v|r<<8);if(Fc(this.v)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Fc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.fa&65535}; k.Ce=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.A&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.A=this.g&4?this.A+b:this.A-b,this.g=this.A=this.A&65408|c);break;case 8:this.D=this.A;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ua||f>=c.qa?this.fa|=37888: -(g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Sc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Oc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.J};k.Be=function(a){this.J=a&63}; +(g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Rc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Oc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.J};k.Be=function(a){this.J=a&63}; var Hh={},Ch=(Hh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Hh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Hh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Hh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Hh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Hh);function Ih(a){t.call(this,"Debugger",a,Ih);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.A=-1;this.g=[];this.X={}}z(Ih); var Jh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Ih.prototype.tc=function(){return-1};Ih.prototype.uc=function(){}; function Kh(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+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(xa(b.substring(c,f))),c=f+1}}return a} diff --git a/versions/pdpjs/1.30.3/pdp11.js b/versions/pdpjs/1.30.3/pdp11.js index c2645624a..9c33bae2d 100644 --- a/versions/pdpjs/1.30.3/pdp11.js +++ b/versions/pdpjs/1.30.3/pdp11.js @@ -71,7 +71,7 @@ function zb(a,b,c){var d=!1,e=this.controller;a=e.za[a];var f=c&65535;a&&(a[3]?( function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.La)return l.qb+=l.La-f,l.La=f,!0;if(f>=l.La+l.qb){p=l.size-(f-n);p>g&&(p=g);l.qb=f-l.La+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.tb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)} function Eb(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Cb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.na)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a}; function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].Hb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.na)>>>this.c].Ib(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].rb(b&a.l,c&65535,b)}h.ob=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.na)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--}; -function Pb(a){for(var b=0,c=[],d=0;da.a.Ea)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U>5&3;b.cb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Xb(b))}};h.Hc=function(){var a=this.a;a.I&57344||(a.Ub=a.$&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.I&57344||(a.Vb=a.zb);return a.Vb}; @@ -89,7 +89,7 @@ L.prototype.be,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.ce L.prototype.Qa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Kd,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Ld,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.vd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.$d,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.ud,"CPUERR",1,1170],M[65528]= [null,null,L.prototype.Fc,L.prototype.Cd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Fd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.Zd,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Id,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>> +function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.La=b;this.qb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.wa=this.jc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.fc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&J(this.h,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<b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Jf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Lf(this)};h.save=function(){return(new O(this)).data()}; h.restore=function(a){return Lf(this,a[0])};function Of(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qf(a,e,b,c,!1,d)}else Pf(a,e)} -function Qf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Pf(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.ib=!!f,Df(new zf(a,k,"preload"),c,d,f,a.ic)&&g++));return g} -h.ic=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.ca=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&yc(this.l)):a.ib=!1;a.ub&&(a.ub=!1,--this.s||F(this));Jf(this,a.yb)}; +function Qf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Pf(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.ib=!!f,Df(new zf(a,k,"preload"),c,d,f,a.kc)&&g++));return g} +h.kc=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.ca=b,a.xa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&yc(this.l)):a.ib=!1;a.ub&&(a.ub=!1,--this.s||F(this));Jf(this,a.yb)}; function Nf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; +h.ic=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0}; h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)}; h.wd=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535}; h.Rd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.wd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w& -63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.jc.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.F))}};h.Uc=function(){return this.v};h.Pd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Sd=function(a){this.c=a};h.Yc=function(){return this.m};h.Td=function(a){this.m=a};h.Vc=function(){return this.w};h.Qd=function(a){this.w=a&63}; +63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ic.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.F))}};h.Uc=function(){return this.v};h.Pd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Sd=function(a){this.c=a};h.Yc=function(){return this.m};h.Td=function(a){this.m=a};h.Vc=function(){return this.w};h.Qd=function(a){this.w=a&63}; var Rf={},Mf=(Rf[63744]=[null,null,N.prototype.Wc,N.prototype.Rd,"RLCS"],Rf[63746]=[null,null,N.prototype.Uc,N.prototype.Pd,"RLBA"],Rf[63748]=[null,null,N.prototype.Xc,N.prototype.Sd,"RLDA"],Rf[63750]=[null,null,N.prototype.Yc,N.prototype.Td,"RLMP"],Rf[63752]=[null,null,N.prototype.Vc,N.prototype.Qd,"RLBE"],Rf); function Sf(a,b,c){x.call(this,"Computer",a,Sf);this.j.N=!1;Tf(this,b);this.A=sc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Uf;this.s=null;this.i=this.I=!1;this.O=sc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Vf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.h=new vb({id:this.pa+".bus",busWidth:this.M},this.a,this.D);var d,e=A(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Xa)for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b