Merge branch 'master' into gh-pages
This commit is contained in:
commit
f39608efde
44 changed files with 1991 additions and 781 deletions
|
|
@ -42,7 +42,7 @@ p. 155, "PAPER TAPE SOFTWARE", the following software was available on paper tap
|
|||
- [IOX](iox/) (PDP-11 Input/Output eXecutive)
|
||||
- [PDP-11 BASIC](basic/) (Beginners All-purpose Symbolic Instruction Code)
|
||||
|
||||
There was a separate DEC publication, [PDP-11 Paper Tape Software Handbook](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Paper_Tape_Software_Handbook.pdf),
|
||||
There was a separate DEC publication, [PDP-11 Paper Tape Software Handbook](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Paper_Tape_Software_Handbook_1976.pdf),
|
||||
that described all of the above software in greater detail, and it included some programs that the 1971 Handbook listed under
|
||||
"Disk Operating System" instead of "Paper Tape System", such as:
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ we know about the "Absolute Format":
|
|||
[Other sites](http://www.retrocmp.com/stories/dec-pc05-papertape/242-dec-pc05-working-with-paper-tapes)
|
||||
have referred to this tape format as the "Standard Absolute" format, but I've not found that terminology
|
||||
used in any DEC publication. In fact, I think that term may have arisen from a misreading of instructions
|
||||
found in DEC manuals like the ["MEM EXER 16K" Diagnostics Manual](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Mem-Exer-16k_Feb78.pdf):
|
||||
found in DEC manuals like the ["MEM EXER 16K" Diagnostics Manual](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-9045F-MC_CZQMCFO_MEM_EXER_16K_Feb78.pdf):
|
||||
|
||||
Load the program using any standard absolute loader.
|
||||
|
||||
|
|
@ -54,5 +54,5 @@ for which a specific address has been selected, based on the amount of RAM prese
|
|||
PCjs has archived the following Absolute Loader resources:
|
||||
|
||||
- [Absolute Loader](DEC-11-L2PC-PO.json)
|
||||
- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Absolute_Loader_Listing_Jun75.pdf)
|
||||
- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA_ABSOLUTE_LOADER_LISTING_Jun75.pdf)
|
||||
- "APPENDIX D: THE BOOTSTRAP AND ABSOLUTE LOADERS" from the [PDP-11 BASIC PROGRAMMING MANUAL (December 1970)](http://archive.pcjs.org/pubs/dec/pdp11/basic/BASIC_Programming_Manual_Dec70.pdf)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ DEC PDP-11 BASIC
|
|||
|
||||
[](DEC-11-AJPB-PB.json)
|
||||
|
||||
According to the [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf), p. 160,
|
||||
notable features of PDP-11 BASIC included:
|
||||
According to the [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf),
|
||||
p. 160, notable features of PDP-11 BASIC included:
|
||||
|
||||
- Use of BASIC statements in immediate mode (no line number)
|
||||
- Ability to use any BASIC command (RUN, LIST, etc.) in deferred mode (with a line number)
|
||||
|
|
@ -47,19 +47,19 @@ Debugging Notes
|
|||
|
||||
### PDPjs Debugger vs. SIMH
|
||||
|
||||
When I first tried to run BASIC in a PDPjs machine, it crashed almost immediately. It was attempting to use memory beyond
|
||||
the 16Kb of installed RAM. After a bit of poking around, I found BASIC's memory sizing code here:
|
||||
When I first tried to run BASIC in a PDPjs machine, it crashed almost immediately. It was attempting to use memory
|
||||
beyond the 16Kb of installed RAM. After a bit of poking around, I found BASIC's memory sizing code here:
|
||||
|
||||
016142: 012701 160000 MOV #160000,R1
|
||||
016146: 022626 CMP (SP)+,(SP)+
|
||||
016150: 014111 MOV -(R1),@R1
|
||||
|
||||
The code sets R1 to highest possible RAM address and starts scanning backwards for the first valid memory location. However,
|
||||
the scanning process wasn't clear to me at first glance, and the `CMP (SP)+,(SP)+` was a bit of a head-scratcher, so I decided
|
||||
to do an instruction-by-instruction comparison with SIMH.
|
||||
The code sets R1 to highest possible RAM address and starts scanning backwards for the first valid memory location.
|
||||
However, the scanning process wasn't clear to me at first glance, and the `CMP (SP)+,(SP)+` was a bit of a
|
||||
head-scratcher, so I decided to do an instruction-by-instruction comparison with SIMH.
|
||||
|
||||
After cloning the [SIMH project](https://github.com/simh/simh) and building the *pdp11* binary, I created a *pdp11.ini* text file
|
||||
that contained:
|
||||
After cloning the [SIMH project](https://github.com/simh/simh) and building the *pdp11* binary, I created a *pdp11.ini*
|
||||
text file that contained:
|
||||
|
||||
ECHO Configuring PDP-11/20 with 16Kb of RAM...
|
||||
SET CPU 11/20
|
||||
|
|
@ -154,15 +154,15 @@ After typing several "do tr" commands, I was surprised to see SIMH execution con
|
|||
|
||||
Step expired, PC: 016150 (MOV -(R1),(R1))
|
||||
|
||||
until I remembered that when the PDP-11 accesses an invalid address, it's supposed to trap to vector 000004, and that BASIC
|
||||
must have modified vector 000004 to jump into the middle of this code.
|
||||
until I remembered that when the PDP-11 accesses an invalid address, it's supposed to trap to vector 000004, and that
|
||||
BASIC must have modified vector 000004 to jump into the middle of this code.
|
||||
|
||||
This code fragment was simply marching down the address space until it reached an address that didn't trap. The odd-looking
|
||||
`CMP (SP)+,(SP)+` instruction was throwing away the PC and PSW that each trap pushed onto the stack, by effectively adding
|
||||
4 to SP.
|
||||
This code fragment was simply marching down the address space until it reached an address that didn't trap. The
|
||||
odd-looking `CMP (SP)+,(SP)+` instruction was throwing away the PC and PSW that each trap pushed onto the stack, by
|
||||
effectively adding 4 to SP.
|
||||
|
||||
The problem with PDPjs was that it wasn't generating a trap to vector 000004 when an invalid address was accessed. After fixing
|
||||
that, I verified with the PDPjs Debugger that the memory sizing code was working properly:
|
||||
The problem with PDPjs was that it wasn't generating a trap to vector 000004 when an invalid address was accessed.
|
||||
After fixing that, I verified with the PDPjs Debugger that the memory sizing code was working properly:
|
||||
|
||||
PDPjs v1.30.1
|
||||
Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -263,18 +263,19 @@ When the code starts, the TRAP instruction has already pushed two words onto the
|
|||
0(SP): previous PC
|
||||
2(SP): previous PSW
|
||||
|
||||
The first instruction, `MOV @SP,2(SP)`, copies the *previous PC* onto the *previous PSW*, which is where we'll eventually want
|
||||
*previous PC*, so that the handler can eventually return with a simple `RTS PC`.
|
||||
The first instruction, `MOV @SP,2(SP)`, copies the *previous PC* onto the *previous PSW*, which is where we'll
|
||||
eventually want *previous PC*, so that the handler can eventually return with a simple `RTS PC`.
|
||||
|
||||
The next instruction, `SUB #2,@SP`, subtracts 2 from the original *previous PC*, so that it now points to the TRAP instruction.
|
||||
The next instruction, `SUB #2,@SP`, subtracts 2 from the original *previous PC*, so that it now points to the TRAP
|
||||
instruction.
|
||||
|
||||
Then `@(SP)+,-(SP)` fetches the TRAP instruction while also "popping" the original *previous PC* and then "pushing" TRAP
|
||||
instruction onto the stack, overwriting the original *previous PC*.
|
||||
Then `@(SP)+,-(SP)` fetches the TRAP instruction while also "popping" the original *previous PC* and then "pushing"
|
||||
TRAP instruction onto the stack, overwriting the original *previous PC*.
|
||||
|
||||
The next few instructions shift the TRAP right to see if bit 0 is set, and if it is not, then the TRAP instruction is restored
|
||||
by shifting it left again, and then a large offset is added to it, transforming the TRAP instruction (which is now known to be
|
||||
an *even* value) into a jump table index.
|
||||
The next few instructions shift the TRAP right to see if bit 0 is set, and if it is not, then the TRAP instruction
|
||||
is restored by shifting it left again, and then a large offset is added to it, transforming the TRAP instruction (which
|
||||
is now known to be an *even* value) into a jump table index.
|
||||
|
||||
The final instruction, `MOV @(SP)+,PC`, moves the address at the jump table index into PC, while also removing the TRAP
|
||||
instruction from the stack, leaving only the *previous PC* on the stack, so that when the TRAP handler is done, it can execute
|
||||
`RTS PC` to return to the caller.
|
||||
instruction from the stack, leaving only the *previous PC* on the stack, so that when the TRAP handler is done, it can
|
||||
execute `RTS PC` to return to the caller.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ PDP-11 Device Configurations
|
|||
* [Control Panels](panel/)
|
||||
* Serial Interface for Display Terminals [(DL11)](dl11/)
|
||||
* High-Speed Paper Tape Reader/Punch [(PC11)](pc11/)
|
||||
* Disk Controllers ([RK11](rk11/), [RL11](rl11/))
|
||||
* Disk Controllers ([RK11](rk11/), [RL11](rl11/), [RX11](rx11/))
|
||||
* [ROM Images](rom/)
|
||||
|
||||
Sample machines include a
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/front.xml"/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<serial id="dl11" adapter="0"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/front.xml"/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<serial id="dl11" adapter="0"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/front.xml"/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<serial id="dl11" adapter="0"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/front.xml"/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -44,3 +44,6 @@ used to control the device, such as choosing which tape should be "loaded" into
|
|||
</control>
|
||||
</device>
|
||||
```
|
||||
|
||||
For details about the PC11 hardware, we relied upon the [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf),
|
||||
p. 4-376 (p. 408 of the PDF).
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ permalink: /devices/pdp11/rk11/
|
|||
RK11 Disk Controller
|
||||
--------------------
|
||||
|
||||
The RK11 Disk Controller controls up to eight RK05 disk drives, which in turn read/write [RK03-KA](/disks/dec/rk03/)
|
||||
The RK11 Disk Controller controls up to eight RK05 disk drives, which in turn read/write [RK03](/disks/dec/rk03/)
|
||||
disk cartridges.
|
||||
|
||||
RK03 disks are single-platter cartridges with 203 tracks per side, 12 sectors per track, and a sector size of 256 words
|
||||
(512 bytes), for a total capacity of 2.38Mb (2,494,464 bytes).
|
||||
|
||||
Machines containing the [RK11 Component](/modules/pdp11/lib/rk11.js) include:
|
||||
|
||||
- [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<device id="rk11" type="rk11" autoMount='{RK0:{path:"http://archive.pcjs.org/disks/dec/rk03/RK03-XXDP.json"}}' pos="left" width="35%" padLeft="8px" padBottom="8px">
|
||||
<name>Disk Drive Controls</name>
|
||||
<device id="rk11" type="rk11" autoMountExample='{RK0:{path:"http://archive.pcjs.org/disks/dec/rk03/RK03-XXDP.json"}}' pos="left" width="35%" padLeft="8px" padBottom="8px">
|
||||
<control type="container">
|
||||
<control type="list" binding="listDrives"/>
|
||||
<control type="list" binding="listDisks">
|
||||
|
|
|
|||
|
|
@ -8,7 +8,13 @@ RL11 Disk Controller
|
|||
--------------------
|
||||
|
||||
The RL11 Disk Controller controls up to four RL01 or RL02 disk drives, which in turn read/write
|
||||
[RL01K](/disks/dec/rl01k/) or [RL02K](/disks/dec/rl02k/) disk cartridges.
|
||||
[RL01K](/disks/dec/rl01k/) or [RL02K](/disks/dec/rl02k/) disk cartridges, respectively.
|
||||
|
||||
RL01K disks are single-platter cartridges with 256 tracks per side, 40 sectors per track, and a sector size of
|
||||
256 bytes, for a total capacity of 5Mb (5,242,880 bytes).
|
||||
|
||||
RL02K disks are single-platter cartridges with 512 tracks per side, 40 sectors per track, and a sector size of
|
||||
256 bytes, for a total capacity of 10Mb (10,485,760 bytes).
|
||||
|
||||
Machines containing the [RL11 Component](/modules/pdp11/lib/pc11.js) include:
|
||||
|
||||
|
|
|
|||
175
devices/pdp11/rx11/README.md
Normal file
175
devices/pdp11/rx11/README.md
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
---
|
||||
layout: page
|
||||
title: RX11 Disk Controller
|
||||
permalink: /devices/pdp11/rx11/
|
||||
---
|
||||
|
||||
RX11 Disk Controller
|
||||
--------------------
|
||||
|
||||
The RX11 Disk Controller controls up to two RX01 disk drives, which in turn read/write 8-inch diskettes that DEC
|
||||
merely describes as "compatible with the IBM 3740 family of equipment." We refer to them simply as RX01 diskettes.
|
||||
|
||||
RX01 diskettes are single-sided, with a logical format of 77 tracks, 26 sectors per track, and a sector size of 128
|
||||
bytes, for a total capacity of 250Kb (256,256 bytes).
|
||||
|
||||
> **SIDEBAR**: DEC's [documentation](/pubs/dec/pdp11/rx11/) claims a capacity of "256K bytes", but like many disk drive
|
||||
manufacturers, they overstated the capacity by treating "K" as 1000 rather than 1024, which was its traditional meaning
|
||||
within the computer industry at the time. DEC's own processor handbooks, for example, invariably used "K" to mean 1024.
|
||||
|
||||
> Since 1998, standards organizations have been pushing the term "kibibyte" (abbreviated KiB) to mean 1024 bytes,
|
||||
in an effort to redefine the "K" in "Kilobyte" (Kb) as 1000, but that doesn't change what the term commonly meant prior
|
||||
to 1998.
|
||||
|
||||
Machines containing the [RX11 Component](/modules/pdp11/lib/rx11.js) include:
|
||||
|
||||
- [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/))
|
||||
- [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/) (with [Debugger](/devices/pdp11/machine/1170/vt100/debugger/))
|
||||
|
||||
PCjs has archived a selection of [RX01 Disk Images](/disks/dec/rx01/) for use by those machines, which are listed in
|
||||
the following RX11 Device XML file:
|
||||
|
||||
- [Default](/devices/pdp11/rx11/default.xml)
|
||||
|
||||
which is typically referenced by a Machine XML file as:
|
||||
|
||||
```xml
|
||||
<device ref="/devices/pdp11/rx11/default.xml"/>
|
||||
```
|
||||
|
||||
Device XML files not only configure a device, but also list all the resource the device will use, and define UI elements
|
||||
used to control the device, such as choosing which disks should be "auto-mounted" by the RX11 device. For example:
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<device id="rx11" type="rx11" pos="left" width="35%" padLeft="8px" padBottom="8px">
|
||||
<name>Disk Drive Controls</name>
|
||||
<control type="container">
|
||||
<control type="list" binding="listDrives"/>
|
||||
<control type="list" binding="listDisks">
|
||||
<disk id="disk01" name="RT-11 V3 SYS (1 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-1.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (2 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-2.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (3 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-3.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (4 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-4.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (5 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-5.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (6 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-6.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (7 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-7.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (8 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-8.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (9 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-9.json"/>
|
||||
</control>
|
||||
<control type="button" binding="loadDisk">Load</control>
|
||||
<control type="button" binding="bootDisk">Boot</control>
|
||||
<control type="description" binding="descDisk" padRight="8px"/>
|
||||
<control type="file" binding="mountDisk"/>
|
||||
</control>
|
||||
</device>
|
||||
```
|
||||
|
||||
Loading the RX11 Bootstrap
|
||||
--------------------------
|
||||
|
||||
From the [RT-11 v4.0 Installation Manual (March 1981)](/pubs/dec/pdp11/rt11/), p. E-9:
|
||||
|
||||
The procedure to deposit the RX11 disk bootstrap loader in memory depends on the type of processor you have.
|
||||
If your computer is a PDP-11V/03, PDP-11/03, or LSI-11, see the PDP-11/03 user's manual for instructions.
|
||||
|
||||
1. Set the ENABLE/HALT switch to HALT.
|
||||
|
||||
2. Set the first address, 010000, in the switch register (see Table E-3).
|
||||
|
||||
3. Press the LOAD ADDR switch.
|
||||
|
||||
4. Set the contents for the first address (from Table E-3) in the switch register.
|
||||
|
||||
5. Lift the DEP switch. The computer automatically advances to the next address.
|
||||
|
||||
6. Set the contents for the next address (from Table E-3) in the switch register.
|
||||
|
||||
7. Lift the DEP switch.
|
||||
|
||||
8. Repeat steps 6 and 7 until you have deposited all the instructions.
|
||||
|
||||
Now verify that you deposited the bootstrap program properly.
|
||||
|
||||
1. Set the first address, 001000, in the switch register.
|
||||
|
||||
2. Press the LOAD ADDR switch.
|
||||
|
||||
3. Press the EXAM switch to display the contents of that address in the data register.
|
||||
|
||||
4. Compare the number in the data register with the value for that address in Table E-3.
|
||||
|
||||
5. If the values are the same, press EXAM again to display the contents of the next address.
|
||||
If the values are not the same, repeat the entire procedure for depositing the bootstrap.
|
||||
Verify the contents of all the addresses in this way. If any instruction is incorrect,
|
||||
repeat the entire deposit procedure.
|
||||
|
||||
Once you have correctly deposited the bootstrap in memory, start the computer as follows:
|
||||
|
||||
1. Set the starting address, 001000, in the switch register.
|
||||
|
||||
2. Press the LOAD ADDR switch.
|
||||
|
||||
3. Set the ENABLE/HALT switch to ENABLE.
|
||||
|
||||
4. Press the START switch.
|
||||
|
||||
Table E-3: RX-11 Bootstrap Loader
|
||||
---------------------------------
|
||||
|
||||
Location Contents
|
||||
|
||||
001000 005000
|
||||
001002 012701
|
||||
001004 177170
|
||||
001006 105711
|
||||
001010 001776
|
||||
001012 012711
|
||||
001014 000003
|
||||
001016 005711
|
||||
001020 001776
|
||||
001022 100405
|
||||
001024 105711
|
||||
001026 100004
|
||||
001030 116120
|
||||
001032 000002
|
||||
001034 000770
|
||||
001036 000000
|
||||
001040 005000
|
||||
001042 000110
|
||||
|
||||
Loading the RX-11 Bootstrap Loader
|
||||
----------------------------------
|
||||
|
||||
Any PDP-11 machine using built-in PCjs Debugger makes it easy to enter the bootstrap code above. Paste
|
||||
the following commands into the Debugger's command buffer:
|
||||
|
||||
ew 1000 005000 012701 177170 105711 001776 012711 000003 005711 001776;
|
||||
ew 1022 100405 105711 100004 116120 000002 000770 000000 005000 000110;
|
||||
r pc 1000
|
||||
|
||||
You can then review (eg, disassemble) the bootstrap code:
|
||||
|
||||
>> u 1000 1044
|
||||
001000: 005000 CLR R0
|
||||
001002: 012701 177170 MOV #177170,R1
|
||||
001006: 105711 TSTB @R1
|
||||
001010: 001776 BEQ 001006
|
||||
001012: 012711 000003 MOV #3,@R1
|
||||
001016: 005711 TST @R1
|
||||
001020: 001776 BEQ 001016
|
||||
001022: 100405 BMI 001036
|
||||
001024: 105711 TSTB @R1
|
||||
001026: 100004 BPL 001040
|
||||
001030: 116120 000002 MOVB 2(R1),(R0)+
|
||||
001034: 000770 BR 001016
|
||||
001036: 000000 HALT
|
||||
001040: 005000 CLR R0
|
||||
001042: 000110 JMP @R0
|
||||
|
||||
Last but not least, make sure you have successfully loaded an RX01 diskette image into drive DX0. Then execute the
|
||||
bootstrap code with the Debugger's "g" command.
|
||||
|
||||
Of course, if the machine also includes the RX11 Boot control, then all you *really* need to is select an
|
||||
RX01 diskette, click "Load", wait for the diskette image to be successfully loaded (i.e., downloaded) and then click
|
||||
"Boot".
|
||||
22
devices/pdp11/rx11/default.xml
Normal file
22
devices/pdp11/rx11/default.xml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<device id="rx11" type="rx11" pos="left" width="35%" padLeft="8px" padBottom="8px">
|
||||
<name>Disk Drive Controls</name>
|
||||
<control type="container">
|
||||
<control type="list" binding="listDrives"/>
|
||||
<control type="list" binding="listDisks">
|
||||
<disk id="disk01" name="RT-11 V3 SYS (1 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-1.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (2 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-2.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (3 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-3.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (4 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-4.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (5 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-5.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (6 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-6.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (7 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-7.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (8 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-8.json"/>
|
||||
<disk id="disk01" name="RT-11 V3 SYS (9 OF 9)" path="http://archive.pcjs.org/disks/dec/rx01/RX01-RT11-V03-9.json"/>
|
||||
</control>
|
||||
<control type="button" binding="loadDisk">Load</control>
|
||||
<control type="button" binding="bootDisk">Boot</control>
|
||||
<control type="description" binding="descDisk" padRight="8px"/>
|
||||
<control type="file" binding="mountDisk"/>
|
||||
</control>
|
||||
</device>
|
||||
|
|
@ -12,9 +12,14 @@ The DEC disk images we have archived are organized by type:
|
|||
* [RK03](rk03/)
|
||||
* [RL01K](rl01k/)
|
||||
* [RL02K](rl02k/)
|
||||
* [RX01](rx01/)
|
||||
|
||||
RK03 (or more precisely, RK03-KA) disks are single-platter cartridges with a capacity of 2.38Mb.
|
||||
They are used in RK05 disk drives in conjunction with an [RK11 Disk Controller](/devices/pdp11/rk11/).
|
||||
|
||||
RL01K and RL02K disks are single-platter cartridges with capacities of 5Mb and 10Mb, respectively,
|
||||
They are used in RL01 and RL02 disk drives with an [RL11 Disk Controller](/devices/pdp11/rl11/).
|
||||
|
||||
RX01 diskettes are single-sided, with 77 tracks per side, 26 sectors per track, and a sector size of 128 bytes,
|
||||
for a total capacity of 250Kb (256,256 bytes). They are used in RX01 disk drives in conjunction with an
|
||||
[RX11 Disk Controller](/devices/pdp11/rx11/).
|
||||
|
|
|
|||
135
disks/dec/rx01/README.md
Normal file
135
disks/dec/rx01/README.md
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
---
|
||||
layout: page
|
||||
title: DEC RX01 Disk Images
|
||||
permalink: /disks/dec/rx01/
|
||||
---
|
||||
|
||||
DEC RX01 Disk Images
|
||||
--------------------
|
||||
|
||||
RX01 diskettes are single-sided, with 77 tracks per side, 26 sectors per track, and a sector size of 128 bytes,
|
||||
for a total capacity of 250Kb (256,256 bytes). They are used in RX01 disk drives in conjunction with an
|
||||
[RX11 Disk Controller](/devices/pdp11/rx11/).
|
||||
|
||||
Below is a summary of RX01 diskette images archived here.
|
||||
|
||||
### RT-11 V3 [[Source](http://www.headcrashers.org/comp/rx01/)]
|
||||
|
||||
#### RT-11 V3 SYS (1 OF 9)
|
||||
|
||||
DXMNSJ.SYS 86 14-Aug-77 TT .SYS 2 14-Aug-77
|
||||
DP .SYS 2 14-Aug-77 DT .SYS 2 14-Aug-77
|
||||
DX .SYS 2 14-Aug-77 RF .SYS 2 14-Aug-77
|
||||
RK .SYS 2 14-Aug-77 DM .SYS 4 14-Aug-77
|
||||
DS .SYS 2 14-Aug-77 LP .SYS 2 14-Aug-77
|
||||
NL .SYS 2 14-Aug-77 STARTS.COM 1 11-Jul-77
|
||||
PIP .SAV 16 14-Aug-77 DUP .SAV 17 14-Aug-77
|
||||
DIR .SAV 17 14-Aug-77 SYSMAC.SML 37 14-Aug-77
|
||||
EDIT .SAV 21 14-Aug-77 MACRO .SAV 45 14-Aug-77
|
||||
CREF .SAV 6 14-Aug-77 LINK .SAV 29 16-Aug-77
|
||||
LIBR .SAV 18 14-Aug-77 FILEX .SAV 18 14-Aug-77
|
||||
SRCCOM.SAV 11 14-Aug-77 DUMP .SAV 7 14-Aug-77
|
||||
PATCH .SAV 9 14-Aug-77 HELP .SAV 21 14-Aug-77
|
||||
HELP .TEC 3 23-Jun-77 HELP .TXT 73 19-Jul-77
|
||||
DEMOBG.MAC 4 01-Aug-77 DEMOFG.MAC 5 01-Aug-77
|
||||
V2USER.TXT 2 13-Jul-77
|
||||
31 Files, 468 Blocks
|
||||
12 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (2 OF 9)
|
||||
|
||||
RKMNSJ.SYS 86 14-Aug-77 RKMNFB.SYS 96 14-Aug-77
|
||||
RKMNXM.SYS 106 14-Aug-77 RKMNSJ.BL 82 14-Aug-77
|
||||
DMMNSJ.SYS 87 14-Aug-77 ODT .OBJ 9 14-Aug-77
|
||||
6 Files, 466 Blocks
|
||||
14 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (3 OF 9)
|
||||
|
||||
DPMNXM.SYS 106 14-Aug-77 RFMNSJ.SYS 86 14-Aug-77
|
||||
RFMNFB.SYS 96 14-Aug-77 RFMNXM.SYS 106 14-Aug-77
|
||||
DTX .SYS 2 14-Aug-77 DPX .SYS 2 14-Aug-77
|
||||
DXX .SYS 3 14-Aug-77 RFX .SYS 2 14-Aug-77
|
||||
RKX .SYS 2 14-Aug-77 DMX .SYS 4 14-Aug-77
|
||||
DSX .SYS 2 14-Aug-77 LPX .SYS 2 14-Aug-77
|
||||
CR .SYS 3 14-Aug-77 CRX .SYS 3 14-Aug-77
|
||||
MT .SYS 8 14-Aug-77 MTX .SYS 9 14-Aug-77
|
||||
MTHD .SYS 3 14-Aug-77 MTHDX .SYS 4 14-Aug-77
|
||||
BA .SYS 7 14-Aug-77 BAX .SYS 7 14-Aug-77
|
||||
TT .MAC 9 14-Aug-77 DEMOED.TXT 1 09-May-77
|
||||
22 Files, 467 Blocks
|
||||
13 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (4 OF 9)
|
||||
|
||||
DMMNFB.SYS 98 14-Aug-77 DMMNXM.SYS 108 14-Aug-77
|
||||
DXMNFB.SYS 97 14-Aug-77 DXMNXM.SYS 107 14-Aug-77
|
||||
SYE .SAV 50 14-Aug-77 NLX .SYS 2 14-Aug-77
|
||||
PC .SYS 2 14-Aug-77 PCX .SYS 2 14-Aug-77
|
||||
DEMOF1.FOR 2 28-Jan-77
|
||||
9 Files, 468 Blocks
|
||||
12 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (5 OF 9)
|
||||
|
||||
DXMNSJ.BL 83 14-Aug-77 DTMNSJ.SYS 86 14-Aug-77
|
||||
DTMNFB.SYS 96 14-Aug-77 DTMNSJ.BL 82 14-Aug-77
|
||||
DSMNSJ.SYS 86 14-Aug-77 RF .MAC 6 14-Aug-77
|
||||
DM .MAC 19 14-Aug-77 DEMOSP.MAC 11 01-Aug-77
|
||||
8 Files, 469 Blocks
|
||||
11 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (6 OF 9)
|
||||
|
||||
DSMNFB.SYS 96 14-Aug-77 DSMNXM.SYS 106 14-Aug-77
|
||||
DPMNSJ.SYS 86 14-Aug-77 DPMNFB.SYS 97 14-Aug-77
|
||||
DP .MAC 9 14-Aug-77 MUBRTE.OBJ 1 04-May-77
|
||||
MUBTAB.OBJ 1 04-May-77 MUBZN1.OBJ 1 04-May-77
|
||||
CT .MAC 32 14-Aug-77 TM .MAC 24 14-Aug-77
|
||||
MMHD .SYS 4 14-Aug-77 MMHDX .SYS 4 14-Aug-77
|
||||
PAT .SAV 7 14-Aug-77
|
||||
13 Files, 468 Blocks
|
||||
12 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (7 OF 9)
|
||||
|
||||
KMON .MAC 118 14-Aug-77 USR .MAC 59 14-Aug-77
|
||||
RMONSJ.MAC 56 14-Aug-77 RMONFB.MAC 138 14-Aug-77
|
||||
EL .MAC 18 14-Aug-77 LP .MAC 7 14-Aug-77
|
||||
RK .MAC 7 14-Aug-77 DT .MAC 7 14-Aug-77
|
||||
DS .MAC 7 14-Aug-77 PC .MAC 6 14-Aug-77
|
||||
ERRUTL.SAV 6 14-Aug-77 MACFST.SAV 45 14-Aug-77
|
||||
12 Files, 474 Blocks
|
||||
6 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (8 OF 9)
|
||||
|
||||
KMOVLY.MAC 153 14-Aug-77 BSTRAP.MAC 41 14-Aug-77
|
||||
MTTEMT.MAC 18 16-Aug-77 MTTINT.MAC 34 14-Aug-77
|
||||
TJ .MAC 28 14-Aug-77 NL .MAC 3 14-Aug-77
|
||||
DX .MAC 11 14-Aug-77 CR .MAC 14 14-Aug-77
|
||||
FSM .MAC 31 14-Aug-77 BATCH .MAC 98 14-Aug-77
|
||||
MUBET1.OBJ 1 04-May-77 MUBXT1.OBJ 1 04-May-77
|
||||
MUBZ1 .OBJ 1 04-May-77 MUBS1D.OBJ 1 04-May-77
|
||||
MUBLNK.COM 1 04-May-77 MM .SYS 9 14-Aug-77
|
||||
MMX .SYS 9 14-Aug-77 BA .MAC 19 14-Aug-77
|
||||
18 Files, 473 Blocks
|
||||
7 Free blocks
|
||||
|
||||
#### RT-11 V3 SYS (9 OF 9)
|
||||
|
||||
SYSMAC.MAC 36 01-Aug-77 BATCH .SAV 25 14-Aug-77
|
||||
MAC8K .SAV 52 14-Aug-77 PSE .SAV 13 14-Aug-77
|
||||
SYSGEN.SAV 32 14-Aug-77 SYSGEN.CND 83 08-Aug-77
|
||||
SYSTBL.CND 26 08-Aug-77 VTMAC .MAC 7 01-Aug-77
|
||||
VTHDLR.OBJ 8 14-Aug-77 SYSF4 .OBJ 39 14-Aug-77
|
||||
MDUP .SAV 9 14-Aug-77 MDUP .MM 48 14-Aug-77
|
||||
MDUP .MT 48 14-Aug-77 MBOOT .BOT 1 14-Aug-77
|
||||
MSBOOT.BOT 3 14-Aug-77 STARTF.COM 1 10-Jun-77
|
||||
STARTX.COM 1 10-Jun-77 SJ .MAC 1 01-Aug-77
|
||||
FB .MAC 1 01-Aug-77 XM .MAC 1 01-Aug-77
|
||||
SYSDEV.MAC 1 24-Sep-76 CT .SYS 5 14-Aug-77
|
||||
CTX .SYS 6 14-Aug-77 TECO .SAV 27 14-Aug-77
|
||||
DEMOX1.MAC 5 01-Aug-77
|
||||
25 Files, 479 Blocks
|
||||
1 Free blocks
|
||||
|
|
@ -44,10 +44,10 @@
|
|||
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
|
||||
*/
|
||||
var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||
var da={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]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];fa[191]=n["?"];
|
||||
fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"];
|
||||
var da={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],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,
|
||||
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];
|
||||
fa[191]=n["?"];fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"];
|
||||
function ga(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ha(a,b){var c,d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function ia(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=ha(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
|
||||
function ja(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function q(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function r(a){return q(a,2,!0)}function ka(a){return q(a,4,!0)}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@
|
|||
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
|
||||
*/
|
||||
var k,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||
var da={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]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];p[192]=n["~"];p[219]=n["{"];
|
||||
p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
|
||||
var da={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],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,
|
||||
y:121,z:122,"{":123,"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];
|
||||
p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
|
||||
function fa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ga(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
|
||||
function ia(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ja(a,b){return-1!==a.indexOf(b,a.length-b.length)}function ka(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function ma(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
|
|
|
|||
|
|
@ -1410,7 +1410,7 @@ class ComputerPDP11 extends Component {
|
|||
this.fReload = false;
|
||||
} else {
|
||||
this.reset();
|
||||
if (this.cpu) this.cpu.autoStart();
|
||||
if (this.cpu && !this.dbg) this.cpu.autoStart();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -567,13 +567,15 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
}
|
||||
|
||||
/**
|
||||
* setReset(addr, fStart)
|
||||
* setReset(addr, fStart, bUnit, addrStack)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @param {boolean|undefined} fStart (true if a "startable" image was just loaded, false if not)
|
||||
* @param {boolean} [fStart] (true if a "startable" image was just loaded, false if not)
|
||||
* @param {number} [bUnit] (boot unit #)
|
||||
* @param {number} [addrStack]
|
||||
*/
|
||||
setReset(addr, fStart)
|
||||
setReset(addr, fStart, bUnit, addrStack)
|
||||
{
|
||||
this.addrReset = addr;
|
||||
|
||||
|
|
@ -583,18 +585,16 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
this.resetCPU();
|
||||
|
||||
if (fStart) {
|
||||
/*
|
||||
* TODO: Review. I'm zeroing R2-R5 in the fStart case (ie, for boot code) simply because that's what I
|
||||
* saw the PDP-11 Boot Monitor doing (see /apps/pdp11/boot/monitor/BOOTMON.mac).
|
||||
*/
|
||||
for (var i = 2; i <= 5; i++) {
|
||||
this.regsGen[i] = 0;
|
||||
}
|
||||
if (!this.flags.powered) {
|
||||
this.flags.autoStart = true;
|
||||
}
|
||||
else if (!this.flags.running) {
|
||||
this.startCPU();
|
||||
this.regsGen[0] = bUnit || 0;
|
||||
for (var i = 1; i <= 5; i++) this.regsGen[i] = 0;
|
||||
this.regsGen[6] = addrStack || 0o2000;
|
||||
if (!this.dbg) {
|
||||
if (!this.flags.powered) {
|
||||
this.flags.autoStart = true;
|
||||
}
|
||||
else if (!this.flags.running) {
|
||||
this.startCPU();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -2870,6 +2870,7 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
data = (data < 0? (this.regsGen[-data-1] & 0xff): data);
|
||||
this.regsGen[reg] = (this.regsGen[reg] & ~writeFlags) | (((data << 24) >> 24) & writeFlags);
|
||||
}
|
||||
//noinspection JSUnresolvedFunction
|
||||
fnFlags.call(this, data << 8);
|
||||
} else {
|
||||
var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE);
|
||||
|
|
|
|||
|
|
@ -513,6 +513,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)
|
||||
RXCS: 0o177170, // RX11 Command and Status Register
|
||||
RXDB: 0o177172, // RX11 Data Buffer Register
|
||||
RKDS: 0o177400, // RK11 Drive Status Register
|
||||
RKER: 0o177402, // RK11 Error Register
|
||||
RKCS: 0o177404, // RK11 Control Status Register
|
||||
|
|
@ -662,29 +664,28 @@ var PDP11 = {
|
|||
RVEC: 0o070, // reader vector
|
||||
PVEC: 0o074, // punch vector
|
||||
PRS: { // 177550: PC11 (and PR11) Reader Status Register
|
||||
RE: 0x0001, // Reader Enable (W/O)
|
||||
RIE: 0x0040, // Reader Interrupt Enable (allows the DONE and ERROR bits to trigger an interrupt)
|
||||
DONE: 0x0080, // Done (R/O)
|
||||
BUSY: 0x0800, // Busy (R/O)
|
||||
ERROR: 0x8000, // Error (R/O)
|
||||
CLEAR: 0x08C0, // bits cleared on INIT
|
||||
RMASK: 0xFFFE, // bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readPRS())
|
||||
WMASK: 0x0041, // bits writable
|
||||
RE: 0x0001, // (000001) Reader Enable (W/O)
|
||||
IE: 0x0040, // (000100) Reader Interrupt Enable (allows the DONE and ERROR bits to trigger an interrupt)
|
||||
DONE: 0x0080, // (000200) Done (R/O)
|
||||
BUSY: 0x0800, // (004000) Busy (R/O)
|
||||
ERROR: 0x8000, // (100000) Error (R/O)
|
||||
CLEAR: 0x08C0, // (004300) bits cleared on INIT
|
||||
RMASK: 0xFFFE, // (177776) bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readPRS())
|
||||
WMASK: 0x0041, // (000101) bits writable
|
||||
BAUD: 3600
|
||||
},
|
||||
PRB: { // 177552: PC11 (and PR11) Reader Buffer Register
|
||||
MASK: 0x00FF // Data
|
||||
},
|
||||
PPS: { // 177554: PC11 Punch Status Register
|
||||
/*
|
||||
* TODO: Flesh this out if/when we add Paper Tape Punch support
|
||||
*/
|
||||
IE: 0x0040, // Interrupt Enable
|
||||
RDY: 0x0080, // Ready
|
||||
ERROR: 0x8000, // Error (eg, no tape in punch, or punch has no power)
|
||||
WMASK: 0x0040, // bits writable
|
||||
BAUD: 600
|
||||
},
|
||||
PPB: { // 177556: PC11 Punch Buffer Register
|
||||
/*
|
||||
* TODO: Flesh this out if/when we add Paper Tape Punch support
|
||||
*/
|
||||
MASK: 0x00FF // Data
|
||||
}
|
||||
},
|
||||
RK11: { // RK11 Disk Controller
|
||||
|
|
@ -738,7 +739,7 @@ var PDP11 = {
|
|||
SCP: 0x2000, // (020000) Search Complete (R/O)
|
||||
HE: 0x4000, // (040000) Hard Error (R/O)
|
||||
ERR: 0x8000, // (100000) Composite Error (R/O) (set when any RKER bit is set)
|
||||
UNUSED: 0x1200, // (120000) unused
|
||||
UNUSED: 0x1200, // (011000) unused
|
||||
RMASK: 0xEFFE, // (167776) bits readable
|
||||
WMASK: 0x0F7F, // (007577) bits writable
|
||||
SHIFT: {
|
||||
|
|
@ -772,6 +773,7 @@ var PDP11 = {
|
|||
PRI: 5,
|
||||
VEC: 0o160,
|
||||
DRIVES: 4, // maximum of 4 drives
|
||||
PREFIX: "DY",
|
||||
RLCS: { // 174400: Control Status Register
|
||||
DRDY: 0x0001, // Drive Ready (R/O)
|
||||
FUNC: 0x000E, // Function Code (F2,F1,F0) (R/W)
|
||||
|
|
@ -865,6 +867,76 @@ var PDP11 = {
|
|||
RDNC: 0b1110 // Read Data without Header Check
|
||||
}
|
||||
},
|
||||
RX11: { // RX11 Disk Controller
|
||||
PRI: 5,
|
||||
VEC: 0o264,
|
||||
DRIVES: 2, // maximum of 2 drives
|
||||
PREFIX: "DX",
|
||||
RXCS: { // 177170: Command and Status Register
|
||||
GO: 0x0001, // (000001) Go (W/O)
|
||||
FUNC: 0x000E, // (000016) Function Code (F2,F1,F0) (W/O)
|
||||
UNIT: 0x0010, // (000020) Unit Select (W/O)
|
||||
DONE: 0x0020, // (000040) Done (R/O)
|
||||
IE: 0x0040, // (000100) Interrupt Enable (R/W, cleared on INIT)
|
||||
TR: 0x0080, // (000200) Transfer Request (R/O)
|
||||
INIT: 0x4000, // (040000) RX11 Initialize (W/O)
|
||||
ERR: 0x8000, // (100000) Error (R/O, cleared on INIT or command)
|
||||
UNUSED: 0x3F00, // (037400) unused
|
||||
RMASK: 0x80E0, // (100340) bits readable
|
||||
WMASK: 0x405F // (040137) bits writable
|
||||
},
|
||||
RXDB: { // 177172: Data Buffer Register
|
||||
},
|
||||
RXTA: {
|
||||
MASK: 0x007F
|
||||
},
|
||||
RXSA: {
|
||||
MASK: 0x001F
|
||||
},
|
||||
RXES: {
|
||||
/*
|
||||
* The DRDY bit is only valid when retrieved via a Read Status function or at completion of Initialize when it indicates
|
||||
* status of drive O. It is asserted if the unit currently selected exists, is properly supplied with power, has a diskette
|
||||
* installed correctly, has its door closed, and has a diskette up to speed.
|
||||
*
|
||||
* If the Error bit was set in the RXCS but Error bits are not set in the RXES, then specific error conditions can be accessed via
|
||||
* a Read Error Register function.
|
||||
*/
|
||||
CRC: 0x0001, // CRC error (RXES is moved to the RXDB, and Error and Done are asserted)
|
||||
PARITY: 0x0002, // parity error (RXES is moved to the RXDB, and Error and Done are asserted)
|
||||
ID: 0x0004, // Initialize Done (following a programmable or UNIBUS initialization, or a power failure)
|
||||
DEL: 0x0040, // Deleted Data Detected
|
||||
DRDY: 0x0080 // Drive Ready
|
||||
},
|
||||
FUNC: { // NOTE: These function codes are pre-shifted to read/write directly from/to RXCS.FUNC
|
||||
FILL: 0b0000, // Fill Buffer
|
||||
EMPTY: 0b0010, // Empty Buffer
|
||||
WRITE: 0b0100, // Write Sector
|
||||
READ: 0b0110, // Read Sector
|
||||
UNUSED: 0b1000, // UNUSED
|
||||
RDSTAT: 0b1010, // Read Status
|
||||
WRDEL: 0b1100, // Write Deleted Data Sector
|
||||
RDERR: 0b1110 // Read Error Register
|
||||
},
|
||||
ERROR: {
|
||||
HOME0: 0o0010, // Drive 0 failed to see home on Initialize
|
||||
HOME1: 0o0020, // Drive 1 failed to see home on Initialize
|
||||
BAD_HOME: 0o0030, // Found home when stepping out 10 tracks for INIT
|
||||
NO_TRACK: 0o0040, // Tried to access a track greater than 77
|
||||
FOUND_HOME: 0o0050, // Home was found before desired track was reached
|
||||
SELF_DIAG: 0o0060, // Self-diagnostic error
|
||||
NO_SECTOR: 0o0070, // Desired sector could not be found after looking at 52 headers (2 revolutions)
|
||||
NO_SEP: 0o0110, // More than 40us and no SEP clock seen
|
||||
NO_PREAM: 0o0120, // A preamble could not be found
|
||||
NO_IOMARK: 0o0130, // Preamble found but no I/O mark found within allowable time span
|
||||
CRC_HEADER: 0o0140, // CRC error on what we thought was a header
|
||||
BAD_TRACK: 0o0150, // The header track address of a good header does not compare with the desired track
|
||||
NO_ID: 0o0160, // Too many tries for an IDAM (identifies header)
|
||||
NO_DATA: 0o0170, // Data AM not found in allotted time
|
||||
CRC_DATA: 0o0200, // CRC error on reading the sector from the disk (No code appears in the ERREG).
|
||||
BAD_PARITY: 0o0210 // All parity errors
|
||||
}
|
||||
},
|
||||
VECTORS: {
|
||||
0o060: "DL11R",
|
||||
0o064: "DL11X",
|
||||
|
|
@ -872,12 +944,31 @@ var PDP11 = {
|
|||
0o074: "PC11X",
|
||||
0o100: "KW11",
|
||||
0o160: "RL11",
|
||||
0o220: "RK11"
|
||||
0o220: "RK11",
|
||||
0o264: "RX11"
|
||||
}
|
||||
};
|
||||
|
||||
PDP11.RK11.RK05 = [203, 2, 12, 512, PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY];
|
||||
PDP11.RL11.RL02K = [512, 2, 40, 256, PDP11.RL11.RLMP.GS_ST.LOCKON | PDP11.RL11.RLMP.GS_BH | PDP11.RL11.RLMP.GS_HO];
|
||||
PDP11.RX11.RX01 = [
|
||||
"DX",
|
||||
77, 1, 26, 128, // disk geometry (CHSN: cylinders, heads, sectors/track, and bytes/sector)
|
||||
1, 0, 0, 128, // boot code location (cylinder, head, sector index (NOT sector number), and number of bytes)
|
||||
0 // default drive status
|
||||
];
|
||||
|
||||
PDP11.RK11.RK05 = [
|
||||
"RK",
|
||||
203, 2, 12, 512, // disk geometry (CHSN: cylinders, heads, sectors/track, and bytes/sector)
|
||||
0, 0, 0, 512, // boot code location (cylinder, head, sector index (NOT sector number), and number of bytes)
|
||||
PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY
|
||||
];
|
||||
|
||||
PDP11.RL11.RL02K = [
|
||||
"RL",
|
||||
512, 2, 40, 256, // disk geometry (CHSN: cylinders, heads, sectors/track, and bytes/sector)
|
||||
0, 0, 0, 256, // boot code location (cylinder, head, sector index (NOT sector number), and number of bytes)
|
||||
PDP11.RL11.RLMP.GS_ST.LOCKON | PDP11.RL11.RLMP.GS_BH | PDP11.RL11.RLMP.GS_HO
|
||||
];
|
||||
|
||||
PDP11.ACCESS.READ_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.READ; // formerly READ_MODE (2)
|
||||
PDP11.ACCESS.READ_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.READ; // formerly READ_MODE (2) | BYTE_MODE (1)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ if (NODE) {
|
|||
var PC11 = require("./pc11");
|
||||
var RL11 = require("./rl11");
|
||||
var RK11 = require("./rk11");
|
||||
var RX11 = require("./rx11");
|
||||
}
|
||||
|
||||
class DevicePDP11 extends Component {
|
||||
|
|
@ -1204,6 +1205,10 @@ class DevicePDP11 extends Component {
|
|||
device = new RK11(parmsDevice);
|
||||
Component.bindComponentControls(device, eDevice, PDP11.APPCLASS);
|
||||
break;
|
||||
case 'rx11':
|
||||
device = new RX11(parmsDevice);
|
||||
Component.bindComponentControls(device, eDevice, PDP11.APPCLASS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -376,7 +376,8 @@ class DriveController extends Component {
|
|||
*/
|
||||
getDriveName(iDrive)
|
||||
{
|
||||
return this.type.substr(0, 2) + iDrive;
|
||||
var drive = this.aDrives[iDrive];
|
||||
return drive.sName || "---";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -554,11 +555,16 @@ class DriveController extends Component {
|
|||
* NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have
|
||||
* these or SMALLER values (subject to the limits of what the controller supports, of course).
|
||||
*/
|
||||
drive.nCylinders = configDrive[0];
|
||||
drive.nHeads = configDrive[1];
|
||||
drive.nSectors = configDrive[2];
|
||||
drive.cbSector = configDrive[3];
|
||||
drive.status = configDrive[4];
|
||||
drive.sName = configDrive[i++] + iDrive;
|
||||
drive.nCylinders = configDrive[i++];
|
||||
drive.nHeads = configDrive[i++];
|
||||
drive.nSectors = configDrive[i++];
|
||||
drive.cbSector = configDrive[i++];
|
||||
drive.iCylinderBoot = configDrive[i++];
|
||||
drive.iHeadBoot = configDrive[i++];
|
||||
drive.iSectorBoot = configDrive[i++];
|
||||
drive.cbSectorBoot = configDrive[i++];
|
||||
drive.status = configDrive[i++];
|
||||
|
||||
/*
|
||||
* The next group of properties are set by various controller command sequences.
|
||||
|
|
@ -720,9 +726,9 @@ class DriveController extends Component {
|
|||
{
|
||||
if (!fRemount) this.cAutoMount = 0;
|
||||
for (var sDrive in this.configMount) {
|
||||
var configDrive = this.configMount[sDrive];
|
||||
var sDiskPath = configDrive['path'] || "";
|
||||
var sDiskName = configDrive['name'] || this.findDisk(sDiskPath);
|
||||
var configDisk = this.configMount[sDrive];
|
||||
var sDiskPath = configDisk['path'] || "";
|
||||
var sDiskName = configDisk['name'] || this.findDisk(sDiskPath);
|
||||
if (sDiskPath && sDiskName) {
|
||||
var iDrive = this.getDriveNumber(sDrive);
|
||||
if (iDrive >= 0 && iDrive < this.aDrives.length) {
|
||||
|
|
@ -732,7 +738,7 @@ class DriveController extends Component {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDrive) + ")");
|
||||
this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDisk) + ")");
|
||||
}
|
||||
return !!this.cAutoMount;
|
||||
}
|
||||
|
|
@ -814,8 +820,8 @@ class DriveController extends Component {
|
|||
* expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler,
|
||||
* a READY state is assured, and the readData() call shouldn't do anything to change that.
|
||||
*/
|
||||
this.cpu.setReset(0, true);
|
||||
var err = this.readData(drive, 0, 0, 0, 512, 0x0000, 2);
|
||||
this.cpu.setReset(0, true, iDrive);
|
||||
var err = this.readData(drive, drive.iCylinderBoot, drive.iHeadBoot, drive.iSectorBoot, drive.cbSectorBoot, 0x0000, 2);
|
||||
if (err) {
|
||||
this.notice("Unable to read the boot sector (" + err + ")");
|
||||
}
|
||||
|
|
@ -914,6 +920,11 @@ class DriveController extends Component {
|
|||
drive.sDiskName = sDiskName;
|
||||
drive.sDiskPath = sDiskPath;
|
||||
|
||||
/*
|
||||
* Inform the controller implementation (eg, RX11) of the disk change.
|
||||
*/
|
||||
this.notifyLoad(drive.iDrive);
|
||||
|
||||
/*
|
||||
* Adding local disk image names to the disk list seems like a nice idea, but it's too confusing,
|
||||
* because then it looks like the "Mount" button should be able to (re)load them, and that can NEVER
|
||||
|
|
@ -1117,6 +1128,11 @@ class DriveController extends Component {
|
|||
this.sDiskSource = DriveController.SOURCE.NONE;
|
||||
this.displayDisk(iDrive);
|
||||
}
|
||||
|
||||
/*
|
||||
* Inform the controller implementation (eg, RX11) of the disk removal.
|
||||
*/
|
||||
this.notifyUnload(iDrive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1217,10 +1233,34 @@ class DriveController extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* notifyLoad(iDrive)
|
||||
*
|
||||
* Placeholder for subclasses. Called whenever DriveController has loaded a new disk into the specified drive.
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} iDrive
|
||||
*/
|
||||
notifyLoad(iDrive)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* notifyUnload(iDrive)
|
||||
*
|
||||
* Placeholder for subclasses. Called whenever DriveController has unloaded a disk from the specified drive.
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} iDrive
|
||||
*/
|
||||
notifyUnload(iDrive)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
*
|
||||
* Placeholder for subclasses.
|
||||
* Placeholder for subclasses. Implementation is optional, but the automatic BOOT feature will be unavailable.
|
||||
*
|
||||
* @this {DriveController}
|
||||
* @param {Object} drive
|
||||
|
|
@ -1236,13 +1276,13 @@ class DriveController extends Component {
|
|||
*/
|
||||
readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
*
|
||||
* Placeholder for subclasses.
|
||||
* Placeholder for subclasses. Implementation is optional.
|
||||
*
|
||||
* @this {DriveController}
|
||||
* @param {Object} drive
|
||||
|
|
@ -1258,7 +1298,7 @@ class DriveController extends Component {
|
|||
*/
|
||||
writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,10 +48,11 @@ var MessagesPDP11 = {
|
|||
WRITE: 0x00008000,
|
||||
RK11: 0x00010000,
|
||||
RL11: 0x00020000,
|
||||
DL11: 0x00040000,
|
||||
SERIAL: 0x00040000,
|
||||
KW11: 0x00080000,
|
||||
TIMER: 0x00080000,
|
||||
RX11: 0x00040000,
|
||||
DL11: 0x00100000,
|
||||
SERIAL: 0x00100000,
|
||||
KW11: 0x00200000,
|
||||
TIMER: 0x00200000,
|
||||
SPEAKER: 0x01000000,
|
||||
COMPUTER: 0x02000000,
|
||||
LOG: 0x10000000,
|
||||
|
|
@ -94,6 +95,7 @@ MessagesPDP11.CATEGORIES = {
|
|||
"write": MessagesPDP11.WRITE,
|
||||
"rk11": MessagesPDP11.RK11,
|
||||
"rl11": MessagesPDP11.RL11,
|
||||
"rx11": MessagesPDP11.RX11,
|
||||
"dl11": MessagesPDP11.DL11,
|
||||
"serial": MessagesPDP11.SERIAL,
|
||||
"kw11": MessagesPDP11.KW11,
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ class PC11 extends Component {
|
|||
*/
|
||||
constructor(parms)
|
||||
{
|
||||
super("PC11", parms);
|
||||
super("PC11", parms, MessagesPDP11.PC11);
|
||||
|
||||
this.sDevice = "PTR"; // TODO: Make the device name configurable
|
||||
this.sDevice = "PTR"; // TODO: Make the device name configurable
|
||||
|
||||
/*
|
||||
* We preliminarily parse and record any 'autoMount' object now, but we no longer process it
|
||||
|
|
@ -76,10 +76,12 @@ class PC11 extends Component {
|
|||
this.cAutoMount = 0;
|
||||
this.nBaudReceive = +parms['baudReceive'] || PDP11.PC11.PRS.BAUD;
|
||||
|
||||
this.regPRS = 0; // PRS register
|
||||
this.regPRB = 0; // PRB register
|
||||
this.iTapeData = 0; // buffer index
|
||||
this.aTapeData = []; // buffer for the PRB register
|
||||
this.regPRS = 0; // PRS register
|
||||
this.regPRB = 0; // PRB register
|
||||
this.regPPS = PDP11.PC11.PPS.ERROR; // PPS register (TODO: Stop signaling error once punch is implemented)
|
||||
this.regPPB = 0; // PPB register
|
||||
this.iTapeData = 0; // buffer index
|
||||
this.aTapeData = []; // buffer for the PRB register
|
||||
this.sTapeSource = PC11.SOURCE.NONE;
|
||||
this.nTapeTarget = PC11.TARGET.NONE;
|
||||
this.sTapeName = this.sTapePath = "";
|
||||
|
|
@ -434,6 +436,7 @@ class PC11 extends Component {
|
|||
loadTape(sTapeName, sTapePath, nTapeTarget, fAutoMount, file)
|
||||
{
|
||||
var nResult = -1;
|
||||
|
||||
if (this.sTapePath.toLowerCase() != sTapePath.toLowerCase() || this.nTapeTarget != nTapeTarget) {
|
||||
|
||||
nResult++;
|
||||
|
|
@ -493,7 +496,7 @@ class PC11 extends Component {
|
|||
pc11.finishRead(sTapeName, sTapePath, nTapeTarget, reader.result);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -579,6 +582,7 @@ class PC11 extends Component {
|
|||
this.parseTape(sTapeName, sTapePath, nTapeTarget, aBytes);
|
||||
this.sTapeSource = PC11.SOURCE.LOCAL;
|
||||
}
|
||||
this.flags.busy = false;
|
||||
this.displayTape();
|
||||
}
|
||||
|
||||
|
|
@ -724,9 +728,12 @@ class PC11 extends Component {
|
|||
this.status('Read tape "' + sTapeName + '"');
|
||||
return;
|
||||
}
|
||||
|
||||
this.iTapeData = 0;
|
||||
this.aTapeData = aBytes;
|
||||
this.status('Loaded tape "' + sTapeName + '"');
|
||||
this.regPRS &= ~PDP11.PC11.PRS.ERROR;
|
||||
|
||||
this.status('Loaded tape "' + sTapeName + '" (' + aBytes.length + " bytes)");
|
||||
this.displayProgress(0);
|
||||
}
|
||||
|
||||
|
|
@ -820,13 +827,18 @@ class PC11 extends Component {
|
|||
* (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask
|
||||
* the data assigned to PRB with 0xff.
|
||||
*/
|
||||
this.regPRB = this.aTapeData[this.iTapeData++] & 0xff;
|
||||
this.regPRB = this.aTapeData[this.iTapeData] & 0xff;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".advanceReader(" + this.iTapeData + "): " + Str.toHexByte(this.regPRB), true);
|
||||
this.iTapeData++;
|
||||
this.displayProgress(this.iTapeData / this.aTapeData.length * 100);
|
||||
this.regPRS |= PDP11.PC11.PRS.DONE;
|
||||
this.regPRS &= ~PDP11.PC11.PRS.BUSY;
|
||||
if (this.regPRS & PDP11.PC11.PRS.RIE) {
|
||||
this.cpu.setIRQ(this.irqReader);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.regPRS |= PDP11.PC11.PRS.ERROR;
|
||||
}
|
||||
this.regPRS |= PDP11.PC11.PRS.DONE;
|
||||
this.regPRS &= ~PDP11.PC11.PRS.BUSY;
|
||||
if (this.regPRS & PDP11.PC11.PRS.IE) {
|
||||
this.cpu.setIRQ(this.irqReader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -868,7 +880,7 @@ class PC11 extends Component {
|
|||
*/
|
||||
if (this.regPRS & PDP11.PC11.PRS.ERROR) {
|
||||
data &= ~PDP11.PC11.PRS.RE;
|
||||
if (this.regPRS & PDP11.PC11.PRS.RIE) {
|
||||
if (this.regPRS & PDP11.PC11.PRS.IE) {
|
||||
this.cpu.setIRQ(this.irqReader);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -914,6 +926,63 @@ class PC11 extends Component {
|
|||
writePRB(data, addr)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* readPPS(addr)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.PPS or 177554)
|
||||
* @return {number}
|
||||
*/
|
||||
readPPS(addr)
|
||||
{
|
||||
return this.regPPS;
|
||||
}
|
||||
|
||||
/**
|
||||
* writePPS(data, addr)
|
||||
*
|
||||
* NOTE: This was originally added ONLY because when RT-11 v4.0 copies from device "PC:" (the paper tape reader),
|
||||
* it executes the following code:
|
||||
*
|
||||
* 016010: 005037 177550 CLR @#177550 ;history=2 PRS
|
||||
* 016014: 005037 177554 CLR @#177554 ;history=1
|
||||
*
|
||||
* and as you can see, without this PPS handler, a TRAP to 4 would normally occur. I guess since we claim to be
|
||||
* a PC11, that makes sense. But what about PDP-11 machines with only a PR11 (ie, a reader-only unit)?
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {number} data
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.PPS or 177554)
|
||||
*/
|
||||
writePPS(data, addr)
|
||||
{
|
||||
this.regPPS = (this.regPPS & ~PDP11.PC11.PPS.WMASK) | (data & PDP11.PC11.PPS.WMASK);
|
||||
}
|
||||
|
||||
/**
|
||||
* readPPB(addr)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.PPB or 177556)
|
||||
* @return {number}
|
||||
*/
|
||||
readPPB(addr)
|
||||
{
|
||||
return this.regPPB;
|
||||
}
|
||||
|
||||
/**
|
||||
* writePPB(data, addr)
|
||||
*
|
||||
* @this {PC11}
|
||||
* @param {number} data
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.PPB or 177556)
|
||||
*/
|
||||
writePPB(data, addr)
|
||||
{
|
||||
this.regPPB = (data & PDP11.PC11.PPB.MASK);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -944,7 +1013,9 @@ PC11.CSSCLASS = {
|
|||
*/
|
||||
PC11.UNIBUS_IOTABLE = {
|
||||
[PDP11.UNIBUS.PRS]: /* 177550 */ [null, null, PC11.prototype.readPRS, PC11.prototype.writePRS, "PRS"],
|
||||
[PDP11.UNIBUS.PRB]: /* 177552 */ [null, null, PC11.prototype.readPRB, PC11.prototype.writePRB, "PRB"]
|
||||
[PDP11.UNIBUS.PRB]: /* 177552 */ [null, null, PC11.prototype.readPRB, PC11.prototype.writePRB, "PRB"],
|
||||
[PDP11.UNIBUS.PPS]: /* 177554 */ [null, null, PC11.prototype.readPPS, PC11.prototype.writePPS, "PPS"],
|
||||
[PDP11.UNIBUS.PPB]: /* 177556 */ [null, null, PC11.prototype.readPPB, PC11.prototype.writePPB, "PPB"]
|
||||
};
|
||||
|
||||
if (NODE) module.exports = PC11;
|
||||
|
|
|
|||
|
|
@ -230,12 +230,12 @@ class RK11 extends DriveController {
|
|||
*/
|
||||
readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
var err = 0;
|
||||
var nError = 0;
|
||||
var disk = drive.disk;
|
||||
var sector = null, ibSector;
|
||||
|
||||
if (!disk) {
|
||||
err = RK11.RKER.NXD;
|
||||
nError = RK11.RKER.NXD;
|
||||
nWords = 0;
|
||||
}
|
||||
|
||||
|
|
@ -243,12 +243,12 @@ class RK11 extends DriveController {
|
|||
while (nWords) {
|
||||
if (!sector) {
|
||||
if (iCylinder >= disk.nCylinders) {
|
||||
err = RK11.RKER.NXC;
|
||||
nError = RK11.RKER.NXC;
|
||||
break;
|
||||
}
|
||||
sector = disk.seek(iCylinder, iHead, iSector + 1);
|
||||
if (!sector) {
|
||||
err = RK11.RKER.SKE;
|
||||
nError = RK11.RKER.SKE;
|
||||
break;
|
||||
}
|
||||
ibSector = 0;
|
||||
|
|
@ -262,7 +262,7 @@ class RK11 extends DriveController {
|
|||
}
|
||||
var b0, b1;
|
||||
if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) {
|
||||
err = RK11.RKER.NXS;
|
||||
nError = RK11.RKER.NXS;
|
||||
break;
|
||||
}
|
||||
if (!fCheck) {
|
||||
|
|
@ -277,7 +277,7 @@ class RK11 extends DriveController {
|
|||
}
|
||||
}
|
||||
if (this.bus.checkFault()) {
|
||||
err = RK11.RKER.NXM;
|
||||
nError = RK11.RKER.NXM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ class RK11 extends DriveController {
|
|||
addr += inc;
|
||||
nWords--;
|
||||
}
|
||||
return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err;
|
||||
return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -305,29 +305,29 @@ class RK11 extends DriveController {
|
|||
*/
|
||||
writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
var err = 0;
|
||||
var nError = 0;
|
||||
var disk = drive.disk;
|
||||
var sector = null, ibSector;
|
||||
|
||||
if (!disk) {
|
||||
err = RK11.RKER.NXD;
|
||||
nError = RK11.RKER.NXD;
|
||||
nWords = 0;
|
||||
}
|
||||
|
||||
while (nWords) {
|
||||
var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr));
|
||||
if (this.bus.checkFault()) {
|
||||
err = RK11.RKER.NXM;
|
||||
nError = RK11.RKER.NXM;
|
||||
break;
|
||||
}
|
||||
if (!sector) {
|
||||
if (iCylinder >= disk.nCylinders) {
|
||||
err = RK11.RKER.NXC;
|
||||
nError = RK11.RKER.NXC;
|
||||
break;
|
||||
}
|
||||
sector = disk.seek(iCylinder, iHead, iSector + 1, true);
|
||||
if (!sector) {
|
||||
err = RK11.RKER.SKE;
|
||||
nError = RK11.RKER.SKE;
|
||||
break;
|
||||
}
|
||||
ibSector = 0;
|
||||
|
|
@ -342,7 +342,7 @@ class RK11 extends DriveController {
|
|||
if (fCheck) {
|
||||
var b0, b1;
|
||||
if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) {
|
||||
err = RK11.RKER.NXS;
|
||||
nError = RK11.RKER.NXS;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
|
|
@ -356,12 +356,12 @@ class RK11 extends DriveController {
|
|||
* trigger the RKCS HE (Hard Error) bit. This is all taken care of in updateErrors() now.
|
||||
*/
|
||||
if (data != (b0 | (b1 << 8))) {
|
||||
err = RK11.RKER.WCE;
|
||||
nError = RK11.RKER.WCE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) {
|
||||
err = RK11.RKER.NXS;
|
||||
nError = RK11.RKER.NXS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -369,14 +369,14 @@ class RK11 extends DriveController {
|
|||
addr += inc;
|
||||
nWords--;
|
||||
}
|
||||
return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err;
|
||||
return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError;
|
||||
}
|
||||
|
||||
/**
|
||||
* doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr)
|
||||
* doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr)
|
||||
*
|
||||
* @this {RK11}
|
||||
* @param {number} err
|
||||
* @param {number} nError
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
* @param {number} iSector
|
||||
|
|
@ -384,13 +384,13 @@ class RK11 extends DriveController {
|
|||
* @param {number} addr
|
||||
* @return {boolean}
|
||||
*/
|
||||
doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr)
|
||||
doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr)
|
||||
{
|
||||
this.regRKBA = addr & 0xffff;
|
||||
this.regRKCS = (this.regRKCS & ~RK11.RKCS.MEX) | ((addr >> (16 - RK11.RKCS.SHIFT.MEX)) & RK11.RKCS.MEX);
|
||||
this.regRKWC = (0x10000 - nWords) & 0xffff;
|
||||
this.regRKDA = (this.regRKDA & ~RK11.RKDA.SA) | (iSector & RK11.RKDA.SA);
|
||||
this.regRKER |= err;
|
||||
this.regRKER |= nError;
|
||||
this.updateErrors();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,13 +227,13 @@ class RL11 extends DriveController {
|
|||
*/
|
||||
readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
var err = 0;
|
||||
var nError = 0;
|
||||
var checksum = 0;
|
||||
var disk = drive.disk;
|
||||
var sector = null, ibSector;
|
||||
|
||||
if (!disk) {
|
||||
err = RL11.ERRC.HNF; // TODO: Review
|
||||
nError = RL11.ERRC.HNF; // TODO: Review
|
||||
nWords = 0;
|
||||
}
|
||||
|
||||
|
|
@ -242,14 +242,14 @@ class RL11 extends DriveController {
|
|||
if (!sector) {
|
||||
sector = disk.seek(iCylinder, iHead, iSector + 1);
|
||||
if (!sector) {
|
||||
err = RL11.ERRC.HNF;
|
||||
nError = RL11.ERRC.HNF;
|
||||
break;
|
||||
}
|
||||
ibSector = 0;
|
||||
}
|
||||
var b0, b1, data;
|
||||
if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) {
|
||||
err = RL11.ERRC.HNF;
|
||||
nError = RL11.ERRC.HNF;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
|
|
@ -267,7 +267,7 @@ class RL11 extends DriveController {
|
|||
}
|
||||
}
|
||||
if (this.bus.checkFault()) {
|
||||
err = RL11.ERRC.NXM;
|
||||
nError = RL11.ERRC.NXM;
|
||||
break;
|
||||
}
|
||||
addr += 2;
|
||||
|
|
@ -280,7 +280,7 @@ class RL11 extends DriveController {
|
|||
if (++iHead >= disk.nHeads) {
|
||||
iHead = 0;
|
||||
if (++iCylinder >= disk.nCylinders) {
|
||||
err = RL11.ERRC.HNF;
|
||||
nError = RL11.ERRC.HNF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -292,7 +292,7 @@ class RL11 extends DriveController {
|
|||
console.log("checksum: " + (checksum|0));
|
||||
}
|
||||
|
||||
return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err;
|
||||
return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -312,13 +312,13 @@ class RL11 extends DriveController {
|
|||
*/
|
||||
writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
var err = 0;
|
||||
var nError = 0;
|
||||
var checksum = 0;
|
||||
var disk = drive.disk;
|
||||
var sector = null, ibSector;
|
||||
|
||||
if (!disk) {
|
||||
err = RL11.ERRC.HNF; // TODO: Review
|
||||
nError = RL11.ERRC.HNF; // TODO: Review
|
||||
nWords = 0;
|
||||
}
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ class RL11 extends DriveController {
|
|||
*/
|
||||
var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr));
|
||||
if (this.bus.checkFault()) {
|
||||
err = RL11.ERRC.NXM;
|
||||
nError = RL11.ERRC.NXM;
|
||||
break;
|
||||
}
|
||||
if (DEBUG && this.messageEnabled(MessagesPDP11.WRITE)) {
|
||||
|
|
@ -348,13 +348,13 @@ class RL11 extends DriveController {
|
|||
if (!sector) {
|
||||
sector = disk.seek(iCylinder, iHead, iSector + 1, true);
|
||||
if (!sector) {
|
||||
err = RL11.ERRC.HNF;
|
||||
nError = RL11.ERRC.HNF;
|
||||
break;
|
||||
}
|
||||
ibSector = 0;
|
||||
}
|
||||
if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) {
|
||||
err = RL11.ERRC.HNF;
|
||||
nError = RL11.ERRC.HNF;
|
||||
break;
|
||||
}
|
||||
if (ibSector >= disk.cbSector) {
|
||||
|
|
@ -364,7 +364,7 @@ class RL11 extends DriveController {
|
|||
if (++iHead >= disk.nHeads) {
|
||||
iHead = 0;
|
||||
if (++iCylinder >= disk.nCylinders) {
|
||||
err = RL11.ERRC.HNF;
|
||||
nError = RL11.ERRC.HNF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -376,14 +376,14 @@ class RL11 extends DriveController {
|
|||
console.log("checksum: " + (checksum|0));
|
||||
}
|
||||
|
||||
return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err;
|
||||
return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError;
|
||||
}
|
||||
|
||||
/**
|
||||
* doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr)
|
||||
* doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr)
|
||||
*
|
||||
* @this {RL11}
|
||||
* @param {number} err
|
||||
* @param {number} nError
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
* @param {number} iSector
|
||||
|
|
@ -391,7 +391,7 @@ class RL11 extends DriveController {
|
|||
* @param {number} addr
|
||||
* @return {boolean}
|
||||
*/
|
||||
doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr)
|
||||
doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr)
|
||||
{
|
||||
this.regRLBA = addr & 0xffff;
|
||||
this.regRLCS = (this.regRLCS & ~RL11.RLCS.BAE) | ((addr >> (16 - RL11.RLCS.SHIFT.BAE)) & RL11.RLCS.BAE);
|
||||
|
|
@ -399,8 +399,8 @@ class RL11 extends DriveController {
|
|||
this.regRLDA = (iCylinder << RL11.RLDA.SHIFT.RW_CA) | (iHead? RL11.RLDA.RW_HS : 0) | (iSector & RL11.RLDA.RW_SA);
|
||||
this.tmpRLDA = this.regRLDA;
|
||||
this.regRLMP = (0x10000 - nWords) & 0xffff;
|
||||
if (err) {
|
||||
this.regRLCS |= err | RL11.RLCS.ERR;
|
||||
if (nError) {
|
||||
this.regRLCS |= nError | RL11.RLCS.ERR;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
593
modules/pdp11/lib/rx11.js
Normal file
593
modules/pdp11/lib/rx11.js
Normal file
|
|
@ -0,0 +1,593 @@
|
|||
/**
|
||||
* @fileoverview Implements the RX11 Disk Controller (for RX01 Diskettes)
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @copyright © Jeff Parsons 2012-2017
|
||||
*
|
||||
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
||||
*
|
||||
* It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis
|
||||
* (paulnank@hotmail.com) at <http://skn.noip.me/pdp11/pdp11.html>. This code may be used
|
||||
* freely provided the original authors are acknowledged in any modified source code.
|
||||
*
|
||||
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation, either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with PCjs. If not,
|
||||
* see <http://www.gnu.org/licenses/gpl.html>.
|
||||
*
|
||||
* You are required to include the above copyright notice in every modified copy of this work
|
||||
* and to display that copyright notice when the software starts running; see COPYRIGHT in
|
||||
* <http://pcjs.org/modules/shared/lib/defines.js>.
|
||||
*
|
||||
* Some PCjs files also attempt to load external resource files, such as character-image files,
|
||||
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
||||
* for purposes of the GNU General Public License, and the author does not claim any copyright
|
||||
* as to their contents.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
if (NODE) {
|
||||
var Str = require("../../shared/lib/strlib");
|
||||
var PDP11 = require("./defines");
|
||||
var MessagesPDP11 = require("./messages");
|
||||
var DriveController = require("./drive");
|
||||
}
|
||||
|
||||
class RX11 extends DriveController {
|
||||
/**
|
||||
* RX11(parms)
|
||||
*
|
||||
* The RX11 component has the following component-specific (parms) properties:
|
||||
*
|
||||
* autoMount: one or more JSON-encoded objects, each containing 'name' and 'path' properties
|
||||
*
|
||||
* The RX11 Disk Controller controls up to two RX01 disk drives, which in turn read/write
|
||||
* disk cartridges. See [RX11 Disk Controller Configuration Files](/devices/pdp11/rx11/).
|
||||
*
|
||||
* RX01 diskettes are single-sided, with 77 tracks per side, 26 sectors per track, and a sector size
|
||||
* of 128 bytes, for a total capacity of 250Kb (256,256 bytes). See [RX01 Disk Images](/disks/dec/rx01/).
|
||||
*
|
||||
* @param {Object} parms
|
||||
*/
|
||||
constructor(parms)
|
||||
{
|
||||
super("RX11", parms, MessagesPDP11.RX11, PDP11.RX11, PDP11.RX11.RX01, RX11.UNIBUS_IOTABLE);
|
||||
|
||||
/*
|
||||
* Define all the registers required for this controller.
|
||||
*/
|
||||
this.regRXCS = this.regRXDB = 0;
|
||||
this.regRXTA = this.regRXSA = this.regRXES = this.regError = 0;
|
||||
|
||||
/*
|
||||
* Whenever a command is issued, we record the function code internally here, and when the command
|
||||
* is completed, we set the internal function code back to UNUSED.
|
||||
*/
|
||||
this.funCode = RX11.FUNC.UNUSED; // no function in progress (device is idle)
|
||||
|
||||
this.iBuffer = 0;
|
||||
/*
|
||||
* We use the new ES6 fill() method to ensure that the buffer returns something reasonable if, for some
|
||||
* strange reason, the first command we receive is an Empty Buffer command.
|
||||
*/
|
||||
this.abBuffer = new Array(128).fill(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* initController(aRegs)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {Array} [aRegs]
|
||||
* @return {boolean} true if successful, false if failure
|
||||
*/
|
||||
initController(aRegs)
|
||||
{
|
||||
if (!aRegs) {
|
||||
this.regRXCS = 0;
|
||||
this.regRXDB = 0;
|
||||
this.regRXTA = 1;
|
||||
this.regRXSA = 1;
|
||||
this.regRXES = 0;
|
||||
this.regError = 0;
|
||||
this.funCode = RX11.FUNC.READ;
|
||||
this.iBuffer = 0;
|
||||
this.cpu.clearIRQ(this.irq);
|
||||
this.readSector();
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse
|
||||
* of what saveController() does when it collects a bunch of object properties into an array.
|
||||
*/
|
||||
[
|
||||
this.regRXCS,
|
||||
this.regRXDB,
|
||||
this.regRXTA,
|
||||
this.regRXSA,
|
||||
this.regRXES,
|
||||
this.regError,
|
||||
this.funCode,
|
||||
this.iBuffer,
|
||||
this.abBuffer
|
||||
] = aRegs;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* saveController()
|
||||
*
|
||||
* Basically, the inverse of initController().
|
||||
*
|
||||
* @this {RX11}
|
||||
* @return {Array}
|
||||
*/
|
||||
saveController()
|
||||
{
|
||||
return [
|
||||
this.regRXCS,
|
||||
this.regRXDB,
|
||||
this.regRXTA,
|
||||
this.regRXSA,
|
||||
this.regRXES,
|
||||
this.regError,
|
||||
this.funCode,
|
||||
this.iBuffer,
|
||||
this.abBuffer
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* notifyLoad(iDrive)
|
||||
*
|
||||
* Called whenever DriveController has loaded a new disk into the specified drive.
|
||||
*
|
||||
* We're interested in this so that whenever a disk change occurs for drive 0, we can automatically
|
||||
* refill the sector buffer with the data from sector 1 from track 1.
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} iDrive
|
||||
*/
|
||||
notifyLoad(iDrive)
|
||||
{
|
||||
if (iDrive == 0) this.initController();
|
||||
}
|
||||
|
||||
/**
|
||||
* notifyUnload(iDrive)
|
||||
*
|
||||
* Called whenever DriveController has unloaded a disk from the specified drive.
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} iDrive
|
||||
*/
|
||||
notifyUnload(iDrive)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* processCommand()
|
||||
*
|
||||
* @this {RX11}
|
||||
*/
|
||||
processCommand()
|
||||
{
|
||||
this.funCode = this.regRXCS & RX11.RXCS.FUNC;
|
||||
this.regRXCS &= ~(RX11.RXCS.GO | RX11.RXCS.TR | RX11.RXCS.DONE | RX11.RXCS.ERR);
|
||||
this.cpu.clearIRQ(this.irq);
|
||||
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".processCommand(" + RX11.FUNCS[this.funCode >> 1]+ ")", true, true);
|
||||
|
||||
switch(this.funCode) {
|
||||
|
||||
case RX11.FUNC.FILL:
|
||||
case RX11.FUNC.EMPTY:
|
||||
case RX11.FUNC.READ:
|
||||
case RX11.FUNC.WRITE:
|
||||
case RX11.FUNC.WRDEL:
|
||||
this.initCommand();
|
||||
break;
|
||||
|
||||
case RX11.FUNC.RDSTAT:
|
||||
this.readStatus();
|
||||
break;
|
||||
|
||||
case RX11.FUNC.RDERR:
|
||||
this.readError();
|
||||
break;
|
||||
|
||||
default:
|
||||
this.assert(this.funCode == RX11.FUNC.UNUSED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* initCommand()
|
||||
*
|
||||
* @this {RX11}
|
||||
*/
|
||||
initCommand()
|
||||
{
|
||||
this.iBuffer = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* doneCommand(nError)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} [nError]
|
||||
*/
|
||||
doneCommand(nError)
|
||||
{
|
||||
if (nError) {
|
||||
this.regError = nError;
|
||||
this.regRXDB = this.regRXES;
|
||||
this.regRXCS |= RX11.RXCS.ERR;
|
||||
}
|
||||
this.funCode = RX11.FUNC.UNUSED;
|
||||
this.regRXCS |= RX11.RXCS.DONE;
|
||||
if (this.regRXCS & RX11.RXCS.IE) this.cpu.setIRQ(this.irq);
|
||||
}
|
||||
|
||||
/**
|
||||
* readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
*
|
||||
* This function is required ONLY if we want to support DriveController's bootSelectedDisk() function (and we do).
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {Object} drive
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
* @param {number} iSector
|
||||
* @param {number} nWords
|
||||
* @param {number} addr
|
||||
* @param {number} inc (normally 2, unless inhibited, in which case it's 0)
|
||||
* @param {boolean} [fCheck]
|
||||
* @param {function(...)} [done]
|
||||
* @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any)
|
||||
*/
|
||||
readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done)
|
||||
{
|
||||
var nError = 0;
|
||||
var disk = drive.disk;
|
||||
var sector = null, ibSector;
|
||||
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".readData(" + iCylinder + ":" + iHead + ":" + iSector + ") " + Str.toOct(addr) + "--" + Str.toOct(addr + (nWords << 1)), true, true);
|
||||
|
||||
if (!disk) {
|
||||
nError = drive.iDrive? RX11.ERROR.HOME1 : RX11.ERROR.HOME0;
|
||||
nWords = 0;
|
||||
}
|
||||
|
||||
var sWords = "";
|
||||
while (nWords) {
|
||||
if (!sector) {
|
||||
if (iCylinder >= disk.nCylinders) {
|
||||
nError = RX11.ERROR.NO_TRACK;
|
||||
break;
|
||||
}
|
||||
sector = disk.seek(iCylinder, iHead, iSector + 1);
|
||||
if (!sector) {
|
||||
nError = RX11.ERROR.NO_SECTOR;
|
||||
break;
|
||||
}
|
||||
ibSector = 0;
|
||||
if (++iSector >= disk.nSectors) {
|
||||
iSector = 0;
|
||||
if (++iHead >= disk.nHeads) {
|
||||
iHead = 0;
|
||||
++iCylinder;
|
||||
}
|
||||
}
|
||||
}
|
||||
var b0, b1;
|
||||
if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) {
|
||||
nError = RX11.ERROR.NO_DATA;
|
||||
break;
|
||||
}
|
||||
var data = b0 | (b1 << 8);
|
||||
this.bus.setWordDirect(this.cpu.mapUnibus(addr), data);
|
||||
if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) {
|
||||
if (!sWords) sWords = Str.toOct(addr) + ": ";
|
||||
sWords += Str.toOct(data) + ' ';
|
||||
if (sWords.length >= 64) {
|
||||
console.log(sWords);
|
||||
sWords = "";
|
||||
}
|
||||
}
|
||||
if (ibSector >= disk.cbSector) sector = null;
|
||||
addr += inc;
|
||||
nWords--;
|
||||
}
|
||||
|
||||
return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError;
|
||||
}
|
||||
|
||||
/**
|
||||
* readSector()
|
||||
*
|
||||
* @this {RX11}
|
||||
*/
|
||||
readSector()
|
||||
{
|
||||
var nError = 0;
|
||||
var iDrive = (this.regRXCS & RX11.RXCS.UNIT)? 1 : 0;
|
||||
var drive = this.aDrives[iDrive];
|
||||
var disk = drive && drive.disk;
|
||||
var iCylinder = this.regRXTA & RX11.RXTA.MASK, iHead = 0, nSector = this.regRXSA & RX11.RXSA.MASK;
|
||||
|
||||
this.regRXES &= ~(RX11.RXES.CRC | RX11.RXES.PARITY | RX11.RXES.DEL | RX11.RXES.DRDY);
|
||||
|
||||
if (disk) {
|
||||
this.regRXES |= RX11.RXES.DRDY;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".readSector(" + iCylinder + ":" + iHead + ":" + nSector + ")", true, true);
|
||||
this.assert(nSector); // RX sector numbers (unlike RK and RL) are supposed to be 1-based
|
||||
var sector = disk.seek(iCylinder, iHead, nSector, true);
|
||||
if (sector) {
|
||||
var i = 0, nBytes = this.abBuffer.length;
|
||||
while (i < nBytes) {
|
||||
var b = disk.read(sector, i);
|
||||
if (b < 0) {
|
||||
nError = RX11.ERROR.NO_DATA;
|
||||
break;
|
||||
}
|
||||
this.abBuffer[i++] = b;
|
||||
}
|
||||
if (sector.deleted) this.regRXES |= RX11.RXES.DEL;
|
||||
} else {
|
||||
nError = RX11.ERROR.NO_SECTOR;
|
||||
}
|
||||
} else {
|
||||
nError = iDrive? RX11.ERROR.HOME1 : RX11.ERROR.HOME0;
|
||||
}
|
||||
this.doneCommand(nError);
|
||||
}
|
||||
|
||||
/**
|
||||
* writeSector(fDeleted)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {boolean} fDeleted
|
||||
*/
|
||||
writeSector(fDeleted)
|
||||
{
|
||||
var nError = 0;
|
||||
var iDrive = (this.regRXCS & RX11.RXCS.UNIT)? 1 : 0;
|
||||
var drive = this.aDrives[iDrive];
|
||||
var disk = drive && drive.disk;
|
||||
var iCylinder = this.regRXTA & RX11.RXTA.MASK, iHead = 0, nSector = this.regRXSA & RX11.RXSA.MASK;
|
||||
|
||||
this.regRXES &= ~(RX11.RXES.CRC | RX11.RXES.PARITY | RX11.RXES.DEL | RX11.RXES.DRDY);
|
||||
|
||||
if (disk) {
|
||||
this.regRXES |= RX11.RXES.DRDY;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".writeSector(" + iCylinder + ":" + iHead + ":" + nSector + ")", true, true);
|
||||
this.assert(nSector); // RX sector numbers (unlike RK and RL) are supposed to be 1-based
|
||||
var sector = disk.seek(iCylinder, iHead, nSector, true);
|
||||
if (sector) {
|
||||
if (fDeleted) sector.deleted = true;
|
||||
var i = 0, nBytes = this.abBuffer.length;
|
||||
while (i < nBytes) {
|
||||
var data = this.abBuffer[i];
|
||||
if (!disk.write(sector, i, data & 0xff)) {
|
||||
nError = RX11.ERROR.NO_DATA;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
nError = RX11.ERROR.NO_SECTOR;
|
||||
}
|
||||
} else {
|
||||
nError = iDrive? RX11.ERROR.HOME1 : RX11.ERROR.HOME0;
|
||||
}
|
||||
this.doneCommand(nError);
|
||||
}
|
||||
|
||||
/**
|
||||
* readStatus()
|
||||
*
|
||||
* @this {RX11}
|
||||
*/
|
||||
readStatus()
|
||||
{
|
||||
var iDrive = (this.regRXCS & RX11.RXCS.UNIT)? 1 : 0;
|
||||
var drive = this.aDrives[iDrive];
|
||||
|
||||
this.regRXES &= ~RX11.RXES.DRDY;
|
||||
if (drive && drive.disk) this.regRXES |= RX11.RXES.DRDY;
|
||||
|
||||
this.regRXDB = this.regRXES;
|
||||
this.doneCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
* readError()
|
||||
*
|
||||
* @this {RX11}
|
||||
*/
|
||||
readError()
|
||||
{
|
||||
this.regRXDB = this.regError;
|
||||
this.doneCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
* readRXCS(addr)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.RXCS or 177170)
|
||||
* @param {boolean} [fPreWrite]
|
||||
* @return {number}
|
||||
*/
|
||||
readRXCS(addr, fPreWrite)
|
||||
{
|
||||
var w = this.regRXCS;
|
||||
|
||||
if (!fPreWrite) {
|
||||
w &= RX11.RXCS.RMASK;
|
||||
|
||||
switch (this.funCode) {
|
||||
|
||||
case RX11.FUNC.FILL:
|
||||
case RX11.FUNC.EMPTY:
|
||||
if (this.iBuffer < this.abBuffer.length) {
|
||||
this.regRXCS |= RX11.RXCS.TR;
|
||||
}
|
||||
break;
|
||||
|
||||
case RX11.FUNC.READ:
|
||||
case RX11.FUNC.WRITE:
|
||||
case RX11.FUNC.WRDEL:
|
||||
if (this.iBuffer < 2) {
|
||||
this.regRXCS |= RX11.RXCS.TR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
/**
|
||||
* writeRXCS(data, addr)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} data
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.RXCS or 177170)
|
||||
*/
|
||||
writeRXCS(data, addr)
|
||||
{
|
||||
this.regRXCS = (this.regRXCS & ~RX11.RXCS.WMASK) | (data & RX11.RXCS.WMASK);
|
||||
|
||||
if (this.regRXCS & RX11.RXCS.INIT) {
|
||||
this.initController();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this.regRXCS & RX11.RXCS.GO) && this.funCode == RX11.FUNC.UNUSED) {
|
||||
this.processCommand();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(this.regRXCS & RX11.RXCS.IE)) {
|
||||
this.cpu.clearIRQ(this.irq);
|
||||
}
|
||||
else if (this.regRXCS & RX11.RXCS.DONE) {
|
||||
this.cpu.setIRQ(this.irq);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* readRXDB(addr)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.RXDB or 177172)
|
||||
* @param {boolean} [fPreWrite]
|
||||
* @return {number}
|
||||
*/
|
||||
readRXDB(addr, fPreWrite)
|
||||
{
|
||||
if (!fPreWrite) {
|
||||
switch (this.funCode) {
|
||||
|
||||
case RX11.FUNC.EMPTY:
|
||||
if (this.regRXCS & RX11.RXCS.TR) {
|
||||
this.regRXCS &= ~RX11.RXCS.TR;
|
||||
this.assert(this.iBuffer < this.abBuffer.length);
|
||||
this.regRXDB = this.abBuffer[this.iBuffer] & 0xff;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".readByte(" + this.iBuffer + "): " + Str.toHexByte(this.regRXDB), true, true);
|
||||
if (++this.iBuffer >= this.abBuffer.length) {
|
||||
this.doneCommand();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.regRXDB;
|
||||
}
|
||||
|
||||
/**
|
||||
* writeRXDB(data, addr)
|
||||
*
|
||||
* @this {RX11}
|
||||
* @param {number} data
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.RXDB or 177172)
|
||||
*/
|
||||
writeRXDB(data, addr)
|
||||
{
|
||||
switch(this.funCode) {
|
||||
|
||||
case RX11.FUNC.FILL:
|
||||
if (this.regRXCS & RX11.RXCS.TR) {
|
||||
this.regRXCS &= ~RX11.RXCS.TR;
|
||||
this.assert(this.iBuffer < this.abBuffer.length);
|
||||
this.abBuffer[this.iBuffer] = data & 0xff;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ".writeByte(" + this.iBuffer + "," + Str.toHexByte(data) + ")", true, true);
|
||||
if (++this.iBuffer >= this.abBuffer.length) {
|
||||
this.doneCommand();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RX11.FUNC.READ:
|
||||
case RX11.FUNC.WRITE:
|
||||
case RX11.FUNC.WRDEL:
|
||||
if (this.regRXCS & RX11.RXCS.TR) {
|
||||
this.regRXCS &= ~RX11.RXCS.TR;
|
||||
|
||||
switch(this.iBuffer++) {
|
||||
case 0:
|
||||
this.regRXSA = data;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this.regRXTA = data;
|
||||
if (this.funCode == RX11.FUNC.READ) {
|
||||
this.readSector();
|
||||
} else {
|
||||
this.writeSector(this.funCode == RX11.FUNC.WRDEL);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
this.assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.regRXDB = data;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Alias RX11 definitions as class constants
|
||||
*/
|
||||
RX11.RXCS = PDP11.RX11.RXCS; // 177170: Command and Status Register
|
||||
RX11.RXDB = PDP11.RX11.RXDB; // 177172: Data Buffer Register
|
||||
RX11.RXTA = PDP11.RX11.RXTA;
|
||||
RX11.RXSA = PDP11.RX11.RXSA;
|
||||
RX11.RXES = PDP11.RX11.RXES;
|
||||
RX11.FUNC = PDP11.RX11.FUNC;
|
||||
RX11.ERROR = PDP11.RX11.ERROR;
|
||||
|
||||
RX11.FUNCS = [
|
||||
"FILL", "EMPTY", "WRITE", "READ", "UNUSED", "RDSTAT", "WRDEL", "RDERR"
|
||||
];
|
||||
|
||||
/*
|
||||
* ES6 ALERT: As you can see below, I've finally started using computed property names.
|
||||
*/
|
||||
RX11.UNIBUS_IOTABLE = {
|
||||
[PDP11.UNIBUS.RXCS]: /* 177170 */ [null, null, RX11.prototype.readRXCS, RX11.prototype.writeRXCS, "RXCS"],
|
||||
[PDP11.UNIBUS.RXDB]: /* 177172 */ [null, null, RX11.prototype.readRXDB, RX11.prototype.writeRXDB, "RXDB"]
|
||||
};
|
||||
|
||||
if (NODE) module.exports = RX11;
|
||||
|
|
@ -93,8 +93,9 @@ DiskAPI.DISK_FORMATS = {
|
|||
*/
|
||||
21368320:[615,4,17], // PC AT 20Mb hard drive (type 2)
|
||||
/*
|
||||
* Assorted DEC disk pack formats.
|
||||
* Assorted DEC disk formats.
|
||||
*/
|
||||
256256: [77, 1,26,128], // RX01 single-platter diskette: 77 tracks, 1 head, 26 sectors/track, 128 bytes/sector, for a total of 256256 bytes
|
||||
2494464: [203,2,12,512], // RK03 single-platter disk cartridge: 203 tracks, 2 heads, 12 sectors/track, 512 bytes/sector, for a total of 2494464 bytes
|
||||
5242880: [256,2,40,256], // RL01K single-platter disk cartridge: 256 tracks, 2 heads, 40 sectors/track, 256 bytes/sector, for a total of 5242880 bytes
|
||||
10485760:[512,2,40,256] // RL02K single-platter disk cartridge: 512 tracks, 2 heads, 40 sectors/track, 256 bytes/sector, for a total of 10485760 bytes
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@
|
|||
"./modules/pdp11/lib/drive.js",
|
||||
"./modules/pdp11/lib/rk11.js",
|
||||
"./modules/pdp11/lib/rl11.js",
|
||||
"./modules/pdp11/lib/rx11.js",
|
||||
"./modules/shared/lib/debugger.js",
|
||||
"./modules/pdp11/lib/debugger.js",
|
||||
"./modules/pdp11/lib/computer.js",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ title: DEC PDP-11 Publications and Papers
|
|||
permalink: /pubs/dec/pdp11/
|
||||
---
|
||||
|
||||
DEC PDP-11 Publications
|
||||
PDP-11 Hardware Publications
|
||||
---
|
||||
|
||||
This page summarizes PDP-11 documentation that was useful in creating [PDPjs](/modules/pdp11/). In most cases,
|
||||
|
|
@ -29,6 +29,35 @@ directory. If a PDF was not searchable, it was "OCR'ed" before being archived b
|
|||
- [PDP-11/70 Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Handbook_1976.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/1170/PDP-11_70_Handbook_1977-78.pdf)]
|
||||
- [PDP-11/70 Handbook (1979)](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Handbook_1979.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/handbooks/PDP11_Handbook1979.pdf)]
|
||||
|
||||
[PDP-11 KW11](kw11/)
|
||||
|
||||
- [KW11-L Line Time Clock Manual (Apr 1973)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Apr73.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/unibus/DEC-11-HKWB-D_KW11L_Apr73.pdf)]
|
||||
- [KW11-L Line Time Clock Manual (Jul 1974)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Jul74.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/1140/EK-KW11L_TM-002_KW11-L_Line_Time_Clock_Manual_Jul74.pdf)]
|
||||
|
||||
[PDP-11 M9312](m9312/)
|
||||
|
||||
- [M9312 Bootstrap/Terminator Module Technical Manual (Oct 1979)](http://archive.pcjs.org/pubs/dec/pdp11/m9312/M9312_Bootstrap_Terminator_Module_Technical_Manual.pdf)
|
||||
|
||||
[PDP-11 RK11](rk11/)
|
||||
|
||||
- [CXRKAG0 DEC/X11 RK11 MODULE (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/AC-E676G-MC_CXRKAG0-RK11_Sep78.pdf)
|
||||
- [RK11-D and RK11-E Moving Head Disk Drive Controller Manual (Feb 1975)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/EK-RK11D-MM-002.pdf)
|
||||
|
||||
[PDP-11 RL11](rl11/)
|
||||
|
||||
- [RL01/RL02 User Guide (Sep 1981)](http://archive.pcjs.org/pubs/dec/pdp11/rl11/EK-RL012-UG-005_Sep81.pdf)
|
||||
|
||||
[PDP-11 RX11](rx11/)
|
||||
|
||||
- [RX8/RX11 floppy disk system user's manual (Nov 1976)](http://archive.pcjs.org/pubs/dec/pdp11/rx11/EK-RX01-OP-001_RX11UM_Nov76.pdf)
|
||||
|
||||
[Other PDP-11 Peripherals](other/)
|
||||
|
||||
- [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf)
|
||||
|
||||
PDP-11 Software Publications
|
||||
---
|
||||
|
||||
[PDP-11 BASIC](basic/)
|
||||
|
||||
- [PDP-11 BASIC Programming Manual (1970)](http://archive.pcjs.org/pubs/dec/pdp11/basic/BASIC_Programming_Manual_Dec70.pdf)
|
||||
|
|
@ -49,44 +78,26 @@ directory. If a PDF was not searchable, it was "OCR'ed" before being archived b
|
|||
- [CEQKCE0 11/70 INSTRUCTION EXERCISER (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7994E-MC_CEQKCE0_1170_INSTRUCTION_EXERCISER_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7996E-MC__PDP11-70-74__11-70_INST_EXR__CEQKCE0__%28C%2975,80.pdf)]
|
||||
- [CFKAAC0 11/34 BASIC INSTRUCTION TEST (Oct 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-8041C-MC_CFKAAC0_1134_BSC_INST_TST_Oct78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/diag_listings/1134/AC-8041C-MC_CFKAAC0-1134-Bsc-Inst-Tst_Oct78.pdf)]
|
||||
- [CXCPAG0 INSTRUCTION TEST (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-E664G-MC_CXCPAG0_PROCESSOR_TEST_Sep78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/x11_listings/AC-E664G-MC_CXCPAG0-Processor-test_Sep78.pdf)]
|
||||
- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-9045F-MC_CZQMCFO_MEM_EXER_16K_Feb78.pdf)
|
||||
- [PDP-11 DIAGNOSTIC HANDBOOK (1988)](http://archive.pcjs.org/pubs/dec/pdp11/diags/PDP11_DiagnosticHandbook_1988.pdf)
|
||||
- [Notes for XXDP+ and XXDP V2 Operating Systems (Feb 1993)](http://archive.pcjs.org/pubs/dec/pdp11/diags/XXDP_Notes_Feb93.pdf)
|
||||
|
||||
[PDP-11 KW11](kw11/)
|
||||
|
||||
- [KW11-L Line Time Clock Manual (Apr 1973)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Apr73.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/unibus/DEC-11-HKWB-D_KW11L_Apr73.pdf)]
|
||||
- [KW11-L Line Time Clock Manual (Jul 1974)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Jul74.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/1140/EK-KW11L_TM-002_KW11-L_Line_Time_Clock_Manual_Jul74.pdf)]
|
||||
|
||||
[PDP-11 M9312](m9312/)
|
||||
|
||||
- [M9312 Bootstrap/Terminator Module Technical Manual (Oct 1979)](http://archive.pcjs.org/pubs/dec/pdp11/m9312/M9312_Bootstrap_Terminator_Module_Technical_Manual.pdf)
|
||||
|
||||
[PDP-11 MACRO-11](macro11/)
|
||||
[MACRO-11](macro11/)
|
||||
|
||||
- [MACRO-11 Reference Manual (Dec 1975)](http://archive.pcjs.org/pubs/dec/pdp11/macro11/MACRO11_Dec75.pdf)
|
||||
- [MACRO-11 Language Reference Manual (Mar 1983)](http://archive.pcjs.org/pubs/dec/pdp11/macro11/MACRO11_Mar83.pdf)
|
||||
|
||||
[PDP-11 PC11](pc11/)
|
||||
[RT-11](rt11/)
|
||||
|
||||
- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Absolute_Loader_Listing_Jun75.pdf)
|
||||
- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Mem-Exer-16k_Feb78.pdf)
|
||||
- [PDP-11 Paper Tape Software Handbook (Apr 1976)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Paper_Tape_Software_Handbook.pdf)
|
||||
- [RT-11 v4.0 Installation and System Generation Guide (Mar 1980)](http://archive.pcjs.org/pubs/dec/pdp11/rt11/AA-H376A-TC_RT-11_V4.0_Installation_Manual_Mar81.pdf)
|
||||
|
||||
[PDP-11 RK11](rk11/)
|
||||
|
||||
- [CXRKAG0 DEC/X11 RK11 MODULE (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/AC-E676G-MC_CXRKAG0-RK11_Sep78.pdf)
|
||||
- [RK11-D and RK11-E Moving Head Disk Drive Controller Manual (Feb 1975)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/EK-RK11D-MM-002.pdf)
|
||||
|
||||
[PDP-11 RL11](rl11/)
|
||||
|
||||
- [RL01/RL02 User Guide (Sep 1981)](http://archive.pcjs.org/pubs/dec/pdp11/rl11/EK-RL012-UG-005_Sep81.pdf)
|
||||
|
||||
---
|
||||
|
||||
[Assorted PDP-11 Handbooks](other/)
|
||||
[Other PDP-11 Software](other/)
|
||||
|
||||
- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA_ABSOLUTE_LOADER_LISTING_Jun75.pdf)
|
||||
- [PDP-11 Paper Tape Software Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Paper_Tape_Software_Handbook_1976.pdf)
|
||||
- [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf)
|
||||
- [PDP-11 Software Handbook (1978)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Software_Handbook_1978.pdf)
|
||||
|
||||
PDP-11 Research Papers
|
||||
---
|
||||
|
||||
[Assorted PDP-11 Papers](papers/)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ PDPjs development and testing relied on the following PDP-11 diagnostic publicat
|
|||
- [CEQKCE0 11/70 INSTRUCTION EXERCISER (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7994E-MC_CEQKCE0_1170_INSTRUCTION_EXERCISER_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7996E-MC__PDP11-70-74__11-70_INST_EXR__CEQKCE0__%28C%2975,80.pdf)]
|
||||
- [CFKAAC0 11/34 BASIC INSTRUCTION TEST (Oct 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-8041C-MC_CFKAAC0_1134_BSC_INST_TST_Oct78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/diag_listings/1134/AC-8041C-MC_CFKAAC0-1134-Bsc-Inst-Tst_Oct78.pdf)]
|
||||
- [CXCPAG0 INSTRUCTION TEST (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-E664G-MC_CXCPAG0_PROCESSOR_TEST_Sep78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/x11_listings/AC-E664G-MC_CXCPAG0-Processor-test_Sep78.pdf)]
|
||||
- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-9045F-MC_CZQMCFO_MEM_EXER_16K_Feb78.pdf)
|
||||
|
||||
The *MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)* was particularly useful for understanding DEC's
|
||||
[Paper Tape Diagnostics](/apps/pdp11/tapes/diags/).
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ DEC PDP-11 Assorted Handbooks
|
|||
|
||||
PDPjs development and testing relied on the following PDP-11 publications:
|
||||
|
||||
- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA_ABSOLUTE_LOADER_LISTING_Jun75.pdf)
|
||||
- [PDP-11 Paper Tape Software Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Paper_Tape_Software_Handbook_1976.pdf)
|
||||
- [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf)
|
||||
- [PDP-11 Software Handbook (1978)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Software_Handbook_1978.pdf)
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
layout: page
|
||||
title: DEC PDP-11 PC11 Paper Tape Reader
|
||||
permalink: /pubs/dec/pdp11/pc11/
|
||||
---
|
||||
|
||||
DEC PDP-11 PC11 Paper Tape Reader
|
||||
---
|
||||
|
||||
PDPjs development and testing relied on the following PDP-11 publications:
|
||||
|
||||
- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Absolute_Loader_Listing_Jun75.pdf)
|
||||
- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Mem-Exer-16k_Feb78.pdf)
|
||||
- [PDP-11 Paper Tape Software Handbook (Apr 1976)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Paper_Tape_Software_Handbook.pdf)
|
||||
12
pubs/dec/pdp11/rt11/README.md
Normal file
12
pubs/dec/pdp11/rt11/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
layout: page
|
||||
title: DEC RT-11 Publications
|
||||
permalink: /pubs/dec/pdp11/rt11/
|
||||
---
|
||||
|
||||
DEC RT-11 Publications
|
||||
---
|
||||
|
||||
### RT-11 v4.0
|
||||
|
||||
- [RT-11 Installation and System Generation Guide (Mar 1980)](http://archive.pcjs.org/pubs/dec/pdp11/rt11/AA-H376A-TC_RT-11_V4.0_Installation_Manual_Mar81.pdf)
|
||||
12
pubs/dec/pdp11/rx11/README.md
Normal file
12
pubs/dec/pdp11/rx11/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
layout: page
|
||||
title: DEC PDP-11 RX11 Disk Controller
|
||||
permalink: /pubs/dec/pdp11/rx11/
|
||||
---
|
||||
|
||||
DEC PDP-11 RX11 Disk Controller
|
||||
---
|
||||
|
||||
PDPjs development and testing relied on the following PDP-11 publications:
|
||||
|
||||
- [RX8/RX11 floppy disk system user's manual (Nov 1976)](http://archive.pcjs.org/pubs/dec/pdp11/rx11/EK-RX01-OP-001_RX11UM_Nov76.pdf)
|
||||
|
|
@ -44,10 +44,10 @@
|
|||
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
|
||||
*/
|
||||
var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||
var da={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]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];fa[191]=n["?"];
|
||||
fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"];
|
||||
var da={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],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp: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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,
|
||||
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];
|
||||
fa[191]=n["?"];fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"];
|
||||
function ga(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ha(a,b){var c,d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function ia(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=ha(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
|
||||
function ja(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function q(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function r(a){return q(a,2,!0)}function ka(a){return q(a,4,!0)}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@
|
|||
http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017
|
||||
*/
|
||||
var k,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}
|
||||
var da={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]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];p[192]=n["~"];p[219]=n["{"];
|
||||
p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
|
||||
var da={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],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo: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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,
|
||||
y:121,z:122,"{":123,"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];
|
||||
p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"];
|
||||
function fa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ga(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
|
||||
function ia(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ja(a,b){return-1!==a.indexOf(b,a.length-b.length)}function ka(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function ma(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/rx11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2017
|
||||
|
|
@ -34,342 +35,354 @@
|
|||
http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017
|
||||
*/
|
||||
var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++}
|
||||
function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ha(a){fa();a={next:a};a[ba.Symbol.iterator]=function(){return this};return a}function ja(a){fa();ca();fa();var b=a[Symbol.iterator];return b?b.call(a):ga(a)}
|
||||
function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ka=ba,la=["Math","log2"],ma=0;ma<la.length-1;ma++){var oa=la[ma];oa in ka||(ka[oa]={});ka=ka[oa]}var pa=la[la.length-1],qa=ka[pa],ra=qa?qa:function(a){return Math.log(a)/Math.LN2};ra!=qa&&null!=ra&&aa(ka,pa,{configurable:!0,writable:!0,value:ra});
|
||||
var sa={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]},ta={Gh:0,le:1,Lh:2,Mh:3,Nh:4,Oh:5,Ph:6,Qh:7,qd:8,Rh:9,me:10,Sh:11,Th:12,ne:13,Uh:14,Vh:15,Wh:16,Xh:17,Yh:18,Zh:19,$h:20,ai:21,bi:22,ci:23,di:24,ei:25,fi: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,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,Xe:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,oe:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Ue=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Eb=this.id:(this.pb=this.id.substr(0,a),this.Eb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,Z:!1,error:!1};this.yc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)}
|
||||
function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<ua.length;b++){var d=ua[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Ba(a){if(void 0!==a){var b;for(b=0;b<ua.length;b++)if(ua[b].id===a)return ua[b]}return null}
|
||||
function Da(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<ua.length;d++)if(c)c==ua[d]&&(c=null);else if(!(a!=ua[d].type||b&&ua[d].id.indexOf(b)))return ua[d]}return null}function Ea(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){v(c.message+" ("+a+")")}return b}
|
||||
function Fa(a,b){var c=w;b=x(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=Ea(g))&&k.binding&&a.ua(k.type,k.binding,g,k.value),m=l.length}}}}
|
||||
function x(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}h=q.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
h.ua=function(a,b,c){switch(b){case "clear":return this.H[b]||(this.H[b]=c,c.onclick=function(a){return function(){a.H.print&&(a.H.print.value="")}}(this)),!0;case "print":return this.H[b]||(this.Qa=this.H[b]=c,c.value="",this.u=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.S=function(a){this.u(a,this.Eb)}),!0;default:return!1}};h.log=function(){};h.u=function(){};
|
||||
h.status=function(a){this.u(this.Eb+": "+a)};h.S=function(a,b,c){c=c||this.type;b||v((c?c+": ":"")+a)};function Ga(a,b){a.A.error=!0;a.S(b)}function Ha(a){return a.A.error?(a.u(a.toString()+" error"),!0):!1}function Ia(a,b){b&&(a.A.ready?b():a.yc=b);return a.A.ready}function y(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.yc,a.yc=null,b&&b()))}function Ja(a,b){a.A.jb&&(b?a.A.$c=!0:void 0===b&&a.u(a.toString()+" busy"));return a.A.jb}
|
||||
function Ka(a,b){if(a.A.$c)return a.A.jb=!1,a.A.$c=!1;if(a.A.error)return a.u(a.toString()+" error"),!1;a.A.jb=b;return a.A.jb}h.Ca=function(){return this.A.Z=!0};h.Ba=function(a,b){b&&(this.A.Z=!1);return!0};function A(a,b){if(a.F){a===a.F?b|=0:b=b||a.fa;var c=a.F.fa&b;return!!b&&c===b||!!(c&a.F.Sd)}return!1}function D(a,b,c,d){a.F&&(!0===c||A(a,c|0))&&a.F.message(b,d)}
|
||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var xa=window?window.PCjs.Machines:{},ua=window?window.PCjs.Components:[];Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ha(a){fa();a={next:a};a[ba.Symbol.iterator]=function(){return this};return a}function ia(a){fa();ca();fa();var b=a[Symbol.iterator];return b?b.call(a):ga(a)}
|
||||
function p(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}function ja(a,b){if(b){var c=ba;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}
|
||||
ja("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}});ja("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}});
|
||||
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],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},la={ri:0,Be:1,yi:2,zi:3,Ai:4,Bi:5,Ci:6,Di:7,Jd:8,Ei:9,Ce:10,Fi:11,Gi:12,De:13,Hi:14,Ii:15,Ji:16,Ki:17,Li:18,Mi:19,Ni:20,Oi:21,Pi:22,Qi:23,Ri:24,Si:25,Ti: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,Fd:65,mi:66,ti:67,Ui:68,E:69,$i:70,cj:71,oj:72,qj:73,rj:74,sj:75,tj:76,wj:77,yj:78,Ej:79,Hj:80,Q:81,Jj:82,Mj:83,Vj:84,Xj:85,Zj:86,$j:87,dk:88,ek:89,tf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,fk:97,gk:98,jk:99,d:100,e:101,kk:102,lk:103,mk:104,nk:105,sk:106,k:107,tk:108,uk:109,n:110,vk:111,p:112,q:113,r:114,wk:115,t:116,zk:117,Ak:118,Bk:119,x:120,
|
||||
y:121,z:122,"{":123,"|":124,"}":125,"~":126,cc:127};function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sd=b.comment;this.rf=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Mb=this.id:(this.wb=this.id.substr(0,a),this.Mb=this.id.substr(a+1));this.A={ready:!1,gb:!1,td:!1,aa:!1,error:!1};this.Kc=null;this.A.error=!1;this.ha=c||0;this.F=this.f=this.D=this.K=this.Ta=null;ma.push(this)}function oa(a,b,c){pa[a]&&b&&(pa[a][b]=c)}
|
||||
function qa(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ra(a){var b=!1;window&&(b=window.confirm(a));return b}function ta(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<ma.length;b++){var d=ma[b];a&&d.id.indexOf(a)||c.push(d)}return c}function ua(a){if(void 0!==a){var b;for(b=0;b<ma.length;b++)if(ma[b].id===a)return ma[b]}return null}
|
||||
function va(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<ma.length;d++)if(c)c==ma[d]&&(c=null);else if(!(a!=ma[d].type||b&&ma[d].id.indexOf(b)))return ma[d]}return null}function wa(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){v(c.message+" ("+a+")")}return b}
|
||||
function xa(a,b){var c=w;b=x(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=wa(g))&&k.binding&&a.va(k.type,k.binding,g,k.value),m=l.length}}}}
|
||||
function x(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}h=r.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
h.va=function(a,b,c){switch(b){case "clear":return this.H[b]||(this.H[b]=c,c.onclick=function(a){return function(){a.H.print&&(a.H.print.value="")}}(this)),!0;case "print":return this.H[b]||(this.Ta=this.H[b]=c,c.value="",this.v=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.T=function(a){this.v(a,this.Mb)}),!0;default:return!1}};h.log=function(){};h.v=function(){};
|
||||
h.status=function(a){this.v(this.Mb+": "+a)};h.T=function(a,b,c){c=c||this.type;b||v((c?c+": ":"")+a)};function ya(a,b){a.A.error=!0;a.T(b)}function za(a){return a.A.error?(a.v(a.toString()+" error"),!0):!1}function Aa(a,b){b&&(a.A.ready?b():a.Kc=b);return a.A.ready}function y(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Kc,a.Kc=null,b&&b()))}function Ba(a,b){a.A.gb&&(b?a.A.td=!0:void 0===b&&a.v(a.toString()+" busy"));return a.A.gb}
|
||||
function Da(a,b){if(a.A.td)return a.A.gb=!1,a.A.td=!1;if(a.A.error)return a.v(a.toString()+" error"),!1;a.A.gb=b;return a.A.gb}h.Da=function(){return this.A.aa=!0};h.Ca=function(a,b){b&&(this.A.aa=!1);return!0};function z(a,b){if(a.F){a===a.F?b|=0:b=b||a.ha;var c=a.F.ha&b;return!!b&&c===b||!!(c&a.F.ge)}return!1}function D(a,b,c,d){a.F&&(!0===c||z(a,c|0))&&a.F.message(b,d)}
|
||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var pa=window?window.PCjs.Machines:{},ma=window?window.PCjs.Components:[];Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
function La(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Qa(a,b,c){var d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function E(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}
|
||||
function Ra(a){var b=2,c="";b?10<b&&(b=10):b=a&-65536?10:5;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode(a%10+48)+c,a/=10;return c}function F(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Sa(a){return F(a,4,!0)}
|
||||
function Ta(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function Ua(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function Va(a,b){return-1!==a.indexOf(b,a.length-b.length)}function Wa(a){return a.replace(/[&<>"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)}
|
||||
function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,k;k=c(b,a[g]);0<k?d=g+1:(e=g,f=!k)}return f?d:~d}function eb(){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 fb(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
||||
function Ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Fa(a,b,c){var d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function E(a,b,c){var d="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}
|
||||
function Ga(a){var b=2,c="";b?10<b&&(b=10):b=a&-65536?10:5;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode(a%10+48)+c,a/=10;return c}function F(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Ha(a){return F(a,4,!0)}
|
||||
function Ja(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function Ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function La(a,b){return-1!==a.indexOf(b,a.length-b.length)}function Ma(a){return a.replace(/[&<>"']/g,function(a){return Na[a]})}function Oa(a,b){return(a+" ").slice(0,b)}
|
||||
function Pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Na={"&":"&","<":"<",">":">",'"':""","'":"'"},Qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function Ra(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,k;k=c(b,a[g]);0<k?d=g+1:(e=g,f=!k)}return f?d:~d}function Wa(){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 Xa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
||||
f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function gb(a,b){var c,d={ba:null,ea:null,xa: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.xa=g.load;d.wa=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<e.length;c++)d.ba[f++]=e[c]&255,d.ba[f++]=e[c]>>8&255;else if(e=g.data)for(d.ba=Array(4*e.length),f=c=0;c<e.length;c++)d.ba[f++]=
|
||||
e[c]&255,d.ba[f++]=e[c]>>8&255,d.ba[f++]=e[c]>>16&255,d.ba[f++]=e[c]>>24&255;else d.ba=g;d.ea=g.symbols;d.ba.length?1==d.ba.length&&(v(d.ba[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;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){v("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ba=e)}return d}
|
||||
function hb(){return"http://"+(window?window.location.host:"www.pcjs.org")}function ib(){if(null==jb){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}jb=a}return jb}function kb(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function lb(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function mb(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
|
||||
function nb(a){if(!pb){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}pb=c}return pb[a]}function vb(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function wb(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}function xb(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function yb(a){zb.init.push(a)}
|
||||
function Ab(a){if(Bb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){v(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Cb(a){!Bb&&a?(Bb=!0,Db&&Eb("init"),Fb&&Eb("show")):Bb=a}function Eb(a){zb[a]&&Ab(zb[a])}var pb=null,zb={init:[],show:[],exit:[]},Db=!1,Fb=!1,Bb=!0,jb=null;xb("onload",function(){Db=!0;Ab(zb.init)});xb("onpageshow",function(){Fb=!0;Ab(zb.show)});xb(mb("Opera")||mb("iOS")?"onunload":"onbeforeunload",function(){Ab(zb.exit)});
|
||||
var Gb="undefined"!==typeof ArrayBuffer,w="pdp11",Hb="PDPjs",Ib=!1,Jb=Gb,Kb=!0,Lb=!0,Mb="UNKNOWN PANIC ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Nb={Dd:5,Nd:144,rd:8,uc:{Ne:15,Vi:16,jj:32,Gd:64,Bb:128,Kd:256,Yi:512,ki:1024,tc:2048,ji:4096,xd:57344,ka:{xd:13}},Ge:{Od:1,Kh:2,Oe:3,Te:28,sc:32,rc:64,Ad:128,cj:256,pe:512,Vb:1024,Ri:2048,Jd:4096,hj:8192,Pi:16384,qe:32768,Oc:32736},Ee:{vd:1,Pa:14,Cb:48,Rc:64,Xa:128,aj:256,li:512,ni:1024,xe:2048,Yc:8192,Oc:16384,Ub:32768,Te:4608,
|
||||
Wc:61438,qb:3967,ka:{Pa:1,Cb:4}},Fe:{Xc:15,Pc:16,Tb:8160,nb:57344,ka:{Pc:4,Tb:5,nb:13}},Pa:{ke:0,We:2,Be:4,Zc:6,xc:8,ze:10,re:12,ij:14}},Ob={Dd:5,Nd:112,rd:4,Le:{Bb:1,Pa:14,Wa:48,Rc:64,Xa:128,nb:768,ud:15360,ii:16384,Ub:32768,Jh:16254,Xi:128,Wc:65535,qb:1022,ka:{Pa:1,Wa:4,nb:8}},Je:{qb:65534},Me:{Pe:1,Qe:4,Re:16,Wi:65408,Hd:63,wc:64,Wb:65408,te:3,ui:8,ka:{wc:6,Wb:7}},vc:{we:{Hi:0,$i:1,Hh:2,Ii:3,xc:4,ye:5,ej:6,Zi:7},wd:8,ve:16,ri:32,ti:64,ue:128,si:256,xi:512,zi:1024,wi:2048,vi:4096,Ai:8192,pi:16384,
|
||||
yi:32768},Ke:{Vc:63},ud:{Oi:1024,hi:2048,Od:2048,Ci:3072,pe:4096,Ya:5120,Vb:8192,Ki:9216},Pa:{Mi:0,Zc:2,Se:4,xc:6,Ce:8,Ve:10,Ae:12,Ti:14}},Pb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"};Nb.tc=[203,2,12,512,Nb.uc.tc|Nb.uc.Kd|Nb.uc.Gd];Ob.He=[512,2,40,256,Ob.vc.we.ye|Ob.vc.wd|Ob.vc.ve];
|
||||
var w="pdp11",Hb="PDPjs",Ib=!1,Jb=Gb,Lb=Kb=!0,Qb={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 Rb(a,b){q.call(this,"Panel",a,512);this.j=this.v=0;this.M=b;this.da=this.g=this.Ua=this.Ta=0;this.B=this.D=-1;this.G=this.I=this.w=!1;this.L=Yb;this.i={};this.b={START:[1,1,!0,!1,this.mf],STEP:[1,1,!1,!1,this.nf],ENABLE:[1,1,!1,!1,this.hf],CONT:[1,1,!0,!1,this.ff],DEP:[0,0,!0,!1,this.gf],EXAM:[1,1,!0,!1,this.jf],LOAD:[1,1,!0,!1,this.lf],TEST:[0,0,!0,!1,this.kf]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.pf,a];this.F=this.f=this.C=this.K=null;y(this)}p(Rb,q);h=Rb.prototype;
|
||||
h.reset=function(a){this.stop();a&&Zb(this,this.Ta=0)};
|
||||
h.ua=function(a,b,c,d){if(this.K&&this.K.ua(a,b,c,d)||this.f&&this.f.ua(a,b,c,d)||this.F&&this.F.ua(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.H[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
||||
b){return function(){$b(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ac(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){$b(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ac(a,b)}}(this,b),!0):q.prototype.ua.call(this,a,b,c,d)}};h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;bc(b,this,cc);dc(b,this.reset.bind(this));ec(this);fc(this)};
|
||||
h.Ca=function(a,b){if(!b)if(this.M&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.da,this.Ta,this.Ua]);return a.data()};h.restore=function(a){if(a=a[0])hc(this,this.da=a[0]),Zb(this,this.Ta=a[1]),ic(this,a[2]);return!0};function jc(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.i)jc(a,c,null!=b?b:a.i[c])}
|
||||
function kc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function fc(a){for(var b in a.b)kc(a,b,a.b[b][1])}function lc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Aa||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function $b(a,b){var c=a.b[b];kc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mc&&(a.G=b==nc,a.I=b==oc)}
|
||||
function ac(a,b){var c=a.b[b];c[2]&&c[3]&&(kc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.mf=function(a){a||this.f.A.T||(a=this.f,a.C.reset(),pc(a),this.b[qc]&&this.b[qc][1]&&rc(this.f))};h.nf=function(){};h.hf=function(a){a||this.f.aa()};
|
||||
h.ff=function(a){if(!a&&!this.f.A.T)if(this.b[qc]&&this.b[qc][1])rc(this.f);else{if((a=this.F)&&!Ja(a,!0))Ka(a,!0),sc(a,0,null),Ka(a,!1);else try{var b=this.f.pc(1);0<b&&(tc(this.f,b),uc(this.f,b,!0),vc(this.f,b))}catch(c){"number"!=typeof c&&Ga(this.f,c.stack||c.message)}this.stop();this.K&&I(this.K)}};h.gf=function(a){if(a&&!this.f.A.T)if(this.G&&wc(this),a=Zb(this,this.Ua),this.L==Yb)xc(this.C,this.da,a);else{var b=this.f,c=this.da;b.oa++;b.C.Sb(yc(b,c,4),a);b.oa--}};
|
||||
h.jf=function(a){a||this.f.A.T||(this.I&&wc(this),a=this.L==Yb?zc(this.C,this.da):Ac(this.f,this.da),Zb(this,a))};h.lf=function(a){a||this.f.A.T||hc(this,this.Ua)};h.kf=function(a){a?(this.w=!0,ec(this,!0)):(this.w=!1,ec(this),ic(this,0))};h.pf=function(a,b){this.Ua=a?this.Ua|1<<b:this.Ua&~(1<<b)};function wc(a){var b=1140>=a.f.ia?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.C.I;a.b[mc]&&a.b[mc][1]||(b=-b);hc(a,a.da&~c|a.da+b&c)}
|
||||
function hc(a,b){a.da=b&a.C.I;if(a.B!==a.da){a.B=a.da;b=a.B;for(var c=0;22>c;c++)Mc(a,"A"+c,b&1<<c)}}function Zb(a,b){a.g=b&65535;if(a.D!==a.g){a.D=a.g;b=a.D;for(var c=0;16>c;c++)Mc(a,"D"+c,b&1<<c)}return a.g}function Mc(a,b,c){a.i[b]=c;a.w||jc(a,b,c)}function Nc(a){return void 0!==a.H[Oc]}function ic(a,b){if(Nc(a)){a.Ua=b;for(var c=0;22>c;c++)a.b["S"+c][1]=b&1<<c?1:0;fc(a)}}h.stop=function(){hc(this,this.f.g[7])};h.kd=function(a){this.da=a};h.setData=function(a,b){b?this.Ta=a:this.g=a};
|
||||
h.uf=function(a,b){return(b?this.Ta:this.Ua)&65535};h.Eg=function(a){this.Ta=a};function gc(){for(var a=x(document,w,"panel"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),e=Ba(d.id);e||(e=new Rb(d,!0));Fa(e,c)}}var Yb=7,Oc="S0",nc="DEP",qc="ENABLE",oc="EXAM",mc="STEP",Pc={},cc=(Pc[65400]=[null,null,Rb.prototype.uf,Rb.prototype.Eg,"CNSW"],Pc);yb(gc);
|
||||
function Qc(a,b,c){q.call(this,"Bus",a,16);this.f=b;this.F=c;this.V=+a.busWidth||16;this.M=1<<this.V;this.I=this.M-1;this.j=Rc;this.g=Math.log2(this.j);this.R=this.j>>2;this.i=this.j-1;this.G=this.M/this.j|0;this.U=this.G-1;this.Na=[];this.la=0;this.D=!1;this.N=[];this.Ye=[Sc,Tc,Uc,Vc];this.b=this.v=[];this.B=this.L=this.w=this.O=this.P=0;a=new J(this);Wc(a,this.F);this.b=Array(this.G);this.v=Array(this.G);for(b=0;b<this.G;b++)this.b[b]=this.v[b]=a;this.B=this.M-Rc;Xc(this,this.B,Rc,Yc,this);this.P=
|
||||
this.O=(this.B&this.I)>>>this.g;this.L=0;this.w=this.I;y(this)}p(Qc,q);function Zc(a,b){if(b!=a.L){for(var c=0;c<a.G;c++)a.v[c]=a.b[c];a.L=0;a.w=a.I;b&&(a.L=b,b=1<<b,a.w=b-1,b-=Rc,a.P=(b&a.w)>>>a.g,a.v[a.P]=a.b[a.O])}}h=Qc.prototype;h.reset=function(){for(var a=0;a<this.N.length;a++)this.N[a]();Zc(this,16)};h.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,$c(this));return a.data()};
|
||||
function Ya(a,b){var c,d={ca:null,ga:null,za:null,ya: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.za=g.load;d.ya=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c<e.length;c++)d.ca[f++]=e[c]&255,d.ca[f++]=e[c]>>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c<e.length;c++)d.ca[f++]=
|
||||
e[c]&255,d.ca[f++]=e[c]>>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ga=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[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;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){v("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ca=e)}return d}
|
||||
function Za(){return"http://"+(window?window.location.host:"www.pcjs.org")}function $a(){if(null==ab){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}ab=a}return ab}function bb(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function cb(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function db(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
|
||||
function eb(a){if(!fb){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}fb=c}return fb[a]}function gb(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function hb(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}function lb(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function mb(a){nb.init.push(a)}
|
||||
function ob(a){if(pb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){v(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function qb(a){!pb&&a?(pb=!0,rb&&sb("init"),tb&&sb("show")):pb=a}function sb(a){nb[a]&&ob(nb[a])}var fb=null,nb={init:[],show:[],exit:[]},rb=!1,tb=!1,pb=!0,ab=null;lb("onload",function(){rb=!0;ob(nb.init)});lb("onpageshow",function(){tb=!0;ob(nb.show)});lb(db("Opera")||db("iOS")?"onunload":"onbeforeunload",function(){ob(nb.exit)});
|
||||
var ub="undefined"!==typeof ArrayBuffer,w="pdp11",wb="PDPjs",Cb=!1,Db=ub,Eb=!0,Fb=!0,Gb="UNKNOWN PANIC ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Hb={nd:5,rd:144,Wc:8,Fc:{kf:15,Nj:16,ck:32,Wd:64,Fa:128,$d:256,Rj:512,Yi:1024,Ec:2048,Xi:4096,gd:57344,ma:{gd:13}},Ye:{ce:1,xi:2,lf:3,Kb:28,Dc:32,Cc:64,Qd:128,Wj:256,Ee:512,ec:1024,Ij:2048,Zd:4096,ak:8192,Gj:16384,Fe:32768,bd:32736},We:{dc:1,wa:14,Jb:48,Ib:64,$a:128,Uj:256,Zi:512,aj:1024,Me:2048,pd:8192,bd:16384,jb:32768,Kb:4608,
|
||||
fc:61438,Sa:3967,ma:{wa:1,Jb:4}},Xe:{od:15,ed:16,bc:8160,tb:57344,ma:{ed:4,bc:5,tb:13}},wa:{Ae:0,hc:2,ub:4,sd:6,Ic:8,Qe:10,Ge:12,bk:14}},Ib={nd:5,rd:112,Wc:4,Pe:"DY",cf:{Fa:1,wa:14,Za:48,Ib:64,$a:128,tb:768,Md:15360,Wi:16384,jb:32768,ui:16254,Qj:128,fc:65535,Sa:1022,ma:{wa:1,Za:4,tb:8}},af:{Sa:65534},df:{mf:1,nf:4,pf:16,Oj:65408,Xd:63,Hc:64,gc:65408,Ie:3,hj:8,ma:{Hc:6,gc:7}},Gc:{Le:{uj:0,Tj:1,si:2,vj:3,Ic:4,Ne:5,Yj:6,Sj:7},Nd:8,Ke:16,ej:32,gj:64,Je:128,fj:256,kj:512,mj:1024,jj:2048,ij:4096,nj:8192,
|
||||
dj:16384,lj:32768},bf:{bb:63},Md:{Fj:1024,Vi:2048,ce:2048,pj:3072,Ee:4096,ab:5120,ec:8192,xj:9216},wa:{zj:0,sd:2,qf:4,Ic:6,Ue:8,sf:10,Re:12,Kj:14}},Jb={nd:5,rd:180,Wc:2,Pe:"DX",ff:{dc:1,wa:14,qd:16,DONE:32,Ib:64,fb:128,INIT:16384,jb:32768,Kb:16128,fc:32992,Sa:16479},Lj:{},jf:{bb:127},hf:{bb:31},gf:{Id:1,Td:2,gd:4,cc:64,Fa:128},wa:{Zc:0,EMPTY:2,hc:4,ub:6,Kb:8,Te:10,Jc:12,Se:14},ERROR:{cd:8,dd:16,ni:24,Oe:32,bj:40,Pj:48,md:56,Dj:72,Cj:80,Bj:88,wi:96,pi:104,Aj:112,ld:120,vi:128,oi:136}},Kb={48:"DL11R",
|
||||
52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11",180:"RX11"};Jb.ef=["DX",77,1,26,128,1,0,0,128,0];Hb.Ec=["RK",203,2,12,512,0,0,0,512,Hb.Fc.Ec|Hb.Fc.$d|Hb.Fc.Wd];Ib.Ze=["RL",512,2,40,256,0,0,0,256,Ib.Gc.Le.Ne|Ib.Gc.Nd|Ib.Gc.Ke];
|
||||
var w="pdp11",wb="PDPjs",Cb=!1,Db=ub,Fb=Eb=!0,Lb={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,rx11:262144,dl11:1048576,serial:1048576,kw11:2097152,timer:2097152,speaker:16777216,computer:33554432,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||
function Mb(a,b){r.call(this,"Panel",a,512);this.j=this.u=0;this.M=b;this.fa=this.g=this.Xa=this.Wa=0;this.B=this.C=-1;this.G=this.I=this.w=!1;this.L=Nb;this.i={};this.b={START:[1,1,!0,!1,this.Nf],STEP:[1,1,!1,!1,this.Of],ENABLE:[1,1,!1,!1,this.Jf],CONT:[1,1,!0,!1,this.Hf],DEP:[0,0,!0,!1,this.If],EXAM:[1,1,!0,!1,this.Kf],LOAD:[1,1,!0,!1,this.Mf],TEST:[0,0,!0,!1,this.Lf]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Pf,a];this.F=this.f=this.D=this.K=null;y(this)}p(Mb,r);h=Mb.prototype;
|
||||
h.reset=function(a){this.stop();a&&Ob(this,this.Wa=0)};
|
||||
h.va=function(a,b,c,d){if(this.K&&this.K.va(a,b,c,d)||this.f&&this.f.va(a,b,c,d)||this.F&&this.F.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.H[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
||||
b){return function(){Pb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Qb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Pb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Qb(a,b)}}(this,b),!0):r.prototype.va.call(this,a,b,c,d)}};h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;Rb(b,this,Sb);Tb(b,this.reset.bind(this));Ub(this);Vb(this)};
|
||||
h.Da=function(a,b){if(!b)if(this.M&&Wb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ca=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.fa,this.Wa,this.Xa]);return a.data()};h.restore=function(a){if(a=a[0])Xb(this,this.fa=a[0]),Ob(this,this.Wa=a[1]),Yb(this,a[2]);return!0};function ec(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Ub(a,b){for(var c in a.i)ec(a,c,null!=b?b:a.i[c])}
|
||||
function fc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Vb(a){for(var b in a.b)fc(a,b,a.b[b][1])}function gc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Ba||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function Pb(a,b){var c=a.b[b];fc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=hc&&(a.G=b==ic,a.I=b==jc)}
|
||||
function Qb(a,b){var c=a.b[b];c[2]&&c[3]&&(fc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Nf=function(a){a||this.f.A.V||(a=this.f,a.D.reset(),kc(a),this.b[lc]&&this.b[lc][1]&&mc(this.f))};h.Of=function(){};h.Jf=function(a){a||this.f.ba()};
|
||||
h.Hf=function(a){if(!a&&!this.f.A.V)if(this.b[lc]&&this.b[lc][1])mc(this.f);else{if((a=this.F)&&!Ba(a,!0))Da(a,!0),nc(a,0,null),Da(a,!1);else try{var b=this.f.Ac(1);0<b&&(oc(this.f,b),pc(this.f,b,!0),qc(this.f,b))}catch(c){"number"!=typeof c&&ya(this.f,c.stack||c.message)}this.stop();this.K&&H(this.K)}};h.If=function(a){if(a&&!this.f.A.V)if(this.G&&rc(this),a=Ob(this,this.Xa),this.L==Nb)sc(this.D,this.fa,a);else{var b=this.f,c=this.fa;b.pa++;b.D.ac(tc(b,c,4),a);b.pa--}};
|
||||
h.Kf=function(a){a||this.f.A.V||(this.I&&rc(this),a=this.L==Nb?uc(this.D,this.fa):vc(this.f,this.fa),Ob(this,a))};h.Mf=function(a){a||this.f.A.V||Xb(this,this.Xa)};h.Lf=function(a){a?(this.w=!0,Ub(this,!0)):(this.w=!1,Ub(this),Yb(this,0))};h.Pf=function(a,b){this.Xa=a?this.Xa|1<<b:this.Xa&~(1<<b)};function rc(a){var b=1140>=a.f.ka?8:16,c=65472<=a.fa&&a.fa<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[hc]&&a.b[hc][1]||(b=-b);Xb(a,a.fa&~c|a.fa+b&c)}
|
||||
function Xb(a,b){a.fa=b&a.D.I;if(a.B!==a.fa){a.B=a.fa;b=a.B;for(var c=0;22>c;c++)wc(a,"A"+c,b&1<<c)}}function Ob(a,b){a.g=b&65535;if(a.C!==a.g){a.C=a.g;b=a.C;for(var c=0;16>c;c++)wc(a,"D"+c,b&1<<c)}return a.g}function wc(a,b,c){a.i[b]=c;a.w||ec(a,b,c)}function xc(a){return void 0!==a.H[yc]}function Yb(a,b){if(xc(a)){a.Xa=b;for(var c=0;22>c;c++)a.b["S"+c][1]=b&1<<c?1:0;Vb(a)}}h.stop=function(){Xb(this,this.f.g[7])};h.Cd=function(a){this.fa=a};h.setData=function(a,b){b?this.Wa=a:this.g=a};
|
||||
h.Uf=function(a,b){return(b?this.Wa:this.Xa)&65535};h.ih=function(a){this.Wa=a};function Wb(){for(var a=x(document,w,"panel"),b=0;b<a.length;b++){var c=a[b],d=wa(c),e=ua(d.id);e||(e=new Mb(d,!0));xa(e,c)}}var Nb=7,yc="S0",ic="DEP",lc="ENABLE",jc="EXAM",hc="STEP",zc={},Sb=(zc[65400]=[null,null,Mb.prototype.Uf,Mb.prototype.ih,"CNSW"],zc);mb(Wb);
|
||||
function Ac(a,b,c){r.call(this,"Bus",a,16);this.f=b;this.F=c;this.U=+a.busWidth||16;this.M=1<<this.U;this.I=this.M-1;this.j=Bc;this.g=Math.log2(this.j);this.R=this.j>>2;this.i=this.j-1;this.G=this.M/this.j|0;this.S=this.G-1;this.Pa=[];this.na=0;this.C=!1;this.N=[];this.uf=[Cc,Dc,Ec,Fc];this.b=this.u=[];this.B=this.L=this.w=this.O=this.P=0;a=new I(this);Gc(a,this.F);this.b=Array(this.G);this.u=Array(this.G);for(b=0;b<this.G;b++)this.b[b]=this.u[b]=a;this.B=this.M-Bc;Hc(this,this.B,Bc,Ic,this);this.P=
|
||||
this.O=(this.B&this.I)>>>this.g;this.L=0;this.w=this.I;y(this)}p(Ac,r);function Jc(a,b){if(b!=a.L){for(var c=0;c<a.G;c++)a.u[c]=a.b[c];a.L=0;a.w=a.I;b&&(a.L=b,b=1<<b,a.w=b-1,b-=Bc,a.P=(b&a.w)>>>a.g,a.u[a.P]=a.b[a.O])}}h=Ac.prototype;h.reset=function(){for(var a=0;a<this.N.length;a++)this.N[a]();Jc(this,16)};h.Da=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ca=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,Vc(this));return a.data()};
|
||||
h.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&d.length<this.R){for(var e=0,f=Array(this.R),g=0;g<d.length-1;)for(var k=d[g++],l=d[g++];k--;)f[e++]=l;d=f}e=this.b[c];if(!e||!e.restore(d)){v("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
||||
function Xc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0<g&&k<a.b.length;){var l=a.b[k],m=k*a.j,n=a.j-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Ob+=l.J-f,l.J=f,!0;if(f>=l.J+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return ad(bd,f,g)}f=new J(a,f,n,a.j,d,e);Wc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cd[d]+" at "+E(b)),!0):ad(dd,b,c)}h.od=function(a){return this.v[(a&this.w)>>>this.g].xb(a&this.i,a)};
|
||||
h.oc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.v[c].na(b,a):this.v[c++].xb(b,a)|this.v[c&this.U].xb(0,a+1)<<8};h.pd=function(a,b){this.v[(a&this.w)>>>this.g].zb(a&this.i,b,a)};h.Sb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.v[d].Ab(c,b,a):(this.v[d++].zb(c,b&255,a),this.v[d&this.U].zb(0,b>>8&255,a+1))};function ed(a,b){return a.b[(b&a.I)>>>a.g]}
|
||||
function zc(a,b){var c;a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|ed(a,b+1).K(0,b+1)<<8;a.la--;return c}function fd(a,b,c){a.D=!1;a.la++;ed(a,b).F(b&a.i,c&255,b);a.la--}function xc(a,b,c){a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?e.D(d,c&65535,b):(e.F(d,c&255,b),ed(a,b+1).F(0,c>>8&255,b+1));a.la--}
|
||||
function $c(a){for(var b=0,c=[],d=0;d<a.G;d++){var e=a.b[d];if(e.ab||e.cf){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[k++]=n-g;l[k++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function gd(a){for(var b=hd,c=0,d=0;d<a.b.length;d++){var e=a.b[d];e.type==b&&(c=e.J+e.Ob)}return c}
|
||||
function id(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var n=b&jd;if(void 0!==a.Na[n])return v("I/O address already registered: "+F(b,8,!0)),!1;var r=l||"unknown";r&&0<=m&&(r+=m++);a.Na[n]=[d,e,f,g,r,k||16,!1]}return!0}
|
||||
function bc(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.ia)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t<u;t++,f+=2)if(r&&1<u&&(r=g[4]+t),!id(a,f,f,k,l,m,n,g[7]||b.fa,r||b.Eb))return!1}}return!0}
|
||||
function dc(a,b){a.N.push(b)}h.La=function(a,b,c){this.D=!0;this.la||(this.F&&A(this.F,4)&&D(this.F,"memory fault ("+c+") on "+K(this.F,a),!0,!0),b&&(this.f.P|=b),this.f.sa(4,0,a))};function kd(a){var b=a.D;a.D=!1;return b}function ad(a,b,c){v("Memory block error ("+a+": "+F(b)+","+F(c)+")");return!1}var Rc=8192,jd=Rc-1,bd=1,dd=2;
|
||||
function Sc(a,b){var c=-1,d=this.controller,e=d.Na[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.Na[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c}
|
||||
function Tc(a,b,c){var d=!1,e=this.controller,f=e.Na[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.Na[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.f&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f,
|
||||
b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Na[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.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c}
|
||||
function Vc(a,b,c){var d=!1,e=this.controller;a=e.Na[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.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+K(this.f,c)+": "+K(this.f,b),!0,!e.la))}function L(a){q.call(this,"Device",a,256);this.b={bb:128,ld:-1}}p(L,q);h=L.prototype;
|
||||
h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.ld=ld(c,function(){e.b.bb|=128;e.b.bb&64&&md(e.f,e.b.Lb);e.K&&I(e.K,1);nd(e.f,e.b.ld,1E3/60)});this.b.Lb=od(c,64,6,524288);bc(b,this,pd);dc(b,this.reset.bind(this));d&&qd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0],
|
||||
!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});y(this)};function rd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n<e;n++)n%m||(g&&(g+="\n"),g+=b+(k?"["+Ra(n)+"]":"")+":"),g+=" "+K(a,c[d+n],l);a.u(g+(f?"\n":""))}}h.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.Ba=function(a){return a?this.save():!0};h.reset=function(){this.b.bb=128;nd(this.f,this.b.ld,1E3/60,!0)};h.save=function(){var a=new G(this);a.set(0,[this.b.bb]);return a.data()};h.restore=function(a){a=ja(a[0]);this.b.bb=a.next().value;return!0};h.Bf=function(){return this.b.bb};h.Lg=function(a){this.b.bb=a&192;this.b.bb&64||sd(this.f,this.b.Lb)};h.Df=function(){return td(this.f)};h.Ng=function(a){ud(this.f,a&-129|this.f.U&128)};h.Ef=function(){return wd(this.f)};h.Ff=function(){return xd(this.f)};
|
||||
h.Gf=function(){return this.f.V};h.Og=function(a){yd(this.f,a)};h.ng=function(a){a=a>>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.wh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.gg=function(a){return this.f.B[1][a>>1&7]};h.ph=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.eg=function(a){return this.f.B[1][(a>>1&7)+8]};h.nh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.fg=function(a){return this.f.M[1][a>>1&7]};
|
||||
h.oh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.dg=function(a){return this.f.M[1][(a>>1&7)+8]};h.mh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Af=function(a){return this.f.B[0][a>>1&7]};h.Kg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.Ig=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.zf=function(a){return this.f.M[0][a>>1&7]};h.Jg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295};
|
||||
h.xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.Hg=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.mg=function(a){return this.f.B[3][a>>1&7]};h.vh=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.kg=function(a){return this.f.B[3][(a>>1&7)+8]};h.th=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.lg=function(a){return this.f.M[3][a>>1&7]};h.uh=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.jg=function(a){return this.f.M[3][(a>>1&7)+8]};
|
||||
h.sh=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Mb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Qb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.Lf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Tg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.Of=function(){return this.f.g[7]};h.Wg=function(a){this.f.g[7]=a};h.Nb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]};
|
||||
h.Rb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.Mf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ug=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.Nf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Vg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.wf=function(a){return this.f.lc[a-65504>>1]};h.Gg=function(a,b){this.f.lc[b-65504>>1]=a};h.de=function(a){return 65520==a?(gd(this.C)>>6)-1:0};
|
||||
h.ie=function(){};h.ig=function(){return 1};h.rh=function(){};h.vf=function(){return this.f.P};h.Fg=function(){this.f.P=0};h.Cf=function(){return this.f.ic};h.Mg=function(a,b){b&1||(a&=255);this.f.ic=a};h.Hf=function(a,b){return b?0:this.f.$a};h.Pg=function(a){zd(this.f,a)};h.hg=function(a,b){return b?0:this.f.va&65280};h.qh=function(a){this.f.va=a|255};h.Kf=function(){return Ad(this.f)};h.Sg=function(a){Bd(this.f,a)};h.he=function(a,b){A(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)};
|
||||
var N={},pd=(N[61568]=[null,null,L.prototype.ng,L.prototype.wh,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.gg,L.prototype.ph,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.eg,L.prototype.nh,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.fg,L.prototype.oh,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.dg,L.prototype.mh,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.Af,L.prototype.Kg,"KIPDR",8,1140,64],N[62672]=[null,null,L.prototype.yf,L.prototype.Ig,"KDPDR",8,1145,64],N[62688]=
|
||||
[null,null,L.prototype.zf,L.prototype.Jg,"KIPAR",8,1140,64],N[62704]=[null,null,L.prototype.xf,L.prototype.Hg,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.Gf,L.prototype.Og,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.Bf,L.prototype.Lg,"LKS"],N[65402]=[null,null,L.prototype.Df,L.prototype.Ng,"MMR0",1,1140,64],N[65404]=[null,null,L.prototype.Ef,L.prototype.he,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.Ff,L.prototype.he,"MMR2",1,1140,64],N[65408]=[null,null,L.prototype.mg,L.prototype.vh,
|
||||
"UIPDR",8,1140,64],N[65424]=[null,null,L.prototype.kg,L.prototype.th,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.lg,L.prototype.uh,"UIPAR",8,1140,64],N[65456]=[null,null,L.prototype.jg,L.prototype.sh,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Mb,L.prototype.Qb,"R0SET0"],N[65473]=[null,null,L.prototype.Mb,L.prototype.Qb,"R1SET0"],N[65474]=[null,null,L.prototype.Mb,L.prototype.Qb,"R2SET0"],N[65475]=[null,null,L.prototype.Mb,L.prototype.Qb,"R3SET0"],N[65476]=[null,null,L.prototype.Mb,
|
||||
L.prototype.Qb,"R4SET0"],N[65477]=[null,null,L.prototype.Mb,L.prototype.Qb,"R5SET0"],N[65478]=[null,null,L.prototype.Lf,L.prototype.Tg,"R6KERNEL"],N[65479]=[null,null,L.prototype.Of,L.prototype.Wg,"R7KERNEL"],N[65480]=[null,null,L.prototype.Nb,L.prototype.Rb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Nb,L.prototype.Rb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Nb,L.prototype.Rb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Nb,L.prototype.Rb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Nb,
|
||||
L.prototype.Rb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Nb,L.prototype.Rb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Mf,L.prototype.Ug,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Nf,L.prototype.Vg,"R6USER",1,1145],N[65504]=[null,null,L.prototype.wf,L.prototype.Gg,"CTRL",8,1170],N[65520]=[null,null,L.prototype.de,L.prototype.ie,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.de,L.prototype.ie,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ig,L.prototype.rh,"SYSID",1,1170],N[65526]=
|
||||
[null,null,L.prototype.vf,L.prototype.Fg,"ERR",1,1170],N[65528]=[null,null,L.prototype.Cf,L.prototype.Mg,"MBR",1,1170],N[65530]=[null,null,L.prototype.Hf,L.prototype.Pg,"PIR"],N[65532]=[null,null,L.prototype.hg,L.prototype.qh,"SLR"],N[65534]=[null,null,L.prototype.Kf,L.prototype.Sg,"PSW"],N);
|
||||
yb(function(){for(var a=x(document,w,"device"),b=0;b<a.length;b++){var c,d=a[b];c=Ea(d);switch(c.type){case "default":c=new L(c);Fa(c,d);break;case "pc11":c=new Cd(c);Fa(c,d);break;case "rl11":c=new Dd(c);Fa(c,d);break;case "rk11":c=new O(c),Fa(c,d)}}});
|
||||
function J(a,b,c,d,e,f){this.C=a;this.id=Ed+=2;this.b=null;this.J=b;this.Ob=c;this.size=d||0;this.type=e||Fd;this.j=e==Gd;this.f=this.controller=null;this.xb=this.K=this.ed;this.na=this.B=this.fd;this.zb=this.F=this.Pb;this.Ab=this.D=this.Gc;this.H=this.i=0;Wc(this);this.ab=this.cf=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Hd(this,f.Ye);else if(Gb)this.v=new ArrayBuffer(this.size),this.w=new DataView(this.v,0,this.size),this.g=new Uint8Array(this.v,0,this.size),this.G=new Uint16Array(this.v,
|
||||
0,this.size>>1),this.b=new Int32Array(this.v,0,this.size>>2),Hd(this,Id?Jd:Kd);else{a=this.b=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;Hd(this,Ld)}else Hd(this)}h=J.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(Gb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.w.getInt32(b<<2,!0);else a=this.b;return a};
|
||||
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Gb)for(b=0;b<a.length;b++)this.w.setInt32(b<<2,a[b],!0);else this.b=a;return this.ab=!0}return!1};function Hd(a,b){b||(b=Md);Nd(a,b,void 0);Wd(a,b,void 0)}function Nd(a,b,c){c&&a.H||(a.xb=b[0]||a.ed,a.na=b[2]||a.fd);if(c||void 0===c)a.K=b[0]||a.ed,a.B=b[2]||a.fd}function Wd(a,b,c){c&&a.i||(a.zb=!a.j&&b[1]||a.Pb,a.Ab=!a.j&&b[3]||a.Gc);if(c||void 0===c)a.F=b[1]||a.Pb,a.D=b[3]||a.Gc}
|
||||
h.wb=function(a,b){b?this.i++||Wd(this,Xd,!1):this.H++||Nd(this,Xd,!1)};function Yd(a,b){b?--a.i||(a.zb=a.j?a.Pb:a.F,a.Ab=a.j?a.Gc:a.D):--a.H||(a.xb=a.K,a.na=a.B)}function Wc(a,b,c){a.f=b;a.H=a.i=0;c&&((a.H=c.H)&&Nd(a,Xd,!1),(a.i=c.i)&&Wd(a,Xd,!1))}h.ed=function(a,b){this.f&&A(this.f,32)&&D(this.f,"attempt to read invalid address "+K(this.f,b),!0);this.C.La(b,32,2);return 255};
|
||||
h.Pb=function(a,b,c){this.f&&A(this.f,32)&&D(this.f,"attempt to write "+K(this.f,b)+" to invalid addresses "+K(this.f,c),!0);this.C.La(c,32,4)};h.fd=function(a,b){return this.xb(a++,b++)|this.xb(a,b)<<8};h.Gc=function(a,b,c){this.zb(a++,b&255,c++);this.zb(a,b>>8,c)};h.tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.tg=function(a,b){Kb&&a&1&&this.C.La(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};
|
||||
h.Dg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.ab=!0};h.Ah=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.ab=!0};h.rf=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a);return this.K(a,b)};h.pg=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a,2);return this.B(a,b)};
|
||||
h.Bg=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a);this.j?this.Pb(0,b,c):this.F(a,b,c)};h.yh=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a,2);this.j?this.Pb(0,b,c):this.D(a,b,c)};h.qf=function(a){return this.g[a]};h.sf=function(a,b){a=this.g[a];this.f&&A(this.f,32)&&D(this.f,"Memory.readByte("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.og=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)};
|
||||
h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.ab=!0};h.Cg=function(a,b,c){this.g[a]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.ab=!0};
|
||||
h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Md=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh];
|
||||
if(Gb)var Kd=[J.prototype.qf,J.prototype.Ag,J.prototype.og,J.prototype.xh],Jd=[J.prototype.sf,J.prototype.Cg,J.prototype.sg,J.prototype.zh];var ae;if(Gb){var be=new ArrayBuffer(2);(new DataView(be)).setUint16(0,256,!0);ae=256===(new Uint16Array(be))[0]}else ae=!1;var Id=ae;
|
||||
function ce(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Kc=0;this.Ic=b;this.hb=c;this.Sc=Math.round(this.Ic/1E4)/100;this.sb=this.Sc*this.hb;this.Tc=this.dc=this.vb=this.Jc=0;this.A.T=this.A.Dc=!1;this.A.qa=a.autoStart;"string"==typeof this.A.qa&&(this.A.qa="true"==this.A.qa);this.A.Fb=!1;this.bc=this.Ib=0;this.cc=+a.csStart;this.Gb=+a.csInterval;this.Jb=+a.csStop;this.ha=[];this.Id=this.xg.bind(this);this.ib=this.Ia=this.gb=this.b=this.ja=this.Ha=this.ac=this.fb=this.Kb=
|
||||
this.Uc=this.rb=0;this.ta=null;y(this)}p(ce,q);h=ce.prototype;h.za=function(a,b,c,d){this.K=a;this.C=b;this.F=d;this.ta=a.i;for(a=0;a<de.length;a++)(b=this.H[de[a]])&&this.K.ua(null,de[a],b);y(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.Ca=function(a,b){var c=ee(this.K,"autoStart");null!=c?this.A.qa="true"==c?!0:"false"==c?!1:!!c:null==this.A.qa&&(this.A.qa=!this.F&&void 0===this.H.run);if(!b){if(a){fe(this);if(!this.restore(a))return!1;ge(this)}else this.reset();this.F?(a=this.F,b=this.A.qa,a.Ea=!0,a.u("Type ? for help with PDPjs Debugger commands"),he(a),b||ie(a),a.ta&&(b=a.ta,a.ta=null,je(a,b))):this.status("No debugger detected");this.A.qa||this.u("CPU will not be auto-started "+(this.ta?"(click Run to start)":"(type 'go' to start)"))}return!0};
|
||||
h.Ba=function(a){return a?this.save():!0};h.qa=function(){return this.A.T?!0:this.A.qa?(rc(this),!0):!1};h.Xd=function(){return 0};function ge(a){void 0===a.cc&&(a.cc=0);void 0===a.Gb&&(a.Gb=-1);void 0===a.Jb&&(a.Jb=-1);a.A.Fb=0<=a.cc&&0<a.Gb;a.A.Fb&&(a.bc=0,a.Ib=a.cc-a.ib)}function vc(a,b){if(a.A.Fb){var c=!1;a.bc=a.bc+a.Xd()|0;a.Ib-=b;0>=a.Ib&&(a.Ib+=a.Gb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Gb=a.Jb=-1,ge(a),a.aa(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}}
|
||||
h.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.Z)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.A.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.A.Z);c++);c==k.length&&(b=a);v("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.yc?" (waiting for notification)":""))+".");a=!1}a&&(d.A.T?d.aa():rc(d))},!0;
|
||||
case "speed":return this.H[b]=c,!0;case "setSpeed":return this.H[b]=c,c.onclick=function(){le(d,d.hb<<1,!0)},c.textContent=this.sb.toFixed(2)+"Mhz",!0}return!1};function uc(a,b,c){a.ib+=b;c&&(a.gb=a.b=a.ja=0)}function me(a,b){var c=1;b&&1<a.hb&&a.rb&&(c=a.rb/a.Sc);a.Tc=Math.round(1E3/ne);a.dc=Math.floor(a.Ic/ne*c);b||(a.vb=a.dc);a.Jc=0}function ke(a){return a.ib+a.Ia+a.gb-a.b}function fe(a){a.rb=0;a.Uc=0;a.ib=a.Ia=a.gb=a.b=a.ja=0;ge(a);le(a,1)}
|
||||
function le(a,b,c){var d=!1;if(void 0!==b){.8>a.rb/a.sb?b=1:d=!0;a.hb=b;b=a.Sc*a.hb;if(a.sb!=b){a.sb=b;b=a.sb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.K&&oe(a.K)}uc(a,a.Ia);a.Ia=0;a.Ha=ya();a.fb=0;me(a);return d}function ld(a,b){var c=a.ha.length;a.ha.push([-1,b]);return c}function nd(a,b,c,d){0<=b&&b<a.ha.length&&(d||0>a.ha[b][0])&&(c=a.Ic*a.hb/1E3*c|0,a.A.T&&(c+=pe(a)),a.ha[b][0]=c)}
|
||||
function qe(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function re(a){for(var b=[],c=0;c<a.ha.length;c++)b.push(a.ha[c][0]);return b}function tc(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pe(a,b){var c=a.gb-=a.b;a.b=a.ja=0;b&&(a.gb=0);return c}
|
||||
h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Fb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.aa();this.K&&this.K.stop(ya(),ke(this));
|
||||
Ga(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Id;this.fb=ya();var c=this.Tc;this.Kb&&(c=Math.round(c*this.Kb/this.dc));var c=c-(this.fb-this.ac),d=this.fb-this.Ha;d&&(this.rb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.ib=0,le(this)));if(0>c||this.rb<this.sb)-1E3>c&&(this.Ha-=c),c=0;this.Jc+=this.Kb;this.fb+=c;a(b,c)}}};
|
||||
function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.aa=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"];
|
||||
function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Za=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.$a=this.va=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Db=this.af,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Db=this.bf,
|
||||
this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140<this.ia?2048:0);this.qc=this.nc=this.oa=0;this.R=null;this.$b=[];this.Xb=this.Lc=this.Wd;this.Yb=this.Mc=this.ae;this.Ec=this.Nc=this.fe;this.Zb=this.Qc=this.ge;this.Ga=this.ob=this.fc=this.gc=0;this.Ea=this.$d;this.na=this.gd;this.Ab=this.md;this.v=this.j=this.Hc=this.X=this.Y=0;this.A.complete=!1}p(te,ce);h=te.prototype;
|
||||
h.za=function(a,b,c,d){ce.prototype.za.call(this,a,b,c,d);this.Lc=b.od.bind(b);this.Mc=b.oc.bind(b);this.Nc=b.pd.bind(b);this.Qc=b.Sb.bind(b)};h.Ca=function(a,b){for(var c=192,d=0;d<this.$b.length;d++){var e=this.$b[d];0>e.yb&&(e.yb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)};
|
||||
h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.aa();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,
|
||||
65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Za=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.$a=0;a.va=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))}
|
||||
function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Wd,a.Yb=a.ae);a.gc&&(a.Ec=a.fe,a.Zb=a.ge);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.$d,a.na=a.fc?a.rg:a.gd,a.Ab=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.ee,a.Ab=a.gc?a.Bh:a.je,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b}
|
||||
function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))}
|
||||
function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.Z?a.A.T||rc(a):a.A.qa=!0}else a.F&&a.A.Z?a.aa()||(he(a.F),I(a.K,-1)):!1===c&&a.aa();!a.A.T&&a.ta&&a.ta.stop()}h.Xd=function(){return 0};
|
||||
h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.$a,this.va,this.ub,this.mb,this.cb,this.i,this.O,this.Za,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.qa]);a.set(3,ze(this));a.set(4,re(this));return a.data()};
|
||||
h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.$a=b.next().value;this.va=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Za=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);ud(this,b[1]);
|
||||
this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.qa=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.$b.length;d++){var e=this.$b[d];if(e.yb===b[c]){d=e;break a}}d=null}d&&(d.next=this.R,this.R=d)}a=a[4];for(b=0;b<this.ha.length&&b<a.length;b++)this.ha[b][0]=a[b];return!0};function Ae(a){return a.D&65536?1:0}function Be(a){return a.G&32768?2:0}function Ce(a){return a.L&65535?0:4}function De(a){return a.I&32768?8:0}
|
||||
function Ee(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function P(a,b,c){c&&(ye(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={yb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)}
|
||||
function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.yb),a=a.next;return b}
|
||||
function Ge(a){return a.i&64?(a.sa(168,64,-6),!0):a.i&32?(a.sa(4,32,-5),!0):a.i&16?(a.sa(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.$a=b}
|
||||
h.Da=function(a){this.I=this.L=a;this.G=0};h.lb=function(a,b){this.I=this.L=this.D=a;this.G=b||0};function He(a,b){a.I=a.L=a.D=b;a.G=a.I^a.D>>1}function Ie(a,b,c,d){a.I=a.L=a.D=b;a.G=(c^d)&(d^b)}
|
||||
h.sa=function(a,b,c){if(!this.oa){0>this.Za?this.Za=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Za>>2&12288);Je(this,this.Za);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Za=-1;this.nc=c;this.qc=a;-1==c&&this.aa();if(-4<=c)throw a;}};
|
||||
function Ke(a){var b=Le(a),c=Le(a);a.w&49152&&(c=c&-225|a.w&63712);ye(a,b);Bd(a,c);a.i&=-17}function Me(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||
function Ne(a,b,c){var d=[];if(c){c=Me(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.tb){var e=a.N<<1,f=b>>13;7<f&&(e|=1);a.V&a.Ed[a.N]||(f&=7);b&=8191;var g=a.M[a.N][f]<<6;c=g+b&a.eb;3932160<=c&&(c=Me(a,c));d.push(c);d.push(b);d.push(e);d.push(f&7);d.push(g);d.push(a.eb)}else c=b&65535,57344<=c&&(c|=a.ob),d.push(c);return d}
|
||||
function yc(a,b,c){var d,e,f;if(!(c&a.tb))return f=b&65535,57344<=f&&(f|=a.ob),f;d=b>>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f<a.ob?(a.P|=32,a.sa(4,0,f)):f&1&&!(c&1)&&(a.P|=64,a.sa(4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&
|
||||
(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Za&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,ud(a,a.U&-61695|g&61694)),a.sa(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Db(4,-2,c);a.Ab(c,b)}
|
||||
function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.Db(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Db(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Db(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Db(d,
|
||||
0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.af=function(a,b,c){!this.N&&0>=b&&c<=this.va&&(this.i|=32)};h.bf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.va&&(c<=this.va-32?this.sa(4,0,-4):(this.P|=8,this.i|=32)))};h.Wd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.ae=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)};
|
||||
h.fe=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.ge=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.$d=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.ee=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.ee(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))};
|
||||
h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.je=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.je(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c}
|
||||
function Re(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Oe(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=yc(a,e|c&65536,4),a.N=a.w>>14&3,a.Zb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Se(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c+a.mc]&a.Fd}function Te(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d+a.mc];return c}function Ue(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Oe(a,b,c,8)}
|
||||
function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function Xe(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(e))),e&1&&a.b--):(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 R(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Zb(e,d.call(a,0>c?a.g[-c-1]:c,a.Yb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function tf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Ec(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
|
||||
function uf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Zb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}
|
||||
h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.aa();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.$a&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.yb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.$a||(this.i&=-3)}else this.i&
|
||||
1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.aa();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.aa();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0<this.b);return this.A.complete?this.gb-this.b:!1===this.A.complete?-1:0};yb(function(){for(var a=x(document,w,"cpu"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),d=new te(d);Fa(d,c)}});
|
||||
function xf(a,b){var c=b+a;this.I=this.L=this.D=c;this.G=(a^c)&(b^c);return c&65535}function yf(a,b){var c=b+a,d=c<<8;this.I=this.L=this.D=d;this.G=(a<<8^d)&(b<<8^d);return c&255}function zf(a,b){a=b<<1;He(this,a);return a&65535}function Af(a,b){a=b<<1;He(this,a<<8);return a&255}function Bf(a,b){a=b&32768|b>>1|b<<16;He(this,a);return a&65535}function Cf(a,b){a=b&128|b>>1|b<<8;He(this,a<<8);return a&255}function Df(a,b){a=b&~a;this.Da(a);return a}function Ef(a,b){a=b&~a;this.Da(a<<8);return a}
|
||||
function Ff(a,b){a|=b;this.Da(a);return a}function Gf(a,b){a|=b;this.Da(a<<8);return a}function Hf(a,b){a=~b|65536;this.lb(a);return a&65535}function If(a,b){a=~b|256;this.lb(a<<8);return a&255}function Jf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Kf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function Lf(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Mf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255}
|
||||
function Nf(a,b){a=-b;this.lb(a,a&b&32768);return a&65535}function Of(a,b){a=-b;this.lb(a<<8,(a&b&128)<<8);return a&255}function Pf(a,b){a=b<<1|this.D>>16&1;He(this,a);return a&65535}function Qf(a,b){a=b<<1|this.D>>16&1;He(this,a<<8);return a&255}function Rf(a,b){a=(this.D&65536|b)>>1|b<<16;He(this,a);return a&65535}function Sf(a,b){a=((this.D&65536)>>8|b)>>1|b<<8;He(this,a<<8);return a&255}function Tf(a,b){var c=b-a;Ie(this,c,a,b);return c&65535}
|
||||
function Uf(a,b){var c=b-a;Ie(this,c<<8,a<<8,b<<8);return c&255}function Vf(a,b){this.I=this.L=b&65280;this.G=this.D=0;return(b<<8|b>>8)&65535}function Wf(a,b){a^=b;this.Da(a);return a&65535}function Xf(a){R(this,a,Te(this,a),xf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}
|
||||
function Yf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.D=this.G=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.D=c<<17-b,c>>=b;else if(b)if(16<b)this.G=c,c=0;else{this.D=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.G=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b}
|
||||
function Zf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.D=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.D=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.G=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function $f(a){P(this,a,!Ae(this))}function ag(a){P(this,a,Ae(this))}
|
||||
function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){Xe(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){Xe(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}
|
||||
function fg(a){var b=Te(this,a);a=We(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){var b=Se(this,a);a=Ve(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function hg(a){P(this,a,Ce(this))}function ig(a){P(this,a,!De(this)==!Be(this))}function jg(a){P(this,a,!Ce(this)&&!De(this)==!Be(this))}function kg(a){P(this,a,!Ae(this)&&!Ce(this))}
|
||||
function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.sa(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5}
|
||||
function wg(a){var b=Te(this,a);a=We(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function xg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}
|
||||
function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=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.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.sa(24,0,-9);this.b-=20}
|
||||
function Ag(){this.w&49152?(this.P|=128,this.sa(4,0,-8)):(this.ta&&1120==this.ia&&this.ta.setData(this.g[0],!0),this.F?Bg(this.F):this.aa());this.b-=7}function Cg(){this.sa(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]}
|
||||
var Hg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ig(a){var b=Te(this,a);this.ja=this.b;uf(this,a,b,this.Da);this.b=this.ja-Hg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Jg(a){var b=Se(this,a);tf(this,a,b,65535,this.Da);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Kg=[7,13,13,17,14,18,17,21];
|
||||
function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767<b?65536:0;this.b-=23}function Mg(){this.b-=5}function Ng(){this.w&49152||(this.C.reset(),pc(this),this.ta&&this.ta.setData(this.g[0],!0));this.b-=667}function Og(a){if(a&8)S.call(this,a);else{var b=Le(this);a&=7;7==a?ye(this,b):(ye(this,this.g[a]),this.g[a]=b);this.b-=9}}function Pg(){Ke(this);this.b-=13}
|
||||
function Qg(a){a&1&&(this.D=65536);a&2&&(this.G=32768);a&4&&(this.L=0);a&8&&(this.I=32768);this.b-=5}function Rg(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.sa(28,0,-9)}
|
||||
function Vg(){this.ta&&(this.ta.kd(this.g[7],!0),this.ta.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.sa(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)}
|
||||
function dh(a){eh[a&15].call(this,a)}function fh(a){gh[a&15].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)}function jh(a){kh[a>>6&3].call(this,a)}function lh(a){mh[a>>6&3].call(this,a)}
|
||||
var Xg=[function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,S,function(a){oh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],nh=[function(a){ph[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,S,S,S],Zg=[function(a){uf(this,a,0,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Jf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=[function(a){R(this,a,0,Nf);
|
||||
this.b-=this.v?11:6},function(a){R(this,a,Ae(this)?1:0,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,Ae(this)?1:0,Tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=We(this,a);this.lb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],ch=[function(a){R(this,a,0,Rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)}],ph=
|
||||
[function(a){qh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,S,dh,fh,Tg,Tg,Tg,Tg],qh=[Ag,Vg,Pg,rg,Cg,Ng,S,S,S,S,S,S,S,S,S,S],eh=[Mg,function(){this.D=0;this.b-=5},function(){this.G=0;this.b-=5},vg,function(){this.L=1;this.b-=5},vg,vg,vg,function(){this.I=0;this.b-=5},vg,vg,vg,vg,vg,vg,vg],gh=[Mg,function(){this.D=65536;this.b-=5},function(){this.G=32768;this.b-=5},Qg,function(){this.L=0;this.b-=5},Qg,Qg,Qg,function(){this.I=32768;this.b-=5},Qg,Qg,Qg,Qg,Qg,Qg,Qg],oh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,
|
||||
lh,S,S,S],ih=[function(a){tf(this,a,0,255,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,1,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,1,Kf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh=[function(a){Xe(this,a,0,Of);this.b-=this.v?11:6},function(a){Xe(this,a,Ae(this)?1:0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,Ae(this)?1:0,Uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ve(this,
|
||||
a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){Xe(this,a,0,Sf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){Xe(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,0,Cf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){Xe(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)}];function ve(a){rh[a>>12].call(this,a)}
|
||||
var rh=[function(a){sh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,function(a){th[a>>8&15].call(this,a)},function(a){uh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],sh=[function(a){vh[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,function(a){wh[a>>6&3].call(this,a)},S,S],wh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ye(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Qe(this,a,0);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);
|
||||
this.ja=this.b;this.Da(b);Re(this,a,0,b);this.b=this.ja-Kg[this.v]},function(a){uf(this,a,De(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],vh=[function(a){xh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,function(a){!(a&8)||1145>this.ia?S.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},dh,fh,Tg,Tg,Tg,Tg],xh=[Ag,Vg,function(){Ke(this);this.i|=this.w&16;this.b-=13},rg,Cg,Ng,Pg,function(a){S.call(this,a)},S,S,S,S,S,S,S,S],th=[Lg,Lg,yg,yg,Yf,Yf,Zf,Zf,
|
||||
Wg,Wg,S,S,S,S,Rg,Rg],uh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,lh,function(a){1145>this.ia?S.call(this,a):yh[a>>6&3].call(this,a)},S,S],yh=[function(a){S.call(this,a)},function(a){a=Qe(this,a,65536);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);this.ja=this.b;this.Da(b);Re(this,a,65536,b);this.b=this.ja-Kg[this.v]},function(a){S.call(this,a)}];
|
||||
function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ta(this.j);if(this.j){a=this.j;var b=Ua(this.B);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.ba,c.ea=a.ea):c.j=null);Ah(c)})}}p(zh,q);
|
||||
h=zh.prototype;h.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Ah(this)};h.Ca=function(){this.ea&&(this.F&&Bh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Ba=function(){return!0};
|
||||
function Ah(a){if(!Ia(a)){if(a.j){if(!a.g||!a.C)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ga(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Rc){var c={},c=(c[b]=[zh.prototype.cg,zh.prototype.lh,null,null,null,a.b>>1],c);if(bc(a.C,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Xc(a.C,b,a.b,Gd)){for(c=0;c<a.g.length;c++)fd(a.C,b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.i?
|
||||
b.push(a.i):null!=a.i&&a.i.length&&(b=a.i);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.C,g=d.b,k=[],l=d.v>>>f.g;0<g&&l<f.b.length;)k.push(f.b[l++]),g-=f.j;f=d.C;d=d.b;g=0;for(e>>>=f.g;0<d&&e<f.b.length;){l=k[g++];if(!l)break;f.b[e++]=l;d-=f.j}}a.w||delete a.g}}}y(a)}}h.cg=function(a){return this.g[a-this.v]};h.lh=function(){};yb(function(){for(var a=x(document,w,"rom"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),d=new zh(d);Fa(d,c)}});
|
||||
function Ch(a){q.call(this,"RAM",a);this.ea=this.g=null;this.i=+a.addr;this.j=+a.size;this.xa=a.load;this.wa=a.exec;null!=this.xa&&(this.xa=+this.xa);null!=this.wa&&(this.wa=+this.wa);this.v=!1;this.b=a.file;this.w=Ta(this.b);if(this.b){a=this.b;var b=Ua(this.w);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.ba,c.ea=a.ea,
|
||||
null==c.xa&&(c.xa=a.xa),null==c.wa&&(c.wa=a.wa)):c.b=null);Dh(c)})}}p(Ch,q);Ch.prototype.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Dh(this)};Ch.prototype.Ca=function(a,b){this.ea&&(this.F&&Bh(this.F,this.id,this.i,this.j,this.ea),delete this.ea);b||this.reset();return!0};Ch.prototype.Ba=function(){return!0};
|
||||
function Dh(a){if(a.C&&(!a.v&&a.j&&(Xc(a.C,a.i,a.j,hd)?a.v=!0:a.j=0),!Ia(a))){if(!a.v)v("No RAM allocated");else if(a.b){if(!a.g||!a.C)return;Eh(a,a.g,a.xa,a.wa,a.i)?a.status('Loaded image "'+a.w+'"'):a.S('Error loading image "'+a.w+'"')}y(a)}}
|
||||
Ch.prototype.reset=function(){if(this.v){for(var a=this.C,b=this.i,c=this.j,d=b&a.i,b=b>>>a.g;0<c&&b<a.b.length;){var e=a.b[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(Gb&&e.g)for(k=d;f--&&k<e.g.length;k++)e.g[k]=g;else for(k=d;f--&&k<e.size;k++)e.F(d,g,e.J+d);c-=a.j;b++;d=0}this.g&&Eh(this,this.g,this.xa,this.wa,this.i,!0)}};
|
||||
function Eh(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){D(a,"invalid signature ("+Sa(m)+") at offset "+Sa(n),4096);break}if(l+6>=b.length){D(a,"invalid block at offset "+Sa(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,C=r-=6;0<r&&l<b.length;)m+=b[l++]&255,r--;if(r||l>=b.length){D(a,"insufficient data for block at offset "+Sa(n),4096);
|
||||
break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Sa(n),4096);break}if(C)for(D(a,"loading "+Sa(C)+" bytes at "+Sa(u)+"-"+Sa(u+C),4096);C--;)fd(a.C,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&D(a,"starting address: "+Sa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)fd(a.C,c+e,b[e]);k=!0}if(k){if(null==d||g)a.f.aa(),f=!1;null!=d&&xe(a.f,d,f)}return k}
|
||||
yb(function(){for(var a=x(document,w,"ram"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),d=new Ch(d);Fa(d,c)}});function Fh(a){q.call(this,"Keyboard",a,1024);y(this)}p(Fh,q);Fh.prototype.ua=function(){return!1};Fh.prototype.za=function(a,b,c,d){this.K=a;this.f=c;this.F=d};yb(function(){for(var a=x(document,w,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),d=new Fh(d);Fa(d,c)}});
|
||||
function Gh(a){q.call(this,"SerialPort",a,262144);this.M=+a.adapter;this.U=+a.baudReceive||9600;this.Y=+a.baudTransmit||9600;this.L=a.upperCase;"string"==typeof this.L&&(this.L="true"==this.L);this.v=this.w=null;this.W=+a.tabSize;this.V=+a.charBOL;this.B=0;this.I=!0;this.P=this.N=null;this.R=this.X=-1;this.D=this.b=this.g=0;this.i=[];var b=a.binding;if("console"==b)this.w="";else{var c;a=Hh;b&&(void 0===c&&(c="Panel"),(c=Da(c,this.id))&&(b=c.H[b])&&this.ua(null,a,b))}this.j=this.G=this.O=null;this.exports=
|
||||
{connect:this.be,receiveData:this.Bc,receiveStatus:this.wg,setConnection:this.zg}}p(Gh,q);h=Gh.prototype;
|
||||
h.ua=function(a,b,c){var d=this;switch(b){case Hh:return this.H[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?ta.qd:ta.oe:46==c?b=ta.qd:a.ctrlKey&&c>=ta.nd&&c<=ta.Xe&&(b=c-(ta.nd-ta.le));b&&(a.preventDefault&&a.preventDefault(),d.Bc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.ne&&(b=ta.me);d.Bc(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.Bc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;var e=this;this.P=od(this.f,this.M?-1:48,4,262144);this.R=ld(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),nd(e.f,e.R,1E3/Math.round(e.U/10)));0<=a&&(e.D=a,e.b&128?e.D|=49152:e.b|=128,e.b&64&&md(c,e.P))});this.N=od(this.f,this.M?-1:52,4,262144);this.X=ld(this.f,function(){e.g|=128;e.g&64&&md(c,e.N)});bc(b,this,Ih,this.M?64832+8*(this.M-1)-65392:0);dc(b,this.reset.bind(this));
|
||||
y(this)};h.be=function(a){if(!this.j){var b=ee(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.Eb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.pb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
h.Ca=function(a,b){if(!b)if(this.be(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){Jh(this)};h.save=function(){var a=new G(this);a.set(0,[this.D,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Jh(this,a[0])};function Jh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.D=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0}
|
||||
h.Bc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.i.push(b)}else this.i=this.i.concat(a);nd(this.f,this.R,1E3/Math.round(this.U/10));return!0};h.wg=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&md(this.f,this.P))};h.zg=function(a,b){return this.j?!1:(this.j=a,this.G=b,!0)};
|
||||
h.Qf=function(){var a=this.b&65534;this.b&=-32769;return a};h.Yg=function(a){var b=a^this.b;this.b=this.b&-112|a&111;this.O&&b&6&&(b=0,b=this.I?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.O.call(this.j,b))};h.Pf=function(){this.b&=-129;return this.D};h.Xg=function(){};h.vg=function(){return this.g};h.Eh=function(a){this.g&128&&(a&64?md(this.f,this.N):sd(this.f,this.N));this.g=this.g&-70|a&69};h.ug=function(){return 0};
|
||||
h.Dh=function(a){a&=255;D(this,"transmitByte("+F(a,2,!0)+")");this.G&&this.G.call(this.j,a);a&=127;if(this.v)if(13==a)this.B=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.B&&this.B--;else{if(a){var b;13!=a&&10!=a&&(b=$a[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.B+=c}}else if(null!=this.w){if(10==
|
||||
a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}nd(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Hh="buffer",Kh={},Ih=(Kh[65392]=[null,null,Gh.prototype.Qf,Gh.prototype.Yg,"RCSR"],Kh[65394]=[null,null,Gh.prototype.Pf,Gh.prototype.Xg,"RBUF"],Kh[65396]=[null,null,Gh.prototype.vg,Gh.prototype.Eh,"XCSR"],Kh[65398]=[null,null,Gh.prototype.ug,Gh.prototype.Dh,"XBUF"],Kh);
|
||||
yb(function(){for(var a=x(document,w,"serial"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),d=new Gh(d);Fa(d,c)}});function Cd(a){q.call(this,"PC11",a);this.M=Lh(this,a.autoMount);this.g=0;this.R=+a.baudReceive||3600;this.B=this.D=this.b=0;this.w=[];this.v=Mh;this.i=Nh;this.L=this.j="";this.ba=this.xa=this.wa=null;this.O=-1;this.N=!mb("Mobi")&&window&&"FileReader"in window;this.G=null;this.P=-1;this.I=null}p(Cd,q);
|
||||
function Lh(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Cd.prototype;
|
||||
h.ua=function(a,b,c){var d=this,e=Nh;switch(b){case "listTapes":return this.H[b]=c,c.onchange=function(){var a=d.H.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){v("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick=
|
||||
function(){var a=d.H.listTapes;a&&Qh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.H[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;Qh(d,Ta(b,!0),b,Ph,a)}return!1};return!0;case Rh:return this.H[b]=c,!0}return!1};
|
||||
h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;this.I=Sh(a);var e=this;if(a=Lh(this,ee(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.G=od(this.f,56,4,4096);this.P=ld(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.B<e.w.length&&(e.D=e.w[e.B++]&255,Th(e,e.B/e.w.length*100),e.b|=128,e.b&=-2049,e.b&64&&md(e.f,e.G))});bc(b,this,Uh);dc(b,this.reset.bind(this));Vh(this,"None",Mh,!0);this.N&&Vh(this,"Local Tape",Wh);Vh(this,"Remote Tape",Xh);Yh(this)||y(this)};
|
||||
h.Ca=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.D=0};function Yh(a){a.g=0;var b=a.M.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.H.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=Ta(c,!0)}c&&b?Zh(a,b,c,Ph,!0):$h(a)}return!!a.g}
|
||||
function Qh(a,b,c,d,e){if(c)if(c==Wh)a.S('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Xh){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"');a.v=Xh}else a.v=c;Zh(a,b,c,d,!1,e)}else ai(a,!1)}
|
||||
function Zh(a,b,c,d,e,f){var g=-1;if(a.j.toLowerCase()!=c.toLowerCase()||a.i!=d)g++,ai(a,!0),a.A.jb?a.S("PC11 busy"):(e&&(a.g++,A(a)&&D(a,"auto-loading tape: "+b)),bi(a,b,c,d,f)?g++:a.A.jb=!0);g&&ci(a,a.L,a.j,a.i,a.ba,a.xa,a.wa)}
|
||||
function bi(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),ci(a,b,c,d,e),a.v=Wh);$h(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.Z;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.ba,e.xa,
|
||||
e.wa));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function $h(a){var b=a.H.listTapes;if(b&&b.options){a=a.v||a.j;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Th(a,b){b|=0;if(b!==a.O){var c=a.H[Rh];c&&(c=(c=x(c,di))&&c[0])&&c.style&&(c.style.width=b+"%");a.O=b}}
|
||||
function ci(a,b,c,d,e,f,g){a.L=b;a.j=c;a.i=d;a.ba=e;a.xa=f;a.wa=g;d==Oh?a.I&&Eh(a.I,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.S('No valid memory address for tape "'+b+'"'):(a.B=0,a.w=e,a.status('Loaded tape "'+b+'"'),Th(a,0))}function ai(a,b){if(a.j||!1===b)a.L="",a.j="",b||(a.i&&a.status(a.i==Ph?"tape detached":"tape unloaded"),a.v=Mh,a.i=Nh,$h(a))}h.save=function(){return(new G(this)).data()};h.restore=function(){return!0};h.Jf=function(){return this.b&65534};
|
||||
h.Rg=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&md(this.f,this.G)):(this.b&=-129,this.b|=2048,this.D=0,nd(this.f,this.P,1E3/Math.round(this.R/10))));this.b=this.b&-66|a&65};h.If=function(){this.b&=-129;this.b|=2048;return this.D};h.Qg=function(){};var Mh="",Wh="?",Xh="??",Nh=0,Ph=1,Oh=2,Rh="readProgress",di="pcjs-progress-bar",ei={},Uh=(ei[65384]=[null,null,Cd.prototype.Jf,Cd.prototype.Rg,"PRS"],ei[65386]=[null,null,Cd.prototype.If,Cd.prototype.Qg,"PRB"],ei);
|
||||
function fi(a,b,c){q.call(this,"Disk",{id:a.pb+".disk"+F(++gi,4)},8192);this.controller=a;this.K=a.K;this.F=a.F;this.v=b;this.Va=b.name;this.Ma=this.hd="";this.dd=b.dd;this.ca=this.ma=this.ga=this.ya=this.mode=0;this.b=[];this.i=null;this.j=!1;hi(this,c,b.ca,b.ma,b.ga,b.ya);this.g=this.w=null;y(this)}p(fi,q);h=fi.prototype;h.za=function(a,b,c,d){this.F=d};
|
||||
function hi(a,b,c,d,e,f){a.mode=b;a.ca=c;a.ma=d;a.ga=e;a.ya=f;a.b=[];if("preload"!=a.mode){b=Array(a.ca);for(c=0;c<b.length;c++){d=Array(a.ma);for(e=0;e<d.length;e++){f=Array(a.ga);for(var g=1;g<=f.length;g++)f[g-1]=ii(null,c,e,g,a.ya,0);d[e]=f}b[c]=d}a.b=b}a.i=null}
|
||||
function ji(a,b,c,d,e){var f=c;if(a.g)return!0;a.Va=b;a.Ma=c;a.hd=Ta(c);a.g=e;a.w=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=sa[d];if(e){a.ca=e[0];a.ma=e[1];a.ga=e[2];a.ya=e[3]||512;c=a.ya>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ca);for(d=0;d<a.b.length;d++)for(var u=a.b[d]=Array(a.ma),t=0;t<u.length;t++)for(var C=u[t]=Array(a.ga),z=0;z<C.length;z++){for(var B=ii(null,d,t,z+1,a.ya,0),H=B.data,ob=0;ob<c;ob++,f+=4)var vd=H[ob]=b.getInt32(f,
|
||||
!0),e=e+vd&-1;B.Ja=c;C[z]=B}a.i=e;c=a}else a.S("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.v,c,a.Va,a.Ma),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=Ua(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"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f,
|
||||
null,!0,function(b,c,d){ki(a,b,c,d)})}
|
||||
function ki(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.Z;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0<Ta(a.hd,!0).toLowerCase().indexOf("-readonly"))a.j=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.j=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.Va]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)v(k[0]);else{a.ca=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.ya=l&&l.length||512;for(d=c=0;d<a.ca;d++)for(f=0;f<a.ma;f++)for(g=0;g<a.ga;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,C=u.length;C<t;C++)u[C]=n;li(l,u)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}ii(l,d,f);for(t=
|
||||
0;t<r.length;t++)c=c+r[t]&-1}a.b=k;a.i=c;e=a}else v("Empty disk image: "+a.Va)}catch(z){v("Disk image error ("+b+"): "+z.message)}}a.g&&(a.g.call(a.w,a.v,e,a.Va,a.Ma),a.g=null)}function ii(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.vj=b;a.wj=c;a.Sa=a.Ja=0;a.ab=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var k=g[b];if(!k&&f.Ze&&b<f.ma)for(k=g[b]=Array(f.$e),g=0;g<k.length;g++)k[g]=ii(null,a,b,g+1,f.ce,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Ze&&9==f.Rd&&(d=k[g]=ii(null,a,b,f.Rd,f.ce,0))}}e&&e(d,!1);return d};function li(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f<a.Sa?(a.Ja+=a.Sa-f,a.Sa=f):f>=a.Sa+a.Ja&&(a.Ja+=f-(a.Sa+a.Ja)+1):(a.Sa=f,a.Ja=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function mi(a,b){var c=a.ma*a.ga,d=b/c|0;return d<a.ca?(b%=c,a.seek(d,b/a.ga|0,b%a.ga+1)):null}function ni(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
|
||||
h.save=function(){var a=0,b=[];b[a++]=[this.Ma,this.i,this.ca,this.ma,this.ga,this.ya];if(!this.j)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ja){for(var k=[],l=0,m=g.Sa,n=g.Sa+g.Ja;m<n;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.Sa,k]}}return b};
|
||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?hi(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.i&&e[1]!=this.i&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.i+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.Sa=e;for(k.Ja=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.S("Unable to restore disk '"+this.Va+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)oi(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 oi(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var gi=0;function Ii(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.g=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ii,q);
|
||||
function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ii.prototype;
|
||||
h.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&&
|
||||
Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.S("Unable to boot the selected drive"):a.ra?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c);
|
||||
break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[La(a.value,10)||0])if(a=a.ra){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;l<m;l++)b+=String.fromCharCode(ni(a,k,l));b=btoa(b);a=a.hd.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+
|
||||
a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");v(a)}else d.S("No disk loaded in drive.");else d.S("No disk drive selected.")};return!0;case "mountDisk":if(this.M)return this.H[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;Mi(d,Ta(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;if(a=Ki(this,ee(this.K,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.L[e]=a[e]);this.reset();this.Lb=od(this.f,this.O.Nd,this.O.Dd,this.fa);bc(b,this,this.R);dc(b,this.reset.bind(this));Ni(this,"None",Oi,!0);this.M&&Ni(this,"Local Disk",Pi);Ni(this,"Remote Disk",Qi);Ri(this)||y(this)};
|
||||
h.Ca=function(a,b){if(!b){if(!a){if(this.reset(),this.K.M){this.v=[];for(a=0;a<this.g.length;a++)Si(this,a,!0);Ri(this,!0)}}else if(!this.restore(a))return!1;if(a=this.H.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;b<this.N;b++){var c=document.createElement("option");c.value=b;c.text=this.type.substr(0,2)+b;a.appendChild(c)}0<this.N&&(a.value="0",Li(this,0))}}return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){this.Ac();Ti(this)};
|
||||
h.save=function(){var a=new G(this);a.set(0,this.jd());a.set(1,Ui(this));a.set(2,Vi(this));return a.data()};h.restore=function(a){var b=!0;this.Ac(a[0])||(b=!1);var c=a[1];c&&(this.v=c);Ti(this,a[2])||(b=!1);return b};h.Ac=function(){return!0};h.jd=function(){return[]};
|
||||
function Ti(a,b){for(var c=0;c<a.g.length;c++){var d=a.g[c];void 0===d&&(d=a.g[c]={});var e=a,f=d,d=c,g=a.P,k=b&&b[c];f.zc=d;f.name=e.Eb;f.cd=f.Hb=!1;f.dd=!0;f.ca=g[0];f.ma=g[1];f.ga=g[2];f.ya=g[3];f.status=g[4];f.pj=0;f.oj=0;f.Rd=1;f.$e=f.ga;f.ce=f.ya;f.xj=0;f.Ej=null;f.ra||(f.Ma="");if(k){var l=k[1],g=k[2];k[0]?(f=l,k=e.g[d],Si(e,d,!0),k.Hb=!0,d=new fi(e,k,"preload"),e.Vd(k,d,f,g,!0)):Wi(e,d,l,g,!0)?f.ra&&g&&Xi(e,l,g,f.ra):y(e,!1)}}return!0}
|
||||
function Vi(a){for(var b=[],c=0;c<a.g.length;c++){var d=a.g[c];b.push([d.Hb,d.Va,d.Ma])}return b}function Ui(a){for(var b=0;b<a.g.length;b++){var c=a.g[b];c.ra&&Yi(a,c.Ma,c.ra)}return a.v}
|
||||
function Ri(a,b){b||(a.G=0);for(var c in a.L){var d=a.L[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.H.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=Ta(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.g.length)){!Wi(a,g,f,e,!0)&&b&&y(a,!1);continue}a.S("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.G}
|
||||
function Mi(a,b,c,d){var e=a.H.listDrives,e=e&&La(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wi(a,e,b,c,!1,d)}else Si(a,e)}
|
||||
function Wi(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Ma.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.Hb=!!f,ji(new fi(a,k,"preload"),c,d,f,a.Vd)&&g++));return g}
|
||||
h.Vd=function(a,b,c,d,e){a.cd=!1;b&&(b.ca>a.ca||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.zc)),b=null);b?(a.ra=b,a.Va=c,a.Ma=d,Xi(this,c,d,b),this.S('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.zc),a.bd||e),this.K&&oe(this.K)):a.Hb=!1;a.bd&&(a.bd=!1,--this.G||y(this));Li(this,a.zc)};
|
||||
function Ni(a,b,c,d){if((a=a.H.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function Li(a,b,c){var d=!1;if(0<=b&&b<a.g.length){var e=a.g[b],f=a.H.listDisks;a=a.H.listDrives;if(f&&a&&f.options&&a.options){if(c)for(c=0;c<a.options.length;c++)if(La(a.options[c].value,10)==e.zc){a.selectedIndex!=c&&(a.selectedIndex=c);d=!0;break}c=La(a.value,10);e=e.Hb?Pi:e.Ma;if(!isNaN(c)&&c==b){for(c=0;c<f.options.length;c++)if(f.options[c].value==e){f.selectedIndex!=c&&(f.selectedIndex=c);d=!0;break}c==f.options.length&&(f.selectedIndex=0)}}}return d}
|
||||
h.yg=function(a){var b=this.H.listDrives;if(b&&b.options)for(var c=b.options.length,d=0;d<c;d++)if(b.options[d].innerHTML==a){var e=La(b.options[d].value,10);if(0<=e)return Li(this,e,!0)}return!1};function Si(a,b,c){var d=a.g[b];if(d.ra||!1===c)Yi(a,d.Ma,d.ra),d.Va="",d.Ma="",d.ra=null,d.Hb=!1,c||(a.S("Drive "+(a.type.substr(0,2)+b)+" unloaded",c),Li(a,b))}function Xi(a,b,c,d){var e;for(e=0;e<a.v.length;e++)if(a.v[e][1]==c){d.restore(a.v[e][2]);return}a.v[e]=[b,c,[]]}
|
||||
function Yi(a,b,c){var d;for(d=0;d<a.v.length;d++)if(a.v[d][1]==b){a.v[d][2]=c.save();break}}h.hc=function(){return!1};h.Fc=function(){return!1};var Oi="",Pi="?",Qi="??";function O(a){Ii.call(this,"RK11",a,65536,Nb,Nb.tc,Zi);this.I=this.i=this.b=this.B=this.w=this.j=this.D=0}p(O,Ii);h=O.prototype;
|
||||
h.Ac=function(a){a||(a=[$i.tc|$i.Kd|$i.Gd,0,T.Xa,0,0,0,0]);a=ja(a);this.I=a.next().value;this.i=a.next().value;this.b=a.next().value;this.B=a.next().value;this.w=a.next().value;this.j=a.next().value;this.D=a.next().value;return!0};h.jd=function(){return[this.I,this.i,this.b,this.B,this.w,this.j,this.D]};
|
||||
h.hc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ra;var n=null,r;a||(m=U.Ad,e=0);for(;e;){if(!n){if(b>=a.ca){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ra;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ca){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.De=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Cb|f>>16-T.ka.Cb&T.Cb;this.B=65536-e&65535;this.j=this.j&~aj.Xc|d&aj.Xc;this.i|=a;bj(this);return!0};function bj(a){a.b&=~T.Ub;a.i&&(a.i|=U.qe,a.b|=T.Ub,a.i&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.i)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.i};h.eh=function(){};h.Sf=function(){return this.b&T.Wc};
|
||||
h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&aj.nb)>>aj.ka.nb,f=this.g[e],g,k,l,m,n,r;this.b&=~(T.Xa|T.Yc);this.i&=~U.Oe;switch(c=this.b&T.Pa){case cj.ke:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.i=this.j=0;this.b=T.Xa;break;case cj.ze:d="RCHK";case cj.Be:d||(d="READ"),b=this.hc;case cj.Zc:d||(d="WCHK");case cj.We:d||(d="WRITE");b||(b=this.Fc);g=(this.j&aj.Tb)>>aj.ka.Tb;k=(this.j&aj.Pc)>>aj.ka.Pc;l=this.j&aj.Xc;m=65536-this.B&65535;n=(this.b&T.Cb)<<
|
||||
16-T.ka.Cb|this.w;r=this.b&T.xe?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ca){this.i|=U.rc;break}if(l>=f.ga){this.i|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=cj.Zc,this.De.bind(this));break;case cj.xc:g=(this.j&aj.Tb)>>aj.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g<f.ca?this.b|=T.Yc:this.i|=U.rc;break;case cj.re:A(this)&&D(this,this.type+": DRESET("+e+")");this.i=this.j=0;this.b=T.Xa|T.Yc;break;default:A(this)&&D(this,this.type+": UNSUPPORTED("+
|
||||
c+")")}this.I=f.status|(f.ra?$i.Bb:0)|e<<$i.ka.xd|this.j&$i.Ne;bj(this);a&&(this.b&=~T.vd,this.b|=T.Xa,this.b&T.Rc&&md(this.f,this.Lb))}};h.Xf=function(){return this.B};h.fh=function(a){this.B=a};h.Rf=function(){return this.w};h.Zg=function(a){this.w=a};h.Tf=function(){return this.j};h.ah=function(a){this.j=a};h.Uf=function(){return this.D};h.bh=function(a){this.D=a};
|
||||
var $i=Nb.uc,U=Nb.Ge,T=Nb.Ee,aj=Nb.Fe,cj=Nb.Pa,dj={},Zi=(dj[65280]=[null,null,O.prototype.Vf,O.prototype.dh,"RKDS"],dj[65282]=[null,null,O.prototype.Wf,O.prototype.eh,"RKER"],dj[65284]=[null,null,O.prototype.Sf,O.prototype.$g,"RKCS"],dj[65286]=[null,null,O.prototype.Xf,O.prototype.fh,"RKWC"],dj[65288]=[null,null,O.prototype.Rf,O.prototype.Zg,"RKBA"],dj[65290]=[null,null,O.prototype.Tf,O.prototype.ah,"RKDA"],dj[65294]=[null,null,O.prototype.Uf,O.prototype.bh,"RKDB"],dj);
|
||||
function Dd(a){Ii.call(this,"RL11",a,131072,Ob,Ob.He,ej);this.b=this.D=this.i=this.j=this.B=this.w=0}p(Dd,Ii);h=Dd.prototype;h.Ac=function(a){a||(a=[V.Bb|V.Xa,0,0,0,0,0]);a=ja(a);this.b=a.next().value;this.D=a.next().value;this.i=a.next().value;this.j=a.next().value;this.B=a.next().value;this.w=a.next().value;return!0};h.jd=function(){return[this.b,this.D,this.i,this.j,this.B,this.w]};
|
||||
h.hc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ra;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){if(!k){k=a.seek(b,c,d+1);if(!k){g=fj.Ya;break}m=0}var n,r;if(0>(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=fj.Ya;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ca)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ra;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=fj.Ya;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=fj.Ya;break}if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ca)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.Ie=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Wa|f>>16-V.ka.Wa&V.Wa;this.w=f>>16&gj.Vc;this.j=this.i=b<<hj.ka.Wb|(c?hj.wc:0)|d&hj.Hd;this.B=65536-e&65535;a&&(this.b=this.b|a|V.Ub);return!0};h.$f=function(){return this.b&V.Wc};
|
||||
h.ih=function(a){this.b=this.b&~V.qb|a&V.qb;this.w=this.w&60|(a&V.Wa)>>V.ka.Wa;if(!(this.b&V.Xa)){a=!0;var b,c="",d=this.g[(this.b&V.nb)>>V.ka.nb],e=d.ra,f,g,k;this.b&=~V.Bb;switch(this.b&V.Pa){case ij.Se:this.B&jj.wd&&(this.b&=V.Bb|V.Pa|V.Wa);this.B=d.status|this.j&hj.wc|(e&&512==e.ca?jj.ue:0);break;case ij.xc:(this.i&hj.te)==hj.Pe&&(b=this.i&hj.Wb,c=(this.i&hj.Re)<<2,this.j=this.i&hj.Qe?this.j+b:this.j-b,this.i=this.j=this.j&hj.Wb|c);break;case ij.Ce:this.B=this.j;break;case ij.Ae:c="READ",b=this.hc;
|
||||
case ij.Ve:c||(c="WRITE"),b||(b=this.Fc),f=this.i>>hj.ka.Wb,g=this.i&hj.wc?1:0,k=this.i&hj.Hd,!e||f>=e.ca||k>=e.ga?this.b=this.b|fj.Ya|V.Ub:(a=65536-this.B&65535,e=(this.w&gj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.Ie.bind(this)))}a&&(this.b=this.b|V.Bb|V.Xa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&kj.qb};h.ag=function(){return this.i};
|
||||
h.jh=function(a){this.i=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&gj.Vc;this.b=this.b&~V.Wa|(this.w&3)<<V.ka.Wa};
|
||||
var V=Ob.Le,kj=Ob.Je,hj=Ob.Me,jj=Ob.vc,gj=Ob.Ke,fj=Ob.ud,ij=Ob.Pa,lj={},ej=(lj[63744]=[null,null,Dd.prototype.$f,Dd.prototype.ih,"RLCS"],lj[63746]=[null,null,Dd.prototype.Yf,Dd.prototype.gh,"RLBA"],lj[63748]=[null,null,Dd.prototype.ag,Dd.prototype.jh,"RLDA"],lj[63750]=[null,null,Dd.prototype.bg,Dd.prototype.kh,"RLMP"],lj[63752]=[null,null,Dd.prototype.Zf,Dd.prototype.hh,"RLBE"],lj);
|
||||
function mj(a){q.call(this,"Debugger",a);this.Aa=+a.base||16;this.ha=!1;this.w=0;this.O=!1;this.v=-1;this.j=[];this.U={}}p(mj,q);mj.prototype.Yd=function(){return-1};mj.prototype.Zd=function(){};
|
||||
function nj(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.O?b="end":b=a.j[a.v+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(Za(b.substring(c,f))),c=f+1}}return a}
|
||||
function oj(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<<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;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?1:0;break;case "&":d=f&e;break;
|
||||
function Hc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0<g&&k<a.b.length;){var l=a.b[k],m=k*a.j,n=a.j-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Xb+=l.J-f,l.J=f,!0;if(f>=l.J+l.Xb){n=l.size-(f-m);n>g&&(n=g);l.Xb=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return Wc(Xc,f,g)}f=new I(a,f,n,a.j,d,e);Gc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Yc[d]+" at "+E(b)),!0):Wc(Zc,b,c)}h.Gd=function(a){return this.u[(a&this.w)>>>this.g].Eb(a&this.i,a)};
|
||||
h.zc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Fb||b!=this.i?this.u[c].oa(b,a):this.u[c++].Eb(b,a)|this.u[c&this.S].Eb(0,a+1)<<8};h.Hd=function(a,b){this.u[(a&this.w)>>>this.g].Gb(a&this.i,b,a)};h.ac=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Fb||c!=this.i?this.u[d].Hb(c,b,a):(this.u[d++].Gb(c,b&255,a),this.u[d&this.S].Gb(0,b>>8&255,a+1))};function $c(a,b){return a.b[(b&a.I)>>>a.g]}
|
||||
function uc(a,b){var c;a.C=!1;a.na++;var d=b&a.i,e=$c(a,b);Fb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|$c(a,b+1).K(0,b+1)<<8;a.na--;return c}function ad(a,b,c){a.C=!1;a.na++;$c(a,b).F(b&a.i,c&255,b);a.na--}function sc(a,b,c){a.C=!1;a.na++;var d=b&a.i,e=$c(a,b);Fb||d!=a.i?e.C(d,c&65535,b):(e.F(d,c&255,b),$c(a,b+1).F(0,c>>8&255,b+1));a.na--}
|
||||
function Vc(a){for(var b=0,c=[],d=0;d<a.G;d++){var e=a.b[d];if(e.hb||e.Bf){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[k++]=n-g;l[k++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function bd(a){for(var b=cd,c=0,d=0;d<a.b.length;d++){var e=a.b[d];e.type==b&&(c=e.J+e.Xb)}return c}
|
||||
function dd(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var n=b&ed;if(void 0!==a.Pa[n])return v("I/O address already registered: "+F(b,8,!0)),!1;var q=l||"unknown";q&&0<=m&&(q+=m++);a.Pa[n]=[d,e,f,g,q,k||16,!1]}return!0}
|
||||
function Rb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.ka)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var q=g[4],t=g[5]||1,u=0;u<t;u++,f+=2)if(q&&1<t&&(q=g[4]+u),!dd(a,f,f,k,l,m,n,g[7]||b.ha,q||b.Mb))return!1}}return!0}
|
||||
function Tb(a,b){a.N.push(b)}h.Na=function(a,b,c){this.C=!0;this.na||(this.F&&z(this.F,4)&&D(this.F,"memory fault ("+c+") on "+J(this.F,a),!0,!0),b&&(this.f.P|=b),this.f.sa(4,0,a))};function fd(a){var b=a.C;a.C=!1;return b}function Wc(a,b,c){v("Memory block error ("+a+": "+F(b)+","+F(c)+")");return!1}var Bc=8192,ed=Bc-1,Xc=1,Zc=2;
|
||||
function Cc(a,b){var c=-1,d=this.controller,e=d.Pa[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.Pa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&z(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+J(this.f,b)+"): "+J(this.f,c),!0,!d.na),c;d.Na(b,16,3);c=255;this.f&&z(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+J(this.f,b)+": "+J(this.f,c),!0,!d.na);return c}
|
||||
function Dc(a,b,c){var d=!1,e=this.controller,f=e.Pa[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.Pa[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.f&&z(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+J(this.f,c)+","+J(this.f,b)+")",!0,!e.na):(e.Na(c,16,5),this.f&&z(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+J(this.f,c)+": "+J(this.f,
|
||||
b),!0,!e.na))}function Ec(a,b){var c=-1,d=this.controller;a=d.Pa[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.f&&z(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+J(this.f,b)+"): "+J(this.f,c),!0,!d.na),c;d.Na(b,16,2);c=65535;this.f&&z(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+J(this.f,b)+": "+J(this.f,c),!0,!d.na);return c}
|
||||
function Fc(a,b,c){var d=!1,e=this.controller;a=e.Pa[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.f&&z(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+J(this.f,c)+","+J(this.f,b)+")",!0,!e.na):(e.Na(c,16,4),this.f&&z(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+J(this.f,c)+": "+J(this.f,b),!0,!e.na))}function L(a){r.call(this,"Device",a,256);this.b={ib:128,Dd:-1}}p(L,r);h=L.prototype;
|
||||
h.Aa=function(a,b,c,d){this.D=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.Dd=gd(c,function(){e.b.ib|=128;e.b.ib&64&&hd(e.f,e.b.Qa);e.K&&H(e.K,1);id(e.f,e.b.Dd,1E3/60)});this.b.Qa=jd(c,64,6,2097152);Rb(b,this,kd);Tb(b,this.reset.bind(this));d&&ld(d,64,function(a){var b=e.f;md(e,"KIPDR",b.B[0],0,a[0]);md(e,"KDPDR",b.B[0],8,a[0]);md(e,"KIPAR",b.M[0],0,a[0]);md(e,"KDPAR",b.M[0],8,a[0],!0);md(e,"SIPDR",b.B[1],0,a[0]);md(e,"SDPDR",b.B[1],8,a[0]);md(e,"SIPAR",b.M[1],0,a[0]);md(e,"SDPAR",b.M[1],8,a[0],
|
||||
!0);md(e,"UIPDR",b.B[3],0,a[0]);md(e,"UDPDR",b.B[3],8,a[0]);md(e,"UIPAR",b.M[3],0,a[0]);md(e,"UDPAR",b.M[3],8,a[0],!0);b.U&32&&md(e,"UNIMAP",b.Ha,-1,a[0])});y(this)};function md(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n<e;n++)n%m||(g&&(g+="\n"),g+=b+(k?"["+Ga(n)+"]":"")+":"),g+=" "+J(a,c[d+n],l);a.v(g+(f?"\n":""))}}h.Da=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.Ca=function(a){return a?this.save():!0};h.reset=function(){this.b.ib=128;id(this.f,this.b.Dd,1E3/60,!0)};h.save=function(){var a=new G(this);a.set(0,[this.b.ib]);return a.data()};h.restore=function(a){a=ia(a[0]);this.b.ib=a.next().value;return!0};h.ag=function(){return this.b.ib};h.ph=function(a){this.b.ib=a&192;this.b.ib&64||nd(this.f,this.b.Qa)};h.cg=function(){return od(this.f)};h.rh=function(a){pd(this.f,a&-129|this.f.S&128)};h.dg=function(){return qd(this.f)};h.eg=function(){return rd(this.f)};
|
||||
h.fg=function(){return this.f.U};h.sh=function(a){sd(this.f,a)};h.Rg=function(a){a=a>>1&63;var b=this.f.Ha[a>>1];return a&1?b>>16:b&65535};h.di=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ha[c]=b&1?this.f.Ha[c]&65535|(a&63)<<16:this.f.Ha[c]&-65536|a&65534};h.Kg=function(a){return this.f.B[1][a>>1&7]};h.Xh=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Ig=function(a){return this.f.B[1][(a>>1&7)+8]};h.Vh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Jg=function(a){return this.f.M[1][a>>1&7]};
|
||||
h.Wh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Hg=function(a){return this.f.M[1][(a>>1&7)+8]};h.Uh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.$f=function(a){return this.f.B[0][a>>1&7]};h.oh=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.Yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.mh=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.Zf=function(a){return this.f.M[0][a>>1&7]};h.nh=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295};
|
||||
h.Xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.lh=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.Qg=function(a){return this.f.B[3][a>>1&7]};h.ci=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Og=function(a){return this.f.B[3][(a>>1&7)+8]};h.ai=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Pg=function(a){return this.f.M[3][a>>1&7]};h.bi=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ng=function(a){return this.f.M[3][(a>>1&7)+8]};
|
||||
h.$h=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Vb=function(a){a&=7;return this.f.w&2048?this.f.qa[a]:this.f.g[a]};h.Zb=function(a,b){b&=7;this.f.w&2048?this.f.qa[b]=a:this.f.g[b]=a};h.mg=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.zh=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.pg=function(){return this.f.g[7]};h.Ch=function(a){this.f.g[7]=a};h.Wb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.qa[a]};
|
||||
h.$b=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.qa[b]=a};h.ng=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ah=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.og=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Bh=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.Wf=function(a){return this.f.wc[a-65504>>1]};h.kh=function(a,b){this.f.wc[b-65504>>1]=a};h.te=function(a){return 65520==a?(bd(this.D)>>6)-1:0};
|
||||
h.ye=function(){};h.Mg=function(){return 1};h.Zh=function(){};h.Vf=function(){return this.f.P};h.jh=function(){this.f.P=0};h.bg=function(){return this.f.tc};h.qh=function(a,b){b&1||(a&=255);this.f.tc=a};h.gg=function(a,b){return b?0:this.f.eb};h.th=function(a){td(this.f,a)};h.Lg=function(a,b){return b?0:this.f.xa&65280};h.Yh=function(a){this.f.xa=a|255};h.lg=function(){return ud(this.f)};h.yh=function(a){vd(this.f,a)};h.xe=function(a,b){z(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)};
|
||||
var M={},kd=(M[61568]=[null,null,L.prototype.Rg,L.prototype.di,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.Kg,L.prototype.Xh,"SIPDR",8,1145,64],M[62608]=[null,null,L.prototype.Ig,L.prototype.Vh,"SDPDR",8,1145,64],M[62624]=[null,null,L.prototype.Jg,L.prototype.Wh,"SIPAR",8,1145,64],M[62640]=[null,null,L.prototype.Hg,L.prototype.Uh,"SDPAR",8,1145,64],M[62656]=[null,null,L.prototype.$f,L.prototype.oh,"KIPDR",8,1140,64],M[62672]=[null,null,L.prototype.Yf,L.prototype.mh,"KDPDR",8,1145,64],M[62688]=
|
||||
[null,null,L.prototype.Zf,L.prototype.nh,"KIPAR",8,1140,64],M[62704]=[null,null,L.prototype.Xf,L.prototype.lh,"KDPAR",8,1145,64],M[62798]=[null,null,L.prototype.fg,L.prototype.sh,"MMR3",1,1145,64],M[65382]=[null,null,L.prototype.ag,L.prototype.ph,"LKS"],M[65402]=[null,null,L.prototype.cg,L.prototype.rh,"MMR0",1,1140,64],M[65404]=[null,null,L.prototype.dg,L.prototype.xe,"MMR1",1,1145,64],M[65406]=[null,null,L.prototype.eg,L.prototype.xe,"MMR2",1,1140,64],M[65408]=[null,null,L.prototype.Qg,L.prototype.ci,
|
||||
"UIPDR",8,1140,64],M[65424]=[null,null,L.prototype.Og,L.prototype.ai,"UDPDR",8,1145,64],M[65440]=[null,null,L.prototype.Pg,L.prototype.bi,"UIPAR",8,1140,64],M[65456]=[null,null,L.prototype.Ng,L.prototype.$h,"UDPAR",8,1145,64],M[65472]=[null,null,L.prototype.Vb,L.prototype.Zb,"R0SET0"],M[65473]=[null,null,L.prototype.Vb,L.prototype.Zb,"R1SET0"],M[65474]=[null,null,L.prototype.Vb,L.prototype.Zb,"R2SET0"],M[65475]=[null,null,L.prototype.Vb,L.prototype.Zb,"R3SET0"],M[65476]=[null,null,L.prototype.Vb,
|
||||
L.prototype.Zb,"R4SET0"],M[65477]=[null,null,L.prototype.Vb,L.prototype.Zb,"R5SET0"],M[65478]=[null,null,L.prototype.mg,L.prototype.zh,"R6KERNEL"],M[65479]=[null,null,L.prototype.pg,L.prototype.Ch,"R7KERNEL"],M[65480]=[null,null,L.prototype.Wb,L.prototype.$b,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Wb,L.prototype.$b,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Wb,L.prototype.$b,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Wb,L.prototype.$b,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Wb,
|
||||
L.prototype.$b,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Wb,L.prototype.$b,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.ng,L.prototype.Ah,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.og,L.prototype.Bh,"R6USER",1,1145],M[65504]=[null,null,L.prototype.Wf,L.prototype.kh,"CTRL",8,1170],M[65520]=[null,null,L.prototype.te,L.prototype.ye,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.te,L.prototype.ye,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.Mg,L.prototype.Zh,"SYSID",1,1170],M[65526]=
|
||||
[null,null,L.prototype.Vf,L.prototype.jh,"ERR",1,1170],M[65528]=[null,null,L.prototype.bg,L.prototype.qh,"MBR",1,1170],M[65530]=[null,null,L.prototype.gg,L.prototype.th,"PIR"],M[65532]=[null,null,L.prototype.Lg,L.prototype.Yh,"SLR"],M[65534]=[null,null,L.prototype.lg,L.prototype.yh,"PSW"],M);
|
||||
mb(function(){for(var a=x(document,w,"device"),b=0;b<a.length;b++){var c,d=a[b];c=wa(d);switch(c.type){case "default":c=new L(c);xa(c,d);break;case "pc11":c=new wd(c);xa(c,d);break;case "rl11":c=new xd(c);xa(c,d);break;case "rk11":c=new N(c);xa(c,d);break;case "rx11":c=new yd(c),xa(c,d)}}});
|
||||
function I(a,b,c,d,e,f){this.D=a;this.id=zd+=2;this.b=null;this.J=b;this.Xb=c;this.size=d||0;this.type=e||Ad;this.j=e==Bd;this.f=this.controller=null;this.Eb=this.K=this.yd;this.oa=this.B=this.zd;this.Gb=this.F=this.Yb;this.Hb=this.C=this.Sc;this.H=this.i=0;Gc(this);this.hb=this.Bf=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Dd(this,f.uf);else if(ub)this.u=new ArrayBuffer(this.size),this.w=new DataView(this.u,0,this.size),this.g=new Uint8Array(this.u,0,this.size),this.G=new Uint16Array(this.u,
|
||||
0,this.size>>1),this.b=new Int32Array(this.u,0,this.size>>2),Dd(this,Ed?Fd:Gd);else{a=this.b=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;Dd(this,Hd)}else Dd(this)}h=I.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(ub)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.w.getInt32(b<<2,!0);else a=this.b;return a};
|
||||
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(ub)for(b=0;b<a.length;b++)this.w.setInt32(b<<2,a[b],!0);else this.b=a;return this.hb=!0}return!1};function Dd(a,b){b||(b=Id);Jd(a,b,void 0);Kd(a,b,void 0)}function Jd(a,b,c){c&&a.H||(a.Eb=b[0]||a.yd,a.oa=b[2]||a.zd);if(c||void 0===c)a.K=b[0]||a.yd,a.B=b[2]||a.zd}function Kd(a,b,c){c&&a.i||(a.Gb=!a.j&&b[1]||a.Yb,a.Hb=!a.j&&b[3]||a.Sc);if(c||void 0===c)a.F=b[1]||a.Yb,a.C=b[3]||a.Sc}
|
||||
h.Cb=function(a,b){b?this.i++||Kd(this,Ld,!1):this.H++||Jd(this,Ld,!1)};function Md(a,b){b?--a.i||(a.Gb=a.j?a.Yb:a.F,a.Hb=a.j?a.Sc:a.C):--a.H||(a.Eb=a.K,a.oa=a.B)}function Gc(a,b,c){a.f=b;a.H=a.i=0;c&&((a.H=c.H)&&Jd(a,Ld,!1),(a.i=c.i)&&Kd(a,Ld,!1))}h.yd=function(a,b){this.f&&z(this.f,32)&&D(this.f,"attempt to read invalid address "+J(this.f,b),!0);this.D.Na(b,32,2);return 255};
|
||||
h.Yb=function(a,b,c){this.f&&z(this.f,32)&&D(this.f,"attempt to write "+J(this.f,b)+" to invalid addresses "+J(this.f,c),!0);this.D.Na(c,32,4)};h.zd=function(a,b){return this.Eb(a++,b++)|this.Eb(a,b)<<8};h.Sc=function(a,b,c){this.Gb(a++,b&255,c++);this.Gb(a,b>>8,c)};h.Tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.Xg=function(a,b){Eb&&a&1&&this.D.Na(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};
|
||||
h.hh=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.hb=!0};h.hi=function(a,b,c){Eb&&a&1&&this.D.Na(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.hb=!0};h.Rf=function(a,b){this.f&&null!=this.J&&Nd(this.f,this.J+a);return this.K(a,b)};h.Tg=function(a,b){this.f&&null!=this.J&&Nd(this.f,this.J+a,2);return this.B(a,b)};
|
||||
h.fh=function(a,b,c){this.f&&null!=this.J&&Od(this.f,this.J+a);this.j?this.Yb(0,b,c):this.F(a,b,c)};h.fi=function(a,b,c){this.f&&null!=this.J&&Od(this.f,this.J+a,2);this.j?this.Yb(0,b,c):this.C(a,b,c)};h.Qf=function(a){return this.g[a]};h.Sf=function(a,b){a=this.g[a];this.f&&z(this.f,32)&&D(this.f,"Memory.readByte("+J(this.f,b)+"): "+J(this.f,a),!0);return a};h.Sg=function(a,b){Eb&&a&1&&this.D.Na(b,64,2);return this.w.getUint16(a,!0)};
|
||||
h.Wg=function(a,b){Eb&&a&1&&this.D.Na(b,64,2);a=!Fb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&z(this.f,32)&&D(this.f,"Memory.readWord("+J(this.f,b)+"): "+J(this.f,a),!0);return a};h.eh=function(a,b){this.g[a]=b;this.hb=!0};h.gh=function(a,b,c){this.g[a]=b;this.hb=!0;this.f&&z(this.f,32)&&D(this.f,"Memory.writeByte("+J(this.f,c)+","+J(this.f,b)+")",!0)};h.ei=function(a,b,c){Eb&&a&1&&this.D.Na(c,64,4);this.w.setUint16(a,b,!0);this.hb=!0};
|
||||
h.gi=function(a,b,c){Eb&&a&1&&this.D.Na(c,64,4);!Fb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.hb=!0;this.f&&z(this.f,32)&&D(this.f,"Memory.writeWord("+J(this.f,c)+","+J(this.f,b)+")",!0)};var Ad=0,cd=1,Bd=2,Ic=4,Yc=["NONE","RAM","ROM","VID","H/W"],zd=0,Id=[],Hd=[I.prototype.Tf,I.prototype.hh,I.prototype.Xg,I.prototype.hi],Ld=[I.prototype.Rf,I.prototype.fh,I.prototype.Tg,I.prototype.fi];
|
||||
if(ub)var Gd=[I.prototype.Qf,I.prototype.eh,I.prototype.Sg,I.prototype.ei],Fd=[I.prototype.Sf,I.prototype.gh,I.prototype.Wg,I.prototype.gi];var Pd;if(ub){var Qd=new ArrayBuffer(2);(new DataView(Qd)).setUint16(0,256,!0);Pd=256===(new Uint16Array(Qd))[0]}else Pd=!1;var Ed=Pd;
|
||||
function Rd(a,b){r.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Xc=0;this.Uc=b;this.ob=c;this.hd=Math.round(this.Uc/1E4)/100;this.yb=this.hd*this.ob;this.jd=this.pc=this.Bb=this.Vc=0;this.A.V=this.A.Pc=!1;this.A.ra=a.autoStart;"string"==typeof this.A.ra&&(this.A.ra="true"==this.A.ra);this.A.Nb=!1;this.nc=this.Qb=0;this.oc=+a.csStart;this.Ob=+a.csInterval;this.Rb=+a.csStop;this.ia=[];this.Yd=this.ah.bind(this);this.pb=this.Ka=this.nb=this.b=this.la=this.Ja=this.mc=this.mb=this.Sb=
|
||||
this.kd=this.xb=0;this.ta=null;y(this)}p(Rd,r);h=Rd.prototype;h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.F=d;this.ta=a.i;for(a=0;a<Sd.length;a++)(b=this.H[Sd[a]])&&this.K.va(null,Sd[a],b);y(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.Da=function(a,b){var c=Td(this.K,"autoStart");null!=c?this.A.ra="true"==c?!0:"false"==c?!1:!!c:null==this.A.ra&&(this.A.ra=!this.F&&void 0===this.H.run);if(!b){if(a){Ud(this);if(!this.restore(a))return!1;ce(this)}else this.reset();this.F?(a=this.F,b=this.A.ra,a.Ga=!0,a.v("Type ? for help with PDPjs Debugger commands"),de(a),b||ee(a),a.ta&&(b=a.ta,a.ta=null,fe(a,b))):this.status("No debugger detected");this.A.ra||this.v("CPU will not be auto-started "+(this.ta?"(click Run to start)":"(type 'go' to start)"))}return!0};
|
||||
h.Ca=function(a){return a?this.save():!0};h.ra=function(){return this.A.V?!0:this.A.ra?(mc(this),!0):!1};h.le=function(){return 0};function ce(a){void 0===a.oc&&(a.oc=0);void 0===a.Ob&&(a.Ob=-1);void 0===a.Rb&&(a.Rb=-1);a.A.Nb=0<=a.oc&&0<a.Ob;a.A.Nb&&(a.nc=0,a.Qb=a.oc-a.pb)}function qc(a,b){if(a.A.Nb){var c=!1;a.nc=a.nc+a.le()|0;a.Qb-=b;0>=a.Qb&&(a.Qb+=a.Ob,c=!0);0<=a.Rb&&a.Rb<=ge(a)&&(a.Ob=a.Rb=-1,ce(a),a.ba(),c=!0);c&&a.v(ge(a)+" cycles: checksum="+F(a.nc))}}
|
||||
h.va=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.aa)a=!0;else{var b=null,c,k=ta(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.A.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.A.aa);c++);c==k.length&&(b=a);v("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Kc?" (waiting for notification)":""))+".");a=!1}a&&(d.A.V?d.ba():mc(d))},!0;
|
||||
case "speed":return this.H[b]=c,!0;case "setSpeed":return this.H[b]=c,c.onclick=function(){he(d,d.ob<<1,!0)},c.textContent=this.yb.toFixed(2)+"Mhz",!0}return!1};function pc(a,b,c){a.pb+=b;c&&(a.nb=a.b=a.la=0)}function ie(a,b){var c=1;b&&1<a.ob&&a.xb&&(c=a.xb/a.hd);a.jd=Math.round(1E3/je);a.pc=Math.floor(a.Uc/je*c);b||(a.Bb=a.pc);a.Vc=0}function ge(a){return a.pb+a.Ka+a.nb-a.b}function Ud(a){a.xb=0;a.kd=0;a.pb=a.Ka=a.nb=a.b=a.la=0;ce(a);he(a,1)}
|
||||
function he(a,b,c){var d=!1;if(void 0!==b){.8>a.xb/a.yb?b=1:d=!0;a.ob=b;b=a.hd*a.ob;if(a.yb!=b){a.yb=b;b=a.yb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.K&&ke(a.K)}pc(a,a.Ka);a.Ka=0;a.Ja=qa();a.mb=0;ie(a);return d}function gd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function id(a,b,c,d){0<=b&&b<a.ia.length&&(d||0>a.ia[b][0])&&(c=a.Uc*a.ob/1E3*c|0,a.A.V&&(c+=le(a)),a.ia[b][0]=c)}
|
||||
function me(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ne(a){for(var b=[],c=0;c<a.ia.length;c++)b.push(a.ia[c][0]);return b}function oc(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function le(a,b){var c=a.nb-=a.b;a.b=a.la=0;b&&(a.nb=0);return c}
|
||||
h.ah=function(){if(this.A.V){this.Vc>=this.Uc&&ie(this,!0);this.Sb=0;this.mc=qa();if(this.mb){var a=this.mc-this.mb;a>this.jd&&(this.Ja+=a,this.Ja>this.mc&&(this.Ja=this.mc))}try{do{var b=me(this,this.A.Nb?1:this.pc);try{this.Ac(b)}catch(e){if("number"!=typeof e)throw e;}b=le(this,!0);this.Sb+=b;this.Ka+=b;qc(this,b);oc(this,b);this.Bb-=b;if(0>=this.Bb){this.Bb+=this.pc;++this.kd>=oe&&(this.K&&H(this.K,void 0),this.kd=0);break}}while(this.A.V)}catch(e){this.ba();this.K&&this.K.stop(qa(),ge(this));
|
||||
ya(this,e.stack||e.message);return}if(this.A.V){a=setTimeout;b=this.Yd;this.mb=qa();var c=this.jd;this.Sb&&(c=Math.round(c*this.Sb/this.pc));var c=c-(this.mb-this.mc),d=this.mb-this.Ja;d&&(this.xb=Math.round(this.Ka/(10*d))/100,864E5<=d&&(this.pb=0,he(this)));if(0>c||this.xb<this.yb)-1E3>c&&(this.Ja-=c),c=0;this.Vc+=this.Sb;this.mb+=c;a(b,c)}}};
|
||||
function mc(a,b){if(!za(a))if(a.A.V)a.v(a.toString()+" busy");else{he(a);a.A.V=!0;a.A.Pc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&ke(a.K,!0),a.K.start(a.Ja,ge(a)));a.F||a.status("Started");setTimeout(a.Yd,0)}}h.Ac=function(){return 0};h.ba=function(a){var b=!1;if(this.A.V){le(this);pc(this,this.Ka);this.Ka=0;this.A.V=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(qa(),ge(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var je=30,oe=15,Sd=["power","reset"];
|
||||
function pe(a){var b=+a.model||1170;Rd.call(this,a,6666667);this.ka=b;this.Rd=+a.addrReset||0;this.cb=this.w=this.N=this.C=this.G=this.L=this.I=0;this.g=this.qa=this.W=[];this.M=this.B=this.Ha=this.wc=[];this.kb=this.O=this.Pd=this.zb=this.Ab=this.sb=this.lb=this.P=this.tc=this.eb=this.xa=this.S=this.uc=this.vc=this.U=this.i=0;this.Ud=[4,2,0,1];this.xc=0;this.Vd=255;1120>=this.ka?(this.Od=qe.bind(this),this.Lb=this.yf,this.xc=8,this.Vd=-1,this.be=255,this.ae=0):(this.Od=re.bind(this),this.Lb=this.zf,
|
||||
this.be=~(1792|(1140>=this.ka?2048:0))&65535,this.ae=1140<this.ka?2048:0);this.Bc=this.yc=this.pa=0;this.R=null;this.lc=[];this.ic=this.Yc=this.ke;this.jc=this.$c=this.pe;this.Qc=this.ad=this.ve;this.kc=this.fd=this.we;this.Ia=this.vb=this.rc=this.sc=0;this.Ga=this.oe;this.oa=this.Ad;this.Hb=this.Ed;this.u=this.j=this.Tc=this.X=this.Y=0;this.A.complete=!1}p(pe,Rd);h=pe.prototype;
|
||||
h.Aa=function(a,b,c,d){Rd.prototype.Aa.call(this,a,b,c,d);this.Yc=b.Gd.bind(b);this.$c=b.zc.bind(b);this.ad=b.Hd.bind(b);this.fd=b.ac.bind(b)};h.Da=function(a,b){for(var c=192,d=0;d<this.lc.length;d++){var e=this.lc[d];0>e.Fb&&(e.Fb=c,c+=4)}return Rd.prototype.Da.call(this,a,b)};
|
||||
h.reset=function(){this.status("Model "+this.ka);this.A.V&&this.ba();this.C=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rd,-1,-2,-3,-4,-5,-6,-7,-8];this.qa=[0,0,0,0,0,0];this.W=[0,0,0,0];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.B=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,
|
||||
65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.wc=[0,0,0,0,0,0,0,0];this.N=0;this.cb=-1;this.u=this.j=this.Tc=this.X=this.Y=this.i=this.tc=0;kc(this);Ud(this);this.A.error=!1;Rd.prototype.reset.call(this)};function kc(a){a.S=0;a.uc=0;a.vc=0;a.U=0;a.P=0;a.eb=0;a.xa=255;a.zb=0;a.Ab=0;a.sb=0;a.lb=262143;a.kb=a.g[7];a.O=0;a.R=null;a.D&&(se(a),a.Pd=bd(a.D))}
|
||||
function se(a){a.ic=a.Yc;a.jc=a.$c;a.Qc=a.ad;a.kc=a.fd;a.rc&&(a.ic=a.ke,a.jc=a.pe);a.sc&&(a.Qc=a.ve,a.kc=a.we);a.zb?(a.Ia=65536,a.vb=a.U&16?4186112:253952,a.Ga=a.oe,a.oa=a.rc?a.Vg:a.Ad,a.Hb=a.sc?a.ji:a.Ed,Jc(a.D,a.U&16?22:18)):(a.Ia=0,a.vb=57344,a.Ga=a.Cf,a.oa=a.rc?a.Ug:a.ue,a.Hb=a.sc?a.ii:a.ze,Jc(a.D,16))}function od(a){var b=a.S;b&57344||(b=b&-3199|a.Ab<<5|a.sb<<1);return b}
|
||||
function pd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.uc=a.O>>16&65535,a.vc=a.O&65535);a.S=b;a.Ab=(b&96)>>5;a.sb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.zb!=c&&(a.zb=c,se(a))}}function qd(a){a.S&57344||(a.uc=a.O>>16&65535);a=a.uc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function rd(a){a.S&57344||(a.vc=a.O&65535);return a.vc}function sd(a,b){1170>a.ka&&(b&=-49);a.U!=b&&(a.U=b,a.lb=b&16?4194303:262143,se(a))}
|
||||
function te(a,b,c,d){a.Rd=b;ue(a,b);vd(a,0);a.D.reset();kc(a);if(c){a.g[0]=d||0;for(b=1;5>=b;b++)a.g[b]=0;a.g[6]=1024;a.F||(a.A.aa?a.A.V||mc(a):a.A.ra=!0)}else a.F&&a.A.aa?a.ba()||(de(a.F),H(a.K,-1)):!1===c&&a.ba();!a.A.V&&a.ta&&a.ta.stop()}h.le=function(){return 0};
|
||||
h.save=function(){var a=new G(this);a.set(0,[this.g,this.qa,this.W,this.M,this.B,this.Ha,this.wc,this.P,this.tc,this.eb,this.xa,this.Ab,this.sb,this.kb,this.i,this.O,this.cb,this.yc,this.Bc]);a.set(1,[ud(this),od(this),qd(this),rd(this),this.U]);a.set(2,[this.pb,this.ob,this.A.ra]);a.set(3,ve(this));a.set(4,ne(this));return a.data()};
|
||||
h.restore=function(a){var b=ia(a[0]);this.g=b.next().value;this.qa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Ha=b.next().value;this.wc=b.next().value;this.P=b.next().value;this.tc=b.next().value;this.eb=b.next().value;this.xa=b.next().value;this.Ab=b.next().value;this.sb=b.next().value;this.kb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.cb=b.next().value;this.yc=b.next().value;this.Bc=b.next().value;b=a[1];vd(this,b[0]);pd(this,b[1]);
|
||||
this.uc=b[2];this.vc=b[3];sd(this,b[4]);b=a[2];this.pb=b[0];he(this,b[1]);this.A.ra=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.lc.length;d++){var e=this.lc[d];if(e.Fb===b[c]){d=e;break a}}d=null}d&&(d.next=this.R,this.R=d)}a=a[4];for(b=0;b<this.ia.length&&b<a.length;b++)this.ia[b][0]=a[b];return!0};function we(a){return a.C&65536?1:0}function xe(a){return a.G&32768?2:0}function ye(a){return a.L&65535?0:4}function ze(a){return a.I&32768?8:0}
|
||||
function Ae(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function Be(a,b,c){c&&(ue(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}function ue(a,b){a.g[7]=b&65535}function jd(a,b,c,d){b={Fb:b,qb:c,message:d||0,name:Kb[b],next:null};a.lc.push(b);return b}function Ce(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)}
|
||||
function hd(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.qb<=b.qb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.qb<=b.qb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&z(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.Fb)+",priority="+b.qb+")",!0,!0)}}function nd(a,b){b&&(Ce(a,b),b.message&&z(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.Fb)+",priority="+b.qb+")",!0,!0))}function ve(a){var b=[];for(a=a.R;a;)b.push(a.Fb),a=a.next;return b}
|
||||
function De(a){return a.i&64?(a.sa(168,64,-6),!0):a.i&32?(a.sa(4,32,-5),!0):a.i&16?(a.sa(12,16,-7),!0):!1}function ud(a){return a.w=a.w&63728|ze(a)|ye(a)|xe(a)|we(a)}function vd(a,b){b&=a.be;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.C=b<<16;if((b^a.w)&a.ae)for(var c=a.qa.length;0<=--c;){var d=a.g[c];a.g[c]=a.qa[c];a.qa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function td(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.eb=b}
|
||||
h.Ea=function(a){this.I=this.L=a;this.G=0};h.rb=function(a,b){this.I=this.L=this.C=a;this.G=b||0};function Ee(a,b){a.I=a.L=a.C=b;a.G=a.I^a.C>>1}function Fe(a,b,c,d){a.I=a.L=a.C=b;a.G=(c^d)&(d^b)}
|
||||
h.sa=function(a,b,c){if(!this.pa){0>this.cb?this.cb=ud(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.oa(a|this.Ia),e=this.oa(a+2&65535|this.Ia);vd(this,e&-12289|this.cb>>2&12288);Ge(this,this.cb);Ge(this,this.g[7]);ue(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.cb=-1;this.yc=c;this.Bc=a;-1==c&&this.ba();if(-4<=c)throw a;}};
|
||||
function He(a){var b=Ie(a),c=Ie(a);a.w&49152&&(c=c&-225|a.w&63712);ue(a,b);vd(a,c);a.i&=-17}function Je(a,b){var c=b>>13&31;31>c&&(b=a.U&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||
function Ke(a,b,c){var d=[];if(c){c=Je(a,b);var e=b>>13&31;d.push(c);d.push(e);a.U&32&&(d.push(a.Ha[e]),d.push(b&8191))}else if(a.zb){var e=a.N<<1,f=b>>13;7<f&&(e|=1);a.U&a.Ud[a.N]||(f&=7);b&=8191;var g=a.M[a.N][f]<<6;c=g+b&a.lb;3932160<=c&&(c=Je(a,c));d.push(c);d.push(b);d.push(e);d.push(f&7);d.push(g);d.push(a.lb)}else c=b&65535,57344<=c&&(c|=a.vb),d.push(c);return d}
|
||||
function tc(a,b,c){var d,e,f;if(!(c&a.zb))return f=b&65535,57344<=f&&(f|=a.vb),f;d=b>>13;a.U&a.Ud[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.lb;3932160<=f&&(f=Je(a,f));if(a.pa)return f;f>=a.Pd&&f<a.vb?(a.P|=32,a.sa(4,0,f)):f&1&&!(c&1)&&(a.P|=64,a.sa(4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&
|
||||
(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.lb)||a.N)a.Ab=a.N,a.sb=d;g&&(g&57344&&(0<=a.cb&&(g|=128),a.S&57344||(g|=a.S&4096|a.Ab<<5|a.sb<<1,pd(a,a.S&-61695|g&61694)),a.sa(168,64,-2)),a.S&61440||!(f<(4191360&a.lb)||f>(4194239&a.lb))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function Ie(a){var b=a.oa(a.g[6]|a.Ia);a.g[6]=a.g[6]+2&65535;return b}function Ge(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Lb(4,-2,c);a.Hb(c,b)}
|
||||
function Le(a,b,c,d){var e,f,g=d&8?0:a.Ia;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.Lb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Lb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.oa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Lb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.oa(e)|g;a.b-=8;break;case 6:return e=a.oa(Ae(a,2)),e=e+a.g[c]&65535,6==c&&a.Lb(d,
|
||||
0,e),a.b-=6,e|g;case 7:return e=a.oa(Ae(a,2)),e=e+a.g[c]&65535,e=a.oa(e|a.Ia),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.yf=function(a,b,c){!this.N&&0>=b&&c<=this.xa&&(this.i|=32)};h.zf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.xa&&(c<=this.xa-32?this.sa(4,0,-4):(this.P|=8,this.i|=32)))};h.ke=function(a){this.F&&Nd(this.F,a,1);return this.Yc(a)};h.pe=function(a){this.F&&Nd(this.F,a,2);return this.$c(a)};
|
||||
h.ve=function(a,b){this.F&&Od(this.F,a,1);this.ad(a,b)};h.we=function(a,b){this.F&&Od(this.F,a,2);this.fd(a,b)};function vc(a,b){a.pa++;b=a.D.zc(tc(a,b,2));a.pa--;return b}function Me(a,b){(b?--a.sc:--a.rc)||se(a)}h.Cf=function(a,b,c){return Le(this,a,b,c)};h.oe=function(a,b,c){return tc(this,Le(this,a,b,c),c)};h.ue=function(a){return this.D.zc(this.kb=a)};h.Ug=function(a){this.F&&Nd(this.F,a,2);return this.ue(a)};h.Ad=function(a){return this.D.zc(this.kb=tc(this,a,2))};
|
||||
h.Vg=function(a){this.F&&Nd(this.F,a,2);return this.Ad(a)};h.ze=function(a,b){this.D.ac(this.kb=a,b)};h.ii=function(a,b){this.F&&Od(this.F,a,2);this.ze(a,b)};h.Ed=function(a,b){this.D.ac(this.kb=tc(this,a,4),b)};h.ji=function(a,b){this.F&&Od(this.F,a,2);this.Ed(a,b)};function Ne(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Le(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.oa(d|c&a.Ia),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c}
|
||||
function Oe(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Le(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=tc(a,e|c&65536,4),a.N=a.w>>14&3,a.kc(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Pe(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.ic(a.Ga(b,c,3)):a.g[c+a.xc]&a.Vd}function Qe(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.jc(a.Ga(b,d,2)):c=a.g[d+a.xc];return c}function Re(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Le(a,b,c,8)}
|
||||
function Se(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.ic(a.Ga(b,c,3)):a.g[c]&255}function Te(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.jc(a.Ga(b,d,2)):c=a.g[d];return c}function Ue(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Tc=a.Ga(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Qc(e,d.call(a,c,a.ic(e))),e&1&&a.b--):(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 P(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ga(b,e,6),a.kc(e,d.call(a,0>c?a.g[-c-1]:c,a.jc(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function Ve(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ga(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Qc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
|
||||
function We(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ga(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.kc(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}
|
||||
h.Ac=function(a){this.A.complete=!0;var b=this.F?Xe(this.F)?1:this.A.Pc?-1:0:0,c=a?this.A.Pc?0:1:-1;this.A.Pc=!1;this.nb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(Ye(this.F,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.eb&224)>>5,f=this.R&&this.R.qb>e?this.R:null;f&&(d=f.Fb,e=f.qb);e>(this.w&224)>>5?(this.i&8&&(Ae(this,2),this.i&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Ce(this,f),a=!0);this.R||this.eb||(this.i&=-3)}else this.i&
|
||||
1&&this.i++;if(a){if(this.i&4&&Ye(this.F,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&De(this)){if(this.i&4&&Ye(this.F,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.oa(a);this.g[7]=a+2&65535;this.Od(f)}while(0<this.b);return this.A.complete?this.nb-this.b:!1===this.A.complete?-1:0};mb(function(){for(var a=x(document,w,"cpu"),b=0;b<a.length;b++){var c=a[b],d=wa(c),d=new pe(d);xa(d,c)}});
|
||||
function Ze(a,b){var c=b+a;this.I=this.L=this.C=c;this.G=(a^c)&(b^c);return c&65535}function $e(a,b){var c=b+a,d=c<<8;this.I=this.L=this.C=d;this.G=(a<<8^d)&(b<<8^d);return c&255}function wf(a,b){a=b<<1;Ee(this,a);return a&65535}function xf(a,b){a=b<<1;Ee(this,a<<8);return a&255}function yf(a,b){a=b&32768|b>>1|b<<16;Ee(this,a);return a&65535}function zf(a,b){a=b&128|b>>1|b<<8;Ee(this,a<<8);return a&255}function Af(a,b){a=b&~a;this.Ea(a);return a}function Bf(a,b){a=b&~a;this.Ea(a<<8);return a}
|
||||
function Cf(a,b){a|=b;this.Ea(a);return a}function Df(a,b){a|=b;this.Ea(a<<8);return a}function Ef(a,b){a=~b|65536;this.rb(a);return a&65535}function Ff(a,b){a=~b|256;this.rb(a<<8);return a&255}function Gf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Hf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function If(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Jf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255}
|
||||
function Kf(a,b){a=-b;this.rb(a,a&b&32768);return a&65535}function Lf(a,b){a=-b;this.rb(a<<8,(a&b&128)<<8);return a&255}function Mf(a,b){a=b<<1|this.C>>16&1;Ee(this,a);return a&65535}function Nf(a,b){a=b<<1|this.C>>16&1;Ee(this,a<<8);return a&255}function Of(a,b){a=(this.C&65536|b)>>1|b<<16;Ee(this,a);return a&65535}function Pf(a,b){a=((this.C&65536)>>8|b)>>1|b<<8;Ee(this,a<<8);return a&255}function Qf(a,b){var c=b-a;Fe(this,c,a,b);return c&65535}
|
||||
function Rf(a,b){var c=b-a;Fe(this,c<<8,a<<8,b<<8);return c&255}function Sf(a,b){this.I=this.L=b&65280;this.G=this.C=0;return(b<<8|b>>8)&65535}function Tf(a,b){a^=b;this.Ea(a);return a&65535}function Uf(a){P(this,a,Qe(this,a),Ze);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}
|
||||
function Vf(a){var b=Te(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.C=this.G=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.C=c<<17-b,c>>=b;else if(b)if(16<b)this.G=c,c=0;else{this.C=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.G=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b}
|
||||
function Wf(a){var b=Te(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.C=this.G=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.C=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.C=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.G=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Xf(a){Be(this,a,!we(this))}function Yf(a){Be(this,a,we(this))}
|
||||
function Zf(a){P(this,a,Qe(this,a),Af);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){Ue(this,a,Pe(this,a),Bf);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function ag(a){P(this,a,Qe(this,a),Cf);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function bg(a){Ue(this,a,Pe(this,a),Df);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}
|
||||
function cg(a){var b=Qe(this,a);a=Te(this,a);this.Ea((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function dg(a){var b=Pe(this,a);a=Se(this,a);this.Ea(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function eg(a){Be(this,a,ye(this))}function fg(a){Be(this,a,!ze(this)==!xe(this))}function gg(a){Be(this,a,!ye(this)&&!ze(this)==!xe(this))}function hg(a){Be(this,a,!we(this)&&!ye(this))}
|
||||
function ig(a){Be(this,a,ye(this)||!ze(this)!=!xe(this))}function jg(a){Be(this,a,we(this)||ye(this))}function kg(a){Be(this,a,!ze(this)!=!xe(this))}function lg(a){Be(this,a,ze(this))}function mg(a){Be(this,a,!ye(this))}function ng(a){Be(this,a,!ze(this))}function og(){this.sa(12,0,-9)}function pg(a){Be(this,a,!0)}function qg(a){Be(this,a,!xe(this))}function rg(a){Be(this,a,xe(this))}function sg(a){a&1&&(this.C=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5}
|
||||
function tg(a){var b=Qe(this,a);a=Te(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Fe(this,c,a,b);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function ug(a){var b=Pe(this,a);a=Se(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Fe(this,c,a,b);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}
|
||||
function vg(a){var b=Te(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.C=this.G=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.L=d>>16|d,this.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.C=65536,this.b-=7}function wg(){this.sa(24,0,-9);this.b-=20}
|
||||
function xg(){this.w&49152?(this.P|=128,this.sa(4,0,-8)):(this.ta&&1120==this.ka&&this.ta.setData(this.g[0],!0),this.F?yg(this.F):this.ba());this.b-=7}function zg(){this.sa(16,0,-9);this.b-=20}var Ag=[0,7,7,10,7,11,9,13];function Bg(a){this.la=this.b;ue(this,Re(this,a));this.b=this.la-Ag[this.u]}var Cg=[0,14,14,17,14,18,16,20];function Dg(a){this.la=this.b;var b=Re(this,a);a=a>>6&7;Ge(this,this.g[a]);this.g[a]=this.g[7];ue(this,b);this.b=this.la-Cg[this.u]}
|
||||
var Eg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Fg(a){var b=Qe(this,a);this.la=this.b;We(this,a,b,this.Ea);this.b=this.la-Eg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Gg(a){var b=Pe(this,a);Ve(this,a,b,65535,this.Ea);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Hg=[7,13,13,17,14,18,17,21];
|
||||
function Ig(a){var b=Te(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.C=-32768>b||32767<b?65536:0;this.b-=23}function Jg(){this.b-=5}function Kg(){this.w&49152||(this.D.reset(),kc(this),this.ta&&this.ta.setData(this.g[0],!0));this.b-=667}function Lg(a){if(a&8)Q.call(this,a);else{var b=Ie(this);a&=7;7==a?ue(this,b):(ue(this,this.g[a]),this.g[a]=b);this.b-=9}}function Mg(){He(this);this.b-=13}
|
||||
function Ng(a){a&1&&(this.C=65536);a&2&&(this.G=32768);a&4&&(this.L=0);a&8&&(this.I=32768);this.b-=5}function Og(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)ue(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Pg(a){P(this,a,Qe(this,a),Qf);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Qg(a){P(this,a,0,Sf);this.b-=this.u?9:3+(7==this.j?2:0)}function Rg(){this.sa(28,0,-9)}
|
||||
function Sg(){this.ta&&(this.ta.Cd(this.g[7],!0),this.ta.setData(this.g[0],!0));this.i|=8;Ae(this,-2);this.b-=3}function Tg(a){P(this,a,this.g[(a>>6&7)+this.xc],Tf);this.b-=this.u?9:3+(7==this.j?2:0)}function Q(a){var b;if(b=this.F)b=this.F,z(b,1)?(D(b,"undefined opcode "+J(b,a),!0,!0),b=yg(b)):b=!1;b||this.sa(8,0,-9)}function qe(a){Ug[a>>12].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)}function Zg(a){$g[a>>6&3].call(this,a)}
|
||||
function ah(a){bh[a&15].call(this,a)}function ch(a){dh[a&15].call(this,a)}function eh(a){fh[a>>6&3].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)}function ih(a){jh[a>>6&3].call(this,a)}
|
||||
var Ug=[function(a){kh[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Uf,Q,function(a){lh[a>>8&15].call(this,a)},Gg,ug,dg,$f,bg,Pg,Q],kh=[function(a){mh[a>>4&15].call(this,a)},pg,mg,eg,fg,kg,gg,ig,Dg,Dg,Vg,Xg,Zg,Q,Q,Q],Wg=[function(a){We(this,a,0,this.rb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,Ef);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)}],Yg=[function(a){P(this,a,0,Kf);
|
||||
this.b-=this.u?11:6},function(a){P(this,a,we(this)?1:0,Ze);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,we(this)?1:0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Te(this,a);this.rb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],$g=[function(a){P(this,a,0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,Mf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,yf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,wf);this.b-=this.u?9:3+(7==this.j?2:0)}],mh=
|
||||
[function(a){nh[a&15].call(this,a)},Q,Q,Q,Bg,Bg,Bg,Bg,Lg,Q,ah,ch,Qg,Qg,Qg,Qg],nh=[xg,Sg,Mg,og,zg,Kg,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q],bh=[Jg,function(){this.C=0;this.b-=5},function(){this.G=0;this.b-=5},sg,function(){this.L=1;this.b-=5},sg,sg,sg,function(){this.I=0;this.b-=5},sg,sg,sg,sg,sg,sg,sg],dh=[Jg,function(){this.C=65536;this.b-=5},function(){this.G=32768;this.b-=5},Ng,function(){this.L=0;this.b-=5},Ng,Ng,Ng,function(){this.I=32768;this.b-=5},Ng,Ng,Ng,Ng,Ng,Ng,Ng],lh=[ng,lg,hg,jg,qg,rg,Xf,Yf,wg,Rg,eh,gh,
|
||||
ih,Q,Q,Q],fh=[function(a){Ve(this,a,0,255,this.rb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,0,Ff);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,1,Jf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,1,Hf);this.b-=this.u?9:3+(7==this.j?2:0)}],hh=[function(a){Ue(this,a,0,Lf);this.b-=this.u?11:6},function(a){Ue(this,a,we(this)?1:0,$e);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,we(this)?1:0,Rf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Se(this,
|
||||
a);this.rb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],jh=[function(a){Ue(this,a,0,Pf);this.b-=this.u?9+(this.Tc&1):3+(7==this.j?2:0)},function(a){Ue(this,a,0,Nf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,0,zf);this.b-=this.u?9+(this.Tc&1):3+(7==this.j?2:0)},function(a){Ue(this,a,0,xf);this.b-=this.u?9:3+(7==this.j?2:0)}];function re(a){oh[a>>12].call(this,a)}
|
||||
var oh=[function(a){ph[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Uf,function(a){qh[a>>8&15].call(this,a)},function(a){rh[a>>8&15].call(this,a)},Gg,ug,dg,$f,bg,Pg,Q],ph=[function(a){sh[a>>4&15].call(this,a)},pg,mg,eg,fg,kg,gg,ig,Dg,Dg,Vg,Xg,Zg,function(a){th[a>>6&3].call(this,a)},Q,Q],th=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.oa(a|this.Ia);ue(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Ne(this,a,0);this.Ea(a);Ge(this,a);this.b-=11},function(a){var b=Ie(this);
|
||||
this.la=this.b;this.Ea(b);Oe(this,a,0,b);this.b=this.la-Hg[this.u]},function(a){We(this,a,ze(this)?65535:0,this.Ea);this.b-=this.u?9:3+(7==this.j?2:0)}],sh=[function(a){uh[a&15].call(this,a)},Q,Q,Q,Bg,Bg,Bg,Bg,Lg,function(a){!(a&8)||1145>this.ka?Q.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},ah,ch,Qg,Qg,Qg,Qg],uh=[xg,Sg,function(){He(this);this.i|=this.w&16;this.b-=13},og,zg,Kg,Mg,function(a){Q.call(this,a)},Q,Q,Q,Q,Q,Q,Q,Q],qh=[Ig,Ig,vg,vg,Vf,Vf,Wf,Wf,
|
||||
Tg,Tg,Q,Q,Q,Q,Og,Og],rh=[ng,lg,hg,jg,qg,rg,Xf,Yf,wg,Rg,eh,gh,ih,function(a){1145>this.ka?Q.call(this,a):vh[a>>6&3].call(this,a)},Q,Q],vh=[function(a){Q.call(this,a)},function(a){a=Ne(this,a,65536);this.Ea(a);Ge(this,a);this.b-=11},function(a){var b=Ie(this);this.la=this.b;this.Ea(b);Oe(this,a,65536,b);this.b=this.la-Hg[this.u]},function(a){Q.call(this,a)}];
|
||||
function wh(a){r.call(this,"ROM",a,128);this.ga=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ja(this.j);if(this.j){a=this.j;var b=Ka(this.B);"json"!=b&&"hex"!=b&&(a=Za()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;Xa(a,null,!0,function(a,b,f){f?(c.T("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(oa(c.wb,a,b),(a=Ya(a,b))?(c.g=a.ca,c.ga=a.ga):c.j=null);xh(c)})}}p(wh,r);
|
||||
h=wh.prototype;h.Aa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;xh(this)};h.Da=function(){this.ga&&(this.F&&yh(this.F,this.id,this.u,this.b,this.ga),delete this.ga);return!0};h.Ca=function(){return!0};
|
||||
function xh(a){if(!Aa(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)ya(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Bc){var c={},c=(c[b]=[wh.prototype.Eg,wh.prototype.Rh,null,null,null,a.b>>1],c);if(Rb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Hc(a.D,b,a.b,Bd)){for(c=0;c<a.g.length;c++)ad(a.D,b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.i?
|
||||
b.push(a.i):null!=a.i&&a.i.length&&(b=a.i);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.D,g=d.b,k=[],l=d.u>>>f.g;0<g&&l<f.b.length;)k.push(f.b[l++]),g-=f.j;f=d.D;d=d.b;g=0;for(e>>>=f.g;0<d&&e<f.b.length;){l=k[g++];if(!l)break;f.b[e++]=l;d-=f.j}}a.w||delete a.g}}}y(a)}}h.Eg=function(a){return this.g[a-this.u]};h.Rh=function(){};mb(function(){for(var a=x(document,w,"rom"),b=0;b<a.length;b++){var c=a[b],d=wa(c),d=new wh(d);xa(d,c)}});
|
||||
function zh(a){r.call(this,"RAM",a);this.ga=this.g=null;this.i=+a.addr;this.j=+a.size;this.za=a.load;this.ya=a.exec;null!=this.za&&(this.za=+this.za);null!=this.ya&&(this.ya=+this.ya);this.u=!1;this.b=a.file;this.w=Ja(this.b);if(this.b){a=this.b;var b=Ka(this.w);"json"!=b&&"hex"!=b&&(a=Za()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;Xa(a,null,!0,function(a,b,f){f?(c.T("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(oa(c.wb,a,b),(a=Ya(a,b))?(c.g=a.ca,c.ga=a.ga,
|
||||
null==c.za&&(c.za=a.za),null==c.ya&&(c.ya=a.ya)):c.b=null);Ah(c)})}}p(zh,r);zh.prototype.Aa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;Ah(this)};zh.prototype.Da=function(a,b){this.ga&&(this.F&&yh(this.F,this.id,this.i,this.j,this.ga),delete this.ga);b||this.reset();return!0};zh.prototype.Ca=function(){return!0};
|
||||
function Ah(a){if(a.D&&(!a.u&&a.j&&(Hc(a.D,a.i,a.j,cd)?a.u=!0:a.j=0),!Aa(a))){if(!a.u)v("No RAM allocated");else if(a.b){if(!a.g||!a.D)return;Bh(a,a.g,a.za,a.ya,a.i)?a.status('Loaded image "'+a.w+'"'):a.T('Error loading image "'+a.w+'"')}y(a)}}
|
||||
zh.prototype.reset=function(){if(this.u){for(var a=this.D,b=this.i,c=this.j,d=b&a.i,b=b>>>a.g;0<c&&b<a.b.length;){var e=a.b[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(ub&&e.g)for(k=d;f--&&k<e.g.length;k++)e.g[k]=g;else for(k=d;f--&&k<e.size;k++)e.F(d,g,e.J+d);c-=a.j;b++;d=0}this.g&&Bh(this,this.g,this.za,this.ya,this.i,!0)}};
|
||||
function Bh(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){D(a,"invalid signature ("+Ha(m)+") at offset "+Ha(n),4096);break}if(l+6>=b.length){D(a,"invalid block at offset "+Ha(n),4096);break}for(var l=l+2,q=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((q&255)+(q>>8)+(t&255)+(t>>8)),u=l,C=q-=6;0<q&&l<b.length;)m+=b[l++]&255,q--;if(q||l>=b.length){D(a,"insufficient data for block at offset "+Ha(n),4096);
|
||||
break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Ha(n),4096);break}if(C)for(D(a,"loading "+Ha(C)+" bytes at "+Ha(t)+"-"+Ha(t+C),4096);C--;)ad(a.D,t++,b[u++]&255);else t&1?g=!0:null==d&&(d=t),null!=d&&D(a,"starting address: "+Ha(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)ad(a.D,c+e,b[e]);k=!0}if(k){if(null==d||g)a.f.ba(),f=!1;null!=d&&te(a.f,d,f)}return k}
|
||||
mb(function(){for(var a=x(document,w,"ram"),b=0;b<a.length;b++){var c=a[b],d=wa(c),d=new zh(d);xa(d,c)}});function Ch(a){r.call(this,"Keyboard",a,1024);y(this)}p(Ch,r);Ch.prototype.va=function(){return!1};Ch.prototype.Aa=function(a,b,c,d){this.K=a;this.f=c;this.F=d};mb(function(){for(var a=x(document,w,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=wa(c),d=new Ch(d);xa(d,c)}});
|
||||
function Dh(a){r.call(this,"SerialPort",a,1048576);this.M=+a.adapter;this.S=+a.baudReceive||9600;this.Y=+a.baudTransmit||9600;this.L=a.upperCase;"string"==typeof this.L&&(this.L="true"==this.L);this.u=this.w=null;this.W=+a.tabSize;this.U=+a.charBOL;this.B=0;this.I=!0;this.P=this.N=null;this.R=this.X=-1;this.C=this.b=this.g=0;this.i=[];var b=a.binding;if("console"==b)this.w="";else{var c;a=Eh;b&&(void 0===c&&(c="Panel"),(c=va(c,this.id))&&(b=c.H[b])&&this.va(null,a,b))}this.j=this.G=this.O=null;this.exports=
|
||||
{connect:this.qe,receiveData:this.Lc,receiveStatus:this.$g,setConnection:this.dh}}p(Dh,r);h=Dh.prototype;
|
||||
h.va=function(a,b,c){var d=this;switch(b){case Eh:return this.H[b]=this.u=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?la.Jd:la.cc:46==c?b=la.Jd:a.ctrlKey&&c>=la.Fd&&c<=la.tf&&(b=c-(la.Fd-la.Be));b&&(a.preventDefault&&a.preventDefault(),d.Lc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==la.De&&(b=la.Ce);d.Lc(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.Lc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;var e=this;this.P=jd(this.f,this.M?-1:48,4,1048576);this.R=gd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),id(e.f,e.R,1E3/Math.round(e.S/10)));0<=a&&(e.C=a,e.b&128?e.C|=49152:e.b|=128,e.b&64&&hd(c,e.P))});this.N=jd(this.f,this.M?-1:52,4,1048576);this.X=gd(this.f,function(){e.g|=128;e.g&64&&hd(c,e.N)});Rb(b,this,Fh,this.M?64832+8*(this.M-1)-65392:0);Tb(b,this.reset.bind(this));
|
||||
y(this)};h.qe=function(a){if(!this.j){var b=Td(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Pa(c[0]);if(d!=this.Mb)return;c=Pa(c[1]);if(this.j=ua(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.wb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
h.Da=function(a,b){if(!b)if(this.qe(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ca=function(a){return a?this.save():!0};h.reset=function(){Gh(this)};h.save=function(){var a=new G(this);a.set(0,[this.C,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Gh(this,a[0])};function Gh(a,b){b||(b=[0,8192,128,a.i]);b=ia(b);a.C=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0}
|
||||
h.Lc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.i.push(b)}else this.i=this.i.concat(a);id(this.f,this.R,1E3/Math.round(this.S/10));return!0};h.$g=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&hd(this.f,this.P))};h.dh=function(a,b){return this.j?!1:(this.j=a,this.G=b,!0)};
|
||||
h.rg=function(){var a=this.b&65534;this.b&=-32769;return a};h.Eh=function(a){var b=a^this.b;this.b=this.b&-112|a&111;this.O&&b&6&&(b=0,b=this.I?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.O.call(this.j,b))};h.qg=function(){this.b&=-129;return this.C};h.Dh=function(){};h.Zg=function(){return this.g};h.li=function(a){this.g&128&&(a&64?hd(this.f,this.N):nd(this.f,this.N));this.g=this.g&-70|a&69};h.Yg=function(){return 0};
|
||||
h.ki=function(a){a&=255;D(this,"transmitByte("+F(a,2,!0)+")");this.G&&this.G.call(this.j,a);a&=127;if(this.u)if(13==a)this.B=0;else if(8==a)this.u.value=this.u.value.slice(0,-1),0<this.B&&this.B--;else{if(a){var b;13!=a&&10!=a&&(b=Qa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Oa("",c)));this.U&&!this.B&&c&&(b=String.fromCharCode(this.U)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10==
|
||||
a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}id(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Eh="buffer",Hh={},Fh=(Hh[65392]=[null,null,Dh.prototype.rg,Dh.prototype.Eh,"RCSR"],Hh[65394]=[null,null,Dh.prototype.qg,Dh.prototype.Dh,"RBUF"],Hh[65396]=[null,null,Dh.prototype.Zg,Dh.prototype.li,"XCSR"],Hh[65398]=[null,null,Dh.prototype.Yg,Dh.prototype.ki,"XBUF"],Hh);
|
||||
mb(function(){for(var a=x(document,w,"serial"),b=0;b<a.length;b++){var c=a[b],d=wa(c),d=new Dh(d);xa(d,c)}});function wd(a){r.call(this,"PC11",a,4096);this.N=Ih(this,a.autoMount);this.g=0;this.U=+a.baudReceive||3600;this.w=this.b=0;this.L=32768;this.i=this.R=0;this.C=[];this.B=Jh;this.j=Kh;this.M=this.u="";this.ca=this.za=this.ya=null;this.P=-1;this.O=!db("Mobi")&&window&&"FileReader"in window;this.G=null;this.S=-1;this.I=null}p(wd,r);
|
||||
function Ih(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=wd.prototype;
|
||||
h.va=function(a,b,c){var d=this,e=Kh;switch(b){case "listTapes":return this.H[b]=c,c.onchange=function(){var a=d.H.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){v("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Lh;case "loadTape":return e||(e=Mh),this.H[b]=c,c.onclick=
|
||||
function(){var a=d.H.listTapes;a&&Nh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.H[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;Nh(d,Ja(b,!0),b,Mh,a)}return!1};return!0;case Oh:return this.H[b]=c,!0}return!1};
|
||||
h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;this.I=Ph(a);var e=this;if(a=Ih(this,Td(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.N[f]=a[f]);this.G=jd(this.f,56,4,4096);this.S=gd(this.f,function(){1!=(e.b&32769)||e.b&128||(e.i<e.C.length?(e.w=e.C[e.i]&255,z(e)&&D(e,e.type+".advanceReader("+e.i+"): "+F(e.w,2,!0),!0),e.i++,Qh(e,e.i/e.C.length*100)):e.b|=32768,e.b|=128,e.b&=-2049,e.b&64&&hd(e.f,e.G))});Rb(b,this,Rh);Tb(b,this.reset.bind(this));Sh(this,"None",Jh,!0);this.O&&Sh(this,
|
||||
"Local Tape",Th);Sh(this,"Remote Tape",Uh);Vh(this)||y(this)};h.Da=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ca=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.w=0};function Vh(a){a.g=0;var b=a.N.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.H.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=Ja(c,!0)}c&&b?Wh(a,b,c,Mh,!0):Xh(a)}return!!a.g}
|
||||
function Nh(a,b,c,d,e){if(c)if(c==Th)a.T('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Uh){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=Ja(c);a.status("Attempting to load "+c+' as "'+b+'"');a.B=Uh}else a.B=c;Wh(a,b,c,d,!1,e)}else Yh(a,!1)}
|
||||
function Wh(a,b,c,d,e,f){var g=-1;if(a.u.toLowerCase()!=c.toLowerCase()||a.j!=d)g++,Yh(a,!0),a.A.gb?a.T("PC11 busy"):(e&&(a.g++,z(a)&&D(a,"auto-loading tape: "+b)),Zh(a,b,c,d,f)?g++:a.A.gb=!0);g&&$h(a,a.M,a.u,a.j,a.ca,a.za,a.ya)}
|
||||
function Zh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),$h(a,b,c,d,e),a.B=Th);a.A.gb=!1;Xh(a)};g.readAsArrayBuffer(e);return!1}0>c.indexOf("/api/v1/dump")&&(e=Ka(c),f="json"==e||"gz"==e?encodeURI(c):Za()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Xa(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.aa;g?a.T('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(oa(a.wb,e,f),(e=Ya(e,f))&&$h(a,b,c,d,
|
||||
e.ca,e.za,e.ya));a.A.gb=!1;a.g&&(a.g--,a.g||y(a));Xh(a)})}function Sh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function Xh(a){var b=a.H.listTapes;if(b&&b.options){a=a.B||a.u;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Qh(a,b){b|=0;if(b!==a.P){var c=a.H[Oh];c&&(c=(c=x(c,ai))&&c[0])&&c.style&&(c.style.width=b+"%");a.P=b}}
|
||||
function $h(a,b,c,d,e,f,g){a.M=b;a.u=c;a.j=d;a.ca=e;a.za=f;a.ya=g;d==Lh?a.I&&Bh(a.I,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.T('No valid memory address for tape "'+b+'"'):(a.i=0,a.C=e,a.b&=-32769,a.status('Loaded tape "'+b+'" ('+e.length+" bytes)"),Qh(a,0))}function Yh(a,b){if(a.u||!1===b)a.M="",a.u="",b||(a.j&&a.status(a.j==Mh?"tape detached":"tape unloaded"),a.B=Jh,a.j=Kh,Xh(a))}h.save=function(){return(new G(this)).data()};h.restore=function(){return!0};h.kg=function(){return this.b&65534};
|
||||
h.xh=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&hd(this.f,this.G)):(this.b&=-129,this.b|=2048,this.w=0,id(this.f,this.S,1E3/Math.round(this.U/10))));this.b=this.b&-66|a&65};h.jg=function(){this.b&=-129;this.b|=2048;return this.w};h.wh=function(){};h.ig=function(){return this.L};h.vh=function(a){this.L=this.L&-65|a&64};h.hg=function(){return this.R};h.uh=function(a){this.R=a&255};
|
||||
var Jh="",Th="?",Uh="??",Kh=0,Mh=1,Lh=2,Oh="readProgress",ai="pcjs-progress-bar",bi={},Rh=(bi[65384]=[null,null,wd.prototype.kg,wd.prototype.xh,"PRS"],bi[65386]=[null,null,wd.prototype.jg,wd.prototype.wh,"PRB"],bi[65388]=[null,null,wd.prototype.ig,wd.prototype.vh,"PPS"],bi[65390]=[null,null,wd.prototype.hg,wd.prototype.uh,"PPB"],bi);
|
||||
function ci(a,b,c){r.call(this,"Disk",{id:a.wb+".disk"+F(++di,4)},8192);this.controller=a;this.K=a.K;this.F=a.F;this.u=b;this.Ya=b.name;this.Oa=this.Bd="";this.xd=b.xd;this.Z=this.ja=this.ea=this.ua=this.mode=0;this.b=[];this.i=null;this.j=!1;ei(this,c,b.Z,b.ja,b.ea,b.ua);this.g=this.w=null;y(this)}p(ci,r);h=ci.prototype;h.Aa=function(a,b,c,d){this.F=d};
|
||||
function ei(a,b,c,d,e,f){a.mode=b;a.Z=c;a.ja=d;a.ea=e;a.ua=f;a.b=[];if("preload"!=a.mode){b=Array(a.Z);for(c=0;c<b.length;c++){d=Array(a.ja);for(e=0;e<d.length;e++){f=Array(a.ea);for(var g=1;g<=f.length;g++)f[g-1]=fi(null,c,e,g,a.ua,0);d[e]=f}b[c]=d}a.b=b}a.i=null}
|
||||
function gi(a,b,c,d,e){var f=c;if(a.g)return!0;a.Ya=b;a.Oa=c;a.Bd=Ja(c);a.g=e;a.w=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.Z=e[0];a.ja=e[1];a.ea=e[2];a.ua=e[3]||512;c=a.ua>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Z);for(d=0;d<a.b.length;d++)for(var t=a.b[d]=Array(a.ja),u=0;u<t.length;u++)for(var C=t[u]=Array(a.ea),A=0;A<C.length;A++){for(var B=fi(null,d,u,A+1,a.ua,0),K=B.data,vb=0;vb<c;vb++,f+=4)var Cd=K[vb]=b.getInt32(f,
|
||||
!0),e=e+Cd&-1;B.La=c;C[A]=B}a.i=e;c=a}else a.T("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.u,c,a.Ya,a.Oa),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.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=Za()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.xd?"":e)+"&format=json"));return!!Xa(f,
|
||||
null,!0,function(b,c,d){hi(a,b,c,d)})}
|
||||
function hi(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.aa;a.j=!1;if(d)a.controller.T('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{oa(a.controller.wb,b,c);try{if(0<Ja(a.Bd,!0).toLowerCase().indexOf("-readonly"))a.j=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.j=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.Ya]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)v(k[0]);else{a.Z=k.length;a.ja=k[0].length;a.ea=k[0][0].length;var l=k[0][0][0];a.ua=l&&l.length||512;for(d=c=0;d<a.Z;d++)for(f=0;f<a.ja;f++)for(g=0;g<a.ea;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var q=l.data;if(void 0===q){var t=l.bytes;if(void 0!==t&&t.length){for(var u=m<<2,C=t.length;C<u;C++)t[C]=n;ii(l,t)}else q=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=q;delete l.bytes}fi(l,d,f);for(u=
|
||||
0;u<q.length;u++)c=c+q[u]&-1}a.b=k;a.i=c;e=a}else v("Empty disk image: "+a.Ya)}catch(A){v("Disk image error ("+b+"): "+A.message)}}a.g&&(a.g.call(a.w,a.u,e,a.Ya,a.Oa),a.g=null)}function fi(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.pk=b;a.qk=c;a.Va=a.La=0;a.hb=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.u,g=this.b[a];if(g){var k=g[b];if(!k&&f.vf&&b<f.ja)for(k=g[b]=Array(f.wf),g=0;g<k.length;g++)k[g]=fi(null,a,b,g+1,f.re,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.vf&&9==f.fe&&(d=k[g]=fi(null,a,b,f.fe,f.re,0))}}e&&e(d,!1);return d};function ii(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.La?f<a.Va?(a.La+=a.Va-f,a.Va=f):f>=a.Va+a.La&&(a.La+=f-(a.Va+a.La)+1):(a.Va=f,a.La=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function ji(a,b){var c=a.ja*a.ea,d=b/c|0;return d<a.Z?(b%=c,a.seek(d,b/a.ea|0,b%a.ea+1)):null}function ki(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Oa,this.i,this.Z,this.ja,this.ea,this.ua];if(!this.j)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.La){for(var k=[],l=0,m=g.Va,n=g.Va+g.La;m<n;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.Va,k]}}return b};
|
||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?ei(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.i&&e[1]!=this.i&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.i+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.Va=e;for(k.La=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.T("Unable to restore disk '"+this.Ya+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=ji(this,a++);)li(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 li(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var di=0;function mi(a,b,c,d,e,f){r.call(this,a,b,c);this.N=ni(this,b.autoMount);this.M=0;this.R=d;this.S=e;this.U=f;this.P=d.Wc;this.g=Array(this.P);this.O=!db("Mobi")&&window&&"FileReader"in window;this.B=[];this.Qa=null;this.exports={selectDrive:this.bh}}p(mi,r);
|
||||
function ni(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=mi.prototype;
|
||||
h.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){v(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.H[b]=c,c.onchange=function(){var a=Ea(c.value,10);null!=a&&
|
||||
oi(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&pi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&Ea(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.T("Unable to boot the selected drive"):a.da?(te(d.f,0,!0,b),(a=d.Ub(a,a.Df,a.Ef,a.Ff,a.xf,0,2))&&d.T("Unable to read the boot sector ("+a+")")):d.T("Load a disk into the drive first")},!0;case "saveDisk":if(!this.O){c.parentNode.removeChild(c);
|
||||
break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[Ea(a.value,10)||0])if(a=a.da){var b;b="";for(var c=0,k;k=ji(a,c++);)for(var l=0,m=k.length;l<m;l++)b+=String.fromCharCode(ki(a,k,l));b=btoa(b);a=a.Bd.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+
|
||||
a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");v(a)}else d.T("No disk loaded in drive.");else d.T("No disk drive selected.")};return!0;case "mountDisk":if(this.O)return this.H[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;pi(d,Ja(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;if(a=ni(this,Td(this.K,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.N[e]=a[e]);this.reset();this.Qa=jd(this.f,this.R.rd,this.R.nd,this.ha);Rb(b,this,this.U);Tb(b,this.reset.bind(this));qi(this,"None",ri,!0);this.O&&qi(this,"Local Disk",si);qi(this,"Remote Disk",ti);Ni(this)||y(this)};
|
||||
h.Da=function(a,b){if(!b){if(!a){if(this.reset(),this.K.M){this.B=[];for(a=0;a<this.g.length;a++)Pi(this,a,!0);Ni(this,!0)}}else if(!this.restore(a))return!1;if(a=this.H.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;b<this.P;b++){var c=document.createElement("option");c.value=b;c.text=this.g[b].Nc||"---";a.appendChild(c)}0<this.P&&(a.value="0",oi(this,0))}}return!0};h.Ca=function(a){return a?this.save():!0};h.reset=function(){this.Db();Qi(this)};
|
||||
h.save=function(){var a=new G(this);a.set(0,this.Oc());a.set(1,Ri(this));a.set(2,Si(this));return a.data()};h.restore=function(a){var b=!0;this.Db(a[0])||(b=!1);var c=a[1];c&&(this.B=c);Qi(this,a[2])||(b=!1);return b};h.Db=function(){return!0};h.Oc=function(){return[]};
|
||||
function Qi(a,b){for(var c=0;c<a.g.length;c++){var d=a.g[c];void 0===d&&(d=a.g[c]={});var e=a,f=d,d=c,g=a.S,k=b&&b[c],l=0;f.Tb=d;f.name=e.Mb;f.wd=f.Pb=!1;f.xd=!0;f.Nc=g[l++]+d;f.Z=g[l++];f.ja=g[l++];f.ea=g[l++];f.ua=g[l++];f.Df=g[l++];f.Ef=g[l++];f.Ff=g[l++];f.xf=g[l++];f.status=g[l++];f.ik=0;f.hk=0;f.fe=1;f.wf=f.ea;f.re=f.ua;f.rk=0;f.yk=null;f.da||(f.Oa="");k&&(l=k[1],g=k[2],k[0]?(f=l,k=g,g=e.g[d],Pi(e,d,!0),g.Pb=!0,d=new ci(e,g,"preload"),e.je(g,d,f,k,!0)):Ti(e,d,l,g,!0)?f.da&&g&&Ui(e,l,g,f.da):
|
||||
y(e,!1))}return!0}function Si(a){for(var b=[],c=0;c<a.g.length;c++){var d=a.g[c];b.push([d.Pb,d.Ya,d.Oa])}return b}function Ri(a){for(var b=0;b<a.g.length;b++){var c=a.g[b];c.da&&Vi(a,c.Oa,c.da)}return a.B}
|
||||
function Ni(a,b){b||(a.M=0);for(var c in a.N){var d=a.N[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.H.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=Ja(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.g.length)){!Ti(a,g,f,e,!0)&&b&&y(a,!1);continue}a.T("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.M}
|
||||
function pi(a,b,c,d){var e=a.H.listDrives,e=e&&Ea(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.T("Unable to load the selected drive");else if(c)if(c==si)a.T('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==ti){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ja(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ti(a,e,b,c,!1,d)}else Pi(a,e)}
|
||||
function Ti(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Oa.toLowerCase()!=d.toLowerCase()&&(g++,Pi(a,b,!0),k.wd?a.T(a.type+" busy"):(k.wd=!0,e&&(k.vd=!0,a.M++,z(a)&&D(a,"auto-loading disk: "+c)),k.Pb=!!f,gi(new ci(a,k,"preload"),c,d,f,a.je)&&g++));return g}
|
||||
h.je=function(a,b,c,d,e){a.wd=!1;b&&(b.Z>a.Z||b.ja>a.ja)&&(this.T('Disk "'+c+'" too large for drive '+(this.g[a.Tb].Nc||"---")),b=null);b?(a.da=b,a.Ya=c,a.Oa=d,this.se(a.Tb),Ui(this,c,d,b),this.T('Loaded disk "'+c+'" in drive '+(this.g[a.Tb].Nc||"---"),a.vd||e),this.K&&ke(this.K)):a.Pb=!1;a.vd&&(a.vd=!1,--this.M||y(this));oi(this,a.Tb)};
|
||||
function qi(a,b,c,d){if((a=a.H.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function oi(a,b,c){var d=!1;if(0<=b&&b<a.g.length){var e=a.g[b],f=a.H.listDisks;a=a.H.listDrives;if(f&&a&&f.options&&a.options){if(c)for(c=0;c<a.options.length;c++)if(Ea(a.options[c].value,10)==e.Tb){a.selectedIndex!=c&&(a.selectedIndex=c);d=!0;break}c=Ea(a.value,10);e=e.Pb?si:e.Oa;if(!isNaN(c)&&c==b){for(c=0;c<f.options.length;c++)if(f.options[c].value==e){f.selectedIndex!=c&&(f.selectedIndex=c);d=!0;break}c==f.options.length&&(f.selectedIndex=0)}}}return d}
|
||||
h.bh=function(a){var b=this.H.listDrives;if(b&&b.options)for(var c=b.options.length,d=0;d<c;d++)if(b.options[d].innerHTML==a){var e=Ea(b.options[d].value,10);if(0<=e)return oi(this,e,!0)}return!1};function Pi(a,b,c){var d=a.g[b];if(d.da||!1===c)Vi(a,d.Oa,d.da),d.Ya="",d.Oa="",d.da=null,d.Pb=!1,c||(a.T("Drive "+(a.g[b].Nc||"---")+" unloaded",c),oi(a,b))}function Ui(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}
|
||||
function Vi(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}h.se=function(){};h.Ub=function(){return-1};h.Rc=function(){return-1};var ri="",si="?",ti="??";function N(a){mi.call(this,"RK11",a,65536,Hb,Hb.Ec,Wi);this.G=this.i=this.b=this.w=this.u=this.j=this.C=0}p(N,mi);h=N.prototype;
|
||||
h.Db=function(a){a||(a=[Xi.Ec|Xi.$d|Xi.Wd,0,R.$a,0,0,0,0]);a=ia(a);this.G=a.next().value;this.i=a.next().value;this.b=a.next().value;this.w=a.next().value;this.u=a.next().value;this.j=a.next().value;this.C=a.next().value;return!0};h.Oc=function(){return[this.G,this.i,this.b,this.w,this.u,this.j,this.C]};
|
||||
h.Ub=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,q;a||(m=S.Qd,e=0);for(;e;){if(!n){if(b>=a.Z){m=S.Cc;break}n=a.seek(b,c,d+1);if(!n){m=S.Zd;break}q=0;++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b))}var t,u;if(0>(t=a.read(n,q++))||0>(u=a.read(n,q++))){m=S.Dc;break}if(!k&&(sc(this.D,Je(this.f,f),t|u<<8),fd(this.D))){m=S.ec;break}q>=a.ua&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Rc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,q;a||(m=S.Qd,e=0);for(;e;){var t=uc(this.D,Je(this.f,f));if(fd(this.D)){m=S.ec;break}if(!n){if(b>=a.Z){m=S.Cc;break}n=a.seek(b,c,d+1,!0);if(!n){m=S.Zd;break}q=0;++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b))}if(k){var u,C;if(0>(u=a.read(n,q++))||0>(C=a.read(n,q++))){m=S.Dc;break}if(t!=(u|C<<8)){m=S.ce;break}}else if(!a.write(n,q++,t&255)||!a.write(n,q++,t>>8)){m=S.Dc;break}q>=a.ua&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Ve=function(a,b,c,d,e,f){this.u=f&65535;this.b=this.b&~R.Jb|f>>16-R.ma.Jb&R.Jb;this.w=65536-e&65535;this.j=this.j&~Yi.od|d&Yi.od;this.i|=a;Zi(this);return!0};function Zi(a){a.b&=~R.jb;a.i&&(a.i|=S.Fe,a.b|=R.jb,a.i&S.bd&&(a.b|=R.bd),z(a)&&D(a,a.type+": ERROR: "+E(a.i)))}h.wg=function(){return this.G};h.Jh=function(){};h.xg=function(){return this.i};h.Kh=function(){};h.tg=function(){return this.b&R.fc};
|
||||
h.Gh=function(a){this.b=this.b&~R.Sa|a&R.Sa;if(this.b&R.dc){a=!0;var b,c,d="",e=(this.j&Yi.tb)>>Yi.ma.tb,f=this.g[e],g,k,l,m,n,q;this.b&=~(R.$a|R.pd);this.i&=~S.lf;switch(c=this.b&R.wa){case $i.Ae:z(this)&&D(this,this.type+": CRESET("+e+")",!0);this.i=this.j=0;this.b=R.$a;break;case $i.Qe:d="RCHK";case $i.ub:d||(d="READ"),b=this.Ub;case $i.sd:d||(d="WCHK");case $i.hc:d||(d="WRITE");b||(b=this.Rc);g=(this.j&Yi.bc)>>Yi.ma.bc;k=(this.j&Yi.ed)>>Yi.ma.ed;l=this.j&Yi.od;m=65536-this.w&65535;n=(this.b&R.Jb)<<
|
||||
16-R.ma.Jb|this.u;q=this.b&R.Me?0:2;z(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.Z){this.i|=S.Cc;break}if(l>=f.ea){this.i|=S.Dc;break}a=b.call(this,f,g,k,l,m,n,q,c>=$i.sd,this.Ve.bind(this));break;case $i.Ic:g=(this.j&Yi.bc)>>Yi.ma.bc;z(this)&&D(this,this.type+": SEEK("+g+")",!0);g<f.Z?this.b|=R.pd:this.i|=S.Cc;break;case $i.Ge:z(this)&&D(this,this.type+": DRESET("+e+")");this.i=this.j=0;this.b=R.$a|R.pd;break;default:z(this)&&D(this,this.type+": UNSUPPORTED("+
|
||||
c+")")}this.G=f.status|(f.da?Xi.Fa:0)|e<<Xi.ma.gd|this.j&Xi.kf;Zi(this);a&&(this.b&=~R.dc,this.b|=R.$a,this.b&R.Ib&&hd(this.f,this.Qa))}};h.yg=function(){return this.w};h.Lh=function(a){this.w=a};h.sg=function(){return this.u};h.Fh=function(a){this.u=a};h.ug=function(){return this.j};h.Hh=function(a){this.j=a};h.vg=function(){return this.C};h.Ih=function(a){this.C=a};
|
||||
var Xi=Hb.Fc,S=Hb.Ye,R=Hb.We,Yi=Hb.Xe,$i=Hb.wa,aj={},Wi=(aj[65280]=[null,null,N.prototype.wg,N.prototype.Jh,"RKDS"],aj[65282]=[null,null,N.prototype.xg,N.prototype.Kh,"RKER"],aj[65284]=[null,null,N.prototype.tg,N.prototype.Gh,"RKCS"],aj[65286]=[null,null,N.prototype.yg,N.prototype.Lh,"RKWC"],aj[65288]=[null,null,N.prototype.sg,N.prototype.Fh,"RKBA"],aj[65290]=[null,null,N.prototype.ug,N.prototype.Hh,"RKDA"],aj[65294]=[null,null,N.prototype.vg,N.prototype.Ih,"RKDB"],aj);
|
||||
function xd(a){mi.call(this,"RL11",a,131072,Ib,Ib.Ze,bj);this.b=this.C=this.i=this.j=this.w=this.u=0}p(xd,mi);h=xd.prototype;h.Db=function(a){a||(a=[U.Fa|U.$a,0,0,0,0,0]);a=ia(a);this.b=a.next().value;this.C=a.next().value;this.i=a.next().value;this.j=a.next().value;this.w=a.next().value;this.u=a.next().value;return!0};h.Oc=function(){return[this.b,this.C,this.i,this.j,this.w,this.u]};
|
||||
h.Ub=function(a,b,c,d,e,f,g,k,l){g=0;a=a.da;k=null;var m;a||(g=cj.ab,e=0);for(;e;){if(!k){k=a.seek(b,c,d+1);if(!k){g=cj.ab;break}m=0}var n,q;if(0>(n=a.read(k,m++))||0>(q=a.read(k,m++))){g=cj.ab;break}sc(this.D,Je(this.f,f),n|q<<8);if(fd(this.D)){g=cj.ec;break}f+=2;e--;if(m>=a.ua&&(k=null,++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b>=a.Z)))){g=cj.ab;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.Rc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.da;k=null;var m;a||(g=cj.ab,e=0);for(;e;){var n=uc(this.D,Je(this.f,f));if(fd(this.D)){g=cj.ec;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=cj.ab;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=cj.ab;break}if(m>=a.ua&&(k=null,++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b>=a.Z)))){g=cj.ab;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.$e=function(a,b,c,d,e,f){this.C=f&65535;this.b=this.b&~U.Za|f>>16-U.ma.Za&U.Za;this.u=f>>16&dj.bb;this.j=this.i=b<<ej.ma.gc|(c?ej.Hc:0)|d&ej.Xd;this.w=65536-e&65535;a&&(this.b=this.b|a|U.jb);return!0};h.Bg=function(){return this.b&U.fc};
|
||||
h.Oh=function(a){this.b=this.b&~U.Sa|a&U.Sa;this.u=this.u&60|(a&U.Za)>>U.ma.Za;if(!(this.b&U.$a)){a=!0;var b,c="",d=this.g[(this.b&U.tb)>>U.ma.tb],e=d.da,f,g,k;this.b&=~U.Fa;switch(this.b&U.wa){case fj.qf:this.w&gj.Nd&&(this.b&=U.Fa|U.wa|U.Za);this.w=d.status|this.j&ej.Hc|(e&&512==e.Z?gj.Je:0);break;case fj.Ic:(this.i&ej.Ie)==ej.mf&&(b=this.i&ej.gc,c=(this.i&ej.pf)<<2,this.j=this.i&ej.nf?this.j+b:this.j-b,this.i=this.j=this.j&ej.gc|c);break;case fj.Ue:this.w=this.j;break;case fj.Re:c="READ",b=this.Ub;
|
||||
case fj.sf:c||(c="WRITE"),b||(b=this.Rc),f=this.i>>ej.ma.gc,g=this.i&ej.Hc?1:0,k=this.i&ej.Xd,!e||f>=e.Z||k>=e.ea?this.b=this.b|cj.ab|U.jb:(a=65536-this.w&65535,e=(this.u&dj.bb)<<16|this.C,z(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.$e.bind(this)))}a&&(this.b=this.b|U.Fa|U.$a,this.b&U.Ib&&hd(this.f,this.Qa))}};h.zg=function(){return this.C};h.Mh=function(a){this.C=a&hj.Sa};h.Cg=function(){return this.i};
|
||||
h.Ph=function(a){this.i=a};h.Dg=function(){return this.w};h.Qh=function(a){this.w=a};h.Ag=function(){return this.u};h.Nh=function(a){this.u=a&dj.bb;this.b=this.b&~U.Za|(this.u&3)<<U.ma.Za};
|
||||
var U=Ib.cf,hj=Ib.af,ej=Ib.df,gj=Ib.Gc,dj=Ib.bf,cj=Ib.Md,fj=Ib.wa,ij={},bj=(ij[63744]=[null,null,xd.prototype.Bg,xd.prototype.Oh,"RLCS"],ij[63746]=[null,null,xd.prototype.zg,xd.prototype.Mh,"RLBA"],ij[63748]=[null,null,xd.prototype.Cg,xd.prototype.Ph,"RLDA"],ij[63750]=[null,null,xd.prototype.Dg,xd.prototype.Qh,"RLMP"],ij[63752]=[null,null,xd.prototype.Ag,xd.prototype.Nh,"RLBE"],ij);
|
||||
function yd(a){mi.call(this,"RX11",a,262144,Jb,Jb.ef,jj);this.I=this.G=this.i=this.L=this.b=this.C=0;this.j=V.Kb;this.u=0;this.w=Array(128).fill(0)}p(yd,mi);h=yd.prototype;h.Db=function(a){a?(a=ia(a),this.b=a.next().value,this.C=a.next().value,this.I=a.next().value,this.G=a.next().value,this.i=a.next().value,this.L=a.next().value,this.j=a.next().value,this.u=a.next().value,this.w=a.next().value):(this.C=this.b=0,this.G=this.I=1,this.L=this.i=0,this.j=V.ub,this.u=0,nd(this.f,this.Qa),kj(this));return!0};
|
||||
h.Oc=function(){return[this.b,this.C,this.I,this.G,this.i,this.L,this.j,this.u,this.w]};h.se=function(a){a||this.Db()};function lj(a,b){b&&(a.L=b,a.C=a.i,a.b|=W.jb);a.j=V.Kb;a.b|=W.DONE;a.b&W.Ib&&hd(a.f,a.Qa)}
|
||||
h.Ub=function(a,b,c,d,e,f,g,k,l){k=0;var m=a.da,n=null,q;z(this)&&D(this,this.type+".readData("+b+":"+c+":"+d+") "+E(f)+"--"+E(f+(e<<1)),!0,!0);m||(k=a.Tb?mj.dd:mj.cd,e=0);for(;e;){if(!n){if(b>=m.Z){k=mj.Oe;break}n=m.seek(b,c,d+1);if(!n){k=mj.md;break}q=0;++d>=m.ea&&(d=0,++c>=m.ja&&(c=0,++b))}var t;if(0>(a=m.read(n,q++))||0>(t=m.read(n,q++))){k=mj.ld;break}sc(this.D,Je(this.f,f),a|t<<8);q>=m.ua&&(n=null);f+=g;e--}return l?l(k,b,c,d,e,f):k};
|
||||
function kj(a){var b=0,c=a.b&W.qd?1:0,d=a.g[c],d=d&&d.da,e=a.I&nj.bb,f=a.G&oj.bb;a.i&=~(pj.Id|pj.Td|pj.cc|pj.Fa);if(d)if(a.i|=pj.Fa,z(a)&&D(a,a.type+".readSector("+e+":0:"+f+")",!0,!0),c=d.seek(e,0,f,!0)){e=0;for(f=a.w.length;e<f;){var g=d.read(c,e);if(0>g){b=mj.ld;break}a.w[e++]=g}c.Af&&(a.i|=pj.cc)}else b=mj.md;else b=c?mj.dd:mj.cd;lj(a,b)}
|
||||
h.Fg=function(a,b){a=this.b;if(!b)switch(a&=W.fc,this.j){case V.Zc:case V.EMPTY:this.u<this.w.length&&(this.b|=W.fb);break;case V.ub:case V.hc:case V.Jc:2>this.u&&(this.b|=W.fb)}return a};
|
||||
h.Sh=function(a){this.b=this.b&~W.Sa|a&W.Sa;if(this.b&W.INIT)this.Db();else if(this.b&W.dc&&this.j==V.Kb)switch(this.j=this.b&W.wa,this.b&=~(W.dc|W.fb|W.DONE|W.jb),nd(this.f,this.Qa),z(this)&&D(this,this.type+".processCommand("+qj[this.j>>1]+")",!0,!0),this.j){case V.Zc:case V.EMPTY:case V.ub:case V.hc:case V.Jc:this.u=0;break;case V.Te:a=this.g[this.b&W.qd?1:0];this.i&=~pj.Fa;a&&a.da&&(this.i|=pj.Fa);this.C=this.i;lj(this);break;case V.Se:this.C=this.L,lj(this)}else this.b&W.Ib?this.b&W.DONE&&hd(this.f,
|
||||
this.Qa):nd(this.f,this.Qa)};h.Gg=function(a,b){if(!b)switch(this.j){case V.EMPTY:this.b&W.fb&&(this.b&=~W.fb,this.C=this.w[this.u]&255,z(this)&&D(this,this.type+".readByte("+this.u+"): "+F(this.C,2,!0),!0,!0),++this.u>=this.w.length&&lj(this))}return this.C};
|
||||
h.Th=function(a){switch(this.j){case V.Zc:this.b&W.fb&&(this.b&=~W.fb,this.w[this.u]=a&255,z(this)&&D(this,this.type+".writeByte("+this.u+","+F(a,2,!0)+")",!0,!0),++this.u>=this.w.length&&lj(this));break;case V.ub:case V.hc:case V.Jc:if(this.b&W.fb)switch(this.b&=~W.fb,this.u++){case 0:this.G=a;break;case 1:if(this.I=a,this.j==V.ub)kj(this);else{var b=this.j==V.Jc,c=0,d=this.b&W.qd?1:0,e=this.g[d],e=e&&e.da,f=this.I&nj.bb,g=this.G&oj.bb;this.i&=~(pj.Id|pj.Td|pj.cc|pj.Fa);if(e)if(this.i|=pj.Fa,z(this)&&
|
||||
D(this,this.type+".writeSector("+f+":0:"+g+")",!0,!0),d=e.seek(f,0,g,!0))for(b&&(d.Af=!0),b=0,f=this.w.length;b<f;){if(!e.write(d,b,this.w[b]&255)){c=mj.ld;break}b++}else c=mj.md;else c=d?mj.dd:mj.cd;lj(this,c)}}}this.C=a};var W=Jb.ff,nj=Jb.jf,oj=Jb.hf,pj=Jb.gf,V=Jb.wa,mj=Jb.ERROR,qj="FILL EMPTY WRITE READ UNUSED RDSTAT WRDEL RDERR".split(" "),rj={},jj=(rj[65144]=[null,null,yd.prototype.Fg,yd.prototype.Sh,"RXCS"],rj[65146]=[null,null,yd.prototype.Gg,yd.prototype.Th,"RXDB"],rj);
|
||||
function sj(a){r.call(this,"Debugger",a);this.Ba=+a.base||16;this.ia=!1;this.w=0;this.O=!1;this.u=-1;this.j=[];this.S={}}p(sj,r);sj.prototype.me=function(){return-1};sj.prototype.ne=function(){};
|
||||
function tj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.O?b="end":b=a.j[a.u+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(Pa(b.substring(c,f))),c=f+1}}return a}
|
||||
function uj(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<<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;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?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 pj(a,b,c){var d;if(b){b=qj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=Za(n);if(!n){f=!0;break}n=rj(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],u=n.length;l.length&&sj[n]<sj[l[l.length-1]]&&oj(k,l,1);l.push(n);b=b.substr(r+u)}oj(k,l)&&1==k.length||(f=!0);f?c&&a.u("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&tj(a,null,
|
||||
d))}return d}function qj(a,b){for(var c,d=a.ha?"(":"{",e=a.ha?")":"}",f=new RegExp(a.ha?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=pj(a,c[1]);b=b.replace(d+c[1]+e,null!=g?K(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
||||
function rj(a,b,c,d){var e;null!=b?(e=a.Yd(b),0<=e?e=a.Zd(e):(e=a.U[b],null==e&&(e=La(b,a.Aa))),null!=e||d||a.u("invalid "+(c?c:"value")+": "+b)):d||a.u("missing "+(c||"value"));return e}function tj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=Qa(d&255,8)+g,d>>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e}
|
||||
function uj(a,b){if(b)return tj(a,b,a.U[b]);var c=0;for(b in a.U)tj(a,b,a.U[b]),c++;return 0<c}function K(a,b,c,d){switch(a.Aa){case 8:a=E(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=F(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var sj={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function vj(a){mj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.va=W();this.N=W();this.B=[];this.g=this.L=this.D=[];wj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;xj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];yj(this,a.messages);this.ta=a.commands;this.Ha=zj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]=
|
||||
function(a){return je(b,a)})}p(vj,mj);function Aj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=vj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function Bj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function Cj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=nj(a,c.Cc=b[4]));return c}
|
||||
h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&yj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Dj));1145>this.f.ia&&(this.W=this.W.concat(Ej));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=Aj(Fj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."):
|
||||
(c=n.type,m=cd[c],n&&d.u(F(n.id,8)+" %"+F(e<<d.C.g,8)+" %"+F(n.J,8)+" "+Sa(n.Ob)+" "+Sa(n.size)+" "+m),c!=Fd&&(c=-1),m=0);a+=d.C.j;e++}}});y(this)};
|
||||
h.ua=function(a,b,c){var d=this;switch(b){case "debugInput":return this.V=this.H[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",je(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.v<d.j.length-1&&(b=d.j[++d.v])):40==a.keyCode&&(0<d.v?b=d.j[--d.v]:(b="",d.v=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.H[b]=c,wb(c,function(){if(d.V){var a=d.V.value;d.V.value=
|
||||
"";je(d,a,!0);return!0}return!1}),!0;case "step":return this.H[b]=c,wb(c,function(a){var b=!1;Ja(d,!0)||(Ka(d,!0),b=sc(d,a?1:0,null),Ka(d,!1));return b}),!0}return!1};function ie(a){if(a.V){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.V.focus();window&&window.scrollTo(b,c)}}h.sd=function(a,b){var c=255,d=Aj(a);-1!==d&&(a.Ka||65535<d?(c=this.C,d=Me(this.f,d),c.D=!1,c.la++,d=ed(c,d).K(d&c.i,d),c.la--):(c=this.f,c.oa++,d=c.C.od(yc(c,d,3)),c.oa--),c=d,b&&Gj(a,b));return c};
|
||||
h.Oa=function(a,b){var c=65535,d=Aj(a);-1!==d&&(c=a.Ka||65535<d?zc(this.C,Me(this.f,d)):Ac(this.f,d),b&&Gj(a,b));return c};h.td=function(a,b,c){var d=Aj(a);if(-1!==d){if(a.Ka||65535<d)fd(this.C,Me(this.f,d),b);else{var e=this.f;e.oa++;e.C.pd(yc(e,d,5),b);e.oa--}c&&Gj(a,c);I(this.K,-1)}};h.se=function(a,b,c){var d=Aj(a);if(-1!==d){if(a.Ka||65535<d)xc(this.C,Me(this.f,d),b);else{var e=this.f;e.oa++;e.C.Sb(yc(e,d,4),b);e.oa--}c&&Gj(a,c);I(this.K,-1)}};
|
||||
function Fj(a,b,c){var d;c=(c?a.G:a.va).J;var e,f;if(void 0!==b){b=qj(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,k;a:{c=a.C;var l;l=d.toUpperCase();for(k in c.Na){var m=+k;if(c.Na[m][4]==l){k=c.B+m;break a}}k=null}if(null==k&&d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.B.length;c++)if(l=a.B[c].ea[d],null!=l){k=l.o;break}null!=k&&(g=W(k));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=pj(a,b,void 0)}null!=c&&(d=W(c,e,f));return d}
|
||||
function Hj(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Pd=nj(a,b.Cc=c[2]))}function Gj(a,b){null!=a.J&&(a.J+=b||1)}function Ij(a,b){return(b.Ka?"%":"")+K(a,b.J)}
|
||||
function yj(a,b){a.F=a;a.fa=a.Sd=536870912;a.R=null;a.M=[];b=nj(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Qb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.fa|=Qb[c],a.u(c+" messages enabled"))}}function qd(a,b,c){for(var d in Qb)if(b==Qb[d]){a.ia[d]=c;break}}
|
||||
h.Yd=function(a){a=a.toUpperCase();var b=Jj[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function Kj(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
h.Zd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Lj:b=Ad(this.f);break;case Mj:b=c.$a;break;case Nj:b=c.P;break;case Oj:b=c.va&65280;break;case Pj:b=td(c);break;case Qj:b=wd(c);break;case Rj:b=xd(c);break;case Sj:b=c.V;break;case Tj:d&&(b=d.da);break;case Uj:d&&(b=d.Ta);break;case Vj:d&&Nc(d)&&(b=d.Ua)}}return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+Ij(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.aa(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}};
|
||||
function xj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Wj);for(b=0;b<a.i.length;b++)a.i[b]=W();a.P=0;a.u("instruction history buffer allocated")}}function Xj(a,b,c){if(!Yj(a,c))return!1;rc(a.f,b);return!0}
|
||||
function sc(a,b,c,d){if(!Yj(a))return!1;var e="";null===c&&(e=(c=!a.pa||"tr"==a.pa)?"tr":"t");a.w=0;b||vf(a)&&wf(a,a.f.g[7],0);try{b=qe(a.f,b);var f=a.f.pc(b);0<f&&(tc(a.f,f),a.w+=f,uc(a.f,f,!0),vc(a.f,f),a.X++)}catch(g){"number"!=typeof g&&(a.w=0,Ga(a.f,g.stack||g.message))}!1!==d&&(a.b&&a.b.stop(),I(a.K,-1));he(a,c||!1,e);return 0<a.w}h.aa=function(a){this.f&&this.f.aa(a)};
|
||||
function he(a,b,c){if(a.Ea){void 0===b&&(b=!0);c&&a.u(Zj+c);c=a.f;if(c=c.i&128?c.qc|c.nc<<8:0){var d=c>>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?ak(a):bk(a)}}function Yj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.Z?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0};
|
||||
h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){xj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;ck(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,Bj(this.G));a.set(1,Bj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()};
|
||||
h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=Cj(this,a[b++]),this.N=Cj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b};
|
||||
h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0<a?Math.round(1E3*this.w/a):0;b+=" (";vf(this)&&(b+=this.X+" instructions, ",this.X=0);b+=this.w+" cycles, "+a+" ms, "+c+" hz)"}else A(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.u(b)}he(this,!0);ie(this);ck(this,this.f.g[7]);this.R=null}};function vf(a){return 1<a.g.length||!!a.Y}
|
||||
function wf(a,b,c){var d=-1;c||(d=Ac(a.f,b))||(a.f.O&65535)!=b||(b=Ee(a.f,2));if(0<c&&(a.Y&&!--a.Y||dk(a,b,1,a.g)))return!0;0<=c&&a.i.length&&(a.X++,0>d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.aa(),-1;return!1}function Zd(a,b,c){dk(a,b,c||1,a.L)&&a.aa(!1)}function $d(a,b,c){dk(a,b,c||1,a.D)&&a.aa(!1)}
|
||||
function wj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b<a.L.length;b++)c=a.L[b],d=Aj(c),c.Ka?(c=a.C,Yd(c.b[d>>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=Aj(c),c.Ka?(c=a.C,Yd(c.b[d>>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0}
|
||||
h.wb=function(a,b,c){var d=!0;c||ek(this,a,b,!1,!0);if(a!=this.g){var e=Aj(b);if(-1===e)this.u("invalid address: "+Ij(this,b)),d=!1;else{var f=a==this.D;65535<e&&(b.Ka=!0);if(b.Ka){var g=this.C;g.b[e>>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(fk(this,a,a.length-1,"set"),xj(this)));return d};
|
||||
function ek(a,b,c,d,e){var f=!1;c=Aj(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==Aj(k)&&(!d||k.Ra)){f=!0;k.Ra||e||fk(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(b=b==a.D,k.Ka?(d=a.C,Yd(d.b[c>>>d.g],b)):Pe(a.f,b));k.Ra||xj(a);break}}return f}function gk(a,b){for(var c=1;c<b.length;c++)fk(a,b,c);return b.length-1}function fk(a,b,c,d){c=b[c];a.u(b[0]+" "+Ij(a,c)+(d?" "+d:c.Cc?' "'+c.Cc+'"':""))}
|
||||
function ck(a,b){if(void 0!==b)dk(a,b,1,a.g,!0),a.I=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Ra){if(!ek(a,a.g,c,!0))break;b=0}}}
|
||||
function dk(a,b,c,d,e){var f=!1;if(!a.ja++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Ra)for(var l=Aj(k)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==l){var n,f=!0;k.Ra&&(ek(a,d,k,!0),e=!0);if(n=k.Pd){for(var f=!1,r=0;r<n.length;r++)if(!hk(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var u=r+1;u<n.length&&n[u].indexOf("else");u++)r++;if(u==n.length){f=!0;break}}a.f.A.T||(f=!0)}if(f){e||fk(a,d,g,"hit");break}}}a.ja--;return f}
|
||||
function ik(a,b,c,d){var e=W(b.J),f=a.Oa(b,2),g,k;for(k in a.Ha)if(g=a.Ha[k][f&k])break;g||(g=jk);var l=g[0];0<=a.W.indexOf(l)&&(g=jk,l=g[0]);var m=k="",n=kk[l],r=g.length-1;l||r||(k=K(a,f));for(l=1;l<=r;l++){var u=g[l];if(void 0!==u){var t;t=a;var C=u,u=b,z="",B=C&lk;if(B==X)u=u.J+((f&255)<<24>>23)&65535,z=K(t,u);else if(B==mk)u=u.J-((f&63)<<1)&65535,z=K(t,u);else if(B==nk)z=K(t,f&7,1);else if(B==ok)z=K(t,f&63,1);else if(B==pk)z=K(t,f&255,1);else if(B=f&C,C&qk&&(B>>=6,C>>=6),C&Y){var C=null,H=B&
|
||||
rk;switch(B&sk){case 0:z=Kj(H);break;case 8:z="@"+Kj(H);C=tk(t,t.f.g[H]);break;case 16:7>H?z="("+Kj(H)+")+":(B=t.Oa(u,2),z="#"+K(t,B,0,!0));break;case 24:7>H?z="@("+Kj(H)+")+":(B=t.Oa(u,2),z="@#"+K(t,B,0,!0),C=tk(t,B));break;case 32:z="-("+Kj(H)+")";break;case 40:z="@-("+Kj(H)+")";break;case 48:B=t.Oa(u,2);z=K(t,B,0,!0)+"("+Kj(H)+")";7==H&&(z=K(t,B=B+u.J&65535),C=tk(t,B));break;case 56:B=t.Oa(u,2),z="@"+K(t,B)+"("+Kj(H)+")",7==H&&(z="@"+K(t,B=B+u.J&65535),C=tk(t,Ac(t.f,B)))}C&&(z=[z,C])}t=z;if(!t||
|
||||
!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0<k.length&&(k+=",");k+=t||"???"}}f="";g=Ij(a,e)+":";if(-1!==e.J&&-1!==b.J){do if(f+=" "+K(a,a.Oa(e,2)),null==e.J)break;while(e.J!=b.J)}g+=Ya(f,24);g+=Ya(n,5);k&&(g+=" "+k);if(c||m)g=Ya(g,60)+";"+(c||""),g=a.f.A.Fb?g+("cycles="+ke(a.f).toString()+" cs="+F(a.f.bc)):g+(null!=d?"="+d.toString():""),m&&(";"!=g.slice(-1)&&(g+=" "),g+=m);return g}
|
||||
function tk(a,b){b=Ne(a.f,b)[0];b>=a.f.ob&&b<a.C.B&&(b=b-a.f.ob+a.C.B);var c=a.C;a=null;b>=c.B&&(b=c.Na[b&jd])&&(a=b[4]);return a}function uk(a,b){switch(b){case "N":a=De(a.f);break;case "Z":a=Ce(a.f);break;case "V":a=Be(a.f);break;case "C":a=Ae(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Z(a,b){var c="",d=a.f;if(8>b)c=Kj(b),c+="="+K(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.W[b-16]);else switch(b){case Lj:c="PS="+K(a,Ad(d));break;case Mj:c="PI="+K(a,d.$a);break;case Nj:c="ER="+K(a,d.P);break;case Oj:c="SL="+K(a,d.va&65280);break;case Pj:c="M0="+K(a,td(d));break;case Qj:c="M1="+K(a,wd(d));break;case Rj:c="M2="+K(a,xd(d));break;case Sj:c="M3="+K(a,d.V);break;case Tj:a.b&&(c="AR="+K(a,a.b.da,3));break;case Uj:a.b&&(c="DR="+
|
||||
K(a,a.b.Ta));break;case Vj:a.b&&Nc(a.b)&&(c="SR="+K(a,a.b.Ua,3))}c&&(c+=" ");return c}function vk(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,Lj)+Z(a,Mj)+Z(a,Oj);d+=uk(a,"T")+uk(a,"N")+uk(a,"Z")+uk(a,"V")+uk(a,"C");b&&(b=d,c=""+(Z(a,Pj)+Z(a,Qj)),c+=Z(a,Rj)+Z(a,Sj)+Z(a,Nj),c=c+"\n"+(Z(a,Vj)+Z(a,Tj)+Z(a,Uj)),d=b+("\n"+c));return d}h.Td=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function Bh(a,b,c,d,e){var f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var l=k.o,m=k.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=ab(n,l,a.Td);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Dj:b,J:c,ef:d,ea:e,Qd:f})}function wk(a,b,c){var d=[],e=Aj(b)>>>0;for(b=0;b<a.B.length;b++){var f=a.B[b],g=f.J>>>0,k=f.ef;if(e>=g&&e<g+k){e=ab(f.Qd,[e-g],a.Td);0<=e?xk(a,b,e,d):c&&(e=~e,xk(a,b,e-1,d),xk(a,b,e,d));break}}return d}
|
||||
function xk(a,b,c,d){var e={},f=a.B[b].Qd,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.B[b].ea[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}function yk(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return uj(a)||a.u("no variables"),!0;if(!c[2])return uj(a,c[1]);if(!c[3])return delete a.U[c[1]],!0;b=pj(a,c[3]);return void 0!==b?(a.U[c[1]]=b,!0):!1}a.u("invalid assignment:"+b);return!1}
|
||||
function zk(a,b,c){var d=null;if(b=Fj(a,b,!0)){var e=wk(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.J-e[1])&&(g=" + "+Sa(f)),f=e[0]+" ("+K(a,e[1])+")"+g,c&&a.u(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.J)&&(g=" - "+Sa(f)),f=e[4]+" ("+K(a,e[5])+")"+g,c&&a.u(f),d||(d=f))}else c&&a.u("no symbols")}return d}
|
||||
function ak(a,b){var c;if(b&&"?"==b[1])a.u("register commands:"),a.u("\tr\tdump registers"),a.u("\trm\tdump misc registers"),a.u("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.f;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.u("missing value for "+b[1]);return}g=pj(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.g[6]=g&65535;break;case "PC":case "R7":ye(e,
|
||||
g);a.G=W(e.g[7]);break;case "N":e.I=g?32768:0;break;case "Z":e.L=g?0:1;break;case "V":e.G=g?32768:0;break;case "C":e.D=g?65536:0;break;case "PS":Bd(e,g);break;case "PI":zd(e,g);break;case "ER":e.P=g;d=!0;break;case "SL":e.va=g|255;break;case "M0":ud(e,g);d=!0;break;case "M3":yd(e,g);d=!0;break;case "AR":a.b&&(d=a.b,hc(d,d.da=g));d=!0;break;case "DR":a.b&&(d=a.b,Zb(d,d.Ta=g));d=!0;break;case "SR":if(a.b&&Nc(a.b)){ic(a.b,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.g[b]=
|
||||
g&65535;break}a.u("unknown register: "+f);return}I(a.K);a.u("updated registers:")}}a.u(vk(a,d));c&&(a.G=W(e.g[7]),bk(a,Ij(a,a.G)))}}function Ak(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.u(c[2]):tj(a,null,c[2].charCodeAt(0)):pj(a,b,!0)}
|
||||
function Bk(a,b,c){if("?"==c)a.u("trace commands:"),a.u("\tt [#]\ttrace # instructions"),a.u("\ttr [#]\ttrace # instructions with register updates"),a.u("\ttc [#]\ttrace # cycles"),a.u("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=rj(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.pa=b;vb(c,function(){return Ka(a,!0)&&sc(a,e,d,!1)},function(){a.b&&a.b.stop();I(a.K,-1);Ka(a,!1)})}}
|
||||
function bk(a,b,c,d){if(b=Fj(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=rj(a,c.substr(1)),null!=c&&(d=c);else{d=Fj(a,c,!0);if(!d||d.J<b.J)return;e=d.J-b.J;if(256<e){a.u("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=Ja(a,!1)||a.I?a.w:null;var g=null!=f?"cycles":null,k=wk(a,b),l=b.J;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=ik(a,b,g,f);a.u(f);a.G=b;e-=b.J-l;c++}}}
|
||||
function hk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Zj+b):(a.O&&(a.u("ended assemble at "+Ij(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Ia(a)&&0<b.length){a.O&&(b="a "+Ij(a,a.N)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var k=g[0],l=k.charAt(0),m=1;m<k.length;m++){var n=k.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=k.substr(m);g.unshift(k.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
|
||||
Fj(a,g[1],!0);if(r)if(a.N=r,void 0===g[2])a.u("begin assemble at "+Ij(a,r)),a.O=!0,I(a.K);else{var u;a.u("not supported yet");u=[];if(u.length){for(var t=0;t<u.length;t++)a.td(r,u[t],1);a.u(ik(a,a.N))}}break;case "b":a:{var C=g[0],z=g[1],B=b;if("?"==z)a.u("breakpoint commands:"),a.u("\tbp #\tset exec breakpoint"),a.u("\tbr #\tset read breakpoint"),a.u("\tbw #\tset write breakpoint"),a.u("\tbc #\tclear breakpoint (* to clear all)"),a.u("\tbl\tlist all breakpoints"),a.u("\tbn [#]\tbreak after # instruction(s)");
|
||||
else{var H=C.charAt(1);if("l"==H){var ob;ob=0+gk(a,a.g);ob+=gk(a,a.L);(ob+=gk(a,a.D))||a.u("no breakpoints")}else if("n"==H){var vd=+z||0;z&&(a.Y=vd);a.u("break after "+vd+" instruction(s)")}else if(void 0===z)a.u("missing breakpoint address");else{var na=W();if("*"!=z&&(na=Fj(a,z,!0),!na))break a;"c"==H?null==na.J?(wj(a),a.u("all breakpoints cleared")):ek(a,a.g,na)||ek(a,a.L,na)||ek(a,a.D,na)||a.u("breakpoint missing: "+Ij(a,na)):null!=na.J&&(Hj(a,na,B),"p"==H?a.wb(a.g,na):"r"==H?a.wb(a.L,na):"w"==
|
||||
H?a.wb(a.D,na):a.u("unknown breakpoint command: "+H))}}}break;case "c":a.Qa&&(a.Qa.value="");break;case "d":a:{var Sb,bb=g[0],Ma=g[1],cb=g[2],al=g[3];if("?"==Ma){var Tb="";for(Sb in Qb)a.ia[Sb]&&(Tb&&(Tb+=","),Tb+=Sb);Tb+=",state,symbols";a.u("dump memory commands:");a.u("\tda [a] dump info for address a");a.u("\tdb [a] [n] dump n bytes at address a");a.u("\tdw [a] [n] dump n words at address a");a.u("\tdd [a] [n] dump n dwords at address a");a.u("\tds [a] [n] dump n words at address a as JSON");
|
||||
a.u("\tdh [p] [n] dump n instructions from history position p");Tb.length&&a.u("dump extension commands:\n\t"+Tb)}else if("state"==Ma){var Ye=Ck(a.K,!0);"console"==cb?console.log(Ye):(a.Qa&&(a.Qa.value=""),Ye&&a.u(Ye))}else if("symbols"==Ma)for(var Ze=0;Ze<a.B.length;Ze++){var $e=a.B[Ze],Ub;for(Ub in $e.ea)if("."!=Ub.charAt(0)){var pi=$e.ea[Ub].o;if(void 0!==pi){var qi=$e.ea[Ub].l;qi&&(Ub=qi);a.u(K(a,pi)+" "+Ub)}}}else{if("d"==bb){for(Sb in Qb)if(g[1]==Sb){var ri=a.ia[Sb];ri?(g.shift(),g.shift(),
|
||||
ri(g)):a.u("no dump registered for "+Ma);break a}Ma||(bb=a.Ia||"dw")}else a.Ia=bb;if("dh"==bb){var si=Ma,ti=cb,ui="",vi=0,Ca=a.P,Na=a.i;if(Na.length){var wa=+si||a.oa,Bc=+ti||10;isNaN(wa)?wa=Bc:ui="more ";wa>Na.length&&(a.u("note: only "+Na.length+" available"),wa=Na.length);Ca-=wa;0>Ca&&(null==Na[Na.length-1].J?(wa=Ca+wa,Ca=0):Ca+=Na.length);var af=[];"call"==ti&&(Bc=1E5,af=["CALL"]);for(void 0!==si&&a.u(wa+" instructions earlier:");0<Bc&&Ca!=a.P;){var wi=Na[Ca++];if(null==wi.J)break;var Cc=W(wi.J),
|
||||
bl=wa--,xi=ik(a,Cc,"history",bl);(!af.length||0<=xi.indexOf(af[0]))&&a.u(xi);Cc.ad&&(Ca+=Cc.ad,Bc-=Cc.ad,wa-=Cc.ad);Ca>=Na.length&&(Ca=0);a.oa=wa;vi++;Bc--}}vi||(a.u("no "+ui+"history available"),a.oa=void 0)}else{var ia=Fj(a,Ma);if(ia)if("da"==bb){var bf=ia.Ka||65535<ia.J,M=Ne(a.f,ia.J||0,bf);a.u(Ya("",bf?12:19)+Qa(ia.J,bf?22:17,3)+" "+E(ia.J,8));6>M.length?(2<M.length&&(a.u(" OFFSET: "+Qa(M[3],13,3)+" "+E(M[3],8)),a.u("UNIMAP["+Ra(M[1])+"]: "+Qa(M[2],22,3)+" "+E(M[2],8))),a.u(" PHYSICAL: "+
|
||||
Qa(M[0],22,3)+" "+E(M[0],8))):(a.u(" OFFSET: "+Qa(M[1],13,3)+" "+E(M[1],8)),a.u("+ "+Dk[M[2]]+"PAR"+M[3]+": "+Qa(M[4],22,3)+" "+E(M[4],8)),a.u("& MMUMASK: "+Qa(M[5],22,3)+" "+E(M[5],8)),a.u("= PHYSICAL: "+Qa(M[0],22,3)+" "+E(M[0],8)))}else{var qb=0,cf="ds"==bb;if(cb){if("l"==cb.charAt(0))cb=cb.substr(1)||al,qb=rj(a,cb);else{var yi=Fj(a,cb);yi&&(qb=yi.J-ia.J)}0>qb&&(qb=0);65536<qb&&(qb=65536)}var dl=a.Aa;ia.Aa&&(a.Aa=ia.Aa);for(var rb="dd"==bb?4:"db"==bb?1:2,Od=rb*qb||128,df=
|
||||
cf?16:a.Aa,el=(Od+df-1)/df|0||1,sb="";el--&&0<Od;){for(var tb="",ef="",Ma=Ij(a,ia),Pd=df,Dc=0,Ec=0;0<Pd&&0<Od;){var Vb=1,Qd=1==rb?a.sd(ia,Vb):a.Oa(ia,Vb=2),Dc=Dc|Qd<<(Ec<<3),Ec=Ec+Vb;Ec==rb&&(cf?(tb&&(tb+=","),tb+="0x"+F(Dc,2*rb)):(tb+=K(a,Dc,rb),tb+=1==rb?9==Pd?"-":" ":" "),Dc=Ec=0);Pd-=Vb;for(Od-=Vb;1==rb&&Vb--;)var ff=Qd&255,ef=ef+(32<=ff&&128>ff?String.fromCharCode(ff):"."),Qd=Qd>>8}sb&&(sb+="\n");sb=cf?sb+(tb+","):sb+(Ma+": "+tb+(Pd?"":" "+ef))}sb&&a.u(sb);a.va=ia;a.Aa=dl}}}}break;case "e":if("else"==
|
||||
g[0])break;var Wb,gf,hf,jf,kf=g[0],lf=g[1];"eb"==kf?(Wb=1,gf=255,hf=a.sd,jf=a.td):"e"==kf||"ew"==kf?(Wb=2,gf=65535,hf=a.Oa,jf=a.se):lf=null;if(null==lf)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var Rd=Fj(a,lf);if(Rd)for(var Sd=2;Sd<g.length;Sd++){var Fc=pj(a,g[Sd]);if(void 0===Fc){a.u("unrecognized value: "+g[Sd]);break}Fc&~gf&&a.u("warning: "+F(Fc)+" exceeds "+Wb+"-byte value");a.u("changing "+Ij(a,Rd)+(A(a,16)?
|
||||
"":" from "+K(a,hf.call(a,Rd),Wb))+" to "+K(a,Fc,Wb));jf.call(a,Rd,Fc,Wb)}}break;case "g":a:{var zi=g[1],fl=b;if(void 0!==zi){var mf=Fj(a,zi,!0);if(!mf)break a;Hj(a,mf,fl);a.wb(a.g,mf,!0)}Xj(a,!0,c)}break;case "h":a.A.T?(c||a.u("halting"),a.aa()):Ja(a,!0)||c||a.u("already halted");break;case "i":if("if"==g[0]){var nf;var Gc=b.substr(2),Gc=Za(Gc);pj(a,Gc)?(c||a.u("true: "+Gc),nf=!0):(c||a.u("false: "+Gc),nf=!1);nf||(d=!1);break}f=!0;break;case "k":var gl=g[0];if("?"==g[1])a.u("stack trace commands:"),
|
||||
a.u("\tk\tshow frame addresses"),a.u("\tks\tshow symbol information");else{var of=0,pf=W(),Hc=W(a.f.g[6]);for(a.u("stack trace for "+Ij(a,Hc));10>of;){for(var ub=null,hl=256;65536>Hc.J>>>0;){pf.J=a.Oa(Hc,2);if(null==Hc.J||!hl--)break;if(!(pf.J&1)){for(var il=a,Td=pf,Ai=null,Ic=Td.J,Bi=Ic,qf=1;6>=qf&&Ic;qf++){if(2<qf){Td.J=Ic;var Ud=ik(il,Td);if(0<=Ud.indexOf("JSR")){var Ci=Ud.indexOf(" ");if(Ic+(Ud.indexOf(" ",Ci+1)-Ci-1)/2==Bi){Ai=Ud;break}}}Ic-=2}Td.J=Bi;if(ub=Ai)break}}if(!ub||null==ub)break;var Di=
|
||||
null;if("ks"==gl){var Ei=ub.match(/[0-9A-F]+$/);Ei&&(Di=zk(a,Ei[0]))}ub=Ya(ub,50)+" ;"+(Di||"stack="+Ij(a,Hc));a.u(ub);of++}of||a.u("no return addresses found")}break;case "l":if("ln"==g[0]){zk(a,g[1],!0);break}f=!0;break;case "m":a:{var Oa,Pa=null,Q=g[1];"?"==Q&&(Q=void 0);if(void 0!==Q){var db=0;if("all"==Q)db=1879046143,Q=null;else if("on"==Q)Pa=!0,Q=null;else if("off"==Q)Pa=!1,Q=null;else{"keys"==Q&&(Q="key");"kbd"==Q&&(Q="keyboard");for(Oa in Qb)if(Q==Oa){db=Qb[Oa];Pa=!!(a.fa&db);break}if(!db){a.u("unknown message category: "+
|
||||
Q);break a}}if(db)if("on"==g[2])a.fa|=db,Pa=!0;else if("off"==g[2]&&(a.fa&=~db,Pa=!1,1073741824==db)){for(var Fi=1E3<=a.M.length?a.M.length-1E3:0;Fi<a.M.length;)a.u(a.M[Fi++]);a.M=[]}}var jl=0,Jc="";for(Oa in Qb)if(!Q||Q==Oa){var kl=!!(a.fa&Qb[Oa]);if(null===Pa||Pa==kl)Jc&&(Jc+=","),++jl%10||(Jc+="\n\t"),"key"==Oa&&(Oa="keys"),Jc+=Oa}void 0===Q&&a.u("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.u((null!==Pa?Pa?"messages on: ":"messages off: ":"message categories:\n\t")+
|
||||
(Jc||"none"));xj(a)}break;case "p":if("print"==g[0]){Ak(a,b.substr(5));break}var ll=g[0];if("?"==g[1])a.u("step commands:"),a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else{var Gi="pr"==ll?1:0,Hi=1+Gi;if(a.I)a.u("step in progress");else{var Vd=W(a.f.g[7]),Xb=a.Oa(Vd);3==Xb||4==Xb||34816==(Xb&65280)||32256==(Xb&65024)||35072==(Xb&65280)?(a.I=Hi,Gj(Vd,2)):2048==(Xb&65024)&&(ik(a,Vd),a.I=Hi);a.I?(a.wb(a.g,Vd,!0),Xj(a)||(a.K&&oe(a.K),a.I=0)):Bk(a,Gi?"tr":
|
||||
"t")}}break;case "r":if("reset"==b){a.K&&a.K.reset();break}ak(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Kc=+g[2];if(8==Kc||10==Kc||16==Kc)a.Aa=Kc;else{a.u("invalid base: "+Kc);break}}a.u("default base: "+a.Aa);break;case "cs":var Lc;void 0!==g[3]&&(Lc=+g[3]);switch(g[2]){case "int":a.f.Gb=Lc;break;case "start":a.f.cc=Lc;break;case "stop":a.f.Jb=Lc;break;default:a.u("unknown cs option");break a}void 0!==Lc&&ge(a.f);a.u("checksums "+(a.f.A.Fb?"enabled":"disabled"));break;case "sp":void 0!==
|
||||
g[2]&&(le(a.f,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));a.u("target speed: "+(a.f.sb.toFixed(2)+"Mhz")+" ("+a.f.hb+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"),a.u("\tcs start #\tset checksum cycle start count to #"),a.u("\tcs stop #\tset checksum cycle stop count to #"),a.u("\tsp #\t\tset speed multiplier to #")}break;case "t":Bk(a,
|
||||
g[0],g[1]);break;case "u":bk(a,g[1],g[2],8);break;case "v":if("var"==g[0]){yk(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.u((Hb||"PDP11")+" version 1.33.1 ("+a.f.ia+",RELEASE"+(Jb?",TYPEDARRAYS":Ib?",BYTEARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){Ak(a,b.substr(1));break}var rf="commands:",sf;for(sf in Ek)rf+="\n"+Ya(sf,9)+Ek[sf];vf(a)||(rf+="\nnote: history disabled if no exec breakpoints");a.u(rf);break;default:f=!0}f&&(a.u("unknown command: "+
|
||||
b),d=!1)}}catch(Ji){a.u("debugger error: "+(Ji.stack||Ji.message)),d=!1}return d}function je(a,b,c){b=nj(a,b,c);for(var d in b)if(!hk(a,b[+d]))return!1;return!0}
|
||||
var Ek={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},kk=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
|
||||
Lj=20,Mj=21,Nj=22,Oj=23,Pj=24,Qj=25,Rj=26,Sj=27,Tj=28,Uj=29,Vj=30,Jj={SP:6,PC:7,PS:Lj,PI:Mj,ER:Nj,SL:Oj,M0:Pj,M1:Qj,M2:Rj,M3:Sj,AR:Tj,DR:Uj,SR:Vj},Dk="KI KD SI SD ?? ?? UI UD".split(" "),rk=7,sk=56,Y=sk|rk,qk=4032,X=4096,mk=8192,nk=12288,ok=24576,pk=32768,lk=61440,zj={61440:{4096:[62,qk,Y],8192:[47,qk,Y],12288:[18,qk,Y],16384:[14,qk,Y],20480:[16,qk,Y],24576:[3,qk,Y],36864:[63,qk,Y],40960:[48,qk,Y],45056:[19,qk,Y],49152:[15,qk,Y],53248:[17,qk,Y],57344:[94,qk,Y]},65024:{2048:[57,448,Y],28672:[100,Y,
|
||||
448],29184:[101,Y,448],29696:[102,Y,448],30208:[103,Y,448],30720:[104,448,Y],32256:[105,448,mk]},65280:{256:[27,X],512:[24,X],768:[10,X],1024:[11,X],1280:[22,X],1536:[12,X],1792:[20,X],32768:[25,X],33024:[23,X],33280:[13,X],33536:[21,X],33792:[28,X],34048:[29,X],34304:[8,X],34560:[9,X],34816:[106,pk],35072:[107,pk]},65472:{64:[56,Y],192:[95,Y],2560:[39,Y],2624:[49,Y],2688:[53,Y],2752:[51,Y],2816:[67,Y],2880:[1,Y],2944:[77,Y],3008:[97,Y],3072:[73,Y],3136:[71,Y],3200:[6,Y],3264:[4,Y],3328:[58,ok],3392:[60,
|
||||
Y],3456:[65,Y],3520:[96,Y],35328:[40,Y],35392:[50,Y],35456:[54,Y],35520:[52,Y],35584:[68,Y],35648:[2,Y],35712:[78,Y],35776:[98,Y],35840:[74,Y],35904:[72,Y],35968:[7,Y],36032:[5,Y],36096:[66,Y],36160:[59,Y],36224:[64,Y],36288:[61,Y]},65528:{128:[76,rk],152:[108,nk]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],
|
||||
179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},jk=[0],Dj=[58,60,65,96,110,100,101,102,103,104,105],Ej=[108,59,64],Wj=1E3,Zj=">> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b<a.length;b++){var c=a[b],d=Ea(c),d=new vj(d);Fa(d,c)}});
|
||||
function Fk(a,b,c){q.call(this,"Computer",a,33554432);this.A.Z=!1;this.O=null;Gk(this,b);this.L=ee(this,"autoPower",a,6);this.j=0;this.U=+a.busWidth||+a.buswidth;this.G=this.w=this.I=null;this.D=this.R=!1;this.B=this.v=null;this.P=this.M=this.N=!1;this.V=ee(this,"url")||"";(Math.random()+.1).toString(36);this.g=Hk(this);if(this.f=Da("CPU",this.id)){this.F=Da("Debugger",this.id);this.C=new Qc({id:this.pb+".bus",busWidth:this.U},this.f,this.F);var d,e=Aa(this.id);if((this.i=Da("Panel",this.id))&&this.i.Qa)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.S=this.i.S,d.u=this.i.u,d.Qa=this.i.Qa;this.u(Hb+" v1.33.1\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis <http://skn.noip.me/pdp11/pdp11.html>");for(b=0;b<e.length;b++)d=e[b],d.za&&d.za(this,this.C,this.f,this.F);b=null;d=ee(this,"resume",a);void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=ee(this,"state")||
|
||||
(f=!0,a.state))this.I=b=a,f||(this.D=!0,this.b=Ik),this.b&&(this.B=new G(this,"1.33.1"),Jk(this.B)?b=null:delete this.B);!b&&this.b&&(b=Kk(this))&&(this.D=!0);if(b){var g=this;fb(b,null,!0,function(a,b,c){c?(g.w=null,g.D=!1,g.S("Unable to load machine state from server (error "+c+(b?": "+Za(b):"")+")")):(g.G=b,g.R=!0);y(g)})}else y(this);this.H.power||(this.L=!0);!c&&this.L&&Lk(this,this.ec)}else v("Unable to find CPU component")}p(Fk,q);
|
||||
function Gk(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){v(d.message+" ("+c+")")}}a.O=b}function ee(a,b,c,d){var e=b.toLowerCase(),e=nb(b)||nb(e);void 0===e&&a.O&&(e=a.O[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}
|
||||
function Lk(a,b,c){for(var d=Aa(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ia(f)){Ia(f,function(){Lk(a,b,c)});return}}b.call(a,c)}function Mk(a,b){var c=new G(a,"1.33.1",Nk);if(Jk(c)&&Ok(c)){var d=c.get(Pk),e=b?b.get(Pk):"unknown";d!=e&&(a.S("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Fk.prototype;
|
||||
h.ec=function(a){void 0===a&&(a=this.b||(this.G?Qk:Ik));if(!this.j){this.j++;var b=!1,c=!1;this.N=!1;var d=this.B||new G(this,"1.33.1");if(a==Rk)b=!0;else if(a>Ik){if(Jk(d,this.G)){this.v=new G(this,"1.33.1",Sk);Jk(this.v)&&(Tk(this,d),a=Uk,Vk(this.v));this.v.set(Pk,eb());Wk(this.v);var e=this.b&&!this.D;if(a==Qk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Ok(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Jk(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Xk,""),this.g=null)):this.u(f+": "+g),Vk(d),Jk(d)?(c=Ok(d),e=!0):c=!1))}e&&Mk(this,c?d:null)}else a==Uk&&d.clear()}else Mk(this);delete this.G;delete this.B}e=Aa(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.f&&(c=Yk(this,g,d,b,c));b=[d,a,c];a!=Rk?Lk(this,this.Ud,b):this.Ud(b)}};
|
||||
function Yk(a,b,c,d,e){if(!b.A.Z){b.A.Z=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.Ca(f,d)&&f&&(v("Unable to restore state for "+b.type),a.I&&!a.R?(c.clear(),a.b=Ik,window&&window.location.reload()):a.N=!0,b.Ca(null),e=!1),!d&&b.Cd){var g=b.Cd.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){v("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
|
||||
h.Ud=function(a){var b=a[0],c=0>a[1];a=a[2];this.P=!0;this.A.Z=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Yk(this,this.f,b,c,a),I(this,-2),this.f.qa());this.N&&(Tk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0};
|
||||
function Tk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Ck(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.33.1"),g=new G(a,"1.33.1",Nk),k=eb();g.set(Pk,k);f.set(Pk,k);f.set(Zk,"1.33.1");f.set($k,window?window.location.href:null);f.set(cl,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.qa=a.f.A.T),a.f.aa()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.Z=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l<k.length;l++){var m=k[l];m.A.Z&&(m.Ba&&(d=m.Ba(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.A.Z=
|
||||
!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.g&&ml(a,a.g,f.toString()),Wk(g)&&Wk(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=a.b==nl),d&&f.clear(k)):e=f.toString());c&&(a.A.Z=!1,b=a.H.power)&&(b.textContent="Power");a.j=0;return e}
|
||||
h.reset=function(){this.C&&this.C.reset&&(D(this,"Resetting "+this.C.type),this.C.reset());this.f&&this.f.reset&&(D(this,"Resetting "+this.f.type),this.f.reset());for(var a=Aa(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.C&&c!==this.f&&c.reset&&(D(this,"Resetting "+c.type),c.reset())}I(this,-1)};h.start=function(a,b){for(var c=Aa(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}I(this,-1)};
|
||||
h.stop=function(a,b){for(var c=Aa(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}I(this,-1)};
|
||||
function I(a,b){if(a.f){var c=a.f,d=b||0,e=c.H.speed;e&&(0>=d||30<=(c.Kc+=d))&&(e.textContent=c.A.T?c.rb.toFixed(2)+"Mhz":"Stopped",c.Kc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;e<a.f.g.length;e++)lc(a,"R"+e,a.f.g[e]);e=Ad(a.f);lc(a,"PS",e);lc(a,"NF",e&8?1:0,1);lc(a,"ZF",e&4?1:0,1);lc(a,"VF",e&2?1:0,1);lc(a,"CF",e&1?1:0,1);a.j=0}-1>b?a.da=a.f.g[7]:0<b&&c&&!d&&(a.da=a.f.cb);hc(a,a.da);Zb(a,a.Ta);b=a.f;b=b.tb?b.V&16?1:2:4;Mc(a,"B22",b&1);Mc(a,"B18",b&2);
|
||||
Mc(a,"B16",b&4)}}
|
||||
h.ua=function(a,b,c){var d=this;switch(b){case "power":return this.H[b]=c,c.onclick=function(){d.j||(d.A.Z?Ck(d,!1,!0):Lk(d,d.ec))},!0;case "reset":return this.H[b]=c,c.onclick=function(){if(d.A.Z&&!d.j)if(d.b&&!d.w){var a=za("Click OK to save changes to this "+Hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ck(d,a,!0);!a&&d.I?window&&window.location.reload():(a||(d.M=!0),d.ec(Ik),d.M=!1)}else d.reset(),d.f&&d.f.qa()},!0;case "save":if(Va(hb(),"pcjs.org"))c.parentNode.removeChild(c);else return this.H[b]=
|
||||
c,c.onclick=function(){var a=Hk(d,!0);if(a){var b=!!(d.b&&!d.w||d.I),c=Ck(d,b);b?ml(d,a,c):d.S("Resume disabled, machine state not saved")}},!0}return!1};function Hk(a,b){var c=a.g;c||((c=kb(Xk),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=ol(a,c))||a.S("The user ID is invalid.")):b&&a.S("Browser local storage is not available"));return c}
|
||||
function ol(a,b){a.g=null;b=fb(hb()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(lb(Xk,b.data),a.g=b.data)}catch(d){v(d.message+" ("+c+")")}return a.g}function Kk(a){var b=null;a.g&&(b=hb()+"/api/v1/user?req=load&user="+a.g+"&state="+pl(a,"1.33.1"));return b}
|
||||
function ml(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=pl(a,"1.33.1");d.data=c;b=fb(hb()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.S("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.S(c),lb(Xk,""),a.g=null)}}
|
||||
function Sh(a){var b;a=Aa(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function oe(a,b){if(a.Qa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Qa.focus();!b&&window&&window.scrollTo(c,d)}}var Sk="failsafe",Nk="validate",Pk="timestamp",Zk="version",$k="url",cl="browser",Xk="user",Rk=-1,Ik=0,Qk=1,Uk=2,nl=3;
|
||||
yb(function(){for(var a=x(document,w+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=Ea(c),c=x(c,w,"computer"),e=0;e<c.length;e++){var f=c[e],g=Ea(f),g=new Fk(g,d,!0);Fa(g,f);g.L&&Lk(g,g.ec)}});zb.show.push(function(){for(var a=x(document,w,"computer"),b=0;b<a.length;b++){var c=Ea(a[b]);(c=Da("Computer",c.id))&&c.P&&!c.A.Z&&c.ec(Rk)}});zb.exit.push(function(){for(var a=x(document,w,"computer"),b=0;b<a.length;b++){var c=Ea(a[b]);(c=Da("Computer",c.id))&&c.A.Z&&Ck(c,!(!c.b||c.w),!0)}});
|
||||
function G(a,b,c){this.id=a.id;this.b="";this.f={};this.g=this.C=!1;this.key=pl(a,b,c);Vk(this,a.Ue)}h=G.prototype;h.set=function(a,b){try{this.f[a]=b}catch(c){}};h.get=function(a){return this.f[a]||null};h.data=function(){return this.f};function Jk(a,b){return b?(a.b=b,a.g=!0,a.C=!1,!0):a.g?!0:ib()&&(b=kb(a.key))?(a.b=b,a.g=!0):!1}function Ok(a){var b=!0;if(!a.C)try{a.f=JSON.parse(a.b),a.C=!0}catch(c){v(c.message||c),b=!1}return b}
|
||||
function Wk(a){var b=!0;if(ib()){var c=JSON.stringify(a.f);lb(a.key,c)||(v("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.f?JSON.stringify(this.f):this.b};function Vk(a,b){a.b="";a.f={};a.g=a.C=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){Vk(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function pl(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var ql=0;
|
||||
function rl(a,b,c,d,e,f){e("Loading "+a+"...");fb(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):sl(k,a,b,c,d,e,f)})}
|
||||
function sl(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(va(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?tl(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function tl(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");fb(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,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]);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);tl(a,b,c)}})}else c(a,null)}
|
||||
function ul(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ql||Cb(!0));l=!1}var g,k,l=!0;ql++;xa[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.33.1/components.xsl");m=function(d,k){k?rl(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ql||Cb(!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),--ql||Cb(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?rl(b,a,d,!0,e,m):sl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Cb(!1);return ul(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11-dbg.map
|
||||
function vj(a,b,c){var d;if(b){b=wj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],q=n.length,n=Pa(n);if(!n){f=!0;break}n=xj(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],t=n.length;l.length&&yj[n]<yj[l[l.length-1]]&&uj(k,l,1);l.push(n);b=b.substr(q+t)}uj(k,l)&&1==k.length||(f=!0);f?c&&a.v("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&zj(a,null,
|
||||
d))}return d}function wj(a,b){for(var c,d=a.ia?"(":"{",e=a.ia?")":"}",f=new RegExp(a.ia?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=vj(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
||||
function xj(a,b,c,d){var e;null!=b?(e=a.me(b),0<=e?e=a.ne(e):(e=a.S[b],null==e&&(e=Ea(b,a.Ba))),null!=e||d||a.v("invalid "+(c?c:"value")+": "+b)):d||a.v("missing "+(c||"value"));return e}function zj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=Fa(d&255,8)+g,d>>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e}
|
||||
function Aj(a,b){if(b)return zj(a,b,a.S[b]);var c=0;for(b in a.S)zj(a,b,a.S[b]),c++;return 0<c}function J(a,b,c,d){switch(a.Ba){case 8:a=E(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=F(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var yj={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function Bj(a){sj.call(this,a);this.Ga=!1;this.ia=!0;this.G=X();this.xa=X();this.N=X();this.B=[];this.g=this.L=this.C=[];Cj(this);this.P=this.Y=0;this.i=[];this.pa=void 0;Dj(this);this.F=this;this.ka={};this.ha=this.ge=0;this.R=null;this.M=[];Ej(this,a.messages);this.ta=a.commands;this.Ja=Fj;this.W=[];this.I=0;this.Ka=this.qa=null;this.w=this.Ia=this.Ha=this.X=this.la=0;this.b=this.U=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return fe(b,a)}):void 0===global[w]&&(global[w]=
|
||||
function(a){return fe(b,a)})}p(Bj,sj);function Gj(a){a=a&&a.J;null==a&&(a=-1);return a}function X(a,b,c){return{J:void 0===a?null:a,Ma:void 0===b?!1:b,Ua:!1,Ba:c}}h=Bj.prototype;h.Cd=function(a,b){a.J=b;a.Ua=!1;a.Ba=void 0;return a};function Hj(a){return[a.J,a.Ma,a.Ba,a.Ua,a.Mc]}function Ij(a,b){var c=X(b[0],b[1],b[2]);c.Ua=b[3];b[4]&&(c.de=tj(a,c.Mc=b[4]));return c}
|
||||
h.Aa=function(a,b,c,d){this.D=b;this.K=a;this.f=c;this.b=a.i;(a=Td(a,"messages"))&&Ej(this,a);1140>this.f.ka&&(this.W=this.W.concat(Jj));1145>this.f.ka&&(this.W=this.W.concat(Kj));ld(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=Gj(Lj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."):
|
||||
(c=n.type,m=Yc[c],n&&d.v(F(n.id,8)+" %"+F(e<<d.D.g,8)+" %"+F(n.J,8)+" "+Ha(n.Xb)+" "+Ha(n.size)+" "+m),c!=Ad&&(c=-1),m=0);a+=d.D.j;e++}}});y(this)};
|
||||
h.va=function(a,b,c){var d=this;switch(b){case "debugInput":return this.U=this.H[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",fe(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.u<d.j.length-1&&(b=d.j[++d.u])):40==a.keyCode&&(0<d.u?b=d.j[--d.u]:(b="",d.u=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.H[b]=c,hb(c,function(){if(d.U){var a=d.U.value;d.U.value=
|
||||
"";fe(d,a,!0);return!0}return!1}),!0;case "step":return this.H[b]=c,hb(c,function(a){var b=!1;Ba(d,!0)||(Da(d,!0),b=nc(d,a?1:0,null),Da(d,!1));return b}),!0}return!1};function ee(a){if(a.U){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.U.focus();window&&window.scrollTo(b,c)}}h.Kd=function(a,b){var c=255,d=Gj(a);-1!==d&&(a.Ma||65535<d?(c=this.D,d=Je(this.f,d),c.C=!1,c.na++,d=$c(c,d).K(d&c.i,d),c.na--):(c=this.f,c.pa++,d=c.D.Gd(tc(c,d,3)),c.pa--),c=d,b&&Mj(a,b));return c};
|
||||
h.Ra=function(a,b){var c=65535,d=Gj(a);-1!==d&&(c=a.Ma||65535<d?uc(this.D,Je(this.f,d)):vc(this.f,d),b&&Mj(a,b));return c};h.Ld=function(a,b,c){var d=Gj(a);if(-1!==d){if(a.Ma||65535<d)ad(this.D,Je(this.f,d),b);else{var e=this.f;e.pa++;e.D.Hd(tc(e,d,5),b);e.pa--}c&&Mj(a,c);H(this.K,-1)}};h.He=function(a,b,c){var d=Gj(a);if(-1!==d){if(a.Ma||65535<d)sc(this.D,Je(this.f,d),b);else{var e=this.f;e.pa++;e.D.ac(tc(e,d,4),b);e.pa--}c&&Mj(a,c);H(this.K,-1)}};
|
||||
function Lj(a,b,c){var d;c=(c?a.G:a.xa).J;var e,f;if(void 0!==b){b=wj(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,k;a:{c=a.D;var l;l=d.toUpperCase();for(k in c.Pa){var m=+k;if(c.Pa[m][4]==l){k=c.B+m;break a}}k=null}if(null==k&&d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.B.length;c++)if(l=a.B[c].ga[d],null!=l){k=l.o;break}null!=k&&(g=X(k));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=vj(a,b,void 0)}null!=c&&(d=X(c,e,f));return d}
|
||||
function Nj(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.de=tj(a,b.Mc=c[2]))}function Mj(a,b){null!=a.J&&(a.J+=b||1)}function Oj(a,b){return(b.Ma?"%":"")+J(a,b.J)}
|
||||
function Ej(a,b){a.F=a;a.ha=a.ge=536870912;a.R=null;a.M=[];b=tj(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Lb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ha|=Lb[c],a.v(c+" messages enabled"))}}function ld(a,b,c){for(var d in Lb)if(b==Lb[d]){a.ka[d]=c;break}}
|
||||
h.me=function(a){a=a.toUpperCase();var b=Pj[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function Qj(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
h.ne=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.qa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Rj:b=ud(this.f);break;case Sj:b=c.eb;break;case Tj:b=c.P;break;case Uj:b=c.xa&65280;break;case Vj:b=od(c);break;case Wj:b=qd(c);break;case Xj:b=rd(c);break;case Yj:b=c.U;break;case Zj:d&&(b=d.fa);break;case ak:d&&(b=d.Wa);break;case bk:d&&xc(d)&&(b=d.Xa)}}return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+Oj(this,X(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.ha&1073741824)this.M.push(a);else{var c;if(this.ha&-2147483648&&this.f&&(c=this.f.A.V)||Ba(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,le(a),a.Bb=0,a.K&&H(a.K,void 0))}};
|
||||
function Dj(a){var b;if(!Xe(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(ck);for(b=0;b<a.i.length;b++)a.i[b]=X();a.P=0;a.v("instruction history buffer allocated")}}function dk(a,b,c){if(!ek(a,c))return!1;mc(a.f,b);return!0}
|
||||
function nc(a,b,c,d){if(!ek(a))return!1;var e="";null===c&&(e=(c=!a.qa||"tr"==a.qa)?"tr":"t");a.w=0;b||Xe(a)&&Ye(a,a.f.g[7],0);try{b=me(a.f,b);var f=a.f.Ac(b);0<f&&(oc(a.f,f),a.w+=f,pc(a.f,f,!0),qc(a.f,f),a.X++)}catch(g){"number"!=typeof g&&(a.w=0,ya(a.f,g.stack||g.message))}!1!==d&&(a.b&&a.b.stop(),H(a.K,-1));de(a,c||!1,e);return 0<a.w}h.ba=function(a){this.f&&this.f.ba(a)};
|
||||
function de(a,b,c){if(a.Ga){void 0===b&&(b=!0);c&&a.v(fk+c);c=a.f;if(c=c.i&128?c.Bc|c.yc<<8:0){var d=c>>8;a.v("trapped to "+J(a,c&255,1)+" ("+(0>d?Gb[-d]:J(a,d))+")")}a.G=X(a.f.g[7]);b&&1!=a.I?gk(a):hk(a)}}function ek(a,b){var c;(c=!a.f||!Aa(a.f))||(c=a.f,c.A.aa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.V?(b||a.v("cpu busy or unavailable, command ignored"),!1):!za(a.f)}h.Da=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0};
|
||||
h.Ca=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Dj(this);this.X=0;this.R=null;this.w=0;this.G=X(this.f.g[7]);this.A.V=!1;ik(this);a||de(this)};h.save=function(){var a=new G(this);a.set(0,Hj(this.G));a.set(1,Hj(this.N));a.set(2,[this.j,this.O,this.ha]);a.set(3,this.B);return a.data()};
|
||||
h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=Ij(this,a[b++]),this.N=Ij(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.ha|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.V=!0;this.Ha=a;this.Ia=b};
|
||||
h.stop=function(a,b){if(this.A.V){this.A.V=!1;this.w=b-this.Ia;if(!this.I){b="stopped";if(this.w){a-=this.Ha;var c=0<a?Math.round(1E3*this.w/a):0;b+=" (";Xe(this)&&(b+=this.X+" instructions, ",this.X=0);b+=this.w+" cycles, "+a+" ms, "+c+" hz)"}else z(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.v(b)}de(this,!0);ee(this);ik(this,this.f.g[7]);this.R=null}};function Xe(a){return 1<a.g.length||!!a.Y}
|
||||
function Ye(a,b,c){var d=-1;c||(d=vc(a.f,b))||(a.f.O&65535)!=b||(b=Ae(a.f,2));if(0<c&&(a.Y&&!--a.Y||jk(a,b,1,a.g)))return!0;0<=c&&a.i.length&&(a.X++,0>d&&(d=vc(a.f,b)),65535!=(d&65535)&&(a.Cd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function yg(a){var b=a.f;if(b.A.V)throw ue(b,a.f.O&65535),a.ba(),-1;return!1}function Nd(a,b,c){jk(a,b,c||1,a.L)&&a.ba(!1)}function Od(a,b,c){jk(a,b,c||1,a.C)&&a.ba(!1)}
|
||||
function Cj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b<a.L.length;b++)c=a.L[b],d=Gj(c),c.Ma?(c=a.D,Md(c.b[d>>>c.g],!1)):Me(a.f,!1);a.L=["br"];if(a.C)for(b=1;b<a.C.length;b++)c=a.C[b],d=Gj(c),c.Ma?(c=a.D,Md(c.b[d>>>c.g],!0)):Me(a.f,!0);a.C=["bw"];a.la=0;a.Y=0}
|
||||
h.Cb=function(a,b,c){var d=!0;c||kk(this,a,b,!1,!0);if(a!=this.g){var e=Gj(b);if(-1===e)this.v("invalid address: "+Oj(this,b)),d=!1;else{var f=a==this.C;65535<e&&(b.Ma=!0);if(b.Ma){var g=this.D;g.b[e>>>g.g].Cb(e&g.i,f)}else e=this.f,(f?e.sc++:e.rc++)||se(e)}}d&&(a.push(b),c?b.Ua=!0:(lk(this,a,a.length-1,"set"),Dj(this)));return d};
|
||||
function kk(a,b,c,d,e){var f=!1;c=Gj(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==Gj(k)&&(!d||k.Ua)){f=!0;k.Ua||e||lk(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(b=b==a.C,k.Ma?(d=a.D,Md(d.b[c>>>d.g],b)):Me(a.f,b));k.Ua||Dj(a);break}}return f}function mk(a,b){for(var c=1;c<b.length;c++)lk(a,b,c);return b.length-1}function lk(a,b,c,d){c=b[c];a.v(b[0]+" "+Oj(a,c)+(d?" "+d:c.Mc?' "'+c.Mc+'"':""))}
|
||||
function ik(a,b){if(void 0!==b)jk(a,b,1,a.g,!0),a.I=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Ua){if(!kk(a,a.g,c,!0))break;b=0}}}
|
||||
function jk(a,b,c,d,e){var f=!1;if(!a.la++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Ua)for(var l=Gj(k)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==l){var n,f=!0;k.Ua&&(kk(a,d,k,!0),e=!0);if(n=k.de){for(var f=!1,q=0;q<n.length;q++)if(!nk(a,n[q],!0)){if(n[q].indexOf("if")){f=!0;break}for(var t=q+1;t<n.length&&n[t].indexOf("else");t++)q++;if(t==n.length){f=!0;break}}a.f.A.V||(f=!0)}if(f){e||lk(a,d,g,"hit");break}}}a.la--;return f}
|
||||
function ok(a,b,c,d){var e=X(b.J),f=a.Ra(b,2),g,k;for(k in a.Ja)if(g=a.Ja[k][f&k])break;g||(g=pk);var l=g[0];0<=a.W.indexOf(l)&&(g=pk,l=g[0]);var m=k="",n=qk[l],q=g.length-1;l||q||(k=J(a,f));for(l=1;l<=q;l++){var t=g[l];if(void 0!==t){var u;u=a;var C=t,t=b,A="",B=C&rk;if(B==Y)t=t.J+((f&255)<<24>>23)&65535,A=J(u,t);else if(B==sk)t=t.J-((f&63)<<1)&65535,A=J(u,t);else if(B==tk)A=J(u,f&7,1);else if(B==uk)A=J(u,f&63,1);else if(B==vk)A=J(u,f&255,1);else if(B=f&C,C&wk&&(B>>=6,C>>=6),C&Z){var C=null,K=B&
|
||||
xk;switch(B&yk){case 0:A=Qj(K);break;case 8:A="@"+Qj(K);C=zk(u,u.f.g[K]);break;case 16:7>K?A="("+Qj(K)+")+":(B=u.Ra(t,2),A="#"+J(u,B,0,!0));break;case 24:7>K?A="@("+Qj(K)+")+":(B=u.Ra(t,2),A="@#"+J(u,B,0,!0),C=zk(u,B));break;case 32:A="-("+Qj(K)+")";break;case 40:A="@-("+Qj(K)+")";break;case 48:B=u.Ra(t,2);A=J(u,B,0,!0)+"("+Qj(K)+")";7==K&&(A=J(u,B=B+t.J&65535),C=zk(u,B));break;case 56:B=u.Ra(t,2),A="@"+J(u,B)+"("+Qj(K)+")",7==K&&(A="@"+J(u,B=B+t.J&65535),C=zk(u,vc(u.f,B)))}C&&(A=[A,C])}u=A;if(!u||
|
||||
!u.length){k="INVALID";break}"string"!=typeof u&&(m=u[1],u=u[0]);0<k.length&&(k+=",");k+=u||"???"}}f="";g=Oj(a,e)+":";if(-1!==e.J&&-1!==b.J){do if(f+=" "+J(a,a.Ra(e,2)),null==e.J)break;while(e.J!=b.J)}g+=Oa(f,24);g+=Oa(n,5);k&&(g+=" "+k);if(c||m)g=Oa(g,60)+";"+(c||""),g=a.f.A.Nb?g+("cycles="+ge(a.f).toString()+" cs="+F(a.f.nc)):g+(null!=d?"="+d.toString():""),m&&(";"!=g.slice(-1)&&(g+=" "),g+=m);return g}
|
||||
function zk(a,b){b=Ke(a.f,b)[0];b>=a.f.vb&&b<a.D.B&&(b=b-a.f.vb+a.D.B);var c=a.D;a=null;b>=c.B&&(b=c.Pa[b&ed])&&(a=b[4]);return a}function Ak(a,b){switch(b){case "N":a=ze(a.f);break;case "Z":a=ye(a.f);break;case "V":a=xe(a.f);break;case "C":a=we(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Bk(a,b){var c="",d=a.f;if(8>b)c=Qj(b),c+="="+J(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.qa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.W[b-16]);else switch(b){case Rj:c="PS="+J(a,ud(d));break;case Sj:c="PI="+J(a,d.eb);break;case Tj:c="ER="+J(a,d.P);break;case Uj:c="SL="+J(a,d.xa&65280);break;case Vj:c="M0="+J(a,od(d));break;case Wj:c="M1="+J(a,qd(d));break;case Xj:c="M2="+J(a,rd(d));break;case Yj:c="M3="+J(a,d.U);break;case Zj:a.b&&(c="AR="+J(a,a.b.fa,3));break;case ak:a.b&&(c="DR="+
|
||||
J(a,a.b.Wa));break;case bk:a.b&&xc(a.b)&&(c="SR="+J(a,a.b.Xa,3))}c&&(c+=" ");return c}function Ck(a,b){var c,d="";for(c=0;6>c;c++)d+=Bk(a,c);d=d+"\n"+(Bk(a,6)+Bk(a,7));d+=Bk(a,Rj)+Bk(a,Sj)+Bk(a,Uj);d+=Ak(a,"T")+Ak(a,"N")+Ak(a,"Z")+Ak(a,"V")+Ak(a,"C");b&&(b=d,c=""+(Bk(a,Vj)+Bk(a,Wj)),c+=Bk(a,Xj)+Bk(a,Yj)+Bk(a,Tj),c=c+"\n"+(Bk(a,bk)+Bk(a,Zj)+Bk(a,ak)),d=b+("\n"+c));return d}h.he=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function yh(a,b,c,d,e){var f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var l=k.o,m=k.a;if(void 0!==l){var n=f,l=[l>>>0,g],q=Ra(n,l,a.he);0>q&&n.splice(-(q+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xk:b,J:c,Gf:d,ga:e,ee:f})}function Dk(a,b,c){var d=[],e=Gj(b)>>>0;for(b=0;b<a.B.length;b++){var f=a.B[b],g=f.J>>>0,k=f.Gf;if(e>=g&&e<g+k){e=Ra(f.ee,[e-g],a.he);0<=e?Ek(a,b,e,d):c&&(e=~e,Ek(a,b,e-1,d),Ek(a,b,e,d));break}}return d}
|
||||
function Ek(a,b,c,d){var e={},f=a.B[b].ee,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.B[b].ga[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}function Fk(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Aj(a)||a.v("no variables"),!0;if(!c[2])return Aj(a,c[1]);if(!c[3])return delete a.S[c[1]],!0;b=vj(a,c[3]);return void 0!==b?(a.S[c[1]]=b,!0):!1}a.v("invalid assignment:"+b);return!1}
|
||||
function Gk(a,b,c){var d=null;if(b=Lj(a,b,!0)){var e=Dk(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.J-e[1])&&(g=" + "+Ha(f)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.v(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.J)&&(g=" - "+Ha(f)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.v(f),d||(d=f))}else c&&a.v("no symbols")}return d}
|
||||
function gk(a,b){var c;if(b&&"?"==b[1])a.v("register commands:"),a.v("\tr\tdump registers"),a.v("\trm\tdump misc registers"),a.v("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.f;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.v("missing value for "+b[1]);return}g=vj(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.g[6]=g&65535;break;case "PC":case "R7":ue(e,
|
||||
g);a.G=X(e.g[7]);break;case "N":e.I=g?32768:0;break;case "Z":e.L=g?0:1;break;case "V":e.G=g?32768:0;break;case "C":e.C=g?65536:0;break;case "PS":vd(e,g);break;case "PI":td(e,g);break;case "ER":e.P=g;d=!0;break;case "SL":e.xa=g|255;break;case "M0":pd(e,g);d=!0;break;case "M3":sd(e,g);d=!0;break;case "AR":a.b&&(d=a.b,Xb(d,d.fa=g));d=!0;break;case "DR":a.b&&(d=a.b,Ob(d,d.Wa=g));d=!0;break;case "SR":if(a.b&&xc(a.b)){Yb(a.b,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.g[b]=
|
||||
g&65535;break}a.v("unknown register: "+f);return}H(a.K);a.v("updated registers:")}}a.v(Ck(a,d));c&&(a.G=X(e.g[7]),hk(a,Oj(a,a.G)))}}function Hk(a,b){b=Pa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.v(c[2]):zj(a,null,c[2].charCodeAt(0)):vj(a,b,!0)}
|
||||
function Ik(a,b,c){if("?"==c)a.v("trace commands:"),a.v("\tt [#]\ttrace # instructions"),a.v("\ttr [#]\ttrace # instructions with register updates"),a.v("\ttc [#]\ttrace # cycles"),a.v("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=xj(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.qa=b;gb(c,function(){return Da(a,!0)&&nc(a,e,d,!1)},function(){a.b&&a.b.stop();H(a.K,-1);Da(a,!1)})}}
|
||||
function hk(a,b,c,d){if(b=Lj(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=xj(a,c.substr(1)),null!=c&&(d=c);else{d=Lj(a,c,!0);if(!d||d.J<b.J)return;e=d.J-b.J;if(256<e){a.v("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=Ba(a,!1)||a.I?a.w:null;var g=null!=f?"cycles":null,k=Dk(a,b),l=b.J;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=ok(a,b,g,f);a.v(f);a.G=b;e-=b.J-l;c++}}}
|
||||
function nk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(fk+b):(a.O&&(a.v("ended assemble at "+Oj(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Aa(a)&&0<b.length){a.O&&(b="a "+Oj(a,a.N)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var k=g[0],l=k.charAt(0),m=1;m<k.length;m++){var n=k.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=k.substr(m);g.unshift(k.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var q=
|
||||
Lj(a,g[1],!0);if(q)if(a.N=q,void 0===g[2])a.v("begin assemble at "+Oj(a,q)),a.O=!0,H(a.K);else{var t;a.v("not supported yet");t=[];if(t.length){for(var u=0;u<t.length;u++)a.Ld(q,t[u],1);a.v(ok(a,a.N))}}break;case "b":a:{var C=g[0],A=g[1],B=b;if("?"==A)a.v("breakpoint commands:"),a.v("\tbp #\tset exec breakpoint"),a.v("\tbr #\tset read breakpoint"),a.v("\tbw #\tset write breakpoint"),a.v("\tbc #\tclear breakpoint (* to clear all)"),a.v("\tbl\tlist all breakpoints"),a.v("\tbn [#]\tbreak after # instruction(s)");
|
||||
else{var K=C.charAt(1);if("l"==K){var vb;vb=0+mk(a,a.g);vb+=mk(a,a.L);(vb+=mk(a,a.C))||a.v("no breakpoints")}else if("n"==K){var Cd=+A||0;A&&(a.Y=Cd);a.v("break after "+Cd+" instruction(s)")}else if(void 0===A)a.v("missing breakpoint address");else{var sa=X();if("*"!=A&&(sa=Lj(a,A,!0),!sa))break a;"c"==K?null==sa.J?(Cj(a),a.v("all breakpoints cleared")):kk(a,a.g,sa)||kk(a,a.L,sa)||kk(a,a.C,sa)||a.v("breakpoint missing: "+Oj(a,sa)):null!=sa.J&&(Nj(a,sa,B),"p"==K?a.Cb(a.g,sa):"r"==K?a.Cb(a.L,sa):"w"==
|
||||
K?a.Cb(a.C,sa):a.v("unknown breakpoint command: "+K))}}}break;case "c":a.Ta&&(a.Ta.value="");break;case "d":a:{var Zb,ib=g[0],Sa=g[1],jb=g[2],hl=g[3];if("?"==Sa){var $b="";for(Zb in Lb)a.ka[Zb]&&($b&&($b+=","),$b+=Zb);$b+=",state,symbols";a.v("dump memory commands:");a.v("\tda [a] dump info for address a");a.v("\tdb [a] [n] dump n bytes at address a");a.v("\tdw [a] [n] dump n words at address a");a.v("\tdd [a] [n] dump n dwords at address a");a.v("\tds [a] [n] dump n words at address a as JSON");
|
||||
a.v("\tdh [p] [n] dump n instructions from history position p");$b.length&&a.v("dump extension commands:\n\t"+$b)}else if("state"==Sa){var af=Jk(a.K,!0);"console"==jb?console.log(af):(a.Ta&&(a.Ta.value=""),af&&a.v(af))}else if("symbols"==Sa)for(var bf=0;bf<a.B.length;bf++){var cf=a.B[bf],ac;for(ac in cf.ga)if("."!=ac.charAt(0)){var ui=cf.ga[ac].o;if(void 0!==ui){var vi=cf.ga[ac].l;vi&&(ac=vi);a.v(J(a,ui)+" "+ac)}}}else{if("d"==ib){for(Zb in Lb)if(g[1]==Zb){var wi=a.ka[Zb];wi?(g.shift(),g.shift(),
|
||||
wi(g)):a.v("no dump registered for "+Sa);break a}Sa||(ib=a.Ka||"dw")}else a.Ka=ib;if("dh"==ib){var xi=Sa,yi=jb,zi="",Ai=0,Ia=a.P,Ta=a.i;if(Ta.length){var Ca=+xi||a.pa,Kc=+yi||10;isNaN(Ca)?Ca=Kc:zi="more ";Ca>Ta.length&&(a.v("note: only "+Ta.length+" available"),Ca=Ta.length);Ia-=Ca;0>Ia&&(null==Ta[Ta.length-1].J?(Ca=Ia+Ca,Ia=0):Ia+=Ta.length);var df=[];"call"==yi&&(Kc=1E5,df=["CALL"]);for(void 0!==xi&&a.v(Ca+" instructions earlier:");0<Kc&&Ia!=a.P;){var Bi=Ta[Ia++];if(null==Bi.J)break;var Lc=X(Bi.J),
|
||||
il=Ca--,Ci=ok(a,Lc,"history",il);(!df.length||0<=Ci.indexOf(df[0]))&&a.v(Ci);Lc.ud&&(Ia+=Lc.ud,Kc-=Lc.ud,Ca-=Lc.ud);Ia>=Ta.length&&(Ia=0);a.pa=Ca;Ai++;Kc--}}Ai||(a.v("no "+zi+"history available"),a.pa=void 0)}else{var na=Lj(a,Sa);if(na)if("da"==ib){var ef=na.Ma||65535<na.J,O=Ke(a.f,na.J||0,ef);a.v(Oa("",ef?12:19)+Fa(na.J,ef?22:17,3)+" "+E(na.J,8));6>O.length?(2<O.length&&(a.v(" OFFSET: "+Fa(O[3],13,3)+" "+E(O[3],8)),a.v("UNIMAP["+Ga(O[1])+"]: "+Fa(O[2],22,3)+" "+E(O[2],8))),a.v(" PHYSICAL: "+
|
||||
Fa(O[0],22,3)+" "+E(O[0],8))):(a.v(" OFFSET: "+Fa(O[1],13,3)+" "+E(O[1],8)),a.v("+ "+Kk[O[2]]+"PAR"+O[3]+": "+Fa(O[4],22,3)+" "+E(O[4],8)),a.v("& MMUMASK: "+Fa(O[5],22,3)+" "+E(O[5],8)),a.v("= PHYSICAL: "+Fa(O[0],22,3)+" "+E(O[0],8)))}else{var xb=0,ff="ds"==ib;if(jb){if("l"==jb.charAt(0))jb=jb.substr(1)||hl,xb=xj(a,jb);else{var Di=Lj(a,jb);Di&&(xb=Di.J-na.J)}0>xb&&(xb=0);65536<xb&&(xb=65536)}var kl=a.Ba;na.Ba&&(a.Ba=na.Ba);for(var yb="dd"==ib?4:"db"==ib?1:2,Vd=yb*xb||128,gf=
|
||||
ff?16:a.Ba,ll=(Vd+gf-1)/gf|0||1,zb="";ll--&&0<Vd;){for(var Ab="",hf="",Sa=Oj(a,na),Wd=gf,Mc=0,Nc=0;0<Wd&&0<Vd;){var bc=1,Xd=1==yb?a.Kd(na,bc):a.Ra(na,bc=2),Mc=Mc|Xd<<(Nc<<3),Nc=Nc+bc;Nc==yb&&(ff?(Ab&&(Ab+=","),Ab+="0x"+F(Mc,2*yb)):(Ab+=J(a,Mc,yb),Ab+=1==yb?9==Wd?"-":" ":" "),Mc=Nc=0);Wd-=bc;for(Vd-=bc;1==yb&&bc--;)var jf=Xd&255,hf=hf+(32<=jf&&128>jf?String.fromCharCode(jf):"."),Xd=Xd>>8}zb&&(zb+="\n");zb=ff?zb+(Ab+","):zb+(Sa+": "+Ab+(Wd?"":" "+hf))}zb&&a.v(zb);a.xa=na;a.Ba=kl}}}}break;case "e":if("else"==
|
||||
g[0])break;var cc,kf,lf,mf,nf=g[0],of=g[1];"eb"==nf?(cc=1,kf=255,lf=a.Kd,mf=a.Ld):"e"==nf||"ew"==nf?(cc=2,kf=65535,lf=a.Ra,mf=a.He):of=null;if(null==of)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Yd=Lj(a,of);if(Yd)for(var Zd=2;Zd<g.length;Zd++){var Oc=vj(a,g[Zd]);if(void 0===Oc){a.v("unrecognized value: "+g[Zd]);break}Oc&~kf&&a.v("warning: "+F(Oc)+" exceeds "+cc+"-byte value");a.v("changing "+Oj(a,Yd)+(z(a,16)?
|
||||
"":" from "+J(a,lf.call(a,Yd),cc))+" to "+J(a,Oc,cc));mf.call(a,Yd,Oc,cc)}}break;case "g":a:{var Ei=g[1],ml=b;if(void 0!==Ei){var pf=Lj(a,Ei,!0);if(!pf)break a;Nj(a,pf,ml);a.Cb(a.g,pf,!0)}dk(a,!0,c)}break;case "h":a.A.V?(c||a.v("halting"),a.ba()):Ba(a,!0)||c||a.v("already halted");break;case "i":if("if"==g[0]){var qf;var Pc=b.substr(2),Pc=Pa(Pc);vj(a,Pc)?(c||a.v("true: "+Pc),qf=!0):(c||a.v("false: "+Pc),qf=!1);qf||(d=!1);break}f=!0;break;case "k":var nl=g[0];if("?"==g[1])a.v("stack trace commands:"),
|
||||
a.v("\tk\tshow frame addresses"),a.v("\tks\tshow symbol information");else{var rf=0,sf=X(),Qc=X(a.f.g[6]);for(a.v("stack trace for "+Oj(a,Qc));10>rf;){for(var Bb=null,ol=256;65536>Qc.J>>>0;){sf.J=a.Ra(Qc,2);if(null==Qc.J||!ol--)break;if(!(sf.J&1)){for(var pl=a,$d=sf,Fi=null,Rc=$d.J,Gi=Rc,tf=1;6>=tf&&Rc;tf++){if(2<tf){$d.J=Rc;var ae=ok(pl,$d);if(0<=ae.indexOf("JSR")){var Hi=ae.indexOf(" ");if(Rc+(ae.indexOf(" ",Hi+1)-Hi-1)/2==Gi){Fi=ae;break}}}Rc-=2}$d.J=Gi;if(Bb=Fi)break}}if(!Bb||null==Bb)break;var Ii=
|
||||
null;if("ks"==nl){var Ji=Bb.match(/[0-9A-F]+$/);Ji&&(Ii=Gk(a,Ji[0]))}Bb=Oa(Bb,50)+" ;"+(Ii||"stack="+Oj(a,Qc));a.v(Bb);rf++}rf||a.v("no return addresses found")}break;case "l":if("ln"==g[0]){Gk(a,g[1],!0);break}f=!0;break;case "m":a:{var Ua,Va=null,T=g[1];"?"==T&&(T=void 0);if(void 0!==T){var kb=0;if("all"==T)kb=1879046143,T=null;else if("on"==T)Va=!0,T=null;else if("off"==T)Va=!1,T=null;else{"keys"==T&&(T="key");"kbd"==T&&(T="keyboard");for(Ua in Lb)if(T==Ua){kb=Lb[Ua];Va=!!(a.ha&kb);break}if(!kb){a.v("unknown message category: "+
|
||||
T);break a}}if(kb)if("on"==g[2])a.ha|=kb,Va=!0;else if("off"==g[2]&&(a.ha&=~kb,Va=!1,1073741824==kb)){for(var Ki=1E3<=a.M.length?a.M.length-1E3:0;Ki<a.M.length;)a.v(a.M[Ki++]);a.M=[]}}var ql=0,Sc="";for(Ua in Lb)if(!T||T==Ua){var rl=!!(a.ha&Lb[Ua]);if(null===Va||Va==rl)Sc&&(Sc+=","),++ql%10||(Sc+="\n\t"),"key"==Ua&&(Ua="keys"),Sc+=Ua}void 0===T&&a.v("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.v((null!==Va?Va?"messages on: ":"messages off: ":"message categories:\n\t")+
|
||||
(Sc||"none"));Dj(a)}break;case "p":if("print"==g[0]){Hk(a,b.substr(5));break}var sl=g[0];if("?"==g[1])a.v("step commands:"),a.v("\tp\tstep over instruction"),a.v("\tpr\tstep over instruction with register update");else{var Li="pr"==sl?1:0,Mi=1+Li;if(a.I)a.v("step in progress");else{var be=X(a.f.g[7]),dc=a.Ra(be);3==dc||4==dc||34816==(dc&65280)||32256==(dc&65024)||35072==(dc&65280)?(a.I=Mi,Mj(be,2)):2048==(dc&65024)&&(ok(a,be),a.I=Mi);a.I?(a.Cb(a.g,be,!0),dk(a)||(a.K&&ke(a.K),a.I=0)):Ik(a,Li?"tr":
|
||||
"t")}}break;case "r":if("reset"==b){a.K&&a.K.reset();break}gk(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Tc=+g[2];if(8==Tc||10==Tc||16==Tc)a.Ba=Tc;else{a.v("invalid base: "+Tc);break}}a.v("default base: "+a.Ba);break;case "cs":var Uc;void 0!==g[3]&&(Uc=+g[3]);switch(g[2]){case "int":a.f.Ob=Uc;break;case "start":a.f.oc=Uc;break;case "stop":a.f.Rb=Uc;break;default:a.v("unknown cs option");break a}void 0!==Uc&&ce(a.f);a.v("checksums "+(a.f.A.Nb?"enabled":"disabled"));break;case "sp":void 0!==
|
||||
g[2]&&(he(a.f,+g[2])||a.v("warning: using 1x multiplier, previous target not reached"));a.v("target speed: "+(a.f.yb.toFixed(2)+"Mhz")+" ("+a.f.ob+"x)");break;default:if(g[1]){a.v("unknown option: "+g[1]);break}case "?":a.v("debugger options:"),a.v("\tbase #\t\tset default base to #"),a.v("\tcs int #\tset checksum cycle interval to #"),a.v("\tcs start #\tset checksum cycle start count to #"),a.v("\tcs stop #\tset checksum cycle stop count to #"),a.v("\tsp #\t\tset speed multiplier to #")}break;case "t":Ik(a,
|
||||
g[0],g[1]);break;case "u":hk(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Fk(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.v((wb||"PDP11")+" version 1.33.1 ("+a.f.ka+",RELEASE"+(Db?",TYPEDARRAYS":Cb?",BYTEARRAYS":",LONGARRAYS")+")");a.v(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){Hk(a,b.substr(1));break}var uf="commands:",vf;for(vf in Lk)uf+="\n"+Oa(vf,9)+Lk[vf];Xe(a)||(uf+="\nnote: history disabled if no exec breakpoints");a.v(uf);break;default:f=!0}f&&(a.v("unknown command: "+
|
||||
b),d=!1)}}catch(Oi){a.v("debugger error: "+(Oi.stack||Oi.message)),d=!1}return d}function fe(a,b,c){b=tj(a,b,c);for(var d in b)if(!nk(a,b[+d]))return!1;return!0}
|
||||
var Lk={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},qk=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
|
||||
Rj=20,Sj=21,Tj=22,Uj=23,Vj=24,Wj=25,Xj=26,Yj=27,Zj=28,ak=29,bk=30,Pj={SP:6,PC:7,PS:Rj,PI:Sj,ER:Tj,SL:Uj,M0:Vj,M1:Wj,M2:Xj,M3:Yj,AR:Zj,DR:ak,SR:bk},Kk="KI KD SI SD ?? ?? UI UD".split(" "),xk=7,yk=56,Z=yk|xk,wk=4032,Y=4096,sk=8192,tk=12288,uk=24576,vk=32768,rk=61440,Fj={61440:{4096:[62,wk,Z],8192:[47,wk,Z],12288:[18,wk,Z],16384:[14,wk,Z],20480:[16,wk,Z],24576:[3,wk,Z],36864:[63,wk,Z],40960:[48,wk,Z],45056:[19,wk,Z],49152:[15,wk,Z],53248:[17,wk,Z],57344:[94,wk,Z]},65024:{2048:[57,448,Z],28672:[100,Z,
|
||||
448],29184:[101,Z,448],29696:[102,Z,448],30208:[103,Z,448],30720:[104,448,Z],32256:[105,448,sk]},65280:{256:[27,Y],512:[24,Y],768:[10,Y],1024:[11,Y],1280:[22,Y],1536:[12,Y],1792:[20,Y],32768:[25,Y],33024:[23,Y],33280:[13,Y],33536:[21,Y],33792:[28,Y],34048:[29,Y],34304:[8,Y],34560:[9,Y],34816:[106,vk],35072:[107,vk]},65472:{64:[56,Z],192:[95,Z],2560:[39,Z],2624:[49,Z],2688:[53,Z],2752:[51,Z],2816:[67,Z],2880:[1,Z],2944:[77,Z],3008:[97,Z],3072:[73,Z],3136:[71,Z],3200:[6,Z],3264:[4,Z],3328:[58,uk],3392:[60,
|
||||
Z],3456:[65,Z],3520:[96,Z],35328:[40,Z],35392:[50,Z],35456:[54,Z],35520:[52,Z],35584:[68,Z],35648:[2,Z],35712:[78,Z],35776:[98,Z],35840:[74,Z],35904:[72,Z],35968:[7,Z],36032:[5,Z],36096:[66,Z],36160:[59,Z],36224:[64,Z],36288:[61,Z]},65528:{128:[76,xk],152:[108,tk]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],
|
||||
179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},pk=[0],Jj=[58,60,65,96,110,100,101,102,103,104,105],Kj=[108,59,64],ck=1E3,fk=">> ";mb(function(){for(var a=x(document,w,"debugger"),b=0;b<a.length;b++){var c=a[b],d=wa(c),d=new Bj(d);xa(d,c)}});
|
||||
function Mk(a,b,c){r.call(this,"Computer",a,33554432);this.A.aa=!1;this.O=null;Nk(this,b);this.L=Td(this,"autoPower",a,6);this.j=0;this.S=+a.busWidth||+a.buswidth;this.G=this.w=this.I=null;this.C=this.R=!1;this.B=this.u=null;this.P=this.M=this.N=!1;this.U=Td(this,"url")||"";(Math.random()+.1).toString(36);this.g=Ok(this);if(this.f=va("CPU",this.id)){this.F=va("Debugger",this.id);this.D=new Ac({id:this.wb+".bus",busWidth:this.S},this.f,this.F);var d,e=ta(this.id);if((this.i=va("Panel",this.id))&&this.i.Ta)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.T=this.i.T,d.v=this.i.v,d.Ta=this.i.Ta;this.v(wb+" v1.33.1\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis <http://skn.noip.me/pdp11/pdp11.html>");for(b=0;b<e.length;b++)d=e[b],d.Aa&&d.Aa(this,this.D,this.f,this.F);b=null;d=Td(this,"resume",a);void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=Td(this,"state")||
|
||||
(f=!0,a.state))this.I=b=a,f||(this.C=!0,this.b=Pk),this.b&&(this.B=new G(this,"1.33.1"),Qk(this.B)?b=null:delete this.B);!b&&this.b&&(b=Rk(this))&&(this.C=!0);if(b){var g=this;Xa(b,null,!0,function(a,b,c){c?(g.w=null,g.C=!1,g.T("Unable to load machine state from server (error "+c+(b?": "+Pa(b):"")+")")):(g.G=b,g.R=!0);y(g)})}else y(this);this.H.power||(this.L=!0);!c&&this.L&&Sk(this,this.qc)}else v("Unable to find CPU component")}p(Mk,r);
|
||||
function Nk(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){v(d.message+" ("+c+")")}}a.O=b}function Td(a,b,c,d){var e=b.toLowerCase(),e=eb(b)||eb(e);void 0===e&&a.O&&(e=a.O[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}
|
||||
function Sk(a,b,c){for(var d=ta(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Aa(f)){Aa(f,function(){Sk(a,b,c)});return}}b.call(a,c)}function Tk(a,b){var c=new G(a,"1.33.1",Uk);if(Qk(c)&&Vk(c)){var d=c.get(Wk),e=b?b.get(Wk):"unknown";d!=e&&(a.T("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Mk.prototype;
|
||||
h.qc=function(a){void 0===a&&(a=this.b||(this.G?Xk:Pk));if(!this.j){this.j++;var b=!1,c=!1;this.N=!1;var d=this.B||new G(this,"1.33.1");if(a==Yk)b=!0;else if(a>Pk){if(Qk(d,this.G)){this.u=new G(this,"1.33.1",Zk);Qk(this.u)&&($k(this,d),a=al,bl(this.u));this.u.set(Wk,Wa());cl(this.u);var e=this.b&&!this.C;if(a==Xk||ra("Click OK to restore the previous "+wb+" machine state, or CANCEL to reset the machine.")){if(c=Vk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Qk(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.T("Error: "+g),"unable to verify user"==g&&(cb(dl,""),this.g=null)):this.v(f+": "+g),bl(d),Qk(d)?(c=Vk(d),e=!0):c=!1))}e&&Tk(this,c?d:null)}else a==al&&d.clear()}else Tk(this);delete this.G;delete this.B}e=ta(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.f&&(c=el(this,g,d,b,c));b=[d,a,c];a!=Yk?Sk(this,this.ie,b):this.ie(b)}};
|
||||
function el(a,b,c,d,e){if(!b.A.aa){b.A.aa=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.Da(f,d)&&f&&(v("Unable to restore state for "+b.type),a.I&&!a.R?(c.clear(),a.b=Pk,window&&window.location.reload()):a.N=!0,b.Da(null),e=!1),!d&&b.Sd){var g=b.Sd.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){v("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
|
||||
h.ie=function(a){var b=a[0],c=0>a[1];a=a[2];this.P=!0;this.A.aa=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(el(this,this.f,b,c,a),H(this,-2),this.f.ra());this.N&&($k(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0};
|
||||
function $k(a,b){if(ra("There may be a problem with your "+wb+" machine.\n\nTo help us diagnose it, click OK to send this "+wb+" machine state to http://www.pcjs.org.")){var c=a.U;a=a.g||"";b=b.toString();var d={};d.app=wb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;Xa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Jk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.33.1"),g=new G(a,"1.33.1",Uk),k=Wa();g.set(Wk,k);f.set(Wk,k);f.set(fl,"1.33.1");f.set(gl,window?window.location.href:null);f.set(jl,window?window.navigator.userAgent:"");a.f&&a.f.Ca&&(c&&(b&&(a.f.A.ra=a.f.A.V),a.f.ba()),d=a.f.Ca(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.aa=!1,!1===d&&(e=null)));for(var k=ta(a.id),l=0;l<k.length;l++){var m=k[l];m.A.aa&&(m.Ca&&(d=m.Ca(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.A.aa=
|
||||
!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.g&&tl(a,a.g,f.toString()),cl(g)&&cl(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=a.b==ul),d&&f.clear(k)):e=f.toString());c&&(a.A.aa=!1,b=a.H.power)&&(b.textContent="Power");a.j=0;return e}
|
||||
h.reset=function(){this.D&&this.D.reset&&(D(this,"Resetting "+this.D.type),this.D.reset());this.f&&this.f.reset&&(D(this,"Resetting "+this.f.type),this.f.reset());for(var a=ta(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.D&&c!==this.f&&c.reset&&(D(this,"Resetting "+c.type),c.reset())}H(this,-1)};h.start=function(a,b){for(var c=ta(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}H(this,-1)};
|
||||
h.stop=function(a,b){for(var c=ta(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}H(this,-1)};
|
||||
function H(a,b){if(a.f){var c=a.f,d=b||0,e=c.H.speed;e&&(0>=d||30<=(c.Xc+=d))&&(e.textContent=c.A.V?c.xb.toFixed(2)+"Mhz":"Stopped",c.Xc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.V;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;e<a.f.g.length;e++)gc(a,"R"+e,a.f.g[e]);e=ud(a.f);gc(a,"PS",e);gc(a,"NF",e&8?1:0,1);gc(a,"ZF",e&4?1:0,1);gc(a,"VF",e&2?1:0,1);gc(a,"CF",e&1?1:0,1);a.j=0}-1>b?a.fa=a.f.g[7]:0<b&&c&&!d&&(a.fa=a.f.kb);Xb(a,a.fa);Ob(a,a.Wa);b=a.f;b=b.zb?b.U&16?1:2:4;wc(a,"B22",b&1);wc(a,"B18",b&2);
|
||||
wc(a,"B16",b&4)}}
|
||||
h.va=function(a,b,c){var d=this;switch(b){case "power":return this.H[b]=c,c.onclick=function(){d.j||(d.A.aa?Jk(d,!1,!0):Sk(d,d.qc))},!0;case "reset":return this.H[b]=c,c.onclick=function(){if(d.A.aa&&!d.j)if(d.b&&!d.w){var a=ra("Click OK to save changes to this "+wb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Jk(d,a,!0);!a&&d.I?window&&window.location.reload():(a||(d.M=!0),d.qc(Pk),d.M=!1)}else d.reset(),d.f&&!d.F&&d.f.ra()},!0;case "save":if(La(Za(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.H[b]=c,c.onclick=function(){var a=Ok(d,!0);if(a){var b=!!(d.b&&!d.w||d.I),c=Jk(d,b);b?tl(d,a,c):d.T("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ok(a,b){var c=a.g;c||((c=bb(dl),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=vl(a,c))||a.T("The user ID is invalid.")):b&&a.T("Browser local storage is not available"));return c}
|
||||
function vl(a,b){a.g=null;b=Xa(Za()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(cb(dl,b.data),a.g=b.data)}catch(d){v(d.message+" ("+c+")")}return a.g}function Rk(a){var b=null;a.g&&(b=Za()+"/api/v1/user?req=load&user="+a.g+"&state="+wl(a,"1.33.1"));return b}
|
||||
function tl(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=wl(a,"1.33.1");d.data=c;b=Xa(Za()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.T("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.T(c),cb(dl,""),a.g=null)}}
|
||||
function Ph(a){var b;a=ta(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function ke(a,b){if(a.Ta){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Ta.focus();!b&&window&&window.scrollTo(c,d)}}var Zk="failsafe",Uk="validate",Wk="timestamp",fl="version",gl="url",jl="browser",dl="user",Yk=-1,Pk=0,Xk=1,al=2,ul=3;
|
||||
mb(function(){for(var a=x(document,w+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=wa(c),c=x(c,w,"computer"),e=0;e<c.length;e++){var f=c[e],g=wa(f),g=new Mk(g,d,!0);xa(g,f);g.L&&Sk(g,g.qc)}});nb.show.push(function(){for(var a=x(document,w,"computer"),b=0;b<a.length;b++){var c=wa(a[b]);(c=va("Computer",c.id))&&c.P&&!c.A.aa&&c.qc(Yk)}});nb.exit.push(function(){for(var a=x(document,w,"computer"),b=0;b<a.length;b++){var c=wa(a[b]);(c=va("Computer",c.id))&&c.A.aa&&Jk(c,!(!c.b||c.w),!0)}});
|
||||
function G(a,b,c){this.id=a.id;this.b="";this.f={};this.g=this.D=!1;this.key=wl(a,b,c);bl(this,a.rf)}h=G.prototype;h.set=function(a,b){try{this.f[a]=b}catch(c){}};h.get=function(a){return this.f[a]||null};h.data=function(){return this.f};function Qk(a,b){return b?(a.b=b,a.g=!0,a.D=!1,!0):a.g?!0:$a()&&(b=bb(a.key))?(a.b=b,a.g=!0):!1}function Vk(a){var b=!0;if(!a.D)try{a.f=JSON.parse(a.b),a.D=!0}catch(c){v(c.message||c),b=!1}return b}
|
||||
function cl(a){var b=!0;if($a()){var c=JSON.stringify(a.f);cb(a.key,c)||(v("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.f?JSON.stringify(this.f):this.b};function bl(a,b){a.b="";a.f={};a.g=a.D=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){bl(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function wl(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var xl=0;
|
||||
function yl(a,b,c,d,e,f){e("Loading "+a+"...");Xa(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):zl(k,a,b,c,d,e,f)})}
|
||||
function zl(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(oa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Al(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Al(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Xa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,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]);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);Al(a,b,c)}})}else c(a,null)}
|
||||
function Bl(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ma(a))}function f(a){e("Error: "+a);l&&(--xl||qb(!0));l=!1}var g,k,l=!0;xl++;pa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=m:q.appendChild(document.createTextNode(m));n.appendChild(q)}c||
|
||||
(c="/versions/pdpjs/1.33.1/components.xsl");m=function(d,k){k?yl(c,null,null,!1,e,function(d,l){l?(oa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--xl||qb(!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),--xl||qb(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?yl(b,a,d,!0,e,m):zl(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){qb(!1);return Bl(a,b,c,d)};window.findMachineComponent=function(a,b){return va(b,a+".machine")};window.enableEvents=qb;window.sendEvent=sb;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11-dbg.map
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/rx11.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2017
|
||||
http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2017
|
||||
|
|
@ -34,251 +35,262 @@
|
|||
http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017
|
||||
*/
|
||||
var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++}
|
||||
function ga(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});ga=function(){}}function ha(a){var b=0;return ia(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ia(a){ga();a={next:a};a[ba.Symbol.iterator]=function(){return this};return a}function ja(a){ga();ca();ga();var b=a[Symbol.iterator];return b?b.call(a):ha(a)}
|
||||
function n(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}for(var ka=ba,la=["Math","log2"],ma=0;ma<la.length-1;ma++){var na=la[ma];na in ka||(ka[na]={});ka=ka[na]}var oa=la[la.length-1],pa=ka[oa],qa=pa?pa:function(a){return Math.log(a)/Math.LN2};qa!=pa&&null!=qa&&aa(ka,oa,{configurable:!0,writable:!0,value:qa});
|
||||
var ra={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]},sa={Vg:0,Ad:1,$g:2,ah:3,bh:4,dh:5,eh:6,fh:7,Oc:8,gh:9,Bd:10,hh:11,ih:12,Cd:13,jh:14,kh:15,lh:16,mh:17,nh:18,oh:19,ph:20,qh:21,rh:22,sh:23,th:24,uh:25,vh: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,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,le:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,Dd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.he=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.Na=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,O:!1,error:!1};this.Ub=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.gb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)}
|
||||
function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<r.length;b++){var d=r[b];a&&d.id.indexOf(a)||c.push(d)}return c}function ya(a){if(void 0!==a){var b;for(b=0;b<r.length;b++)if(r[b].id===a)return r[b]}return null}
|
||||
function za(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<r.length;d++)if(c)c==r[d]&&(c=null);else if(!(a!=r[d].type||b&&r[d].id.indexOf(b)))return r[d]}return null}function v(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b}
|
||||
function w(a,b){var c=x;b=A(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=v(g))&&k.binding&&a.ka(k.type,k.binding,g,k.value),m=l.length}}}}
|
||||
function A(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}h=q.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
h.ka=function(a,b,c){switch(b){case "clear":return this.m[b]||(this.m[b]=c,c.onclick=function(a){return function(){a.m.print&&(a.m.print.value="")}}(this)),!0;case "print":return this.m[b]||(this.gb=this.m[b]=c,c.value="",this.Z=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.G=function(a){this.Z(a,this.$a)}),!0;default:return!1}};h.log=function(){};h.Z=function(){};
|
||||
h.status=function(a){this.Z(this.$a+": "+a)};h.G=function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)};function Aa(a,b){b&&(a.j.ready?b():a.Ub=b);return a.j.ready}function B(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.Ub,a.Ub=null,b&&b()))}function Ba(a,b){a.j.Ac?(a.j.Va=!1,a.j.Ac=!1):a.j.error?a.Z(a.toString()+" error"):a.j.Va=b}h.ja=function(){return this.j.O=!0};h.ia=function(a,b){b&&(this.j.O=!1);return!0};
|
||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var ua=window?window.PCjs.Machines:{},r=window?window.PCjs.Components:[];Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ha(a){fa();a={next:a};a[ba.Symbol.iterator]=function(){return this};return a}function ia(a){fa();ca();fa();var b=a[Symbol.iterator];return b?b.call(a):ga(a)}
|
||||
function n(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}function ja(a,b){if(b){var c=ba;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}
|
||||
ja("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}});ja("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}});
|
||||
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],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},la={Gh:0,Qd:1,Nh:2,Oh:3,Ph:4,Qh:5,Rh:6,Sh:7,gd:8,Th:9,Rd:10,Uh:11,Vh:12,Sd:13,Wh:14,Xh:15,Yh:16,Zh:17,$h:18,ai:19,bi:20,ci:21,di:22,ei:23,fi:24,gi:25,hi: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,ed:65,Ch:66,Ih:67,ii:68,E:69,oi:70,si:71,Ei:72,Gi:73,Hi:74,Ii:75,Ji:76,Mi:77,Oi:78,Ui:79,Xi:80,Q:81,Zi:82,bj:83,kj:84,mj:85,oj:86,pj:87,tj:88,uj:89,Ge:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,vj:97,wj:98,zj:99,d:100,e:101,Aj:102,Bj:103,Cj:104,Dj:105,Hj:106,k:107,Ij:108,Jj:109,n:110,Kj:111,p:112,q:113,r:114,Lj:115,t:116,Nj:117,Oj:118,Pj:119,x:120,
|
||||
y:121,z:122,"{":123,"|":124,"}":125,"~":126,Cb:127};function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pd=b.comment;this.Ee=b;this.exports={};this.o=this.bindings={};a=this.id.indexOf(".");0>a?this.ib=this.id:(this.Ua=this.id.substr(0,a),this.ib=this.id.substr(a+1));this.j={ready:!1,Ra:!1,Tc:!1,R:!1,error:!1};this.fc=null;this.j.error=!1;this.nd=c||0;this.D=this.c=this.u=this.A=this.ob=null;t.push(this)}function na(a,b,c){oa[a]&&b&&(oa[a][b]=c)}
|
||||
function pa(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function qa(a){var b=!1;window&&(b=window.confirm(a));return b}function ra(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<t.length;b++){var d=t[b];a&&d.id.indexOf(a)||c.push(d)}return c}function sa(a){if(void 0!==a){var b;for(b=0;b<t.length;b++)if(t[b].id===a)return t[b]}return null}
|
||||
function ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<t.length;d++)if(c)c==t[d]&&(c=null);else if(!(a!=t[d].type||b&&t[d].id.indexOf(b)))return t[d]}return null}function v(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b}
|
||||
function w(a,b){var c=y;b=z(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=v(g))&&k.binding&&a.ma(k.type,k.binding,g,k.value),m=l.length}}}}
|
||||
function z(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}h=r.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
h.ma=function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.ob=this.o[b]=c,c.value="",this.aa=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.G=function(a){this.aa(a,this.ib)}),!0;default:return!1}};h.log=function(){};h.aa=function(){};
|
||||
h.status=function(a){this.aa(this.ib+": "+a)};h.G=function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)};function ua(a,b){b&&(a.j.ready?b():a.fc=b);return a.j.ready}function B(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.fc,a.fc=null,b&&b()))}function va(a,b){a.j.Tc?(a.j.Ra=!1,a.j.Tc=!1):a.j.error?a.aa(a.toString()+" error"):a.j.Ra=b}h.la=function(){return this.j.R=!0};h.ka=function(a,b){b&&(this.j.R=!1);return!0};
|
||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var oa=window?window.PCjs.Machines:{},t=window?window.PCjs.Components:[];Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
function Ca(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
||||
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function Da(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function Ea(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function Fa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function Ga(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function Ha(a,b){return-1!==a.indexOf(b,a.length-b.length)}function Ia(a){return a.replace(/[&<>"']/g,function(a){return Ja[a]})}function Ka(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var Ja={"&":"&","<":"<",">":">",'"':""","'":"'"},Ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function Na(){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 Oa(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
||||
function wa(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
||||
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function xa(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function ya(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function za(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function Aa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function Ba(a,b){return-1!==a.indexOf(b,a.length-b.length)}function Ca(a){return a.replace(/[&<>"']/g,function(a){return Da[a]})}function Ea(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var Da={"&":"&","<":"<",">":">",'"':""","'":"'"},Fa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function Ga(){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 Ha(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
||||
f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function Pa(a,b){var c,d={M:null,ga:null,ca:null,ba: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.ca=g.load;d.ba=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<e.length;c++)d.M[f++]=e[c]&255,d.M[f++]=e[c]>>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c<e.length;c++)d.M[f++]=e[c]&
|
||||
255,d.M[f++]=e[c]>>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.M=e)}return d}
|
||||
function Qa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function Ra(){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 Ta(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function Ua(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Va(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
|
||||
function Wa(a){if(!Xa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Xa=c}return Xa[a]}function Ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Za(a){$a.init.push(a)}
|
||||
function ab(a){if(bb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function cb(a){!bb&&a?(bb=!0,db&&eb("init"),fb&&eb("show")):bb=a}function eb(a){$a[a]&&ab($a[a])}var Xa=null,$a={init:[],show:[],exit:[]},db=!1,fb=!1,bb=!0,Sa=null;Ya("onload",function(){db=!0;ab($a.init)});Ya("onpageshow",function(){fb=!0;ab($a.show)});Ya(Va("Opera")||Va("iOS")?"onunload":"onbeforeunload",function(){ab($a.exit)});
|
||||
var gb="undefined"!==typeof ArrayBuffer,x="pdp11",hb="PDPjs",ib=!0,jb=!0,C={ad:5,jd:144,Pc:8,Pb:{ae:15,ji:16,zi:32,dd:64,Xa:128,hd:256,mi:512,Ah:1024,Ob:2048,zh:4096,Tc:57344,S:{Tc:13}},Ud:{kd:1,Zg:2,be:3,ie:28,Nb:32,Mb:64,Yc:128,si:256,Ed:512,ub:1024,fi:2048,gd:4096,xi:8192,di:16384,Fd:32768,qc:32736},Sd:{Rc:1,ra:14,Ya:48,tc:64,wa:128,pi:256,Bh:512,Dh:1024,Ld:2048,yc:8192,qc:16384,tb:32768,ie:4608,wc:61438,Ta:3967,S:{ra:1,Ya:4}},Td:{xc:15,rc:16,sb:8160,Ma:57344,S:{rc:4,sb:5,Ma:13}},ra:{zd:0,ke:2,
|
||||
Pd:4,zc:6,Sb:8,Nd:10,Gd:12,yi:14}},D={ad:5,jd:112,Pc:4,Zd:{Xa:1,ra:14,va:48,tc:64,wa:128,Ma:768,Qc:15360,yh:16384,tb:32768,Yg:16254,li:128,wc:65535,Ta:1022,S:{ra:1,va:4,Ma:8}},Xd:{Ta:65534},$d:{ce:1,de:4,ee:16,ki:65408,ed:63,Rb:64,vb:65408,Hd:3,Jh:8,S:{Rb:6,vb:7}},Qb:{Kd:{Wh:0,oi:1,Wg:2,Xh:3,Sb:4,Md:5,ui:6,ni:7},Sc:8,Jd:16,Gh:32,Ih:64,Id:128,Hh:256,Mh:512,Oh:1024,Lh:2048,Kh:4096,Ph:8192,Fh:16384,Nh:32768},Yd:{vc:63},Qc:{ci:1024,xh:2048,kd:2048,Rh:3072,Ed:4096,ya:5120,ub:8192,Zh:9216},ra:{ai:0,zc:2,
|
||||
fe:4,Sb:6,Qd:8,je:10,Od:12,hi:14}},kb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"};C.Ob=[203,2,12,512,C.Pb.Ob|C.Pb.hd|C.Pb.dd];D.Vd=[512,2,40,256,D.Qb.Kd.Md|D.Qb.Sc|D.Qb.Jd];x="pdp11";hb="PDPjs";jb=ib=!0;
|
||||
function lb(a,b){q.call(this,"Panel",a,512);this.i=this.l=0;this.D=b;this.U=this.g=this.b=this.f=0;this.s=this.v=-1;this.w=this.B=this.o=!1;this.C=mb;this.h={};this.a={START:[1,1,!0,!1,this.Be],STEP:[1,1,!1,!1,this.Ce],ENABLE:[1,1,!1,!1,this.xe],CONT:[1,1,!0,!1,this.ve],DEP:[0,0,!0,!1,this.we],EXAM:[1,1,!0,!1,this.ye],LOAD:[1,1,!0,!1,this.Ae],TEST:[0,0,!0,!1,this.ze]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.De,a];this.F=this.c=this.u=this.A=null;B(this)}n(lb,q);h=lb.prototype;
|
||||
h.reset=function(a){this.stop();a&&nb(this,this.f=0)};
|
||||
h.ka=function(a,b,c,d){if(this.A&&this.A.ka(a,b,c,d)||this.c&&this.c.ka(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.m[b]=c,this.l++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.h[b]=d?1:0,this.l++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ob(a,
|
||||
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){pb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ob(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){pb(a,b)}}(this,b),!0):q.prototype.ka.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;qb(b,this,rb);sb(b,this.reset.bind(this));tb(this);ub(this)};h.ja=function(a,b){if(!b)if(this.D&&vb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};
|
||||
h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])wb(this,this.U=a[0]),nb(this,this.f=a[1]),xb(this,a[2]);return!0};function yb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function tb(a,b){for(var c in a.h)yb(a,c,null!=b?b:a.h[c])}function zb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}
|
||||
function ub(a){for(var b in a.a)zb(a,b,a.a[b][1])}function Ab(a,b,c,d){if(a.m[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Da(c,d):Ea(c,d);a.m[b].textContent!=c&&(a.m[b].textContent=c)}}function ob(a,b){var c=a.a[b];zb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Bb&&(a.w=b==Cb,a.B=b==Db)}function pb(a,b){var c=a.a[b];c[2]&&c[3]&&(zb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Be=function(a){a||this.c.j.L||(a=this.c,a.u.reset(),Eb(a),this.a[Fb]&&this.a[Fb][1]&&Gb(this.c))};h.Ce=function(){};
|
||||
h.xe=function(a){a||F(this.c)};h.ve=function(a){if(!a&&!this.c.j.L)if(this.a[Fb]&&this.a[Fb][1])Gb(this.c);else{a=this.F;var b;if(b=a)a.j.Va&&(a.j.Ac=!0),b=!a.j.Va;if(b)Ba(a,!0),a.f(0,null),Ba(a,!1);else try{var c=this.c.kc(1);0<c&&(Hb(this.c,c),Ib(this.c,c,!0),Jb(this.c,c))}catch(d){"number"!=typeof d&&(c=this.c,a=d.stack||d.message,c.j.error=!0,c.G(a))}this.stop();this.A&&Kb(this.A)}};
|
||||
h.we=function(a){if(a&&!this.c.j.L)if(this.w&&Lb(this),a=nb(this,this.b),this.C==mb)Mb(this.u,this.U,a);else{var b=this.c,c=this.U;b.hb++;b.u.Lb(Nb(b,c,4),a);b.hb--}};h.ye=function(a){if(!a&&!this.c.j.L){this.B&&Lb(this);if(this.C==mb)a=Ob(this.u,this.U);else{a=this.c;var b=this.U;a.hb++;b=a.u.Kb(Nb(a,b,2));a.hb--;a=b}nb(this,a)}};h.Ae=function(a){a||this.c.j.L||wb(this,this.b)};h.ze=function(a){a?(this.o=!0,tb(this,!0)):(this.o=!1,tb(this),xb(this,0))};
|
||||
h.De=function(a,b){this.b=a?this.b|1<<b:this.b&~(1<<b)};function Lb(a){var b=1140>=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[Bb]&&a.a[Bb][1]||(b=-b);wb(a,a.U&~c|a.U+b&c)}function wb(a,b){a.U=b&a.u.v;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Pb(a,"A"+c,b&1<<c)}}function nb(a,b){a.g=b&65535;if(a.v!==a.g){a.v=a.g;b=a.v;for(var c=0;16>c;c++)Pb(a,"D"+c,b&1<<c)}return a.g}function Pb(a,b,c){a.h[b]=c;a.o||yb(a,b,c)}
|
||||
function xb(a,b){if(void 0!==a.m[Qb]){a.b=b;for(var c=0;22>c;c++)a.a["S"+c][1]=b&1<<c?1:0;ub(a)}}h.stop=function(){wb(this,this.c.b[7])};h.setData=function(a,b){b?this.f=a:this.g=a};h.Ie=function(a,b){return(b?this.f:this.b)&65535};h.Vf=function(a){this.f=a};function vb(){for(var a=A(document,x,"panel"),b=0;b<a.length;b++){var c=a[b],d=v(c),e=ya(d.id);e||(e=new lb(d,!0));w(e,c)}}
|
||||
var mb=7,Qb="S0",Cb="DEP",Fb="ENABLE",Db="EXAM",Bb="STEP",Rb={},rb=(Rb[65400]=[null,null,lb.prototype.Ie,lb.prototype.Vf,"CNSW"],Rb);Za(vb);
|
||||
function Sb(a,b,c){q.call(this,"Bus",a,16);this.c=b;this.F=c;this.R=+a.busWidth||16;this.C=1<<this.R;this.v=this.C-1;this.g=Tb;this.h=Math.log2(this.g);this.J=this.g>>2;this.f=this.g-1;this.s=this.C/this.g|0;this.K=this.s-1;this.Ka=[];this.l=0;this.o=!1;this.D=[];this.me=[Ub,Vb,Wb,Xb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Yb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b<this.s;b++)this.a[b]=this.b[b]=a;this.B=this.C-Tb;Zb(this,this.B,Tb,$b,this);this.I=this.H=
|
||||
(this.B&this.v)>>>this.h;this.w=0;this.i=this.v;B(this)}n(Sb,q);function ac(a,b){if(b!=a.w){for(var c=0;c<a.s;c++)a.b[c]=a.a[c];a.w=0;a.i=a.v;b&&(a.w=b,b=1<<b,a.i=b-1,b-=Tb,a.I=(b&a.i)>>>a.h,a.b[a.I]=a.a[a.H])}}h=Sb.prototype;h.reset=function(){for(var a=0;a<this.D.length;a++)this.D[a]();ac(this,16)};h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,bc(this));return a.data()};
|
||||
function Ia(a,b){var c,d={N:null,ia:null,ea:null,da: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.ea=g.load;d.da=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&255,d.N[f++]=e[c]>>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&
|
||||
255,d.N[f++]=e[c]>>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ia=g.symbols;d.N.length?1==d.N.length&&(u(d.N[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.N=e)}return d}
|
||||
function Ja(){return"http://"+(window?window.location.host:"www.pcjs.org")}function Ka(){if(null==La){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}La=a}return La}function Ma(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function Na(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Oa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
|
||||
function Pa(a){if(!Qa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Qa=c}return Qa[a]}function Ra(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ta(a){Ua.init.push(a)}
|
||||
function Va(a){if(Wa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Xa(a){!Wa&&a?(Wa=!0,Ya&&Za("init"),$a&&Za("show")):Wa=a}function Za(a){Ua[a]&&Va(Ua[a])}var Qa=null,Ua={init:[],show:[],exit:[]},Ya=!1,$a=!1,Wa=!0,La=null;Ra("onload",function(){Ya=!0;Va(Ua.init)});Ra("onpageshow",function(){$a=!0;Va(Ua.show)});Ra(Oa("Opera")||Oa("iOS")?"onunload":"onbeforeunload",function(){Va(Ua.exit)});
|
||||
var ab="undefined"!==typeof ArrayBuffer,y="pdp11",bb="PDPjs",cb=!0,db=!0,C={Nc:5,Rc:144,yc:8,$b:{xe:15,cj:16,sj:32,ud:64,ha:128,yd:256,gj:512,mi:1024,Zb:2048,li:4096,Jc:57344,U:{Jc:13}},le:{zd:1,Mh:2,ye:3,gb:28,Yb:32,Xb:64,od:128,lj:256,Td:512,Eb:1024,Yi:2048,xd:4096,qj:8192,Wi:16384,Ud:32768,Ec:32736},je:{Db:1,ca:14,fb:48,eb:64,za:128,jj:256,ni:512,pi:1024,$d:2048,Pc:8192,Ec:16384,Ja:32768,gb:4608,Fb:61438,va:3967,U:{ca:1,fb:4}},ke:{Oc:15,Hc:16,Bb:8160,Ta:57344,U:{Hc:4,Bb:5,Ta:13}},ca:{Pd:0,Hb:2,
|
||||
Va:4,Sc:6,cc:8,de:10,Vd:12,rj:14}},D={Nc:5,Rc:112,yc:4,ce:"DY",qe:{ha:1,ca:14,ya:48,eb:64,za:128,Ta:768,hd:15360,ki:16384,Ja:32768,Jh:16254,fj:128,Fb:65535,va:1022,U:{ca:1,ya:4,Ta:8}},oe:{va:65534},re:{ze:1,Ae:4,Be:16,dj:65408,vd:63,bc:64,Gb:65408,Wd:3,xi:8,U:{bc:6,Gb:7}},ac:{Zd:{Ki:0,ij:1,Hh:2,Li:3,cc:4,ae:5,nj:6,hj:7},jd:8,Yd:16,ui:32,wi:64,Xd:128,vi:256,Ai:512,Ci:1024,zi:2048,yi:4096,Di:8192,ti:16384,Bi:32768},pe:{Fa:63},hd:{Vi:1024,ji:2048,zd:2048,Fi:3072,Td:4096,Ba:5120,Eb:8192,Ni:9216},ca:{Pi:0,
|
||||
Sc:2,Ce:4,cc:6,he:8,Fe:10,ee:12,$i:14}},eb={Nc:5,Rc:180,yc:2,ce:"DX",te:{Db:1,ca:14,Qc:16,DONE:32,eb:64,Ga:128,INIT:16384,Ja:32768,gb:16128,Fb:32992,va:16479},aj:{},we:{Fa:127},ve:{Fa:31},ue:{fd:1,rd:2,Jc:4,Cb:64,ha:128},ca:{Bc:0,EMPTY:2,Hb:4,Va:6,gb:8,ge:10,dc:12,fe:14},ERROR:{Fc:8,Gc:16,Dh:24,be:32,ri:40,ej:48,Mc:56,Ti:72,Si:80,Ri:88,Lh:96,Fh:104,Qi:112,Lc:120,Kh:128,Eh:136}},fb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11",180:"RX11"};
|
||||
eb.se=["DX",77,1,26,128,1,0,0,128,0];C.Zb=["RK",203,2,12,512,0,0,0,512,C.$b.Zb|C.$b.yd|C.$b.ud];D.me=["RL",512,2,40,256,0,0,0,256,D.ac.Zd.ae|D.ac.jd|D.ac.Yd];y="pdp11";bb="PDPjs";db=cb=!0;
|
||||
function gb(a,b){r.call(this,"Panel",a,512);this.i=this.m=0;this.F=b;this.V=this.g=this.b=this.f=0;this.s=this.v=-1;this.w=this.B=this.l=!1;this.C=hb;this.h={};this.a={START:[1,1,!0,!1,this.af],STEP:[1,1,!1,!1,this.bf],ENABLE:[1,1,!1,!1,this.Xe],CONT:[1,1,!0,!1,this.Ve],DEP:[0,0,!0,!1,this.We],EXAM:[1,1,!0,!1,this.Ye],LOAD:[1,1,!0,!1,this.$e],TEST:[0,0,!0,!1,this.Ze]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.cf,a];this.D=this.c=this.u=this.A=null;B(this)}n(gb,r);h=gb.prototype;
|
||||
h.reset=function(a){this.stop();a&&ib(this,this.f=0)};
|
||||
h.ma=function(a,b,c,d){if(this.A&&this.A.ma(a,b,c,d)||this.c&&this.c.ma(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.o[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a,
|
||||
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ma.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.la=function(a,b){if(!b)if(this.F&&qb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};
|
||||
h.ka=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.V,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])rb(this,this.V=a[0]),ib(this,this.f=a[1]),sb(this,a[2]);return!0};function tb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.h)tb(a,c,null!=b?b:a.h[c])}function ub(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}
|
||||
function pb(a){for(var b in a.a)ub(a,b,a.a[b][1])}function vb(a,b,c,d){if(a.o[b]){var e=a.D&&a.D.h||8;c=c||0;c=8==e?xa(c,d):ya(c,d);a.o[b].textContent!=c&&(a.o[b].textContent=c)}}function jb(a,b){var c=a.a[b];ub(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=wb&&(a.w=b==xb,a.B=b==yb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(ub(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.af=function(a){a||this.c.j.M||(a=this.c,a.u.reset(),zb(a),this.a[Ab]&&this.a[Ab][1]&&Bb(this.c))};h.bf=function(){};
|
||||
h.Xe=function(a){a||F(this.c)};h.Ve=function(a){if(!a&&!this.c.j.M)if(this.a[Ab]&&this.a[Ab][1])Bb(this.c);else{a=this.D;var b;if(b=a)a.j.Ra&&(a.j.Tc=!0),b=!a.j.Ra;if(b)va(a,!0),a.f(0,null),va(a,!1);else try{var c=this.c.wc(1);0<c&&(Cb(this.c,c),Db(this.c,c,!0),Eb(this.c,c))}catch(d){"number"!=typeof d&&(c=this.c,a=d.stack||d.message,c.j.error=!0,c.G(a))}this.stop();this.A&&Fb(this.A)}};
|
||||
h.We=function(a){if(a&&!this.c.j.M)if(this.w&&Gb(this),a=ib(this,this.b),this.C==hb)Hb(this.u,this.V,a);else{var b=this.c,c=this.V;b.pb++;b.u.Wb(Ib(b,c,4),a);b.pb--}};h.Ye=function(a){if(!a&&!this.c.j.M){this.B&&Gb(this);if(this.C==hb)a=Jb(this.u,this.V);else{a=this.c;var b=this.V;a.pb++;b=a.u.Vb(Ib(a,b,2));a.pb--;a=b}ib(this,a)}};h.$e=function(a){a||this.c.j.M||rb(this,this.b)};h.Ze=function(a){a?(this.l=!0,ob(this,!0)):(this.l=!1,ob(this),sb(this,0))};
|
||||
h.cf=function(a,b){this.b=a?this.b|1<<b:this.b&~(1<<b)};function Gb(a){var b=1140>=a.c.sa?8:16,c=65472<=a.V&&a.V<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[wb]&&a.a[wb][1]||(b=-b);rb(a,a.V&~c|a.V+b&c)}function rb(a,b){a.V=b&a.u.v;if(a.s!==a.V){a.s=a.V;b=a.s;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<<c)}}function ib(a,b){a.g=b&65535;if(a.v!==a.g){a.v=a.g;b=a.v;for(var c=0;16>c;c++)Kb(a,"D"+c,b&1<<c)}return a.g}function Kb(a,b,c){a.h[b]=c;a.l||tb(a,b,c)}
|
||||
function sb(a,b){if(void 0!==a.o[Lb]){a.b=b;for(var c=0;22>c;c++)a.a["S"+c][1]=b&1<<c?1:0;pb(a)}}h.stop=function(){rb(this,this.c.b[7])};h.setData=function(a,b){b?this.f=a:this.g=a};h.hf=function(a,b){return(b?this.f:this.b)&65535};h.yg=function(a){this.f=a};function qb(){for(var a=z(document,y,"panel"),b=0;b<a.length;b++){var c=a[b],d=v(c),e=sa(d.id);e||(e=new gb(d,!0));w(e,c)}}
|
||||
var hb=7,Lb="S0",xb="DEP",Ab="ENABLE",yb="EXAM",wb="STEP",Mb={},mb=(Mb[65400]=[null,null,gb.prototype.hf,gb.prototype.yg,"CNSW"],Mb);Ta(qb);
|
||||
function Nb(a,b,c){r.call(this,"Bus",a,16);this.c=b;this.D=c;this.S=+a.busWidth||16;this.C=1<<this.S;this.v=this.C-1;this.g=Ob;this.h=Math.log2(this.g);this.J=this.g>>2;this.f=this.g-1;this.s=this.C/this.g|0;this.K=this.s-1;this.Qa=[];this.m=0;this.l=!1;this.F=[];this.He=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b<this.s;b++)this.a[b]=this.b[b]=a;this.B=this.C-Ob;Ub(this,this.B,Ob,Vb,this);this.I=this.H=
|
||||
(this.B&this.v)>>>this.h;this.w=0;this.i=this.v;B(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c<a.s;c++)a.b[c]=a.a[c];a.w=0;a.i=a.v;b&&(a.w=b,b=1<<b,a.i=b-1,b-=Ob,a.I=(b&a.i)>>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;a<this.F.length;a++)this.F[a]();Wb(this,16)};h.la=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ka=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,Xb(this));return a.data()};
|
||||
h.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&d.length<this.J){for(var e=0,f=Array(this.J),g=0;g<d.length-1;)for(var k=d[g++],l=d[g++];k--;)f[e++]=l;d=f}e=this.a[c];if(!e||!e.restore(d)){u("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
||||
function Zb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.g,p=a.g-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ua)return l.Hb+=l.Ua-f,l.Ua=f,!0;if(f>=l.Ua+l.Hb){p=l.size-(f-m);p>g&&(p=g);l.Hb=f-l.Ua+p;f=m+a.g;g-=p;k++;continue}}return cc(dc,f,g)}f=new G(a,f,p,a.g,d,e);Yb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ec[d]+" at "+Da(b)),!0):cc(fc,b,c)}h.xd=function(a){return this.b[(a&this.i)>>>this.h].lb(a&this.f,a)};
|
||||
h.Kb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return jb||b!=this.f?this.b[c].W(b,a):this.b[c++].lb(b,a)|this.b[c&this.K].lb(0,a+1)<<8};h.yd=function(a,b){this.b[(a&this.i)>>>this.h].ob(a&this.f,b,a)};h.Lb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;jb||c!=this.f?this.b[d].rb(c,b,a):(this.b[d++].ob(c,b&255,a),this.b[d&this.K].ob(0,b>>8&255,a+1))};function gc(a,b){return a.a[(b&a.v)>>>a.h]}
|
||||
function Ob(a,b){var c;a.o=!1;a.l++;var d=b&a.f,e=gc(a,b);jb||d!=a.f?c=e.l(d,b):c=e.i(d,b)|gc(a,b+1).i(0,b+1)<<8;a.l--;return c}function hc(a,b,c){a.o=!1;a.l++;gc(a,b).m(b&a.f,c&255,b);a.l--}function Mb(a,b,c){a.o=!1;a.l++;var d=b&a.f,e=gc(a,b);jb||d!=a.f?e.F(d,c&65535,b):(e.m(d,c&255,b),gc(a,b+1).m(0,c>>8&255,b+1));a.l--}
|
||||
function bc(a){for(var b=0,c=[],d=0;d<a.s;d++){var e=a.a[d];if(e.Ca||e.re){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;l[k++]=p-g;l[k++]=m;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function ic(a){for(var b=jc,c=0,d=0;d<a.a.length;d++){var e=a.a[d];e.type==b&&(c=e.Ua+e.Hb)}return c}
|
||||
function kc(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&lc;if(void 0!==a.Ka[p])return u("I/O address already registered: "+Ea(b,8,!0)),!1;var t=l||"unknown";t&&0<=m&&(t+=m++);a.Ka[p]=[d,e,f,g,t,k||16,!1]}return!0}
|
||||
function qb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.pa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],z=g[5]||1,y=0;y<z;y++,f+=2)if(t&&1<z&&(t=g[4]+y),!kc(a,f,f,k,l,m,p,g[7]||b.Xc,t||b.$a))return!1}}return!0}
|
||||
function sb(a,b){a.D.push(b)}function H(a,b,c){a.o=!0;a.l||(c&&(a.c.D|=c),I(a.c,4,0,b))}function mc(a){var b=a.o;a.o=!1;return b}function cc(a,b,c){u("Memory block error ("+a+": "+Ea(b)+","+Ea(c)+")");return!1}var Tb=8192,lc=Tb-1,dc=1,fc=2;function Ub(a,b){var c=-1,d=this.controller,e=d.Ka[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.Ka[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255}
|
||||
function Vb(a,b,c){var d=!1,e=this.controller,f=e.Ka[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.Ka[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||H(e,c,16)}function Wb(a,b){var c=-1,d=this.controller;a=d.Ka[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;H(d,b,16);return 65535}
|
||||
function Xb(a,b,c){var d=!1,e=this.controller;a=e.Ka[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||H(e,c,16)}function J(a){q.call(this,"Device",a,256);this.a={Da:128,Jc:-1}}n(J,q);h=J.prototype;h.ha=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.Jc=nc(c,function(){e.a.Da|=128;e.a.Da&64&&oc(e.c,e.a.jb);e.A&&Kb(e.A,1);pc(e.c,e.a.Jc,1E3/60)});this.a.jb=qc(c,64,6,524288);qb(b,this,sc);sb(b,this.reset.bind(this));B(this)};
|
||||
h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a.Da=128;pc(this.c,this.a.Jc,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Da]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Da=a.next().value;return!0};h.Pe=function(){return this.a.Da};h.bg=function(a){this.a.Da=a&192;this.a.Da&64||(a=this.a.jb)&&tc(this.c,a)};h.Re=function(){return uc(this.c)};
|
||||
h.dg=function(a){vc(this.c,a&-129|this.c.J&128)};h.Se=function(){return wc(this.c)};h.Te=function(){return xc(this.c)};h.Ue=function(){return this.c.qa};h.eg=function(a){yc(this.c,a)};h.Df=function(a){a=a>>1&63;var b=this.c.Ja[a>>1];return a&1?b>>16:b&65535};h.Mg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ja[c]=b&1?this.c.Ja[c]&65535|(a&63)<<16:this.c.Ja[c]&-65536|a&65534};h.wf=function(a){return this.c.s[1][a>>1&7]};h.Fg=function(a,b){this.c.s[1][b>>1&7]=a&65295};
|
||||
h.uf=function(a){return this.c.s[1][(a>>1&7)+8]};h.Dg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.vf=function(a){return this.c.H[1][a>>1&7]};h.Eg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.tf=function(a){return this.c.H[1][(a>>1&7)+8]};h.Cg=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Oe=function(a){return this.c.s[0][a>>1&7]};h.ag=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.Me=function(a){return this.c.s[0][(a>>1&7)+8]};
|
||||
h.Zf=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.Ne=function(a){return this.c.H[0][a>>1&7]};h.$f=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Le=function(a){return this.c.H[0][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Cf=function(a){return this.c.s[3][a>>1&7]};h.Lg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.Af=function(a){return this.c.s[3][(a>>1&7)+8]};h.Jg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};
|
||||
h.Bf=function(a){return this.c.H[3][a>>1&7]};h.Kg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.zf=function(a){return this.c.H[3][(a>>1&7)+8]};h.Ig=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.mb=function(a){a&=7;return this.c.i&2048?this.c.sa[a]:this.c.b[a]};h.pb=function(a,b){b&=7;this.c.i&2048?this.c.sa[b]=a:this.c.b[b]=a};h.Ze=function(){return this.c.i&49152?this.c.fa[0]:this.c.b[6]};h.jg=function(a){this.c.i&49152?this.c.fa[0]=a:this.c.b[6]=a};
|
||||
h.bf=function(){return this.c.b[7]};h.mg=function(a){this.c.b[7]=a};h.nb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.sa[a]};h.qb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.sa[b]=a};h.$e=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[1]};h.kg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[1]=a};h.af=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[3]};h.lg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[3]=a};
|
||||
h.Ke=function(a){return this.c.Eb[a-65504>>1]};h.Xf=function(a,b){this.c.Eb[b-65504>>1]=a};h.sd=function(a){return 65520==a?(ic(this.u)>>6)-1:0};h.vd=function(){};h.yf=function(){return 1};h.Hg=function(){};h.Je=function(){return this.c.D};h.Wf=function(){this.c.D=0};h.Qe=function(){return this.c.Bb};h.cg=function(a,b){b&1||(a&=255);this.c.Bb=a};h.Ve=function(a,b){return b?0:this.c.Sa};h.fg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a};
|
||||
h.xf=function(a,b){return b?0:this.c.Ia&65280};h.Gg=function(a){this.c.Ia=a|255};h.Ye=function(){return zc(this.c)};h.ig=function(a){Ac(this.c,a)};h.ud=function(){};
|
||||
var K={},sc=(K[61568]=[null,null,J.prototype.Df,J.prototype.Mg,"UNIMAP",64,1170],K[62592]=[null,null,J.prototype.wf,J.prototype.Fg,"SIPDR",8,1145,64],K[62608]=[null,null,J.prototype.uf,J.prototype.Dg,"SDPDR",8,1145,64],K[62624]=[null,null,J.prototype.vf,J.prototype.Eg,"SIPAR",8,1145,64],K[62640]=[null,null,J.prototype.tf,J.prototype.Cg,"SDPAR",8,1145,64],K[62656]=[null,null,J.prototype.Oe,J.prototype.ag,"KIPDR",8,1140,64],K[62672]=[null,null,J.prototype.Me,J.prototype.Zf,"KDPDR",8,1145,64],K[62688]=
|
||||
[null,null,J.prototype.Ne,J.prototype.$f,"KIPAR",8,1140,64],K[62704]=[null,null,J.prototype.Le,J.prototype.Yf,"KDPAR",8,1145,64],K[62798]=[null,null,J.prototype.Ue,J.prototype.eg,"MMR3",1,1145,64],K[65382]=[null,null,J.prototype.Pe,J.prototype.bg,"LKS"],K[65402]=[null,null,J.prototype.Re,J.prototype.dg,"MMR0",1,1140,64],K[65404]=[null,null,J.prototype.Se,J.prototype.ud,"MMR1",1,1145,64],K[65406]=[null,null,J.prototype.Te,J.prototype.ud,"MMR2",1,1140,64],K[65408]=[null,null,J.prototype.Cf,J.prototype.Lg,
|
||||
"UIPDR",8,1140,64],K[65424]=[null,null,J.prototype.Af,J.prototype.Jg,"UDPDR",8,1145,64],K[65440]=[null,null,J.prototype.Bf,J.prototype.Kg,"UIPAR",8,1140,64],K[65456]=[null,null,J.prototype.zf,J.prototype.Ig,"UDPAR",8,1145,64],K[65472]=[null,null,J.prototype.mb,J.prototype.pb,"R0SET0"],K[65473]=[null,null,J.prototype.mb,J.prototype.pb,"R1SET0"],K[65474]=[null,null,J.prototype.mb,J.prototype.pb,"R2SET0"],K[65475]=[null,null,J.prototype.mb,J.prototype.pb,"R3SET0"],K[65476]=[null,null,J.prototype.mb,
|
||||
J.prototype.pb,"R4SET0"],K[65477]=[null,null,J.prototype.mb,J.prototype.pb,"R5SET0"],K[65478]=[null,null,J.prototype.Ze,J.prototype.jg,"R6KERNEL"],K[65479]=[null,null,J.prototype.bf,J.prototype.mg,"R7KERNEL"],K[65480]=[null,null,J.prototype.nb,J.prototype.qb,"R0SET1",1,1145],K[65481]=[null,null,J.prototype.nb,J.prototype.qb,"R1SET1",1,1145],K[65482]=[null,null,J.prototype.nb,J.prototype.qb,"R2SET1",1,1145],K[65483]=[null,null,J.prototype.nb,J.prototype.qb,"R3SET1",1,1145],K[65484]=[null,null,J.prototype.nb,
|
||||
J.prototype.qb,"R4SET1",1,1145],K[65485]=[null,null,J.prototype.nb,J.prototype.qb,"R5SET1",1,1145],K[65486]=[null,null,J.prototype.$e,J.prototype.kg,"R6SUPER",1,1145],K[65487]=[null,null,J.prototype.af,J.prototype.lg,"R6USER",1,1145],K[65504]=[null,null,J.prototype.Ke,J.prototype.Xf,"CTRL",8,1170],K[65520]=[null,null,J.prototype.sd,J.prototype.vd,"LSIZE",1,1170],K[65522]=[null,null,J.prototype.sd,J.prototype.vd,"HSIZE",1,1170],K[65524]=[null,null,J.prototype.yf,J.prototype.Hg,"SYSID",1,1170],K[65526]=
|
||||
[null,null,J.prototype.Je,J.prototype.Wf,"ERR",1,1170],K[65528]=[null,null,J.prototype.Qe,J.prototype.cg,"MBR",1,1170],K[65530]=[null,null,J.prototype.Ve,J.prototype.fg,"PIR"],K[65532]=[null,null,J.prototype.xf,J.prototype.Gg,"SLR"],K[65534]=[null,null,J.prototype.Ye,J.prototype.ig,"PSW"],K);
|
||||
Za(function(){for(var a=A(document,x,"device"),b=0;b<a.length;b++){var c,d=a[b];c=v(d);switch(c.type){case "default":c=new J(c);w(c,d);break;case "pc11":c=new Bc(c);w(c,d);break;case "rl11":c=new L(c);w(c,d);break;case "rk11":c=new M(c),w(c,d)}}});
|
||||
function G(a,b,c,d,e,f){this.b=a;this.id=Cc+=2;this.c=null;this.Ua=b;this.Hb=c;this.size=d||0;this.type=e||Dc;this.A=e==Ec;this.controller=null;this.lb=this.i=this.Ec;this.W=this.l=this.Fc;this.ob=this.m=this.Jb;this.rb=this.F=this.Kc;this.g=this.h=0;Yb(this);this.Ca=this.re=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],Fc(this,f.me);else if(gb)this.f=new ArrayBuffer(this.size),this.u=new DataView(this.f,0,this.size),this.a=new Uint8Array(this.f,0,this.size),this.o=new Uint16Array(this.f,
|
||||
0,this.size>>1),this.c=new Int32Array(this.f,0,this.size>>2),Fc(this,Gc?Hc:Ic);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;Fc(this,Jc)}else Fc(this)}h=G.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(gb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.u.getInt32(b<<2,!0);else a=this.c;return a};
|
||||
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(gb)for(b=0;b<a.length;b++)this.u.setInt32(b<<2,a[b],!0);else this.c=a;return this.Ca=!0}return!1};function Fc(a,b){b||(b=Lc);Mc(a,b,void 0);Nc(a,b,void 0)}function Mc(a,b,c){c&&a.g||(a.lb=b[0]||a.Ec,a.W=b[2]||a.Fc);if(c||void 0===c)a.i=b[0]||a.Ec,a.l=b[2]||a.Fc}function Nc(a,b,c){c&&a.h||(a.ob=!a.A&&b[1]||a.Jb,a.rb=!a.A&&b[3]||a.Kc);if(c||void 0===c)a.m=b[1]||a.Jb,a.F=b[3]||a.Kc}
|
||||
function Yb(a,b){a.g=a.h=0;b&&((a.g=b.g)&&Mc(a,Oc,!1),(a.h=b.h)&&Nc(a,Oc,!1))}h.Ec=function(a,b){H(this.b,b,32);return 255};h.Jb=function(a,b,c){H(this.b,c,32)};h.Fc=function(a,b){return this.lb(a++,b++)|this.lb(a,b)<<8};h.Kc=function(a,b,c){this.ob(a++,b&255,c++);this.ob(a,b>>8,c)};h.He=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.If=function(a,b){ib&&a&1&&H(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8};
|
||||
h.Uf=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.Ca=!0};h.Qg=function(a,b,c){ib&&a&1&&H(this.b,c,64);c=a>>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<<a)|b<<a:(this.c[c]=this.c[c]&16777215|b<<24,c++,this.c[c]=this.c[c]&-256|b>>8);this.Ca=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]};
|
||||
h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ca=!0};h.Tf=function(a,b){this.a[a]=b;this.Ca=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ca=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ca=!0};
|
||||
var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Jc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc;
|
||||
function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.ab=this.nc*this.Ra;this.oc=this.Ab=this.eb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.Y=a.autoStart;"string"==typeof this.j.Y&&(this.j.Y="true"==this.j.Y);this.j.Tb=!1;this.cc=this.cb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.X=[];this.bd=this.Mf.bind(this);this.Ha=this.Aa=this.Ga=this.a=this.aa=this.za=this.xb=this.Fa=this.fb=this.pc=
|
||||
this.Oa=0;this.na=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.na=a.f;for(a=0;a<Sc.length;a++)(b=this.m[Sc[a]])&&this.A.ka(null,Sc[a],b);B(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.ja=function(a,b){var c=Tc(this.A,"autoStart");null!=c?this.j.Y="true"==c?!0:"false"==c?!1:!!c:null==this.j.Y&&(this.j.Y=void 0===this.m.run);if(!b){if(a){Uc(this);if(!this.restore(a))return!1;Vc(this)}else this.reset();this.status("No debugger detected");this.j.Y||this.Z("CPU will not be auto-started "+(this.na?"(click Run to start)":"(type 'go' to start)"))}return!0};h.ia=function(a){return a?this.save():!0};h.Y=function(){return this.j.L?!0:this.j.Y?(Gb(this),!0):!1};h.od=function(){return 0};
|
||||
function Vc(a){void 0===a.dc&&(a.dc=0);void 0===a.yb&&(a.yb=-1);void 0===a.zb&&(a.zb=-1);a.j.Tb=0<=a.dc&&0<a.yb;a.j.Tb&&(a.cc=0,a.cb=a.dc-a.Ha)}function Jb(a,b){if(a.j.Tb){var c=!1;a.cc=a.cc+a.od()|0;a.cb-=b;0>=a.cb&&(a.cb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.Z(Wc(a)+" cycles: checksum="+Ea(a.cc))}}
|
||||
h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.O)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.O);c++);c==k.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.Ub?" (waiting for notification)":""))+".");a=!1}a&&(d.j.L?F(d):Gb(d))},!0;case "speed":return this.m[b]=
|
||||
c,!0;case "setSpeed":return this.m[b]=c,c.onclick=function(){Xc(d,d.Ra<<1,!0)},c.textContent=this.ab.toFixed(2)+"Mhz",!0}return!1};function Ib(a,b,c){a.Ha+=b;c&&(a.Ga=a.a=a.aa=0)}function Yc(a,b){var c=1;b&&1<a.Ra&&a.Oa&&(c=a.Oa/a.nc);a.oc=Math.round(1E3/Zc);a.Ab=Math.floor(a.ec/Zc*c);b||(a.eb=a.Ab);a.fc=0}function Wc(a){return a.Ha+a.Aa+a.Ga-a.a}function Uc(a){a.Oa=0;a.pc=0;a.Ha=a.Aa=a.Ga=a.a=a.aa=0;Vc(a);Xc(a,1)}
|
||||
function Xc(a,b,c){if(void 0!==b){.8>a.Oa/a.ab&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.ab!=b){a.ab=b;b=a.ab.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.Aa);a.Aa=0;a.za=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function pc(a,b,c,d){0<=b&&b<a.X.length&&(d||0>a.X[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.X[b][0]=c)}function bd(a){for(var b=[],c=0;c<a.X.length;c++)b.push(a.X[c][0]);return b}
|
||||
function Hb(a,b){for(var c=a.X.length-1;0<=c;c--){var d=a.X[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.aa=0;b&&(a.Ga=0);return c}
|
||||
h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.fb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.za+=a,this.za>this.xb&&(this.za=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.X.length-1;0<=d;d--){var e=this.X[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.fb+=b;this.Aa+=b;Jb(this,b);Hb(this,b);this.eb-=b;if(0>=this.eb){this.eb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this);
|
||||
this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.fb&&(c=Math.round(c*this.fb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.za)this.Oa=Math.round(this.Aa/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oa<this.ab)-1E3>c&&(this.za-=c),c=0;this.fc+=this.fb;this.Fa+=c;a(b,c)}}};
|
||||
function Gb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.Z(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.za,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.Aa);a.Aa=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"];
|
||||
function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Ba=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.bb=this.Pa=this.Qa=this.Wa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.g=0;this.ge=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.Za=this.pe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.Za=this.qe,
|
||||
this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140<this.pa?2048:0);this.uc=this.sc=this.hb=0;this.I=null;this.wb=[];this.Yb=this.Mc=this.se;this.Zb=this.ic=this.ue;this.jc=this.lc=this.Of;this.$b=this.mc=this.Qf;this.xa=this.Xb=0;this.oa=this.pd;this.W=this.td;this.rb=this.wd;this.h=this.f=this.bc=this.K=this.R=0;this.j.complete=!1}n(dd,Rc);h=dd.prototype;h.ha=function(a,b,c,d){Rc.prototype.ha.call(this,a,b,c,d);this.Mc=b.xd.bind(b);this.ic=b.Kb.bind(b);this.lc=b.yd.bind(b);this.mc=b.Lb.bind(b)};
|
||||
h.ja=function(a,b){for(var c=192,d=0;d<this.wb.length;d++){var e=this.wb[d];0>e.Ib&&(e.Ib=c,c+=4)}return Rc.prototype.ja.call(this,a,b)};
|
||||
h.reset=function(){this.status("Model "+this.pa);this.j.L&&F(this);this.v=65536;this.l=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Wc,-1,-2,-3,-4,-5,-6,-7,-8];this.sa=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.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],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,
|
||||
65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.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];this.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Ba=-1;this.h=this.f=this.bc=this.K=this.R=this.g=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.bb=0;a.Pa=0;a.Qa=0;a.Wa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))}
|
||||
function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.bb?(a.xa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.pd,a.W=a.td,a.rb=a.wd,ac(a.u,a.qa&16?22:18)):(a.xa=0,a.Xb=57344,a.oa=a.te,a.W=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.bb!=c&&(a.bb=c,gd(a))}}
|
||||
function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.O?a.j.L||Gb(a):a.j.Y=!0}else a.F&&a.j.O?F(a)||(a.F.g(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.na&&a.na.stop()}h.od=function(){return 0};
|
||||
h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.g,this.C,this.Ba,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.Y]);a.set(3,jd(this));a.set(4,bd(this));return a.data()};
|
||||
h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.g=b.next().value;this.C=b.next().value;this.Ba=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]);
|
||||
this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.Y=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.wb.length;d++){var e=this.wb[d];if(e.Ib===b[c]){d=e;break a}}d=null}d&&(d.next=this.I,this.I=d)}a=a[4];for(b=0;b<this.X.length&&b<a.length;b++)this.X[b][0]=a[b];return!0};function kd(a){return a.v&65536?1:0}function ld(a){return a.w&32768?8:0}function md(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}
|
||||
function N(a,b,c){c&&(id(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function qc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}
|
||||
function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.g&64?(I(a,168,64,-6),!0):a.g&32?(I(a,4,32,-5),!0):a.g&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.g&=-3;a.g|=a.I?2:1}
|
||||
h.ea=function(a){this.w=this.o=a;this.l=0};h.La=function(a,b){this.w=this.o=this.v=a;this.l=b||0};function od(a,b){a.w=a.o=a.v=b;a.l=a.w^a.v>>1}function pd(a,b,c,d){a.w=a.o=a.v=b;a.l=(c^d)&(d^b)}
|
||||
function I(a,b,c,d){if(!a.hb){0>a.Ba?a.Ba=zc(a):a.B||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.D|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.W(b|a.xa),f=a.W(b+2&65535|a.xa);Ac(a,f&-12289|a.Ba>>2&12288);qd(a,a.Ba);qd(a,a.b[7]);id(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Ba=-1;a.sc=d;a.uc=b;-1==d&&F(a);if(-4<=d)throw b;}}function rd(a){var b=sd(a),c=sd(a);a.i&49152&&(c=c&-225|a.i&63712);id(a,b);Ac(a,c);a.g&=-17}
|
||||
function td(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ja[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||
function Nb(a,b,c){var d,e,f;if(!(c&a.bb))return f=b&65535,57344<=f&&(f|=a.Xb),f;d=b>>13;a.qa&a.ge[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.Wa;3932160<=f&&(f=td(a,f));if(a.hb)return f;f>=a.Vc&&f<a.Xb?(a.D|=32,I(a,4,0,f)):f&1&&!(c&1)&&(a.D|=64,I(a,4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&
|
||||
(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.Wa)||a.B)a.Pa=a.B,a.Qa=d;g&&(g&57344&&(0<=a.Ba&&(g|=128),a.J&57344||(g|=a.J&4096|a.Pa<<5|a.Qa<<1,vc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.Wa)||f>(4194239&a.Wa))||(a.J|=4096,a.J&512&&(a.g|=64)));return f}function sd(a){var b=a.W(a.b[6]|a.xa);a.b[6]=a.b[6]+2&65535;return b}function qd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.g&256||a.Za(4,-2,c);a.rb(c,b)}
|
||||
function ud(a,b,c,d){var e,f,g=d&8?0:a.xa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.Za(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Za(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Za(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(md(a,2)),e=e+a.b[c]&65535,6==c&&a.Za(d,0,
|
||||
e),a.a-=6,e|g;case 7:return e=a.W(md(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.xa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.pe=function(a,b,c){!this.B&&0>=b&&c<=this.Ia&&(this.g|=32)};h.qe=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Ia&&(c<=this.Ia-32?I(this,4,0,-4):(this.D|=8,this.g|=32)))};h.se=function(a){return this.Mc(a)};h.ue=function(a){return this.ic(a)};h.Of=function(a,b){this.lc(a,b)};h.Qf=function(a,b){this.mc(a,b)};
|
||||
h.te=function(a,b,c){return ud(this,a,b,c)};h.pd=function(a,b,c){return Nb(this,ud(this,a,b,c),c)};h.Gf=function(a){return this.u.Kb(this.Ea=a)};h.td=function(a){return this.u.Kb(this.Ea=Nb(this,a,2))};h.Rg=function(a,b){this.u.Lb(this.Ea=a,b)};h.wd=function(a,b){this.u.Lb(this.Ea=Nb(this,a,4),b)};
|
||||
function vd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=ud(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.W(d|c&a.xa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.fa[a.i>>12&3];return c}function wd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=ud(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Nb(a,e|c&65536,4),a.B=a.i>>14&3,a.$b(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.fa[a.i>>12&3]=d}
|
||||
function xd(a,b){b>>=6;var c=a.R=b&7;return(b=a.K=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c+a.hc]&a.$c}function yd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.K=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d+a.hc];return c}function zd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return ud(a,b,c,8)}function Ad(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c]&255}function Bd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d];return c}
|
||||
function O(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.bc=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.jc(e,d.call(a,c,a.Yb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function P(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.$b(e,d.call(a,0>c?a.b[-c-1]:c,a.Zb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])}
|
||||
function Cd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.jc(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function Dd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.$b(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))}
|
||||
h.kc=function(a){this.j.complete=!0;var b=a?this.j.Ic?0:1:-1;this.j.Ic=!1;this.Ga=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.Sa&224)>>5,e=this.I&&this.I.kb>d?this.I:null;e&&(c=e.Ib,d=e.kb);d>(this.i&224)>>5?(this.g&8&&(md(this,2),this.g&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&tc(this,e),a=!0);this.I||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.g&112&&nd(this)){if(this.g&
|
||||
4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.C=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.Uc(e)}while(0<this.a);return this.j.complete?this.Ga-this.a:!1===this.j.complete?-1:0};Za(function(){for(var a=A(document,x,"cpu"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new dd(d);w(d,c)}});function Ed(a,b){var c=b+a;this.w=this.o=this.v=c;this.l=(a^c)&(b^c);return c&65535}
|
||||
function Fd(a,b){var c=b+a,d=c<<8;this.w=this.o=this.v=d;this.l=(a<<8^d)&(b<<8^d);return c&255}function Gd(a,b){a=b<<1;od(this,a);return a&65535}function Hd(a,b){a=b<<1;od(this,a<<8);return a&255}function Id(a,b){a=b&32768|b>>1|b<<16;od(this,a);return a&65535}function Jd(a,b){a=b&128|b>>1|b<<8;od(this,a<<8);return a&255}function Kd(a,b){a=b&~a;this.ea(a);return a}function Ld(a,b){a=b&~a;this.ea(a<<8);return a}function Md(a,b){a|=b;this.ea(a);return a}function Nd(a,b){a|=b;this.ea(a<<8);return a}
|
||||
function Od(a,b){a=~b|65536;this.La(a);return a&65535}function Pd(a,b){a=~b|256;this.La(a<<8);return a&255}function Qd(a,b){this.w=this.o=a=b-a;this.l=b&(b^a);return a&65535}function Rd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.l=b&(b^c);return a&255}function Sd(a,b){this.w=this.o=a=b+a;this.l=a&(b^a);return a&65535}function Td(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.l=c&(b<<8^c);return a&255}function Ud(a,b){a=-b;this.La(a,a&b&32768);return a&65535}
|
||||
function Vd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Wd(a,b){a=b<<1|this.v>>16&1;od(this,a);return a&65535}function Xd(a,b){a=b<<1|this.v>>16&1;od(this,a<<8);return a&255}function Yd(a,b){a=(this.v&65536|b)>>1|b<<16;od(this,a);return a&65535}function Zd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;od(this,a<<8);return a&255}function $d(a,b){var c=b-a;pd(this,c,a,b);return c&65535}function ae(a,b){var c=b-a;pd(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function be(a,b){this.w=this.o=b&65280;this.l=this.v=0;return(b<<8|b>>8)&65535}function ce(a,b){a^=b;this.ea(a);return a&65535}function de(a){P(this,a,yd(this,a),Ed);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
||||
function ee(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.l=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.v=c<<17-b,c>>=b;else if(b)if(16<b)this.l=c,c=0;else{this.v=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.l=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b}
|
||||
function fe(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.v=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.l=32768)):d=c;this.b[a]=d>>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function ge(a){N(this,a,!kd(this))}function he(a){N(this,a,kd(this))}
|
||||
function ie(a){P(this,a,yd(this,a),Kd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function je(a){O(this,a,xd(this,a),Ld);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ke(a){P(this,a,yd(this,a),Md);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function le(a){O(this,a,xd(this,a),Nd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
||||
function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ne(a){var b=xd(this,a);a=Ad(this,a);this.ea(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function oe(a){N(this,a,this.o&65535?0:4)}function pe(a){N(this,a,!ld(this)==!(this.l&32768))}function qe(a){N(this,a,!!(this.o&65535)&&!ld(this)==!(this.l&32768))}
|
||||
function re(a){N(this,a,!kd(this)&&!!(this.o&65535))}function se(a){N(this,a,(this.o&65535?0:4)||!ld(this)!=!(this.l&32768))}function te(a){N(this,a,kd(this)||(this.o&65535?0:4))}function ue(a){N(this,a,!ld(this)!=!(this.l&32768))}function ve(a){N(this,a,ld(this))}function we(a){N(this,a,!!(this.o&65535))}function xe(a){N(this,a,!ld(this))}function ye(){I(this,12,0,-9)}function ze(a){N(this,a,!0)}function Ae(a){N(this,a,!(this.l&32768))}function Be(a){N(this,a,this.l&32768?2:0)}
|
||||
function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
||||
function Ee(a){var b=Bd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.l=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.l=32768,this.v=65536,this.a-=7}function Fe(){I(this,24,0,-9);this.a-=20}
|
||||
function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.na&&1120==this.pa&&this.na.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.aa=this.a;id(this,zd(this,a));this.a=this.aa-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.aa=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.aa-Ke[this.h]}
|
||||
var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ne(a){var b=yd(this,a);this.aa=this.a;Dd(this,a,b,this.ea);this.a=this.aa-Me[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Pe=[7,13,13,17,14,18,17,21];
|
||||
function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767<b?65536:0;this.a-=23}function Re(){this.a-=5}function Se(){this.i&49152||(this.u.reset(),Eb(this),this.na&&this.na.setData(this.b[0],!0));this.a-=667}function Te(a){if(a&8)I(this,8,0,-9);else{var b=sd(this);a&=7;7==a?id(this,b):(id(this,this.b[a]),this.b[a]=b);this.a-=9}}function Ue(){rd(this);this.a-=13}
|
||||
function R(a){a&1&&(this.v=65536);a&2&&(this.l=32768);a&4&&(this.o=0);a&8&&(this.w=32768);this.a-=5}function Ve(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.f?2:0)}function Ye(){I(this,28,0,-9)}
|
||||
function Ze(){this.na&&(this.na.U=this.b[7],this.na.setData(this.b[0],!0));this.g|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.f?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)}function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)}
|
||||
function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)}
|
||||
var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)}],ef=[function(a){P(this,a,0,Ud);
|
||||
this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],uf=
|
||||
[function(a){vf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,S,hf,kf,Xe,Xe,Xe,Xe],vf=[Ge,Ze,Ue,ye,He,Se,S,S,S,S,S,S,S,S,S,S],jf=[Re,function(){this.v=0;this.a-=5},function(){this.l=0;this.a-=5},Q,function(){this.o=1;this.a-=5},Q,Q,Q,function(){this.w=0;this.a-=5},Q,Q,Q,Q,Q,Q,Q],lf=[Re,function(){this.v=65536;this.a-=5},function(){this.l=32768;this.a-=5},R,function(){this.o=0;this.a-=5},R,R,R,function(){this.w=32768;this.a-=5},R,R,R,R,R,R,R],tf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,S,S,S],nf=[function(a){Cd(this,
|
||||
a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+
|
||||
(7==this.f?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.f?2:0)}];function fd(a){wf[a>>12].call(this,a)}
|
||||
var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.xa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);
|
||||
this.aa=this.a;this.ea(b);wd(this,a,0,b);this.a=this.aa-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.f?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.g|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe,
|
||||
$e,$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.aa=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.aa-Pe[this.h]},function(){I(this,8,0,-9)}];
|
||||
function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.l=Fa(this.g);if(this.g){a=this.g;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.g=null);Ff(c)})}}n(Ef,q);
|
||||
h=Ef.prototype;h.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Ff(this)};h.ja=function(){this.ga&&(this.F&&this.F.a(this.id,this.h,this.a,this.ga),delete this.ga);return!0};h.ia=function(){return!0};
|
||||
function Ff(a){if(!Aa(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Ea(a.b.length,8,!0)+") does not match specified size ("+Ea(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Tb){var c={},c=(c[b]=[Ef.prototype.sf,Ef.prototype.Bg,null,null,null,a.a>>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c<a.b.length;c++)hc(a.u,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];
|
||||
"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.u,g=d.a,k=[],l=d.h>>>f.h;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.g;f=d.u;d=d.a;g=0;for(e>>>=f.h;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.g}}a.i||delete a.b}}}B(a)}}h.sf=function(a){return this.b[a-this.h]};h.Bg=function(){};Za(function(){for(var a=A(document,x,"rom"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Ef(d);w(d,c)}});
|
||||
function Gf(a){q.call(this,"RAM",a);this.ga=this.b=null;this.f=+a.addr;this.g=+a.size;this.ca=a.load;this.ba=a.exec;null!=this.ca&&(this.ca=+this.ca);null!=this.ba&&(this.ba=+this.ba);this.h=!1;this.a=a.file;this.i=Fa(this.a);if(this.a){a=this.a;var b=Ga(this.i);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga,
|
||||
null==c.ca&&(c.ca=a.ca),null==c.ba&&(c.ba=a.ba)):c.a=null);Hf(c)})}}n(Gf,q);Gf.prototype.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Hf(this)};Gf.prototype.ja=function(a,b){this.ga&&(this.F&&this.F.a(this.id,this.f,this.g,this.ga),delete this.ga);b||this.reset();return!0};Gf.prototype.ia=function(){return!0};
|
||||
function Hf(a){if(a.u&&(!a.h&&a.g&&(Zb(a.u,a.f,a.g,jc)?a.h=!0:a.g=0),!Aa(a))){if(!a.h)u("No RAM allocated");else if(a.a){if(!a.b||!a.u)return;If(a,a.b,a.ca,a.ba,a.f)?a.status('Loaded image "'+a.i+'"'):a.G('Error loading image "'+a.i+'"')}B(a)}}
|
||||
Gf.prototype.reset=function(){if(this.h){for(var a=this.u,b=this.f,c=this.g,d=b&a.f,b=b>>>a.h;0<c&&b<a.a.length;){var e=a.a[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(gb&&e.a)for(k=d;f--&&k<e.a.length;k++)e.a[k]=g;else for(k=d;f--&&k<e.size;k++)e.m(d,g,e.Ua+d);c-=a.g;b++;d=0}this.b&&If(this,this.b,this.ca,this.ba,this.f,!0)}};
|
||||
function If(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),z=l,y=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)hc(a.u,t++,b[z++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
|
||||
b.length;e++)hc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&hd(a.c,d,f)}return k}Za(function(){for(var a=A(document,x,"ram"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Gf(d);w(d,c)}});function Jf(a){q.call(this,"Keyboard",a,1024);B(this)}n(Jf,q);Jf.prototype.ka=function(){return!1};Jf.prototype.ha=function(a,b,c,d){this.A=a;this.c=c;this.F=d};Za(function(){for(var a=A(document,x,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Jf(d);w(d,c)}});
|
||||
function T(a){q.call(this,"SerialPort",a,262144);this.B=+a.adapter;this.J=+a.baudReceive||9600;this.aa=+a.baudTransmit||9600;this.w=a.upperCase;"string"==typeof this.w&&(this.w="true"==this.w);this.h=this.i=null;this.R=+a.tabSize;this.K=+a.charBOL;this.l=0;this.v=!0;this.H=this.C=null;this.I=this.X=-1;this.o=this.a=this.b=0;this.f=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=Kf;b&&(void 0===c&&(c="Panel"),(c=za(c,this.id))&&(b=c.m[b])&&this.ka(null,a,b))}this.g=this.s=this.D=null;this.exports=
|
||||
{connect:this.qd,receiveData:this.ac,receiveStatus:this.Lf,setConnection:this.Pf}}n(T,q);h=T.prototype;
|
||||
h.ka=function(a,b,c){var d=this;switch(b){case Kf:return this.m[b]=this.h=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?sa.Oc:sa.Dd:46==c?b=sa.Oc:a.ctrlKey&&c>=sa.Nc&&c<=sa.le&&(b=c-(sa.Nc-sa.Ad));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Cd&&(b=sa.Bd);d.ac(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.ac(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;var e=this;this.H=qc(this.c,this.B?-1:48,4,262144);this.I=nc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),pc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&oc(c,e.H))});this.C=qc(this.c,this.B?-1:52,4,262144);this.X=nc(this.c,function(){e.b|=128;e.b&64&&oc(c,e.C)});qb(b,this,Lf,this.B?64832+8*(this.B-1)-65392:0);sb(b,this.reset.bind(this));B(this)};
|
||||
h.qd=function(a){if(!this.g){var b=Tc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ka(c[0]);if(d!=this.$a)return;c=Ka(c[1]);if(this.g=ya(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.v);if(this.s=e.receiveData){this.v=a;this.D=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ja=function(a,b){if(!b)if(this.qd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){var a=new E(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Mf(this,a[0])};function Mf(a,b){b||(b=[0,8192,128,a.f]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0}
|
||||
h.ac=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.f.push(b)}else this.f=this.f.concat(a);pc(this.c,this.I,1E3/Math.round(this.J/10));return!0};h.Lf=function(a){var b=this.a;this.a&=-12289;a&32&&(this.a|=8192);a&256&&(this.a|=4096);b!=this.a&&(this.a|=32768,this.a&32&&oc(this.c,this.H))};h.Pf=function(a,b){return this.g?!1:(this.g=a,this.s=b,!0)};
|
||||
h.df=function(){var a=this.a&65534;this.a&=-32769;return a};h.og=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.D&&b&6&&(b=0,b=this.v?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.D.call(this.g,b))};h.cf=function(){this.a&=-129;return this.o};h.ng=function(){};h.Kf=function(){return this.b};h.Tg=function(a){if(this.b&128)if(a&64)oc(this.c,this.C);else{var b=this.C;b&&tc(this.c,b)}this.b=this.b&-70|a&69};h.Jf=function(){return 0};
|
||||
h.Sg=function(a){a&=255;this.s&&this.s.call(this.g,a);a&=127;if(this.h)if(13==a)this.l=0;else if(8==a)this.h.value=this.h.value.slice(0,-1),0<this.l&&this.l--;else{if(a){var b;13!=a&&10!=a&&(b=Ma[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!=
|
||||
this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}pc(this.c,this.X,1E3/Math.round(this.aa/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf);
|
||||
Za(function(){for(var a=A(document,x,"serial"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new T(d);w(d,c)}});function Bc(a){q.call(this,"PC11",a);this.B=Of(this,a.autoMount);this.b=0;this.I=+a.baudReceive||3600;this.l=this.o=this.a=0;this.i=[];this.h=Pf;this.f=Qf;this.w=this.g="";this.M=this.ca=this.ba=null;this.D=-1;this.C=!Va("Mobi")&&window&&"FileReader"in window;this.s=null;this.H=-1;this.v=null}n(Bc,q);
|
||||
function Of(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Bc.prototype;
|
||||
h.ka=function(a,b,c){var d=this,e=Qf;switch(b){case "listTapes":return this.m[b]=c,c.onchange=function(){var a=d.m.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){u("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.m[b]=c,!0;case "readTape":e=Rf;case "loadTape":return e||(e=Sf),this.m[b]=c,c.onclick=
|
||||
function(){var a=d.m.listTapes;a&&Tf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.m[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;Tf(d,Fa(b,!0),b,Sf,a)}return!1};return!0;case Uf:return this.m[b]=c,!0}return!1};
|
||||
h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;this.v=Vf(a);var e=this;if(a=Of(this,Tc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.B[f]=a[f]);this.s=qc(this.c,56,4,4096);this.H=nc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.l<e.i.length&&(e.o=e.i[e.l++]&255,Wf(e,e.l/e.i.length*100),e.a|=128,e.a&=-2049,e.a&64&&oc(e.c,e.s))});qb(b,this,Xf);sb(b,this.reset.bind(this));Yf(this,"None",Pf,!0);this.C&&Yf(this,"Local Tape",Zf);Yf(this,"Remote Tape",$f);ag(this)||B(this)};
|
||||
h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a&=-2241;this.o=0};function ag(a){a.b=0;var b=a.B.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.m.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=Fa(c,!0)}c&&b?bg(a,b,c,Sf,!0):cg(a)}return!!a.b}
|
||||
function Tf(a,b,c,d,e){if(c)if(c==Zf)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==$f){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.h=$f}else a.h=c;bg(a,b,c,d,!1,e)}else dg(a,!1)}function bg(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,dg(a,!0),a.j.Va?a.G("PC11 busy"):(e&&a.b++,eg(a,b,c,d,f)?g++:a.j.Va=!0);g&&fg(a,a.w,a.g,a.f,a.M,a.ca,a.ba)}
|
||||
function eg(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),fg(a,b,c,d,e),a.h=Zf);cg(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.ca,e.ba));
|
||||
a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function cg(a){var b=a.m.listTapes;if(b&&b.options){a=a.h||a.g;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
|
||||
function Wf(a,b){b|=0;if(b!==a.D){var c=a.m[Uf];c&&(c=(c=A(c,gg))&&c[0])&&c.style&&(c.style.width=b+"%");a.D=b}}function fg(a,b,c,d,e,f,g){a.w=b;a.g=c;a.f=d;a.M=e;a.ca=f;a.ba=g;d==Rf?a.v&&If(a.v,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.G('No valid memory address for tape "'+b+'"'):(a.l=0,a.i=e,a.status('Loaded tape "'+b+'"'),Wf(a,0))}function dg(a,b){if(a.g||!1===b)a.w="",a.g="",b||(a.f&&a.status(a.f==Sf?"tape detached":"tape unloaded"),a.h=Pf,a.f=Qf,cg(a))}h.save=function(){return(new E(this)).data()};
|
||||
h.restore=function(){return!0};h.Xe=function(){return this.a&65534};h.hg=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&oc(this.c,this.s)):(this.a&=-129,this.a|=2048,this.o=0,pc(this.c,this.H,1E3/Math.round(this.I/10))));this.a=this.a&-66|a&65};h.We=function(){this.a&=-129;this.a|=2048;return this.o};h.gg=function(){};
|
||||
var Pf="",Zf="?",$f="??",Qf=0,Sf=1,Rf=2,Uf="readProgress",gg="pcjs-progress-bar",hg={},Xf=(hg[65384]=[null,null,Bc.prototype.Xe,Bc.prototype.hg,"PRS"],hg[65386]=[null,null,Bc.prototype.We,Bc.prototype.gg,"PRB"],hg);
|
||||
function ig(a,b,c){q.call(this,"Disk",{id:a.Na+".disk"+Ea(++jg,4)},8192);this.controller=a;this.A=a.A;this.F=a.F;this.h=b;this.ua=b.name;this.ma=this.Gc="";this.Dc=b.Dc;this.N=this.T=this.P=this.da=this.mode=0;this.a=[];this.f=null;this.g=!1;kg(this,c,b.N,b.T,b.P,b.da);this.b=this.i=null;B(this)}n(ig,q);h=ig.prototype;h.ha=function(a,b,c,d){this.F=d};
|
||||
function kg(a,b,c,d,e,f){a.mode=b;a.N=c;a.T=d;a.P=e;a.da=f;a.a=[];if("preload"!=a.mode){b=Array(a.N);for(c=0;c<b.length;c++){d=Array(a.T);for(e=0;e<d.length;e++){f=Array(a.P);for(var g=1;g<=f.length;g++)f[g-1]=lg(null,c,e,g,a.da,0);d[e]=f}b[c]=d}a.a=b}a.f=null}
|
||||
function mg(a,b,c,d,e){var f=c;if(a.b)return!0;a.ua=b;a.ma=c;a.Gc=Fa(c);a.b=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ra[d];if(e){a.N=e[0];a.T=e[1];a.P=e[2];a.da=e[3]||512;c=a.da>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;d<a.a.length;d++)for(var z=a.a[d]=Array(a.T),y=0;y<z.length;y++)for(var fa=z[y]=Array(a.P),La=0;La<fa.length;La++){for(var rc=lg(null,d,y,La+1,a.da,0),gh=rc.data,Kc=0;Kc<c;Kc++,f+=4)var hh=gh[Kc]=b.getInt32(f,
|
||||
!0),e=e+hh&-1;rc.la=c;fa[La]=rc}a.f=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.ua,a.ma),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=Ga(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"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f,
|
||||
null,!0,function(b,c,d){ng(a,b,c,d)})}
|
||||
function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.O;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0<Fa(a.Gc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ua]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.P=k[0][0].length;var l=k[0][0][0];a.da=l&&l.length||512;for(d=c=0;d<a.N;d++)for(f=0;f<a.T;f++)for(g=0;g<a.P;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa<y;fa++)z[fa]=p;og(l,z)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}lg(l,d,f);for(y=
|
||||
0;y<t.length;y++)c=c+t[y]&-1}a.a=k;a.f=c;e=a}else u("Empty disk image: "+a.ua)}catch(La){u("Disk image error ("+b+"): "+La.message)}}a.b&&(a.b.call(a.i,a.h,e,a.ua,a.ma),a.b=null)}function lg(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Li=b;a.Mi=c;a.ta=a.la=0;a.Ca=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.h,g=this.a[a];if(g){var k=g[b];if(!k&&f.ne&&b<f.T)for(k=g[b]=Array(f.oe),g=0;g<k.length;g++)k[g]=lg(null,a,b,g+1,f.rd,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.ne&&9==f.ld&&(d=k[g]=lg(null,a,b,f.ld,f.rd,0))}}e&&e(d,!1);return d};function og(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f<a.ta?(a.la+=a.ta-f,a.ta=f):f>=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function pg(a,b){var c=a.T*a.P,d=b/c|0;return d<a.N?(b%=c,a.seek(d,b/a.P|0,b%a.P+1)):null}function qg(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.ma,this.f,this.N,this.T,this.P,this.da];if(!this.g)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.la){for(var k=[],l=0,m=g.ta,p=g.ta+g.la;m<p;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.ta,k]}}return b};
|
||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?kg(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.ta=e;for(k.la=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.ua+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=pg(this,a++);)rg(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 rg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var jg=0;function sg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=tg(this,b.autoMount);this.s=0;this.D=d;this.H=e;this.I=f;this.C=d.Pc;this.b=Array(this.C);this.B=!Va("Mobi")&&window&&"FileReader"in window;this.h=[];this.jb=null;this.exports={selectDrive:this.Nf}}n(sg,q);
|
||||
function tg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=sg.prototype;
|
||||
h.ka=function(a,b,c){var d=this;switch(b){case "listDisks":return this.m[b]=c,c.onchange=function(){var a=d.m.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.m[b]=c,c.onchange=function(){var a=Ca(c.value);null!=a&&ug(d,
|
||||
a)},!0;case "loadDisk":return this.m[b]=c,c.onclick=function(){var a=d.m.listDisks;a&&a.options&&vg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.m[b]=c,c.onclick=function(){var a,b=d.m.listDrives,b=b&&Ca(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.G("Unable to boot the selected drive"):a.V?(hd(d.c,0,!0),(a=d.Gb(a,0,0,0,512,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.B){c.parentNode.removeChild(c);
|
||||
break}this.m[b]=c;c.onclick=function(){var a=d.m.listDrives;if(a&&a.options&&d.b)if(a=d.b[Ca(a.value)||0])if(a=a.V){var b;b="";for(var c=0,k;k=pg(a,c++);)for(var l=0,m=k.length;l<m;l++)b+=String.fromCharCode(qg(a,k,l));b=btoa(b);a=a.Gc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+
|
||||
a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");u(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDisk":if(this.B)return this.m[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;vg(d,Fa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;if(a=tg(this,Tc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);this.reset();this.jb=qc(this.c,this.D.jd,this.D.ad,this.Xc);qb(b,this,this.I);sb(b,this.reset.bind(this));wg(this,"None",xg,!0);this.B&&wg(this,"Local Disk",yg);wg(this,"Remote Disk",zg);Ag(this)||B(this)};
|
||||
h.ja=function(a,b){if(!b){if(!a){if(this.reset(),this.A.B){this.h=[];for(a=0;a<this.b.length;a++)Bg(this,a,!0);Ag(this,!0)}}else if(!this.restore(a))return!1;if(a=this.m.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;b<this.C;b++){var c=document.createElement("option");c.value=b;c.text=this.type.substr(0,2)+b;a.appendChild(c)}0<this.C&&(a.value="0",ug(this,0))}}return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.Wb();Cg(this)};
|
||||
h.save=function(){var a=new E(this);a.set(0,this.Hc());a.set(1,Dg(this));a.set(2,Eg(this));return a.data()};h.restore=function(a){var b=!0;this.Wb(a[0])||(b=!1);var c=a[1];c&&(this.h=c);Cg(this,a[2])||(b=!1);return b};h.Wb=function(){return!0};h.Hc=function(){return[]};
|
||||
function Cg(a,b){for(var c=0;c<a.b.length;c++){var d=a.b[c];void 0===d&&(d=a.b[c]={});var e=a,f=d,d=c,g=a.H,k=b&&b[c];f.Vb=d;f.name=e.$a;f.Cc=f.ib=!1;f.Dc=!0;f.N=g[0];f.T=g[1];f.P=g[2];f.da=g[3];f.status=g[4];f.Fi=0;f.Ei=0;f.ld=1;f.oe=f.P;f.rd=f.da;f.Ni=0;f.Ti=null;f.V||(f.ma="");if(k){var l=k[1],g=k[2];k[0]?(f=l,k=e.b[d],Bg(e,d,!0),k.ib=!0,d=new ig(e,k,"preload"),e.nd(k,d,f,g,!0)):Fg(e,d,l,g,!0)?f.V&&g&&Gg(e,l,g,f.V):B(e,!1)}}return!0}
|
||||
function Eg(a){for(var b=[],c=0;c<a.b.length;c++){var d=a.b[c];b.push([d.ib,d.ua,d.ma])}return b}function Dg(a){for(var b=0;b<a.b.length;b++){var c=a.b[b];c.V&&Hg(a,c.ma,c.V)}return a.h}
|
||||
function Ag(a,b){b||(a.s=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.m.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=Fa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Fg(a,g,f,e,!0)&&b&&B(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
|
||||
function vg(a,b,c,d){var e=a.m.listDrives,e=e&&Ca(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Fg(a,e,b,c,!1,d)}else Bg(a,e)}
|
||||
function Fg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.ma.toLowerCase()!=d.toLowerCase()&&(g++,Bg(a,b,!0),k.Cc?a.G(a.type+" busy"):(k.Cc=!0,e&&(k.Bc=!0,a.s++),k.ib=!!f,mg(new ig(a,k,"preload"),c,d,f,a.nd)&&g++));return g}
|
||||
h.nd=function(a,b,c,d,e){a.Cc=!1;b&&(b.N>a.N||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Vb)),b=null);b?(a.V=b,a.ua=c,a.ma=d,Gg(this,c,d,b),this.G('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.Vb),a.Bc||e),this.A&&$c(this.A)):a.ib=!1;a.Bc&&(a.Bc=!1,--this.s||B(this));ug(this,a.Vb)};
|
||||
function wg(a,b,c,d){if((a=a.m.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function ug(a,b,c){var d=!1;if(0<=b&&b<a.b.length){var e=a.b[b],f=a.m.listDisks;a=a.m.listDrives;if(f&&a&&f.options&&a.options){if(c)for(c=0;c<a.options.length;c++)if(Ca(a.options[c].value)==e.Vb){a.selectedIndex!=c&&(a.selectedIndex=c);d=!0;break}c=Ca(a.value);e=e.ib?yg:e.ma;if(!isNaN(c)&&c==b){for(c=0;c<f.options.length;c++)if(f.options[c].value==e){f.selectedIndex!=c&&(f.selectedIndex=c);d=!0;break}c==f.options.length&&(f.selectedIndex=0)}}}return d}
|
||||
h.Nf=function(a){var b=this.m.listDrives;if(b&&b.options)for(var c=b.options.length,d=0;d<c;d++)if(b.options[d].innerHTML==a){var e=Ca(b.options[d].value);if(0<=e)return ug(this,e,!0)}return!1};function Bg(a,b,c){var d=a.b[b];if(d.V||!1===c)Hg(a,d.ma,d.V),d.ua="",d.ma="",d.V=null,d.ib=!1,c||(a.G("Drive "+(a.type.substr(0,2)+b)+" unloaded",c),ug(a,b))}function Gg(a,b,c,d){var e;for(e=0;e<a.h.length;e++)if(a.h[e][1]==c){d.restore(a.h[e][2]);return}a.h[e]=[b,c,[]]}
|
||||
function Hg(a,b,c){var d;for(d=0;d<a.h.length;d++)if(a.h[d][1]==b){a.h[d][2]=c.save();break}}h.Gb=function(){return!1};h.gc=function(){return!1};var xg="",yg="?",zg="??";function M(a){sg.call(this,"RK11",a,65536,C,C.Ob,Ig);this.v=this.f=this.a=this.l=this.i=this.g=this.o=0}n(M,sg);h=M.prototype;
|
||||
h.Wb=function(a){a||(a=[Jg.Ob|Jg.hd|Jg.dd,0,U.wa,0,0,0,0]);a=ja(a);this.v=a.next().value;this.f=a.next().value;this.a=a.next().value;this.l=a.next().value;this.i=a.next().value;this.g=a.next().value;this.o=a.next().value;return!0};h.Hc=function(){return[this.v,this.f,this.a,this.l,this.i,this.g,this.o]};
|
||||
h.Gb=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Rd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Ya|f>>16-U.S.Ya&U.Ya;this.l=65536-e&65535;this.g=this.g&~W.xc|d&W.xc;this.f|=a;Kg(this);return!0};function Kg(a){a.a&=~U.tb;a.f&&(a.f|=V.Fd,a.a|=U.tb,a.f&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.f};h.ug=function(){};h.ff=function(){return this.a&U.wc};
|
||||
h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.g&W.Ma)>>W.S.Ma,e=this.b[d],f,g,k,l,m,p;this.a&=~(U.wa|U.yc);this.f&=~V.be;switch(c=this.a&U.ra){case Lg.zd:this.f=this.g=0;this.a=U.wa;break;case Lg.Nd:case Lg.Pd:b=this.Gb;case Lg.zc:case Lg.ke:b||(b=this.gc);f=(this.g&W.sb)>>W.S.sb;g=(this.g&W.rc)>>W.S.rc;k=this.g&W.xc;l=65536-this.l&65535;m=(this.a&U.Ya)<<16-U.S.Ya|this.i;p=this.a&U.Ld?0:2;if(f>=e.N){this.f|=V.Mb;break}if(k>=e.P){this.f|=V.Nb;break}a=b.call(this,
|
||||
e,f,g,k,l,m,p,c>=Lg.zc,this.Rd.bind(this));break;case Lg.Sb:f=(this.g&W.sb)>>W.S.sb;f<e.N?this.a|=U.yc:this.f|=V.Mb;break;case Lg.Gd:this.f=this.g=0,this.a=U.wa|U.yc}this.v=e.status|(e.V?Jg.Xa:0)|d<<Jg.S.Tc|this.g&Jg.ae;Kg(this);a&&(this.a&=~U.Rc,this.a|=U.wa,this.a&U.tc&&oc(this.c,this.jb))}};h.lf=function(){return this.l};h.vg=function(a){this.l=a};h.ef=function(){return this.i};h.pg=function(a){this.i=a};h.gf=function(){return this.g};h.rg=function(a){this.g=a};h.hf=function(){return this.o};
|
||||
h.sg=function(a){this.o=a};var Jg=C.Pb,V=C.Ud,U=C.Sd,W=C.Td,Lg=C.ra,Mg={},Ig=(Mg[65280]=[null,null,M.prototype.jf,M.prototype.tg,"RKDS"],Mg[65282]=[null,null,M.prototype.kf,M.prototype.ug,"RKER"],Mg[65284]=[null,null,M.prototype.ff,M.prototype.qg,"RKCS"],Mg[65286]=[null,null,M.prototype.lf,M.prototype.vg,"RKWC"],Mg[65288]=[null,null,M.prototype.ef,M.prototype.pg,"RKBA"],Mg[65290]=[null,null,M.prototype.gf,M.prototype.rg,"RKDA"],Mg[65294]=[null,null,M.prototype.hf,M.prototype.sg,"RKDB"],Mg);
|
||||
function L(a){sg.call(this,"RL11",a,131072,D,D.Vd,Ng);this.a=this.o=this.f=this.g=this.l=this.i=0}n(L,sg);h=L.prototype;h.Wb=function(a){a||(a=[X.Xa|X.wa,0,0,0,0,0]);a=ja(a);this.a=a.next().value;this.o=a.next().value;this.f=a.next().value;this.g=a.next().value;this.l=a.next().value;this.i=a.next().value;return!0};h.Hc=function(){return[this.a,this.o,this.f,this.g,this.l,this.i]};
|
||||
h.Gb=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){if(!k){k=a.seek(b,c,d+1);if(!k){g=Y.ya;break}m=0}var p,t;if(0>(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.ya;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.da&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.ya;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.ya;break}if(m>=a.da&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.Wd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.va|f>>16-X.S.va&X.va;this.i=f>>16&Og.vc;this.g=this.f=b<<Z.S.vb|(c?Z.Rb:0)|d&Z.ed;this.l=65536-e&65535;a&&(this.a=this.a|a|X.tb);return!0};h.pf=function(){return this.a&X.wc};
|
||||
h.yg=function(a){this.a=this.a&~X.Ta|a&X.Ta;this.i=this.i&60|(a&X.va)>>X.S.va;if(!(this.a&X.wa)){a=!0;var b,c=this.b[(this.a&X.Ma)>>X.S.Ma],d=c.V,e,f,g;this.a&=~X.Xa;switch(this.a&X.ra){case Pg.fe:this.l&Qg.Sc&&(this.a&=X.Xa|X.ra|X.va);this.l=c.status|this.g&Z.Rb|(d&&512==d.N?Qg.Id:0);break;case Pg.Sb:(this.f&Z.Hd)==Z.ce&&(b=this.f&Z.vb,c=(this.f&Z.ee)<<2,this.g=this.f&Z.de?this.g+b:this.g-b,this.f=this.g=this.g&Z.vb|c);break;case Pg.Qd:this.l=this.g;break;case Pg.Od:b=this.Gb;case Pg.je:b||(b=this.gc),
|
||||
e=this.f>>Z.S.vb,f=this.f&Z.Rb?1:0,g=this.f&Z.ed,!d||e>=d.N||g>=d.P?this.a=this.a|Y.ya|X.tb:(a=65536-this.l&65535,d=(this.i&Og.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Wd.bind(this)))}a&&(this.a=this.a|X.Xa|X.wa,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Rg.Ta};h.qf=function(){return this.f};h.zg=function(a){this.f=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i};
|
||||
h.xg=function(a){this.i=a&Og.vc;this.a=this.a&~X.va|(this.i&3)<<X.S.va};var X=D.Zd,Rg=D.Xd,Z=D.$d,Qg=D.Qb,Og=D.Yd,Y=D.Qc,Pg=D.ra,Sg={},Ng=(Sg[63744]=[null,null,L.prototype.pf,L.prototype.yg,"RLCS"],Sg[63746]=[null,null,L.prototype.mf,L.prototype.wg,"RLBA"],Sg[63748]=[null,null,L.prototype.qf,L.prototype.zg,"RLDA"],Sg[63750]=[null,null,L.prototype.rf,L.prototype.Ag,"RLMP"],Sg[63752]=[null,null,L.prototype.nf,L.prototype.xg,"RLBE"],Sg);
|
||||
function Tg(a,b,c){q.call(this,"Computer",a,33554432);this.j.O=!1;this.D=null;Ug(this,b);this.w=Tc(this,"autoPower",a,6);this.g=0;this.J=+a.busWidth||+a.buswidth;this.s=this.i=this.v=null;this.o=this.I=!1;this.l=this.h=null;this.H=this.B=this.C=!1;this.K=Tc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Vg(this);if(this.c=za("CPU",this.id)){this.F=za("Debugger",this.id);this.u=new Sb({id:this.Na+".bus",busWidth:this.J},this.c,this.F);var d,e=xa(this.id);if((this.f=za("Panel",this.id))&&this.f.gb)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.G=this.f.G,d.Z=this.f.Z,d.gb=this.f.gb;this.Z(hb+" v1.33.1\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis <http://skn.noip.me/pdp11/pdp11.html>");for(b=0;b<e.length;b++)d=e[b],d.ha&&d.ha(this,this.u,this.c,this.F);b=null;d=Tc(this,"resume",a);void 0!==d&&(1<d.length?b=this.i=d:this.a=parseInt(d,10));var f;if(a=Tc(this,"state")||
|
||||
(f=!0,a.state))this.v=b=a,f||(this.o=!0,this.a=Wg),this.a&&(this.l=new E(this,"1.33.1"),Xg(this.l)?b=null:delete this.l);!b&&this.a&&(b=Yg(this))&&(this.o=!0);if(b){var g=this;Oa(b,null,!0,function(a,b,c){c?(g.i=null,g.o=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+Ka(b):"")+")")):(g.s=b,g.I=!0);B(g)})}else B(this);this.m.power||(this.w=!0);!c&&this.w&&Zg(this,this.Fb)}else u("Unable to find CPU component")}n(Tg,q);
|
||||
function Ug(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.D=b}function Tc(a,b,c,d){var e=b.toLowerCase(),e=Wa(b)||Wa(e);void 0===e&&a.D&&(e=a.D[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}
|
||||
function Zg(a,b,c){for(var d=xa(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Aa(f)){Aa(f,function(){Zg(a,b,c)});return}}b.call(a,c)}function $g(a,b){var c=new E(a,"1.33.1",ah);if(Xg(c)&&bh(c)){var d=c.get(ch),e=b?b.get(ch):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Tg.prototype;
|
||||
h.Fb=function(a){void 0===a&&(a=this.a||(this.s?dh:Wg));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.l||new E(this,"1.33.1");if(a==eh)b=!0;else if(a>Wg){if(Xg(d,this.s)){this.h=new E(this,"1.33.1",fh);Xg(this.h)&&(ih(this,d),a=jh,kh(this.h));this.h.set(ch,Na());lh(this.h);var e=this.a&&!this.o;if(a==dh||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=bh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xg(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(mh,""),this.b=null)):this.Z(f+": "+g),kh(d),Xg(d)?(c=bh(d),e=!0):c=!1))}e&&$g(this,c?d:null)}else a==jh&&d.clear()}else $g(this);delete this.s;delete this.l}e=xa(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=nh(this,g,d,b,c));b=[d,a,c];a!=eh?Zg(this,this.md,b):this.md(b)}};
|
||||
function nh(a,b,c,d,e){if(!b.j.O){b.j.O=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.ja(f,d)&&f&&(u("Unable to restore state for "+b.type),a.v&&!a.I?(c.clear(),a.a=Wg,window&&window.location.reload()):a.C=!0,b.ja(null),e=!1),!d&&b.Zc){var g=b.Zc.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){u("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
|
||||
h.md=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.j.O=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(nh(this,this.c,b,c,a),Kb(this,-2),this.c.Y());this.C&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
||||
function ih(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function oh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.33.1"),g=new E(a,"1.33.1",ah),k=Na();g.set(ch,k);f.set(ch,k);f.set(ph,"1.33.1");f.set(qh,window?window.location.href:null);f.set(rh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.Y=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.O=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l<k.length;l++){var m=k[l];m.j.O&&(m.ia&&(d=m.ia(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.j.O=
|
||||
!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.b&&sh(a,a.b,f.toString()),lh(g)&&lh(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==th),d&&f.clear(k)):e=f.toString());c&&(a.j.O=!1,b=a.m.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.u&&this.u.reset&&this.u.reset();this.c&&this.c.reset&&this.c.reset();for(var a=xa(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.u&&c!==this.c&&c.reset&&c.reset()}Kb(this,-1)};
|
||||
h.start=function(a,b){for(var c=xa(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}Kb(this,-1)};h.stop=function(a,b){for(var c=xa(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}Kb(this,-1)};
|
||||
function Kb(a,b){if(a.c){var c=a.c,d=b||0,e=c.m.speed;e&&(0>=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.f&&(a=a.f,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;e<a.c.b.length;e++)Ab(a,"R"+e,a.c.b[e]);e=zc(a.c);Ab(a,"PS",e);Ab(a,"NF",e&8?1:0,1);Ab(a,"ZF",e&4?1:0,1);Ab(a,"VF",e&2?1:0,1);Ab(a,"CF",e&1?1:0,1);a.i=0}-1>b?a.U=a.c.b[7]:0<b&&c&&!d&&(a.U=a.c.Ea);wb(a,a.U);nb(a,a.f);b=a.c;b=b.bb?b.qa&16?1:2:4;Pb(a,"B22",b&1);Pb(a,"B18",b&2);Pb(a,
|
||||
function Ub(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.h;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.g,p=a.g-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.ab)return l.Sb+=l.ab-f,l.ab=f,!0;if(f>=l.ab+l.Sb){p=l.size-(f-m);p>g&&(p=g);l.Sb=f-l.ab+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new G(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+xa(b)),!0):Yb(ac,b,c)}h.Nd=function(a){return this.b[(a&this.i)>>>this.h].tb(a&this.f,a)};
|
||||
h.Vb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return db||b!=this.f?this.b[c].W(b,a):this.b[c++].tb(b,a)|this.b[c&this.K].tb(0,a+1)<<8};h.Od=function(a,b){this.b[(a&this.i)>>>this.h].xb(a&this.f,b,a)};h.Wb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;db||c!=this.f?this.b[d].Ab(c,b,a):(this.b[d++].xb(c,b&255,a),this.b[d&this.K].xb(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.v)>>>a.h]}
|
||||
function Jb(a,b){var c;a.l=!1;a.m++;var d=b&a.f,e=bc(a,b);db||d!=a.f?c=e.D(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.l=!1;a.m++;bc(a,b).o(b&a.f,c&255,b);a.m--}function Hb(a,b,c){a.l=!1;a.m++;var d=b&a.f,e=bc(a,b);db||d!=a.f?e.m(d,c&65535,b):(e.o(d,c&255,b),bc(a,b+1).o(0,c>>8&255,b+1));a.m--}
|
||||
function Xb(a){for(var b=0,c=[],d=0;d<a.s;d++){var e=a.a[d];if(e.Ha||e.Oe){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;l[k++]=p-g;l[k++]=m;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function dc(a){for(var b=ec,c=0,d=0;d<a.a.length;d++){var e=a.a[d];e.type==b&&(c=e.ab+e.Sb)}return c}
|
||||
function fc(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&gc;if(void 0!==a.Qa[p])return u("I/O address already registered: "+ya(b,8,!0)),!1;var q=l||"unknown";q&&0<=m&&(q+=m++);a.Qa[p]=[d,e,f,g,q,k||16,!1]}return!0}
|
||||
function lb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.sa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var q=g[4],x=g[5]||1,A=0;A<x;A++,f+=2)if(q&&1<x&&(q=g[4]+A),!fc(a,f,f,k,l,m,p,g[7]||b.nd,q||b.ib))return!1}}return!0}
|
||||
function nb(a,b){a.F.push(b)}function H(a,b,c){a.l=!0;a.m||(c&&(a.c.F|=c),I(a.c,4,0,b))}function hc(a){var b=a.l;a.l=!1;return b}function Yb(a,b,c){u("Memory block error ("+a+": "+ya(b)+","+ya(c)+")");return!1}var Ob=8192,gc=Ob-1,Zb=1,ac=2;function Pb(a,b){var c=-1,d=this.controller,e=d.Qa[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.Qa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255}
|
||||
function Qb(a,b,c){var d=!1,e=this.controller,f=e.Qa[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.Qa[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||H(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Qa[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;H(d,b,16);return 65535}
|
||||
function Sb(a,b,c){var d=!1,e=this.controller;a=e.Qa[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||H(e,c,16)}function J(a){r.call(this,"Device",a,256);this.a={Ia:128,ad:-1}}n(J,r);h=J.prototype;h.ja=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.ad=ic(c,function(){e.a.Ia|=128;e.a.Ia&64&&K(e.c,e.a.qa);e.A&&Fb(e.A,1);jc(e.c,e.a.ad,1E3/60)});this.a.qa=kc(c,64,6,2097152);lb(b,this,lc);nb(b,this.reset.bind(this));B(this)};
|
||||
h.la=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){this.a.Ia=128;jc(this.c,this.a.ad,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Ia]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.Ia=a.next().value;return!0};h.qf=function(){return this.a.Ia};h.Fg=function(a){this.a.Ia=a&192;this.a.Ia&64||(a=this.a.qa)&&mc(this.c,a)};h.sf=function(){return nc(this.c)};
|
||||
h.Hg=function(a){oc(this.c,a&-129|this.c.J&128)};h.tf=function(){return pc(this.c)};h.uf=function(){return qc(this.c)};h.vf=function(){return this.c.ta};h.Ig=function(a){rc(this.c,a)};h.gg=function(a){a=a>>1&63;var b=this.c.Pa[a>>1];return a&1?b>>16:b&65535};h.uh=function(a,b){b=b>>1&63;var c=b>>1;this.c.Pa[c]=b&1?this.c.Pa[c]&65535|(a&63)<<16:this.c.Pa[c]&-65536|a&65534};h.$f=function(a){return this.c.s[1][a>>1&7]};h.nh=function(a,b){this.c.s[1][b>>1&7]=a&65295};
|
||||
h.Yf=function(a){return this.c.s[1][(a>>1&7)+8]};h.lh=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.Zf=function(a){return this.c.H[1][a>>1&7]};h.mh=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Xf=function(a){return this.c.H[1][(a>>1&7)+8]};h.kh=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.pf=function(a){return this.c.s[0][a>>1&7]};h.Eg=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.mf=function(a){return this.c.s[0][(a>>1&7)+8]};
|
||||
h.Cg=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.nf=function(a){return this.c.H[0][a>>1&7]};h.Dg=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.lf=function(a){return this.c.H[0][(a>>1&7)+8]};h.Bg=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.fg=function(a){return this.c.s[3][a>>1&7]};h.th=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.dg=function(a){return this.c.s[3][(a>>1&7)+8]};h.rh=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295};
|
||||
h.eg=function(a){return this.c.H[3][a>>1&7]};h.sh=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.cg=function(a){return this.c.H[3][(a>>1&7)+8]};h.qh=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.vb=function(a){a&=7;return this.c.i&2048?this.c.ua[a]:this.c.b[a]};h.yb=function(a,b){b&=7;this.c.i&2048?this.c.ua[b]=a:this.c.b[b]=a};h.Cf=function(){return this.c.i&49152?this.c.ga[0]:this.c.b[6]};h.Pg=function(a){this.c.i&49152?this.c.ga[0]=a:this.c.b[6]=a};
|
||||
h.Ff=function(){return this.c.b[7]};h.Sg=function(a){this.c.b[7]=a};h.wb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ua[a]};h.zb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ua[b]=a};h.Df=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ga[1]};h.Qg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ga[1]=a};h.Ef=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ga[3]};h.Rg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ga[3]=a};
|
||||
h.kf=function(a){return this.c.Qb[a-65504>>1]};h.Ag=function(a,b){this.c.Qb[b-65504>>1]=a};h.Id=function(a){return 65520==a?(dc(this.u)>>6)-1:0};h.Ld=function(){};h.bg=function(){return 1};h.ph=function(){};h.jf=function(){return this.c.F};h.zg=function(){this.c.F=0};h.rf=function(){return this.c.Nb};h.Gg=function(a,b){b&1||(a&=255);this.c.Nb=a};h.wf=function(a,b){return b?0:this.c.$a};h.Jg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.$a=a};
|
||||
h.ag=function(a,b){return b?0:this.c.Oa&65280};h.oh=function(a){this.c.Oa=a|255};h.Bf=function(){return sc(this.c)};h.Og=function(a){tc(this.c,a)};h.Kd=function(){};
|
||||
var L={},lc=(L[61568]=[null,null,J.prototype.gg,J.prototype.uh,"UNIMAP",64,1170],L[62592]=[null,null,J.prototype.$f,J.prototype.nh,"SIPDR",8,1145,64],L[62608]=[null,null,J.prototype.Yf,J.prototype.lh,"SDPDR",8,1145,64],L[62624]=[null,null,J.prototype.Zf,J.prototype.mh,"SIPAR",8,1145,64],L[62640]=[null,null,J.prototype.Xf,J.prototype.kh,"SDPAR",8,1145,64],L[62656]=[null,null,J.prototype.pf,J.prototype.Eg,"KIPDR",8,1140,64],L[62672]=[null,null,J.prototype.mf,J.prototype.Cg,"KDPDR",8,1145,64],L[62688]=
|
||||
[null,null,J.prototype.nf,J.prototype.Dg,"KIPAR",8,1140,64],L[62704]=[null,null,J.prototype.lf,J.prototype.Bg,"KDPAR",8,1145,64],L[62798]=[null,null,J.prototype.vf,J.prototype.Ig,"MMR3",1,1145,64],L[65382]=[null,null,J.prototype.qf,J.prototype.Fg,"LKS"],L[65402]=[null,null,J.prototype.sf,J.prototype.Hg,"MMR0",1,1140,64],L[65404]=[null,null,J.prototype.tf,J.prototype.Kd,"MMR1",1,1145,64],L[65406]=[null,null,J.prototype.uf,J.prototype.Kd,"MMR2",1,1140,64],L[65408]=[null,null,J.prototype.fg,J.prototype.th,
|
||||
"UIPDR",8,1140,64],L[65424]=[null,null,J.prototype.dg,J.prototype.rh,"UDPDR",8,1145,64],L[65440]=[null,null,J.prototype.eg,J.prototype.sh,"UIPAR",8,1140,64],L[65456]=[null,null,J.prototype.cg,J.prototype.qh,"UDPAR",8,1145,64],L[65472]=[null,null,J.prototype.vb,J.prototype.yb,"R0SET0"],L[65473]=[null,null,J.prototype.vb,J.prototype.yb,"R1SET0"],L[65474]=[null,null,J.prototype.vb,J.prototype.yb,"R2SET0"],L[65475]=[null,null,J.prototype.vb,J.prototype.yb,"R3SET0"],L[65476]=[null,null,J.prototype.vb,
|
||||
J.prototype.yb,"R4SET0"],L[65477]=[null,null,J.prototype.vb,J.prototype.yb,"R5SET0"],L[65478]=[null,null,J.prototype.Cf,J.prototype.Pg,"R6KERNEL"],L[65479]=[null,null,J.prototype.Ff,J.prototype.Sg,"R7KERNEL"],L[65480]=[null,null,J.prototype.wb,J.prototype.zb,"R0SET1",1,1145],L[65481]=[null,null,J.prototype.wb,J.prototype.zb,"R1SET1",1,1145],L[65482]=[null,null,J.prototype.wb,J.prototype.zb,"R2SET1",1,1145],L[65483]=[null,null,J.prototype.wb,J.prototype.zb,"R3SET1",1,1145],L[65484]=[null,null,J.prototype.wb,
|
||||
J.prototype.zb,"R4SET1",1,1145],L[65485]=[null,null,J.prototype.wb,J.prototype.zb,"R5SET1",1,1145],L[65486]=[null,null,J.prototype.Df,J.prototype.Qg,"R6SUPER",1,1145],L[65487]=[null,null,J.prototype.Ef,J.prototype.Rg,"R6USER",1,1145],L[65504]=[null,null,J.prototype.kf,J.prototype.Ag,"CTRL",8,1170],L[65520]=[null,null,J.prototype.Id,J.prototype.Ld,"LSIZE",1,1170],L[65522]=[null,null,J.prototype.Id,J.prototype.Ld,"HSIZE",1,1170],L[65524]=[null,null,J.prototype.bg,J.prototype.ph,"SYSID",1,1170],L[65526]=
|
||||
[null,null,J.prototype.jf,J.prototype.zg,"ERR",1,1170],L[65528]=[null,null,J.prototype.rf,J.prototype.Gg,"MBR",1,1170],L[65530]=[null,null,J.prototype.wf,J.prototype.Jg,"PIR"],L[65532]=[null,null,J.prototype.ag,J.prototype.oh,"SLR"],L[65534]=[null,null,J.prototype.Bf,J.prototype.Og,"PSW"],L);
|
||||
Ta(function(){for(var a=z(document,y,"device"),b=0;b<a.length;b++){var c,d=a[b];c=v(d);switch(c.type){case "default":c=new J(c);w(c,d);break;case "pc11":c=new vc(c);w(c,d);break;case "rl11":c=new M(c);w(c,d);break;case "rk11":c=new N(c);w(c,d);break;case "rx11":c=new wc(c),w(c,d)}}});
|
||||
function G(a,b,c,d,e,f){this.b=a;this.id=xc+=2;this.c=null;this.ab=b;this.Sb=c;this.size=d||0;this.type=e||yc;this.A=e==zc;this.controller=null;this.tb=this.i=this.Xc;this.W=this.D=this.Yc;this.xb=this.o=this.Ub;this.Ab=this.m=this.bd;this.g=this.h=0;Tb(this);this.Ha=this.Oe=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],Ac(this,f.He);else if(ab)this.f=new ArrayBuffer(this.size),this.u=new DataView(this.f,0,this.size),this.a=new Uint8Array(this.f,0,this.size),this.l=new Uint16Array(this.f,
|
||||
0,this.size>>1),this.c=new Int32Array(this.f,0,this.size>>2),Ac(this,Bc?Cc:Dc);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;Ac(this,Ec)}else Ac(this)}h=G.prototype;h.save=function(){var a,b;if(this.controller)a=null;else if(ab)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.u.getInt32(b<<2,!0);else a=this.c;return a};
|
||||
h.restore=function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(ab)for(b=0;b<a.length;b++)this.u.setInt32(b<<2,a[b],!0);else this.c=a;return this.Ha=!0}return!1};function Ac(a,b){b||(b=Fc);Gc(a,b,void 0);Hc(a,b,void 0)}function Gc(a,b,c){c&&a.g||(a.tb=b[0]||a.Xc,a.W=b[2]||a.Yc);if(c||void 0===c)a.i=b[0]||a.Xc,a.D=b[2]||a.Yc}function Hc(a,b,c){c&&a.h||(a.xb=!a.A&&b[1]||a.Ub,a.Ab=!a.A&&b[3]||a.bd);if(c||void 0===c)a.o=b[1]||a.Ub,a.m=b[3]||a.bd}
|
||||
function Tb(a,b){a.g=a.h=0;b&&((a.g=b.g)&&Gc(a,Ic,!1),(a.h=b.h)&&Hc(a,Ic,!1))}h.Xc=function(a,b){H(this.b,b,32);return 255};h.Ub=function(a,b,c){H(this.b,c,32)};h.Yc=function(a,b){return this.tb(a++,b++)|this.tb(a,b)<<8};h.bd=function(a,b,c){this.xb(a++,b&255,c++);this.xb(a,b>>8,c)};h.gf=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.lg=function(a,b){cb&&a&1&&H(this.b,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8};
|
||||
h.xg=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.Ha=!0};h.yh=function(a,b,c){cb&&a&1&&H(this.b,c,64);c=a>>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<<a)|b<<a:(this.c[c]=this.c[c]&16777215|b<<24,c++,this.c[c]=this.c[c]&-256|b>>8);this.Ha=!0};h.ef=function(a,b){return this.i(a,b)};h.ig=function(a,b){return this.D(a,b)};h.vg=function(a,b,c){this.A?this.Ub(0,0,c):this.o(a,b,c)};h.wh=function(a,b,c){this.A?this.Ub(0,0,c):this.m(a,b,c)};h.df=function(a){return this.a[a]};
|
||||
h.ff=function(a){return this.a[a]};h.hg=function(a,b){cb&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.kg=function(a,b){cb&&a&1&&H(this.b,b,64);return!db&&a&1?this.a[a]|this.a[a+1]<<8:this.l[a>>1]};h.ug=function(a,b){this.a[a]=b;this.Ha=!0};h.wg=function(a,b){this.a[a]=b;this.Ha=!0};h.vh=function(a,b,c){cb&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ha=!0};h.xh=function(a,b,c){cb&&a&1&&H(this.b,c,64);!db&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.l[a>>1]=b;this.Ha=!0};
|
||||
var yc=0,ec=1,zc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],xc=0,Fc=[],Ec=[G.prototype.gf,G.prototype.xg,G.prototype.lg,G.prototype.yh],Ic=[G.prototype.ef,G.prototype.vg,G.prototype.ig,G.prototype.wh];if(ab)var Dc=[G.prototype.df,G.prototype.ug,G.prototype.hg,G.prototype.vh],Cc=[G.prototype.ff,G.prototype.wg,G.prototype.kg,G.prototype.xh];var Jc;if(ab){var Kc=new ArrayBuffer(2);(new DataView(Kc)).setUint16(0,256,!0);Jc=256===(new Uint16Array(Kc))[0]}else Jc=!1;var Bc=Jc;
|
||||
function Mc(a,b){r.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.cd=0;this.qc=b;this.Za=c;this.Ac=Math.round(this.qc/1E4)/100;this.jb=this.Ac*this.Za;this.Cc=this.Mb=this.mb=this.rc=0;this.j.M=this.j.$c=!1;this.j.Y=a.autoStart;"string"==typeof this.j.Y&&(this.j.Y="true"==this.j.Y);this.j.ec=!1;this.oc=this.lb=0;this.pc=+a.csStart;this.Kb=+a.csInterval;this.Lb=+a.csStop;this.X=[];this.sd=this.pg.bind(this);this.Na=this.Da=this.Ma=this.a=this.ba=this.Ca=this.Jb=this.La=this.nb=this.Dc=
|
||||
this.Wa=0;this.pa=null;B(this)}n(Mc,r);h=Mc.prototype;h.ja=function(a,b,c,d){this.A=a;this.u=b;this.D=d;this.pa=a.f;for(a=0;a<Nc.length;a++)(b=this.o[Nc[a]])&&this.A.ma(null,Nc[a],b);B(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.la=function(a,b){var c=Oc(this.A,"autoStart");null!=c?this.j.Y="true"==c?!0:"false"==c?!1:!!c:null==this.j.Y&&(this.j.Y=void 0===this.o.run);if(!b){if(a){Pc(this);if(!this.restore(a))return!1;Qc(this)}else this.reset();this.status("No debugger detected");this.j.Y||this.aa("CPU will not be auto-started "+(this.pa?"(click Run to start)":"(type 'go' to start)"))}return!0};h.ka=function(a){return a?this.save():!0};h.Y=function(){return this.j.M?!0:this.j.Y?(Bb(this),!0):!1};h.Dd=function(){return 0};
|
||||
function Qc(a){void 0===a.pc&&(a.pc=0);void 0===a.Kb&&(a.Kb=-1);void 0===a.Lb&&(a.Lb=-1);a.j.ec=0<=a.pc&&0<a.Kb;a.j.ec&&(a.oc=0,a.lb=a.pc-a.Na)}function Eb(a,b){if(a.j.ec){var c=!1;a.oc=a.oc+a.Dd()|0;a.lb-=b;0>=a.lb&&(a.lb+=a.Kb,c=!0);0<=a.Lb&&a.Lb<=Rc(a)&&(a.Kb=a.Lb=-1,Qc(a),F(a),c=!0);c&&a.aa(Rc(a)+" cycles: checksum="+ya(a.oc))}}
|
||||
h.ma=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.R)a=!0;else{var b=null,c,k=ra(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.R);c++);c==k.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.fc?" (waiting for notification)":""))+".");a=!1}a&&(d.j.M?F(d):Bb(d))},!0;case "speed":return this.o[b]=
|
||||
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){Sc(d,d.Za<<1,!0)},c.textContent=this.jb.toFixed(2)+"Mhz",!0}return!1};function Db(a,b,c){a.Na+=b;c&&(a.Ma=a.a=a.ba=0)}function Tc(a,b){var c=1;b&&1<a.Za&&a.Wa&&(c=a.Wa/a.Ac);a.Cc=Math.round(1E3/Uc);a.Mb=Math.floor(a.qc/Uc*c);b||(a.mb=a.Mb);a.rc=0}function Rc(a){return a.Na+a.Da+a.Ma-a.a}function Pc(a){a.Wa=0;a.Dc=0;a.Na=a.Da=a.Ma=a.a=a.ba=0;Qc(a);Sc(a,1)}
|
||||
function Sc(a,b,c){if(void 0!==b){.8>a.Wa/a.jb&&(b=1);a.Za=b;b=a.Ac*a.Za;if(a.jb!=b){a.jb=b;b=a.jb.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.aa("target speed: "+b)}c&&a.A&&Vc(a.A)}Db(a,a.Da);a.Da=0;a.Ca=pa();a.La=0;Tc(a)}function ic(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function jc(a,b,c,d){0<=b&&b<a.X.length&&(d||0>a.X[b][0])&&(c=a.qc*a.Za/1E3*c|0,a.j.M&&(c+=Wc(a)),a.X[b][0]=c)}function Xc(a){for(var b=[],c=0;c<a.X.length;c++)b.push(a.X[c][0]);return b}
|
||||
function Cb(a,b){for(var c=a.X.length-1;0<=c;c--){var d=a.X[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Wc(a,b){var c=a.Ma-=a.a;a.a=a.ba=0;b&&(a.Ma=0);return c}
|
||||
h.pg=function(){if(this.j.M){this.rc>=this.qc&&Tc(this,!0);this.nb=0;this.Jb=pa();if(this.La){var a=this.Jb-this.La;a>this.Cc&&(this.Ca+=a,this.Ca>this.Jb&&(this.Ca=this.Jb))}try{do{for(var b,c=this.j.ec?1:this.Mb,d=this.X.length-1;0<=d;d--){var e=this.X[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wc(b)}catch(f){if("number"!=typeof f)throw f;}b=Wc(this,!0);this.nb+=b;this.Da+=b;Eb(this,b);Cb(this,b);this.mb-=b;if(0>=this.mb){this.mb+=this.Mb;++this.Dc>=Yc&&(this.A&&Fb(this.A,void 0),this.Dc=0);break}}while(this.j.M)}catch(f){F(this);
|
||||
this.A&&this.A.stop(pa(),Rc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.M){a=setTimeout;b=this.sd;this.La=pa();c=this.Cc;this.nb&&(c=Math.round(c*this.nb/this.Mb));c-=this.La-this.Jb;if(d=this.La-this.Ca)this.Wa=Math.round(this.Da/(10*d))/100,864E5<=d&&(this.Na=0,Sc(this));if(0>c||this.Wa<this.jb)-1E3>c&&(this.Ca-=c),c=0;this.rc+=this.nb;this.La+=c;a(b,c)}}};
|
||||
function Bb(a){var b;a.j.error?(a.aa(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.M)a.aa(a.toString()+" busy");else{Sc(a);a.j.M=!0;a.j.$c=!0;if(b=a.o.run)b.textContent="Halt";a.A&&a.A.start(a.Ca,Rc(a));a.D||a.status("Started");setTimeout(a.sd,0)}}h.wc=function(){return 0};function F(a){var b=!1;if(a.j.M){Wc(a);Db(a,a.Da);a.Da=0;a.j.M=!1;if(b=a.o.run)b.textContent="Run";a.A&&a.A.stop(pa(),Rc(a));b=!0;a.D||a.status("Stopped")}a.j.complete=void 0;return b}var Uc=30,Yc=15,Nc=["power","reset"];
|
||||
function Zc(a){var b=+a.model||1170;Mc.call(this,a,6666667);this.sa=b;this.md=+a.addrReset||0;this.Ea=this.i=this.B=this.v=this.m=this.l=this.w=0;this.b=this.ua=this.ga=[];this.H=this.s=this.Pa=this.Qb=[];this.Ka=this.C=this.ld=this.kb=this.Xa=this.Ya=this.cb=this.F=this.Nb=this.$a=this.Oa=this.J=this.Ob=this.Pb=this.ta=this.g=0;this.De=[4,2,0,1];this.tc=0;this.qd=255;1120>=this.sa?(this.kd=$c.bind(this),this.hb=this.Le,this.tc=8,this.qd=-1,this.wd=255,this.td=0):(this.kd=ad.bind(this),this.hb=this.Me,
|
||||
this.wd=~(1792|(1140>=this.sa?2048:0))&65535,this.td=1140<this.sa?2048:0);this.Kc=this.Ic=this.pb=0;this.I=null;this.Ib=[];this.hc=this.dd=this.Pe;this.ic=this.uc=this.Re;this.vc=this.xc=this.rg;this.jc=this.zc=this.tg;this.Aa=this.gc=0;this.ra=this.Ed;this.W=this.Jd;this.Ab=this.Md;this.h=this.f=this.nc=this.K=this.S=0;this.j.complete=!1}n(Zc,Mc);h=Zc.prototype;h.ja=function(a,b,c,d){Mc.prototype.ja.call(this,a,b,c,d);this.dd=b.Nd.bind(b);this.uc=b.Vb.bind(b);this.xc=b.Od.bind(b);this.zc=b.Wb.bind(b)};
|
||||
h.la=function(a,b){for(var c=192,d=0;d<this.Ib.length;d++){var e=this.Ib[d];0>e.Tb&&(e.Tb=c,c+=4)}return Mc.prototype.la.call(this,a,b)};
|
||||
h.reset=function(){this.status("Model "+this.sa);this.j.M&&F(this);this.v=65536;this.m=32768;this.l=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.md,-1,-2,-3,-4,-5,-6,-7,-8];this.ua=[0,0,0,0,0,0];this.ga=[0,0,0,0];this.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],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,
|
||||
65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Pa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Qb=[0,0,0,0,0,0,0,0];this.B=0;this.Ea=-1;this.h=this.f=this.nc=this.K=this.S=this.g=this.Nb=0;zb(this);Pc(this);this.j.error=!1;Mc.prototype.reset.call(this)};function zb(a){a.J=0;a.Ob=0;a.Pb=0;a.ta=0;a.F=0;a.$a=0;a.Oa=255;a.kb=0;a.Xa=0;a.Ya=0;a.cb=262143;a.Ka=a.b[7];a.C=0;a.I=null;a.u&&(bd(a),a.ld=dc(a.u))}
|
||||
function bd(a){a.hc=a.dd;a.ic=a.uc;a.vc=a.xc;a.jc=a.zc;a.kb?(a.Aa=65536,a.gc=a.ta&16?4186112:253952,a.ra=a.Ed,a.W=a.Jd,a.Ab=a.Md,Wb(a.u,a.ta&16?22:18)):(a.Aa=0,a.gc=57344,a.ra=a.Qe,a.W=a.jg,a.Ab=a.zh,Wb(a.u,16))}function nc(a){var b=a.J;b&57344||(b=b&-3199|a.Xa<<5|a.Ya<<1);return b}function oc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Ob=a.C>>16&65535,a.Pb=a.C&65535);a.J=b;a.Xa=(b&96)>>5;a.Ya=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.kb!=c&&(a.kb=c,bd(a))}}
|
||||
function pc(a){a.J&57344||(a.Ob=a.C>>16&65535);a=a.Ob;a&65280&&(a=(a<<8|a>>8)&65535);return a}function qc(a){a.J&57344||(a.Pb=a.C&65535);return a.Pb}function rc(a,b){1170>a.sa&&(b&=-49);a.ta!=b&&(a.ta=b,a.cb=b&16?4194303:262143,bd(a))}function cd(a,b,c,d){a.md=b;dd(a,b);tc(a,0);a.u.reset();zb(a);if(c){a.b[0]=d||0;for(b=1;5>=b;b++)a.b[b]=0;a.b[6]=1024;a.D||(a.j.R?a.j.M||Bb(a):a.j.Y=!0)}else a.D&&a.j.R?F(a)||(a.D.g(),Fb(a.A,-1)):!1===c&&F(a);!a.j.M&&a.pa&&a.pa.stop()}h.Dd=function(){return 0};
|
||||
h.save=function(){var a=new E(this);a.set(0,[this.b,this.ua,this.ga,this.H,this.s,this.Pa,this.Qb,this.F,this.Nb,this.$a,this.Oa,this.Xa,this.Ya,this.Ka,this.g,this.C,this.Ea,this.Ic,this.Kc]);a.set(1,[sc(this),nc(this),pc(this),qc(this),this.ta]);a.set(2,[this.Na,this.Za,this.j.Y]);a.set(3,ed(this));a.set(4,Xc(this));return a.data()};
|
||||
h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ua=b.next().value;this.ga=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Pa=b.next().value;this.Qb=b.next().value;this.F=b.next().value;this.Nb=b.next().value;this.$a=b.next().value;this.Oa=b.next().value;this.Xa=b.next().value;this.Ya=b.next().value;this.Ka=b.next().value;this.g=b.next().value;this.C=b.next().value;this.Ea=b.next().value;this.Ic=b.next().value;this.Kc=b.next().value;b=a[1];tc(this,b[0]);oc(this,b[1]);
|
||||
this.Ob=b[2];this.Pb=b[3];rc(this,b[4]);b=a[2];this.Na=b[0];Sc(this,b[1]);this.j.Y=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.Ib.length;d++){var e=this.Ib[d];if(e.Tb===b[c]){d=e;break a}}d=null}d&&(d.next=this.I,this.I=d)}a=a[4];for(b=0;b<this.X.length&&b<a.length;b++)this.X[b][0]=a[b];return!0};function fd(a){return a.v&65536?1:0}function gd(a){return a.w&32768?8:0}function hd(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}
|
||||
function O(a,b,c){c&&(dd(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function dd(a,b){a.b[7]=b&65535}function kc(a,b,c,d){b={Tb:b,sb:c,message:d||0,name:fb[b],next:null};a.Ib.push(b);return b}function mc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function K(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.sb<=b.sb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.sb<=b.sb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}
|
||||
function ed(a){var b=[];for(a=a.I;a;)b.push(a.Tb),a=a.next;return b}function id(a){return a.g&64?(I(a,168,64,-6),!0):a.g&32?(I(a,4,32,-5),!0):a.g&16?(I(a,12,16,-7),!0):!1}function sc(a){return a.i=a.i&63728|gd(a)|(a.l&65535?0:4)|(a.m&32768?2:0)|fd(a)}function tc(a,b){b&=a.wd;a.w=b<<12;a.l=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.td)for(var c=a.ua.length;0<=--c;){var d=a.b[c];a.b[c]=a.ua[c];a.ua[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.ga[c]=a.b[6],a.b[6]=a.ga[a.B]);a.i=b;a.g&=-3;a.g|=a.I?2:1}
|
||||
h.fa=function(a){this.w=this.l=a;this.m=0};h.Sa=function(a,b){this.w=this.l=this.v=a;this.m=b||0};function jd(a,b){a.w=a.l=a.v=b;a.m=a.w^a.v>>1}function kd(a,b,c,d){a.w=a.l=a.v=b;a.m=(c^d)&(d^b)}
|
||||
function I(a,b,c,d){if(!a.pb){0>a.Ea?a.Ea=sc(a):a.B||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.F|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.W(b|a.Aa),f=a.W(b+2&65535|a.Aa);tc(a,f&-12289|a.Ea>>2&12288);ld(a,a.Ea);ld(a,a.b[7]);dd(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Ea=-1;a.Ic=d;a.Kc=b;-1==d&&F(a);if(-4<=d)throw b;}}function md(a){var b=nd(a),c=nd(a);a.i&49152&&(c=c&-225|a.i&63712);dd(a,b);tc(a,c);a.g&=-17}
|
||||
function od(a,b){var c=b>>13&31;31>c&&(b=a.ta&32?a.Pa[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||
function Ib(a,b,c){var d,e,f;if(!(c&a.kb))return f=b&65535,57344<=f&&(f|=a.gc),f;d=b>>13;a.ta&a.De[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.cb;3932160<=f&&(f=od(a,f));if(a.pb)return f;f>=a.ld&&f<a.gc?(a.F|=32,I(a,4,0,f)):f&1&&!(c&1)&&(a.F|=64,I(a,4,0,f));var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&
|
||||
(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.cb)||a.B)a.Xa=a.B,a.Ya=d;g&&(g&57344&&(0<=a.Ea&&(g|=128),a.J&57344||(g|=a.J&4096|a.Xa<<5|a.Ya<<1,oc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.cb)||f>(4194239&a.cb))||(a.J|=4096,a.J&512&&(a.g|=64)));return f}function nd(a){var b=a.W(a.b[6]|a.Aa);a.b[6]=a.b[6]+2&65535;return b}function ld(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.g&256||a.hb(4,-2,c);a.Ab(c,b)}
|
||||
function pd(a,b,c,d){var e,f,g=d&8?0:a.Aa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.hb(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.hb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.hb(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.W(e)|g;a.a-=8;break;case 6:return e=a.W(hd(a,2)),e=e+a.b[c]&65535,6==c&&a.hb(d,0,
|
||||
e),a.a-=6,e|g;case 7:return e=a.W(hd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.Aa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.Le=function(a,b,c){!this.B&&0>=b&&c<=this.Oa&&(this.g|=32)};h.Me=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Oa&&(c<=this.Oa-32?I(this,4,0,-4):(this.F|=8,this.g|=32)))};h.Pe=function(a){return this.dd(a)};h.Re=function(a){return this.uc(a)};h.rg=function(a,b){this.xc(a,b)};h.tg=function(a,b){this.zc(a,b)};
|
||||
h.Qe=function(a,b,c){return pd(this,a,b,c)};h.Ed=function(a,b,c){return Ib(this,pd(this,a,b,c),c)};h.jg=function(a){return this.u.Vb(this.Ka=a)};h.Jd=function(a){return this.u.Vb(this.Ka=Ib(this,a,2))};h.zh=function(a,b){this.u.Wb(this.Ka=a,b)};h.Md=function(a,b){this.u.Wb(this.Ka=Ib(this,a,4),b)};
|
||||
function qd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=pd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.W(d|c&a.Aa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ga[a.i>>12&3];return c}function rd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=pd(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Ib(a,e|c&65536,4),a.B=a.i>>14&3,a.jc(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ga[a.i>>12&3]=d}
|
||||
function sd(a,b){b>>=6;var c=a.S=b&7;return(b=a.K=(b&56)>>3)?a.hc(a.ra(b,c,3)):a.b[c+a.tc]&a.qd}function td(a,b){var c;b>>=6;var d=a.S=b&7;(b=a.K=(b&56)>>3)?c=a.ic(a.ra(b,d,2)):c=a.b[d+a.tc];return c}function ud(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return pd(a,b,c,8)}function vd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.hc(a.ra(b,c,3)):a.b[c]&255}function wd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.ic(a.ra(b,d,2)):c=a.b[d];return c}
|
||||
function P(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.nc=a.ra(b,e,7),c=0>c?a.b[-c-1]&255:c,a.vc(e,d.call(a,c,a.hc(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function Q(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ra(b,e,6),a.jc(e,d.call(a,0>c?a.b[-c-1]:c,a.ic(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])}
|
||||
function xd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.ra(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.vc(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function yd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ra(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.jc(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))}
|
||||
h.wc=function(a){this.j.complete=!0;var b=a?this.j.$c?0:1:-1;this.j.$c=!1;this.Ma=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.$a&224)>>5,e=this.I&&this.I.sb>d?this.I:null;e&&(c=e.Tb,d=e.sb);d>(this.i&224)>>5?(this.g&8&&(hd(this,2),this.g&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&mc(this,e),a=!0);this.I||this.$a||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.g&112&&id(this)){if(this.g&
|
||||
4&&this.D.b(this.b[7],b)){F(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.C=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.kd(e)}while(0<this.a);return this.j.complete?this.Ma-this.a:!1===this.j.complete?-1:0};Ta(function(){for(var a=z(document,y,"cpu"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Zc(d);w(d,c)}});function zd(a,b){var c=b+a;this.w=this.l=this.v=c;this.m=(a^c)&(b^c);return c&65535}
|
||||
function Ad(a,b){var c=b+a,d=c<<8;this.w=this.l=this.v=d;this.m=(a<<8^d)&(b<<8^d);return c&255}function Bd(a,b){a=b<<1;jd(this,a);return a&65535}function Cd(a,b){a=b<<1;jd(this,a<<8);return a&255}function Dd(a,b){a=b&32768|b>>1|b<<16;jd(this,a);return a&65535}function Ed(a,b){a=b&128|b>>1|b<<8;jd(this,a<<8);return a&255}function Fd(a,b){a=b&~a;this.fa(a);return a}function Gd(a,b){a=b&~a;this.fa(a<<8);return a}function Hd(a,b){a|=b;this.fa(a);return a}function Id(a,b){a|=b;this.fa(a<<8);return a}
|
||||
function Jd(a,b){a=~b|65536;this.Sa(a);return a&65535}function Kd(a,b){a=~b|256;this.Sa(a<<8);return a&255}function Ld(a,b){this.w=this.l=a=b-a;this.m=b&(b^a);return a&65535}function Md(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.l=c;this.m=b&(b^c);return a&255}function Nd(a,b){this.w=this.l=a=b+a;this.m=a&(b^a);return a&65535}function Od(a,b){a=b+a;var c=a<<8;this.w=this.l=c;this.m=c&(b<<8^c);return a&255}function Pd(a,b){a=-b;this.Sa(a,a&b&32768);return a&65535}
|
||||
function Qd(a,b){a=-b;this.Sa(a<<8,(a&b&128)<<8);return a&255}function Rd(a,b){a=b<<1|this.v>>16&1;jd(this,a);return a&65535}function Sd(a,b){a=b<<1|this.v>>16&1;jd(this,a<<8);return a&255}function Td(a,b){a=(this.v&65536|b)>>1|b<<16;jd(this,a);return a&65535}function Ud(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;jd(this,a<<8);return a&255}function Vd(a,b){var c=b-a;kd(this,c,a,b);return c&65535}function Wd(a,b){var c=b-a;kd(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function Xd(a,b){this.w=this.l=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Yd(a,b){a^=b;this.fa(a);return a&65535}function Zd(a){Q(this,a,td(this,a),zd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
||||
function $d(a){var b=wd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.m=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.v=c<<17-b,c>>=b;else if(b)if(16<b)this.m=c,c=0;else{this.v=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.l=c;this.a-=(this.h?6:7)+b}
|
||||
function ae(a){var b=wd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.v=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.m=32768)):d=c;this.b[a]=d>>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.l=d>>16|d;this.a-=(this.h?6:7)+b}function be(a){O(this,a,!fd(this))}function ce(a){O(this,a,fd(this))}
|
||||
function de(a){Q(this,a,td(this,a),Fd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ee(a){P(this,a,sd(this,a),Gd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function fe(a){Q(this,a,td(this,a),Hd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ge(a){P(this,a,sd(this,a),Id);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
||||
function he(a){var b=td(this,a);a=wd(this,a);this.fa((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ie(a){var b=sd(this,a);a=vd(this,a);this.fa(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function je(a){O(this,a,this.l&65535?0:4)}function ke(a){O(this,a,!gd(this)==!(this.m&32768))}function le(a){O(this,a,!!(this.l&65535)&&!gd(this)==!(this.m&32768))}
|
||||
function me(a){O(this,a,!fd(this)&&!!(this.l&65535))}function ne(a){O(this,a,(this.l&65535?0:4)||!gd(this)!=!(this.m&32768))}function oe(a){O(this,a,fd(this)||(this.l&65535?0:4))}function pe(a){O(this,a,!gd(this)!=!(this.m&32768))}function qe(a){O(this,a,gd(this))}function re(a){O(this,a,!!(this.l&65535))}function se(a){O(this,a,!gd(this))}function te(){I(this,12,0,-9)}function ue(a){O(this,a,!0)}function ve(a){O(this,a,!(this.m&32768))}function we(a){O(this,a,this.m&32768?2:0)}
|
||||
function xe(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.l=1);a&8&&(this.w=0);this.a-=5}function ye(a){var b=td(this,a);a=wd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;kd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ze(a){var b=sd(this,a);a=vd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);kd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
||||
function Ae(a){var b=wd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.l=d>>16|d,this.w=d>>16):(this.m=32768,this.l=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.l=this.w=0,this.m=32768,this.v=65536,this.a-=7}function Be(){I(this,24,0,-9);this.a-=20}
|
||||
function Ce(){this.i&49152?(this.F|=128,I(this,4,0,-8)):(this.pa&&1120==this.sa&&this.pa.setData(this.b[0],!0),this.D?this.D.i():F(this));this.a-=7}function De(){I(this,16,0,-9);this.a-=20}var Ee=[0,7,7,10,7,11,9,13];function Fe(a){this.ba=this.a;dd(this,ud(this,a));this.a=this.ba-Ee[this.h]}var Ge=[0,14,14,17,14,18,16,20];function He(a){this.ba=this.a;var b=ud(this,a);a=a>>6&7;ld(this,this.b[a]);this.b[a]=this.b[7];dd(this,b);this.a=this.ba-Ge[this.h]}
|
||||
var Ie=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Je(a){var b=td(this,a);this.ba=this.a;yd(this,a,b,this.fa);this.a=this.ba-Ie[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Ke(a){var b=sd(this,a);xd(this,a,b,65535,this.fa);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Le=[7,13,13,17,14,18,17,21];
|
||||
function Me(a){var b=wd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.l=this.w|b;this.m=0;this.v=-32768>b||32767<b?65536:0;this.a-=23}function Ne(){this.a-=5}function Oe(){this.i&49152||(this.u.reset(),zb(this),this.pa&&this.pa.setData(this.b[0],!0));this.a-=667}function Pe(a){if(a&8)I(this,8,0,-9);else{var b=nd(this);a&=7;7==a?dd(this,b):(dd(this,this.b[a]),this.b[a]=b);this.a-=9}}function Qe(){md(this);this.a-=13}
|
||||
function Re(a){a&1&&(this.v=65536);a&2&&(this.m=32768);a&4&&(this.l=0);a&8&&(this.w=32768);this.a-=5}function Se(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)dd(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Te(a){Q(this,a,td(this,a),Vd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ue(a){Q(this,a,0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ve(){I(this,28,0,-9)}
|
||||
function We(){this.pa&&(this.pa.V=this.b[7],this.pa.setData(this.b[0],!0));this.g|=8;hd(this,-2);this.a-=3}function Xe(a){Q(this,a,this.b[(a>>6&7)+this.tc],Yd);this.a-=this.h?9:3+(7==this.f?2:0)}function R(){I(this,8,0,-9)}function $c(a){Ye[a>>12].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a&15].call(this,a)}function gf(a){hf[a&15].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)}
|
||||
function lf(a){mf[a>>6&3].call(this,a)}function nf(a){of[a>>6&3].call(this,a)}
|
||||
var Ye=[function(a){pf[a>>8&15].call(this,a)},Je,ye,he,de,fe,Zd,R,function(a){qf[a>>8&15].call(this,a)},Ke,ze,ie,ee,ge,Te,R],pf=[function(a){rf[a>>4&15].call(this,a)},ue,re,je,ke,pe,le,ne,He,He,Ze,af,cf,R,R,R],$e=[function(a){yd(this,a,0,this.Sa);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Jd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Ld);this.a-=this.h?9:3+(7==this.f?2:0)}],bf=[function(a){Q(this,a,0,Pd);
|
||||
this.a-=this.h?11:6},function(a){Q(this,a,fd(this)?1:0,zd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,fd(this)?1:0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=wd(this,a);this.Sa(a);this.a-=this.h?4:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)}],rf=
|
||||
[function(a){sf[a&15].call(this,a)},R,R,R,Fe,Fe,Fe,Fe,Pe,R,ef,gf,Ue,Ue,Ue,Ue],sf=[Ce,We,Qe,te,De,Oe,R,R,R,R,R,R,R,R,R,R],ff=[Ne,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},xe,function(){this.l=1;this.a-=5},xe,xe,xe,function(){this.w=0;this.a-=5},xe,xe,xe,xe,xe,xe,xe],hf=[Ne,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},Re,function(){this.l=0;this.a-=5},Re,Re,Re,function(){this.w=32768;this.a-=5},Re,Re,Re,Re,Re,Re,Re],qf=[se,qe,me,oe,ve,we,be,ce,Be,Ve,jf,lf,
|
||||
nf,R,R,R],kf=[function(a){xd(this,a,0,255,this.Sa);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Kd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Md);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){P(this,a,0,Qd);this.a-=this.h?11:6},function(a){P(this,a,fd(this)?1:0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,fd(this)?1:0,Wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=vd(this,a);
|
||||
this.Sa(a<<8);this.a-=this.h?4:3+(7==this.f?2:0)}],of=[function(a){P(this,a,0,Ud);this.a-=this.h?9+(this.nc&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Ed);this.a-=this.h?9+(this.nc&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Cd);this.a-=this.h?9:3+(7==this.f?2:0)}];function ad(a){tf[a>>12].call(this,a)}
|
||||
var tf=[function(a){uf[a>>8&15].call(this,a)},Je,ye,he,de,fe,Zd,function(a){vf[a>>8&15].call(this,a)},function(a){wf[a>>8&15].call(this,a)},Ke,ze,ie,ee,ge,Te,R],uf=[function(a){xf[a>>4&15].call(this,a)},ue,re,je,ke,pe,le,ne,He,He,Ze,af,cf,function(a){yf[a>>6&3].call(this,a)},R,R],yf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.Aa);dd(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=qd(this,a,0);this.fa(a);ld(this,a);this.a-=11},function(a){var b=nd(this);
|
||||
this.ba=this.a;this.fa(b);rd(this,a,0,b);this.a=this.ba-Le[this.h]},function(a){yd(this,a,gd(this)?65535:0,this.fa);this.a-=this.h?9:3+(7==this.f?2:0)}],xf=[function(a){zf[a&15].call(this,a)},R,R,R,Fe,Fe,Fe,Fe,Pe,function(a){!(a&8)||1145>this.sa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},ef,gf,Ue,Ue,Ue,Ue],zf=[Ce,We,function(){md(this);this.g|=this.i&16;this.a-=13},te,De,Oe,Qe,function(){I(this,8,0,-9)},R,R,R,R,R,R,R,R],vf=[Me,Me,Ae,Ae,$d,$d,ae,ae,
|
||||
Xe,Xe,R,R,R,R,Se,Se],wf=[se,qe,me,oe,ve,we,be,ce,Be,Ve,jf,lf,nf,function(a){1145>this.sa?I(this,8,0,-9):Af[a>>6&3].call(this,a)},R,R],Af=[function(){I(this,8,0,-9)},function(a){a=qd(this,a,65536);this.fa(a);ld(this,a);this.a-=11},function(a){var b=nd(this);this.ba=this.a;this.fa(b);rd(this,a,65536,b);this.a=this.ba-Le[this.h]},function(){I(this,8,0,-9)}];
|
||||
function Bf(a){r.call(this,"ROM",a,128);this.ia=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=za(this.g);if(this.g){a=this.g;var b=Aa(this.m);"json"!=b&&"hex"!=b&&(a=Ja()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Ha(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(na(c.Ua,a,b),(a=Ia(a,b))?(c.b=a.N,c.ia=a.ia):c.g=null);Cf(c)})}}n(Bf,r);
|
||||
h=Bf.prototype;h.ja=function(a,b,c,d){this.u=b;this.c=c;this.D=d;Cf(this)};h.la=function(){this.ia&&(this.D&&this.D.a(this.id,this.h,this.a,this.ia),delete this.ia);return!0};h.ka=function(){return!0};
|
||||
function Cf(a){if(!ua(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+ya(a.b.length,8,!0)+") does not match specified size ("+ya(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[Bf.prototype.Uf,Bf.prototype.hh,null,null,null,a.a>>1],c);if(lb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+xa(b));b=a.i=!0;break a}}else if(Ub(a.u,b,a.a,zc)){for(c=0;c<a.b.length;c++)cc(a.u,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];
|
||||
"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.u,g=d.a,k=[],l=d.h>>>f.h;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.g;f=d.u;d=d.a;g=0;for(e>>>=f.h;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.g}}a.i||delete a.b}}}B(a)}}h.Uf=function(a){return this.b[a-this.h]};h.hh=function(){};Ta(function(){for(var a=z(document,y,"rom"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Bf(d);w(d,c)}});
|
||||
function Df(a){r.call(this,"RAM",a);this.ia=this.b=null;this.f=+a.addr;this.g=+a.size;this.ea=a.load;this.da=a.exec;null!=this.ea&&(this.ea=+this.ea);null!=this.da&&(this.da=+this.da);this.h=!1;this.a=a.file;this.i=za(this.a);if(this.a){a=this.a;var b=Aa(this.i);"json"!=b&&"hex"!=b&&(a=Ja()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;Ha(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(na(c.Ua,a,b),(a=Ia(a,b))?(c.b=a.N,c.ia=a.ia,
|
||||
null==c.ea&&(c.ea=a.ea),null==c.da&&(c.da=a.da)):c.a=null);Ef(c)})}}n(Df,r);Df.prototype.ja=function(a,b,c,d){this.u=b;this.c=c;this.D=d;Ef(this)};Df.prototype.la=function(a,b){this.ia&&(this.D&&this.D.a(this.id,this.f,this.g,this.ia),delete this.ia);b||this.reset();return!0};Df.prototype.ka=function(){return!0};
|
||||
function Ef(a){if(a.u&&(!a.h&&a.g&&(Ub(a.u,a.f,a.g,ec)?a.h=!0:a.g=0),!ua(a))){if(!a.h)u("No RAM allocated");else if(a.a){if(!a.b||!a.u)return;Ff(a,a.b,a.ea,a.da,a.f)?a.status('Loaded image "'+a.i+'"'):a.G('Error loading image "'+a.i+'"')}B(a)}}
|
||||
Df.prototype.reset=function(){if(this.h){for(var a=this.u,b=this.f,c=this.g,d=b&a.f,b=b>>>a.h;0<c&&b<a.a.length;){var e=a.a[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(ab&&e.a)for(k=d;f--&&k<e.a.length;k++)e.a[k]=g;else for(k=d;f--&&k<e.size;k++)e.o(d,g,e.ab+d);c-=a.g;b++;d=0}this.b&&Ff(this,this.b,this.ea,this.da,this.f,!0)}};
|
||||
function Ff(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,q=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(q&255)+(q>>8)),x=l,A=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(A)for(;A--;)cc(a.u,q++,b[x++]&255);else q&1?g=!0:null==d&&(d=q);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
|
||||
b.length;e++)cc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&cd(a.c,d,f)}return k}Ta(function(){for(var a=z(document,y,"ram"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Df(d);w(d,c)}});function Gf(a){r.call(this,"Keyboard",a,1024);B(this)}n(Gf,r);Gf.prototype.ma=function(){return!1};Gf.prototype.ja=function(a,b,c,d){this.A=a;this.c=c;this.D=d};Ta(function(){for(var a=z(document,y,"keyboard"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Gf(d);w(d,c)}});
|
||||
function Hf(a){r.call(this,"SerialPort",a,1048576);this.B=+a.adapter;this.J=+a.baudReceive||9600;this.ba=+a.baudTransmit||9600;this.w=a.upperCase;"string"==typeof this.w&&(this.w="true"==this.w);this.h=this.i=null;this.S=+a.tabSize;this.K=+a.charBOL;this.m=0;this.v=!0;this.H=this.C=null;this.I=this.X=-1;this.l=this.a=this.b=0;this.f=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=If;b&&(void 0===c&&(c="Panel"),(c=ta(c,this.id))&&(b=c.o[b])&&this.ma(null,a,b))}this.g=this.s=this.F=null;this.exports=
|
||||
{connect:this.Fd,receiveData:this.kc,receiveStatus:this.og,setConnection:this.sg}}n(Hf,r);h=Hf.prototype;
|
||||
h.ma=function(a,b,c){var d=this;switch(b){case If:return this.o[b]=this.h=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?la.gd:la.Cb:46==c?b=la.gd:a.ctrlKey&&c>=la.ed&&c<=la.Ge&&(b=c-(la.ed-la.Qd));b&&(a.preventDefault&&a.preventDefault(),d.kc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==la.Sd&&(b=la.Rd);d.kc(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.kc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;var e=this;this.H=kc(this.c,this.B?-1:48,4,1048576);this.I=ic(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),jc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.l=a,e.a&128?e.l|=49152:e.a|=128,e.a&64&&K(c,e.H))});this.C=kc(this.c,this.B?-1:52,4,1048576);this.X=ic(this.c,function(){e.b|=128;e.b&64&&K(c,e.C)});lb(b,this,Jf,this.B?64832+8*(this.B-1)-65392:0);nb(b,this.reset.bind(this));B(this)};
|
||||
h.Fd=function(a){if(!this.g){var b=Oc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ea(c[0]);if(d!=this.ib)return;c=Ea(c[1]);if(this.g=sa(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.v);if(this.s=e.receiveData){this.v=a;this.F=e.receiveStatus;this.status("Connected "+this.Ua+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.la=function(a,b){if(!b)if(this.Fd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.ka=function(a){return a?this.save():!0};h.reset=function(){Kf(this)};h.save=function(){var a=new E(this);a.set(0,[this.l,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Kf(this,a[0])};function Kf(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.l=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0}
|
||||
h.kc=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.f.push(b)}else this.f=this.f.concat(a);jc(this.c,this.I,1E3/Math.round(this.J/10));return!0};h.og=function(a){var b=this.a;this.a&=-12289;a&32&&(this.a|=8192);a&256&&(this.a|=4096);b!=this.a&&(this.a|=32768,this.a&32&&K(this.c,this.H))};h.sg=function(a,b){return this.g?!1:(this.g=a,this.s=b,!0)};
|
||||
h.Hf=function(){var a=this.a&65534;this.a&=-32769;return a};h.Ug=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.F&&b&6&&(b=0,b=this.v?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.F.call(this.g,b))};h.Gf=function(){this.a&=-129;return this.l};h.Tg=function(){};h.ng=function(){return this.b};h.Bh=function(a){if(this.b&128)if(a&64)K(this.c,this.C);else{var b=this.C;b&&mc(this.c,b)}this.b=this.b&-70|a&69};h.mg=function(){return 0};
|
||||
h.Ah=function(a){a&=255;this.s&&this.s.call(this.g,a);a&=127;if(this.h)if(13==a)this.m=0;else if(8==a)this.h.value=this.h.value.slice(0,-1),0<this.m&&this.m--;else{if(a){var b;13!=a&&10!=a&&(b=Fa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!=
|
||||
this.i){if(10==a||1024<=this.i.length)this.aa(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}jc(this.c,this.X,1E3/Math.round(this.ba/10));this.b&=-129};var If="buffer",Lf={},Jf=(Lf[65392]=[null,null,Hf.prototype.Hf,Hf.prototype.Ug,"RCSR"],Lf[65394]=[null,null,Hf.prototype.Gf,Hf.prototype.Tg,"RBUF"],Lf[65396]=[null,null,Hf.prototype.ng,Hf.prototype.Bh,"XCSR"],Lf[65398]=[null,null,Hf.prototype.mg,Hf.prototype.Ah,"XBUF"],Lf);
|
||||
Ta(function(){for(var a=z(document,y,"serial"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Hf(d);w(d,c)}});function vc(a){r.call(this,"PC11",a,4096);this.C=Mf(this,a.autoMount);this.b=0;this.K=+a.baudReceive||3600;this.l=this.a=0;this.w=32768;this.h=this.I=0;this.m=[];this.i=Nf;this.f=Of;this.B=this.g="";this.N=this.ea=this.da=null;this.H=-1;this.F=!Oa("Mobi")&&window&&"FileReader"in window;this.s=null;this.J=-1;this.v=null}n(vc,r);
|
||||
function Mf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=vc.prototype;
|
||||
h.ma=function(a,b,c){var d=this,e=Of;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){u("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "readTape":e=Pf;case "loadTape":return e||(e=Qf),this.o[b]=c,c.onclick=
|
||||
function(){var a=d.o.listTapes;a&&Rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[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,za(b,!0),b,Qf,a)}return!1};return!0;case Sf:return this.o[b]=c,!0}return!1};
|
||||
h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;this.v=Tf(a);var e=this;if(a=Mf(this,Oc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=kc(this.c,56,4,4096);this.J=ic(this.c,function(){1!=(e.a&32769)||e.a&128||(e.h<e.m.length?(e.l=e.m[e.h]&255,e.h++,Uf(e,e.h/e.m.length*100)):e.a|=32768,e.a|=128,e.a&=-2049,e.a&64&&K(e.c,e.s))});lb(b,this,Vf);nb(b,this.reset.bind(this));Wf(this,"None",Nf,!0);this.F&&Wf(this,"Local Tape",Xf);Wf(this,"Remote Tape",Yf);Zf(this)||B(this)};
|
||||
h.la=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){this.a&=-2241;this.l=0};function Zf(a){a.b=0;var b=a.C.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.o.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=za(c,!0)}c&&b?$f(a,b,c,Qf,!0):ag(a)}return!!a.b}
|
||||
function Rf(a,b,c,d,e){if(c)if(c==Xf)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Yf){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=za(c);a.status("Attempting to load "+c+' as "'+b+'"');a.i=Yf}else a.i=c;$f(a,b,c,d,!1,e)}else bg(a,!1)}function $f(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,bg(a,!0),a.j.Ra?a.G("PC11 busy"):(e&&a.b++,cg(a,b,c,d,f)?g++:a.j.Ra=!0);g&&dg(a,a.B,a.g,a.f,a.N,a.ea,a.da)}
|
||||
function cg(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),dg(a,b,c,d,e),a.i=Xf);a.j.Ra=!1;ag(a)};g.readAsArrayBuffer(e);return!1}0>c.indexOf("/api/v1/dump")&&(e=Aa(c),f="json"==e||"gz"==e?encodeURI(c):Ja()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ha(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.R;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(na(a.Ua,e,f),(e=Ia(e,f))&&dg(a,b,c,d,
|
||||
e.N,e.ea,e.da));a.j.Ra=!1;a.b&&(a.b--,a.b||B(a));ag(a)})}function Wf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function ag(a){var b=a.o.listTapes;if(b&&b.options){a=a.i||a.g;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Uf(a,b){b|=0;if(b!==a.H){var c=a.o[Sf];c&&(c=(c=z(c,eg))&&c[0])&&c.style&&(c.style.width=b+"%");a.H=b}}
|
||||
function dg(a,b,c,d,e,f,g){a.B=b;a.g=c;a.f=d;a.N=e;a.ea=f;a.da=g;d==Pf?a.v&&Ff(a.v,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.G('No valid memory address for tape "'+b+'"'):(a.h=0,a.m=e,a.a&=-32769,a.status('Loaded tape "'+b+'" ('+e.length+" bytes)"),Uf(a,0))}function bg(a,b){if(a.g||!1===b)a.B="",a.g="",b||(a.f&&a.status(a.f==Qf?"tape detached":"tape unloaded"),a.i=Nf,a.f=Of,ag(a))}h.save=function(){return(new E(this)).data()};h.restore=function(){return!0};h.Af=function(){return this.a&65534};
|
||||
h.Ng=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&K(this.c,this.s)):(this.a&=-129,this.a|=2048,this.l=0,jc(this.c,this.J,1E3/Math.round(this.K/10))));this.a=this.a&-66|a&65};h.zf=function(){this.a&=-129;this.a|=2048;return this.l};h.Mg=function(){};h.yf=function(){return this.w};h.Lg=function(a){this.w=this.w&-65|a&64};h.xf=function(){return this.I};h.Kg=function(a){this.I=a&255};
|
||||
var Nf="",Xf="?",Yf="??",Of=0,Qf=1,Pf=2,Sf="readProgress",eg="pcjs-progress-bar",fg={},Vf=(fg[65384]=[null,null,vc.prototype.Af,vc.prototype.Ng,"PRS"],fg[65386]=[null,null,vc.prototype.zf,vc.prototype.Mg,"PRB"],fg[65388]=[null,null,vc.prototype.yf,vc.prototype.Lg,"PPS"],fg[65390]=[null,null,vc.prototype.xf,vc.prototype.Kg,"PPB"],fg);
|
||||
function gg(a,b,c){r.call(this,"Disk",{id:a.Ua+".disk"+ya(++hg,4)},8192);this.controller=a;this.A=a.A;this.D=a.D;this.h=b;this.xa=b.name;this.oa=this.Zc="";this.Wc=b.Wc;this.L=this.T=this.P=this.Z=this.mode=0;this.a=[];this.f=null;this.g=!1;ig(this,c,b.L,b.T,b.P,b.Z);this.b=this.i=null;B(this)}n(gg,r);h=gg.prototype;h.ja=function(a,b,c,d){this.D=d};
|
||||
function ig(a,b,c,d,e,f){a.mode=b;a.L=c;a.T=d;a.P=e;a.Z=f;a.a=[];if("preload"!=a.mode){b=Array(a.L);for(c=0;c<b.length;c++){d=Array(a.T);for(e=0;e<d.length;e++){f=Array(a.P);for(var g=1;g<=f.length;g++)f[g-1]=jg(null,c,e,g,a.Z,0);d[e]=f}b[c]=d}a.a=b}a.f=null}
|
||||
function kg(a,b,c,d,e){var f=c;if(a.b)return!0;a.xa=b;a.oa=c;a.Zc=za(c);a.b=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.L=e[0];a.T=e[1];a.P=e[2];a.Z=e[3]||512;c=a.Z>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.L);for(d=0;d<a.a.length;d++)for(var x=a.a[d]=Array(a.T),A=0;A<x.length;A++)for(var ma=x[A]=Array(a.P),Sa=0;Sa<ma.length;Sa++){for(var uc=jg(null,d,A,Sa+1,a.Z,0),lh=uc.data,Lc=0;Lc<c;Lc++,f+=4)var mh=lh[Lc]=b.getInt32(f,
|
||||
!0),e=e+mh&-1;uc.na=c;ma[Sa]=uc}a.f=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.xa,a.oa),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=Aa(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"):Ba(c,"/")&&(d="dir"),f=Ja()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Wc?"":e)+"&format=json"));return!!Ha(f,
|
||||
null,!0,function(b,c,d){lg(a,b,c,d)})}
|
||||
function lg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.R;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.xa+'" (error '+d+": "+b+")",f);else{na(a.controller.Ua,b,c);try{if(0<za(a.Zc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.xa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)u(k[0]);else{a.L=k.length;a.T=k[0].length;a.P=k[0][0].length;var l=k[0][0][0];a.Z=l&&l.length||512;for(d=c=0;d<a.L;d++)for(f=0;f<a.T;f++)for(g=0;g<a.P;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var q=l.data;if(void 0===q){var x=l.bytes;if(void 0!==x&&x.length){for(var A=m<<2,ma=x.length;ma<A;ma++)x[ma]=p;mg(l,x)}else q=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=q;delete l.bytes}jg(l,d,f);for(A=
|
||||
0;A<q.length;A++)c=c+q[A]&-1}a.a=k;a.f=c;e=a}else u("Empty disk image: "+a.xa)}catch(Sa){u("Disk image error ("+b+"): "+Sa.message)}}a.b&&(a.b.call(a.i,a.h,e,a.xa,a.oa),a.b=null)}function jg(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ej=b;a.Fj=c;a.wa=a.na=0;a.Ha=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.h,g=this.a[a];if(g){var k=g[b];if(!k&&f.Ie&&b<f.T)for(k=g[b]=Array(f.Je),g=0;g<k.length;g++)k[g]=jg(null,a,b,g+1,f.Gd,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Ie&&9==f.Ad&&(d=k[g]=jg(null,a,b,f.Ad,f.Gd,0))}}e&&e(d,!1);return d};function mg(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.na?f<a.wa?(a.na+=a.wa-f,a.wa=f):f>=a.wa+a.na&&(a.na+=f-(a.wa+a.na)+1):(a.wa=f,a.na=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function ng(a,b){var c=a.T*a.P,d=b/c|0;return d<a.L?(b%=c,a.seek(d,b/a.P|0,b%a.P+1)):null}function og(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.oa,this.f,this.L,this.T,this.P,this.Z];if(!this.g)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.na){for(var k=[],l=0,m=g.wa,p=g.wa+g.na;m<p;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.wa,k]}}return b};
|
||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?ig(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.wa=e;for(k.na=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.xa+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=ng(this,a++);)pg(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 pg(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}var hg=0;function qg(a,b,c,d,e,f){r.call(this,a,b,c);this.C=rg(this,b.autoMount);this.B=0;this.I=d;this.J=e;this.K=f;this.H=d.yc;this.b=Array(this.H);this.F=!Oa("Mobi")&&window&&"FileReader"in window;this.m=[];this.qa=null;this.exports={selectDrive:this.qg}}n(qg,r);
|
||||
function rg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=qg.prototype;
|
||||
h.ma=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=wa(c.value);null!=a&&sg(d,
|
||||
a)},!0;case "loadDisk":return this.o[b]=c,c.onclick=function(){var a=d.o.listDisks;a&&a.options&&tg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.o[b]=c,c.onclick=function(){var a,b=d.o.listDrives,b=b&&wa(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.G("Unable to boot the selected drive"):a.O?(cd(d.c,0,!0,b),(a=d.ub(a,a.Se,a.Te,a.Ue,a.Ke,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.F){c.parentNode.removeChild(c);
|
||||
break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[wa(a.value)||0])if(a=a.O){var b;b="";for(var c=0,k;k=ng(a,c++);)for(var l=0,m=k.length;l<m;l++)b+=String.fromCharCode(og(a,k,l));b=btoa(b);a=a.Zc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+
|
||||
a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");u(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDisk":if(this.F)return this.o[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;tg(d,za(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;if(a=rg(this,Oc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.C[e]=a[e]);this.reset();this.qa=kc(this.c,this.I.Rc,this.I.Nc,this.nd);lb(b,this,this.K);nb(b,this.reset.bind(this));ug(this,"None",vg,!0);this.F&&ug(this,"Local Disk",wg);ug(this,"Remote Disk",xg);yg(this)||B(this)};
|
||||
h.la=function(a,b){if(!b){if(!a){if(this.reset(),this.A.B){this.m=[];for(a=0;a<this.b.length;a++)zg(this,a,!0);yg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;b<this.H;b++){var c=document.createElement("option");c.value=b;c.text=this.b[b].lc||"---";a.appendChild(c)}0<this.H&&(a.value="0",sg(this,0))}}return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){this.bb();Ag(this)};
|
||||
h.save=function(){var a=new E(this);a.set(0,this.mc());a.set(1,Bg(this));a.set(2,Cg(this));return a.data()};h.restore=function(a){var b=!0;this.bb(a[0])||(b=!1);var c=a[1];c&&(this.m=c);Ag(this,a[2])||(b=!1);return b};h.bb=function(){return!0};h.mc=function(){return[]};
|
||||
function Ag(a,b){for(var c=0;c<a.b.length;c++){var d=a.b[c];void 0===d&&(d=a.b[c]={});var e=a,f=d,d=c,g=a.J,k=b&&b[c],l=0;f.rb=d;f.name=e.ib;f.Vc=f.qb=!1;f.Wc=!0;f.lc=g[l++]+d;f.L=g[l++];f.T=g[l++];f.P=g[l++];f.Z=g[l++];f.Se=g[l++];f.Te=g[l++];f.Ue=g[l++];f.Ke=g[l++];f.status=g[l++];f.yj=0;f.xj=0;f.Ad=1;f.Je=f.P;f.Gd=f.Z;f.Gj=0;f.Mj=null;f.O||(f.oa="");k&&(l=k[1],g=k[2],k[0]?(f=l,k=g,g=e.b[d],zg(e,d,!0),g.qb=!0,d=new gg(e,g,"preload"),e.Cd(g,d,f,k,!0)):Dg(e,d,l,g,!0)?f.O&&g&&Eg(e,l,g,f.O):B(e,!1))}return!0}
|
||||
function Cg(a){for(var b=[],c=0;c<a.b.length;c++){var d=a.b[c];b.push([d.qb,d.xa,d.oa])}return b}function Bg(a){for(var b=0;b<a.b.length;b++){var c=a.b[b];c.O&&Fg(a,c.oa,c.O)}return a.m}
|
||||
function yg(a,b){b||(a.B=0);for(var c in a.C){var d=a.C[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=za(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Dg(a,g,f,e,!0)&&b&&B(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.B}
|
||||
function tg(a,b,c,d){var e=a.o.listDrives,e=e&&wa(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if(c==wg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==xg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=za(c);a.status("Attempting to load "+c+' as "'+b+'"')}Dg(a,e,b,c,!1,d)}else zg(a,e)}
|
||||
function Dg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.oa.toLowerCase()!=d.toLowerCase()&&(g++,zg(a,b,!0),k.Vc?a.G(a.type+" busy"):(k.Vc=!0,e&&(k.Uc=!0,a.B++),k.qb=!!f,kg(new gg(a,k,"preload"),c,d,f,a.Cd)&&g++));return g}
|
||||
h.Cd=function(a,b,c,d,e){a.Vc=!1;b&&(b.L>a.L||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.b[a.rb].lc||"---")),b=null);b?(a.O=b,a.xa=c,a.oa=d,this.Hd(a.rb),Eg(this,c,d,b),this.G('Loaded disk "'+c+'" in drive '+(this.b[a.rb].lc||"---"),a.Uc||e),this.A&&Vc(this.A)):a.qb=!1;a.Uc&&(a.Uc=!1,--this.B||B(this));sg(this,a.rb)};
|
||||
function ug(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function sg(a,b,c){var d=!1;if(0<=b&&b<a.b.length){var e=a.b[b],f=a.o.listDisks;a=a.o.listDrives;if(f&&a&&f.options&&a.options){if(c)for(c=0;c<a.options.length;c++)if(wa(a.options[c].value)==e.rb){a.selectedIndex!=c&&(a.selectedIndex=c);d=!0;break}c=wa(a.value);e=e.qb?wg:e.oa;if(!isNaN(c)&&c==b){for(c=0;c<f.options.length;c++)if(f.options[c].value==e){f.selectedIndex!=c&&(f.selectedIndex=c);d=!0;break}c==f.options.length&&(f.selectedIndex=0)}}}return d}
|
||||
h.qg=function(a){var b=this.o.listDrives;if(b&&b.options)for(var c=b.options.length,d=0;d<c;d++)if(b.options[d].innerHTML==a){var e=wa(b.options[d].value);if(0<=e)return sg(this,e,!0)}return!1};function zg(a,b,c){var d=a.b[b];if(d.O||!1===c)Fg(a,d.oa,d.O),d.xa="",d.oa="",d.O=null,d.qb=!1,c||(a.G("Drive "+(a.b[b].lc||"---")+" unloaded",c),sg(a,b))}function Eg(a,b,c,d){var e;for(e=0;e<a.m.length;e++)if(a.m[e][1]==c){d.restore(a.m[e][2]);return}a.m[e]=[b,c,[]]}
|
||||
function Fg(a,b,c){var d;for(d=0;d<a.m.length;d++)if(a.m[d][1]==b){a.m[d][2]=c.save();break}}h.Hd=function(){};h.ub=function(){return-1};h.sc=function(){return-1};var vg="",wg="?",xg="??";function N(a){qg.call(this,"RK11",a,65536,C,C.Zb,Gg);this.s=this.f=this.a=this.i=this.h=this.g=this.l=0}n(N,qg);h=N.prototype;
|
||||
h.bb=function(a){a||(a=[Hg.Zb|Hg.yd|Hg.ud,0,S.za,0,0,0,0]);a=ia(a);this.s=a.next().value;this.f=a.next().value;this.a=a.next().value;this.i=a.next().value;this.h=a.next().value;this.g=a.next().value;this.l=a.next().value;return!0};h.mc=function(){return[this.s,this.f,this.a,this.i,this.h,this.g,this.l]};
|
||||
h.ub=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.O;var p=null,q;a||(m=T.od,e=0);for(;e;){if(!p){if(b>=a.L){m=T.Xb;break}p=a.seek(b,c,d+1);if(!p){m=T.xd;break}q=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}var x,A;if(0>(x=a.read(p,q++))||0>(A=a.read(p,q++))){m=T.Yb;break}if(!k&&(Hb(this.u,od(this.c,f),x|A<<8),hc(this.u))){m=T.Eb;break}q>=a.Z&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.sc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.O;var p=null,q;a||(m=T.od,e=0);for(;e;){var x=Jb(this.u,od(this.c,f));if(hc(this.u)){m=T.Eb;break}if(!p){if(b>=a.L){m=T.Xb;break}p=a.seek(b,c,d+1,!0);if(!p){m=T.xd;break}q=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var A,ma;if(0>(A=a.read(p,q++))||0>(ma=a.read(p,q++))){m=T.Yb;break}if(x!=(A|ma<<8)){m=T.zd;break}}else if(!a.write(p,q++,x&255)||!a.write(p,q++,x>>8)){m=T.Yb;break}q>=a.Z&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.ie=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&~S.fb|f>>16-S.U.fb&S.fb;this.i=65536-e&65535;this.g=this.g&~Ig.Oc|d&Ig.Oc;this.f|=a;Jg(this);return!0};function Jg(a){a.a&=~S.Ja;a.f&&(a.f|=T.Ud,a.a|=S.Ja,a.f&T.Ec&&(a.a|=S.Ec))}h.Mf=function(){return this.s};h.Zg=function(){};h.Nf=function(){return this.f};h.$g=function(){};h.Jf=function(){return this.a&S.Fb};
|
||||
h.Wg=function(a){this.a=this.a&~S.va|a&S.va;if(this.a&S.Db){a=!0;var b,c,d=(this.g&Ig.Ta)>>Ig.U.Ta,e=this.b[d],f,g,k,l,m,p;this.a&=~(S.za|S.Pc);this.f&=~T.ye;switch(c=this.a&S.ca){case Kg.Pd:this.f=this.g=0;this.a=S.za;break;case Kg.de:case Kg.Va:b=this.ub;case Kg.Sc:case Kg.Hb:b||(b=this.sc);f=(this.g&Ig.Bb)>>Ig.U.Bb;g=(this.g&Ig.Hc)>>Ig.U.Hc;k=this.g&Ig.Oc;l=65536-this.i&65535;m=(this.a&S.fb)<<16-S.U.fb|this.h;p=this.a&S.$d?0:2;if(f>=e.L){this.f|=T.Xb;break}if(k>=e.P){this.f|=T.Yb;break}a=b.call(this,
|
||||
e,f,g,k,l,m,p,c>=Kg.Sc,this.ie.bind(this));break;case Kg.cc:f=(this.g&Ig.Bb)>>Ig.U.Bb;f<e.L?this.a|=S.Pc:this.f|=T.Xb;break;case Kg.Vd:this.f=this.g=0,this.a=S.za|S.Pc}this.s=e.status|(e.O?Hg.ha:0)|d<<Hg.U.Jc|this.g&Hg.xe;Jg(this);a&&(this.a&=~S.Db,this.a|=S.za,this.a&S.eb&&K(this.c,this.qa))}};h.Of=function(){return this.i};h.ah=function(a){this.i=a};h.If=function(){return this.h};h.Vg=function(a){this.h=a};h.Kf=function(){return this.g};h.Xg=function(a){this.g=a};h.Lf=function(){return this.l};
|
||||
h.Yg=function(a){this.l=a};var Hg=C.$b,T=C.le,S=C.je,Ig=C.ke,Kg=C.ca,Lg={},Gg=(Lg[65280]=[null,null,N.prototype.Mf,N.prototype.Zg,"RKDS"],Lg[65282]=[null,null,N.prototype.Nf,N.prototype.$g,"RKER"],Lg[65284]=[null,null,N.prototype.Jf,N.prototype.Wg,"RKCS"],Lg[65286]=[null,null,N.prototype.Of,N.prototype.ah,"RKWC"],Lg[65288]=[null,null,N.prototype.If,N.prototype.Vg,"RKBA"],Lg[65290]=[null,null,N.prototype.Kf,N.prototype.Xg,"RKDA"],Lg[65294]=[null,null,N.prototype.Lf,N.prototype.Yg,"RKDB"],Lg);
|
||||
function M(a){qg.call(this,"RL11",a,131072,D,D.me,Mg);this.a=this.l=this.f=this.g=this.i=this.h=0}n(M,qg);h=M.prototype;h.bb=function(a){a||(a=[U.ha|U.za,0,0,0,0,0]);a=ia(a);this.a=a.next().value;this.l=a.next().value;this.f=a.next().value;this.g=a.next().value;this.i=a.next().value;this.h=a.next().value;return!0};h.mc=function(){return[this.a,this.l,this.f,this.g,this.i,this.h]};
|
||||
h.ub=function(a,b,c,d,e,f,g,k,l){g=0;a=a.O;k=null;var m;a||(g=Ng.Ba,e=0);for(;e;){if(!k){k=a.seek(b,c,d+1);if(!k){g=Ng.Ba;break}m=0}var p,q;if(0>(p=a.read(k,m++))||0>(q=a.read(k,m++))){g=Ng.Ba;break}Hb(this.u,od(this.c,f),p|q<<8);if(hc(this.u)){g=Ng.Eb;break}f+=2;e--;if(m>=a.Z&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.L)))){g=Ng.Ba;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.sc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.O;k=null;var m;a||(g=Ng.Ba,e=0);for(;e;){var p=Jb(this.u,od(this.c,f));if(hc(this.u)){g=Ng.Eb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Ng.Ba;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Ng.Ba;break}if(m>=a.Z&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.L)))){g=Ng.Ba;break}}return l?l(g,b,c,d,e,f):g};
|
||||
h.ne=function(a,b,c,d,e,f){this.l=f&65535;this.a=this.a&~U.ya|f>>16-U.U.ya&U.ya;this.h=f>>16&Og.Fa;this.g=this.f=b<<V.U.Gb|(c?V.bc:0)|d&V.vd;this.i=65536-e&65535;a&&(this.a=this.a|a|U.Ja);return!0};h.Rf=function(){return this.a&U.Fb};
|
||||
h.eh=function(a){this.a=this.a&~U.va|a&U.va;this.h=this.h&60|(a&U.ya)>>U.U.ya;if(!(this.a&U.za)){a=!0;var b,c=this.b[(this.a&U.Ta)>>U.U.Ta],d=c.O,e,f,g;this.a&=~U.ha;switch(this.a&U.ca){case Pg.Ce:this.i&Qg.jd&&(this.a&=U.ha|U.ca|U.ya);this.i=c.status|this.g&V.bc|(d&&512==d.L?Qg.Xd:0);break;case Pg.cc:(this.f&V.Wd)==V.ze&&(b=this.f&V.Gb,c=(this.f&V.Be)<<2,this.g=this.f&V.Ae?this.g+b:this.g-b,this.f=this.g=this.g&V.Gb|c);break;case Pg.he:this.i=this.g;break;case Pg.ee:b=this.ub;case Pg.Fe:b||(b=this.sc),
|
||||
e=this.f>>V.U.Gb,f=this.f&V.bc?1:0,g=this.f&V.vd,!d||e>=d.L||g>=d.P?this.a=this.a|Ng.Ba|U.Ja:(a=65536-this.i&65535,d=(this.h&Og.Fa)<<16|this.l,a=b.call(this,c,e,f,g,a,d,2,!1,this.ne.bind(this)))}a&&(this.a=this.a|U.ha|U.za,this.a&U.eb&&K(this.c,this.qa))}};h.Pf=function(){return this.l};h.bh=function(a){this.l=a&Rg.va};h.Sf=function(){return this.f};h.fh=function(a){this.f=a};h.Tf=function(){return this.i};h.gh=function(a){this.i=a};h.Qf=function(){return this.h};
|
||||
h.dh=function(a){this.h=a&Og.Fa;this.a=this.a&~U.ya|(this.h&3)<<U.U.ya};var U=D.qe,Rg=D.oe,V=D.re,Qg=D.ac,Og=D.pe,Ng=D.hd,Pg=D.ca,Sg={},Mg=(Sg[63744]=[null,null,M.prototype.Rf,M.prototype.eh,"RLCS"],Sg[63746]=[null,null,M.prototype.Pf,M.prototype.bh,"RLBA"],Sg[63748]=[null,null,M.prototype.Sf,M.prototype.fh,"RLDA"],Sg[63750]=[null,null,M.prototype.Tf,M.prototype.gh,"RLMP"],Sg[63752]=[null,null,M.prototype.Qf,M.prototype.dh,"RLBE"],Sg);
|
||||
function wc(a){qg.call(this,"RX11",a,262144,eb,eb.se,Tg);this.v=this.s=this.f=this.w=this.a=this.l=0;this.g=W.gb;this.i=0;this.h=Array(128).fill(0)}n(wc,qg);h=wc.prototype;
|
||||
h.bb=function(a){a?(a=ia(a),this.a=a.next().value,this.l=a.next().value,this.v=a.next().value,this.s=a.next().value,this.f=a.next().value,this.w=a.next().value,this.g=a.next().value,this.i=a.next().value,this.h=a.next().value):(this.l=this.a=0,this.s=this.v=1,this.w=this.f=0,this.g=W.Va,this.i=0,(a=this.qa)&&mc(this.c,a),Ug(this));return!0};h.mc=function(){return[this.a,this.l,this.v,this.s,this.f,this.w,this.g,this.i,this.h]};h.Hd=function(a){a||this.bb()};
|
||||
function Vg(a,b){b&&(a.w=b,a.l=a.f,a.a|=X.Ja);a.g=W.gb;a.a|=X.DONE;a.a&X.eb&&K(a.c,a.qa)}h.ub=function(a,b,c,d,e,f,g,k,l){k=0;var m=a.O,p=null,q;m||(k=a.rb?Y.Gc:Y.Fc,e=0);for(;e;){if(!p){if(b>=m.L){k=Y.be;break}p=m.seek(b,c,d+1);if(!p){k=Y.Mc;break}q=0;++d>=m.P&&(d=0,++c>=m.T&&(c=0,++b))}var x;if(0>(a=m.read(p,q++))||0>(x=m.read(p,q++))){k=Y.Lc;break}Hb(this.u,od(this.c,f),a|x<<8);q>=m.Z&&(p=null);f+=g;e--}return l?l(k,b,c,d,e,f):k};
|
||||
function Ug(a){var b=0,c=a.a&X.Qc?1:0,d=a.b[c],d=d&&d.O,e=a.v&Wg.Fa,f=a.s&Xg.Fa;a.f&=~(Z.fd|Z.rd|Z.Cb|Z.ha);if(d)if(a.f|=Z.ha,c=d.seek(e,0,f,!0)){e=0;for(f=a.h.length;e<f;){var g=d.read(c,e);if(0>g){b=Y.Lc;break}a.h[e++]=g}c.Ne&&(a.f|=Z.Cb)}else b=Y.Mc;else b=c?Y.Gc:Y.Fc;Vg(a,b)}h.Vf=function(a,b){a=this.a;if(!b)switch(a&=X.Fb,this.g){case W.Bc:case W.EMPTY:this.i<this.h.length&&(this.a|=X.Ga);break;case W.Va:case W.Hb:case W.dc:2>this.i&&(this.a|=X.Ga)}return a};
|
||||
h.ih=function(a){this.a=this.a&~X.va|a&X.va;if(this.a&X.INIT)this.bb();else if(this.a&X.Db&&this.g==W.gb)switch(this.g=this.a&X.ca,this.a&=~(X.Db|X.Ga|X.DONE|X.Ja),(a=this.qa)&&mc(this.c,a),this.g){case W.Bc:case W.EMPTY:case W.Va:case W.Hb:case W.dc:this.i=0;break;case W.ge:a=this.b[this.a&X.Qc?1:0];this.f&=~Z.ha;a&&a.O&&(this.f|=Z.ha);this.l=this.f;Vg(this);break;case W.fe:this.l=this.w,Vg(this)}else this.a&X.eb?this.a&X.DONE&&K(this.c,this.qa):(a=this.qa)&&mc(this.c,a)};
|
||||
h.Wf=function(a,b){if(!b)switch(this.g){case W.EMPTY:this.a&X.Ga&&(this.a&=~X.Ga,this.l=this.h[this.i]&255,++this.i>=this.h.length&&Vg(this))}return this.l};
|
||||
h.jh=function(a){switch(this.g){case W.Bc:this.a&X.Ga&&(this.a&=~X.Ga,this.h[this.i]=a&255,++this.i>=this.h.length&&Vg(this));break;case W.Va:case W.Hb:case W.dc:if(this.a&X.Ga)switch(this.a&=~X.Ga,this.i++){case 0:this.s=a;break;case 1:if(this.v=a,this.g==W.Va)Ug(this);else{var b=this.g==W.dc,c=0,d=this.a&X.Qc?1:0,e=this.b[d],e=e&&e.O,f=this.v&Wg.Fa,g=this.s&Xg.Fa;this.f&=~(Z.fd|Z.rd|Z.Cb|Z.ha);if(e)if(this.f|=Z.ha,d=e.seek(f,0,g,!0))for(b&&(d.Ne=!0),b=0,f=this.h.length;b<f;){if(!e.write(d,b,this.h[b]&
|
||||
255)){c=Y.Lc;break}b++}else c=Y.Mc;else c=d?Y.Gc:Y.Fc;Vg(this,c)}}}this.l=a};var X=eb.te,Wg=eb.we,Xg=eb.ve,Z=eb.ue,W=eb.ca,Y=eb.ERROR,Yg={},Tg=(Yg[65144]=[null,null,wc.prototype.Vf,wc.prototype.ih,"RXCS"],Yg[65146]=[null,null,wc.prototype.Wf,wc.prototype.jh,"RXDB"],Yg);
|
||||
function Zg(a,b,c){r.call(this,"Computer",a,33554432);this.j.R=!1;this.F=null;$g(this,b);this.w=Oc(this,"autoPower",a,6);this.g=0;this.J=+a.busWidth||+a.buswidth;this.s=this.i=this.v=null;this.l=this.I=!1;this.m=this.h=null;this.H=this.B=this.C=!1;this.K=Oc(this,"url")||"";(Math.random()+.1).toString(36);this.b=ah(this);if(this.c=ta("CPU",this.id)){this.D=ta("Debugger",this.id);this.u=new Nb({id:this.Ua+".bus",busWidth:this.J},this.c,this.D);var d,e=ra(this.id);if((this.f=ta("Panel",this.id))&&this.f.ob)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.G=this.f.G,d.aa=this.f.aa,d.ob=this.f.ob;this.aa(bb+" v1.33.1\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.aa("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis <http://skn.noip.me/pdp11/pdp11.html>");for(b=0;b<e.length;b++)d=e[b],d.ja&&d.ja(this,this.u,this.c,this.D);b=null;d=Oc(this,"resume",a);void 0!==d&&(1<d.length?b=this.i=d:this.a=parseInt(d,10));var f;if(a=Oc(this,
|
||||
"state")||(f=!0,a.state))this.v=b=a,f||(this.l=!0,this.a=bh),this.a&&(this.m=new E(this,"1.33.1"),ch(this.m)?b=null:delete this.m);!b&&this.a&&(b=dh(this))&&(this.l=!0);if(b){var g=this;Ha(b,null,!0,function(a,b,c){c?(g.i=null,g.l=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+Ea(b):"")+")")):(g.s=b,g.I=!0);B(g)})}else B(this);this.o.power||(this.w=!0);!c&&this.w&&eh(this,this.Rb)}else u("Unable to find CPU component")}n(Zg,r);
|
||||
function $g(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.F=b}function Oc(a,b,c,d){var e=b.toLowerCase(),e=Pa(b)||Pa(e);void 0===e&&a.F&&(e=a.F[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}
|
||||
function eh(a,b,c){for(var d=ra(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ua(f)){ua(f,function(){eh(a,b,c)});return}}b.call(a,c)}function fh(a,b){var c=new E(a,"1.33.1",gh);if(ch(c)&&hh(c)){var d=c.get(ih),e=b?b.get(ih):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Zg.prototype;
|
||||
h.Rb=function(a){void 0===a&&(a=this.a||(this.s?jh:bh));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.m||new E(this,"1.33.1");if(a==kh)b=!0;else if(a>bh){if(ch(d,this.s)){this.h=new E(this,"1.33.1",nh);ch(this.h)&&(oh(this,d),a=ph,qh(this.h));this.h.set(ih,Ga());rh(this.h);var e=this.a&&!this.l;if(a==jh||qa("Click OK to restore the previous "+bb+" machine state, or CANCEL to reset the machine.")){if(c=hh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ch(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.G("Error: "+g),"unable to verify user"==g&&(Na(sh,""),this.b=null)):this.aa(f+": "+g),qh(d),ch(d)?(c=hh(d),e=!0):c=!1))}e&&fh(this,c?d:null)}else a==ph&&d.clear()}else fh(this);delete this.s;delete this.m}e=ra(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=th(this,g,d,b,c));b=[d,a,c];a!=kh?eh(this,this.Bd,b):this.Bd(b)}};
|
||||
function th(a,b,c,d,e){if(!b.j.R){b.j.R=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.la(f,d)&&f&&(u("Unable to restore state for "+b.type),a.v&&!a.I?(c.clear(),a.a=bh,window&&window.location.reload()):a.C=!0,b.la(null),e=!1),!d&&b.pd){var g=b.pd.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){u("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
|
||||
h.Bd=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.j.R=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.c&&(th(this,this.c,b,c,a),Fb(this,-2),this.c.Y());this.C&&(oh(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
||||
function oh(a,b){if(qa("There may be a problem with your "+bb+" machine.\n\nTo help us diagnose it, click OK to send this "+bb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=bb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;Ha("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function uh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.33.1"),g=new E(a,"1.33.1",gh),k=Ga();g.set(ih,k);f.set(ih,k);f.set(vh,"1.33.1");f.set(wh,window?window.location.href:null);f.set(xh,window?window.navigator.userAgent:"");a.c&&a.c.ka&&(c&&(b&&(a.c.j.Y=a.c.j.M),F(a.c)),d=a.c.ka(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.R=!1,!1===d&&(e=null)));for(var k=ra(a.id),l=0;l<k.length;l++){var m=k[l];m.j.R&&(m.ka&&(d=m.ka(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.j.R=
|
||||
!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.b&&yh(a,a.b,f.toString()),rh(g)&&rh(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==zh),d&&f.clear(k)):e=f.toString());c&&(a.j.R=!1,b=a.o.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.u&&this.u.reset&&this.u.reset();this.c&&this.c.reset&&this.c.reset();for(var a=ra(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.u&&c!==this.c&&c.reset&&c.reset()}Fb(this,-1)};
|
||||
h.start=function(a,b){for(var c=ra(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}Fb(this,-1)};h.stop=function(a,b){for(var c=ra(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}Fb(this,-1)};
|
||||
function Fb(a,b){if(a.c){var c=a.c,d=b||0,e=c.o.speed;e&&(0>=d||30<=(c.cd+=d))&&(e.textContent=c.j.M?c.Wa.toFixed(2)+"Mhz":"Stopped",c.cd=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.M;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;e<a.c.b.length;e++)vb(a,"R"+e,a.c.b[e]);e=sc(a.c);vb(a,"PS",e);vb(a,"NF",e&8?1:0,1);vb(a,"ZF",e&4?1:0,1);vb(a,"VF",e&2?1:0,1);vb(a,"CF",e&1?1:0,1);a.i=0}-1>b?a.V=a.c.b[7]:0<b&&c&&!d&&(a.V=a.c.Ka);rb(a,a.V);ib(a,a.f);b=a.c;b=b.kb?b.ta&16?1:2:4;Kb(a,"B22",b&1);Kb(a,"B18",b&2);Kb(a,
|
||||
"B16",b&4)}}
|
||||
h.ka=function(a,b,c){var d=this;switch(b){case "power":return this.m[b]=c,c.onclick=function(){d.g||(d.j.O?oh(d,!1,!0):Zg(d,d.Fb))},!0;case "reset":return this.m[b]=c,c.onclick=function(){if(d.j.O&&!d.g)if(d.a&&!d.i){var a=wa("Click OK to save changes to this "+hb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");oh(d,a,!0);!a&&d.v?window&&window.location.reload():(a||(d.B=!0),d.Fb(Wg),d.B=!1)}else d.reset(),d.c&&d.c.Y()},!0;case "save":if(Ha(Qa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.m[b]=
|
||||
c,c.onclick=function(){var a=Vg(d,!0);if(a){var b=!!(d.a&&!d.i||d.v),c=oh(d,b);b?sh(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function Vg(a,b){var c=a.b;c||((c=Ta(mh),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=uh(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||
function uh(a,b){a.b=null;b=Oa(Qa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ua(mh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function Yg(a){var b=null;a.b&&(b=Qa()+"/api/v1/user?req=load&user="+a.b+"&state="+vh(a,"1.33.1"));return b}
|
||||
function sh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=vh(a,"1.33.1");d.data=c;b=Oa(Qa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),Ua(mh,""),a.b=null)}}
|
||||
function Vf(a){var b;a=xa(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function $c(a){if(a.gb){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.gb.focus();window&&window.scrollTo(b,c)}}var fh="failsafe",ah="validate",ch="timestamp",ph="version",qh="url",rh="browser",mh="user",eh=-1,Wg=0,dh=1,jh=2,th=3;
|
||||
Za(function(){for(var a=A(document,x+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=v(c),c=A(c,x,"computer"),e=0;e<c.length;e++){var f=c[e],g=v(f),g=new Tg(g,d,!0);w(g,f);g.w&&Zg(g,g.Fb)}});$a.show.push(function(){for(var a=A(document,x,"computer"),b=0;b<a.length;b++){var c=v(a[b]);(c=za("Computer",c.id))&&c.H&&!c.j.O&&c.Fb(eh)}});$a.exit.push(function(){for(var a=A(document,x,"computer"),b=0;b<a.length;b++){var c=v(a[b]);(c=za("Computer",c.id))&&c.j.O&&oh(c,!(!c.a||c.i),!0)}});
|
||||
function E(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.m=!1;this.key=vh(a,b,c);kh(this,a.he)}h=E.prototype;h.set=function(a,b){try{this.c[a]=b}catch(c){}};h.get=function(a){return this.c[a]||null};h.data=function(){return this.c};function Xg(a,b){return b?(a.a=b,a.b=!0,a.m=!1,!0):a.b?!0:Ra()&&(b=Ta(a.key))?(a.a=b,a.b=!0):!1}function bh(a){var b=!0;if(!a.m)try{a.c=JSON.parse(a.a),a.m=!0}catch(c){u(c.message||c),b=!1}return b}
|
||||
function lh(a){var b=!0;if(Ra()){var c=JSON.stringify(a.c);Ua(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function kh(a,b){a.a="";a.c={};a.b=a.m=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){kh(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function vh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var wh=0;
|
||||
function xh(a,b,c,d,e,f){e("Loading "+a+"...");Oa(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):yh(k,a,b,c,d,e,f)})}
|
||||
function yh(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(ta(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?zh(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function zh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Oa(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);zh(a,b,c)}})}else c(a,null)}
|
||||
function Ah(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ia(a))}function f(a){e("Error: "+a);l&&(--wh||cb(!0));l=!1}var g,k,l=!0;wh++;ua[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c||
|
||||
(c="/versions/pdpjs/1.33.1/components.xsl");m=function(d,k){k?xh(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,--wh||cb(!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),--wh||cb(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xh(b,a,d,!0,e,m):yh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return Ah(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=cb;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11.map
|
||||
h.ma=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.g||(d.j.R?uh(d,!1,!0):eh(d,d.Rb))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.R&&!d.g)if(d.a&&!d.i){var a=qa("Click OK to save changes to this "+bb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");uh(d,a,!0);!a&&d.v?window&&window.location.reload():(a||(d.B=!0),d.Rb(bh),d.B=!1)}else d.reset(),d.c&&!d.D&&d.c.Y()},!0;case "save":if(Ba(Ja(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]=
|
||||
c,c.onclick=function(){var a=ah(d,!0);if(a){var b=!!(d.a&&!d.i||d.v),c=uh(d,b);b?yh(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function ah(a,b){var c=a.b;c||((c=Ma(sh),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=Ah(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||
function Ah(a,b){a.b=null;b=Ha(Ja()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Na(sh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function dh(a){var b=null;a.b&&(b=Ja()+"/api/v1/user?req=load&user="+a.b+"&state="+Bh(a,"1.33.1"));return b}
|
||||
function yh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Bh(a,"1.33.1");d.data=c;b=Ha(Ja()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),Na(sh,""),a.b=null)}}
|
||||
function Tf(a){var b;a=ra(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function Vc(a){if(a.ob){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.ob.focus();window&&window.scrollTo(b,c)}}var nh="failsafe",gh="validate",ih="timestamp",vh="version",wh="url",xh="browser",sh="user",kh=-1,bh=0,jh=1,ph=2,zh=3;
|
||||
Ta(function(){for(var a=z(document,y+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=v(c),c=z(c,y,"computer"),e=0;e<c.length;e++){var f=c[e],g=v(f),g=new Zg(g,d,!0);w(g,f);g.w&&eh(g,g.Rb)}});Ua.show.push(function(){for(var a=z(document,y,"computer"),b=0;b<a.length;b++){var c=v(a[b]);(c=ta("Computer",c.id))&&c.H&&!c.j.R&&c.Rb(kh)}});Ua.exit.push(function(){for(var a=z(document,y,"computer"),b=0;b<a.length;b++){var c=v(a[b]);(c=ta("Computer",c.id))&&c.j.R&&uh(c,!(!c.a||c.i),!0)}});
|
||||
function E(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.o=!1;this.key=Bh(a,b,c);qh(this,a.Ee)}h=E.prototype;h.set=function(a,b){try{this.c[a]=b}catch(c){}};h.get=function(a){return this.c[a]||null};h.data=function(){return this.c};function ch(a,b){return b?(a.a=b,a.b=!0,a.o=!1,!0):a.b?!0:Ka()&&(b=Ma(a.key))?(a.a=b,a.b=!0):!1}function hh(a){var b=!0;if(!a.o)try{a.c=JSON.parse(a.a),a.o=!0}catch(c){u(c.message||c),b=!1}return b}
|
||||
function rh(a){var b=!0;if(Ka()){var c=JSON.stringify(a.c);Na(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function qh(a,b){a.a="";a.c={};a.b=a.o=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){qh(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function Bh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var Ch=0;
|
||||
function Dh(a,b,c,d,e,f){e("Loading "+a+"...");Ha(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):Eh(k,a,b,c,d,e,f)})}
|
||||
function Eh(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(na(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Fh(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Fh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ha(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);Fh(a,b,c)}})}else c(a,null)}
|
||||
function Gh(a,b,c,d){function e(a){if(void 0===k){var b=g&&z(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ca(a))}function f(a){e("Error: "+a);l&&(--Ch||Xa(!0));l=!1}var g,k,l=!0;Ch++;oa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=m:q.appendChild(document.createTextNode(m));p.appendChild(q)}c||
|
||||
(c="/versions/pdpjs/1.33.1/components.xsl");m=function(d,k){k?Dh(c,null,null,!1,e,function(d,l){l?(na(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--Ch||Xa(!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),--Ch||Xa(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Dh(b,a,d,!0,e,m):Eh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Xa(!1);return Gh(a,b,c,d)};window.findMachineComponent=function(a,b){return ta(b,a+".machine")};window.enableEvents=Xa;window.sendEvent=Za;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11.map
|
||||
|
|
|
|||
Loading…
Reference in a new issue