From e51607037535cb34392a55a9a7cd503b2652c109 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Mon, 15 Aug 2016 10:49:04 -0700 Subject: [PATCH] Added Video callout to make resolutions adjustments (eg, from 80-column mode to 132-column mode); work in Video component ready to begin --- .../pc8080/machine/vt100/debugger/README.md | 50 ++- .../pc8080/machine/vt100/debugger/machine.xml | 4 +- modules/pc8080/lib/chipset.js | 206 +++++++--- modules/pc8080/lib/cpu.js | 4 +- modules/pc8080/lib/keyboard.js | 59 +-- modules/pc8080/lib/panel.js | 2 +- modules/pc8080/lib/serialport.js | 2 +- modules/pc8080/lib/video.js | 30 +- modules/pcx86/lib/keyboard.js | 6 +- versions/pc8080/1.23.3/pc8080-dbg.js | 368 +++++++++--------- versions/pc8080/1.23.3/pc8080.js | 246 ++++++------ 11 files changed, 577 insertions(+), 400 deletions(-) diff --git a/devices/pc8080/machine/vt100/debugger/README.md b/devices/pc8080/machine/vt100/debugger/README.md index f2dea50a6..6bb308ab6 100644 --- a/devices/pc8080/machine/vt100/debugger/README.md +++ b/devices/pc8080/machine/vt100/debugger/README.md @@ -27,8 +27,22 @@ maps modern keys to VT100 key addresses, and most of the mappings are 1-1. Func - F8: NO SCROLL - F9: SET-UP -The simulation is not fully operational yet, but it is now possible to access the SET-UP screen, press 4 to switch to LOCAL -mode, and verify that most VT100 keys work properly. +The simulation is not fully operational yet, but it is now possible to access the SET-UP screen, press **4** to switch to +LOCAL mode, and verify local operation of most VT100 keys. You can also test the following keys while in SET-UP Mode. + +### SET-UP Mode Keys + +- 0: RESET +- 2: SET/CLEAR TAB +- 3: CLEAR ALL TABS +- 4: ONLINE/LOCAL +- 5: SET-UP A/B +- 6: TOGGLE FEATURE +- 7: TRANSMIT SPEED +- 8: RECEIVE SPEED +- 9: 80/132 COLUMNS +- SHIFT-S: Save SET-UP Features +- SHIFT-R: Restore SET-UP Features {% include machine.html id="vt100" %} @@ -227,6 +241,38 @@ Some additional observations: set in the keyboard STATUS port (0x82), generating a "bell" (beep). The NVR checksum test used to fail when we initialized all NVR words with the freshly-erased value of 0x3fff; now we initialize them with canned values (see ChipSet.VT100.INIT). +SET-UP Mode +----------- + +From "PART 2: SET-UP MODE", p. 2-6, of the VT100 Technical Manual (July 1982): + +> Unlike most terminals, the VT100 does not use switches or jumpers to individually turn the built-in terminal features on +or off. Instead, the VT100 uses a nonvolatile memory (NVR) that always remembers what features have been selected, as if a +swiitch had been set. + +> Selection and storage of built-in terminal features is performed in a special mode of operation called SET-UP mode. +When you enter SET-UP mode, the status of features stored in temporary memory shows on the screen. You can then change the +features and store any new feature selections either temporarily, by leaving SET-UP mode; or on a fixed basis, by performing +a Save operation. In either case, terminal operation reflects the new feature selection. If a recall operation is performed, +or the terminal is reset, or terminal power is turned off, all temporary feature settings are replaced by features that have +been stored on a fixed basis. + +> ### SET-UP Features + +> SET-UP mode provides two brief summaries of the current feature status. The first presentation - SET-UP A - displays +the location of tab stops set and a visual ruler that numbers each character position on the line. The second presentation - +SET-UP B - summarizes the status of the other terminal features. + +> **SET-UP A** - To enter SET-UP A, press the **SET-UP** key. The display has a presentation similar to Figure 2-3. The bottom +line of the display consists of a "ruler" that numbers each character position available on a line. Each tab stop is shown by +a "T" above the ruler. If the tab stop(s) set are those desired, you may exit **SET-UP** mode by pressing the SET-UP key again +or you may now change the tabs to meet your requirements. + +> **SET-UP B** - SET-UP B mode may only be entered from SET-UP A mode. To enter SET-UP B, from SET-UP A press the **5** key on +the main keyboard. The display looks like Figure 2-4. Figure 2-5 summarizes the SET-UP B presentation. This summary allows you +to quickly determine what features are enabled. For additional information on a feature refer to in Part 3, SET-UP Feature +Definitions. + Additional VT100 Resources -------------------------- diff --git a/devices/pc8080/machine/vt100/debugger/machine.xml b/devices/pc8080/machine/vt100/debugger/machine.xml index 876e6ccc4..274cc208b 100644 --- a/devices/pc8080/machine/vt100/debugger/machine.xml +++ b/devices/pc8080/machine/vt100/debugger/machine.xml @@ -24,7 +24,9 @@ - + + SET-UP + diff --git a/modules/pc8080/lib/chipset.js b/modules/pc8080/lib/chipset.js index c70b044d7..67cdff3ab 100644 --- a/modules/pc8080/lib/chipset.js +++ b/modules/pc8080/lib/chipset.js @@ -235,24 +235,52 @@ ChipSet.VT100 = { PORT: 0x42, // write-only INIT: 0x00 // for lack of a better guess }, - NVR: { - LATCH: { - PORT: 0x62 // write-only - }, - CMD: { - ACCEPT_DATA: 0x0, - ACCEPT_ADDR: 0x1, - SHIFT_OUT: 0x2, - WRITE: 0x4, - ERASE: 0x5, - READ: 0x6, - STANDBY: 0x7 - }, - WORDMASK: 0x3fff // NVR words are 14-bit - /* - * The Technical Manual, p. 4-18, also notes that "Early VT100s can disable the receiver interrupt by - * programming D4 in the NVR latch. However, this is never used by the VT100." - */ + /* + * DC011 is referred to as a Timing Chip. + * + * As p. 4-55 (105) of the VT100 Technical Manual (July 1982) explains: + * + * The DCO11 is a custom designed bipolar circuit that provides most of the timing signals required by the + * video processor. Internal counters divide the output of a 24.0734 MHz oscillator (located elsewhere on the + * terminal controller module) into the lower frequencies that define dot, character, scan, and frame timing. + * The counters are programmable through various input pins to control the number of characters per line, + * the frequency at which the screen is refreshed, and whether the display is interlaced or noninterlaced. + * These parameters can be controlled through SET-UP mode or by the host. + * + * Table 4-6-1: Video Mode Selection (Write Address 0xC2) + * + * D5 D4 Configuration + * -- -- ------------- + * 0 0 80-column mode, interlaced + * 0 1 132-column mode, interlaced + * 1 0 60Hz, non-interlaced + * 1 1 50Hz, non-interlaced + * + * On p. 4-56, the DC011 Block Diagram shows 8 outputs labeled LBA0 through LBA7. From p. 4-61: + * + * Several of the LBAs are used as general purpose clocks in the VT100. LBA 3 and LBA 4 are used to generate + * timing for the keyboard. These signals satisfy the keyboard's requirement of two square-waves, one twice the + * frequency of the other, even though every 16th transition is delayed (the second stage of the horizontal + * counter divides by 17, not 16). LBA 7 is used by the nonvolatile RAM. + * + * And on p. 4-62, timings are provided for the LBA0 through LBA7 when the VT100 is in 80-column mode; in particular: + * + * LBA6: 16.82353us (when LBA6 is low, for a period of 33.64706us) + * LBA7: 31.77778us (when LBA7 is high, for a period of 63.55556us) + * + * If we assume that the CPU cycle count increments once every 361.69ns, it will increment roughly 88 times every + * time LBA7 toggles. So we can divide the CPU cycle count by 88 and set LBA to the low bit of that truncated + * result. An even faster (but less accurate) solution would be to mask bit 6 of the CPU cycle count, which will + * doesn't change until the count has been incremented 64 times. See getVT100LBA() for the chosen implementation. + */ + DC011: { // generates Line Buffer Addresses (LBAs) for the Video Processor + PORT: 0xC2, // write-only + COLS80: 0x00, + COLS132: 0x10, + RATE60: 0x20, + RATE50: 0x30, + INITCOLS: 0x00, // ie, COLS80 + INITRATE: 0x20 // ie, RATE60 }, /* * DC012 is referred to as a Control Chip. @@ -302,40 +330,33 @@ ChipSet.VT100 = { */ DC012: { // generates scan counts for the Video Processor PORT: 0xA2, // write-only - INIT: 0x00 // for lack of a better guess + SCROLL_LO: 0x00, + INITSCROLL: 0x00, + INITBLINK: 0x00, + INITREVERSE:0x00, + INITATTR: 0x00 }, /* - * DC011 is referred to as a Timing Chip. - * - * As p. 4-55 (105) of the VT100 Technical Manual (July 1982) explains: - * - * The DCO11 is a custom designed bipolar circuit that provides most of the timing signals required by the - * video processor. Internal counters divide the output of a 24.0734 MHz oscillator (located elsewhere on the - * terminal controller module) into the lower frequencies that define dot, character, scan, and frame timing. - * The counters are programmable through various input pins to control the number of characters per line, - * the frequency at which the screen is refreshed, and whether the display is interlaced or noninterlaced. - * These parameters can be controlled through SET-UP mode or by the host. - * - * On p. 4-56, the DC011 Block Diagram shows 8 outputs labeled LBA0 through LBA7. From p. 4-61: - * - * Several of the LBAs are used as general purpose clocks in the VT100. LBA 3 and LBA 4 are used to generate - * timing for the keyboard. These signals satisfy the keyboard's requirement of two square-waves, one twice the - * frequency of the other, even though every 16th transition is delayed (the second stage of the horizontal - * counter divides by 17, not 16). LBA 7 is used by the nonvolatile RAM. - * - * And on p. 4-62, timings are provided for the LBA0 through LBA7 when the VT100 is in 80-column mode; in particular: - * - * LBA6: 16.82353us (when LBA6 is low, for a period of 33.64706us) - * LBA7: 31.77778us (when LBA7 is high, for a period of 63.55556us) - * - * If we assume that the CPU cycle count increments once every 361.69ns, it will increment roughly 88 times every - * time LBA7 toggles. So we can divide the CPU cycle count by 88 and set LBA to the low bit of that truncated - * result. An even faster (but less accurate) solution would be to mask bit 6 of the CPU cycle count, which will - * doesn't change until the count has been incremented 64 times. See getVT100LBA() for the chosen implementation. + * ER1400 Non-Volatile RAM (NVR) Chip Definitions */ - DC011: { // generates Line Buffer Addresses (LBAs) for the Video Processor - PORT: 0xC2, // write-only - INIT: 0x00 // for lack of a better guess + NVR: { + LATCH: { + PORT: 0x62 // write-only + }, + CMD: { + ACCEPT_DATA: 0x0, + ACCEPT_ADDR: 0x1, + SHIFT_OUT: 0x2, + WRITE: 0x4, + ERASE: 0x5, + READ: 0x6, + STANDBY: 0x7 + }, + WORDMASK: 0x3fff // NVR words are 14-bit + /* + * The Technical Manual, p. 4-18, also notes that "Early VT100s can disable the receiver interrupt by + * programming D4 in the NVR latch. However, this is never used by the VT100." + */ } }; @@ -402,7 +423,8 @@ ChipSet.prototype.initBus = function(cmp, bus, cpu, dbg) this.cpu = cpu; this.dbg = dbg; this.cmp = cmp; - this.kbd = cmp.getMachineComponent("Keyboard"); + this.kbd = /** @type {Keyboard} */ (cmp.getMachineComponent("Keyboard")); + this.video = /** @type {Video} */ (cmp.getMachineComponent("Video")); bus.addPortInputTable(this, this.config.portsInput); bus.addPortOutputTable(this, this.config.portsOutput); }; @@ -452,9 +474,17 @@ ChipSet.SI1978.INIT = [ ChipSet.VT100.INIT = [ [ ChipSet.VT100.BRIGHTNESS.INIT, - ChipSet.VT100.FLAGS_BUFFER.NO_AVO | ChipSet.VT100.FLAGS_BUFFER.NO_GFX, - ChipSet.VT100.DC012.INIT, - ChipSet.VT100.DC011.INIT + ChipSet.VT100.FLAGS_BUFFER.NO_AVO | ChipSet.VT100.FLAGS_BUFFER.NO_GFX + ], + [ + ChipSet.VT100.DC011.INITCOLS, + ChipSet.VT100.DC011.INITRATE + ], + [ + ChipSet.VT100.DC012.INITSCROLL, + ChipSet.VT100.DC012.INITBLINK, + ChipSet.VT100.DC012.INITREVERSE, + ChipSet.VT100.DC012.INITATTR ], [ 0, 0, 0, 0, @@ -501,8 +531,10 @@ ChipSet.prototype.save = function() state.set(0, [this.bStatus0, this.bStatus1, this.bStatus2, this.wShiftData, this.bShiftCount, this.bSound1, this.bSound2]); break; case ChipSet.VT100.MODEL: - state.set(0, [this.bBrightness, this.bFlagsBuffer, this.bDC012, this.bDC011]); - state.set(1, [this.dNVRAddr, this.wNVRData, this.bNVRLatch, this.bNVROut, this.aNVRWords]); + state.set(0, [this.bBrightness, this.bFlagsBuffer]); + state.set(1, [this.bDC011Cols, this.bDC011Rate]); + state.set(2, [this.bDC012Scroll, this.bDC012Blink, this.bDC012Reverse, this.bDC012Attr]); + state.set(3, [this.dNVRAddr, this.wNVRData, this.bNVRLatch, this.bNVROut, this.aNVRWords]); break; } return state.data(); @@ -534,9 +566,15 @@ ChipSet.prototype.restore = function(data) case ChipSet.VT100.MODEL: this.bBrightness = a[0]; this.bFlagsBuffer = a[1]; - this.bDC012 = a[2]; - this.bDC011 = a[3]; a = data[1]; + this.bDC011Cols = a[0]; + this.bDC011Rate = a[1]; + a = data[2]; + this.bDC012Scroll = a[0]; + this.bDC012Blink = a[1]; + this.bDC012Reverse = a[2]; + this.bDC012Attr = a[3]; + a = data[3]; this.dNVRAddr = a[0]; // 20-bit address this.wNVRData = a[1]; // 14-bit word this.bNVRLatch = a[2]; // 1 byte @@ -909,9 +947,8 @@ ChipSet.prototype.outVT100NVRLatch = function(port, b, addrFrom) /** * outVT100DC012(port, b, addrFrom) * - * TODO: Consider whether we should disable any interrupts (eg, vertical retrace) until the - * this port is initialized at runtime. We initialize it ourselves at start-up, but our initial - * value is just a guess. + * TODO: Consider whether we should disable any interrupts (eg, vertical retrace) until + * this port is initialized at runtime. * * @this {ChipSet} * @param {number} port (0xA2) @@ -921,7 +958,34 @@ ChipSet.prototype.outVT100NVRLatch = function(port, b, addrFrom) ChipSet.prototype.outVT100DC012 = function(port, b, addrFrom) { this.printMessageIO(port, b, addrFrom, "DC012"); - this.bDC012 = b; + + var bOpt = b & 0x3; + var bCmd = (b >> 2) & 0x3; + switch(bCmd) { + case 0x0: + this.bDC012Scroll = (this.bDC012Scroll & ~0x3) | bOpt; + break; + case 0x1: + this.bDC012Scroll = (this.bDC012Scroll & ~0xC) | (bOpt << 2); + break; + case 0x2: + switch(bOpt) { + case 0x0: + this.bDC012Blink = ~this.bDC012Blink; + break; + case 0x1: + // TODO: Clear vertical frequency interrupt + break; + case 0x2: + case 0x3: + this.bDC012Reverse = 0x3 - bOpt; + break; + } + break; + case 0x3: + this.bDC012Attr = bOpt; + break; + } }; /** @@ -935,7 +999,25 @@ ChipSet.prototype.outVT100DC012 = function(port, b, addrFrom) ChipSet.prototype.outVT100DC011 = function(port, b, addrFrom) { this.printMessageIO(port, b, addrFrom, "DC011"); - this.bDC011 = b; + if (b & ChipSet.VT100.DC011.RATE60) { + b &= ChipSet.VT100.DC011.RATE50; + if (this.bDC011Rate != b) { + this.bDC011Rate = b; + if (this.video) { + this.video.updateRate(this.bDC011Rate == ChipSet.VT100.DC011.RATE50? 50 : 60); + } + } + } else { + b &= ChipSet.VT100.DC011.COLS132; + if (this.bDC011Cols != b) { + this.bDC011Cols = b; + if (this.video) { + var nCols = (this.bDC011Cols == ChipSet.VT100.DC011.COLS132? 132 : 80); + var nRows = (nCols > 80 && (this.bFlagsBuffer & ChipSet.VT100.FLAGS_BUFFER.NO_AVO)? 14 : 24); + this.video.updateDimensions(nCols, nRows); + } + } + } }; /* diff --git a/modules/pc8080/lib/cpu.js b/modules/pc8080/lib/cpu.js index 9da44e78d..080676351 100644 --- a/modules/pc8080/lib/cpu.js +++ b/modules/pc8080/lib/cpu.js @@ -176,13 +176,13 @@ CPU.prototype.initBus = function(cmp, bus, cpu, dbg) /* * We need to know the refresh rate (and corresponding interrupt rate, if any) of the Video component. */ - var video = cmp.getMachineComponent("Video"); + var video = /** @type {Video} */ (cmp.getMachineComponent("Video")); this.refreshRate = video && video.getRefreshRate() || CPU.VIDEO_UPDATES_PER_SECOND; /* * Attach the ChipSet component to the CPU so that it can be notified whenever the CPU stops and starts. */ - this.chipset = cmp.getMachineComponent("ChipSet"); + this.chipset = /** @type {ChipSet} */ (cmp.getMachineComponent("ChipSet")); /* * We've already saved the parmsCPU 'autoStart' setting, but there may be a machine (or URL) override. diff --git a/modules/pc8080/lib/keyboard.js b/modules/pc8080/lib/keyboard.js index bc06ceea4..3daed04d3 100644 --- a/modules/pc8080/lib/keyboard.js +++ b/modules/pc8080/lib/keyboard.js @@ -72,9 +72,9 @@ Component.subclass(Keyboard); /** * Alphanumeric and other common (printable) ASCII codes. * - * TODO: Determine what we can do to get ALL constants like these inlined (enum doesn't seem to - * get the job done); the problem seems to be limited to property references that use quotes, which - * is why I've 'unquoted' as many of them as possible. + * TODO: Determine what we can do to get ALL constants like these inlined by the Closure Compiler + * (enum doesn't seem to get the job done); the problem seems to be limited to property references + * that use quotes, which is why I've 'unquoted' as many of them as possible. * * @enum {number} */ @@ -101,8 +101,8 @@ Keyboard.ASCII = { * * keyCodes for most common ASCII keys can simply use the appropriate ASCII code above. * - * Most of these represent non-ASCII keys (eg, the LEFT arrow key), yet for some reason, browsers defined - * them using ASCII codes (eg, the LEFT arrow key uses the ASCII code for '%' or 37). + * Most of these represent non-ASCII characters (eg, the LEFT arrow key), yet for some reason, browsers + * defined them using ASCII codes (eg, the LEFT arrow key uses 37, which is the ASCII code for '%'). * * @enum {number} */ @@ -282,13 +282,15 @@ Keyboard.VT100 = { KEYMAP: {}, ALTCODES: {}, LEDCODES: {}, - SOFTCODES: {}, + SOFTCODES: { + 'setup': Keyboard.KEYCODE.F9 + }, /* * Reading port 0x82 returns a key address from the VT100 keyboard's UART data output. * * Every time a keyboard scan is initiated (by setting the START bit of the status byte), - * an internal address index is reset to zero, and an interrupt is generated for each entry - * in the aKeysActive array, along with a final interrupt for KEYLAST. + * our internal address index (iKeyNext) is set to zero, and an interrupt is generated for + * each entry in the aKeysActive array, along with a final interrupt for KEYLAST. */ ADDRESS: { PORT: 0x82, @@ -320,9 +322,12 @@ Keyboard.VT100 = { CLICK: 0x80, INIT: 0x00 }, - KEYLAST: 0x7F + KEYLAST: 0x7F // special end-of-scan key address (all valid key addresses are < KEYLAST) }; +/* + * Table to map host key codes to VT100 key addresses (ie, unique 7-bit values representing key positions on the VT100) + */ Keyboard.VT100.KEYMAP[Keyboard.KEYCODE.DEL] = 0x03; Keyboard.VT100.KEYMAP[Keyboard.ASCII.P] = 0x05; Keyboard.VT100.KEYMAP[Keyboard.ASCII.O] = 0x06; @@ -486,16 +491,25 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) default: if (this.config.SOFTCODES && this.config.SOFTCODES[sBinding] !== undefined) { this.bindings[id] = control; - var fnDown = function(kbd, sSoftCode) { - return function onMouseOrTouchDownKeyboard(event) { - kbd.onSoftKeyDown(sSoftCode, true); + var fnDown = function(kbd, softCode) { + return function onKeyboardBindingDown(event) { + kbd.onSoftKeyDown(softCode, true); + /* + * I'm assuming we only need to give focus back on the "up" event... + * + * if (kbd.cmp) kbd.cmp.updateFocus(); + */ }; - }(this, sBinding); - var fnUp = function (kbd, sSoftCode) { - return function onMouseOrTouchUpKeyboard(event) { - kbd.onSoftKeyDown(sSoftCode, false); + }(this, this.config.SOFTCODES[sBinding]); + var fnUp = function (kbd, softCode) { + return function onKeyboardBindingUp(event) { + kbd.onSoftKeyDown(softCode, false); + /* + * Give focus back to the machine (since clicking the button takes focus away). + */ + if (kbd.cmp) kbd.cmp.updateFocus(); }; - }(this, sBinding); + }(this, this.config.SOFTCODES[sBinding]); if ('ontouchstart' in window) { control.ontouchstart = fnDown; control.ontouchend = fnUp; @@ -522,9 +536,10 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) */ Keyboard.prototype.initBus = function(cmp, bus, cpu, dbg) { + this.cmp = cmp; this.cpu = cpu; this.dbg = dbg; // NOTE: The "dbg" property must be set for the message functions to work - this.chipset = cmp.getMachineComponent("ChipSet"); + this.chipset = /** @type {ChipSet} */ (cmp.getMachineComponent("ChipSet")); bus.addPortInputTable(this, this.config.portsInput); bus.addPortOutputTable(this, this.config.portsOutput); }; @@ -873,8 +888,8 @@ Keyboard.prototype.checkBusy = function() * * We take our cue from iKeyNext. If it's -1 (default), we simply return the last value latched * in bVT100Address. Otherwise, if iKeyNext is a valid index into aKeysActive, we look up the key - * in the VT100.KEYMAP, latch it, and increment iKeyNext, else we latch Keyboard.VT100.KEYLAST - * and set iKeyNext to -1 again. + * in the VT100.KEYMAP, latch it, and increment iKeyNext. Failing that, we latch Keyboard.VT100.KEYLAST + * and reset iKeyNext to -1. * * @this {Keyboard} * @param {number} port (0x82) @@ -893,8 +908,8 @@ Keyboard.prototype.inVT100UARTAddress = function(port, addrFrom) /* * In MAXDEBUG builds, this code removes the key as soon as it's been reported, because * when debugging, it's easy for the window to lose focus and never receive the keyUp event, - * thereby leaving us with a stuck key. However, this causes more problems than it solves, - * and seems to illustrate that key presses need to be persist for more than a single poll. + * thereby leaving us with a stuck key. However, this may cause more problems than it solves, + * because the VT100's ROM seems to require that key presses persist for more than a single poll. */ this.aKeysActive.splice(this.iKeyNext, 1); } diff --git a/modules/pc8080/lib/panel.js b/modules/pc8080/lib/panel.js index 892aa2a73..de1c1b6b6 100644 --- a/modules/pc8080/lib/panel.js +++ b/modules/pc8080/lib/panel.js @@ -95,7 +95,7 @@ Panel.prototype.initBus = function(cmp, bus, cpu, dbg) this.bus = bus; this.cpu = cpu; this.dbg = dbg; - this.kbd = cmp.getMachineComponent("Keyboard"); + this.kbd = /** @type {Keyboard} */ (cmp.getMachineComponent("Keyboard")); }; /** diff --git a/modules/pc8080/lib/serialport.js b/modules/pc8080/lib/serialport.js index 226735532..8ab191cb7 100644 --- a/modules/pc8080/lib/serialport.js +++ b/modules/pc8080/lib/serialport.js @@ -241,7 +241,7 @@ SerialPort.prototype.initBus = function(cmp, bus, cpu, dbg) this.bus = bus; this.cpu = cpu; this.dbg = dbg; - this.chipset = cmp.getMachineComponent("ChipSet"); + this.chipset = /** @type {ChipSet} */ (cmp.getMachineComponent("ChipSet")); bus.addPortInputTable(this, SerialPort.aPortInput, this.portBase); bus.addPortOutputTable(this, SerialPort.aPortOutput, this.portBase); this.setReady(); diff --git a/modules/pc8080/lib/video.js b/modules/pc8080/lib/video.js index db554b905..b9e219c3a 100644 --- a/modules/pc8080/lib/video.js +++ b/modules/pc8080/lib/video.js @@ -410,7 +410,7 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg) * If we have an associated keyboard, then ensure that the keyboard will be notified * whenever the canvas gets focus and receives input. */ - this.kbd = cmp.getMachineComponent("Keyboard"); + this.kbd = /** @type {Keyboard} */ (cmp.getMachineComponent("Keyboard")); if (this.kbd) { for (var s in this.ledBindings) { this.kbd.setBinding("led", s, this.ledBindings[s]); @@ -712,6 +712,34 @@ Video.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) return false; }; +/** + * updateDimensions(nCols, nRows) + * + * Called from the ChipSet component whenever the screen dimensions have been dynamically altered. + * + * @this {Video} + * @param {number} nCols (should be either 80 or 132; 80 is the default) + * @param {number} nRows (should be either 24 or 14; 24 is the default) + */ +Video.prototype.updateDimensions = function(nCols, nRows) +{ + this.println("updateDimensions(" + nCols + "," + nRows + ")"); +}; + +/** + * updateRate(nRate) + * + * Called from the ChipSet component whenever the monitor refresh rate has been dynamically altered. + * + * @this {Video} + * @param {number} nRate (should be either 50 or 60; 60 is the default) + */ +Video.prototype.updateRate = function(nRate) +{ + this.println("updateRate(" + nRate + ")"); + this.rateMonitor = nRate; +}; + /** * doFullScreen() * diff --git a/modules/pcx86/lib/keyboard.js b/modules/pcx86/lib/keyboard.js index 3e6315041..c28b1a5c6 100644 --- a/modules/pcx86/lib/keyboard.js +++ b/modules/pcx86/lib/keyboard.js @@ -1220,7 +1220,7 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) if (Keyboard.CLICKCODES[sCode] !== undefined && sHTMLType == "button") { this.bindings[id] = control; control.onclick = function(kbd, sKey, simCode) { - return function onClickKeyboard(event) { + return function onKeyboardBindingClick(event) { if (!COMPILED && kbd.messageEnabled()) kbd.printMessage(sKey + " clicked", Messages.KEYS); if (kbd.cmp) kbd.cmp.updateFocus(); kbd.updateShiftState(simCode, true); // future-proofing if/when any LOCK keys are added to CLICKCODES @@ -1233,12 +1233,12 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) this.cSoftCodes++; this.bindings[id] = control; var fnDown = function(kbd, sKey, simCode) { - return function onMouseOrTouchDownKeyboard(event) { + return function onKeyboardBindingDown(event) { kbd.addActiveKey(simCode); }; }(this, sBinding, Keyboard.SOFTCODES[sBinding]); var fnUp = function (kbd, sKey, simCode) { - return function onMouseOrTouchUpKeyboard(event) { + return function onKeyboardBindingUp(event) { kbd.removeActiveKey(simCode); }; }(this, sBinding, Keyboard.SOFTCODES[sBinding]); diff --git a/versions/pc8080/1.23.3/pc8080-dbg.js b/versions/pc8080/1.23.3/pc8080-dbg.js index 2fd69da0b..346627f6d 100644 --- a/versions/pc8080/1.23.3/pc8080-dbg.js +++ b/versions/pc8080/1.23.3/pc8080-dbg.js @@ -7,132 +7,134 @@ function oa(a,b,c,d){var e=0,f=null,h=null;if("object"==typeof resources&&(f=res typeof b){var k="",l;for(l in b)b.hasOwnProperty(l)&&(k&&(k+="&"),k+=l+"="+encodeURIComponent(b[l]));k=k.replace(/%20/g,"+");g.open("POST",a,!!c);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(k)}else g.open("GET",a,!!c),"bytes"==b&&g.overrideMimeType("text/plain; charset=x-user-defined"),g.send();c||(f=g.responseText,200!=g.status&&(e=g.status||-1),d&&d(a,f,e),h=[f,e]);return h}function pa(){return"http://"+(window?window.location.host:"www.pcjs.org")} function qa(){return window?window.navigator.userAgent:""}function u(a){window&&window.alert(a)}function ra(a){var b=!1;window&&(b=window.confirm(a));return b}var sa=null;function ta(){if(null==sa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}sa=a}return sa} function ua(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function va(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function wa(a){if(window){var b=qa();return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function xa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0=this.J?10:20>=this.J?12:24>=this.J?14:15;this.Ea=1<>2;this.A=this.Ea-1;this.M=this.O/this.Ea|0;this.K=this.M-1;this.u=[];this.w=[];this.I=this.G=!1;this.Z=[];this.ba=[];a=new E;tb(a,this.H);this.W=Array(this.M);for(b=0;b>>a.na;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.F)return g.Fb+=g.F-e,g.F=e,!0;if(e>=g.F+g.Fb){l=g.size-(e-k);l>f&&(l=f);g.Fb=e-g.F+l;e=k+a.Ea;f-=l;h++;continue}}return vb(1,e,f)}e=new E(e,l,a.Ea,d);tb(e,a.H,g);a.W[h++]=e;e=k+a.Ea;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+wb[d]+" at "+t(b)),!0):vb(2,b,c)}m.Y=function(a){return this.W[(a&this.C)>>>this.na].qb(a&this.A,a)}; -function xb(a,b){return a.W[(b&a.C)>>>a.na].Db(b&a.A,b)}m.Qa=function(a){var b=a&this.A,c=(a&this.C)>>>this.na;return b!=this.A?this.W[c].Bc(b,a):this.W[c++].qb(b,a)|this.W[c&this.K].qb(0,a+1)<<8};function yb(a,b){var c=b&a.A,d=(b&a.C)>>>a.na;return c!=a.A?a.W[d].ac(c,b):a.W[d++].Db(c,b)|a.W[d&a.K].Db(0,b+1)<<8}m.ra=function(a,b){this.W[(a&this.C)>>>this.na].sb(a&this.A,b&255,a)};function zb(a,b,c){a.W[(b&a.C)>>>a.na].Gb(b&a.A,c&255,b)} -m.Rb=function(a,b){var c=a&this.A,d=(a&this.C)>>>this.na;c!=this.A?this.W[d].Dc(c,b&65535,a):(this.W[d++].sb(c,b&255,a),this.W[d&this.K].sb(0,b>>8&255,a+1))};function Ab(a,b){if(void 0===b)return a.I=!a.I,a.I;void 0===a.u[b]&&(a.u[b]=[null,!1]);a.u[b][1]=!a.u[b][1];return a.u[b][1]}function Bb(a,b,c,d){void 0===d&&(d=0);if(c)for(var e in c){var f=a,h=+e+d,g=c[e].bind(b);if(void 0!==g)for(var k=+e+d;k<=h;k++)void 0!==f.u[k]?u("Input port "+t(k)+" already registered"):f.u[k]=[g,!1]}} -function Cb(a,b,c){for(var d=1,e=0,f=0;0>>=f)&k;if(void 0!==h){if(h[0])h[0](b,k,d);a.H&&a.G!=h[1]&&Hb(a.H,b,k)}else a.H&&(eb(a.H,a,b,k,d),a.G&&Hb(a.H,b,k));f+=g<<3;b+=g;e-=g}} +0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function pb(a){x.call(this,"Panel",a,pb)}Za(pb);m=pb.prototype;m.la=function(a,b,c,d){return this.A&&this.A.la(a,b,c,d)||this.b&&this.b.la(a,b,c,d)||this.M&&this.M.la(a,b,c,d)||this.H&&this.H.la(a,b,c,d)?!0:this.parent.la.call(this,a,b,c,d)};m.Na=function(a,b,c,d){this.A=a;this.w=b;this.b=c;this.H=d;this.M=qb(a,"Keyboard")};m.Ea=function(a,b){b||rb();return!0};m.Ha=function(){return!0};m.Ia=function(){}; +function rb(){for(var a=!1,b=B(document,"pc8080","panel"),c=0;c=this.J?10:20>=this.J?12:24>=this.J?14:15;this.Ga=1<>2;this.w=this.Ga-1;this.M=this.O/this.Ga|0;this.K=this.M-1;this.A=[];this.u=[];this.I=this.G=!1;this.Y=[];this.aa=[];a=new E;tb(a,this.H);this.W=Array(this.M);for(b=0;b>>a.na;0f&&(l=f);if(g&&g.size){if(g.type==d){if(e+f<=g.F)return g.Ib+=g.F-e,g.F=e,!0;if(e>=g.F+g.Ib){l=g.size-(e-k);l>f&&(l=f);g.Ib=e-g.F+l;e=k+a.Ga;f-=l;h++;continue}}return vb(1,e,f)}e=new E(e,l,a.Ga,d);tb(e,a.H,g);a.W[h++]=e;e=k+a.Ga;f-=l}return 0>=f?(a.status(Math.floor(c/1024)+"Kb "+wb[d]+" at "+t(b)),!0):vb(2,b,c)}m.Z=function(a){return this.W[(a&this.C)>>>this.na].sb(a&this.w,a)}; +function xb(a,b){return a.W[(b&a.C)>>>a.na].Hb(b&a.w,b)}m.Qa=function(a){var b=a&this.w,c=(a&this.C)>>>this.na;return b!=this.w?this.W[c].Gc(b,a):this.W[c++].sb(b,a)|this.W[c&this.K].sb(0,a+1)<<8};function yb(a,b){var c=b&a.w,d=(b&a.C)>>>a.na;return c!=a.w?a.W[d].bc(c,b):a.W[d++].Hb(c,b)|a.W[d&a.K].Hb(0,b+1)<<8}m.ra=function(a,b){this.W[(a&this.C)>>>this.na].vb(a&this.w,b&255,a)};function zb(a,b,c){a.W[(b&a.C)>>>a.na].Jb(b&a.w,c&255,b)} +m.Tb=function(a,b){var c=a&this.w,d=(a&this.C)>>>this.na;c!=this.w?this.W[d].Ic(c,b&65535,a):(this.W[d++].vb(c,b&255,a),this.W[d&this.K].vb(0,b>>8&255,a+1))};function Ab(a,b){if(void 0===b)return a.I=!a.I,a.I;void 0===a.A[b]&&(a.A[b]=[null,!1]);a.A[b][1]=!a.A[b][1];return a.A[b][1]}function Bb(a,b,c,d){void 0===d&&(d=0);if(c)for(var e in c){var f=a,h=+e+d,g=c[e].bind(b);if(void 0!==g)for(var k=+e+d;k<=h;k++)void 0!==f.A[k]?u("Input port "+t(k)+" already registered"):f.A[k]=[g,!1]}} +function Cb(a,b,c){for(var d=1,e=0,f=0;0>>=f)&k;if(void 0!==h){if(h[0])h[0](b,k,d);a.H&&a.G!=h[1]&&Hb(a.H,b,k)}else a.H&&(eb(a.H,a,b,k,d),a.G&&Hb(a.H,b,k));f+=g<<3;b+=g;e-=g}} function vb(a,b,c){u("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Ib;if(nb){var Jb=new ArrayBuffer(2);(new DataView(Jb)).setUint16(0,256,!0);Ib=256===(new Uint16Array(Jb))[0]}else Ib=!1;var Sb=Ib; -function E(a,b,c,d){this.id=Tb+=2;this.b=null;this.F=a;this.Fb=b;this.size=c||0;this.type=d||Ub;this.L=d==Vb;tb(this);this.La=this.mc=!1;if(c)if(nb)this.I=new ArrayBuffer(c),this.G=new DataView(this.I,0,c),this.A=new Uint8Array(this.I,0,c),this.K=new Uint16Array(this.I,0,c>>1),this.b=new Int32Array(this.I,0,c>>2),Wb(this,Sb?Xb:Yb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a){var 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},Ba:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.La=!0},Z:function(a,b){if(this.H&&null!=this.F){var c=this.H;cc(c,this.F+a,1,c.Z)&&c.la(!0)}return this.Db(a,b)},fa:function(a,b){if(this.H&&null!=this.F){var c=this.H;cc(c,this.F+a,2,c.Z)&&c.la(!0)}return this.ac(a,b)},va:function(a,b,c){if(this.H&&null!=this.F){var d=this.H;cc(d,this.F+a,1,d.G)&&d.la(!0)}this.L?this.C(a,b,c):this.Gb(a,b,c)},Ja:function(a, -b,c){if(this.H&&null!=this.F){var d=this.H;cc(d,this.F+a,2,d.G)&&d.la(!0)}this.L?this.C(a,b,c):this.cc(a,b,c)},P:function(a){return this.A[a]},ba:function(a){return this.A[a]},ea:function(a){return this.G.getUint16(a,!0)},ha:function(a){return a&1?this.A[a]|this.A[a+1]<<8:this.K[a>>1]},oa:function(a,b){this.A[a]=b;this.La=!0},wa:function(a,b){this.A[a]=b;this.La=!0},Ca:function(a,b){this.G.setUint16(a,b,!0);this.La=!0},Ka:function(a,b){a&1?(this.A[a]=b,this.A[a+1]=b>>8):this.K[a>>1]=b;this.La=!0}}; -function tb(a,b,c){a.H=b;a.u=a.w=0;c&&((a.u=c.u)&&bc(a,ac,!1),(a.w=c.w)&&$b(a,ac,!1))}function dc(a,b){b?0===--a.w&&(a.sb=a.L?a.C:a.Gb,a.Dc=a.L?a.J:a.cc):0===--a.u&&(a.qb=a.Db,a.Bc=a.ac)}function $b(a,b,c){c&&a.w||(a.sb=!a.L&&b[2]||a.C,a.Dc=!a.L&&b[3]||a.J);if(c||void 0===c)a.Gb=b[2]||a.C,a.cc=b[3]||a.J}function bc(a,b,c){c&&a.u||(a.qb=b[0]||a.M,a.Bc=b[1]||a.O);if(c||void 0===c)a.Db=b[0]||a.M,a.ac=b[1]||a.O}function Wb(a,b){b||(b=ec);bc(a,b,void 0);$b(a,b,void 0)} -var ec=[],Zb=[E.prototype.da,E.prototype.ma,E.prototype.Ba,E.prototype.ab],ac=[E.prototype.Z,E.prototype.fa,E.prototype.va,E.prototype.Ja];if(nb)var Yb=[E.prototype.P,E.prototype.ea,E.prototype.oa,E.prototype.Ca],Xb=[E.prototype.ba,E.prototype.ha,E.prototype.wa,E.prototype.Ka]; -function fc(a,b){x.call(this,"CPU",a,fc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.pb=c;this.i.Ob=0;this.i.Za=d;this.i.Xb=Math.round(this.i.pb/1E4)/100;this.i.Xa=this.i.Xb*this.i.Za;this.D.xa=!1;this.D.Vb=!1;this.D.lc=a.autoStart;this.D.nc=!1;this.D.hb=!1;this.i.xb=this.i.mb=0;this.i.yb=a.csStart;this.i.lb=a.csInterval;this.i.nb=a.csStop;this.ba=this.$a.bind(this);D(this)}Za(fc);var gc=["power","reset"];m=fc.prototype; -m.Na=function(a,b,c,d){this.u=a;this.A=b;this.H=d;for(b=0;b=a.i.mb&&(a.i.mb+=a.i.lb,c=!0);0<=a.i.nb&&a.i.nb<=Ac(a)&&(a.i.lb=a.i.nb=-1,jc(a),a.la(),c=!0);c&&a.g(Ac(a)+" cycles: checksum="+n(a.i.xb))}} -m.ka=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.L[b]=c;a=!0;break;case "run":this.L[b]=c;c.onclick=function(){var a;if(a=d.u)if(a=d.u,a.D.sa)a=!0;else{var b=null,c,g=bb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Wa/a.i.Xa?b=1:d=!0;a.i.Za=b;b=a.i.Xb*a.i.Za;if(a.i.Xa!=b){a.i.Xa=b;b=a.i.Xa.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.u&&a.u.Eb()}Cc(a,a.G);a.G=0;a.i.kb=la();a.i.Ya=0;Dc(a);return d} -m.$a=function(a){if(hb(this,!0)){if(!this.D.xa){Bc(this);this.u&&this.u.start(this.i.kb,Ac(this));this.D.xa=!0;this.D.Vb=!0;this.I&&this.I.start();var b=this.L.run;b&&(b.textContent="Halt");this.u&&(this.u.Ga(!0),a&&this.u.Eb(!0))}this.i.$b>=this.i.pb&&Dc(this,!0);this.i.Bb=0;this.i.Nb=la();this.i.Ya&&(a=this.i.Nb-this.i.Ya,a>this.i.uc&&(this.i.kb+=a,this.i.kb>this.i.Nb&&(this.i.kb=this.i.Nb)));try{do{this.rb(this.D.hb?1:this.i.sd);var c=this.C-this.b;this.G+=c;this.i.Bb+=c;Cc(this,0,!0);nc(this, -c);this.i.Ab-=c;0>=this.i.Ab&&(this.i.Ab+=this.i.wc,this.u&&Ec(this.u,this.i.Ob++),this.i.Ob>this.M&&(this.i.Ob=0));this.i.zb-=c;0>=this.i.zb&&(this.i.zb+=this.i.vc,this.u&&this.u.Ga());this.i.ob-=c;if(0>=this.i.ob){this.i.ob+=this.i.Zb;break}}while(this.D.xa)}catch(e){this.la();lc(this);this.u&&this.u.stop(la(),Ac(this));hb(this,!1);kb(this,e.stack||e.message);return}c=setTimeout;a=this.ba;this.i.Ya=la();b=this.i.uc;this.i.Bb&&(b=Math.round(b*this.i.Bb/this.i.Zb));var b=b-(this.i.Ya-this.i.Nb),d= -this.i.Ya-this.i.kb;d&&(this.i.Wa=Math.round(this.G/(10*d))/100,864E5<=d&&(this.J=0,Bc(this)));if(0>b||this.i.Wa>8&255;a.S=b&255}function Oc(a){return a.T<<8|a.U}function Pc(a,b){a.T=b>>8&255;a.U=b&255}function K(a){return a.V<<8|a.X} -function Qc(a,b){a.V=b>>8&255;a.X=b&255}function F(a,b){a.N=b&65535}function Rc(a){return a.aa&256?1:0}function Sc(a,b){a.aa=a.aa&255|b}function Tc(a){return ob[a.ca&255]?4:0}function Uc(a){return(a.ca^a.ua)&16?16:0}function Vc(a){return a.aa&255?0:64}function Wc(a){return a.ca&128?128:0}function Lc(a){return a.ta&-214|Wc(a)|Vc(a)|Uc(a)|Tc(a)|Rc(a)}function Jc(a,b){a.aa=a.ca=a.ua=0;b&1&&(a.aa|=256);b&4||(a.ca|=1);b&16&&(a.ua|=16);b&64||(a.aa|=255);b&128&&(a.ca^=192);a.ta=a.ta&-726|b&512|2} -function Xc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b)&255}function Yc(a,b){a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?1:0))&255}function Zc(a,b){a.aa=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.aa}function $c(a,b){a.ua=b^255;b=a.ca=b+255&255;a.aa=a.aa&-256|b;return b}function ad(a,b){a.ua=b;b=a.ca=b+1&255;a.aa=a.aa&-256|b;return b}function bd(a,b){return a.ca=a.aa=a.ua=a.j|b}function L(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+1^256)&255} -function cd(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.aa=a.j+b+(a.aa&256?0:1)^256)&255}function dd(a,b){return a.ca=a.aa=a.ua=a.j^b}m.Y=function(a){return this.A.Y(a)};m.ra=function(a,b){this.A.ra(a,b)};function M(a){var b=a.Y(a.N);F(a,a.N+1);return b}function N(a){var b=a.A.Qa(a.N);F(a,a.N+2);return b}function P(a){var b=a.A.Qa(a.ja);a.ja=a.ja+2&65535;return b}function Q(a,b){a.ja=a.ja-2&65535;a.A.Rb(a.ja,b)}function ed(a,b){a.w=a.w&-8|b|8} -function S(a,b,c,d){d=d||2;a.L[b]&&(void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.la()),c=!a.D.xa||a.D.nc?n(c,d):"--------".substr(0,d),a.L[b].textContent!=c&&(a.L[b].textContent=c))} -m.Ga=function(a){this.Z&&(a||!this.D.xa||this.D.nc)&&(S(this,"A",this.j),S(this,"B",this.R),S(this,"C",this.S),S(this,"BC",Mc(this),4),S(this,"D",this.T),S(this,"E",this.U),S(this,"DE",Oc(this),4),S(this,"H",this.V),S(this,"L",this.X),S(this,"HL",K(this),4),S(this,"SP",this.ja,4),S(this,"PC",this.N,4),a=Lc(this),S(this,"PS",a,4),S(this,"IF",a&512?1:0,1),S(this,"SF",a&128?1:0,1),S(this,"ZF",a&64?1:0,1),S(this,"AF",a&16?1:0,1),S(this,"PF",a&4?1:0,1),S(this,"CF",a&1?1:0,1));if(a=this.L.speed)a.textContent= -this.D.xa&&this.i.Wa?this.i.Wa.toFixed(2)+"Mhz":"Stopped"};m.rb=function(a){this.D.Jb=!0;var b=this.D.hd=this.H&&yd(this.H),c=a?this.D.Vb?0:1:-1;this.D.Vb=!1;this.C=this.b=a;do{if(this.w){if(a&&this.w&8&&this.ta&512){var d=199|(this.w&7)<<3;this.w&=-17;this.w&=-16;this.ta&=-513;this.O[d].call(this)}if(this.w&16){this.b=0;break}}if(b){if(zd(this.H,this.N,c)){this.la();break}c=1}this.O[M(this)].call(this)}while(0>8;Sc(this,a&256);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+Mc(this));Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Mc(this));this.b-=7},function(){Nc(this,Mc(this)-1);this.b-= +function E(a,b,c,d){this.id=Tb+=2;this.b=null;this.F=a;this.Ib=b;this.size=c||0;this.type=d||Ub;this.L=d==Vb;tb(this);this.La=this.qc=!1;if(c)if(nb)this.I=new ArrayBuffer(c),this.G=new DataView(this.I,0,c),this.w=new Uint8Array(this.I,0,c),this.K=new Uint16Array(this.I,0,c>>1),this.b=new Int32Array(this.I,0,c>>2),Wb(this,Sb?Xb:Yb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ia:function(a){var 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},ya:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.La=!0},Y:function(a,b){if(this.H&&null!=this.F){var c=this.H;cc(c,this.F+a,1,c.Y)&&c.ma(!0)}return this.Hb(a,b)},fa:function(a,b){if(this.H&&null!=this.F){var c=this.H;cc(c,this.F+a,2,c.Y)&&c.ma(!0)}return this.bc(a,b)},va:function(a,b,c){if(this.H&&null!=this.F){var d=this.H;cc(d,this.F+a,1,d.G)&&d.ma(!0)}this.L?this.C(a,b,c):this.Jb(a,b,c)},Ca:function(a, +b,c){if(this.H&&null!=this.F){var d=this.H;cc(d,this.F+a,2,d.G)&&d.ma(!0)}this.L?this.C(a,b,c):this.dc(a,b,c)},P:function(a){return this.w[a]},aa:function(a){return this.w[a]},ea:function(a){return this.G.getUint16(a,!0)},ga:function(a){return a&1?this.w[a]|this.w[a+1]<<8:this.K[a>>1]},oa:function(a,b){this.w[a]=b;this.La=!0},wa:function(a,b){this.w[a]=b;this.La=!0},za:function(a,b){this.G.setUint16(a,b,!0);this.La=!0},Da:function(a,b){a&1?(this.w[a]=b,this.w[a+1]=b>>8):this.K[a>>1]=b;this.La=!0}}; +function tb(a,b,c){a.H=b;a.A=a.u=0;c&&((a.A=c.A)&&bc(a,ac,!1),(a.u=c.u)&&$b(a,ac,!1))}function dc(a,b){b?0===--a.u&&(a.vb=a.L?a.C:a.Jb,a.Ic=a.L?a.J:a.dc):0===--a.A&&(a.sb=a.Hb,a.Gc=a.bc)}function $b(a,b,c){c&&a.u||(a.vb=!a.L&&b[2]||a.C,a.Ic=!a.L&&b[3]||a.J);if(c||void 0===c)a.Jb=b[2]||a.C,a.dc=b[3]||a.J}function bc(a,b,c){c&&a.A||(a.sb=b[0]||a.M,a.Gc=b[1]||a.O);if(c||void 0===c)a.Hb=b[0]||a.M,a.bc=b[1]||a.O}function Wb(a,b){b||(b=ec);bc(a,b,void 0);$b(a,b,void 0)} +var ec=[],Zb=[E.prototype.da,E.prototype.ia,E.prototype.ya,E.prototype.cb],ac=[E.prototype.Y,E.prototype.fa,E.prototype.va,E.prototype.Ca];if(nb)var Yb=[E.prototype.P,E.prototype.ea,E.prototype.oa,E.prototype.za],Xb=[E.prototype.aa,E.prototype.ga,E.prototype.wa,E.prototype.Da]; +function fc(a,b){x.call(this,"CPU",a,fc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.rb=c;this.i.Qb=0;this.i.ab=d;this.i.Yb=Math.round(this.i.rb/1E4)/100;this.i.Za=this.i.Yb*this.i.ab;this.D.xa=!1;this.D.Xb=!1;this.D.pc=a.autoStart;this.D.rc=!1;this.D.jb=!1;this.i.Bb=this.i.ob=0;this.i.Cb=a.csStart;this.i.nb=a.csInterval;this.i.pb=a.csStop;this.aa=this.bb.bind(this);D(this)}Za(fc);var gc=["power","reset"];m=fc.prototype; +m.Na=function(a,b,c,d){this.A=a;this.w=b;this.H=d;for(b=0;b=a.i.ob&&(a.i.ob+=a.i.nb,c=!0);0<=a.i.pb&&a.i.pb<=Ac(a)&&(a.i.nb=a.i.pb=-1,jc(a),a.ma(),c=!0);c&&a.g(Ac(a)+" cycles: checksum="+n(a.i.Bb))}} +m.la=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.L[b]=c;a=!0;break;case "run":this.L[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.D.sa)a=!0;else{var b=null,c,g=bb(a.id);for(c=0;cc&&(c=2);var d=1;b&&1a.i.Ya/a.i.Za?b=1:d=!0;a.i.ab=b;b=a.i.Yb*a.i.ab;if(a.i.Za!=b){a.i.Za=b;b=a.i.Za.toFixed(2)+"Mhz";var e=a.L.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.A&&a.A.ub()}Cc(a,a.G);a.G=0;a.i.mb=la();a.i.$a=0;Dc(a);return d} +m.bb=function(a){if(hb(this,!0)){if(!this.D.xa){Bc(this);this.A&&this.A.start(this.i.mb,Ac(this));this.D.xa=!0;this.D.Xb=!0;this.I&&this.I.start();var b=this.L.run;b&&(b.textContent="Halt");this.A&&(this.A.Ia(!0),a&&this.A.ub(!0))}this.i.ac>=this.i.rb&&Dc(this,!0);this.i.Fb=0;this.i.Pb=la();this.i.$a&&(a=this.i.Pb-this.i.$a,a>this.i.zc&&(this.i.mb+=a,this.i.mb>this.i.Pb&&(this.i.mb=this.i.Pb)));try{do{this.tb(this.D.jb?1:this.i.Bd);var c=this.C-this.b;this.G+=c;this.i.Fb+=c;Cc(this,0,!0);nc(this, +c);this.i.Eb-=c;0>=this.i.Eb&&(this.i.Eb+=this.i.Bc,this.A&&Ec(this.A,this.i.Qb++),this.i.Qb>this.M&&(this.i.Qb=0));this.i.Db-=c;0>=this.i.Db&&(this.i.Db+=this.i.Ac,this.A&&this.A.Ia());this.i.qb-=c;if(0>=this.i.qb){this.i.qb+=this.i.$b;break}}while(this.D.xa)}catch(e){this.ma();lc(this);this.A&&this.A.stop(la(),Ac(this));hb(this,!1);kb(this,e.stack||e.message);return}c=setTimeout;a=this.aa;this.i.$a=la();b=this.i.zc;this.i.Fb&&(b=Math.round(b*this.i.Fb/this.i.$b));var b=b-(this.i.$a-this.i.Pb),d= +this.i.$a-this.i.mb;d&&(this.i.Ya=Math.round(this.G/(10*d))/100,864E5<=d&&(this.J=0,Bc(this)));if(0>b||this.i.Ya>8&255;a.S=b&255}function Oc(a){return a.T<<8|a.U}function Pc(a,b){a.T=b>>8&255;a.U=b&255}function K(a){return a.V<<8|a.X} +function Qc(a,b){a.V=b>>8&255;a.X=b&255}function F(a,b){a.N=b&65535}function Rc(a){return a.ba&256?1:0}function Sc(a,b){a.ba=a.ba&255|b}function Tc(a){return ob[a.ca&255]?4:0}function Uc(a){return(a.ca^a.ua)&16?16:0}function Vc(a){return a.ba&255?0:64}function Wc(a){return a.ca&128?128:0}function Lc(a){return a.ta&-214|Wc(a)|Vc(a)|Uc(a)|Tc(a)|Rc(a)}function Jc(a,b){a.ba=a.ca=a.ua=0;b&1&&(a.ba|=256);b&4||(a.ca|=1);b&16&&(a.ua|=16);b&64||(a.ba|=255);b&128&&(a.ca^=192);a.ta=a.ta&-726|b&512|2} +function Xc(a,b){a.ua=a.j^b;return a.ca=(a.ba=a.j+b)&255}function Yc(a,b){a.ua=a.j^b;return a.ca=(a.ba=a.j+b+(a.ba&256?1:0))&255}function Zc(a,b){a.ba=a.ca=a.ua=a.j&b;(a.j|b)&8&&(a.ua^=16);return a.ba}function $c(a,b){a.ua=b^255;b=a.ca=b+255&255;a.ba=a.ba&-256|b;return b}function ad(a,b){a.ua=b;b=a.ca=b+1&255;a.ba=a.ba&-256|b;return b}function bd(a,b){return a.ca=a.ba=a.ua=a.j|b}function L(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.ba=a.j+b+1^256)&255} +function cd(a,b){b^=255;a.ua=a.j^b;return a.ca=(a.ba=a.j+b+(a.ba&256?0:1)^256)&255}function dd(a,b){return a.ca=a.ba=a.ua=a.j^b}m.Z=function(a){return this.w.Z(a)};m.ra=function(a,b){this.w.ra(a,b)};function M(a){var b=a.Z(a.N);F(a,a.N+1);return b}function N(a){var b=a.w.Qa(a.N);F(a,a.N+2);return b}function P(a){var b=a.w.Qa(a.ka);a.ka=a.ka+2&65535;return b}function Q(a,b){a.ka=a.ka-2&65535;a.w.Tb(a.ka,b)}function ed(a,b){a.u=a.u&-8|b|8} +function S(a,b,c,d){d=d||2;a.L[b]&&(void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.ma()),c=!a.D.xa||a.D.rc?n(c,d):"--------".substr(0,d),a.L[b].textContent!=c&&(a.L[b].textContent=c))} +m.Ia=function(a){this.Y&&(a||!this.D.xa||this.D.rc)&&(S(this,"A",this.j),S(this,"B",this.R),S(this,"C",this.S),S(this,"BC",Mc(this),4),S(this,"D",this.T),S(this,"E",this.U),S(this,"DE",Oc(this),4),S(this,"H",this.V),S(this,"L",this.X),S(this,"HL",K(this),4),S(this,"SP",this.ka,4),S(this,"PC",this.N,4),a=Lc(this),S(this,"PS",a,4),S(this,"IF",a&512?1:0,1),S(this,"SF",a&128?1:0,1),S(this,"ZF",a&64?1:0,1),S(this,"AF",a&16?1:0,1),S(this,"PF",a&4?1:0,1),S(this,"CF",a&1?1:0,1));if(a=this.L.speed)a.textContent= +this.D.xa&&this.i.Ya?this.i.Ya.toFixed(2)+"Mhz":"Stopped"};m.tb=function(a){this.D.Nb=!0;var b=this.D.rd=this.H&&yd(this.H),c=a?this.D.Xb?0:1:-1;this.D.Xb=!1;this.C=this.b=a;do{if(this.u){if(a&&this.u&8&&this.ta&512){var d=199|(this.u&7)<<3;this.u&=-17;this.u&=-16;this.ta&=-513;this.O[d].call(this)}if(this.u&16){this.b=0;break}}if(b){if(zd(this.H,this.N,c)){this.ma();break}c=1}this.O[M(this)].call(this)}while(0>8;Sc(this,a&256);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+Mc(this));Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Z(Mc(this));this.b-=7},function(){Nc(this,Mc(this)-1);this.b-= 5},function(){this.S=ad(this,this.S);this.b-=5},function(){this.S=$c(this,this.S);this.b-=5},function(){this.S=M(this);this.b-=7},function(){var a=this.j<<8&256;this.j=(a|this.j)>>1;Sc(this,a);this.b-=4},Ad,function(){Pc(this,N(this));this.b-=10},function(){this.ra(Oc(this),this.j);this.b-=7},function(){Pc(this,Oc(this)+1);this.b-=5},function(){this.T=ad(this,this.T);this.b-=5},function(){this.T=$c(this,this.T);this.b-=5},function(){this.T=M(this);this.b-=7},function(){var a=this.j<<1;this.j=a&255| -Rc(this);Sc(this,a&256);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+Oc(this));Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(Oc(this));this.b-=7},function(){Pc(this,Oc(this)-1);this.b-=5},function(){this.U=ad(this,this.U);this.b-=5},function(){this.U=$c(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.j<<8;this.j=(Rc(this)<<8|this.j)>>1;Sc(this,a&256);this.b-=4},Ad,function(){Qc(this,N(this));this.b-=10},function(){var a=N(this);this.A.Rb(a,K(this)); -this.b-=16},function(){Qc(this,K(this)+1);this.b-=5},function(){this.V=ad(this,this.V);this.b-=5},function(){this.V=$c(this,this.V);this.b-=5},function(){this.V=M(this);this.b-=7},function(){var a=0,b=Rc(this);if(Uc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Xc(this,a);Sc(this,b?256:0);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+K(this));Sc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.A.Qa(a);Qc(this,a);this.b-=16},function(){Qc(this,K(this)-1);this.b-=5},function(){this.X= -ad(this,this.X);this.b-=5},function(){this.X=$c(this,this.X);this.b-=5},function(){this.X=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},Ad,function(){this.ja=N(this)&65535;this.b-=10},function(){this.ra(N(this),this.j);this.b-=13},function(){this.ja=this.ja+1&65535;this.b-=5},function(){var a=K(this);this.ra(a,ad(this,this.Y(a)));this.b-=10},function(){var a=K(this);this.ra(a,$c(this,this.Y(a)));this.b-=10},function(){this.ra(K(this),M(this));this.b-=10},function(){this.aa|=256;this.b-= -4},Ad,function(){var a;Qc(this,a=K(this)+this.ja);Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Y(N(this));this.b-=13},function(){this.ja=this.ja-1&65535;this.b-=5},function(){this.j=ad(this,this.j);this.b-=5},function(){this.j=$c(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){Sc(this,Rc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.U;this.b-=5},function(){this.R=this.V;this.b-= -5},function(){this.R=this.X;this.b-=5},function(){this.R=this.Y(K(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.X;this.b-=5},function(){this.S=this.Y(K(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T= -this.U;this.b-=5},function(){this.T=this.V;this.b-=5},function(){this.T=this.X;this.b-=5},function(){this.T=this.Y(K(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){this.U=this.R;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-=5},function(){this.U=this.V;this.b-=5},function(){this.U=this.X;this.b-=5},function(){this.U=this.Y(K(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.V=this.R;this.b-=5},function(){this.V= -this.S;this.b-=5},function(){this.V=this.T;this.b-=5},function(){this.V=this.U;this.b-=5},function(){this.b-=5},function(){this.V=this.X;this.b-=5},function(){this.V=this.Y(K(this));this.b-=7},function(){this.V=this.j;this.b-=5},function(){this.X=this.R;this.b-=5},function(){this.X=this.S;this.b-=5},function(){this.X=this.T;this.b-=5},function(){this.X=this.U;this.b-=5},function(){this.X=this.V;this.b-=5},function(){this.b-=5},function(){this.X=this.Y(K(this));this.b-=7},function(){this.X=this.j; -this.b-=5},function(){this.ra(K(this),this.R);this.b-=7},function(){this.ra(K(this),this.S);this.b-=7},function(){this.ra(K(this),this.T);this.b-=7},function(){this.ra(K(this),this.U);this.b-=7},function(){this.ra(K(this),this.V);this.b-=7},function(){this.ra(K(this),this.X);this.b-=7},function(){var a=this.N-1;if(this.K.length)for(var b=0;b>8&256);this.b-=10},function(){this.j=this.Z(Oc(this));this.b-=7},function(){Pc(this,Oc(this)-1);this.b-=5},function(){this.U=ad(this,this.U);this.b-=5},function(){this.U=$c(this,this.U);this.b-=5},function(){this.U=M(this);this.b-=7},function(){var a=this.j<<8;this.j=(Rc(this)<<8|this.j)>>1;Sc(this,a&256);this.b-=4},Ad,function(){Qc(this,N(this));this.b-=10},function(){var a=N(this);this.w.Tb(a,K(this)); +this.b-=16},function(){Qc(this,K(this)+1);this.b-=5},function(){this.V=ad(this,this.V);this.b-=5},function(){this.V=$c(this,this.V);this.b-=5},function(){this.V=M(this);this.b-=7},function(){var a=0,b=Rc(this);if(Uc(this)||9<(this.j&15))a|=6;if(b||154<=this.j)a|=96,b=1;this.j=Xc(this,a);Sc(this,b?256:0);this.b-=4},Ad,function(){var a;Qc(this,a=K(this)+K(this));Sc(this,a>>8&256);this.b-=10},function(){var a;a=N(this);a=this.w.Qa(a);Qc(this,a);this.b-=16},function(){Qc(this,K(this)-1);this.b-=5},function(){this.X= +ad(this,this.X);this.b-=5},function(){this.X=$c(this,this.X);this.b-=5},function(){this.X=M(this);this.b-=7},function(){this.j=~this.j&255;this.b-=4},Ad,function(){this.ka=N(this)&65535;this.b-=10},function(){this.ra(N(this),this.j);this.b-=13},function(){this.ka=this.ka+1&65535;this.b-=5},function(){var a=K(this);this.ra(a,ad(this,this.Z(a)));this.b-=10},function(){var a=K(this);this.ra(a,$c(this,this.Z(a)));this.b-=10},function(){this.ra(K(this),M(this));this.b-=10},function(){this.ba|=256;this.b-= +4},Ad,function(){var a;Qc(this,a=K(this)+this.ka);Sc(this,a>>8&256);this.b-=10},function(){this.j=this.Z(N(this));this.b-=13},function(){this.ka=this.ka-1&65535;this.b-=5},function(){this.j=ad(this,this.j);this.b-=5},function(){this.j=$c(this,this.j);this.b-=5},function(){this.j=M(this);this.b-=7},function(){Sc(this,Rc(this)?0:256);this.b-=4},function(){this.b-=5},function(){this.R=this.S;this.b-=5},function(){this.R=this.T;this.b-=5},function(){this.R=this.U;this.b-=5},function(){this.R=this.V;this.b-= +5},function(){this.R=this.X;this.b-=5},function(){this.R=this.Z(K(this));this.b-=7},function(){this.R=this.j;this.b-=5},function(){this.S=this.R;this.b-=5},function(){this.b-=5},function(){this.S=this.T;this.b-=5},function(){this.S=this.U;this.b-=5},function(){this.S=this.V;this.b-=5},function(){this.S=this.X;this.b-=5},function(){this.S=this.Z(K(this));this.b-=7},function(){this.S=this.j;this.b-=5},function(){this.T=this.R;this.b-=5},function(){this.T=this.S;this.b-=5},function(){this.b-=5},function(){this.T= +this.U;this.b-=5},function(){this.T=this.V;this.b-=5},function(){this.T=this.X;this.b-=5},function(){this.T=this.Z(K(this));this.b-=7},function(){this.T=this.j;this.b-=5},function(){this.U=this.R;this.b-=5},function(){this.U=this.S;this.b-=5},function(){this.U=this.T;this.b-=5},function(){this.b-=5},function(){this.U=this.V;this.b-=5},function(){this.U=this.X;this.b-=5},function(){this.U=this.Z(K(this));this.b-=7},function(){this.U=this.j;this.b-=5},function(){this.V=this.R;this.b-=5},function(){this.V= +this.S;this.b-=5},function(){this.V=this.T;this.b-=5},function(){this.V=this.U;this.b-=5},function(){this.b-=5},function(){this.V=this.X;this.b-=5},function(){this.V=this.Z(K(this));this.b-=7},function(){this.V=this.j;this.b-=5},function(){this.X=this.R;this.b-=5},function(){this.X=this.S;this.b-=5},function(){this.X=this.T;this.b-=5},function(){this.X=this.U;this.b-=5},function(){this.X=this.V;this.b-=5},function(){this.b-=5},function(){this.X=this.Z(K(this));this.b-=7},function(){this.X=this.j; +this.b-=5},function(){this.ra(K(this),this.R);this.b-=7},function(){this.ra(K(this),this.S);this.b-=7},function(){this.ra(K(this),this.T);this.b-=7},function(){this.ra(K(this),this.U);this.b-=7},function(){this.ra(K(this),this.V);this.b-=7},function(){this.ra(K(this),this.X);this.b-=7},function(){var a=this.N-1;if(this.K.length)for(var b=0;b>8;this.b-=10},function(){var a=N(this);Wc(this)||F(this,a);this.b-=10},function(){this.ta&=-513;this.b-=4},function(){var a=N(this);Wc(this)||(Q(this,this.N),F(this,a),this.b-=6);this.b-=11},function(){Q(this,Lc(this)&255|this.j<<8);this.b-=11},function(){this.j=bd(this,M(this));this.b-=7},function(){Q(this,this.N);F(this,48);this.b-=11},function(){Wc(this)&&(F(this,P(this)), -this.b-=6);this.b-=5},function(){this.ja=K(this)&65535;this.b-=5},function(){var a=N(this);Wc(this)&&F(this,a);this.b-=10},function(){this.ta|=512;this.b-=4},function(){var a=N(this);Wc(this)&&(Q(this,this.N),F(this,a),this.b-=6);this.b-=11},Dd,function(){L(this,M(this));this.b-=7},function(){Q(this,this.N);F(this,56);this.b-=11}]; -function T(a){x.call(this,"ChipSet",a,T,32768);var b=a.model;b&&!Ed[b]&&Ka("Unrecognized ChipSet model: "+b);this.C=Ed[b]||{};a.sound&&(this.da=null,window&&(this.da=window.AudioContext||window.webkitAudioContext),this.da&&new this.da);D(this)}Za(T); -var U={ya:1978.1,cd:{za:0,Qd:1,Ud:16,ae:32,je:64,ie:128,tb:14},Sa:{za:1,Ic:1,Yc:2,Uc:4,Vc:16,Wc:32,Xc:64,tb:8},dd:{za:2,Pd:3,qe:4,Rd:8,ee:16,fe:32,ge:64,Sd:128,tb:0},me:{za:3},ke:{za:2,be:7},oe:{za:3,re:1,ne:2,he:4,Zd:8,Td:16,Nd:32},le:{za:4},pe:{za:5,Vd:1,Wd:2,Xd:4,Yd:8,se:16}},V={ya:100,Pa:{za:66,te:1,Sc:2,Tc:4,de:8,ce:16,ic:32,hc:64,ec:128},Hc:{za:66,INIT:0},Ha:{$d:{za:98},Ra:{Fc:0,Ec:1,$c:2,ed:4,Lc:5,Zc:6,ad:7},Hb:16383},Kc:{za:162,INIT:0},Jc:{za:194,INIT:0}},Ed={SI1978:U,VT100:V}; -T.prototype.ka=function(){return!1};T.prototype.Na=function(a,b,c,d){this.A=b;this.b=c;this.H=d;this.u=a;this.M=qb(a,"Keyboard");Bb(b,this,this.C.Pb);Fb(b,this,this.C.Qb)};T.prototype.Aa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};T.prototype.Fa=function(a){return a?this.save():!0};U.INIT=[[U.cd.tb,U.Sa.tb,U.dd.tb,0,0,0,0]]; -V.INIT=[[V.Hc.INIT,V.Pa.Sc|V.Pa.Tc,V.Kc.INIT,V.Jc.INIT],[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,11856,11824,11840,11808,11776,12E3,12E3,11857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]];m=T.prototype; -m.reset=function(){this.C.INIT&&!this.restore(this.C.INIT)&&this.ga("reset error")};m.save=function(){var a=new G(this);switch(this.C.ya){case U.ya:H(a,0,[this.va,this.I,this.wa,this.P,this.ba,this.ma,this.oa]);break;case V.ya:H(a,0,[this.ea,this.J,this.ha,this.fa]),H(a,1,[this.O,this.w,this.K,this.Z,this.G])}return a.data()}; -m.restore=function(a){var b;if(a&&(b=a[0])&&b.length)switch(this.C.ya){case U.ya:return this.va=b[0],this.I=b[1],this.wa=b[2],this.P=b[3],this.ba=b[4],this.ma=b[5],this.oa=b[6],!0;case V.ya:return this.ea=b[0],this.J=b[1],this.ha=b[2],this.fa=b[3],b=a[1],this.O=b[0],this.w=b[1],this.K=b[2],this.Z=b[3],this.G=b[4],!0}return!1};m.start=function(){};m.stop=function(){};m.md=function(a,b){var c=this.va;C(this,a,null,b,"STATUS0",c,!0);return c}; -m.nd=function(a,b){var c=this.I;C(this,a,null,b,"STATUS1",c,!0);return c};m.od=function(a,b){var c=this.wa;C(this,a,null,b,"STATUS2",c,!0);return c};m.ld=function(a,b){var c=this.P>>8-this.ba&255;C(this,a,null,b,"SHIFT.RESULT",c,!0);return c};m.wd=function(a,b,c){C(this,a,b,c,"SHIFT.COUNT",null,!0);this.ba=b};m.yd=function(a,b,c){C(this,a,b,c,"SOUND1",null,!0);this.ma=b};m.xd=function(a,b,c){C(this,a,b,c,"SHIFT.DATA",null,!0);this.P=b<<8|this.P>>8}; -m.zd=function(a,b,c){C(this,a,b,c,"SOUND2",null,!0);this.oa=b};m.Ad=function(a,b,c){C(this,a,b,c,"WATCHDOG",null,!0)};function Fd(a){var b=0,c=0,d=~a.O;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} -m.pd=function(a,b){var c=this.J,c=c&~V.Pa.hc;if((Ac(this.b)&64)<<1&&(c|=V.Pa.hc,c!=this.J)){var d,e;d=this.K&1;e=this.K>>1&7;switch(e){case V.Ha.Ra.ad:break;case V.Ha.Ra.Ec:this.O=this.O<<1|d;break;case V.Ha.Ra.Lc:d=Fd(this);this.G[d]=V.Ha.Hb;fb(this,"doNVRCommand(): erase data at addr "+t(d));break;case V.Ha.Ra.Fc:this.w=this.w<<1|d;break;case V.Ha.Ra.ed:d=Fd(this);e=this.w&V.Ha.Hb;this.G[d]=e;fb(this,"doNVRCommand(): write data "+t(e)+" to addr "+t(d));break;case V.Ha.Ra.Zc:d=Fd(this);e=this.G[d]; -null==e&&(e=V.Ha.Hb);this.w=e;fb(this,"doNVRCommand(): read data "+t(e)+" from addr "+t(d));break;case V.Ha.Ra.$c:this.w<<=1;this.Z=this.w&V.Ha.Hb+1;break;default:fb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~V.Pa.ic;this.Z&&(c|=V.Pa.ic);c&=~V.Pa.ec;this.M&&(c|=V.Pa.ec);this.J=c;C(this,a,null,b,"FLAGS.BUFFER",c);return c};m.Bd=function(a,b,c){C(this,a,b,c,"BRIGHTNESS");this.ea=b};m.Ed=function(a,b,c){C(this,a,b,c,"NVR.LATCH");this.K=b}; -m.Dd=function(a,b,c){C(this,a,b,c,"DC012");this.ha=b};m.Cd=function(a,b,c){C(this,a,b,c,"DC011");this.fa=b};U.Pb={0:T.prototype.md,1:T.prototype.nd,2:T.prototype.od,3:T.prototype.ld};U.Qb={2:T.prototype.wd,3:T.prototype.yd,4:T.prototype.xd,5:T.prototype.zd,6:T.prototype.Ad};V.Pb={66:T.prototype.pd};V.Qb={66:T.prototype.Bd,98:T.prototype.Ed,162:T.prototype.Dd,194:T.prototype.Cd};Ia(function(){for(var a=B(document,"pc8080","chipset"),b=0;b>>0,h],q=ka(p,k,a.Ua);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({ue:b,F:c,rd:d,Oa:e,jc:f})}delete this.Oa}return!0};Gd.prototype.Fa=function(){return!0}; -function Hd(a,b,c,d){if(d)a.ga("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.Tb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.u=f;else if(h)for(a.u=Array(4*h.length),d=c=0;c>8&255,a.u[d++]=h[c]>>16&255,a.u[d++]=h[c]>>24&255;else a.u=e;a.Oa=e.symbols;if(!a.u.length){u("Empty ROM: "+b);return}if(1==a.u.length){u(a.u[0]);return}}catch(g){a.ga("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, -" ").replace(/ +$/,"").split(" "),a.u=Array(b.length),e=0;e>>f.na;0>>=f.na;0d?a.u.push({bc:b,Yb:Date.now(),Ib:!1}):(a.u[d].Yb=Date.now(),a.u[d].Ib=!1);else if(0<=d){if(!a.u[d].Ib){var e=a.u[d].Yb;if(e&&100>Date.now()-e)return a.u[d].Ib=!0,Td(a),!0}a.u.splice(d,1)}if(a.I){d=0;switch(b){case "1p":d=U.Sa.Uc;break;case "2p":d=U.Sa.Yc;break;case "coin":d=U.Sa.Ic;break;case "left":d=U.Sa.Wc;break;case "right":d=U.Sa.Xc;break;case "fire":d=U.Sa.Vc}d&&(a=a.I,b=d,a.I&=~b,c&&(a.I|=b))}return!0} -function Td(a){for(var b=0,c=-1;bc||c>e)c=e}else{Rd(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Td(a)},c)}m.qd=function(a,b){var c=this.C;0<=this.w&&(this.w>3)*this.da;if(this.Jd||ub(this.A,this.va,this.Ua,3))1>1)),this.O=document.createElement("canvas"),this.O.width=b,this.O.height=c,this.cb=this.O.getContext("2d"),this.ma={},this.Ca=1<=a.Gd?8:16,f=8>(7>8-this.ga&255;C(this,a,null,b,"SHIFT.RESULT",c,!0);return c};m.Fd=function(a,b,c){C(this,a,b,c,"SHIFT.COUNT",null,!0);this.ga=b};m.Hd=function(a,b,c){C(this,a,b,c,"SOUND1",null,!0);this.ya=b};m.Gd=function(a,b,c){C(this,a,b,c,"SHIFT.DATA",null,!0);this.da=b<<8|this.da>>8}; +m.Id=function(a,b,c){C(this,a,b,c,"SOUND2",null,!0);this.za=b};m.Jd=function(a,b,c){C(this,a,b,c,"WATCHDOG",null,!0)};function Fd(a){var b=0,c=0,d=~a.aa;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} +m.yd=function(a,b){var c=this.J,c=c&~V.Oa.kc;if((Ac(this.b)&64)<<1&&(c|=V.Oa.kc,c!=this.J)){var d,e;d=this.Y&1;e=this.Y>>1&7;switch(e){case V.Ja.Ra.kd:break;case V.Ja.Ra.Jc:this.aa=this.aa<<1|d;break;case V.Ja.Ra.Oc:d=Fd(this);this.K[d]=V.Ja.Lb;fb(this,"doNVRCommand(): erase data at addr "+t(d));break;case V.Ja.Ra.Kc:this.u=this.u<<1|d;break;case V.Ja.Ra.od:d=Fd(this);e=this.u&V.Ja.Lb;this.K[d]=e;fb(this,"doNVRCommand(): write data "+t(e)+" to addr "+t(d));break;case V.Ja.Ra.hd:d=Fd(this);e=this.K[d]; +null==e&&(e=V.Ja.Lb);this.u=e;fb(this,"doNVRCommand(): read data "+t(e)+" from addr "+t(d));break;case V.Ja.Ra.jd:this.u<<=1;this.fa=this.u&V.Ja.Lb+1;break;default:fb(this,"doNVRCommand(): unrecognized command 0x"+n(e,2))}}c&=~V.Oa.lc;this.fa&&(c|=V.Oa.lc);c&=~V.Oa.gc;this.M&&(c|=V.Oa.gc);this.J=c;C(this,a,null,b,"FLAGS.BUFFER",c);return c};m.Kd=function(a,b,c){C(this,a,b,c,"BRIGHTNESS");this.oa=b};m.Nd=function(a,b,c){C(this,a,b,c,"NVR.LATCH");this.Y=b}; +m.Md=function(a,b,c){C(this,a,b,c,"DC012");a=b&3;switch(b>>2&3){case 0:this.G=this.G&-4|a;break;case 1:this.G=this.G&-13|a<<2;break;case 2:switch(a){case 0:this.ea=~this.ea;break;case 2:case 3:this.wa=3-a}break;case 3:this.va=a}}; +m.Ld=function(a,b,c){C(this,a,b,c,"DC011");b&V.Sa.gd?(b&=V.Sa.mc,this.P!=b&&(this.P=b,this.video&&(a=this.video,b=this.P==V.Sa.mc?50:60,a.g("updateRate("+b+")"),a.Ab=b))):(b&=V.Sa.fc,this.O!=b&&(this.O=b,this.video&&(a=this.O==V.Sa.fc?132:80,this.video.g("updateDimensions("+a+","+(80>>0,h],q=ka(p,k,a.Wa);0>q&&p.splice(-(q+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.J.push({Fe:b,F:c,Ad:d,Pa:e,nc:f})}delete this.Pa}return!0};Gd.prototype.Ha=function(){return!0}; +function Hd(a,b,c,d){if(d)a.ha("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.Vb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,h=e.data;if(f)a.A=f;else if(h)for(a.A=Array(4*h.length),d=c=0;c>8&255,a.A[d++]=h[c]>>16&255,a.A[d++]=h[c]>>24&255;else a.A=e;a.Pa=e.symbols;if(!a.A.length){u("Empty ROM: "+b);return}if(1==a.A.length){u(a.A[0]);return}}catch(g){a.ha("ROM data error: "+g.message);return}else for(b=c.replace(/\n/gm, +" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e>>f.na;0>>=f.na;0d?a.u.push({cc:b,Zb:Date.now(),Mb:!1}):(a.u[d].Zb=Date.now(),a.u[d].Mb=!1);else if(0<=d){if(!a.u[d].Mb){var e=a.u[d].Zb;if(e&&100>Date.now()-e)return a.u[d].Mb=!0,Td(a),!0}a.u.splice(d,1)}if(a.I){d=0;switch(b){case "1p":d=U.Ua.bd;break;case "2p":d=U.Ua.fd;break;case "coin":d=U.Ua.Nc;break;case "left":d=U.Ua.dd;break;case "right":d=U.Ua.ed;break;case "fire":d=U.Ua.cd}d&&(a=a.I,b=d,a.I&=~b,c&&(a.I|=b))}return!0} +function Td(a){for(var b=0,c=-1;bc||c>e)c=e}else{Rd(a,d,!1);b=0;continue}}b++}0<=c&&setTimeout(function(){Td(a)},c)}m.zd=function(a,b){var c=this.G;0<=this.C&&(this.C>3)*this.da;if(this.Sd||ub(this.w,this.va,this.Wa,3))1>1)),this.O=document.createElement("canvas"),this.O.width=b,this.O.height=c,this.fb=this.O.getContext("2d"),this.ia={},this.za=1<=a.Pd?8:16,f=8>(7>4)*c)}return k} -Ud.prototype.Aa=function(){if(2==this.ea){for(var a={0:[32,"SET-UP A"],2:[64,'TO EXIT PRESS "SET-UP"'],22:[96," T T T T T T T T T"],23:[96,"1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890"],24:[]},b=this.va,c=-1,d=-1,e,f=-(60==this.zc?2:5);f>8&15|16;zb(this.A,b++,e);zb(this.A,b++, -c&255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.rc?(this.P.style.width=a,this.P.style.width=a,this.P.style.display="block",this.P.style.margin="auto"):(this.w.style.width=a,this.w.style.height="auto");this.w.style.backgroundColor="black";this.w.fb();a=!0}this.Ba&&this.Ba.focus()}return a}; -function Xd(a,b){!b&&a.w&&(a.rc?a.P.style.width=a.P.style.height="":a.w.style.width=a.w.style.height="");fb(a,"notifyFullScreen("+b+")",!0)}function Zd(a,b){a.xc=b;a.wa=!1;if(void 0===a.J||a.J.length!=a.xc)a.J=Array(a.xc)}function be(a,b,c,d,e){d=a.C?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ea&&(208<=c&&236>c?e=a.Ca+0:28<=c&&72>c&&(e=a.Ca+1));a=a.oa[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 ce(a){for(var b=a.va,c=-1,d=0,e=60==a.zc?2:5,f=0,h=0;d>=1);;){var q=xb(a.A,k++);if(127==(q&127)){var r=xb(a.A,k++),c=r&96,b=(r&15)<<8|xb(a.A,k),b=b+(r&16?8192:16384);break}if(g>4)*q.ia,w=void 0,J=void 0,A=void 0, -R=void 0,za=q.qa,Z=q.ia;y?(w=p*r.qa,J=d*r.ia,A=r.qa,R=r.ia):(w=p*r.Lb,J=d*r.Mb,A=r.Lb,R=r.Mb);q.qa>r.qa&&(w*=2,A*=2);q.ia>r.ia&&(0==l&&(v+=r.ia),Z=r.ia);y?y.drawImage(q.canvas,I,v,za,Z,w,J,A,R):(w+=0,J+=0,r.I.drawImage(q.canvas,I,v,za,Z,w,J,A,R))}h++}f++}d++}}a.wa=!0;h&&a.cb&&a.I.drawImage(a.O,0,0,a.K,a.da-a.ia,0,0,a.Hd,a.Id)} -Ia(function(){for(var a=B(document,"pc8080","video"),b=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<=qa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= +Ud.prototype.Ea=function(){if(2==this.ea){for(var a={0:[32,"SET-UP A"],2:[64,'TO EXIT PRESS "SET-UP"'],22:[96," T T T T T T T T T"],23:[96,"1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890","1234567890"],24:[]},b=this.va,c=-1,d=-1,e,f=-(60==this.Ab?2:5);f>8&15|16;zb(this.w,b++,e);zb(this.w,b++, +c&255);if(g)break}if(h)for(c=0,e=1;ec&&(a=Math.round(c/b*100)+"%")}this.xc?(this.P.style.width=a,this.P.style.width=a,this.P.style.display="block",this.P.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.hb();a=!0}this.ya&&this.ya.focus()}return a}; +function Xd(a,b){!b&&a.u&&(a.xc?a.P.style.width=a.P.style.height="":a.u.style.width=a.u.style.height="");fb(a,"notifyFullScreen("+b+")",!0)}function Zd(a,b){a.Dc=b;a.wa=!1;if(void 0===a.J||a.J.length!=a.Dc)a.J=Array(a.Dc)}function be(a,b,c,d,e){d=a.C?(b.height-c-1)*b.width+d:c+d*b.width;e&&1==a.ea&&(208<=c&&236>c?e=a.za+0:28<=c&&72>c&&(e=a.za+1));a=a.oa[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 ce(a){for(var b=a.va,c=-1,d=0,e=60==a.Ab?2:5,f=0,h=0;d>=1);;){var q=xb(a.w,k++);if(127==(q&127)){var r=xb(a.w,k++),c=r&96,b=(r&15)<<8|xb(a.w,k),b=b+(r&16?8192:16384);break}if(g>4)*q.ja,w=void 0,J=void 0,A=void 0, +R=void 0,Aa=q.qa,Z=q.ja;z?(w=p*r.qa,J=d*r.ja,A=r.qa,R=r.ja):(w=p*r.uc,J=d*r.vc,A=r.uc,R=r.vc);q.qa>r.qa&&(w*=2,A*=2);q.ja>r.ja&&(0==l&&(v+=r.ja),Z=r.ja);z?z.drawImage(q.canvas,I,v,Aa,Z,w,J,A,R):(w+=0,J+=0,r.I.drawImage(q.canvas,I,v,Aa,Z,w,J,A,R))}h++}f++}d++}}a.wa=!0;h&&a.fb&&a.I.drawImage(a.O,0,0,a.K,a.da-a.ja,0,0,a.Qd,a.Rd)} +Ia(function(){for(var a=B(document,"pc8080","video"),b=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<=qa().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||Ra.aspect);f&&.3<=f&&3.33>=f&&(Ha("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");wa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Ud(d,e,h,f,c);db(d,c)}}); -function de(a){this.G=+a.adapter;switch(this.G){case 0:this.J=0;break;default:u("Unrecognized serial adapter #"+this.G);return}x.call(this,"SerialPort",a,de,8388608);var b=a.binding;if("console"!=b){var c;a=ee;b&&(void 0===c&&(c="Panel"),(c=cb(c,this.id))&&(b=c.L[b])&&this.ka(null,a,b))}}Za(de);var ee="buffer";m=de.prototype; -m.ka=function(a,b,c){switch(b){case ee:return this.L[b]=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;(8===b||a.ctrlKey&&65<=b&&90>=b)&&a.preventDefault&&a.preventDefault();return!0},c.onkeypress=function(a){a=a||window.event;a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};m.Na=function(a,b,c,d){this.A=b;this.b=c;this.H=d;this.I=qb(a,"ChipSet");Bb(b,this,fe,this.J);Fb(b,this,ge,this.J);D(this)}; -m.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};m.Fa=function(a){return a?this.save():!0};m.reset=function(){he(this)};m.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.w;c[b++]=this.u;c[b++]=this.C;H(a,0,c);return a.data()};m.restore=function(a){return he(this,a[0])};function he(a,b){var c=0;void 0===b&&(b=[0,0,0]);a.w=b[c++];a.u=b[c++];a.C=b[c++];return!0}m.kd=function(a,b){var c=this.w;C(this,a,null,b,"DATA",c);return c}; -m.jd=function(a,b){var c=this.u;C(this,a,null,b,"COMMAND",c);return c};m.vd=function(a,b,c){C(this,a,b,c,"DATA");this.w=b};m.ud=function(a,b,c){C(this,a,b,c,"COMMAND");this.u=b};m.td=function(a,b,c){C(this,a,b,c,"BAUDRATE");this.C=b};var fe={0:de.prototype.kd,1:de.prototype.jd},ge={0:de.prototype.vd,1:de.prototype.ud,2:de.prototype.td};Ia(function(){for(var a=B(document,"pc8080","serial"),b=0;b=b)&&a.preventDefault&&a.preventDefault();return!0},c.onkeypress=function(a){a=a||window.event;a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};m.Na=function(a,b,c,d){this.w=b;this.b=c;this.H=d;this.I=qb(a,"ChipSet");Bb(b,this,fe,this.J);Fb(b,this,ge,this.J);D(this)}; +m.Ea=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};m.Ha=function(a){return a?this.save():!0};m.reset=function(){he(this)};m.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.u;c[b++]=this.A;c[b++]=this.C;H(a,0,c);return a.data()};m.restore=function(a){return he(this,a[0])};function he(a,b){var c=0;void 0===b&&(b=[0,0,0]);a.u=b[c++];a.A=b[c++];a.C=b[c++];return!0}m.td=function(a,b){var c=this.u;C(this,a,null,b,"DATA",c);return c}; +m.sd=function(a,b){var c=this.A;C(this,a,null,b,"COMMAND",c);return c};m.Ed=function(a,b,c){C(this,a,b,c,"DATA");this.u=b};m.Dd=function(a,b,c){C(this,a,b,c,"COMMAND");this.A=b};m.Cd=function(a,b,c){C(this,a,b,c,"BAUDRATE");this.C=b};var fe={0:de.prototype.td,1:de.prototype.sd},ge={0:de.prototype.Ed,1:de.prototype.Dd,2:de.prototype.Cd};Ia(function(){for(var a=B(document,"pc8080","serial"),b=0;b>>d.A.na;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,l=0;k--;){var p=b[g];p.type==c?l++||d.g("..."):(c=p.type,l=wb[c],p&&d.g(n(p.id)+" %"+n(g<>>e.na;f!=e.A?e.W[h].cc(f,b&65535,d):(e.W[h++].Gb(f,b&255,d),e.W[h&e.K].Gb(0,b>>8&255,d+1));c&&we(a,c);lc(this.b,!0)}};function X(a){return{F:a,Ma:!1}}function xe(a){return[a.F,a.Ma]}function ye(a){return{F:a[0],Ma:a[1]}} -function ve(a,b,c){var d;c=(c?a.P:a.bb).F;if(void 0!==b){d=b=ze(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c>>d.w.na;k=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,l=0;k--;){var p=b[g];p.type==c?l++||d.g("..."):(c=p.type,l=wb[c],p&&d.g(n(p.id)+" %"+n(g<>>e.na;f!=e.w?e.W[h].dc(f,b&65535,d):(e.W[h++].Jb(f,b&255,d),e.W[h&e.K].Jb(0,b>>8&255,d+1));c&&we(a,c);lc(this.b,!0)}};function X(a){return{F:a,Ma:!1}}function xe(a){return[a.F,a.Ma]}function ye(a){return{F:a[0],Ma:a[1]}} +function ve(a,b,c){var d;c=(c?a.P:a.eb).F;if(void 0!==b){d=b=ze(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=na(qe,a.substr(b,1))));return c}function Fe(a,b){var c=0,d=Ge(a,b);if(void 0!==d)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?n(d,c):"??"} -function Ge(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.R;break;case 1:c=d.S;break;case 8:c=Mc(d);break;case 2:c=d.T;break;case 3:c=d.U;break;case 9:c=Oc(d);break;case 4:c=d.V;break;case 5:c=d.X;break;case 10:c=K(d);break;case 6:c=d.Y(K(d));break;case 11:c=d.ja;break;case 12:c=d.N;break;case 13:c=Lc(d);break;case 14:c=Lc(d)&255|d.j<<8}}return c} +function Ge(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.j;break;case 0:c=d.R;break;case 1:c=d.S;break;case 8:c=Mc(d);break;case 2:c=d.T;break;case 3:c=d.U;break;case 9:c=Oc(d);break;case 4:c=d.V;break;case 5:c=d.X;break;case 10:c=K(d);break;case 6:c=d.Z(K(d));break;case 11:c=d.ka;break;case 12:c=d.N;break;case 13:c=Lc(d);break;case 14:c=Lc(d)&255|d.j<<8}}return c} function He(a,b){b=ze(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=Ee(b,c+1),0<=e&&(b=b.substr(0,c)+Fe(a,e)+b.substr(c+1+qe[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=ba(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=ve(a,e))?(d=e+' "'+De(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=ve(a,e))?(we(d),d=e+' "'+ -De(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}m.message=function(a,b){b&&(a+=" at "+Y(X(this.b.N).F));if(this.pa&1073741824)this.Ba.push(a);else if(!this.wa||a!=this.wa)if(this.wa=a,this.pa&-2147483648&&(this.la(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.ob=0;c.C-=c.b;c.b=0;lc(c)}}; -function eb(a,b,c,d,e,f,h,g){g|=256;null!=f&&(a.pa&g)!=g||a.message(b.ab+"."+(null!=d?"outPort":"inPort")+"("+t(c)+","+(f?f:"unknown")+(null!=d?",0x"+n(d,2):"")+")"+(null!=h?": 0x"+n(h,2):"")+(null!=e?" at "+Y(e):""))} -function le(a){var b;if(yd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.na],!1)}a.Z=["br"];if(void 0!==a.G)for(b=1;b>>d.na],!0);a.G=["bw"];a.cb=0}m.Va=function(a,b,c){var d=!0;c||Me(this,a,b,!1,!0);if(a!=this.w){var e=ue(b);if(-1===e)this.g("invalid address: "+Y(b.F)),d=!1;else{var f=this.A;f.W[e>>>f.na].Va(e&f.A,a==this.G)}}d&&(a.push(b),c?b.Ma=!0:(lf(this,a,a.length-1,"set"),le(this)));return d}; -function Me(a,b,c,d,e){var f=!1;c=ue(c);for(var h=1;h>>d.na],b==a.G));g.Ma||le(a);break}}return f}function mf(a,b){for(var c=1;c>24,4);break;case 3:w=n(y.Qa(I,2),4);break;default:y="imm("+t(v)+")";break a}8086==y.style&&v&64?w="["+w+"]":v&16||(w=(y.style==je?"$":"0x")+w);y=w}else v& -16?(y=(q&3840)>>8,v=qe[y],8086==a.style&&q&64&&(6==y&&(v="HL"),v="["+v+"]"),y=v):v&128&&(y=(f>>3&7).toString());if(!y||!y.length){g="INVALID";break}0>>d.na],!1)}a.Y=["br"];if(void 0!==a.G)for(b=1;b>>d.na],!0);a.G=["bw"];a.fb=0}m.Xa=function(a,b,c){var d=!0;c||Me(this,a,b,!1,!0);if(a!=this.u){var e=ue(b);if(-1===e)this.g("invalid address: "+Y(b.F)),d=!1;else{var f=this.w;f.W[e>>>f.na].Xa(e&f.w,a==this.G)}}d&&(a.push(b),c?b.Ma=!0:(lf(this,a,a.length-1,"set"),le(this)));return d}; +function Me(a,b,c,d,e){var f=!1;c=ue(c);for(var h=1;h>>d.na],b==a.G));g.Ma||le(a);break}}return f}function mf(a,b){for(var c=1;c>24,4);break;case 3:w=n(z.Qa(I,2),4);break;default:z="imm("+t(v)+")";break a}8086==z.style&&v&64?w="["+w+"]":v&16||(w=(z.style==je?"$":"0x")+w);z=w}else v& +16?(z=(q&3840)>>8,v=qe[z],8086==a.style&&q&64&&(6==z&&(v="HL"),v="["+v+"]"),z=v):v&128&&(z=(f>>3&7).toString());if(!z||!z.length){g="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; function tf(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 Ae(a,b,c){var d;if(b){b=ze(a,b);for(var e=0,f=!1,h=b,g=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;h=p+"b"+h;d>>=8}d="0x"+n(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function wf(a,b){if(b)return vf(a,b,a.ha[b]);var c=0;for(b in a.ha)vf(a,b,a.ha[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.rd;if(e>=h&&e>=1;h=p+"b"+h;d>>=8}d="0x"+n(c)+" "+c+". ("+h+")"}a.g((null!=b?b+": ":"")+d);return e}function wf(a,b){if(b)return vf(a,b,a.ga[b]);var c=0;for(b in a.ga)vf(a,b,a.ga[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,g=f.Ad;if(e>=h&&e>8&255;case "C":d.S=g&255;break;case "D":d.T= -g&255;break;case "DE":d.T=g>>8&255;case "E":d.U=g&255;break;case "H":d.V=g&255;break;case "HL":d.V=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ja=g&65535;break;case "PC":F(d,g);a.P=X(d.N);break;case "PS":Jc(d,g);break;case "PSW":Jc(d,g&255|d.ta&-256);d.j=g>>8;break;case "CF":d.aa=g?d.aa|256:d.aa&255;break;case "PF":g?Tc(d)||(d.ca^=1):Tc(d)&&(d.ca^=1);break;case "AF":d.ua=g?~d.ca&16|d.ua&-17:d.ca&16|d.ua&-17;break;case "ZF":d.aa=g?d.aa&-256:d.aa|255;break;case "SF":g?Wc(d)||(d.ca^=192):Wc(d)&&(d.ca^= -192);break;case "IF":d.ta=g?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}lc(d);a.g("updated registers:")}a.g(rf(a));c&&(a.P=X(d.N),Ke(a,Y(a.P.F)))}}function Df(a,b){b=ja(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(He(a,c[2])):Ae(a,b,!0)}function Ef(a,b,c){var d="t"!=b;c=uf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);xa(c,function(){return hb(a,!0)&&a.rb(e,d,!1)},function(){lc(a.b);hb(a,!1)})} -function Ke(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.Fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=of(a,b,h,f);a.g(f);a.P=b;e-=b.F-k;c++}}} +g&255;break;case "DE":d.T=g>>8&255;case "E":d.U=g&255;break;case "H":d.V=g&255;break;case "HL":d.V=g>>8&255;case "L":d.X=g&255;break;case "SP":d.ka=g&65535;break;case "PC":F(d,g);a.P=X(d.N);break;case "PS":Jc(d,g);break;case "PSW":Jc(d,g&255|d.ta&-256);d.j=g>>8;break;case "CF":d.ba=g?d.ba|256:d.ba&255;break;case "PF":g?Tc(d)||(d.ca^=1):Tc(d)&&(d.ca^=1);break;case "AF":d.ua=g?~d.ca&16|d.ua&-17:d.ca&16|d.ua&-17;break;case "ZF":d.ba=g?d.ba&-256:d.ba|255;break;case "SF":g?Wc(d)||(d.ca^=192):Wc(d)&&(d.ca^= +192);break;case "IF":d.ta=g?d.ta|512:d.ta&-513;break;default:a.g("unknown register: "+e);return}if(!h){a.g("invalid value: "+f);return}lc(d);a.g("updated registers:")}a.g(rf(a));c&&(a.P=X(d.N),Ke(a,Y(a.P.F)))}}function Df(a,b){b=ja(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(He(a,c[2])):Ae(a,b,!0)}function Ef(a,b,c){var d="t"!=b;c=uf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);xa(c,function(){return hb(a,!0)&&a.tb(e,d,!1)},function(){lc(a.b);hb(a,!1)})} +function Ke(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.Fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],f=null);f=of(a,b,h,f);a.g(f);a.P=b;e-=b.F-k;c++}}} function Ce(a,b,c,d){if(c)if(b){0>a.I&&a.C.length&&(a.I=0);if(0>a.I||b!=a.C[a.I])a.C.splice(0,0,b),a.I=0;a.I--}else a.fa?b="end":b=a.C[a.I+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var h=b.charAt(f);if('"'==h||"'"==h)e?h==e&&(e=null):e=h;else if(h==d&&!e||!h)a.push(ja(b.substring(c,f))),c=f+1}}return a} function nf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.fa&&(a.g("ended assemble at "+Y(a.ea.F)),a.P=a.ea,a.fa=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.wa=null;if(jb(a)&&0l||"z"Ca.length&&(a.g("note: only "+Ca.length+" available"),fa=Ca.length);aa-=fa;0>aa&&(null==Ca[Ca.length-1].F?(fa=aa+fa,aa=0):aa+=Ca.length);var hd=[];"call"== -Se&&(mb=1E5,hd=["CALL"]);for(void 0!==Re&&a.g(fa+" instructions earlier:");0=Ca.length&&(aa=0);a.eb=fa;Ue++;mb--}}Ue||(a.g("no "+Te+"history available"),a.eb=void 0)}else{var oc=ve(a,Z);if(oc){var pc=0;Va&&("l"==Va.charAt(0)&&(Va=Va.substr(1)||Zf),pc=uf(a,Va)>>>0,65536>4||1;ag--&&0tc?String.fromCharCode(tc):".";rc--}Wa&&(Wa+="\n");Wa+=Z+" "+Mb+(0==Lb?" "+jd:"")}Wa&&a.g(Wa);a.bb=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,Xe=255,Ye=a.Y,Ze=a.ra;"ew"==f[0]&&(uc=2,Xe=65535,Ye=a.Qa,Ze=a.Rb);var $e=uc<<1,af=f[1];if(null==af)a.g("edit memory commands:"), +p,void 0===f[2])a.g("begin assemble at "+Y(p.F)),a.fa=!0,lc(a.b);else{var q;a.g("not supported yet");q=[];if(q.length){for(var r=0;rDa.length&&(a.g("note: only "+Da.length+" available"),fa=Da.length);aa-=fa;0>aa&&(null==Da[Da.length-1].F?(fa=aa+fa,aa=0):aa+=Da.length);var hd=[];"call"== +Se&&(mb=1E5,hd=["CALL"]);for(void 0!==Re&&a.g(fa+" instructions earlier:");0=Da.length&&(aa=0);a.gb=fa;Ue++;mb--}}Ue||(a.g("no "+Te+"history available"),a.gb=void 0)}else{var oc=ve(a,Z);if(oc){var pc=0;Va&&("l"==Va.charAt(0)&&(Va=Va.substr(1)||Zf),pc=uf(a,Va)>>>0,65536>4||1;ag--&&0tc?String.fromCharCode(tc):".";rc--}Wa&&(Wa+="\n");Wa+=Z+" "+Mb+(0==Lb?" "+jd:"")}Wa&&a.g(Wa);a.eb=oc}}}}break;case "e":if("else"==f[0])break;var uc=1,Xe=255,Ye=a.Z,Ze=a.ra;"ew"==f[0]&&(uc=2,Xe=65535,Ye=a.Qa,Ze=a.Tb);var $e=uc<<1,af=f[1];if(null==af)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 vc=ve(a,af);if(vc)for(var wc=2;wcqd;){for(var Xa=null,gg=256;65536>Pb.F>>>0;){cf.F= +Be(a,kd,cg);a.Xa(a.u,kd,!0)}a.bb(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;case "h":a:{var ld;if(a.D.xa)ld="halting",a.ma();else{if(ib(a,!0))break a;ld="already halted"}c||a.g(ld)}break;case "i":if("if"==f[0]){var md;var Ob=b.substr(2),Ob=ja(Ob);Ae(a,Ob)?(c||a.g("true: "+Ob),md=!0):(c||a.g("false: "+Ob),md=!1);md||(d=!1);break}if("int"==f[0]){var xc;var dg=f[1];if(a.b.ta&512){var nd=Ae(a,dg);null==nd?xc=!1:(a.g("requesting interrupt level "+nd),ed(a.b,nd),xc=!0)}else a.g("interrupts disabled (use rif=1 to enable)"), +xc=!1;xc||(d=!1);break}var od=f[1];if(od&&"?"!=od){var pd=uf(a,od);if(void 0!==pd){var eg=Cb(a.w,pd);a.g(t(pd)+": "+("0x"+n(eg,2)))}}else a.g("input commands:"),a.g("\ti [p]\tread port [p]"),a.g("warning: port accesses can affect hardware state");break;case "k":var fg=f[0];if("?"==f[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var qd=0,cf=X(),Pb=X(a.b.ka);for(a.g("stack trace for "+Y(Pb.F));10>qd;){for(var Xa=null,gg=256;65536>Pb.F>>>0;){cf.F= a.Qa(Pb,2);if(null==Pb.F||!gg--)break;for(var hg=a,yc=cf,df=null,Qb=yc.F,ef=Qb,rd=1;6>=rd&&Qb;rd++){if(2\nLicense: GPL version 3 or later ");for(b=0;b\nLicense: GPL version 3 or later ");for(b=0;bOf){if(Kf(d,this.P)){this.G=new G(this,"1.23.3","failsafe");Kf(this.G)&&(Tf(this,d),a=2,Hf(this.G));H(this.G,"timestamp",ma());If(this.G);var e=this.u&&!this.K;if(1==a||ra("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Jf(d)){var f=Lf(d,"code"),h=Lf(d,"data");f&&("ok"==f?Kf(d,h):("error"==f&& -"no machine state"!=h?(this.ga("Error: "+h),"unable to verify user"==h&&(va("user",""),this.w=null)):this.g(f+": "+h),Hf(d),Kf(d)?(c=Jf(d),e=!0):c=!1))}e&&Sf(this,c?d:null)}else 2==a&&d.clear()}else Sf(this);delete this.P;delete this.Z}e=bb(this.id);for(f=0;fa[1];a=a[2];this.oa=!0;this.D.sa=!0;var d=this.L.power;d&&(d.textContent="Shutdown");this.b&&(Uf(this,this.b,b,c,a),mc(this.b));this.ea&&(Tf(this,b),b.clear());!c&&this.G&&(this.G.clear(),delete this.G);this.C=0}; -function Tf(a,b){if(ra("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.w||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.ma;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}} -function Ff(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new G(a,"1.23.3"),h=new G(a,"1.23.3","validate"),g=ma();H(h,"timestamp",g);H(f,"timestamp",g);H(f,"version","1.23.3");H(f,"url",window?window.location.href:null);H(f,"browser",qa());a.b&&a.b.Fa&&(c&&a.b.la(),d=a.b.Fa(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.D.sa=!1,!1===d&&(e=null)));for(var g=bb(a.id),k=0;kOf){if(Kf(d,this.P)){this.G=new G(this,"1.23.3","failsafe");Kf(this.G)&&(Tf(this,d),a=2,Hf(this.G));H(this.G,"timestamp",ma());If(this.G);var e=this.A&&!this.K;if(1==a||ra("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Jf(d)){var f=Lf(d,"code"),h=Lf(d,"data");f&&("ok"==f?Kf(d,h):("error"==f&& +"no machine state"!=h?(this.ha("Error: "+h),"unable to verify user"==h&&(va("user",""),this.u=null)):this.g(f+": "+h),Hf(d),Kf(d)?(c=Jf(d),e=!0):c=!1))}e&&Sf(this,c?d:null)}else 2==a&&d.clear()}else Sf(this);delete this.P;delete this.Y}e=bb(this.id);for(f=0;fa[1];a=a[2];this.oa=!0;this.D.sa=!0;var d=this.L.power;d&&(d.textContent="Shutdown");this.b&&(Uf(this,this.b,b,c,a),mc(this.b));this.ea&&(Tf(this,b),b.clear());!c&&this.G&&(this.G.clear(),delete this.G);this.C=0}; +function Tf(a,b){if(ra("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.u||"",d=b.toString(),e={app:"PC8080",ver:"1.23.3"};e.url=a.ia;e.user=c;e.type="bug";e.data=d;oa("http://www.pcjs.org/api/v1/report",e,!0)}} +function Ff(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new G(a,"1.23.3"),h=new G(a,"1.23.3","validate"),g=ma();H(h,"timestamp",g);H(f,"timestamp",g);H(f,"version","1.23.3");H(f,"url",window?window.location.href:null);H(f,"browser",qa());a.b&&a.b.Ha&&(c&&a.b.ma(),d=a.b.Ha(b,c),"object"===typeof d&&H(f,a.b.id,d),c&&(a.b.D.sa=!1,!1===d&&(e=null)));for(var g=bb(a.id),k=0;k>>f.na;0>8|(w&255)<<8);p>J&I;be(d,d.sc,p++,q,R);J+=v}p>r&&(r=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.wa=!0;e>>f.na;0>8|(w&255)<<8);p>J&I;be(d,d.Cc,p++,q,R);J+=v}p>r&&(r=p);q=h&&(h=q+1)}g+=2;l++;if(p>=d.K&&(p=0,q++,q>d.da))break}d.wa=!0;eg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2")); g=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");oa(e,null,!0,function(f,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(f=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,p=/( [a-z]+=)(['"])(.*?)\2/g;l=p.exec(f);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, @@ -238,4 +240,4 @@ function pg(a,b,c,d){if(!c&&b){d.push(b);a=$a[d[0]];b=null;for(var e in a)if(ea( function qg(a,b){var c,d,e,f=b[0],h=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var g=$a[f],k={},l;for(l in g){var p=g[l],q=da(l);if("xml"==q){for(q=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=q.exec(g[l]);){var r=d[2];r&&(g[r]||(p=p.replace(d[0],"")))}d=l=ca(l)}else"xsl"==q&&(e=l=ca(l));k[l]=p}a&&(k[l="css"]=a);b[2]&&(k[l="parms"]=b[2]);b[3]&&(k[l="state"]=b[3]);d&&e?(l=JSON.stringify(k),h+=".js",c=c[1]+"var resources="+l+";"+c[2]+c[3],c=c.replace(/\u00A9/g, "©"),l=h,g=null,k="data:application/javascript,",k=wa("Firefox")?k+encodeURIComponent(c):k+encodeURI(c),l&&(g=document.createElement("a"),"string"!=typeof g.download&&(g=null)),g?(g.href=k,g.download=l,document.body.appendChild(g),g.click(),document.body.removeChild(g),c="Check your Downloads folder for "+l+"."):(window.open(k),c="Check your browser for a new window/tab containing the requested data"+(l?" ("+l+")":"")+"."),c+=', copy it to your web server as "'+h+'", and then add the following to your web page:\n\n', c+='
\n',c+="...\n",c+='