From 6bea7fd0e96940a4119ea017a412874292b2ec42 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 1 Dec 2016 11:15:27 -0800 Subject: [PATCH] Added SerialPort interface to support the passing of flow control signals between machines (only PDP-11 and VT100 for now; PCx86 will come later, after I study how well, or not-so-well, this works with the VT100) --- modules/pc8080/lib/serialport.js | 44 +- modules/pdp11/lib/bus.js | 11 +- modules/pdp11/lib/cpu.js | 12 + modules/pdp11/lib/cpustate.js | 41 +- modules/pdp11/lib/defines.js | 11 +- modules/pdp11/lib/serialport.js | 63 ++- modules/shared/lib/defines.js | 46 ++ versions/pc8080/1.30.5/pc8080-dbg.js | 168 ++++---- versions/pc8080/1.30.5/pc8080.js | 181 ++++---- versions/pdpjs/1.30.5/pdp11-dbg.js | 599 ++++++++++++++------------- versions/pdpjs/1.30.5/pdp11.js | 457 ++++++++++---------- 11 files changed, 901 insertions(+), 732 deletions(-) diff --git a/modules/pc8080/lib/serialport.js b/modules/pc8080/lib/serialport.js index 1c8bd1d5e..0b27e9922 100644 --- a/modules/pc8080/lib/serialport.js +++ b/modules/pc8080/lib/serialport.js @@ -112,6 +112,8 @@ function SerialPort8080(parmsSerial) { this.fAutoXOFF = true; this.fAutoStop = false; + this.fNullModem = true; + Component.call(this, "SerialPort", parmsSerial, SerialPort8080, Messages8080.SERIAL); var sBinding = parmsSerial['binding']; @@ -128,14 +130,15 @@ function SerialPort8080(parmsSerial) { * No connection until initConnection() is called. */ this.sDataReceived = ""; - this.connection = this.sendData = null; + this.connection = this.sendData = this.updateStatus = null; /* - * Export all functions required by initConnection(); currently, this is the bare minimum (no flow control yet). + * Export all functions required by initConnection(). */ this['exports'] = { 'connect': this.initConnection, - 'receiveData': this.receiveData + 'receiveData': this.receiveData, + 'receiveStatus': this.receiveStatus }; } @@ -474,6 +477,7 @@ SerialPort8080.prototype.initBus = function(cmp, bus, cpu, dbg) * If the target component is found, then verify that it has exported functions with the following names: * * receiveData(data): called when we have data to transmit; aliased internally to sendData(data) + * receiveStatus(pins): called when our control signals have changed; aliased internally to updateStatus(pins) * * For now, we're not going to worry about communication in the other direction, because when the target component * performs its own initConnection(), it will find our receiveData() function, at which point communication in both @@ -502,6 +506,7 @@ SerialPort8080.prototype.initConnection = function() var fnConnect = exports['connect']; if (fnConnect) fnConnect.call(this.connection); this.sendData = exports['receiveData']; + this.updateStatus = exports['receiveStatus']; if (this.sendData) { this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID); return; @@ -713,6 +718,22 @@ SerialPort8080.prototype.receiveData = function(data) return true; // for now, return true regardless, since we're buffering everything anyway }; +/** + * receiveStatus(pins) + * + * NOTE: Prior to the addition of this interface, the DSR bit was initialized set and remained set for the life + * of the machine. It is entirely appropriate that this is the only way the bit can be changed, because it represents + * an external control signal. + * + * @this {SerialPort8080} + * @param {number} pins + */ +SerialPort8080.prototype.receiveStatus = function(pins) +{ + this.bStatus &= ~SerialPort8080.UART8251.STATUS.DSR; + if (pins & RS232.DSR.MASK) this.bStatus |= SerialPort8080.UART8251.STATUS.DSR; +}; + /** * transmitByte(b) * @@ -865,6 +886,23 @@ SerialPort8080.prototype.outControl = function(port, bOut, addrFrom) this.bMode = bOut; this.fReady = true; } else { + /* + * Whenever DTR or RTS changes, we also want to notify any connected machine, via updateStatus(). + */ + if (this.updateStatus) { + var delta = (bOut ^ this.bCommand); + if (delta & (SerialPort8080.UART8251.COMMAND.RTS | SerialPort8080.UART8251.COMMAND.DTR)) { + var pins = 0; + if (this.fNullModem) { + pins |= (bOut & SerialPort8080.UART8251.COMMAND.RTS)? RS232.CTS.MASK : 0; + pins |= (bOut & SerialPort8080.UART8251.COMMAND.DTR)? (RS232.DSR.MASK | RS232.CD.MASK): 0; + } else { + pins |= (bOut & SerialPort8080.UART8251.COMMAND.RTS)? RS232.RTS.MASK : 0; + pins |= (bOut & SerialPort8080.UART8251.COMMAND.DTR)? RS232.DTR.MASK : 0; + } + this.updateStatus(pins); + } + } this.bCommand = bOut; if (this.bCommand & SerialPort8080.UART8251.COMMAND.INTERNAL_RESET) { this.fReady = false; diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index c4719e3ea..a521fb7f6 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -1236,20 +1236,21 @@ BusPDP11.prototype.addIOHandlers = function(start, end, fnReadByte, fnWriteByte, }; /** - * addIOTable(component, table) + * addIOTable(component, table, offReg) * * Add I/O notification handlers from the specified table (a batch version of addIOHandlers). * * @this {BusPDP11} * @param {Component} component * @param {Object} table + * @param {number} [offReg] (optional offset to add to all register addresses) * @return {boolean} (true if entire range successfully registered, false if any conflicts) */ -BusPDP11.prototype.addIOTable = function(component, table) +BusPDP11.prototype.addIOTable = function(component, table, offReg) { - for (var port in table) { - var addr = +port; - var afn = table[port]; + for (var reg in table) { + var addr = +reg + (offReg || 0); + var afn = table[reg]; /* * Don't install (ie, ignore) handlers for I/O addresses that are defined with a model number diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 5b3a03a34..b1a63e8ed 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -206,6 +206,17 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.setReady(); }; +/** + * finish() + * + * Stub for final initialization call (overridden by the CPUStatePDP11 component). + * + * @this {CPUPDP11} + */ +CPUPDP11.prototype.finish = function() +{ +}; + /** * reset() * @@ -255,6 +266,7 @@ CPUPDP11.prototype.restore = function(data) CPUPDP11.prototype.powerUp = function(data, fRepower) { if (!fRepower) { + this.finish(); if (!data || !this.restore) { this.reset(); } else { diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index f80524d7b..eb032e5cf 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -149,16 +149,35 @@ CPUStatePDP11.prototype.initProcessor = function() this.nDisableTraps = 0; /** @type {IRQ|null} */ - this.irqNext = null; // the head of the active IRQ list, in priority order + this.irqNext = null; // the head of the active IRQ list, in priority order - if (DEBUG) { - /** @type {Array.} */ - this.aIRQs = []; // list of all IRQs, active or not (just for debugging) - } + /** @type {Array.} */ + this.aIRQs = []; // list of all IRQs, active or not (to be used for auto-configuration) this.flags.complete = false; }; +/** + * finish() + * + * TODO: This function simply ensures that we don't leave any IRQs installed with unresolved floating + * (negative) vectors; properly assigning vectors according to device type (ie, auto-configuration) is an + * exercise left for another day. + * + * @this {CPUStatePDP11} + */ +CPUStatePDP11.prototype.finish = function() +{ + var vectorFloating = 0o300; + for (var i = 0; i < this.aIRQs.length; i++) { + var irq = this.aIRQs[i]; + if (irq.vector < 0) { + irq.vector = vectorFloating; + vectorFloating += 4; + } + } +}; + /** * reset() * @@ -170,7 +189,7 @@ CPUStatePDP11.prototype.reset = function() if (this.flags.running) this.stopCPU(); this.initRegs(); this.resetCycles(); - this.clearError(); // clear any fatal error/exception that setError() may have flagged + this.clearError(); // clear any fatal error/exception that setError() may have flagged this.parent.reset.call(this); }; @@ -264,7 +283,7 @@ CPUStatePDP11.prototype.resetMMU = function() this.regMMR1 = 0; // 177574 this.regMMR2 = 0; // 177576 this.regMMR3 = 0; // 172516 - this.regErr = 0; // 177766 TODO: Do we ever need to clear this, because it appears to accumulate errors... + this.regErr = 0; // 177766 TODO: Do we ever need to automatically clear this, or is it manually cleared? this.regPIR = 0; // 177772 this.regSL = 0xff; // 177774 this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE @@ -774,7 +793,7 @@ CPUStatePDP11.prototype.setSP = function(addr) * addIRQ(vector, priority, message) * * @this {CPUStatePDP11} - * @param {number} vector + * @param {number} vector (-1 for floating vector) * @param {number} priority * @param {number} [message] * @return {IRQ} @@ -782,10 +801,8 @@ CPUStatePDP11.prototype.setSP = function(addr) CPUStatePDP11.prototype.addIRQ = function(vector, priority, message) { var irq = {vector: vector, priority: priority, message: message || 0, next: null}; - if (DEBUG) { - irq.name = PDP11.VECTORS[vector]; - this.aIRQs.push(irq); - } + irq.name = PDP11.VECTORS[vector]; + this.aIRQs.push(irq); return irq; }; diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 60fc58a80..b1a19491c 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -489,6 +489,8 @@ var PDP11 = { RLMP: 0o174406, // RL11 Multi-Purpose Register RLBE: 0o174410, // RL11 Bus (Address) Extension Register (RLV12 controller only) + DL11: 0o176500, // DL11 Additional Register Range (ends at 0o176676) + RKDS: 0o177400, // RK11 Drive Status Register RKER: 0o177402, // RK11 Error Register RKCS: 0o177404, // RK11 Control Status Register @@ -609,6 +611,7 @@ var PDP11 = { DSC: 0x8000, // Dataset Status Change (R/O) RMASK: 0xFFFE, // bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readRCSR()) WMASK: 0x006F, // bits writable + RS232: 0x0006, // bits affecting RS-232 status updates BAUD: 9600 }, RBUF: { // 177562: DL11 Receiver Data Buffer Register @@ -846,10 +849,10 @@ var PDP11 = { } }, VECTORS: { - 0o060: "DL11.RCSR", - 0o064: "DL11.XCSR", - 0o070: "PC11.PRS", - 0o074: "PC11.PPS", + 0o060: "DL11R", + 0o064: "DL11X", + 0o070: "PC11R", + 0o074: "PC11X", 0o100: "KW11", 0o160: "RL11", 0o220: "RK11" diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index 9a807c844..87326c863 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -80,6 +80,7 @@ function SerialPortPDP11(parmsSerial) { this.nBaudReceive = parmsSerial['baudReceive'] || PDP11.DL11.RCSR.BAUD; this.nBaudTransmit = parmsSerial['baudTransmit'] || PDP11.DL11.XCSR.BAUD; this.fUpperCase = parmsSerial['upperCase']; + this.fNullModem = true; /** * consoleOutput becomes a string that records serial port output if the 'binding' property is set to the @@ -134,14 +135,15 @@ function SerialPortPDP11(parmsSerial) { * No connection until initConnection() is called. */ this.sDataReceived = ""; - this.connection = this.sendData = null; + this.connection = this.sendData = this.updateStatus = null; /* - * Export all functions required by initConnection(); currently, this is the bare minimum (no flow control yet). + * Export all functions required by initConnection(). */ this['exports'] = { 'connect': this.initConnection, - 'receiveData': this.receiveData + 'receiveData': this.receiveData, + 'receiveStatus': this.receiveStatus }; } @@ -308,7 +310,7 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) var serial = this; - this.irqReceiver = this.cpu.addIRQ(PDP11.DL11.RVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); + this.irqReceiver = this.cpu.addIRQ(this.iAdapter? -1 : PDP11.DL11.RVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); this.timerReceiveInterrupt = this.cpu.addTimer(function readyReceiver() { var b = serial.receiveByte(); @@ -325,7 +327,7 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) } }); - this.irqTransmitter = this.cpu.addIRQ(PDP11.DL11.XVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); + this.irqTransmitter = this.cpu.addIRQ(this.iAdapter? -1 : PDP11.DL11.XVEC, PDP11.DL11.PRI, MessagesPDP11.DL11); this.timerTransmitInterrupt = this.cpu.addTimer(function readyTransmitter() { serial.regXCSR |= PDP11.DL11.XCSR.READY; @@ -334,7 +336,7 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) } }); - bus.addIOTable(this, SerialPortPDP11.UNIBUS_IOTABLE); + bus.addIOTable(this, SerialPortPDP11.UNIBUS_IOTABLE, this.iAdapter? ((PDP11.UNIBUS.DL11 + (this.iAdapter - 1) * 8) - PDP11.UNIBUS.RCSR) : 0); bus.addResetHandler(this.reset.bind(this)); this.setReady(); @@ -349,6 +351,7 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) * If the target component is found, then verify that it has exported functions with the following names: * * receiveData(data): called when we have data to transmit; aliased internally to sendData(data) + * receiveStatus(pins): called when our control signals have changed; aliased internally to updateStatus(pins) * * For now, we're not going to worry about communication in the other direction, because when the target component * performs its own initConnection(), it will find our receiveData() function, at which point communication in both @@ -377,6 +380,7 @@ SerialPortPDP11.prototype.initConnection = function() var fnConnect = exports['connect']; if (fnConnect) fnConnect.call(this.connection); this.sendData = exports['receiveData']; + this.updateStatus = exports['receiveStatus']; if (this.sendData) { this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID); return; @@ -483,7 +487,7 @@ SerialPortPDP11.prototype.restore = function(data) SerialPortPDP11.prototype.initState = function(data) { this.regRBUF = 0; - this.regRCSR = 0; + this.regRCSR = PDP11.DL11.RCSR.CTS; // TODO: I didn't use to set this initially; is this wise? this.regXCSR = PDP11.DL11.XCSR.READY; this.abReceive = []; return true; @@ -592,6 +596,30 @@ SerialPortPDP11.prototype.receiveByte = function() return b; }; +/** + * receiveStatus(pins) + * + * @this {SerialPortPDP11} + * @param {number} pins + */ +SerialPortPDP11.prototype.receiveStatus = function(pins) +{ + var oldRCSR = this.regRCSR; + this.regRCSR &= ~(PDP11.DL11.RCSR.CTS | PDP11.DL11.RCSR.CD); + if (pins & RS232.CTS.MASK) { + this.regRCSR |= PDP11.DL11.RCSR.CTS; + } + if (pins & RS232.CD.MASK) { + this.regRCSR |= PDP11.DL11.RCSR.CD; + } + if (oldRCSR != this.regRCSR) { + this.regRCSR |= PDP11.DL11.RCSR.DSC; + if (this.regRCSR & PDP11.DL11.RCSR.DIE) { + this.cpu.setIRQ(this.irqReceiver); + } + } +}; + /** * transmitByte(b) * @@ -681,7 +709,9 @@ SerialPortPDP11.prototype.transmitByte = function(b) */ SerialPortPDP11.prototype.readRCSR = function(addr) { - return this.regRCSR & PDP11.DL11.RCSR.RMASK; + var data = this.regRCSR & PDP11.DL11.RCSR.RMASK; + this.regRCSR &= ~PDP11.DL11.RCSR.DSC; + return data; }; /** @@ -693,6 +723,23 @@ SerialPortPDP11.prototype.readRCSR = function(addr) */ SerialPortPDP11.prototype.writeRCSR = function(data, addr) { + /* + * Whenever DTR or RTS changes, we also want to notify any connected machine, via updateStatus(). + */ + if (this.updateStatus) { + var delta = (data ^ this.regRCSR); + if (delta & PDP11.DL11.RCSR.RS232) { + var pins = 0; + if (this.fNullModem) { + pins |= (data & PDP11.DL11.RCSR.RTS)? RS232.CTS.MASK : 0; + pins |= (data & PDP11.DL11.RCSR.DTR)? (RS232.DSR.MASK | RS232.CD.MASK): 0; + } else { + pins |= (data & PDP11.DL11.RCSR.RTS)? RS232.RTS.MASK : 0; + pins |= (data & PDP11.DL11.RCSR.DTR)? RS232.DTR.MASK : 0; + } + this.updateStatus(pins); + } + } this.regRCSR = (this.regRCSR & ~PDP11.DL11.RCSR.WMASK) | (data & PDP11.DL11.RCSR.WMASK); }; diff --git a/modules/shared/lib/defines.js b/modules/shared/lib/defines.js index 1459217a4..935eef1cf 100644 --- a/modules/shared/lib/defines.js +++ b/modules/shared/lib/defines.js @@ -62,6 +62,51 @@ var MAXDEBUG = false; // this @define is overridden by the Closure Com */ var PRIVATE = false; // this @define is overridden by the Closure Compiler (to false) to enable PRIVATE code +/* + * RS-232 DB-25 Pin Definitions, mapped to bits 1-25 in a 32-bit status value. + * + * SerialPorts in PCjs machines are considered DTE (Data Terminal Equipment), which means they should be "virtually" + * connected to each other via a null-modem cable, which assumes the following cross-wiring: + * + * G 1 <-> 1 G (Ground) + * TD 2 <-> 3 RD (Received Data) + * RD 3 <-> 2 TD (Transmitted Data) + * RTS 4 <-> 5 CTS (Clear To Send) + * CTS 5 <-> 4 RTS (Request To Send) + * DSR 6+8 <-> 20 DTR (Data Terminal Ready) + * SG 7 <-> 7 SG (Signal Ground) + * DTR 20 <-> 6+8 DSR (Data Set Ready + Carrier Detect) + * RI 22 <-> 22 RI (Ring Indicator) + * + * TODO: Move these definitions to a more appropriate shared file at some point. + */ +var RS232 = { + RTS: { + PIN: 4, + MASK: 0x00000010 + }, + CTS: { + PIN: 5, + MASK: 0x00000020 + }, + DSR: { + PIN: 6, + MASK: 0x00000040 + }, + CD: { + PIN: 8, + MASK: 0x00000100 + }, + DTR: { + PIN: 20, + MASK: 0x00100000 + }, + RI: { + PIN: 22, + MASK: 0x00400000 + } +}; + /* * NODE should be true if we're running under NodeJS (eg, command-line), false if not (eg, web browser) */ @@ -82,6 +127,7 @@ if (NODE) { global.DEBUG = DEBUG; global.MAXDEBUG = MAXDEBUG; global.PRIVATE = PRIVATE; + global.RS232 = RS232; global.NODE = NODE; /* * TODO: When we're "required" by Node, should we return anything via module.exports? diff --git a/versions/pc8080/1.30.5/pc8080-dbg.js b/versions/pc8080/1.30.5/pc8080-dbg.js index 5488cd476..503e2668f 100644 --- a/versions/pc8080/1.30.5/pc8080-dbg.js +++ b/versions/pc8080/1.30.5/pc8080-dbg.js @@ -29,8 +29,8 @@ http://pcjs.org/modules/pc8080/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -var l,n={pe:0,se:1,te:2,ue:3,ve:4,we:5,xe:6,ye:7,ze:8,Ae:9,Be:10,Ce:11,De:12,Ee:13,Fe:14,Ge:15,He:16,Ie:17,Je:18,Ke:19,Le:20,Me:21,Ne:22,Oe:23,Pe:24,Qe:25,Re: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,Eb:65,Mc:66,Oc:67,bc:68,E:69,Rc:70,Sc:71,Tc:72,Uc:73,ad:74,bd:75,dc:76,jd:77,kd:78,md:79,nd:80,Q:81,td:82,wd:83,Cd:84,Dd:85,Ed:86,Fd:87, -Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,Af:98,Bf:99,d:100,e:101,Cf:102,Df:103,Ef:104,Ff:105,Gf:106,k:107,Hf:108,If:109,n:110,Jf:111,p:112,q:113,r:114,Kf:115,t:116,Mf:117,Nf:118,Of:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Se:127}; +var l,n={qe:0,te:1,ue:2,ve:3,we:4,xe:5,ye:6,ze:7,Ae:8,Be:9,Ce:10,De:11,Ee:12,Fe:13,Ge:14,He:15,Ie:16,Je:17,Ke:18,Le:19,Me:20,Ne:21,Oe:22,Pe:23,Qe:24,Re:25,Se: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,Eb:65,Mc:66,Oc:67,bc:68,E:69,Rc:70,Sc:71,Tc:72,Uc:73,ad:74,bd:75,dc:76,jd:77,kd:78,md:79,nd:80,Q:81,td:82,wd:83,Cd:84,Dd:85,Ed:86,Fd:87, +Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,Bf:98,Cf:99,d:100,e:101,Df:102,Ef:103,Ff:104,Gf:105,Hf:106,k:107,If:108,Jf:109,n:110,Kf:111,p:112,q:113,r:114,Lf:115,t:116,Nf:117,Of:118,Pf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Te:127}; function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function t(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){return t(a,2,!0)} function u(a){return t(a,4,!0)}function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})} @@ -39,29 +39,29 @@ function pa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a function sa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ab=g.load;d.Sa=g.exec;if(e=g.bytes)d.za=e;else if(e=g.words)for(d.za=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.za=Array(4*e.length),f=c=0;c>8&255,d.za[f++]=e[c]>>16&255,d.za[f++]=e[c]>>24&255;else d.za=g;d.Da=g.symbols;d.za.length?1==d.za.length&&(w(d.za[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.ab=g.load;d.Sa=g.exec;if(e=g.bytes)d.Ba=e;else if(e=g.words)for(d.Ba=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.Ba=Array(4*e.length),f=c=0;c>8&255,d.Ba[f++]=e[c]>>16&255,d.Ba[f++]=e[c]>>24&255;else d.Ba=g;d.Fa=g.symbols;d.Ba.length?1==d.Ba.length&&(w(d.Ba[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?this.gb=this.id:(this.hb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,wb:!1,Qb:!1,wa:!1,error:!1};this.Ib=null;this.C.error=!1;this.M={};this.H=null;this.sa=d||0;Ua.push(this)}var Va=void 0,Wa={}; +function x(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.jc=b.comment;this.Qd=b;b=this.id.indexOf(".");0>b?this.gb=this.id:(this.hb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,wb:!1,Qb:!1,xa:!1,error:!1};this.Ib=null;this.C.error=!1;this.M={};this.H=null;this.sa=d||0;Ua.push(this)}var Va=void 0,Wa={}; if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function ab(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function A(a,b){b||(b=x);a.prototype=ab(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var bb=window.PCjs.Machines||(window.PCjs.Machines={}),Ua=window.PCjs.Components||(window.PCjs.Components=[])}else bb={},Ua=[];function cb(a,b,c){bb[a]&&b&&(bb[a][b]=c)}function Qa(a,b,c){b||w((c?c+": ":"")+a)} function db(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.ha&&(this.ha=10);15>2;this.w=this.Ia-1;this.I=this.K/this.Ia|0;this.D=this.I-1;this.A=[];this.j=[];this.F=this.B=!1;this.N=[];this.O=[];a=new G;xb(a,this.H);this.W=Array(this.I);for(b=0;b>>a.ha;0f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.G)return h.Cb+=h.G-e,h.G=e,!0;if(e>=h.G+h.Cb){m=h.size-(e-k);m>f&&(m=f);h.Cb=e-h.G+m;e=k+a.Ia;f-=m;g++;continue}}return zb(1,e,f)}e=new G(e,m,a.Ia,d);xb(e,a.H,h);a.W[g++]=e;e=k+a.Ia;f-=m}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Ab[d]+" at "+u(b)),!0):zb(2,b,c)} +l.oa=function(a,b,c,d){return this.A&&this.A.oa(a,b,c,d)||this.b&&this.b.oa(a,b,c,d)||this.I&&this.I.oa(a,b,c,d)||this.H&&this.H.oa(a,b,c,d)?!0:this.parent.oa.call(this,a,b,c,d)};l.Qa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.H=d;this.I=ub(a,"Keyboard")};l.Ga=function(a,b){b||vb();return!0};l.Ka=function(){return!0};l.Aa=function(){};function vb(){for(var a=!1,b=D(document,"pc8080","panel"),c=0;c>1)+2;10>this.ha&&(this.ha=10);15>2;this.w=this.Ja-1;this.I=this.K/this.Ja|0;this.D=this.I-1;this.A=[];this.j=[];this.F=this.B=!1;this.N=[];this.O=[];a=new G;xb(a,this.H);this.W=Array(this.I);for(b=0;b>>a.ha;0f&&(m=f);if(h&&h.size){if(h.type==d){if(e+f<=h.G)return h.Cb+=h.G-e,h.G=e,!0;if(e>=h.G+h.Cb){m=h.size-(e-k);m>f&&(m=f);h.Cb=e-h.G+m;e=k+a.Ja;f-=m;g++;continue}}return zb(1,e,f)}e=new G(e,m,a.Ja,d);xb(e,a.H,h);a.W[g++]=e;e=k+a.Ja;f-=m}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+Ab[d]+" at "+u(b)),!0):zb(2,b,c)} l.Z=function(a){return this.W[(a&this.u)>>>this.ha].nb(a&this.w,a)};function Bb(a,b){return a.W[(b&a.u)>>>a.ha].Ab(b&a.w,b)}l.bb=function(a){var b=a&this.w,c=(a&this.u)>>>this.ha;return b!=this.w?this.W[c].Fc(b,a):this.W[c++].nb(b,a)|this.W[c&this.D].nb(0,a+1)<<8};function Cb(a,b){var c=b&a.w,d=(b&a.u)>>>a.ha;return c!=a.w?a.W[d].Vb(c,b):a.W[d++].Ab(c,b)|a.W[d&a.D].Ab(0,b+1)<<8}l.ua=function(a,b){this.W[(a&this.u)>>>this.ha].pb(a&this.w,b&255,a)}; function Db(a,b,c){a.W[(b&a.u)>>>a.ha].Db(b&a.w,c&255,b)}l.Mb=function(a,b){var c=a&this.w,d=(a&this.u)>>>this.ha;c!=this.w?this.W[d].Hc(c,b&65535,a):(this.W[d++].pb(c,b&255,a),this.W[d&this.D].pb(0,b>>8&255,a+1))};function Eb(a){for(var b=0,c=[],d=0;d>1]},ga:function(a,b){this.w[a]=b;this.Oa=!0},gb:function(a,b){this.w[a]=b;this.Oa=!0},ka:function(a,b){this.B.setUint16(a,b,!0);this.Oa=!0},ra:function(a,b){a&1?(this.w[a]=b,this.w[a+1]=b>>8):this.I[a>>1]=b;this.Oa=!0}}; function xb(a,b,c){a.H=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc,!1))}function kc(a,b){b?--a.j||(a.pb=a.M?a.u:a.Db,a.Hc=a.M?a.D:a.Zb):--a.A||(a.nb=a.Ab,a.Fc=a.Vb)}function gc(a,b,c){c&&a.j||(a.pb=!a.M&&b[1]||a.u,a.Hc=!a.M&&b[3]||a.D);if(c||void 0===c)a.Db=b[1]||a.u,a.Zb=b[3]||a.D}function ic(a,b,c){c&&a.A||(a.nb=b[0]||a.J,a.Fc=b[2]||a.K);if(c||void 0===c)a.Ab=b[0]||a.J,a.Vb=b[2]||a.K}function cc(a,b){b||(b=lc);ic(a,b,void 0);gc(a,b,void 0)} var lc=[],fc=[G.prototype.X,G.prototype.hb,G.prototype.ea,G.prototype.va],hc=[G.prototype.N,G.prototype.ja,G.prototype.ba,G.prototype.la];if(ob)var ec=[G.prototype.L,G.prototype.ga,G.prototype.aa,G.prototype.ka],dc=[G.prototype.O,G.prototype.gb,G.prototype.da,G.prototype.ra]; -function mc(a,b){x.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.X=a.cycles||b;this.Ra=c;this.ga=Math.round(this.X/1E4)/100;this.cb=this.ga*this.Ra;this.C.ya=!1;this.C.Yb=!1;this.C.vb=a.autoStart;this.C.Ac=!1;this.C.jb=!1;this.xb=this.N=0;this.yb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.u=[];this.Ga=this.eb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype; +function mc(a,b){x.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.X=a.cycles||b;this.Ra=c;this.ga=Math.round(this.X/1E4)/100;this.cb=this.ga*this.Ra;this.C.za=!1;this.C.Yb=!1;this.C.vb=a.autoStart;this.C.Ac=!1;this.C.jb=!1;this.xb=this.N=0;this.yb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.u=[];this.Ha=this.eb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype; l.Qa=function(a,b,c,d){this.A=a;this.w=b;this.H=d;for(b=0;b=a.N&&(a.N+=a.lb,c=!0);0<=a.mb&&a.mb<=Gc(a)&&(a.lb=a.mb=-1,qc(a),a.pa(),c=!0);c&&a.g(Gc(a)+" cycles: checksum="+t(a.xb))}} -l.oa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.M[b]=c;a=!0;break;case "run":this.M[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.wa)a=!0;else{var b=null,c,h=db(a.id);for(c=0;ca.I/a.cb?b=1:d=!0;a.Ra=b;b=a.ga*a.Ra;if(a.cb!=b){a.cb=b;b=a.cb.toFixed(2)+"Mhz";var e=a.M.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.A&&a.A.Bb()}Ic(a,a.D);a.D=0;a.B=qa();a.J=0;Jc(a);return d}function Kc(a,b){var c=a.u.length;a.u.push([-1,b]);return c}function Lc(a,b,c){0<=b&&ba.u[b][0]&&(c*=a.X*a.Ra/1E3,a.u[b][0]=c+Mc(a))}function Mc(a,b){var c=a.K-=a.b;a.b=0;b&&(a.K=0);return c} -l.eb=function(a){if(kb(this,!0)){if(!this.C.ya){Hc(this);this.A&&this.A.start(this.B,Gc(this));this.C.ya=!0;this.C.Yb=!0;this.F&&this.F.start();var b=this.M.run;b&&(b.textContent="Halt");this.A&&(this.A.Ka(!0),a&&this.A.Bb(!0))}this.ja>=this.X&&Jc(this,!0);this.aa=0;this.da=qa();this.J&&(a=this.da-this.J,a>this.va&&(this.B+=a,this.B>this.da&&(this.B=this.da)));try{do{for(var c,d=this.C.jb?1:this.ea,e=this.u.length-1;0<=e;e--){var f=this.u[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.ob(c);c=Mc(this,!0);this.aa+= -c;this.D+=c;Fc(this,c);a=c;for(var g=this.u.length-1;0<=g;g--){var h=this.u[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.O-=c;if(0>=this.O){this.O+=this.ea;15<=++this.Aa&&(this.A&&this.A.Ka(),this.Aa=0);break}}while(this.C.ya)}catch(k){this.pa();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ga;this.J=qa();e=this.va;this.aa&&(e=Math.round(e*this.aa/this.ea));e-=this.J-this.da;if(f=this.J-this.B)this.I=Math.round(this.D/(10*f))/ -100,864E5<=f&&(this.L=0,Hc(this));if(0>e||this.Ie&&(this.B-=e),e=0;this.ja+=this.aa;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.ob=function(){return 0};l.pa=function(a){lb(this,!0);Mc(this);Ic(this,this.D);this.D=0;if(this.C.ya){this.C.ya=!1;this.F&&this.F.stop();var b=this.M.run;b&&(b.textContent="Run")}this.C.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d=this.X&&Jc(this,!0);this.aa=0;this.da=qa();this.J&&(a=this.da-this.J,a>this.va&&(this.B+=a,this.B>this.da&&(this.B=this.da)));try{do{for(var c,d=this.C.jb?1:this.ea,e=this.u.length-1;0<=e;e--){var f=this.u[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.ob(c);c=Mc(this,!0);this.aa+= +c;this.D+=c;Fc(this,c);a=c;for(var g=this.u.length-1;0<=g;g--){var h=this.u[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.O-=c;if(0>=this.O){this.O+=this.ea;15<=++this.Ca&&(this.A&&this.A.Aa(),this.Ca=0);break}}while(this.C.za)}catch(k){this.pa();Ec(this);this.A&&this.A.stop(qa(),Gc(this));kb(this,!1);nb(this,k.stack||k.message);return}c=setTimeout;d=this.Ha;this.J=qa();e=this.va;this.aa&&(e=Math.round(e*this.aa/this.ea));e-=this.J-this.da;if(f=this.J-this.B)this.I=Math.round(this.D/(10*f))/ +100,864E5<=f&&(this.L=0,Hc(this));if(0>e||this.Ie&&(this.B-=e),e=0;this.ja+=this.aa;this.J+=e;c(d,e)}else Ec(this),this.A&&this.A.stop(qa(),Gc(this))};l.ob=function(){return 0};l.pa=function(a){lb(this,!0);Mc(this);Ic(this,this.D);this.D=0;if(this.C.za){this.C.za=!1;this.F&&this.F.stop();var b=this.M.run;b&&(b.textContent="Run")}this.C.complete=a};function Ec(a,b){if(a.A){for(var c=a.A,d=0;d>8&255;a.S=b&255}function Yc(a){return a.T<<8|a.U}function Zc(a,b){a.T=b>>8&255;a.U=b&255}function J(a){return a.V<<8|a.Y} -function $c(a,b){a.V=b>>8&255;a.Y=b&255}function I(a,b){a.P=b&65535}function ad(a){return a.ca&256?1:0}function bd(a,b){a.ca=a.ca&255|b}function cd(a){return pb[a.fa&255]?4:0}function dd(a){return(a.fa^a.xa)&16?16:0}function ed(a){return a.ca&255?0:64}function fd(a){return a.fa&128?128:0}function Uc(a){return a.ta&-214|fd(a)|ed(a)|dd(a)|cd(a)|ad(a)}function Sc(a,b){a.ca=a.fa=a.xa=0;b&1&&(a.ca|=256);b&4||(a.fa|=1);b&16&&(a.xa|=16);b&64||(a.ca|=255);b&128&&(a.fa^=192);a.ta=a.ta&-726|b&512|2} -function gd(a,b){a.xa=a.i^b;return a.fa=(a.ca=a.i+b)&255}function hd(a,b){a.xa=a.i^b;return a.fa=(a.ca=a.i+b+(a.ca&256?1:0))&255}function id(a,b){a.ca=a.fa=a.xa=a.i&b;(a.i|b)&8&&(a.xa^=16);return a.ca}function jd(a,b){a.xa=b^255;b=a.fa=b+255&255;a.ca=a.ca&-256|b;return b}function kd(a,b){a.xa=b;b=a.fa=b+1&255;a.ca=a.ca&-256|b;return b}function ld(a,b){return a.fa=a.ca=a.xa=a.i|b}function K(a,b){b^=255;a.xa=a.i^b;return a.fa=(a.ca=a.i+b+1^256)&255} -function Gd(a,b){b^=255;a.xa=a.i^b;return a.fa=(a.ca=a.i+b+(a.ca&256?0:1)^256)&255}function Hd(a,b){return a.fa=a.ca=a.xa=a.i^b}l.Z=function(a){return this.w.Z(a)};l.ua=function(a,b){this.w.ua(a,b)};function L(a){var b=a.Z(a.P);I(a,a.P+1);return b}function M(a){var b=a.w.bb(a.P);I(a,a.P+2);return b}function N(a){var b=a.w.bb(a.na);a.na=a.na+2&65535;return b}function P(a,b){a.na=a.na-2&65535;a.w.Mb(a.na,b)} -function Id(a){if(a.b&&a.j&255&&a.ta&512){for(var b=0;8>b&&!(a.j&1<b?255:1<>8&255;a.Y=b&255}function I(a,b){a.P=b&65535}function ad(a){return a.ca&256?1:0}function bd(a,b){a.ca=a.ca&255|b}function cd(a){return pb[a.fa&255]?4:0}function dd(a){return(a.fa^a.ya)&16?16:0}function ed(a){return a.ca&255?0:64}function fd(a){return a.fa&128?128:0}function Uc(a){return a.ta&-214|fd(a)|ed(a)|dd(a)|cd(a)|ad(a)}function Sc(a,b){a.ca=a.fa=a.ya=0;b&1&&(a.ca|=256);b&4||(a.fa|=1);b&16&&(a.ya|=16);b&64||(a.ca|=255);b&128&&(a.fa^=192);a.ta=a.ta&-726|b&512|2} +function gd(a,b){a.ya=a.i^b;return a.fa=(a.ca=a.i+b)&255}function hd(a,b){a.ya=a.i^b;return a.fa=(a.ca=a.i+b+(a.ca&256?1:0))&255}function id(a,b){a.ca=a.fa=a.ya=a.i&b;(a.i|b)&8&&(a.ya^=16);return a.ca}function jd(a,b){a.ya=b^255;b=a.fa=b+255&255;a.ca=a.ca&-256|b;return b}function kd(a,b){a.ya=b;b=a.fa=b+1&255;a.ca=a.ca&-256|b;return b}function ld(a,b){return a.fa=a.ca=a.ya=a.i|b}function K(a,b){b^=255;a.ya=a.i^b;return a.fa=(a.ca=a.i+b+1^256)&255} +function Gd(a,b){b^=255;a.ya=a.i^b;return a.fa=(a.ca=a.i+b+(a.ca&256?0:1)^256)&255}function Hd(a,b){return a.fa=a.ca=a.ya=a.i^b}l.Z=function(a){return this.w.Z(a)};l.ua=function(a,b){this.w.ua(a,b)};function L(a){var b=a.Z(a.P);I(a,a.P+1);return b}function M(a){var b=a.w.bb(a.P);I(a,a.P+2);return b}function N(a){var b=a.w.bb(a.na);a.na=a.na+2&65535;return b}function P(a,b){a.na=a.na-2&65535;a.w.Mb(a.na,b)} +function Id(a){if(a.b&&a.j&255&&a.ta&512){for(var b=0;8>b&&!(a.j&1<b?255:1<>8;bd(this,a&256);this.b-=4},Md,function(){var a;$c(this,a=J(this)+Wc(this));bd(this,a>>8&256);this.b-=10},function(){this.i=this.Z(Wc(this));this.b-=7},function(){Xc(this,Wc(this)-1);this.b-= 5},function(){this.S=kd(this,this.S);this.b-=5},function(){this.S=jd(this,this.S);this.b-=5},function(){this.S=L(this);this.b-=7},function(){var a=this.i<<8&256;this.i=(a|this.i)>>1;bd(this,a);this.b-=4},Md,function(){Zc(this,M(this));this.b-=10},function(){this.ua(Yc(this),this.i);this.b-=7},function(){Zc(this,Yc(this)+1);this.b-=5},function(){this.T=kd(this,this.T);this.b-=5},function(){this.T=jd(this,this.T);this.b-=5},function(){this.T=L(this);this.b-=7},function(){var a=this.i<<1;this.i=a&255| @@ -120,71 +120,71 @@ J(this));this.b-=11},function(){this.i=id(this,L(this));this.b-=7},function(){P( 40);this.b-=11},function(){fd(this)||(I(this,N(this)),this.b-=6);this.b-=5},function(){var a=N(this);Sc(this,a&255|this.ta&-256);this.i=a>>8;this.b-=10},function(){var a=M(this);fd(this)||I(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=M(this);fd(this)||(P(this,this.P),I(this,a),this.b-=6);this.b-=11},function(){P(this,Uc(this)&255|this.i<<8);this.b-=11},function(){this.i=ld(this,L(this));this.b-=7},function(){P(this,this.P);I(this,48);this.b-=11},function(){fd(this)&&(I(this, N(this)),this.b-=6);this.b-=5},function(){this.na=J(this)&65535;this.b-=5},function(){var a=M(this);fd(this)&&I(this,a);this.b-=10},function(){this.ta|=512;this.b-=4;Id(this)},function(){var a=M(this);fd(this)&&(P(this,this.P),I(this,a),this.b-=6);this.b-=11},Pd,function(){K(this,L(this));this.b-=7},function(){P(this,this.P);I(this,56);this.b-=11}]; function R(a){x.call(this,"ChipSet",a,R,32768);var b=a.model;b&&!Qd[b]&&Qa("Unrecognized ChipSet model: "+b);this.u=Qd[b]||{};a.sound&&(this.ga=null,window&&(this.ga=window.AudioContext||window.webkitAudioContext),this.ga&&new this.ga);F(this)}A(R); -var S={Ba:1978.1,Ad:{Ca:0,Ue:1,Ye:16,ef:32,pf:64,nf:128,qb:14},Za:{Ca:1,Pc:1,sd:2,od:4,pd:16,qd:32,rd:64,qb:8},Bd:{Ca:2,Te:3,xf:4,Ve:8,jf:16,kf:32,lf:64,We:128,qb:0},tf:{Ca:3},rf:{Ca:2,ff:7},vf:{Ca:3,yf:1,uf:2,mf:4,cf:8,Xe:16,oe:32},sf:{Ca:4},wf:{Ca:5,Ze:1,$e:2,af:4,bf:8,zf:16}},T={Ba:100,La:{Ca:66,rc:1,gc:2,ld:4,hf:8,gf:16,ic:32,hc:64,cc:128},Nc:{Ca:66,INIT:0},Ua:{Ca:194,re:0,ac:16,ud:32,nc:48,Xc:0,Yc:32},Fb:{Ca:162,qf:0,$c:0,Wc:0,Zc:0,Vc:0},Ma:{df:{Ca:98},Ta:{Kc:0,Jc:1,xd:2,Gd:4,Qc:5,vd:6,yd:7}, -Gb:16383}},Qd={SI1978:S,VT100:T};R.prototype.oa=function(){return!1};R.prototype.Qa=function(a,b,c,d){this.w=b;this.b=c;this.H=d;this.A=a;this.I=ub(a,"Keyboard");this.J=ub(a,"SerialPort");this.video=ub(a,"Video");Gb(b,this,this.u.Kb);Ub(b,this,this.u.Lb);if(d){var e=this;Rd(d,16384,function(){for(var a="",b=0;b>8-this.ea&255;E(this,a,null,b,"SHIFT.RESULT",c,!0);return c};l.ee=function(a,b,c){E(this,a,b,c,"SHIFT.COUNT",null,!0);this.ea=b};l.ge=function(a,b,c){E(this,a,b,c,"SOUND1",null,!0);this.ra=b};l.fe=function(a,b,c){E(this,a,b,c,"SHIFT.DATA",null,!0);this.aa=b<<8|this.aa>>8}; +l.save=function(){var a=new Vc(this);switch(this.u.Da){case S.Da:a.set(0,[this.Ca,this.D,this.Ha,this.aa,this.ea,this.ra,this.va]);break;case T.Da:a.set(0,[this.ja,this.K]),a.set(1,[this.L,this.N]),a.set(2,[this.B,this.ba,this.la,this.ka]),a.set(3,[this.X,this.j,this.O,this.da,this.F])}return a.data()}; +l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.u.Da){case S.Da:return this.Ca=b[0],this.D=b[1],this.Ha=b[2],this.aa=b[3],this.ea=b[4],this.ra=b[5],this.va=b[6],!0;case T.Da:return this.ja=b[0],this.K=b[1],b=a[1],this.L=b[0],this.N=b[1],b=a[2],this.B=b[0],this.ba=b[1],this.la=b[2],this.ka=b[3],b=a[3],this.X=b[0],this.j=b[1],this.O=b[2],this.da=b[3],this.F=b[4],!0}return!1};l.start=function(){};l.stop=function(){};l.Vd=function(a,b){var c=this.Ca;E(this,a,null,b,"STATUS0",c,!0);return c}; +l.Wd=function(a,b){var c=this.D;E(this,a,null,b,"STATUS1",c,!0);return c};l.Xd=function(a,b){var c=this.Ha;E(this,a,null,b,"STATUS2",c,!0);return c};l.Ud=function(a,b){var c=this.aa>>8-this.ea&255;E(this,a,null,b,"SHIFT.RESULT",c,!0);return c};l.ee=function(a,b,c){E(this,a,b,c,"SHIFT.COUNT",null,!0);this.ea=b};l.ge=function(a,b,c){E(this,a,b,c,"SOUND1",null,!0);this.ra=b};l.fe=function(a,b,c){E(this,a,b,c,"SHIFT.DATA",null,!0);this.aa=b<<8|this.aa>>8}; l.he=function(a,b,c){E(this,a,b,c,"SOUND2",null,!0);this.va=b};l.ie=function(a,b,c){E(this,a,b,c,"WATCHDOG",null,!0)};function Sd(a){var b=0,c=0,d=~a.X;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} l.Yd=function(a,b){var c=this.K,c=c&~T.La.hc;if((Gc(this.b)&64)<<1&&(c|=T.La.hc,c!=this.K)){var d,e;d=this.O&1;e=this.O>>1&7;switch(e){case T.Ma.Ta.yd:break;case T.Ma.Ta.Jc:this.X=this.X<<1|d;break;case T.Ma.Ta.Qc:d=Sd(this);this.F[d]=T.Ma.Gb;ib(this,"doNVRCommand(): erase data at addr "+u(d));break;case T.Ma.Ta.Kc:this.j=this.j<<1|d;break;case T.Ma.Ta.Gd:d=Sd(this);e=this.j&T.Ma.Gb;this.F[d]=e;ib(this,"doNVRCommand(): write data "+u(e)+" to addr "+u(d));break;case T.Ma.Ta.vd:d=Sd(this);e=this.F[d]; -null==e&&(e=T.Ma.Gb);this.j=e;ib(this,"doNVRCommand(): read data "+u(e)+" from addr "+u(d));break;case T.Ma.Ta.xd:this.j<<=1;this.da=this.j&T.Ma.Gb+1;break;default:ib(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~T.La.ic;this.da&&(c|=T.La.ic);c&=~T.La.cc;if(d=this.I){d=this.I;if(e=d.D)e=d.b,e=Gc(d.b)>=d.L+e.X*e.Ra/1E3*1.2731488;e&&(d.D=!1);d=!d.D}d&&(c|=T.La.cc);c&=~T.La.rc;this.J&&this.J.Ea&1&&(c|=T.La.rc);this.K=c;E(this,a,null,b,"FLAGS",c);return c}; +null==e&&(e=T.Ma.Gb);this.j=e;ib(this,"doNVRCommand(): read data "+u(e)+" from addr "+u(d));break;case T.Ma.Ta.xd:this.j<<=1;this.da=this.j&T.Ma.Gb+1;break;default:ib(this,"doNVRCommand(): unrecognized command "+ca(e))}}c&=~T.La.ic;this.da&&(c|=T.La.ic);c&=~T.La.cc;if(d=this.I){d=this.I;if(e=d.D)e=d.b,e=Gc(d.b)>=d.L+e.X*e.Ra/1E3*1.2731488;e&&(d.D=!1);d=!d.D}d&&(c|=T.La.cc);c&=~T.La.rc;this.J&&this.J.wa&1&&(c|=T.La.rc);this.K=c;E(this,a,null,b,"FLAGS",c);return c}; l.je=function(a,b,c){E(this,a,b,c,"BRIGHTNESS");this.ja=b};l.me=function(a,b,c){E(this,a,b,c,"NVR.LATCH");this.O=b};l.le=function(a,b,c){E(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.B=this.B&-4|a;break;case 1:this.B=this.B&-13|a<<2;this.video&&(b=this.video,a=this.B,ib(b,"updateScrollOffset("+a+")"),b.ib!==a&&((b.ib=a)?Nc(b,!0):b.sb=!0));break;case 2:switch(a){case 0:this.ba=~this.ba;break;case 2:case 3:this.la=3-a}break;case 3:this.ka=a}}; l.ke=function(a,b,c){E(this,a,b,c,"DC011");b&T.Ua.ud?(b&=T.Ua.nc,this.N!=b&&(this.N=b,this.video&&(a=this.video,b=this.N==T.Ua.nc?50:60,ib(a,"updateRate("+b+")"),a.vc=b))):(b&=T.Ua.ac,this.L!=b&&(this.L=b,this.video&&(a=this.L==T.Ua.ac?132:80,b=this.video,ib(b,"updateDimensions("+a+","+(80>>0,g],q=pa(p,k,a.zc);0>q&&p.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.D.push({Lf:b,G:c,$d:d,Da:e,yc:f})}delete this.Da}return!0};Vd.prototype.Ja=function(){return!0}; -function Wd(a,b,c,d){if(d)a.ia("Unable to load system ROM (error "+d+": "+b+")");else{cb(a.hb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Da=e.symbols;if(!a.A.length){w("Empty ROM: "+b);return}if(1==a.A.length){w(a.A[0]);return}}catch(h){a.ia("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, +Vd.prototype.Ga=function(){if(this.Fa){if(this.H){var a=this.H,b=this.id,c=this.B,d=this.j,e=this.Fa,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var p=f,k=[k>>>0,g],q=pa(p,k,a.zc);0>q&&p.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.D.push({Mf:b,G:c,$d:d,Fa:e,yc:f})}delete this.Fa}return!0};Vd.prototype.Ka=function(){return!0}; +function Wd(a,b,c,d){if(d)a.ia("Unable to load system ROM (error "+d+": "+b+")");else{cb(a.hb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Fa=e.symbols;if(!a.A.length){w("Empty ROM: "+b);return}if(1==a.A.length){w(a.A[0]);return}}catch(h){a.ia("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e>>f.ha;0>>= -f.ha;0>>f.ha;0>>= +f.ha;0=n.Eb&&a<=n.Pb?d.u&515||(d.u|=512,ge(d,20,!0),he(d)):a>=n.Jd&&a<=n.z&&d.u&512&&(d.u&=-513,ge(d,20,!1),he(d));return!0},c.onpaste=function(a){a:{if(d.J&&d.J.fb&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(), a=a.clipboardData||window.clipboardData)){ie(d.J,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.w.Ya&&void 0!==this.w.Ya[b])return this.M[e]=c,a=function(a,b){return function(c){c.preventDefault();ge(a,b,!0)}}(this,this.w.Ya[b]),b=function(a,b){return function(){ge(a,b,!1)}}(this,this.w.Ya[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}}return!1}; -be.prototype.Qa=function(a,b,c,d){this.A=a;this.b=c;this.H=d;var e=this;this.O=Kc(this.b,function(){je(e)});this.F=ub(a,"ChipSet");this.J=ub(a,"SerialPort");Gb(b,this,this.w.Kb);Ub(b,this,this.w.Lb)};be.prototype.Fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};be.prototype.Ja=function(a){return a?this.save():!0};W.INIT=[[W.Na.INIT,W.Lc.INIT,!1,0,-1]];l=be.prototype;l.reset=function(){this.j=[];this.u=0;this.w.INIT&&!this.restore(this.w.INIT)&&this.ia("reset error")}; -l.save=function(){var a=new Vc(this);switch(this.w.Ba){case W.Ba:a.set(0,[this.K,this.I,this.D,this.L,-1])}return a.data()};l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.w.Ba){case ee.Ba:return!0;case W.Ba:return this.K=b[0],he(this,this.K&W.Na.ec),this.I=b[1],this.D=b[2],this.L=b[3],this.B=b[4],!0}return!1}; +be.prototype.Qa=function(a,b,c,d){this.A=a;this.b=c;this.H=d;var e=this;this.O=Kc(this.b,function(){je(e)});this.F=ub(a,"ChipSet");this.J=ub(a,"SerialPort");Gb(b,this,this.w.Kb);Ub(b,this,this.w.Lb)};be.prototype.Ga=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};be.prototype.Ka=function(a){return a?this.save():!0};W.INIT=[[W.Na.INIT,W.Lc.INIT,!1,0,-1]];l=be.prototype;l.reset=function(){this.j=[];this.u=0;this.w.INIT&&!this.restore(this.w.INIT)&&this.ia("reset error")}; +l.save=function(){var a=new Vc(this);switch(this.w.Da){case W.Da:a.set(0,[this.K,this.I,this.D,this.L,-1])}return a.data()};l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.w.Da){case ee.Da:return!0;case W.Da:return this.K=b[0],he(this,this.K&W.Na.ec),this.I=b[1],this.D=b[2],this.L=b[3],this.B=b[4],!0}return!1}; function he(a,b){var c;null!=b?a.N=b:b=a.N;for(var d in a.w.tb)if(c="led-"+d,c=a.M[c]){var e=a.w.tb[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+t(16711680,6):"#000000"}if(c=a.M["led-caps-lock"])c.style.backgroundColor=a.u&512?"#"+t(65280,6):"#000000"} function fe(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?1:2;break;case 17:g=f?4:8;break;case 18:g=f?16:32;break;case 91:g=f?64:128;break;case 20:g=512}g&&(a.u=c?a.u|g:a.u&~g);var h;a:if(e=a.w.$b[e]||e,a.w.Nb[e])h=e;else{for(h in a.w.Ya)if(a.w.Ya[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.u&4144&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.u=c?a.u|4096:a.u&-4097)),d=ge(a,h,c),h>=n.Eb&&h<=n.Pb||b.preventDefault());return d} function ge(a,b,c){var d,e;a:{for(e=0;ee?a.j.push({Xb:b,Ub:Date.now(),Hb:d}):(a.j[e].Ub=Date.now(),a.j[e].Hb=d);else if(0<=e){if(!a.j[e].Hb&&(d=a.j[e].Ub)&&50>Date.now()-d)return a.j[e].Hb=!0,je(a),!0;a.j.splice(e,1)}if(a.F){d=0;switch(b){case "1p":d=S.Za.od;break;case "2p":d=S.Za.sd;break;case "coin":d=S.Za.Pc;break;case "left":d=S.Za.qd;break;case "right":d=S.Za.rd;break;case "fire":d=S.Za.pd}d&&(a=a.F,b=d,a.D&=~b,c&&(a.D|=b))}return!0} function je(a){for(var b=0,c=-1;bc||c>e)c=e}else{ge(a,d,!1);b=0;continue}}b++}0<=c&&Lc(a.b,a.O,c)}l.Zd=function(a,b){var c=this.I;0<=this.B&&(this.B>3)*a.aa,!yb(a.w,a.Va,a.O,3)))return!1;a.O?(a.qc=a.F.createImageData(b,c),a.tc=16/a.Wa|0,pe(a,a.O>>1)):pe(a,(a.ba+1)*a.va);a.K=document.createElement("canvas");a.K.width=b;a.K.height=c;a.rb=a.K.getContext("2d");a.ea={};a.la=1<=a.kc?8:16,f=8>(7>4)*c)}return k}ke.prototype.Fa=function(){return!0};ke.prototype.oa=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Ob[b]=c,!0;switch(b){case "fullScreen":return this.M[b]=c,this.j&&this.j.kb?c.onclick=function(){d.kb()}:c.parentNode.removeChild(c),!0}return!1}; +a.Ha=Array(a.ba));return!0}ke.prototype.Qa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.H=d;Td(this);if(this.I=ub(a,"Keyboard")){for(var e in this.Ob)this.I.oa("led",e,this.Ob[e]);this.L&&this.I.oa(this.Rd?"textarea":"canvas","kbd",this.ka)}var f=this;this.xc=Kc(this.b,function(){Nc(f)});Lc(this.b,this.xc,1E3/Math.max(this.wc,this.Xa));this.uc=0;this.da||F(this)}; +function oe(a,b,c,d){if(d)a.ia("Unable to load font ROM (error "+d+": "+b+")");else{cb(a.hb,b,c);try{var e=eval("("+c+")"),f=e.bytes||e;if(!f||!f.length){w("Empty font ROM: "+b);return}if(1==f.length){w(f[0]);return}if(2048==f.length)a.Ca=f,Ud(a);else{a.ia("Unrecognized font data length ("+f.length+")");return}}catch(g){a.ia("Font ROM data error: "+g.message);return}(a.F||a.H)&&F(a)}} +function Ud(a){a.Ca&&(a.oc=2==a.ra,a.ea[96]=[qe(a,a.qa,a.ma),qe(a,a.qa,a.ma,a.ub)],a.ea[64]=[qe(a,2*a.qa,a.ma),qe(a,2*a.qa,a.ma,a.ub)],a.ea[32]=a.ea[0]=[qe(a,2*a.qa,2*a.ma),qe(a,2*a.qa,2*a.ma,a.ub)])} +function qe(a,b,c,d){var e=8>=a.kc?8:16,f=8>(7>4)*c)}return k}ke.prototype.Ga=function(){return!0};ke.prototype.oa=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.Ob[b]=c,!0;switch(b){case "fullScreen":return this.M[b]=c,this.j&&this.j.kb?c.onclick=function(){d.kb()}:c.parentNode.removeChild(c),!0}return!1}; ke.prototype.kb=function(){var a=!1;if(this.j){if(this.j.kb){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.X/this.N;b>c&&(a=Math.round(c/b*100)+"%")}this.pc?(this.L.style.width=a,this.L.style.width=a,this.L.style.display="block",this.L.style.margin="auto"):(this.j.style.width=a,this.j.style.height="auto");this.j.style.backgroundColor="black";this.j.kb();a=!0}this.ka&&this.ka.focus()}return a}; function ne(a,b){!b&&a.j&&(a.pc?a.L.style.width=a.L.style.height="":a.j.style.width=a.j.style.height="");ib(a,"notifyFullScreen("+b+")")}function pe(a,b){a.sc=b;a.ja=!1;if(void 0===a.D||a.D.length!=a.sc)a.D=Array(a.sc)}function re(a,b,c,d,e){d=a.u?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ra&&(208<=c&&236>c?e=a.la+0:28<=c&&72>c&&(e=a.la+1));a=a.ga[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Nc(a,b){var c=!0;if(!b){a.Xa&&(120==a.Xa?a.uc&1?(Jd(a.b,2),c=!1):Jd(a.b,1):Jd(a.b,4));if(c&&a.ja&&a.O){for(var d=a.w,e=a.O,f=!0,g=a.Va>>>d.ha;0>=1);;){var v=Bb(a.w,p++);if(127==(v&127)){var r=Bb(a.w,p++),d=r&96,c=(r&15)<<8|Bb(a.w,p),c=c+ -(r&16?8192:16384);break}if(m>4)*v.ma,C,U,ea,Y,va=v.qa,Hb=v.ma;z?(C=y*r.qa,U=e*r.ma,ea=r.qa,Y=r.ma):(C=y*r.lc,U=e*r.mc,ea=r.lc,Y=r.mc);v.qa>r.qa&&(C*=2,ea*=2);v.ma>r.ma&&(q||(H+=r.ma),Hb=r.ma);z?z.drawImage(v.canvas,ha,H,va,Hb,C,U,ea,Y):(C+=0,U+=0,r.F.drawImage(v.canvas, +function Nc(a,b){var c=!0;if(!b){a.Xa&&(120==a.Xa?a.uc&1?(Jd(a.b,2),c=!1):Jd(a.b,1):Jd(a.b,4));if(c&&a.ja&&a.O){for(var d=a.w,e=a.O,f=!0,g=a.Va>>>d.ha;0>=1);;){var v=Bb(a.w,p++);if(127==(v&127)){var r=Bb(a.w,p++),d=r&96,c=(r&15)<<8|Bb(a.w,p),c=c+ +(r&16?8192:16384);break}if(m>4)*v.ma,C,U,ea,Y,va=v.qa,Hb=v.ma;z?(C=y*r.qa,U=e*r.ma,ea=r.qa,Y=r.ma):(C=y*r.lc,U=e*r.mc,ea=r.lc,Y=r.mc);v.qa>r.qa&&(C*=2,ea*=2);v.ma>r.ma&&(q||(H+=r.ma),Hb=r.ma);z?z.drawImage(v.canvas,ha,H,va,Hb,C,U,ea,Y):(C+=0,U+=0,r.F.drawImage(v.canvas, ha,H,va,Hb,C,U,ea,Y))}h++}g++}e++}}a.ja=!0;!b&&a.sb&&1==h&&(a.D[k]=-1,h=0);a.sb=!1;(h||b)&&a.rb&&a.F.drawImage(a.K,0,a.ib,a.J,a.aa-a.ma,0,0,a.Ic,a.Ld)}else{e=a.Va;f=e+a.O;k=h=g=0;b=a.J;m=0;c=a.aa;q=d=0;p=a.Wa;y=(1<>8|(r&255)<<8);h>z&y,re(a,a.qc,h++,k,ha),z+=p;h>m&&(m=h);k=d&&(d=k+1)}e+=2;g++;if(h>=a.J&&(h=0,k++,k>a.aa))break}a.ja=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=xa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= (a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Wa.aspect);f&&.3<=f&&3.33>=f&&(Na("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");Da("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new ke(d,e,g,f,c);gb(d,c)}}); -function se(a){this.da=+a.adapter;switch(this.da){case 0:this.ea=0;this.ja=2;break;default:w("Unrecognized serial adapter #"+this.da);return}this.j=this.B=null;this.ga=a.tabSize;this.ba=a.charBOL;this.D=0;this.X=!1;x.call(this,"SerialPort",a,se,8388608);var b=a.binding;if("console"==b)this.B="";else{var c;a=te;b&&(void 0===c&&(c="Panel"),(c=fb(c,this.id))&&(b=c.M[b])&&this.oa(null,a,b))}this.I="";this.u=this.fb=null;this.exports={connect:this.Ec,receiveData:this.Wb}}A(se); -var ue=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],ve=[!1,0,0,133,142,39,238],te="buffer";l=se.prototype; +function se(a){this.da=+a.adapter;switch(this.da){case 0:this.ea=0;this.ja=2;break;default:w("Unrecognized serial adapter #"+this.da);return}this.j=this.B=null;this.ga=a.tabSize;this.ba=a.charBOL;this.D=0;this.X=!1;x.call(this,"SerialPort",a,se,8388608);var b=a.binding;if("console"==b)this.B="";else{var c;a=te;b&&(void 0===c&&(c="Panel"),(c=fb(c,this.id))&&(b=c.M[b])&&this.oa(null,a,b))}this.I="";this.u=this.fb=this.Aa=null;this.exports={connect:this.Ec,receiveData:this.Wb,receiveStatus:this.oe}} +A(se);var ue=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],ve=[!1,0,0,133,142,39,238],te="buffer";l=se.prototype; l.oa=function(a,b,c,d){var e=this;switch(b){case te:return this.M[b]=this.j=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=na(b[0]);if(c!=this.gb)return;b=na(b[1]);if(this.u=eb(b)){var d=this.u.exports;if(d){var e=d.connect;e&&e.call(this.u);if(this.fb=d.receiveData){this.status(this.hb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};l.Fa=function(a,b){if(!b)if(this.Ec(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -l.Ja=function(a){return a?this.save():!0};l.reset=function(){ze(this)};l.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.K;c[b++]=this.O;c[b++]=this.aa;c[b++]=this.Ea;c[b++]=this.J;c[b++]=this.N;c[b]=this.L;a.set(0,c);return a.data()};l.restore=function(a){return ze(this,a[0])};function ze(a,b){var c=0;b||(b=ve);a.K=b[c++];a.O=b[c++];a.aa=b[c++];a.Ea=b[c++];a.J=b[c++];a.N=b[c++];a.L=b[c];return!0} -function Ae(a,b){var c=a.L&b;b&15||(c>>=4);b=ue[c];c=((a.J&12)>>2)+6;a.J&16&&c++;c+=((a.J&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function we(a,b){ib(a,"receiveByte("+ca(b)+"), status="+ca(a.Ea));return a.X||a.Ea&2?!1:(a.O=b,a.Ea|=2,Jd(a.b,a.ja),!0)}l.Wb=function(a){null!=a&&(this.I="number"!=typeof a?a:this.I+String.fromCharCode(a));this.I&&(we(this,this.I.charCodeAt(0))&&(this.I=this.I.substr(1)),this.I&&this.b&&Lc(this.b,this.ka,Ae(this,15)));return!0}; -function ie(a,b){a.Ea|=5;b&&a.fb&&a.fb.call(a.u,b)}l.Td=function(a,b){var c=this.O;E(this,a,null,b,"DATA",c);this.Ea&=-3;return c};l.Sd=function(a,b){var c=this.Ea;E(this,a,null,b,"STATUS",c);return c}; -l.de=function(a,b,c){E(this,a,b,c,"DATA");this.aa=b;this.Ea&=-6;ib(this,"transmitByte("+ca(b)+")");if(19==b)this.X=!0;else if(17==b)this.X=!1;else if(this.fb&&this.fb.call(this.u,b),this.j)8==b?(this.j.value=this.j.value.slice(0,-1),0":String.fromCharCode(b),c=a.length,9==b?(b=this.ga||8,c=b-this.D%b,this.ga&&(a=ma("",c))):13==b&&(this.D=c=0,a="\n"),this.ba&&!this.D&&c&&(a=String.fromCharCode(this.ba)+a),this.j.value+=a,this.j.scrollTop=this.j.scrollHeight, -this.D+=c);else if(null!=this.B){if(10==b||1024<=this.B.length)this.g(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b))}this.b&&Lc(this.b,this.la,Ae(this,240))};l.ce=function(a,b,c){E(this,a,b,c,"CONTROL");this.K?(this.N=b,this.N&64&&(this.K=!1)):(this.J=b,this.K=!0)};l.be=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.L=b};var xe={0:se.prototype.Td,1:se.prototype.Sd},ye={0:se.prototype.de,1:se.prototype.ce,2:se.prototype.be}; +l.Ec=function(){if(!this.u){var a=oc(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=na(b[0]);if(c!=this.gb)return;b=na(b[1]);if(this.u=eb(b)){var d=this.u.exports;if(d){var e=d.connect;e&&e.call(this.u);this.fb=d.receiveData;this.Aa=d.receiveStatus;if(this.fb){this.status(this.hb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};l.Ga=function(a,b){if(!b)if(this.Ec(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +l.Ka=function(a){return a?this.save():!0};l.reset=function(){ze(this)};l.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.L;c[b++]=this.O;c[b++]=this.aa;c[b++]=this.wa;c[b++]=this.J;c[b++]=this.K;c[b]=this.N;a.set(0,c);return a.data()};l.restore=function(a){return ze(this,a[0])};function ze(a,b){var c=0;b||(b=ve);a.L=b[c++];a.O=b[c++];a.aa=b[c++];a.wa=b[c++];a.J=b[c++];a.K=b[c++];a.N=b[c];return!0} +function Ae(a,b){var c=a.N&b;b&15||(c>>=4);b=ue[c];c=((a.J&12)>>2)+6;a.J&16&&c++;c+=((a.J&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function we(a,b){ib(a,"receiveByte("+ca(b)+"), status="+ca(a.wa));return a.X||a.wa&2?!1:(a.O=b,a.wa|=2,Jd(a.b,a.ja),!0)}l.Wb=function(a){null!=a&&(this.I="number"!=typeof a?a:this.I+String.fromCharCode(a));this.I&&(we(this,this.I.charCodeAt(0))&&(this.I=this.I.substr(1)),this.I&&this.b&&Lc(this.b,this.ka,Ae(this,15)));return!0}; +l.oe=function(a){this.wa&=-129;a&64&&(this.wa|=128)};function ie(a,b){a.wa|=5;b&&a.fb&&a.fb.call(a.u,b)}l.Td=function(a,b){var c=this.O;E(this,a,null,b,"DATA",c);this.wa&=-3;return c};l.Sd=function(a,b){var c=this.wa;E(this,a,null,b,"STATUS",c);return c}; +l.de=function(a,b,c){E(this,a,b,c,"DATA");this.aa=b;this.wa&=-6;ib(this,"transmitByte("+ca(b)+")");if(19==b)this.X=!0;else if(17==b)this.X=!1;else if(this.fb&&this.fb.call(this.u,b),this.j)8==b?(this.j.value=this.j.value.slice(0,-1),0":String.fromCharCode(b),c=a.length,9==b?(b=this.ga||8,c=b-this.D%b,this.ga&&(a=ma("",c))):13==b&&(this.D=c=0,a="\n"),this.ba&&!this.D&&c&&(a=String.fromCharCode(this.ba)+a),this.j.value+=a,this.j.scrollTop=this.j.scrollHeight, +this.D+=c);else if(null!=this.B){if(10==b||1024<=this.B.length)this.g(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b))}this.b&&Lc(this.b,this.la,Ae(this,240))};l.ce=function(a,b,c){E(this,a,b,c,"CONTROL");this.L?(this.Aa&&(b^this.K)&34&&this.Aa(0|(b&32?32:0)|(b&2?320:0)),this.K=b,this.K&64&&(this.L=!1)):(this.J=b,this.L=!0)};l.be=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.N=b};var xe={0:se.prototype.Td,1:se.prototype.Sd},ye={0:se.prototype.de,1:se.prototype.ce,2:se.prototype.be}; Oa(function(){for(var a=D(document,"pc8080","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Be.prototype.Sb=function(){return-1};Be.prototype.Tb=function(){}; Be.prototype.Jb=function(a,b,c){if(b)if(a){0>this.j&&this.u.length&&(this.j=0);if(0>this.j||a!=this.u[this.j])this.u.splice(0,0,a),this.j=0;this.j--}else this.O?a="end":a=this.u[this.j+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; function De(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; @@ -193,7 +193,7 @@ function Ee(a,b,c){var d;if(b){b=Fe(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.spli d))}return d}function Fe(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=Ee(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?Ie(a,e):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.aa-a.ra}if(null==d)break;b=b.replace(c[0],d.toString())}return b} function Ge(a,b,c,d){var e;null!=b?(e=a.Sb(b),0<=e?e=a.Tb(e):(e=a.da[b],null==e&&(e=aa(b,a.Wa))),null!=e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e} function He(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4>=1;g=p+g;d>>=8}d=t(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function Je(a,b){if(b)return He(a,b,a.da[b]);var c=0;for(b in a.da)He(a,b,a.da[b]),c++;return 0>>d.w.ha;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;k--;){var p=b[e];p.type==c?m++||d.g("..."):(c=p.type,m=Ab[c],p&&d.g(t(p.id)+" %"+t(e<>>d.w.ha;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;k--;){var p=b[e];p.type==c?m++||d.g("..."):(c=p.type,m=Ab[c],p&&d.g(t(p.id)+" %"+t(e<>>e.ha;f!=e.w?e.W[g].Zb(f,b&65535,d):(e.W[g++].Db(f,b&255,d),e.W[g&e.D].Db(0,b>>8&255,d+1));c&&We(a,c);Ec(this.b,!0)}};function X(a){return{G:a,Pa:!1}}function wf(a){return[a.G,a.Pa]}function xf(a){return{G:a[0],Pa:a[1]}} -function Ve(a,b,c){var d;c=(c?a.L:a.Va).G;if(void 0!==b){d=b=Fe(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=sa(Se,a.substr(b,1))));return c};function Af(a,b){var c=0;a=a.Tb(b);if(void 0!==a)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 6:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?t(a,c):"??"} l.Tb=function(a){var b;if(0<=a){var c=this.b;switch(a){case 7:b=c.i;break;case 0:b=c.R;break;case 1:b=c.S;break;case 8:b=Wc(c);break;case 2:b=c.T;break;case 3:b=c.U;break;case 9:b=Yc(c);break;case 4:b=c.V;break;case 5:b=c.Y;break;case 10:b=J(c);break;case 6:b=c.Z(J(c));break;case 11:b=c.na;break;case 12:b=c.P;break;case 13:b=Uc(c);break;case 14:b=Uc(c)&255|c.i<<8}}return b}; @@ -216,39 +216,39 @@ function Bf(a,b){b=Fe(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.Sb(b,c+1 ' "'+zf(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}l.message=function(a,b){b&&(a+=" at "+Z(X(this.b.P).G));this.sa&1073741824?this.la.push(a):this.ka&&a==this.ka||(this.ka=a,this.sa&-2147483648&&(this.pa(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Mc(a),a.O=0,Ec(a)))}; function hb(a,b,c,d,e,f,g,h){h|=256;null!=f&&(a.sa&h)!=h||a.message(b.gb+"."+(null!=d?"outPort":"inPort")+"("+u(c)+","+(f?f:"unknown")+(null!=d?","+ca(d):"")+")"+(null!=g?": "+ca(g):"")+(null!=e?" at "+Z(e):""))} function Ne(a){var b;if(Kd(a)){if(!a.K||!a.K.length){a.K=Array(1E3);for(b=0;b>>d.ha],!1)}a.N=["br"];if(a.B)for(b=1;b>>d.ha],!0);a.B=["bw"];a.Xa=0}l.$a=function(a,b,c){var d=!0;c||Gf(this,a,b,!1,!0);if(a!=this.F){var e=Ue(b);if(-1===e)this.g("invalid address: "+Z(b.G)),d=!1;else{var f=this.w;f.W[e>>>f.ha].$a(e&f.w,a==this.B)}}d&&(a.push(b),c?b.Pa=!0:(Hf(this,a,a.length-1,"set"),Ne(this)));return d}; function Gf(a,b,c,d,e){var f=!1;c=Ue(c);for(var g=1;g>>d.ha],b==a.B));h.Pa||Ne(a);break}}return f}function If(a,b){for(var c=1;c>24,4);break;case 3:z=t(v.bb(z,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?z="["+z+"]":r&16||(z=(v.style==Le?"$":"0x")+z);v=z}else r&16?(v= +function jc(a,b,c,d,e){var f=!1;if(!a.Xa++)for(var g=1;!f&&g>24,4);break;case 3:z=t(v.bb(z,2),4);break;default:v="imm("+u(r)+")";break a}8086==v.style&&r&64?z="["+z+"]":r&16||(z=(v.style==Le?"$":"0x")+z);v=z}else r&16?(v= (q&3840)>>8,r=Se[v],8086==a.style&&q&64&&(6==v&&(r="HL"),r="["+r+"]"),v=r):r&128&&(v=(f>>3&7).toString());if(!v||!v.length){h="INVALID";break}0b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.$d;if(e>=g&&e>>0;for(b=0;b>>0,h=f.$d;if(e>=g&&e>8&255;case "C":d.S=f&255;break;case "D":d.T=f&255;break; -case "DE":d.T=f>>8&255;case "E":d.U=f&255;break;case "H":d.V=f&255;break;case "HL":d.V=f>>8&255;case "L":d.Y=f&255;break;case "SP":d.na=f&65535;break;case "PC":I(d,f);a.L=X(d.P);break;case "PS":Sc(d,f);break;case "PSW":Sc(d,f&255|d.ta&-256);d.i=f>>8;break;case "CF":d.ca=f?d.ca|256:d.ca&255;break;case "PF":f?cd(d)||(d.fa^=1):cd(d)&&(d.fa^=1);break;case "AF":d.xa=f?~d.fa&16|d.xa&-17:d.fa&16|d.xa&-17;break;case "ZF":d.ca=f?d.ca&-256:d.ca|255;break;case "SF":f?fd(d)||(d.fa^=192):fd(d)&&(d.fa^=192);break; +case "DE":d.T=f>>8&255;case "E":d.U=f&255;break;case "H":d.V=f&255;break;case "HL":d.V=f>>8&255;case "L":d.Y=f&255;break;case "SP":d.na=f&65535;break;case "PC":I(d,f);a.L=X(d.P);break;case "PS":Sc(d,f);break;case "PSW":Sc(d,f&255|d.ta&-256);d.i=f>>8;break;case "CF":d.ca=f?d.ca|256:d.ca&255;break;case "PF":f?cd(d)||(d.fa^=1):cd(d)&&(d.fa^=1);break;case "AF":d.ya=f?~d.fa&16|d.ya&-17:d.fa&16|d.ya&-17;break;case "ZF":d.ca=f?d.ca&-256:d.ca|255;break;case "SF":f?fd(d)||(d.fa^=192):fd(d)&&(d.fa^=192);break; case "IF":d.ta=f?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}Ec(d);a.g("updated registers:")}a.g(Nf(a));c&&(a.L=X(d.P),Ef(a,Z(a.L.G)))}}function Uf(a,b){b=na(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Bf(a,c[2])):Ee(a,b,!0)}function Vf(a,b,c){var d="t"!=b;c=Ge(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ea(c,function(){return kb(a,!0)&&a.ob(e,d,!1)},function(){Ec(a.b);kb(a,!1)})} function Ef(a,b,c,d){if(b=Ve(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Ve(a,c,!0);if(!d||d.Gh[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.g(m)}h[3]&&(g=h[3],f=null);f=Kf(a,b,g,f);a.g(f);a.L=b;e-=b.G-k;c++}}} l.Jb=function(a,b,c){if(b)if(a){0>this.j&&this.u.length&&(this.j=0);if(0>this.j||a!=this.u[this.j])this.u.splice(0,0,a),this.j=0;this.j--}else this.O?a="end":a=this.u[this.j+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b}; function Jf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.O&&(a.g("ended assemble at "+Z(a.ba.G)),a.L=a.ba,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ka=null;if(mb(a)&&0m||"z"Ha.length&&(a.g("note: only "+Ha.length+" available"),ja=Ha.length);wa-=ja;0>wa&&(null==Ha[Ha.length-1].G?(ja=wa+ja,wa=0):wa+=Ha.length);var od=[];"call"==bf&&(Lb=1E5,od=["CALL"]);for(void 0!==af&&a.g(ja+" instructions earlier:");0< Lb&&wa!=a.ea;){var ef=Ha[wa++];if(null==ef.G)break;var Mb=X(ef.G),ng=ja--,ff=Kf(a,Mb,"history",ng);(!od.length||0<=ff.indexOf(od[0]))&&a.g(ff);Mb.Rb&&(wa+=Mb.Rb,Lb-=Mb.Rb,ja-=Mb.Rb);wa>=Ha.length&&(wa=0);a.ib=ja;df++;Lb--}}df||(a.g("no "+cf+"history available"),a.ib=void 0)}else{var rc=Ve(a,Y);if(rc){var sc=0;va&&("l"==va.charAt(0)&&(va=va.substr(1)||Hb),sc=Ge(a,va)>>>0,65536>4||1;og--&&0wc?String.fromCharCode(wc):".";uc--}Nb&&(Nb+="\n");Nb+=Y+" "+qd+(Ob?"":" "+gf)}Nb&&a.g(Nb);a.Va=rc}}}}break;case "e":if("else"==f[0])break;var xc=1,hf=255,jf=a.Z,kf=a.ua;"ew"==f[0]&&(xc=2,hf=65535,jf=a.bb,kf=a.Mb);var lf=xc<<1,mf=f[1];if(null==mf)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a"); else{var yc=Ve(a,mf);if(yc)for(var zc=2;zcxd;){for(var $a=null,ug=256;65536>Rb.G>>>0;){of.G=a.bb(Rb,2);if(null==Rb.G||!ug--)break;for(var vg=a,Bc=of,pf= null,Sb=Bc.G,qf=Sb,yd=1;6>=yd&&Sb;yd++){if(2\nLicense: GPL version 3 or later ");for(b=0;b\nLicense: GPL version 3 or later ");for(b=0;bZf){if(ag(d,this.K)){this.B=new Vc(this,"1.30.5","failsafe");ag(this.B)&&(fg(this,d),a=2,gg(this.B));this.B.set("timestamp",ra());hg(this.B);var e=this.A&&!this.I;if(1==a||ya("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=eg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ag(d,g):("error"== f&&"no machine state"!=g?(this.ia("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.j=null)):this.g(f+": "+g),gg(d),ag(d)?(c=eg(d),e=!0):c=!1))}e&&dg(this,c?d:null)}else 2==a&&d.clear()}else dg(this);delete this.K;delete this.L}e=db(this.id);for(f=0;fa[1];a=a[2];this.ga=!0;this.C.wa=!0;var d=this.M.power;d&&(d.textContent="Shutdown");this.b&&(ig(this,this.b,b,c,a),this.b.vb());this.X&&(fg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.u=0}; +function ig(a,b,c,d,e){if(!b.C.xa){b.C.xa=!0;if(b.Ga){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ga(f,d)&&f&&(w("Unable to restore state for "+b.type),a.O&&!a.aa?(c.clear(),a.A=Zf,window&&window.location.reload()):a.X=!0,b.Ga(null),e=!1)}if(!d&&b.jc)for(a=b.jc.split("|"),c=0;ca[1];a=a[2];this.ga=!0;this.C.xa=!0;var d=this.M.power;d&&(d.textContent="Shutdown");this.b&&(ig(this,this.b,b,c,a),this.b.vb());this.X&&(fg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.u=0}; function fg(a,b){if(ya("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.j||"";b=b.toString();var d={app:"PC8080",ver:"1.30.5"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;ta("http://www.pcjs.org/api/v1/report",d,!0)}} -function Wf(a,b,c){var d,e="none";if(a.u)return null;a.u--;var f=new Vc(a,"1.30.5"),g=new Vc(a,"1.30.5","validate"),h=ra();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",xa());a.b&&a.b.Ja&&(c&&a.b.pa(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.wa=!1,!1===d&&(e=null)));for(var h=db(a.id),k=0;k":62,"?":63,"@":64,Wa:65,Sb:66,Ub:67,sb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,ub:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87, -Mc:88,Nc:89,kb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,De:98,Ee:99,d:100,e:101,Fe:102,Ge:103,He:104,Ie:105,Je:106,k:107,Ke:108,Le:109,n:110,Me:111,p:112,q:113,r:114,Ne:115,t:116,Oe:117,Pe:118,Qe:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Wd:127}; +var l,m={ud:0,xd:1,yd:2,zd:3,Ad:4,Bd:5,Cd:6,Dd:7,Ed:8,Fd:9,Gd:10,Hd:11,Id:12,Jd:13,Kd:14,Ld:15,Md:16,Nd:17,Od:18,Pd:19,Qd:20,Rd:21,Sd:22,Td:23,Ud:24,Vd:25,Wd: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,Wa:65,Sb:66,Ub:67,sb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,ub:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87, +Mc:88,Nc:89,kb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,Ee:98,Fe:99,d:100,e:101,Ge:102,He:103,Ie:104,Je:105,Ke:106,k:107,Le:108,Me:109,n:110,Ne:111,p:112,q:113,r:114,Oe:115,t:116,Pe:117,Qe:118,Re:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Xd:127}; function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",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"},ka=Date.now||function(){return+new Date};function la(){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 ma(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 k="",n;for(n in b)b.hasOwnProperty(n)&&(k&&(k+="&"),k+=n+"="+encodeURIComponent(b[n]));k=k.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}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 na(a,b){var c,d={Z:null,va:null,Da:null,wa: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.Da=g.load;d.wa=g.exec;if(e=g.bytes)d.Z=e;else if(e=g.words)for(d.Z=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.Z=Array(4*e.length),f=c=0;c>8&255,d.Z[f++]=e[c]>>16&255,d.Z[f++]=e[c]>>24&255;else d.Z=g;d.va=g.symbols;d.Z.length?1==d.Z.length&&(q(d.Z[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("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.Ea=g.load;d.xa=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c>8&255,d.aa[f++]=e[c]>>16&255,d.aa[f++]=e[c]>>24&255;else d.aa=g;d.wa=g.symbols;d.aa.length?1==d.aa.length&&(q(d.aa[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ya=this.id:(this.ya=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,ab:!1,lb:!1,X:!1,error:!1};this.eb=null;this.j.error=!1;this.v={};this.M=null;u.push(this)}var Fa=void 0,Ga={}; +za("onpageshow",function(){xa=!0;Ba(va.show)});za(ua("Opera")||ua("iOS")?"onunload":"onbeforeunload",function(){Ba(va.exit)});function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ab=b.comment;this.Sc=b;b=this.id.indexOf(".");0>b?this.Ya=this.id:(this.za=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,ab:!1,lb:!1,Y:!1,error:!1};this.eb=null;this.j.error=!1;this.v={};this.M=null;u.push(this)}var Fa=void 0,Ga={}; if(window){Fa||(Fa=window.location.search.substr(1));for(var Ha,Ia=/\+/g,Ja=/([^&=]+)=?([^&]*)/g;Ha=Ja.exec(Fa);)Ga[decodeURIComponent(Ha[1].replace(Ia," "))]=decodeURIComponent(Ha[2].replace(Ia," "))}function Ka(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function w(a,b){b||(b=r);a.prototype=Ka(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var La=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else La={},u=[];function Ma(a,b,c){La[a]&&b&&(La[a][b]=c)}function Ca(a,b,c){b||q((c?c+": ":"")+a)} function Na(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.i&&(this.i=10);15>2;this.f=this.c-1;this.h=this.s/this.c|0;this.m=this.h-1;this.l=[];this.w=[];this.A=[];this.B=[];a=new D;Za(a,this.M);this.b=Array(this.h);for(b=0;b>>a.i;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.Ra)return h.ib+=h.Ra-e,h.Ra=e,!0;if(e>=h.Ra+h.ib){n=h.size-(e-k);n>f&&(n=f);h.ib=e-h.Ra+n;e=k+a.c;f-=n;g++;continue}}return ab(1,e,f)}e=new D(e,n,a.c,d);Za(e,a.M,h);a.b[g++]=e;e=k+a.c;f-=n}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+bb[d]+" at "+p(b,4,!0)),!0):ab(2,b,c)}Ya.prototype.J=function(a){return this.b[(a&this.g)>>>this.i].Ua(a&this.f,a)}; -function cb(a,b){return a.b[(b&a.g)>>>a.i].hb(b&a.f,b)}function db(a,b){var c=b&a.f,d=(b&a.g)>>>a.i;return c!=a.f?a.b[d].qd(c,b):a.b[d++].Ua(c,b)|a.b[d&a.m].Ua(0,b+1)<<8}Ya.prototype.aa=function(a,b){this.b[(a&this.g)>>>this.i].Va(a&this.f,b&255,a)};function eb(a,b,c){a.b[(b&a.g)>>>a.i].Nb(b&a.f,c&255,b)}function fb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.i;d!=a.f?a.b[e].rd(d,c&65535,b):(a.b[e++].Va(d,c&255,b),a.b[e&a.m].Va(0,c>>8&255,b+1))} -function gb(a){for(var b=0,c=[],d=0;d>>a.i].hb(b&a.f,b)}function db(a,b){var c=b&a.f,d=(b&a.g)>>>a.i;return c!=a.f?a.b[d].qd(c,b):a.b[d++].Ua(c,b)|a.b[d&a.m].Ua(0,b+1)<<8}Ya.prototype.ba=function(a,b){this.b[(a&this.g)>>>this.i].Va(a&this.f,b&255,a)};function eb(a,b,c){a.b[(b&a.g)>>>a.i].Nb(b&a.f,c&255,b)}function fb(a,b,c){var d=b&a.f,e=(b&a.g)>>>a.i;d!=a.f?a.b[e].sd(d,c&65535,b):(a.b[e++].Va(d,c&255,b),a.b[e&a.m].Va(0,c>>8&255,b+1))} +function gb(a){for(var b=0,c=[],d=0;d>1),this.a=new Int32Array(this.i,0,c>>2),qb(this,mb?rb:sb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},B:function(a){return this.a[a>> -2]>>>((a&3)<<3)&255},H:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},R: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.na=!0},u:function(a,b){return this.hb(a,b)},G:function(a,b){return this.Kb(a,b)},N:function(a,b,c){this.c||this.Nb(a,b,c)},U:function(a, -b,c){this.c||this.W(a,b,c)},s:function(a){return this.b[a]},A:function(a){return this.b[a]},F:function(a){return this.v.getUint16(a,!0)},L:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.h[a>>1]},I:function(a,b){this.b[a]=b;this.na=!0},P:function(a,b){this.b[a]=b;this.na=!0},V:function(a,b){this.v.setUint16(a,b,!0);this.na=!0},ya:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.h[a>>1]=b;this.na=!0}};function Za(a,b,c){a.M=b;a.f=a.g=0;c&&((a.f=c.f)&&ub(a,vb,!1),(a.g=c.g)&&wb(a,vb,!1))} -function wb(a,b,c){c&&a.g||(a.Va=!a.c&&b[1]||a.m,a.rd=!a.c&&b[3]||a.o);if(c||void 0===c)a.Nb=b[1]||a.m,a.W=b[3]||a.o}function ub(a,b,c){c&&a.f||(a.Ua=b[0]||a.l,a.qd=b[2]||a.w);if(c||void 0===c)a.hb=b[0]||a.l,a.Kb=b[2]||a.w}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[D.prototype.B,D.prototype.R,D.prototype.H,D.prototype.Y],vb=[D.prototype.u,D.prototype.N,D.prototype.G,D.prototype.U]; -if(Ua)var sb=[D.prototype.s,D.prototype.I,D.prototype.F,D.prototype.V],rb=[D.prototype.A,D.prototype.P,D.prototype.L,D.prototype.ya];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.la=a.cycles||b;this.I=c;this.Ha=Math.round(this.la/1E4)/100;this.V=this.Ha*this.I;this.j.oa=!1;this.j.Lb=!1;this.j.Sa=a.autoStart;this.j.Eb=!1;this.j.bb=!1;this.ta=this.W=0;this.ua=a.csStart;this.Y=a.csInterval;this.ia=a.csStop;this.F=[];this.$a=this.ob.bind(this);B(this)}w(yb);var zb=["power","reset"]; -l=yb.prototype;l.qa=function(a,b,c,d){this.w=a;this.i=b;this.M=d;for(b=0;ba.P/a.V&&(b=1);a.I=b;b=a.Ha*a.I;if(a.V!=b){a.V=b;b=a.V.toFixed(2)+"Mhz";var d=a.v.setSpeed;d&&(d.textContent=b);a.da("target speed: "+b)}c&&a.w&&Ib(a.w)}a.G+=a.N;a.N=0;a.H=ka();a.R=0;Gb(a)}function Jb(a,b){var c=a.F.length;a.F.push([-1,b]);return c}function Kb(a,b,c){0<=b&&ba.F[b][0]&&(c*=a.la*a.I/1E3,a.F[b][0]=c+Lb(a))}function Lb(a,b){var c=a.U-=a.a;a.a=0;b&&(a.U=0);return c} -l.ob=function(a){if(Ra(this,!0)){if(!this.j.oa){Fb(this);this.w&&this.w.start(this.H,Hb(this));this.j.oa=!0;this.j.Lb=!0;this.L&&this.L.start();var b=this.v.run;b&&(b.textContent="Halt");this.w&&(this.w.Fa(!0),a&&Ib(this.w,!0))}this.Ia>=this.la&&Gb(this,!0);this.pa=0;this.sa=ka();this.R&&(a=this.sa-this.R,a>this.Pa&&(this.H+=a,this.H>this.sa&&(this.H=this.sa)));try{do{for(var c,d=this.j.bb?1:this.Aa,e=this.F.length-1;0<=e;e--){var f=this.F[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Mb(c);c=Lb(this,!0); -this.pa+=c;this.N+=c;a=c;this.j.bb&&(b=!1,this.ta=this.ta+this.Hb()|0,this.W-=a,0>=this.W&&(this.W+=this.Y,b=!0),0<=this.ia&&this.ia<=Hb(this)&&(this.Y=this.ia=-1,Cb(this),Eb(this),b=!0),b&&this.da(Hb(this)+" cycles: checksum="+p(this.ta)));a=c;for(var g=this.F.length-1;0<=g;g--){var h=this.F[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.ka-=c;if(0>=this.ka){this.ka+=this.Aa;15<=++this.Qa&&(this.w&&this.w.Fa(),this.Qa=0);break}}while(this.j.oa)}catch(k){Eb(this);Db(this);this.w&&this.w.stop(ka(), -Hb(this));Ra(this,!1);c=k.stack||k.message;this.j.error=!0;this.K(c);return}c=setTimeout;d=this.$a;this.R=ka();e=this.Pa;this.pa&&(e=Math.round(e*this.pa/this.Aa));e-=this.R-this.sa;if(f=this.R-this.H)this.P=Math.round(this.N/(10*f))/100,864E5<=f&&(this.G=0,Fb(this));if(0>e||this.Pe&&(this.H-=e),e=0;this.Ia+=this.pa;this.R+=e;c(d,e)}else Db(this),this.w&&this.w.stop(ka(),Hb(this))};l.Mb=function(){return 0}; -function Eb(a){a.j.ab&&(a.j.lb=!0);Lb(a);a.G+=a.N;a.N=0;if(a.j.oa){a.j.oa=!1;a.L&&a.L.stop();var b=a.v.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Db(a){if(a.w){for(var b=a.w,c=0;c>1),this.a=new Int32Array(this.i,0,c>>2),qb(this,mb?rb:sb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},B:function(a){return this.a[a>> +2]>>>((a&3)<<3)&255},H:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},R: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.oa=!0},u:function(a,b){return this.hb(a,b)},G:function(a,b){return this.Kb(a,b)},N:function(a,b,c){this.c||this.Nb(a,b,c)},U:function(a, +b,c){this.c||this.W(a,b,c)},s:function(a){return this.b[a]},A:function(a){return this.b[a]},F:function(a){return this.v.getUint16(a,!0)},L:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.h[a>>1]},I:function(a,b){this.b[a]=b;this.oa=!0},P:function(a,b){this.b[a]=b;this.oa=!0},V:function(a,b){this.v.setUint16(a,b,!0);this.oa=!0},za:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.h[a>>1]=b;this.oa=!0}};function Za(a,b,c){a.M=b;a.f=a.g=0;c&&((a.f=c.f)&&ub(a,vb,!1),(a.g=c.g)&&wb(a,vb,!1))} +function wb(a,b,c){c&&a.g||(a.Va=!a.c&&b[1]||a.m,a.sd=!a.c&&b[3]||a.o);if(c||void 0===c)a.Nb=b[1]||a.m,a.W=b[3]||a.o}function ub(a,b,c){c&&a.f||(a.Ua=b[0]||a.l,a.qd=b[2]||a.w);if(c||void 0===c)a.hb=b[0]||a.l,a.Kb=b[2]||a.w}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[D.prototype.B,D.prototype.R,D.prototype.H,D.prototype.Z],vb=[D.prototype.u,D.prototype.N,D.prototype.G,D.prototype.U]; +if(Ua)var sb=[D.prototype.s,D.prototype.I,D.prototype.F,D.prototype.V],rb=[D.prototype.A,D.prototype.P,D.prototype.L,D.prototype.za];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.I=c;this.Ha=Math.round(this.ma/1E4)/100;this.V=this.Ha*this.I;this.j.pa=!1;this.j.Lb=!1;this.j.Sa=a.autoStart;this.j.Eb=!1;this.j.bb=!1;this.ua=this.W=0;this.va=a.csStart;this.Z=a.csInterval;this.ja=a.csStop;this.F=[];this.$a=this.ob.bind(this);B(this)}w(yb);var zb=["power","reset"]; +l=yb.prototype;l.ra=function(a,b,c,d){this.w=a;this.i=b;this.M=d;for(b=0;ba.P/a.V&&(b=1);a.I=b;b=a.Ha*a.I;if(a.V!=b){a.V=b;b=a.V.toFixed(2)+"Mhz";var d=a.v.setSpeed;d&&(d.textContent=b);a.ea("target speed: "+b)}c&&a.w&&Ib(a.w)}a.G+=a.N;a.N=0;a.H=ka();a.R=0;Gb(a)}function Jb(a,b){var c=a.F.length;a.F.push([-1,b]);return c}function Kb(a,b,c){0<=b&&ba.F[b][0]&&(c*=a.ma*a.I/1E3,a.F[b][0]=c+Lb(a))}function Lb(a,b){var c=a.U-=a.a;a.a=0;b&&(a.U=0);return c} +l.ob=function(a){if(Ra(this,!0)){if(!this.j.pa){Fb(this);this.w&&this.w.start(this.H,Hb(this));this.j.pa=!0;this.j.Lb=!0;this.L&&this.L.start();var b=this.v.run;b&&(b.textContent="Halt");this.w&&(this.w.ia(!0),a&&Ib(this.w,!0))}this.Ia>=this.ma&&Gb(this,!0);this.qa=0;this.ta=ka();this.R&&(a=this.ta-this.R,a>this.Pa&&(this.H+=a,this.H>this.ta&&(this.H=this.ta)));try{do{for(var c,d=this.j.bb?1:this.Ba,e=this.F.length-1;0<=e;e--){var f=this.F[e];0>f[0]||d>f[0]&&(d=f[0])}c=d;this.Mb(c);c=Lb(this,!0); +this.qa+=c;this.N+=c;a=c;this.j.bb&&(b=!1,this.ua=this.ua+this.Hb()|0,this.W-=a,0>=this.W&&(this.W+=this.Z,b=!0),0<=this.ja&&this.ja<=Hb(this)&&(this.Z=this.ja=-1,Cb(this),Eb(this),b=!0),b&&this.ea(Hb(this)+" cycles: checksum="+p(this.ua)));a=c;for(var g=this.F.length-1;0<=g;g--){var h=this.F[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.la-=c;if(0>=this.la){this.la+=this.Ba;15<=++this.Qa&&(this.w&&this.w.ia(),this.Qa=0);break}}while(this.j.pa)}catch(k){Eb(this);Db(this);this.w&&this.w.stop(ka(), +Hb(this));Ra(this,!1);c=k.stack||k.message;this.j.error=!0;this.K(c);return}c=setTimeout;d=this.$a;this.R=ka();e=this.Pa;this.qa&&(e=Math.round(e*this.qa/this.Ba));e-=this.R-this.ta;if(f=this.R-this.H)this.P=Math.round(this.N/(10*f))/100,864E5<=f&&(this.G=0,Fb(this));if(0>e||this.Pe&&(this.H-=e),e=0;this.Ia+=this.qa;this.R+=e;c(d,e)}else Db(this),this.w&&this.w.stop(ka(),Hb(this))};l.Mb=function(){return 0}; +function Eb(a){a.j.ab&&(a.j.lb=!0);Lb(a);a.G+=a.N;a.N=0;if(a.j.pa){a.j.pa=!1;a.L&&a.L.stop();var b=a.v.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Db(a){if(a.w){for(var b=a.w,c=0;c>8&255;a.C=b&255}function Xb(a){return a.f<<8|a.D}function Yb(a,b){a.f=b>>8&255;a.D=b&255}function H(a){return a.g<<8|a.h} function J(a,b){a.g=b>>8&255;a.h=b&255}function F(a,b){a.m=b&65535}function K(a){return a.l&256?1:0}function L(a,b){a.l=a.l&255|b}function Zb(a){return Va[a.o&255]?4:0}function Ub(a){return a.B&-214|(a.o&128?128:0)|(a.l&255?0:64)|((a.o^a.u)&16?16:0)|Zb(a)|K(a)}function Sb(a,b){a.l=a.o=a.u=0;b&1&&(a.l|=256);b&4||(a.o|=1);b&16&&(a.u|=16);b&64||(a.l|=255);b&128&&(a.o^=192);a.B=a.B&-726|b&512|2}function M(a,b){a.u=a.b^b;return a.o=(a.l=a.b+b)&255} function $b(a,b){a.u=a.b^b;return a.o=(a.l=a.b+b+(a.l&256?1:0))&255}function ac(a,b){a.l=a.o=a.u=a.b&b;(a.b|b)&8&&(a.u^=16);return a.l}function bc(a,b){a.u=b^255;b=a.o=b+255&255;a.l=a.l&-256|b;return b}function cc(a,b){a.u=b;b=a.o=b+1&255;a.l=a.l&-256|b;return b}function dc(a,b){return a.o=a.l=a.u=a.b|b}function N(a,b){b^=255;a.u=a.b^b;return a.o=(a.l=a.b+b+1^256)&255}function ec(a,b){b^=255;a.u=a.b^b;return a.o=(a.l=a.b+b+(a.l&256?0:1)^256)&255}function fc(a,b){return a.o=a.l=a.u=a.b^b}l.J=function(a){return this.i.J(a)}; -l.aa=function(a,b){this.i.aa(a,b)};function O(a){var b=a.J(a.m);F(a,a.m+1);return b}function P(a){var b=db(a.i,a.m);F(a,a.m+2);return b}function Q(a){var b=db(a.i,a.s);a.s=a.s+2&65535;return b}function R(a,b){a.s=a.s-2&65535;fb(a.i,a.s,b)}function gc(a){if(a.a&&a.A&255&&a.B&512){for(var b=0;8>b&&!(a.A&1<b?255:1<b&&!(a.A&1<b?255:1<>8;L(this,a&256);this.a-=4},ic,function(){var a;J(this,a=H(this)+Vb(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.J(Vb(this));this.a-=7},function(){Wb(this,Vb(this)-1);this.a-=5}, -function(){this.C=cc(this,this.C);this.a-=5},function(){this.C=bc(this,this.C);this.a-=5},function(){this.C=O(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;L(this,a);this.a-=4},ic,function(){Yb(this,P(this));this.a-=10},function(){this.aa(Xb(this),this.b);this.a-=7},function(){Yb(this,Xb(this)+1);this.a-=5},function(){this.f=cc(this,this.f);this.a-=5},function(){this.f=bc(this,this.f);this.a-=5},function(){this.f=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|K(this); +var Pb=[ic,function(){Wb(this,P(this));this.a-=10},function(){this.ba(Vb(this),this.b);this.a-=7},function(){Wb(this,Vb(this)+1);this.a-=5},function(){this.c=cc(this,this.c);this.a-=5},function(){this.c=bc(this,this.c);this.a-=5},function(){this.c=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|a>>8;L(this,a&256);this.a-=4},ic,function(){var a;J(this,a=H(this)+Vb(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.J(Vb(this));this.a-=7},function(){Wb(this,Vb(this)-1);this.a-=5}, +function(){this.C=cc(this,this.C);this.a-=5},function(){this.C=bc(this,this.C);this.a-=5},function(){this.C=O(this);this.a-=7},function(){var a=this.b<<8&256;this.b=(a|this.b)>>1;L(this,a);this.a-=4},ic,function(){Yb(this,P(this));this.a-=10},function(){this.ba(Xb(this),this.b);this.a-=7},function(){Yb(this,Xb(this)+1);this.a-=5},function(){this.f=cc(this,this.f);this.a-=5},function(){this.f=bc(this,this.f);this.a-=5},function(){this.f=O(this);this.a-=7},function(){var a=this.b<<1;this.b=a&255|K(this); L(this,a&256);this.a-=4},ic,function(){var a;J(this,a=H(this)+Xb(this));L(this,a>>8&256);this.a-=10},function(){this.b=this.J(Xb(this));this.a-=7},function(){Yb(this,Xb(this)-1);this.a-=5},function(){this.D=cc(this,this.D);this.a-=5},function(){this.D=bc(this,this.D);this.a-=5},function(){this.D=O(this);this.a-=7},function(){var a=this.b<<8;this.b=(K(this)<<8|this.b)>>1;L(this,a&256);this.a-=4},ic,function(){J(this,P(this));this.a-=10},function(){var a=P(this);fb(this.i,a,H(this));this.a-=16},function(){J(this, H(this)+1);this.a-=5},function(){this.g=cc(this,this.g);this.a-=5},function(){this.g=bc(this,this.g);this.a-=5},function(){this.g=O(this);this.a-=7},function(){var a=0,b=K(this);if((this.o^this.u)&16||9<(this.b&15))a|=6;if(b||154<=this.b)a|=96,b=1;this.b=M(this,a);L(this,b?256:0);this.a-=4},ic,function(){var a;J(this,a=H(this)+H(this));L(this,a>>8&256);this.a-=10},function(){var a;a=P(this);a=db(this.i,a);J(this,a);this.a-=16},function(){J(this,H(this)-1);this.a-=5},function(){this.h=cc(this,this.h); -this.a-=5},function(){this.h=bc(this,this.h);this.a-=5},function(){this.h=O(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},ic,function(){this.s=P(this)&65535;this.a-=10},function(){this.aa(P(this),this.b);this.a-=13},function(){this.s=this.s+1&65535;this.a-=5},function(){var a=H(this);this.aa(a,cc(this,this.J(a)));this.a-=10},function(){var a=H(this);this.aa(a,bc(this,this.J(a)));this.a-=10},function(){this.aa(H(this),O(this));this.a-=10},function(){this.l|=256;this.a-=4},ic,function(){var a; +this.a-=5},function(){this.h=bc(this,this.h);this.a-=5},function(){this.h=O(this);this.a-=7},function(){this.b=~this.b&255;this.a-=4},ic,function(){this.s=P(this)&65535;this.a-=10},function(){this.ba(P(this),this.b);this.a-=13},function(){this.s=this.s+1&65535;this.a-=5},function(){var a=H(this);this.ba(a,cc(this,this.J(a)));this.a-=10},function(){var a=H(this);this.ba(a,bc(this,this.J(a)));this.a-=10},function(){this.ba(H(this),O(this));this.a-=10},function(){this.l|=256;this.a-=4},ic,function(){var a; J(this,a=H(this)+this.s);L(this,a>>8&256);this.a-=10},function(){this.b=this.J(P(this));this.a-=13},function(){this.s=this.s-1&65535;this.a-=5},function(){this.b=cc(this,this.b);this.a-=5},function(){this.b=bc(this,this.b);this.a-=5},function(){this.b=O(this);this.a-=7},function(){L(this,K(this)?0:256);this.a-=4},function(){this.a-=5},function(){this.c=this.C;this.a-=5},function(){this.c=this.f;this.a-=5},function(){this.c=this.D;this.a-=5},function(){this.c=this.g;this.a-=5},function(){this.c=this.h; this.a-=5},function(){this.c=this.J(H(this));this.a-=7},function(){this.c=this.b;this.a-=5},function(){this.C=this.c;this.a-=5},function(){this.a-=5},function(){this.C=this.f;this.a-=5},function(){this.C=this.D;this.a-=5},function(){this.C=this.g;this.a-=5},function(){this.C=this.h;this.a-=5},function(){this.C=this.J(H(this));this.a-=7},function(){this.C=this.b;this.a-=5},function(){this.f=this.c;this.a-=5},function(){this.f=this.C;this.a-=5},function(){this.a-=5},function(){this.f=this.D;this.a-= 5},function(){this.f=this.g;this.a-=5},function(){this.f=this.h;this.a-=5},function(){this.f=this.J(H(this));this.a-=7},function(){this.f=this.b;this.a-=5},function(){this.D=this.c;this.a-=5},function(){this.D=this.C;this.a-=5},function(){this.D=this.f;this.a-=5},function(){this.a-=5},function(){this.D=this.g;this.a-=5},function(){this.D=this.h;this.a-=5},function(){this.D=this.J(H(this));this.a-=7},function(){this.D=this.b;this.a-=5},function(){this.g=this.c;this.a-=5},function(){this.g=this.C;this.a-= -5},function(){this.g=this.f;this.a-=5},function(){this.g=this.D;this.a-=5},function(){this.a-=5},function(){this.g=this.h;this.a-=5},function(){this.g=this.J(H(this));this.a-=7},function(){this.g=this.b;this.a-=5},function(){this.h=this.c;this.a-=5},function(){this.h=this.C;this.a-=5},function(){this.h=this.f;this.a-=5},function(){this.h=this.D;this.a-=5},function(){this.h=this.g;this.a-=5},function(){this.a-=5},function(){this.h=this.J(H(this));this.a-=7},function(){this.h=this.b;this.a-=5},function(){this.aa(H(this), -this.c);this.a-=7},function(){this.aa(H(this),this.C);this.a-=7},function(){this.aa(H(this),this.f);this.a-=7},function(){this.aa(H(this),this.D);this.a-=7},function(){this.aa(H(this),this.g);this.a-=7},function(){this.aa(H(this),this.h);this.a-=7},function(){var a=this.m-1;if(this.ra.length)for(var b=0;b>8;this.a-=10},function(){var a=P(this);this.o&128||F(this,a);this.a-=10},function(){this.B&=-513;this.a-=4},function(){var a=P(this);this.o&128||(R(this,this.m),F(this,a),this.a-=6);this.a-=11},function(){R(this, Ub(this)&255|this.b<<8);this.a-=11},function(){this.b=dc(this,O(this));this.a-=7},function(){R(this,this.m);F(this,48);this.a-=11},function(){this.o&128&&(F(this,Q(this)),this.a-=6);this.a-=5},function(){this.s=H(this)&65535;this.a-=5},function(){var a=P(this);this.o&128&&F(this,a);this.a-=10},function(){this.B|=512;this.a-=4;gc(this)},function(){var a=P(this);this.o&128&&(R(this,this.m),F(this,a),this.a-=6);this.a-=11},lc,function(){N(this,O(this));this.a-=7},function(){R(this,this.m);F(this,56); this.a-=11}];function U(a){r.call(this,"ChipSet",a,U);var b=a.model;b&&!mc[b]&&Ca("Unrecognized ChipSet model: "+b);this.c=mc[b]||{};a.sound&&(this.I=null,window&&(this.I=window.AudioContext||window.webkitAudioContext),this.I&&new this.I);B(this)}w(U); -var V={ba:1978.1,Fc:{ca:0,Yd:1,be:16,ie:32,re:64,qe:128,Ka:14},Ca:{ca:1,Vb:1,yc:2,uc:4,vc:16,wc:32,xc:64,Ka:8},Gc:{ca:2,Xd:3,Ae:4,Zd:8,me:16,ne:32,oe:64,$d:128,Ka:0},ve:{ca:3},te:{ca:2,je:7},xe:{ca:3,Be:1,we:2,pe:4,ge:8,ae:16,sd:32},ue:{ca:4},ye:{ca:5,ce:1,de:2,ee:4,fe:8,Ce:16}},X={ba:100,ja:{ca:66,Bb:1,qc:2,rc:4,le:8,ke:16,yb:32,xb:64,tb:128},Tb:{ca:66,INIT:0},za:{ca:194,vd:0,rb:16,Ac:32,zb:48,cc:0,dc:32},Xa:{ca:162,se:0,fc:0,bc:0,ec:0,ac:0},ma:{he:{ca:98},Ga:{Qb:0,Pb:1,Dc:2,Lc:4,Wb:5,Bc:6,ze:7}, -Za:16383}},mc={SI1978:V,VT100:X};U.prototype.T=function(){return!1};U.prototype.qa=function(a,b,c,d){this.i=b;this.a=c;this.M=d;this.w=a;this.l=C(a,"Keyboard");this.h=C(a,"SerialPort");this.video=C(a,"Video");hb(b,this,this.c.fb);jb(b,this,this.c.gb)};U.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};U.prototype.ha=function(a){return a?this.save():!0};V.INIT=[[V.Fc.Ka,V.Ca.Ka,V.Gc.Ka,0,0,0,0]]; -X.INIT=[[X.Tb.INIT,X.ja.qc|X.ja.rc],[X.za.cc,X.za.dc],[X.Xa.fc,X.Xa.bc,X.Xa.ec,X.Xa.ac],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +var V={ca:1978.1,Fc:{da:0,Zd:1,ce:16,je:32,se:64,re:128,Ka:14},Da:{da:1,Vb:1,yc:2,uc:4,vc:16,wc:32,xc:64,Ka:8},Gc:{da:2,Yd:3,Be:4,$d:8,ne:16,oe:32,pe:64,ae:128,Ka:0},we:{da:3},ue:{da:2,ke:7},ye:{da:3,Ce:1,xe:2,qe:4,he:8,be:16,td:32},ve:{da:4},ze:{da:5,de:1,ee:2,fe:4,ge:8,De:16}},X={ca:100,ka:{da:66,Bb:1,qc:2,rc:4,me:8,le:16,yb:32,xb:64,tb:128},Tb:{da:66,INIT:0},Aa:{da:194,wd:0,rb:16,Ac:32,zb:48,cc:0,dc:32},Xa:{da:162,te:0,fc:0,bc:0,ec:0,ac:0},na:{ie:{da:98},Ga:{Qb:0,Pb:1,Dc:2,Lc:4,Wb:5,Bc:6,Ae:7}, +Za:16383}},mc={SI1978:V,VT100:X};U.prototype.T=function(){return!1};U.prototype.ra=function(a,b,c,d){this.i=b;this.a=c;this.M=d;this.w=a;this.l=C(a,"Keyboard");this.h=C(a,"SerialPort");this.video=C(a,"Video");hb(b,this,this.c.fb);jb(b,this,this.c.gb)};U.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};U.prototype.ha=function(a){return a?this.save():!0};V.INIT=[[V.Fc.Ka,V.Da.Ka,V.Gc.Ka,0,0,0,0]]; +X.INIT=[[X.Tb.INIT,X.ka.qc|X.ka.rc],[X.Aa.cc,X.Aa.dc],[X.Xa.fc,X.Xa.bc,X.Xa.ec,X.Xa.ac],[0,0,0,0,[11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11776,11984,11888,11776,11808,11776,12E3,12E3,11901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11904,11776,11784,11918,11808,11984,11856,11776,11808,11776,12E3,12E3,11881,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];l=U.prototype;l.reset=function(){this.c.INIT&&!this.restore(this.c.INIT)&&this.K("reset error")}; -l.save=function(){var a=new G(this);switch(this.c.ba){case V.ba:a.set(0,[this.W,this.g,this.Y,this.F,this.H,this.V,this.U]);break;case X.ba:a.set(0,[this.N,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.P]),a.set(3,[this.B,this.b,this.A,this.L,this.m])}return a.data()}; -l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.c.ba){case V.ba:return this.W=b[0],this.g=b[1],this.Y=b[2],this.F=b[3],this.H=b[4],this.V=b[5],this.U=b[6],!0;case X.ba:return this.N=b[0],this.u=b[1],b=a[1],this.o=b[0],this.s=b[1],b=a[2],this.f=b[0],this.G=b[1],this.R=b[2],this.P=b[3],b=a[3],this.B=b[0],this.b=b[1],this.A=b[2],this.L=b[3],this.m=b[4],!0}return!1};l.start=function(){};l.stop=function(){};l.Yc=function(){return this.W};l.Zc=function(){return this.g};l.$c=function(){return this.Y}; +l.save=function(){var a=new G(this);switch(this.c.ca){case V.ca:a.set(0,[this.W,this.g,this.Z,this.F,this.H,this.V,this.U]);break;case X.ca:a.set(0,[this.N,this.u]),a.set(1,[this.o,this.s]),a.set(2,[this.f,this.G,this.R,this.P]),a.set(3,[this.B,this.b,this.A,this.L,this.m])}return a.data()}; +l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.c.ca){case V.ca:return this.W=b[0],this.g=b[1],this.Z=b[2],this.F=b[3],this.H=b[4],this.V=b[5],this.U=b[6],!0;case X.ca:return this.N=b[0],this.u=b[1],b=a[1],this.o=b[0],this.s=b[1],b=a[2],this.f=b[0],this.G=b[1],this.R=b[2],this.P=b[3],b=a[3],this.B=b[0],this.b=b[1],this.A=b[2],this.L=b[3],this.m=b[4],!0}return!1};l.start=function(){};l.stop=function(){};l.Yc=function(){return this.W};l.Zc=function(){return this.g};l.$c=function(){return this.Z}; l.Xc=function(){return this.F>>8-this.H&255};l.fd=function(a,b){this.H=b};l.hd=function(a,b){this.V=b};l.gd=function(a,b){this.F=b<<8|this.F>>8};l.jd=function(a,b){this.U=b};l.kd=function(){};function nc(a){var b=0,c=0,d=~a.B;for(a=0;10>a;a++)d&1&&(b=9-a),d>>=1;for(a=0;10>a;a++)d&1&&(c=9-a),d>>=1;return 10*b+c} -l.ad=function(){var a=this.u,a=a&~X.ja.xb;if((Hb(this.a)&64)<<1&&(a|=X.ja.xb,a!=this.u)){var b,c;b=this.A&1;switch(this.A>>1&7){case X.ma.Ga.Pb:this.B=this.B<<1|b;break;case X.ma.Ga.Wb:b=nc(this);this.m[b]=X.ma.Za;break;case X.ma.Ga.Qb:this.b=this.b<<1|b;break;case X.ma.Ga.Lc:b=nc(this);c=this.b&X.ma.Za;this.m[b]=c;break;case X.ma.Ga.Bc:b=nc(this);c=this.m[b];null==c&&(c=X.ma.Za);this.b=c;break;case X.ma.Ga.Dc:this.b<<=1,this.L=this.b&X.ma.Za+1}}a&=~X.ja.yb;this.L&&(a|=X.ja.yb);a&=~X.ja.tb;if(b=this.l){b= -this.l;if(c=b.g)c=b.a,c=Hb(b.a)>=b.o+c.la*c.I/1E3*1.2731488;c&&(b.g=!1);b=!b.g}b&&(a|=X.ja.tb);a&=~X.ja.Bb;this.h&&this.h.ea&1&&(a|=X.ja.Bb);return this.u=a};l.ld=function(a,b){this.N=b};l.od=function(a,b){this.A=b};l.nd=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.pa!==a&&((b.pa=a)?Mb(b,!0):b.sa=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.P=a}}; -l.md=function(a,b){b&X.za.Ac?(b&=X.za.zb,this.s!=b&&(this.s=b,this.video&&(this.video.Jb=this.s==X.za.zb?50:60))):(b&=X.za.rb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==X.za.rb?132:80,a.G=b,a.S=a.Aa,80>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.va=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.K("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, +l.ad=function(){var a=this.u,a=a&~X.ka.xb;if((Hb(this.a)&64)<<1&&(a|=X.ka.xb,a!=this.u)){var b,c;b=this.A&1;switch(this.A>>1&7){case X.na.Ga.Pb:this.B=this.B<<1|b;break;case X.na.Ga.Wb:b=nc(this);this.m[b]=X.na.Za;break;case X.na.Ga.Qb:this.b=this.b<<1|b;break;case X.na.Ga.Lc:b=nc(this);c=this.b&X.na.Za;this.m[b]=c;break;case X.na.Ga.Bc:b=nc(this);c=this.m[b];null==c&&(c=X.na.Za);this.b=c;break;case X.na.Ga.Dc:this.b<<=1,this.L=this.b&X.na.Za+1}}a&=~X.ka.yb;this.L&&(a|=X.ka.yb);a&=~X.ka.tb;if(b=this.l){b= +this.l;if(c=b.g)c=b.a,c=Hb(b.a)>=b.o+c.ma*c.I/1E3*1.2731488;c&&(b.g=!1);b=!b.g}b&&(a|=X.ka.tb);a&=~X.ka.Bb;this.h&&this.h.X&1&&(a|=X.ka.Bb);return this.u=a};l.ld=function(a,b){this.N=b};l.od=function(a,b){this.A=b};l.nd=function(a,b){a=b&3;switch(b>>2&3){case 0:this.f=this.f&-4|a;break;case 1:this.f=this.f&-13|a<<2;this.video&&(b=this.video,a=this.f,b.qa!==a&&((b.qa=a)?Mb(b,!0):b.ta=!0));break;case 2:switch(a){case 0:this.G=~this.G;break;case 2:case 3:this.R=3-a}break;case 3:this.P=a}}; +l.md=function(a,b){b&X.Aa.Ac?(b&=X.Aa.zb,this.s!=b&&(this.s=b,this.video&&(this.video.Jb=this.s==X.Aa.zb?50:60))):(b&=X.Aa.rb,this.o!=b&&(this.o=b,this.video&&(a=this.video,b=this.o==X.Aa.rb?132:80,a.G=b,a.S=a.Ba,80>8&255,a.b[d++]=g[c]>>16&255,a.b[d++]=g[c]>>24&255;else a.b=e;a.wa=e.symbols;if(!a.b.length){q("Empty ROM: "+b);return}if(1==a.b.length){q(a.b[0]);return}}catch(h){a.K("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>f.i;0>>=f.i;0=m.Wa&&a<=m.kb?d.c&515||(d.c|=512,Dc(d,20,!0),Ec(d)):a>=m.Pc&&a<=m.z&&d.c&512&&(d.c&=-513,Dc(d,20,!1),Ec(d));return!0},c.onpaste=function(a){a:{if(d.h&&d.h.Ea&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(), -a=a.clipboardData||window.clipboardData)){Fc(d.h,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ba&&void 0!==this.b.Ba[b])return this.v[e]=c,a=function(a,b){return function(c){c.preventDefault();Dc(a,b,!0)}}(this,this.b.Ba[b]),b=function(a,b){return function(){Dc(a,b,!1)}}(this,this.b.Ba[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}}return!1}; -xc.prototype.qa=function(a,b,c,d){this.w=a;this.a=c;this.M=d;var e=this;this.u=Jb(this.a,function(){Gc(e)});this.L=C(a,"ChipSet");this.h=C(a,"SerialPort");hb(b,this,this.b.fb);jb(b,this,this.b.gb)};xc.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};xc.prototype.ha=function(a){return a?this.save():!0};Z.INIT=[[Z.ga.INIT,Z.Rb.INIT,!1,0,-1]];l=xc.prototype;l.reset=function(){this.i=[];this.c=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.K("reset error")}; -l.save=function(){var a=new G(this);switch(this.b.ba){case Z.ba:a.set(0,[this.m,this.l,this.g,this.o,-1])}return a.data()};l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.ba){case Ac.ba:return!0;case Z.ba:return this.m=b[0],Ec(this,this.m&Z.ga.vb),this.l=b[1],this.g=b[2],this.o=b[3],this.f=b[4],!0}return!1}; +var Ac={ca:1978.1,jb:{},qb:zc,La:{},Ca:{"1p":49,"2p":50,coin:51,left:37,right:39,fire:32}},Y={},Z={ca:100,jb:(Y[8]=3,Y[m.tc]=5,Y[m.sc]=6,Y[m.Nc]=7,Y[m.Hc]=8,Y[m.Kc]=9,Y[m.Q]=10,Y[39]=16,Y[221]=20,Y[219]=21,Y[m.$b]=22,Y[m.Ic]=23,Y[m.zc]=24,Y[m.E]=25,Y[49]=26,Y[37]=32,Y[40]=34,Y[117]=35,Y[19]=35,Y[192]=36,Y[189]=37,Y[57]=38,Y[55]=39,Y[52]=40,Y[51]=41,Y[27]=42,Y[38]=48,Y[114]=49,Y[112]=50,Y[46]=51,Y[187]=52,Y[48]=53,Y[56]=54,Y[54]=55,Y[53]=56,Y[50]=57,Y[9]=58,Y[103]=64,Y[115]=65,Y[113]=66,Y[96]=67,Y[118]= +68,Y[220]=69,Y[m.ub]=70,Y[m.hc]=71,Y[m.Yb]=72,Y[m.Xb]=73,Y[m.Wa]=74,Y[104]=80,Y[2013]=81,Y[98]=82,Y[97]=83,Y[222]=85,Y[186]=86,Y[m.gc]=87,Y[m.Zb]=88,Y[m.sb]=89,Y[m.Cc]=90,Y[110]=96,Y[116]=97,Y[101]=98,Y[100]=99,Y[13]=100,Y[190]=101,Y[188]=102,Y[m.pc]=103,Y[m.Sb]=104,Y[m.Mc]=105,Y[119]=106,Y[105]=112,Y[99]=113,Y[102]=114,Y[109]=115,Y[191]=117,Y[m.oc]=118,Y[m[" "]]=119,Y[m.Jc]=120,Y[m.Ub]=121,Y[m.kb]=122,Y[120]=123,Y[17]=124,Y[16]=125,Y[20]=126,Y),qb:{},La:{},Ca:{"num-comma":116,"break":117,"line-feed":118, +"no-scroll":119,setup:120},Rb:{da:130,INIT:127},ga:{da:130,mc:1,lc:2,kc:4,jc:8,nc:16,wb:32,vb:63,Ec:64,vd:128,INIT:0},ic:127};Z.La={l4:Z.ga.mc,l3:Z.ga.lc,l2:Z.ga.kc,l1:Z.ga.jc,locked:Z.ga.nc,local:Z.ga.wb,online:~Z.ga.wb,"caps-lock":512};var yc={SI1978:Ac,VT100:Z}; +xc.prototype.T=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.v[e]){if("led"==a&&this.b.La[b])return this.v[e]=c,!0;switch(b){case "kbd":return c.onkeydown=function(a){return Cc(d,a,!0)},c.onkeyup=function(a){return Cc(d,a,!1)},c.onkeypress=function(a){a=a.keyCode;a>=m.Wa&&a<=m.kb?d.c&515||(d.c|=512,Dc(d,20,!0),Ec(d)):a>=m.Pc&&a<=m.z&&d.c&512&&(d.c&=-513,Dc(d,20,!1),Ec(d));return!0},c.onpaste=function(a){a:{if(d.h&&d.h.Fa&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(), +a=a.clipboardData||window.clipboardData)){Fc(d.h,a.getData("Text"));a=!1;break a}a=!0}return a},!0;default:if(this.b.Ca&&void 0!==this.b.Ca[b])return this.v[e]=c,a=function(a,b){return function(c){c.preventDefault();Dc(a,b,!0)}}(this,this.b.Ca[b]),b=function(a,b){return function(){Dc(a,b,!1)}}(this,this.b.Ca[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}}return!1}; +xc.prototype.ra=function(a,b,c,d){this.w=a;this.a=c;this.M=d;var e=this;this.u=Jb(this.a,function(){Gc(e)});this.L=C(a,"ChipSet");this.h=C(a,"SerialPort");hb(b,this,this.b.fb);jb(b,this,this.b.gb)};xc.prototype.fa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};xc.prototype.ha=function(a){return a?this.save():!0};Z.INIT=[[Z.ga.INIT,Z.Rb.INIT,!1,0,-1]];l=xc.prototype;l.reset=function(){this.i=[];this.c=0;this.b.INIT&&!this.restore(this.b.INIT)&&this.K("reset error")}; +l.save=function(){var a=new G(this);switch(this.b.ca){case Z.ca:a.set(0,[this.m,this.l,this.g,this.o,-1])}return a.data()};l.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.b.ca){case Ac.ca:return!0;case Z.ca:return this.m=b[0],Ec(this,this.m&Z.ga.vb),this.l=b[1],this.g=b[2],this.o=b[3],this.f=b[4],!0}return!1}; function Ec(a,b){var c;null!=b?a.s=b:b=a.s;for(var d in a.b.La)if(c="led-"+d,c=a.v[c]){var e=a.b.La[d],f=!!(b&e);e&e-1&&(f=!(b&~e));c.style.backgroundColor=f?"#"+p(16711680,6):"#000000"}if(c=a.v["led-caps-lock"])c.style.backgroundColor=a.c&512?"#"+p(65280,6):"#000000"} -function Cc(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?1:2;break;case 17:g=f?4:8;break;case 18:g=f?16:32;break;case 91:g=f?64:128;break;case 20:g=512}g&&(a.c=c?a.c|g:a.c&~g);var h;a:if(e=a.b.qb[e]||e,a.b.jb[e])h=e;else{for(h in a.b.Ba)if(a.b.Ba[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.c&4144&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.c=c?a.c|4096:a.c&-4097)),d=Dc(a,h,c),h>=m.Wa&&h<=m.kb||b.preventDefault());return d} -function Dc(a,b,c){var d,e;a:{for(e=0;ee?a.i.push({pb:b,mb:Date.now(),cb:d}):(a.i[e].mb=Date.now(),a.i[e].cb=d);else if(0<=e){if(!a.i[e].cb&&(d=a.i[e].mb)&&50>Date.now()-d)return a.i[e].cb=!0,Gc(a),!0;a.i.splice(e,1)}if(a.L){d=0;switch(b){case "1p":d=V.Ca.uc;break;case "2p":d=V.Ca.yc;break;case "coin":d=V.Ca.Vb;break;case "left":d=V.Ca.wc;break;case "right":d=V.Ca.xc;break;case "fire":d=V.Ca.vc}d&&(a=a.L,b=d,a.g&=~b,c&&(a.g|=b))}return!0} +function Cc(a,b,c){var d=!0,e=b.keyCode,f=2==b.location,g=0;switch(e){case 16:g=f?1:2;break;case 17:g=f?4:8;break;case 18:g=f?16:32;break;case 91:g=f?64:128;break;case 20:g=512}g&&(a.c=c?a.c|g:a.c&~g);var h;a:if(e=a.b.qb[e]||e,a.b.jb[e])h=e;else{for(h in a.b.Ca)if(a.b.Ca[h]===e)break a;h=null}h&&!b.metaKey&&(d=!1,a.c&4144&&(13==h?(h=118,d=!0):8==h&&(h=46,d=!0),d&&(a.c=c?a.c|4096:a.c&-4097)),d=Dc(a,h,c),h>=m.Wa&&h<=m.kb||b.preventDefault());return d} +function Dc(a,b,c){var d,e;a:{for(e=0;ee?a.i.push({pb:b,mb:Date.now(),cb:d}):(a.i[e].mb=Date.now(),a.i[e].cb=d);else if(0<=e){if(!a.i[e].cb&&(d=a.i[e].mb)&&50>Date.now()-d)return a.i[e].cb=!0,Gc(a),!0;a.i.splice(e,1)}if(a.L){d=0;switch(b){case "1p":d=V.Da.uc;break;case "2p":d=V.Da.yc;break;case "coin":d=V.Da.Vb;break;case "left":d=V.Da.wc;break;case "right":d=V.Da.xc;break;case "fire":d=V.Da.vc}d&&(a=a.L,b=d,a.g&=~b,c&&(a.g|=b))}return!0} function Gc(a){for(var b=0,c=-1;bc||c>e)c=e}else{Dc(a,d,!1);b=0;continue}}b++}0<=c&&Kb(a.a,a.u,c)}l.bd=function(){var a=this.l;0<=this.f&&(this.f>3)*a.F,!$a(a.i,a.ia,a.A,3)))return!1;a.A?(a.Oa=a.f.createImageData(b,c),a.Qa=16/a.ka|0,Mc(a,a.A>>1)):Mc(a,(a.G+1)*a.U);a.o=document.createElement("canvas");a.o.width=b;a.o.height=c;a.ra=a.o.getContext("2d");a.H={};a.R=1<=a.Aa?8:16,f=8>(7>4)*c)}return k}Hc.prototype.fa=function(){return!0};Hc.prototype.T=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.ua[b]=c,!0;switch(b){case "fullScreen":return this.v[b]=c,this.b&&this.b.Ja?c.onclick=function(){d.Ja()}:c.parentNode.removeChild(c),!0}return!1}; +break}for(c=0;c>3)*a.F,!$a(a.i,a.ja,a.A,3)))return!1;a.A?(a.Oa=a.f.createImageData(b,c),a.Qa=16/a.la|0,Mc(a,a.A>>1)):Mc(a,(a.G+1)*a.U);a.o=document.createElement("canvas");a.o.width=b;a.o.height=c;a.sa=a.o.getContext("2d");a.H={};a.R=1<=a.Ba?8:16,f=8>(7>4)*c)}return k}Hc.prototype.fa=function(){return!0};Hc.prototype.T=function(a,b,c){var d=this;if("led"==a||"rled"==a)return this.va[b]=c,!0;switch(b){case "fullScreen":return this.v[b]=c,this.b&&this.b.Ja?c.onclick=function(){d.Ja()}:c.parentNode.removeChild(c),!0}return!1}; Hc.prototype.Ja=function(){var a=!1;if(this.b){if(this.b.Ja){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.B/this.u;b>c&&(a=Math.round(c/b*100)+"%")}this.Na?(this.s.style.width=a,this.s.style.width=a,this.s.style.display="block",this.s.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.Ja();a=!0}this.P&&this.P.focus()}return a}; function Kc(a,b){!b&&a.b&&(a.Na?a.s.style.width=a.s.style.height="":a.b.style.width=a.b.style.height="")}function Mc(a,b){a.Pa=b;a.N=!1;if(void 0===a.h||a.h.length!=a.Pa)a.h=Array(a.Pa)}function Oc(a,b,c,d,e){d=a.c?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.V&&(208<=c&&236>c?e=a.R+0:28<=c&&72>c&&(e=a.R+1));a=a.I[e];d*=a.length;b.data[d]=a[0];b.data[d+1]=a[1];b.data[d+2]=a[2];b.data[d+3]=a[3]} -function Mb(a,b){var c=!0;if(!b){a.la&&(120==a.la?a.$a&1?(hc(a.a,2),c=!1):hc(a.a,1):hc(a.a,4));if(c&&a.N&&a.A){for(var d=a.i,e=a.A,f=!0,g=a.ia>>>d.i;0>=1);;){var x=cb(a.i,v++);if(127==(x&127)){var t=cb(a.i,v++),d=t&96,c=(t&15)<<8|cb(a.i,v),c=c+(t&16? -8192:16384);break}if(n>4)*x.O,ba,ta,Sa,ib,Bc=x.S,Nb=x.O;E?(ba=I*t.S,ta=e*t.O,Sa=t.S,ib=t.O):(ba=I*t.Ha,ta=e*t.Ia,Sa=t.Ha,ib=t.Ia);x.S>t.S&&(ba*=2,Sa*=2);x.O>t.O&&(z||(S+=t.O),Nb=t.O);E?E.drawImage(x.canvas,W,S,Bc,Nb,ba,ta,Sa,ib):(ba+=0,ta+=0,t.f.drawImage(x.canvas,W,S,Bc, -Nb,ba,ta,Sa,ib))}h++}g++}e++}}a.N=!0;!b&&a.sa&&1==h&&(a.h[k]=-1,h=0);a.sa=!1;(h||b)&&a.ra&&a.f.drawImage(a.o,0,a.pa,a.m,a.F-a.O,0,0,a.Oc,a.Ob)}else{e=a.ia;f=e+a.A;k=h=g=0;b=a.m;n=0;c=a.F;z=d=0;v=a.ka;I=(1<>>t.i;t=x!=t.f?t.b[W].Kb(x,E):t.b[W++].hb(x,E)|t.b[W&t.m].hb(0,E+1)<<8;if(a.N&&t===a.h[g])h+=a.Qa;else{a.h[g]=t;(E=z)&&(t=t>>8|(t&255)<<8);h>E&I,Oc(a,a.Oa,h++,k,W),E+=v;h>n&&(n=h);k=d&&(d=k+ -1)}e+=2;g++;if(h>=a.m&&(h=0,k++,k>a.F))break}a.N=!0;b>>d.i;0>=1);;){var x=cb(a.i,v++);if(127==(x&127)){var t=cb(a.i,v++),d=t&96,c=(t&15)<<8|cb(a.i,v),c=c+(t&16? +8192:16384);break}if(n>4)*x.O,ba,ta,Sa,ib,Bc=x.S,Nb=x.O;E?(ba=I*t.S,ta=e*t.O,Sa=t.S,ib=t.O):(ba=I*t.Ha,ta=e*t.Ia,Sa=t.Ha,ib=t.Ia);x.S>t.S&&(ba*=2,Sa*=2);x.O>t.O&&(z||(S+=t.O),Nb=t.O);E?E.drawImage(x.canvas,W,S,Bc,Nb,ba,ta,Sa,ib):(ba+=0,ta+=0,t.f.drawImage(x.canvas,W,S,Bc, +Nb,ba,ta,Sa,ib))}h++}g++}e++}}a.N=!0;!b&&a.ta&&1==h&&(a.h[k]=-1,h=0);a.ta=!1;(h||b)&&a.sa&&a.f.drawImage(a.o,0,a.qa,a.m,a.F-a.O,0,0,a.Oc,a.Ob)}else{e=a.ja;f=e+a.A;k=h=g=0;b=a.m;n=0;c=a.F;z=d=0;v=a.la;I=(1<>>t.i;t=x!=t.f?t.b[W].Kb(x,E):t.b[W++].hb(x,E)|t.b[W&t.m].hb(0,E+1)<<8;if(a.N&&t===a.h[g])h+=a.Qa;else{a.h[g]=t;(E=z)&&(t=t>>8|(t&255)<<8);h>E&I,Oc(a,a.Oa,h++,k,W),E+=v;h>n&&(n=h);k=d&&(d=k+ +1)}e+=2;g++;if(h>=a.m&&(h=0,k++,k>a.F))break}a.N=!0;bMissing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= (a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Ga.aspect);f&&.3<=f&&3.33>=f&&(za("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");ua("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Hc(d,e,g,f,c);Qa(d,c)}}); -function Pc(a){this.G=+a.adapter;switch(this.G){case 0:this.H=0;this.N=2;break;default:q("Unrecognized serial adapter #"+this.G);return}this.b=this.f=null;this.I=a.tabSize;this.F=a.charBOL;this.g=0;this.A=!1;r.call(this,"SerialPort",a,Pc);var b=a.binding;if("console"==b)this.f="";else{var c;a=Qc;b&&(void 0===c&&(c="Panel"),(c=Pa(c,this.id))&&(b=c.v[b])&&this.T(null,a,b))}this.h="";this.c=this.Ea=null;this.exports={connect:this.Ib,receiveData:this.nb}}w(Pc); +function Pc(a){this.G=+a.adapter;switch(this.G){case 0:this.H=0;this.N=2;break;default:q("Unrecognized serial adapter #"+this.G);return}this.b=this.f=null;this.I=a.tabSize;this.F=a.charBOL;this.g=0;this.A=!1;r.call(this,"SerialPort",a,Pc);var b=a.binding;if("console"==b)this.f="";else{var c;a=Qc;b&&(void 0===c&&(c="Panel"),(c=Pa(c,this.id))&&(b=c.v[b])&&this.T(null,a,b))}this.h="";this.c=this.Fa=this.ia=null;this.exports={connect:this.Ib,receiveData:this.nb,receiveStatus:this.rd}}w(Pc); var Rc=[50,75,110,134.5,150,200,300,600,1200,1800,2E3,2400,3600,4800,9600,19200],Sc=[!1,0,0,133,142,39,238],Qc="buffer";l=Pc.prototype; l.T=function(a,b,c,d){var e=this;switch(b){case Qc:return this.v[b]=this.b=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ia(b[0]);if(c!=this.Ya)return;b=ia(b[1]);if(this.c=Oa(b)){var d=this.c.exports;if(d){var e=d.connect;e&&e.call(this.c);if(this.Ea=d.receiveData){this.status(this.ya+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};l.fa=function(a,b){if(!b)if(this.Ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -l.ha=function(a){return a?this.save():!0};l.reset=function(){Wc(this)};l.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.m;c[b++]=this.u;c[b++]=this.B;c[b++]=this.ea;c[b++]=this.l;c[b++]=this.s;c[b]=this.o;a.set(0,c);return a.data()};l.restore=function(a){return Wc(this,a[0])};function Wc(a,b){var c=0;b||(b=Sc);a.m=b[c++];a.u=b[c++];a.B=b[c++];a.ea=b[c++];a.l=b[c++];a.s=b[c++];a.o=b[c];return!0} -function Xc(a,b){var c=a.o&b;b&15||(c>>=4);b=Rc[c];c=((a.l&12)>>2)+6;a.l&16&&c++;c+=((a.l&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Tc(a,b){return a.A||a.ea&2?!1:(a.u=b,a.ea|=2,hc(a.a,a.N),!0)}l.nb=function(a){null!=a&&(this.h="number"!=typeof a?a:this.h+String.fromCharCode(a));this.h&&(Tc(this,this.h.charCodeAt(0))&&(this.h=this.h.substr(1)),this.h&&this.a&&Kb(this.a,this.P,Xc(this,15)));return!0};function Fc(a,b){a.ea|=5;b&&a.Ea&&a.Ea.call(a.c,b)} -l.Wc=function(){var a=this.u;this.ea&=-3;return a};l.Vc=function(){return this.ea}; -l.ed=function(a,b){this.B=b;this.ea&=-6;if(19==b)this.A=!0;else if(17==b)this.A=!1;else if(this.Ea&&this.Ea.call(this.c,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0":String.fromCharCode(b);var c=a.length;9==b?(b=this.I||8,c=b-this.g%b,this.I&&(a=" ".slice(0,c))):13==b&&(this.g=c=0,a="\n");this.F&&!this.g&&c&&(a=String.fromCharCode(this.F)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;this.g+=c}else if(null!= -this.f){if(10==b||1024<=this.f.length)this.da(this.f),this.f="";10!=b&&(this.f+=String.fromCharCode(b))}this.a&&Kb(this.a,this.R,Xc(this,240))};l.dd=function(a,b){this.m?(this.s=b,this.s&64&&(this.m=!1)):(this.l=b,this.m=!0)};l.cd=function(a,b){this.o=b};var Uc={0:Pc.prototype.Wc,1:Pc.prototype.Vc},Vc={0:Pc.prototype.ed,1:Pc.prototype.dd,2:Pc.prototype.cd};Aa(function(){for(var a=A(document,"pc8080","serial"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;b");if(2==b.length){var c=ia(b[0]);if(c!=this.Ya)return;b=ia(b[1]);if(this.c=Oa(b)){var d=this.c.exports;if(d){var e=d.connect;e&&e.call(this.c);this.Fa=d.receiveData;this.ia=d.receiveStatus;if(this.Fa){this.status(this.za+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};l.fa=function(a,b){if(!b)if(this.Ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +l.ha=function(a){return a?this.save():!0};l.reset=function(){Wc(this)};l.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.o;c[b++]=this.u;c[b++]=this.B;c[b++]=this.X;c[b++]=this.l;c[b++]=this.m;c[b]=this.s;a.set(0,c);return a.data()};l.restore=function(a){return Wc(this,a[0])};function Wc(a,b){var c=0;b||(b=Sc);a.o=b[c++];a.u=b[c++];a.B=b[c++];a.X=b[c++];a.l=b[c++];a.m=b[c++];a.s=b[c];return!0} +function Xc(a,b){var c=a.s&b;b&15||(c>>=4);b=Rc[c];c=((a.l&12)>>2)+6;a.l&16&&c++;c+=((a.l&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Tc(a,b){return a.A||a.X&2?!1:(a.u=b,a.X|=2,hc(a.a,a.N),!0)}l.nb=function(a){null!=a&&(this.h="number"!=typeof a?a:this.h+String.fromCharCode(a));this.h&&(Tc(this,this.h.charCodeAt(0))&&(this.h=this.h.substr(1)),this.h&&this.a&&Kb(this.a,this.P,Xc(this,15)));return!0};l.rd=function(a){this.X&=-129;a&64&&(this.X|=128)}; +function Fc(a,b){a.X|=5;b&&a.Fa&&a.Fa.call(a.c,b)}l.Wc=function(){var a=this.u;this.X&=-3;return a};l.Vc=function(){return this.X}; +l.ed=function(a,b){this.B=b;this.X&=-6;if(19==b)this.A=!0;else if(17==b)this.A=!1;else if(this.Fa&&this.Fa.call(this.c,b),this.b)if(8==b)this.b.value=this.b.value.slice(0,-1),0":String.fromCharCode(b);var c=a.length;9==b?(b=this.I||8,c=b-this.g%b,this.I&&(a=" ".slice(0,c))):13==b&&(this.g=c=0,a="\n");this.F&&!this.g&&c&&(a=String.fromCharCode(this.F)+a);this.b.value+=a;this.b.scrollTop=this.b.scrollHeight;this.g+=c}else if(null!= +this.f){if(10==b||1024<=this.f.length)this.ea(this.f),this.f="";10!=b&&(this.f+=String.fromCharCode(b))}this.a&&Kb(this.a,this.R,Xc(this,240))};l.dd=function(a,b){this.o?(this.ia&&(b^this.m)&34&&this.ia(0|(b&32?32:0)|(b&2?320:0)),this.m=b,this.m&64&&(this.o=!1)):(this.l=b,this.o=!0)};l.cd=function(a,b){this.s=b};var Uc={0:Pc.prototype.Wc,1:Pc.prototype.Vc},Vc={0:Pc.prototype.ed,1:Pc.prototype.dd,2:Pc.prototype.cd}; +Aa(function(){for(var a=A(document,"pc8080","serial"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;b$c){if(bd(d,this.o)){this.h=new G(this,"1.30.5","failsafe");bd(this.h)&&(gd(this,d),a=2,hd(this.h));this.h.set("timestamp",la());id(this.h);var e=this.b&&!this.w;if(1==a||oa("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=fd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?bd(d,g):("error"== -f&&"no machine state"!=g?(this.K("Error: "+g),"unable to verify user"==g&&(sa("user",""),this.c=null)):this.da(f+": "+g),hd(d),bd(d)?(c=fd(d),e=!0):c=!1))}e&&ed(this,c?d:null)}else 2==a&&d.clear()}else ed(this);delete this.o;delete this.s}e=Na(this.id);for(f=0;fa[1];a=a[2];this.I=!0;this.j.X=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(jd(this,this.a,b,c,a),this.a.Sa());this.B&&(gd(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.f=0}; +f&&"no machine state"!=g?(this.K("Error: "+g),"unable to verify user"==g&&(sa("user",""),this.c=null)):this.ea(f+": "+g),hd(d),bd(d)?(c=fd(d),e=!0):c=!1))}e&&ed(this,c?d:null)}else 2==a&&d.clear()}else ed(this);delete this.o;delete this.s}e=Na(this.id);for(f=0;fa[1];a=a[2];this.I=!0;this.j.Y=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(jd(this,this.a,b,c,a),this.a.Sa());this.B&&(gd(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.f=0}; function gd(a,b){if(oa("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PC8080",ver:"1.30.5"};d.url=a.H;d.user=c;d.type="bug";d.data=b;ma("http://www.pcjs.org/api/v1/report",d,!0)}} -function kd(a,b,c){var d,e="none";if(a.f)return null;a.f--;var f=new G(a,"1.30.5"),g=new G(a,"1.30.5","validate"),h=la();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ha&&(c&&Eb(a.a),d=a.a.ha(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.X=!1,!1===d&&(e=null)));for(var h=Na(a.id),k=0;k":62,"?":63,"@":64,sc:65,zf:66,Bf:67,Yf:68,E:69,Zf:70,$f:71,ag:72,bg:73,cg:74,dg:75,eg:76,fg:77,gg:78,hg:79,ig:80,Q:81,jg:82,kg:83,lg:84,mg:85,ng:86,og:87,pg:88,qg:89,cd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,rg:97,sg:98,tg:99,d:100,e:101,vg:102,wg:103,xg:104,yg:105,Bg:106,k:107,Cg:108,Dg:109,n:110,Eg:111,p:112,q:113,r:114,Fg:115,t:116,Hg:117,Ig:118,Jg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Tc:127}; +var ka={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]},la={Df:0,Sc:1,Ff:2,Gf:3,Hf:4,If:5,Jf:6,Kf:7,vc:8,Lf:9,Tc:10,Mf:11,Nf:12,Uc:13,Of:14,Pf:15,Qf:16,Rf:17,Sf:18,Tf:19,Uf:20,Vf:21,Wf:22,Xf:23,Yf:24,Zf:25,$f: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,tc:65,Cf:66,Ef:67,ag:68,E:69,bg:70,cg:71,dg:72,eg:73,fg:74,gg:75,hg:76,ig:77,jg:78,kg:79,lg:80,Q:81,mg:82,ng:83,og:84,pg:85,qg:86,rg:87,sg:88,tg:89,dd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ug:97,vg:98,wg:99,d:100,e:101,yg:102,zg:103,Ag:104,Bg:105,Eg:106,k:107,Fg:108,Gg:109,n:110,Hg:111,p:112,q:113,r:114,Ig:115,t:116,Kg:117,Lg:118,Mg:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Vc:127}; function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)} -function t(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function sa(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} -function ta(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",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 u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ra(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} +function ta(a,b){return(a+" ").slice(0,b)}function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",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 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={ga:null,ia:null,Sa:null,Ra: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.Sa=g.load;d.Ra=g.exec;if(e=g.bytes)d.ga=e;else if(e=g.words)for(d.ga=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ga=Array(4*e.length),f=c=0;c>8&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ia=g.symbols;d.ga.length?1==d.ga.length&&(w(d.ga[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&255,d.ga[f++]=e[c]>>16&255,d.ga[f++]=e[c]>>24&255;else d.ga=g;d.ia=g.symbols;d.ga.length?1==d.ga.length&&(v(d.ga[0]),d=null):(v("Empty resource: "+a),d=null)}catch(h){v("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.fb=this.id:(this.gb=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,ib:!1,jc:!1,la:!1,error:!1};this.$b=null;this.C.error=!1;this.D={};this.j=null;this.ma=d||0;z.push(this)}var fb=void 0,gb={}; +function cb(a){if($a)try{for(var b=0;bb?this.fb=this.id:(this.gb=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,ib:!1,lc:!1,la:!1,error:!1};this.ac=null;this.C.error=!1;this.D={};this.j=null;this.na=d||0;z.push(this)}var fb=void 0,gb={}; if(window){fb||(fb=window.location.search.substr(1));for(var hb,ib=/\+/g,jb=/([^&=]+)=?([^&]*)/g;hb=jb.exec(fb);)gb[decodeURIComponent(hb[1].replace(ib," "))]=decodeURIComponent(hb[2].replace(ib," "))}function kb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function B(a,b){b||(b=x);a.prototype=kb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},z=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Cd,a]}B(Eb);var Fb=7;function Gb(a,b){return a.f[b]&&a.f[b][1]}k=Eb.prototype;k.reset=function(){this.stop()}; -k.va=function(a,b,c,d){if(this.A&&this.A.va(a,b,c,d)||this.b&&this.b.va(a,b,c,d)||this.j&&this.j.va(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.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Hb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ib(a,b)}}(this,b),!0):this.parent.va.call(this,a,b,c,d)}};k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;Jb(b,this,Kb);Lb(b,this.reset.bind(this));Mb(this);Nb(this)};k.Ia=function(a,b){b||(Ob(),this.reset());return!0};k.Ha=function(){return!0}; -function Pb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Mb(a,b){for(var c in a.g)Pb(a,c,null!=b?b:a.g[c])}function Qb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Nb(a){for(var b in a.f)Qb(a,b,a.f[b][1])}function Rb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ca()),c=8==(a.j&&a.j.ra||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} -function Hb(a,b){var c=a.f[b];Qb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Ib(a,b){var c=a.f[b];c[2]&&c[3]&&(Qb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ad=function(a){a||this.b.C.W||(a=this.b,a.w.reset(),Sb(a),Gb(this,"ENABLE")&&this.b.ob())};k.Bd=function(){};k.wd=function(a){a||this.b.ca()}; -k.ud=function(a){if(!a&&!this.b.C.W)if(Gb(this,"ENABLE"))this.b.ob();else{if((a=this.j)&&!xb(a,!0))qb(a,!0),a.pb(0,null),qb(a,!1);else try{var b=this.b.pb(1);0a.b.jb?8:16,c=65472<=a.za&&a.za<65472+b,b=c?1:2,c=c?15:a.w.Eb;Gb(a,"STEP")||(b=-b);oc(a,a.za&~c|a.za+b&c)} -function oc(a,b){a.za=b&a.w.Eb;b=a.za;for(var c=0;22>c;c++)qc(a,"A"+c,b&1<c;c++)qc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.w=this.Ga-1;this.v=this.B/this.Ga|0;this.hb=[];this.oa=0;this.A=!1;this.F=[];this.gd=[vc,wc,xc,yc];a=new K(this);zc(a,this.j);this.ba=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.na;this.G=0;this.g=this.Eb;J(this)}B(tc); -var uc=8192,Cc=uc-1;function vc(a,b){var c=-1,d=this.controller,e=d.hb[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.hb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.oa),c;d.Ma(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.oa);return c} -function wc(a,b,c){var d=!1,e=this.controller,f=e.hb[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.hb[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?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.oa):(e.Ma(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, -b),!0,!e.oa))}function xc(a,b){var c=-1,d=this.controller;a=d.hb[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 this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.oa),c;d.Ma(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.oa);return c} -function yc(a,b,c){var d=!1,e=this.controller;a=e.hb[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?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.oa):(e.Ma(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.oa))} -function Dc(a,b){if(b!=a.G){for(var c=0;c>>a.na,a.f[a.K]=a.ba[a.I])}}k=tc.prototype;k.reset=function(){for(var a=0;a>>a.na;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Lb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.H+n;f=m+a.Ga;g-=n;h++;continue}}return Ec(1,f,g)}f=new K(a,f,n,a.Ga,d,e);zc(f,a.j,l);a.ba[h++]=f;f=m+a.Ga;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Fc[d]+" at "+na(b)),!0):Ec(2,b,c)}k.ac=function(a){return this.f[(a&this.g)>>>this.na].bc(a&this.w,a)}; -function Gc(a,b){return a.ba[(b&a.Eb)>>>a.na]}k.ta=function(a){return this.f[(a&this.g)>>>this.na].ya(a&this.w,a)};function mc(a,b){a.A=!1;a.oa++;b=Gc(a,b).K(b&a.w,b);a.oa--;return b}k.Kb=function(a,b){this.f[(a&this.g)>>>this.na].ec(a&this.w,b&255,a)};function Hc(a,b,c){a.A=!1;a.oa++;Gc(a,b).G(b&a.w,c&255,b);a.oa--}k.zb=function(a,b){this.f[(a&this.g)>>>this.na].Xb(a&this.w,b&65535,a)};function Yb(a,b,c){a.A=!1;a.oa++;Gc(a,b).M(b&a.w,c&65535,b);a.oa--} -function Ic(a){for(var b=0,c=[],d=0;da.b.jb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],r=f[5]||1,v=0;vb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Db=128;Pc(this.b,this.f.pc,1E3/60,!0)};k.Kd=function(){return this.f.Db};k.Je=function(a){this.f.Db=a&192;this.f.Db&64||Tc(this.b,this.f.Cb)};k.Md=function(){return bd(this.b)};k.Le=function(a){cd(this.b,a&-129|this.b.Ca&128)}; -k.Nd=function(){return dd(this.b)};k.Od=function(){return ed(this.b)};k.Pd=function(){return this.b.Wa};k.Me=function(a){fd(this.b,a)};k.we=function(a){a=a>>1&63;var b=this.b.Wb[a>>1];return a&1?b>>16:b&65535};k.vf=function(a,b){b=b>>1&63;var c=b>>1;this.b.Wb[c]=b&1?this.b.Wb[c]&65535|(a&63)<<16:this.b.Wb[c]&-65536|a&65534};k.pe=function(a){return this.b.R[1][a>>1&7]};k.nf=function(a,b){this.b.R[1][b>>1&7]=a&65295};k.ne=function(a){return this.b.R[1][(a>>1&7)+8]}; -k.lf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.oe=function(a){return this.b.ja[1][a>>1&7]};k.mf=function(a,b){b=b>>1&7;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.me=function(a){return this.b.ja[1][(a>>1&7)+8]};k.kf=function(a,b){b=(b>>1&7)+8;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.Jd=function(a){return this.b.R[0][a>>1&7]};k.Ie=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Hd=function(a){return this.b.R[0][(a>>1&7)+8]};k.Ge=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295}; -k.Id=function(a){return this.b.ja[0][a>>1&7]};k.He=function(a,b){b=b>>1&7;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.Gd=function(a){return this.b.ja[0][(a>>1&7)+8]};k.Fe=function(a,b){b=(b>>1&7)+8;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.ve=function(a){return this.b.R[3][a>>1&7]};k.uf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.te=function(a){return this.b.R[3][(a>>1&7)+8]};k.sf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295};k.ue=function(a){return this.b.ja[3][a>>1&7]}; -k.tf=function(a,b){b=b>>1&7;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.se=function(a){return this.b.ja[3][(a>>1&7)+8]};k.rf=function(a,b){b=(b>>1&7)+8;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.Hb=function(a){a&=7;return this.b.O&2048?this.b.eb[a]:this.b.u[a]};k.Mb=function(a,b){b&=7;this.b.O&2048?this.b.eb[b]=a:this.b.u[b]=a};k.Ud=function(){return this.b.O&49152?this.b.Oa[0]:this.b.u[6]};k.Re=function(a){this.b.O&49152?this.b.Oa[0]=a:this.b.u[6]=a};k.Xd=function(){return this.b.u[7]}; -k.Ue=function(a){this.b.u[7]=a};k.Ib=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.eb[a]};k.Nb=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.eb[b]=a};k.Vd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.Se=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.Wd=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.Te=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a};k.Fd=function(a){return this.b.Lc[a-65504>>1]}; -k.Ee=function(a,b){this.b.Lc[b-65504>>1]=a};k.Ic=function(a){return 65520==a?(Jc(this.w)>>6)-1:0};k.Oc=function(){};k.re=function(){return 1};k.qf=function(){};k.Ed=function(){return this.b.pa};k.De=function(){this.b.pa=0};k.Ld=function(){return this.b.Kc};k.Ke=function(a,b){b&1||(a&=255);this.b.Kc=a};k.Qd=function(a,b){return b?0:this.b.Jb};k.Ne=function(a){gd(this.b,a)};k.qe=function(a,b){return b?0:this.b.mb&65280};k.pf=function(a){this.b.mb=a|255};k.Td=function(){return hd(this.b)}; -k.Qe=function(a){id(this.b,a&-1793|hd(this.b)&1792);this.b.J|=256};k.Nc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; -var O={},Rc=(O[61568]=[null,null,M.prototype.we,M.prototype.vf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.pe,M.prototype.nf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.ne,M.prototype.lf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.oe,M.prototype.mf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.me,M.prototype.kf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Jd,M.prototype.Ie,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Hd,M.prototype.Ge,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.Id,M.prototype.He,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Gd,M.prototype.Fe,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Pd,M.prototype.Me,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Kd,M.prototype.Je,"LKS"],O[65402]=[null,null,M.prototype.Md,M.prototype.Le,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Nd,M.prototype.Nc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Od,M.prototype.Nc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ve,M.prototype.uf, -"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.te,M.prototype.sf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ue,M.prototype.tf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.se,M.prototype.rf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Hb,M.prototype.Mb,"R0SET0"],O[65473]=[null,null,M.prototype.Hb,M.prototype.Mb,"R1SET0"],O[65474]=[null,null,M.prototype.Hb,M.prototype.Mb,"R2SET0"],O[65475]=[null,null,M.prototype.Hb,M.prototype.Mb,"R3SET0"],O[65476]=[null,null,M.prototype.Hb, -M.prototype.Mb,"R4SET0"],O[65477]=[null,null,M.prototype.Hb,M.prototype.Mb,"R5SET0"],O[65478]=[null,null,M.prototype.Ud,M.prototype.Re,"R6KERNEL"],O[65479]=[null,null,M.prototype.Xd,M.prototype.Ue,"R7KERNEL"],O[65480]=[null,null,M.prototype.Ib,M.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Ib,M.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Ib,M.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Ib,M.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Ib, -M.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Ib,M.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Vd,M.prototype.Se,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Wd,M.prototype.Te,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Fd,M.prototype.Ee,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ic,M.prototype.Oc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ic,M.prototype.Oc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.re,M.prototype.qf,"SYSID",1,1170],O[65526]= -[null,null,M.prototype.Ed,M.prototype.De,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Ld,M.prototype.Ke,"MB",1,1170],O[65530]=[null,null,M.prototype.Qd,M.prototype.Ne,"PIR"],O[65532]=[null,null,M.prototype.qe,M.prototype.pf,"SL"],O[65534]=[null,null,M.prototype.Td,M.prototype.Qe,"PSW"],O); -bb(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),qd(this,md?rd:sd);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},Da:function(a,b){a&1&&this.w.Ma(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+ -1]&255)<<8},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.ab=!0},gb:function(a,b){if(this.j&&null!=this.H){var c=this.j;xd(c,this.H+a,1,c.M)&&c.ca(!0)}return this.I(a,b)},ra:function(a,b){if(this.j&&null!=this.H){var c=this.j;xd(c,this.H+a,2,c.M)&&c.ca(!0)}return this.K(a,b)},Ea:function(a, -b,c){if(this.j&&null!=this.H){var d=this.j;xd(d,this.H+a,1,d.F)&&d.ca(!0)}this.f?this.v(a,b,c):this.G(a,b,c)},Xa:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;xd(d,this.H+a,2,d.F)&&d.ca(!0)}this.f?this.v(a,b,c):this.M(a,b,c)},fb:function(a){return this.D[a]},Y:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ea:function(a,b){a&1&&this.w.Ma(b,64,2);return this.F.getUint16(a,!0)},sa:function(a,b){a&1&&this.w.Ma(b,64,2);a= -this.P[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},Aa:function(a,b){this.D[a]=b;this.ab=!0},Ka:function(a,b,c){this.D[a]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Qa:function(a,b,c){a&1&&this.w.Ma(c,64,4);this.F.setUint16(a,b,!0);this.ab=!0},Ya:function(a,b,c){a&1&&this.w.Ma(c,64,4);this.P[a>>1]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, -b)+")",!0)}};function zc(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&wd(a,vd,!1),(a.g=c.g)&&ud(a,vd,!1))}function yd(a,b){b?--a.g||(a.ec=a.f?a.v:a.G,a.Xb=a.f?a.L:a.M):--a.A||(a.bc=a.I,a.ya=a.K)}function ud(a,b,c){c&&a.g||(a.ec=!a.f&&b[1]||a.v,a.Xb=!a.f&&b[3]||a.L);if(c||void 0===c)a.G=b[1]||a.v,a.M=b[3]||a.L}function wd(a,b,c){c&&a.A||(a.bc=b[0]||a.S,a.ya=b[2]||a.T);if(c||void 0===c)a.I=b[0]||a.S,a.K=b[2]||a.T}function qd(a,b){b||(b=zd);wd(a,b,void 0);ud(a,b,void 0)} -var zd=[],td=[K.prototype.da,K.prototype.Pa,K.prototype.Da,K.prototype.Za],vd=[K.prototype.gb,K.prototype.Ea,K.prototype.ra,K.prototype.Xa];if(Bb)var sd=[K.prototype.fb,K.prototype.Aa,K.prototype.ea,K.prototype.Qa],rd=[K.prototype.Y,K.prototype.Ka,K.prototype.sa,K.prototype.Ya]; -function Ad(a,b){x.call(this,"CPU",a,Ad,1);b=a.cycles||b;var c=a.multiplier||1;this.Ob=0;this.qb=b;this.kb=c;this.Rb=Math.round(this.qb/1E4)/100;this.xb=this.Rb*this.kb;this.C.W=!1;this.C.dc=!1;this.C.Ab=a.autoStart;this.C.Bb=!1;this.Tb=this.Da=0;this.Ub=a.csStart;this.Fb=a.csInterval;this.Gb=a.csStop;this.M=[];this.zc=this.Ae.bind(this);J(this)}B(Ad);var Bd=["power","reset"];k=Ad.prototype; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b=a.Da&&(a.Da+=a.Fb,c=!0);0<=a.Gb&&a.Gb<=Hd(a)&&(a.Fb=a.Gb=-1,Ed(a),a.ca(),c=!0);c&&a.i(Hd(a)+" cycles: checksum="+p(a.Tb))}} -k.va=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.la)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.sa/a.xb?b=1:d=!0;a.kb=b;b=a.Rb*a.kb;if(a.xb!=b){a.xb=b;b=a.xb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.nb()}Ub(a,a.T);a.T=0;a.S=Ba();a.Y=0;Jd(a);return d}function Nc(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.qb*a.kb/1E3*c|0,a.C.W&&(c+=Kd(a)),a.M[b][0]=c)} -function Ld(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Tb(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 Kd(a,b){var c=a.da-=a.b;a.b=a.L=0;b&&(a.da=0);return c} -k.Ae=function(){if(this.C.W){this.fc>=this.qb&&Jd(this,!0);this.Qa=0;this.Za=Ba();if(this.Y){var a=this.Za-this.Y;a>this.xc&&(this.S+=a,this.S>this.Za&&(this.S=this.Za))}try{do{var b=Ld(this,this.C.Bb?1:this.rb);try{this.pb(b)}catch(e){if("number"!=typeof e)throw e;}b=Kd(this,!0);this.Qa+=b;this.T+=b;Vb(this,b);Tb(this,b);this.Aa-=b;if(0>=this.Aa){this.Aa+=this.rb;15<=++this.yc&&(this.wa(),this.yc=0);break}}while(this.C.W)}catch(e){this.ca();this.A&&this.A.stop(Ba(),Hd(this));Ab(this,e.stack||e.message); -return}if(this.C.W){a=setTimeout;b=this.zc;this.Y=Ba();var c=this.xc;this.Qa&&(c=Math.round(c*this.Qa/this.rb));var c=c-(this.Y-this.Za),d=this.Y-this.S;d&&(this.sa=Math.round(this.T/(10*d))/100,864E5<=d&&(this.ea=0,Id(this)));if(0>c||this.sac&&(this.S-=c),c=0;this.fc+=this.Qa;this.Y+=c;a(b,c)}}}; -k.ob=function(a){if(zb(this))return!1;if(this.C.W)return this.i(this.toString()+" busy"),!1;Id(this);this.C.W=!0;this.C.dc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.nb(!0),this.A.start(this.S,Hd(this)));setTimeout(this.zc,0);return!0};k.pb=function(){return 0};k.ca=function(a){var b=!1;if(this.C.W){Kd(this);Ub(this,this.T);this.T=0;this.C.W=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Hd(this));b=!0}this.C.complete=a;return b}; -function Md(a){this.jb=+a.model||1170;this.uc=a.addrReset||0;Ad.call(this,a,6666667);this.sb=0;this.wc=255;1120==this.jb?(this.decode=Nd.bind(this),this.ra=this.nd,this.sb=8,this.wc=-1):(this.decode=Od.bind(this),this.ra=this.od);Pd(this);this.K=0;this.I=null;this.C.complete=!1}B(Md,Ad);k=Md.prototype;k.reset=function(){this.status("model "+this.jb);this.C.W&&this.ca();Pd(this);Dd(this);this.C.error=!1;this.parent.reset.call(this)}; -function Pd(a){a.U=65536;a.V=32768;a.Z=65535;a.X=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.uc,-1,-2,-3,-4,-5,-6,-7,-8];a.eb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.B=0;a.Ya=0;a.dd=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,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]];a.ja=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.Wb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Lc=[0,0,0,0,0,0,0,0];a.Kc=0;a.J=0;a.F=a.G=0;a.g=a.f=a.Qb=0;a.Ea=-1;Sb(a)}function Sb(a){a.Ca=0;a.gc=0;a.hc=0;a.Wa=0;a.pa=0;a.Jb=0;a.mb=255;a.Ka=0;a.Xa=0;a.Pa=262143;a.Sb=0;a.ua=0;a.I=null;a.w&&(Qd(a),a.bd=Jc(a.w))}function Qd(a){a.Ka?(a.P=65536,a.Pb=a.Wa&16?4186112:253952,a.aa=a.rd,a.ya=a.xe,a.Xb=a.wf,Dc(a.w,a.Wa&16?22:18)):(a.P=0,a.Pb=57344,a.aa=a.qd,a.ya=a.Jc,a.Xb=a.rc,Dc(a.w,16))} -function bd(a){var b=a.Ca;b&57344||(b=b&-3199|a.Xa<<5|a.Ya<<1);return b}function cd(a,b){b&=-3073;if(a.Ca!=b){b&57344&&!(a.Ca&57344)&&(a.gc=a.ua>>16&65535,a.hc=a.ua&65535);a.Ca=b;a.Xa=b>>5&3;a.Ya=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ka!=c&&(a.Ka=c,Qd(a))}}function dd(a){a.Ca&57344||(a.gc=a.ua>>16&65535);a=a.gc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function ed(a){a.Ca&57344||(a.hc=a.ua&65535);return a.hc} -function fd(a,b){1170>a.jb&&(b&=-49);a.Wa!=b&&(a.Wa=b,a.Pa=b&16?4194303:262143,Qd(a))}k.Ec=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.ea,this.kb]);a.set(2,Ic(this.w));return a.data()}; -k.restore=function(a){var b=a[1];this.ea=b[1];Id(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.O>>14&3;a.B!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.B]);a.O=b;a.J&=-3;a.J|=a.I?2:1}function gd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.J|=1}a.Jb=b}function U(a,b){a.J&256||(a.X=a.Z=b,a.V=0)}function Zd(a,b,c){a.J&256||(a.X=a.Z=a.U=b,a.V=c||0)} -function $d(a,b,c,d){a.J&256||(a.X=a.Z=a.U=b,a.V=(c^b)&(d^b))}function ue(a,b){a.J&256||(a.X=a.Z=a.U=b,a.V=a.X^a.U>>1)}function ve(a,b,c,d){a.J&256||(a.X=a.Z=a.U=b,a.V=(c^d)&(d^b))} -k.qa=function(a,b,c){if(!this.K){0>this.Ea?this.Ea=hd(this):this.B||(c=-3);var d=!1;-3==c&&(a=4,this.pa|=4,this.u[6]=4,d=!0);this.ua=a|4143316992;this.B=0;var e=this.ya(a|this.P),f=this.ya(a+2&65535|this.P);id(this,f&-12289|this.Ea>>2&12288);we(this,this.Ea,d);we(this,this.u[7],d);T(this,e);this.b-=5;this.J&=~(b|19);this.J|=129;this.Ea=-1;this.ld=a;this.fd=c;if(-3<=c)throw a;}};function xe(a){var b=ye(a),c=ye(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);T(a,b);id(a,c);a.J&=-17} +var Bb="undefined"!==typeof ArrayBuffer,Cb="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Db={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"},Eb={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,pc11:4096,paper:4096,disk:8192,read:16384,write:32768,rk11:65536,rl11:131072,dl11:262144,serial:262144,kw11:524288,timer:524288,speaker:16777216,computer:33554432,log:268435456,warn:536870912, +buffer:1073741824,halt:-2147483648};function Fb(a){x.call(this,"Panel",a,Fb,512);this.Ba=this.v=this.cb=this.yb=this.B=this.F=0;this.I=this.K=this.G=!1;this.L=Gb;this.g={};this.f={START:[1,1,!0,!1,this.Cd],STEP:[1,1,!1,!1,this.Dd],ENABLE:[1,1,!1,!1,this.yd],CONT:[1,1,!0,!1,this.wd],DEP:[0,0,!0,!1,this.xd],EXAM:[1,1,!0,!1,this.zd],LOAD:[1,1,!0,!1,this.Bd],TEST:[0,0,!0,!1,this.Ad]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.Ed,a]}B(Fb);var Gb=7;function Hb(a,b){return a.f[b]&&a.f[b][1]}k=Fb.prototype; +k.reset=function(){this.stop()}; +k.wa=function(a,b,c,d){if(this.A&&this.A.wa(a,b,c,d)||this.b&&this.b.wa(a,b,c,d)||this.j&&this.j.wa(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.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[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):this.parent.wa.call(this,a,b,c,d)}};k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;Kb(b,this,Lb);Mb(b,this.reset.bind(this));Nb(this);Ob(this)};k.Ia=function(a,b){b||(Pb(),this.reset());return!0};k.Ha=function(){return!0}; +function Qb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Nb(a,b){for(var c in a.g)Qb(a,c,null!=b?b:a.g[c])}function Rb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Ob(a){for(var b in a.f)Rb(a,b,a.f[b][1])}function Sb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ea()),c=8==(a.j&&a.j.ma||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} +function Ib(a,b){var c=a.f[b];Rb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Jb(a,b){var c=a.f[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}k.Cd=function(a){a||this.b.C.W||(a=this.b,a.w.reset(),Tb(a),Hb(this,"ENABLE")&&this.b.ob())};k.Dd=function(){};k.yd=function(a){a||this.b.ea()}; +k.wd=function(a){if(!a&&!this.b.C.W)if(Hb(this,"ENABLE"))this.b.ob();else{if((a=this.j)&&!xb(a,!0))qb(a,!0),a.pb(0,null),qb(a,!1);else try{var b=this.b.pb(1);0a.b.jb?8:16,c=65472<=a.Ba&&a.Ba<65472+b,b=c?1:2,c=c?15:a.w.Eb;Hb(a,"STEP")||(b=-b);pc(a,a.Ba&~c|a.Ba+b&c)} +function pc(a,b){a.Ba=b&a.w.Eb;b=a.Ba;for(var c=0;22>c;c++)rc(a,"A"+c,b&1<c;c++)rc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.w=this.Ga-1;this.v=this.B/this.Ga|0;this.hb=[];this.pa=0;this.A=!1;this.F=[];this.hd=[wc,xc,yc,zc];a=new K(this);Ac(a,this.j);this.da=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.oa;this.G=0;this.g=this.Eb;J(this)}B(uc); +var vc=8192,Dc=vc-1;function wc(a,b){var c=-1,d=this.controller,e=d.hb[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.hb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.pa),c;d.Ma(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.pa);return c} +function xc(a,b,c){var d=!1,e=this.controller,f=e.hb[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.hb[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?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.pa):(e.Ma(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, +b),!0,!e.pa))}function yc(a,b){var c=-1,d=this.controller;a=d.hb[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 this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.pa),c;d.Ma(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.pa);return c} +function zc(a,b,c){var d=!1,e=this.controller;a=e.hb[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?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.pa):(e.Ma(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.pa))} +function Ec(a,b){if(b!=a.G){for(var c=0;c>>a.oa,a.f[a.K]=a.da[a.I])}}k=uc.prototype;k.reset=function(){for(var a=0;a>>a.oa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Lb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.H+n;f=m+a.Ga;g-=n;h++;continue}}return Fc(1,f,g)}f=new K(a,f,n,a.Ga,d,e);Ac(f,a.j,l);a.da[h++]=f;f=m+a.Ga;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Gc[d]+" at "+na(b)),!0):Fc(2,b,c)}k.bc=function(a){return this.f[(a&this.g)>>>this.oa].cc(a&this.w,a)}; +function Hc(a,b){return a.da[(b&a.Eb)>>>a.oa]}k.ua=function(a){return this.f[(a&this.g)>>>this.oa].Aa(a&this.w,a)};function nc(a,b){a.A=!1;a.pa++;b=Hc(a,b).K(b&a.w,b);a.pa--;return b}k.Kb=function(a,b){this.f[(a&this.g)>>>this.oa].fc(a&this.w,b&255,a)};function Ic(a,b,c){a.A=!1;a.pa++;Hc(a,b).G(b&a.w,c&255,b);a.pa--}k.zb=function(a,b){this.f[(a&this.g)>>>this.oa].Yb(a&this.w,b&65535,a)};function Zb(a,b,c){a.A=!1;a.pa++;Hc(a,b).M(b&a.w,c&65535,b);a.pa--} +function Jc(a){for(var b=0,c=[],d=0;da.b.jb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],w=g[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Db=128;Qc(this.b,this.f.rc,1E3/60,!0)};k.Md=function(){return this.f.Db};k.Me=function(a){this.f.Db=a&192;this.f.Db&64||bd(this.b,this.f.Cb)};k.Od=function(){return cd(this.b)}; +k.Oe=function(a){dd(this.b,a&-129|this.b.Da&128)};k.Pd=function(){return ed(this.b)};k.Qd=function(){return fd(this.b)};k.Rd=function(){return this.b.Wa};k.Pe=function(a){gd(this.b,a)};k.ye=function(a){a=a>>1&63;var b=this.b.Wb[a>>1];return a&1?b>>16:b&65535};k.yf=function(a,b){b=b>>1&63;var c=b>>1;this.b.Wb[c]=b&1?this.b.Wb[c]&65535|(a&63)<<16:this.b.Wb[c]&-65536|a&65534};k.re=function(a){return this.b.R[1][a>>1&7]};k.rf=function(a,b){this.b.R[1][b>>1&7]=a&65295}; +k.pe=function(a){return this.b.R[1][(a>>1&7)+8]};k.pf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.qe=function(a){return this.b.ja[1][a>>1&7]};k.qf=function(a,b){b=b>>1&7;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.oe=function(a){return this.b.ja[1][(a>>1&7)+8]};k.nf=function(a,b){b=(b>>1&7)+8;this.b.ja[1][b]=a;this.b.R[1][b]&=65295};k.Ld=function(a){return this.b.R[0][a>>1&7]};k.Le=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Jd=function(a){return this.b.R[0][(a>>1&7)+8]}; +k.Je=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295};k.Kd=function(a){return this.b.ja[0][a>>1&7]};k.Ke=function(a,b){b=b>>1&7;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.Id=function(a){return this.b.ja[0][(a>>1&7)+8]};k.Ie=function(a,b){b=(b>>1&7)+8;this.b.ja[0][b]=a;this.b.R[0][b]&=65295};k.xe=function(a){return this.b.R[3][a>>1&7]};k.xf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.ve=function(a){return this.b.R[3][(a>>1&7)+8]};k.vf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295}; +k.we=function(a){return this.b.ja[3][a>>1&7]};k.wf=function(a,b){b=b>>1&7;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.ue=function(a){return this.b.ja[3][(a>>1&7)+8]};k.uf=function(a,b){b=(b>>1&7)+8;this.b.ja[3][b]=a;this.b.R[3][b]&=65295};k.Hb=function(a){a&=7;return this.b.O&2048?this.b.eb[a]:this.b.u[a]};k.Mb=function(a,b){b&=7;this.b.O&2048?this.b.eb[b]=a:this.b.u[b]=a};k.Wd=function(){return this.b.O&49152?this.b.Oa[0]:this.b.u[6]};k.Ue=function(a){this.b.O&49152?this.b.Oa[0]=a:this.b.u[6]=a}; +k.Zd=function(){return this.b.u[7]};k.Xe=function(a){this.b.u[7]=a};k.Ib=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.eb[a]};k.Nb=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.eb[b]=a};k.Xd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.Ve=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.Yd=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.We=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a}; +k.Hd=function(a){return this.b.Nc[a-65504>>1]};k.He=function(a,b){this.b.Nc[b-65504>>1]=a};k.Kc=function(a){return 65520==a?(Kc(this.w)>>6)-1:0};k.Qc=function(){};k.te=function(){return 1};k.tf=function(){};k.Gd=function(){return this.b.qa};k.Ge=function(){this.b.qa=0};k.Nd=function(){return this.b.Mc};k.Ne=function(a,b){b&1||(a&=255);this.b.Mc=a};k.Sd=function(a,b){return b?0:this.b.Jb};k.Qe=function(a){hd(this.b,a)};k.se=function(a,b){return b?0:this.b.mb&65280};k.sf=function(a){this.b.mb=a|255}; +k.Vd=function(){return id(this.b)};k.Te=function(a){jd(this.b,a&-1793|id(this.b)&1792);this.b.J|=256};k.Pc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +var O={},Sc=(O[61568]=[null,null,M.prototype.ye,M.prototype.yf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.re,M.prototype.rf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.pe,M.prototype.pf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.qe,M.prototype.qf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.oe,M.prototype.nf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Ld,M.prototype.Le,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Jd,M.prototype.Je,"KDPDR",8,1145,64],O[62688]= +[null,null,M.prototype.Kd,M.prototype.Ke,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Id,M.prototype.Ie,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Rd,M.prototype.Pe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Md,M.prototype.Me,"LKS"],O[65402]=[null,null,M.prototype.Od,M.prototype.Oe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Pd,M.prototype.Pc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Qd,M.prototype.Pc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.xe,M.prototype.xf, +"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.ve,M.prototype.vf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.we,M.prototype.wf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.ue,M.prototype.uf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Hb,M.prototype.Mb,"R0SET0"],O[65473]=[null,null,M.prototype.Hb,M.prototype.Mb,"R1SET0"],O[65474]=[null,null,M.prototype.Hb,M.prototype.Mb,"R2SET0"],O[65475]=[null,null,M.prototype.Hb,M.prototype.Mb,"R3SET0"],O[65476]=[null,null,M.prototype.Hb, +M.prototype.Mb,"R4SET0"],O[65477]=[null,null,M.prototype.Hb,M.prototype.Mb,"R5SET0"],O[65478]=[null,null,M.prototype.Wd,M.prototype.Ue,"R6KERNEL"],O[65479]=[null,null,M.prototype.Zd,M.prototype.Xe,"R7KERNEL"],O[65480]=[null,null,M.prototype.Ib,M.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Ib,M.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Ib,M.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Ib,M.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Ib, +M.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Ib,M.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Xd,M.prototype.Ve,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Yd,M.prototype.We,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Hd,M.prototype.He,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Kc,M.prototype.Qc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Kc,M.prototype.Qc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.te,M.prototype.tf,"SYSID",1,1170],O[65526]= +[null,null,M.prototype.Gd,M.prototype.Ge,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Nd,M.prototype.Ne,"MB",1,1170],O[65530]=[null,null,M.prototype.Sd,M.prototype.Qe,"PIR"],O[65532]=[null,null,M.prototype.se,M.prototype.sf,"SL"],O[65534]=[null,null,M.prototype.Vd,M.prototype.Te,"PSW"],O); +bb(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),rd(this,nd?sd:td);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},ba:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ya:function(a,b){a&1&&this.w.Ma(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+ +1]&255)<<8},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.ab=!0},gb:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,1,c.M)&&c.ea(!0)}return this.I(a,b)},ma:function(a,b){if(this.j&&null!=this.H){var c=this.j;yd(c,this.H+a,2,c.M)&&c.ea(!0)}return this.K(a,b)},Ea:function(a, +b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,1,d.F)&&d.ea(!0)}this.f?this.v(a,b,c):this.G(a,b,c)},Xa:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;yd(d,this.H+a,2,d.F)&&d.ea(!0)}this.f?this.v(a,b,c):this.M(a,b,c)},fb:function(a){return this.D[a]},Y:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ca:function(a,b){a&1&&this.w.Ma(b,64,2);return this.F.getUint16(a,!0)},sa:function(a,b){a&1&&this.w.Ma(b,64,2);a= +this.P[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ta:function(a,b){this.D[a]=b;this.ab=!0},Ka:function(a,b,c){this.D[a]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Qa:function(a,b,c){a&1&&this.w.Ma(c,64,4);this.F.setUint16(a,b,!0);this.ab=!0},Ya:function(a,b,c){a&1&&this.w.Ma(c,64,4);this.P[a>>1]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, +b)+")",!0)}};function Ac(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&xd(a,wd,!1),(a.g=c.g)&&vd(a,wd,!1))}function zd(a,b){b?--a.g||(a.fc=a.f?a.v:a.G,a.Yb=a.f?a.L:a.M):--a.A||(a.cc=a.I,a.Aa=a.K)}function vd(a,b,c){c&&a.g||(a.fc=!a.f&&b[1]||a.v,a.Yb=!a.f&&b[3]||a.L);if(c||void 0===c)a.G=b[1]||a.v,a.M=b[3]||a.L}function xd(a,b,c){c&&a.A||(a.cc=b[0]||a.S,a.Aa=b[2]||a.T);if(c||void 0===c)a.I=b[0]||a.S,a.K=b[2]||a.T}function rd(a,b){b||(b=Ad);xd(a,b,void 0);vd(a,b,void 0)} +var Ad=[],ud=[K.prototype.ba,K.prototype.Pa,K.prototype.ya,K.prototype.Za],wd=[K.prototype.gb,K.prototype.Ea,K.prototype.ma,K.prototype.Xa];if(Bb)var td=[K.prototype.fb,K.prototype.ta,K.prototype.ca,K.prototype.Qa],sd=[K.prototype.Y,K.prototype.Ka,K.prototype.sa,K.prototype.Ya]; +function Bd(a,b){x.call(this,"CPU",a,Bd,1);b=a.cycles||b;var c=a.multiplier||1;this.Ob=0;this.qb=b;this.kb=c;this.gc=Math.round(this.qb/1E4)/100;this.xb=this.gc*this.kb;this.C.W=!1;this.C.ec=!1;this.C.Ab=a.autoStart;this.C.Bb=!1;this.Tb=this.ya=0;this.Ub=a.csStart;this.Fb=a.csInterval;this.Gb=a.csStop;this.M=[];this.Bc=this.De.bind(this);J(this)}B(Bd);var Cd=["power","reset"];k=Bd.prototype; +k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b=a.ya&&(a.ya+=a.Fb,c=!0);0<=a.Gb&&a.Gb<=Id(a)&&(a.Fb=a.Gb=-1,Fd(a),a.ea(),c=!0);c&&a.i(Id(a)+" cycles: checksum="+p(a.Tb))}} +k.wa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.la)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.sa/a.xb?b=1:d=!0;a.kb=b;b=a.gc*a.kb;if(a.xb!=b){a.xb=b;b=a.xb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.nb()}Vb(a,a.T);a.T=0;a.S=Ba();a.Y=0;Kd(a);return d}function Oc(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Qc(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.qb*a.kb/1E3*c|0,a.C.W&&(c+=Ld(a)),a.M[b][0]=c)} +function Md(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Ub(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 Ld(a,b){var c=a.ba-=a.b;a.b=a.L=0;b&&(a.ba=0);return c} +k.De=function(){if(this.C.W){this.hc>=this.qb&&Kd(this,!0);this.Qa=0;this.Za=Ba();if(this.Y){var a=this.Za-this.Y;a>this.zc&&(this.S+=a,this.S>this.Za&&(this.S=this.Za))}try{do{var b=Md(this,this.C.Bb?1:this.rb);try{this.pb(b)}catch(e){if("number"!=typeof e)throw e;}b=Ld(this,!0);this.Qa+=b;this.T+=b;Wb(this,b);Ub(this,b);this.ta-=b;if(0>=this.ta){this.ta+=this.rb;15<=++this.Ac&&(this.xa(),this.Ac=0);break}}while(this.C.W)}catch(e){this.ea();this.A&&this.A.stop(Ba(),Id(this));Ab(this,e.stack||e.message); +return}if(this.C.W){a=setTimeout;b=this.Bc;this.Y=Ba();var c=this.zc;this.Qa&&(c=Math.round(c*this.Qa/this.rb));var c=c-(this.Y-this.Za),d=this.Y-this.S;d&&(this.sa=Math.round(this.T/(10*d))/100,864E5<=d&&(this.ca=0,Jd(this)));if(0>c||this.sac&&(this.S-=c),c=0;this.hc+=this.Qa;this.Y+=c;a(b,c)}}}; +k.ob=function(a){if(zb(this))return!1;if(this.C.W)return this.i(this.toString()+" busy"),!1;Jd(this);this.C.W=!0;this.C.ec=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.nb(!0),this.A.start(this.S,Id(this)));setTimeout(this.Bc,0);return!0};k.pb=function(){return 0};k.ea=function(a){var b=!1;if(this.C.W){Ld(this);Vb(this,this.T);this.T=0;this.C.W=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Id(this));b=!0}this.C.complete=a;return b}; +function Nd(a){this.jb=+a.model||1170;this.wc=a.addrReset||0;Bd.call(this,a,6666667);this.sb=0;this.yc=255;1120==this.jb?(this.decode=Od.bind(this),this.ma=this.pd,this.sb=8,this.yc=-1):(this.decode=Pd.bind(this),this.ma=this.qd);Qd(this);this.K=0;this.I=null;this.Pb=[];this.C.complete=!1}B(Nd,Bd);k=Nd.prototype;k.uc=function(){for(var a=192,b=0;bc.Xb&&(c.Xb=a,a+=4)}}; +k.reset=function(){this.status("model "+this.jb);this.C.W&&this.ea();Qd(this);Ed(this);this.C.error=!1;this.parent.reset.call(this)}; +function Qd(a){a.U=65536;a.V=32768;a.Z=65535;a.X=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.wc,-1,-2,-3,-4,-5,-6,-7,-8];a.eb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.B=0;a.Ya=0;a.Rc=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,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]];a.ja=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0]];a.Wb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Nc=[0,0,0,0,0,0,0,0];a.Mc=0;a.J=0;a.F=a.G=0;a.g=a.f=a.Rb=0;a.Ea=-1;Tb(a)}function Tb(a){a.Da=0;a.ic=0;a.jc=0;a.Wa=0;a.qa=0;a.Jb=0;a.mb=255;a.Ka=0;a.Xa=0;a.Pa=262143;a.Sb=0;a.va=0;a.I=null;a.w&&(Rd(a),a.ed=Kc(a.w))}function Rd(a){a.Ka?(a.P=65536,a.Qb=a.Wa&16?4186112:253952,a.aa=a.td,a.Aa=a.ze,a.Yb=a.zf,Ec(a.w,a.Wa&16?22:18)):(a.P=0,a.Qb=57344,a.aa=a.sd,a.Aa=a.Lc,a.Yb=a.sc,Ec(a.w,16))} +function cd(a){var b=a.Da;b&57344||(b=b&-3199|a.Xa<<5|a.Ya<<1);return b}function dd(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.ic=a.va>>16&65535,a.jc=a.va&65535);a.Da=b;a.Xa=b>>5&3;a.Ya=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ka!=c&&(a.Ka=c,Rd(a))}}function ed(a){a.Da&57344||(a.ic=a.va>>16&65535);a=a.ic;a&65280&&(a=(a<<8|a>>8)&65535);return a}function fd(a){a.Da&57344||(a.jc=a.va&65535);return a.jc} +function gd(a,b){1170>a.jb&&(b&=-49);a.Wa!=b&&(a.Wa=b,a.Pa=b&16?4194303:262143,Rd(a))}k.Gc=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.ca,this.kb]);a.set(2,Jc(this.w));return a.data()}; +k.restore=function(a){var b=a[1];this.ca=b[1];Jd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.O>>14&3;a.B!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.B]);a.O=b;a.J&=-3;a.J|=a.I?2:1}function hd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.J|=1}a.Jb=b}function U(a,b){a.J&256||(a.X=a.Z=b,a.V=0)}function $d(a,b,c){a.J&256||(a.X=a.Z=a.U=b,a.V=c||0)} +function ue(a,b,c,d){a.J&256||(a.X=a.Z=a.U=b,a.V=(c^b)&(d^b))}function ve(a,b){a.J&256||(a.X=a.Z=a.U=b,a.V=a.X^a.U>>1)}function we(a,b,c,d){a.J&256||(a.X=a.Z=a.U=b,a.V=(c^d)&(d^b))} +k.ra=function(a,b,c){if(!this.K){0>this.Ea?this.Ea=id(this):this.B||(c=-3);var d=!1;-3==c&&(a=4,this.qa|=4,this.u[6]=4,d=!0);this.va=a|4143316992;this.B=0;var e=this.Aa(a|this.P),f=this.Aa(a+2&65535|this.P);jd(this,f&-12289|this.Ea>>2&12288);xe(this,this.Ea,d);xe(this,this.u[7],d);T(this,e);this.b-=5;this.J&=~(b|19);this.J|=129;this.Ea=-1;this.od=a;this.md=c;if(-3<=c)throw a;}};function ye(a){var b=ze(a),c=ze(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);T(a,b);jd(a,c);a.J&=-17} k.Na=function(a){var b=a>>13&31;31>b&&(a=this.Wa&32?this.Wb[b]+(a&8190)&4194302:a&-3932161);return a}; -function Zb(a,b,c){var d,e,f;if(!(c&a.Ka))return f=b&65535,57344<=f&&(f|=a.Pb),f;d=b>>13;a.Wa&a.dd[a.B]||(d&=7);e=a.R[a.B][d];f=(a.ja[a.B][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=a.Na(f));if(a.K)return f;f>=a.bd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& -8128)&&(g|=16384));a.R[a.B][d]=e;if(f!=(4194170&a.Pa)||a.B)a.Xa=a.B,a.Ya=d;g&&(g&57344&&(0<=a.Ea&&(g|=128),a.Ca&57344||(g|=a.Ca&4096|a.Xa<<5|a.Ya<<1,cd(a,a.Ca&-61695|g&61694)),a.qa(168,64,-1)),a.Ca&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Ca|=4096,a.Ca&512&&(a.J|=64)));return f}function ze(a,b){return a.w.ac(b)}function ye(a){var b=a.ya(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} -function we(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.ua=a.ua&65535|(a.ua&-65536)<<8|16121856;c||a.ra(4,-2,d);a.Xb(d,b)} -function Ae(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.qa(4,0,-2),0;case 1:return 6==c&&a.ra(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ra(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.ya(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ra(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ya(e)|g;a.b-=8;break;case 6:return e=a.ya(Wd(a,2)),e=e+a.u[c]&65535,6==c&&a.ra(d, -0,e),a.b-=6,e|g;case 7:return e=a.ya(Wd(a,2)),e=e+a.u[c]&65535,e=a.ya(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ua=a.ua&65535|(a.ua&-65536)<<8|(f<<3&248|c)<<16;return e}k.nd=function(a,b,c){!this.B&&0>=b&&c<=this.mb&&(this.J|=32)};k.od=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.mb&&(c<=this.mb-32?this.qa(4,0,-3):(this.pa|=8,this.J|=32)))};function nc(a,b){a.K++;b=a.Jc(Zb(a,b,2));a.K--;return b}k.qd=function(a,b,c){a=Ae(this,a,b,c);3932160<=a&&(a=this.Na(a));return a}; -k.rd=function(a,b,c){return Zb(this,Ae(this,a,b,c),c)};k.Jc=function(a){3932160<=a&&(a=this.Na(a));return this.w.ta(this.Sb=a)};k.xe=function(a){return this.w.ta(this.Sb=Zb(this,a,2))};k.rc=function(a,b){3932160<=a&&(a=this.Na(a));this.w.zb(this.Sb=a,b&65535)};k.wf=function(a,b){this.w.zb(this.Sb=Zb(this,a,4),b)}; -function Be(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Ae(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=a.ya(d|c&a.P),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Oa[a.O>>12&3];return c}function Ce(a,b,c,d){a.ua=a.ua&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Ae(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=Zb(a,e|c&65536,4),a.B=a.O>>14&3,a.w.zb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Oa[a.O>>12&3]=d} -function De(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?ze(a,a.aa(b,c,3)):a.u[c+a.sb]&a.wc}function Ee(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.w.ta(a.aa(b,c,2)):a.u[c+a.sb]}function Fe(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Ae(a,b,c,8)}function Ge(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ze(a,a.aa(b,c,3)):a.u[c]&255}function He(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ta(a.aa(b,c,2)):a.u[c]} -function Ie(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Qb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ze(a,e)),e&1&&a.b--,a.w.Kb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.zb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.ta(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} -function Je(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.w.Kb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Ke(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.w.zb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.pb=function(a){this.C.complete=!0;var b=this.j?Le(this.j)?1:this.C.dc?-1:0:0,c=a?this.C.dc?0:1:-1;this.C.dc=!1;this.da=this.b=a;do{if(b){if(Me(this.j,this.u[7],c)){this.ca();break}c||c++;b++}if(this.J){if(a=this.J&11)if(a=!1,this.J&2){var d=160,e=(this.Jb&224)>>5,f=this.I&&this.I.lb>e?this.I:null;f&&(d=f.qc,e=f.lb);e>(this.O&224)>>5?(this.J&8&&(Wd(this,2),this.J&=-9),this.qa(d,0,-9),e=!0):e=!1;e&&(f&&Xd(this,f),a=!0);this.I||this.Jb||(this.J&=-3)}else this.J&1&&this.J++;if(a){if(b&&Me(this.j,this.u[7], -c)){this.ca();break}if(0>c)break}if(this.J&112&&Yd(this)){if(b&&Me(this.j,this.u[7],c)){this.ca();break}if(0>c)break}}this.J=this.J&15|this.O&16;this.decode(Vd(this))}while(0>1|b<<16;ue(this,a);return a&65535}function Se(a,b){a=b&128|b>>1|b<<8;ue(this,a<<8);return a&255}function Te(a,b){a=b&~a;U(this,a);return a}function Ue(a,b){a=b&~a;U(this,a<<8);return a}function Ve(a,b){a|=b;U(this,a);return a}function We(a,b){a|=b;U(this,a<<8);return a}function Xe(a,b){a=~b|65536;Zd(this,a);return a&65535} -function Ye(a,b){a=~b|256;Zd(this,a<<8);return a&255}function Ze(a,b){a=b-a;this.J&256||(this.X=this.Z=a,this.V=b&(b^a));return a&65535}function $e(a,b){a=b-a;var c=a<<8;b<<=8;this.J&256||(this.X=this.Z=c,this.V=b&(b^c));return a&255}function af(a,b){a=b+a;this.J&256||(this.X=this.Z=a,this.V=a&(b^a));return a&65535}function bf(a,b){a=b+a;var c=a<<8;this.J&256||(this.X=this.Z=c,this.V=c&(b<<8^c));return a&255}function cf(a,b){a=-b;Zd(this,a,a&b&32768);return a&65535} -function df(a,b){a=-b;Zd(this,a<<8,(a&b&128)<<8);return a&255}function ef(a,b){a=b<<1|this.U>>16&1;ue(this,a);return a&65535}function ff(a,b){a=b<<1|this.U>>16&1;ue(this,a<<8);return a&255}function gf(a,b){a=(this.U&65536|b)>>1|b<<16;ue(this,a);return a&65535}function hf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ue(this,a<<8);return a&255}function jf(a,b){var c=b-a;ve(this,c,a,b);return c&65535}function kf(a,b){var c=b-a;ve(this,c<<8,a<<8,b<<8);return c&255} -function lf(a,b){this.J&256||(this.X=this.Z=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function mf(a,b){a^=b;U(this,a);return a&65535}function nf(a){V(this,a,Ee(this,a),Ne);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function of(a){var b=He(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.X=this.Z=c;this.b-=(this.g?6:7)+b} -function pf(a){var b=He(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function qf(a){W(this,a,!Rd(this))}function rf(a){W(this,a,Rd(this))} -function sf(a){V(this,a,Ee(this,a),Te);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function tf(a){Ie(this,a,De(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function uf(a){V(this,a,Ee(this,a),Ve);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function vf(a){Ie(this,a,De(this,a),We);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function wf(a){var b=Ee(this,a);a=He(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function xf(a){var b=De(this,a);a=Ge(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function yf(a){W(this,a,Td(this))}function zf(a){W(this,a,!Ud(this)==!Sd(this))}function Af(a){W(this,a,!Td(this)&&!Ud(this)==!Sd(this))}function Bf(a){W(this,a,!Rd(this)&&!Td(this))} -function Cf(a){W(this,a,Td(this)||!Ud(this)!=!Sd(this))}function Df(a){W(this,a,Rd(this)||Td(this))}function Ef(a){W(this,a,!Ud(this)!=!Sd(this))}function Ff(a){W(this,a,Ud(this))}function Gf(a){W(this,a,!Td(this))}function Hf(a){W(this,a,!Ud(this))}function If(){this.qa(12,0,-8)}function Jf(a){W(this,a,!0)}function Kf(a){W(this,a,!Sd(this))}function Lf(a){W(this,a,Sd(this))}function Mf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Z=1);a&8&&(this.X=0);this.b-=5} -function Nf(a){var b=Ee(this,a);a=He(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ve(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Of(a){var b=De(this,a);a=Ge(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ve(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} -function Pf(a){var b=He(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Z=d>>16|d,this.X=d>>16):(this.V=32768,this.Z=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.X=0,this.V=32768,this.U=65536,this.b-=7}function Qf(){this.qa(24,0,-8);this.b-=20} -function Rf(){this.O&49152?(this.pa|=128,this.qa(4,0,-7)):(this.v&&1120==this.jb&&this.v.setData(this.u[0],!0),this.j?Sf(this.j):this.ca());this.b-=7}function Tf(){this.qa(16,0,-8);this.b-=20}var Uf=[0,7,7,10,7,11,9,13];function Vf(a){this.L=this.b;T(this,Fe(this,a));this.b=this.L-Uf[this.g]}var Wf=[0,14,14,17,14,18,16,20];function Xf(a){this.L=this.b;var b=Fe(this,a);a=a>>6&7;we(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.L-Wf[this.g]} -var Yf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Zf(a){var b=Ee(this,a);this.L=this.b;U(this,Ke(this,a,b));this.b=this.L-Yf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function $f(a){var b=De(this,a);U(this,Je(this,a,b,65535)<<8);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var ag=[7,13,13,17,14,18,17,21]; -function bg(a){var b=He(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&256||(this.X=b>>16,this.Z=this.X|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function ig(a){V(this,a,Ee(this,a),jf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function jg(a){V(this,a,0,lf);this.b-=this.g?9:3+(7==this.f?2:0)}function kg(){this.qa(28,0,-8)} -function lg(){this.v&&(this.v.oc(this.u[7],!0),this.v.setData(this.u[0],!0));this.J|=8;Wd(this,-2);this.b-=3}function mg(a){V(this,a,this.u[(a>>6&7)+this.sb],mf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Sf(b)):b=!1;b||this.qa(8,0,-8)}function Nd(a){ng[a>>12].call(this,a)}function og(a){pg[a>>6&3].call(this,a)}function qg(a){rg[a>>6&3].call(this,a)}function sg(a){tg[a>>6&3].call(this,a)} -function ug(a){vg[a&15].call(this,a)}function wg(a){xg[a&15].call(this,a)}function yg(a){zg[a>>6&3].call(this,a)}function Ag(a){Bg[a>>6&3].call(this,a)}function Cg(a){Dg[a>>6&3].call(this,a)} -var ng=[function(a){Eg[a>>8&15].call(this,a)},Zf,Nf,wf,sf,uf,nf,X,function(a){Fg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,ig,X],Eg=[function(a){Gg[a>>4&15].call(this,a)},Jf,Gf,yf,zf,Ef,Af,Cf,Xf,Xf,og,qg,sg,X,X,X],pg=[function(a){Zd(this,Ke(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ze);this.b-=this.g?9:3+(7==this.f?2:0)}],rg=[function(a){V(this,a,0, -cf);this.b-=this.g?11:6},function(a){V(this,a,Rd(this)?1:0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Rd(this)?1:0,jf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=He(this,a);Zd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],tg=[function(a){V(this,a,0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)}], -Gg=[function(a){Hg[a&15].call(this,a)},X,X,X,Vf,Vf,Vf,Vf,eg,X,ug,wg,jg,jg,jg,jg],Hg=[Rf,lg,fg,If,Tf,dg,X,X,X,X,X,X,X,X,X,X],vg=[cg,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Mf,function(){this.Z=1;this.b-=5},Mf,Mf,Mf,function(){this.X=0;this.b-=5},Mf,Mf,Mf,Mf,Mf,Mf,Mf],xg=[cg,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},gg,function(){this.Z=0;this.b-=5},gg,gg,gg,function(){this.X=32768;this.b-=5},gg,gg,gg,gg,gg,gg,gg],Fg=[Hf,Ff,Bf,Df,Kf,Lf,qf,rf,Qf,kg,yg, -Ag,Cg,X,X,X],zg=[function(a){Zd(this,Je(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ie(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ie(this,a,1,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ie(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)}],Bg=[function(a){Ie(this,a,0,df);this.b-=this.g?11:6},function(a){Ie(this,a,Rd(this)?1:0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ie(this,a,Rd(this)?1:0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= -Ge(this,a);Zd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Dg=[function(a){Ie(this,a,0,hf);this.b-=this.g?9+(this.Qb&1):3+(7==this.f?2:0)},function(a){Ie(this,a,0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ie(this,a,0,Se);this.b-=this.g?9+(this.Qb&1):3+(7==this.f?2:0)},function(a){Ie(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)}];function Od(a){Ig[a>>12].call(this,a)} -var Ig=[function(a){Jg[a>>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.ya(a|this.P);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.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.J|=1,this.J&=-3),this.b-=5):X.call(this,a)},ug,wg,jg,jg,jg,jg],Og=[Rf,lg,function(){xe(this);this.J|=this.O&16;this.b-=13},If,Tf,dg,fg,function(){this.qa(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.ia=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.G=t(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.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.gb,a,b),(a=Ea(a,b))?(c.A=a.ga,c.ia=a.ia):c.g=null);Rg(c)})}}B(Qg);k=Qg.prototype; -k.Fa=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Rg(this)};k.Ia=function(){this.ia&&(this.j&&Sg(this.j,this.id,this.B,this.f,this.ia),delete this.ia);return!0};k.Ha=function(){return!0}; -function Rg(a){if(!yb(a)){if(a.g){if(!a.A||!a.w)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.le,Qg.prototype.jf,null,null,null,a.f>>1],c);if(Jb(a.w,a,b)){b=a.F=!0;break a}}else if(Ac(a.w,b,a.f,pd)){for(c=0;c>>f.na;0>>=f.na;0>>a.na;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)),v=h,u=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= -b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(u)for(G(a,"loading "+q(u)+" bytes at "+q(r)+"-"+q(r+u-1),4096);u--;)Hc(a.w,r++,b[v++]&255);else r&1?a.b.ca():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.sc&&c<=la.cd&&(b=c-(la.sc-la.Qc));b&&(a.preventDefault&&a.preventDefault(),d.cc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Sc&&(b=la.Rc);d.cc(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.cc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;var e=this;this.ea=Qc(48,4,262144);this.Y=Nc(this.b,function(){var a;a=-1;e.G.length&&(a=e.G.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.da&&97<=a&&122>a&&(a-=32),Pc(e.b,e.Y,1E3/Math.round(e.P/10)));0<=a&&(e.K=a,e.f&128?e.K|=49152:e.f|=128,e.f&64&&Oc(c,e.ea))});this.M=Qc(52,4,262144);this.sa=Nc(this.b,function(){e.g|=128;e.g&64&&Oc(c,e.M)});Jb(b,this,Zg);Lb(b,this.reset.bind(this));J(this)}; -k.Hc=function(){if(!this.I){var a=Cd(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.fb)return;b=ya(b[1]);if(this.I=ob(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.gb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ia=function(a,b){if(!b)if(this.Hc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ha=function(a){return a?this.save():!0};k.reset=function(){$g(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return $g(this)};function $g(a){a.K=0;a.f=0;a.g=128;a.G=[];return!0}k.cc=function(a){if("number"==typeof a)this.G.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.T||8,c=a-this.F%a,this.T&&(b=ta("",c)));this.S&&!this.F&&c&&(b=String.fromCharCode(this.S)+b);this.v.value+=b;this.v.scrollTop=this.v.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.sa,1E3/Math.round(this.ra/10));this.g&=-129};var ah={},Zg=(ah[65392]=[null,null,Xg.prototype.Zd,Xg.prototype.We,"RCSR"],ah[65394]=[null,null,Xg.prototype.Yd,Xg.prototype.Ve,"RBUF"],ah[65396]=[null,null,Xg.prototype.ze,Xg.prototype.yf,"XCSR"],ah[65398]=[null,null,Xg.prototype.ye,Xg.prototype.xf,"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.P){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,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;this.Y=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.S=Qc(56,4,4096);this.ea=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.la;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.gb,e,f),(e=Ea(e,f))&&Hh(a,b,c,d,e.ga,e.Sa, -e.Ra));a.C.ib=!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.fa);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.Zb?"":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.la;if(d)a.controller.N('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{mb(a.controller.gb,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.fa=h.length;a.ka=h[0].length;a.ha=h[0][0].length;var l=h[0][0][0];a.xa=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 v=l.bytes;if(void 0!==v&&v.length){for(var u=m<<2,A=v.length;A>2,e=Array(d),f=0;f>13;a.Wa&a.Rc[a.B]||(d&=7);e=a.R[a.B][d];f=(a.ja[a.B][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=a.Na(f));if(a.K)return f;f>=a.ed&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& +8128)&&(g|=16384));a.R[a.B][d]=e;if(f!=(4194170&a.Pa)||a.B)a.Xa=a.B,a.Ya=d;g&&(g&57344&&(0<=a.Ea&&(g|=128),a.Da&57344||(g|=a.Da&4096|a.Xa<<5|a.Ya<<1,dd(a,a.Da&-61695|g&61694)),a.ra(168,64,-1)),a.Da&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function Ae(a,b){return a.w.bc(b)}function ze(a){var b=a.Aa(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} +function xe(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.va=a.va&65535|(a.va&-65536)<<8|16121856;c||a.ma(4,-2,d);a.Yb(d,b)} +function Be(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.ra(4,0,-2),0;case 1:return 6==c&&a.ma(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ma(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Aa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ma(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Aa(e)|g;a.b-=8;break;case 6:return e=a.Aa(Xd(a,2)),e=e+a.u[c]&65535,6==c&&a.ma(d, +0,e),a.b-=6,e|g;case 7:return e=a.Aa(Xd(a,2)),e=e+a.u[c]&65535,e=a.Aa(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.va=a.va&65535|(a.va&-65536)<<8|(f<<3&248|c)<<16;return e}k.pd=function(a,b,c){!this.B&&0>=b&&c<=this.mb&&(this.J|=32)};k.qd=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.mb&&(c<=this.mb-32?this.ra(4,0,-3):(this.qa|=8,this.J|=32)))};function oc(a,b){a.K++;b=a.Lc(mc(a,b,2));a.K--;return b}k.sd=function(a,b,c){a=Be(this,a,b,c);3932160<=a&&(a=this.Na(a));return a}; +k.td=function(a,b,c){return mc(this,Be(this,a,b,c),c)};k.Lc=function(a){3932160<=a&&(a=this.Na(a));return this.w.ua(this.Sb=a)};k.ze=function(a){return this.w.ua(this.Sb=mc(this,a,2))};k.sc=function(a,b){3932160<=a&&(a=this.Na(a));this.w.zb(this.Sb=a,b&65535)};k.zf=function(a,b){this.w.zb(this.Sb=mc(this,a,4),b)}; +function Ce(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Be(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=a.Aa(d|c&a.P),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Oa[a.O>>12&3];return c}function De(a,b,c,d){a.va=a.va&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Be(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=mc(a,e|c&65536,4),a.B=a.O>>14&3,a.w.zb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Oa[a.O>>12&3]=d} +function Ee(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?Ae(a,a.aa(b,c,3)):a.u[c+a.sb]&a.yc}function Fe(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c+a.sb]}function Ge(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Be(a,b,c,8)}function He(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ae(a,a.aa(b,c,3)):a.u[c]&255}function Ie(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.ua(a.aa(b,c,2)):a.u[c]} +function Je(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Rb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,Ae(a,e)),e&1&&a.b--,a.w.Kb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.zb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.ua(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} +function Ke(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.w.Kb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Le(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.w.zb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.pb=function(a){this.C.complete=!0;var b=this.j?Me(this.j)?1:this.C.ec?-1:0:0,c=a?this.C.ec?0:1:-1;this.C.ec=!1;this.ba=this.b=a;do{if(b){if(Ne(this.j,this.u[7],c)){this.ea();break}c||c++;b++}if(this.J){if(a=this.J&11)if(a=!1,this.J&2){var d=160,e=(this.Jb&224)>>5,f=this.I&&this.I.lb>e?this.I:null;f&&(d=f.Xb,e=f.lb);e>(this.O&224)>>5?(this.J&8&&(Xd(this,2),this.J&=-9),this.ra(d,0,-9),e=!0):e=!1;e&&(f&&Yd(this,f),a=!0);this.I||this.Jb||(this.J&=-3)}else this.J&1&&this.J++;if(a){if(b&&Ne(this.j,this.u[7], +c)){this.ea();break}if(0>c)break}if(this.J&112&&Zd(this)){if(b&&Ne(this.j,this.u[7],c)){this.ea();break}if(0>c)break}}this.J=this.J&15|this.O&16;this.decode(Wd(this))}while(0>1|b<<16;ve(this,a);return a&65535}function Te(a,b){a=b&128|b>>1|b<<8;ve(this,a<<8);return a&255}function Ue(a,b){a=b&~a;U(this,a);return a}function Ve(a,b){a=b&~a;U(this,a<<8);return a}function We(a,b){a|=b;U(this,a);return a}function Xe(a,b){a|=b;U(this,a<<8);return a}function Ye(a,b){a=~b|65536;$d(this,a);return a&65535} +function Ze(a,b){a=~b|256;$d(this,a<<8);return a&255}function $e(a,b){a=b-a;this.J&256||(this.X=this.Z=a,this.V=b&(b^a));return a&65535}function af(a,b){a=b-a;var c=a<<8;b<<=8;this.J&256||(this.X=this.Z=c,this.V=b&(b^c));return a&255}function bf(a,b){a=b+a;this.J&256||(this.X=this.Z=a,this.V=a&(b^a));return a&65535}function cf(a,b){a=b+a;var c=a<<8;this.J&256||(this.X=this.Z=c,this.V=c&(b<<8^c));return a&255}function df(a,b){a=-b;$d(this,a,a&b&32768);return a&65535} +function ef(a,b){a=-b;$d(this,a<<8,(a&b&128)<<8);return a&255}function ff(a,b){a=b<<1|this.U>>16&1;ve(this,a);return a&65535}function gf(a,b){a=b<<1|this.U>>16&1;ve(this,a<<8);return a&255}function hf(a,b){a=(this.U&65536|b)>>1|b<<16;ve(this,a);return a&65535}function jf(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ve(this,a<<8);return a&255}function kf(a,b){var c=b-a;we(this,c,a,b);return c&65535}function lf(a,b){var c=b-a;we(this,c<<8,a<<8,b<<8);return c&255} +function mf(a,b){this.J&256||(this.X=this.Z=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function nf(a,b){a^=b;U(this,a);return a&65535}function of(a){V(this,a,Fe(this,a),Oe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function pf(a){var b=Ie(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.X=this.Z=c;this.b-=(this.g?6:7)+b} +function qf(a){var b=Ie(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function rf(a){W(this,a,!Sd(this))}function sf(a){W(this,a,Sd(this))} +function tf(a){V(this,a,Fe(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function uf(a){Je(this,a,Ee(this,a),Ve);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function vf(a){V(this,a,Fe(this,a),We);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function wf(a){Je(this,a,Ee(this,a),Xe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function xf(a){var b=Fe(this,a);a=Ie(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function yf(a){var b=Ee(this,a);a=He(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function zf(a){W(this,a,Ud(this))}function Af(a){W(this,a,!Vd(this)==!Td(this))}function Bf(a){W(this,a,!Ud(this)&&!Vd(this)==!Td(this))}function Cf(a){W(this,a,!Sd(this)&&!Ud(this))} +function Df(a){W(this,a,Ud(this)||!Vd(this)!=!Td(this))}function Ef(a){W(this,a,Sd(this)||Ud(this))}function Ff(a){W(this,a,!Vd(this)!=!Td(this))}function Gf(a){W(this,a,Vd(this))}function Hf(a){W(this,a,!Ud(this))}function If(a){W(this,a,!Vd(this))}function Jf(){this.ra(12,0,-8)}function Kf(a){W(this,a,!0)}function Lf(a){W(this,a,!Td(this))}function Mf(a){W(this,a,Td(this))}function Nf(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Z=1);a&8&&(this.X=0);this.b-=5} +function Of(a){var b=Fe(this,a);a=Ie(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;we(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Pf(a){var b=Ee(this,a);a=He(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);we(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} +function Qf(a){var b=Ie(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Z=d>>16|d,this.X=d>>16):(this.V=32768,this.Z=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.X=0,this.V=32768,this.U=65536,this.b-=7}function Rf(){this.ra(24,0,-8);this.b-=20} +function Sf(){this.O&49152?(this.qa|=128,this.ra(4,0,-7)):(this.v&&1120==this.jb&&this.v.setData(this.u[0],!0),this.j?Tf(this.j):this.ea());this.b-=7}function Uf(){this.ra(16,0,-8);this.b-=20}var Vf=[0,7,7,10,7,11,9,13];function Wf(a){this.L=this.b;T(this,Ge(this,a));this.b=this.L-Vf[this.g]}var Xf=[0,14,14,17,14,18,16,20];function Yf(a){this.L=this.b;var b=Ge(this,a);a=a>>6&7;xe(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.L-Xf[this.g]} +var Zf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function $f(a){var b=Fe(this,a);this.L=this.b;U(this,Le(this,a,b));this.b=this.L-Zf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function ag(a){var b=Ee(this,a);U(this,Ke(this,a,b,65535)<<8);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var bg=[7,13,13,17,14,18,17,21]; +function cg(a){var b=Ie(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&256||(this.X=b>>16,this.Z=this.X|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function jg(a){V(this,a,Fe(this,a),kf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function kg(a){V(this,a,0,mf);this.b-=this.g?9:3+(7==this.f?2:0)}function lg(){this.ra(28,0,-8)} +function mg(){this.v&&(this.v.qc(this.u[7],!0),this.v.setData(this.u[0],!0));this.J|=8;Xd(this,-2);this.b-=3}function ng(a){V(this,a,this.u[(a>>6&7)+this.sb],nf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Tf(b)):b=!1;b||this.ra(8,0,-8)}function Od(a){og[a>>12].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)} +function vg(a){wg[a&15].call(this,a)}function xg(a){yg[a&15].call(this,a)}function zg(a){Ag[a>>6&3].call(this,a)}function Bg(a){Cg[a>>6&3].call(this,a)}function Dg(a){Eg[a>>6&3].call(this,a)} +var og=[function(a){Fg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,of,X,function(a){Gg[a>>8&15].call(this,a)},ag,Pf,yf,uf,wf,jg,X],Fg=[function(a){Hg[a>>4&15].call(this,a)},Kf,Hf,zf,Af,Ff,Bf,Df,Yf,Yf,pg,rg,tg,X,X,X],qg=[function(a){$d(this,Le(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){V(this,a,0, +df);this.b-=this.g?11:6},function(a){V(this,a,Sd(this)?1:0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Sd(this)?1:0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ie(this,a);$d(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],ug=[function(a){V(this,a,0,hf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)}], +Hg=[function(a){Ig[a&15].call(this,a)},X,X,X,Wf,Wf,Wf,Wf,fg,X,vg,xg,kg,kg,kg,kg],Ig=[Sf,mg,gg,Jf,Uf,eg,X,X,X,X,X,X,X,X,X,X],wg=[dg,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},Nf,function(){this.Z=1;this.b-=5},Nf,Nf,Nf,function(){this.X=0;this.b-=5},Nf,Nf,Nf,Nf,Nf,Nf,Nf],yg=[dg,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},hg,function(){this.Z=0;this.b-=5},hg,hg,hg,function(){this.X=32768;this.b-=5},hg,hg,hg,hg,hg,hg,hg],Gg=[If,Gf,Cf,Ef,Lf,Mf,rf,sf,Rf,lg,zg, +Bg,Dg,X,X,X],Ag=[function(a){$d(this,Ke(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,1,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,1,af);this.b-=this.g?9:3+(7==this.f?2:0)}],Cg=[function(a){Je(this,a,0,ef);this.b-=this.g?11:6},function(a){Je(this,a,Sd(this)?1:0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,Sd(this)?1:0,lf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= +He(this,a);$d(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Eg=[function(a){Je(this,a,0,jf);this.b-=this.g?9+(this.Rb&1):3+(7==this.f?2:0)},function(a){Je(this,a,0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,0,Te);this.b-=this.g?9+(this.Rb&1):3+(7==this.f?2:0)},function(a){Je(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)}];function Pd(a){Jg[a>>12].call(this,a)} +var Jg=[function(a){Kg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,of,function(a){Lg[a>>8&15].call(this,a)},function(a){Mg[a>>8&15].call(this,a)},ag,Pf,yf,uf,wf,jg,X],Kg=[function(a){Ng[a>>4&15].call(this,a)},Kf,Hf,zf,Af,Ff,Bf,Df,Yf,Yf,pg,rg,tg,function(a){Og[a>>6&3].call(this,a)},X,X],Og=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Aa(a|this.P);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ce(this,a,0);xe(this,a);U(this,a);this.b-=11},function(a){var b=ze(this);this.L= +this.b;De(this,a,0,b);U(this,b);this.b=this.L-bg[this.g]},function(a){U(this,Le(this,a,Vd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ng=[function(a){Pg[a&15].call(this,a)},X,X,X,Wf,Wf,Wf,Wf,fg,function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.J|=1,this.J&=-3),this.b-=5):X.call(this,a)},vg,xg,kg,kg,kg,kg],Pg=[Sf,mg,function(){ye(this);this.J|=this.O&16;this.b-=13},Jf,Uf,eg,gg,function(){this.ra(8,0,-8)},X,X,X,X,X,X,X,X],Lg=[cg,cg,Qf,Qf,pf,pf,qf,qf,ng,ng,X,X,X,X,ig,ig],Mg= +[If,Gf,Cf,Ef,Lf,Mf,rf,sf,Rf,lg,zg,Bg,Dg,function(a){Qg[a>>6&3].call(this,a)},X,X],Qg=[X,function(a){a=Ce(this,a,65536);xe(this,a);U(this,a);this.b-=11},function(a){var b=ze(this);this.L=this.b;De(this,a,65536,b);U(this,b);this.b=this.L-bg[this.g]},X]; +function Rg(a){x.call(this,"ROM",a,Rg,128);this.ia=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.v=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.N("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.gb,a,b),(a=Ea(a,b))?(c.A=a.ga,c.ia=a.ia):c.g=null);Sg(c)})}}B(Rg);k=Rg.prototype; +k.Fa=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Sg(this)};k.Ia=function(){this.ia&&(this.j&&Tg(this.j,this.id,this.B,this.f,this.ia),delete this.ia);return!0};k.Ha=function(){return!0}; +function Sg(a){if(!yb(a)){if(a.g){if(!a.A||!a.w)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+vc){var c={};b=(c[b]=[Rg.prototype.ne,Rg.prototype.mf,null,null,null,a.f>>1],c);if(Kb(a.w,a,b)){b=a.F=!0;break a}}else if(Bc(a.w,b,a.f,qd)){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)),w=h,t=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= +b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(t)for(G(a,"loading "+q(t)+" bytes at "+q(r)+"-"+q(r+t-1),4096);t--;)Ic(a.w,r++,b[w++]&255);else r&1?a.b.ea():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.tc&&c<=la.dd&&(b=c-(la.tc-la.Sc));b&&(a.preventDefault&&a.preventDefault(),d.dc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Uc&&(b=la.Tc);d.dc(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.dc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;var e=this;this.ba=Rc(this.b,this.K?-1:48,4,262144);this.ma=Oc(this.b,function(){var a;a=-1;e.G.length&&(a=e.G.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.sa&&97<=a&&122>a&&(a-=32),Qc(e.b,e.ma,1E3/Math.round(e.T/10)));0<=a&&(e.L=a,e.f&128?e.L|=49152:e.f|=128,e.f&64&&Pc(c,e.ba))});this.S=Rc(this.b,this.K?-1:52,4,262144);this.ta=Oc(this.b,function(){e.g|=128;e.g&64&&Pc(c,e.S)});Kb(b,this,$g,this.K?64832+8*(this.K-1)-65392:0);Mb(b,this.reset.bind(this)); +J(this)};k.Jc=function(){if(!this.I){var a=Dd(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ua(b[0]);if(c!=this.fb)return;b=ua(b[1]);if(this.I=ob(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);this.M=d.receiveData;this.P=d.receiveStatus;if(this.M){this.status(this.gb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}}; +k.Ia=function(a,b){if(!b)if(this.Jc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){ah(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return ah(this)};function ah(a){a.L=0;a.f=8192;a.g=128;a.G=[];return!0} +k.dc=function(a){if("number"==typeof a)this.G.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.ca||8,c=a-this.F%a,this.ca&&(b=ta("",c)));this.Y&&!this.F&&c&&(b=String.fromCharCode(this.Y)+b);this.v.value+=b;this.v.scrollTop=this.v.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))}Qc(this.b,this.ta,1E3/Math.round(this.ya/10));this.g&=-129};var vh={},$g=(vh[65392]=[null,null,Yg.prototype.ae,Yg.prototype.Ze,"RCSR"],vh[65394]=[null,null,Yg.prototype.$d,Yg.prototype.Ye,"RBUF"],vh[65396]=[null,null,Yg.prototype.Be,Yg.prototype.Bf,"XCSR"],vh[65398]=[null,null,Yg.prototype.Ae,Yg.prototype.Af,"XBUF"],vh); +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&&yh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){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;yh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; +k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;this.Y=zh(a);var e=this;if((this.g=Dd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){v("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.S=Rc(this.b,56,4,4096);this.ca=Oc(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.la;g?a.N('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.gb,e,f),(e=Ea(e,f))&&Ih(a,b,c,d,e.ga,e.Sa, +e.Ra));a.C.ib=!1;a.F&&(a.F--,a.F||J(a));Fh(a)})}function Ch(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.fa);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){Ph(a,b,c,d)})} +function Ph(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.la;if(d)a.controller.N('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{mb(a.controller.gb,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)v(h[0]);else{a.fa=h.length;a.ka=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 w=l.bytes;if(void 0!==w&&w.length){for(var t=m<<2,A=w.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.La?f=a.Va+a.La&&(a.La+=f-(a.Va+a.La)+1):(a.Va=f,a.La=1);d[f]=d[f]&~(255<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 ("+ +function Rh(a,b){var c=a.ka*a.ha,d=b/c|0;return dg)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.N("Unable to restore disk '"+this.Ta+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=Qh(this,a++);)Th(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")}; -function Th(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)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.K=a.autoMount||{};this.F=0;this.g=Array(8);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; -k.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Uh(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&Vh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Ba)?(a=Na(Sh(a),a.nc.replace(".json",".img")),w(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return 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;Vh(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Cd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);Wh(this);this.Cb=Qc(144,5,65536);Jb(b,this,Xh);Lb(b,this.reset.bind(this));Yh(this,"None","",!0);this.L&&Yh(this,"Local Disk","?");Yh(this,"Remote Disk","??");Zh(this)||J(this)}; -k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.lc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Uh(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){Wh(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return Wh(this,a[0])};function Zh(a,b){b||(a.F=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('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=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}ai(a,e,b,c,!1,d)}else $h(a,e)} -function ai(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ja.toLowerCase()!=d.toLowerCase()&&(g++,$h(a,b,!0),h.vb?a.N("RK11 busy"):(h.vb=!0,e&&(h.ub=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Nh(new Jh(a,h,"preload"),c,d,f,a.Vc)&&g++));return g} -k.Vc=function(a,b,c,d,e){a.vb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.wb)),b=null);b?(a.Ba=b,a.Ta=c,a.Ja=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.F||J(this));Uh(this,a.wb)}; -function Yh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.I=65536-e&65535;a&&(this.B=this.B|a|32768,this.f|=49152);return!0};k.Wc=function(a,b,c,d,e,f,g){var h=0;a=a.Ba;var l=null,m;a||(h=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=4096;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=32;break}Yb(this.w,f,n|r<<8);if(Mc(this.w)){h=1024;break}f+=2;if(m>=a.xa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)}; -k.Xc=function(a,b,c,d,e,f,g){var h=0;a=a.Ba;var l=null,m;a||(h=128,e=0);for(;e--;){var n=mc(this.w,f);if(Mc(this.w)){h=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=4096;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=32;break}if(m>=a.xa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)};k.de=function(){return this.M};k.af=function(){};k.ee=function(){return this.B};k.bf=function(){};k.ae=function(){return this.f&61438}; -k.Ye=function(a){this.f=this.f&-3968|a&3967;if(this.f&1){var b,c=!0;a=(this.v&57344)>>13;var d=this.g[a],e,f,g,h;this.f&=-129;switch(this.f&14){case 0:this.M=d.status;this.B=0;this.f=128;this.v=0;break;case 4:b=this.Wc;case 2:b||(b=this.Xc),e=(this.v&8160)>>5,f=(this.v&16)>>4,g=this.v&15,e>=d.fa?(this.B|=32832,this.f|=49152):g>=d.ha?(this.B|=32800,this.f|=49152):(h=(this.f&48)<<12|this.G,c=65536-this.I&65535,c=b.call(this,d,e,f,g,c,h,this.Uc.bind(this)))}this.M=d.status|a<<13|this.v%9&15;c&&(this.f&= --2,this.f|=128,this.f&64&&Oc(this.b,this.Cb))}};k.fe=function(){return this.I};k.cf=function(a){this.I=a};k.$d=function(){return this.G};k.Xe=function(a){this.G=a};k.be=function(){return this.v};k.Ze=function(a){this.v=a};k.ce=function(){return this.P};k.$e=function(a){this.P=a}; -var bi={},Xh=(bi[65280]=[null,null,Q.prototype.de,Q.prototype.af,"RKDS"],bi[65282]=[null,null,Q.prototype.ee,Q.prototype.bf,"RKER"],bi[65284]=[null,null,Q.prototype.ae,Q.prototype.Ye,"RKCS"],bi[65286]=[null,null,Q.prototype.fe,Q.prototype.cf,"RKWC"],bi[65288]=[null,null,Q.prototype.$d,Q.prototype.Xe,"RKBA"],bi[65290]=[null,null,Q.prototype.be,Q.prototype.Ze,"RKDA"],bi[65294]=[null,null,Q.prototype.ce,Q.prototype.$e,"RKDB"],bi); +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")}; +function Uh(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)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.K=a.autoMount||{};this.F=0;this.g=Array(8);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; +k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Vh(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&Wh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Ca)?(a=Na(Th(a),a.pc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return 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;Wh(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);Xh(this);this.Cb=Rc(this.b,144,5,65536);Kb(b,this,Yh);Mb(b,this.reset.bind(this));Zh(this,"None","",!0);this.L&&Zh(this,"Local Disk","?");Zh(this,"Remote Disk","??");$h(this)||J(this)}; +k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.nc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Vh(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){Xh(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return Xh(this,a[0])};function $h(a,b){b||(a.F=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('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=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}bi(a,e,b,c,!1,d)}else ai(a,e)} +function bi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ja.toLowerCase()!=d.toLowerCase()&&(g++,ai(a,b,!0),h.vb?a.N("RK11 busy"):(h.vb=!0,e&&(h.ub=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Oh(new Kh(a,h,"preload"),c,d,f,a.Xc)&&g++));return g} +k.Xc=function(a,b,c,d,e){a.vb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.wb)),b=null);b?(a.Ca=b,a.Ta=c,a.Ja=d,this.N('Mounted disk "'+c+'" in drive '+("RK"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.F||J(this));Vh(this,a.wb)}; +function Zh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.I=65536-e&65535;a&&(this.B=this.B|a|32768,this.f|=49152);return!0};k.Yc=function(a,b,c,d,e,f,g){var h=0;a=a.Ca;var l=null,m;a||(h=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=4096;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=32;break}Zb(this.w,f,n|r<<8);if(Nc(this.w)){h=1024;break}f+=2;if(m>=a.za&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)}; +k.Zc=function(a,b,c,d,e,f,g){var h=0;a=a.Ca;var l=null,m;a||(h=128,e=0);for(;e--;){var n=nc(this.w,f);if(Nc(this.w)){h=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=4096;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=32;break}if(m>=a.za&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=64;break}}return g(h,b,c,d,e,f)};k.fe=function(){return this.M};k.df=function(){};k.ge=function(){return this.B};k.ef=function(){};k.ce=function(){return this.f&61438}; +k.af=function(a){this.f=this.f&-3968|a&3967;if(this.f&1){var b,c=!0;a=(this.v&57344)>>13;var d=this.g[a],e,f,g,h;this.f&=-129;switch(this.f&14){case 0:this.M=d.status;this.B=0;this.f=128;this.v=0;break;case 4:b=this.Yc;case 2:b||(b=this.Zc),e=(this.v&8160)>>5,f=(this.v&16)>>4,g=this.v&15,e>=d.fa?(this.B|=32832,this.f|=49152):g>=d.ha?(this.B|=32800,this.f|=49152):(h=(this.f&48)<<12|this.G,c=65536-this.I&65535,c=b.call(this,d,e,f,g,c,h,this.Wc.bind(this)))}this.M=d.status|a<<13|this.v%9&15;c&&(this.f&= +-2,this.f|=128,this.f&64&&Pc(this.b,this.Cb))}};k.he=function(){return this.I};k.ff=function(a){this.I=a};k.be=function(){return this.G};k.$e=function(a){this.G=a};k.de=function(){return this.v};k.bf=function(a){this.v=a};k.ee=function(){return this.P};k.cf=function(a){this.P=a}; +var ci={},Yh=(ci[65280]=[null,null,Q.prototype.fe,Q.prototype.df,"RKDS"],ci[65282]=[null,null,Q.prototype.ge,Q.prototype.ef,"RKER"],ci[65284]=[null,null,Q.prototype.ce,Q.prototype.af,"RKCS"],ci[65286]=[null,null,Q.prototype.he,Q.prototype.ff,"RKWC"],ci[65288]=[null,null,Q.prototype.be,Q.prototype.$e,"RKBA"],ci[65290]=[null,null,Q.prototype.de,Q.prototype.bf,"RKDA"],ci[65294]=[null,null,Q.prototype.ee,Q.prototype.cf,"RKDB"],ci); function P(a){x.call(this,"RL11",a,P,131072);this.L=a.autoMount||{};this.I=0;this.g=Array(4);this.M=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; -k.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&ci(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&di(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.M){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Ba)?(a=Na(Sh(a),a.nc.replace(".json",".img")),w(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.M)return 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;di(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Cd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);ei(this);this.Cb=Qc(112,5,131072);Jb(b,this,fi);Lb(b,this.reset.bind(this));gi(this,"None","",!0);this.M&&gi(this,"Local Disk","?");gi(this,"Remote Disk","??");hi(this)||J(this)}; -k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.lc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ci(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){ei(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return ei(this,a[0])};function hi(a,b){b||(a.I=0);for(var c in a.L){var d=a.L[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('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=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}ji(a,e,b,c,!1,d)}else ii(a,e)} -function ji(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ja.toLowerCase()!=d.toLowerCase()&&(g++,ii(a,b,!0),h.vb?a.N("RL11 busy"):(h.vb=!0,e&&(h.ub=!0,a.I++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Nh(new Jh(a,h,"preload"),c,d,f,a.Zc)&&g++));return g} -k.Zc=function(a,b,c,d,e){a.vb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.wb)),b=null);b?(a.Ba=b,a.Ta=c,a.Ja=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.I||J(this));ci(this,a.wb)}; -function gi(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.v=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.f=this.f|a|32768);return!0}; -k.$c=function(a,b,c,d,e,f,g){var h=0;a=a.Ba;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=5120;break}Yb(this.w,this.b.Na(f),n|r<<8);if(Mc(this.w)){h=8192;break}f+=2;if(m>=a.xa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.ad=function(a,b,c,d,e,f,g){var h=0;a=a.Ba;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=mc(this.w,this.b.Na(f));if(Mc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.xa&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.ie=function(){return this.f&65535}; -k.ff=function(a){this.f=this.f&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.f&128)){var b;a=!0;var c=this.g[(this.f&768)>>8],d=c.Ba,e,f,g;this.f&=-2;switch(this.f&14){case 4:this.G&8&&(this.f&=63);this.G=c.status|this.B&64|(d&&512==d.fa?128:0);break;case 6:1==(this.v&3)&&(b=this.v&65408,c=(this.v&16)<<2,this.B=this.v&4?this.B+b:this.B-b,this.v=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.$c;case 10:b||(b=this.ad),e=this.v>>7,f=this.v&64?1:0,g=this.v&63,!d||e>=d.fa|| -g>=d.ha?this.f|=37888:(d=(this.F&63)<<16|this.K,a=65536-this.G&65535,a=b.call(this,c,e,f,g,a,d,this.Yc.bind(this)))}a&&(this.f|=129,this.f&64&&Oc(this.b,this.Cb))}};k.ge=function(){return this.K};k.df=function(a){this.K=a&65534};k.je=function(){return this.v};k.gf=function(a){this.v=a};k.ke=function(){return this.G};k.hf=function(a){this.G=a};k.he=function(){return this.F};k.ef=function(a){this.F=a&63;this.f=this.f&-49|(this.F&3)<<4}; -var ki={},fi=(ki[63744]=[null,null,P.prototype.ie,P.prototype.ff,"RLCS"],ki[63746]=[null,null,P.prototype.ge,P.prototype.df,"RLBA"],ki[63748]=[null,null,P.prototype.je,P.prototype.gf,"RLDA"],ki[63750]=[null,null,P.prototype.ke,P.prototype.hf,"RLMP"],ki[63752]=[null,null,P.prototype.he,P.prototype.ef,"RLBE"],ki);function li(a){x.call(this,"Debugger",a,li);this.ra=a.base||16;this.Ka=!1;this.K=0;this.T=!1;this.B=-1;this.g=[];this.da={}}B(li); -var mi={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};li.prototype.Fc=function(){return-1};li.prototype.Gc=function(){}; -function ni(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.T?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} -function oi(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +k.wa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){v("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&di(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&ei(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.M){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Ca)?(a=Na(Th(a),a.pc.replace(".json",".img")),v(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDrive":if(this.M)return 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;ei(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Fa=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.j=d;if((a=Dd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);fi(this);this.Cb=Rc(this.b,112,5,131072);Kb(b,this,gi);Mb(b,this.reset.bind(this));hi(this,"None","",!0);this.M&&hi(this,"Local Disk","?");hi(this,"Remote Disk","??");ii(this)||J(this)}; +k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.nc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";di(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){fi(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return fi(this,a[0])};function ii(a,b){b||(a.I=0);for(var c in a.L){var d=a.L[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if("?"==c)a.N('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=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}ki(a,e,b,c,!1,d)}else ji(a,e)} +function ki(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ja.toLowerCase()!=d.toLowerCase()&&(g++,ji(a,b,!0),h.vb?a.N("RL11 busy"):(h.vb=!0,e&&(h.ub=!0,a.I++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Oh(new Kh(a,h,"preload"),c,d,f,a.ad)&&g++));return g} +k.ad=function(a,b,c,d,e){a.vb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.wb)),b=null);b?(a.Ca=b,a.Ta=c,a.Ja=d,this.N('Mounted disk "'+c+'" in drive '+("RL"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.I||J(this));di(this,a.wb)}; +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.v=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.f=this.f|a|32768);return!0}; +k.bd=function(a,b,c,d,e,f,g){var h=0;a=a.Ca;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){h=5120;break}Zb(this.w,this.b.Na(f),n|r<<8);if(Nc(this.w)){h=8192;break}f+=2;if(m>=a.za&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)}; +k.cd=function(a,b,c,d,e,f,g){var h=0;a=a.Ca;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=nc(this.w,this.b.Na(f));if(Nc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.za&&(l=null,++d>=a.ha&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g(h,b,c,d,e,f)};k.ke=function(){return this.f&65535}; +k.jf=function(a){this.f=this.f&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.f&128)){var b;a=!0;var c=this.g[(this.f&768)>>8],d=c.Ca,e,f,g;this.f&=-2;switch(this.f&14){case 4:this.G&8&&(this.f&=63);this.G=c.status|this.B&64|(d&&512==d.fa?128:0);break;case 6:1==(this.v&3)&&(b=this.v&65408,c=(this.v&16)<<2,this.B=this.v&4?this.B+b:this.B-b,this.v=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.bd;case 10:b||(b=this.cd),e=this.v>>7,f=this.v&64?1:0,g=this.v&63,!d||e>=d.fa|| +g>=d.ha?this.f|=37888:(d=(this.F&63)<<16|this.K,a=65536-this.G&65535,a=b.call(this,c,e,f,g,a,d,this.$c.bind(this)))}a&&(this.f|=129,this.f&64&&Pc(this.b,this.Cb))}};k.ie=function(){return this.K};k.gf=function(a){this.K=a&65534};k.le=function(){return this.v};k.kf=function(a){this.v=a};k.me=function(){return this.G};k.lf=function(a){this.G=a};k.je=function(){return this.F};k.hf=function(a){this.F=a&63;this.f=this.f&-49|(this.F&3)<<4}; +var li={},gi=(li[63744]=[null,null,P.prototype.ke,P.prototype.jf,"RLCS"],li[63746]=[null,null,P.prototype.ie,P.prototype.gf,"RLBA"],li[63748]=[null,null,P.prototype.le,P.prototype.kf,"RLDA"],li[63750]=[null,null,P.prototype.me,P.prototype.lf,"RLMP"],li[63752]=[null,null,P.prototype.je,P.prototype.hf,"RLBE"],li);function mi(a){x.call(this,"Debugger",a,mi);this.ma=a.base||16;this.Ka=!1;this.K=0;this.T=!1;this.B=-1;this.g=[];this.ba={}}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.Hc=function(){return-1};mi.prototype.Ic=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.T?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(ua(b.substring(c,f))),c=f+1}}return a} +function pi(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function pi(a,b,c){var d;if(b){b=qi(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ti(a,b){if(b)return si(a,b,a.da[b]);var c=0;for(b in a.da)si(a,b,a.da[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ui(a,b){if(b)return ti(a,b,a.ba[b]);var c=0;for(b in a.ba)ti(a,b,a.ba[b]),c++;return 0this.b.jb?Di:[];Sc(this,16,function(a){a:{var b=d.w.ba,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Ei(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.na;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Fc[c],n&&d.i(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -k.Gc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.eb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=hd(this.b);break;case 21:b=c.Jb;break;case 22:b=c.pa;break;case 23:b=c.mb;break;case 24:b=bd(c);break;case 25:b=dd(c);break;case 26:b=ed(c);break;case 27:b=c.Wa;break;case 28:d&&(b=d.za);break;case 29:d&&(b=d.yb);break;case 30:d&&rc(d)&&(b=d.cb)}}return b}; -k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.ua&65535).H));if(!this.sa||a!=this.sa)if(this.sa=a,this.ma&1073741824)this.Y.push(a);else{var c;if(this.ma&-2147483648&&this.b&&(c=this.b.C.W)||xb(this,!0))this.ca(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Kd(a),a.Aa=0,a.wa())}}; -function wi(a){var b;if(!Le(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.ea=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.P?Li(a):Mi(a)}}function Ki(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ia=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ha=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){wi(this);this.Ea=0;this.sa=null;this.K=0;this.L=Y(this.b.u[7]);this.C.W=!1;Ni(this);a||Fd(this)};k.save=function(){var a=new S(this);a.set(0,Gi(this.L));a.set(1,Gi(this.S));a.set(2,[this.g,this.T,this.ma]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Hi(a[b++]),this.S=Hi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.ma|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.W=!0;this.Pb=a;this.Qb=b}; -k.stop=function(a,b){if(this.C.W){this.C.W=!1;this.K=b-this.Qb;if(!this.P){b="stopped";if(this.K){a-=this.Pb;var c=0d&&(d=nc(a.b,b)),65535!=(d&65535)&&(a.oc(a.G[a.ea],b),++a.ea==a.G.length&&(a.ea=0)));return!1}function Sf(a){var b=a.b;if(b.C.W)throw T(b,a.b.ua&65535),a.ca(),-1;return!1} -function vi(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.na],!1)}a.M=["br"];if(a.F)for(b=1;b>>d.na],!0);a.F=["bw"];a.Za=0}k.tb=function(a,b,c){var d=!0;c||Oi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.w;f.ba[e>>>f.na].tb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Pi(this,a,a.length-1,"set"),wi(this)));return d}; -function Oi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.na],b==a.F));h.Ua||wi(a);break}}return f}function Qi(a,b){for(var c=1;c>23)&65535,y=L(u,v);else if(8192==C)v=v.H-((f&63)<<1)&65535,y=L(u,v);else if(12288==C)y=L(u,f&7,1);else if(24576==C)y=L(u,f&63,1);else if(32768==C)y=L(u,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), -A&63)switch(A=C&7,C&56){case 0:y=Ji(A);break;case 8:y="@"+Ji(A);break;case 16:7>A?y="("+Ji(A)+")+":(C=u.ta(v,2),y="#"+L(u,C,0,!0));break;case 24:7>A?y="@("+Ji(A)+")+":(C=u.ta(v,2),y="@#"+L(u,C,0,!0));break;case 32:y="-("+Ji(A)+")";break;case 40:y="@-("+Ji(A)+")";break;case 48:C=u.ta(v,2);y=L(u,C,0,!0)+"("+Ji(A)+")";7==A&&(y=L(u,C+v.H&65535));break;case 56:C=u.ta(v,2),y="@"+L(u,C)+"("+Ji(A)+")",7==A&&(y="@"+L(u,C+v.H&65535))}u=y;if(!u||!u.length){h="INVALID";break}"string"!=typeof u&&(m=u[1],u=u[0]); -0b)c=Ji(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.eb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,hd(d));break;case 21:c="IR="+L(a,d.Jb);break;case 22:c="ER="+L(a,d.pa);break;case 23:c="SL="+L(a,d.mb);break;case 24:c="MMR0="+L(a,bd(d));break;case 25:c="MMR1="+L(a,dd(d));break;case 26:c="MMR2="+L(a,ed(d));break;case 27:c="MMR3="+L(a,d.Wa);break;case 28:a.v&&(c="AR="+L(a,a.v.za,3));break;case 29:a.v&& -(c="DR="+L(a,a.v.yb));break;case 30:a.v&&rc(a.v)&&(c="SR="+L(a,a.v.cb,3))}c&&(c+=" ");return c}function Ui(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ti(a,"T")+Ti(a,"N")+Ti(a,"Z")+Ti(a,"V")+Ti(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Cc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Cc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Gg:b,H:c,td:d,ia:e,Ac:f})}function Vi(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.td;if(e>=g&&eb)){e.u[b]= -g&65535;break}a.i("unknown register: "+f);return}a.A.wa();a.i("updated registers:")}}a.i(Ui(a,d));c&&(a.L=Y(e.u[7]),Mi(a,L(a,a.L.H)))}}function Zi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Si(a,b,g,f);a.i(f);a.L=b;e-=b.H-l;c++}}} -function Ri(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+L(a,a.S.H)),a.L=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.sa=null;if(yb(a)&&0n||"z"va.length&&(a.i("note: only "+va.length+" available"),ea=va.length);ia-=ea;0>ia&&(null==va[va.length-1].H?(ea=ia+ea,ia=0):ia+=va.length);var ce=[];"call"==gh&&($b=1E5,ce=["CALL"]);for(void 0!==fh&&a.i(ea+" instructions earlier:");0<$b&&ia!=a.ea;){var jh=va[ia++];if(null==jh.H)break;var ac=Y(jh.H),tj= -ea--,kh=Si(a,ac,"history",tj);(!ce.length||0<=kh.indexOf(ce[0]))&&a.i(kh);ac.kc&&(ia+=ac.kc,$b-=ac.kc,ea-=ac.kc);ia>=va.length&&(ia=0);a.qb=ea;ih++;$b--}}ih||(a.i("no "+hh+"history available"),a.qb=void 0)}else{var ub=Ei(a,ua);if(ub){var bc=0,de=!1,ee="ds"==Sa;Ta&&(de=!0,"l"==Ta.charAt(0)&&(de=!1,Ta=Ta.substr(1)||sj),bc=ri(a,Ta)>>>0,65536he?String.fromCharCode(he):"."),Wc=Wc>>8}Va&&(Va+="\n");Va=ee?Va+(Wa+","):Va+(ua+": "+Wa+(0==Vc?" "+ge:""))}Va&&a.i(Va);a.Xa=ub}}}}break;case "e":if("else"==g[0])break;var wb,ie,je,ke,le=g[0],me=g[1];"eb"==le?(wb=1,ie=255,je=a.ac,ke= -a.Kb):"e"==le||"ew"==le?(wb=2,ie=65535,je=a.ta,ke=a.zb):me=null;if(null==me)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Xc=Ei(a,me);if(Xc)for(var Yc=2;Ycpe;){for(var Xa=null,xj=256;65536>gc.H>>>0;){qe.H=a.ta(gc,2);if(null==gc.H||!xj--)break;if(!(qe.H&1)){for(var yj=a,Zc=qe,mh=null,hc=Zc.H,nh=hc,re=1;6>=re&&hc;re++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bdj){if(fj(d,this.I)){this.B=new S(this,"1.30.5","failsafe");fj(this.B)&&(kj(this,d),a=2,lj(this.B));this.B.set("timestamp",Ca());mj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=jj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?fj(d,g):("error"== -f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),lj(d),fj(d)?(c=jj(d),e=!0):c=!1))}e&&ij(this,c?d:null)}else 2==a&&d.clear()}else ij(this);delete this.I;delete this.K}e=nb(this.id);for(f=0;fa[1];a=a[2];this.ea=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(nj(this,this.b,b,c,a),this.wa(),this.b.Ab());this.P&&(kj(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; -function kj(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.da;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} -function aj(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ha&&(c&&a.b.ca(),d=a.b.Ha(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;l=c||30<=(b.Ob+=c))&&(d.textContent=b.C.W?b.sa.toFixed(2)+"Mhz":"Stopped",b.Ob=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.W;d=!!(b.b.J&8);if(0>=a||60<=(b.B+=a)){for(var e=0;ethis.b.jb?Ei:[];Tc(this,16,function(a){a:{var b=d.w.da,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Fi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.oa;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Gc[c],n&&d.i(p(n.id,8)+" %"+ +p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +k.Ic=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.eb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=id(this.b);break;case 21:b=c.Jb;break;case 22:b=c.qa;break;case 23:b=c.mb;break;case 24:b=cd(c);break;case 25:b=ed(c);break;case 26:b=fd(c);break;case 27:b=c.Wa;break;case 28:d&&(b=d.Ba);break;case 29:d&&(b=d.yb);break;case 30:d&&sc(d)&&(b=d.cb)}}return b}; +k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.va&65535).H));if(!this.sa||a!=this.sa)if(this.sa=a,this.na&1073741824)this.Y.push(a);else{var c;if(this.na&-2147483648&&this.b&&(c=this.b.C.W)||xb(this,!0))this.ea(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ld(a),a.ta=0,a.xa())}}; +function xi(a){var b;if(!Me(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.ca=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.P?Mi(a):Ni(a)}}function Li(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ia=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ha=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){xi(this);this.Ea=0;this.sa=null;this.K=0;this.L=Y(this.b.u[7]);this.C.W=!1;Oi(this);a||Gd(this)};k.save=function(){var a=new S(this);a.set(0,Hi(this.L));a.set(1,Hi(this.S));a.set(2,[this.g,this.T,this.na]);a.set(3,this.I);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Ii(a[b++]),this.S=Ii(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.na|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.W=!0;this.Pb=a;this.Qb=b}; +k.stop=function(a,b){if(this.C.W){this.C.W=!1;this.K=b-this.Qb;if(!this.P){b="stopped";if(this.K){a-=this.Pb;var c=0d&&(d=oc(a.b,b)),65535!=(d&65535)&&(a.qc(a.G[a.ca],b),++a.ca==a.G.length&&(a.ca=0)));return!1}function Tf(a){var b=a.b;if(b.C.W)throw T(b,a.b.va&65535),a.ea(),-1;return!1} +function wi(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.oa],!1)}a.M=["br"];if(a.F)for(b=1;b>>d.oa],!0);a.F=["bw"];a.Za=0}k.tb=function(a,b,c){var d=!0;c||Pi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.w;f.da[e>>>f.oa].tb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Qi(this,a,a.length-1,"set"),xi(this)));return d}; +function Pi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.oa],b==a.F));h.Ua||xi(a);break}}return f}function Ri(a,b){for(var c=1;c>23)&65535,y=L(t,w);else if(8192==C)w=w.H-((f&63)<<1)&65535,y=L(t,w);else if(12288==C)y=L(t,f&7,1);else if(24576==C)y=L(t,f&63,1);else if(32768==C)y=L(t,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), +A&63)switch(A=C&7,C&56){case 0:y=Ki(A);break;case 8:y="@"+Ki(A);break;case 16:7>A?y="("+Ki(A)+")+":(C=t.ua(w,2),y="#"+L(t,C,0,!0));break;case 24:7>A?y="@("+Ki(A)+")+":(C=t.ua(w,2),y="@#"+L(t,C,0,!0));break;case 32:y="-("+Ki(A)+")";break;case 40:y="@-("+Ki(A)+")";break;case 48:C=t.ua(w,2);y=L(t,C,0,!0)+"("+Ki(A)+")";7==A&&(y=L(t,C+w.H&65535));break;case 56:C=t.ua(w,2),y="@"+L(t,C)+"("+Ki(A)+")",7==A&&(y="@"+L(t,C+w.H&65535))}t=y;if(!t||!t.length){h="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]); +0b)c=Ki(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.eb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,id(d));break;case 21:c="IR="+L(a,d.Jb);break;case 22:c="ER="+L(a,d.qa);break;case 23:c="SL="+L(a,d.mb);break;case 24:c="MMR0="+L(a,cd(d));break;case 25:c="MMR1="+L(a,ed(d));break;case 26:c="MMR2="+L(a,fd(d));break;case 27:c="MMR3="+L(a,d.Wa);break;case 28:a.v&&(c="AR="+L(a,a.v.Ba,3));break;case 29:a.v&& +(c="DR="+L(a,a.v.yb));break;case 30:a.v&&sc(a.v)&&(c="SR="+L(a,a.v.cb,3))}c&&(c+=" ");return c}function Vi(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ui(a,"T")+Ui(a,"N")+Ui(a,"Z")+Ui(a,"V")+Ui(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Ec=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Ec);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Jg:b,H:c,vd:d,ia:e,Cc:f})}function Wi(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.vd;if(e>=g&&eb)){e.u[b]= +g&65535;break}a.i("unknown register: "+f);return}a.A.xa();a.i("updated registers:")}}a.i(Vi(a,d));c&&(a.L=Y(e.u[7]),Ni(a,L(a,a.L.H)))}}function $i(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Ti(a,b,g,f);a.i(f);a.L=b;e-=b.H-l;c++}}} +function Si(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+L(a,a.S.H)),a.L=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.sa=null;if(yb(a)&&0n||"z"wa.length&&(a.i("note: only "+wa.length+" available"),ea=wa.length);ia-=ea;0>ia&&(null==wa[wa.length-1].H?(ea=ia+ea,ia=0):ia+=wa.length);var ce=[];"call"==gh&&($b=1E5,ce=["CALL"]);for(void 0!==fh&&a.i(ea+" instructions earlier:");0<$b&&ia!=a.ca;){var jh=wa[ia++];if(null==jh.H)break;var ac=Y(jh.H),uj= +ea--,kh=Ti(a,ac,"history",uj);(!ce.length||0<=kh.indexOf(ce[0]))&&a.i(kh);ac.mc&&(ia+=ac.mc,$b-=ac.mc,ea-=ac.mc);ia>=wa.length&&(ia=0);a.qb=ea;ih++;$b--}}ih||(a.i("no "+hh+"history available"),a.qb=void 0)}else{var ub=Fi(a,va);if(ub){var bc=0,de=!1,ee="ds"==Sa;Ta&&(de=!0,"l"==Ta.charAt(0)&&(de=!1,Ta=Ta.substr(1)||tj),bc=si(a,Ta)>>>0,65536he?String.fromCharCode(he):"."),Wc=Wc>>8}Va&&(Va+="\n");Va=ee?Va+(Wa+","):Va+(va+": "+Wa+(0==Vc?" "+ge:""))}Va&&a.i(Va);a.Xa=ub}}}}break;case "e":if("else"==g[0])break;var wb,ie,je,ke,le=g[0],me=g[1];"eb"==le?(wb=1,ie=255,je=a.bc,ke= +a.Kb):"e"==le||"ew"==le?(wb=2,ie=65535,je=a.ua,ke=a.zb):me=null;if(null==me)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Xc=Fi(a,me);if(Xc)for(var Yc=2;Ycpe;){for(var Xa=null,yj=256;65536>gc.H>>>0;){qe.H=a.ua(gc,2);if(null==gc.H||!yj--)break;if(!(qe.H&1)){for(var zj=a,Zc=qe,mh=null,hc=Zc.H,nh=hc,re=1;6>=re&&hc;re++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bej){if(gj(d,this.I)){this.B=new S(this,"1.30.5","failsafe");gj(this.B)&&(lj(this,d),a=2,mj(this.B));this.B.set("timestamp",Ca());nj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=kj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?gj(d,g):("error"== +f&&"no machine state"!=g?(this.N("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),mj(d),gj(d)?(c=kj(d),e=!0):c=!1))}e&&jj(this,c?d:null)}else 2==a&&d.clear()}else jj(this);delete this.I;delete this.K}e=nb(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(oj(this,this.b,b,c,a),this.xa(),this.b.Ab());this.P&&(lj(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; +function lj(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} +function bj(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ha&&(c&&a.b.ea(),d=a.b.Ha(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;l=c||30<=(b.Ob+=c))&&(d.textContent=b.C.W?b.sa.toFixed(2)+"Mhz":"Stopped",b.Ob=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.W;d=!!(b.b.J&8);if(0>=a||60<=(b.B+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Ej(a,b,c)}})}else c(a,null)} -function Fj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=sa(a))}function f(a){e("Error: "+a);l&&(--rj||db(!0));l=!1}var g,h,l=!0;rj++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Cj(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--rj||db(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--rj||db(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Cj(b,a,d,!0,e,m):Dj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(v){f(v.message)}return l}window.embedPDP11=function(a,b,c,d){db(!1);return Fj(a,b,c,d)};window.enableEvents=db;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map +k.wa=function(a,b,c){var d=this;switch(b){case "power":return this.D[b]=c,c.onclick=function(){d.g||(d.C.la?bj(d,!1,!0):ij(d,d.Vb))},!0;case "reset":return this.D[b]=c,c.onclick=function(){if(d.C.la&&!d.g)if(d.f&&!d.G){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");bj(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.nc=!0),d.Vb(ej),d.nc=!1)}else d.reset(),d.b&&d.b.Ab()},!0;case "save":if(pa(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.D[b]= +c,c.onclick=function(){var a=fj(d,!0);if(a){var b=!!(d.f&&!d.G||d.M),c=bj(d,b);b?pj(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1}; +function fj(a,b){var c=a.A;c||((c=Ka("user"),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=qj(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c} +function qj(a,b){a.A=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.A=b.data)}catch(d){v(d.message+" ("+c+")")}return a.A}function hj(a){var b=null;a.A&&(b=Fa()+"/api/v1/user?req=load&user="+a.A+"&state="+rj(a,"1.30.5"));return b} +function pj(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=rj(a,"1.30.5");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Fj(a,b,c)}})}else c(a,null)} +function Gj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--sj||db(!0));l=!1}var g,h,l=!0;sj++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Dj(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--sj||db(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sj||db(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Dj(b,a,d,!0,e,m):Ej(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){db(!1);return Gj(a,b,c,d)};window.enableEvents=db;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.5/pdp11.js b/versions/pdpjs/1.30.5/pdp11.js index d1f5614c3..7e6a44a1b 100644 --- a/versions/pdpjs/1.30.5/pdp11.js +++ b/versions/pdpjs/1.30.5/pdp11.js @@ -34,235 +34,236 @@ */ for(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,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,Pb:65,Pe:66,Re:67,pf:68,E:69,qf:70,rf:71,sf:72,tf:73,uf:74,vf:75,wf:76,xf:77,yf:78,zf:79,Af:80,Q:81,Bf:82,Cf:83,Df:84,Ef:85,Ff:86,Gf:87,Hf:88,If:89,vc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jf:97,Kf:98,Lf:99,d:100,e:101,Nf:102,Of:103,Pf:104,Qf:105,Tf:106,k:107,Uf:108,Vf:109,n:110,Wf:111,p:112,q:113,r:114,Xf:115,t:116,Yf:117,Zf:118,$f:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,mc:127}; +var ia={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]},m={Te:0,mc:1,Ve:2,We:3,Xe:4,Ye:5,Ze:6,$e:7,Tb:8,af:9,nc:10,bf:11,cf:12,oc:13,df:14,ef:15,ff:16,gf:17,hf:18,jf:19,kf:20,lf:21,mf:22,nf:23,pf:24,qf:25,rf: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,Rb:65,Se:66,Ue:67,sf:68,E:69,tf:70,uf:71,vf:72,wf:73,xf:74,yf:75,zf:76,Af:77,Bf:78,Cf:79,Df:80,Q:81,Ef:82,Ff:83,Gf:84,Hf:85,If:86,Jf:87,Kf:88,Lf:89,yc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Mf:97,Nf:98,Of:99,d:100,e:101,Qf:102,Rf:103,Sf:104,Tf:105,Wf:106,k:107,Xf:108,Yf:109,n:110,Zf:111,p:112,q:113,r:114,$f:115,t:116,ag:117,bg:118,cg:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,pc:127}; function q(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function r(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function t(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})} -function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",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"},qa=Date.now||function(){return+new Date}; -function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function v(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"== +e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ja(a,b){var c="";b?11>=3;return""+c}function ka(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function r(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})} +function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",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"},ra=Date.now||function(){return+new Date}; +function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function t(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={M:null,ba:null,ma:null,la: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.ma=g.load;d.la=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ba=g.symbols;d.M.length?1==d.M.length&&(w(d.M[0]),d=null):(w("Empty resource: "+a),d=null)}catch(k){w("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.wa=this.id:(this.xa=this.id.substr(0,b),this.wa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Gb:!1,P:!1,error:!1};this.tb=null;this.o.error=!1;this.j={};this.F=null;this.Hc=d||0;y.push(this)}var Ma=void 0,Na={}; -if(window){Ma||(Ma=window.location.search.substr(1));for(var Oa,Pa=/\+/g,Qa=/([^&=]+)=?([^&]*)/g;Oa=Qa.exec(Ma);)Na[decodeURIComponent(Oa[1].replace(Pa," "))]=decodeURIComponent(Oa[2].replace(Pa," "))}function Ra(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function A(a,b){b||(b=x);a.prototype=Ra(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Sa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},y=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Sc,a]}A($a);var ab=7;function bb(a,b){return a.b[b]&&a.b[b][1]}h=$a.prototype;h.reset=function(){this.stop()}; -h.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[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(){cb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){db(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){cb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){db(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;eb(b,this,fb);gb(b,this.reset.bind(this));hb(this);ib(this)};h.ha=function(a,b){b||(jb(),this.reset());return!0};h.ga=function(){return!0}; -function kb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function hb(a,b){for(var c in a.f)kb(a,c,null!=b?b:a.f[c])}function lb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ib(a){for(var b in a.b)lb(a,b,a.b[b][1])}function mb(a,b,c,d){a.j[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ja(c,d):r(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} -function cb(a,b){var c=a.b[b];lb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function db(a,b){var c=a.b[b];c[2]&&c[3]&&(lb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Qc=function(a){a||this.a.o.R||(a=this.a,a.h.reset(),nb(a),bb(this,"ENABLE")&&ob(this.a))};h.Rc=function(){};h.Mc=function(a){a||G(this.a)}; -h.Kc=function(a){if(!a&&!this.a.o.R)if(bb(this,"ENABLE"))ob(this.a);else{a=this.F;var b;if(b=a)a.o.Fa&&(a.o.Gb=!0),b=!a.o.Fa;if(b)Wa(a,!0),a.wb(0,null),Wa(a,!1);else try{var c=this.a.wb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Qa?8:16,c=65472<=a.ia&&a.ia<65472+b,b=c?1:2,c=c?15:a.h.Ca;bb(a,"STEP")||(b=-b);xb(a,a.ia&~c|a.ia+b&c)}function xb(a,b){a.ia=b&a.h.Ca;b=a.ia;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.w/this.c|0;this.Ba=[];this.m=0;this.s=!1;this.A=[];this.wc=[Cb,Db,Eb,Fb];a=new H(this);Gb(a,this.F);this.h=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.b;this.B=0;this.i=this.Ca;F(this)}A(Ab); -var Bb=8192,Jb=Bb-1;function Cb(a,b){var c=-1,d=this.controller,e=d.Ba[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} -function Db(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Eb(a,b){var c=-1,d=this.controller;a=d.Ba[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} -function Fb(a,b,c){var d=!1,e=this.controller;a=e.Ba[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Kb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.I]=a.h[a.G])}}Ab.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ea)return l.ib+=l.Ea-f,l.Ea=f,!0;if(f>=l.Ea+l.ib){p=l.size-(f-n);p>g&&(p=g);l.ib=f-l.Ea+p;f=n+a.c;g-=p;k++;continue}}return Lb(1,f,g)}f=new H(a,f,p,a.c,d,e);Gb(f,a.F,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Mb[d]+" at "+ja(b)),!0):Lb(2,b,c)}function Nb(a,b){return a.f[(b&a.i)>>>a.b].Kb(b&a.l,b)} -function Ob(a,b){return a.f[(b&a.i)>>>a.b].X(b&a.l,b)}function wb(a,b){a.s=!1;a.m++;b=a.h[(b&a.Ca)>>>a.b].bc(b&a.l,b);a.m--;return b}function Pb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].Ob(b&a.l,c&255,b);a.m--}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].yb(b&a.l,c&65535,b)}function ub(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].hc(b&a.l,c&65535,b);a.m--} -function Rb(a){for(var b=0,c=[],d=0;da.a.Qa)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,z=0;z>16&65535);a=a.Fb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.dd=function(){var a=this.a;a.Z&57344||(a.Hb=a.A&65535);return a.Hb};h.ed=function(){return this.a.Da};h.de=function(a){var b=this.a;1170>b.Qa&&(a&=-49);b.Da!=a&&(b.Da=a,b.Xa=a&16?4194303:262143,cc(b))};h.Nd=function(a){a=a>>1&63;var b=this.a.hb[a>>1];return a&1?b>>16:b&65535}; -h.Le=function(a,b){b=b>>1&63;var c=b>>1;this.a.hb[c]=b&1?this.a.hb[c]&65535|(a&63)<<16:this.a.hb[c]&-65536|a&65534};h.Gd=function(a){return this.a.H[1][a>>1&7]};h.Ee=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Ed=function(a){return this.a.H[1][(a>>1&7)+8]};h.Ce=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.Fd=function(a){return this.a.ca[1][a>>1&7]};h.De=function(a,b){b=b>>1&7;this.a.ca[1][b]=a;this.a.H[1][b]&=65295};h.Dd=function(a){return this.a.ca[1][(a>>1&7)+8]}; -h.Be=function(a,b){b=(b>>1&7)+8;this.a.ca[1][b]=a;this.a.H[1][b]&=65295};h.Zc=function(a){return this.a.H[0][a>>1&7]};h.$d=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Xc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Yc=function(a){return this.a.ca[0][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.ca[0][b]=a;this.a.H[0][b]&=65295};h.Wc=function(a){return this.a.ca[0][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.ca[0][b]=a;this.a.H[0][b]&=65295}; -h.Md=function(a){return this.a.H[3][a>>1&7]};h.Ke=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Kd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Ie=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Ld=function(a){return this.a.ca[3][a>>1&7]};h.Je=function(a,b){b=b>>1&7;this.a.ca[3][b]=a;this.a.H[3][b]&=65295};h.Jd=function(a){return this.a.ca[3][(a>>1&7)+8]};h.He=function(a,b){b=(b>>1&7)+8;this.a.ca[3][b]=a;this.a.H[3][b]&=65295};h.Sa=function(a){a&=7;return this.a.D&2048?this.a.Ja[a]:this.a.g[a]}; -h.Ua=function(a,b){b&=7;this.a.D&2048?this.a.Ja[b]=a:this.a.g[b]=a};h.kd=function(){return this.a.D&49152?this.a.pa[0]:this.a.g[6]};h.ie=function(a){this.a.D&49152?this.a.pa[0]=a:this.a.g[6]=a};h.nd=function(){return this.a.g[7]};h.le=function(a){this.a.g[7]=a};h.Ta=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Ja[a]};h.Va=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Ja[b]=a};h.ld=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.pa[1]}; -h.je=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.pa[1]=a};h.md=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.pa[3]};h.ke=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.pa[3]=a};h.Vc=function(a){return this.a.ec[a-65504>>1]};h.Wd=function(a,b){this.a.ec[b-65504>>1]=a};h.ac=function(a){return 65520==a?(Sb(this.h)>>6)-1:0};h.gc=function(){};h.Id=function(){return 1};h.Ge=function(){};h.Uc=function(){return this.a.Y};h.Vd=function(){this.a.Y=0};h.ad=function(){return this.a.dc}; -h.be=function(a,b){b&1||(a&=255);this.a.dc=a};h.fd=function(a,b){return b?0:this.a.vb};h.ee=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=1}b.vb=a};h.Hd=function(a,b){return b?0:this.a.gb&65280};h.Fe=function(a){this.a.gb=a|255};h.jd=function(){return dc(this.a)};h.he=function(a){ec(this.a,a&-1793|dc(this.a)&1792);this.a.u|=256};h.fc=function(){}; -var L={},$b=(L[61568]=[null,null,K.prototype.Nd,K.prototype.Le,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Gd,K.prototype.Ee,"SIPDR",8,1145,64],L[62608]=[null,null,K.prototype.Ed,K.prototype.Ce,"SDPDR",8,1145,64],L[62624]=[null,null,K.prototype.Fd,K.prototype.De,"SIPAR",8,1145,64],L[62640]=[null,null,K.prototype.Dd,K.prototype.Be,"SDPAR",8,1145,64],L[62656]=[null,null,K.prototype.Zc,K.prototype.$d,"KIPDR",8,1145,64],L[62672]=[null,null,K.prototype.Xc,K.prototype.Yd,"KDPDR",8,1145,64],L[62688]= -[null,null,K.prototype.Yc,K.prototype.Zd,"KIPAR",8,1145,64],L[62704]=[null,null,K.prototype.Wc,K.prototype.Xd,"KDPAR",8,1145,64],L[62798]=[null,null,K.prototype.ed,K.prototype.de,"MMR3",1,1145,64],L[65382]=[null,null,K.prototype.$c,K.prototype.ae,"LKS"],L[65402]=[null,null,K.prototype.bd,K.prototype.ce,"MMR0",1,1145,64],L[65404]=[null,null,K.prototype.cd,K.prototype.fc,"MMR1",1,1145,64],L[65406]=[null,null,K.prototype.dd,K.prototype.fc,"MMR2",1,1145,64],L[65408]=[null,null,K.prototype.Md,K.prototype.Ke, -"UIPDR",8,1145,64],L[65424]=[null,null,K.prototype.Kd,K.prototype.Ie,"UDPDR",8,1145,64],L[65440]=[null,null,K.prototype.Ld,K.prototype.Je,"UIPAR",8,1145,64],L[65456]=[null,null,K.prototype.Jd,K.prototype.He,"UDPAR",8,1145,64],L[65472]=[null,null,K.prototype.Sa,K.prototype.Ua,"R0SET0"],L[65473]=[null,null,K.prototype.Sa,K.prototype.Ua,"R1SET0"],L[65474]=[null,null,K.prototype.Sa,K.prototype.Ua,"R2SET0"],L[65475]=[null,null,K.prototype.Sa,K.prototype.Ua,"R3SET0"],L[65476]=[null,null,K.prototype.Sa, -K.prototype.Ua,"R4SET0"],L[65477]=[null,null,K.prototype.Sa,K.prototype.Ua,"R5SET0"],L[65478]=[null,null,K.prototype.kd,K.prototype.ie,"R6KERNEL"],L[65479]=[null,null,K.prototype.nd,K.prototype.le,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ta,K.prototype.Va,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ta,K.prototype.Va,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ta,K.prototype.Va,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ta,K.prototype.Va,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ta, -K.prototype.Va,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ta,K.prototype.Va,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.ld,K.prototype.je,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.md,K.prototype.ke,"R6USER",1,1145],L[65504]=[null,null,K.prototype.Vc,K.prototype.Wd,"CTRL",8,1170],L[65520]=[null,null,K.prototype.ac,K.prototype.gc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.ac,K.prototype.gc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Id,K.prototype.Ge,"SYSID",1,1170],L[65526]= -[null,null,K.prototype.Uc,K.prototype.Vd,"CPUERR",1,1170],L[65528]=[null,null,K.prototype.ad,K.prototype.be,"MB",1,1170],L[65530]=[null,null,K.prototype.fd,K.prototype.ee,"PIR"],L[65532]=[null,null,K.prototype.Hd,K.prototype.Fe,"SL"],L[65534]=[null,null,K.prototype.jd,K.prototype.he,"PSW"],L); -Ia(function(){for(var a=E(document,"pdp11","device"),b=0;b>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)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ka:function(a,b){a&1&&I(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},qa: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.ta=!0},G:function(a,b){return this.I(a,b)},T:function(a,b){return this.bc(a,b)},xa:function(a,b,c){this.l?this.f(a,b,c):this.Ob(a,b,c)},sa:function(a,b,c){this.l?this.f(a,b,c):this.hc(a,b,c)},B:function(a){return this.j[a]},J:function(a){return this.j[a]},S:function(a,b){a&1&&I(this.h,b,64);return this.c.getUint16(a,!0)},ja:function(a,b){a&1&&I(this.h,b,64);return this.s[a>>1]},wa:function(a,b){this.j[a]=b;this.ta=!0},ya:function(a,b){this.j[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&I(this.h, -c,64);this.c.setUint16(a,b,!0);this.ta=!0},za:function(a,b,c){a&1&&I(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function Gb(a,b,c){a.F=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.xb=!a.l&&b[1]||a.f,a.yb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ob=b[1]||a.f,a.hc=b[3]||a.A}function sc(a,b,c){c&&a.i||(a.Kb=b[0]||a.v,a.X=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.bc=b[2]||a.w}function mc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} -var vc=[],pc=[H.prototype.L,H.prototype.qa,H.prototype.ka,H.prototype.Aa],tc=[H.prototype.G,H.prototype.xa,H.prototype.T,H.prototype.sa];if(Za)var oc=[H.prototype.B,H.prototype.wa,H.prototype.S,H.prototype.ra],nc=[H.prototype.J,H.prototype.ya,H.prototype.ja,H.prototype.za]; -function wc(a,b){x.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Ab=0;this.ob=b;this.ra=c;this.zb=Math.round(this.ob/1E4)/100;this.Ka=this.zb*this.ra;this.o.R=!1;this.o.Mb=!1;this.o.cb=a.autoStart;this.o.rb=!1;this.mb=this.La=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.L=[];this.$b=this.Rd.bind(this);F(this)}A(wc);var xc=["power","reset"];h=wc.prototype; -h.fa=function(a,b,c,d){this.l=a;this.h=b;this.F=d;this.w=a.w;for(b=0;b=a.La&&(a.La+=a.Ya,c=!0);0<=a.Za&&a.Za<=Bc(a)&&(a.Ya=a.Za=-1,Ac(a),G(a),c=!0);c&&a.V(Bc(a)+" cycles: checksum="+r(a.mb))}} -h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.P)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Aa/a.Ka&&(b=1);a.ra=b;b=a.zb*a.ra;if(a.Ka!=b){a.Ka=b;b=a.Ka.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.l&&Ec(a.l)}qb(a,a.ka);a.ka=0;a.ja=qa();a.ya=0;Dc(a)}function Wb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.ob*a.ra/1E3*c|0,a.o.R&&(c+=Fc(a)),a.L[b][0]=c)} -function pb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.qa-=a.a;a.a=a.J=0;b&&(a.qa=0);return c} -h.Rd=function(){if(this.o.R){this.Db>=this.ob&&Dc(this,!0);this.ab=0;this.lb=qa();if(this.ya){var a=this.lb-this.ya;a>this.Xb&&(this.ja+=a,this.ja>this.lb&&(this.ja=this.lb))}try{do{for(var b,c=this.o.rb?1:this.pb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.ab+=b;this.ka+=b;rb(this,b);pb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.pb;15<=++this.Yb&&(this.va(),this.Yb=0);break}}while(this.o.R)}catch(f){G(this); -this.l&&this.l.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.R){a=setTimeout;b=this.$b;this.ya=qa();c=this.Xb;this.ab&&(c=Math.round(c*this.ab/this.pb));c-=this.ya-this.lb;if(d=this.ya-this.ja)this.Aa=Math.round(this.ka/(10*d))/100,864E5<=d&&(this.sa=0,Cc(this));if(0>c||this.Aac&&(this.ja-=c),c=0;this.Db+=this.ab;this.ya+=c;a(b,c)}}}; -function ob(a){var b;a.o.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.R)a.V(a.toString()+" busy");else{Cc(a);a.o.R=!0;a.o.Mb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.ja,Bc(a));setTimeout(a.$b,0)}}h.wb=function(){return 0};function G(a){var b=!1;if(a.o.R){Fc(a);qb(a,a.ka);a.ka=0;a.o.R=!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.Qa=+a.model||1170;this.Tb=a.addrReset||0;wc.call(this,a,6666667);this.qb=0;this.Vb=255;1120==this.Qa?(this.decode=Hc.bind(this),this.za=this.Ac,this.qb=8,this.Vb=-1):(this.decode=Ic.bind(this),this.za=this.Bc);Jc(this);this.Ma=0;this.I=null;this.o.complete=!1}A(Gc,wc);h=Gc.prototype;h.reset=function(){this.status("model "+this.Qa);this.o.R&&G(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; -function Jc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.Tb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.pa=[0,0,0,0];a.v=0;a.kb=0;a.Ic=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,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]];a.ca=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.ec=[0,0,0,0,0,0,0,0];a.dc=0;a.u=0;a.B=a.G=0;a.c=a.b=a.Cb=0;a.Na=-1;nb(a)}function nb(a){a.Z=0;a.Fb=0;a.Hb=0;a.Da=0;a.Y=0;a.vb=0;a.gb=255;a.Wa=0;a.jb=0;a.Xa=262143;a.bb=0;a.A=0;a.I=null;a.h&&(cc(a),a.Gc=Sb(a.h))}function cc(a){a.Wa?(a.T=65536,a.Bb=a.Da&16?4186112:253952,a.S=a.Ec,a.X=a.Od,a.yb=a.Me,Kb(a.h,a.Da&16?22:18)):(a.T=0,a.Bb=57344,a.S=a.Dc,a.X=a.cc,a.yb=a.ic,Kb(a.h,16))} -function bc(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Fb=a.A>>16&65535,a.Hb=a.A&65535);a.Z=b;a.jb=b>>5&3;a.kb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Wa!=c&&(a.Wa=c,cc(a))}}h.Wb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.sa,this.ra]);a.set(2,Rb(this.h));return a.data()}; -h.restore=function(a){var b=a[1];this.sa=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.v!=c&&(a.pa[c]=a.g[6],a.g[6]=a.pa[a.v]);a.D=b;a.u&=-3;a.u|=a.I?2:1}function R(a,b){a.u&256||(a.s=a.i=b,a.f=0)} -function Oc(a,b,c){a.u&256||(a.s=a.i=a.m=b,a.f=c||0)}function Pc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Qc(a,b){a.u&256||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Rc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} -function J(a,b,c,d){if(!a.Ma){0>a.Na?a.Na=dc(a):a.v||(d=-3);var e=!1;-3==d&&(b=4,a.Y|=4,a.g[6]=4,e=!0);a.A=b|4143316992;a.v=0;var f=a.X(b|a.T),g=a.X(b+2&65535|a.T);ec(a,g&-12289|a.Na>>2&12288);Sc(a,a.Na,e);Sc(a,a.g[7],e);Q(a,f);a.a-=5;a.u&=~(c|19);a.u|=129;a.Na=-1;if(-3<=d)throw b;}}function Tc(a){var b=Uc(a),c=Uc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);Q(a,b);ec(a,c);a.u&=-17}function Vc(a,b){var c=b>>13&31;31>c&&(b=a.Da&32?a.hb[c]+(b&8190)&4194302:b&-3932161);return b} -function vb(a,b,c){var d,e,f;if(!(c&a.Wa))return f=b&65535,57344<=f&&(f|=a.Bb),f;d=b>>13;a.Da&a.Ic[a.v]||(d&=7);e=a.H[a.v][d];f=(a.ca[a.v][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=Vc(a,f));if(a.Ma)return f;f>=a.Gc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Xa)||a.v)a.jb=a.v,a.kb=d;g&&(g&57344&&(0<=a.Na&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.jb<<5|a.kb<<1,bc(a,a.Z&-61695|g&61694)),J(a,168,64,-1)),a.Z&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Uc(a){var b=a.X(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Sc(a,b,c){var d=a.g[6]-2&65535;a.g[6]=d;a.A=a.A&65535|(a.A&-65536)<<8|16121856;c||a.za(4,-2,d);a.yb(d,b)} -function Wc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.za(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.za(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.X(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.za(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.X(e)|g;a.a-=8;break;case 6:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,6==c&&a.za(d,0, -e),a.a-=6,e|g;case 7:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,e=a.X(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ac=function(a,b,c){!this.v&&0>=b&&c<=this.gb&&(this.u|=32)};h.Bc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.gb&&(c<=this.gb-32?J(this,4,0,-3):(this.Y|=8,this.u|=32)))};h.Dc=function(a,b,c){a=Wc(this,a,b,c);3932160<=a&&(a=Vc(this,a));return a};h.Ec=function(a,b,c){return vb(this,Wc(this,a,b,c),c)}; -h.cc=function(a){3932160<=a&&(a=Vc(this,a));return Ob(this.h,this.bb=a)};h.Od=function(a){return Ob(this.h,this.bb=vb(this,a,2))};h.ic=function(a,b){3932160<=a&&(a=Vc(this,a));Qb(this.h,this.bb=a,b&65535)};h.Me=function(a,b){Qb(this.h,this.bb=vb(this,a,4),b)};function Xc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Wc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.v=a.D>>12&3,c=a.X(d|c&a.T),a.v=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.pa[a.D>>12&3];return c} -function Yc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Wc(a,b,e,4),c&65536||(e&=65535),a.v=a.D>>12&3,e=vb(a,e|c&65536,4),a.v=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.pa[a.D>>12&3]=d}function Zc(a,b){b>>=6;var c=a.G=b&7;(b=a.B=(b&56)>>3)?(c=a.S(b,c,3),a=Nb(a.h,c)):a=a.g[c+a.qb]&a.Vb;return a}function $c(a,b){b>>=6;var c=a.G=b&7;return(b=a.B=(b&56)>>3)?Ob(a.h,a.S(b,c,2)):a.g[c+a.qb]} -function ad(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Wc(a,b,c,8)}function bd(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.S(b,c,3),a=Nb(a.h,c)):a=a.g[c]&255;return a}function cd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Ob(a.h,a.S(b,c,2)):a.g[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Cb=a.S(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Nb(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].xb(e&a.l,c&255,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} -function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.S(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Ob(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function dd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,e,5),e=c=0>c?a.g[-c-1]&255:c,d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].xb(d&a.l,e&255,d)):c?(c=0>c?a.g[-c-1]&255:c,a.g[e]=a.g[e]&~d|c<<24>>24&d):a.g[e]&=~d;return c} -function ed(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,d,4),Qb(a.h,d,c=0>c?a.g[-c-1]:c)):a.g[d]=c=0>c?a.g[-c-1]:c;return c}function V(a,b,c){c&&(Q(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} -h.wb=function(a){this.o.complete=!0;var b=a?this.o.Mb?0:1:-1;this.o.Mb=!1;this.qa=this.a=a;do{if(this.u){if(a=this.u&11){a=!1;if(this.u&2){var c=160,d=(this.vb&224)>>5,e=this.I&&this.I.Ra>d?this.I:null;e&&(c=e.Td,d=e.Ra);d>(this.D&224)>>5?(this.u&8&&(Mc(this,2),this.u&=-9),J(this,c,0,-9),d=!0):d=!1;d&&(e&&ac(this,e),a=!0);this.I||this.vb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Nc(this)&&0>b)break}this.u=this.u&15|this.D&16;this.decode(Lc(this))}while(0>1|b<<16;Qc(this,a);return a&65535} -function kd(a,b){a=b&128|b>>1|b<<8;Qc(this,a<<8);return a&255}function ld(a,b){a=b&~a;R(this,a);return a}function md(a,b){a=b&~a;R(this,a<<8);return a}function nd(a,b){a|=b;R(this,a);return a}function od(a,b){a|=b;R(this,a<<8);return a}function pd(a,b){a=~b|65536;Oc(this,a);return a&65535}function qd(a,b){a=~b|256;Oc(this,a<<8);return a&255}function rd(a,b){a=b-a;this.u&256||(this.s=this.i=a,this.f=b&(b^a));return a&65535} -function sd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&256||(this.s=this.i=c,this.f=b&(b^c));return a&255}function td(a,b){a=b+a;this.u&256||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function ud(a,b){a=b+a;var c=a<<8;this.u&256||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function vd(a,b){a=-b;Oc(this,a,a&b&32768);return a&65535}function wd(a,b){a=-b;Oc(this,a<<8,(a&b&128)<<8);return a&255}function xd(a,b){a=b<<1|this.m>>16&1;Qc(this,a);return a&65535} -function yd(a,b){a=b<<1|this.m>>16&1;Qc(this,a<<8);return a&255}function zd(a,b){a=(this.m&65536|b)>>1|b<<16;Qc(this,a);return a&65535}function Ad(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Qc(this,a<<8);return a&255}function Bd(a,b){var c=b-a;Rc(this,c,a,b);return c&65535}function Cd(a,b){var c=b-a;Rc(this,c<<8,a<<8,b<<8);return c&255}function Dd(a,b){this.u&256||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}function Ed(a,b){a^=b;R(this,a);return a&65535} -function Fd(a){U(this,a,$c(this,a),fd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Gd(a){var b=cd(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} -function Hd(a){var b=cd(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Id(a){V(this,a,!P(this))}function Jd(a){V(this,a,P(this))} -function Kd(a){U(this,a,$c(this,a),ld);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Ld(a){S(this,a,Zc(this,a),md);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Md(a){U(this,a,$c(this,a),nd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Nd(a){S(this,a,Zc(this,a),od);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function Od(a){var b=$c(this,a);a=cd(this,a);R(this,(0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Pd(a){var b=Zc(this,a);a=bd(this,a);R(this,((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Qd(a){V(this,a,this.i&65535?0:4)}function Rd(a){V(this,a,!Kc(this)==!(this.f&32768))}function Sd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.f&32768))} -function Td(a){V(this,a,!P(this)&&!!(this.i&65535))}function Ud(a){V(this,a,(this.i&65535?0:4)||!Kc(this)!=!(this.f&32768))}function Vd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Wd(a){V(this,a,!Kc(this)!=!(this.f&32768))}function Xd(a){V(this,a,Kc(this))}function Yd(a){V(this,a,!!(this.i&65535))}function Zd(a){V(this,a,!Kc(this))}function $d(){J(this,12,0,-8)}function ae(a){V(this,a,!0)}function be(a){V(this,a,!(this.f&32768))}function ce(a){V(this,a,this.f&32768?2:0)} -function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function de(a){var b=$c(this,a);a=cd(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Rc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ee(a){var b=Zc(this,a);a=bd(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Rc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} -function fe(a){var b=cd(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function ge(){J(this,24,0,-8);this.a-=20} -function he(){this.D&49152?(this.Y|=128,J(this,4,0,-7)):(this.w&&1120==this.Qa&&this.w.setData(this.g[0],!0),this.F?this.F.b():G(this));this.a-=7}function ie(){J(this,16,0,-8);this.a-=20}var je=[0,7,7,10,7,11,9,13];function ke(a){this.J=this.a;Q(this,ad(this,a));this.a=this.J-je[this.c]}var le=[0,14,14,17,14,18,16,20];function me(a){this.J=this.a;var b=ad(this,a);a=a>>6&7;Sc(this,this.g[a]);this.g[a]=this.g[7];Q(this,b);this.a=this.J-le[this.c]}var ne=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function oe(a){var b=$c(this,a);this.J=this.a;R(this,ed(this,a,b));this.a=this.J-ne[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function pe(a){var b=Zc(this,a);R(this,dd(this,a,b,65535)<<8);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var qe=[7,13,13,17,14,18,17,21]; -function re(a){var b=cd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.u&256||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)Q(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function xe(a){U(this,a,$c(this,a),Bd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ye(a){U(this,a,0,Dd);this.a-=this.c?9:3+(7==this.b?2:0)}function ze(){J(this,28,0,-8)} -function Ae(){this.w&&(this.w.ia=this.g[7],this.w.setData(this.g[0],!0));this.u|=8;Mc(this,-2);this.a-=3}function Be(a){U(this,a,this.g[(a>>6&7)+this.qb],Ed);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Hc(a){Ce[a>>12].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a>>6&3].call(this,a)} -function Pe(a){Qe[a>>6&3].call(this,a)}function Re(a){Se[a>>6&3].call(this,a)} -var Ce=[function(a){Te[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,Fd,Y,function(a){Ue[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,xe,Y],Te=[function(a){Ve[a>>4&15].call(this,a)},ae,Yd,Qd,Rd,Wd,Sd,Ud,me,me,De,Fe,He,Y,Y,Y],Ee=[function(a){Oc(this,ed(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0, -vd);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=cd(this,a);Oc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ie=[function(a){U(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)}], -Ve=[function(a){We[a&15].call(this,a)},Y,Y,Y,ke,ke,ke,ke,ue,Y,Je,Le,ye,ye,ye,ye],We=[he,Ae,ve,$d,ie,te,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ke=[se,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Me=[se,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ue=[Zd,Xd,Td,Vd,be,ce,Id,Jd,ge,ze,Ne,Pe,Re,Y,Y,Y],Oe=[function(a){Oc(this, -dd(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)}],Qe=[function(a){S(this,a,0,wd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bd(this,a);Oc(this,a<<8);this.a-=this.c?4:3+(7== -this.b?2:0)}],Se=[function(a){S(this,a,0,Ad);this.a-=this.c?9+(this.Cb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,kd);this.a-=this.c?9+(this.Cb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Xe[a>>12].call(this,a)} -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.g[7]+((a&63)<<1)&65535;var b=this.X(a|this.T);Q(this,this.g[5]);this.g[6]=a+2&65535;this.g[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.J= -this.a;Yc(this,a,0,b);R(this,b);this.a=this.J-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.D&49152||(this.D=this.D&-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.D&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.J=this.a;Yc(this,a,65536,b);R(this,b);this.a=this.J-qe[this.c]},Y]; -function ef(a){x.call(this,"ROM",a,ef,128);this.ba=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=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;v(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.xa,a,b),(a=sa(a,b))?(c.c=a.M,c.ba=a.ba):c.l=null);ff(c)})}}A(ef);h=ef.prototype; -h.fa=function(a,b,c,d){this.h=b;this.a=c;this.F=d;ff(this)};h.ha=function(){this.ba&&(this.F&&this.F.a(this.id,this.i,this.b,this.ba),delete this.ba);return!0};h.ga=function(){return!0}; -function ff(a){if(!Xa(a)){if(a.l){if(!a.c||!a.h)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.Cd,ef.prototype.Ae,null,null,null,a.b>>1],c);if(eb(a.h,a,b)){b=a.m=!0;break a}}else if(Hb(a.h,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,z=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(z)for(;z--;)Pb(a.h,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.Pb&&c<=m.vc&&(b=c-(m.Pb-m.jc));b&&(a.preventDefault&&a.preventDefault(),d.ub(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.lc&&(b=m.kc);d.ub(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& +function ta(a,b){var c,d={M:null,ba: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.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ba=g.symbols;d.M.length?1==d.M.length&&(v(d.M[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.xa=this.id:(this.ya=this.id.substr(0,b),this.xa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Gb:!1,P:!1,error:!1};this.tb=null;this.o.error=!1;this.j={};this.G=null;this.Kc=d||0;x.push(this)}var Na=void 0,Oa={}; +if(window){Na||(Na=window.location.search.substr(1));for(var Pa,Qa=/\+/g,Ra=/([^&=]+)=?([^&]*)/g;Pa=Ra.exec(Na);)Oa[decodeURIComponent(Pa[1].replace(Qa," "))]=decodeURIComponent(Pa[2].replace(Qa," "))}function Sa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} +function y(a,b){b||(b=w);a.prototype=Sa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ta=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else Ta={},x=[];function Ua(a,b,c){Ta[a]&&b&&(Ta[a][b]=c)}function z(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Vc,a]}y(bb);var cb=7;function db(a,b){return a.b[b]&&a.b[b][1]}h=bb.prototype;h.reset=function(){this.stop()}; +h.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[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(){eb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){fb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){eb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){fb(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.ga=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;gb(b,this,hb);ib(b,this.reset.bind(this));jb(this);kb(this)};h.ia=function(a,b){b||(lb(),this.reset());return!0};h.ha=function(){return!0}; +function mb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function jb(a,b){for(var c in a.f)mb(a,c,null!=b?b:a.f[c])}function nb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function kb(a){for(var b in a.b)nb(a,b,a.b[b][1])}function ob(a,b,c,d){a.j[b]&&(void 0===c&&(Za(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.G&&a.G.b||8)?ja(c,d):ka(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} +function eb(a,b){var c=a.b[b];nb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function fb(a,b){var c=a.b[b];c[2]&&c[3]&&(nb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Tc=function(a){a||this.a.o.S||(a=this.a,a.h.reset(),pb(a),db(this,"ENABLE")&&qb(this.a))};h.Uc=function(){};h.Pc=function(a){a||G(this.a)}; +h.Nc=function(a){if(!a&&!this.a.o.S)if(db(this,"ENABLE"))qb(this.a);else{a=this.G;var b;if(b=a)a.o.Fa&&(a.o.Gb=!0),b=!a.o.Fa;if(b)Xa(a,!0),a.wb(0,null),Xa(a,!1);else try{var c=this.a.wb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Qa?8:16,c=65472<=a.ja&&a.ja<65472+b,b=c?1:2,c=c?15:a.h.Ca;db(a,"STEP")||(b=-b);zb(a,a.ja&~c|a.ja+b&c)}function zb(a,b){a.ja=b&a.h.Ca;b=a.ja;for(var c=0;22>c;c++)Ab(a,"A"+c,b&1<c;c++)Ab(a,"D"+c,b&1<>2;this.l=this.c-1;this.v=this.w/this.c|0;this.Ba=[];this.m=0;this.s=!1;this.A=[];this.zc=[Eb,Fb,Gb,Hb];a=new H(this);Ib(a,this.G);this.h=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.b;this.B=0;this.i=this.Ca;E(this)}y(Cb); +var Db=8192,Lb=Db-1;function Eb(a,b){var c=-1,d=this.controller,e=d.Ba[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} +function Fb(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Gb(a,b){var c=-1,d=this.controller;a=d.Ba[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} +function Hb(a,b,c){var d=!1,e=this.controller;a=e.Ba[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Mb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.H]=a.h[a.F])}}Cb.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ea)return l.ib+=l.Ea-f,l.Ea=f,!0;if(f>=l.Ea+l.ib){p=l.size-(f-n);p>g&&(p=g);l.ib=f-l.Ea+p;f=n+a.c;g-=p;k++;continue}}return Nb(1,f,g)}f=new H(a,f,p,a.c,d,e);Ib(f,a.G,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Ob[d]+" at "+ja(b)),!0):Nb(2,b,c)}function Pb(a,b){return a.f[(b&a.i)>>>a.b].Lb(b&a.l,b)} +function Qb(a,b){return a.f[(b&a.i)>>>a.b].X(b&a.l,b)}function yb(a,b){a.s=!1;a.m++;b=a.h[(b&a.Ca)>>>a.b].ec(b&a.l,b);a.m--;return b}function Rb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].Qb(b&a.l,c&255,b);a.m--}function Sb(a,b,c){a.f[(b&a.i)>>>a.b].yb(b&a.l,c&65535,b)}function wb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].kc(b&a.l,c&65535,b);a.m--} +function Tb(a){for(var b=0,c=[],d=0;da.a.Qa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var u=g[4],A=g[5]||1,F=0;F>16&65535);a=a.Hb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.gd=function(){var a=this.a;a.Z&57344||(a.Ib=a.A&65535);return a.Ib};h.hd=function(){return this.a.Da};h.ge=function(a){var b=this.a;1170>b.Qa&&(a&=-49);b.Da!=a&&(b.Da=a,b.Xa=a&16?4194303:262143,ec(b))};h.Qd=function(a){a=a>>1&63;var b=this.a.hb[a>>1];return a&1?b>>16:b&65535}; +h.Oe=function(a,b){b=b>>1&63;var c=b>>1;this.a.hb[c]=b&1?this.a.hb[c]&65535|(a&63)<<16:this.a.hb[c]&-65536|a&65534};h.Jd=function(a){return this.a.I[1][a>>1&7]};h.He=function(a,b){this.a.I[1][b>>1&7]=a&65295};h.Hd=function(a){return this.a.I[1][(a>>1&7)+8]};h.Fe=function(a,b){this.a.I[1][(b>>1&7)+8]=a&65295};h.Id=function(a){return this.a.ca[1][a>>1&7]};h.Ge=function(a,b){b=b>>1&7;this.a.ca[1][b]=a;this.a.I[1][b]&=65295};h.Gd=function(a){return this.a.ca[1][(a>>1&7)+8]}; +h.Ee=function(a,b){b=(b>>1&7)+8;this.a.ca[1][b]=a;this.a.I[1][b]&=65295};h.bd=function(a){return this.a.I[0][a>>1&7]};h.ce=function(a,b){this.a.I[0][b>>1&7]=a&65295};h.$c=function(a){return this.a.I[0][(a>>1&7)+8]};h.ae=function(a,b){this.a.I[0][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.a.ca[0][a>>1&7]};h.be=function(a,b){b=b>>1&7;this.a.ca[0][b]=a;this.a.I[0][b]&=65295};h.Zc=function(a){return this.a.ca[0][(a>>1&7)+8]};h.$d=function(a,b){b=(b>>1&7)+8;this.a.ca[0][b]=a;this.a.I[0][b]&=65295}; +h.Pd=function(a){return this.a.I[3][a>>1&7]};h.Ne=function(a,b){this.a.I[3][b>>1&7]=a&65295};h.Nd=function(a){return this.a.I[3][(a>>1&7)+8]};h.Le=function(a,b){this.a.I[3][(b>>1&7)+8]=a&65295};h.Od=function(a){return this.a.ca[3][a>>1&7]};h.Me=function(a,b){b=b>>1&7;this.a.ca[3][b]=a;this.a.I[3][b]&=65295};h.Md=function(a){return this.a.ca[3][(a>>1&7)+8]};h.Ke=function(a,b){b=(b>>1&7)+8;this.a.ca[3][b]=a;this.a.I[3][b]&=65295};h.Sa=function(a){a&=7;return this.a.D&2048?this.a.Ja[a]:this.a.g[a]}; +h.Ua=function(a,b){b&=7;this.a.D&2048?this.a.Ja[b]=a:this.a.g[b]=a};h.nd=function(){return this.a.D&49152?this.a.ra[0]:this.a.g[6]};h.le=function(a){this.a.D&49152?this.a.ra[0]=a:this.a.g[6]=a};h.qd=function(){return this.a.g[7]};h.oe=function(a){this.a.g[7]=a};h.Ta=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Ja[a]};h.Va=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Ja[b]=a};h.od=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.ra[1]}; +h.me=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.ra[1]=a};h.pd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.ra[3]};h.ne=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.ra[3]=a};h.Yc=function(a){return this.a.hc[a-65504>>1]};h.Zd=function(a,b){this.a.hc[b-65504>>1]=a};h.dc=function(a){return 65520==a?(Ub(this.h)>>6)-1:0};h.jc=function(){};h.Ld=function(){return 1};h.Je=function(){};h.Xc=function(){return this.a.Y};h.Yd=function(){this.a.Y=0};h.dd=function(){return this.a.gc}; +h.ee=function(a,b){b&1||(a&=255);this.a.gc=a};h.jd=function(a,b){return b?0:this.a.vb};h.he=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=1}b.vb=a};h.Kd=function(a,b){return b?0:this.a.gb&65280};h.Ie=function(a){this.a.gb=a|255};h.md=function(){return fc(this.a)};h.ke=function(a){gc(this.a,a&-1793|fc(this.a)&1792);this.a.u|=256};h.ic=function(){}; +var M={},ac=(M[61568]=[null,null,K.prototype.Qd,K.prototype.Oe,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Jd,K.prototype.He,"SIPDR",8,1145,64],M[62608]=[null,null,K.prototype.Hd,K.prototype.Fe,"SDPDR",8,1145,64],M[62624]=[null,null,K.prototype.Id,K.prototype.Ge,"SIPAR",8,1145,64],M[62640]=[null,null,K.prototype.Gd,K.prototype.Ee,"SDPAR",8,1145,64],M[62656]=[null,null,K.prototype.bd,K.prototype.ce,"KIPDR",8,1145,64],M[62672]=[null,null,K.prototype.$c,K.prototype.ae,"KDPDR",8,1145,64],M[62688]= +[null,null,K.prototype.ad,K.prototype.be,"KIPAR",8,1145,64],M[62704]=[null,null,K.prototype.Zc,K.prototype.$d,"KDPAR",8,1145,64],M[62798]=[null,null,K.prototype.hd,K.prototype.ge,"MMR3",1,1145,64],M[65382]=[null,null,K.prototype.cd,K.prototype.de,"LKS"],M[65402]=[null,null,K.prototype.ed,K.prototype.fe,"MMR0",1,1145,64],M[65404]=[null,null,K.prototype.fd,K.prototype.ic,"MMR1",1,1145,64],M[65406]=[null,null,K.prototype.gd,K.prototype.ic,"MMR2",1,1145,64],M[65408]=[null,null,K.prototype.Pd,K.prototype.Ne, +"UIPDR",8,1145,64],M[65424]=[null,null,K.prototype.Nd,K.prototype.Le,"UDPDR",8,1145,64],M[65440]=[null,null,K.prototype.Od,K.prototype.Me,"UIPAR",8,1145,64],M[65456]=[null,null,K.prototype.Md,K.prototype.Ke,"UDPAR",8,1145,64],M[65472]=[null,null,K.prototype.Sa,K.prototype.Ua,"R0SET0"],M[65473]=[null,null,K.prototype.Sa,K.prototype.Ua,"R1SET0"],M[65474]=[null,null,K.prototype.Sa,K.prototype.Ua,"R2SET0"],M[65475]=[null,null,K.prototype.Sa,K.prototype.Ua,"R3SET0"],M[65476]=[null,null,K.prototype.Sa, +K.prototype.Ua,"R4SET0"],M[65477]=[null,null,K.prototype.Sa,K.prototype.Ua,"R5SET0"],M[65478]=[null,null,K.prototype.nd,K.prototype.le,"R6KERNEL"],M[65479]=[null,null,K.prototype.qd,K.prototype.oe,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ta,K.prototype.Va,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ta,K.prototype.Va,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ta,K.prototype.Va,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ta,K.prototype.Va,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ta, +K.prototype.Va,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ta,K.prototype.Va,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.od,K.prototype.me,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.pd,K.prototype.ne,"R6USER",1,1145],M[65504]=[null,null,K.prototype.Yc,K.prototype.Zd,"CTRL",8,1170],M[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Ld,K.prototype.Je,"SYSID",1,1170],M[65526]= +[null,null,K.prototype.Xc,K.prototype.Yd,"CPUERR",1,1170],M[65528]=[null,null,K.prototype.dd,K.prototype.ee,"MB",1,1170],M[65530]=[null,null,K.prototype.jd,K.prototype.he,"PIR"],M[65532]=[null,null,K.prototype.Kd,K.prototype.Ie,"SL"],M[65534]=[null,null,K.prototype.md,K.prototype.ke,"PSW"],M); +Ja(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),oc(this,kc?pc:qc);else{a=this.a=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ka:function(a,b){a&1&&I(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},la: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},F:function(a,b){return this.H(a,b)},T:function(a,b){return this.ec(a,b)},ya:function(a,b,c){this.l?this.f(a,b,c):this.Qb(a,b,c)},ta:function(a,b,c){this.l?this.f(a,b,c):this.kc(a,b,c)},B:function(a){return this.j[a]},J:function(a){return this.j[a]},R:function(a,b){a&1&&I(this.h,b,64);return this.c.getUint16(a,!0)},ea:function(a,b){a&1&&I(this.h,b,64);return this.s[a>>1]},xa:function(a,b){this.j[a]=b;this.ua=!0},pa:function(a,b){this.j[a]=b;this.ua=!0},sa:function(a,b,c){a&1&&I(this.h, +c,64);this.c.setUint16(a,b,!0);this.ua=!0},za:function(a,b,c){a&1&&I(this.h,c,64);this.s[a>>1]=b;this.ua=!0}};function Ib(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&tc(a,uc,!1),(a.m=c.m)&&vc(a,uc,!1))}function vc(a,b,c){c&&a.m||(a.xb=!a.l&&b[1]||a.f,a.yb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Qb=b[1]||a.f,a.kc=b[3]||a.A}function tc(a,b,c){c&&a.i||(a.Lb=b[0]||a.v,a.X=b[2]||a.w);if(c||void 0===c)a.H=b[0]||a.v,a.ec=b[2]||a.w}function oc(a,b){b||(b=wc);tc(a,b,void 0);vc(a,b,void 0)} +var wc=[],sc=[H.prototype.L,H.prototype.la,H.prototype.ka,H.prototype.Aa],uc=[H.prototype.F,H.prototype.ya,H.prototype.T,H.prototype.ta];if($a)var qc=[H.prototype.B,H.prototype.xa,H.prototype.R,H.prototype.sa],pc=[H.prototype.J,H.prototype.pa,H.prototype.ea,H.prototype.za]; +function xc(a,b){w.call(this,"CPU",a,xc,1);b=a.cycles||b;var c=a.multiplier||1;this.Ab=0;this.ob=b;this.sa=c;this.Db=Math.round(this.ob/1E4)/100;this.Ka=this.Db*this.sa;this.o.S=!1;this.o.Nb=!1;this.o.cb=a.autoStart;this.o.rb=!1;this.mb=this.La=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.L=[];this.cc=this.Vd.bind(this);E(this)}y(xc);var yc=["power","reset"];h=xc.prototype; +h.ga=function(a,b,c,d){this.l=a;this.h=b;this.G=d;this.w=a.w;for(b=0;b=a.La&&(a.La+=a.Ya,c=!0);0<=a.Za&&a.Za<=Cc(a)&&(a.Ya=a.Za=-1,Bc(a),G(a),c=!0);c&&a.V(Cc(a)+" cycles: checksum="+ka(a.mb))}} +h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.P)a=!0;else{var b=null,c,k=z(a.id);for(c=0;ca.Aa/a.Ka&&(b=1);a.sa=b;b=a.Db*a.sa;if(a.Ka!=b){a.Ka=b;b=a.Ka.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.l&&Fc(a.l)}sb(a,a.ka);a.ka=0;a.ea=ra();a.pa=0;Ec(a)}function Yb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Zb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.ob*a.sa/1E3*c|0,a.o.S&&(c+=Gc(a)),a.L[b][0]=c)} +function rb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Gc(a,b){var c=a.la-=a.a;a.a=a.J=0;b&&(a.la=0);return c} +h.Vd=function(){if(this.o.S){this.Fb>=this.ob&&Ec(this,!0);this.ab=0;this.lb=ra();if(this.pa){var a=this.lb-this.pa;a>this.$b&&(this.ea+=a,this.ea>this.lb&&(this.ea=this.lb))}try{do{for(var b,c=this.o.rb?1:this.pb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wb(b)}catch(f){if("number"!=typeof f)throw f;}b=Gc(this,!0);this.ab+=b;this.ka+=b;tb(this,b);rb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.pb;15<=++this.bc&&(this.wa(),this.bc=0);break}}while(this.o.S)}catch(f){G(this); +this.l&&this.l.stop(ra(),Cc(this));Za(this,f.stack||f.message);return}if(this.o.S){a=setTimeout;b=this.cc;this.pa=ra();c=this.$b;this.ab&&(c=Math.round(c*this.ab/this.pb));c-=this.pa-this.lb;if(d=this.pa-this.ea)this.Aa=Math.round(this.ka/(10*d))/100,864E5<=d&&(this.ta=0,Dc(this));if(0>c||this.Aac&&(this.ea-=c),c=0;this.Fb+=this.ab;this.pa+=c;a(b,c)}}}; +function qb(a){var b;a.o.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.S)a.V(a.toString()+" busy");else{Dc(a);a.o.S=!0;a.o.Nb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.ea,Cc(a));setTimeout(a.cc,0)}}h.wb=function(){return 0};function G(a){var b=!1;if(a.o.S){Gc(a);sb(a,a.ka);a.ka=0;a.o.S=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(ra(),Cc(a));b=!0}a.o.complete=void 0;return b} +function Hc(a){this.Qa=+a.model||1170;this.Wb=a.addrReset||0;xc.call(this,a,6666667);this.qb=0;this.Zb=255;1120==this.Qa?(this.decode=Ic.bind(this),this.za=this.Dc,this.qb=8,this.Zb=-1):(this.decode=Jc.bind(this),this.za=this.Ec);Kc(this);this.Ma=0;this.H=null;this.Bb=[];this.o.complete=!1}y(Hc,xc);h=Hc.prototype;h.Sb=function(){for(var a=192,b=0;bc.Pb&&(c.Pb=a,a+=4)}}; +h.reset=function(){this.status("model "+this.Qa);this.o.S&&G(this);Kc(this);Ac(this);this.o.error=!1;this.parent.reset.call(this)}; +function Kc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.Wb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.ra=[0,0,0,0];a.v=0;a.kb=0;a.Lc=[4,2,0,1];a.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],[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]];a.ca=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0]];a.hb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.hc=[0,0,0,0,0,0,0,0];a.gc=0;a.u=0;a.B=a.F=0;a.c=a.b=a.zb=0;a.Na=-1;pb(a)}function pb(a){a.Z=0;a.Hb=0;a.Ib=0;a.Da=0;a.Y=0;a.vb=0;a.gb=255;a.Wa=0;a.jb=0;a.Xa=262143;a.bb=0;a.A=0;a.H=null;a.h&&(ec(a),a.Jc=Ub(a.h))}function ec(a){a.Wa?(a.T=65536,a.Cb=a.Da&16?4186112:253952,a.R=a.Hc,a.X=a.Rd,a.yb=a.Pe,Mb(a.h,a.Da&16?22:18)):(a.T=0,a.Cb=57344,a.R=a.Gc,a.X=a.fc,a.yb=a.lc,Mb(a.h,16))} +function dc(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Hb=a.A>>16&65535,a.Ib=a.A&65535);a.Z=b;a.jb=b>>5&3;a.kb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Wa!=c&&(a.Wa=c,ec(a))}}h.Yb=function(){return 0};h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ta,this.sa]);a.set(2,Tb(this.h));return a.data()}; +h.restore=function(a){var b=a[1];this.ta=b[1];Dc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.v!=c&&(a.ra[c]=a.g[6],a.g[6]=a.ra[a.v]);a.D=b;a.u&=-3;a.u|=a.H?2:1}function S(a,b){a.u&256||(a.s=a.i=b,a.f=0)} +function Pc(a,b,c){a.u&256||(a.s=a.i=a.m=b,a.f=c||0)}function Qc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Rc(a,b){a.u&256||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Sc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} +function J(a,b,c,d){if(!a.Ma){0>a.Na?a.Na=fc(a):a.v||(d=-3);var e=!1;-3==d&&(b=4,a.Y|=4,a.g[6]=4,e=!0);a.A=b|4143316992;a.v=0;var f=a.X(b|a.T),g=a.X(b+2&65535|a.T);gc(a,g&-12289|a.Na>>2&12288);Tc(a,a.Na,e);Tc(a,a.g[7],e);R(a,f);a.a-=5;a.u&=~(c|19);a.u|=129;a.Na=-1;if(-3<=d)throw b;}}function Uc(a){var b=Vc(a),c=Vc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);R(a,b);gc(a,c);a.u&=-17}function Wc(a,b){var c=b>>13&31;31>c&&(b=a.Da&32?a.hb[c]+(b&8190)&4194302:b&-3932161);return b} +function xb(a,b,c){var d,e,f;if(!(c&a.Wa))return f=b&65535,57344<=f&&(f|=a.Cb),f;d=b>>13;a.Da&a.Lc[a.v]||(d&=7);e=a.I[a.v][d];f=(a.ca[a.v][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=Wc(a,f));if(a.Ma)return f;f>=a.Jc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.I[a.v][d]=e;if(f!=(4194170&a.Xa)||a.v)a.jb=a.v,a.kb=d;g&&(g&57344&&(0<=a.Na&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.jb<<5|a.kb<<1,dc(a,a.Z&-61695|g&61694)),J(a,168,64,-1)),a.Z&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Vc(a){var b=a.X(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Tc(a,b,c){var d=a.g[6]-2&65535;a.g[6]=d;a.A=a.A&65535|(a.A&-65536)<<8|16121856;c||a.za(4,-2,d);a.yb(d,b)} +function Xc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.za(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.za(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.X(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.za(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.X(e)|g;a.a-=8;break;case 6:return e=a.X(Nc(a,2)),e=e+a.g[c]&65535,6==c&&a.za(d,0, +e),a.a-=6,e|g;case 7:return e=a.X(Nc(a,2)),e=e+a.g[c]&65535,e=a.X(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Dc=function(a,b,c){!this.v&&0>=b&&c<=this.gb&&(this.u|=32)};h.Ec=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.gb&&(c<=this.gb-32?J(this,4,0,-3):(this.Y|=8,this.u|=32)))};h.Gc=function(a,b,c){a=Xc(this,a,b,c);3932160<=a&&(a=Wc(this,a));return a};h.Hc=function(a,b,c){return xb(this,Xc(this,a,b,c),c)}; +h.fc=function(a){3932160<=a&&(a=Wc(this,a));return Qb(this.h,this.bb=a)};h.Rd=function(a){return Qb(this.h,this.bb=xb(this,a,2))};h.lc=function(a,b){3932160<=a&&(a=Wc(this,a));Sb(this.h,this.bb=a,b&65535)};h.Pe=function(a,b){Sb(this.h,this.bb=xb(this,a,4),b)};function Yc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Xc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.v=a.D>>12&3,c=a.X(d|c&a.T),a.v=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.ra[a.D>>12&3];return c} +function Zc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Xc(a,b,e,4),c&65536||(e&=65535),a.v=a.D>>12&3,e=xb(a,e|c&65536,4),a.v=a.D>>14&3,Sb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.ra[a.D>>12&3]=d}function $c(a,b){b>>=6;var c=a.F=b&7;(b=a.B=(b&56)>>3)?(c=a.R(b,c,3),a=Pb(a.h,c)):a=a.g[c+a.qb]&a.Zb;return a}function ad(a,b){b>>=6;var c=a.F=b&7;return(b=a.B=(b&56)>>3)?Qb(a.h,a.R(b,c,2)):a.g[c+a.qb]} +function bd(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Xc(a,b,c,8)}function cd(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Pb(a.h,c)):a=a.g[c]&255;return a}function dd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Qb(a.h,a.R(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.zb=a.R(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Pb(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].xb(e&a.l,c&255,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} +function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Sb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Qb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function ed(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,e,5),e=c=0>c?a.g[-c-1]&255:c,d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].xb(d&a.l,e&255,d)):c?(c=0>c?a.g[-c-1]&255:c,a.g[e]=a.g[e]&~d|c<<24>>24&d):a.g[e]&=~d;return c} +function fd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,d,4),Sb(a.h,d,c=0>c?a.g[-c-1]:c)):a.g[d]=c=0>c?a.g[-c-1]:c;return c}function V(a,b,c){c&&(R(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} +h.wb=function(a){this.o.complete=!0;var b=a?this.o.Nb?0:1:-1;this.o.Nb=!1;this.la=this.a=a;do{if(this.u){if(a=this.u&11){a=!1;if(this.u&2){var c=160,d=(this.vb&224)>>5,e=this.H&&this.H.Ra>d?this.H:null;e&&(c=e.Pb,d=e.Ra);d>(this.D&224)>>5?(this.u&8&&(Nc(this,2),this.u&=-9),J(this,c,0,-9),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.H||this.vb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Oc(this)&&0>b)break}this.u=this.u&15|this.D&16;this.decode(Mc(this))}while(0>1|b<<16;Rc(this,a);return a&65535} +function ld(a,b){a=b&128|b>>1|b<<8;Rc(this,a<<8);return a&255}function md(a,b){a=b&~a;S(this,a);return a}function nd(a,b){a=b&~a;S(this,a<<8);return a}function od(a,b){a|=b;S(this,a);return a}function pd(a,b){a|=b;S(this,a<<8);return a}function qd(a,b){a=~b|65536;Pc(this,a);return a&65535}function rd(a,b){a=~b|256;Pc(this,a<<8);return a&255}function sd(a,b){a=b-a;this.u&256||(this.s=this.i=a,this.f=b&(b^a));return a&65535} +function td(a,b){a=b-a;var c=a<<8;b<<=8;this.u&256||(this.s=this.i=c,this.f=b&(b^c));return a&255}function ud(a,b){a=b+a;this.u&256||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function vd(a,b){a=b+a;var c=a<<8;this.u&256||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function wd(a,b){a=-b;Pc(this,a,a&b&32768);return a&65535}function xd(a,b){a=-b;Pc(this,a<<8,(a&b&128)<<8);return a&255}function yd(a,b){a=b<<1|this.m>>16&1;Rc(this,a);return a&65535} +function zd(a,b){a=b<<1|this.m>>16&1;Rc(this,a<<8);return a&255}function Ad(a,b){a=(this.m&65536|b)>>1|b<<16;Rc(this,a);return a&65535}function Bd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Rc(this,a<<8);return a&255}function Cd(a,b){var c=b-a;Sc(this,c,a,b);return c&65535}function Dd(a,b){var c=b-a;Sc(this,c<<8,a<<8,b<<8);return c&255}function Ed(a,b){this.u&256||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}function Fd(a,b){a^=b;S(this,a);return a&65535} +function Gd(a){U(this,a,ad(this,a),gd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Hd(a){var b=dd(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} +function Id(a){var b=dd(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Jd(a){V(this,a,!Q(this))}function Kd(a){V(this,a,Q(this))} +function Ld(a){U(this,a,ad(this,a),md);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Md(a){T(this,a,$c(this,a),nd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Nd(a){U(this,a,ad(this,a),od);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Od(a){T(this,a,$c(this,a),pd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function Pd(a){var b=ad(this,a);a=dd(this,a);S(this,(0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Qd(a){var b=$c(this,a);a=cd(this,a);S(this,((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Rd(a){V(this,a,this.i&65535?0:4)}function Sd(a){V(this,a,!Lc(this)==!(this.f&32768))}function Td(a){V(this,a,!!(this.i&65535)&&!Lc(this)==!(this.f&32768))} +function Ud(a){V(this,a,!Q(this)&&!!(this.i&65535))}function Vd(a){V(this,a,(this.i&65535?0:4)||!Lc(this)!=!(this.f&32768))}function Wd(a){V(this,a,Q(this)||(this.i&65535?0:4))}function Xd(a){V(this,a,!Lc(this)!=!(this.f&32768))}function Yd(a){V(this,a,Lc(this))}function Zd(a){V(this,a,!!(this.i&65535))}function $d(a){V(this,a,!Lc(this))}function ae(){J(this,12,0,-8)}function be(a){V(this,a,!0)}function ce(a){V(this,a,!(this.f&32768))}function de(a){V(this,a,this.f&32768?2:0)} +function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ee(a){var b=ad(this,a);a=dd(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Sc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fe(a){var b=$c(this,a);a=cd(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Sc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} +function ge(a){var b=dd(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function he(){J(this,24,0,-8);this.a-=20} +function ie(){this.D&49152?(this.Y|=128,J(this,4,0,-7)):(this.w&&1120==this.Qa&&this.w.setData(this.g[0],!0),this.G?this.G.c():G(this));this.a-=7}function je(){J(this,16,0,-8);this.a-=20}var ke=[0,7,7,10,7,11,9,13];function le(a){this.J=this.a;R(this,bd(this,a));this.a=this.J-ke[this.c]}var me=[0,14,14,17,14,18,16,20];function ne(a){this.J=this.a;var b=bd(this,a);a=a>>6&7;Tc(this,this.g[a]);this.g[a]=this.g[7];R(this,b);this.a=this.J-me[this.c]}var oe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function pe(a){var b=ad(this,a);this.J=this.a;S(this,fd(this,a,b));this.a=this.J-oe[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function qe(a){var b=$c(this,a);S(this,ed(this,a,b,65535)<<8);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var re=[7,13,13,17,14,18,17,21]; +function se(a){var b=dd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.u&256||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)R(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ye(a){U(this,a,ad(this,a),Cd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ze(a){U(this,a,0,Ed);this.a-=this.c?9:3+(7==this.b?2:0)}function Ae(){J(this,28,0,-8)} +function Be(){this.w&&(this.w.ja=this.g[7],this.w.setData(this.g[0],!0));this.u|=8;Nc(this,-2);this.a-=3}function Ce(a){U(this,a,this.g[(a>>6&7)+this.qb],Fd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Ic(a){De[a>>12].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a>>6&3].call(this,a)}function Ke(a){Le[a&15].call(this,a)}function Me(a){Ne[a&15].call(this,a)}function Oe(a){Pe[a>>6&3].call(this,a)} +function Qe(a){Re[a>>6&3].call(this,a)}function Se(a){Te[a>>6&3].call(this,a)} +var De=[function(a){Ue[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,Gd,Y,function(a){Ve[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,ye,Y],Ue=[function(a){We[a>>4&15].call(this,a)},be,Zd,Rd,Sd,Xd,Td,Vd,ne,ne,Ee,Ge,Ie,Y,Y,Y],Fe=[function(a){Pc(this,fd(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)}],He=[function(a){U(this,a,0, +wd);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=dd(this,a);Pc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Je=[function(a){U(this,a,0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)}], +We=[function(a){Xe[a&15].call(this,a)},Y,Y,Y,le,le,le,le,ve,Y,Ke,Me,ze,ze,ze,ze],Xe=[ie,Be,we,ae,je,ue,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Le=[te,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ne=[te,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ve=[$d,Yd,Ud,Wd,ce,de,Jd,Kd,he,Ae,Oe,Qe,Se,Y,Y,Y],Pe=[function(a){Pc(this, +ed(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)}],Re=[function(a){T(this,a,0,xd);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,Dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=cd(this,a);Pc(this,a<<8);this.a-=this.c?4:3+(7== +this.b?2:0)}],Te=[function(a){T(this,a,0,Bd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ld);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Jc(a){Ye[a>>12].call(this,a)} +var Ye=[function(a){Ze[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,Gd,function(a){$e[a>>8&15].call(this,a)},function(a){af[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,ye,Y],Ze=[function(a){bf[a>>4&15].call(this,a)},be,Zd,Rd,Sd,Xd,Td,Vd,ne,ne,Ee,Ge,Ie,function(a){cf[a>>6&3].call(this,a)},Y,Y],cf=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.X(a|this.T);R(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Yc(this,a,0);Tc(this,a);S(this,a);this.a-=11},function(a){var b=Vc(this);this.J= +this.a;Zc(this,a,0,b);S(this,b);this.a=this.J-re[this.c]},function(a){S(this,fd(this,a,Lc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],bf=[function(a){df[a&15].call(this,a)},Y,Y,Y,le,le,le,le,ve,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.u|=1,this.u&=-3),this.a-=5):J(this,8,0,-8)},Ke,Me,ze,ze,ze,ze],df=[ie,Be,function(){Uc(this);this.u|=this.D&16;this.a-=13},ae,je,ue,we,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],$e=[se,se,ge,ge,Hd,Hd,Id,Id,Ce,Ce,Y,Y,Y,Y,xe,xe],af=[$d, +Yd,Ud,Wd,ce,de,Jd,Kd,he,Ae,Oe,Qe,Se,function(a){ef[a>>6&3].call(this,a)},Y,Y],ef=[Y,function(a){a=Yc(this,a,65536);Tc(this,a);S(this,a);this.a-=11},function(a){var b=Vc(this);this.J=this.a;Zc(this,a,65536,b);S(this,b);this.a=this.J-re[this.c]},Y]; +function ff(a){w.call(this,"ROM",a,ff,128);this.ba=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.l=a.file;this.s=r(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;t(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ua(c.ya,a,b),(a=ta(a,b))?(c.c=a.M,c.ba=a.ba):c.l=null);gf(c)})}}y(ff);h=ff.prototype; +h.ga=function(a,b,c,d){this.h=b;this.a=c;this.G=d;gf(this)};h.ia=function(){this.ba&&(this.G&&this.G.a(this.id,this.i,this.b,this.ba),delete this.ba);return!0};h.ha=function(){return!0}; +function gf(a){if(!Ya(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Za(a,"ROM size ("+ka(a.c.length,8,!0)+") does not match specified size ("+ka(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+Db){var c={};b=(c[b]=[ff.prototype.Fd,ff.prototype.De,null,null,null,a.b>>1],c);if(gb(a.h,a,b)){b=a.m=!0;break a}}else if(Jb(a.h,b,a.b,nc)){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,A=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(A)for(;A--;)Rb(a.h,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.Rb&&c<=m.yc&&(b=c-(m.Rb-m.mc));b&&(a.preventDefault&&a.preventDefault(),d.ub(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.oc&&(b=m.nc);d.ub(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.ub(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;var e=this;this.T=Zb(48,4,262144);this.L=Wb(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.S&&97<=a&&122>a&&(a-=32),Yb(e.a,e.L,1E3/Math.round(e.G/10)));0<=a&&(e.w=a,e.b&128?e.w|=49152:e.b|=128,e.b&64&&Xb(c,e.T))});this.B=Zb(52,4,262144);this.ka=Wb(this.a,function(){e.c|=128;e.c&64&&Xb(c,e.B)});eb(b,this,mf);gb(b,this.reset.bind(this));F(this)}; -h.Zb=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.wa)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.A=d.receiveData){this.status(this.xa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ha=function(a,b){if(!b)if(this.Zb(),!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(){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.w=0;a.b=0;a.c=128;a.s=[];return!0}h.ub=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.J||8,c=a-this.m%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.m&&c&&(b=String.fromCharCode(this.I)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=this.i){if(10==a|| -1024<=this.i.length)this.V(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Yb(this.a,this.ka,1E3/Math.round(this.ja/10));this.c&=-129};var of={},mf=(of[65392]=[null,null,Z.prototype.pd,Z.prototype.ne,"RCSR"],of[65394]=[null,null,Z.prototype.od,Z.prototype.me,"RBUF"],of[65396]=[null,null,Z.prototype.Qd,Z.prototype.Oe,"XCSR"],of[65398]=[null,null,Z.prototype.Pd,Z.prototype.Ne,"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.G){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.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;this.L=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){w("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.I=Zb(56,4,4096);this.T=Wb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!v(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.xa,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.M,e.ma,e.la)); -a.o.Fa=!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.K);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.sb?"":e)+"&format=json"));return!!v(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.P;if(d)a.controller.C('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{Ta(a.controller.xa,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)w(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=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 z=l.bytes;if(void 0!==z&&z.length){for(var T=n<<2,za=z.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.ea?f=a.oa+a.ea&&(a.ea+=f-(a.oa+a.ea)+1):(a.oa=f,a.ea=1);d[f]=d[f]&~(255<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.na+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=Kf(this,a++);)Nf(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 Nf(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)}}function N(a){x.call(this,"RK11",a,N,65536);this.w=a.autoMount||{};this.m=0;this.c=Array(8);this.A=!Ba("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; -h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Of(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Pf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Mf(a),a.Lb.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)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;Pf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if((a=yc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Qf(this);this.Oa=Zb(144,5,65536);eb(b,this,Rf);gb(b,this.reset.bind(this));Sf(this,"None","",!0);this.A&&Sf(this,"Local Disk","?");Sf(this,"Remote Disk","??");Tf(this)||F(this)}; -h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Ib){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Of(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Qf(this)};h.save=function(){return(new O(this)).data()}; -h.restore=function(a){return Qf(this,a[0])};function Tf(a,b){b||(a.m=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('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=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}Vf(a,e,b,c,!1,d)}else Uf(a,e)} -function Vf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,Uf(a,b,!0),k.Ha?a.C("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.m++),k.ua=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.oc)&&g++));return g}h.oc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.W=b,a.na=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.l&&Ec(this.l)):a.ua=!1;a.Ga&&(a.Ga=!1,--this.m||F(this));Of(this,a.Ia)}; -function Sf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.v=65536-e&65535;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; -h.pc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=4096;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=32;break}ub(this.h,f,p|u<<8);if(Vb(this.h)){k=1024;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)}; -h.qc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){var p=wb(this.h,f);if(Vb(this.h)){k=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=4096;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=32;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)};h.ud=function(){return this.B};h.se=function(){};h.vd=function(){return this.i};h.te=function(){};h.rd=function(){return this.b&61438}; -h.pe=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.c[a],e,f,g,k;this.b&=-129;switch(this.b&14){case 0:this.B=d.status;this.i=0;this.b=128;this.f=0;break;case 4:b=this.pc;case 2:b||(b=this.qc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):(k=(this.b&48)<<12|this.s,c=65536-this.v&65535,c=b.call(this,d,e,f,g,c,k,this.nc.bind(this)))}this.B=d.status|a<<13|this.f%9&15;c&&(this.b&= --2,this.b|=128,this.b&64&&Xb(this.a,this.Oa))}};h.wd=function(){return this.v};h.ue=function(a){this.v=a};h.qd=function(){return this.s};h.oe=function(a){this.s=a};h.sd=function(){return this.f};h.qe=function(a){this.f=a};h.td=function(){return this.G};h.re=function(a){this.G=a}; -var Wf={},Rf=(Wf[65280]=[null,null,N.prototype.ud,N.prototype.se,"RKDS"],Wf[65282]=[null,null,N.prototype.vd,N.prototype.te,"RKER"],Wf[65284]=[null,null,N.prototype.rd,N.prototype.pe,"RKCS"],Wf[65286]=[null,null,N.prototype.wd,N.prototype.ue,"RKWC"],Wf[65288]=[null,null,N.prototype.qd,N.prototype.oe,"RKBA"],Wf[65290]=[null,null,N.prototype.sd,N.prototype.qe,"RKDA"],Wf[65294]=[null,null,N.prototype.td,N.prototype.re,"RKDB"],Wf); -function M(a){x.call(this,"RL11",a,M,131072);this.A=a.autoMount||{};this.v=0;this.c=Array(4);this.B=!Ba("Mobi")&&window&&"FileReader"in window}A(M);h=M.prototype; -h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Xf(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Yf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Mf(a),a.Lb.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)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;Yf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if((a=yc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);Zf(this);this.Oa=Zb(112,5,131072);eb(b,this,$f);gb(b,this.reset.bind(this));ag(this,"None","",!0);this.B&&ag(this,"Local Disk","?");ag(this,"Remote Disk","??");bg(this)||F(this)}; -h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Ib){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Xf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Zf(this)};h.save=function(){return(new O(this)).data()}; -h.restore=function(a){return Zf(this,a[0])};function bg(a,b){b||(a.v=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('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=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}dg(a,e,b,c,!1,d)}else cg(a,e)} -function dg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,cg(a,b,!0),k.Ha?a.C("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.v++),k.ua=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.sc)&&g++));return g}h.sc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.W=b,a.na=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.l&&Ec(this.l)):a.ua=!1;a.Ga&&(a.Ga=!1,--this.v||F(this));Xf(this,a.Ia)}; -function ag(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.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; -h.tc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}ub(this.h,Vc(this.a,f),p|u<<8);if(Vb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.uc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=wb(this.h,Vc(this.a,f));if(Vb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.zd=function(){return this.b&65535}; -h.xe=function(a){this.b=this.b&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.W,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.tc;case 10:b||(b=this.uc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= -d.N?this.b|=37888:(d=(this.m&63)<<16|this.w,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.rc.bind(this)))}a&&(this.b|=129,this.b&64&&Xb(this.a,this.Oa))}};h.xd=function(){return this.w};h.ve=function(a){this.w=a&65534};h.Ad=function(){return this.f};h.ye=function(a){this.f=a};h.Bd=function(){return this.s};h.ze=function(a){this.s=a};h.yd=function(){return this.m};h.we=function(a){this.m=a&63;this.b=this.b&-49|(this.m&3)<<4}; -var eg={},$f=(eg[63744]=[null,null,M.prototype.zd,M.prototype.xe,"RLCS"],eg[63746]=[null,null,M.prototype.xd,M.prototype.ve,"RLBA"],eg[63748]=[null,null,M.prototype.Ad,M.prototype.ye,"RLDA"],eg[63750]=[null,null,M.prototype.Bd,M.prototype.ze,"RLMP"],eg[63752]=[null,null,M.prototype.yd,M.prototype.we,"RLBE"],eg); -function fg(a,b,c){x.call(this,"Computer",a,fg,33554432);this.o.P=!1;gg(this,b);this.A=yc(this,"autoPower",a);this.l=0;this.L=a.busWidth||a.buswidth;this.b=hg;this.s=null;this.i=this.I=!1;this.S=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=ig(this);if(this.a=Va("CPU",this.id)){this.F=Va("Debugger",this.id);this.h=new Ab({id:this.xa+".bus",busWidth:this.L},this.a,this.F);var d,e=B(this.id);if((this.w=Va("Panel",this.id))&&this.w.eb)for(b=0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bhg){if(jg(d,this.s)){this.f=new O(this,"1.30.5","failsafe");jg(this.f)&&(og(this,d),a=2,pg(this.f));this.f.set("timestamp",ra());qg(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== -f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(ya("user",""),this.c=null)):this.V(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.s;delete this.v}e=B(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(tg(this,this.a,b,c,a),this.va(),this.a.cb());this.G&&(og(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; -function og(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.S;d.user=c;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}} -function ug(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.5"),g=new O(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ga&&(c&&G(a.a),d=a.a.ga(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.Ab+=c))&&(d.textContent=b.o.R?b.Aa.toFixed(2)+"Mhz":"Stopped",b.Ab=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.o.R;d=!!(b.a.u&8);if(0>=a||60<=(b.s+=a)){for(var e=0;ea&&(a-=32),Zb(e.a,e.ea,1E3/Math.round(e.J/10)));0<=a&&(e.A=a,e.b&128?e.A|=49152:e.b|=128,e.b&64&&L(c,e.R))});this.H=$b(this.a,this.w?-1:52,4,262144);this.la=Yb(this.a,function(){e.c|=128;e.c&64&&L(c,e.H)});gb(b,this,nf,this.w?64832+8*(this.w-1)-65392:0);ib(b,this.reset.bind(this));E(this)}; +h.ac=function(){if(!this.v){var a=zc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.xa)return;b=pa(b[1]);if(this.v=Va(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);this.B=d.receiveData;this.F=d.receiveStatus;if(this.B){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.ac(),!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(){of(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return of(this)};function of(a){a.A=0;a.b=8192;a.c=128;a.s=[];return!0}h.ub=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.T||8,c=a-this.m%a,this.T&&(b=" ".slice(0,c)));this.L&&!this.m&&c&&(b=String.fromCharCode(this.L)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=this.i){if(10==a|| +1024<=this.i.length)this.V(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Zb(this.a,this.la,1E3/Math.round(this.pa/10));this.c&=-129};var pf={},nf=(pf[65392]=[null,null,Z.prototype.sd,Z.prototype.qe,"RCSR"],pf[65394]=[null,null,Z.prototype.rd,Z.prototype.pe,"RBUF"],pf[65396]=[null,null,Z.prototype.Td,Z.prototype.Re,"XCSR"],pf[65398]=[null,null,Z.prototype.Sd,Z.prototype.Qe,"XBUF"],pf); +Ja(function(){for(var a=D(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&&sf(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;sf(d,r(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.h=b;this.a=c;this.G=d;this.L=tf(a);var e=this;if((this.c=zc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){v("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.H=$b(this.a,56,4,4096);this.T=Yb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):ua()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!t(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ua(a.ya,e,f),(e=ta(e,f))&&Cf(a,b,c,d,e.M,e.na,e.ma)); +a.o.Fa=!1;a.m&&(a.m--,a.m||E(a));zf(a)})}function wf(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.K);for(d=0;dc.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=ua()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.sb?"":e)+"&format=json"));return!!t(f, +null,!0,function(b,c,d){Jf(a,b,c,d)})} +function Jf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.P;if(d)a.controller.C('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{Ua(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)v(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=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 A=l.bytes;if(void 0!==A&&A.length){for(var F=n<<2,za=A.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.qa+a.fa&&(a.fa+=f-(a.qa+a.fa)+1):(a.qa=f,a.fa=1);d[f]=d[f]&~(255<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")}; +function Of(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)}}function O(a){w.call(this,"RK11",a,O,65536);this.w=a.autoMount||{};this.m=0;this.c=Array(8);this.A=!Ca("Mobi")&&window&&"FileReader"in window}y(O);h=O.prototype; +h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Pf(d,a)},!0;case "loadDrive":return this.j[b]= +c,c.onclick=function(){var a=d.j.listDisks;a&&Qf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Da(Nf(a),a.Mb.replace(".json",".img")),v(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)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;Qf(d,r(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ga=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;if((a=zc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Rf(this);this.Oa=$b(this.a,144,5,65536);gb(b,this,Sf);ib(b,this.reset.bind(this));Tf(this,"None","",!0);this.A&&Tf(this,"Local Disk","?");Tf(this,"Remote Disk","??");Uf(this)||E(this)}; +h.ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Pf(this,0)}}return!0};h.ha=function(a){return a?this.save():!0};h.reset=function(){Rf(this)};h.save=function(){return(new P(this)).data()}; +h.restore=function(a){return Rf(this,a[0])};function Uf(a,b){b||(a.m=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('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=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wf(a,e,b,c,!1,d)}else Vf(a,e)} +function Wf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,Vf(a,b,!0),k.Ha?a.C("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.m++),k.va=!!f,If(new Ef(a,k,"preload"),c,d,f,a.rc)&&g++));return g}h.rc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.W=b,a.oa=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.l&&Fc(this.l)):a.va=!1;a.Ga&&(a.Ga=!1,--this.m||E(this));Pf(this,a.Ia)}; +function Tf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.v=65536-e&65535;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; +h.sc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=4096;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=32;break}wb(this.h,f,p|u<<8);if(Xb(this.h)){k=1024;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)}; +h.tc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){var p=yb(this.h,f);if(Xb(this.h)){k=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=4096;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=32;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)};h.xd=function(){return this.B};h.ve=function(){};h.yd=function(){return this.i};h.we=function(){};h.ud=function(){return this.b&61438}; +h.se=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.c[a],e,f,g,k;this.b&=-129;switch(this.b&14){case 0:this.B=d.status;this.i=0;this.b=128;this.f=0;break;case 4:b=this.sc;case 2:b||(b=this.tc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):(k=(this.b&48)<<12|this.s,c=65536-this.v&65535,c=b.call(this,d,e,f,g,c,k,this.qc.bind(this)))}this.B=d.status|a<<13|this.f%9&15;c&&(this.b&= +-2,this.b|=128,this.b&64&&L(this.a,this.Oa))}};h.zd=function(){return this.v};h.xe=function(a){this.v=a};h.td=function(){return this.s};h.re=function(a){this.s=a};h.vd=function(){return this.f};h.te=function(a){this.f=a};h.wd=function(){return this.F};h.ue=function(a){this.F=a}; +var Xf={},Sf=(Xf[65280]=[null,null,O.prototype.xd,O.prototype.ve,"RKDS"],Xf[65282]=[null,null,O.prototype.yd,O.prototype.we,"RKER"],Xf[65284]=[null,null,O.prototype.ud,O.prototype.se,"RKCS"],Xf[65286]=[null,null,O.prototype.zd,O.prototype.xe,"RKWC"],Xf[65288]=[null,null,O.prototype.td,O.prototype.re,"RKBA"],Xf[65290]=[null,null,O.prototype.vd,O.prototype.te,"RKDA"],Xf[65294]=[null,null,O.prototype.wd,O.prototype.ue,"RKDB"],Xf); +function N(a){w.call(this,"RL11",a,N,131072);this.A=a.autoMount||{};this.v=0;this.c=Array(4);this.B=!Ca("Mobi")&&window&&"FileReader"in window}y(N);h=N.prototype; +h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Yf(d,a)},!0;case "loadDrive":return this.j[b]= +c,c.onclick=function(){var a=d.j.listDisks;a&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Da(Nf(a),a.Mb.replace(".json",".img")),v(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,r(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ga=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;if((a=zc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){v(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);$f(this);this.Oa=$b(this.a,112,5,131072);gb(b,this,ag);ib(b,this.reset.bind(this));bg(this,"None","",!0);this.B&&bg(this,"Local Disk","?");bg(this,"Remote Disk","??");cg(this)||E(this)}; +h.ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ha=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new P(this)).data()}; +h.restore=function(a){return $f(this,a[0])};function cg(a,b){b||(a.v=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('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=r(c);a.status("Attempting to load "+c+' as "'+b+'"')}eg(a,e,b,c,!1,d)}else dg(a,e)} +function eg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,dg(a,b,!0),k.Ha?a.C("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.v++),k.va=!!f,If(new Ef(a,k,"preload"),c,d,f,a.vc)&&g++));return g}h.vc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.W=b,a.oa=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.l&&Fc(this.l)):a.va=!1;a.Ga&&(a.Ga=!1,--this.v||E(this));Yf(this,a.Ia)}; +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.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; +h.wc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}wb(this.h,Wc(this.a,f),p|u<<8);if(Xb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.xc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=yb(this.h,Wc(this.a,f));if(Xb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Cd=function(){return this.b&65535}; +h.Ae=function(a){this.b=this.b&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.W,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.wc;case 10:b||(b=this.xc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= +d.N?this.b|=37888:(d=(this.m&63)<<16|this.w,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.uc.bind(this)))}a&&(this.b|=129,this.b&64&&L(this.a,this.Oa))}};h.Ad=function(){return this.w};h.ye=function(a){this.w=a&65534};h.Dd=function(){return this.f};h.Be=function(a){this.f=a};h.Ed=function(){return this.s};h.Ce=function(a){this.s=a};h.Bd=function(){return this.m};h.ze=function(a){this.m=a&63;this.b=this.b&-49|(this.m&3)<<4}; +var fg={},ag=(fg[63744]=[null,null,N.prototype.Cd,N.prototype.Ae,"RLCS"],fg[63746]=[null,null,N.prototype.Ad,N.prototype.ye,"RLBA"],fg[63748]=[null,null,N.prototype.Dd,N.prototype.Be,"RLDA"],fg[63750]=[null,null,N.prototype.Ed,N.prototype.Ce,"RLMP"],fg[63752]=[null,null,N.prototype.Bd,N.prototype.ze,"RLBE"],fg); +function gg(a,b,c){w.call(this,"Computer",a,gg,33554432);this.o.P=!1;hg(this,b);this.A=zc(this,"autoPower",a);this.l=0;this.L=a.busWidth||a.buswidth;this.b=ig;this.s=null;this.i=this.H=!1;this.R=zc(this,"url")||"";(Math.random()+.1).toString(36);this.c=jg(this);if(this.a=Wa("CPU",this.id)){this.G=Wa("Debugger",this.id);this.h=new Cb({id:this.ya+".bus",busWidth:this.L},this.a,this.G);var d,e=z(this.id);if((this.w=Wa("Panel",this.id))&&this.w.eb)for(b=0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;big){if(kg(d,this.s)){this.f=new P(this,"1.30.5","failsafe");kg(this.f)&&(pg(this,d),a=2,qg(this.f));this.f.set("timestamp",sa());rg(this.f);var e=this.b&&!this.i;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=og(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?kg(d,g):("error"== +f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.c=null)):this.V(f+": "+g),qg(d),kg(d)?(c=og(d),e=!0):c=!1))}e&&ng(this,c?d:null)}else 2==a&&d.clear()}else ng(this);delete this.s;delete this.v}e=z(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(ug(this,this.a,b,c,a),this.wa(),this.a.cb());this.F&&(pg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; +function pg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;t("http://www.pcjs.org/api/v1/report",d,!0)}} +function vg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new P(a,"1.30.5"),g=new P(a,"1.30.5","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ha&&(c&&G(a.a),d=a.a.ha(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=z(a.id),l=0;l=c||30<=(b.Ab+=c))&&(d.textContent=b.o.S?b.Aa.toFixed(2)+"Mhz":"Stopped",b.Ab=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.o.S;d=!!(b.a.u&8);if(0>=a||60<=(b.s+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\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/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],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[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);Bg(a,b,c)}})}else c(a,null)} -function Cg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--yg||Ka(!0));l=!1}var g,k,l=!0;yg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| -(c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?zg(c,null,null,!1,e,function(d,l){l?(Ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--yg||Ka(!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),--yg||Ka(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?zg(b,a,d,!0,e,n):Ag(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Cg(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map +h.aa=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.l||(d.o.P?vg(d,!1,!0):mg(d,d.fb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.o.P&&!d.l)if(d.b&&!d.m){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");vg(d,a,!0);!a&&d.B?window&&window.location.reload():(a||(d.Jb=!0),d.fb(ig),d.Jb=!1)}else d.reset(),d.a&&d.a.cb()},!0;case "save":if(ma(ua(),"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.b&&!d.m||d.B),c=vg(d,b);b?wg(d,a,c):d.C("Resume disabled, machine state not saved")}},!0}return!1}; +function jg(a,b){var c=a.c;c||((c=ya("user"),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=xg(a,c))||a.C("The user ID is invalid.")):b&&a.C("Browser local storage is not available"));return c} +function xg(a,b){a.c=null;b=t(ua()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ba("user",b.data),a.c=b.data)}catch(d){v(d.message+" ("+c+")")}return a.c}function lg(a){var b=null;a.c&&(b=ua()+"/api/v1/user?req=load&user="+a.c+"&state="+yg(a,"1.30.5"));return b} +function wg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=yg(a,"1.30.5");d.data=c;b=t(ua()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\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/g.exec(a)){var e=d[2];b("Loading "+e+"...");t(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],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[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);Cg(a,b,c)}})}else c(a,null)} +function Dg(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--zg||La(!0));l=!1}var g,k,l=!0;zg++;Ta[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| +(c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?Ag(c,null,null,!1,e,function(d,l){l?(Ua(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--zg||La(!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),--zg||La(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ag(b,a,d,!0,e,n):Bg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(A){f(A.message)}return l}window.embedPDP11=function(a,b,c,d){La(!1);return Dg(a,b,c,d)};window.enableEvents=La;window.sendEvent=Ma;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map