Improved separation of FDC media parameters from drive parameters
This commit is contained in:
parent
2ce025aa78
commit
1809543577
32 changed files with 1915 additions and 1887 deletions
|
|
@ -16,7 +16,7 @@ when the keyboard's "clock" line is toggled (see *set8042CmdData()* in [chipset.
|
|||
a 40-track diskette).
|
||||
+ The BIOS Diskette Reset function does something odd after resetting the Floppy Disk Controller: it
|
||||
issues not one but *four* "SENSE INTERRUPT STATUS" commands to the FDC, and expects each response to
|
||||
return an incrementally larger drive number. I found this a bit mystifying, considering that the IBM's
|
||||
return an incrementally larger drive number. I found this a bit mystifying, considering that IBM's
|
||||
own FDC/HDC "combo card" supports a maximum of *two* diskette drives. But, there's no point in arguing
|
||||
with a BIOS that's almost 30 years old.
|
||||
+ The BIOS attempts to detect what its authors must have considered a common problem: failure to run SETUP
|
||||
|
|
@ -28,22 +28,22 @@ to discover that the ATC had this behavior, and now I'm wondering how many other
|
|||
immediate "STATUS" register updates.
|
||||
|
||||
This PCjs release also fixes a problem reported by a user: if you disable **localStorage** support in your
|
||||
browser, previous versions would fault. I knew that every browser that supports PCjs also supports
|
||||
**localStorage**, but I didn't consider what might happen if a user had decided to turn it off.
|
||||
browser, previous versions of PCjs would fault. While every browser that supports PCjs also supports
|
||||
**localStorage**, I didn't consider what might happen if a user decided to turn it off.
|
||||
|
||||
The only downside to turning off **localStorage** is that none of your PCjs machines will be able save/restore
|
||||
their state when you leave/return to the page, so they will always reboot.
|
||||
their state when you leave/return to the page; they will always reboot.
|
||||
|
||||
Browser's don't always refer to the **localStorage** feature by its actual name, either. For example, in
|
||||
Chrome, the setting that enables/disables **localStorage** is hidden under "Advanced Settings" => "Privacy" =>
|
||||
"Content Settings" => "Cookies" => "Allow local data to be set (recommended)". Which is a little misleading
|
||||
and annoying, because **localStorage** != **cookie**.
|
||||
"Content Settings" => "Cookies" => "Allow local data to be set (recommended)". Which is somewhat misleading
|
||||
and a little annoying, because **localStorage** is *not* a **cookie**.
|
||||
|
||||
PCjs *never* sets any cookies. Cookies are bits of data that your browser saves and then automatically sends
|
||||
off to the server every time you make a request. **localStorage** is nothing more than local storage. Granted,
|
||||
a JavaScript application could certainly abuse it and send it around like a cookie, but PCjs doesn't do that.
|
||||
The only exception is when PCjs detects a problem, and even then, you must first agree to submit your machine's
|
||||
state as part of the bug report.
|
||||
off to the server every time you make a request. **localStorage** is nothing more than local storage; it is
|
||||
*not* automatically sent anywhere. Granted, a JavaScript application could abuse it and send it around like a
|
||||
cookie, but PCjs does *not* do that; the only exception is when PCjs detects a problem, and even then, you must
|
||||
first agree to submit your machine's state as part of the bug report.
|
||||
|
||||
*[@jeffpar](http://twitter.com/jeffpar)*
|
||||
*October 17, 2014*
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ The following features are targeted for version 1.16:
|
|||
|
||||
### History
|
||||
|
||||
+ v1.15 introduced PC AT (Model 5170) emulation, as discussed on our [Blog](/blog/2014/09/13/).
|
||||
+ v1.14 introduced limited EGA emulation, as discussed on our [Blog](/blog/2014/07/30/).
|
||||
+ v1.15 introduced PC AT (Model 5170) emulation, as discussed in the [blog](/blog/2014/09/13/).
|
||||
+ v1.14 introduced limited EGA emulation, as discussed in the [blog](/blog/2014/07/30/).
|
||||
+ v1.13 introduced manifest files that describe software packages that can be used with PCjs.
|
||||
More information on software manifests is available [here](/apps/).
|
||||
+ v1.12.1 coincided with the first release of the new PCjs web server running on [Node.js](http://nodejs.org).
|
||||
|
|
|
|||
|
|
@ -36,17 +36,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var http = require("http");
|
||||
var mkdirp = require("mkdirp");
|
||||
var crypto = require("crypto");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var http = require("http");
|
||||
var mkdirp = require("mkdirp");
|
||||
var crypto = require("crypto");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var X86 = require("../../pcjs-client/lib/x86");
|
||||
var X86 = require("../../pcjs-client/lib/x86");
|
||||
|
||||
/**
|
||||
* @class exports
|
||||
|
|
@ -73,7 +73,7 @@ var fNormalize = true;
|
|||
*
|
||||
* TODO: Honor the caller's mbHD size. At the moment, any hard disk build request translates to 10Mb,
|
||||
* since we rely on a "canned" BPB in aDefaultBPBs.
|
||||
*
|
||||
*
|
||||
* TODO: If sServerRoot is set, make sure the final sDiskPath refers to something in either /apps/ or /disks/,
|
||||
* to prevent random enumeration of other server resources.
|
||||
*
|
||||
|
|
@ -114,7 +114,7 @@ function DiskDump(sDiskPath, asExclude, sFormat, fComments, mbHD, sServerRoot, s
|
|||
/*
|
||||
* If we have to enumerate one or more files during the buildImage() process, this array
|
||||
* will save them, in case the caller wants to query that information later, in updateManifest().
|
||||
*
|
||||
*
|
||||
* Originally, I thought each saved entry would be a subset of what the fileInfo objects contain,
|
||||
* but it turns out I pretty much need everything. This, in turn, means that some of the original
|
||||
* buildImage() functions could simply use this.aManifestInfo, instead of their own aFiles array,
|
||||
|
|
@ -196,7 +196,7 @@ DiskDump.MY_OEM_STRING = "PCJS.ORG";
|
|||
|
||||
/**
|
||||
* The BPBs that buildImage() currently supports; these BPBs should be in order of smallest to largest capacity,
|
||||
* to help insure we don't select a disk format larger than necessary.
|
||||
* to help insure we don't select a disk format larger than necessary.
|
||||
*/
|
||||
DiskDump.aDefaultBPBs = [
|
||||
[ // define BPB for 160Kb diskette
|
||||
|
|
@ -279,7 +279,7 @@ DiskDump.aDefaultBPBs = [
|
|||
* diskdump --dir={directory} [--format=json|data|hex|bytes|img] [--comments] [--output={file}]
|
||||
* diskdump --disk={disk image} [--format=json|data|hex|bytes|img] [--comments] [--output={file}]
|
||||
* diskdump --path={file[;file]...} [--format=json|data|hex|bytes|img] [--comments] [--output={file}]
|
||||
*
|
||||
*
|
||||
* NOTE: --img is permitted as an alias for --disk
|
||||
*
|
||||
* Arguments
|
||||
|
|
@ -290,9 +290,9 @@ DiskDump.aDefaultBPBs = [
|
|||
*
|
||||
* Note that command-line arguments, if any, are not validated. For example, argv['comments'] may be any of
|
||||
* boolean, string, or undefined, since the user may have typed "--comments" or "--comments=foo" or nothing at all.
|
||||
*
|
||||
*
|
||||
* Additional command-line arguments include:
|
||||
*
|
||||
*
|
||||
* --mbhd={number}: requests a hard disk image with the given number of megabytes (eg, 10 for a 10mb image)
|
||||
* --exclude={filename}: specifies a filename that should be excluded from the image; repeat as often as needed
|
||||
* --overwrite: allows the --output option to overwrite an existing file; default is to NOT overwrite
|
||||
|
|
@ -320,7 +320,7 @@ DiskDump.CLI = function()
|
|||
|
||||
var sDiskPath = null, sServerRoot = "";
|
||||
var sDir = argv['dir'], sDisk = (argv['disk'] || argv['img']), sPath = argv['path'];
|
||||
|
||||
|
||||
if (typeof sDir == "string") {
|
||||
sDiskPath = sDir;
|
||||
}
|
||||
|
|
@ -345,7 +345,7 @@ DiskDump.CLI = function()
|
|||
if (sManifestFile && sManifestFile.charAt(0) != '/') {
|
||||
sManifestFile = path.join(process.cwd(), sManifestFile);
|
||||
}
|
||||
|
||||
|
||||
var sOutput = "";
|
||||
var sOutputFile = argv['output'];
|
||||
if (typeof sOutputFile == "string" && !str.endsWith(sOutputFile, ".img") && !str.endsWith(sOutputFile, ".json")) {
|
||||
|
|
@ -362,14 +362,14 @@ DiskDump.CLI = function()
|
|||
}
|
||||
} else {
|
||||
sOutput = "disk";
|
||||
}
|
||||
}
|
||||
sOutputFile = sOutput + '.' + argv['format'];
|
||||
}
|
||||
if (sOutputFile && sOutputFile.charAt(0) != '/') sOutputFile = path.join(process.cwd(), sOutputFile);
|
||||
|
||||
var fOverwrite = argv['overwrite'];
|
||||
var sManifestTitle = argv['title'];
|
||||
|
||||
|
||||
if (sDiskPath) {
|
||||
var disk = new DiskDump(sDiskPath, asExclude, argv['format'], argv['comments'], argv['mbhd'], sServerRoot, sManifestFile);
|
||||
if (sDir) {
|
||||
|
|
@ -394,7 +394,7 @@ DiskDump.CLI = function()
|
|||
else {
|
||||
console.log("usage: diskdump --dir={dir}|--disk={disk}|--path={file}[;{file}...] [--format=json|data|hex|bytes|img] [--comments] [--output={file}] [--manifest={file}]");
|
||||
}
|
||||
|
||||
|
||||
if (err) {
|
||||
DiskDump.logError(err);
|
||||
process.exit(1);
|
||||
|
|
@ -432,9 +432,9 @@ DiskDump.outputDisk = function(err, disk, sDiskPath, sOutputFile, fOverwrite, sM
|
|||
}
|
||||
}
|
||||
if (data) {
|
||||
|
||||
|
||||
var cbDisk = (disk.bufDisk? disk.bufDisk.length : data.length);
|
||||
|
||||
|
||||
if (sOutputFile) {
|
||||
|
||||
var fUnchanged;
|
||||
|
|
@ -448,7 +448,7 @@ DiskDump.outputDisk = function(err, disk, sDiskPath, sOutputFile, fOverwrite, sM
|
|||
}
|
||||
fUnchanged = DiskDump.updateManifest(disk, disk.sManifestFile, sDiskPath, sOutputFile, true, sManifestTitle, md5Disk, md5JSON);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (fUnchanged) {
|
||||
console.log(sOutputFile + " unchanged");
|
||||
|
|
@ -468,7 +468,7 @@ DiskDump.outputDisk = function(err, disk, sDiskPath, sOutputFile, fOverwrite, sM
|
|||
} else {
|
||||
/*
|
||||
* We'll dump JSON to the console, but not a raw disk buffer; we could add an option to
|
||||
* "stringify" buffers, but if that's what the caller wants, they should use "--format=json".
|
||||
* "stringify" buffers, but if that's what the caller wants, they should use "--format=json".
|
||||
*/
|
||||
if (typeof data == "string") {
|
||||
console.log(data);
|
||||
|
|
@ -480,7 +480,7 @@ DiskDump.outputDisk = function(err, disk, sDiskPath, sOutputFile, fOverwrite, sM
|
|||
err = new Error("unable to convert " + disk.sDiskPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (err) {
|
||||
DiskDump.logError(err);
|
||||
process.exit(1);
|
||||
|
|
@ -489,7 +489,7 @@ DiskDump.outputDisk = function(err, disk, sDiskPath, sOutputFile, fOverwrite, sM
|
|||
|
||||
/**
|
||||
* getManifestAttr(sID, sTag)
|
||||
*
|
||||
*
|
||||
* @param sID
|
||||
* @param sTag
|
||||
* @return {string|null}
|
||||
|
|
@ -503,14 +503,14 @@ DiskDump.getManifestAttr = function(sID, sTag)
|
|||
|
||||
/**
|
||||
* updateManifest(disk, sManifestFile, sDiskPath, sOutputFile, fOverwrite, sTitle, md5Disk, md5JSON)
|
||||
*
|
||||
*
|
||||
* This function reports a change if EITHER the md5Disk value does not match the original
|
||||
* "md5" value recorded in the manifest OR the manifest itself has changed. If md5JSON is
|
||||
* also provided, we require that to match as well.
|
||||
*
|
||||
*
|
||||
* Since this function is for command-line use only, we use *Sync functions, so that we can
|
||||
* return the results immediately.
|
||||
*
|
||||
*
|
||||
* @param {DiskDump} disk
|
||||
* @param {string} sManifestFile
|
||||
* @param {string} sDiskPath
|
||||
|
|
@ -523,9 +523,9 @@ DiskDump.getManifestAttr = function(sID, sTag)
|
|||
*/
|
||||
DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile, fOverwrite, sTitle, md5Disk, md5JSON)
|
||||
{
|
||||
var fUnchanged, fExists = false, sXML, err = null;
|
||||
var fUnchanged, fExists = false, sXML, err = null;
|
||||
var sMatchDisk = null, sIDDisk = null, sMD5Disk = null, sMD5JSON = null;
|
||||
|
||||
|
||||
try {
|
||||
sXML = fs.readFileSync(sManifestFile, {encoding: "utf8"});
|
||||
fExists = true;
|
||||
|
|
@ -544,7 +544,7 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
|
|||
sXML += '\t<title' + sPrefix + '>' + sTitle + '</title>\n';
|
||||
sXML += '</manifest>';
|
||||
}
|
||||
|
||||
|
||||
var i = sOutputFile.indexOf("/disks/");
|
||||
if (i > 0) {
|
||||
sOutputFile = sOutputFile.substr(i);
|
||||
|
|
@ -562,7 +562,7 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
|
|||
sMD5Disk = DiskDump.getManifestAttr("md5", match[1]);
|
||||
sMD5JSON = DiskDump.getManifestAttr("md5json", match[1]);
|
||||
}
|
||||
|
||||
|
||||
if (!sIDDisk) {
|
||||
for (i = 1; i < 1000; i++) {
|
||||
sIDDisk = i.toString();
|
||||
|
|
@ -574,7 +574,7 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
|
|||
err = new Error("manifest already contains " + i + " disks");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!err) {
|
||||
/*
|
||||
* Thanks to buildImage(), fDir is true if a "dir" parameter was provided, false if a "path" parameter was provided,
|
||||
|
|
@ -586,10 +586,10 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
|
|||
} else if (disk.fDir === undefined) {
|
||||
sParm = "img";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Build a "size" attribute with the total disk size in bytes and a "chs" attribute that describes the disk geometry; eg:
|
||||
*
|
||||
*
|
||||
* size="368640" chs="40:2:9"
|
||||
*/
|
||||
var size = 0, sCHS = "";
|
||||
|
|
@ -598,7 +598,7 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
|
|||
size = disk.dataDisk.length * disk.dataDisk[0].length * disk.dataDisk[0][0].length * disk.dataDisk[0][0][0].length;
|
||||
}
|
||||
var sXMLDisk = '\t<disk id="' + sIDDisk + '"' + (size? ' size="' + size + '"' : '') + (sCHS? ' chs="' + sCHS + '"' : '') + (sParm? ' ' + sParm + '="' + sDiskPath + '"' : '') + ' href="' + sOutputFile + '"' + (md5Disk? ' md5="' + md5Disk + '"' : '') + (md5JSON? ' md5json="' + md5JSON + '"' : '') + '>\n';
|
||||
|
||||
|
||||
var sName = "";
|
||||
if (sMatchDisk && (match = sMatchDisk.match(/<name>([^>]*)<\/name>/))) {
|
||||
sName = match[1];
|
||||
|
|
@ -618,7 +618,7 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
|
|||
var fileInfo = disk.aManifestInfo[i];
|
||||
if (fileInfo.FILE_SIZE < 0) continue; // ignore non-file entries
|
||||
var sDir = path.dirname(fileInfo.FILE_PATH) + '/';
|
||||
if (sBaseDir === null) sBaseDir = sDir;
|
||||
if (sBaseDir === null) sBaseDir = sDir;
|
||||
sAttrs += ' size="' + fileInfo.FILE_SIZE + '"';
|
||||
sAttrs += ' time="' + usr.formatDate("Y-m-d H:i:s", fileInfo.FILE_TIME) + '"';
|
||||
sAttrs += ' attr="0x' + fileInfo.FILE_ATTR.toString(16) + '"';
|
||||
|
|
@ -713,7 +713,7 @@ DiskDump.getStat = function(sPath, done)
|
|||
|
||||
/**
|
||||
* readFile(sPath, sEncoding, done)
|
||||
*
|
||||
*
|
||||
* An alternative to fs.readFile() that handles supported remote files, in addition to local files
|
||||
*
|
||||
* @param {string} sPath
|
||||
|
|
@ -753,7 +753,7 @@ DiskDump.readFile = function(sPath, sEncoding, done)
|
|||
*
|
||||
* @this {DiskDump}
|
||||
* @param {string} sName is the basename of a file under consideration
|
||||
* @return {boolean} is true if the file should be excluded, false if not
|
||||
* @return {boolean} is true if the file should be excluded, false if not
|
||||
*/
|
||||
DiskDump.prototype.isExcluded = function(sName)
|
||||
{
|
||||
|
|
@ -818,7 +818,7 @@ DiskDump.prototype.setData = function(err, buf, done)
|
|||
* with comments, so if the caller has requested comments, we immediately convert the
|
||||
* JSON to a Buffer and throw the JSON away. The next convertToJSON() call will take care
|
||||
* of the rest.
|
||||
*
|
||||
*
|
||||
* We could also move this functionality into its own function, or wait until the
|
||||
* caller actually calls convertToJSON() -- although if the caller inadvertently calls
|
||||
* convertToJSON() multiple times, you don't want to be regenerating the JSON every time.
|
||||
|
|
@ -1049,7 +1049,7 @@ DiskDump.ATTR_ARCHIVE = 0x20;
|
|||
*
|
||||
* @this {DiskDump}
|
||||
* @param {Date} dateTime
|
||||
* @return {boolean} true if date/time modified, false if not
|
||||
* @return {boolean} true if date/time modified, false if not
|
||||
*/
|
||||
DiskDump.prototype.validateTime = function(dateTime)
|
||||
{
|
||||
|
|
@ -1067,7 +1067,7 @@ DiskDump.prototype.validateTime = function(dateTime)
|
|||
* nothing that in PC-DOS 2.0, I observed a date with the largest possible year value (127) displayed as
|
||||
* "12-31-:7" (an ASCII ':' is the next highest character after '0'). While that DOES distinguish the year
|
||||
* 2007 from the year 2107, we probably shouldn't allow any year > 2099, to eliminate confusion.
|
||||
*
|
||||
*
|
||||
* In fact, it might be worth setting the upper limit to 2079, otherwise a date like "12-31-81" is ambiguous
|
||||
* (it could mean 1981 or 2081). But I'll stick to a limit of 2099 for now.
|
||||
*/
|
||||
|
|
@ -1168,19 +1168,19 @@ DiskDump.prototype.readDir = function(sDir, fRoot, done)
|
|||
done(err, null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sorting file names now (since they're just strings) is easier/faster than sorting the filtered
|
||||
* aFiles array later (which would require the use of a compare function), so we do the sort now; it
|
||||
* has no bearing on the outcome. Note that the lack of a stable sort in JavaScript also has no
|
||||
* bearing, because we're sorting on name, and every name is different.
|
||||
*
|
||||
*
|
||||
* However, it's not entirely clear whether this is strictly necessary. I think the variations in
|
||||
* file name order that I was originally seeing may have simply been due to out-of-order fs.stat()
|
||||
* calls, because I used to call addManifestInfo() in the callback.
|
||||
*/
|
||||
// if (fNormalize) asFiles.sort();
|
||||
|
||||
|
||||
for (iFile = 0; iFile < asFiles.length; iFile++) {
|
||||
var sFileName = asFiles[iFile];
|
||||
/*
|
||||
|
|
@ -1201,7 +1201,7 @@ DiskDump.prototype.readDir = function(sDir, fRoot, done)
|
|||
fileInfo.FILE_NAME = obj.buildName(sFileName);
|
||||
fileInfo.FILE_PATH = sFilePath;
|
||||
aFiles.push(fileInfo);
|
||||
|
||||
|
||||
/*
|
||||
* We add the fileInfo objects to the aManifestInfo array NOW, because the fs.stat() callbacks may
|
||||
* occur out-of-order. The only downside is that non-file entries can now appear in the array, which
|
||||
|
|
@ -1209,7 +1209,7 @@ DiskDump.prototype.readDir = function(sDir, fRoot, done)
|
|||
*/
|
||||
obj.addManifestInfo(fileInfo);
|
||||
}
|
||||
|
||||
|
||||
var errSave = null;
|
||||
for (iFile = 0; iFile < aFiles.length; iFile++) {
|
||||
if (!aFiles[iFile].FILE_PATH) continue;
|
||||
|
|
@ -1332,7 +1332,7 @@ DiskDump.prototype.readPath = function(sPath, done)
|
|||
var obj = this;
|
||||
var cCallbacks = 0;
|
||||
var errSave = null;
|
||||
|
||||
|
||||
for (iFile = 0; iFile < aFiles.length; iFile++) {
|
||||
if (!aFiles[iFile].FILE_PATH) continue;
|
||||
(function readPathEntry(fileInfo) {
|
||||
|
|
@ -1341,7 +1341,7 @@ DiskDump.prototype.readPath = function(sPath, done)
|
|||
/*
|
||||
* TODO: See if we can eliminate some of the unfortunate redundancy between the code
|
||||
* below and the very similar code in readDir(), such as the "README.md" pre-processing.
|
||||
*
|
||||
*
|
||||
* However, in this case, because we want readPath() to support both local and remote
|
||||
* paths, we call DiskDump.readFile() instead of fs.readFile().
|
||||
*/
|
||||
|
|
@ -1897,15 +1897,15 @@ DiskDump.prototype.buildImageFromFiles = function(aFiles, done)
|
|||
*/
|
||||
var cbMax = (this.mbHD? this.mbHD * 1024 * 1024 : 1440 * 1024);
|
||||
var cbTotal = this.calcFileSizes(aFiles);
|
||||
|
||||
|
||||
if (fDebug) console.log("total calculated size for " + aFiles.length + " files/folders: " + cbTotal + " bytes (0x" + str.toHex(cbTotal) + ")");
|
||||
|
||||
|
||||
if (cbTotal >= cbMax) {
|
||||
err = new Error("file(s) too large (" + cbTotal + " bytes total, " + cbMax + " bytes maximum)");
|
||||
done(err);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var abBoot, cbSector, cSectorsPerCluster, cbCluster, cFATs, cFATSectors;
|
||||
var cRootEntries, cRootSectors, cTotalSectors, cSectorsPerTrack, cHeads, cDataSectors, cbAvail;
|
||||
|
||||
|
|
@ -2027,7 +2027,7 @@ DiskDump.prototype.buildImageFromFiles = function(aFiles, done)
|
|||
offDisk += cClusters * cSectorsPerCluster * cbSector;
|
||||
|
||||
if (fDebug) console.log(offDisk + " bytes written, " + cbDisk + " bytes available");
|
||||
|
||||
|
||||
if (offDisk > cbDisk) {
|
||||
err = new Error("too much data for disk image (" + cClusters + " clusters required)");
|
||||
done(err);
|
||||
|
|
@ -2064,17 +2064,17 @@ DiskDump.prototype.convertToJSON = function()
|
|||
try {
|
||||
var cbDiskData = this.bufDisk.length;
|
||||
// console.log("length of buffer: " + cbDiskData);
|
||||
|
||||
|
||||
var nHeads = 0;
|
||||
var nCylinders = 0;
|
||||
var nSectorsPerTrack = 0;
|
||||
|
||||
|
||||
var aTracks = []; // track array (used only for disk images with track tables)
|
||||
var iTrack, cbTrack, offTrack, bufTrack, bufSector;
|
||||
|
||||
|
||||
var cbSector = 512; // default sector size
|
||||
var offBootSector = 0;
|
||||
|
||||
|
||||
if (cbDiskData >= 3000000) { // arbitrary threshold between diskette image sizes and hard disk image sizes
|
||||
/*
|
||||
* In this case, the first sector should be an MBR; find the active partition entry,
|
||||
|
|
@ -2093,10 +2093,10 @@ DiskDump.prototype.convertToJSON = function()
|
|||
* other reserved sectors.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
var bByte0 = this.bufDisk.readUInt8(offBootSector + DiskDump.BPB.JMP_OPCODE);
|
||||
var cbSectorBPB = this.bufDisk.readUInt16LE(offBootSector + DiskDump.BPB.SECTOR_BYTES);
|
||||
|
||||
|
||||
/*
|
||||
* These checks are not only necessary for DOS 1.x diskette images (and other pre-BPB images),
|
||||
* but also non-DOS diskette images (eg, CPM-86 diskettes).
|
||||
|
|
@ -2134,7 +2134,7 @@ DiskDump.prototype.convertToJSON = function()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!nHeads) {
|
||||
/*
|
||||
* Next, check for a DSK header (an old private format I used to use, which begins with either 0x00 (read-write) or 0x01 (write-protected),
|
||||
|
|
@ -2180,7 +2180,7 @@ DiskDump.prototype.convertToJSON = function()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nHeads) {
|
||||
/*
|
||||
* Output the disk data as an array of cylinders, each containing an array of tracks (one track per head),
|
||||
|
|
@ -2194,9 +2194,9 @@ DiskDump.prototype.convertToJSON = function()
|
|||
json = this.dumpLine(2, "[", "DiskDump of " + this.sDiskPath + " via " + DiskDump.sNotice);
|
||||
}
|
||||
for (var iCylinder=0; iCylinder < nCylinders; iCylinder++) {
|
||||
|
||||
|
||||
// if (fDebug) console.log("dumping cylinder " + iCylinder);
|
||||
|
||||
|
||||
var aHeads;
|
||||
if (this.fJSONNative) {
|
||||
aHeads = new Array(nHeads);
|
||||
|
|
@ -2206,9 +2206,9 @@ DiskDump.prototype.convertToJSON = function()
|
|||
}
|
||||
var offHead = 0;
|
||||
for (var iHead=0; iHead < nHeads; iHead++) {
|
||||
|
||||
|
||||
// if (fDebug) console.log(" dumping head " + iHead);
|
||||
|
||||
|
||||
if (aTracks.length) {
|
||||
var aTrack = aTracks[iTrack++];
|
||||
nSectorsPerTrack = aTrack[0];
|
||||
|
|
@ -2218,9 +2218,9 @@ DiskDump.prototype.convertToJSON = function()
|
|||
} else {
|
||||
bufTrack = this.bufDisk.slice(offTrack + offHead, offTrack + offHead + cbTrack);
|
||||
}
|
||||
|
||||
|
||||
// if (fDebug) console.log(" track buffer length: " + bufTrack.length);
|
||||
|
||||
|
||||
var aSectors;
|
||||
if (this.fJSONNative) {
|
||||
aSectors = new Array(nSectorsPerTrack);
|
||||
|
|
@ -2228,13 +2228,13 @@ DiskDump.prototype.convertToJSON = function()
|
|||
} else {
|
||||
json += this.dumpLine(2, "[", "head:" + this.sJSONWhitespace + iHead + ", track:" + this.sJSONWhitespace + iCylinder);
|
||||
}
|
||||
|
||||
|
||||
for (var iSector=1, offSector=0; offSector < cbTrack; iSector++, offSector += cbSector) {
|
||||
|
||||
|
||||
var sector = {};
|
||||
|
||||
|
||||
// if (fDebug) console.log(" dumping sector " + iSector);
|
||||
|
||||
|
||||
bufSector = bufTrack.slice(offSector, offSector + cbSector);
|
||||
if (this.fJSONNative) {
|
||||
sector['sector'] = iSector;
|
||||
|
|
@ -2304,7 +2304,7 @@ DiskDump.prototype.convertToJSON = function()
|
|||
|
||||
/**
|
||||
* convertOSIDiskToJSON()
|
||||
*
|
||||
*
|
||||
* This is called when we detect a "CW" signature at offset 0x900 of bufDisk, so we'll try parsing the data
|
||||
* as an OSI disk image, and output the data in JSON as an array of heads, each containing an array of tracks,
|
||||
* like so:
|
||||
|
|
@ -2344,7 +2344,7 @@ DiskDump.prototype.convertOSIDiskToJSON = function()
|
|||
var iTrack = 0;
|
||||
var offTrack = 0;
|
||||
var cbTrack = 0x900; // this is the raw track length for a 40-track 5.25-inch disk image
|
||||
|
||||
|
||||
if (this.fJSONNative) {
|
||||
json = "";
|
||||
} else {
|
||||
|
|
@ -2352,7 +2352,7 @@ DiskDump.prototype.convertOSIDiskToJSON = function()
|
|||
}
|
||||
json += this.dumpLine(2, "[");
|
||||
json += this.dumpLine(2, "["); // begin array of heads
|
||||
|
||||
|
||||
while (true) {
|
||||
var bufSector;
|
||||
var bufTrack = this.bufDisk.slice(offTrack, offTrack + cbTrack);
|
||||
|
|
@ -2449,7 +2449,7 @@ DiskDump.prototype.convertOSIDiskToJSON = function()
|
|||
* convertToIMG()
|
||||
*
|
||||
* Converts the disk image data to a Buffer.
|
||||
*
|
||||
*
|
||||
* TODO: Consider creating a caching mechanism for these requests (ie, stash a limited number of these
|
||||
* disk images under /tmp, using a name based on a hash of the source path).
|
||||
*
|
||||
|
|
@ -2507,7 +2507,7 @@ DiskDump.prototype.convertToIMG = function()
|
|||
* sectors per track, etc).
|
||||
*/
|
||||
var buf = null;
|
||||
|
||||
|
||||
try {
|
||||
/*
|
||||
* We need to be prepared for any number of errors due to malformed data; in fact, it's entirely
|
||||
|
|
@ -2518,10 +2518,10 @@ DiskDump.prototype.convertToIMG = function()
|
|||
var nHeads = this.dataDisk[0].length;
|
||||
var nSectorsPerTrack = this.dataDisk[0][0].length;
|
||||
var cbDisk = nCylinders * nHeads * nSectorsPerTrack * 512;
|
||||
|
||||
|
||||
var off = 0;
|
||||
buf = new Buffer(cbDisk);
|
||||
|
||||
|
||||
/*
|
||||
* WARNING: Buffers are NOT zero-initialized, so we need explicitly fill it with zeros (this seems to
|
||||
* be a reversal in the trend to zero buffers, when security concerns used to trump performance concerns).
|
||||
|
|
@ -2596,7 +2596,7 @@ DiskDump.prototype.convertToIMG = function()
|
|||
}
|
||||
if (buf.length < 3000000) { // arbitrary threshold between diskette image sizes and hard disk image sizes
|
||||
/*
|
||||
* Mimic the BPB test in convertToJSON(), because we don't want to blast an OEM string into non-DOS diskette images
|
||||
* Mimic the BPB test in convertToJSON(), because we don't want to blast an OEM string into non-DOS diskette images
|
||||
*/
|
||||
var bByte0 = buf.readUInt8(DiskDump.BPB.JMP_OPCODE);
|
||||
var cbSectorBPB = buf.readUInt16LE(DiskDump.BPB.SECTOR_BYTES);
|
||||
|
|
@ -2611,7 +2611,7 @@ DiskDump.prototype.convertToIMG = function()
|
|||
DiskDump.logError(err);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
this.bufDisk = buf;
|
||||
}
|
||||
return this.bufDisk;
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var mkdirp = require("mkdirp");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var mkdirp = require("mkdirp");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
|
||||
/**
|
||||
|
|
@ -661,7 +661,7 @@ FileDump.prototype.outputFile = function(sOutputFile, fOverwrite)
|
|||
} else {
|
||||
/*
|
||||
* We'll dump JSON to the console, but not a raw file buffer; we could add an option to
|
||||
* "stringify" buffers, but if that's what the caller wants, they should use "--format=json".
|
||||
* "stringify" buffers, but if that's what the caller wants, they should use "--format=json".
|
||||
*/
|
||||
if (typeof data == "string") {
|
||||
console.log(data);
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ var glob = require("glob");
|
|||
var HTTPAPI = require("./httpapi");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var MarkOut = require("../../markout");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
|
||||
/**
|
||||
* @class exports
|
||||
|
|
|
|||
|
|
@ -32,24 +32,24 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
||||
/**
|
||||
* @class exports
|
||||
* @property {function(string)} sync
|
||||
*/
|
||||
var mkdirp = require("mkdirp");
|
||||
var mkdirp = require("mkdirp");
|
||||
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var DiskDump = require("../../diskdump");
|
||||
var FileDump = require("../../filedump");
|
||||
var UserAPI = require("../../shared/lib/userapi");
|
||||
var ReportAPI = require("../../shared/lib/reportapi");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var UserAPI = require("../../shared/lib/userapi");
|
||||
var ReportAPI = require("../../shared/lib/reportapi");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var DiskDump = require("../../diskdump");
|
||||
var FileDump = require("../../filedump");
|
||||
|
||||
/**
|
||||
* @type {HTMLOut}
|
||||
|
|
@ -59,7 +59,7 @@ var HTMLOut;
|
|||
/**
|
||||
* sServerRoot is the root directory of the web server; it can (and should) be overridden using by the Express
|
||||
* web server using setRoot().
|
||||
*
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
var sServerRoot = "";
|
||||
|
|
@ -70,7 +70,7 @@ var sServerRoot = "";
|
|||
* the entries on the left-hand side should contain trailing slashes.
|
||||
*
|
||||
* FYI, here's what the jsmachines.net .htaccess contained before we retired its Apache webserver:
|
||||
*
|
||||
*
|
||||
* Redirect permanent /c1p /docs/c1pjs/
|
||||
* Redirect permanent /c1pjs /docs/c1pjs/
|
||||
* Redirect permanent /pc /docs/pcjs/
|
||||
|
|
@ -118,10 +118,10 @@ var externalRedirects = {
|
|||
* and continue until a match is found, at which point the okens =cement is performed and comparisons stop;
|
||||
* we could make the replacement process "additive", by continuing comparisons/replacements until the
|
||||
* end is reached, but let's not, unless there's an actual need.
|
||||
*
|
||||
*
|
||||
* In fact, until I find a compelling need for any of these redirects, I'm going to disable them, so that we
|
||||
* don't waste time running RegExp tests on every server request.
|
||||
*
|
||||
*
|
||||
* Feel free to use subgroups on the left-hand side, and references to them (eg, $1, $2, etc) on the right.
|
||||
*/
|
||||
var internalRedirects = {
|
||||
|
|
@ -238,7 +238,7 @@ HTTPAPI.filterAPI = function(req, res, next)
|
|||
|
||||
/**
|
||||
* hasAPICommand(req, asCommands)
|
||||
*
|
||||
*
|
||||
* @param {Object} req
|
||||
* @param {Array.<string>} asCommands (eg, DumpAPI.asDiskCommands or DumpAPI.asFileCommands)
|
||||
* @returns {Array|null}
|
||||
|
|
@ -256,7 +256,7 @@ HTTPAPI.hasAPICommand = function(req, asCommands)
|
|||
|
||||
/**
|
||||
* initUserVolume(vol, fd, cbInit)
|
||||
*
|
||||
*
|
||||
* @param {Object} vol
|
||||
* @param {number} fd
|
||||
* @param {number} cbInit
|
||||
|
|
@ -326,7 +326,7 @@ HTTPAPI.openUserVolume = function(sPath, sMachine, sUser, sMode, cbInit, done)
|
|||
* and return DiskAPI.FAIL.REVOKED; otherwise, there's no real protection of volume
|
||||
* integrity here. One of the challenges will be ensuring the list of revoked machine
|
||||
* IDs doesn't grow without bound.
|
||||
*
|
||||
*
|
||||
* When revoking, we should also be able to reuse the current vol by simply updating its
|
||||
* machine ID; there's no need to close and re-open the file (although assuming revocation
|
||||
* is a rare occurrence, it shouldn't much matter).
|
||||
|
|
@ -338,17 +338,17 @@ HTTPAPI.openUserVolume = function(sPath, sMachine, sUser, sMode, cbInit, done)
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!vol) {
|
||||
vol = {fd: null, mode: sMode, path: sPath, machine: sMachine};
|
||||
userVolumes[sUser] = vol;
|
||||
}
|
||||
|
||||
|
||||
var nResponse = 200;
|
||||
var sResponse = null;
|
||||
|
||||
if (!vol.fd) {
|
||||
|
||||
|
||||
HTMLOut.logDebug('HTMLOut.openUserVolume("' + sPath + '")');
|
||||
|
||||
fs.open(sPath, "r+", function(err, fd) {
|
||||
|
|
@ -406,9 +406,9 @@ HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aAddr, done)
|
|||
{
|
||||
var pos = (aAddr[0] * (aCHS[1] * aCHS[2] * aCHS[3])) + (aAddr[1] * (aCHS[2] * aCHS[3])) + ((aAddr[2] - 1) * aCHS[3]);
|
||||
var len = (aAddr[3] * aCHS[3]);
|
||||
|
||||
|
||||
HTMLOut.logDebug('HTMLOut.readUserVolume("' + sPath + '"): pos: ' + pos + ', len: ' + len);
|
||||
|
||||
|
||||
var buf = new Buffer(len);
|
||||
fs.read(fd, buf, 0, len, pos, function(err, cbRead, buffer) {
|
||||
var nResponse = 200;
|
||||
|
|
@ -423,7 +423,7 @@ HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aAddr, done)
|
|||
/*
|
||||
* Replace the preceding line with this if you want to test how well the client deals with long I/O delays (eg, 10 seconds)
|
||||
*
|
||||
setTimeout(function() {
|
||||
setTimeout(function() {
|
||||
HTMLOut.logDebug("HTTPAPI.readUserVolume(): responding after 10000ms delay");
|
||||
done(nResponse, sResponse);
|
||||
}, 10000);
|
||||
|
|
@ -519,7 +519,7 @@ HTTPAPI.closeUserVolume = function(sPath, sMachine, sUser, done)
|
|||
|
||||
/**
|
||||
* parseDiskValues(s, aDefaults)
|
||||
*
|
||||
*
|
||||
* @param {string} s
|
||||
* @param {Array.<number>} a
|
||||
* @returns {Array.<number>}
|
||||
|
|
@ -546,7 +546,7 @@ HTTPAPI.parseDiskValues = function(s, a)
|
|||
HTTPAPI.processDiskAPI = function(req, res)
|
||||
{
|
||||
/*
|
||||
* For every volume, we must maintain the active machine+user that currently has access.
|
||||
* For every volume, we must maintain the active machine+user that currently has access.
|
||||
*/
|
||||
var nResponse = 400; // default to "Bad Request"
|
||||
var reqParms = req.method == "GET"? req.query : req.body;
|
||||
|
|
@ -598,7 +598,7 @@ HTTPAPI.processDiskAPI = function(req, res)
|
|||
* Without the addition of "no-store", Chrome will assume that a previous response to
|
||||
* a previously seen URL can be re-used without hitting the server again, which would be
|
||||
* bad if the requested sector(s) had been written in the meantime.
|
||||
*
|
||||
*
|
||||
* Perhaps I should be using different HTTP verbs, or perhaps I should switch to sockets,
|
||||
* but in the meantime, this is absolutely necessary.
|
||||
*/
|
||||
|
|
@ -642,7 +642,7 @@ HTTPAPI.processDiskAPI = function(req, res)
|
|||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
res.status(nResponse).send(DiskAPI.FAIL.BADVOL);
|
||||
return true;
|
||||
};
|
||||
|
|
@ -659,7 +659,7 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
var aCommand;
|
||||
var nResponse = 400; // default to "Bad Request"
|
||||
var sDisk, sFile, sFormat, fComments;
|
||||
|
||||
|
||||
if ((aCommand = HTTPAPI.hasAPICommand(req, DumpAPI.asDiskCommands))) {
|
||||
|
||||
sDisk = aCommand[1];
|
||||
|
|
@ -669,11 +669,11 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
* Allowing ".." in a path component is risky, unless we're running locally...
|
||||
*/
|
||||
if (sDisk.indexOf("..") < 0 || req.app.settings.port == 8088) {
|
||||
|
||||
|
||||
sFormat = req.query[DumpAPI.QUERY.FORMAT] || DumpAPI.FORMAT.JSON;
|
||||
fComments = (req.query[DumpAPI.QUERY.COMMENTS]? true : false);
|
||||
var mbHD = req.query[DumpAPI.QUERY.MBHD];
|
||||
|
||||
|
||||
/*
|
||||
* TODO: Consider adding support for DiskDump's "exclusion" option to the API interface
|
||||
* (the command-line interface supports it).
|
||||
|
|
@ -692,7 +692,7 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
}
|
||||
}
|
||||
else if ((aCommand = HTTPAPI.hasAPICommand(req, DumpAPI.asFileCommands))) {
|
||||
|
||||
|
||||
sFile = aCommand[1];
|
||||
HTMLOut.logDebug('HTTPAPI.processDumpAPI("' + sFile + '"): type=' + aCommand[0]);
|
||||
|
||||
|
|
@ -700,7 +700,7 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
* Allowing ".." in a path component is too risky, unless we're running locally.
|
||||
*/
|
||||
if (sFile.indexOf("..") < 0 || req.app.settings.port == 8088) {
|
||||
|
||||
|
||||
sFormat = req.query[DumpAPI.QUERY.FORMAT] || DumpAPI.FORMAT.JSON;
|
||||
fComments = (req.query[DumpAPI.QUERY.COMMENTS]? true : false);
|
||||
var fDecimal;
|
||||
|
|
@ -730,7 +730,7 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
|
||||
/**
|
||||
* dumpDisk(err, disk, res)
|
||||
*
|
||||
*
|
||||
* @param {Error} err
|
||||
* @param {DiskDump} disk
|
||||
* @param {Object} res
|
||||
|
|
@ -794,7 +794,7 @@ HTTPAPI.processReportAPI = function(req, res)
|
|||
var sUser = req.body[ReportAPI.QUERY.USER];
|
||||
var sType = req.body[ReportAPI.QUERY.TYPE];
|
||||
var sData = req.body[ReportAPI.QUERY.DATA];
|
||||
|
||||
|
||||
HTMLOut.logDebug('HTTPAPI.processReportAPI("' + sApp + '"): ver=' + sVer + ', url=' + sURL + ', type=' + sType);
|
||||
|
||||
if (sApp && sVer && sType == ReportAPI.TYPE.BUG && sData) {
|
||||
|
|
@ -879,7 +879,7 @@ HTTPAPI.createUserID = function(sUser, res)
|
|||
*/
|
||||
if (iVerified == 1 || iVerified <= 0 && asUsers[0] == net.GORT_COMMAND) {
|
||||
HTTPAPI.verifyUserID(asUsers[1], res, function doneVerifyUserID(iVerified, resultSecond, res) {
|
||||
|
||||
|
||||
HTMLOut.logDebug('HTTPAPI.doneVerifyUserID("' + asUsers[1] + '"): ' + iVerified);
|
||||
|
||||
if (iVerified <= 0) {
|
||||
|
|
@ -906,15 +906,15 @@ HTTPAPI.createUserID = function(sUser, res)
|
|||
|
||||
/**
|
||||
* verifyUserID(sUser, res, done)
|
||||
*
|
||||
*
|
||||
* If a done() handler is specified, the first parameter it receives is iVerified, which
|
||||
* will be -1 if the "users.log" file hasn't been initialized yet, 0 if the key doesn't exist,
|
||||
* or a positive number representing the line number at which the key appears.
|
||||
*
|
||||
*
|
||||
* Moreover, when a done() handler is provided, it simply passes the response object (res) to
|
||||
* done(), which must actually send the response, based on the provided result; this function sends
|
||||
* a response only if done() is NOT provided.
|
||||
*
|
||||
*
|
||||
* @param {string} sUser
|
||||
* @param {Object} res is an Express response object (http://expressjs.com/api.html#res.status)
|
||||
* @param {function(number, Object, Object)} [done]
|
||||
|
|
@ -923,7 +923,7 @@ HTTPAPI.createUserID = function(sUser, res)
|
|||
HTTPAPI.verifyUserID = function(sUser, res, done)
|
||||
{
|
||||
HTMLOut.logDebug('HTTPAPI.verifyUserID("' + sUser + '")');
|
||||
|
||||
|
||||
/*
|
||||
* If a colon separator is present, this is an implicit REQ.CREATE call
|
||||
* (in fact, at present, PCjs does not issue any explicit REQ.CREATE calls).
|
||||
|
|
@ -934,7 +934,7 @@ HTTPAPI.verifyUserID = function(sUser, res, done)
|
|||
var iVerified = -1;
|
||||
var sUserFile = path.join(sServerRoot, "/logs/users.log");
|
||||
fs.readFile(sUserFile, {encoding: "utf8"}, function doneReadUserIDs(err, sData) {
|
||||
|
||||
|
||||
var sResCode = UserAPI.CODE.FAIL;
|
||||
var sResData = UserAPI.FAIL.VERIFY;
|
||||
if (err) {
|
||||
|
|
@ -975,8 +975,8 @@ HTTPAPI.getUserDir = function(sUser)
|
|||
|
||||
/**
|
||||
* createUserDir(sUser)
|
||||
*
|
||||
* TODO: Creation is relatively rare, so I'm lazy and use synchronous calls, but fix this someday.
|
||||
*
|
||||
* TODO: Creation is relatively rare, so I'm lazy and use synchronous calls, but fix this someday.
|
||||
*
|
||||
* @param {string} sUser
|
||||
* @return {boolean} true if successful, false if not
|
||||
|
|
@ -1054,7 +1054,7 @@ HTTPAPI.loadUserData = function(sUser, sState, res)
|
|||
* Without the addition of "no-store", Chrome (and perhaps other browsers) will assume that
|
||||
* a previous response to a previously seen URL can be re-used without hitting the server
|
||||
* again, which would be bad if the requested state has been modified in the meantime.
|
||||
*
|
||||
*
|
||||
* Here's the scenario: the user loads a web page with a machine that uses server-side state,
|
||||
* the user changes the state of that machine and switches away from the machine (eg, clicks
|
||||
* a link to a different page), which causes the state to be updated on the server; then they
|
||||
|
|
|
|||
|
|
@ -35,30 +35,30 @@
|
|||
*
|
||||
* TODO: Consider adding support for GFM-style tables, as described [here](https://help.github.com/articles/github-flavored-markdown#tables);
|
||||
* this would be nice for a Markdown-based ASCII table, for example.
|
||||
*
|
||||
*
|
||||
* TODO: Consider adding support for GFM-style strike-through, as described [here](https://help.github.com/articles/github-flavored-markdown#strikethrough)
|
||||
*
|
||||
*
|
||||
* TODO: Consider adding support for anything in the Markdown spec that we don't currently support (but only features that I might actually want to use).
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
var path = require("path");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var path = require("path");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
|
||||
/**
|
||||
* @class exports
|
||||
* @property {string} name
|
||||
* @property {string} version
|
||||
*/
|
||||
var pkg = require("../../../package.json");
|
||||
var pkg = require("../../../package.json");
|
||||
|
||||
/**
|
||||
* fConsole controls diagnostic messages; it is false by default and can be overridden using the
|
||||
* setOptions() 'console' property.
|
||||
*
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
var fConsole = false;
|
||||
|
|
@ -123,7 +123,7 @@ function MarkOut(sMD, sIndent, req, aParms, fDebug)
|
|||
|
||||
/**
|
||||
* CLI()
|
||||
*
|
||||
*
|
||||
* Provides a command-line interface for the markout module
|
||||
*
|
||||
* Usage:
|
||||
|
|
@ -147,7 +147,7 @@ MarkOut.CLI = function()
|
|||
{
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
||||
|
||||
var fDebug = false;
|
||||
var args = proc.getArgs();
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ MarkOut.prototype.getMachines = function()
|
|||
|
||||
/**
|
||||
* generateID(sText)
|
||||
*
|
||||
*
|
||||
* Generate an ID from the given text, by basically converting it to lower case, converting anything
|
||||
* that's not a letter or a digit to a hyphen (-), and stripping all leading and trailing hyphens from
|
||||
* the result. Furthermore, if the generated ID is not unique (among the set of ALL generated IDs),
|
||||
|
|
@ -315,7 +315,7 @@ MarkOut.prototype.convertMD = function(sIndent)
|
|||
* to replace any \r\n sequences with \n.
|
||||
*/
|
||||
sMD = str.replaceArray(MarkOut.aHTMLEntities, sMD).replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
||||
|
||||
|
||||
/*
|
||||
* Before performing the original comment-elimination step, a new step has been added that
|
||||
* allows blocks of Markdown to be excluded from the Markout process (eg, build instructions
|
||||
|
|
@ -399,7 +399,7 @@ MarkOut.prototype.convertMD = function(sIndent)
|
|||
* Ready to convert all blocks now.
|
||||
*/
|
||||
sMD = this.convertMDBlocks(sMD, sIndent);
|
||||
|
||||
|
||||
/*
|
||||
* Post-processing hacks go here. First off, we would like all <pre>...</pre><pre>...</pre> sequences
|
||||
* to become one single (unified) <pre> sequence.
|
||||
|
|
@ -435,13 +435,13 @@ MarkOut.prototype.convertMDBlocks = function(sMD, sIndent)
|
|||
|
||||
sMD = str.replaceArray({"<h######":"<h6", "<h#####":"<h5", "<h####":"<h4", "<h###":"<h3", "<h##":"<h2", "<h#":"<h1"}, sMD);
|
||||
sMD = str.replaceArray({"h######>":"h6>", "h#####>":"h5>", "h####>":"h4>", "h###>":"h3>", "h##>":"h2>", "h#>":"h1>"}, sMD);
|
||||
|
||||
|
||||
/*
|
||||
* Convert all "Setext-style headers" (ie, series of equal-signs or dashes) to their <h#> equivalents.
|
||||
*/
|
||||
sMD = sMD.replace(/([^\n]+)\n([=-])[=-]*(\n|$)/g, "<h$2>$1</h$2>\n\n");
|
||||
sMD = str.replaceArray({"h=>":"h1>", "h->":"h2>"}, sMD);
|
||||
|
||||
|
||||
/*
|
||||
* Auto-generate IDs for headings
|
||||
*/
|
||||
|
|
@ -710,20 +710,20 @@ MarkOut.prototype.convertMDLines = function(s)
|
|||
* we strip the '#' and use the remainder of the link as the name of the anchor. To reference a named
|
||||
* anchor from another link, you have to specify a path with '#' and the anchor name appended, in order
|
||||
* to distinguish an anchor name from an anchor reference.
|
||||
*
|
||||
*
|
||||
* Note that the need for named anchors is somewhat diminished now that I automatically generate IDs for
|
||||
* all heading tags (eg, <h1>); refer to the generateID() function that's used in convertMDBlocks().
|
||||
*
|
||||
*
|
||||
* Another extension to Markdown that I've added is detecting empty parentheses alongside a likely URL,
|
||||
* and automatically converting it to a link; eg:
|
||||
*
|
||||
*
|
||||
* [http://www.ascii-code.com/]()
|
||||
*
|
||||
*
|
||||
* Also, if a URL contains any asterisks, we replace them with the current version number from "package.json".
|
||||
*
|
||||
* I prefer this solution over GFM's "autolinking" solution, which is too "loosey-goosey" for my taste
|
||||
* (see https://help.github.com/articles/github-flavored-markdown#url-autolinking).
|
||||
*
|
||||
*
|
||||
* TODO: Consider adding support for "reference"-style Markdown links.
|
||||
*
|
||||
* @this {MarkOut}
|
||||
|
|
@ -794,11 +794,11 @@ MarkOut.prototype.convertMDImageLinks = function(sBlock, sIndent)
|
|||
* link:url[:width[:height]]
|
||||
*
|
||||
* If "link:" is specified, a URL is required, but image width and height are optional.
|
||||
*
|
||||
*
|
||||
* Alternatively:
|
||||
*
|
||||
*
|
||||
* link:url:nogallery[:width[:height]]
|
||||
*
|
||||
*
|
||||
* to disable the automatic "gallery-ification" of image links (an optional width and height
|
||||
* can still follow).
|
||||
*/
|
||||
|
|
@ -814,11 +814,11 @@ MarkOut.prototype.convertMDImageLinks = function(sBlock, sIndent)
|
|||
* If the image link (aMatch[2]) contains "static/" but the sURL is external, AND we're in
|
||||
* "reveal mode", then transform sURL into a "static/" URL as well; encodeURL() will take care
|
||||
* of the rest of the transformation.
|
||||
*
|
||||
*
|
||||
* This feature is used with READMEs like /pubs/pc/programming/README.md, where normally we
|
||||
* want to link to documents stored on sites like archive.org, minuszerodegrees.net or bitsavers,
|
||||
* unless you're in "reveal mode", in which case we'll serve up our own "backup copies".
|
||||
*
|
||||
*
|
||||
* The assumption here is that if we have "static" thumbs, then we should also have full "static"
|
||||
* copies as well.
|
||||
*/
|
||||
|
|
@ -908,7 +908,7 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
|
|||
* We don't have the XML file open here, and I don't think it's worth the hit to open it.
|
||||
* Besides, the XML config file isn't necessarily on the same server (although whenever this
|
||||
* script is being used, it very likely is).
|
||||
*
|
||||
*
|
||||
* TODO: Consider cracking open the XML file anyway, even though the Markdown module is supposed
|
||||
* to be non-blocking; I'd like to be smarter about defaults (eg, specifying "debugger" when the
|
||||
* XML file clearly needs it).
|
||||
|
|
@ -926,7 +926,7 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
|
|||
var sMachineFunc = "embed" + sMachine;
|
||||
var sMachineClass = sMachine.toLowerCase();
|
||||
var aMachineParms = aMatch[4].split(':');
|
||||
var sMachineMessage = "(If you see this message, " + sMachine + "js may still be loading)";
|
||||
var sMachineMessage = "(If you see this message, " + sMachine + "js is still loading, or JavaScript has been disabled)";
|
||||
|
||||
var sMachineID = aMachineParms[0];
|
||||
var sMachineXSLFile = aMachineParms[1] || "";
|
||||
|
|
@ -957,11 +957,11 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
|
|||
|
||||
/*
|
||||
* Now that we're providing all of the following machine information to addMachine(), we don't
|
||||
* need to install the machine embed code here; processMachines() in HTMLOut will take care of that now.
|
||||
* need to install the machine embed code here; processMachines() in HTMLOut will take care of that now.
|
||||
*
|
||||
sReplacement += this.sIndent + '<script type="text/javascript">\n' + this.sIndent + 'window.' + sMachineFunc + '("' + sMachineID + '","' + sMachineXMLFile + '","' + sMachineXSLFile + '");\n' + this.sIndent + '</script>';
|
||||
*/
|
||||
|
||||
|
||||
sBlock = sBlock.replace(aMatch[0], sReplacement);
|
||||
reMachines.lastIndex = 0; // reset lastIndex, since we just modified the string that reMachines is iterating over
|
||||
cMatches++;
|
||||
|
|
@ -987,17 +987,17 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
|
|||
|
||||
/**
|
||||
* convertMDEmphasis(sBlock)
|
||||
*
|
||||
*
|
||||
* We look for sequences like **strength**, __strength__, *emphasis* and _emphasis_;
|
||||
* we convert the stronger (double-character) forms first, followed by the weaker
|
||||
* (single-character) forms, since we don't want to misconstrue the former as containing
|
||||
* the latter.
|
||||
*
|
||||
*
|
||||
* Also, standard Markdown says that "if you surround an * or _ with spaces, it’ll be
|
||||
* treated as a literal asterisk or underscore." Well, we don't. You can already escape
|
||||
* special characters with a backslash to make them literal, so I don't feel like
|
||||
* complicating the RegExps below to accommodate a syntax I don't use or want to support.
|
||||
*
|
||||
*
|
||||
* Also, for reasons noted in the code below, we don't support emphasis in the middle
|
||||
* of words.
|
||||
*
|
||||
|
|
@ -1009,17 +1009,17 @@ MarkOut.prototype.convertMDEmphasis = function(sBlock)
|
|||
{
|
||||
/*
|
||||
* Standard Markdown allows * or _ in the middle of a word, as in:
|
||||
*
|
||||
*
|
||||
* un*frigging*believable
|
||||
*
|
||||
*
|
||||
* but we do not. That's because a Markdown link like:
|
||||
*
|
||||
*
|
||||
* [my_modules](/my_modules/)
|
||||
*
|
||||
*
|
||||
* would otherwise be misconstrued as containing emphasis (and it doesn't
|
||||
* matter whether we process emphasis BEFORE or AFTER links -- an HTML link
|
||||
* poses the same problem as a Markdown link).
|
||||
*
|
||||
*
|
||||
* To resolve this, I require something non-alphanumeric to both precede AND
|
||||
* follow the emphasis characters. I would expect that "something" to normally
|
||||
* be whitespace, but we make it a bit more flexible, so that you can do things
|
||||
|
|
@ -1103,4 +1103,4 @@ MarkOut.prototype.encodeWhitespace = function(sText)
|
|||
};
|
||||
*/
|
||||
|
||||
module.exports = MarkOut;
|
||||
module.exports = MarkOut;
|
||||
|
|
|
|||
|
|
@ -34,15 +34,15 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Memory = require("./mem");
|
||||
var State = require("./state");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Memory = require("./mem");
|
||||
var State = require("./state");
|
||||
}
|
||||
|
||||
/**
|
||||
* Bus(cpu, dbg)
|
||||
*
|
||||
*
|
||||
* The Bus component manages "physical" memory and I/O address spaces.
|
||||
*
|
||||
* The Bus component has no UI elements, so it does not require an init() handler,
|
||||
|
|
@ -81,7 +81,7 @@ function Bus(parmsBus, cpu, dbg)
|
|||
|
||||
/*
|
||||
* Compute all the Bus memory block addressing values that we rely on, based on the width of the bus.
|
||||
*
|
||||
*
|
||||
* Regarding this.blockTotal, we want to avoid address-overflow-detection expressions like:
|
||||
*
|
||||
* iBlock < this.blockTotal? iBlock : 0
|
||||
|
|
@ -106,12 +106,12 @@ function Bus(parmsBus, cpu, dbg)
|
|||
* this.blockLimit Bus.BLOCK.LIMIT 0xfff
|
||||
* this.blockTotal Bus.BLOCK.TOTAL ((this.addrLimit + this.blockSize) / this.blockSize) | 0
|
||||
* this.blockMask Bus.BLOCK.MASK (this.blockTotal - 1) (ie, 0xff)
|
||||
*
|
||||
*
|
||||
* Note that the blockShift calculation below chooses a 4Kb physical memory block size for a 20-bit bus
|
||||
* (1Mb address space) and a 16Kb physical memory block for a 24-bit bus (16Mb address space). This yields
|
||||
* a 256-block array for the smaller bus and a 1024-block array for the larger bus. If we left the block
|
||||
* size at 4Kb in all cases, we'd end up with a 4096-block array for an 80286, which seems a bit excessive.
|
||||
*
|
||||
*
|
||||
* I can't think of any reason why a coarser block granularity (of 16Kb) should hurt anything, other than
|
||||
* wasting a little memory for ROMs smaller than the block size. Realize that this is strictly a physical
|
||||
* memory implementation detail, which should have no bearing on segment or page granularity of any future
|
||||
|
|
@ -138,11 +138,11 @@ function Bus(parmsBus, cpu, dbg)
|
|||
* WARNING: Unlike the (old) read and write memory notification functions, these support only one
|
||||
* pair of input/output functions per port. A more sophisticated architecture could support a list
|
||||
* of chained functions across multiple components, but I doubt that will be necessary here.
|
||||
*
|
||||
*
|
||||
* UPDATE: The Debugger now piggy-backs on these arrays to indicate ports for which it wants notification
|
||||
* of I/O. In those cases, the registered component/function elements may or may not be set, but the following
|
||||
* additional element will be set:
|
||||
*
|
||||
*
|
||||
* [2]: true to break on I/O, false to ignore I/O
|
||||
*
|
||||
* The false case is important if fPortInputBreakAll and/or fPortOutputBreakAll is set, because it allows the
|
||||
|
|
@ -163,7 +163,7 @@ Component.subclass(Component, Bus);
|
|||
|
||||
/**
|
||||
* initMemory()
|
||||
*
|
||||
*
|
||||
* Allocate enough (empty) Memory blocks to span the entire physical address space.
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
@ -192,7 +192,7 @@ Bus.prototype.reset = function()
|
|||
|
||||
/**
|
||||
* addMemory(addr, size, fReadOnly, controller)
|
||||
*
|
||||
*
|
||||
* Adds new Memory blocks to the specified address range. Any Memory blocks previously
|
||||
* added to that range must first be removed via removeMemory(); otherwise, you'll get
|
||||
* an allocation conflict error. Moreover, the address range must start at a block-granular
|
||||
|
|
@ -228,7 +228,7 @@ Bus.prototype.addMemory = function(addr, size, fReadOnly, controller)
|
|||
|
||||
/**
|
||||
* cleanMemory(addr, size)
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {number} addr
|
||||
* @param {number} size
|
||||
|
|
@ -318,7 +318,7 @@ Bus.prototype.setMemoryAccess = function(addr, size, afn)
|
|||
* removeMemory(addr, size)
|
||||
*
|
||||
* Replaces every block in the specified address range with empty Memory blocks that will ignore all reads/writes.
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {number} addr
|
||||
* @param {number} size
|
||||
|
|
@ -410,7 +410,7 @@ Bus.prototype.setWordDirect = function(addr, w)
|
|||
* All dirty blocks will be stored in a single array, as pairs of block numbers and data arrays, like so:
|
||||
*
|
||||
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
|
||||
*
|
||||
*
|
||||
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
|
||||
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
|
||||
* surprised to see negative numbers in the data.
|
||||
|
|
@ -459,7 +459,7 @@ Bus.prototype.saveMemory = function()
|
|||
* component to be restored, all those blocks (and their attributes) should be in place now.
|
||||
*
|
||||
* See saveMemory() for a description of how the memory block contents are saved.
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {Array} a
|
||||
* @return {boolean} true if successful, false if not
|
||||
|
|
@ -490,7 +490,7 @@ Bus.prototype.restoreMemory = function(a)
|
|||
|
||||
/**
|
||||
* addMemoryBreakpoint(addr, fWrite)
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {number} addr
|
||||
* @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint
|
||||
|
|
@ -505,7 +505,7 @@ Bus.prototype.addMemoryBreakpoint = function(addr, fWrite)
|
|||
|
||||
/**
|
||||
* removeMemoryBreakpoint(addr, fWrite)
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {number} addr
|
||||
* @param {boolean} fWrite is true for a memory write breakpoint, false for a memory read breakpoint
|
||||
|
|
@ -540,7 +540,7 @@ Bus.prototype.addPortInputBreak = function(port)
|
|||
|
||||
/**
|
||||
* addPortInputNotify(start, end, component, fn)
|
||||
*
|
||||
*
|
||||
* Add a port input-notification handler to the list of such handlers.
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
@ -565,7 +565,7 @@ Bus.prototype.addPortInputNotify = function(start, end, component, fn)
|
|||
|
||||
/**
|
||||
* addPortInputTable(component, table, offset)
|
||||
*
|
||||
*
|
||||
* Add port input-notification handlers from the specified table (a batch version of addPortInputNotify)
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
@ -578,7 +578,7 @@ Bus.prototype.addPortInputTable = function(component, table, offset)
|
|||
if (offset === undefined) offset = 0;
|
||||
for (var port in table) {
|
||||
/*
|
||||
* JavaScript coerces property keys to strings, so we use parseInt() to coerce them back to numbers.
|
||||
* JavaScript coerces property keys to strings, so we use parseInt() to coerce them back to numbers.
|
||||
*/
|
||||
port = parseInt(port, 10);
|
||||
this.addPortInputNotify(port + offset, port + offset, component, table[port]);
|
||||
|
|
@ -587,7 +587,7 @@ Bus.prototype.addPortInputTable = function(component, table, offset)
|
|||
|
||||
/**
|
||||
* checkPortInputNotify(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {number} port
|
||||
* @param {number} [addrFrom] is the EIP value at the time of the input
|
||||
|
|
@ -619,7 +619,7 @@ Bus.prototype.checkPortInputNotify = function(port, addrFrom)
|
|||
|
||||
/**
|
||||
* removePortInputNotify(start, end, component, fn)
|
||||
*
|
||||
*
|
||||
* Remove a port input-notification handler from the list of such handlers (to be ENABLED later if needed)
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
@ -660,7 +660,7 @@ Bus.prototype.addPortOutputBreak = function(port)
|
|||
|
||||
/**
|
||||
* addPortOutputNotify(start, end, component, fn)
|
||||
*
|
||||
*
|
||||
* Add a port output-notification handler to the list of such handlers.
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
@ -685,7 +685,7 @@ Bus.prototype.addPortOutputNotify = function(start, end, component, fn)
|
|||
|
||||
/**
|
||||
* addPortOutputTable(component, table, offset)
|
||||
*
|
||||
*
|
||||
* Add port output-notification handlers from the specified table (a batch version of addPortOutputNotify)
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
@ -698,7 +698,7 @@ Bus.prototype.addPortOutputTable = function(component, table, offset)
|
|||
if (offset === undefined) offset = 0;
|
||||
for (var port in table) {
|
||||
/*
|
||||
* JavaScript converts property keys to strings (brilliant), so we use parseInt() to convert them back to numbers.
|
||||
* JavaScript converts property keys to strings (brilliant), so we use parseInt() to convert them back to numbers.
|
||||
*/
|
||||
port = parseInt(port, 10);
|
||||
this.addPortOutputNotify(port + offset, port + offset, component, table[port]);
|
||||
|
|
@ -707,7 +707,7 @@ Bus.prototype.addPortOutputTable = function(component, table, offset)
|
|||
|
||||
/**
|
||||
* checkPortOutputNotify(port, bOut, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {Bus}
|
||||
* @param {number} port
|
||||
* @param {number} bOut
|
||||
|
|
@ -734,7 +734,7 @@ Bus.prototype.checkPortOutputNotify = function(port, bOut, addrFrom)
|
|||
|
||||
/**
|
||||
* removePortOutputNotify(start, end, component, fn)
|
||||
*
|
||||
*
|
||||
* Remove a port output-notification handler from the list of such handlers (to be ENABLED later if needed)
|
||||
*
|
||||
* @this {Bus}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -53,11 +53,11 @@
|
|||
* The PCjs JavaScript files do have some initialization-order dependencies.
|
||||
* If you load the files individually, it's recommended that you load them in
|
||||
* the same order that they're compiled.
|
||||
*
|
||||
*
|
||||
* Generally speaking, component.js should be first, computer.js should be
|
||||
* last (of the files based on component.js), and panel.js should be listed
|
||||
* early so that the Control Panel is ready as soon as possible.
|
||||
*
|
||||
*
|
||||
* Another recent ordering requirement is that rom.js must be loaded before
|
||||
* ram.js; this was true before, but now it's required, because I'm starting
|
||||
* to add ROM BIOS Data Area definitions to rom.js, and since the data area
|
||||
|
|
@ -67,19 +67,19 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var UserAPI = require("../../shared/lib/userapi");
|
||||
var ReportAPI = require("../../shared/lib/reportapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Bus = require("./bus");
|
||||
var State = require("./state");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var UserAPI = require("../../shared/lib/userapi");
|
||||
var ReportAPI = require("../../shared/lib/reportapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Bus = require("./bus");
|
||||
var State = require("./state");
|
||||
}
|
||||
|
||||
/**
|
||||
* Computer(parmsComputer, parmsMachine, fSuspended)
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsComputer
|
||||
|
|
@ -93,7 +93,7 @@ if (typeof module !== 'undefined') {
|
|||
* 20 is the minimum (and the default), which implies 8086/8088 real-mode addressing,
|
||||
* while 24 is required for 80286 protected-mode addressing. This value is passed
|
||||
* directly through to the Bus component; see that component for more details.
|
||||
*
|
||||
*
|
||||
* resume: one of the Computer.RESUME constants, which are as follows:
|
||||
* '0' if resume disabled (default)
|
||||
* '1' if enabled without prompting
|
||||
|
|
@ -102,7 +102,7 @@ if (typeof module !== 'undefined') {
|
|||
* or a string containing the path of a predefined JSON-encoded state
|
||||
*
|
||||
* state: the path to JSON-encoded state file (see details regarding 'state' below)
|
||||
*
|
||||
*
|
||||
* If a predefined state is supplied AND it's successfully loaded, then resume behavior
|
||||
* defaults to '1' (ie, resume enabled without prompting).
|
||||
*
|
||||
|
|
@ -154,12 +154,12 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
this.bus = new Bus({'id': this.idMachine + '.bus', 'buswidth': this.nBusWidth}, this.cpu, this.dbg);
|
||||
|
||||
/*
|
||||
* Iterate through all the components and connect them to the Control Panel, if any
|
||||
* Iterate through all the components and connect them to the Control Panel, if any
|
||||
*/
|
||||
var iComponent, component;
|
||||
var aComponents = Component.getComponents(this.id);
|
||||
this.panel = Component.getComponentByType("Panel", this.id);
|
||||
|
||||
|
||||
if (this.panel && this.panel.controlPrint) {
|
||||
for (iComponent = 0; iComponent < aComponents.length; iComponent++) {
|
||||
component = aComponents[iComponent];
|
||||
|
|
@ -198,7 +198,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
* The Computer 'state' property allows a state file to be specified independent of the 'resume' feature;
|
||||
* previously, you could only use 'resume' to load a state file -- which we still support, but loading a state
|
||||
* file that way prevents the machine's state from being saved, since we always resume from the 'resume' file.
|
||||
*
|
||||
*
|
||||
* The other wrinkle is on the restore side: we need to IGNORE the 'state' property if a saved state now exists.
|
||||
* So we have to peek at localStorage, and unfortunately, the only way to "peek" is to actually load the data,
|
||||
* but we're not ready to use it yet, so powerUp() has been changed to use any existing stateComputer that we've
|
||||
|
|
@ -210,7 +210,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
*/
|
||||
var fAllowResume;
|
||||
var sState = Component.parmsURL && Component.parmsURL['state'] || (fAllowResume = true) && parmsComputer['state'];
|
||||
|
||||
|
||||
if (sState) {
|
||||
sStatePath = this.sStatePath = sState;
|
||||
if (!fAllowResume) {
|
||||
|
|
@ -229,7 +229,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
|
||||
/*
|
||||
* If sStatePath is set, we must use it. But if there's no sStatePath AND resume is set,
|
||||
* then we have the option of resuming from a server-side state, assuming a valid USERID.
|
||||
* then we have the option of resuming from a server-side state, assuming a valid USERID.
|
||||
*/
|
||||
if (!sStatePath && this.resume) {
|
||||
sStatePath = this.getServerStatePath();
|
||||
|
|
@ -241,7 +241,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
} else {
|
||||
web.loadResource(sStatePath, true, null, this, this.onLoadSetReady);
|
||||
}
|
||||
|
||||
|
||||
if (!fSuspended) {
|
||||
/*
|
||||
* Power "up" the computer, giving every component the opportunity to reset or restore itself.
|
||||
|
|
@ -317,7 +317,7 @@ Computer.prototype.getUserID = function()
|
|||
|
||||
/**
|
||||
* onLoadSetReady(sStateFile, sStateData, nErrorCode)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {string} sStateFile
|
||||
* @param {string} sStateData
|
||||
|
|
@ -327,7 +327,7 @@ Computer.prototype.onLoadSetReady = function(sStateFile, sStateData, nErrorCode)
|
|||
{
|
||||
if (!nErrorCode) {
|
||||
this.sStateData = sStateData;
|
||||
if (DEBUG) this.messageDebugger("loaded state file " + sStateFile.replace(this.sUserID || "xxx", "xxx"));
|
||||
if (DEBUG) this.messageDebugger("loaded state file " + sStateFile.replace(this.sUserID || "xxx", "xxx"));
|
||||
} else {
|
||||
this.sResumePath = null;
|
||||
this.fServerState = false;
|
||||
|
|
@ -338,7 +338,7 @@ Computer.prototype.onLoadSetReady = function(sStateFile, sStateData, nErrorCode)
|
|||
|
||||
/**
|
||||
* wait(fn, parms)
|
||||
*
|
||||
*
|
||||
* wait() waits until every component is ready (including ourselves, the last component we check),
|
||||
* then calls the specified Computer method.
|
||||
*
|
||||
|
|
@ -376,7 +376,7 @@ Computer.prototype.wait = function(fn, parms)
|
|||
* validateState(stateComputer)
|
||||
*
|
||||
* NOTE: We clear() stateValidate only when there's no stateComputer.
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {State|null} [stateComputer]
|
||||
* @return {boolean} true if state passes validation, false if not
|
||||
|
|
@ -403,7 +403,7 @@ Computer.prototype.validateState = function(stateComputer)
|
|||
* powerOn(resume)
|
||||
*
|
||||
* Power every component "up", applying any previously available state information.
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {number} [resume] is a valid RESUME value; default is this.resume
|
||||
*/
|
||||
|
|
@ -455,7 +455,7 @@ Computer.prototype.powerOn = function(resume)
|
|||
stateComputer.load(sData);
|
||||
} else {
|
||||
/*
|
||||
* A missing (or not yet created) state file is no cause for alarm, but other errors might be
|
||||
* A missing (or not yet created) state file is no cause for alarm, but other errors might be
|
||||
*/
|
||||
if (sCode == UserAPI.CODE.FAIL && sData != UserAPI.FAIL.NOSTATE) {
|
||||
this.notice("Error: " + sData);
|
||||
|
|
@ -529,7 +529,7 @@ Computer.prototype.powerOn = function(resume)
|
|||
|
||||
/**
|
||||
* powerRestore(component, stateComputer, fRepower, fRestore)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {Component} component
|
||||
* @param {State} stateComputer
|
||||
|
|
@ -550,7 +550,7 @@ Computer.prototype.powerRestore = function(component, stateComputer, fRepower, f
|
|||
* This is a hack that makes it possible for a machine whose ID has been
|
||||
* supplemented with a suffix (a single letter or digit) to find object IDs
|
||||
* in states created from a machine without the suffix.
|
||||
*
|
||||
*
|
||||
* For example, if a state file was created from a machine with ID "ibm5160"
|
||||
* but the current machine is "ibm5160a", this attempts a second lookup with
|
||||
* "ibm5160", enabling us to find objects that match the original machine ID
|
||||
|
|
@ -565,7 +565,7 @@ Computer.prototype.powerRestore = function(component, stateComputer, fRepower, f
|
|||
* string comes back, something went wrong. By explicitly eliminating "string" data,
|
||||
* the Closure Compiler stops complaining that we might be passing strings to our
|
||||
* powerUp() functions (even though we know we're not).
|
||||
*
|
||||
*
|
||||
* TODO: Determine if there's some way to coerce the Closure Compiler into treating
|
||||
* data as Object or null, without having to include this runtime check. An assert
|
||||
* would be a good idea, but this is overkill.
|
||||
|
|
@ -629,7 +629,7 @@ Computer.prototype.powerRestore = function(component, stateComputer, fRepower, f
|
|||
* powerFinish(aParms)
|
||||
*
|
||||
* This is nothing more than a continuation of powerOn(), giving us the option of calling wait() one more time.
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {Array} aParms containing [stateComputer, resume, fRestore]
|
||||
*/
|
||||
|
|
@ -676,7 +676,7 @@ Computer.prototype.powerFinish = function(aParms)
|
|||
|
||||
/**
|
||||
* powerReport(stateComputer)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {State} stateComputer
|
||||
*/
|
||||
|
|
@ -712,7 +712,7 @@ Computer.prototype.powerReport = function(stateComputer)
|
|||
*
|
||||
* As it stands, the worst that happens is any manually mounted disk images might have to be manually remounted,
|
||||
* which doesn't seem like a huge problem.
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {boolean} fSave
|
||||
* @param {boolean} [fShutdown] is true if the machine is being shut down
|
||||
|
|
@ -809,9 +809,9 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
|
|||
sState = stateComputer.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fShutdown) this.fPowered = false;
|
||||
|
||||
|
||||
return sState;
|
||||
};
|
||||
|
||||
|
|
@ -819,11 +819,11 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
|
|||
* reset()
|
||||
*
|
||||
* Notify all (other) components with a reset() method that the Computer is being reset.
|
||||
*
|
||||
*
|
||||
* NOTE: We'd like to reset the Bus first (due to the importance of the A20 line), but since we
|
||||
* allocated the Bus object ourselves, after all the other components were allocated, it ends
|
||||
* up near the end of Component's list of components. Hence the special case for this.bus below.
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
*/
|
||||
Computer.prototype.reset = function()
|
||||
|
|
@ -846,10 +846,10 @@ Computer.prototype.reset = function()
|
|||
* start(ms, nCycles)
|
||||
*
|
||||
* Notify all (other) components with a start() method that the CPU has started.
|
||||
*
|
||||
*
|
||||
* Note that we're called by runCPU(), which is why we exclude the CPU component,
|
||||
* as well as ourselves.
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {number} ms
|
||||
* @param {number} nCycles
|
||||
|
|
@ -892,7 +892,7 @@ Computer.prototype.stop = function(ms, nCycles)
|
|||
|
||||
/**
|
||||
* setBinding(sHTMLClass, sHTMLType, sBinding, control)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output")
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
|
|
@ -942,7 +942,7 @@ Computer.prototype.resetUserID = function()
|
|||
|
||||
/**
|
||||
* queryUserID(fPrompt)
|
||||
*
|
||||
*
|
||||
* @param {boolean} [fPrompt]
|
||||
* @returns {string|null|undefined}
|
||||
*/
|
||||
|
|
@ -968,7 +968,7 @@ Computer.prototype.queryUserID = function(fPrompt)
|
|||
|
||||
/**
|
||||
* verifyUserID(sUserID)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {string} sUserID
|
||||
* @return {string} validated user ID, or null if error
|
||||
|
|
@ -1002,7 +1002,7 @@ Computer.prototype.verifyUserID = function(sUserID)
|
|||
|
||||
/**
|
||||
* getServerStatePath()
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @return {string|null} sStatePath (null if no localStorage or no USERID stored in localStorage)
|
||||
*/
|
||||
|
|
@ -1020,7 +1020,7 @@ Computer.prototype.getServerStatePath = function()
|
|||
|
||||
/**
|
||||
* saveServerState(sUserID, sState)
|
||||
*
|
||||
*
|
||||
* @param {string} sUserID
|
||||
* @param {string|null} sState
|
||||
*/
|
||||
|
|
@ -1054,7 +1054,7 @@ Computer.prototype.saveServerState = function(sUserID, sState)
|
|||
|
||||
/**
|
||||
* storeServerState(sUserID, sState, fSync)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {string} sUserID
|
||||
* @param {string} sState
|
||||
|
|
@ -1095,7 +1095,7 @@ Computer.prototype.storeServerState = function(sUserID, sState, fSync)
|
|||
|
||||
/**
|
||||
* onReset()
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
*/
|
||||
Computer.prototype.onReset = function()
|
||||
|
|
@ -1117,7 +1117,7 @@ Computer.prototype.onReset = function()
|
|||
* and rely on all the components to reset themselves to their default state. The components with
|
||||
* the greatest burden here are FDC and HDC, which must rely on the fReload flag to determine whether
|
||||
* or not to unload/reload all their original auto-mounted disk images.
|
||||
*
|
||||
*
|
||||
* However, if we started with a predefined state (ie, sStatePath is set), we take this shortcut, because
|
||||
* we don't (yet) have code in place to gracefully reload the initial state (requires calling loadResource()
|
||||
* again); alternatively, we could avoid throwing that state away, but it seems better to save the memory.
|
||||
|
|
@ -1139,7 +1139,7 @@ Computer.prototype.onReset = function()
|
|||
|
||||
/**
|
||||
* getComponentByType(sType, componentPrev)
|
||||
*
|
||||
*
|
||||
* @this {Computer}
|
||||
* @param {string} sType
|
||||
* @param {Component} [componentPrev] of previously returned component, if any
|
||||
|
|
@ -1188,19 +1188,19 @@ Computer.prototype.messageDebugger = function(sMessage, fForce)
|
|||
Computer.init = function()
|
||||
{
|
||||
var aeMachines = Component.getElementsByClass(window.document, PCJSCLASS + "-machine");
|
||||
|
||||
|
||||
for (var iMachine = 0; iMachine < aeMachines.length; iMachine++) {
|
||||
|
||||
|
||||
var eMachine = aeMachines[iMachine];
|
||||
var parmsMachine = Component.getComponentParms(eMachine);
|
||||
|
||||
var aeComputers = Component.getElementsByClass(eMachine, PCJSCLASS, "computer");
|
||||
|
||||
|
||||
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
|
||||
|
||||
|
||||
var eComputer = aeComputers[iComputer];
|
||||
var parmsComputer = Component.getComponentParms(eComputer);
|
||||
|
||||
|
||||
/*
|
||||
* We set fSuspended in the Computer constructor because we want to "power up" the
|
||||
* computer ourselves, after any/all bindings are in place.
|
||||
|
|
@ -1208,7 +1208,7 @@ Computer.init = function()
|
|||
var computer = new Computer(parmsComputer, parmsMachine, true);
|
||||
|
||||
if (DEBUG) computer.messageDebugger("onInit(" + computer.fPowered + ")");
|
||||
|
||||
|
||||
/*
|
||||
* For now, all we support are "reset" and "save" buttons. We may eventually add a "power"
|
||||
* button to manually suspend/resume the machine. An "erase" button was also considered, but
|
||||
|
|
@ -1216,7 +1216,7 @@ Computer.init = function()
|
|||
* might be redundant now.
|
||||
*/
|
||||
Component.bindComponentControls(computer, eComputer, PCJSCLASS);
|
||||
|
||||
|
||||
/*
|
||||
* Power "up" the computer, giving every component the opportunity to reset or restore itself.
|
||||
*/
|
||||
|
|
@ -1238,7 +1238,7 @@ Computer.show = function()
|
|||
if (computer) {
|
||||
|
||||
if (DEBUG) computer.messageDebugger("onShow(" + computer.fInitialized + "," + computer.fPowered + ")");
|
||||
|
||||
|
||||
if (computer.fInitialized && !computer.fPowered) {
|
||||
/**
|
||||
* Repower the computer, notifying every component to continue running as-is.
|
||||
|
|
@ -1285,7 +1285,7 @@ Computer.exit = function()
|
|||
if (computer) {
|
||||
|
||||
if (DEBUG) computer.messageDebugger("onExit(" + computer.fPowered + ")");
|
||||
|
||||
|
||||
if (computer.fPowered) {
|
||||
/**
|
||||
* Power "down" the computer, giving every component an opportunity to save its state,
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,9 +46,9 @@ if (typeof module !== 'undefined') {
|
|||
*
|
||||
* cycles: the machine's base cycles per second; the X86CPU constructor will
|
||||
* provide us with a default (based on the CPU model) to use as a fallback
|
||||
*
|
||||
*
|
||||
* multiplier: base cycle multiplier; default is 1
|
||||
*
|
||||
*
|
||||
* autoStart: true to automatically start, false to not, or null (default)
|
||||
* to make the autoStart decision based on whether or not a Debugger is
|
||||
* installed (if there's no Debugger AND no "Run" button, then auto-start,
|
||||
|
|
@ -82,7 +82,7 @@ function CPU(parmsCPU, nCyclesDefault)
|
|||
var nMultiplier = parmsCPU['multiplier'] || 1;
|
||||
|
||||
this.nCyclesPerSecond = nCycles;
|
||||
|
||||
|
||||
/*
|
||||
* nCyclesMultiplier replaces the old "speed" variable (0, 1, 2) and eliminates the need for
|
||||
* the constants (SPEED_SLOW, SPEED_FAST and SPEED_MAX). The UI simply doubles the multiplier
|
||||
|
|
@ -113,7 +113,7 @@ function CPU(parmsCPU, nCyclesDefault)
|
|||
* Get checksum parameters, if any. runCPU() behavior is not affected until fChecksum
|
||||
* is true, which won't happen until resetChecksum() is called with nCyclesChecksumInterval
|
||||
* ("csInterval") set to a positive value.
|
||||
*
|
||||
*
|
||||
* As above, any of these parameters can also be set with the Debugger's execution options
|
||||
* command ("x"); for example, "x cs int 5000" will set nCyclesChecksumInterval to 5000
|
||||
* and call resetChecksum().
|
||||
|
|
@ -126,7 +126,7 @@ function CPU(parmsCPU, nCyclesDefault)
|
|||
|
||||
var cpu = this;
|
||||
this.onRunTimeout = function() { cpu.runCPU(); };
|
||||
|
||||
|
||||
this.setReady();
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ CPU.STATUS_UPDATES_PER_SECOND = 2;
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {Computer} cmp
|
||||
* @param {Bus} bus
|
||||
|
|
@ -170,7 +170,7 @@ CPU.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
this.cmp = cmp;
|
||||
/*
|
||||
* Attach the Video component to the CPU, so that the CPU can periodically update
|
||||
* the video display via displayVideo(), as cycles permit.
|
||||
* the video display via displayVideo(), as cycles permit.
|
||||
*/
|
||||
var video = cmp.getComponentByType("Video");
|
||||
if (video) {
|
||||
|
|
@ -184,7 +184,7 @@ CPU.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
/*
|
||||
* Attach the ChipSet component to the CPU, so that it can obtain the IDT vector number of
|
||||
* pending hardware interrupts, in response to ChipSet's updateINTR() notifications.
|
||||
*
|
||||
*
|
||||
* We must also call chipset.updateAllTimers() periodically; stepCPU() takes care of that.
|
||||
*/
|
||||
this.chipset = cmp.getComponentByType("ChipSet");
|
||||
|
|
@ -195,7 +195,7 @@ CPU.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
* reset()
|
||||
*
|
||||
* This is a placeholder for reset (overridden by the X86CPU component).
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
*/
|
||||
CPU.prototype.reset = function()
|
||||
|
|
@ -206,7 +206,7 @@ CPU.prototype.reset = function()
|
|||
* save()
|
||||
*
|
||||
* This is a placeholder for save support (overridden by the X86CPU component).
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @return {Object|null}
|
||||
*/
|
||||
|
|
@ -219,7 +219,7 @@ CPU.prototype.save = function()
|
|||
* restore(data)
|
||||
*
|
||||
* This is a placeholder for restore support (overridden by the X86CPU component).
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {Object} data
|
||||
* @return {boolean} true if restore successful, false if not
|
||||
|
|
@ -258,7 +258,7 @@ CPU.prototype.powerUp = function(data, fRepower)
|
|||
* knows if there's a "print" control (this.cmp.panel.controlPrint), and if there IS a "print" control
|
||||
* but no debugger, the machine is probably misconfigured (most likely, the page simply neglected to
|
||||
* load the Debugger component).
|
||||
*
|
||||
*
|
||||
* However, we don't actually need to check all that; it's always safe use println(), regardless whether
|
||||
* a Control Panel with a "print" control is present or not.
|
||||
*/
|
||||
|
|
@ -273,7 +273,7 @@ CPU.prototype.powerUp = function(data, fRepower)
|
|||
|
||||
/**
|
||||
* powerDown(fSave)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -286,7 +286,7 @@ CPU.prototype.powerDown = function(fSave)
|
|||
|
||||
/**
|
||||
* autoStart()
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @return {boolean} true if started, false if not
|
||||
*/
|
||||
|
|
@ -335,9 +335,9 @@ CPU.prototype.isRunning = function()
|
|||
|
||||
/**
|
||||
* getChecksum()
|
||||
*
|
||||
*
|
||||
* This will be implemented by the X86CPU component.
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @return {number} a 32-bit summation of key elements of the current CPU state (used by the CPU checksum code)
|
||||
*/
|
||||
|
|
@ -352,7 +352,7 @@ CPU.prototype.getChecksum = function()
|
|||
* If checksum generation is enabled (fChecksum is true), this resets the running 32-bit checksum and the
|
||||
* cycle counter that will trigger the next displayChecksum(); called by resetCycles(), which is called whenever
|
||||
* the CPU is reset or restored.
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @return {boolean} true if checksum generation enabled, false if not
|
||||
*/
|
||||
|
|
@ -378,7 +378,7 @@ CPU.prototype.resetChecksum = function()
|
|||
* number of cycles (1), effectively limiting execution to a single instruction, and then we're called with
|
||||
* the exact number cycles that were actually executed. This should give us instruction-granular checksums
|
||||
* at precise intervals that are 100% repeatable.
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {number} nCycles
|
||||
*/
|
||||
|
|
@ -409,11 +409,11 @@ CPU.prototype.updateChecksum = function(nCycles)
|
|||
|
||||
/**
|
||||
* displayChecksum()
|
||||
*
|
||||
*
|
||||
* When checksum generation is enabled (fChecksum is true), this is called to provide a crude log of all
|
||||
* checksums generated at the specified cycle intervals, as specified by the "csStart" and "csInterval" parmsCPU
|
||||
* properties).
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
*/
|
||||
CPU.prototype.displayChecksum = function()
|
||||
|
|
@ -473,7 +473,7 @@ CPU.prototype.displayVideo = function()
|
|||
|
||||
/**
|
||||
* setBinding(sHTMLClass, sHTMLType, sBinding, control)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output")
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
|
|
@ -539,7 +539,7 @@ CPU.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control)
|
|||
* A divisor greater than 1 (the default) does NOT require us to yield more frequently or update the screen
|
||||
* more frequently; it only means that stepCPU() must be called more frequently, with correspondingly smaller burst
|
||||
* cycles, because stepCPU() is responsible for updating all the timers ONCE, each time it's called.
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {number} nDivisor
|
||||
*/
|
||||
|
|
@ -652,12 +652,12 @@ CPU.prototype.getCycles = function(fScaled)
|
|||
*
|
||||
* but that speed will fluctuate somewhat: large fluctuations at first, but increasingly smaller
|
||||
* fluctuations after each burst of instructions that runCPU() executes.
|
||||
*
|
||||
*
|
||||
* Alternatively, we can scale the cycle count by the multiplier, which is good in that the
|
||||
* multiplier doesn't vary once the user changes it, but a potential downside is that the
|
||||
* multiplier might be set too high, resulting in a target speed that's higher than the effective
|
||||
* speed is able to reach.
|
||||
*
|
||||
*
|
||||
* Also, if multipliers were always limited to a power-of-two, then this could be calculated
|
||||
* with a simple shift. However, only the "setSpeed" UI binding limits it that way; the Debugger
|
||||
* interface allows any value, as does the CPU "multiplier" parmsCPU property (from the machine's
|
||||
|
|
@ -717,9 +717,9 @@ CPU.prototype.getSpeed = function() {
|
|||
*/
|
||||
CPU.prototype.getSpeedCurrent = function() {
|
||||
/*
|
||||
* TODO: Has toFixed() been "fixed" in all browsers (eg, IE) to return a rounded value now?
|
||||
* TODO: Has toFixed() been "fixed" in all browsers (eg, IE) to return a rounded value now?
|
||||
*/
|
||||
return ((this.fRunning && this.mhz)? (this.mhz.toFixed(2) + "Mhz") : "Stopped");
|
||||
return ((this.fRunning && this.mhz)? (this.mhz.toFixed(2) + "Mhz") : "Stopped");
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -730,14 +730,14 @@ CPU.prototype.getSpeedCurrent = function() {
|
|||
*/
|
||||
CPU.prototype.getSpeedTarget = function() {
|
||||
/*
|
||||
* TODO: Has toFixed() been "fixed" in all browsers (eg, IE) to return a rounded value now?
|
||||
* TODO: Has toFixed() been "fixed" in all browsers (eg, IE) to return a rounded value now?
|
||||
*/
|
||||
return this.mhzTarget.toFixed(2) + "Mhz";
|
||||
};
|
||||
|
||||
/**
|
||||
* setSpeed(nMultiplier, fOnClick)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {number} [nMultiplier] is the new proposed multiplier (reverts to 1 if the target was too high)
|
||||
* @param {boolean} [fOnClick] is true if called from a click handler that might have stolen focus
|
||||
|
|
@ -774,7 +774,7 @@ CPU.prototype.setSpeed = function(nMultiplier, fOnClick)
|
|||
|
||||
/**
|
||||
* calcSpeed(nCycles, msElapsed)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {number} nCycles
|
||||
* @param {number} msElapsed
|
||||
|
|
@ -793,7 +793,7 @@ CPU.prototype.calcSpeed = function(nCycles, msElapsed)
|
|||
|
||||
/**
|
||||
* calcStartTime()
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
*/
|
||||
CPU.prototype.calcStartTime = function()
|
||||
|
|
@ -808,22 +808,22 @@ CPU.prototype.calcStartTime = function()
|
|||
* Try to detect situations where the browser may have throttled us, such as when the user switches
|
||||
* to a different tab; in those situations, Chrome and Safari may restrict setTimeout() callbacks
|
||||
* to roughly one per second.
|
||||
*
|
||||
*
|
||||
* Another scenario: the user resizes the browser window. setTimeout() callbacks are not throttled,
|
||||
* but there can still be enough of a lag between the callbacks that CPU speed will be noticeably
|
||||
* erratic if we don't compensate for it here.
|
||||
*
|
||||
*
|
||||
* We can detect throttling/lagging by verifying that msEndThisRun (which was set at the end of the
|
||||
* previous run and includes any requested sleep time) is comparable to the current msStartThisRun;
|
||||
* if the delta is significant, we compensate by bumping msRunStart forward by that delta.
|
||||
*
|
||||
*
|
||||
* This shouldn't be triggered when the Debugger halts the CPU, because setSpeed() -- which is called
|
||||
* whenever the CPU starts running again -- zeroes msEndThisRun.
|
||||
*
|
||||
*
|
||||
* This also won't do anything about other internal delays; for example, Debugger message() calls.
|
||||
* By the time the message() function has called yieldCPU(), the cost of the message has already been
|
||||
* incurred, so it will be end up being charged against the instruction(s) that triggered them.
|
||||
*
|
||||
*
|
||||
* TODO: Consider calling yieldCPU() sooner from message(), so that it can arrange for the msEndThisRun
|
||||
* "snapshot" to occur sooner; it's unclear, however, whether that will really improve the CPU's ability
|
||||
* to hit its target speed, since you would expect any instruction that displays a message to be an
|
||||
|
|
@ -849,14 +849,14 @@ CPU.prototype.calcStartTime = function()
|
|||
|
||||
/**
|
||||
* calcRemainingTime()
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @return {number}
|
||||
*/
|
||||
CPU.prototype.calcRemainingTime = function()
|
||||
{
|
||||
this.msEndThisRun = usr.getTime();
|
||||
|
||||
|
||||
var msYield = this.msPerYield;
|
||||
if (this.nCyclesThisRun) {
|
||||
/*
|
||||
|
|
@ -906,7 +906,7 @@ CPU.prototype.calcRemainingTime = function()
|
|||
|
||||
/*
|
||||
* Last but not least, update nRecalcCycles, so that when runCPU() starts up again and calls calcStartTime(),
|
||||
* it'll be ready to decide if calcCycles() should be called again.
|
||||
* it'll be ready to decide if calcCycles() should be called again.
|
||||
*/
|
||||
this.nRecalcCycles += this.nCyclesThisRun;
|
||||
|
||||
|
|
@ -920,7 +920,7 @@ CPU.prototype.calcRemainingTime = function()
|
|||
|
||||
/**
|
||||
* runCPU(fOnClick)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {boolean} [fOnClick] is true if called from a click handler that might have stolen focus
|
||||
*/
|
||||
|
|
@ -953,7 +953,7 @@ CPU.prototype.runCPU = function(fOnClick)
|
|||
try {
|
||||
do {
|
||||
var nCyclesPerBurst = this.fChecksum? 1 : Math.round(this.nCyclesPerBurst / this.nBurstDivisor);
|
||||
|
||||
|
||||
/*
|
||||
* This is an alternative to ChipSet calling setBurstDivisor(). Unfortunately, this doesn't seem
|
||||
* to work as well as setBurstDivisor(); for some reason, the smaller bursts that the burst divisor
|
||||
|
|
@ -965,7 +965,7 @@ CPU.prototype.runCPU = function(fOnClick)
|
|||
* nCyclesPerBurst = nCyclesTimer0;
|
||||
* }
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* nCyclesPerBurst is how many cycles we WANT to run on each iteration of stepCPU(), but it may run
|
||||
* significantly less (or slightly more, since we can't execute partial instructions).
|
||||
|
|
@ -1015,7 +1015,7 @@ CPU.prototype.runCPU = function(fOnClick)
|
|||
|
||||
/**
|
||||
* setBurstCycles(nCycles)
|
||||
*
|
||||
*
|
||||
* This function is used by the ChipSet component whenever a very low timer count is set,
|
||||
* in anticipation of the timer requiring an update sooner than the normal nCyclesPerYield
|
||||
* period in runCPU() would normally provide.
|
||||
|
|
@ -1046,7 +1046,7 @@ CPU.prototype.setBurstCycles = function(nCycles)
|
|||
*
|
||||
* This similar to yieldCPU(), but it doesn't need to zero nCyclesNextYield to break out of runCPU();
|
||||
* it simply needs to clear fRunning (well, "simply" may be oversimplifying a bit....)
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
* @param {boolean} [fComplete]
|
||||
*/
|
||||
|
|
@ -1067,7 +1067,7 @@ CPU.prototype.haltCPU = function(fComplete)
|
|||
|
||||
/**
|
||||
* stepCPU(nMinCycles)
|
||||
*
|
||||
*
|
||||
* This will be implemented by the X86CPU component.
|
||||
*
|
||||
* @this {CPU}
|
||||
|
|
@ -1086,7 +1086,7 @@ CPU.prototype.stepCPU = function(nMinCycles)
|
|||
* stepCPU() -- needed to have more control over when these updates are performed. However, for
|
||||
* other callers of stepCPU(), such as the Debugger, the combination of stepCPU() + updateCPU()
|
||||
* provides the old behavior.
|
||||
*
|
||||
*
|
||||
* @this {CPU}
|
||||
*/
|
||||
CPU.prototype.updateCPU = function()
|
||||
|
|
@ -1097,7 +1097,7 @@ CPU.prototype.updateCPU = function()
|
|||
|
||||
/**
|
||||
* yieldCPU()
|
||||
*
|
||||
*
|
||||
* Similar to haltCPU() with regard to how it resets various cycle countdown values, but the CPU
|
||||
* remains in a "running" state.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -35,15 +35,15 @@
|
|||
|
||||
if (DEBUGGER) {
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Bus = require("./bus");
|
||||
var State = require("./state");
|
||||
var CPU = require("./cpu");
|
||||
var X86 = require("./x86");
|
||||
var X86Seg = require("./x86seg");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Bus = require("./bus");
|
||||
var State = require("./state");
|
||||
var CPU = require("./cpu");
|
||||
var X86 = require("./x86");
|
||||
var X86Seg = require("./x86seg");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,19 +51,19 @@
|
|||
|
||||
/*
|
||||
* Client/Server Disk I/O
|
||||
*
|
||||
*
|
||||
* To support large disks without consuming large amounts of client-side memory, and to push
|
||||
* client-side disk changes back the server, we need a DiskIO API that can be used in place of
|
||||
* the DiskDump API.
|
||||
*
|
||||
*
|
||||
* Use of the DiskIO API and any associated disk images must be tightly coupled to per-user
|
||||
* storage and specific machine configurations, to prevent the disk images from being corrupted
|
||||
* by inconsistent I/O operations. Our basic User API (userapi.js) already provides some
|
||||
* per-user storage that we can use to get the design rolling.
|
||||
*
|
||||
*
|
||||
* The DiskIO API must also provide the ability to create new (empty) hard disk images in per-user
|
||||
* storage and automatically associate them with the machine configurations that requested them.
|
||||
*
|
||||
*
|
||||
* Principles
|
||||
* ---
|
||||
* Originally, when the Disk class was given a disk image to load and mount, it would request the
|
||||
|
|
@ -71,84 +71,84 @@
|
|||
* for larger disks -- let's just say anything stored on the server as an IMG file -- we'd prefer
|
||||
* to interact with that disk using "On-Demand I/O". Any IMG file on the same server as the PCjs
|
||||
* application should be a candidate for on-demand access.
|
||||
*
|
||||
*
|
||||
* On-Demand I/O means that nothing is initially transferred from the server. As sectors are
|
||||
* requested by the PCjs machine, PCjs requests them from the server, and maintains an MRU cache
|
||||
* of sectors, periodically discarding the least-used clean sectors above a certain memory limit.
|
||||
* Dirty sectors (ie, those that the PCjs machine has written to) must be periodically sent
|
||||
* back to the server and then marked as clean, so that they can be discarded like any other
|
||||
* sector.
|
||||
*
|
||||
*
|
||||
* We also support "local" init-only disk images, which means that dirty sectors are never sent
|
||||
* back to the server and are instead retained by the client for the lifetime of the app; such
|
||||
* images are "read-only" as far as the server is concerned, but "read-write" as far as the client
|
||||
* is concerned. Reloading/restarting an app with an "local" disk will return the disk to its
|
||||
* initial state.
|
||||
*
|
||||
* initial state.
|
||||
*
|
||||
* Practice
|
||||
* ---
|
||||
* Let's first look at what we *already* do for the HDC component:
|
||||
*
|
||||
*
|
||||
* 1) Creating new (empty) disk images
|
||||
* 2) Pre-loading pre-built JSON-encoded disk images (converting them to JSON on the fly as needed)
|
||||
*
|
||||
*
|
||||
* An example of #1 is in /configs/pc/machines/5160/cga/256kb/demo/machine.xml:
|
||||
*
|
||||
*
|
||||
* <hdc id="hdcXT" drives='[{name:"10Mb Hard Disk",type:3}]'/>
|
||||
*
|
||||
*
|
||||
* and an example of #2 is in /configs/pc/disks/fixed/win101.xml:
|
||||
*
|
||||
*
|
||||
* <hdc id="hdcXT" drives='[{name:"10Mb Hard Disk",path:"/disks/pc/fixed/win101/10mb.json",type:3}]'/>
|
||||
*
|
||||
* The HDC component expects an array of drive entries. Array position determines drive numbering
|
||||
* (the first entry is drive 0, the second is drive 1, etc), and each entry contains the following
|
||||
* properties:
|
||||
*
|
||||
*
|
||||
* 'name': user-friendly name for the disk, if any
|
||||
* 'path': URL of the disk image, if any
|
||||
* 'type': a drive type
|
||||
*
|
||||
*
|
||||
* Of those properties, only 'type' is required, which provides an index into an HDC "Drive Type"
|
||||
* table that determines disk geometry and therefore disk size. As we add support for larger disks and
|
||||
* newer disk controllers, the 'type' parameter will be superseded by either a user-defined 'geometry'
|
||||
* parameter that will define number of heads, cylinders, tracks, sectors per track, and (max) bytes per
|
||||
* sector, or perhaps a generic 'size' parameter that leaves geometry choices to the HDC component,
|
||||
* which will then pass those decisions on to the Disk component.
|
||||
*
|
||||
*
|
||||
* We will enable on-demand I/O for a disk image with a new 'mode' parameter that looks like:
|
||||
*
|
||||
*
|
||||
* 'mode': one of "local", "preload", "demandrw", "demandro"
|
||||
*
|
||||
*
|
||||
* "preload" means the disk image will be completely preloaded, exactly as before; "demandrw" enables
|
||||
* full on-demand I/O support; and "demandro" enables on-demand I/O for reads only (all writes are retained
|
||||
* and never written back to the server).
|
||||
*
|
||||
*
|
||||
* "ro" will be the fallback for "rw" unless TWO other important criteria are met: 1) the user has a
|
||||
* private user key, and therefore per-user storage; and 2) the disk image 'path' contains an asterisk (*)
|
||||
* that the server can internally remap to a directory in the user's storage; eg:
|
||||
*
|
||||
*
|
||||
* 'path': <asterisk>/10mb.img (path components following the asterisk are optional)
|
||||
*
|
||||
*
|
||||
* If the disk image does not already exist, it will be created (but not formatted).
|
||||
*
|
||||
*
|
||||
* This preserves the promise that EVERYTHING a user does within a PCjs machine is private (ie, not
|
||||
* visible to any other PCjs users). I don't want to be in the business of saving any user machine
|
||||
* states or disk changes, but at least those operations are limited to users who have asked for (and
|
||||
* received) a private user key.
|
||||
*
|
||||
*
|
||||
* Another important consideration at this stage is dealing with multiple machines writing to the same
|
||||
* disk image; even though we're limiting the "demandrw" mode to per-user images, a single user may still
|
||||
* inadvertently start up multiple machines that refer to the same disk image.
|
||||
*
|
||||
*
|
||||
* So, every PCjs machine needs to generate a unique token and include that token with every Disk I/O API
|
||||
* operation, so that the server can revoke a previous machine's "rw" access to a disk image when a new
|
||||
* machine requests "rw" access to the same disk image.
|
||||
*
|
||||
*
|
||||
* From the client's perspective, revocation can be quietly dealt with by reverting to "demandro" mode;
|
||||
* that client becomes stuck with all their dirty sectors until they can reclaim "rw" access, which should
|
||||
* only happen if no intervening writes to the disk image on the server have occurred (if I bother allowing
|
||||
* reclamation at all).
|
||||
*
|
||||
*
|
||||
* The real challenge here is avoiding revocation of a machine that still has critical changes to commit,
|
||||
* but since we can't even solve the problem of a user closing their browser at an inopportune time
|
||||
* and potentially leaving a disk image in an inconsistent state, premature revocation is the least of
|
||||
|
|
@ -159,12 +159,12 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -177,7 +177,7 @@ if (typeof module !== 'undefined') {
|
|||
* @property {number} iHead
|
||||
* @property {number} iModify
|
||||
* @property {number} cModify
|
||||
*
|
||||
*
|
||||
* Every Sector object (once loaded and fully parsed) should have ALL of the following named properties:
|
||||
*
|
||||
* 'sector': sector number
|
||||
|
|
@ -186,7 +186,7 @@ if (typeof module !== 'undefined') {
|
|||
* 'pattern': dword pattern to use for empty or partial sectors (or null if sector still needs to be loaded)
|
||||
*
|
||||
* initSector() also sets the following properties, to help us quickly identify its location within aDiskData:
|
||||
*
|
||||
*
|
||||
* iCylinder
|
||||
* iHead
|
||||
*
|
||||
|
|
@ -195,7 +195,7 @@ if (typeof module !== 'undefined') {
|
|||
* iModify: index of first modified dword in sector
|
||||
* cModify: number of modified dwords in sector
|
||||
* fDirty: true if sector is dirty, false if clean (or cleaning in progress)
|
||||
*
|
||||
*
|
||||
* fDirty is used in conjunction with "demandrw" disks; it is set to true whenever the sector is modified, and is
|
||||
* set to false whenever the sector has been sent to the server. If the server write succeeds and fDirty is still
|
||||
* false, then the sector modifications are removed (cModify is set to zero). If the write succeeds but fDirty was
|
||||
|
|
@ -203,7 +203,7 @@ if (typeof module !== 'undefined') {
|
|||
* in place (since we don't keep track of more than one modification range within a sector). And if the write failed,
|
||||
* then fDirty is set back to true and again all modifications remain in place; the best we can do is schedule another
|
||||
* write attempt.
|
||||
*
|
||||
*
|
||||
* TODO: Perhaps we should also maintain a failure count and stop trying to write sectors that reach a certain
|
||||
* threshold. Error-handling, as usual, is the thorniest problem.
|
||||
*/
|
||||
|
|
@ -223,7 +223,7 @@ if (typeof module !== 'undefined') {
|
|||
*
|
||||
* This means, for example, that all references to "track[iSector].data" must actually appear as
|
||||
* "track[iSector]['data']".
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {HDC|FDC} controller
|
||||
|
|
@ -233,13 +233,13 @@ if (typeof module !== 'undefined') {
|
|||
function Disk(controller, drive, mode)
|
||||
{
|
||||
Component.call(this, "Disk", {'id': controller.idMachine + ".disk" + Disk.nDisks++}, Disk);
|
||||
|
||||
|
||||
this.controller = controller;
|
||||
this.cmp = controller.cmp;
|
||||
this.dbg = controller.dbg;
|
||||
this.drive = drive;
|
||||
this.mode = mode;
|
||||
|
||||
|
||||
/*
|
||||
* We pull out a number of drive properties that we may or may not need as defaults
|
||||
*/
|
||||
|
|
@ -258,11 +258,11 @@ function Disk(controller, drive, mode)
|
|||
|
||||
/*
|
||||
* The following dirty sector and timer properties are used only with fOnDemand disks,
|
||||
* assuming fRemote was successfully set.
|
||||
* assuming fRemote was successfully set.
|
||||
*/
|
||||
this.aDirtySectors = [];
|
||||
this.aDirtyTimestamps = []; // this array is parallel to aDirtySectors
|
||||
this.timerWrite = null; // REMOTE_WRITE_DELAY timer in effect, if any
|
||||
this.timerWrite = null; // REMOTE_WRITE_DELAY timer in effect, if any
|
||||
this.msTimerWrite = 0; // the time that the write timer, if any, is set to fire
|
||||
this.fWriteInProgress = false;
|
||||
|
||||
|
|
@ -276,12 +276,12 @@ function Disk(controller, drive, mode)
|
|||
* @property {number} 2 contains iSector
|
||||
* @property {number} 3 contains nSectors
|
||||
* @property {boolean} 4 contains fAsync
|
||||
* @property {function(nErrorCode:number,fAsync:boolean)} 5 contains done
|
||||
* @property {function(nErrorCode:number,fAsync:boolean)} 5 contains done
|
||||
*/
|
||||
|
||||
/**
|
||||
* The default number of milliseconds to wait before writing a dirty sector back to a remote disk image
|
||||
*
|
||||
*
|
||||
* @const {number}
|
||||
*/
|
||||
Disk.REMOTE_WRITE_DELAY = 2000; // 2-second delay
|
||||
|
|
@ -295,7 +295,7 @@ Component.subclass(Component, Disk);
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* We have no real interest in this notification, other than to obtain a reference to the Debugger
|
||||
* for every disk loaded BEFORE the initBus() phase; any disk loaded AFTER that point will get its Debugger
|
||||
* reference, if any, from the disk controller passed to the Disk() constructor.
|
||||
|
|
@ -315,7 +315,7 @@ Disk.prototype.initBus = function(cmp, bus, cpu, dbg) {
|
|||
*
|
||||
* As with powerDown(), our sole concern here is for REMOTE disks: if a powerDown() call disconnected an
|
||||
* "on-demand" disk, we need to get reconnected. Calling our own load() function should get the job done.
|
||||
*
|
||||
*
|
||||
* The HDC component could have triggered this as well, but its powerUp() function only calls autoMount()
|
||||
* in case of page (ie, application) reload, which is fine for local disks but insufficient for remote disks,
|
||||
* which have a server connection that must re-established.
|
||||
|
|
@ -339,14 +339,14 @@ Disk.prototype.powerUp = function(data, fRepower) {
|
|||
*
|
||||
* Our sole concern here is for REMOTE disks, making sure any unwritten changes get flushed to
|
||||
* the server during a shutdown. No local state is ever returned, so fSave is ignored.
|
||||
*
|
||||
*
|
||||
* Local disks are managed by the controller (ie, FDC or HDC) that mounted them; the controller's
|
||||
* powerDown() handler will take care of calling save() as needed.
|
||||
*
|
||||
*
|
||||
* TODO: Consider taking responsibility for saving the state of local disks as well; the only reason
|
||||
* the controllers still take care of them is historical, because this component originally didn't
|
||||
* exist, and even after it was created, it didn't originally receive powerDown() notifications.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {boolean} fSave
|
||||
* @param {boolean} [fShutdown]
|
||||
|
|
@ -385,7 +385,7 @@ Disk.prototype.powerDown = function(fSave, fShutdown)
|
|||
|
||||
/**
|
||||
* create()
|
||||
*
|
||||
*
|
||||
* Initializes the disk contents according to the current drive mode and parameters.
|
||||
*/
|
||||
Disk.prototype.create = function()
|
||||
|
|
@ -407,7 +407,7 @@ Disk.prototype.create = function()
|
|||
* Now that our read() and write() functions can deal with unallocated data
|
||||
* arrays, and can read/write the specified pattern on-the-fly, we no longer need
|
||||
* to pre-allocate and pre-initialize the 'data' array.
|
||||
*
|
||||
*
|
||||
* For "local" disks, we can assume a 'pattern' of 0, but for "demandrw" and "demandro"
|
||||
* disks, 'pattern' is set to null, as yet another indication that I/O is required to load
|
||||
* the sector from the server (or to write it back to the server).
|
||||
|
|
@ -429,12 +429,12 @@ Disk.prototype.create = function()
|
|||
* TODO: Figure out how we can strongly type fnNotify, because the Closure Compiler has issues with:
|
||||
*
|
||||
* param {function(Component,Object,Disk,string,string)} fnNotify
|
||||
*
|
||||
*
|
||||
* Also, while we're at it, learn if there are ways to:
|
||||
*
|
||||
*
|
||||
* 1) declare a function taking NO parameters (ie, generate a warning if any parameters are specified)
|
||||
* 2) declare a type for a function's return value
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {string} sDiskName
|
||||
* @param {string} sDiskPath
|
||||
|
|
@ -443,7 +443,7 @@ Disk.prototype.create = function()
|
|||
Disk.prototype.load = function(sDiskName, sDiskPath, fnNotify)
|
||||
{
|
||||
var sDiskURL = sDiskPath;
|
||||
|
||||
|
||||
/*
|
||||
* We could use this.log() as well, but it wouldn't also log which component initiated the load.
|
||||
*/
|
||||
|
|
@ -452,7 +452,7 @@ Disk.prototype.load = function(sDiskName, sDiskPath, fnNotify)
|
|||
this.controller.log(sMessage);
|
||||
this.messageDebugger(sMessage);
|
||||
}
|
||||
|
||||
|
||||
this.sDiskName = sDiskName;
|
||||
this.sDiskPath = sDiskPath;
|
||||
this.fnNotify = fnNotify;
|
||||
|
|
@ -484,16 +484,16 @@ Disk.prototype.load = function(sDiskName, sDiskPath, fnNotify)
|
|||
* disk BPBs, you'll always get a standard PC XT 10mb disk image, so if the 'file' or 'dir' contains
|
||||
* more than 10mb of data, the request will fail. Ultimately, I want to honor the controller's
|
||||
* driveConfig 'size' parm, or to match the capacity required by the driveConfig 'type' parameter.
|
||||
*
|
||||
*
|
||||
* If a 'disk' is specified, we pass mbhd=0, because the actual size will depend on the image.
|
||||
* However, I don't currently have any .DSK or .IMG files containing hard disk images; those formats
|
||||
* were really intended for floppy disk images. If I never create any hard disk image files, then
|
||||
* we can simply eliminate sSizeParm in the 'disk' case.
|
||||
*
|
||||
*
|
||||
* Added more extensions to the list of paths-treated-as-disk-images, so that URLs to files located here:
|
||||
*
|
||||
*
|
||||
* ftp://ftp.oldskool.org/pub/TOPBENCH/dskimage/
|
||||
*
|
||||
*
|
||||
* can be used as-is. TODO: There's a TODO in netlib.getFile() regarding remote support that needs
|
||||
* to be resolved first; DiskDump relies on that function for its remote requests, and it currently
|
||||
* supports only HTTP.
|
||||
|
|
@ -513,10 +513,10 @@ Disk.prototype.load = function(sDiskName, sDiskPath, fnNotify)
|
|||
|
||||
/**
|
||||
* onLoadDisk(sDiskFile, sDiskData, nErrorCode, sDiskPath)
|
||||
*
|
||||
*
|
||||
* This function was originally called mount(). If the mount is successful, we pass the Disk object to the
|
||||
* caller's fnNotify handler; otherwise, we pass null.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {string} sDiskFile
|
||||
* @param {string} sDiskData
|
||||
|
|
@ -578,18 +578,18 @@ Disk.prototype.onLoadDisk = function(sDiskFile, sDiskData, nErrorCode, sDiskPath
|
|||
* eval(). In particular, the 10Mb disk image we use for the Windows 1.01 demo config fails in
|
||||
* IE9 with an "Out of memory" exception. One work-around would be to chop the data into chunks
|
||||
* (perhaps one track per chunk, using regular expressions) and then manually re-assemble it.
|
||||
*
|
||||
*
|
||||
* However, it turns out that using JSON.parse(sDiskData) instead of eval("(" + sDiskData + ")")
|
||||
* is a much easier fix. The only drawback is that we must first quote any unquoted property names
|
||||
* and remove any comments, because while eval() was cool with them, JSON.parse() is more particular;
|
||||
* the following RegExp replacements take care of those requirements.
|
||||
*
|
||||
*
|
||||
* The use of hex values is something else that eval() was OK with, but JSON.parse() is not, and
|
||||
* while I've stopped using hex values in DumpAPI responses (at least when "format=json" is specified),
|
||||
* I can't guarantee they won't show up in "legacy" images, and there's no simple RegExp replacement
|
||||
* for transforming hex values into decimal values, so I cop out and fall back to eval() if I detect
|
||||
* any hex prefixes ("0x") in the sequence. Ditto for error messages, which appear like so:
|
||||
*
|
||||
*
|
||||
* ["unrecognized disk path: test.img"]
|
||||
*/
|
||||
var aDiskData;
|
||||
|
|
@ -622,18 +622,18 @@ Disk.prototype.onLoadDisk = function(sDiskFile, sDiskData, nErrorCode, sDiskPath
|
|||
* aDiskData is an array of cylinders, each of which is an array of heads, each of which
|
||||
* is an array of sector objects. The format does not impose any limitations on number of
|
||||
* cylinders, number of heads, or number of bytes in any of the sector object byte-arrays.
|
||||
*
|
||||
*
|
||||
* WARNING: All accesses to sector object properties must be via their string names, not their
|
||||
* "dot" names, otherwise code will break after it's been processed by the Closure Compiler.
|
||||
*
|
||||
*
|
||||
* Sector object properties include:
|
||||
*
|
||||
*
|
||||
* 'sector' the sector number (1-based, not required to be sequential)
|
||||
* 'length' the byte-length (ie, formatted length) of the sector
|
||||
* 'data' the dword-array containing the sector data
|
||||
* 'pattern' if the dword-array length is less than 'length'/4, this value must be used
|
||||
* to pad out the sector; if no 'pattern' is specified, it's assumed to be zero
|
||||
*
|
||||
*
|
||||
* We still support the older JSON encoding, where sector data was encoded as an array of 'bytes'
|
||||
* rather than a dword 'data' array. However, our support is strictly limited to an on-the-fly
|
||||
* conversion to a forward-compatible 'data' array.
|
||||
|
|
@ -698,27 +698,27 @@ Disk.prototype.onLoadDisk = function(sDiskFile, sDiskData, nErrorCode, sDiskPath
|
|||
}
|
||||
/*
|
||||
* The current sector should now have ALL the properties of a proper Sector object; ie:
|
||||
*
|
||||
*
|
||||
* 'sector': sector number
|
||||
* 'length': size of the sector, in bytes
|
||||
* 'data': array of dwords
|
||||
* 'pattern': dword pattern to use for empty or partial sectors
|
||||
*
|
||||
*
|
||||
* In addition, we will maintain the following information on a per-sector basis,
|
||||
* as sectors are modified:
|
||||
*
|
||||
*
|
||||
* iModify: index of first modified dword in sector
|
||||
* cModify: number of modified dwords in sector
|
||||
* fDirty: true if sector is dirty, false if clean (or cleaning in progress)
|
||||
*
|
||||
*
|
||||
* And for the disk as a whole, we maintain a checksum of the original unmodified data:
|
||||
*
|
||||
*
|
||||
* dwChecksum: summation of all dwords in all non-empty sectors
|
||||
*/
|
||||
this.initSector(sector, iCylinder, iHead);
|
||||
/*
|
||||
* Pattern-filling of sectors is deferred until absolutely necessary (eg, when a sector is
|
||||
* being written). So all we need to do at this point is checksum all the initial sector data.
|
||||
* being written). So all we need to do at this point is checksum all the initial sector data.
|
||||
*/
|
||||
for (var idw = 0; idw < adw.length; idw++) {
|
||||
dwChecksum = (dwChecksum + adw[idw]) & 0xffffffff;
|
||||
|
|
@ -741,7 +741,7 @@ Disk.prototype.onLoadDisk = function(sDiskFile, sDiskData, nErrorCode, sDiskPath
|
|||
|
||||
/**
|
||||
* initSector(sector, iCylinder, iHead, iSector, cbSector, dwPattern)
|
||||
*
|
||||
*
|
||||
* @param {Object} sector
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
|
|
@ -779,7 +779,7 @@ Disk.prototype.onLoadParseSectors = function(sURLName, sURLData, nErrorCode, sec
|
|||
var iSector = sectorInfo[2];
|
||||
var nSectors = sectorInfo[3];
|
||||
fAsync = sectorInfo[4];
|
||||
|
||||
|
||||
if (DEBUG) this.messageDebugger("Disk.onLoadParseSectors(" + iCylinder + ":" + iHead + ":" + iSector + ":" + nSectors + ")");
|
||||
|
||||
var abData = JSON.parse(sURLData);
|
||||
|
|
@ -788,10 +788,10 @@ Disk.prototype.onLoadParseSectors = function(sURLName, sURLData, nErrorCode, sec
|
|||
/*
|
||||
* We call seek with fWrite == true to prevent seek() from triggering another call
|
||||
* to readRemoteSectors() and endlessly recursing. That also forces seek() to:
|
||||
*
|
||||
*
|
||||
* 1) zero the sector's 'pattern'
|
||||
* 2) disable warning about reading an uninitialized sector
|
||||
*
|
||||
*
|
||||
* We KNOW this is an uninitialized sector, because we're about to initialize it.
|
||||
*/
|
||||
var sector = this.seek(iCylinder, iHead, iSector, true);
|
||||
|
|
@ -814,11 +814,11 @@ Disk.prototype.onLoadParseSectors = function(sURLName, sURLData, nErrorCode, sec
|
|||
|
||||
/**
|
||||
* connectRemoteDisk(sDiskPath)
|
||||
*
|
||||
*
|
||||
* Unlike disconnect(), we don't issue the connect request ourselves; instead, we piggyback on the existing
|
||||
* preload code in load() to establish the connection. That, in turn, will trigger a call to mount(), which
|
||||
* will check fOnDemand and set fRemote if the connection was successful.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {string} sDiskPath
|
||||
* @return {string} is the URL connection string required to connect to sDiskPath
|
||||
|
|
@ -836,7 +836,7 @@ Disk.prototype.connectRemoteDisk = function(sDiskPath)
|
|||
|
||||
/**
|
||||
* readRemoteSectors(iCylinder, iHead, iSector, nSectors, done)
|
||||
*
|
||||
*
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
* @param {number} iSector
|
||||
|
|
@ -847,7 +847,7 @@ Disk.prototype.connectRemoteDisk = function(sDiskPath)
|
|||
Disk.prototype.readRemoteSectors = function(iCylinder, iHead, iSector, cbSector, nSectors, done)
|
||||
{
|
||||
if (DEBUG) this.messageDebugger("Disk.readRemoteSectors(" + iCylinder + ":" + iHead + ":" + iSector + ":" + nSectors + "," + cbSector + ")");
|
||||
|
||||
|
||||
if (this.fRemote) {
|
||||
var sParms = DiskAPI.QUERY.ACTION + '=' + DiskAPI.ACTION.READ;
|
||||
sParms += '&' + DiskAPI.QUERY.VOLUME + '=' + this.sDiskPath;
|
||||
|
|
@ -868,12 +868,12 @@ Disk.prototype.readRemoteSectors = function(iCylinder, iHead, iSector, cbSector,
|
|||
* Writes to a remote disk are performed on a timer-driven basis. When a sector is modified for the first time,
|
||||
* a reference to that sector is "pushed" onto (ie, appended to the end of) aDirtySectors, and if aDirtySectors was
|
||||
* originally empty, then a REMOTE_WRITE_DELAY timer is set.
|
||||
*
|
||||
*
|
||||
* When the timer fires, the first batch of contiguous sectors is sent off the server, and when the server responds
|
||||
* (ie, when cleanDirtySectors() is called), if the response indicates success, every sector that was sent is marked
|
||||
* clean -- unless one or more writes to the sector occurred in the meantime, which we track through a per-sector
|
||||
* fDirty flag.
|
||||
*
|
||||
* fDirty flag.
|
||||
*
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
* @param {number} iSector
|
||||
|
|
@ -885,7 +885,7 @@ Disk.prototype.readRemoteSectors = function(iCylinder, iHead, iSector, cbSector,
|
|||
Disk.prototype.writeRemoteSectors = function(iCylinder, iHead, iSector, nSectors, abSectors, fAsync)
|
||||
{
|
||||
if (DEBUG) this.messageDebugger("Disk.writeRemoteSectors(" + iCylinder + ":" + iHead + ":" + iSector + ":" + nSectors + ")");
|
||||
|
||||
|
||||
if (this.fRemote) {
|
||||
var data = {};
|
||||
this.fWriteInProgress = true;
|
||||
|
|
@ -904,7 +904,7 @@ Disk.prototype.writeRemoteSectors = function(iCylinder, iHead, iSector, nSectors
|
|||
|
||||
/**
|
||||
* disconnectRemoteDisk()
|
||||
*
|
||||
*
|
||||
* This is called by our powerDown() notification handler. If fRemote is true, we issue the disconnect request and
|
||||
* then immediately set fRemote to false; we don't wait for (or test) the response.
|
||||
*
|
||||
|
|
@ -928,7 +928,7 @@ Disk.prototype.disconnectRemoteDisk = function()
|
|||
*
|
||||
* Mark the specified sector as dirty, add it to the queue (aDirtySectors) if not already added,
|
||||
* and establish a timeout handler (findDirtySectors) if not already established.
|
||||
*
|
||||
*
|
||||
* A freshly dirtied sector should sit in the queue for a short period of time (eg, 2 seconds)
|
||||
* before we attempt to write it; that is, a REMOTE_WRITE_DELAY timer should start ticking again
|
||||
* for any sector that is rewritten. However, there will be exceptions; for example, when a sector
|
||||
|
|
@ -961,7 +961,7 @@ Disk.prototype.queueDirtySector = function(sector, fAsync)
|
|||
*
|
||||
* If a timer is already active, make sure it's still valid (ie, the time the timer is scheduled to fire is
|
||||
* >= the timestamp of the next dirty sector + REMOTE_WRITE_DELAY); if not, cancel the timer and start a new one.
|
||||
*
|
||||
*
|
||||
* @return {boolean} true if write timer set, false if not
|
||||
*/
|
||||
Disk.prototype.updateWriteTimer = function()
|
||||
|
|
@ -1050,7 +1050,7 @@ Disk.prototype.onWriteCleanSectors = function(sURLName, sURLData, nErrorCode, se
|
|||
var nSectors = sectorInfo[3];
|
||||
var fAsync = sectorInfo[4];
|
||||
this.fWriteInProgress = false;
|
||||
|
||||
|
||||
if (iCylinder >= 0 && iCylinder < this.aDiskData.length && iHead >= 0 && iHead < this.aDiskData[iCylinder].length) {
|
||||
for (var i = iSector - 1; nSectors-- > 0 && i >= 0 && i < this.aDiskData[iCylinder][iHead].length; i++) {
|
||||
var sector = this.aDiskData[iCylinder][iHead][i];
|
||||
|
|
@ -1071,7 +1071,7 @@ Disk.prototype.onWriteCleanSectors = function(sURLName, sURLData, nErrorCode, se
|
|||
|
||||
/**
|
||||
* info()
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @return {Array} containing: [nCylinders, nHeads, nSectorsPerTrack, nBytesPerSector]
|
||||
*/
|
||||
|
|
@ -1079,7 +1079,7 @@ Disk.prototype.info = function()
|
|||
{
|
||||
if (!this.aDiskData.length) {
|
||||
return [0, 0, 0, 0];
|
||||
}
|
||||
}
|
||||
return [this.aDiskData.length, this.aDiskData[0].length, this.aDiskData[0][0].length, this.aDiskData[0][0][0]['length']];
|
||||
};
|
||||
|
||||
|
|
@ -1091,7 +1091,7 @@ Disk.prototype.info = function()
|
|||
* Sectors that were initially compressed should remain compressed unless/until they were modified.
|
||||
*
|
||||
* TODO: Check sectors (or at least modified sectors) to see if they can be recompressed.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @return {string} containing the entire disk image as JSON-encoded data
|
||||
*/
|
||||
|
|
@ -1104,7 +1104,7 @@ Disk.prototype.dump = function()
|
|||
* back again during mount() -- or whenever JSON.parse() is used instead of eval(). But I still remove
|
||||
* them temporarily, so that any remaining property names (eg, "iModify", "cModify", "fDirty") can
|
||||
* easily be stripped out, by virtue of their being the only quoted properties left. We then "requote"
|
||||
* all the property names that remain.
|
||||
* all the property names that remain.
|
||||
*/
|
||||
s = s.replace(/"(sector|length|data|pattern)":/gm, "$1:");
|
||||
/*
|
||||
|
|
@ -1124,17 +1124,17 @@ Disk.prototype.dump = function()
|
|||
* properties. That code used to be in the FDC component, where it was perfectly reasonable
|
||||
* to access those properties. We need a cleaner interface back to the drive, similar to the
|
||||
* info() interface we provide to the controller.
|
||||
*
|
||||
*
|
||||
* Whether or not the "dynamic reconfiguration" feature itself is perfectly reasonable is,
|
||||
* of course, a separate question.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {number} iCylinder
|
||||
* @param {number} iHead
|
||||
* @param {number} iSector
|
||||
* @param {boolean} [fWrite]
|
||||
* @param {function(Object,boolean)} [done]
|
||||
* @return {Object|null} is the requested sector, or null if not found (or not available yet)
|
||||
* @return {Object|null} is the requested sector, or null if not found (or not available yet)
|
||||
*/
|
||||
Disk.prototype.seek = function(iCylinder, iHead, iSector, fWrite, done)
|
||||
{
|
||||
|
|
@ -1181,7 +1181,7 @@ Disk.prototype.seek = function(iCylinder, iHead, iSector, fWrite, done)
|
|||
this.readRemoteSectors(iCylinder, iHead, iSector, drive.cbSector, nSectors, function onReadRemoteComplete(err, fAsync) {
|
||||
if (err) sector = null;
|
||||
// noinspection JSReferencingMutableVariableFromClosure
|
||||
done(sector, fAsync);
|
||||
done(sector, fAsync);
|
||||
});
|
||||
return null;
|
||||
} else {
|
||||
|
|
@ -1205,7 +1205,7 @@ Disk.prototype.seek = function(iCylinder, iHead, iSector, fWrite, done)
|
|||
|
||||
/**
|
||||
* fill(sector, ab, off)
|
||||
*
|
||||
*
|
||||
* @param {Object} sector
|
||||
* @param {*} ab (technically, this should be typed as Array.<number> but I'm having trouble coercing JSON.parse() to that)
|
||||
* @param {number} off
|
||||
|
|
@ -1251,7 +1251,7 @@ Disk.prototype.toBytes = function(sector)
|
|||
|
||||
/**
|
||||
* read(sector, ibSector, fCompare)
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {Object} sector (returned from a previous seek)
|
||||
* @param {number} ibSector a byte index within the given sector
|
||||
|
|
@ -1261,7 +1261,7 @@ Disk.prototype.toBytes = function(sector)
|
|||
Disk.prototype.read = function(sector, ibSector, fCompare)
|
||||
{
|
||||
var b = -1;
|
||||
|
||||
|
||||
if (DEBUG && !ibSector && !fCompare) this.messageDebugger("Disk.read(" + this.controller.id + ":" + this.drive.iDrive + "," + sector.iCylinder + ":" + sector.iHead + ":" + sector['sector'] + ")");
|
||||
|
||||
if (ibSector < sector['length']) {
|
||||
|
|
@ -1275,7 +1275,7 @@ Disk.prototype.read = function(sector, ibSector, fCompare)
|
|||
|
||||
/**
|
||||
* write(sector, ibSector, b)
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {Object} sector (returned from a previous seek)
|
||||
* @param {number} ibSector a byte index within the given sector
|
||||
|
|
@ -1286,7 +1286,7 @@ Disk.prototype.write = function(sector, ibSector, b)
|
|||
{
|
||||
if (this.fWriteProtected)
|
||||
return false;
|
||||
|
||||
|
||||
if (DEBUG && !ibSector) this.messageDebugger("Disk.write(" + this.controller.id + ":" + this.drive.iDrive + "," + sector.iCylinder + ":" + sector.iHead + ":" + sector['sector'] + ")");
|
||||
|
||||
if (ibSector < sector['length']) {
|
||||
|
|
@ -1299,7 +1299,7 @@ Disk.prototype.write = function(sector, ibSector, b)
|
|||
* Ensure every byte up to the specified byte is properly initialized.
|
||||
*/
|
||||
for (var i = adw.length; i <= idw; i++) adw[i] = dwPattern;
|
||||
|
||||
|
||||
if (!sector.cModify) {
|
||||
sector.iModify = idw;
|
||||
sector.cModify = 1;
|
||||
|
|
@ -1330,7 +1330,7 @@ Disk.prototype.write = function(sector, ibSector, b)
|
|||
* [iCylinder, iHead, iSector, iModify, [...]]
|
||||
*
|
||||
* where [...] is an array of modified dword(s) in the corresponding sector.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @return {Array} of modified sectors
|
||||
*/
|
||||
|
|
@ -1373,7 +1373,7 @@ Disk.prototype.save = function()
|
|||
* [iCylinder, iHead, iSector, iModify, [...]]
|
||||
*
|
||||
* where [...] is an array of modified dword(s) in the corresponding sector.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {Array} deltas
|
||||
* @return {number} 0 if no changes applied, -1 if an error occurred, otherwise the number of sectors modified
|
||||
|
|
@ -1382,7 +1382,7 @@ Disk.prototype.restore = function(deltas)
|
|||
{
|
||||
/*
|
||||
* If deltas is undefined, that's not necessarily an error; the controller may simply be (re)initializing
|
||||
* itself (although neither controller should be calling restore() under those conditions anymore).
|
||||
* itself (although neither controller should be calling restore() under those conditions anymore).
|
||||
*/
|
||||
var nChanges = 0;
|
||||
var sReason = "unsupported restore format";
|
||||
|
|
@ -1426,7 +1426,7 @@ Disk.prototype.restore = function(deltas)
|
|||
* Note the buried test for write-protection. Yes, an invariant condition should be tested
|
||||
* outside the loop, not inside, but (a) it's a trivial test, (b) the test should never fail
|
||||
* because save() should never generate any mods for a write-protected disk, and (c) it
|
||||
* centralizes all the failure conditions we're currently checking (which, admittedly, ain't much).
|
||||
* centralizes all the failure conditions we're currently checking (which, admittedly, ain't much).
|
||||
*/
|
||||
if (iCylinder >= this.aDiskData.length || iHead >= this.aDiskData[iCylinder].length || iSector >= this.aDiskData[iCylinder][iHead].length) {
|
||||
sReason = "sector " + iCylinder + ":" + iHead + ":" + iSector + " out of range (" + nChanges + " changes applied)";
|
||||
|
|
@ -1471,7 +1471,7 @@ Disk.prototype.restore = function(deltas)
|
|||
* messageDebugger(sMessage)
|
||||
*
|
||||
* This is a combination of the Debugger's messageEnabled(MESSAGE_DISK) and message() functions, for convenience.
|
||||
*
|
||||
*
|
||||
* @this {Disk}
|
||||
* @param {string} sMessage is any caller-defined message string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var Disk = require("./disk");
|
||||
var Computer = require("./computer");
|
||||
var State = require("./state");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var Disk = require("./disk");
|
||||
var Computer = require("./computer");
|
||||
var State = require("./state");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -738,6 +738,13 @@ FDC.prototype.initController = function(data)
|
|||
for (iDrive = 0; iDrive < this.aDrives.length; iDrive++) {
|
||||
var drive = this.aDrives[iDrive];
|
||||
if (drive === undefined) {
|
||||
/*
|
||||
* The first time each drive is initialized, obtain its type (from switches or CMOS) and the physical limits
|
||||
* of the drive (ie, max tracks and max sectors/track). As for max heads, initDrive() assumes that all drives
|
||||
* have two heads, and in any case, there's no way to configure/specify a single-sided floppy drive.
|
||||
*
|
||||
* TODO: Provide a configuration option for single-sided drives, in case someone really wants to simulate that.
|
||||
*/
|
||||
drive = this.aDrives[iDrive] = {};
|
||||
drive.bType = this.chipset.getSWFloppyDriveType(iDrive);
|
||||
drive.nCylinders = 40;
|
||||
|
|
@ -823,7 +830,7 @@ FDC.prototype.initDrive = function(drive, iDrive, data)
|
|||
/*
|
||||
* Note that when no data is provided (eg, when the controller is being reinitialized), we now take
|
||||
* care to preserve any drive defaults that initController() already obtained for us, falling back to
|
||||
* bare minimums only when all else has failed.
|
||||
* bare minimums only when all else fails.
|
||||
*/
|
||||
data[1] = [FDC.DEFAULT_DRIVE_NAME, drive.nCylinders || 40, drive.nHeads || data[3], drive.nSectors || 9, drive.cbSector || 512, data[1]];
|
||||
}
|
||||
|
|
@ -845,6 +852,18 @@ FDC.prototype.initDrive = function(drive, iDrive, data)
|
|||
drive.nSectors = data[i][3]; // sectors/track
|
||||
drive.cbSector = data[i][4]; // bytes/sector
|
||||
drive.fRemovable = data[i][5];
|
||||
/*
|
||||
* If we have current media parameters, restore them; otherwise, default to the drive's physical parameters.
|
||||
*/
|
||||
if (drive.nDiskCylinders = data[i][6]) {
|
||||
drive.nDiskHeads = data[i][7];
|
||||
drive.nDiskSectors = data[i][8];
|
||||
} else {
|
||||
drive.nDiskCylinders = drive.nCylinders;
|
||||
drive.nDiskHeads = drive.nHeads;
|
||||
drive.nDiskSectors = drive.nSectors;
|
||||
|
||||
}
|
||||
i++;
|
||||
|
||||
/*
|
||||
|
|
@ -888,11 +907,7 @@ FDC.prototype.initDrive = function(drive, iDrive, data)
|
|||
drive.nBytes = data[i++];
|
||||
|
||||
/*
|
||||
* The next group of properties are set by user requests to load/unload diskette images.
|
||||
*
|
||||
* NOTE: I now avoid reinitializing drive.disk in order to retain any previously mounted diskette across resets.
|
||||
*
|
||||
* drive.disk = null; // when a "disk" is "inserted" into the "drive", this is a Disk object
|
||||
* We no longer reinitialize drive.disk, in order to retain previously mounted diskette across resets.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -971,7 +986,7 @@ FDC.prototype.saveDrive = function(drive)
|
|||
var i = 0;
|
||||
var data = [];
|
||||
data[i++] = drive.resCode;
|
||||
data[i++] = [drive.name, drive.nCylinders, drive.nHeads, drive.nSectors, drive.cbSector, drive.fRemovable];
|
||||
data[i++] = [drive.name, drive.nCylinders, drive.nHeads, drive.nSectors, drive.cbSector, drive.fRemovable, drive.nDiskCylinders, drive.nDiskHeads, drive.nDiskSectors];
|
||||
data[i++] = drive.bHead;
|
||||
/*
|
||||
* We used to store drive.nHeads in the next slot, but now we store bCylinderSeek,
|
||||
|
|
@ -1170,15 +1185,20 @@ FDC.prototype.loadDiskette = function(iDrive, sDisketteName, sDiskettePath, fAut
|
|||
*/
|
||||
FDC.prototype.mountDiskette = function(drive, disk, sDisketteName, sDiskettePath)
|
||||
{
|
||||
var aDiskInfo;
|
||||
|
||||
drive.fBusy = false;
|
||||
|
||||
/*
|
||||
* We shouldn't mount the diskette unless the drive is able to handle it; for example, DSDD (40-track)
|
||||
* drives cannot read DSHD (80-track) diskettes.
|
||||
*/
|
||||
if (disk && disk.aDiskData.length > drive.nCylinders) {
|
||||
this.notice("Diskette \"" + sDisketteName + "\" too large for drive " + String.fromCharCode(0x41 + drive.iDrive));
|
||||
disk = null;
|
||||
if (disk) {
|
||||
/*
|
||||
* We shouldn't mount the diskette unless the drive is able to handle it; for example, DSDD (40-track)
|
||||
* drives cannot read DSHD (80-track) diskettes.
|
||||
*/
|
||||
aDiskInfo = disk.info();
|
||||
if (disk && aDiskInfo[0] > drive.nCylinders || aDiskInfo[1] > drive.nHeads || aDiskInfo[2] > drive.nSectors) {
|
||||
this.notice("Diskette \"" + sDisketteName + "\" too large for drive " + String.fromCharCode(0x41 + drive.iDrive));
|
||||
disk = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (disk) {
|
||||
|
|
@ -1205,6 +1225,13 @@ FDC.prototype.mountDiskette = function(drive, disk, sDisketteName, sDiskettePath
|
|||
* and will not match the drive mappings that DOS ultimately uses (ie, for drives beyond B:).
|
||||
*/
|
||||
this.notice("Mounted diskette \"" + sDisketteName + "\" in drive " + String.fromCharCode(0x41 + drive.iDrive), drive.fAutoMount);
|
||||
|
||||
/*
|
||||
* Update the drive's current media parameters to match the disk's.
|
||||
*/
|
||||
drive.nDiskCylinders = aDiskInfo[0];
|
||||
drive.nDiskHeads = aDiskInfo[1];
|
||||
drive.nDiskSectors = aDiskInfo[2];
|
||||
}
|
||||
|
||||
if (drive.fAutoMount) {
|
||||
|
|
@ -2141,8 +2168,8 @@ FDC.prototype.writeByte = function(drive, b)
|
|||
/**
|
||||
* advanceSector(drive)
|
||||
*
|
||||
* This increments the sector number; when the sector number reaches drive.nSectors on the current track, we
|
||||
* increment drive.bHead and reset drive.bSector, and when drive.bHead reaches drive.nHeads, we reset drive.bHead
|
||||
* This increments the sector number; when the sector number reaches drive.nDiskSectors on the current track, we
|
||||
* increment drive.bHead and reset drive.bSector, and when drive.bHead reaches drive.nDiskHeads, we reset drive.bHead
|
||||
* and increment drive.bCylinder.
|
||||
*
|
||||
* @this {FDC}
|
||||
|
|
@ -2150,13 +2177,13 @@ FDC.prototype.writeByte = function(drive, b)
|
|||
*/
|
||||
FDC.prototype.advanceSector = function(drive)
|
||||
{
|
||||
Component.assert(drive.bCylinder < drive.nCylinders);
|
||||
Component.assert(drive.bCylinder < drive.nDiskCylinders);
|
||||
drive.bSector++;
|
||||
var bSectorStart = 1;
|
||||
if (drive.bSector >= drive.nSectors + bSectorStart) {
|
||||
if (drive.bSector >= drive.nDiskSectors + bSectorStart) {
|
||||
drive.bSector = bSectorStart;
|
||||
drive.bHead++;
|
||||
if (drive.bHead >= drive.nHeads) {
|
||||
if (drive.bHead >= drive.nDiskHeads) {
|
||||
drive.bHead = 0;
|
||||
drive.bCylinder++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var Disk = require("./disk");
|
||||
var State = require("./state");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var Disk = require("./disk");
|
||||
var State = require("./state");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -145,7 +145,7 @@ HDC.aDriveTypes = [
|
|||
* so aDriveTypes must first be indexed by a controller index (this.iHDC).
|
||||
*
|
||||
* The following is a more complete description of the drive types supported by the MODEL_5170, where C is
|
||||
* Cylinders, H is Heads, WP is Write Pre-Comp, and LZ is Landing Zone (in practice, we don't need WP or LZ).
|
||||
* Cylinders, H is Heads, WP is Write Pre-Comp, and LZ is Landing Zone (in practice, we don't need WP or LZ).
|
||||
*
|
||||
* Type C H WP LZ
|
||||
* ---- --- -- --- ---
|
||||
|
|
@ -457,7 +457,7 @@ HDC.BIOS = {
|
|||
};
|
||||
|
||||
/*
|
||||
* NOTE: These are useful values for reference, but they're not actually used for anything at the moment.
|
||||
* NOTE: These are useful values for reference, but they're not actually used for anything at the moment.
|
||||
*/
|
||||
HDC.BIOS.DISK_CMD = {
|
||||
RESET: 0x00,
|
||||
|
|
@ -865,7 +865,7 @@ HDC.prototype.initDrive = function(iDrive, drive, driveConfig, data, fReset)
|
|||
/*
|
||||
* The next group of properties are set by user requests to load/unload disk images.
|
||||
*
|
||||
* NOTE: I now avoid reinitializing drive.disk in order to retain any previously mounted disk across resets.
|
||||
* We no longer reinitialize drive.disk, in order to retain previously mounted disk across resets.
|
||||
*/
|
||||
if (drive.disk === undefined) {
|
||||
drive.disk = null;
|
||||
|
|
@ -1235,7 +1235,7 @@ HDC.prototype.outXTCData = function(port, bOut, addrFrom)
|
|||
}
|
||||
if (this.regDataTotal >= cbCmd) {
|
||||
/*
|
||||
* It's essential that XTC.STATUS.IOMODE be set here, at least after the final 8-byte HDC.XTC.DATA.CMD.INIT_DRIVE sequence.
|
||||
* It's essential that XTC.STATUS.IOMODE be set here, at least after the final 8-byte HDC.XTC.DATA.CMD.INIT_DRIVE sequence.
|
||||
*/
|
||||
this.regStatus |= HDC.XTC.STATUS.IOMODE;
|
||||
this.regStatus &= ~HDC.XTC.STATUS.REQ;
|
||||
|
|
@ -1650,13 +1650,13 @@ HDC.prototype.outATCDrvHd = function(port, bOut, addrFrom)
|
|||
* of configured hard drives is something other than 2, using INT 0x13/AH=0x10. This in turn calls the
|
||||
* BIOS "TST_RDY" function, which selects the drive in this register (see DRIVE_MASK), and then immediately
|
||||
* expects regStatus to reflect success or failure.
|
||||
*
|
||||
*
|
||||
* We were always returning success, because no ATC command was actually issued, and so the user would
|
||||
* always get a spurious CMOS configuration error: "System Options Not Set-(Run SETUP)".
|
||||
*
|
||||
*
|
||||
* So now we update regStatus here. I'm not sure which status bits are normally set to indicate failure,
|
||||
* but it should be sufficient to set or clear the READY bit according to whether the drive exists or not.
|
||||
*
|
||||
*
|
||||
* TODO: Dig into the ATC documentation some more, and determine what other situations, if any, regStatus
|
||||
* needs to be updated.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var State = require("./state");
|
||||
var CPU = require("./cpu");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var State = require("./state");
|
||||
var CPU = require("./cpu");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +57,7 @@ if (typeof module !== 'undefined') {
|
|||
*
|
||||
* Its main purpose is to receive binding requests for various keyboard events,
|
||||
* and to use those events to simulate the PC's keyboard hardware.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsKbd
|
||||
|
|
@ -119,11 +119,11 @@ Keyboard.CMD.SETLEDS = 0xED;
|
|||
Keyboard.CMDRES = {};
|
||||
Keyboard.CMDRES.OVERRUN = 0x00;
|
||||
Keyboard.CMDRES.LOADTEST = 0x65; // this is an undocumented "LOAD MANUFACTURING TEST REQUEST" response code
|
||||
Keyboard.CMDRES.BATSUCCESS = 0xAA; // Basic Assurance Test (BAT) completed successfully
|
||||
Keyboard.CMDRES.BATSUCCESS = 0xAA; // Basic Assurance Test (BAT) completed successfully
|
||||
Keyboard.CMDRES.ECHO = 0xEE;
|
||||
Keyboard.CMDRES.BREAKPREFIX = 0xF0;
|
||||
Keyboard.CMDRES.ACK = 0xFA;
|
||||
Keyboard.CMDRES.BATFAIL = 0xFC; // Basic Assurance Test (BAT) failed
|
||||
Keyboard.CMDRES.BATFAIL = 0xFC; // Basic Assurance Test (BAT) failed
|
||||
Keyboard.CMDRES.DIAGFAIL = 0xFD;
|
||||
Keyboard.CMDRES.RESEND = 0xFE;
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ Keyboard.aButtonCodes = {
|
|||
* For example, Safari on iOS devices will not generate up/down events for shift keys, and for other keys,
|
||||
* the up/down events are usually generated after the actual press is complete, and in rapid succession,
|
||||
* which doesn't always give the simulation enough time to detect the key.
|
||||
*
|
||||
*
|
||||
* The other problem (which is more of a problem with keyboards like the C1P than any IBM keyboards) is
|
||||
* that the shift/modifier state for a character on the "source" keyboard may not match the shift/modifier
|
||||
* state for the same character on the "target" keyboard. And since this code is inherited from C1Pjs,
|
||||
|
|
@ -424,7 +424,7 @@ Keyboard.aCharCodes[Keyboard.CHARCODE.CTRLALTDEL]=0x53 + (Keyboard.CHARCODE.CTRL
|
|||
|
||||
/**
|
||||
* setBinding(sHTMLClass, sHTMLType, sBinding, control)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output")
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
|
|
@ -444,7 +444,7 @@ Keyboard.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, contro
|
|||
*
|
||||
* However, it's also possible for the keyboard XML definition to define a control that serves
|
||||
* a similar purpose; eg:
|
||||
*
|
||||
*
|
||||
* <control class="input" type="text" binding="kbd" width="2em">Kbd</control>
|
||||
*
|
||||
* The latter is purely experimental, while we work on finding ways to trigger the soft keyboard on
|
||||
|
|
@ -508,7 +508,7 @@ Keyboard.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, contro
|
|||
|
||||
/**
|
||||
* findBinding(bKey, t, fDown)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} bKey
|
||||
* @param {string} t is the type of control (eg, "button" or "key")
|
||||
|
|
@ -533,7 +533,7 @@ Keyboard.prototype.findBinding = function(bKey, t, fDown)
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {Computer} cmp
|
||||
* @param {Bus} bus
|
||||
|
|
@ -551,7 +551,7 @@ Keyboard.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
|
||||
/**
|
||||
* setModel(nModel)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} nModel
|
||||
*/
|
||||
|
|
@ -561,7 +561,7 @@ Keyboard.prototype.setModel = function(nModel)
|
|||
|
||||
/**
|
||||
* setReady()
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
*/
|
||||
Keyboard.prototype.setReady = function()
|
||||
|
|
@ -574,7 +574,7 @@ Keyboard.prototype.setReady = function()
|
|||
|
||||
/**
|
||||
* resetDevice()
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
*/
|
||||
Keyboard.prototype.resetDevice = function()
|
||||
|
|
@ -589,12 +589,12 @@ Keyboard.prototype.resetDevice = function()
|
|||
|
||||
/**
|
||||
* setEnable(fData, fClock)
|
||||
*
|
||||
*
|
||||
* This is the ChipSet's primary interface for toggling keyboard "data" and "clock" lines.
|
||||
* For MODEL_5150 and MODEL_5160 machines, this function is called from the ChipSet's PPI_B
|
||||
* output handler. For MODEL_5170 machines, this function is called when selected KBC.CMD
|
||||
* "data bytes" have been written.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {boolean} fData is true if the keyboard simulated data line should be enabled
|
||||
* @param {boolean} fClock is true if the keyboard's simulated clock line should be enabled
|
||||
|
|
@ -635,7 +635,7 @@ Keyboard.prototype.setEnable = function(fData, fClock)
|
|||
*
|
||||
* This is the ChipSet's primary interface for controlling "Model M" keyboards (ie, those used
|
||||
* with MODEL_5170 machines). Commands are delivered through the ChipSet's 8042 Keyboard Controller.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} bCmd should be one of the Keyboard.CMD.* command codes (Model M keyboards only)
|
||||
* @return {number} response should be one of the Keyboard.CMDRES.* response codes, or -1 if unrecognized
|
||||
|
|
@ -656,7 +656,7 @@ Keyboard.prototype.sendCmd = function(bCmd)
|
|||
|
||||
/**
|
||||
* readScanCode(fShift)
|
||||
*
|
||||
*
|
||||
* This is the ChipSet's interface for reading scan codes.
|
||||
*
|
||||
* @this {Keyboard}
|
||||
|
|
@ -676,9 +676,9 @@ Keyboard.prototype.readScanCode = function(fShift)
|
|||
|
||||
/**
|
||||
* shiftScanCode(fFlush)
|
||||
*
|
||||
*
|
||||
* This is the ChipSet's interface to advance (or flush) scan codes.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {boolean} [fFlush] is true to completely flush the keyboard buffer
|
||||
*/
|
||||
|
|
@ -736,7 +736,7 @@ Keyboard.prototype.powerUp = function(data, fRepower)
|
|||
|
||||
/**
|
||||
* powerDown(fSave)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -748,7 +748,7 @@ Keyboard.prototype.powerDown = function(fSave)
|
|||
|
||||
/**
|
||||
* reset()
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
*/
|
||||
Keyboard.prototype.reset = function()
|
||||
|
|
@ -801,7 +801,7 @@ Keyboard.prototype.reset = function()
|
|||
* save()
|
||||
*
|
||||
* This implements save support for the Keyboard component.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @return {Object}
|
||||
*/
|
||||
|
|
@ -816,7 +816,7 @@ Keyboard.prototype.save = function()
|
|||
* restore(data)
|
||||
*
|
||||
* This implements restore support for the Keyboard component.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {Object} data
|
||||
* @return {boolean} true if successful, false if failure
|
||||
|
|
@ -828,7 +828,7 @@ Keyboard.prototype.restore = function(data)
|
|||
|
||||
/**
|
||||
* initState(data)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {Array} [data]
|
||||
* @return {boolean} true if successful, false if failure
|
||||
|
|
@ -844,7 +844,7 @@ Keyboard.prototype.initState = function(data)
|
|||
|
||||
/**
|
||||
* saveState()
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @return {Array}
|
||||
*/
|
||||
|
|
@ -859,7 +859,7 @@ Keyboard.prototype.saveState = function()
|
|||
|
||||
/**
|
||||
* setSoftKeyState(control, f)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {Object} control is an HTML control DOM object
|
||||
* @param {boolean} f is true if the key represented by e should be "on", false if "off"
|
||||
|
|
@ -877,7 +877,7 @@ Keyboard.prototype.setSoftKeyState = function(control, f)
|
|||
*
|
||||
* Just as 0xAA is a special scan code response to a software reset, 0xFF is a special scan code response
|
||||
* to an internal buffer overrun. I try to simulate both.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} bScan
|
||||
* @param {boolean} [fRepeat]
|
||||
|
|
@ -917,7 +917,7 @@ Keyboard.prototype.addScanCode = function(bScan, fRepeat)
|
|||
|
||||
/**
|
||||
* calcReleaseDelay(fRepeat)
|
||||
*
|
||||
*
|
||||
* Attempts to scale our default "release" delay appropriately for the current CPU speed.
|
||||
*
|
||||
* Note that if the effective CPU speed exceeds 16Mhz, it becomes very difficult to rely on timer-driven key events
|
||||
|
|
@ -947,7 +947,7 @@ Keyboard.prototype.calcReleaseDelay = function(fRepeat)
|
|||
|
||||
/**
|
||||
* autoClear(notCharCode)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} [notCharCode]
|
||||
*/
|
||||
|
|
@ -963,7 +963,7 @@ Keyboard.prototype.autoClear = function(notCharCode)
|
|||
|
||||
/**
|
||||
* injectKeys(sKeyCodes, msDelay)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {string} sKeyCodes
|
||||
* @param {number|undefined} [msDelay] is an optional injection delay (default is msInjectDelay)
|
||||
|
|
@ -977,7 +977,7 @@ Keyboard.prototype.injectKeys = function(sKeyCodes, msDelay)
|
|||
|
||||
/**
|
||||
* injectKeysFromBuffer(msDelay)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} msDelay is the delay between injected keys
|
||||
*/
|
||||
|
|
@ -1004,7 +1004,7 @@ Keyboard.prototype.injectKeysFromBuffer = function(msDelay)
|
|||
|
||||
/**
|
||||
* keyEvent(event, fDown)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {Object} event
|
||||
* @param {boolean} fDown is true if called for a keyDown event, false if called for a keyUp event
|
||||
|
|
@ -1070,7 +1070,7 @@ Keyboard.prototype.keyEvent = function(event, fDown)
|
|||
* which also generates "down" and "up" events (LOTS of "down" events for that matter),
|
||||
* but no "press" event. The C1P has no TAB key, so it's safe to completely ignore,
|
||||
* hence the code below, but a PC does, so I need to simulate it.
|
||||
*
|
||||
*
|
||||
* fPass = fAutoClear = false;
|
||||
*
|
||||
* I don't get keyPress events for ESC (why?) and I never want the browser to act on DELETE
|
||||
|
|
@ -1117,10 +1117,10 @@ Keyboard.prototype.keyEvent = function(event, fDown)
|
|||
* "up" events, so that keys will repeat immediately when released/pressed repeatedly (most
|
||||
* noticeable with the Enter key), or set fAutoClear to false to ensure that polling apps have
|
||||
* enough time to see every key press.
|
||||
*
|
||||
*
|
||||
* I've decided that the former is more important than the latter, so if polling apps are still
|
||||
* missing keystrokes, then perhaps nCyclesThreshold needs to be supplemented in some way.
|
||||
*
|
||||
*
|
||||
* fAutoClear = false;
|
||||
*/
|
||||
}
|
||||
|
|
@ -1161,7 +1161,7 @@ Keyboard.prototype.keyEvent = function(event, fDown)
|
|||
*
|
||||
* We've stopped relying on keyPress for keyboard emulation purposes, but it's still handy to hook and monitor
|
||||
* when debugging.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {Object} event
|
||||
* @return {boolean} true to pass the event along, false to consume it
|
||||
|
|
@ -1184,12 +1184,12 @@ Keyboard.prototype.keyPress = function(event)
|
|||
/*
|
||||
* Unlike Safari and Chrome, Firefox doesn't seem to honor our "consume" request for the "down" DELETE keyEvent,
|
||||
* so we must ALSO check for the DELETE key here, and again "consume" it. Ditto for TAB.
|
||||
*
|
||||
*
|
||||
* In fact, this is just one example of a larger Firefox problem (see https://bugzilla.mozilla.org/show_bug.cgi?id=501496).
|
||||
* Basically, Firefox is not honoring our consumption of keyDown events, and generates keyPress events anyway.
|
||||
* This causes us grief for various CTRL and ALT combinations, resulting in duplicate key presses.
|
||||
* So, I'm going to try to fix this below, by setting fPass to true if either of those modifier keys is currently down;
|
||||
* if they're not, then we'll continue with the original code that sets fPass based on the return value from keyPressSimulate().
|
||||
* if they're not, then we'll continue with the original code that sets fPass based on the return value from keyPressSimulate().
|
||||
*/
|
||||
fPass = false;
|
||||
} else {
|
||||
|
|
@ -1210,7 +1210,7 @@ Keyboard.prototype.keyPress = function(event)
|
|||
|
||||
/**
|
||||
* keyPressSimulate(charCode)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} charCode
|
||||
* @param {boolean} [fQuickRelease] is true to simulate the press and release immediately
|
||||
|
|
@ -1232,10 +1232,10 @@ Keyboard.prototype.keyPressSimulate = function(charCode, fQuickRelease)
|
|||
* and execute a LOT of instructions between delivery of the keyPress event and the "keyTimeout"
|
||||
* event, and since JavaScript events (including timeouts) are delivered synchronously, it might
|
||||
* take too long for the "keyTimeout" event to arrive.
|
||||
*
|
||||
*
|
||||
* Why don't we ALWAYS do this? Because at normal CPU speeds, we want to faithfully simulate how
|
||||
* long a key is held, so that features like auto-repeat work properly.
|
||||
*
|
||||
*
|
||||
* TODO: The above is probably more true for C1Pjs (where some of this code came from) than PCjs,
|
||||
* so revisit these assumptions. The fact that I had to add the fQuickRelease parameter suggests
|
||||
* that it's time to review/overhaul this code.
|
||||
|
|
@ -1265,7 +1265,7 @@ Keyboard.prototype.keyPressSimulate = function(charCode, fQuickRelease)
|
|||
|
||||
/**
|
||||
* keyEventSimulate(charCode, fDown, simCode)
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {number} charCode
|
||||
* @param {boolean} fDown
|
||||
|
|
@ -1353,7 +1353,7 @@ Keyboard.prototype.keyEventSimulate = function(charCode, fDown, simCode)
|
|||
* messageDebugger(sMessage, fPort)
|
||||
*
|
||||
* This is a combination of the Debugger's messageEnabled(MESSAGE_KBD) and message() functions, for convenience.
|
||||
*
|
||||
*
|
||||
* @this {Keyboard}
|
||||
* @param {string} sMessage is any caller-defined message string
|
||||
* @param {boolean} [fPort] is true if the message is port-related, false if not
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
}
|
||||
/**
|
||||
* @class DataView
|
||||
|
|
@ -70,7 +70,7 @@ if (typeof module !== 'undefined') {
|
|||
* block-granular starting address and an address range equal to bus.blockSize; however,
|
||||
* the size of any given Memory object's underlying buffer can be either zero or bus.blockSize;
|
||||
* memory read/write functions for empty (buffer-less) blocks are mapped to readNone/writeNone.
|
||||
*
|
||||
*
|
||||
* The Bus allocates empty blocks for the entire address space during initialization, so that
|
||||
* any reads/writes to undefined addresses will have no effect. Later, the ROM and RAM
|
||||
* components will ask the Bus to allocate memory for specific ranges, and the Bus will allocate
|
||||
|
|
@ -90,7 +90,7 @@ if (typeof module !== 'undefined') {
|
|||
* consumption. Using TYPEDARRAYS is probably best, although not all JavaScript implementations
|
||||
* support them (IE9 is probably the only real outlier: it lacks typed arrays but otherwise has
|
||||
* all the necessary HTML5 support).
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @param {number} addr of block (must be some multiple of bus.blockSize)
|
||||
* @param {number} [size] of block's buffer in bytes (0 for none); must be a multiple of 4
|
||||
|
|
@ -107,13 +107,13 @@ function Memory(addr, size, fReadOnly, controller) {
|
|||
|
||||
/*
|
||||
* For empty memory blocks, all we need to do is ensure all access functions
|
||||
* are mapped to "none" handlers.
|
||||
* are mapped to "none" handlers.
|
||||
*/
|
||||
if (!size) {
|
||||
this.setAccess();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* When a controller is specified, the controller must provide a buffer,
|
||||
* via getMemoryBuffer(), and memory access functions, via getMemoryAccess().
|
||||
|
|
@ -126,7 +126,7 @@ function Memory(addr, size, fReadOnly, controller) {
|
|||
this.setAccess(controller.getMemoryAccess());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This is the normal case: allocate a buffer that provides 8 bits of data per address;
|
||||
* no controller is required because our default memory access functions (see afnMemory)
|
||||
|
|
@ -161,7 +161,7 @@ Memory.prototype = {
|
|||
constructor: Memory,
|
||||
/**
|
||||
* readNone(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -174,7 +174,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeNone(off, v)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} v (could be either a byte or word value, since we use the same handler for both kinds of accesses)
|
||||
|
|
@ -186,7 +186,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* readByteTypedArray(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -197,7 +197,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* readWordTypedArray(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -208,7 +208,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeByteTypedArray(off, b)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} b
|
||||
|
|
@ -220,7 +220,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeWordTypedArray(off, w)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} w
|
||||
|
|
@ -232,7 +232,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* readByteMemory(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -246,7 +246,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* readWordMemory(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -269,7 +269,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeByteMemory(off, b)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} b
|
||||
|
|
@ -287,7 +287,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeWordMemory(off, w)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} w
|
||||
|
|
@ -312,7 +312,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* readByteVerify(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -323,7 +323,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* readWordVerify(off)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @return {number}
|
||||
|
|
@ -336,7 +336,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeByteVerify(off, b)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} b
|
||||
|
|
@ -347,7 +347,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* writeWordVerify(off, w)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {number} w
|
||||
|
|
@ -366,7 +366,7 @@ Memory.prototype = {
|
|||
*
|
||||
* Memory blocks with custom memory controllers do NOT save their contents;
|
||||
* that's the responsibility of the controller component.
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @return {Array|Int32Array|null}
|
||||
*/
|
||||
|
|
@ -389,7 +389,7 @@ Memory.prototype = {
|
|||
* but we can't be sure of the "endianness" of an Int32Array -- which would be OK if the array
|
||||
* was always saved/restored on the same machine, but there's no guarantee of that, either.
|
||||
* So we use getInt32() and require little-endian values.
|
||||
*
|
||||
*
|
||||
* Moreover, an Int32Array isn't treated by JSON.stringify() and JSON.parse() exactly like
|
||||
* a normal array; it's serialized as an Object rather than an Array, so it lacks a "length"
|
||||
* property and causes problems for State.store() and State.parse().
|
||||
|
|
@ -411,7 +411,7 @@ Memory.prototype = {
|
|||
* used by Bus.restoreMemory(), which is called by X86CPU.restore(), after all other
|
||||
* components have been restored and thus all Memory blocks have been allocated
|
||||
* by their respective components.
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {Array|null} adw
|
||||
* @return {boolean} true if successful, false if block size mismatch
|
||||
|
|
@ -445,7 +445,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* setAccess(afn)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {Array.<function()>} [afn]
|
||||
* @param {boolean} [fDirect]
|
||||
|
|
@ -458,7 +458,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* setReadAccess(afn, fDirect)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {Array.<function()>} afn
|
||||
* @param {boolean} [fDirect]
|
||||
|
|
@ -473,7 +473,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* setWriteAccess(afn, fDirect)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {Array.<function()>} afn
|
||||
* @param {boolean} [fDirect]
|
||||
|
|
@ -488,7 +488,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* resetReadAccess()
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
*/
|
||||
resetReadAccess: function() {
|
||||
|
|
@ -497,7 +497,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* resetWriteAccess()
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
*/
|
||||
resetWriteAccess: function() {
|
||||
|
|
@ -506,7 +506,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* setDebugInfo(cpu, dbg, addr, size)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {X86CPU|Component} cpu
|
||||
* @param {Debugger|Component} dbg
|
||||
|
|
@ -524,7 +524,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* addBreakpoint(off, fWrite)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {boolean} fWrite
|
||||
|
|
@ -547,7 +547,7 @@ Memory.prototype = {
|
|||
},
|
||||
/**
|
||||
* removeBreakpoint(off, fWrite)
|
||||
*
|
||||
*
|
||||
* @this {Memory}
|
||||
* @param {number} off
|
||||
* @param {boolean} fWrite
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var SerialPort = require("./serial");
|
||||
var State = require("./state");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var SerialPort = require("./serial");
|
||||
var State = require("./state");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -64,7 +64,7 @@ if (typeof module !== 'undefined') {
|
|||
* TODO: Just out of curiosity, verify that the Microsoft Bus Mouse used ports 0x23D and 0x23F,
|
||||
* because I saw Windows v1.01 probing those ports immediately prior to probing COM2 (and then COM1)
|
||||
* for a serial mouse.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsMouse
|
||||
|
|
@ -83,14 +83,14 @@ function Mouse(parmsMouse) {
|
|||
|
||||
/*
|
||||
* From http://paulbourke.net/dataformats/serialmouse:
|
||||
*
|
||||
*
|
||||
* The old MicroSoft serial mouse, while no longer in general use, can be employed to provide a low cost input device,
|
||||
* for example, coupling the internal mechanism to other moving objects. The serial protocol for the mouse is:
|
||||
*
|
||||
* 1200 baud, 7 bit, 1 stop bit, no parity.
|
||||
*
|
||||
* The pinout of the connector follows the standard serial interface, as shown below:
|
||||
*
|
||||
*
|
||||
* Pin Abbr Description
|
||||
* 1 DCD Data Carrier Detect
|
||||
* 2 RD Receive Data [serial data from mouse to host]
|
||||
|
|
@ -101,7 +101,7 @@ function Mouse(parmsMouse) {
|
|||
* 7 RTS Request To Send [used to provide positive voltage to mouse]
|
||||
* 8 CTS Clear To Send
|
||||
* 9 RI Ring
|
||||
*
|
||||
*
|
||||
* Every time the mouse changes state (moved or button pressed) a three byte "packet" is sent to the serial interface.
|
||||
* For reasons known only to the engineers, the data is arranged as follows, most notably the two high order bits for the
|
||||
* x and y coordinates share the first byte with the button status.
|
||||
|
|
@ -110,16 +110,16 @@ function Mouse(parmsMouse) {
|
|||
* 1st byte 1 LB RB Y7 Y6 X7 X6
|
||||
* 2nd byte 0 X5 X4 X3 X2 X1 X0
|
||||
* 3rd byte 0 Y5 Y4 Y3 Y2 Y1 Y0
|
||||
*
|
||||
*
|
||||
* where:
|
||||
*
|
||||
*
|
||||
* LB is the state of the left button, 1 = pressed, 0 = released.
|
||||
* RB is the state of the right button, 1 = pressed, 0 = released
|
||||
* X0-7 is movement of the mouse in the X direction since the last packet. Positive movement is toward the right.
|
||||
* Y0-7 is movement of the mouse in the Y direction since the last packet. Positive movement is back, toward the user.
|
||||
*
|
||||
*
|
||||
* From http://www.kryslix.com/nsfaq/Q.12.html:
|
||||
*
|
||||
*
|
||||
* The Microsoft serial mouse is the most popular 2-button mouse. It is supported by all major operating systems.
|
||||
* The maximum tracking rate for a Microsoft mouse is 40 reports/second * 127 counts per report, in other words, 5080 counts
|
||||
* per second. The most common range for mice is is 100 to 400 CPI (counts per inch) but can be up to 1000 CPI. A 100 CPI mouse
|
||||
|
|
@ -141,12 +141,12 @@ function Mouse(parmsMouse) {
|
|||
* (0x4D, ASCII 'M').
|
||||
*
|
||||
* Serial data parameters: 1200bps, 7 data bits, 1 stop bit
|
||||
*
|
||||
*
|
||||
* Data is sent in 3 byte packets for each event (a button is pressed or released, or the mouse moves):
|
||||
*
|
||||
*
|
||||
* D7 D6 D5 D4 D3 D2 D1 D0
|
||||
* Byte 1 X 1 LB RB Y7 Y6 X7 X6
|
||||
* Byte 2 X 0 X5 X4 X3 X2 X1 X0
|
||||
* Byte 2 X 0 X5 X4 X3 X2 X1 X0
|
||||
* Byte 3 X 0 Y5 Y4 Y3 Y2 Y1 Y0
|
||||
*
|
||||
* LB is the state of the left button (1 means down).
|
||||
|
|
@ -161,7 +161,7 @@ Component.subclass(Component, Mouse);
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {Computer} cmp
|
||||
* @param {Bus} bus
|
||||
|
|
@ -180,7 +180,7 @@ Mouse.prototype.initBus = function(cmp, bus, cpu, dbg) {
|
|||
|
||||
/**
|
||||
* isActive()
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @return {boolean} true if active, false if not
|
||||
*/
|
||||
|
|
@ -214,10 +214,10 @@ Mouse.prototype.powerUp = function(data, fRepower) {
|
|||
* on the adapter's state, which is why I envisioned a subsequent syncMouse() call. And you would want
|
||||
* to do that as a separate call, not as part of attachMouse(), because componentAdapter isn't
|
||||
* set until attachMouse() returns.
|
||||
*
|
||||
*
|
||||
* However, syncMouse() seems unnecessary, given that SerialPort initializes its MCR to an "inactive"
|
||||
* state, and even when restoring a previous state, if we've done our job properly, both SerialPort and Mouse
|
||||
* should be restored in sync, making any explicit attempt at sync'ing unnecessary (or so I hope).
|
||||
* should be restored in sync, making any explicit attempt at sync'ing unnecessary (or so I hope).
|
||||
*/
|
||||
// this.componentAdapter.syncMouse();
|
||||
break;
|
||||
|
|
@ -242,7 +242,7 @@ Mouse.prototype.powerUp = function(data, fRepower) {
|
|||
|
||||
/**
|
||||
* powerDown(fSave)
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -253,7 +253,7 @@ Mouse.prototype.powerDown = function(fSave) {
|
|||
|
||||
/**
|
||||
* reset()
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
*/
|
||||
Mouse.prototype.reset = function() {
|
||||
|
|
@ -264,7 +264,7 @@ Mouse.prototype.reset = function() {
|
|||
* save()
|
||||
*
|
||||
* This implements save support for the Mouse component.
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @return {Object}
|
||||
*/
|
||||
|
|
@ -278,7 +278,7 @@ Mouse.prototype.save = function() {
|
|||
* restore(data)
|
||||
*
|
||||
* This implements restore support for the Mouse component.
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {Object} data
|
||||
* @return {boolean} true if successful, false if failure
|
||||
|
|
@ -289,7 +289,7 @@ Mouse.prototype.restore = function(data) {
|
|||
|
||||
/**
|
||||
* initState(data)
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {Array} [data]
|
||||
* @return {boolean} true if successful, false if failure
|
||||
|
|
@ -310,7 +310,7 @@ Mouse.prototype.initState = function(data) {
|
|||
|
||||
/**
|
||||
* saveState()
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @return {Array}
|
||||
*/
|
||||
|
|
@ -333,7 +333,7 @@ Mouse.prototype.saveState = function() {
|
|||
*
|
||||
* NOTE: addEventListener() wasn't supported in IE until IE9, but that's OK, because IE9 is the
|
||||
* oldest IE we support anyway (since older versions of IE lacked complete HTML5/canvas support).
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {Object} control from the HTML DOM (eg, the canvas for the simulated screen)
|
||||
*/
|
||||
|
|
@ -365,13 +365,13 @@ Mouse.prototype.captureMouse = function(control) {
|
|||
this.fCaptured = true;
|
||||
}
|
||||
/*
|
||||
* None of these tricks seemed to work for IE10, so I'm giving up hiding the browser's mouse pointer in IE for now.
|
||||
* None of these tricks seemed to work for IE10, so I'm giving up hiding the browser's mouse pointer in IE for now.
|
||||
*
|
||||
* control['style']['cursor'] = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjbQg61aAAAADUlEQVQYV2P4//8/IwAI/QL/+TZZdwAAAABJRU5ErkJggg=='), url('/versions/images/current/blank.cur'), none";
|
||||
*
|
||||
*
|
||||
* Setting the cursor style to "none" may not be a standard, but it works in Safari, Firefox and Chrome, so that's pretty
|
||||
* good for a non-standard!
|
||||
*
|
||||
*
|
||||
* TODO: The reference to '/versions/images/current/blank.cur' is also problematic for anyone who might want
|
||||
* to run this app from a different server, so think about that as well.
|
||||
*/
|
||||
|
|
@ -385,7 +385,7 @@ Mouse.prototype.captureMouse = function(control) {
|
|||
* TODO: Use removeEventListener() if fCaptured, to clean up our handlers; since I'm currently using
|
||||
* anonymous functions, and since I'm not seeing any compelling reason to remove the handlers once they've
|
||||
* been established, it's less code to leave them in place.
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {Object} control from the HTML DOM
|
||||
*/
|
||||
|
|
@ -408,7 +408,7 @@ Mouse.prototype.releaseMouse = function(control) {
|
|||
* but I don't think they're available in all browsers. screenX and screenY would work as well.
|
||||
*
|
||||
* Anyway, all I care about are deltas. For now.
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {Object} event object from a 'mousemove' event (specifically, a MouseEvent object)
|
||||
*/
|
||||
|
|
@ -430,7 +430,7 @@ Mouse.prototype.moveMouse = function(event) {
|
|||
|
||||
/**
|
||||
* clickMouse(iButton, fDown)
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {number} iButton is 0 for fButton1 (the LEFT button), 2 for fButton2 (the RIGHT button)
|
||||
* @param {boolean} fDown
|
||||
|
|
@ -470,7 +470,7 @@ Mouse.prototype.clickMouse = function(iButton, fDown) {
|
|||
* Byte 1 X 1 LB RB Y7 Y6 X7 X6
|
||||
* Byte 2 X 0 X5 X4 X3 X2 X1 X0
|
||||
* Byte 3 X 0 Y5 Y4 Y3 Y2 Y1 Y0
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {string|null} [sDiag] diagnostic message
|
||||
* @param {number} [xDiag] original x-coordinate (optional; for diagnostic use only)
|
||||
|
|
@ -499,7 +499,7 @@ Mouse.prototype.sendPacket = function(sDiag, xDiag, yDiag) {
|
|||
* sitting in the RBR), and then writes 0x0B to the MCR (DTR on, RTS on). This last step is consistent with making
|
||||
* the mouse "active", but it is NOT consistent with "toggling DTR", so I conclude that a reset is ALSO sufficient
|
||||
* for sending the identification byte. Right or wrong, this gets the ball rolling for Windows v1.01.
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {number} bMCR
|
||||
*/
|
||||
|
|
@ -532,7 +532,7 @@ Mouse.prototype.notifyMCR = function(bMCR) {
|
|||
* At the very least, Windows will have (re)masked the serial port's IRQ, so what does it matter? Not much,
|
||||
* I just would have preferred that fActive properly reflect whether we should continue dispatching mouse
|
||||
* events, displaying MESSAGE_MOUSE messages, etc.
|
||||
*
|
||||
*
|
||||
* We could ask the ChipSet component to notify the SerialPort component whenever its IRQ is masked/unmasked,
|
||||
* and then have the SerialPort pass that notification on to us, but I'm assuming that in the real world,
|
||||
* a mouse device that's still powered may still send event data to the serial port, and if there was software
|
||||
|
|
@ -550,7 +550,7 @@ Mouse.prototype.notifyMCR = function(bMCR) {
|
|||
* messageDebugger(sMessage)
|
||||
*
|
||||
* This is a combination of the Debugger's messageEnabled(MESSAGE_MOUSE) and message() functions, for convenience.
|
||||
*
|
||||
*
|
||||
* @this {Mouse}
|
||||
* @param {string} sMessage is any caller-defined message string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-19
|
||||
*
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
*
|
||||
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
|
||||
|
|
@ -34,15 +34,15 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
}
|
||||
|
||||
/**
|
||||
* Panel(parmsPanel)
|
||||
*
|
||||
* The Panel component has no required (parmsPanel) properties.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsPanel
|
||||
|
|
@ -55,7 +55,7 @@ Component.subclass(Component, Panel);
|
|||
|
||||
/**
|
||||
* setBinding(sHTMLClass, sHTMLType, sBinding, control)
|
||||
*
|
||||
*
|
||||
* The Panel doesn't have any bindings of its own; it passes along all binding requests to
|
||||
* the Computer, CPU, Keyboard and Debugger components. The order shouldn't matter, since any
|
||||
* component that doesn't recognize the specified binding should simply ignore it.
|
||||
|
|
@ -95,7 +95,7 @@ Panel.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
|
||||
/**
|
||||
* powerUp(data, fRepower)
|
||||
*
|
||||
*
|
||||
* @this {Panel}
|
||||
* @param {Object|null} data
|
||||
* @param {boolean} [fRepower]
|
||||
|
|
@ -111,7 +111,7 @@ Panel.prototype.powerUp = function(data, fRepower)
|
|||
|
||||
/**
|
||||
* powerDown(fSave)
|
||||
*
|
||||
*
|
||||
* @this {Panel}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -123,19 +123,19 @@ Panel.prototype.powerDown = function(fSave)
|
|||
|
||||
/**
|
||||
* Panel.init()
|
||||
*
|
||||
*
|
||||
* This function operates on every element (e) of class "panel", and initializes
|
||||
* all the necessary HTML to construct the Panel module(s) as spec'ed.
|
||||
*
|
||||
* Note that each element (e) of class "panel" is expected to have a "data-value"
|
||||
* attribute containing the same JSON-encoded parameters that the Panel constructor
|
||||
* expects.
|
||||
*
|
||||
*
|
||||
* NOTE: Unlike most other component init() functions, this one is designed to be
|
||||
* called multiple times: once at load time, so that we can binding our print()
|
||||
* function to the panel's output control ASAP, and again when the Computer component
|
||||
* is verifying that all components are ready and invoking their setPower() functions.
|
||||
*
|
||||
*
|
||||
* Our setPower() method gives us a second opportunity to notify any components that
|
||||
* that might care (eg, CPU, Keyboard, and Debugger) that we have some controls they
|
||||
* might want to use.
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ROM = require("./rom");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ROM = require("./rom");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +49,7 @@ if (typeof module !== 'undefined') {
|
|||
*
|
||||
* NOTE: We make a note of the specified size, but no memory is initially allocated
|
||||
* for the RAM until the Computer component calls setPower().
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsRAM
|
||||
|
|
@ -69,7 +69,7 @@ Component.subclass(Component, RAM);
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* @this {RAM}
|
||||
* @param {Computer} cmp
|
||||
* @param {Bus} bus
|
||||
|
|
@ -113,7 +113,7 @@ RAM.prototype.powerUp = function(data, fRepower) {
|
|||
|
||||
/**
|
||||
* powerDown(fSave)
|
||||
*
|
||||
*
|
||||
* @this {RAM}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -146,7 +146,7 @@ RAM.prototype.powerDown = function(fSave) {
|
|||
* object was not given a specific size (see fInstalled). If there are other RAM objects in the system,
|
||||
* they must necessarily specify a non-conflicting, non-zero start address, in which case their sizeRAM
|
||||
* value will never be affected by the ChipSet settings.
|
||||
*
|
||||
*
|
||||
* @this {RAM}
|
||||
*/
|
||||
RAM.prototype.reset = function() {
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var Component = require("../../shared/lib/component");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +56,7 @@ if (typeof module !== 'undefined') {
|
|||
*
|
||||
* Also, while the size parameter may seem redundant, I consider it useful to confirm that the ROM you received
|
||||
* is the ROM you expected.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsROM
|
||||
|
|
@ -109,11 +109,11 @@ ROM.BIOS.RESET_FLAG_WARMBOOT = 0x1234; // value stored at ROM.BIOS.RESET_FLAG t
|
|||
/*
|
||||
* NOTE: There's currently no need for this component to have a reset() function, since
|
||||
* once the ROM data is loaded, it can't be changed, so there's nothing to reinitialize.
|
||||
*
|
||||
*
|
||||
* OK, well, I take that back, because the Debugger, if installed, has the ability to modify
|
||||
* ROM contents, so in that case, having a reset() function that restores the original ROM data
|
||||
* might be useful; then again, it might not, depending on what you're trying to debug.
|
||||
*
|
||||
*
|
||||
* If we do add reset(), then we'll want to change copyROM() to hang onto the original
|
||||
* ROM data; currently, we release it after copying it into the read-only memory allocated
|
||||
* via bus.addMemory().
|
||||
|
|
@ -121,7 +121,7 @@ ROM.BIOS.RESET_FLAG_WARMBOOT = 0x1234; // value stored at ROM.BIOS.RESET_FLAG t
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* @this {ROM}
|
||||
* @param {Computer} cmp
|
||||
* @param {Bus} bus
|
||||
|
|
@ -166,7 +166,7 @@ ROM.prototype.powerUp = function(data, fRepower)
|
|||
* this function. But it doesn't hurt anything, and maybe we'll use our state to save something
|
||||
* useful down the road, like user-defined symbols (ie, symbols that the Debugger may have
|
||||
* created, above and beyond those symbols we automatically loaded, if any, along with the ROM).
|
||||
*
|
||||
*
|
||||
* @this {ROM}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -178,7 +178,7 @@ ROM.prototype.powerDown = function(fSave)
|
|||
|
||||
/**
|
||||
* onLoadROM(sROMFile, sROMData, nErrorCode)
|
||||
*
|
||||
*
|
||||
* @this {ROM}
|
||||
* @param {string} sROMFile
|
||||
* @param {string} sROMData
|
||||
|
|
@ -198,7 +198,7 @@ ROM.prototype.onLoadROM = function(sROMFile, sROMData, nErrorCode)
|
|||
var rom = eval("(" + sROMData + ")");
|
||||
var ab = rom['bytes'];
|
||||
var adw = rom['data'];
|
||||
|
||||
|
||||
if (ab) {
|
||||
this.abROM = ab;
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ ROM.prototype.copyROM = function()
|
|||
|
||||
/**
|
||||
* addROM(addr)
|
||||
*
|
||||
*
|
||||
* If addr is null or undefined, then it's presumably an unused addrROMAlias, which we simply ignore (it's not
|
||||
* considered a failure condition).
|
||||
*
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var State = require("./state");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var ChipSet = require("./chipset");
|
||||
var State = require("./state");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +57,7 @@ if (typeof module !== 'undefined') {
|
|||
*
|
||||
* DOS typically names the Primary adapter "COM1" and the Secondary adapter "COM2", but I prefer
|
||||
* to stick to adapter numbers, since not all operating systems follow those naming conventions.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
* @param {Object} parmsSerial
|
||||
|
|
@ -82,7 +82,7 @@ function SerialPort(parmsSerial) {
|
|||
|
||||
/**
|
||||
* controlIOBuffer is a DOM element, if any, bound to the port (currently for output purposes only; see echoByte())
|
||||
*
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
this.controlIOBuffer = null;
|
||||
|
|
@ -98,12 +98,12 @@ function SerialPort(parmsSerial) {
|
|||
* property {number} portBase
|
||||
* property {number} nIRQ
|
||||
* property {Object} controlIOBuffer is a DOM element, if any, bound to the port (for rudimentary output; see echoByte())
|
||||
*
|
||||
*
|
||||
* NOTE: This class declaration started as a way of informing the code inspector of the controlIOBuffer property,
|
||||
* which remained undefined until a setBinding() call set it later, but I've since decided that explicitly
|
||||
* initializing such properties in the constructor is a better way to go -- even though it's more code -- because
|
||||
* JavaScript compilers are supposed to be happier when the underlying object structures aren't constantly changing.
|
||||
*
|
||||
*
|
||||
* Besides, I'm not sure I want to get into documenting every property this way, for this or any/every other class,
|
||||
* let alone getting into which ones should be considered private or protected, because PCjs isn't really a library
|
||||
* for third-party apps.
|
||||
|
|
@ -113,10 +113,10 @@ Component.subclass(Component, SerialPort);
|
|||
|
||||
/*
|
||||
* Internal name used for the I/O buffer control, if any, that we bind to the SerialPort.
|
||||
*
|
||||
*
|
||||
* Alternatively, if SerialPort wants to use another component's control (eg, the Panel's
|
||||
* "print" control), it can specify the name of that control with the 'binding' property.
|
||||
*
|
||||
*
|
||||
* For that binding to succeed, we also need to know the target component; for now, that's
|
||||
* been hard-coded to "Panel", in part because that's one of the few components we can rely
|
||||
* upon initializing before we do, but it would be a simple matter to include a component type
|
||||
|
|
@ -126,11 +126,11 @@ SerialPort.sIOBuffer = "buffer";
|
|||
|
||||
/*
|
||||
* 8250 I/O register offsets (add these to a I/O base address to obtain an I/O port address)
|
||||
*
|
||||
*
|
||||
* NOTE: DLL.REG and DLM.REG form a 16-bit divisor into a clock input frequency of 1.8432Mhz. The following
|
||||
* values should be used for the corresponding baud rates. Rates above 9600 are discouraged by the IBM Tech Ref,
|
||||
* but rates as high as 128000 are listed on the NS8250A data sheet.
|
||||
*
|
||||
*
|
||||
* Divisor Rate Percent Error
|
||||
* 0x0900 50
|
||||
* 0x0600 75
|
||||
|
|
@ -142,7 +142,7 @@ SerialPort.sIOBuffer = "buffer";
|
|||
* 0x0060 1200
|
||||
* 0x0040 1800
|
||||
* 0x003A 2000 0.69%
|
||||
* 0x0030 2400
|
||||
* 0x0030 2400
|
||||
* 0x0020 3600
|
||||
* 0x0018 4800
|
||||
* 0x0010 7200
|
||||
|
|
@ -173,7 +173,7 @@ SerialPort.IER.UNUSED = 0xF0; // always zero
|
|||
|
||||
/*
|
||||
* Interrupt ID Register (IIR.REG, offset 2)
|
||||
*
|
||||
*
|
||||
* All interrupt conditions cleared by reading the corresponding register (or, in the case of IRR_INT_THR, writing a new value to THR.REG)
|
||||
*/
|
||||
SerialPort.IIR = {};
|
||||
|
|
@ -216,7 +216,7 @@ SerialPort.MCR.UNUSED = 0xE0; // always zero
|
|||
|
||||
/*
|
||||
* Line Status Register (LSR.REG, offset 5)
|
||||
*
|
||||
*
|
||||
* NOTE: I've seen different specs for the LSR_TSRE. I'm following the IBM Tech Ref's lead here, but the data sheet I have calls it TEMT
|
||||
* instead of TSRE, and claims that it is set whenever BOTH the THR and TSR are empty, and clear whenever EITHER the THR or TSR contain data.
|
||||
*/
|
||||
|
|
@ -247,7 +247,7 @@ SerialPort.MSR.RLSD = 0x80; // complement of the RLSD (Received Line
|
|||
|
||||
/**
|
||||
* attachMouse(id, mouse)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {string} id
|
||||
* @param {Mouse} mouse component
|
||||
|
|
@ -265,7 +265,7 @@ SerialPort.prototype.attachMouse = function(id, mouse) {
|
|||
* syncMouse()
|
||||
*
|
||||
* NOTE: This is probably obsolete, but the Mouse component still might discover a need for it. See Mouse.powerUp().
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
*
|
||||
SerialPort.prototype.syncMouse = function() {
|
||||
|
|
@ -275,7 +275,7 @@ SerialPort.prototype.syncMouse = function() {
|
|||
|
||||
/**
|
||||
* setBinding(sHTMLClass, sHTMLType, sBinding, control)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output")
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
|
|
@ -291,7 +291,7 @@ SerialPort.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, cont
|
|||
/*
|
||||
* By establishing an onkeypress handler here, we make it possible for DOS commands like
|
||||
* "CTTY COM1" to more or less work (use "CTTY CON" to restore control to the DOS console).
|
||||
*
|
||||
*
|
||||
* WARNING: This isn't really a supported feature yet; very much a work-in-progress.
|
||||
*/
|
||||
control.onkeydown = function onKeyDownSerial(event) {
|
||||
|
|
@ -316,7 +316,7 @@ SerialPort.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, cont
|
|||
serial.sendRBR([charCode]);
|
||||
};
|
||||
return true;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -325,7 +325,7 @@ SerialPort.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, cont
|
|||
|
||||
/**
|
||||
* initBus(cmp, bus, cpu, dbg)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {Computer} cmp
|
||||
* @param {Bus} bus
|
||||
|
|
@ -347,7 +347,7 @@ SerialPort.prototype.initBus = function(cmp, bus, cpu, dbg) {
|
|||
|
||||
/**
|
||||
* powerUp(data, fRepower)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {Object|null} data
|
||||
* @param {boolean} [fRepower]
|
||||
|
|
@ -366,7 +366,7 @@ SerialPort.prototype.powerUp = function(data, fRepower) {
|
|||
|
||||
/**
|
||||
* powerDown(fSave)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {boolean} fSave
|
||||
* @return {Object|boolean}
|
||||
|
|
@ -377,7 +377,7 @@ SerialPort.prototype.powerDown = function(fSave) {
|
|||
|
||||
/**
|
||||
* reset()
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
*/
|
||||
SerialPort.prototype.reset = function() {
|
||||
|
|
@ -388,7 +388,7 @@ SerialPort.prototype.reset = function() {
|
|||
* save()
|
||||
*
|
||||
* This implements save support for the SerialPort component.
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @return {Object}
|
||||
*/
|
||||
|
|
@ -402,7 +402,7 @@ SerialPort.prototype.save = function() {
|
|||
* restore(data)
|
||||
*
|
||||
* This implements restore support for the SerialPort component.
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {Object} data
|
||||
* @return {boolean} true if successful, false if failure
|
||||
|
|
@ -413,7 +413,7 @@ SerialPort.prototype.restore = function(data) {
|
|||
|
||||
/**
|
||||
* initState(data)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {Array} [data]
|
||||
* @return {boolean} true if successful, false if failure
|
||||
|
|
@ -454,7 +454,7 @@ SerialPort.prototype.initState = function(data) {
|
|||
|
||||
/**
|
||||
* saveRegisters()
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @return {Array}
|
||||
*/
|
||||
|
|
@ -476,7 +476,7 @@ SerialPort.prototype.saveRegisters = function() {
|
|||
|
||||
/**
|
||||
* sendRBR(ab)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {Array} ab is an array of bytes to propagate to the bRBR (Receiver Buffer Register)
|
||||
*/
|
||||
|
|
@ -487,7 +487,7 @@ SerialPort.prototype.sendRBR = function(ab) {
|
|||
|
||||
/**
|
||||
* advanceRBR()
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
*/
|
||||
SerialPort.prototype.advanceRBR = function() {
|
||||
|
|
@ -500,7 +500,7 @@ SerialPort.prototype.advanceRBR = function() {
|
|||
|
||||
/**
|
||||
* inRBR(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3F8 or 0x2F8)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -516,7 +516,7 @@ SerialPort.prototype.inRBR = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* inIER(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3F9 or 0x2F9)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -530,7 +530,7 @@ SerialPort.prototype.inIER = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* inIIR(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FA or 0x2FA)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -544,7 +544,7 @@ SerialPort.prototype.inIIR = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* inLCR(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FB or 0x2FB)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -558,7 +558,7 @@ SerialPort.prototype.inLCR = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* inMCR(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FC or 0x2FC)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -572,7 +572,7 @@ SerialPort.prototype.inMCR = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* inLSR(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FD or 0x2FD)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -586,7 +586,7 @@ SerialPort.prototype.inLSR = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* inMSR(port, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FE or 0x2FE)
|
||||
* @param {number} [addrFrom] (not defined whenever the Debugger tries to read the specified port)
|
||||
|
|
@ -600,7 +600,7 @@ SerialPort.prototype.inMSR = function(port, addrFrom) {
|
|||
|
||||
/**
|
||||
* outTHR(port, bOut, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3F8 or 0x2F8)
|
||||
* @param {number} bOut
|
||||
|
|
@ -624,7 +624,7 @@ SerialPort.prototype.outTHR = function(port, bOut, addrFrom) {
|
|||
|
||||
/**
|
||||
* outIER(port, bOut, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3F9 or 0x2F9)
|
||||
* @param {number} bOut
|
||||
|
|
@ -641,7 +641,7 @@ SerialPort.prototype.outIER = function(port, bOut, addrFrom) {
|
|||
|
||||
/**
|
||||
* outLCR(port, bOut, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FB or 0x2FB)
|
||||
* @param {number} bOut
|
||||
|
|
@ -654,7 +654,7 @@ SerialPort.prototype.outLCR = function(port, bOut, addrFrom) {
|
|||
|
||||
/**
|
||||
* outMCR(port, bOut, addrFrom)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port (0x3FC or 0x2FC)
|
||||
* @param {number} bOut
|
||||
|
|
@ -671,7 +671,7 @@ SerialPort.prototype.outMCR = function(port, bOut, addrFrom) {
|
|||
|
||||
/**
|
||||
* updateIRR()
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
*/
|
||||
SerialPort.prototype.updateIRR = function() {
|
||||
|
|
@ -691,7 +691,7 @@ SerialPort.prototype.updateIRR = function() {
|
|||
|
||||
/**
|
||||
* echoByte(b)
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} b
|
||||
* @return {boolean} true if echoed, false if not
|
||||
|
|
@ -715,7 +715,7 @@ SerialPort.prototype.echoByte = function(b) {
|
|||
* messageDebugger(sMessage)
|
||||
*
|
||||
* This is a combination of the Debugger's messageEnabled(MESSAGE_SERIAL) and message() functions, for convenience.
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {string} sMessage is any caller-defined message string
|
||||
*/
|
||||
|
|
@ -731,7 +731,7 @@ SerialPort.prototype.messageDebugger = function(sMessage) {
|
|||
* messagePort(port, bOut, addrFrom, name, bIn)
|
||||
*
|
||||
* This is an internal version of the Debugger's messagePort() function, for convenience.
|
||||
*
|
||||
*
|
||||
* @this {SerialPort}
|
||||
* @param {number} port
|
||||
* @param {number|null} bOut if an output operation
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -34,19 +34,19 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Bus = require("./bus");
|
||||
var State = require("./state");
|
||||
var CPU = require("./cpu");
|
||||
var X86 = require("./x86");
|
||||
var X86Seg = require("./x86seg");
|
||||
var X86Grps = require("./x86grps");
|
||||
var X86Help = require("./x86help");
|
||||
var X86Mods = require("./x86mods");
|
||||
var X86OpXX = require("./x86opxx");
|
||||
var X86Op0F = require("./x86op0f");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Bus = require("./bus");
|
||||
var State = require("./state");
|
||||
var CPU = require("./cpu");
|
||||
var X86 = require("./x86");
|
||||
var X86Seg = require("./x86seg");
|
||||
var X86Grps = require("./x86grps");
|
||||
var X86Help = require("./x86help");
|
||||
var X86Mods = require("./x86mods");
|
||||
var X86OpXX = require("./x86opxx");
|
||||
var X86Op0F = require("./x86op0f");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var X86 = require("./x86");
|
||||
var X86Help = require("./x86help");
|
||||
var Debugger = require("./debugger");
|
||||
var X86 = require("./x86");
|
||||
var X86Help = require("./x86help");
|
||||
var Debugger = require("./debugger");
|
||||
}
|
||||
|
||||
var X86Grps = {
|
||||
|
|
@ -66,7 +66,7 @@ var X86Grps = {
|
|||
/**
|
||||
* NOTE: Notice that some of the simpler math functions could get away with updating resultSize before
|
||||
* the calculation, but here the calculation depends on the incoming carry value.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
|
|
@ -82,7 +82,7 @@ var X86Grps = {
|
|||
/**
|
||||
* NOTE: Notice that some of the simpler math functions could get away with updating resultSize before
|
||||
* the calculation, but here the calculation depends on the incoming carry value.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
|
|
@ -169,7 +169,7 @@ var X86Grps = {
|
|||
/**
|
||||
* NOTE: Notice that some of the simpler math functions could get away with updating resultSize before
|
||||
* the calculation, but here the calculation depends on the incoming carry value.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
|
|
@ -185,7 +185,7 @@ var X86Grps = {
|
|||
/**
|
||||
* NOTE: Notice that some of the simpler math functions could get away with updating resultSize before
|
||||
* the calculation, but here the calculation depends on the incoming carry value.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
|
|
@ -296,7 +296,7 @@ var X86Grps = {
|
|||
* operand size of the last operation. And since only 2 of the 6 arithmetic flags need to change, that tips the scales
|
||||
* in favor of leaving resultSize alone. However, the previous code that worked so hard to update resultSize is still
|
||||
* here, commented out; it works, but it's less efficient.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} result (untruncated, so that we can inspect it for CARRY and OVERFLOW)
|
||||
* @param {number} size
|
||||
|
|
@ -497,7 +497,7 @@ var X86Grps = {
|
|||
* and/or code that depends on them, I'll continue setting PS_AF and PS_OF "normally".
|
||||
*
|
||||
* See also: AND, OR, TEST, and XOR (those instructions leave AUXCARRY "undefined" as well).
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (1 or CL, or an immediate byte for 80186/80188 and up)
|
||||
|
|
@ -522,7 +522,7 @@ var X86Grps = {
|
|||
* AUXCARRY (PS_AF), AUXCARRY isn't properly set on a real 8086/8088; its value is
|
||||
* documented as "undefined." Similarly, OVERFLOW (PS_OF) is documented as "undefined"
|
||||
* for shifts > 1. See opGrpSHLb() for more details.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (1 or CL, or an immediate byte for 80186/80188 and up)
|
||||
|
|
@ -547,7 +547,7 @@ var X86Grps = {
|
|||
* AUXCARRY (PS_AF), AUXCARRY isn't properly set on a real 8086/8088; its value is
|
||||
* documented as "undefined." Similarly, OVERFLOW (PS_OF) is documented as "undefined"
|
||||
* for shifts > 1. See opGrpSHLb() for more details.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (1 or CL, or an immediate byte for 80186/80188 and up)
|
||||
|
|
@ -572,7 +572,7 @@ var X86Grps = {
|
|||
* AUXCARRY (PS_AF), AUXCARRY isn't properly set on a real 8086/8088; its value is
|
||||
* documented as "undefined." Similarly, OVERFLOW (PS_OF) is documented as "undefined"
|
||||
* for shifts > 1. See opGrpSHLb() for more details.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (1 or CL, or an immediate byte for 80186/80188 and up)
|
||||
|
|
@ -597,7 +597,7 @@ var X86Grps = {
|
|||
* AUXCARRY (PS_AF), AUXCARRY isn't properly set on a real 8086/8088; its value is
|
||||
* documented as "undefined." Similarly, OVERFLOW (PS_OF) is documented as "undefined"
|
||||
* for shifts > 1. See opGrpSHLb() for more details.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (1 or CL, or an immediate byte for 80186/80188 and up)
|
||||
|
|
@ -623,7 +623,7 @@ var X86Grps = {
|
|||
* AUXCARRY (PS_AF), AUXCARRY isn't properly set on a real 8086/8088; its value is
|
||||
* documented as "undefined." Similarly, OVERFLOW (PS_OF) is documented as "undefined"
|
||||
* for shifts > 1. See opGrpSHLb() for more details.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (1 or CL, or an immediate byte for 80186/80188 and up)
|
||||
|
|
@ -739,7 +739,7 @@ var X86Grps = {
|
|||
}
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -783,7 +783,7 @@ var X86Grps = {
|
|||
}
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -822,7 +822,7 @@ var X86Grps = {
|
|||
this.resultSize = X86.RESULT.SIZE_BYTE;
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -836,7 +836,7 @@ var X86Grps = {
|
|||
* @param {number} dst
|
||||
* @param {number} src (null)
|
||||
* @return {number} (we return dst unchanged, since it's actually AX that's modified)
|
||||
*
|
||||
*
|
||||
* TODO: Implement the following difference, from "AP-186: Introduction to the 80186 Microprocessor, March 1983":
|
||||
*
|
||||
* "The 8086 will cause a divide error whenever the absolute value of the quotient is greater then 7FFFH
|
||||
|
|
@ -869,7 +869,7 @@ var X86Grps = {
|
|||
this.resultSize = X86.RESULT.SIZE_BYTE;
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -900,7 +900,7 @@ var X86Grps = {
|
|||
}
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -914,15 +914,15 @@ var X86Grps = {
|
|||
* lower 16 bits (carry clear) and when the upper 16 bits contain significant bits (carry set). The latter
|
||||
* will occur whenever a positive result is > 32767 (0x00007fff) and whenever a negative result is < -32768
|
||||
* (0xffff8000).
|
||||
*
|
||||
*
|
||||
* Example 1: 256 * 64 = 16384 (0x00004000): carry is clear
|
||||
* Example 2: 256 * 128 = 32768 (0x00008000): carry is set (the sign bit no longer fits in the lower 16 bits)
|
||||
* Example 3: 256 * -128 (0xff80) = -32768 (0xffff8000): carry is clear (the sign bit *still* fits in the lower 16 bits)
|
||||
* Example 4: 256 * -256 (0xff00) = -65536 (0xffff0000): carry is set (the sign bit no longer fits in the lower 16 bits)
|
||||
*
|
||||
*
|
||||
* An earlier version of this function assumed it simply needed to check bit 15 of the result to determine carry,
|
||||
* which was completely broken.
|
||||
*
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
* @param {number} src (null)
|
||||
|
|
@ -945,7 +945,7 @@ var X86Grps = {
|
|||
}
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -970,7 +970,7 @@ var X86Grps = {
|
|||
}
|
||||
/*
|
||||
* Detect small divisor (quotient overflow)
|
||||
*
|
||||
*
|
||||
* WARNING: We CANNOT simply do "src = (this.regDX << 16) | this.regAX", because if bit 15 of DX
|
||||
* is set, JavaScript will create a negative 32-bit number. So we instead use non-bit-wise operators
|
||||
* to force JavaScript to create a floating-point value that won't suffer from 32-bit-math side-effects.
|
||||
|
|
@ -990,7 +990,7 @@ var X86Grps = {
|
|||
this.resultSize = X86.RESULT.SIZE_WORD;
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -1040,7 +1040,7 @@ var X86Grps = {
|
|||
this.resultSize = X86.RESULT.SIZE_WORD;
|
||||
/*
|
||||
* Multiply/divide instructions specify only a single operand, which the decoders pass to us
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* via the dst parameter, so we set src to the other implied operand (either AX or DX:AX).
|
||||
* However, src is technically an output, and dst is merely an input (which is why we must return
|
||||
* dst unchanged). So, to make traceLog() more consistent, we reverse the order of dst and src.
|
||||
*/
|
||||
|
|
@ -1258,7 +1258,7 @@ var X86Grps = {
|
|||
/*
|
||||
* A word (or two) on instruction groups (eg, GRP1, GRP2), which are groups of instructions that
|
||||
* use a mod/reg/rm byte, where the reg field of that byte selects a function rather than a register.
|
||||
*
|
||||
*
|
||||
* I start with the groupings used by Intel's "Pentium Processor User's Manual (Volume 3: Architecture
|
||||
* and Programming Manual)", but I deviate slightly, mostly by subdividing their groups with the use
|
||||
* of suffixes:
|
||||
|
|
@ -1275,7 +1275,7 @@ var X86Grps = {
|
|||
* 0x0F,0x01 Grp7 GRP7 (SGDT, SIDT, LGDT, LIDT, SMSW, LMSW, INVLPG) Group G
|
||||
* 0x0F,0xBA Grp8 GRP8 (BT, BTS, BTR, BTC) Group H
|
||||
* 0x0F,0xC7 Grp9 GRP9 (CMPXCH) (N/A, 80386 and up?)
|
||||
*
|
||||
*
|
||||
* My only serious deviation is Grp5, which I refer to as GRP4w, because it contains word forms of
|
||||
* the INC and DEC instructions found in GRP4b. Granted, GRP4w also contains versions of the CALL,
|
||||
* JMP and PUSH instructions, which are not in GRP4b, but there's nothing in GRP4b that conflicts with
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var X86 = require("./x86");
|
||||
var Debugger = require("./debugger");
|
||||
var X86 = require("./x86");
|
||||
var Debugger = require("./debugger");
|
||||
}
|
||||
|
||||
var X86Help = {
|
||||
|
|
@ -127,14 +127,14 @@ var X86Help = {
|
|||
* @param {number} dst
|
||||
* @param {number} src
|
||||
* @return {number}
|
||||
*
|
||||
*
|
||||
* 80286_and_80287_Programmers_Reference_Manual_1987.pdf, p.B-44 (p.254) notes that:
|
||||
*
|
||||
*
|
||||
* "The low 16 bits of the product of a 16-bit signed multiply are the same as those of an
|
||||
* unsigned multiply. The three operand IMUL instruction can be used for unsigned operands as well."
|
||||
*
|
||||
*
|
||||
* However, we still sign-extend the operands before multiplying, making it easier to range-check the result.
|
||||
*
|
||||
*
|
||||
* (80186/80188 and up)
|
||||
*/
|
||||
opHelpIMUL16: function(dst, src) {
|
||||
|
|
@ -237,8 +237,8 @@ var X86Help = {
|
|||
if (wIndex < wLower || wIndex > wUpper) {
|
||||
/*
|
||||
* The INT 0x05 handler must be called with CS:IP pointing to the BOUND instruction.
|
||||
*
|
||||
* TODO: Determine the cycle impact when a BOUND exception is triggered, over and above nOpCyclesBound.
|
||||
*
|
||||
* TODO: Determine the cycle impact when a BOUND exception is triggered, over and above nOpCyclesBound.
|
||||
*/
|
||||
this.setIP(this.opEA - this.segCS.base);
|
||||
X86Help.opHelpINT.call(this, X86.EXCEPTION.BOUND_ERR, null, 0);
|
||||
|
|
@ -273,7 +273,7 @@ var X86Help = {
|
|||
/*
|
||||
* Currently, segVER.load() will return an error only if the selector is beyond the bounds of the
|
||||
* descriptor table or the descriptor is not for a segment.
|
||||
*
|
||||
*
|
||||
* TODO: This instruction's 80286 documentation does not discuss conforming code segments; determine
|
||||
* if we need a special check for them.
|
||||
*/
|
||||
|
|
@ -297,7 +297,7 @@ var X86Help = {
|
|||
/*
|
||||
* Currently, segVER.load() will return an error only if the selector is beyond the bounds of the
|
||||
* descriptor table or the descriptor is not for a segment.
|
||||
*
|
||||
*
|
||||
* TODO: LSL is explicitly documented as ALSO requiring a non-null selector, so we check X86.SEL.MASK;
|
||||
* are there any other instructions that were, um, less explicit but also require a non-null selector?
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var X86 = require("./x86");
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
var X86Mods = {
|
||||
|
|
@ -15350,7 +15350,7 @@ var X86Mods = {
|
|||
* mod=11 (reg:dst) reg=110 (afnGrp[6]) r/m=100 (SP)
|
||||
*/
|
||||
opModGrpWordF4: function(afnGrp, fnSrc) {
|
||||
this.opFlags |= X86.OPFLAG.PUSHSP; // we limit this hack to the only ModRM function that calls opGrpPUSHw() with SP
|
||||
this.opFlags |= X86.OPFLAG.PUSHSP; // we limit this hack to the only ModRM function that calls opGrpPUSHw() with SP
|
||||
this.regSP = afnGrp[6].call(this, this.regSP, fnSrc.call(this));
|
||||
},
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var X86 = require("./x86");
|
||||
var X86Grps = require("./x86grps");
|
||||
var X86Help = require("./x86help");
|
||||
var X86Mods = require("./x86mods");
|
||||
var X86 = require("./x86");
|
||||
var X86Grps = require("./x86grps");
|
||||
var X86Help = require("./x86help");
|
||||
var X86Mods = require("./x86mods");
|
||||
}
|
||||
|
||||
var X86Op0F = {
|
||||
|
|
@ -149,10 +149,10 @@ var X86Op0F = {
|
|||
/*
|
||||
* For VERR, if the code segment is readable and conforming, the descriptor privilege level
|
||||
* (DPL) can be any value.
|
||||
*
|
||||
*
|
||||
* Otherwise, DPL must be greater than or equal to (have less or the same privilege as) both the
|
||||
* current privilege level and the selector's RPL.
|
||||
*
|
||||
*
|
||||
* TODO: Consider making a CPL (current privilege level) variable that tracks segCS.sel, so that we
|
||||
* don't have to mask segCS.sel every time.
|
||||
*/
|
||||
|
|
@ -187,7 +187,7 @@ var X86Op0F = {
|
|||
/*
|
||||
* DPL must be greater than or equal to (have less or the same privilege as) both the current
|
||||
* privilege level and the selector's RPL.
|
||||
*
|
||||
*
|
||||
* TODO: Consider making a CPL (current privilege level) variable that tracks segCS.sel, so that we
|
||||
* don't have to mask segCS.sel every time.
|
||||
*/
|
||||
|
|
@ -261,8 +261,8 @@ var X86Op0F = {
|
|||
* opLIDT(dst, src)
|
||||
*
|
||||
* The 80286 LIDT instruction expects a 40-bit operand: a 16-bit limit, followed by a 24-bit address;
|
||||
* the ModRM decoder has already supplied the first word of the operand (in dst), which corresponds to the
|
||||
* limit, so we must fetch the remaining 24 bits ourselves.
|
||||
* the ModRM decoder has already supplied the first word of the operand (in dst), which corresponds to the
|
||||
* limit, so we must fetch the remaining 24 bits ourselves.
|
||||
*
|
||||
* @this {X86CPU}
|
||||
* @param {number} dst
|
||||
|
|
@ -273,7 +273,7 @@ var X86Op0F = {
|
|||
if (this.regEA < 0) {
|
||||
X86Help.opInvalid.call(this);
|
||||
} else {
|
||||
this.addrIDT = this.getWord(this.regEA + 2) | (this.getByte(this.regEA + 4) << 16);
|
||||
this.addrIDT = this.getWord(this.regEA + 2) | (this.getByte(this.regEA + 4) << 16);
|
||||
this.addrIDTLimit = this.addrIDT + dst;
|
||||
if (FASTDISABLE) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||
this.nStepCycles -= 12;
|
||||
|
|
@ -389,7 +389,7 @@ X86Op0F.aOps0F = [
|
|||
* the instructions in GRP6 and GRP7 only read their dst operand (eg, LLDT), which means the ModRM helper function
|
||||
* must insure that setEAWord() is disabled, while others only write their dst operand (eg, SLDT), which means that
|
||||
* getEAWord() should be disabled *prior* to calling the ModRM helper function. This latter case requires that
|
||||
* we decode the reg field of the ModRM byte before dispatching.
|
||||
* we decode the reg field of the ModRM byte before dispatching.
|
||||
*/
|
||||
X86Op0F.aOpGRP6Prot = [
|
||||
X86Op0F.opSLDT, X86Op0F.opSTR, X86Op0F.opLLDT, X86Op0F.opLTR, // 0x0F,0x00(reg=0x0-0x3)
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var Component = require("../../shared/lib/component");
|
||||
var X86 = require("./x86");
|
||||
var X86Grps = require("./x86grps");
|
||||
var X86Help = require("./x86help");
|
||||
var X86Mods = require("./x86mods");
|
||||
var X86Op0F = require("./x86op0f");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var X86 = require("./x86");
|
||||
var X86Grps = require("./x86grps");
|
||||
var X86Help = require("./x86help");
|
||||
var X86Mods = require("./x86mods");
|
||||
var X86Op0F = require("./x86op0f");
|
||||
}
|
||||
|
||||
var X86OpXX = {
|
||||
|
|
@ -1194,14 +1194,14 @@ var X86OpXX = {
|
|||
opINSb: function() {
|
||||
var nReps = 1;
|
||||
var nDelta = 0;
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: 5 + 4n is the cycle time for the 80286; the 80186/80188 has different values: 14 cycles for
|
||||
* an unrepeated INS, and 8 + 8n for a repeated INS. However, accurate cycle times for the 80186/80188 is
|
||||
* low priority.
|
||||
*/
|
||||
var nCycles = 5;
|
||||
|
||||
|
||||
/*
|
||||
* The (normal) REP prefix, if used, is REPNZ (0xf2), but either one works....
|
||||
*/
|
||||
|
|
@ -1210,7 +1210,7 @@ var X86OpXX = {
|
|||
nDelta = 1;
|
||||
if (this.opPrefixes & X86.OPFLAG.REPEAT) nCycles = 4;
|
||||
}
|
||||
|
||||
|
||||
if (nReps--) {
|
||||
var b = this.bus.checkPortInputNotify(this.regDX, this.regEIP - nDelta - 1);
|
||||
this.setSOByte(this.segES, this.regDI, b);
|
||||
|
|
@ -1240,7 +1240,7 @@ var X86OpXX = {
|
|||
opINSw: function() {
|
||||
var nReps = 1;
|
||||
var nDelta = 0;
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: 5 + 4n is the cycle time for the 80286; the 80186/80188 has different values: 14 cycles for
|
||||
* an unrepeated INS, and 8 + 8n for a repeated INS. However, accurate cycle times for the 80186/80188 is
|
||||
|
|
@ -1278,13 +1278,13 @@ var X86OpXX = {
|
|||
* @this {X86CPU}
|
||||
*
|
||||
* NOTE: Segment overrides are ignored for this instruction, so we must use segDS instead of segData.
|
||||
*
|
||||
*
|
||||
* op=0x6E (outsb) (80186/80188 and up)
|
||||
*/
|
||||
opOUTSb: function() {
|
||||
var nReps = 1;
|
||||
var nDelta = 0;
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: 5 + 4n is the cycle time for the 80286; the 80186/80188 has different values: 14 cycles for
|
||||
* an unrepeated INS, and 8 + 8n for a repeated INS. However, accurate cycle times for the 80186/80188 is
|
||||
|
|
@ -1327,7 +1327,7 @@ var X86OpXX = {
|
|||
opOUTSw: function() {
|
||||
var nReps = 1;
|
||||
var nDelta = 0;
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: 5 + 4n is the cycle time for the 80286; the 80186/80188 has different values: 14 cycles for
|
||||
* an unrepeated INS, and 8 + 8n for a repeated INS. However, accurate cycle times for the 80186/80188 is
|
||||
|
|
@ -1647,15 +1647,15 @@ var X86OpXX = {
|
|||
* If the second operand is a register, then the ModeRegByte decoder must use separate "get" and
|
||||
* "set" assignments, otherwise instructions like "XCHG DH,DL" will end up using a stale DL instead of
|
||||
* our updated DL.
|
||||
*
|
||||
*
|
||||
* To be clear, a single assignment like this will fail:
|
||||
*
|
||||
*
|
||||
* opModeRegByteF2: function(fn) {
|
||||
* this.regDX = (this.regDX & 0xff) | (fn.call(this, this.regDX >> 8, this.regDX & 0xff) << 8);
|
||||
* }
|
||||
*
|
||||
* which is why all affected decoders now use separate assignments; eg:
|
||||
*
|
||||
*
|
||||
* opModeRegByteF2: function(fn) {
|
||||
* var b = fn.call(this, this.regDX >> 8, this.regDX & 0xff);
|
||||
* this.regDX = (this.regDX & 0xff) | (b << 8);
|
||||
|
|
@ -1981,7 +1981,7 @@ var X86OpXX = {
|
|||
},
|
||||
/**
|
||||
* @this {X86CPU}
|
||||
*
|
||||
*
|
||||
* op=0x9B (wait)
|
||||
*/
|
||||
opWAIT: function() {
|
||||
|
|
@ -2019,7 +2019,7 @@ var X86OpXX = {
|
|||
opSAHF: function() {
|
||||
/*
|
||||
* NOTE: While it make LOOK more efficient to do this:
|
||||
*
|
||||
*
|
||||
* this.setPS((this.getPS() & ~X86.PS.SAHF) | ((this.regAX >> 8) & X86.PS.SAHF));
|
||||
*
|
||||
* the call to getPS() forces all the "indirect" flags to be resolved first, and then the call
|
||||
|
|
@ -2729,7 +2729,7 @@ var X86OpXX = {
|
|||
* @this {X86CPU}
|
||||
*
|
||||
* Here's the pseudo-code from http://www.pcjs.org/pubs/pc/reference/intel/80286/progref, p.B-40 (p.250):
|
||||
*
|
||||
*
|
||||
* LEVEL := LEVEL MOD 32
|
||||
* Push BP
|
||||
* Set a temporary value FRAME_PTR := SP
|
||||
|
|
@ -2742,7 +2742,7 @@ var X86OpXX = {
|
|||
* End if
|
||||
* BP := FRAME_PTR
|
||||
* SP := SP - first operand
|
||||
*
|
||||
*
|
||||
* TODO: Verify that this pseudo-code is identical on the 80186/80188 (eg, is LEVEL MOD 32 performed in both instances?)
|
||||
*
|
||||
* op=0xC8 (enter imm16,imm8) (80186/80188 and up)
|
||||
|
|
@ -2771,7 +2771,7 @@ var X86OpXX = {
|
|||
},
|
||||
/**
|
||||
* @this {X86CPU}
|
||||
*
|
||||
*
|
||||
* Set SP to BP, then pop BP
|
||||
*
|
||||
* op=0xC9 (leave) (80186/80188 and up)
|
||||
|
|
@ -3359,7 +3359,7 @@ var X86OpXX = {
|
|||
|
||||
/*
|
||||
* This 256-entry array of opcode functions is at the heart of the CPU engine: stepCPU(n).
|
||||
*
|
||||
*
|
||||
* It might be worth trying a switch() statement instead, to see how the performance compares,
|
||||
* but I suspect that would vary quite a bit across JavaScript engines; for now, I'm putting my
|
||||
* money on array lookup.
|
||||
|
|
@ -3405,7 +3405,7 @@ X86OpXX.aOps = [
|
|||
/*
|
||||
* On all processors, opcode groups 0x80 and 0x82 perform identically (0x82 opcodes sign-extend their
|
||||
* immediate data, but since both 0x80 and 0x82 are byte operations, the sign extension has no effect).
|
||||
*
|
||||
*
|
||||
* WARNING: Intel's "Pentium Processor User's Manual (Volume 3: Architecture and Programming Manual)" refers
|
||||
* to opcode 0x82 as a "reserved" instruction, but also cryptically refers to it as "MOVB AL,imm". This is
|
||||
* assumed to be an error in the manual, because as far as I know, 0x82 has always mirrored 0x80.
|
||||
|
|
|
|||
|
|
@ -34,17 +34,17 @@
|
|||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
var X86 = require("./x86");
|
||||
var X86Help = require("./x86help");
|
||||
var X86 = require("./x86");
|
||||
var X86Help = require("./x86help");
|
||||
}
|
||||
|
||||
/**
|
||||
* X86Seg(cpu, sName)
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @param {X86CPU} cpu
|
||||
* @param {string} [sName] segment name
|
||||
* @param {boolean} [fProt] true if segment register used exclusively in protected-mode
|
||||
* @param {boolean} [fProt] true if segment register used exclusively in protected-mode
|
||||
*/
|
||||
function X86Seg(cpu, sName, fProt)
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ function X86Seg(cpu, sName, fProt)
|
|||
|
||||
/**
|
||||
* loadReal(sel, fSuppress)
|
||||
*
|
||||
*
|
||||
* This is the default real-mode load() function.
|
||||
*
|
||||
* @this {X86Seg}
|
||||
|
|
@ -84,7 +84,7 @@ X86Seg.loadReal = function loadReal(sel, fSuppress)
|
|||
*
|
||||
* This replaces the segment's default load() function whenever the segment is notified (eg, by the CPU's setProtMode()
|
||||
* function) the processor is now in protected-mode.
|
||||
*
|
||||
*
|
||||
* Segments in protected-mode are referenced by selectors, which are indexes into descriptor tables (GDT, LDT, IDT) whose
|
||||
* descriptors are 4-word (8-byte) entries:
|
||||
*
|
||||
|
|
@ -92,7 +92,7 @@ X86Seg.loadReal = function loadReal(sel, fSuppress)
|
|||
* word 1: base address low
|
||||
* word 2: base address high (0-7), segment type (8-11), descriptor type (12), DPL (13-14), present bit (15)
|
||||
* word 3: used only on 80386 and up (should be set to zero for upward compatibility)
|
||||
*
|
||||
*
|
||||
* See X86.DESC for offset and bit definitions.
|
||||
*
|
||||
* @this {X86Seg}
|
||||
|
|
@ -115,23 +115,23 @@ X86Seg.loadProt = function loadProt(sel, fSuppress)
|
|||
if (offDT + 7 <= addrDTLimit) {
|
||||
this.checkRead = X86Seg.checkReadProtEnabled;
|
||||
this.checkWrite = X86Seg.checkWriteProtEnabled;
|
||||
|
||||
|
||||
/*
|
||||
* TODO: This is only the first of many steps toward accurately counting cycles in protected mode;
|
||||
* I simply noted that "POP segreg" takes 5 cycles in real mode and 20 in protected mode, so I'm
|
||||
* starting with a 15-cycle difference. Obviously the difference will be much greater when the load fails.
|
||||
*/
|
||||
this.cpu.nStepCycles -= 15;
|
||||
|
||||
|
||||
/*
|
||||
* TODO: Use (direct) Bus memory interfaces instead of (indirect) CPU memory interfaces here?
|
||||
*/
|
||||
var limit = this.cpu.getWord(offDT + X86.DESC.LIMIT.OFFSET);
|
||||
var acc = this.cpu.getWord(offDT + X86.DESC.ACC.OFFSET);
|
||||
var base = this.cpu.getWord(offDT + X86.DESC.BASE.OFFSET) | ((acc & X86.DESC.ACC.BASE1623) << 16);
|
||||
|
||||
|
||||
Component.assert(this.cpu.getWord(offDT + 0x06) == 0);
|
||||
|
||||
|
||||
/*
|
||||
* For LSL (which uses fSuppress), we must support X86.DESC.ACC.TYPE.SEG as well as TSS and LDT.
|
||||
*/
|
||||
|
|
@ -271,7 +271,7 @@ X86Seg.checkWriteProtDisabled = function checkWriteProtDisabled(off, cb, fSuppre
|
|||
*
|
||||
* Early versions of PCjs saved only segment selectors, since that's all that mattered in real-mode;
|
||||
* newer versions need to save/restore the entire segment object.
|
||||
*
|
||||
*
|
||||
* @this {X86Seg}
|
||||
* @return {Array}
|
||||
*/
|
||||
|
|
@ -285,7 +285,7 @@ X86Seg.prototype.save = function()
|
|||
*
|
||||
* Early versions of PCjs saved only segment selectors, since that's all that mattered in real-mode;
|
||||
* newer versions need to save/restore the entire segment object.
|
||||
*
|
||||
*
|
||||
* @this {X86Seg}
|
||||
* @param {Array|number} a
|
||||
*/
|
||||
|
|
@ -305,12 +305,12 @@ X86Seg.prototype.restore = function(a)
|
|||
|
||||
/**
|
||||
* setBase(addr)
|
||||
*
|
||||
*
|
||||
* This is used in unusual situations where the base must be set independently; normally, the base
|
||||
* is set according to the selector provided to load(), but there are a few cases where setBase() is
|
||||
* required (eg, in resetRegs() where the 80286 wants the real-mode CS selector to be 0xF000 but the
|
||||
* CS base must be 0xFF0000, and LOADALL).
|
||||
*
|
||||
*
|
||||
* @this {X86Seg}
|
||||
* @param {number} addr
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -8,95 +8,95 @@ n.send(q)}else n.open("GET",a,b),n.send();a=[];b||(h=n.responseText,200!=n.statu
|
|||
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)?!0:!1}return!1}function wa(a,b,c){function d(){a-=1;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function xa(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}}var ya={init:[],show:[],exit:[]},za=!0;function Aa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ba(a){ya.init.push(a)}
|
||||
function Ca(a){if(za)for(var b=0;b<a.length;b++)a[b]()}Aa("onload",function(){Ca(ya.init)});Aa("onpageshow",function(){Ca(ya.show)});Aa(va("Opera")||va("iOS")?"onunload":"onbeforeunload",function(){Ca(ya.exit)});
|
||||
function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;this.sk=b.comment;this.dp=b;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.th=this.id.substr(0,b),this.sh=this.id.substr(b+1)):this.sh=this.id;this[a]=c;this.Fi=null;this.jd=this.Nb=this.Kc=this.vi=this.nh=!1;this.sa={};this.X=null;this.th&&this.th.match(/\d+/);Da[Da.length]=this}var Ea=void 0,Fa={};
|
||||
function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;this.vk=b.comment;this.gp=b;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.th=this.id.substr(0,b),this.sh=this.id.substr(b+1)):this.sh=this.id;this[a]=c;this.Hi=null;this.jd=this.Nb=this.Kc=this.xi=this.nh=!1;this.sa={};this.X=null;this.th&&this.th.match(/\d+/);Da[Da.length]=this}var Ea=void 0,Fa={};
|
||||
if(window){Ea||(Ea=window.location.search.substr(1));for(var Ga,Ia=/\+/g,Ja=/([^&=]+)=?([^&]*)/g;Ga=Ja.exec(Ea);)Fa[decodeURIComponent(Ga[1].replace(Ia," "))]=decodeURIComponent(Ga[2].replace(Ia," "))}function Ka(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function y(a,b){b.prototype=Ka(a.prototype)}var Da=[];
|
||||
function La(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<Da.length;b++){var d=Da[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Ma(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1)+a);for(c=0;c<Da.length;c++)if(Da[c].id===a)return Da[c]}return null}
|
||||
function Na(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<Da.length;d++)if(c)c==Da[d]&&(c=null);else if(!(a!=Da[d].type||b&&Da[d].id.indexOf(b)))return Da[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("({"+a+"})")}catch(c){w(c.message+" ("+a+")")}return b}
|
||||
function Oa(a,b){var c,d;d=B(b.parentNode,"pcjs-control");for(c=0;c<d.length;c++){var e,f;f=d[c].childNodes;for(e=0;e<f.length;e++){var g=f[e];if(g.nodeType===window.document.ELEMENT_NODE){var h=g.getAttribute("class");if(h){var m,n;n=h.split(" ");for(m=0;m<n.length;m++)switch(h=n[m],h){case "pcjs-input":case "pcjs-output":(n=z(g))&&n.binding&&a.xb(h,n.type,n.binding,g),n=[]}}}}}}
|
||||
function B(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}
|
||||
x.prototype={toString:function(){return this.name?this.name:this.id||this.type},xb:function(a,b,c,d){switch(c){case "clear":return this.sa[c]||(this.sa[c]=d,d.onclick=function(a){return function(){a.sa.print&&(a.sa.print.value="")}}(this)),!0;case "print":return this.sa[c]||(this.Uf=this.sa[c]=d,d.value="",this.ca=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}}(d),this.Ga=
|
||||
function(a,b,c){this.ca(a,"notice",c)}),!0;default:return!1}},log:function(){},ca:function(){},status:function(a){this.ca(this.sh+": "+a)},Ga:function(a,b){b||w(a)},Ta:function(a){!this.jd&&(this.nh=!1!==a)&&(this.name&&this.log("ready"),a=this.Fi,this.Fi=null,a&&a())},$b:function(){return this.Nb=!0},Wb:function(a,b){b&&(this.Nb=!1);return!0}};function Pa(a,b){if(a.vi)return a.Kc&&(a.Kc=!1),a.vi=!1;if(a.jd)return a.ca(a.toString()+" error"),!1;a.Kc=b;return a.Kc}
|
||||
function Qa(a,b){a.Kc&&(b?a.vi=!0:void 0===b&&a.ca(a.toString()+" busy"));return a.Kc}function Ra(a,b){b&&(a.nh?b():a.Fi=b);return a.nh}function Sa(a,b){a.jd=!0;a.Ga("Fatal error: "+b)}window&&!window.document.ELEMENT_NODE&&(window.document.ELEMENT_NODE=1);function Ta(a){x.call(this,"Panel",a,Ta)}y(x,Ta);Ta.prototype.xb=function(a,b,c,d){return this.Da&&this.Da.xb(a,b,c,d)||this.S&&this.S.xb(a,b,c,d)||this.bb&&this.bb.xb(a,b,c,d)||this.X&&this.X.xb(a,b,c,d)?!0:x.prototype.xb.call(this,a,b,c,d)};
|
||||
Ta.prototype.nc=function(a,b,c,d){this.Da=a;this.S=c;this.X=d;this.bb=C(a,"Keyboard")};Ta.prototype.$b=function(a,b){b||Ua();return!0};Ta.prototype.Wb=function(){return!0};function Ua(){for(var a=!1,b=B(window.document,"pcjs","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=Ma(e.id);f||(a=!0,f=new Ta(e));Oa(f,d);a&&f.Ta()}}Ba(Ua);
|
||||
function Va(a,b,c){x.call(this,"Bus",a,Va);this.S=b;this.X=c;this.cg=a.buswidth||20;this.ue=this.Ib=(1<<this.cg)-1;this.rb=20>=this.cg?12:14;this.ec=1<<this.rb;this.ok=this.ec>>2;this.eb=this.ec-1;this.Zg=(this.ue+this.ec)/this.ec|0;this.ye=this.Zg-1;this.rd=[];this.sd=[];this.Zf=this.$f=!1;this.Li();this.Ta()}y(x,Va);
|
||||
Va.prototype.Li=function(){this.Aa=Array(this.Zg);for(var a=0;a<this.Zg;a++){var b=a*this.ec;Wa(this.Aa[a]=new Xa(b),this.S,this.X,b,this.ec)}this.S.Li(this.Aa,this.ue,this.rb,this.eb,this.ye);this.S.Ib=this.Ib};Va.prototype.reset=function(){Ya(this,!0)};function Za(a,b,c,d,e){if(!(b&a.eb||!c||c&a.eb)){for(var f=b>>a.rb;0<c&&f<a.Aa.length;){var g=a.Aa[f];if(void 0!==g&&g.size)return $a(1,b,c);b=f*a.ec;g=a.Aa[f++]=new Xa(b,a.ec,d,e);Wa(g,a.S,a.X,b,a.ec);c-=a.ec}return!0}return $a(2,b,c)}
|
||||
function Ya(a,b){if(void 0!==b&&20<a.cg){var c=a.Ib&-1048577|(b?1048576:0);c!=a.Ib&&(a.Ib=c,a.S&&(a.S.Ib=c))}}Va.prototype.Oh=function(a,b,c){if(!(a&this.eb||!b||b&this.eb)){for(var d=a>>this.rb;0<b;){var e=this.Aa[d];if(!e.ia)return $a(5,a,b);e.Pe(c);b-=this.ec;d++}return!0}return $a(3,a,b)};function ab(a,b,c){if(!(b&a.eb||!c||c&a.eb)){for(var d=b>>a.rb;0<c;)b=d*a.ec,Wa(a.Aa[d++]=new Xa(b),a.S,a.X,b,a.ec),c-=a.ec;return!0}return $a(4,b,c)}function bb(a,b){return a.Aa[(b&a.Ib)>>a.rb].tg(b&a.eb)}
|
||||
function cb(a,b){var c=b&a.eb,d=(b&a.Ib)>>a.rb;return c!=a.eb?a.Aa[d].Oj(c):a.Aa[d++].tg(c)|a.Aa[d&a.ye].tg(0)<<8}function db(a,b,c){a.Aa[(b&a.Ib)>>a.rb].Bg(b&a.eb,c&255)}function eb(a,b,c){var d=b&a.eb;b=(b&a.Ib)>>a.rb;d!=a.eb?a.Aa[b].Xj(d,c&65535):(a.Aa[b++].Bg(d,c&255),a.Aa[b&a.ye].Bg(0,c>>8&255))}
|
||||
function fb(a){for(var b=0,c=[],d=0;d<a.Zg;d++){var e=a.Aa[d];if(e.mb||e.wk){c[b++]=d;var f=c,g=b++;a:if(e=e.save()){for(var h=0,m=0,n=[];h<e.length;){for(var q=e[h],t=h+1;t<e.length&&e[t]===q;)t++;n[m++]=t-h;n[m++]=q;h=t}if(n.length<e.length){e=n;break a}}f[g]=e}}c[b]=a.ue==a.Ib;return c}function hb(a,b){if(void 0===b)return a.Zf=!a.Zf,a.Zf;void 0===a.rd[b]&&(a.rd[b]=[null,null,!1]);a.rd[b][2]=!a.rd[b][2];return a.rd[b][2]}
|
||||
function(a,b,c){this.ca(a,"notice",c)}),!0;default:return!1}},log:function(){},ca:function(){},status:function(a){this.ca(this.sh+": "+a)},Ga:function(a,b){b||w(a)},Ta:function(a){!this.jd&&(this.nh=!1!==a)&&(this.name&&this.log("ready"),a=this.Hi,this.Hi=null,a&&a())},ac:function(){return this.Nb=!0},Wb:function(a,b){b&&(this.Nb=!1);return!0}};function Pa(a,b){if(a.xi)return a.Kc&&(a.Kc=!1),a.xi=!1;if(a.jd)return a.ca(a.toString()+" error"),!1;a.Kc=b;return a.Kc}
|
||||
function Qa(a,b){a.Kc&&(b?a.xi=!0:void 0===b&&a.ca(a.toString()+" busy"));return a.Kc}function Ra(a,b){b&&(a.nh?b():a.Hi=b);return a.nh}function Sa(a,b){a.jd=!0;a.Ga("Fatal error: "+b)}window&&!window.document.ELEMENT_NODE&&(window.document.ELEMENT_NODE=1);function Ta(a){x.call(this,"Panel",a,Ta)}y(x,Ta);Ta.prototype.xb=function(a,b,c,d){return this.Da&&this.Da.xb(a,b,c,d)||this.S&&this.S.xb(a,b,c,d)||this.bb&&this.bb.xb(a,b,c,d)||this.X&&this.X.xb(a,b,c,d)?!0:x.prototype.xb.call(this,a,b,c,d)};
|
||||
Ta.prototype.pc=function(a,b,c,d){this.Da=a;this.S=c;this.X=d;this.bb=C(a,"Keyboard")};Ta.prototype.ac=function(a,b){b||Ua();return!0};Ta.prototype.Wb=function(){return!0};function Ua(){for(var a=!1,b=B(window.document,"pcjs","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=Ma(e.id);f||(a=!0,f=new Ta(e));Oa(f,d);a&&f.Ta()}}Ba(Ua);
|
||||
function Va(a,b,c){x.call(this,"Bus",a,Va);this.S=b;this.X=c;this.cg=a.buswidth||20;this.ue=this.Ib=(1<<this.cg)-1;this.rb=20>=this.cg?12:14;this.fc=1<<this.rb;this.rk=this.fc>>2;this.eb=this.fc-1;this.Zg=(this.ue+this.fc)/this.fc|0;this.ye=this.Zg-1;this.rd=[];this.sd=[];this.Zf=this.$f=!1;this.Ni();this.Ta()}y(x,Va);
|
||||
Va.prototype.Ni=function(){this.Aa=Array(this.Zg);for(var a=0;a<this.Zg;a++){var b=a*this.fc;Wa(this.Aa[a]=new Xa(b),this.S,this.X,b,this.fc)}this.S.Ni(this.Aa,this.ue,this.rb,this.eb,this.ye);this.S.Ib=this.Ib};Va.prototype.reset=function(){Ya(this,!0)};function Za(a,b,c,d,e){if(!(b&a.eb||!c||c&a.eb)){for(var f=b>>a.rb;0<c&&f<a.Aa.length;){var g=a.Aa[f];if(void 0!==g&&g.size)return $a(1,b,c);b=f*a.fc;g=a.Aa[f++]=new Xa(b,a.fc,d,e);Wa(g,a.S,a.X,b,a.fc);c-=a.fc}return!0}return $a(2,b,c)}
|
||||
function Ya(a,b){if(void 0!==b&&20<a.cg){var c=a.Ib&-1048577|(b?1048576:0);c!=a.Ib&&(a.Ib=c,a.S&&(a.S.Ib=c))}}Va.prototype.Qh=function(a,b,c){if(!(a&this.eb||!b||b&this.eb)){for(var d=a>>this.rb;0<b;){var e=this.Aa[d];if(!e.ia)return $a(5,a,b);e.Pe(c);b-=this.fc;d++}return!0}return $a(3,a,b)};function ab(a,b,c){if(!(b&a.eb||!c||c&a.eb)){for(var d=b>>a.rb;0<c;)b=d*a.fc,Wa(a.Aa[d++]=new Xa(b),a.S,a.X,b,a.fc),c-=a.fc;return!0}return $a(4,b,c)}function bb(a,b){return a.Aa[(b&a.Ib)>>a.rb].tg(b&a.eb)}
|
||||
function cb(a,b){var c=b&a.eb,d=(b&a.Ib)>>a.rb;return c!=a.eb?a.Aa[d].Rj(c):a.Aa[d++].tg(c)|a.Aa[d&a.ye].tg(0)<<8}function db(a,b,c){a.Aa[(b&a.Ib)>>a.rb].Bg(b&a.eb,c&255)}function eb(a,b,c){var d=b&a.eb;b=(b&a.Ib)>>a.rb;d!=a.eb?a.Aa[b].$j(d,c&65535):(a.Aa[b++].Bg(d,c&255),a.Aa[b&a.ye].Bg(0,c>>8&255))}
|
||||
function fb(a){for(var b=0,c=[],d=0;d<a.Zg;d++){var e=a.Aa[d];if(e.lb||e.zk){c[b++]=d;var f=c,g=b++;a:if(e=e.save()){for(var h=0,m=0,n=[];h<e.length;){for(var q=e[h],t=h+1;t<e.length&&e[t]===q;)t++;n[m++]=t-h;n[m++]=q;h=t}if(n.length<e.length){e=n;break a}}f[g]=e}}c[b]=a.ue==a.Ib;return c}function hb(a,b){if(void 0===b)return a.Zf=!a.Zf,a.Zf;void 0===a.rd[b]&&(a.rd[b]=[null,null,!1]);a.rd[b][2]=!a.rd[b][2];return a.rd[b][2]}
|
||||
function ib(a,b,c,d){void 0===d&&(d=0);for(var e in c){e=parseInt(e,10);var f=a,g=e+d,h=b,m=c[e];if(void 0!==m)for(var n=e+d;n<=g;n++)void 0!==f.rd[n]?w("Input port "+u(n)+" registered by "+f.rd[n][0].id+", ignoring "+h.id):f.rd[n]=[h,m,!1,!1]}}function jb(a,b,c){var d=255,e=a.rd[b];void 0!==e?(e[1]&&(d=e[1].call(e[0],b,c)),a.X&&a.Zf!=e[2]&&kb(a.X,b,d)):a.X&&(a.X.ba(a,b,null,c),a.Zf&&kb(a.X,b,d));return d}
|
||||
function lb(a,b){if(void 0===b)return a.$f=!a.$f,a.$f;void 0===a.sd[b]&&(a.sd[b]=[null,null,!1]);a.sd[b][2]=!a.sd[b][2];return a.sd[b][2]}function mb(a,b,c,d){void 0===d&&(d=0);for(var e in c){e=parseInt(e,10);var f=a,g=e+d,h=b,m=c[e];if(void 0!==m)for(var n=e+d;n<=g;n++)void 0!==f.sd[n]?w("Output port "+u(n)+" registered by "+f.sd[n][0].id+", ignoring "+h.id):f.sd[n]=[h,m,!1,!1]}}
|
||||
function nb(a,b,c,d){var e=a.sd[b];void 0!==e?(e[1]&&e[1].call(e[0],b,c,d),a.X&&a.$f!=e[2]&&ob(a.X,b,c)):a.X&&(a.X.ba(a,b,c,d),a.$f&&ob(a.X,b,c))}function $a(a,b,c){w("Memory block error ("+a+","+p(b)+","+p(c)+")");return!1}function Xa(a,b,c,d){this.zm=b;this.ra=null;this.offset=0;this.mh=c;this.ia=null;this.mb=this.wk=!1;if(b)if(d)this.ia=d,a=[d.ed,a-d.cb],this.ra=a[0],this.offset=a[1],this.Pe(d.Jf);else{this.ra=Array(b>>2);for(d=0;d<this.ra.length;d++)this.ra[d]=0;this.Pe(pb)}else this.Pe()}
|
||||
Xa.prototype={Ih:function(a){E(this.X,this.X.Fg)&&!a&&this.X.message("attempt to read invalid block %"+p(this.Wd)+" from "+da(this.S.qa,this.S.ua.oa));return 0},xf:function(a,b){E(this.X,this.X.Fg)&&!a&&this.X.message("attempt to write 0x"+u(b)+" to invalid block %"+p(this.Wd)+" from "+da(this.S.qa,this.S.ua.oa))},fp:function(a){return this.ra[a>>2]>>>((a&3)<<3)&255},hp:function(a){var b=a>>2;a=(a&3)<<3;var c=this.ra[b]>>>a;return 24>a?c&65535:c&255|(this.ra[b+1]&255)<<8},pp:function(a,b){var c=a>>
|
||||
2,d=(a&3)<<3;this.ra[c]=this.ra[c]&~(255<<d)|b<<d;this.mb=!0},rp:function(a,b){var c=a>>2,d=(a&3)<<3;24>d?this.ra[c]=this.ra[c]&~(65535<<d)|b<<d:(this.ra[c]=this.ra[c]&16777215|b<<24,c++,this.ra[c]=this.ra[c]&4294967040|b>>8);this.mb=!0},gp:function(a){qb(this.X,this.Wd+a);return this.tg(a)},ip:function(a){qb(this.X,this.Wd+a)||qb(this.X,this.Wd+a+1);return this.Oj(a)},qp:function(a,b){rb(this.X,this.Wd+a);this.Bg(a,b)},sp:function(a,b){rb(this.X,this.Wd+a)||rb(this.X,this.Wd+a+1);this.Xj(a,b)},save:function(){return this.ia?
|
||||
null:this.ra},restore:function(a){return this.ia?null===a:this.zm==a.length<<2?(this.ra=a,this.mb=!0):!1},Pe:function(a,b){a||(a=[]);void 0===b&&(b=!0);sb(this,a,b);tb(this,a,b)},Vd:function(a,b){b?0===this.qk++&&tb(this,ub):0===this.pk++&&sb(this,ub)}};function wb(a,b){b?0===--a.qk&&(a.Dc=a.mh?a.xf:a.Bg,a.im=a.mh?a.xf:a.Xj):0===--a.pk&&(a.sc=a.tg,a.Wl=a.Oj)}function Wa(a,b,c,d,e){a.S=b;a.X=c;a.Wd=d;a.pk=a.qk=0;a.X&&xb(a.X,d,e)}
|
||||
function tb(a,b,c){a.Dc=b[2]&&!a.mh?b[2]:a.xf;a.im=b[3]&&!a.mh?b[3]:a.xf;c&&(a.Bg=b[2]?b[2]:a.xf,a.Xj=b[3]?b[3]:a.xf)}function sb(a,b,c){a.sc=b[0]?b[0]:a.Ih;a.Wl=b[1]?b[1]:a.Ih;c&&(a.tg=b[0]?b[0]:a.Ih,a.Oj=b[1]?b[1]:a.Ih)}var pb=[Xa.prototype.fp,Xa.prototype.hp,Xa.prototype.pp,Xa.prototype.rp],ub=[Xa.prototype.gp,Xa.prototype.ip,Xa.prototype.qp,Xa.prototype.sp];
|
||||
function yb(a,b){x.call(this,"CPU",a,yb);var c=a.multiplier||1;this.Hd=a.cycles||b;this.Gd=c;this.wh=Math.round(this.Hd/1E4)/100;this.Ge=this.wh*this.Gd;this.Ob=this.Nb=!1;this.ui=a.autoStart;c=Fa.autostart;void 0!==c&&(this.ui="true"==c?!0:"false"==c?!1:null);this.cf=!1;this.dg=this.mf=0;this.fg=a.csStart;this.lf=a.csInterval;this.nf=a.csStop;var d=this;this.jo=function(){d.Ne()};this.Ta()}y(x,yb);k=yb.prototype;
|
||||
k.nc=function(a,b,c,d){this.na=b;this.X=d;this.Da=a;var e=C(a,"Video");e&&(this.pi=function(){zb(e)},this.Md=function(){e.Md()});this.ka=C(a,"ChipSet");this.Ta()};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.$b=function(a,b){if(!b){if(a&&this.restore){Ab(this);if(!this.restore(a))return!1;Bb(this)}else this.reset();this.X?this.X.Ln():this.ca("No debugger detected")}this.Nb=!0;!Cb(this)&&this.X&&Db(this.X);Eb(this);return!0};
|
||||
k.Wb=function(a){this.Nb=!1;return a&&this.save?this.save():!0};function Cb(a){return!0===a.ui||null===a.ui&&!a.X&&void 0===a.sa.run?(a.Ne(),!0):!1}k.Md=function(){};k.Dk=function(){return 0};function Bb(a){void 0===a.fg&&(a.fg=0);void 0===a.lf&&(a.lf=-1);void 0===a.nf&&(a.nf=-1);a.cf=0<=a.fg&&0<a.lf;a.cf&&(a.dg=0,a.mf=a.fg-a.Ke)}
|
||||
function Fb(a,b){if(a.cf){var c=!1;a.dg=a.dg+a.Dk()|0;a.mf-=b;0>=a.mf&&(a.mf+=a.lf,c=!0);0<=a.nf&&a.nf<=F(a)&&(a.lf=a.nf=-1,Bb(a),a.Ab(),c=!0);c&&a.ca(F(a)+" cycles: checksum="+p(a.dg))}}function G(a,b,c,d){void 0!==a.sa[b]&&(void 0===d&&(d=4),void 0===c&&(Sa(a,"Register "+b+" is invalid"),a.Ab()),c=p(c,d),a.sa[b].innerHTML!=c&&(a.sa[b].innerHTML=c))}k.eh=function(){};k.pi=function(){};
|
||||
function nb(a,b,c,d){var e=a.sd[b];void 0!==e?(e[1]&&e[1].call(e[0],b,c,d),a.X&&a.$f!=e[2]&&ob(a.X,b,c)):a.X&&(a.X.ba(a,b,c,d),a.$f&&ob(a.X,b,c))}function $a(a,b,c){w("Memory block error ("+a+","+p(b)+","+p(c)+")");return!1}function Xa(a,b,c,d){this.Cm=b;this.ra=null;this.offset=0;this.mh=c;this.ia=null;this.lb=this.zk=!1;if(b)if(d)this.ia=d,a=[d.ed,a-d.cb],this.ra=a[0],this.offset=a[1],this.Pe(d.Jf);else{this.ra=Array(b>>2);for(d=0;d<this.ra.length;d++)this.ra[d]=0;this.Pe(pb)}else this.Pe()}
|
||||
Xa.prototype={Kh:function(a){E(this.X,this.X.Fg)&&!a&&this.X.message("attempt to read invalid block %"+p(this.Wd)+" from "+da(this.S.qa,this.S.ua.oa));return 0},xf:function(a,b){E(this.X,this.X.Fg)&&!a&&this.X.message("attempt to write 0x"+u(b)+" to invalid block %"+p(this.Wd)+" from "+da(this.S.qa,this.S.ua.oa))},ip:function(a){return this.ra[a>>2]>>>((a&3)<<3)&255},kp:function(a){var b=a>>2;a=(a&3)<<3;var c=this.ra[b]>>>a;return 24>a?c&65535:c&255|(this.ra[b+1]&255)<<8},sp:function(a,b){var c=a>>
|
||||
2,d=(a&3)<<3;this.ra[c]=this.ra[c]&~(255<<d)|b<<d;this.lb=!0},up:function(a,b){var c=a>>2,d=(a&3)<<3;24>d?this.ra[c]=this.ra[c]&~(65535<<d)|b<<d:(this.ra[c]=this.ra[c]&16777215|b<<24,c++,this.ra[c]=this.ra[c]&4294967040|b>>8);this.lb=!0},jp:function(a){qb(this.X,this.Wd+a);return this.tg(a)},lp:function(a){qb(this.X,this.Wd+a)||qb(this.X,this.Wd+a+1);return this.Rj(a)},tp:function(a,b){rb(this.X,this.Wd+a);this.Bg(a,b)},vp:function(a,b){rb(this.X,this.Wd+a)||rb(this.X,this.Wd+a+1);this.$j(a,b)},save:function(){return this.ia?
|
||||
null:this.ra},restore:function(a){return this.ia?null===a:this.Cm==a.length<<2?(this.ra=a,this.lb=!0):!1},Pe:function(a,b){a||(a=[]);void 0===b&&(b=!0);sb(this,a,b);tb(this,a,b)},Vd:function(a,b){b?0===this.tk++&&tb(this,ub):0===this.sk++&&sb(this,ub)}};function wb(a,b){b?0===--a.tk&&(a.Dc=a.mh?a.xf:a.Bg,a.lm=a.mh?a.xf:a.$j):0===--a.sk&&(a.sc=a.tg,a.Zl=a.Rj)}function Wa(a,b,c,d,e){a.S=b;a.X=c;a.Wd=d;a.sk=a.tk=0;a.X&&xb(a.X,d,e)}
|
||||
function tb(a,b,c){a.Dc=b[2]&&!a.mh?b[2]:a.xf;a.lm=b[3]&&!a.mh?b[3]:a.xf;c&&(a.Bg=b[2]?b[2]:a.xf,a.$j=b[3]?b[3]:a.xf)}function sb(a,b,c){a.sc=b[0]?b[0]:a.Kh;a.Zl=b[1]?b[1]:a.Kh;c&&(a.tg=b[0]?b[0]:a.Kh,a.Rj=b[1]?b[1]:a.Kh)}var pb=[Xa.prototype.ip,Xa.prototype.kp,Xa.prototype.sp,Xa.prototype.up],ub=[Xa.prototype.jp,Xa.prototype.lp,Xa.prototype.tp,Xa.prototype.vp];
|
||||
function yb(a,b){x.call(this,"CPU",a,yb);var c=a.multiplier||1;this.Hd=a.cycles||b;this.Gd=c;this.wh=Math.round(this.Hd/1E4)/100;this.Ge=this.wh*this.Gd;this.Ob=this.Nb=!1;this.wi=a.autoStart;c=Fa.autostart;void 0!==c&&(this.wi="true"==c?!0:"false"==c?!1:null);this.cf=!1;this.dg=this.mf=0;this.fg=a.csStart;this.lf=a.csInterval;this.nf=a.csStop;var d=this;this.mo=function(){d.Ne()};this.Ta()}y(x,yb);k=yb.prototype;
|
||||
k.pc=function(a,b,c,d){this.na=b;this.X=d;this.Da=a;var e=C(a,"Video");e&&(this.ri=function(){zb(e)},this.Md=function(){e.Md()});this.ka=C(a,"ChipSet");this.Ta()};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.ac=function(a,b){if(!b){if(a&&this.restore){Ab(this);if(!this.restore(a))return!1;Bb(this)}else this.reset();this.X?this.X.On():this.ca("No debugger detected")}this.Nb=!0;!Cb(this)&&this.X&&Db(this.X);Eb(this);return!0};
|
||||
k.Wb=function(a){this.Nb=!1;return a&&this.save?this.save():!0};function Cb(a){return!0===a.wi||null===a.wi&&!a.X&&void 0===a.sa.run?(a.Ne(),!0):!1}k.Md=function(){};k.Gk=function(){return 0};function Bb(a){void 0===a.fg&&(a.fg=0);void 0===a.lf&&(a.lf=-1);void 0===a.nf&&(a.nf=-1);a.cf=0<=a.fg&&0<a.lf;a.cf&&(a.dg=0,a.mf=a.fg-a.Ke)}
|
||||
function Fb(a,b){if(a.cf){var c=!1;a.dg=a.dg+a.Gk()|0;a.mf-=b;0>=a.mf&&(a.mf+=a.lf,c=!0);0<=a.nf&&a.nf<=F(a)&&(a.lf=a.nf=-1,Bb(a),a.Ab(),c=!0);c&&a.ca(F(a)+" cycles: checksum="+p(a.dg))}}function G(a,b,c,d){void 0!==a.sa[b]&&(void 0===d&&(d=4),void 0===c&&(Sa(a,"Register "+b+" is invalid"),a.Ab()),c=p(c,d),a.sa[b].innerHTML!=c&&(a.sa[b].innerHTML=c))}k.eh=function(){};k.ri=function(){};
|
||||
k.xb=function(a,b,c,d){var e=this;a=!1;switch(c){case "run":this.sa[c]=d;d.onclick=function(){e.Ob?e.Ab(!0):e.Ne(!0)};a=!0;break;case "reset":this.sa[c]=d;d.onclick=function(){e.Da&&Gb(e.Da)};a=!0;break;case "speed":this.sa[c]=d;a=!0;break;case "setSpeed":this.sa[c]=d,d.onclick=function(){Hb(e,e.Gd<<1,!0)},d.innerHTML=this.Ge.toFixed(2)+"Mhz",a=!0}return a};function Ib(a,b,c){a.Ke+=b;c&&(a.Oc=a.A=0)}
|
||||
function Jb(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.Gd&&a.ld&&(d=a.ld/a.wh);a.Kk=Math.round(1E3/30);a.$n=Math.floor(a.Hd/c*d);a.Si=Math.floor(a.Hd/30*d);a.Ok=Math.floor(a.Hd/60*d);a.Nk=Math.floor(a.Hd/2*d);b||(a.of=a.Si,a.hg=a.Ok,a.gg=a.Nk);a.Hj=0}function F(a,b){var c=a.Ke+a.ke+a.Oc-a.A;b&&1<a.Gd&&a.ld>a.wh&&(c=Math.round(c/a.Gd));return c}function Ab(a){a.ld=0;a.zh=1;a.Ke=a.ke=a.Oc=a.A=0;Bb(a);Hb(a,1)}
|
||||
function Jb(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.Gd&&a.ld&&(d=a.ld/a.wh);a.Nk=Math.round(1E3/30);a.co=Math.floor(a.Hd/c*d);a.Ui=Math.floor(a.Hd/30*d);a.Rk=Math.floor(a.Hd/60*d);a.Qk=Math.floor(a.Hd/2*d);b||(a.of=a.Ui,a.hg=a.Rk,a.gg=a.Qk);a.Kj=0}function F(a,b){var c=a.Ke+a.ke+a.Oc-a.A;b&&1<a.Gd&&a.ld>a.wh&&(c=Math.round(c/a.Gd));return c}function Ab(a){a.ld=0;a.zh=1;a.Ke=a.ke=a.Oc=a.A=0;Bb(a);Hb(a,1)}
|
||||
function Hb(a,b,c){void 0!==b&&(0.8>a.ld/a.Ge&&(b=1),a.Gd=b,b=a.wh*a.Gd,a.Ge!=b&&(a.Ge=b,b=a.Ge.toFixed(2)+"Mhz",a.sa.setSpeed&&(a.sa.setSpeed.innerHTML=b),a.ca("target speed: "+b)),c&&a.Md());Ib(a,a.ke);a.ke=0;a.kf=oa();a.He=0;Jb(a)}
|
||||
k.Ne=function(a){if(Pa(this,!0)){this.Ob||(Hb(this),this.Da&&this.Da.start(this.kf,F(this)),this.Ob=!0,this.ka&&Kb(this.ka),this.sa.run&&(this.sa.run.innerHTML="Halt"),a&&this.Md());this.Hj>=this.Hd&&Jb(this,!0);this.ig=0;this.xh=oa();this.He&&(a=this.xh-this.He,a>this.Kk&&(this.kf+=a,this.kf>this.xh&&(this.kf=this.xh)));try{do{this.wf(this.cf?1:Math.round(this.$n/this.zh));var b=this.Oc-this.A;this.ke+=b;this.ig+=b;Ib(this,0,!0);Fb(this,b);this.hg-=b;0>=this.hg&&(this.hg+=this.Ok,this.pi());this.gg-=
|
||||
b;0>=this.gg&&(this.gg+=this.Nk,this.eh());this.of-=b;if(0>=this.of){this.of+=this.Si;break}}while(this.Ob)}catch(c){this.Ab();Eb(this);this.Da&&this.Da.stop(oa(),F(this));Pa(this,!1);Sa(this,c.message);return}b=setTimeout;a=this.jo;this.He=oa();var d=this.Kk;this.ig&&(d=Math.round(d*this.ig/this.Si));var d=d-(this.He-this.xh),e=this.He-this.kf;e&&(this.ld=Math.round(this.ke/(10*e))/100,864E5<=e&&(this.Ke=0,this.ka&&Lb(this.ka,!0),Hb(this)));if(0>d||this.ld<this.Ge)d=0;this.Hj+=this.ig;this.He+=d;
|
||||
b(a,d)}else Eb(this),this.Da&&this.Da.stop(oa(),F(this))};k.Ab=function(a){Qa(this,!0);this.Oc-=this.A;this.A=0;Ib(this,this.ke);this.ke=0;this.Ob&&(this.Ob=!1,this.ka&&Kb(this.ka),this.sa.run&&(this.sa.run.innerHTML="Run"));this.kh=a};k.wf=function(){return 0};function Eb(a){a.pi();a.eh()}
|
||||
k.Ne=function(a){if(Pa(this,!0)){this.Ob||(Hb(this),this.Da&&this.Da.start(this.kf,F(this)),this.Ob=!0,this.ka&&Kb(this.ka),this.sa.run&&(this.sa.run.innerHTML="Halt"),a&&this.Md());this.Kj>=this.Hd&&Jb(this,!0);this.ig=0;this.xh=oa();this.He&&(a=this.xh-this.He,a>this.Nk&&(this.kf+=a,this.kf>this.xh&&(this.kf=this.xh)));try{do{this.wf(this.cf?1:Math.round(this.co/this.zh));var b=this.Oc-this.A;this.ke+=b;this.ig+=b;Ib(this,0,!0);Fb(this,b);this.hg-=b;0>=this.hg&&(this.hg+=this.Rk,this.ri());this.gg-=
|
||||
b;0>=this.gg&&(this.gg+=this.Qk,this.eh());this.of-=b;if(0>=this.of){this.of+=this.Ui;break}}while(this.Ob)}catch(c){this.Ab();Eb(this);this.Da&&this.Da.stop(oa(),F(this));Pa(this,!1);Sa(this,c.message);return}b=setTimeout;a=this.mo;this.He=oa();var d=this.Nk;this.ig&&(d=Math.round(d*this.ig/this.Ui));var d=d-(this.He-this.xh),e=this.He-this.kf;e&&(this.ld=Math.round(this.ke/(10*e))/100,864E5<=e&&(this.Ke=0,this.ka&&Lb(this.ka,!0),Hb(this)));if(0>d||this.ld<this.Ge)d=0;this.Kj+=this.ig;this.He+=d;
|
||||
b(a,d)}else Eb(this),this.Da&&this.Da.stop(oa(),F(this))};k.Ab=function(a){Qa(this,!0);this.Oc-=this.A;this.A=0;Ib(this,this.ke);this.ke=0;this.Ob&&(this.Ob=!1,this.ka&&Kb(this.ka),this.sa.run&&(this.sa.run.innerHTML="Run"));this.kh=a};k.wf=function(){return 0};function Eb(a){a.ri();a.eh()}
|
||||
var Mb=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,
|
||||
0,0,1,1,0,1,0,0,1];function Nb(a,b,c){this.S=a;this.Ua=this.oa=0;this.Nc=65535;this.Mc=this.ab=0;this.xg=b;Pb(this,c)}function Qb(a){this.oa=a;this.Nc=65535;return this.Ua=a<<4}
|
||||
function Rb(a){var b,c;a&4?(b=this.S.Ld.Ua,c=this.S.Ld.Nc):(b=this.S.Sc,c=this.S.Ye);b+=a&65528;if(b+7<=c){this.Wc=Sb;this.Yb=Tb;this.S.A-=15;c=this.S.Ia(b+0);var d=this.S.Ia(b+4),e=this.S.Ia(b+2)|(d&255)<<16;this.S.Ia(b+6);b=d&7936;if(b&4096){2048==(b&2560)&&(this.Yb=Ub);if(b&2048||!(b&512))this.Yb=Vb;this.oa=a;this.Nc=c;this.ab=d;this.Mc=(d&24576)>>13;return this.Ua=e}if(b&&768>=b)return this.oa=a,this.Nc=c,this.ab=d,this.Mc=(d&24576)>>13,this.Ua=e}return-1}function Wb(a){return this.Ua+a}
|
||||
function Xb(a){return this.Ua+a}function Sb(a,b,c){return a+b<=this.Nc?this.Ua+a:Ub.call(this,0,0,c)}function Ub(a,b,c){c||Yb.call(this.S,13,0);return-1}function Tb(a,b,c){return a+b<=this.Nc?this.Ua+a:Vb.call(this,0,0,c)}function Vb(a,b,c){c||Yb.call(this.S,13,0);return-1}Nb.prototype.save=function(){return[this.oa,this.Ua,this.Nc,this.ab,this.Mc,this.xg]};Nb.prototype.restore=function(a){"number"==typeof a?this.load(a):(this.oa=a[0],this.Ua=a[1],this.Nc=a[2],this.ab=a[3],this.Mc=a[4],this.xg=a[5])};
|
||||
function Pb(a,b){void 0===b&&(b=!!(a.S.ad&1));b?(a.load=Rb,a.Wc=Sb,a.Yb=Tb):(a.load=Qb,a.Wc=Wb,a.Yb=Xb)}
|
||||
function Zb(a){this.Fa=a.model||8088;var b=0;switch(this.Fa){default:case 8088:b=4772727;break;case 80286:b=6E6}yb.call(this,a,b);this.dk=61442;this.Jg=4;this.pf=255;this.Ij=4;this.aa=5;this.ta=6;this.fa=7;this.ga=8;this.P=9;this.V=11;this.W=12;this.Ie=4;this.Qk=60;this.Rk=83;this.Tb=3;this.sb=9;this.gc=16;this.Ch=1;this.Vk=19;this.Xk=28;this.Zk=16;this.Yk=21;this.Wk=37;this.Tk=2;this.aj=9;this.Uk=5;this.Sk=33;this.cj=10;this.bj=8;this.mg=3;this.lg=15;this.ml=51;this.nl=1;this.ol=2;this.pl=4;this.ll=
|
||||
32;this.rl=this.dj=15;this.Ub=16;this.Vb=4;this.tl=11;this.sl=18;this.ql=24;this.Cb=4;this.ul=2;this.ej=16;this.vl=17;this.jj=18;this.wl=19;this.ij=5;this.kj=6;this.Bl=2;this.Al=8;this.yl=9;this.mj=this.lj=this.xl=this.zl=10;this.al=80;this.cl=144;this.$k=86;this.bl=154;this.el=101;this.gl=165;this.dl=107;this.fl=171;this.Dl=70;this.Fl=113;this.Cl=76;this.El=124;this.il=80;this.kl=128;this.hl=86;this.jl=134;this.og=3;this.ng=16;this.rj=10;this.qj=8;this.Gl=51;this.hc=8;this.Hl=17;this.Il=36;this.pc=
|
||||
11;this.Jl=16;this.pg=10;this.Pb=2;this.Yi=18;this.Zi=9-this.Pb;this.$i=17-this.Pb;this.fj=12;this.gj=9-this.Pb;this.hj=13-this.Pb;this.nj=18;this.oj=9-this.Pb;this.pj=17-this.Pb;this.sj=15;this.tj=9-this.Pb;this.uj=15-this.Pb;this.yj=11;this.zj=9-this.Pb;this.Aj=10-this.Pb;this.Kl=8;this.Nl=12;this.Ll=18;this.Ml=17;this.Ol=15;this.wj=8;this.vj=20;this.xj=2;this.Dj=3;this.qg=9;this.Cj=5;this.Bj=11;this.Fj=4;this.Ej=17;this.Pl=11;this.Sa=$b.slice();80186<=this.Fa&&(this.pf=31,this.Sa[15]=ac,this.Sa[96]=
|
||||
bc,this.Sa[97]=cc,this.Sa[98]=dc,this.Sa[99]=ac,this.Sa[100]=ac,this.Sa[101]=ac,this.Sa[102]=ac,this.Sa[103]=ac,this.Sa[104]=ec,this.Sa[105]=fc,this.Sa[106]=gc,this.Sa[107]=hc,this.Sa[108]=ic,this.Sa[109]=jc,this.Sa[110]=kc,this.Sa[111]=lc,this.Sa[192]=mc,this.Sa[193]=nc,this.Sa[200]=oc,this.Sa[201]=pc,this.Sa[241]=qc,rc[7]=sc,tc[7]=sc,80286<=this.Fa&&(this.dk=2,this.Jg=0,this.Sa[15]=uc,this.Sa[99]=vc,this.Sa[84]=wc,this.P=this.ga=this.fa=this.ta=this.aa=this.Ij=0,this.W=this.V=1,this.Ie=3,this.Qk=
|
||||
14,this.Rk=16,this.Tb=2,this.gc=this.sb=7,this.Ch=0,this.Vk=7,this.Xk=13,this.Zk=7,this.Yk=11,this.Wk=16,this.Tk=3,this.aj=6,this.Uk=2,this.Sk=13,this.bj=this.cj=5,this.mg=2,this.lg=7,this.ml=23,this.nl=0,this.ol=1,this.pl=3,this.ll=17,this.dj=7,this.rl=11,this.Ub=7,this.Vb=3,this.tl=7,this.sl=11,this.ql=15,this.Cb=2,this.ul=3,this.ej=7,this.wl=this.jj=this.vl=8,this.kj=this.ij=4,this.Bl=2,this.Al=3,this.yl=5,this.zl=2,this.xl=3,this.lj=5,this.mj=3,this.al=14,this.cl=22,this.$k=17,this.bl=25,this.el=
|
||||
17,this.gl=25,this.dl=20,this.fl=28,this.Dl=13,this.Fl=21,this.Cl=16,this.El=24,this.il=13,this.kl=21,this.hl=16,this.jl=24,this.og=2,this.ng=7,this.qj=this.rj=5,this.Gl=19,this.Hl=this.hc=5,this.Il=17,this.pc=3,this.Jl=5,this.pg=3,this.Pb=0,this.Yi=8,this.Zi=5,this.$i=9,this.gj=this.fj=5,this.hj=4,this.oj=this.nj=5,this.pj=4,this.sj=7,this.tj=5,this.uj=8,this.yj=3,this.zj=4,this.Aj=3,this.Nl=this.Kl=11,this.Ml=this.Ll=15,this.Ol=7,this.wj=5,this.vj=8,this.xj=0,this.Dj=2,this.qg=6,this.Cj=3,this.Bj=
|
||||
6,this.Fj=3,this.Pl=this.Ej=5));this.Lg=[];this.Mg=[];this.Oc=this.ah=0;this.kh=this.yi=!1;this.Aa=[];this.ue=this.Ib=this.rb=this.eb=this.ye=0;this.T=this.Jm;this.U=this.Km;this.N=this.Rn;this.O=this.Sn;this.Q=this.np;this.R=this.op;xc(this)}y(yb,Zb);k=Zb.prototype;k.Li=function(a,b,c,d,e){this.Aa=a;this.ue=this.Ib=b;this.rb=c;this.eb=d;this.ye=e};k.reset=function(){this.Ob&&this.Ab();xc(this);Ab(this);this.jd=!1};
|
||||
function xc(a){a.G=0;a.B=0;a.I=0;a.J=0;a.Y=0;a.H=0;a.F=0;a.D=0;a.ad=65520;a.dd=0;a.te=1023;a.Jc={Jj:0,oa:0,ab:0,vh:-1};a.ua=new Nb(a,"CS");a.Eb=new Nb(a,"DS");a.wb=new Nb(a,"SS");a.Za=new Nb(a,"ES");a.fm=new Nb(a,"ZERO");yc(a,0,65535);80286<=a.Fa&&(a.Sc=a.Ye=0,a.Ld=new Nb(a,"LDT",!0),a.Ag=new Nb(a,"TSS",!0),a.Qb=new Nb(a,"VER",!0),yc(a,65520,61440),a.ua.Ua=16711680);zc(a,0);Ac(a);a.nb=0;a.Db=a.ug=-1;a.Ug=0;a.ha=a.Ka=-1;a.C=a.Eb;a.M=a.wb;a.$=a.wa=0}
|
||||
k.Dk=function(){var a=this.G+this.B+this.I+this.J+this.Y+this.H+this.F+this.D|0;return a=a+this.qa+this.ua.oa+this.Eb.oa+this.wb.oa+this.Za.oa+Bc(this)|0};function Cc(a,b,c,d){void 0!==d&&(void 0===a.Lg[b]&&(a.Lg[b]=[]),a.Lg[b].push([c,d]))}function Dc(a,b){a.yi&&E(a.X,a.X.$j)&&(Ec(a.X,b,a.Ba),Fc(a,a.Ba,function(a,c){return function(d){Gc(a.X,b,d,F(a)-c)}}(a,F(a))));var c=a.Lg[b];if(void 0!==c)for(var d=0;d<c.length;d++)if(!c[d][1].call(c[d][0],a.Ba))return!1;return!0}
|
||||
function Zb(a){this.Fa=a.model||8088;var b=0;switch(this.Fa){default:case 8088:b=4772727;break;case 80286:b=6E6}yb.call(this,a,b);this.gk=61442;this.Jg=4;this.pf=255;this.Lj=4;this.aa=5;this.ta=6;this.fa=7;this.ga=8;this.P=9;this.V=11;this.W=12;this.Ie=4;this.Tk=60;this.Uk=83;this.Tb=3;this.sb=9;this.hc=16;this.Eh=1;this.Yk=19;this.$k=28;this.bl=16;this.al=21;this.Zk=37;this.Wk=2;this.dj=9;this.Xk=5;this.Vk=33;this.fj=10;this.ej=8;this.mg=3;this.lg=15;this.pl=51;this.ql=1;this.rl=2;this.sl=4;this.ol=
|
||||
32;this.ul=this.gj=15;this.Ub=16;this.Vb=4;this.wl=11;this.vl=18;this.tl=24;this.Cb=4;this.xl=2;this.hj=16;this.yl=17;this.mj=18;this.zl=19;this.lj=5;this.nj=6;this.El=2;this.Dl=8;this.Bl=9;this.pj=this.oj=this.Al=this.Cl=10;this.dl=80;this.fl=144;this.cl=86;this.el=154;this.hl=101;this.jl=165;this.gl=107;this.il=171;this.Gl=70;this.Il=113;this.Fl=76;this.Hl=124;this.ll=80;this.nl=128;this.kl=86;this.ml=134;this.og=3;this.ng=16;this.uj=10;this.tj=8;this.Jl=51;this.ic=8;this.Kl=17;this.Ll=36;this.qc=
|
||||
11;this.Ml=16;this.pg=10;this.Pb=2;this.aj=18;this.bj=9-this.Pb;this.cj=17-this.Pb;this.ij=12;this.jj=9-this.Pb;this.kj=13-this.Pb;this.qj=18;this.rj=9-this.Pb;this.sj=17-this.Pb;this.vj=15;this.wj=9-this.Pb;this.xj=15-this.Pb;this.Bj=11;this.Cj=9-this.Pb;this.Dj=10-this.Pb;this.Nl=8;this.Ql=12;this.Ol=18;this.Pl=17;this.Rl=15;this.zj=8;this.yj=20;this.Aj=2;this.Gj=3;this.qg=9;this.Fj=5;this.Ej=11;this.Ij=4;this.Hj=17;this.Sl=11;this.Sa=$b.slice();80186<=this.Fa&&(this.pf=31,this.Sa[15]=ac,this.Sa[96]=
|
||||
bc,this.Sa[97]=cc,this.Sa[98]=dc,this.Sa[99]=ac,this.Sa[100]=ac,this.Sa[101]=ac,this.Sa[102]=ac,this.Sa[103]=ac,this.Sa[104]=ec,this.Sa[105]=fc,this.Sa[106]=gc,this.Sa[107]=hc,this.Sa[108]=ic,this.Sa[109]=jc,this.Sa[110]=kc,this.Sa[111]=lc,this.Sa[192]=mc,this.Sa[193]=nc,this.Sa[200]=oc,this.Sa[201]=pc,this.Sa[241]=qc,rc[7]=sc,tc[7]=sc,80286<=this.Fa&&(this.gk=2,this.Jg=0,this.Sa[15]=uc,this.Sa[99]=vc,this.Sa[84]=wc,this.P=this.ga=this.fa=this.ta=this.aa=this.Lj=0,this.W=this.V=1,this.Ie=3,this.Tk=
|
||||
14,this.Uk=16,this.Tb=2,this.hc=this.sb=7,this.Eh=0,this.Yk=7,this.$k=13,this.bl=7,this.al=11,this.Zk=16,this.Wk=3,this.dj=6,this.Xk=2,this.Vk=13,this.ej=this.fj=5,this.mg=2,this.lg=7,this.pl=23,this.ql=0,this.rl=1,this.sl=3,this.ol=17,this.gj=7,this.ul=11,this.Ub=7,this.Vb=3,this.wl=7,this.vl=11,this.tl=15,this.Cb=2,this.xl=3,this.hj=7,this.zl=this.mj=this.yl=8,this.nj=this.lj=4,this.El=2,this.Dl=3,this.Bl=5,this.Cl=2,this.Al=3,this.oj=5,this.pj=3,this.dl=14,this.fl=22,this.cl=17,this.el=25,this.hl=
|
||||
17,this.jl=25,this.gl=20,this.il=28,this.Gl=13,this.Il=21,this.Fl=16,this.Hl=24,this.ll=13,this.nl=21,this.kl=16,this.ml=24,this.og=2,this.ng=7,this.tj=this.uj=5,this.Jl=19,this.Kl=this.ic=5,this.Ll=17,this.qc=3,this.Ml=5,this.pg=3,this.Pb=0,this.aj=8,this.bj=5,this.cj=9,this.jj=this.ij=5,this.kj=4,this.rj=this.qj=5,this.sj=4,this.vj=7,this.wj=5,this.xj=8,this.Bj=3,this.Cj=4,this.Dj=3,this.Ql=this.Nl=11,this.Pl=this.Ol=15,this.Rl=7,this.zj=5,this.yj=8,this.Aj=0,this.Gj=2,this.qg=6,this.Fj=3,this.Ej=
|
||||
6,this.Ij=3,this.Sl=this.Hj=5));this.Lg=[];this.Mg=[];this.Oc=this.ah=0;this.kh=this.Ai=!1;this.Aa=[];this.ue=this.Ib=this.rb=this.eb=this.ye=0;this.T=this.Mm;this.U=this.Nm;this.N=this.Un;this.O=this.Vn;this.Q=this.qp;this.R=this.rp;xc(this)}y(yb,Zb);k=Zb.prototype;k.Ni=function(a,b,c,d,e){this.Aa=a;this.ue=this.Ib=b;this.rb=c;this.eb=d;this.ye=e};k.reset=function(){this.Ob&&this.Ab();xc(this);Ab(this);this.jd=!1};
|
||||
function xc(a){a.G=0;a.B=0;a.I=0;a.J=0;a.Y=0;a.H=0;a.F=0;a.D=0;a.ad=65520;a.dd=0;a.te=1023;a.Jc={Mj:0,oa:0,ab:0,vh:-1};a.ua=new Nb(a,"CS");a.Eb=new Nb(a,"DS");a.wb=new Nb(a,"SS");a.Za=new Nb(a,"ES");a.im=new Nb(a,"ZERO");yc(a,0,65535);80286<=a.Fa&&(a.Sc=a.Ye=0,a.Ld=new Nb(a,"LDT",!0),a.Ag=new Nb(a,"TSS",!0),a.Qb=new Nb(a,"VER",!0),yc(a,65520,61440),a.ua.Ua=16711680);zc(a,0);Ac(a);a.mb=0;a.Db=a.ug=-1;a.Ug=0;a.ha=a.Ka=-1;a.C=a.Eb;a.M=a.wb;a.$=a.wa=0}
|
||||
k.Gk=function(){var a=this.G+this.B+this.I+this.J+this.Y+this.H+this.F+this.D|0;return a=a+this.qa+this.ua.oa+this.Eb.oa+this.wb.oa+this.Za.oa+Bc(this)|0};function Cc(a,b,c,d){void 0!==d&&(void 0===a.Lg[b]&&(a.Lg[b]=[]),a.Lg[b].push([c,d]))}function Dc(a,b){a.Ai&&E(a.X,a.X.ck)&&(Ec(a.X,b,a.Ba),Fc(a,a.Ba,function(a,c){return function(d){Gc(a.X,b,d,F(a)-c)}}(a,F(a))));var c=a.Lg[b];if(void 0!==c)for(var d=0;d<c.length;d++)if(!c[d][1].call(c[d][0],a.Ba))return!1;return!0}
|
||||
function Fc(a,b,c){void 0!==c&&(null==a.Mg[b]&&a.ah++,a.Mg[b]=c)}function Hc(a,b){var c=a.Mg[b];null!=c&&(c(--a.ah),delete a.Mg[b])}function Ac(a,b){void 0===b&&(b=!!(a.ad&1));Ic=b?Jc:Kc;Pb(a.ua,b);Pb(a.Eb,b);Pb(a.wb,b);Pb(a.Za,b)}
|
||||
k.save=function(){var a=new H(this);a.set(0,[this.G,this.B,this.I,this.J,this.Y,this.H,this.F,this.D]);a.set(1,[this.qa,this.ua.save(),this.Eb.save(),this.wb.save(),this.Za.save(),Bc(this),null!=this.Sc?[this.ad,this.Sc,this.Ye,this.dd,this.te,this.Ld.save(),this.Ag.save()]:null]);a.set(2,[this.C.xg,this.M.xg,this.$,this.wa,this.nb,this.ha,this.Ka]);a.set(3,[this.zh,this.Ke,this.Gd]);a.set(4,fb(this.na));return a.data()};
|
||||
k.restore=function(a){var b;b=a[0];this.G=b[0];this.B=b[1];this.I=b[2];this.J=b[3];this.Y=b[4];this.H=b[5];this.F=b[6];this.D=b[7];b=a[1];this.ua.restore(b[1]);this.Eb.restore(b[2]);this.wb.restore(b[3]);this.Za.restore(b[4]);zc(this,b[5]);var c=b[6];c&&c.length&&(this.ad=c[0],this.Sc=c[1],this.Ye=c[2],this.dd=c[3],this.te=c[4],this.Ld.restore(c[5]),this.Ag.restore(c[6]),Ac(this));I(this,b[0]);b=a[2];this.C=Lc(this,b[0]);this.M=Lc(this,b[1]);this.$=b[2];this.wa=b[3];this.nb=b[4];this.ha=b[5];this.Ka=
|
||||
b[6];b=a[3];this.zh=b[0];this.Ke=b[1];Hb(this,b[2]);a:{b=this.na;a=a[4];for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.ok){for(var f=0,g=Array(b.ok),h=0;h<e.length-1;)for(var m=e[h++],n=e[h++];m--;)g[f++]=n;e=g}f=b.Aa[d];if(!f||!f.restore(e)){w("Unable to restore memory block "+d);b=!1;break a}}void 0!==a[c]&&Ya(b,a[c]);b=!0}return b};
|
||||
function Lc(a,b){switch(b){case "CS":return a.ua;case "DS":return a.Eb;case "SS":return a.wb;case "ES":return a.Za;case "ZERO":return a.fm;default:return[0,b,0,0,""]}}function Mc(a,b){var c;if(a.ad&1){if(c=a.dd+(b<<3),c+7<=a.te){a.Jc.Jj=a.Ia(c);a.Jc.oa=a.Ia(c+2);a.Jc.ab=a.Ia(c+4);switch(a.Jc.ab&7936){case 1536:a.Jc.vh=-17153;break;case 1792:a.Jc.vh=-16641;break;default:return!1}return!0}}else if(c=a.dd+(b<<2),c+7<=a.te)return a.Jc.Jj=a.Ia(c),a.Jc.oa=a.Ia(c+2),a.Jc.vh=-769,!0;return!1}
|
||||
k.save=function(){var a=new H(this);a.set(0,[this.G,this.B,this.I,this.J,this.Y,this.H,this.F,this.D]);a.set(1,[this.qa,this.ua.save(),this.Eb.save(),this.wb.save(),this.Za.save(),Bc(this),null!=this.Sc?[this.ad,this.Sc,this.Ye,this.dd,this.te,this.Ld.save(),this.Ag.save()]:null]);a.set(2,[this.C.xg,this.M.xg,this.$,this.wa,this.mb,this.ha,this.Ka]);a.set(3,[this.zh,this.Ke,this.Gd]);a.set(4,fb(this.na));return a.data()};
|
||||
k.restore=function(a){var b;b=a[0];this.G=b[0];this.B=b[1];this.I=b[2];this.J=b[3];this.Y=b[4];this.H=b[5];this.F=b[6];this.D=b[7];b=a[1];this.ua.restore(b[1]);this.Eb.restore(b[2]);this.wb.restore(b[3]);this.Za.restore(b[4]);zc(this,b[5]);var c=b[6];c&&c.length&&(this.ad=c[0],this.Sc=c[1],this.Ye=c[2],this.dd=c[3],this.te=c[4],this.Ld.restore(c[5]),this.Ag.restore(c[6]),Ac(this));I(this,b[0]);b=a[2];this.C=Lc(this,b[0]);this.M=Lc(this,b[1]);this.$=b[2];this.wa=b[3];this.mb=b[4];this.ha=b[5];this.Ka=
|
||||
b[6];b=a[3];this.zh=b[0];this.Ke=b[1];Hb(this,b[2]);a:{b=this.na;a=a[4];for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.rk){for(var f=0,g=Array(b.rk),h=0;h<e.length-1;)for(var m=e[h++],n=e[h++];m--;)g[f++]=n;e=g}f=b.Aa[d];if(!f||!f.restore(e)){w("Unable to restore memory block "+d);b=!1;break a}}void 0!==a[c]&&Ya(b,a[c]);b=!0}return b};
|
||||
function Lc(a,b){switch(b){case "CS":return a.ua;case "DS":return a.Eb;case "SS":return a.wb;case "ES":return a.Za;case "ZERO":return a.im;default:return[0,b,0,0,""]}}function Mc(a,b){var c;if(a.ad&1){if(c=a.dd+(b<<3),c+7<=a.te){a.Jc.Mj=a.Ia(c);a.Jc.oa=a.Ia(c+2);a.Jc.ab=a.Ia(c+4);switch(a.Jc.ab&7936){case 1536:a.Jc.vh=-17153;break;case 1792:a.Jc.vh=-16641;break;default:return!1}return!0}}else if(c=a.dd+(b<<2),c+7<=a.te)return a.Jc.Mj=a.Ia(c),a.Jc.oa=a.Ia(c+2),a.Jc.vh=-769,!0;return!1}
|
||||
function Nc(a,b){a.Ba=a.ua.load(b)+a.qa;a.$|=a.Jg}function Oc(a,b){a.Eb.load(b);a.$|=a.Jg}function Pc(a,b){a.wb.load(b);a.$|=4}function Tc(a,b){a.Za.load(b);a.$|=a.Jg}function I(a,b){a.Ba=a.ua.Ua+(a.qa=b&65535)}function yc(a,b,c){a.Ba=a.ua.load(c)+(a.qa=b)}function J(a,b){a.Ba=a.ua.Ua+(a.qa=a.qa+b&65535)}function Uc(a){return a.Z&a.da?1:0}function Vc(a){return Mb[a.ja&255]?4:0}function Wc(a){return(a.ja^a.ma)&16?16:0}function Xc(a){return a.Z&a.da-1?0:64}function Yc(a){return a.ja&a.da>>1?128:0}
|
||||
function Zc(a){return(a.ja^a.ma^a.ja>>1)&a.da>>1?2048:0}function $c(a){a.Z&=~a.da}function ad(a){a.ma=a.ja&16|a.ma&-17}function bd(a){a.Z|=a.da-1}function cd(a){Yc(a)&&(a.ja^=a.da>>1|a.da>>2,a.ma^=32896)}function dd(a){a.ja&=~a.da;a.ma=a.ja&32896|a.ma&-32897}function ed(a){a.Z|=a.da}function fd(a){a.ma=~(a.ja&16)&16|a.ma&-17}function gd(a){a.Z&=~(a.da-1)}function hd(a){Yc(a)||(a.ja^=a.da>>1|a.da>>2,a.ma^=32896)}function id(a){a.ja|=a.da;a.ma=a.ja&32896|a.ma&-32897}
|
||||
function Bc(a){return a.xa&-2262|Uc(a)|Vc(a)|Wc(a)|Xc(a)|Yc(a)|Zc(a)}function zc(a,b){a.da=256;a.Z=a.ja=a.ma=0;b&1&&ed(a);b&4||(a.ja|=1);b&16&&(a.ma|=16);b&64||bd(a);b&128&&hd(a);b&2048&&id(a);a.xa=a.xa&-1793|b&1792|a.dk;a.xa&256&&(a.nb|=2,a.$|=4)}
|
||||
function Bc(a){return a.xa&-2262|Uc(a)|Vc(a)|Wc(a)|Xc(a)|Yc(a)|Zc(a)}function zc(a,b){a.da=256;a.Z=a.ja=a.ma=0;b&1&&ed(a);b&4||(a.ja|=1);b&16&&(a.ma|=16);b&64||bd(a);b&128&&hd(a);b&2048&&id(a);a.xa=a.xa&-1793|b&1792|a.gk;a.xa&256&&(a.mb|=2,a.$|=4)}
|
||||
k.xb=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.sa[c]=d;e=!0;break;default:e=yb.prototype.xb.call(this,a,b,c,d)}return e};k.ub=function(a){return this.Aa[(a&this.Ib)>>this.rb].sc(a&this.eb)};
|
||||
k.Ia=function(a){var b=a&this.eb;a=(a&this.Ib)>>this.rb;this.A-=this.Ij;return b!=this.eb?this.Aa[a].Wl(b):this.Aa[a++].sc(b)|this.Aa[a&this.ye].sc(0)<<8};k.bd=function(a,b){this.Aa[(a&this.Ib)>>this.rb].Dc(a&this.eb,b&255)};k.Nd=function(a,b){var c=a&this.eb,d=(a&this.Ib)>>this.rb;this.A-=this.Ij;c!=this.eb?this.Aa[d].im(c,b&65535):(this.Aa[d++].Dc(c,b&255),this.Aa[d&this.ye].Dc(0,b>>8&255))};k.Jm=function(a,b){this.zg=a;this.ha=a.Wc(this.rg=b,0);return this.$&1?0:this.ub(this.ha)};
|
||||
k.Km=function(a,b){this.zg=a;this.ha=a.Wc(this.rg=b,1);return this.$&1?0:this.Ia(this.ha)};k.Rn=function(a,b){this.zg=a;this.Ka=this.ha=a.Wc(this.rg=b,0);return this.$&1?0:this.ub(this.ha)};k.Sn=function(a,b){this.zg=a;this.Ka=this.ha=a.Wc(this.rg=b,1);return this.$&1?0:this.Ia(this.ha)};k.np=function(a){this.$&2||this.bd(this.zg.Yb(this.rg,1),a)};k.op=function(a){this.$&2||this.Nd(this.zg.Yb(this.rg,2),a)};k.ea=function(){var a=this.ub(this.Ba);this.Ba=this.ua.Ua+(this.qa=this.qa+1&65535);return a};
|
||||
k.Ia=function(a){var b=a&this.eb;a=(a&this.Ib)>>this.rb;this.A-=this.Lj;return b!=this.eb?this.Aa[a].Zl(b):this.Aa[a++].sc(b)|this.Aa[a&this.ye].sc(0)<<8};k.bd=function(a,b){this.Aa[(a&this.Ib)>>this.rb].Dc(a&this.eb,b&255)};k.Nd=function(a,b){var c=a&this.eb,d=(a&this.Ib)>>this.rb;this.A-=this.Lj;c!=this.eb?this.Aa[d].lm(c,b&65535):(this.Aa[d++].Dc(c,b&255),this.Aa[d&this.ye].Dc(0,b>>8&255))};k.Mm=function(a,b){this.zg=a;this.ha=a.Wc(this.rg=b,0);return this.$&1?0:this.ub(this.ha)};
|
||||
k.Nm=function(a,b){this.zg=a;this.ha=a.Wc(this.rg=b,1);return this.$&1?0:this.Ia(this.ha)};k.Un=function(a,b){this.zg=a;this.Ka=this.ha=a.Wc(this.rg=b,0);return this.$&1?0:this.ub(this.ha)};k.Vn=function(a,b){this.zg=a;this.Ka=this.ha=a.Wc(this.rg=b,1);return this.$&1?0:this.Ia(this.ha)};k.qp=function(a){this.$&2||this.bd(this.zg.Yb(this.rg,1),a)};k.rp=function(a){this.$&2||this.Nd(this.zg.Yb(this.rg,2),a)};k.ea=function(){var a=this.ub(this.Ba);this.Ba=this.ua.Ua+(this.qa=this.qa+1&65535);return a};
|
||||
k.L=function(){var a=this.ub(this.Ba)<<24>>24;this.Ba=this.ua.Ua+(this.qa=this.qa+1&65535);return a&65535};k.K=function(){var a=this.Ia(this.Ba);this.Ba=this.ua.Ua+(this.qa=this.qa+2&65535);return a};k.Ja=function(){var a=this.Y;this.Y=this.Y+2&65535;return this.Ia(this.wb.Wc(a,1))};function K(a,b){var c=a.Y=a.Y-2&65535;a.Nd(a.wb.Yb(c,1),b)}
|
||||
k.eh=function(){G(this,"AX",this.G);G(this,"BX",this.B);G(this,"CX",this.I);G(this,"DX",this.J);G(this,"SP",this.Y);G(this,"BP",this.H);G(this,"SI",this.F);G(this,"DI",this.D);G(this,"CS",this.ua.oa);G(this,"DS",this.Eb.oa);G(this,"SS",this.wb.oa);G(this,"ES",this.Za.oa);G(this,"IP",this.qa);var a=Bc(this);G(this,"PS",a);G(this,"C",a&1?1:0,1);G(this,"P",a&4?1:0,1);G(this,"A",a&16?1:0,1);G(this,"Z",a&64?1:0,1);G(this,"S",a&128?1:0,1);G(this,"T",a&256?1:0,1);G(this,"I",a&512?1:0,1);G(this,"D",a&1024?
|
||||
1:0,1);G(this,"O",a&2048?1:0,1);this.sa.speed&&(this.sa.speed.innerHTML=this.Ob&&this.ld?this.ld.toFixed(2)+"Mhz":"Stopped")};
|
||||
k.wf=function(a){this.kh=!0;this.yi=a&&this.X&&jd(this.X);this.Oc=this.A=a;this.ka&&Lb(this.ka);a||!this.X||E(this.X,this.X.Te)||(this.$|=4);do{var b=this.$&240;if(b)this.wa|=b;else if(this.Fh=this.Ba,this.ha=this.Ka=-1,this.C=this.Eb,this.M=this.wb,this.wa=this.$&256,this.nb){a:{if(!(this.$&4))if(this.nb&1&&this.xa&512){if(b=kd(this.ka),-1<=b&&(this.nb&=-2,0<=b)){this.nb&=-5;ld.call(this,b,null,11);b=!0;break a}}else if(this.nb&2){this.nb&=-3;ld.call(this,1,null,11);b=!0;break a}if(b=this.nb&8){for(var b=
|
||||
this.ka,c=!1,d=0;d<b.$a;d++)for(var e=b.$a[d],f=0;f<e.Gb.length;f++){var g=e.Gb[f];g.Fd||(md(b,g),g.Fd||(c=!0))}b=!c}b&&(this.nb&=-9);b=!1}if(b&&!a){this.$=0;break}if(this.nb&4){this.$=this.A=0;break}}if(this.yi&&nd(this.X,this.Ba)){this.Ab();break}this.$=0;this.Sa[this.ea()].call(this)}while(0<this.A);return this.kh?this.Oc-this.A:void 0===this.kh?0:-1};k.Qa=function(a){this.X&&E(this.X,this.X.Fg)&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Zb(d);Oa(d,c)}});function od(a,b){this.ma=a^b;this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=a+b)&255}function pd(a,b){this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=this.ma=a|b)&255}
|
||||
function qd(a,b){this.ma=a^b;this.Z=this.ja=a+b+(this.Z&this.da?1:0);this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return this.Z&255}function rd(a,b){this.ma=a^b;this.Z=this.ja=a-b-(this.Z&this.da?1:0);this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return this.Z&255}function sd(a,b){this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=this.ma=a&b)&255}
|
||||
function td(a,b){this.ma=a^b;this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=a-b)&255}function ud(a,b){this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=this.ma=a^b)&255}function vd(a,b){this.ma=a^b;this.da=256;this.Z=this.ja=a-b;this.A-=0>this.Ka?0>this.ha?this.Tb:this.aj:this.sb;this.$|=2;return a}
|
||||
function wd(a,b){this.ma=a^b;this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=a+b)&65535}function xd(a,b){this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=this.ma=a|b)&65535}function yd(a,b){this.ma=a^b;this.Z=this.ja=a+b+(this.Z&this.da?1:0);this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return this.Z&65535}
|
||||
function zd(a,b){this.ma=a^b;this.Z=this.ja=a-b-(this.Z&this.da?1:0);this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return this.Z&65535}function Ad(a,b){this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=this.ma=a&b)&65535}function Bd(a,b){this.ma=a^b;this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=a-b)&65535}
|
||||
function Cd(a,b){this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.gc;return(this.Z=this.ja=this.ma=a^b)&65535}function Dd(a,b){this.ma=a^b;this.da=65536;this.Z=this.ja=a-b;this.A-=0>this.Ka?0>this.ha?this.Tb:this.aj:this.sb;this.$|=2;return a}function Ed(a,b){this.Z=this.Z&this.da-1|(a&b?this.da:0);(a^a>>1)&b>>1?id(this):dd(this)}function Fd(a,b){var c=a;if(b){var d,e=b&7;e?c=(d=a<<e|a>>8-e)&255:d=a<<8;Ed.call(this,d,256)}return c}
|
||||
k.wf=function(a){this.kh=!0;this.Ai=a&&this.X&&jd(this.X);this.Oc=this.A=a;this.ka&&Lb(this.ka);a||!this.X||E(this.X,this.X.Te)||(this.$|=4);do{var b=this.$&240;if(b)this.wa|=b;else if(this.Hh=this.Ba,this.ha=this.Ka=-1,this.C=this.Eb,this.M=this.wb,this.wa=this.$&256,this.mb){a:{if(!(this.$&4))if(this.mb&1&&this.xa&512){if(b=kd(this.ka),-1<=b&&(this.mb&=-2,0<=b)){this.mb&=-5;ld.call(this,b,null,11);b=!0;break a}}else if(this.mb&2){this.mb&=-3;ld.call(this,1,null,11);b=!0;break a}if(b=this.mb&8){for(var b=
|
||||
this.ka,c=!1,d=0;d<b.$a;d++)for(var e=b.$a[d],f=0;f<e.Gb.length;f++){var g=e.Gb[f];g.Fd||(md(b,g),g.Fd||(c=!0))}b=!c}b&&(this.mb&=-9);b=!1}if(b&&!a){this.$=0;break}if(this.mb&4){this.$=this.A=0;break}}if(this.Ai&&nd(this.X,this.Ba)){this.Ab();break}this.$=0;this.Sa[this.ea()].call(this)}while(0<this.A);return this.kh?this.Oc-this.A:void 0===this.kh?0:-1};k.Qa=function(a){this.X&&E(this.X,this.X.Fg)&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Zb(d);Oa(d,c)}});function od(a,b){this.ma=a^b;this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=a+b)&255}function pd(a,b){this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=this.ma=a|b)&255}
|
||||
function qd(a,b){this.ma=a^b;this.Z=this.ja=a+b+(this.Z&this.da?1:0);this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return this.Z&255}function rd(a,b){this.ma=a^b;this.Z=this.ja=a-b-(this.Z&this.da?1:0);this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return this.Z&255}function sd(a,b){this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=this.ma=a&b)&255}
|
||||
function td(a,b){this.ma=a^b;this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=a-b)&255}function ud(a,b){this.da=256;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=this.ma=a^b)&255}function vd(a,b){this.ma=a^b;this.da=256;this.Z=this.ja=a-b;this.A-=0>this.Ka?0>this.ha?this.Tb:this.dj:this.sb;this.$|=2;return a}
|
||||
function wd(a,b){this.ma=a^b;this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=a+b)&65535}function xd(a,b){this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=this.ma=a|b)&65535}function yd(a,b){this.ma=a^b;this.Z=this.ja=a+b+(this.Z&this.da?1:0);this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return this.Z&65535}
|
||||
function zd(a,b){this.ma=a^b;this.Z=this.ja=a-b-(this.Z&this.da?1:0);this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return this.Z&65535}function Ad(a,b){this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=this.ma=a&b)&65535}function Bd(a,b){this.ma=a^b;this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=a-b)&65535}
|
||||
function Cd(a,b){this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Tb:this.sb:this.hc;return(this.Z=this.ja=this.ma=a^b)&65535}function Dd(a,b){this.ma=a^b;this.da=65536;this.Z=this.ja=a-b;this.A-=0>this.Ka?0>this.ha?this.Tb:this.dj:this.sb;this.$|=2;return a}function Ed(a,b){this.Z=this.Z&this.da-1|(a&b?this.da:0);(a^a>>1)&b>>1?id(this):dd(this)}function Fd(a,b){var c=a;if(b){var d,e=b&7;e?c=(d=a<<e|a>>8-e)&255:d=a<<8;Ed.call(this,d,256)}return c}
|
||||
function Gd(a,b){var c=a;if(b){var d,e=b&15;e?c=(d=a<<e|a>>16-e)&65535:d=a<<16;Ed.call(this,d,65536)}return c}function Hd(a,b){var c=a;if(b){var d,c=b&7,c=d=(a>>c|a<<8-c)&255;d&128&&(d|=256);Ed.call(this,d,256)}return c}function Id(a,b){var c=a;if(b){var d,c=b&15,c=d=(a>>c|a<<16-c)&65535;d&32768&&(d|=65536);Ed.call(this,d,65536)}return c}
|
||||
function Jd(a,b){var c=a;if(b){var d;(d=(b&this.pf)%9)?(d=a<<d|(this.Z&this.da?1:0)<<d-1|a>>9-d,c=d&255):d=a|(this.Z&this.da?1:0)<<8;Ed.call(this,d,256)}return c}function Kd(a,b){var c=a;if(b){var d;(d=(b&this.pf)%17)?(d=a<<d|(this.Z&this.da?1:0)<<d-1|a>>17-d,c=d&65535):d=a|(this.Z&this.da?1:0)<<16;Ed.call(this,d,65536)}return c}function Ld(a,b){var c=a;b&&(c=(b&this.pf)%9,c=a>>c|(this.Z&this.da?1:0)<<8-c|a<<9-c,Ed.call(this,c,256),c&=255);return c}
|
||||
function Md(a,b){var c=a;b&&(c=(b&this.pf)%17,c=a>>c|(this.Z&this.da?1:0)<<16-c|a<<17-c,Ed.call(this,c,65536),c&=65535);return c}function Nd(a,b){var c=a;b&&(c=8<b?this.Z=this.ja=0:(this.Z=this.ja=a<<b)&255,this.ma=0,this.da=256);return c}function Od(a,b){var c=a;b&&(c=16<b?this.Z=this.ja=0:(this.Z=this.ja=a<<b)&65535,this.ma=0,this.da=65536);return c}
|
||||
function Pd(a,b){if(b){var c=8<b?0:a>>b-1;this.Z=this.ja=c>>1;this.Z=c&1?this.Z|256:this.Z&-257;this.ma=a^this.Z;this.da=256;a=this.Z}return a&255}function Qd(a,b){if(b){var c=16<b?0:a>>b-1;this.Z=this.ja=c>>1;this.Z=c&1?this.Z|65536:this.Z&-65537;this.ma=a^this.Z;this.da=65536;a=this.Z}return a&65535}function Rd(a,b){if(b){8<b&&(b=9);var c=a<<24>>24>>b-1;this.Z=this.ja=c>>1;this.Z=c&1?this.Z|256:this.Z&-257;this.ma=a^this.Z;this.da=256;a=this.Z}return a&255}
|
||||
function Sd(a,b){if(b){16<b&&(b=17);var c=a<<16>>16>>b-1;this.Z=this.ja=c>>1;this.Z=c&1?this.Z|65536:this.Z&-65537;this.ma=a^this.Z;this.da=65536;a=this.Z}return a&65535}function Td(){this.A-=0>this.ha?2:this.Ol;return 1}function Ud(){var a=this.I&this.pf;this.A-=(0>this.ha?this.wj:this.vj)+(a<<this.xj);return a}function Vd(){var a=this.ea();this.A-=(0>this.ha?this.wj:this.vj)+(a<<this.xj);return a}function Wd(){return null}function $d(a){Yb.call(this,13,0);return a}
|
||||
function Sd(a,b){if(b){16<b&&(b=17);var c=a<<16>>16>>b-1;this.Z=this.ja=c>>1;this.Z=c&1?this.Z|65536:this.Z&-65537;this.ma=a^this.Z;this.da=65536;a=this.Z}return a&65535}function Td(){this.A-=0>this.ha?2:this.Rl;return 1}function Ud(){var a=this.I&this.pf;this.A-=(0>this.ha?this.zj:this.yj)+(a<<this.Aj);return a}function Vd(){var a=this.ea();this.A-=(0>this.ha?this.zj:this.yj)+(a<<this.Aj);return a}function Wd(){return null}function $d(a){Yb.call(this,13,0);return a}
|
||||
function sc(a){ac.call(this);return a}function L(a){M.call(this);return a}
|
||||
var ae=[od,pd,qd,rd,sd,td,ud,vd],be=[wd,xd,yd,zd,Ad,Bd,Cd,Dd],ce=[function(a,b){this.A-=0>this.Ka?this.hc:this.Hl;return b},$d,$d,$d,$d,$d,$d,$d],de=[function(a,b){this.A-=0>this.Ka?this.zl:this.xl;return b},L,L,L,L,L,L,L],ee=[Fd,Hd,Jd,Ld,Nd,Pd,L,Rd],fe=[Gd,Id,Kd,Md,Od,Qd,L,Sd],he=[function(a,b){b=this.ea();this.Z=this.ja=this.ma=a&b;this.da=256;this.A-=0>this.ha?this.Cj:this.Bj;this.$|=2;return a},L,function(a){this.A-=0>this.ha?this.og:this.ng;return a^255},function(a,b){b=0;this.ma=a^b;this.da=
|
||||
256;this.A-=0>this.ha?this.og:this.ng;return(this.Z=this.ja=b-a)&255},function(a){this.G=this.Db=(this.Z=(this.G&255)*a)&65535;this.ma=this.ja=this.Z;this.da=256;this.G&65280?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.Dl:this.Cl;this.$|=2;return a},function(a){var b=(this.G<<24>>24)*(a<<24>>24);this.G=this.Db=b&65535;this.Z=this.ma=this.ja=b;this.da=256;127<b||-128>b?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.il:this.hl;this.$|=2;return a},function(a){if(!a)return ge.call(this),
|
||||
a;var b=this.G/a;if(255<b)return ge.call(this),a;this.Db=this.G=b&255|(this.G%a&255)<<8;this.ja=this.ma=this.Z=b|256;this.da=256;this.A-=0>this.ha?this.al:this.$k;this.$|=2;return a},function(a){if(!a)return ge.call(this),a;var b=(this.G<<16>>16)/(a<<24>>24);if(b>b<<24>>24&65535)return ge.call(this),a;this.Db=this.G=b&255|((this.G<<16>>16)%(a<<24>>24)&255)<<8;this.ja=this.ma=this.Z=b|256;this.da=256;this.A-=0>this.ha?this.el:this.dl;this.$|=2;return a}],ie=[function(a,b){b=this.K();this.Z=this.ja=
|
||||
this.ma=a&b;this.da=65536;this.A-=0>this.ha?this.Cj:this.Bj;this.$|=2;return a},L,function(a){this.A-=0>this.ha?this.og:this.ng;return a^65535},function(a,b){b=0;this.ma=a^b;this.da=65536;this.A-=0>this.ha?this.og:this.ng;return(this.Z=this.ja=b-a)&65535},function(a){this.Db=this.G=(this.Z=this.G*a)&65535;this.ug=this.J=this.Z>>16&65535;this.ma=this.ja=this.Z;this.da=65536;this.J?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.Fl:this.El;this.$|=2;return a},function(a){var b=(this.G<<
|
||||
16>>16)*(a<<16>>16);this.G=this.Db=b&65535;this.J=this.ug=b>>16&65535;this.Z=this.ma=this.ja=b;this.da=65536;32767<b||-32768>b?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.kl:this.jl;this.$|=2;return a},function(a,b){if(!a)return ge.call(this),a;b=this.G+65536*this.J;var c=Math.floor(b/a);if(65536<=c)return ge.call(this),a;this.Db=this.G=c&65535;this.ug=this.J=b%a&65535;this.ja=this.ma=this.Z=c|65536;this.da=65536;this.A-=0>this.ha?this.cl:this.bl;this.$|=2;return a},function(a,
|
||||
b){if(!a)return ge.call(this),a;var c=a<<16>>16;b=this.J<<16|this.G;var d=Math.floor(b/c);if(d!=(d&65535)<<16>>16)return ge.call(this),a;this.Db=this.G=d&65535;this.ug=this.J=b%c&65535;this.ja=this.ma=this.Z=d|65536;this.da=65536;this.A-=0>this.ha?this.gl:this.fl;this.$|=2;return a}],rc=[function(a){this.ma=a;a=(this.ja=a+1)&255;this.Z=a|(this.Z&this.da?1:0)<<8;this.da=256;this.A-=0>this.ha?this.mg:this.lg;return a},function(a){this.ma=a;a=(this.ja=a-1)&255;this.Z=a|(this.Z&this.da?1:0)<<8;this.da=
|
||||
256;this.A-=0>this.ha?this.mg:this.lg;return a},L,L,L,L,L,L],tc=[function(a){this.ma=a;a=(this.ja=a+1)&65535;this.Z=a|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=0>this.ha?this.mg:this.lg;return a},function(a){this.ma=a;a=(this.ja=a-1)&65535;this.Z=a|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=0>this.ha?this.mg:this.lg;return a},function(a){K(this,this.qa);I(this,a);this.A-=0>this.ha?this.Zk:this.Yk;this.$|=2;return a},function(a){if(0>this.ha)return L.call(this,a);K(this,this.ua.oa);K(this,
|
||||
this.qa);yc(this,a,this.Ia(this.ha+2));this.A-=this.Wk;this.$|=2;return a},function(a){I(this,a);this.A-=0>this.ha?this.tl:this.sl;this.$|=2;return a},function(a){if(0>this.ha)return L.call(this,a);yc(this,a,this.Ia(this.ha+2));this.A-=this.ql;this.$|=2;return a},function(a){var b=a;this.$&512&&(a=a-2&65535,80286>this.Fa&&(b=a));K(this,b);this.A-=0>this.ha?this.pc:this.Jl;this.$|=2;return a},$d],je=[Fd,Hd,Jd,Ld,Nd,Pd,L,Rd],ke=[Gd,Id,Kd,Md,Od,Qd,L,Sd];
|
||||
function le(a,b){this.A-=0>this.Ka?0>this.ha?this.Bl:this.Al:this.yl;return b}function me(){return le.call(this,0,this.Db)}function ne(a,b){this.Z=this.ja=this.ma=a&b;this.da=256;this.A-=0>this.Ka?0>this.ha?this.Dj:this.qg:this.qg;this.$|=2;return a}function oe(a,b){this.Z=this.ja=this.ma=a&b;this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Dj:this.qg:this.qg;this.$|=2;return a}
|
||||
function pe(a,b){var c=(b<<16>>16)*(this.ea()<<24>>24);this.Z=this.ma=this.ja=c;this.da=256;32767<c||-32768>c?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?21:24;return c&65535}function qe(a,b){var c=(b<<16>>16)*(this.K()<<16>>16);this.Z=this.ma=this.ja=c;this.da=65536;32767<c||-32768>c?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?21:24;return c&65535}function re(a){return a}function se(a){if(0>this.ha)return M.call(this),a;this.A-=this.ul;return this.ha}
|
||||
function te(a,b){if(0>this.ha)return M.call(this),a;Oc(this,this.Ia(this.ha+2));this.A-=this.ej;return b}function ue(a,b){if(0>this.ha)return M.call(this),a;Tc(this,this.Ia(this.ha+2));this.A-=this.ej;return b}function ve(a){if(0>this.ha)return ac.call(this),a;var b=a<<16>>16,c=this.Ia(this.ha)<<16>>16,d=this.Ia(this.ha+2)<<16>>16;this.A-=this.Sk;if(b<c||b>d)I(this,this.Fh-this.ua.Ua),ld.call(this,5,null,0);this.$|=2;return a}
|
||||
var ae=[od,pd,qd,rd,sd,td,ud,vd],be=[wd,xd,yd,zd,Ad,Bd,Cd,Dd],ce=[function(a,b){this.A-=0>this.Ka?this.ic:this.Kl;return b},$d,$d,$d,$d,$d,$d,$d],de=[function(a,b){this.A-=0>this.Ka?this.Cl:this.Al;return b},L,L,L,L,L,L,L],ee=[Fd,Hd,Jd,Ld,Nd,Pd,L,Rd],fe=[Gd,Id,Kd,Md,Od,Qd,L,Sd],he=[function(a,b){b=this.ea();this.Z=this.ja=this.ma=a&b;this.da=256;this.A-=0>this.ha?this.Fj:this.Ej;this.$|=2;return a},L,function(a){this.A-=0>this.ha?this.og:this.ng;return a^255},function(a,b){b=0;this.ma=a^b;this.da=
|
||||
256;this.A-=0>this.ha?this.og:this.ng;return(this.Z=this.ja=b-a)&255},function(a){this.G=this.Db=(this.Z=(this.G&255)*a)&65535;this.ma=this.ja=this.Z;this.da=256;this.G&65280?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.Gl:this.Fl;this.$|=2;return a},function(a){var b=(this.G<<24>>24)*(a<<24>>24);this.G=this.Db=b&65535;this.Z=this.ma=this.ja=b;this.da=256;127<b||-128>b?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.ll:this.kl;this.$|=2;return a},function(a){if(!a)return ge.call(this),
|
||||
a;var b=this.G/a;if(255<b)return ge.call(this),a;this.Db=this.G=b&255|(this.G%a&255)<<8;this.ja=this.ma=this.Z=b|256;this.da=256;this.A-=0>this.ha?this.dl:this.cl;this.$|=2;return a},function(a){if(!a)return ge.call(this),a;var b=(this.G<<16>>16)/(a<<24>>24);if(b>b<<24>>24&65535)return ge.call(this),a;this.Db=this.G=b&255|((this.G<<16>>16)%(a<<24>>24)&255)<<8;this.ja=this.ma=this.Z=b|256;this.da=256;this.A-=0>this.ha?this.hl:this.gl;this.$|=2;return a}],ie=[function(a,b){b=this.K();this.Z=this.ja=
|
||||
this.ma=a&b;this.da=65536;this.A-=0>this.ha?this.Fj:this.Ej;this.$|=2;return a},L,function(a){this.A-=0>this.ha?this.og:this.ng;return a^65535},function(a,b){b=0;this.ma=a^b;this.da=65536;this.A-=0>this.ha?this.og:this.ng;return(this.Z=this.ja=b-a)&65535},function(a){this.Db=this.G=(this.Z=this.G*a)&65535;this.ug=this.J=this.Z>>16&65535;this.ma=this.ja=this.Z;this.da=65536;this.J?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.Il:this.Hl;this.$|=2;return a},function(a){var b=(this.G<<
|
||||
16>>16)*(a<<16>>16);this.G=this.Db=b&65535;this.J=this.ug=b>>16&65535;this.Z=this.ma=this.ja=b;this.da=65536;32767<b||-32768>b?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?this.nl:this.ml;this.$|=2;return a},function(a,b){if(!a)return ge.call(this),a;b=this.G+65536*this.J;var c=Math.floor(b/a);if(65536<=c)return ge.call(this),a;this.Db=this.G=c&65535;this.ug=this.J=b%a&65535;this.ja=this.ma=this.Z=c|65536;this.da=65536;this.A-=0>this.ha?this.fl:this.el;this.$|=2;return a},function(a,
|
||||
b){if(!a)return ge.call(this),a;var c=a<<16>>16;b=this.J<<16|this.G;var d=Math.floor(b/c);if(d!=(d&65535)<<16>>16)return ge.call(this),a;this.Db=this.G=d&65535;this.ug=this.J=b%c&65535;this.ja=this.ma=this.Z=d|65536;this.da=65536;this.A-=0>this.ha?this.jl:this.il;this.$|=2;return a}],rc=[function(a){this.ma=a;a=(this.ja=a+1)&255;this.Z=a|(this.Z&this.da?1:0)<<8;this.da=256;this.A-=0>this.ha?this.mg:this.lg;return a},function(a){this.ma=a;a=(this.ja=a-1)&255;this.Z=a|(this.Z&this.da?1:0)<<8;this.da=
|
||||
256;this.A-=0>this.ha?this.mg:this.lg;return a},L,L,L,L,L,L],tc=[function(a){this.ma=a;a=(this.ja=a+1)&65535;this.Z=a|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=0>this.ha?this.mg:this.lg;return a},function(a){this.ma=a;a=(this.ja=a-1)&65535;this.Z=a|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=0>this.ha?this.mg:this.lg;return a},function(a){K(this,this.qa);I(this,a);this.A-=0>this.ha?this.bl:this.al;this.$|=2;return a},function(a){if(0>this.ha)return L.call(this,a);K(this,this.ua.oa);K(this,
|
||||
this.qa);yc(this,a,this.Ia(this.ha+2));this.A-=this.Zk;this.$|=2;return a},function(a){I(this,a);this.A-=0>this.ha?this.wl:this.vl;this.$|=2;return a},function(a){if(0>this.ha)return L.call(this,a);yc(this,a,this.Ia(this.ha+2));this.A-=this.tl;this.$|=2;return a},function(a){var b=a;this.$&512&&(a=a-2&65535,80286>this.Fa&&(b=a));K(this,b);this.A-=0>this.ha?this.qc:this.Ml;this.$|=2;return a},$d],je=[Fd,Hd,Jd,Ld,Nd,Pd,L,Rd],ke=[Gd,Id,Kd,Md,Od,Qd,L,Sd];
|
||||
function le(a,b){this.A-=0>this.Ka?0>this.ha?this.El:this.Dl:this.Bl;return b}function me(){return le.call(this,0,this.Db)}function ne(a,b){this.Z=this.ja=this.ma=a&b;this.da=256;this.A-=0>this.Ka?0>this.ha?this.Gj:this.qg:this.qg;this.$|=2;return a}function oe(a,b){this.Z=this.ja=this.ma=a&b;this.da=65536;this.A-=0>this.Ka?0>this.ha?this.Gj:this.qg:this.qg;this.$|=2;return a}
|
||||
function pe(a,b){var c=(b<<16>>16)*(this.ea()<<24>>24);this.Z=this.ma=this.ja=c;this.da=256;32767<c||-32768>c?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?21:24;return c&65535}function qe(a,b){var c=(b<<16>>16)*(this.K()<<16>>16);this.Z=this.ma=this.ja=c;this.da=65536;32767<c||-32768>c?(ed(this),id(this)):($c(this),dd(this));this.A-=0>this.ha?21:24;return c&65535}function re(a){return a}function se(a){if(0>this.ha)return M.call(this),a;this.A-=this.xl;return this.ha}
|
||||
function te(a,b){if(0>this.ha)return M.call(this),a;Oc(this,this.Ia(this.ha+2));this.A-=this.hj;return b}function ue(a,b){if(0>this.ha)return M.call(this),a;Tc(this,this.Ia(this.ha+2));this.A-=this.hj;return b}function ve(a){if(0>this.ha)return ac.call(this),a;var b=a<<16>>16,c=this.Ia(this.ha)<<16>>16,d=this.Ia(this.ha+2)<<16>>16;this.A-=this.Vk;if(b<c||b>d)I(this,this.Hh-this.ua.Ua),ld.call(this,5,null,0);this.$|=2;return a}
|
||||
function we(a,b){this.A-=10+(0>this.ha?0:1);if((a&3)<(b&3))return a=a&-4|b&3,gd(this),a;bd(this);return a}function xe(a,b){this.A-=14+(0>this.ha?0:2);if(0<=this.Qb.load(b,!0)&&this.Qb.Mc>=(this.ua.oa&3)&&this.Qb.Mc>=(b&3))return gd(this),this.Qb.ab&65280;bd(this);return a}function ye(a,b){this.A-=14+(0>this.ha?0:2);if(b&65528&&0<=this.Qb.load(b,!0)&&(3072==(this.Qb.ab&3072)||this.Qb.Mc>=(this.ua.oa&3))&&this.Qb.Mc>=(b&3))return gd(this),this.Qb.Nc;bd(this);return a}
|
||||
function ze(a,b){if(0>this.ha){switch(this.Ug&7){case 0:this.G=this.G&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.J=this.J&-256|a;break;case 3:this.B=this.B&-256|a;break;case 4:this.G=this.G&255|a<<8;break;case 5:this.I=this.I&255|a<<8;break;case 6:this.J=this.J&255|a<<8;break;case 7:this.B=this.B&255|a<<8}this.A-=this.Fj}else this.Ka=this.ha,this.Q(a),this.A-=this.Ej;return b}
|
||||
function Ae(a,b){if(0>this.ha){switch(this.Ug&7){case 0:this.G=a;break;case 1:this.I=a;break;case 2:this.J=a;break;case 3:this.B=a;break;case 4:this.Y=a;break;case 5:this.H=a;break;case 6:this.F=a;break;case 7:this.D=a}this.A-=this.Fj}else this.Ka=this.ha,this.R(a),this.A-=this.Ej;return b}function ld(a,b,c){Mc(this,a)&&(K(this,Bc(this)),this.xa&=this.Jc.vh,K(this,this.ua.oa),K(this,this.qa),null!=b&&K(this,b),yc(this,this.Jc.Jj,this.Jc.oa),this.A-=this.ml+c)}
|
||||
function ge(){I(this,this.Fh-this.ua.Ua);ld.call(this,0,null,2)}function Yb(a,b){this.X&&E(this.X,this.X.nm)&&this.X.message("Fault 0x"+r(a)+(null!=b?" (0x"+u(b)+")":"")+" on opcode 0x"+r(bb(this.na,this.Ba))+" at "+da(this.qa,this.ua.oa));80186<=this.Fa&&(I(this,this.Fh-this.ua.Ua),ld.call(this,a,b,0))}function ac(){Yb.call(this,6);this.Ab()}function M(){I(this,this.Fh-this.ua.Ua);Sa(this,"Undefined opcode 0x"+r(bb(this.na,this.Ba))+" at "+da(this.qa,this.ua.oa));this.Ab()}
|
||||
function ze(a,b){if(0>this.ha){switch(this.Ug&7){case 0:this.G=this.G&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.J=this.J&-256|a;break;case 3:this.B=this.B&-256|a;break;case 4:this.G=this.G&255|a<<8;break;case 5:this.I=this.I&255|a<<8;break;case 6:this.J=this.J&255|a<<8;break;case 7:this.B=this.B&255|a<<8}this.A-=this.Ij}else this.Ka=this.ha,this.Q(a),this.A-=this.Hj;return b}
|
||||
function Ae(a,b){if(0>this.ha){switch(this.Ug&7){case 0:this.G=a;break;case 1:this.I=a;break;case 2:this.J=a;break;case 3:this.B=a;break;case 4:this.Y=a;break;case 5:this.H=a;break;case 6:this.F=a;break;case 7:this.D=a}this.A-=this.Ij}else this.Ka=this.ha,this.R(a),this.A-=this.Hj;return b}function ld(a,b,c){Mc(this,a)&&(K(this,Bc(this)),this.xa&=this.Jc.vh,K(this,this.ua.oa),K(this,this.qa),null!=b&&K(this,b),yc(this,this.Jc.Mj,this.Jc.oa),this.A-=this.pl+c)}
|
||||
function ge(){I(this,this.Hh-this.ua.Ua);ld.call(this,0,null,2)}function Yb(a,b){this.X&&E(this.X,this.X.qm)&&this.X.message("Fault 0x"+r(a)+(null!=b?" (0x"+u(b)+")":"")+" on opcode 0x"+r(bb(this.na,this.Ba))+" at "+da(this.qa,this.ua.oa));80186<=this.Fa&&(I(this,this.Hh-this.ua.Ua),ld.call(this,a,b,0))}function ac(){Yb.call(this,6);this.Ab()}function M(){I(this,this.Hh-this.ua.Ua);Sa(this,"Undefined opcode 0x"+r(bb(this.na,this.Ba))+" at "+da(this.qa,this.ua.oa));this.Ab()}
|
||||
function Be(a){a=a.call(this,this.G&255,this.G&255);this.G=this.G&-256|a}function Ce(a){a=a.call(this,this.G&255,this.I&255);this.G=this.G&-256|a}function De(a){a=a.call(this,this.G&255,this.J&255);this.G=this.G&-256|a}function Ee(a){a=a.call(this,this.G&255,this.B&255);this.G=this.G&-256|a}function Fe(a){a=a.call(this,this.G&255,this.G>>8);this.G=this.G&-256|a}function Ge(a){a=a.call(this,this.G&255,this.I>>8);this.G=this.G&-256|a}
|
||||
function He(a){a=a.call(this,this.G&255,this.J>>8);this.G=this.G&-256|a}function Ie(a){a=a.call(this,this.G&255,this.B>>8);this.G=this.G&-256|a}function Je(a){a=a.call(this,this.I&255,this.G&255);this.I=this.I&-256|a}function Ke(a){a=a.call(this,this.I&255,this.I&255);this.I=this.I&-256|a}function Le(a){a=a.call(this,this.I&255,this.J&255);this.I=this.I&-256|a}function Me(a){a=a.call(this,this.I&255,this.B&255);this.I=this.I&-256|a}
|
||||
function Ne(a){a=a.call(this,this.I&255,this.G>>8);this.I=this.I&-256|a}function Oe(a){a=a.call(this,this.I&255,this.I>>8);this.I=this.I&-256|a}function Pe(a){a=a.call(this,this.I&255,this.J>>8);this.I=this.I&-256|a}function Qe(a){a=a.call(this,this.I&255,this.B>>8);this.I=this.I&-256|a}function Re(a){a=a.call(this,this.J&255,this.G&255);this.J=this.J&-256|a}function Se(a){a=a.call(this,this.J&255,this.I&255);this.J=this.J&-256|a}
|
||||
|
|
@ -374,22 +374,22 @@ b){this.B=a[7].call(this,this.B,b.call(this))},function(a,b){this.Y=a[7].call(th
|
|||
M,M,M,M,M,M,M,ac,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,
|
||||
M,M],Jc=[function(){this.A-=2+(0>this.ha?0:1);return this.Ld.oa},function(){this.A-=2+(0>this.ha?0:1);return this.Ag.oa},function(a){this.$|=2;this.Ld.load(a);this.A-=17+(0>this.ha?0:2);return a},function(a){this.$|=2;this.Ag.load(a);this.A-=17+(0>this.ha?0:2);return a},function(a){this.$|=2;this.A-=14+(0>this.ha?0:2);if(0<=this.Qb.load(a,!0)&&2048!=(this.Qb.ab&2560)&&(3072==(this.Qb.ab&3072)||this.Qb.Mc>=(this.ua.oa&3)&&this.Qb.Mc>=(a&3)))return gd(this),a;bd(this);return a},function(a){this.$|=
|
||||
2;this.A-=14+(0>this.ha?0:2);if(0<=this.Qb.load(a,!0)&&512==(this.Qb.ab&2560)&&this.Qb.Mc>=(this.ua.oa&3)&&this.Qb.Mc>=(a&3))return gd(this),a;bd(this);return a},L,L],Kc=[sc,sc,sc,sc,sc,sc,L,L],Ic=Kc,ch=[function(a){0>this.ha?ac.call(this):(this.Nd(this.ha+2,this.Sc),this.bd(this.ha+4,this.Sc>>16),a=this.Ye-this.Sc,this.A-=11);return a},function(a){0>this.ha?ac.call(this):(this.Nd(this.ha+2,this.dd),this.bd(this.ha+4,this.dd>>16),a=this.te-this.dd,this.A-=12);return a},function(a){0>this.ha?ac.call(this):
|
||||
(this.Sc=this.Ia(this.ha+2)|this.ub(this.ha+4)<<16,this.Ye=this.Sc+a,this.$|=2,this.A-=11);return a},function(a){0>this.ha?ac.call(this):(this.dd=this.Ia(this.ha+2)|this.ub(this.ha+4)<<16,this.te=this.dd+a,this.$|=2,this.A-=12);return a},function(){this.A-=2+(0>this.ha?0:1);return this.ad},L,function(a){this.ad=this.ad&65520|a&-65521;this.A-=3+(0>this.ha?0:3);this.ad&1&&Ac(this,!0);this.$|=2;return a},L];function uc(){dh[this.ea()].call(this)}function wc(){K(this,this.Y);this.A-=this.pc}
|
||||
function bc(){var a=this.Y;K(this,this.G);K(this,this.I);K(this,this.J);K(this,this.B);K(this,a);K(this,this.H);K(this,this.F);K(this,this.D);this.A-=this.Il}function cc(){this.D=this.Ja();this.F=this.Ja();this.H=this.Ja();this.Y+=2;this.B=this.Ja();this.J=this.Ja();this.I=this.Ja();this.G=this.Ja();this.A-=this.Gl}function dc(){N[this.ea()].call(this,ve)}function vc(){Zg[this.ea()].call(this,we)}function ec(){K(this,this.K());this.A-=this.pc}function fc(){N[this.ea()].call(this,qe)}
|
||||
function gc(){K(this,this.ea());this.A-=this.pc}function hc(){N[this.ea()].call(this,pe)}function ic(){var a=1,b=0,c=5;this.wa&192&&(a=this.I,b=1,this.wa&256&&(c=4));if(a--){var d=jb(this.na,this.J,this.Ba-b-1);this.bd(this.Za.Yb(this.D,0),d);this.D=this.D+(this.xa&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}}
|
||||
(this.Sc=this.Ia(this.ha+2)|this.ub(this.ha+4)<<16,this.Ye=this.Sc+a,this.$|=2,this.A-=11);return a},function(a){0>this.ha?ac.call(this):(this.dd=this.Ia(this.ha+2)|this.ub(this.ha+4)<<16,this.te=this.dd+a,this.$|=2,this.A-=12);return a},function(){this.A-=2+(0>this.ha?0:1);return this.ad},L,function(a){this.ad=this.ad&65520|a&-65521;this.A-=3+(0>this.ha?0:3);this.ad&1&&Ac(this,!0);this.$|=2;return a},L];function uc(){dh[this.ea()].call(this)}function wc(){K(this,this.Y);this.A-=this.qc}
|
||||
function bc(){var a=this.Y;K(this,this.G);K(this,this.I);K(this,this.J);K(this,this.B);K(this,a);K(this,this.H);K(this,this.F);K(this,this.D);this.A-=this.Ll}function cc(){this.D=this.Ja();this.F=this.Ja();this.H=this.Ja();this.Y+=2;this.B=this.Ja();this.J=this.Ja();this.I=this.Ja();this.G=this.Ja();this.A-=this.Jl}function dc(){N[this.ea()].call(this,ve)}function vc(){Zg[this.ea()].call(this,we)}function ec(){K(this,this.K());this.A-=this.qc}function fc(){N[this.ea()].call(this,qe)}
|
||||
function gc(){K(this,this.ea());this.A-=this.qc}function hc(){N[this.ea()].call(this,pe)}function ic(){var a=1,b=0,c=5;this.wa&192&&(a=this.I,b=1,this.wa&256&&(c=4));if(a--){var d=jb(this.na,this.J,this.Ba-b-1);this.bd(this.Za.Yb(this.D,0),d);this.D=this.D+(this.xa&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}}
|
||||
function jc(){var a=1,b=0,c=5;this.wa&192&&(a=this.I,b=1,this.wa&256&&(c=4));if(a--){var d=this.Ba-b-1,d=jb(this.na,this.J,d)|jb(this.na,this.J,d)<<8;this.Nd(this.Za.Yb(this.D,1),d);this.D=this.D+(this.xa&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}}
|
||||
function kc(){var a=1,b=0,c=5;this.wa&192&&(a=this.I,b=1,this.wa&256&&(c=4));if(a--){var d=this.ub(this.Eb.Wc(this.F,0));this.F=this.F+(this.xa&1024?-1:1)&65535;this.A-=c;this.I-=b;nb(this.na,this.J,d,this.Ba-b-1);a&&(J(this,-2),this.$|=256)}}
|
||||
function lc(){var a=1,b=0,c=5;this.wa&192&&(a=this.I,b=1,this.wa&256&&(c=4));if(a--){var d=this.Ia(this.Eb.Wc(this.F,1));this.F=this.F+(this.xa&1024?-2:2)&65535;this.A-=c;this.I-=b;b=this.Ba-b-1;nb(this.na,this.J,d&255,b);nb(this.na,this.J,d>>8,b);a&&(J(this,-2),this.$|=256)}}function eh(){var a=this.L();Zc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function fh(){var a=this.L();Zc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}
|
||||
function gh(){var a=this.L();Uc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function hh(){var a=this.L();Uc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}function ih(){var a=this.L();Xc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function jh(){var a=this.L();Xc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}function kh(){var a=this.L();Uc(this)||Xc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}
|
||||
function lh(){var a=this.L();Uc(this)||Xc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}function mh(){var a=this.L();Yc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function nh(){var a=this.L();Yc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}function oh(){var a=this.L();Vc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function ph(){var a=this.L();Vc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}
|
||||
function qh(){var a=this.L();!Yc(this)!=!Zc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function rh(){var a=this.L();!Yc(this)==!Zc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function sh(){var a=this.L();Xc(this)||!Yc(this)!=!Zc(this)?(I(this,this.qa+a),this.A-=this.Ub):this.A-=this.Vb}function th(){var a=this.L();Xc(this)||!Yc(this)!=!Zc(this)?this.A-=this.Vb:(I(this,this.qa+a),this.A-=this.Ub)}
|
||||
function uh(){ah[this.ea()].call(this,ae,this.ea);this.A-=0>this.Ka?1:this.Ch}function mc(){ah[this.ea()].call(this,je,Vd)}function nc(){bh[this.ea()].call(this,ke,Vd)}function vh(){var a=this.K();I(this,this.Ja());this.Y=this.Y+a&65535;this.A-=this.Nl}function wh(){I(this,this.Ja());this.A-=this.Kl}
|
||||
function oc(){var a=this.K(),b=this.ea()&31;this.A-=11;K(this,this.H);var c=this.Y;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.H=this.H-2&65535,K(this,this.Ia(this.wb.Wc(this.H,1)));K(this,c)}this.H=c;this.Y=this.Y-a&65535}function pc(){this.Y=this.H;this.H=this.Ja();this.A-=5}function xh(){var a=this.K();yc(this,this.Ja(),this.Ja());this.Y=this.Y+a&65535;this.ah&&Hc(this,this.Ba);this.A-=this.Ml}function yh(){yc(this,this.Ja(),this.Ja());this.A-=this.Ll}
|
||||
function uh(){ah[this.ea()].call(this,ae,this.ea);this.A-=0>this.Ka?1:this.Eh}function mc(){ah[this.ea()].call(this,je,Vd)}function nc(){bh[this.ea()].call(this,ke,Vd)}function vh(){var a=this.K();I(this,this.Ja());this.Y=this.Y+a&65535;this.A-=this.Ql}function wh(){I(this,this.Ja());this.A-=this.Nl}
|
||||
function oc(){var a=this.K(),b=this.ea()&31;this.A-=11;K(this,this.H);var c=this.Y;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.H=this.H-2&65535,K(this,this.Ia(this.wb.Wc(this.H,1)));K(this,c)}this.H=c;this.Y=this.Y-a&65535}function pc(){this.Y=this.H;this.H=this.Ja();this.A-=5}function xh(){var a=this.K();yc(this,this.Ja(),this.Ja());this.Y=this.Y+a&65535;this.ah&&Hc(this,this.Ba);this.A-=this.Pl}function yh(){yc(this,this.Ja(),this.Ja());this.A-=this.Ol}
|
||||
function zh(){N[this.ea()].call(this,re);this.A-=8}function Ah(){this.$|=36;this.A-=this.Pb}function qc(){M.call(this)}
|
||||
var $b=[function(){var a=this.ea();Yg[a].call(this,od)},function(){Zg[this.ea()].call(this,wd)},function(){$g[this.ea()].call(this,od)},function(){N[this.ea()].call(this,wd)},function(){this.G=this.G&-256|od.call(this,this.G&255,this.ea());this.A--},function(){this.G=wd.call(this,this.G,this.K());this.A--},function(){K(this,this.Za.oa);this.A-=this.pg},function(){Tc(this,this.Ja());this.A-=this.hc},function(){Yg[this.ea()].call(this,pd)},function(){Zg[this.ea()].call(this,xd)},function(){$g[this.ea()].call(this,
|
||||
pd)},function(){N[this.ea()].call(this,xd)},function(){this.G=this.G&-256|pd.call(this,this.G&255,this.ea());this.A--},function(){this.G=xd.call(this,this.G,this.K());this.A--},function(){K(this,this.ua.oa);this.A-=this.pg},function(){Nc(this,this.Ja());this.A-=this.hc},function(){Yg[this.ea()].call(this,qd)},function(){Zg[this.ea()].call(this,yd)},function(){$g[this.ea()].call(this,qd)},function(){N[this.ea()].call(this,yd)},function(){this.G=this.G&-256|qd.call(this,this.G&255,this.ea());this.A--},
|
||||
function(){this.G=yd.call(this,this.G,this.K());this.A--},function(){K(this,this.wb.oa);this.A-=this.pg},function(){Pc(this,this.Ja());this.A-=this.hc},function(){Yg[this.ea()].call(this,rd)},function(){Zg[this.ea()].call(this,zd)},function(){$g[this.ea()].call(this,rd)},function(){N[this.ea()].call(this,zd)},function(){this.G=this.G&-256|rd.call(this,this.G&255,this.ea());this.A--},function(){this.G=zd.call(this,this.G,this.K());this.A--},function(){K(this,this.Eb.oa);this.A-=this.pg},function(){Oc(this,
|
||||
this.Ja());this.A-=this.hc},function(){Yg[this.ea()].call(this,sd)},function(){Zg[this.ea()].call(this,Ad)},function(){$g[this.ea()].call(this,sd)},function(){N[this.ea()].call(this,Ad)},function(){this.G=this.G&-256|sd.call(this,this.G&255,this.ea());this.A--},function(){this.G=Ad.call(this,this.G,this.K());this.A--},function(){this.$|=20;this.C=this.M=this.Za;this.A-=this.Pb},function(){var a=this.G&255,b=Wc(this),c=this.Z&this.da;if(9<(a&15)||b)a+=6,b=!0;if(159<a||c)a+=96,c=!0;this.G=this.G&-256|
|
||||
var $b=[function(){var a=this.ea();Yg[a].call(this,od)},function(){Zg[this.ea()].call(this,wd)},function(){$g[this.ea()].call(this,od)},function(){N[this.ea()].call(this,wd)},function(){this.G=this.G&-256|od.call(this,this.G&255,this.ea());this.A--},function(){this.G=wd.call(this,this.G,this.K());this.A--},function(){K(this,this.Za.oa);this.A-=this.pg},function(){Tc(this,this.Ja());this.A-=this.ic},function(){Yg[this.ea()].call(this,pd)},function(){Zg[this.ea()].call(this,xd)},function(){$g[this.ea()].call(this,
|
||||
pd)},function(){N[this.ea()].call(this,xd)},function(){this.G=this.G&-256|pd.call(this,this.G&255,this.ea());this.A--},function(){this.G=xd.call(this,this.G,this.K());this.A--},function(){K(this,this.ua.oa);this.A-=this.pg},function(){Nc(this,this.Ja());this.A-=this.ic},function(){Yg[this.ea()].call(this,qd)},function(){Zg[this.ea()].call(this,yd)},function(){$g[this.ea()].call(this,qd)},function(){N[this.ea()].call(this,yd)},function(){this.G=this.G&-256|qd.call(this,this.G&255,this.ea());this.A--},
|
||||
function(){this.G=yd.call(this,this.G,this.K());this.A--},function(){K(this,this.wb.oa);this.A-=this.pg},function(){Pc(this,this.Ja());this.A-=this.ic},function(){Yg[this.ea()].call(this,rd)},function(){Zg[this.ea()].call(this,zd)},function(){$g[this.ea()].call(this,rd)},function(){N[this.ea()].call(this,zd)},function(){this.G=this.G&-256|rd.call(this,this.G&255,this.ea());this.A--},function(){this.G=zd.call(this,this.G,this.K());this.A--},function(){K(this,this.Eb.oa);this.A-=this.pg},function(){Oc(this,
|
||||
this.Ja());this.A-=this.ic},function(){Yg[this.ea()].call(this,sd)},function(){Zg[this.ea()].call(this,Ad)},function(){$g[this.ea()].call(this,sd)},function(){N[this.ea()].call(this,Ad)},function(){this.G=this.G&-256|sd.call(this,this.G&255,this.ea());this.A--},function(){this.G=Ad.call(this,this.G,this.K());this.A--},function(){this.$|=20;this.C=this.M=this.Za;this.A-=this.Pb},function(){var a=this.G&255,b=Wc(this),c=this.Z&this.da;if(9<(a&15)||b)a+=6,b=!0;if(159<a||c)a+=96,c=!0;this.G=this.G&-256|
|
||||
(this.Z=this.ja=a&255);this.da=65536;c&&(this.Z|=this.da);b?fd(this):ad(this);this.A-=this.Ie},function(){Yg[this.ea()].call(this,td)},function(){Zg[this.ea()].call(this,Bd)},function(){$g[this.ea()].call(this,td)},function(){N[this.ea()].call(this,Bd)},function(){this.G=this.G&-256|td.call(this,this.G&255,this.ea());this.A--},function(){this.G=Bd.call(this,this.G,this.K());this.A--},function(){this.$|=20;this.C=this.M=this.ua;this.A-=this.Pb},function(){var a=this.G&255,b=Wc(this),c=this.Z&this.da;
|
||||
if(9<(a&15)||b)a-=6,b=!0;if(159<a||c)a-=96,c=!0;this.G=this.G&-256|(this.Z=this.ja=a&255);this.da=65536;c&&(this.Z|=this.da);b?fd(this):ad(this);this.A-=this.Ie},function(){Yg[this.ea()].call(this,ud)},function(){Zg[this.ea()].call(this,Cd)},function(){$g[this.ea()].call(this,ud)},function(){N[this.ea()].call(this,Cd)},function(){this.G=this.G&-256|ud.call(this,this.G&255,this.ea());this.A--},function(){this.G=Cd.call(this,this.G,this.K());this.A--},function(){this.$|=20;this.C=this.M=this.wb;this.A-=
|
||||
this.Pb},function(){var a=this.G&255,b=this.G>>8,c,d=Wc(this);9<(a&15)||d?(a=a+6&15,b=b+1&255,c=d=!0):c=d=!1;this.G=b<<8|(this.Z=a);this.da=65536;c&&(this.Z|=this.da);d?fd(this):ad(this);this.A-=this.Ie},function(){Yg[this.ea()].call(this,vd)},function(){Zg[this.ea()].call(this,Dd)},function(){$g[this.ea()].call(this,vd)},function(){N[this.ea()].call(this,Dd)},function(){this.G=this.G&-256|vd.call(this,this.G&255,this.ea());this.A--},function(){this.G=Dd.call(this,this.G,this.K());this.A--},function(){this.$|=
|
||||
|
|
@ -397,250 +397,251 @@ this.Pb},function(){var a=this.G&255,b=this.G>>8,c,d=Wc(this);9<(a&15)||d?(a=a+6
|
|||
this.J=(this.ja=this.J+1)&65535;this.Z=this.J|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.B;this.B=(this.ja=this.B+1)&65535;this.Z=this.B|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.Y;this.Y=(this.ja=this.Y+1)&65535;this.Z=this.Y|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.H;this.H=(this.ja=this.H+1)&65535;this.Z=this.H|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.F;this.F=(this.ja=
|
||||
this.F+1)&65535;this.Z=this.F|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.D;this.D=(this.ja=this.D+1)&65535;this.Z=this.D|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.G;this.G=(this.ja=this.G-1)&65535;this.Z=this.G|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.I;this.I=(this.ja=this.I-1)&65535;this.Z=this.I|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.J;this.J=(this.ja=this.J-1)&65535;
|
||||
this.Z=this.J|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.B;this.B=(this.ja=this.B-1)&65535;this.Z=this.B|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.Y;this.Y=(this.ja=this.Y-1)&65535;this.Z=this.Y|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.H;this.H=(this.ja=this.H-1)&65535;this.Z=this.H|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.F;this.F=(this.ja=this.F-1)&65535;this.Z=this.F|
|
||||
(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.D;this.D=(this.ja=this.D-1)&65535;this.Z=this.D|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){K(this,this.G);this.A-=this.pc},function(){K(this,this.I);this.A-=this.pc},function(){K(this,this.J);this.A-=this.pc},function(){K(this,this.B);this.A-=this.pc},function(){K(this,this.Y-2&65535);this.A-=this.pc},function(){K(this,this.H);this.A-=this.pc},function(){K(this,this.F);this.A-=this.pc},function(){K(this,this.D);
|
||||
this.A-=this.pc},function(){this.G=this.Ja();this.A-=this.hc},function(){this.I=this.Ja();this.A-=this.hc},function(){this.J=this.Ja();this.A-=this.hc},function(){this.B=this.Ja();this.A-=this.hc},function(){this.Y=this.Ja();this.A-=this.hc},function(){this.H=this.Ja();this.A-=this.hc},function(){this.F=this.Ja();this.A-=this.hc},function(){this.D=this.Ja();this.A-=this.hc},eh,fh,gh,hh,ih,jh,kh,lh,mh,nh,oh,ph,qh,rh,sh,th,eh,fh,gh,hh,ih,jh,kh,lh,mh,nh,oh,ph,qh,rh,sh,th,uh,function(){bh[this.ea()].call(this,
|
||||
be,this.K);this.A-=0>this.Ka?1:this.Ch},uh,function(){bh[this.ea()].call(this,be,this.L);this.A-=0>this.Ka?1:this.Ch},function(){Yg[this.ea()].call(this,ne)},function(){Zg[this.ea()].call(this,oe)},function(){$g[this.Ug=this.ea()].call(this,ze)},function(){N[this.Ug=this.ea()].call(this,Ae)},function(){this.$|=1;Yg[this.ea()].call(this,le)},function(){this.$|=1;Zg[this.ea()].call(this,le)},function(){$g[this.ea()].call(this,le)},function(){N[this.ea()].call(this,le)},function(){var a=this.ea();switch((a&
|
||||
56)>>3){case 0:this.Db=this.Za.oa;break;case 1:this.Db=this.ua.oa;break;case 2:this.Db=this.wb.oa;break;case 3:this.Db=this.Eb.oa;break;default:M.call(this);return}this.$|=1;Zg[a].call(this,me)},function(){this.$|=1;this.C=this.M=this.fm;N[this.ea()].call(this,se)},function(){var a,b=this.ea(),c=(b&56)>>3;switch(c){case 0:a=this.G;break;case 2:a=this.J;break;case 3:a=this.B;break;default:if(80286<=this.Fa){ac.call(this);return}switch(c){case 1:a=this.I;break;case 4:a=this.Y;break;case 5:a=this.H;
|
||||
(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){this.ma=this.D;this.D=(this.ja=this.D-1)&65535;this.Z=this.D|(this.Z&this.da?1:0)<<16;this.da=65536;this.A-=2},function(){K(this,this.G);this.A-=this.qc},function(){K(this,this.I);this.A-=this.qc},function(){K(this,this.J);this.A-=this.qc},function(){K(this,this.B);this.A-=this.qc},function(){K(this,this.Y-2&65535);this.A-=this.qc},function(){K(this,this.H);this.A-=this.qc},function(){K(this,this.F);this.A-=this.qc},function(){K(this,this.D);
|
||||
this.A-=this.qc},function(){this.G=this.Ja();this.A-=this.ic},function(){this.I=this.Ja();this.A-=this.ic},function(){this.J=this.Ja();this.A-=this.ic},function(){this.B=this.Ja();this.A-=this.ic},function(){this.Y=this.Ja();this.A-=this.ic},function(){this.H=this.Ja();this.A-=this.ic},function(){this.F=this.Ja();this.A-=this.ic},function(){this.D=this.Ja();this.A-=this.ic},eh,fh,gh,hh,ih,jh,kh,lh,mh,nh,oh,ph,qh,rh,sh,th,eh,fh,gh,hh,ih,jh,kh,lh,mh,nh,oh,ph,qh,rh,sh,th,uh,function(){bh[this.ea()].call(this,
|
||||
be,this.K);this.A-=0>this.Ka?1:this.Eh},uh,function(){bh[this.ea()].call(this,be,this.L);this.A-=0>this.Ka?1:this.Eh},function(){Yg[this.ea()].call(this,ne)},function(){Zg[this.ea()].call(this,oe)},function(){$g[this.Ug=this.ea()].call(this,ze)},function(){N[this.Ug=this.ea()].call(this,Ae)},function(){this.$|=1;Yg[this.ea()].call(this,le)},function(){this.$|=1;Zg[this.ea()].call(this,le)},function(){$g[this.ea()].call(this,le)},function(){N[this.ea()].call(this,le)},function(){var a=this.ea();switch((a&
|
||||
56)>>3){case 0:this.Db=this.Za.oa;break;case 1:this.Db=this.ua.oa;break;case 2:this.Db=this.wb.oa;break;case 3:this.Db=this.Eb.oa;break;default:M.call(this);return}this.$|=1;Zg[a].call(this,me)},function(){this.$|=1;this.C=this.M=this.im;N[this.ea()].call(this,se)},function(){var a,b=this.ea(),c=(b&56)>>3;switch(c){case 0:a=this.G;break;case 2:a=this.J;break;case 3:a=this.B;break;default:if(80286<=this.Fa){ac.call(this);return}switch(c){case 1:a=this.I;break;case 4:a=this.Y;break;case 5:a=this.H;
|
||||
break;case 6:a=this.F;break;case 7:a=this.D}}N[b].call(this,le);switch(c){case 0:Tc(this,this.G);this.G=a;break;case 1:Nc(this,this.I);this.I=a;break;case 2:Pc(this,this.J);this.J=a;break;case 3:Oc(this,this.B);this.B=a;break;case 4:Tc(this,this.Y);this.Y=a;break;case 5:Nc(this,this.H);this.H=a;break;case 6:Pc(this,this.F);this.F=a;break;case 7:Oc(this,this.D),this.D=a}},function(){this.$|=1;bh[this.ea()].call(this,ce,this.Ja)},function(){this.A-=3},function(){var a=this.G;this.G=this.I;this.I=a;
|
||||
this.A-=3},function(){var a=this.G;this.G=this.J;this.J=a;this.A-=3},function(){var a=this.G;this.G=this.B;this.B=a;this.A-=3},function(){var a=this.G;this.G=this.Y;this.Y=a;this.A-=3},function(){var a=this.G;this.G=this.H;this.H=a;this.A-=3},function(){var a=this.G;this.G=this.F;this.F=a;this.A-=3},function(){var a=this.G;this.G=this.D;this.D=a;this.A-=3},function(){this.G=this.G<<24>>24&65535;this.A-=2},function(){this.J=this.G&32768?65535:0;this.A-=this.Uk},function(){var a=this.K(),b=this.K();
|
||||
K(this,this.ua.oa);K(this,this.qa);yc(this,a,b);this.A-=this.Xk},function(){M.call(this)},function(){K(this,Bc(this));this.A-=this.pc},function(){zc(this,this.Ja());this.A-=this.hc},function(){var a=this.G>>8;a&1?ed(this):$c(this);a&4?Vc(this)||(this.ja^=1):Vc(this)&&(this.ja^=1);a&16?fd(this):ad(this);a&64?gd(this):bd(this);a&128?hd(this):cd(this);this.A-=this.Cb},function(){this.G=this.G&255|(Bc(this)&213)<<8;this.A-=this.Cb},function(){this.G=this.G&-256|this.T(this.C,this.K());this.A-=this.lj},
|
||||
function(){this.G=this.U(this.C,this.K());this.A-=this.lj},function(){var a=this.K(),b=this.G;this.bd(this.C.Yb(a,0),b);this.A-=this.mj},function(){var a=this.K(),b=this.G;this.Nd(this.C.Yb(a,1),b);this.A-=this.mj},function(){var a=1,b=0,c=this.nj;this.wa&192&&(a=this.I,b=1,c=this.pj,this.wa&256||(this.A-=this.oj));if(a--){var d=this.xa&1024?-1:1,e=this.T(this.C,this.F);this.bd(this.Za.Yb(this.D,0),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.wa&16?-3:-2),this.$|=
|
||||
256)}},function(){var a=1,b=0,c=this.nj;this.wa&192&&(a=this.I,b=1,c=this.pj,this.wa&256||(this.A-=this.oj));if(a--){var d=this.xa&1024?-2:2,e=this.U(this.C,this.F);this.Nd(this.Za.Yb(this.D,1),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.wa&16?-3:-2),this.$|=256)}},function(){var a=1,b=0,c=this.Yi;this.wa&192&&(a=this.I,b=1,c=this.$i,this.wa&256||(this.A-=this.Zi));if(a--){var d=this.xa&1024?-1:1,e=this.T(this.C,this.F),f=this.N(this.Za,this.D);vd.call(this,
|
||||
e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.sb;this.I-=b;a&&Xc(this)==(this.wa&64)&&(J(this,this.wa&16?-3:-2),this.$|=256)}},function(){var a=1,b=0,c=this.Yi;this.wa&192&&(a=this.I,b=1,c=this.$i,this.wa&256||(this.A-=this.Zi));if(a--){var d=this.xa&1024?-2:2,e=this.U(this.C,this.F),f=this.O(this.Za,this.D);Dd.call(this,e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.sb;this.I-=b;a&&Xc(this)==(this.wa&64)&&(J(this,this.wa&16?-3:-2),this.$|=256)}},function(){this.Z=
|
||||
this.ja=this.ma=this.G&255&this.ea();this.da=256;this.A-=this.Ie},function(){this.Z=this.ja=this.ma=this.G&this.K();this.da=65536;this.A-=this.Ie},function(){var a=1,b=0,c=this.yj;this.wa&192&&(a=this.I,b=1,c=this.Aj,this.wa&256||(this.A-=this.zj));if(a--){var d=this.G;this.bd(this.Za.Yb(this.D,0),d);this.D=this.D+(this.xa&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}},function(){var a=1,b=0,c=this.yj;this.wa&192&&(a=this.I,b=1,c=this.Aj,this.wa&256||(this.A-=this.zj));if(a--){var d=
|
||||
this.G;this.Nd(this.Za.Yb(this.D,1),d);this.D=this.D+(this.xa&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}},function(){var a=1,b=0,c=this.fj;this.wa&192&&(a=this.I,b=1,c=this.hj,this.wa&256||(this.A-=this.gj));a--&&(this.G=this.G&-256|this.T(this.C,this.F),this.F=this.F+(this.xa&1024?-1:1)&65535,this.A-=c,this.I-=b,a&&(J(this,this.wa&16?-3:-2),this.$|=256))},function(){var a=1,b=0,c=this.fj;this.wa&192&&(a=this.I,b=1,c=this.hj,this.wa&256||(this.A-=this.gj));a--&&(this.G=this.U(this.C,
|
||||
this.F),this.F=this.F+(this.xa&1024?-2:2)&65535,this.A-=c,this.I-=b,a&&(J(this,this.wa&16?-3:-2),this.$|=256))},function(){var a=1,b=0,c=this.sj;this.wa&192&&(a=this.I,b=1,c=this.uj,this.wa&256||(this.A-=this.tj));a--&&(vd.call(this,this.G&255,this.N(this.Za,this.D)),this.D=this.D+(this.xa&1024?-1:1)&65535,this.A-=c-this.sb,this.I-=b,a&&Xc(this)==(this.wa&64)&&(J(this,-2),this.$|=256))},function(){var a=1,b=0,c=this.sj;this.wa&192&&(a=this.I,b=1,c=this.uj,this.wa&256||(this.A-=this.tj));a--&&(Dd.call(this,
|
||||
this.A-=3},function(){var a=this.G;this.G=this.J;this.J=a;this.A-=3},function(){var a=this.G;this.G=this.B;this.B=a;this.A-=3},function(){var a=this.G;this.G=this.Y;this.Y=a;this.A-=3},function(){var a=this.G;this.G=this.H;this.H=a;this.A-=3},function(){var a=this.G;this.G=this.F;this.F=a;this.A-=3},function(){var a=this.G;this.G=this.D;this.D=a;this.A-=3},function(){this.G=this.G<<24>>24&65535;this.A-=2},function(){this.J=this.G&32768?65535:0;this.A-=this.Xk},function(){var a=this.K(),b=this.K();
|
||||
K(this,this.ua.oa);K(this,this.qa);yc(this,a,b);this.A-=this.$k},function(){M.call(this)},function(){K(this,Bc(this));this.A-=this.qc},function(){zc(this,this.Ja());this.A-=this.ic},function(){var a=this.G>>8;a&1?ed(this):$c(this);a&4?Vc(this)||(this.ja^=1):Vc(this)&&(this.ja^=1);a&16?fd(this):ad(this);a&64?gd(this):bd(this);a&128?hd(this):cd(this);this.A-=this.Cb},function(){this.G=this.G&255|(Bc(this)&213)<<8;this.A-=this.Cb},function(){this.G=this.G&-256|this.T(this.C,this.K());this.A-=this.oj},
|
||||
function(){this.G=this.U(this.C,this.K());this.A-=this.oj},function(){var a=this.K(),b=this.G;this.bd(this.C.Yb(a,0),b);this.A-=this.pj},function(){var a=this.K(),b=this.G;this.Nd(this.C.Yb(a,1),b);this.A-=this.pj},function(){var a=1,b=0,c=this.qj;this.wa&192&&(a=this.I,b=1,c=this.sj,this.wa&256||(this.A-=this.rj));if(a--){var d=this.xa&1024?-1:1,e=this.T(this.C,this.F);this.bd(this.Za.Yb(this.D,0),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.wa&16?-3:-2),this.$|=
|
||||
256)}},function(){var a=1,b=0,c=this.qj;this.wa&192&&(a=this.I,b=1,c=this.sj,this.wa&256||(this.A-=this.rj));if(a--){var d=this.xa&1024?-2:2,e=this.U(this.C,this.F);this.Nd(this.Za.Yb(this.D,1),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.wa&16?-3:-2),this.$|=256)}},function(){var a=1,b=0,c=this.aj;this.wa&192&&(a=this.I,b=1,c=this.cj,this.wa&256||(this.A-=this.bj));if(a--){var d=this.xa&1024?-1:1,e=this.T(this.C,this.F),f=this.N(this.Za,this.D);vd.call(this,
|
||||
e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.sb;this.I-=b;a&&Xc(this)==(this.wa&64)&&(J(this,this.wa&16?-3:-2),this.$|=256)}},function(){var a=1,b=0,c=this.aj;this.wa&192&&(a=this.I,b=1,c=this.cj,this.wa&256||(this.A-=this.bj));if(a--){var d=this.xa&1024?-2:2,e=this.U(this.C,this.F),f=this.O(this.Za,this.D);Dd.call(this,e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.sb;this.I-=b;a&&Xc(this)==(this.wa&64)&&(J(this,this.wa&16?-3:-2),this.$|=256)}},function(){this.Z=
|
||||
this.ja=this.ma=this.G&255&this.ea();this.da=256;this.A-=this.Ie},function(){this.Z=this.ja=this.ma=this.G&this.K();this.da=65536;this.A-=this.Ie},function(){var a=1,b=0,c=this.Bj;this.wa&192&&(a=this.I,b=1,c=this.Dj,this.wa&256||(this.A-=this.Cj));if(a--){var d=this.G;this.bd(this.Za.Yb(this.D,0),d);this.D=this.D+(this.xa&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}},function(){var a=1,b=0,c=this.Bj;this.wa&192&&(a=this.I,b=1,c=this.Dj,this.wa&256||(this.A-=this.Cj));if(a--){var d=
|
||||
this.G;this.Nd(this.Za.Yb(this.D,1),d);this.D=this.D+(this.xa&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.$|=256)}},function(){var a=1,b=0,c=this.ij;this.wa&192&&(a=this.I,b=1,c=this.kj,this.wa&256||(this.A-=this.jj));a--&&(this.G=this.G&-256|this.T(this.C,this.F),this.F=this.F+(this.xa&1024?-1:1)&65535,this.A-=c,this.I-=b,a&&(J(this,this.wa&16?-3:-2),this.$|=256))},function(){var a=1,b=0,c=this.ij;this.wa&192&&(a=this.I,b=1,c=this.kj,this.wa&256||(this.A-=this.jj));a--&&(this.G=this.U(this.C,
|
||||
this.F),this.F=this.F+(this.xa&1024?-2:2)&65535,this.A-=c,this.I-=b,a&&(J(this,this.wa&16?-3:-2),this.$|=256))},function(){var a=1,b=0,c=this.vj;this.wa&192&&(a=this.I,b=1,c=this.xj,this.wa&256||(this.A-=this.wj));a--&&(vd.call(this,this.G&255,this.N(this.Za,this.D)),this.D=this.D+(this.xa&1024?-1:1)&65535,this.A-=c-this.sb,this.I-=b,a&&Xc(this)==(this.wa&64)&&(J(this,-2),this.$|=256))},function(){var a=1,b=0,c=this.vj;this.wa&192&&(a=this.I,b=1,c=this.xj,this.wa&256||(this.A-=this.wj));a--&&(Dd.call(this,
|
||||
this.G,this.O(this.Za,this.D)),this.D=this.D+(this.xa&1024?-2:2)&65535,this.A-=c-this.sb,this.I-=b,a&&Xc(this)==(this.wa&64)&&(J(this,-2),this.$|=256))},function(){this.G=this.G&-256|this.ea();this.A-=this.Cb},function(){this.I=this.I&-256|this.ea();this.A-=this.Cb},function(){this.J=this.J&-256|this.ea();this.A-=this.Cb},function(){this.B=this.B&-256|this.ea();this.A-=this.Cb},function(){this.G=this.G&255|this.ea()<<8;this.A-=this.Cb},function(){this.I=this.I&255|this.ea()<<8;this.A-=this.Cb},function(){this.J=
|
||||
this.J&255|this.ea()<<8;this.A-=this.Cb},function(){this.B=this.B&255|this.ea()<<8;this.A-=this.Cb},function(){this.G=this.K();this.A-=this.Cb},function(){this.I=this.K();this.A-=this.Cb},function(){this.J=this.K();this.A-=this.Cb},function(){this.B=this.K();this.A-=this.Cb},function(){this.Y=this.K();this.A-=this.Cb},function(){this.H=this.K();this.A-=this.Cb},function(){this.F=this.K();this.A-=this.Cb},function(){this.D=this.K();this.A-=this.Cb},vh,wh,vh,wh,function(){N[this.ea()].call(this,ue)},
|
||||
function(){N[this.ea()].call(this,te)},function(){this.$|=1;ah[this.ea()].call(this,de,this.ea)},function(){this.$|=1;bh[this.ea()].call(this,de,this.K)},xh,yh,xh,yh,function(){ld.call(this,3,null,this.nl)},function(){var a=this.ea();Dc(this,a)?ld.call(this,a,null,0):this.A--},function(){Zc(this)?ld.call(this,4,null,this.ol):this.A-=this.pl},function(){yc(this,this.Ja(),this.Ja());zc(this,this.Ja());this.ah&&Hc(this,this.Ba);this.A-=this.ll},function(){ah[this.ea()].call(this,ee,Td)},function(){bh[this.ea()].call(this,
|
||||
fe,Td)},function(){ah[this.ea()].call(this,ee,Ud)},function(){bh[this.ea()].call(this,fe,Ud)},function(){var a=this.ea(),b=this.G&255;this.G=(b/a&255)<<8|b%a;this.da=256;this.Z=this.ja=b;this.A-=this.Rk},function(){var a=this.ea();this.Z=this.ja=this.G=(this.G>>8)*a+this.G&255;this.da=256;this.A-=this.Qk},function(){this.G=this.G&-256|(Uc(this)?255:0);this.A-=2},function(){this.G=this.G&-256|this.T(this.C,this.B+(this.G&255)&65535);this.A-=this.Pl},zh,zh,zh,zh,zh,zh,zh,zh,function(){var a=this.L();
|
||||
(this.I=this.I-1&65535)&&this.Z&this.da-1?(I(this,this.qa+a),this.A-=this.wl):this.A-=this.ij},function(){var a=this.L();!(this.I=this.I-1&65535)||this.Z&this.da-1?this.A-=this.kj:(I(this,this.qa+a),this.A-=this.jj)},function(){var a=this.L();(this.I=this.I-1&65535)?(I(this,this.qa+a),this.A-=this.vl):this.A-=this.ij},function(){var a=this.L();this.I?this.A-=this.kj:(I(this,this.qa+a),this.A-=this.jj)},function(){var a=this.ea();this.G=this.G&-256|jb(this.na,a,this.Ba-2);this.A-=this.cj},function(){var a=
|
||||
this.ea();this.G=jb(this.na,a,this.Ba-1)|jb(this.na,a+1&65535,this.Ba-2)<<8;this.A-=this.cj},function(){var a=this.ea();nb(this.na,a,this.G&255,this.Ba-2);this.A-=this.rj},function(){var a=this.ea();nb(this.na,a,this.G&255,this.Ba-2);nb(this.na,a+1&65535,this.G>>8,this.Ba-2);this.A-=this.rj},function(){var a=this.K();K(this,this.qa);I(this,this.qa+a);this.A-=this.Vk},function(){var a=this.K();I(this,this.qa+a);this.A-=this.dj},function(){yc(this,this.K(),this.K());this.A-=this.rl},function(){var a=
|
||||
this.L();I(this,this.qa+a);this.A-=this.dj},function(){this.G=this.G&-256|jb(this.na,this.J,this.Ba-1);this.A-=this.bj},function(){this.G=jb(this.na,this.J,this.Ba-1)|jb(this.na,this.J+1&65535,this.Ba-1)<<8;this.A-=this.bj},function(){nb(this.na,this.J,this.G&255,this.Ba-1);this.A-=this.qj},function(){nb(this.na,this.J,this.G&255,this.Ba-1);nb(this.na,this.J+1&65535,this.G>>8,this.Ba-1);this.A-=this.qj},Ah,Ah,function(){this.$|=132;this.A-=this.Pb},function(){this.$|=68;this.A-=this.Pb},function(){this.nb|=
|
||||
4;this.A-=2;this.X&&jd(this.X)?(J(this,-1),this.Ab()):this.xa&512||(this.X&&J(this,-1),this.Ab())},function(){Uc(this)?$c(this):ed(this);this.A-=2},function(){this.Db=-1;ah[this.ea()].call(this,he,Wd);0<=this.Db&&(this.G=this.Db)},function(){this.Db=-1;bh[this.ea()].call(this,ie,Wd);0<=this.Db&&(this.G=this.Db,this.J=this.ug)},function(){this.Z&=~this.da;this.A-=2},function(){this.Z|=this.da;this.A-=2},function(){this.xa&=-513;this.A-=this.Tk},function(){this.xa|=512;this.$|=4;this.A-=2},function(){this.xa&=
|
||||
function(){N[this.ea()].call(this,te)},function(){this.$|=1;ah[this.ea()].call(this,de,this.ea)},function(){this.$|=1;bh[this.ea()].call(this,de,this.K)},xh,yh,xh,yh,function(){ld.call(this,3,null,this.ql)},function(){var a=this.ea();Dc(this,a)?ld.call(this,a,null,0):this.A--},function(){Zc(this)?ld.call(this,4,null,this.rl):this.A-=this.sl},function(){yc(this,this.Ja(),this.Ja());zc(this,this.Ja());this.ah&&Hc(this,this.Ba);this.A-=this.ol},function(){ah[this.ea()].call(this,ee,Td)},function(){bh[this.ea()].call(this,
|
||||
fe,Td)},function(){ah[this.ea()].call(this,ee,Ud)},function(){bh[this.ea()].call(this,fe,Ud)},function(){var a=this.ea(),b=this.G&255;this.G=(b/a&255)<<8|b%a;this.da=256;this.Z=this.ja=b;this.A-=this.Uk},function(){var a=this.ea();this.Z=this.ja=this.G=(this.G>>8)*a+this.G&255;this.da=256;this.A-=this.Tk},function(){this.G=this.G&-256|(Uc(this)?255:0);this.A-=2},function(){this.G=this.G&-256|this.T(this.C,this.B+(this.G&255)&65535);this.A-=this.Sl},zh,zh,zh,zh,zh,zh,zh,zh,function(){var a=this.L();
|
||||
(this.I=this.I-1&65535)&&this.Z&this.da-1?(I(this,this.qa+a),this.A-=this.zl):this.A-=this.lj},function(){var a=this.L();!(this.I=this.I-1&65535)||this.Z&this.da-1?this.A-=this.nj:(I(this,this.qa+a),this.A-=this.mj)},function(){var a=this.L();(this.I=this.I-1&65535)?(I(this,this.qa+a),this.A-=this.yl):this.A-=this.lj},function(){var a=this.L();this.I?this.A-=this.nj:(I(this,this.qa+a),this.A-=this.mj)},function(){var a=this.ea();this.G=this.G&-256|jb(this.na,a,this.Ba-2);this.A-=this.fj},function(){var a=
|
||||
this.ea();this.G=jb(this.na,a,this.Ba-1)|jb(this.na,a+1&65535,this.Ba-2)<<8;this.A-=this.fj},function(){var a=this.ea();nb(this.na,a,this.G&255,this.Ba-2);this.A-=this.uj},function(){var a=this.ea();nb(this.na,a,this.G&255,this.Ba-2);nb(this.na,a+1&65535,this.G>>8,this.Ba-2);this.A-=this.uj},function(){var a=this.K();K(this,this.qa);I(this,this.qa+a);this.A-=this.Yk},function(){var a=this.K();I(this,this.qa+a);this.A-=this.gj},function(){yc(this,this.K(),this.K());this.A-=this.ul},function(){var a=
|
||||
this.L();I(this,this.qa+a);this.A-=this.gj},function(){this.G=this.G&-256|jb(this.na,this.J,this.Ba-1);this.A-=this.ej},function(){this.G=jb(this.na,this.J,this.Ba-1)|jb(this.na,this.J+1&65535,this.Ba-1)<<8;this.A-=this.ej},function(){nb(this.na,this.J,this.G&255,this.Ba-1);this.A-=this.tj},function(){nb(this.na,this.J,this.G&255,this.Ba-1);nb(this.na,this.J+1&65535,this.G>>8,this.Ba-1);this.A-=this.tj},Ah,Ah,function(){this.$|=132;this.A-=this.Pb},function(){this.$|=68;this.A-=this.Pb},function(){this.mb|=
|
||||
4;this.A-=2;this.X&&jd(this.X)?(J(this,-1),this.Ab()):this.xa&512||(this.X&&J(this,-1),this.Ab())},function(){Uc(this)?$c(this):ed(this);this.A-=2},function(){this.Db=-1;ah[this.ea()].call(this,he,Wd);0<=this.Db&&(this.G=this.Db)},function(){this.Db=-1;bh[this.ea()].call(this,ie,Wd);0<=this.Db&&(this.G=this.Db,this.J=this.ug)},function(){this.Z&=~this.da;this.A-=2},function(){this.Z|=this.da;this.A-=2},function(){this.xa&=-513;this.A-=this.Wk},function(){this.xa|=512;this.$|=4;this.A-=2},function(){this.xa&=
|
||||
-1025;this.A-=2},function(){this.xa|=1024;this.A-=2},function(){ah[this.ea()].call(this,rc,Wd)},function(){bh[this.ea()].call(this,tc,Wd)}];
|
||||
function O(a){x.call(this,"ChipSet",a,O);this.Fa=a.model;this.Fa=void 0!==this.Fa?parseInt(this.Fa,10):Bh;this.Xb=0;var b=a.sw1;if(b)this.Xb=Ch(b,Dh|Eh.vm);else if(b=a.fdrives||2,this.Xb|=Fh.Uh,b--,this.Xb|=(b&3)<<Fh.Df,b=a.monitor||(this.Fa<Gh?"mono":"ega"),void 0!==Hh[b])this.Xb|=Hh[b]<<Eh.Df;this.pe=Ch(a.sw2||"11110000",0);this.Qn=this.Fa==Bh?16:64;this.Pf=this.Qf=1;this.Fa>=Gh&&(this.Pf=this.Qf=2);this.oh=a.scaleTimers||!1;this.mp=a.rtcDate;this.Ak=!1;a.sound&&window&&"webkitAudioContext"in window&&
|
||||
(this.mi=new webkitAudioContext);this.reset();this.Ta()}y(x,O);var Bh=5150,Gh=5170,Hh={none:0,tv:1,color:2,mono:3,ega:0},Fh={Uh:1,ONE:0,Rp:64,Pp:128,yp:192,Bf:192,Df:6},Dh=12,Eh={Qp:16,tp:32,vm:48,Bf:48,Df:4};k=O.prototype;
|
||||
function O(a){x.call(this,"ChipSet",a,O);this.Fa=a.model;this.Fa=void 0!==this.Fa?parseInt(this.Fa,10):Bh;this.Xb=0;var b=a.sw1;if(b)this.Xb=Ch(b,Dh|Eh.ym);else if(b=a.fdrives||2,this.Xb|=Fh.Wh,b--,this.Xb|=(b&3)<<Fh.Df,b=a.monitor||(this.Fa<Gh?"mono":"ega"),void 0!==Hh[b])this.Xb|=Hh[b]<<Eh.Df;this.pe=Ch(a.sw2||"11110000",0);this.Tn=this.Fa==Bh?16:64;this.Pf=this.Qf=1;this.Fa>=Gh&&(this.Pf=this.Qf=2);this.oh=a.scaleTimers||!1;this.pp=a.rtcDate;this.Dk=!1;a.sound&&window&&"webkitAudioContext"in window&&
|
||||
(this.oi=new webkitAudioContext);this.reset();this.Ta()}y(x,O);var Bh=5150,Gh=5170,Hh={none:0,tv:1,color:2,mono:3,ega:0},Fh={Wh:1,ONE:0,Up:64,Sp:128,Bp:192,Bf:192,Df:6},Dh=12,Eh={Tp:16,wp:32,ym:48,Bf:48,Df:4};k=O.prototype;
|
||||
k.xb=function(a,b,c,d){switch(c){case "sw1":return this.sa[c]=d,Ih(this,c,d,this.Xb,{0:this.Fa==Bh?"Bootable Floppy Drive":"Loop on POST",1:this.Fa==Bh?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Fa==Bh)return this.sa[c]=d,Ih(this,c,d,this.pe,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.sa[c]=d,!0}return!1};
|
||||
k.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.bb=C(a,"Keyboard");this.Ql=Math.round(c.Hd/1193181);ib(b,this,Jh);mb(b,this,Kh);this.Fa<Gh?(ib(b,this,Lh),mb(b,this,Mh)):(ib(b,this,Nh),mb(b,this,Oh));if(d){var e=this;Ph(d,O);Qh(d,O.Te,function(){for(var a=0;a<e.tb.length;a++){for(var b=e.tb[a],c="PIC"+a+":",d=0;d<b.pd.length;d++)c+=" IC"+(d+1)+"="+r(b.pd[d]);c+=" IMR="+r(b.vd)+" IRR="+r(b.Jb)+" ISR="+r(b.Fc);e.X.message(c)}});Qh(d,O.Ue,function(){for(var a=0;a<e.Hb.length;a++){Rh(e,
|
||||
a);var b=e.Hb[a],c="TIMER"+a+":",d=0;if(void 0!==b.gd)for(var n=0;n<=b.gd;n++)d|=b.Zb[n]<<8*n;c+=" MODE"+b.mode+" BYTES="+b.gd+" COUNT="+u(d);e.X.message(c)}});Qh(d,O.Cf,function(){for(var a="",b=0;64>b;b++){var c=13>=b?Sh(e,b):e.pa[b];a&&(a+="\n");a+="CMOS[0x"+r(b)+"]: 0x"+r(c)}e.X.message(a)})}Cc(c,26,this,this.Nn)};k.$b=function(a,b){if(!b)if(!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.Wb=function(a){return a&&this.save?this.save():!0};
|
||||
k.reset=function(a){var b;this.cd=this.Xb;this.Qe=this.pe;Th(this);this.$a=Array(this.Pf);for(b=0;b<this.Pf;b++)Uh(this,b);this.tb=Array(this.Qf);Vh(this,0,32);1<this.Qf&&Vh(this,1,160);this.ji=void 0;this.Hb=Array(3);for(b=0;b<this.Hb.length;b++)Wh(this,b);this.Of=this.hi=this.Ac=this.Wg=void 0;this.Vg=0;if(this.Fa>=Gh){this.kb=16;this.ud=0;this.Xd=16;this.Rg=0;this.ve=160;512<=Xh(this)&&(this.ve|=16);3==Yh(this)&&(this.ve|=64);this.fi=3;this.Mf=0;this.Ng=Array(7);this.we=0;a||(this.pa=Array(64));
|
||||
Zh(this,this.mp);for(a=14;46>a;a++)void 0===this.pa[a]&&(this.pa[a]=0);this.pa[20]=this.cd&(Eh.Bf|2|Fh.Uh|Fh.Bf);this.pa[16]=$h(this,0)<<4|$h(this,1);ai(this)}};
|
||||
k.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.bb=C(a,"Keyboard");this.Tl=Math.round(c.Hd/1193181);ib(b,this,Jh);mb(b,this,Kh);this.Fa<Gh?(ib(b,this,Lh),mb(b,this,Mh)):(ib(b,this,Nh),mb(b,this,Oh));if(d){var e=this;Ph(d,O);Qh(d,O.Te,function(){for(var a=0;a<e.tb.length;a++){for(var b=e.tb[a],c="PIC"+a+":",d=0;d<b.pd.length;d++)c+=" IC"+(d+1)+"="+r(b.pd[d]);c+=" IMR="+r(b.vd)+" IRR="+r(b.Jb)+" ISR="+r(b.Fc);e.X.message(c)}});Qh(d,O.Ue,function(){for(var a=0;a<e.Hb.length;a++){Rh(e,
|
||||
a);var b=e.Hb[a],c="TIMER"+a+":",d=0;if(void 0!==b.gd)for(var n=0;n<=b.gd;n++)d|=b.Zb[n]<<8*n;c+=" MODE"+b.mode+" BYTES="+b.gd+" COUNT="+u(d);e.X.message(c)}});Qh(d,O.Cf,function(){for(var a="",b=0;64>b;b++){var c=13>=b?Sh(e,b):e.pa[b];a&&(a+="\n");a+="CMOS[0x"+r(b)+"]: 0x"+r(c)}e.X.message(a)})}Cc(c,26,this,this.Qn)};k.ac=function(a,b){if(!b)if(!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.Wb=function(a){return a&&this.save?this.save():!0};
|
||||
k.reset=function(a){var b;this.cd=this.Xb;this.Qe=this.pe;Th(this);this.$a=Array(this.Pf);for(b=0;b<this.Pf;b++)Uh(this,b);this.tb=Array(this.Qf);Vh(this,0,32);1<this.Qf&&Vh(this,1,160);this.li=void 0;this.Hb=Array(3);for(b=0;b<this.Hb.length;b++)Wh(this,b);this.Of=this.ji=this.Ac=this.Wg=void 0;this.Vg=0;if(this.Fa>=Gh){this.jb=16;this.ud=0;this.Xd=16;this.Rg=0;this.ve=160;512<=Xh(this)&&(this.ve|=16);3==Yh(this)&&(this.ve|=64);this.hi=3;this.Mf=0;this.Ng=Array(7);this.we=0;a||(this.pa=Array(64));
|
||||
Zh(this,this.pp);for(a=14;46>a;a++)void 0===this.pa[a]&&(this.pa[a]=0);this.pa[20]=this.cd&(Eh.Bf|2|Fh.Wh|Fh.Bf);this.pa[16]=$h(this,0)<<4|$h(this,1);ai(this)}};
|
||||
function Zh(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.ca("CMOS date invalid ("+b+"), using "+c)):b&&a.ca("CMOS date: "+c);a.pa[0]=c.getSeconds();a.pa[1]=0;a.pa[2]=c.getMinutes();a.pa[3]=0;a.pa[4]=c.getHours();a.pa[5]=0;a.pa[6]=c.getDay()+1;a.pa[7]=c.getDate();a.pa[8]=c.getMonth()+1;c=c.getFullYear();a.pa[9]=c%100;c/=100;a.pa[50]=c%10|c/10<<4;a.eg=-1;a.pa[10]=38;a.pa[11]=2;a.pa[12]=0;a.pa[13]=128}
|
||||
function Sh(a,b){var c=a.pa[b];if(10>b){var d=!1;4!=b&&5!=b||a.pa[11]&2||(c=12>c?c?c:12:(c-=12)?c+128:140,d=!0);a.pa[11]&4||(d&&128<c&&(c-=48),c=c%10|c/10<<4)}else 10==b&&(a.pa[b]^=128);return c}function ai(a){for(var b=0,c=16;46>c;c++)b+=a.pa[c];a.pa[47]=b&255;a.pa[46]=b>>8}
|
||||
k.save=function(){var a=new H(this);a.set(0,[this.Xb,this.pe,this.cd,this.Qe]);for(var b=[],c=0;c<this.$a;c++){var d=[],e=this.$a[c];d[0]=e.ae;d[1]=e.gi;d[2]=e.lk;d[3]=e.qb;for(var f=[],g=0;g<e.Gb.length;g++){var h=[],m=e.Gb[g];h[0]=m.Fd;h[1]=m.gk;h[2]=m.Ic;h[3]=m.Rb;h[4]=m.Zb;h[5]=m.mode;h[6]=m.Xg;h[8]=m.jp;h[9]=m.kp;f[g]=h}d[4]=f;b[c]=d}a.set(1,[b]);b=[];for(c=0;c<this.tb.length;c++)d=[],e=this.tb[c],d[0]=e.jg,d[1]=e.pd,d[2]=e.Id,d[3]=e.vd,d[4]=e.Jb,d[5]=e.Fc,d[6]=e.xe,d[7]=e.Nf,b[c]=d;a.set(2,
|
||||
[b]);b=[];for(c=0;c<this.Hb.length;c++)d=[],e=this.Hb[c],d[0]=e.Ic,d[1]=e.Yc,d[2]=e.Zb,d[3]=e.Vf,d[4]=e.nk,d[5]=e.mode,d[6]=e.vg,d[7]=e.de,d[8]=e.gd,d[9]=e.kd,d[10]=e.Yf,d[11]=e.df,d[12]=e.me,b[c]=d;a.set(3,[this.ji,b]);a.set(4,[this.Wg,this.Ac,this.hi,this.Of,this.Vg]);this.Fa>=Gh&&(a.set(5,[this.kb,this.ud,this.Xd,this.Rg,this.ve,this.fi]),a.set(6,[this.Mf,this.Ng,this.we,this.pa,this.eg]));return a.data()};
|
||||
k.restore=function(a){var b,c;b=a[0];this.Xb=b[0];this.pe=b[1];this.cd=b[2];this.Qe=b[3];b=a[1];this.$a=Array(this.Pf);for(c=0;c<this.Pf;c++)Uh(this,c,1==b.length?b[0][c]:b);b=a[2];this.tb=Array(this.Qf);for(c=0;c<this.Qf;c++)Vh(this,c,0===c?32:160,b[0][c]);b=a[3];this.ji=b[0];this.Hb=Array(3);for(c=0;c<this.Hb.length;c++)Wh(this,c,b[1][c]);b=a[4];this.Wg=b[0];this.Ac=b[1];this.hi=b[2];this.Of=b[3];this.Vg=b[4];if(b=a[5])this.kb=b[0],this.ud=b[1],this.Xd=b[2],this.Rg=b[3],this.ve=b[4],this.fi=b[5];
|
||||
if(b=a[6])this.Mf=b[0],this.Ng=b[1],this.we=b[2],this.pa=b[3],this.eg=b[4],Zh(this);return!0};function Uh(a,b,c){a=a.$a[b]={};c&&5==c.length||(c=[0,void 0,void 0,0,[]]);a.ae=c[0];a.gi=c[1];a.lk=c[2];a.qb=c[3];a.Yn=b<<2;a.Gb=Array(4);for(b=0;b<a.Gb.length;b++)bi(a,b,c[4][b])}function bi(a,b,c){var d=a.Gb[b]={};if(void 0===c||8!=c.length)c=[!0,[],[],[],[]];d.ia=a;d.Gk=b;d.Fd=c[0];d.gk=c[1];d.Ic=c[2];d.Rb=c[3];d.Zb=c[4];d.mode=c[5];d.Xg=c[6];ci(d,c[8],c[9])}
|
||||
function ci(a,b,c,d){"string"==typeof b&&(b=Ma(b));b&&(a.fh=null,a.jp=b.id,a.kp=c,a.dh=b,a.Gi=b[c],a.Eh=d)}function Vh(a,b,c,d){a=a.tb[b]={};d&&8==d.length||(d=[0,[void 0,void 0,void 0,void 0]]);a.port=c;a.Up=b<<3;a.jg=d[0];a.pd=d[1];a.Id=d[2];a.vd=d[3];a.Jb=d[4];a.Fc=d[5];a.xe=d[6];a.Nf=d[7]}
|
||||
function Wh(a,b,c){a=a.Hb[b]={};if(void 0===c||13!=c.length)c=[[],[],[],[]];a.Ic=c[0];a.Yc=c[1];a.Zb=c[2];a.Vf=c[3];a.nk=c[4];a.mode=c[5];a.vg=c[6];a.de=c[7];a.gd=c[8];a.kd=c[9];a.Yf=c[10];a.df=c[11];a.me=c[12]}function Xh(a,b){return((((b?a.Xb:a.cd)&12)>>2)+1)*a.Qn+32*((b?a.pe:a.Qe)&15)}function di(a,b){var c=b?a.Xb:a.cd;return a.Fa!=Bh||c&Fh.Uh?((c&Fh.Bf)>>Fh.Df)+1:0}function $h(a,b){return b<di(a)?a.Fa<Gh?1:2:0}function Yh(a,b){return((b?a.Xb:a.cd)&Eh.Bf)>>Eh.Df}
|
||||
k.save=function(){var a=new H(this);a.set(0,[this.Xb,this.pe,this.cd,this.Qe]);for(var b=[],c=0;c<this.$a;c++){var d=[],e=this.$a[c];d[0]=e.ae;d[1]=e.ii;d[2]=e.ok;d[3]=e.qb;for(var f=[],g=0;g<e.Gb.length;g++){var h=[],m=e.Gb[g];h[0]=m.Fd;h[1]=m.jk;h[2]=m.Ic;h[3]=m.Rb;h[4]=m.Zb;h[5]=m.mode;h[6]=m.Xg;h[8]=m.mp;h[9]=m.np;f[g]=h}d[4]=f;b[c]=d}a.set(1,[b]);b=[];for(c=0;c<this.tb.length;c++)d=[],e=this.tb[c],d[0]=e.jg,d[1]=e.pd,d[2]=e.Id,d[3]=e.vd,d[4]=e.Jb,d[5]=e.Fc,d[6]=e.xe,d[7]=e.Nf,b[c]=d;a.set(2,
|
||||
[b]);b=[];for(c=0;c<this.Hb.length;c++)d=[],e=this.Hb[c],d[0]=e.Ic,d[1]=e.Yc,d[2]=e.Zb,d[3]=e.Vf,d[4]=e.qk,d[5]=e.mode,d[6]=e.vg,d[7]=e.de,d[8]=e.gd,d[9]=e.kd,d[10]=e.Yf,d[11]=e.df,d[12]=e.me,b[c]=d;a.set(3,[this.li,b]);a.set(4,[this.Wg,this.Ac,this.ji,this.Of,this.Vg]);this.Fa>=Gh&&(a.set(5,[this.jb,this.ud,this.Xd,this.Rg,this.ve,this.hi]),a.set(6,[this.Mf,this.Ng,this.we,this.pa,this.eg]));return a.data()};
|
||||
k.restore=function(a){var b,c;b=a[0];this.Xb=b[0];this.pe=b[1];this.cd=b[2];this.Qe=b[3];b=a[1];this.$a=Array(this.Pf);for(c=0;c<this.Pf;c++)Uh(this,c,1==b.length?b[0][c]:b);b=a[2];this.tb=Array(this.Qf);for(c=0;c<this.Qf;c++)Vh(this,c,0===c?32:160,b[0][c]);b=a[3];this.li=b[0];this.Hb=Array(3);for(c=0;c<this.Hb.length;c++)Wh(this,c,b[1][c]);b=a[4];this.Wg=b[0];this.Ac=b[1];this.ji=b[2];this.Of=b[3];this.Vg=b[4];if(b=a[5])this.jb=b[0],this.ud=b[1],this.Xd=b[2],this.Rg=b[3],this.ve=b[4],this.hi=b[5];
|
||||
if(b=a[6])this.Mf=b[0],this.Ng=b[1],this.we=b[2],this.pa=b[3],this.eg=b[4],Zh(this);return!0};function Uh(a,b,c){a=a.$a[b]={};c&&5==c.length||(c=[0,void 0,void 0,0,[]]);a.ae=c[0];a.ii=c[1];a.ok=c[2];a.qb=c[3];a.ao=b<<2;a.Gb=Array(4);for(b=0;b<a.Gb.length;b++)bi(a,b,c[4][b])}function bi(a,b,c){var d=a.Gb[b]={};if(void 0===c||8!=c.length)c=[!0,[],[],[],[]];d.ia=a;d.Jk=b;d.Fd=c[0];d.jk=c[1];d.Ic=c[2];d.Rb=c[3];d.Zb=c[4];d.mode=c[5];d.Xg=c[6];ci(d,c[8],c[9])}
|
||||
function ci(a,b,c,d){"string"==typeof b&&(b=Ma(b));b&&(a.fh=null,a.mp=b.id,a.np=c,a.dh=b,a.Ii=b[c],a.Gh=d)}function Vh(a,b,c,d){a=a.tb[b]={};d&&8==d.length||(d=[0,[void 0,void 0,void 0,void 0]]);a.port=c;a.Xp=b<<3;a.jg=d[0];a.pd=d[1];a.Id=d[2];a.vd=d[3];a.Jb=d[4];a.Fc=d[5];a.xe=d[6];a.Nf=d[7]}
|
||||
function Wh(a,b,c){a=a.Hb[b]={};if(void 0===c||13!=c.length)c=[[],[],[],[]];a.Ic=c[0];a.Yc=c[1];a.Zb=c[2];a.Vf=c[3];a.qk=c[4];a.mode=c[5];a.vg=c[6];a.de=c[7];a.gd=c[8];a.kd=c[9];a.Yf=c[10];a.df=c[11];a.me=c[12]}function Xh(a,b){return((((b?a.Xb:a.cd)&12)>>2)+1)*a.Tn+32*((b?a.pe:a.Qe)&15)}function di(a,b){var c=b?a.Xb:a.cd;return a.Fa!=Bh||c&Fh.Wh?((c&Fh.Bf)>>Fh.Df)+1:0}function $h(a,b){return b<di(a)?a.Fa<Gh?1:2:0}function Yh(a,b){return((b?a.Xb:a.cd)&Eh.Bf)>>Eh.Df}
|
||||
function Ih(a,b,c,d,e){for(var f="",g=1;8>=g;g++){var h="pcjs-bitCell";g||(h+=" pcjs-bitCellLeft");f+='<div id="'+(b+"-"+g)+'" class="'+h+'" data-value="0">'+g+"</div>\n"}c.innerHTML=f;b=B(c,"pcjs-bitCell");c=null;for(g=0;g<b.length;g++)void 0!==e&&void 0!==e[g]&&(c=e[g]),c&&b[g].setAttribute("title",c),ei(b[g],d&1<<g?!1:!0),b[g].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");ei(b,c);var d=b.getAttribute("id").split("-"),e=1<<parseInt(d[1],10)-1;switch(d[0]){case "sw1":a.Xb=
|
||||
a.Xb&~e|(c?0:e);break;case "sw2":a.pe=a.pe&~e|(c?0:e)}Th(a)}}(a,b[g])}function ei(a,b){a.setAttribute("data-value",b?"1":"0");a.style.color=b?"#ffffff":"#000000";a.style.backgroundColor=b?"#000000":"#ffffff"}function Th(a){var b=a.sa.swdesc,c={0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"};if(void 0!==b){var d;d=""+(Xh(a,!0)+"Kb");d+=", "+c[Yh(a,!0)]+" Monitor";d+=", "+di(a,!0)+" Floppy Drives";if(void 0!==a.cd&&a.cd!=a.Xb||void 0!==a.Qe&&a.Qe!=a.pe)d+=" (Reset required)";b.innerHTML=d}}
|
||||
function fi(a,b,c,d,e){var f=a.$a[b],g=f.Gb[c].Rb[f.qb];f.qb^=1;a.ba(d,null,e,"DMA"+b+".CHANNEL"+c+".ADDR["+f.qb+"]",O.Fb,g);return g}function gi(a,b,c,d,e,f){var g=a.$a[b];a.ba(d,e,f,"DMA"+b+".CHANNEL"+c+".ADDR["+g.qb+"]",O.Fb);a=g.Gb[c];a.Rb[g.qb]=a.gk[g.qb]=e;g.qb^=1}function hi(a,b,c,d,e){var f=a.$a[b],g=f.Gb[c].Zb[f.qb];f.qb^=1;a.ba(d,null,e,"DMA"+b+".CHANNEL"+c+".COUNT["+f.qb+"]",O.Fb,g);return g}
|
||||
function ii(a,b,c,d,e,f){var g=a.$a[b];a.ba(d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.qb+"]",O.Fb);a=g.Gb[c];a.Zb[g.qb]=a.Ic[g.qb]=e;g.qb^=1}function ji(a,b,c,d){var e=a.$a[b],f=e.ae|1;e.ae&=-16;a.ba(c,null,d,"DMA"+b+".STATUS",O.Fb,f);return f}function ki(a,b,c,d,e){var f=a.$a[b];a.ba(c,d,e,"DMA"+b+".REQ",O.Fb);a=d&3;f.ae=f.ae&~(16<<a)|(d&4)<<a+2;f.lk=d}function li(a,b,c,d,e){var f=a.$a[b];a.ba(c,d,e,"DMA"+b+".MASK",O.Fb);b=d&3;c=f.Gb[b];c.Fd=d&4?!0:!1;c.Fd||mi(a,f.Yn+b)}
|
||||
function fi(a,b,c,d,e){var f=a.$a[b],g=f.Gb[c].Rb[f.qb];f.qb^=1;a.ba(d,null,e,"DMA"+b+".CHANNEL"+c+".ADDR["+f.qb+"]",O.Fb,g);return g}function gi(a,b,c,d,e,f){var g=a.$a[b];a.ba(d,e,f,"DMA"+b+".CHANNEL"+c+".ADDR["+g.qb+"]",O.Fb);a=g.Gb[c];a.Rb[g.qb]=a.jk[g.qb]=e;g.qb^=1}function hi(a,b,c,d,e){var f=a.$a[b],g=f.Gb[c].Zb[f.qb];f.qb^=1;a.ba(d,null,e,"DMA"+b+".CHANNEL"+c+".COUNT["+f.qb+"]",O.Fb,g);return g}
|
||||
function ii(a,b,c,d,e,f){var g=a.$a[b];a.ba(d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.qb+"]",O.Fb);a=g.Gb[c];a.Zb[g.qb]=a.Ic[g.qb]=e;g.qb^=1}function ji(a,b,c,d){var e=a.$a[b],f=e.ae|1;e.ae&=-16;a.ba(c,null,d,"DMA"+b+".STATUS",O.Fb,f);return f}function ki(a,b,c,d,e){var f=a.$a[b];a.ba(c,d,e,"DMA"+b+".REQ",O.Fb);a=d&3;f.ae=f.ae&~(16<<a)|(d&4)<<a+2;f.ok=d}function li(a,b,c,d,e){var f=a.$a[b];a.ba(c,d,e,"DMA"+b+".MASK",O.Fb);b=d&3;c=f.Gb[b];c.Fd=d&4?!0:!1;c.Fd||mi(a,f.ao+b)}
|
||||
function ni(a,b,c,d,e){a.ba(c,d,e,"DMA"+b+".CLEAR",O.Fb);a=a.$a[b];for(b=0;b<a.Gb.length;b++)bi(a,b)}function oi(a,b,c,d,e){var f=a.$a[b].Gb[c].Xg;a.ba(d,null,e,"DMA"+b+".CHANNEL"+c+".PAGE",O.Fb,f);return f}function pi(a,b,c,d,e,f){a.ba(d,e,f,"DMA"+b+".CHANNEL"+c+".PAGE",O.Fb);a.$a[b].Gb[c].Xg=e}function qi(a,b,c,d){var e=a.Ng[b];a.ba(c,null,d,"DMA.SPARE"+b+".PAGE",O.Fb,e);return e}function ri(a,b,c,d,e){a.ba(c,d,e,"DMA.SPARE"+b+".PAGE",O.Fb);a.Ng[b]=d}
|
||||
function si(a,b,c,d,e){ci(a.$a[b>>2].Gb[b&3],c,d,e)}function mi(a,b,c){b=a.$a[b>>2].Gb[b&3];b.dh&&b.Gi&&b.Eh?(c&&(b.fh=c),b.Fd||md(a,b,!0)):c&&c(!0)}
|
||||
function md(a,b,c){c&&(b.count=b.Zb[1]<<8|b.Zb[0],b.jm=b.mode&12,b.Bk=b.jd=!1);for(var d=!1;0<=b.count&&(c=b.Xg<<16|b.Rb[1]<<8|b.Rb[0],4==b.jm?(d=!0,function(c){b.Gi.call(b.dh,b.Eh,-1,function(f,g){0>f&&(b.Bk||(b.Bk=!0),f=255);b.Fd||db(a.na,c,f);(d=g)&&setTimeout(function(){ti(b)||md(a,b)},0)})}(c)):8==b.jm?(c=bb(a.na,c),0>b.Gi.call(b.dh,b.Eh,c)&&(b.jd=!0)):b.jd=!0),!d&&!ti(b););}
|
||||
function ti(a){if(!a.jd&&0<=--a.count&&(a.mode&32?(a.Rb[0]--,0>a.Rb[0]&&(a.Rb[0]=255,a.Rb[1]--,0>a.Rb[1]&&(a.Rb[1]=255))):(a.Rb[0]++,255<a.Rb[0]&&(a.Rb[0]=0,a.Rb[1]++,255<a.Rb[1]&&(a.Rb[1]=0))),!a.Fd))return!1;var b=a.ia;b.ae=b.ae&~(16<<a.Gk)|1<<a.Gk;a.mode&16||(a.Fd=!0,a.dh=a.Eh=null);a.fh&&(a.fh(!a.jd),a.fh=null);return!0}function ui(a,b,c){var d=0,e=a.tb[b];if(void 0!==e.Nf)switch(e.Nf&3){case 2:d=e.Jb;break;case 3:d=e.Fc}a.ba(e.port,null,c,"PIC"+b,O.Te,d);return d}
|
||||
function si(a,b,c,d,e){ci(a.$a[b>>2].Gb[b&3],c,d,e)}function mi(a,b,c){b=a.$a[b>>2].Gb[b&3];b.dh&&b.Ii&&b.Gh?(c&&(b.fh=c),b.Fd||md(a,b,!0)):c&&c(!0)}
|
||||
function md(a,b,c){c&&(b.count=b.Zb[1]<<8|b.Zb[0],b.mm=b.mode&12,b.Ek=b.jd=!1);for(var d=!1;0<=b.count&&(c=b.Xg<<16|b.Rb[1]<<8|b.Rb[0],4==b.mm?(d=!0,function(c){b.Ii.call(b.dh,b.Gh,-1,function(f,g){0>f&&(b.Ek||(b.Ek=!0),f=255);b.Fd||db(a.na,c,f);(d=g)&&setTimeout(function(){ti(b)||md(a,b)},0)})}(c)):8==b.mm?(c=bb(a.na,c),0>b.Ii.call(b.dh,b.Gh,c)&&(b.jd=!0)):b.jd=!0),!d&&!ti(b););}
|
||||
function ti(a){if(!a.jd&&0<=--a.count&&(a.mode&32?(a.Rb[0]--,0>a.Rb[0]&&(a.Rb[0]=255,a.Rb[1]--,0>a.Rb[1]&&(a.Rb[1]=255))):(a.Rb[0]++,255<a.Rb[0]&&(a.Rb[0]=0,a.Rb[1]++,255<a.Rb[1]&&(a.Rb[1]=0))),!a.Fd))return!1;var b=a.ia;b.ae=b.ae&~(16<<a.Jk)|1<<a.Jk;a.mode&16||(a.Fd=!0,a.dh=a.Gh=null);a.fh&&(a.fh(!a.jd),a.fh=null);return!0}function ui(a,b,c){var d=0,e=a.tb[b];if(void 0!==e.Nf)switch(e.Nf&3){case 2:d=e.Jb;break;case 3:d=e.Fc}a.ba(e.port,null,c,"PIC"+b,O.Te,d);return d}
|
||||
function vi(a,b,c,d){var e=a.tb[b];a.ba(e.port,c,d,"PIC"+b,O.Te);if(c&16)e.Id=0,e.pd[e.Id++]=c,e.vd=0,e.xe=7,e.Jb=e.Fc=0,e.Nf=10;else if(c&8)e.Nf=c;else{var f=c&224;if(f&32){d=0;if(96==(f&96))d=1<<(c&7);else for(c=e.xe+1;;){c&=7;f=1<<c;if(e.Fc&f){d=f;break}if(c++==e.xe)break}e.Fc&d&&(e.Fc&=~d,wi(a,b))}else 192==f&&(e.xe=c&7)}}function xi(a,b,c){var d=a.tb[b],e=d.vd;a.ba(d.port+1,null,c,"PIC"+b,O.Te,e);return e}
|
||||
function yi(a,b,c,d){var e=a.tb[b];a.ba(e.port+1,c,d,"PIC"+b,O.Te);e.Id<e.pd.length?(e.pd[e.Id++]=c,2==e.Id&&e.pd[0]&2&&e.Id++,3!=e.Id||e.pd[0]&1||e.Id++):(e.vd=c,d=a.S,d.$|=4,wi(a,b,b||253!=c?0:6))}function wi(a,b,c){b=a.tb[b];var d=((b.Fc|b.vd)^255)&b.Jb;a=a.S;a.ka&&(a.nb=d?a.nb|1:a.nb&-2);d&&c&&(b.jg=c)}function zi(a,b,c){var d=b>>3,e=a.tb[d];e.Jb|=1<<(b&7);e.jg=c||0;1==d&&(a.tb[0].Jb|=4);wi(a,d)}
|
||||
function yi(a,b,c,d){var e=a.tb[b];a.ba(e.port+1,c,d,"PIC"+b,O.Te);e.Id<e.pd.length?(e.pd[e.Id++]=c,2==e.Id&&e.pd[0]&2&&e.Id++,3!=e.Id||e.pd[0]&1||e.Id++):(e.vd=c,d=a.S,d.$|=4,wi(a,b,b||253!=c?0:6))}function wi(a,b,c){b=a.tb[b];var d=((b.Fc|b.vd)^255)&b.Jb;a=a.S;a.ka&&(a.mb=d?a.mb|1:a.mb&-2);d&&c&&(b.jg=c)}function zi(a,b,c){var d=b>>3,e=a.tb[d];e.Jb|=1<<(b&7);e.jg=c||0;1==d&&(a.tb[0].Jb|=4);wi(a,d)}
|
||||
function Ai(a,b){var c=b>>3,d=a.tb[c],e=1<<(b&7);d.Jb&e&&(d.Jb&=~e,1!=c||d.Jb||(a.tb[0].Jb&=-5),wi(a,c))}function kd(a,b){void 0===b&&(b=0);var c=-1,d=a.tb[b];if(d.jg)c=-2,d.jg--;else for(var e=d.Jb&((d.Fc|d.vd)^255),f=d.xe+1;;){var f=f&7,g=1<<f;if(e&g){c=b||2!=f?d.pd[1]+f:kd(a,1);0<=c&&(d.Fc|=g,d.Jb&=~g);break}if(f++==d.xe)break}return c}function Bi(a,b,c){var d;d=a.Hb[b];d.de==d.gd&&Ci(a,b);if(d.Yf)return d.Vf[d.de++];Rh(a,b);d=d.Zb[d.de++];a.ba(64+b,null,c,"TIMER"+b,O.Ue,d);return d}
|
||||
function Di(a,b,c,d){a.ba(64+b,c,d,"TIMER"+b,O.Ue);d=a.Hb[b];d.de==d.gd&&Ci(a,b);d.Ic[d.de++]=c;if(d.de==d.gd){d.df&&0!=d.mode&&8!=d.mode||(d.Yf=!1,d.Zb[0]=d.Yc[0]=d.Ic[0],d.Zb[1]=d.Yc[1]=d.Ic[1],d.me=F(a.S,a.oh),d.df=!0,d.kd=0!=d.mode,0==b&&Ai(a,0));2==b&&Kb(a);if(0==b){var e=Ei(a,0);2048<=e&&(a.S.zh=Math.round(65536/e))}0==b&&0==d.mode&&16==d.vg&&(b=a.S,b.Ob&&(a=b.A-c*a.Ql,b.A-=a,b.Oc-=a))}}k.Hn=function(a,b){this.ba(a,null,b,"TIMER_CTRL",O.Ue);return null};
|
||||
k.Zo=function(a,b,c){this.ba(a,b,c,"TIMER_CTRL",O.Ue);this.ji=b;a=(b&192)>>6;if(3!=a){c=b&1;var d=b&14;if(b&=48){var e=this.Hb[a];e.vg=b;e.mode=d;e.nk=c;e.Ic=[0,0];e.Zb=[0,0];e.Vf=[0,0];e.kd=!1;e.Yf=!1;e.df=!1;Ci(this,a);0==a&&Ai(this,0);2==a&&255==this.tb[0].vd&&77==this.Ac&&(a=this.Hb[0],a.Yc[0]=a.Ic[0],a.Yc[1]=a.Ic[1],a.me=F(this.S,this.oh))}else Rh(this,a),b=this.Hb[a],b.Vf[0]=b.Zb[0],b.Vf[1]=b.Zb[1],b.Yf=!0,Ci(this,a)}};
|
||||
function Di(a,b,c,d){a.ba(64+b,c,d,"TIMER"+b,O.Ue);d=a.Hb[b];d.de==d.gd&&Ci(a,b);d.Ic[d.de++]=c;if(d.de==d.gd){d.df&&0!=d.mode&&8!=d.mode||(d.Yf=!1,d.Zb[0]=d.Yc[0]=d.Ic[0],d.Zb[1]=d.Yc[1]=d.Ic[1],d.me=F(a.S,a.oh),d.df=!0,d.kd=0!=d.mode,0==b&&Ai(a,0));2==b&&Kb(a);if(0==b){var e=Ei(a,0);2048<=e&&(a.S.zh=Math.round(65536/e))}0==b&&0==d.mode&&16==d.vg&&(b=a.S,b.Ob&&(a=b.A-c*a.Tl,b.A-=a,b.Oc-=a))}}k.Kn=function(a,b){this.ba(a,null,b,"TIMER_CTRL",O.Ue);return null};
|
||||
k.bp=function(a,b,c){this.ba(a,b,c,"TIMER_CTRL",O.Ue);this.li=b;a=(b&192)>>6;if(3!=a){c=b&1;var d=b&14;if(b&=48){var e=this.Hb[a];e.vg=b;e.mode=d;e.qk=c;e.Ic=[0,0];e.Zb=[0,0];e.Vf=[0,0];e.kd=!1;e.Yf=!1;e.df=!1;Ci(this,a);0==a&&Ai(this,0);2==a&&255==this.tb[0].vd&&77==this.Ac&&(a=this.Hb[0],a.Yc[0]=a.Ic[0],a.Yc[1]=a.Ic[1],a.me=F(this.S,this.oh))}else Rh(this,a),b=this.Hb[a],b.Vf[0]=b.Zb[0],b.Vf[1]=b.Zb[1],b.Yf=!0,Ci(this,a)}};
|
||||
function Ei(a,b){var c=a.Hb[b],d=c.Ic[1]<<8|c.Ic[0];d||(d=1==c.gd?256:65536);return d}function Ci(a,b){var c=a.Hb[b];c.de=32==c.vg?1:0;c.gd=48==c.vg?2:1}
|
||||
function Rh(a,b,c){var d=a.Hb[b];if(d.df&&(2!=b||a.Ac&1)){var e=F(a.S,a.oh),f=(e-d.me)/a.Ql|0;0>f&&(d.me=e,f=0);var g=Ei(a,b),h=a.Hb[b],m=h.Yc[1]<<8|h.Yc[0];m||(m=1==h.gd?256:65536);h=m-f;0==d.mode?(0>=h&&(h=0),h||(d.kd=!0,d.df=!1,b||zi(a,0))):4==d.mode?(d.kd=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.Yc[0]=h&255,d.Yc[1]=h>>8,d.me=e,!b&&d.kd&&zi(a,0))):6==d.mode&&(h-=f,0>=h&&(d.kd=!d.kd,h=g+h,0>=h&&(h=g),d.Yc[0]=h&255,d.Yc[1]=h>>8,d.me=e,!b&&d.kd&&zi(a,0)));d.Zb[0]=h&255;d.Zb[1]=h>>8;c&&(a.me=0)}return d}
|
||||
function Rh(a,b,c){var d=a.Hb[b];if(d.df&&(2!=b||a.Ac&1)){var e=F(a.S,a.oh),f=(e-d.me)/a.Tl|0;0>f&&(d.me=e,f=0);var g=Ei(a,b),h=a.Hb[b],m=h.Yc[1]<<8|h.Yc[0];m||(m=1==h.gd?256:65536);h=m-f;0==d.mode?(0>=h&&(h=0),h||(d.kd=!0,d.df=!1,b||zi(a,0))):4==d.mode?(d.kd=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.Yc[0]=h&255,d.Yc[1]=h>>8,d.me=e,!b&&d.kd&&zi(a,0))):6==d.mode&&(h-=f,0>=h&&(d.kd=!d.kd,h=g+h,0>=h&&(h=g),d.Yc[0]=h&255,d.Yc[1]=h>>8,d.me=e,!b&&d.kd&&zi(a,0)));d.Zb[0]=h&255;d.Zb[1]=h>>8;c&&(a.me=0)}return d}
|
||||
function Lb(a,b){for(var c=0;c<a.Hb.length;c++)Rh(a,c,b);if(a.Fa>=Gh){var c=0,d=a.S.Hd,e=F(a.S,a.oh);if(0<=a.eg&&(c=e-a.eg,Math.floor(c/d)&&60<=++a.pa[0]&&(a.pa[0]=0,60<=++a.pa[2]&&(a.pa[2]=0,24<=++a.pa[4])))){a.pa[4]=0;a.pa[6]=a.pa[6]%7+1;var f=a.pa[9],g=qa[a.pa[8]-1];28==g&&0===f%4&&(f%100||0===f%400)&&g++;++a.pa[7]>g&&(a.pa[7]=1,12<++a.pa[8]&&(a.pa[8]=1,a.pa[9]=(a.pa[9]+1)%100))}a.eg=e-c%d}}
|
||||
k.zn=function(a,b){var c=this.Wg;this.Of&16&&(this.Ac&128?c=this.cd:this.bb&&(c=Fi(this.bb)));this.ba(a,null,b,"PPI_A",O.uc,c);return c};k.So=function(a,b,c){this.ba(a,b,c,"PPI_A",O.uc);this.Wg=b};k.An=function(a,b){var c=this.Ac;this.ba(a,null,b,"PPI_B",O.uc,c);return c};k.To=function(a,b,c){this.ba(a,b,c,"PPI_B",O.uc);Gi(this,b);this.bb&&Hi(this.bb,b&128?!1:!0,b&64?!0:!1)};function Gi(a,b){var c=!!(b&2),d=!!(a.Ac&2);a.Ac=b;c!=d&&Kb(a,c)}
|
||||
k.Bn=function(a,b){var c=0,c=this.Fa==Bh?this.Ac&4?c|this.Qe&15:c|this.Qe>>4&1:this.Ac&8?c|this.cd>>4:c|this.cd&15;this.Ac&1&&Rh(this,2).kd&&(c=this.Ac&2?c|32:c|16);this.ba(a,null,b,"PPI_C",O.uc|O.Fg,c);return c};k.Uo=function(a,b,c){this.ba(a,b,c,"PPI_C",O.uc);this.hi=b};k.Cn=function(a,b){var c=this.Of;this.ba(a,null,b,"PPI_CTRL",O.uc,c);return c};k.Vo=function(a,b,c){this.ba(a,b,c,"PPI_CTRL",O.uc);this.Of=b};
|
||||
k.Pm=function(a,b){var c=this.Rg;this.ba(a,null,b,"8042_OUTBUFF",O.Se,c);this.kb&=-258;var d=this.bb&&Fi(this.bb,!0);d&&Ii(this,d);return c};k.mo=function(a,b,c){this.ba(a,b,c,"8042_INBUF.DATA",O.Se);if(this.kb&8)switch(this.ud){case 96:Ji(this,b);break;case 209:Ki(this,b);break;default:if(Ji(this,this.Xd&-17),this.bb){a=-1;switch(b){case 255:a=250,Li(this.bb)}Ii(this,a)}}this.ud=b;this.kb&=-9};k.Qm=function(a,b){var c=this.Ac&-209|(F(this.S)&64?16:0);this.ba(a,null,b,"8042_RWREG",O.Se|O.rm,c);return c};
|
||||
k.no=function(a,b,c){this.ba(a,b,c,"8042_RWREG",O.Se);Gi(this,b)};k.Rm=function(a,b){this.ba(a,null,b,"8042_STATUS",O.Se,this.kb);var c=this.kb&255;this.kb&256&&(this.kb|=1,this.kb&=-257);return c};
|
||||
k.lo=function(a,b,c){this.ba(a,b,c,"8042_INBUFF.CMD",O.Se);this.ud=b;this.kb|=8;a=0;240<=this.ud&&(a=this.ud^15,this.ud=240);switch(this.ud){case 192:Ii(this,this.ve);break;case 173:Ji(this,this.Xd|16);break;case 174:Ji(this,this.Xd&-17);break;case 170:this.bb&&Mi(this.bb,!0);Ji(this,this.Xd|16);Ii(this,85);Ki(this,3);break;case 224:Ii(this,this.Xd&16?0:1);break;case 240:a&1&&xc(this.S)}};function Ji(a,b){a.Xd=b;a.kb=a.kb&-5|b&4;a.bb&&Hi(a.bb,!!(b&8),!(b&16))&&Ii(a,Fi(a.bb,!0))}
|
||||
function Ii(a,b){0<=b&&(a.Rg=b,a.kb&=-2,a.kb|=256)}function Ki(a,b){a.fi=b;Ya(a.na,!!(b&2));b&1||xc(a.S)}k.en=function(a,b){this.ba(a,null,b,"CMOS_ADDR",O.Cf,this.we);return this.we};k.Ao=function(a,b,c){this.ba(a,b,c,"CMOS_ADDR",O.Cf);this.we=b;this.Vg=b&128?0:128};k.fn=function(a,b){var c=this.we&63,d=13>=c?Sh(this,c):this.pa[c];this.ba(a,null,b,"CMOS_DATA["+r(c)+"]",O.Cf,d);return d};
|
||||
k.Bo=function(a,b,c){var d=this.we&63;this.ba(a,b,c,"CMOS_DATA["+r(d)+"]",O.Cf);a=this.pa;13>=d&&10>d&&(c=!1,this.pa[11]&4||(b=10*(b>>4)+(b&15),c=!0),4==d||5==d)&&(c&&12<b&&(b+=48),this.pa[11]&2||(12>=b?b=12==b?0:b:(b-=116,b=24==b?12:b)));a[d]=b};k.xn=function(a,b){this.ba(a,null,b,"MFG_DATA",O.uc,this.Mf);return this.Mf};k.Po=function(a,b,c){this.ba(a,b,c,"MFG_DATA",O.uc);this.Mf=b};k.Ro=function(a,b,c){this.ba(a,b,c,"NMI",O.uc);this.Vg=b};
|
||||
k.Nn=function(a){var b=this.S.G>>8;this.X&&E(this.X,O.tm)&&(Ec(this.X,26,a),Fc(this.S,a,function(a,d){return function(e){d=F(a.S)-d;var f,g=a.S.J&255,h=a.S.J>>8,m=a.S.J&255,n=a.S.J>>8;if(2==b||3==b)f=" CH(hour)="+u(h)+" CL(min)="+r(g)+" DH(sec)="+r(n);else if(4==b||5==b)f=" CX(year)="+u(a.S.I)+" DH(month)="+r(n)+" DL(day)="+r(m);Gc(a.X,26,e,d,f)}}(this,F(this.S))));return!0};function Ch(a,b){if(void 0===a)return b;for(var c=0,d=1,e=0;e<a.length;e++)"0"==a.charAt(e)&&(c|=d),d<<=1;return c}
|
||||
function Kb(a,b){if(a.mi){void 0!==b?a.Ak=b:b=a.Ak&&a.S&&a.S.Ob;var c=Math.round(1193181/Ei(a,2));if(20>c||2E4<c)b=!1;b?a.od?(a.od.frequency.value=c,a.Qa("speaker set to "+c+"hz",O.Gg)):(a.od=a.mi.createOscillator(),a.od.type=1,a.od.connect(a.mi.destination),a.od.frequency.value=c,a.Qa("speaker on at "+c+"hz",O.Gg),a.od.noteOn(0)):a.od&&(a.od.noteOff(0),a.od.disconnect(),delete a.od,a.Qa("speaker off at "+c+"hz",O.Gg))}else b&&a.Qa("BEEP",O.Gg)}
|
||||
k.Qa=function(a,b,c){this.X&&(null==b&&(b=O.uc),void 0!==c&&(b|=0==c?O.Ue:1==c?O.ak:6==c?O.Eg:0),E(this.X,b)&&this.X.message(a))};k.ba=function(a,b,c,d,e,f){this.X&&(null==e&&(e=O.uc),this.X.ba(this,a,b,c,d,e,f))};
|
||||
k.Cn=function(a,b){var c=this.Wg;this.Of&16&&(this.Ac&128?c=this.cd:this.bb&&(c=Fi(this.bb)));this.ba(a,null,b,"PPI_A",O.uc,c);return c};k.Vo=function(a,b,c){this.ba(a,b,c,"PPI_A",O.uc);this.Wg=b};k.Dn=function(a,b){var c=this.Ac;this.ba(a,null,b,"PPI_B",O.uc,c);return c};k.Wo=function(a,b,c){this.ba(a,b,c,"PPI_B",O.uc);Gi(this,b);this.bb&&Hi(this.bb,b&128?!1:!0,b&64?!0:!1)};function Gi(a,b){var c=!!(b&2),d=!!(a.Ac&2);a.Ac=b;c!=d&&Kb(a,c)}
|
||||
k.En=function(a,b){var c=0,c=this.Fa==Bh?this.Ac&4?c|this.Qe&15:c|this.Qe>>4&1:this.Ac&8?c|this.cd>>4:c|this.cd&15;this.Ac&1&&Rh(this,2).kd&&(c=this.Ac&2?c|32:c|16);this.ba(a,null,b,"PPI_C",O.uc|O.Fg,c);return c};k.Xo=function(a,b,c){this.ba(a,b,c,"PPI_C",O.uc);this.ji=b};k.Fn=function(a,b){var c=this.Of;this.ba(a,null,b,"PPI_CTRL",O.uc,c);return c};k.Yo=function(a,b,c){this.ba(a,b,c,"PPI_CTRL",O.uc);this.Of=b};
|
||||
k.Sm=function(a,b){var c=this.Rg;this.ba(a,null,b,"8042_OUTBUFF",O.Se,c);this.jb&=-258;var d=this.bb&&Fi(this.bb,!0);d&&Ii(this,d);return c};k.po=function(a,b,c){this.ba(a,b,c,"8042_INBUF.DATA",O.Se);if(this.jb&8)switch(this.ud){case 96:Ji(this,b);break;case 209:Ki(this,b);break;default:if(Ji(this,this.Xd&-17),this.bb){a=-1;switch(b){case 255:a=250,Li(this.bb)}Ii(this,a)}}this.ud=b;this.jb&=-9};k.Tm=function(a,b){var c=this.Ac&-209|(F(this.S)&64?16:0);this.ba(a,null,b,"8042_RWREG",O.Se|O.um,c);return c};
|
||||
k.qo=function(a,b,c){this.ba(a,b,c,"8042_RWREG",O.Se);Gi(this,b)};k.Um=function(a,b){this.ba(a,null,b,"8042_STATUS",O.Se,this.jb);var c=this.jb&255;this.jb&256&&(this.jb|=1,this.jb&=-257);return c};
|
||||
k.oo=function(a,b,c){this.ba(a,b,c,"8042_INBUFF.CMD",O.Se);this.ud=b;this.jb|=8;a=0;240<=this.ud&&(a=this.ud^15,this.ud=240);switch(this.ud){case 192:Ii(this,this.ve);break;case 173:Ji(this,this.Xd|16);break;case 174:Ji(this,this.Xd&-17);break;case 170:this.bb&&Mi(this.bb,!0);Ji(this,this.Xd|16);Ii(this,85);Ki(this,3);break;case 224:Ii(this,this.Xd&16?0:1);break;case 240:a&1&&xc(this.S)}};function Ji(a,b){a.Xd=b;a.jb=a.jb&-5|b&4;a.bb&&Hi(a.bb,!!(b&8),!(b&16))&&Ii(a,Fi(a.bb,!0))}
|
||||
function Ii(a,b){0<=b&&(a.Rg=b,a.jb&=-2,a.jb|=256)}function Ki(a,b){a.hi=b;Ya(a.na,!!(b&2));b&1||xc(a.S)}k.hn=function(a,b){this.ba(a,null,b,"CMOS_ADDR",O.Cf,this.we);return this.we};k.Do=function(a,b,c){this.ba(a,b,c,"CMOS_ADDR",O.Cf);this.we=b;this.Vg=b&128?0:128};k.jn=function(a,b){var c=this.we&63,d=13>=c?Sh(this,c):this.pa[c];this.ba(a,null,b,"CMOS_DATA["+r(c)+"]",O.Cf,d);return d};
|
||||
k.Eo=function(a,b,c){var d=this.we&63;this.ba(a,b,c,"CMOS_DATA["+r(d)+"]",O.Cf);a=this.pa;13>=d&&10>d&&(c=!1,this.pa[11]&4||(b=10*(b>>4)+(b&15),c=!0),4==d||5==d)&&(c&&12<b&&(b+=48),this.pa[11]&2||(12>=b?b=12==b?0:b:(b-=116,b=24==b?12:b)));a[d]=b};k.An=function(a,b){this.ba(a,null,b,"MFG_DATA",O.uc,this.Mf);return this.Mf};k.So=function(a,b,c){this.ba(a,b,c,"MFG_DATA",O.uc);this.Mf=b};k.Uo=function(a,b,c){this.ba(a,b,c,"NMI",O.uc);this.Vg=b};
|
||||
k.Qn=function(a){var b=this.S.G>>8;this.X&&E(this.X,O.wm)&&(Ec(this.X,26,a),Fc(this.S,a,function(a,d){return function(e){d=F(a.S)-d;var f,g=a.S.J&255,h=a.S.J>>8,m=a.S.J&255,n=a.S.J>>8;if(2==b||3==b)f=" CH(hour)="+u(h)+" CL(min)="+r(g)+" DH(sec)="+r(n);else if(4==b||5==b)f=" CX(year)="+u(a.S.I)+" DH(month)="+r(n)+" DL(day)="+r(m);Gc(a.X,26,e,d,f)}}(this,F(this.S))));return!0};function Ch(a,b){if(void 0===a)return b;for(var c=0,d=1,e=0;e<a.length;e++)"0"==a.charAt(e)&&(c|=d),d<<=1;return c}
|
||||
function Kb(a,b){if(a.oi){void 0!==b?a.Dk=b:b=a.Dk&&a.S&&a.S.Ob;var c=Math.round(1193181/Ei(a,2));if(20>c||2E4<c)b=!1;b?a.od?(a.od.frequency.value=c,a.Qa("speaker set to "+c+"hz",O.Gg)):(a.od=a.oi.createOscillator(),a.od.type=1,a.od.connect(a.oi.destination),a.od.frequency.value=c,a.Qa("speaker on at "+c+"hz",O.Gg),a.od.noteOn(0)):a.od&&(a.od.noteOff(0),a.od.disconnect(),delete a.od,a.Qa("speaker off at "+c+"hz",O.Gg))}else b&&a.Qa("BEEP",O.Gg)}
|
||||
k.Qa=function(a,b,c){this.X&&(null==b&&(b=O.uc),void 0!==c&&(b|=0==c?O.Ue:1==c?O.dk:6==c?O.Eg:0),E(this.X,b)&&this.X.message(a))};k.ba=function(a,b,c,d,e,f){this.X&&(null==e&&(e=O.uc),this.X.ba(this,a,b,c,d,e,f))};
|
||||
var Jh={0:function(a,b){return fi(this,0,0,a,b)},1:function(a,b){return hi(this,0,0,a,b)},2:function(a,b){return fi(this,0,1,a,b)},3:function(a,b){return hi(this,0,1,a,b)},4:function(a,b){return fi(this,0,2,a,b)},5:function(a,b){return hi(this,0,2,a,b)},6:function(a,b){return fi(this,0,3,a,b)},7:function(a,b){return hi(this,0,3,a,b)},8:function(a,b){return ji(this,0,a,b)},32:function(a,b){return ui(this,0,b)},33:function(a,b){return xi(this,0,b)},64:function(a,b){return Bi(this,0,b)},65:function(a,
|
||||
b){return Bi(this,1,b)},66:function(a,b){return Bi(this,2,b)},67:O.prototype.Hn,129:function(a,b){return oi(this,0,2,a,b)},130:function(a,b){return oi(this,0,3,a,b)},131:function(a,b){return oi(this,0,1,a,b)},135:function(a,b){return oi(this,0,0,a,b)}},Lh={96:O.prototype.zn,97:O.prototype.An,98:O.prototype.Bn,99:O.prototype.Cn},Nh={96:O.prototype.Pm,97:O.prototype.Qm,100:O.prototype.Rm,112:O.prototype.en,113:O.prototype.fn,128:O.prototype.xn,132:function(a,b){return qi(this,0,a,b)},133:function(a,
|
||||
b){return Bi(this,1,b)},66:function(a,b){return Bi(this,2,b)},67:O.prototype.Kn,129:function(a,b){return oi(this,0,2,a,b)},130:function(a,b){return oi(this,0,3,a,b)},131:function(a,b){return oi(this,0,1,a,b)},135:function(a,b){return oi(this,0,0,a,b)}},Lh={96:O.prototype.Cn,97:O.prototype.Dn,98:O.prototype.En,99:O.prototype.Fn},Nh={96:O.prototype.Sm,97:O.prototype.Tm,100:O.prototype.Um,112:O.prototype.hn,113:O.prototype.jn,128:O.prototype.An,132:function(a,b){return qi(this,0,a,b)},133:function(a,
|
||||
b){return qi(this,1,a,b)},134:function(a,b){return qi(this,2,a,b)},136:function(a,b){return qi(this,3,a,b)},137:function(a,b){return oi(this,1,2,a,b)},138:function(a,b){return oi(this,1,3,a,b)},139:function(a,b){return oi(this,1,1,a,b)},140:function(a,b){return qi(this,4,a,b)},141:function(a,b){return qi(this,5,a,b)},142:function(a,b){return qi(this,6,a,b)},143:function(a,b){return oi(this,1,0,a,b)},160:function(a,b){return ui(this,1,b)},161:function(a,b){return xi(this,1,b)},192:function(a,b){return fi(this,
|
||||
1,0,a,b)},194:function(a,b){return hi(this,1,0,a,b)},196:function(a,b){return fi(this,1,1,a,b)},198:function(a,b){return hi(this,1,1,a,b)},200:function(a,b){return fi(this,1,2,a,b)},202:function(a,b){return hi(this,1,2,a,b)},204:function(a,b){return fi(this,1,3,a,b)},206:function(a,b){return hi(this,1,3,a,b)},208:function(a,b){return ji(this,1,a,b)}},Kh={0:function(a,b,c){gi(this,0,0,a,b,c)},1:function(a,b,c){ii(this,0,0,a,b,c)},2:function(a,b,c){gi(this,0,1,a,b,c)},3:function(a,b,c){ii(this,0,1,
|
||||
a,b,c)},4:function(a,b,c){gi(this,0,2,a,b,c)},5:function(a,b,c){ii(this,0,2,a,b,c)},6:function(a,b,c){gi(this,0,3,a,b,c)},7:function(a,b,c){ii(this,0,3,a,b,c)},8:function(a,b,c){this.ba(a,b,c,"DMA0.CMD",O.Fb);this.$a[0].gi=b},9:function(a,b,c){ki(this,0,a,b,c)},10:function(a,b,c){li(this,0,a,b,c)},11:function(a,b,c){this.ba(a,b,c,"DMA0.MODE",O.Fb);this.$a[0].Gb[b&3].mode=b},12:function(a,b,c){this.ba(a,b,c,"DMA0.INDEX",O.Fb);this.$a[0].qb=0},13:function(a,b,c){ni(this,0,a,b,c)},32:function(a,b,c){vi(this,
|
||||
0,b,c)},33:function(a,b,c){yi(this,0,b,c)},64:function(a,b,c){Di(this,0,b,c)},65:function(a,b,c){Di(this,1,b,c)},66:function(a,b,c){Di(this,2,b,c)},67:O.prototype.Zo,129:function(a,b,c){pi(this,0,2,a,b,c)},130:function(a,b,c){pi(this,0,3,a,b,c)},131:function(a,b,c){pi(this,0,1,a,b,c)},135:function(a,b,c){pi(this,0,0,a,b,c)}},Mh={96:O.prototype.So,97:O.prototype.To,98:O.prototype.Uo,99:O.prototype.Vo,160:O.prototype.Ro},Oh={96:O.prototype.mo,97:O.prototype.no,100:O.prototype.lo,112:O.prototype.Ao,
|
||||
113:O.prototype.Bo,128:O.prototype.Po,132:function(a,b,c){ri(this,0,a,b,c)},133:function(a,b,c){ri(this,1,a,b,c)},134:function(a,b,c){ri(this,2,a,b,c)},136:function(a,b,c){ri(this,3,a,b,c)},137:function(a,b,c){pi(this,1,2,a,b,c)},138:function(a,b,c){pi(this,1,3,a,b,c)},139:function(a,b,c){pi(this,1,1,a,b,c)},140:function(a,b,c){ri(this,4,a,b,c)},141:function(a,b,c){ri(this,5,a,b,c)},142:function(a,b,c){ri(this,6,a,b,c)},143:function(a,b,c){pi(this,1,0,a,b,c)},160:function(a,b,c){vi(this,1,b,c)},161:function(a,
|
||||
b,c){yi(this,1,b,c)},192:function(a,b,c){gi(this,1,0,a,b,c)},194:function(a,b,c){ii(this,1,0,a,b,c)},196:function(a,b,c){gi(this,1,1,a,b,c)},198:function(a,b,c){ii(this,1,1,a,b,c)},200:function(a,b,c){gi(this,1,2,a,b,c)},202:function(a,b,c){ii(this,1,2,a,b,c)},204:function(a,b,c){gi(this,1,3,a,b,c)},206:function(a,b,c){ii(this,1,3,a,b,c)},208:function(a,b,c){this.ba(a,b,c,"DMA1.CMD",O.Fb);this.$a[1].gi=b},210:function(a,b,c){ki(this,1,a,b,c)},212:function(a,b,c){li(this,1,a,b,c)},214:function(a,b,
|
||||
a,b,c)},4:function(a,b,c){gi(this,0,2,a,b,c)},5:function(a,b,c){ii(this,0,2,a,b,c)},6:function(a,b,c){gi(this,0,3,a,b,c)},7:function(a,b,c){ii(this,0,3,a,b,c)},8:function(a,b,c){this.ba(a,b,c,"DMA0.CMD",O.Fb);this.$a[0].ii=b},9:function(a,b,c){ki(this,0,a,b,c)},10:function(a,b,c){li(this,0,a,b,c)},11:function(a,b,c){this.ba(a,b,c,"DMA0.MODE",O.Fb);this.$a[0].Gb[b&3].mode=b},12:function(a,b,c){this.ba(a,b,c,"DMA0.INDEX",O.Fb);this.$a[0].qb=0},13:function(a,b,c){ni(this,0,a,b,c)},32:function(a,b,c){vi(this,
|
||||
0,b,c)},33:function(a,b,c){yi(this,0,b,c)},64:function(a,b,c){Di(this,0,b,c)},65:function(a,b,c){Di(this,1,b,c)},66:function(a,b,c){Di(this,2,b,c)},67:O.prototype.bp,129:function(a,b,c){pi(this,0,2,a,b,c)},130:function(a,b,c){pi(this,0,3,a,b,c)},131:function(a,b,c){pi(this,0,1,a,b,c)},135:function(a,b,c){pi(this,0,0,a,b,c)}},Mh={96:O.prototype.Vo,97:O.prototype.Wo,98:O.prototype.Xo,99:O.prototype.Yo,160:O.prototype.Uo},Oh={96:O.prototype.po,97:O.prototype.qo,100:O.prototype.oo,112:O.prototype.Do,
|
||||
113:O.prototype.Eo,128:O.prototype.So,132:function(a,b,c){ri(this,0,a,b,c)},133:function(a,b,c){ri(this,1,a,b,c)},134:function(a,b,c){ri(this,2,a,b,c)},136:function(a,b,c){ri(this,3,a,b,c)},137:function(a,b,c){pi(this,1,2,a,b,c)},138:function(a,b,c){pi(this,1,3,a,b,c)},139:function(a,b,c){pi(this,1,1,a,b,c)},140:function(a,b,c){ri(this,4,a,b,c)},141:function(a,b,c){ri(this,5,a,b,c)},142:function(a,b,c){ri(this,6,a,b,c)},143:function(a,b,c){pi(this,1,0,a,b,c)},160:function(a,b,c){vi(this,1,b,c)},161:function(a,
|
||||
b,c){yi(this,1,b,c)},192:function(a,b,c){gi(this,1,0,a,b,c)},194:function(a,b,c){ii(this,1,0,a,b,c)},196:function(a,b,c){gi(this,1,1,a,b,c)},198:function(a,b,c){ii(this,1,1,a,b,c)},200:function(a,b,c){gi(this,1,2,a,b,c)},202:function(a,b,c){ii(this,1,2,a,b,c)},204:function(a,b,c){gi(this,1,3,a,b,c)},206:function(a,b,c){ii(this,1,3,a,b,c)},208:function(a,b,c){this.ba(a,b,c,"DMA1.CMD",O.Fb);this.$a[1].ii=b},210:function(a,b,c){ki(this,1,a,b,c)},212:function(a,b,c){li(this,1,a,b,c)},214:function(a,b,
|
||||
c){this.ba(a,b,c,"DMA1.MODE",O.Fb);this.$a[1].Gb[b&3].mode=b},216:function(a,b,c){this.ba(a,b,c,"DMA1.INDEX",O.Fb);this.$a[1].qb=0},218:function(a,b,c){ni(this,1,a,b,c)}};Ba(function(){for(var a=B(window.document,"pcjs","chipset"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new O(d);Oa(d,c);Th(d)}});
|
||||
function Ni(a){x.call(this,"ROM",a,Ni);this.yb=null;this.hk=a.addr;this.Ph=a.size;this.wm=a.alias;this.wg=a.file;this.Hk=a.notify;if(this.wg){a=this.wg;var b=fa(this.wg);"json"!=b&&"hex"!=b&&(a=sa()+"/api/v1/dump?file="+this.wg+"&format=bytes&decimal=true");ra(a,!0,null,this,Ni.prototype.fo)}}y(x,Ni);Ni.prototype.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;Oi(this)};Ni.prototype.$b=function(){this.ai&&(this.X&&Pi(this.X,this.hk,this.Ph,this.ai),delete this.ai);return!0};Ni.prototype.Wb=function(){return!0};
|
||||
Ni.prototype.fo=function(a,b,c){if(c)this.Ga("Unable to load system ROM (error "+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),e=d.bytes,f=d.data;if(e)this.yb=e;else if(f)for(this.yb=Array(4*f.length),c=b=0;b<f.length;b++)this.yb[c++]=f[b]&255,this.yb[c++]=f[b]>>8&255,this.yb[c++]=f[b]>>16&255,this.yb[c++]=f[b]>>24&255;else this.yb=d;this.ai=d.symbols;if(!this.yb.length){w("Empty ROM: "+a);return}if(1==this.yb.length){w(this.yb[0]);return}}catch(g){this.Ga("ROM data error: "+
|
||||
g.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.yb=Array(a.length),d=0;d<a.length;d++)this.yb[d]=parseInt(a[d],16);Oi(this)}};function Oi(a){if(!Ra(a))if(!a.wg)a.Ta();else if(a.yb&&a.na){if(a.yb.length!=a.Ph)Sa(a,"ROM size (0x"+p(a.yb.length)+") does not match specified size (0x"+p(a.Ph)+")");else if(Qi(a,a.hk)&&Qi(a,a.wm)){if(a.Hk){var b=Ma(a.Hk,a.id);b&&("ega"==b.Fa&&Ri(b,a.yb,[8752,12640],8),b.Ta())}delete a.yb}a.Ta()}}
|
||||
function Qi(a,b){if(null==b)return!0;if(Za(a.na,b,a.Ph,!0)){for(var c=0;c<a.yb.length;c++)db(a.na,b+c,a.yb[c]);return!0}return!1}Ba(function(){for(var a=B(window.document,"pcjs","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Ni(d);Oa(d,c)}});function Si(a){x.call(this,"RAM",a,Si);this.Pg=a.addr;this.Od=a.size;this.Gm=a.test;this.Em=!!this.Od;this.hh=!1}y(x,Si);Si.prototype.nc=function(a,b,c){this.na=b;this.S=c;this.Da=a;this.ka=C(a,"ChipSet");this.Ta()};
|
||||
Si.prototype.$b=function(a,b){b||this.reset();return!0};Si.prototype.Wb=function(){return!0};
|
||||
Si.prototype.reset=function(){if(!this.Pg&&!this.Em&&this.ka){var a=1024*Xh(this.ka);this.Od&&a!=this.Od&&(ab(this.na,this.Pg,this.Od),this.hh=!1);this.Od=a}!this.hh&&this.Od&&Za(this.na,this.Pg,this.Od)&&(this.hh=!0,this.status(Math.floor(this.Od/1024)+"Kb"));if(this.hh){if(this.Gm||eb(this.na,1138,4660),this.ka&&(a=this.ka,a.pa)){var b=1048576>this.Pg?21:23,c=a.pa[b]|a.pa[b+1]<<8,c=c+(this.Od>>10);a.pa[b]=c&255;a.pa[b+1]=c>>8;ai(a)}}else w("No RAM allocated")};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Si(d);Oa(d,c)}});function Xi(a){x.call(this,"Keyboard",a,Xi);this.$h={};this.Vn=250;this.Wn=100;this.Ta()}y(x,Xi);
|
||||
function Ni(a){x.call(this,"ROM",a,Ni);this.yb=null;this.kk=a.addr;this.Rh=a.size;this.zm=a.alias;this.wg=a.file;this.Kk=a.notify;if(this.wg){a=this.wg;var b=fa(this.wg);"json"!=b&&"hex"!=b&&(a=sa()+"/api/v1/dump?file="+this.wg+"&format=bytes&decimal=true");ra(a,!0,null,this,Ni.prototype.jo)}}y(x,Ni);Ni.prototype.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;Oi(this)};Ni.prototype.ac=function(){this.ci&&(this.X&&Pi(this.X,this.kk,this.Rh,this.ci),delete this.ci);return!0};Ni.prototype.Wb=function(){return!0};
|
||||
Ni.prototype.jo=function(a,b,c){if(c)this.Ga("Unable to load system ROM (error "+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),e=d.bytes,f=d.data;if(e)this.yb=e;else if(f)for(this.yb=Array(4*f.length),c=b=0;b<f.length;b++)this.yb[c++]=f[b]&255,this.yb[c++]=f[b]>>8&255,this.yb[c++]=f[b]>>16&255,this.yb[c++]=f[b]>>24&255;else this.yb=d;this.ci=d.symbols;if(!this.yb.length){w("Empty ROM: "+a);return}if(1==this.yb.length){w(this.yb[0]);return}}catch(g){this.Ga("ROM data error: "+
|
||||
g.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.yb=Array(a.length),d=0;d<a.length;d++)this.yb[d]=parseInt(a[d],16);Oi(this)}};function Oi(a){if(!Ra(a))if(!a.wg)a.Ta();else if(a.yb&&a.na){if(a.yb.length!=a.Rh)Sa(a,"ROM size (0x"+p(a.yb.length)+") does not match specified size (0x"+p(a.Rh)+")");else if(Qi(a,a.kk)&&Qi(a,a.zm)){if(a.Kk){var b=Ma(a.Kk,a.id);b&&("ega"==b.Fa&&Ri(b,a.yb,[8752,12640],8),b.Ta())}delete a.yb}a.Ta()}}
|
||||
function Qi(a,b){if(null==b)return!0;if(Za(a.na,b,a.Rh,!0)){for(var c=0;c<a.yb.length;c++)db(a.na,b+c,a.yb[c]);return!0}return!1}Ba(function(){for(var a=B(window.document,"pcjs","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Ni(d);Oa(d,c)}});function Si(a){x.call(this,"RAM",a,Si);this.Pg=a.addr;this.Od=a.size;this.Jm=a.test;this.Hm=!!this.Od;this.hh=!1}y(x,Si);Si.prototype.pc=function(a,b,c){this.na=b;this.S=c;this.Da=a;this.ka=C(a,"ChipSet");this.Ta()};
|
||||
Si.prototype.ac=function(a,b){b||this.reset();return!0};Si.prototype.Wb=function(){return!0};
|
||||
Si.prototype.reset=function(){if(!this.Pg&&!this.Hm&&this.ka){var a=1024*Xh(this.ka);this.Od&&a!=this.Od&&(ab(this.na,this.Pg,this.Od),this.hh=!1);this.Od=a}!this.hh&&this.Od&&Za(this.na,this.Pg,this.Od)&&(this.hh=!0,this.status(Math.floor(this.Od/1024)+"Kb"));if(this.hh){if(this.Jm||eb(this.na,1138,4660),this.ka&&(a=this.ka,a.pa)){var b=1048576>this.Pg?21:23,c=a.pa[b]|a.pa[b+1]<<8,c=c+(this.Od>>10);a.pa[b]=c&255;a.pa[b+1]=c>>8;ai(a)}}else w("No RAM allocated")};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Si(d);Oa(d,c)}});function Xi(a){x.call(this,"Keyboard",a,Xi);this.bi={};this.Yn=250;this.Zn=100;this.Ta()}y(x,Xi);
|
||||
var Yi={esc:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9,9:10,0:11,"-":12,"=":13,backspace:14,tab:15,q:16,w:17,e:18,r:19,t:20,y:21,u:22,i:23,o:24,p:25,"[":26,"]":27,enter:28,ctrl:29,a:30,s:31,d:32,f:33,g:34,h:35,j:36,k:37,l:38,";":39,squote:40,bquote:41,lshift:42,bslash:43,z:44,x:45,c:46,v:47,b:48,n:49,m:50,",":51,".":52,"/":53,rshift:54,prtsc:55,alt:56,space:57,"caps-lock":58,f1:59,f2:60,f3:61,f4:62,f5:63,f6:64,f7:65,f8:66,f9:67,f10:68,"num-lock":69,"scroll-lock":70,home:71,"up-arrow":72,"page-up":73,"num-minus":74,
|
||||
"left-arrow":75,center:76,"right-arrow":77,"num-plus":78,end:79,"down-arrow":80,"page-down":81,ins:82,del:83},Zi={tab:9,esc:27,rshift:224,lshift:240,ctrl:241,alt:242,"caps-lock":244,f1:336,f2:337,f3:338,f4:339,f5:340,f6:341,f7:342,f8:343,f9:344,f10:345,"left-arrow":261,"up-arrow":262,"right-arrow":263,"down-arrow":264,"ctrl-c":3,"ctrl-break":254,"ctrl-alt-del":255},P=[];P[32]=57;P[49]=2;P[33]=61442;P[50]=3;P[64]=61443;P[51]=4;P[35]=61444;P[52]=5;P[36]=61445;P[53]=6;P[37]=61446;P[54]=7;P[94]=61447;
|
||||
P[55]=8;P[38]=61448;P[56]=9;P[42]=61449;P[57]=10;P[40]=61450;P[48]=11;P[41]=61451;P[45]=12;P[95]=61452;P[61]=13;P[43]=61453;P[113]=16;P[81]=61456;P[119]=17;P[87]=61457;P[101]=18;P[69]=61458;P[114]=19;P[82]=61459;P[116]=20;P[84]=61460;P[121]=21;P[89]=61461;P[117]=22;P[85]=61462;P[105]=23;P[73]=61463;P[111]=24;P[79]=61464;P[112]=25;P[80]=61465;P[91]=26;P[123]=61466;P[93]=27;P[125]=61467;P[97]=30;P[65]=61470;P[115]=31;P[83]=61471;P[100]=32;P[68]=61472;P[102]=33;P[70]=61473;P[103]=34;P[71]=61474;
|
||||
P[104]=35;P[72]=61475;P[106]=36;P[74]=61476;P[107]=37;P[75]=61477;P[108]=38;P[76]=61478;P[59]=39;P[58]=61479;P[39]=40;P[34]=61480;P[96]=41;P[126]=61481;P[92]=43;P[124]=61483;P[122]=44;P[90]=61484;P[120]=45;P[88]=61485;P[99]=46;P[67]=61486;P[118]=47;P[86]=61487;P[98]=48;P[66]=61488;P[110]=49;P[78]=61489;P[109]=50;P[77]=61490;P[44]=51;P[60]=61491;P[46]=52;P[62]=61492;P[47]=53;P[63]=61493;P[8]=14;P[9]=15;P[13]=28;P[27]=1;P[240]=42;P[224]=54;P[241]=29;P[242]=56;P[244]=58;P[336]=59;P[337]=60;P[338]=61;
|
||||
P[339]=62;P[340]=63;P[341]=64;P[342]=65;P[343]=66;P[344]=67;P[345]=68;P[261]=75;P[262]=72;P[263]=77;P[264]=80;P[254]=61766;P[255]=15921491;k=Xi.prototype;
|
||||
k.xb=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.sa[a])switch(c){case "kbd":return this.sa[a]=d,d.onkeydown=function(a){return $i(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.Ea&32?e.Ea&=-33:b=e.Ea&12?!1:!aj(e,a);return b},d.onkeyup=function(a){return $i(e,a,!1)},!0;default:if(void 0!==Zi[c]&&"button"==b)return this.sa[a]=d,d.onclick=function(a,b,c){return function(){a.S&&a.S.Md();return!aj(a,c)}}(this,c,Zi[c]),!0;if(void 0!==Yi[c])return this.sa[a]=
|
||||
d,b=function(a,b,c){return function(){bj(a,c)}}(this,c,Yi[c]),c=function(a,b,c){return function(){bj(a,c)}}(this,c,Yi[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c):(d.onmousedown=b,d.onmouseup=d.onmouseout=c),!0}return!1};k.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.ka=C(a,"ChipSet")};k.Ta=function(){this.yk=(this.Om=va("iOS"))||va("Android");this.Qa("mobile keyboard support: "+(this.yk?"true":"false"));return x.prototype.Ta.call(this)};
|
||||
function Li(a){a.Qa("keyboard reset",!0);a.zc=[170];a.ka&&zi(a.ka,1,4)}function Hi(a,b,c){var d=!1;a.xi!==c&&(a.xi=a.Di=c);a.lh!==b&&(a.lh=b)&&!a.Di&&Mi(a);a.lh&&a.Di&&(Li(a),a.Di=!1,d=!0);return d}function Fi(a,b){var c=0;a.zc.length&&(c=a.zc[0],a.Qa("scan code "+r(c)+" delivered"),b&&Mi(a));return c}function Mi(a,b){0<a.zc.length&&(b?a.zc=[]:(a.zc.shift(),0<a.zc.length&&a.ka&&zi(a.ka,1)))}k.$b=function(a,b){return!b&&(this.reset(),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.ie();this.Ea=0;this.zc=[];if(this.qd)for(var a in this.qd)ba(a)||this.qd[a]&&clearTimeout(this.qd[a]);this.qd=[];this.Vl=this.Me=0};k.save=function(){var a=new H(this);a.set(0,this.Vj());return a.data()};k.restore=function(a){return this.ie(a[0])};k.ie=function(a){var b=0;void 0===a&&(a=[]);this.xi=a[b++];this.lh=a[b];return!0};k.Vj=function(){var a=0,b=[];b[a++]=this.xi;b[a]=this.lh;return b};
|
||||
function bj(a,b){var c=b&127,d=c==b;if(a.zc)if(20>a.zc.length){if(!(!d&&!a.$h[c]||d&&a.$h[c])){a.$h[c]=d;a.Qa("scan code "+r(b)+" buffered");a.zc.push(b);1==a.zc.length&&a.ka&&zi(a.ka,1);for(var e in Yi)if(Yi[e]==c){(c=a.sa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.zc.length&&a.zc.push(255),a.Qa("scan code buffer overflow")}function cj(a,b){var c=b?a.Wn:a.Vn;a.S&&a.S.ld&&(c/=a.S.ld);return c}
|
||||
d,b=function(a,b,c){return function(){bj(a,c)}}(this,c,Yi[c]),c=function(a,b,c){return function(){bj(a,c)}}(this,c,Yi[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c):(d.onmousedown=b,d.onmouseup=d.onmouseout=c),!0}return!1};k.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.ka=C(a,"ChipSet")};k.Ta=function(){this.Bk=(this.Rm=va("iOS"))||va("Android");this.Qa("mobile keyboard support: "+(this.Bk?"true":"false"));return x.prototype.Ta.call(this)};
|
||||
function Li(a){a.Qa("keyboard reset",!0);a.zc=[170];a.ka&&zi(a.ka,1,4)}function Hi(a,b,c){var d=!1;a.zi!==c&&(a.zi=a.Fi=c);a.lh!==b&&(a.lh=b)&&!a.Fi&&Mi(a);a.lh&&a.Fi&&(Li(a),a.Fi=!1,d=!0);return d}function Fi(a,b){var c=0;a.zc.length&&(c=a.zc[0],a.Qa("scan code "+r(c)+" delivered"),b&&Mi(a));return c}function Mi(a,b){0<a.zc.length&&(b?a.zc=[]:(a.zc.shift(),0<a.zc.length&&a.ka&&zi(a.ka,1)))}k.ac=function(a,b){return!b&&(this.reset(),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.ie();this.Ea=0;this.zc=[];if(this.qd)for(var a in this.qd)ba(a)||this.qd[a]&&clearTimeout(this.qd[a]);this.qd=[];this.Yl=this.Me=0};k.save=function(){var a=new H(this);a.set(0,this.Yj());return a.data()};k.restore=function(a){return this.ie(a[0])};k.ie=function(a){var b=0;void 0===a&&(a=[]);this.zi=a[b++];this.lh=a[b];return!0};k.Yj=function(){var a=0,b=[];b[a++]=this.zi;b[a]=this.lh;return b};
|
||||
function bj(a,b){var c=b&127,d=c==b;if(a.zc)if(20>a.zc.length){if(!(!d&&!a.bi[c]||d&&a.bi[c])){a.bi[c]=d;a.Qa("scan code "+r(b)+" buffered");a.zc.push(b);1==a.zc.length&&a.ka&&zi(a.ka,1);for(var e in Yi)if(Yi[e]==c){(c=a.sa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.zc.length&&a.zc.push(255),a.Qa("scan code buffer overflow")}function cj(a,b){var c=b?a.Zn:a.Yn;a.S&&a.S.ld&&(c/=a.S.ld);return c}
|
||||
function dj(a,b){!a.Me||void 0!==b&&b==a.Me||(clearTimeout(a.qd[a.Me]),ej(a,a.Me,!1))}
|
||||
function $i(a,b,c){var d,e=!c,f=b.keyCode;c&&(a.Vl=f);240==f+224?(a.Ea&=-2,c&&(a.Ea|=1),f+=224,e=!1):241==f+224?(a.Ea&=-5,c&&(a.Ea|=4),f+=224,e=!1):242==f+224?(a.Ea&=-9,c&&(a.Ea|=8),f+=224,e=!1):244==f+224?(a.Ea&=-17,c&&(a.Ea|=16),f+=224,d=aj(a,f)):91==f?(a.Ea&=-33,c&&(a.Ea|=32),e=!1,d=!0):9==f||27==f||8==f?(8==f&&4==(a.Ea&12)&&(f=254),d=c?!aj(a,f):!1):void 0!==P[f+224]?f+=224:b.altKey||b.ctrlKey?65<=f&&90>=f&&(f+=32):d=!0;e&&(a.Ea&=-33,a.yk||f!=a.Vl||dj(a));void 0===d&&(d=!ej(a,f,c));return d}
|
||||
function $i(a,b,c){var d,e=!c,f=b.keyCode;c&&(a.Yl=f);240==f+224?(a.Ea&=-2,c&&(a.Ea|=1),f+=224,e=!1):241==f+224?(a.Ea&=-5,c&&(a.Ea|=4),f+=224,e=!1):242==f+224?(a.Ea&=-9,c&&(a.Ea|=8),f+=224,e=!1):244==f+224?(a.Ea&=-17,c&&(a.Ea|=16),f+=224,d=aj(a,f)):91==f?(a.Ea&=-33,c&&(a.Ea|=32),e=!1,d=!0):9==f||27==f||8==f?(8==f&&4==(a.Ea&12)&&(f=254),d=c?!aj(a,f):!1):void 0!==P[f+224]?f+=224:b.altKey||b.ctrlKey?65<=f&&90>=f&&(f+=32):d=!0;e&&(a.Ea&=-33,a.Bk||f!=a.Yl||dj(a));void 0===d&&(d=!ej(a,f,c));return d}
|
||||
function aj(a,b,c){var d=!1;dj(a,b);ej(a,b,!0)&&(c?ej(a,b,!1):(c=!1,a.qd[b]&&(clearTimeout(a.qd[b]),c=!0),c=cj(a,c),a.qd[a.Me=b]=setTimeout(function(a){return function(){ej(a,b,!1)}}(a),c)),d=!0);return d}
|
||||
function ej(a,b,c){var d=!1;c||(a.qd[b]=null,a.Me==b&&(a.Me=0));var e=P[b];void 0===e&&1<=b&&26>=b&&(e=P[b+64]&255|61696);if(void 0!==e){14==e&&12==(a.Ea&12)&&(e=83);b=[];for(b.push(e&255|(c?0:128));e>>=8;){var d=0,f=e&255;240==f?a.Ea&17||(d=42):224==f?a.Ea&18||(d=54):241==f?a.Ea&4||(d=29):242==f&&(a.Ea&8||(d=56));d&&(c?b.unshift(d):b.push(d|128))}for(c=0;c<b.length;c++)bj(a,b[c]);d=!0}return d}k.Qa=function(a,b){this.X&&E(this.X,this.X.ak|(b?this.X.bk:0))&&this.X.message(a)};
|
||||
function ej(a,b,c){var d=!1;c||(a.qd[b]=null,a.Me==b&&(a.Me=0));var e=P[b];void 0===e&&1<=b&&26>=b&&(e=P[b+64]&255|61696);if(void 0!==e){14==e&&12==(a.Ea&12)&&(e=83);b=[];for(b.push(e&255|(c?0:128));e>>=8;){var d=0,f=e&255;240==f?a.Ea&17||(d=42):224==f?a.Ea&18||(d=54):241==f?a.Ea&4||(d=29):242==f&&(a.Ea&8||(d=56));d&&(c?b.unshift(d):b.push(d|128))}for(c=0;c<b.length;c++)bj(a,b[c]);d=!0}return d}k.Qa=function(a,b){this.X&&E(this.X,this.X.dk|(b?this.X.ek:0))&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Xi(d);Oa(d,c)}});
|
||||
function Q(a,b,c,d){x.call(this,"Video",a,Q);this.Fa=a.model;this.Vc=0;"ega"==this.Fa&&(this.cm=a.switches,this.Vc=a.memory||0);this.nd=a.mode;if(void 0===this.nd||void 0===R[this.nd])this.nd=fj;this.Bh=a.charCols;this.Ti=a.charRows;if(void 0===this.Bh||void 0===this.Ti)this.Bh=R[this.nd][0],this.Ti=R[this.nd][1];this.xd=a.screenWidth;this.fe=a.screenHeight;this.Fm=a.scale;this.Dm=12<=Math.round(this.xd/this.Bh);this.Hm=a.touchScreen;this.Lb=b;this.Xc=c;this.hm=d;this.cb=this.tc=0;this.Td=[];this.td=
|
||||
Array(16);this.zi=!1;var e=this;this.Lb&&(this.Lb.onfocus=function(){e.zi=!0},this.Lb.onblur=function(){e.zi=!1});if(a=a.fontROM)"json"!=fa(a)&&(a=sa()+"/api/v1/dump?file="+a+"&format=bytes"),ra(a,!0,null,this,this.ho)}y(x,Q);
|
||||
var gj={2:{Wi:15700,Vi:208,Lj:85,Mj:96},3:{Wi:18432,Vi:364,Lj:85,Mj:96},4:{Wi:21850,Vi:364,Lj:85,Mj:96}},hj={6:[1,3,!0],7:[2,3,!0],8:[6,3,!0],9:[4,3,!0],10:[3,1,!0],11:[3,2,!0],0:[1,3,!1],1:[2,3,!1],2:[6,3,!1],3:[4,3,!1],4:[3,1,!1],5:[3,2,!1]},fj=7,R=[,[40,25,1,0,3],,[80,25,1,0,3],[320,200,8,192],,[640,200,16,192]];R[fj]=[80,25,1,0,1];R[13]=[320,200,16];R[14]=[640,200,16];R[15]=[640,350,16];R[16]=[640,350,16];R[0]=R[1];R[2]=R[3];R[5]=R[4];var ij=Array(5);ij[0]=[0,0,0,255];ij[1]=[127,192,127,255];
|
||||
function Q(a,b,c,d){x.call(this,"Video",a,Q);this.Fa=a.model;this.Vc=0;"ega"==this.Fa&&(this.fm=a.switches,this.Vc=a.memory||0);this.nd=a.mode;if(void 0===this.nd||void 0===R[this.nd])this.nd=fj;this.Bh=a.charCols;this.Vi=a.charRows;if(void 0===this.Bh||void 0===this.Vi)this.Bh=R[this.nd][0],this.Vi=R[this.nd][1];this.xd=a.screenWidth;this.fe=a.screenHeight;this.Im=a.scale;this.Gm=12<=Math.round(this.xd/this.Bh);this.Km=a.touchScreen;this.Lb=b;this.Xc=c;this.km=d;this.cb=this.tc=0;this.Td=[];this.td=
|
||||
Array(16);this.Bi=!1;var e=this;this.Lb&&(this.Lb.onfocus=function(){e.Bi=!0},this.Lb.onblur=function(){e.Bi=!1});if(a=a.fontROM)"json"!=fa(a)&&(a=sa()+"/api/v1/dump?file="+a+"&format=bytes"),ra(a,!0,null,this,this.ko)}y(x,Q);
|
||||
var gj={2:{Zi:15700,Yi:208,Oj:85,Pj:96},3:{Zi:18432,Yi:364,Oj:85,Pj:96},4:{Zi:21850,Yi:364,Oj:85,Pj:96}},hj={6:[1,3,!0],7:[2,3,!0],8:[6,3,!0],9:[4,3,!0],10:[3,1,!0],11:[3,2,!0],0:[1,3,!1],1:[2,3,!1],2:[6,3,!1],3:[4,3,!1],4:[3,1,!1],5:[3,2,!1]},fj=7,R=[,[40,25,1,0,3],,[80,25,1,0,3],[320,200,8,192],,[640,200,16,192]];R[fj]=[80,25,1,0,1];R[13]=[320,200,16];R[14]=[640,200,16];R[15]=[640,350,16];R[16]=[640,350,16];R[0]=R[1];R[2]=R[3];R[5]=R[4];var ij=Array(5);ij[0]=[0,0,0,255];ij[1]=[127,192,127,255];
|
||||
ij[2]=[127,192,127,255];ij[3]=[127,255,127,255];ij[4]=[127,255,127,255];var jj=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],S=Array(16);S[0]=[0,0,0,255];S[1]=[0,0,170,255];S[2]=[0,170,0,255];S[3]=[0,170,170,255];S[4]=[170,0,0,255];S[5]=[170,0,170,255];S[6]=[170,85,0,255];S[7]=[170,170,170,255];S[8]=[85,85,85,255];S[9]=[85,85,255,255];S[10]=[85,255,85,255];S[11]=[85,255,255,255];S[12]=[255,85,85,255];S[13]=[255,85,255,255];S[14]=[255,255,85,255];S[15]=[255,255,255,255];
|
||||
var kj=[2,4,6],lj=[3,5,7],mj=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],nj=[0,255,65280,65535,16711680,16711935,16776960,16777215,4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295],T=[0];T[128]=1;T[32768]=2;T[32896]=3;T[8388608]=4;T[8388736]=5;T[8421376]=6;T[8421504]=7;T[2147483648]=8;T[2147483776]=9;T[2147516416]=10;T[2147516544]=11;T[2155872256]=12;T[2155872384]=13;T[2155905024]=14;T[2155905152]=15;
|
||||
function oj(a,b,c,d){if(void 0!==b&&(!c||c.length)){var e=pj[b],f=a.je||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(qj)];this.X=a.X;this.type=e[0];this.port=e[1];this.he=b;this.cb=e[2];this.tc=e[3];this.Vc=d||e[4];65536<=this.Vc&&720896<=this.cb&&(this.tc=Math.min(this.Vc>>2,32768));this.kc=c[0];this.Bc=c[1];this.$e=c[2];this.vf=c[3];this.mc=c[4]&255;this.rh=c[4]>>8&255;this.bc=c[5];this.Ni=qj;this.Qg=rj;if(5==b){this.Ni=sj;this.Qg=tj;b=c[6];void 0===b&&(b=[!1,0,Array(20),0,3==f?0:1,0,0,Array(5),
|
||||
0,0,0,Array(9),0,this.Vc,Array(this.Vc>>2),771,0,4294967295,0,4294967295,0,4294967295,0]);this.hd=b[0];this.Bd=b[1];this.Rd=b[2];this.ci=uj;this.Rh=b[3];this.bg=b[4];this.qh=b[5];this.Dd=b[6];this.Ff=b[7];this.ei=vj;this.Hi=b[8];this.Ii=b[9];this.Cd=b[10];this.se=b[11];this.di=wj;this.vb=b[12];d=this.Vc>>2;if((this.ed=b[14])&&this.ed.length<d){for(var e=this.ed,g=0,h=Array(d),m=0;m<e.length-1;){for(var n=e[m++],q=e[m++];n--;)h[g]=q,g+=2;g==d&&(g=1)}this.ed=h}this.Oh(b[15]);this.Gj=b[16];this.gb=b[17];
|
||||
this.md=b[18];this.ob=b[19];this.Dh=b[20];this.le=b[21];this.Je=b[22];this.Pi=b[23];this.Qi=b[24]}f=gj[f]||gj[3];this.Ri=a.S.Hd/f.Wi|0;this.Zn=this.Ri*f.Lj/100|0;this.Pk=this.Ri*f.Vi;this.bo=this.Pk*f.Mj/100|0;this.Xi=null==c[7]?0:c[7]}}
|
||||
function oj(a,b,c,d){if(void 0!==b&&(!c||c.length)){var e=pj[b],f=a.je||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(qj)];this.X=a.X;this.type=e[0];this.port=e[1];this.he=b;this.cb=e[2];this.tc=e[3];this.Vc=d||e[4];65536<=this.Vc&&720896<=this.cb&&(this.tc=Math.min(this.Vc>>2,32768));this.mc=c[0];this.Bc=c[1];this.$e=c[2];this.vf=c[3];this.oc=c[4]&255;this.rh=c[4]>>8&255;this.cc=c[5];this.Pi=qj;this.Qg=rj;if(5==b){this.Pi=sj;this.Qg=tj;b=c[6];void 0===b&&(b=[!1,0,Array(20),0,3==f?0:1,0,0,Array(5),
|
||||
0,0,0,Array(9),0,this.Vc,Array(this.Vc>>2),771,0,4294967295,0,4294967295,0,4294967295,0]);this.hd=b[0];this.Bd=b[1];this.Rd=b[2];this.ei=uj;this.Th=b[3];this.bg=b[4];this.qh=b[5];this.Dd=b[6];this.Ff=b[7];this.gi=vj;this.Ji=b[8];this.Ki=b[9];this.Cd=b[10];this.se=b[11];this.fi=wj;this.vb=b[12];d=this.Vc>>2;if((this.ed=b[14])&&this.ed.length<d){for(var e=this.ed,g=0,h=Array(d),m=0;m<e.length-1;){for(var n=e[m++],q=e[m++];n--;)h[g]=q,g+=2;g==d&&(g=1)}this.ed=h}this.Qh(b[15]);this.Jj=b[16];this.gb=b[17];
|
||||
this.md=b[18];this.nb=b[19];this.Fh=b[20];this.le=b[21];this.Je=b[22];this.Ri=b[23];this.Si=b[24]}f=gj[f]||gj[3];this.Ti=a.S.Hd/f.Zi|0;this.bo=this.Ti*f.Oj/100|0;this.Sk=this.Ti*f.Yi;this.fo=this.Sk*f.Pj/100|0;this.$i=null==c[7]?0:c[7]}}
|
||||
var qj=18,sj=25,rj="HORZ_TOTAL HORZ_DISP HORZ_SYNC_POS HORZ_SYNC_WIDTH VERT_TOTAL VERT_TOTAL_ADJ VERT_DISP VERT_SYNC_POS INTERLACE_POS MAX_SCAN_LINE CURSOR_START CURSOR_END START_ADDR_HI START_ADDR_LO CURSOR_ADDR_HI CURSOR_ADDR_LO LIGHT_PEN_HI LIGHT_PEN_LO".split(" "),tj="HORZ_TOTAL HORZ_DISP_END HORZ_BLANK_START HORZ_BLANK_END HORZ_RETRACE_START HORZ_RETRACE_END VERT_TOTAL CRTC_OVERFLOW PRESET_ROW_SCAN MAX_SCAN_LINE CURSOR_START CURSOR_END START_ADDR_HI START_ADDR_LO CURSOR_ADDR_HI CURSOR_ADDR_LO LIGHT_PEN_HI LIGHT_PEN_LO VERT_DISP_END OFFSET UNDERLINE VERT_BLANK_START VERT_BLANK_END MODE_CTRL LONE_COMPARE".split(" "),
|
||||
uj="PAL00 PAL01 PAL02 PAL03 PAL04 PAL05 PAL06 PAL07 PAL08 PAL09 PAL0A PAL0B PAL0C PAL0D PAL0E PAL0F MODE OVRSCAN PLANES HORZPAN".split(" "),vj=["RESET","CLK","MAPMASK","CHARMAP","MODE"],wj="SRESET ESRESET COLRCMP DATAROT READMAP MODE MISC COLRDC BITMASK".split(" ");function xj(a){return this.sc(a)|this.sc(a+1)<<8}function yj(a,b){this.Dc(a,b&255);this.Dc(a+1,b>>8&255)}
|
||||
var U=[,,function(a){a+=this.offset;return(this.ia.vb=this.ra[a])>>this.ia.Gj&255},function(a){a+=this.offset;var b=a&-2;return(a&1?this.ra[b]>>8:this.ra[b])&255}];U[16]=function(a){a+=this.offset;a=this.ra[a];for(var b=this.ia.Pi&this.ia.Qi,c=0,d=128;d;)(a&b)==b&&(c|=d),b>>>=1,d>>=1;return c};U[512]=function(a,b){var c=a+this.offset,d;d=this.ra[c]&~this.ia.gb|(b|b<<8|b<<16|b<<24)&this.ia.gb;d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};
|
||||
U[1024]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};
|
||||
U[1536]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d&=this.ia.vb;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};
|
||||
U[2560]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d|=this.ia.vb;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};
|
||||
U[3584]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d^=this.ia.vb;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};U[768]=function(a,b){a+=this.offset;var c,d=a&-2;c=this.ia.gb&(d==a?16711935:4278255360);c=(b|b<<8|b<<16|b<<24)&c|this.ra[d]&~c;c=c&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[d]!=c&&(this.ra[d]=c,this.mb=!0)};
|
||||
U[4096]=function(a){a+=this.offset;var b=this.ra[a]&~this.ia.gb|this.ia.vb&this.ia.gb;this.ra[a]!=b&&(this.ra[a]=b,this.mb=!0)};U[8192]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};U[24576]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d&this.ia.vb,d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};
|
||||
U[40960]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d|this.ia.vb,d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};U[57344]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d^this.ia.vb,d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.ob|this.ia.vb&~this.ia.ob;this.ra[c]!=d&&(this.ra[c]=d,this.mb=!0)};
|
||||
function zj(a){var b=[];if(void 0!==a.he){b[0]=a.kc;b[1]=a.Bc;b[2]=a.$e;b[3]=a.vf;b[4]=a.mc|a.rh<<8;b[5]=a.bc;if(5==a.he){var c=[];c[0]=a.hd;c[1]=a.Bd;c[2]=a.Rd;c[3]=a.Rh;c[4]=a.bg;c[5]=a.qh;c[6]=a.Dd;c[7]=a.Ff;c[8]=a.Hi;c[9]=a.Ii;c[10]=a.Cd;c[11]=a.se;c[12]=a.vb;c[13]=a.Vc;var d;a:if(d=a.ed){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var m=d[h],n=h+2;n<d.length&&d[n]===m;)n+=2;f[e++]=n-h>>1;f[e++]=m;h=n}if(f.length<d.length){d=f;break a}}c[14]=d;c[15]=a.yh;c[16]=
|
||||
a.Gj;c[17]=a.gb;c[18]=a.md;c[19]=a.ob;c[20]=a.Dh;c[21]=a.le;c[22]=a.Je;c[23]=a.Pi;c[24]=a.Qi;b[6]=c}b[7]=a.Xi}return b}function Aj(a,b,c,d,e){if(d){var f="",g,h=0;for(g=0;g<e.length;g++)h<e[g].length&&(h=e[g].length);h++;for(g=0;g<e.length;g++){f&&(f+="\n");var m=e[g],f=f+(b+"["+r(g)+"]: "+(m+" ".substr(0,h-m.length))+r(d[g])+(g===c?"*":""))}a.X.message(f)}else a.X.message(b+": "+r(c))}
|
||||
oj.prototype.Oh=function(a){if(null!=a&&a!=this.yh){var b=a&255,c=U[b];c||b&1&&(c=U[1]);var b=a&65280,d=U[b];d||b&256&&(d=U[256]);this.Jf||(this.Jf=[null,xj,null,yj]);this.Jf[0]=c;this.Jf[2]=d;this.yh=a}};var pj=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];k=Q.prototype;
|
||||
k.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;ib(b,this,Bj);mb(b,this,Cj);"ega"==this.Fa&&(ib(b,this,Dj),mb(b,this,Ej));if(d){var e=this;Cc(this.S,16,this,this.On);Qh(d,d.Hg,function(a){if(e.Ca)if(a){var b=e.Ca;if(b.ed){a=ca(a);a=void 0!==a?a-b.cb:b.ep||0;0>a&&(a=0);for(var c="",d=0;8>d;d++){for(var n=p(b.cb+a)+":",q=0;8>q&&a<b.ed.length;q++)var t=b.ed[a++],n=n+(" "+p(t));c&&(c+="\n");c+=n}c&&b.X.message(c);b.ep=a}else b.X.message("no buffer")}else{e.X.message("BIOSMODE: "+r(e.Jd));b=e.Ca;Aj(b,
|
||||
"CRTC",b.mc,b.bc,b.Qg);if(1==b.he||3==b.he)Aj(b," MODEREG",b.Bc),Aj(b," STATUS1",b.vf);3==b.he&&Aj(b," COLOR",b.$e);5==b.he&&(b.X.message(" ATCDATA: "+b.hd),Aj(b," ATC",b.Bd,b.Rd,b.ci),Aj(b," GRC",b.Cd,b.se,b.di),Aj(b," SEQ",b.Dd,b.Ff,b.ei),Aj(b," FEAT",b.qh),Aj(b," MISC",b.bg),Aj(b," STATUS0",b.Rh),Aj(b," LATCHES",b.vb),b.X.message(" ACCESS: "+u(b.yh)),b.X.message("Use 'dump video buffer' to dump video memory"))}else e.X.message("no active video card")})}(this.bb=C(a,"Keyboard"))&&this.Lb&&
|
||||
this.bb.xb("input",this.hm?"textarea":"canvas","kbd",this.hm||this.Lb);this.Sg=9;(this.ka=C(a,"ChipSet"))&&this.cm&&(this.Sg=Ch(this.cm,this.Sg));this.bb&&this.Hm&&Fj(this)};k.On=function(a){this.X&&E(this.X,this.X.Hg)&&(Ec(this.X,16,a),Fc(this.S,a,function(a,c){return function(d){Gc(a.X,16,d,F(a.S)-c)}}(this,F(this.S))));return!0};k.xb=function(a,b,c,d){var e=this;switch(c){case "refresh":return this.sa[c]=d,d.onclick=function(){zb(e,!0)},!0}return!1};k.Md=function(){this.Lb&&this.Lb.focus()};
|
||||
function Fj(a){var b=a.Lb;b&&!a.wi&&(b.addEventListener("touchstart",function(b){Gj(a,b)},!1),b.addEventListener("touchmove",function(b){Gj(a,b)},!0),b.addEventListener("touchend",function(){},!1),a.wi=!0)}
|
||||
function Gj(a,b){a.zi&&b.preventDefault();var c=0,d=0,e=a.Lb;do isNaN(e.offsetLeft)||(c+=e.offsetLeft,d+=e.offsetTop);while(e=e.offsetParent);c=a.xd/a.Lb.offsetWidth*(b.targetTouches[0].pageX-c)/(a.xd/3)|0;d=a.fe/a.Lb.offsetHeight*(b.targetTouches[0].pageY-d)/(a.fe/3)|0;1!=d?d?aj(a.bb,264,!0):aj(a.bb,262,!0):1!=c&&(c?aj(a.bb,263,!0):aj(a.bb,261,!0))}k.$b=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
var U=[,,function(a){a+=this.offset;return(this.ia.vb=this.ra[a])>>this.ia.Jj&255},function(a){a+=this.offset;var b=a&-2;return(a&1?this.ra[b]>>8:this.ra[b])&255}];U[16]=function(a){a+=this.offset;a=this.ra[a];for(var b=this.ia.Ri&this.ia.Si,c=0,d=128;d;)(a&b)==b&&(c|=d),b>>>=1,d>>=1;return c};U[512]=function(a,b){var c=a+this.offset,d;d=this.ra[c]&~this.ia.gb|(b|b<<8|b<<16|b<<24)&this.ia.gb;d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};
|
||||
U[1024]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};
|
||||
U[1536]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d&=this.ia.vb;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};
|
||||
U[2560]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d|=this.ia.vb;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};
|
||||
U[3584]=function(a,b){var c=a+this.offset;b=b>>this.ia.md|b<<8-this.ia.md&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ia.le|this.ia.Je;d^=this.ia.vb;d=d&this.ia.gb|this.ra[c]&~this.ia.gb;d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};U[768]=function(a,b){a+=this.offset;var c,d=a&-2;c=this.ia.gb&(d==a?16711935:4278255360);c=(b|b<<8|b<<16|b<<24)&c|this.ra[d]&~c;c=c&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[d]!=c&&(this.ra[d]=c,this.lb=!0)};
|
||||
U[4096]=function(a){a+=this.offset;var b=this.ra[a]&~this.ia.gb|this.ia.vb&this.ia.gb;this.ra[a]!=b&&(this.ra[a]=b,this.lb=!0)};U[8192]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};U[24576]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d&this.ia.vb,d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};
|
||||
U[40960]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d|this.ia.vb,d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};U[57344]=function(a,b){var c=a+this.offset,d=nj[b&15],d=d^this.ia.vb,d=d&this.ia.gb|this.ra[c]&~this.ia.gb,d=d&this.ia.nb|this.ia.vb&~this.ia.nb;this.ra[c]!=d&&(this.ra[c]=d,this.lb=!0)};
|
||||
function zj(a){var b=[];if(void 0!==a.he){b[0]=a.mc;b[1]=a.Bc;b[2]=a.$e;b[3]=a.vf;b[4]=a.oc|a.rh<<8;b[5]=a.cc;if(5==a.he){var c=[];c[0]=a.hd;c[1]=a.Bd;c[2]=a.Rd;c[3]=a.Th;c[4]=a.bg;c[5]=a.qh;c[6]=a.Dd;c[7]=a.Ff;c[8]=a.Ji;c[9]=a.Ki;c[10]=a.Cd;c[11]=a.se;c[12]=a.vb;c[13]=a.Vc;var d;a:if(d=a.ed){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var m=d[h],n=h+2;n<d.length&&d[n]===m;)n+=2;f[e++]=n-h>>1;f[e++]=m;h=n}if(f.length<d.length){d=f;break a}}c[14]=d;c[15]=a.yh;c[16]=
|
||||
a.Jj;c[17]=a.gb;c[18]=a.md;c[19]=a.nb;c[20]=a.Fh;c[21]=a.le;c[22]=a.Je;c[23]=a.Ri;c[24]=a.Si;b[6]=c}b[7]=a.$i}return b}function Aj(a,b,c,d,e){if(d){var f="",g,h=0;for(g=0;g<e.length;g++)h<e[g].length&&(h=e[g].length);h++;for(g=0;g<e.length;g++){f&&(f+="\n");var m=e[g],f=f+(b+"["+r(g)+"]: "+(m+" ".substr(0,h-m.length))+r(d[g])+(g===c?"*":""))}a.X.message(f)}else a.X.message(b+": "+r(c))}
|
||||
oj.prototype.Qh=function(a){if(null!=a&&a!=this.yh){var b=a&255,c=U[b];c||b&1&&(c=U[1]);var b=a&65280,d=U[b];d||b&256&&(d=U[256]);this.Jf||(this.Jf=[null,xj,null,yj]);this.Jf[0]=c;this.Jf[2]=d;this.yh=a}};var pj=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];k=Q.prototype;
|
||||
k.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;ib(b,this,Bj);mb(b,this,Cj);"ega"==this.Fa&&(ib(b,this,Dj),mb(b,this,Ej));if(d){var e=this;Cc(this.S,16,this,this.Rn);Qh(d,d.Hg,function(a){if(e.Ca)if(a){var b=e.Ca;if(b.ed){a=ca(a);a=void 0!==a?a-b.cb:b.hp||0;0>a&&(a=0);for(var c="",d=0;8>d;d++){for(var n=p(b.cb+a)+":",q=0;8>q&&a<b.ed.length;q++)var t=b.ed[a++],n=n+(" "+p(t));c&&(c+="\n");c+=n}c&&b.X.message(c);b.hp=a}else b.X.message("no buffer")}else{e.X.message("BIOSMODE: "+r(e.Jd));b=e.Ca;Aj(b,
|
||||
"CRTC",b.oc,b.cc,b.Qg);if(1==b.he||3==b.he)Aj(b," MODEREG",b.Bc),Aj(b," STATUS1",b.vf);3==b.he&&Aj(b," COLOR",b.$e);5==b.he&&(b.X.message(" ATCDATA: "+b.hd),Aj(b," ATC",b.Bd,b.Rd,b.ei),Aj(b," GRC",b.Cd,b.se,b.fi),Aj(b," SEQ",b.Dd,b.Ff,b.gi),Aj(b," FEAT",b.qh),Aj(b," MISC",b.bg),Aj(b," STATUS0",b.Th),Aj(b," LATCHES",b.vb),b.X.message(" ACCESS: "+u(b.yh)),b.X.message("Use 'dump video buffer' to dump video memory"))}else e.X.message("no active video card")})}(this.bb=C(a,"Keyboard"))&&this.Lb&&
|
||||
this.bb.xb("input",this.km?"textarea":"canvas","kbd",this.km||this.Lb);this.Sg=9;(this.ka=C(a,"ChipSet"))&&this.fm&&(this.Sg=Ch(this.fm,this.Sg));this.bb&&this.Km&&Fj(this)};k.Rn=function(a){this.X&&E(this.X,this.X.Hg)&&(Ec(this.X,16,a),Fc(this.S,a,function(a,c){return function(d){Gc(a.X,16,d,F(a.S)-c)}}(this,F(this.S))));return!0};k.xb=function(a,b,c,d){var e=this;switch(c){case "refresh":return this.sa[c]=d,d.onclick=function(){zb(e,!0)},!0}return!1};k.Md=function(){this.Lb&&this.Lb.focus()};
|
||||
function Fj(a){var b=a.Lb;b&&!a.yi&&(b.addEventListener("touchstart",function(b){Gj(a,b)},!1),b.addEventListener("touchmove",function(b){Gj(a,b)},!0),b.addEventListener("touchend",function(){},!1),a.yi=!0)}
|
||||
function Gj(a,b){a.Bi&&b.preventDefault();var c=0,d=0,e=a.Lb;do isNaN(e.offsetLeft)||(c+=e.offsetLeft,d+=e.offsetTop);while(e=e.offsetParent);c=a.xd/a.Lb.offsetWidth*(b.targetTouches[0].pageX-c)/(a.xd/3)|0;d=a.fe/a.Lb.offsetHeight*(b.targetTouches[0].pageY-d)/(a.fe/3)|0;1!=d?d?aj(a.bb,264,!0):aj(a.bb,262,!0):1!=c&&(c?aj(a.bb,263,!0):aj(a.bb,261,!0))}k.ac=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
k.Wb=function(a){return a&&this.save?this.save():!0};
|
||||
k.reset=function(){var a=!0,b=0;this.ka&&(b=Yh(this.ka));var c=!1;if(this.Fa)switch(this.Fa){case "ega":var c=!0,d=hj[this.Sg];d&&(b=d[0]);b||(b=4);break;case "mda":b=3;break;default:b=2}this.je!==b&&(this.je=b,a=!0);this.Ca=null;this.Uc=this.ki=new oj(this,1);this.zb=this.bh=new oj(this,3);c?(this.la=new oj(this,5,null,this.Vc),Hj(this)):this.la=new oj;Ij(this);this.Jd=null;this.nd=3==b?fj:3;this.Be=this.Lc=-1;this.Ae=0;Jj(this,this.nd);if(this.Ca.cb&&a){a=this.Ca.cb+this.li;for(b=this.Ca.cb;b<a;b+=
|
||||
2)d=Math.floor(65536*Math.random()),4==this.je?(c=b>>1&255,d=d>>8&-129,d>>4==(d&15)&&(d^=15)):(c=d&255,d=(d&256?7:112)|8&d>>8),eb(this.na,b,c|d<<8);zb(this,!0)}};function Hj(a){a.la.bg&1?(a.Uc=a.ki,a.zb=a.la):(a.Uc=a.la,a.zb=a.bh)}k.save=function(){var a=new H(this);a.set(0,zj(this.ki));a.set(1,zj(this.bh));a.set(2,[this.je,this.nd,this.Jd]);a.set(3,zj(this.la));return a.data()};
|
||||
k.restore=function(a){var b=a[2];this.je=b[0];this.nd=b[1];this.Jd=b[2];this.Ca=null;this.Uc=this.ki=new oj(this,1,a[0]);this.zb=this.bh=new oj(this,3,a[1]);this.la=new oj(this,5,a[3],this.Vc);this.la.kc&&Hj(this);Ij(this);if(!Kj(this))return!1;Lj(this);return!0};
|
||||
k.ho=function(a,b,c){if(c)this.Ga("Unable to load font ROM image (error "+c+")");else{try{var d=eval("("+b+")");if(!d.length){w("Empty font ROM image: "+a);return}if(1==d.length){w(d[0]);return}if(8192==d.length)Ri(this,d,[0,6144]);else{this.Ga("Unrecognized font data length ("+d.length+")");return}}catch(e){this.Ga("Font ROM data error: "+e.message);return}this.Ta()}};
|
||||
function Mj(a,b){if(1==b)return a.td[0]=S[0],a.td[1]=S[7],a.td;if(2==b){var c=a.Ca.$e;if(a.Ca===a.la){var d=a.la.Rd[0],c=d&7;d&16&&(c|=8);18!=a.la.Rd[1]&&(c|=32)}a.td[0]=S[c&15];c=c&32?lj:kj;for(d=0;d<c.length;d++)a.td[d+1]=S[c[d]];return a.td}if(a.zb===a.bh)return S;c=null!=a.la.Rd[15]?a.la.Rd:mj;for(d=0;d<a.td.length;d++){var e=c[d]||0;a.td[d]=[(e&4?170:0)|(e&32?85:0),(e&2?170:0)|(e&16?85:0),(e&1?170:0)|(e&8?85:0),255]}return a.td}function Ri(a,b,c,d){a.Og=b;a.Zh=c;a.De=d}
|
||||
function Ij(a){var b=!1;if(window&&a.Og){var c=a.De?0:2048,d=a.De?a.De:9;Nj(a,1,a.Zh[0],c,d,14,a.Og,ij,jj)&&(b=!0);c=Mj(a);d=a.De?a.De:8;Nj(a,3,a.Zh[1],0,d,8,a.Og,c)&&(b=!0);a.De&&Nj(a,5,a.Zh[0],0,a.De,14,a.Og,c)&&(b=!0)}return b}function Nj(a,b,c,d,e,f,g,h,m){var n=!1;Oj(a,b,c,d,e,f,g,h,m)&&(n=!0);a.Dm&&Oj(a,b<<1,c,d,e,f,g,h,m)&&(n=!0);return n}
|
||||
function Oj(a,b,c,d,e,f,g,h,m){var n=!1,q=b&1?0:1,t=a.Td[b];t||(t={ic:e<<q,jc:f<<q,Ve:Array(h.length),fk:h.slice(),Ef:m,Xh:Array(h.length)});for(m=0;m<h.length;m++){var s=h[m],v=t.Ve[m]?t.fk[m]:[];if(s[0]!==v[0]||s[1]!==v[1]||s[2]!==v[2]){var n=t,v=m,A=q,D=c,ka=d,la=e,vb=f,Qc=g,Xd=[0,0,0,0],Rc=window.document.createElement("canvas");Rc.width=n.ic<<4;Rc.height=n.jc<<4;for(var Ti=Rc.getContext("2d"),Ha=void 0,Ob=void 0,gb=void 0,Sc=8>vb||!ka?vb:8,Yd=Ti.createImageData(n.ic,n.jc),Ha=0;256>Ha;Ha++){for(gb=
|
||||
0;gb<vb;gb++)for(var ql=n.Ef&&v&1&&gb>=vb-2,rl=Qc[gb<Sc?D+Ha*Sc+gb:ka+Ha*Sc+gb-Sc],Zd=0;Zd<=A;Zd++)for(Ob=0;Ob<la;Ob++){var Ui=Ob<<A,Vi=(gb<<A)+Zd,Wi=ql||rl&128>>(8<=Ob&&176<=Ha&&223>=Ha?7:Ob)?s:Xd;Pj(Yd,Ui,Vi,Wi);A&&Pj(Yd,Ui+1,Vi,Wi)}Ti.putImageData(Yd,(Ha&15)*n.ic,(Ha>>4)*n.jc)}n.Ve[v]="#"+r(s[0])+r(s[1])+r(s[2]);n.fk[v]=s;n.Xh[v]=Rc;n=!0}}a.Td[b]=t;return n}function Qj(a){0<a.Ae||0<=a.Lc?0>a.Be&&(a.Be=0):a.Be=-1}
|
||||
function Lj(a){if(a.Sb){for(var b=10;15>=b;b++)if(null==a.Ca.bc[b])return;var c=a.Ca.bc[10],b=c&31,d=a.Ca.bc[11]&31,e=a.Ca.bc[9]&31,f=!1;a.Ca===a.la&&(f=!0,7!=e||4!=b||d||(d=7));if(c&32||b>d&&!f||b>e)Rj(a);else{c=a.Ca.bc[15]+((a.Ca.bc[14]&63)<<8);a.Lc!=c&&(Rj(a),a.Lc=c);d=d-b+1;if(a.km!=b||a.uk!=d)a.km=b,a.uk=d;a.ee=e+1;Qj(a)}}}
|
||||
function Rj(a){if(0<=a.Lc){if(void 0!==a.cc){var b=a.cc[a.Lc];if(b&131072){var b=b&-131073,c=a.Lc%a.Bb,d=Math.floor(a.Lc/a.Bb);a.Sb&&a.Td[a.Sb]&&(a.af&&Sj(a,c,d,b,a.af),Sj(a,c,d,b));a.cc[a.Lc]=b}}a.Lc=-1}}
|
||||
function Tj(a){var b;a=a.Ca;var c=a.se[5];if(null!=c){b=2;var d=512,e=a.se[3]&31;switch(c&3){case 0:if(e){d=1024;switch(e&24){case 8:d=1536;break;case 16:d=2560;break;case 24:d=3584}a.md=e&7}break;case 1:d=4096;break;case 2:switch(e&24){default:d=8192;break;case 8:d=24576;break;case 16:d=40960;break;case 24:d=57344}}c&8&&(b=16);c&16&&(b|=1,d|=256);b|=d}return b}k.Pe=function(a){var b=this.Ca;null!=a&&b&&a!=b.yh&&(b.Oh(a),this.na.Oh(b.cb,b.tc,b.Jf))};
|
||||
function Kj(a,b){var c,d=a.Jd,e=a.Ca;if(e)if(1==e.he)d=fj;else if(5==e.he){var d=null,f=e.Vc>>2,g=32768<f?32768:f,h=e.se[6];if(null!=h){switch(h&12){case 0:e.cb=655360;e.tc=f;d=255;break;case 4:e.cb=655360;e.tc=f;d=3==a.je?15:16;break;case 8:e.cb=720896;e.tc=g;d=fj;break;case 12:e.cb=753664,e.tc=g,d=3==a.je?2:3}c=e.Ff[1]&8;f=e.bc[6]|(e.bc[7]&1)<<8;255!=d&&(h&1?753664==e.cb?d=c?7-d:6:350>f&&(d=c?13:14):c&&(d-=2));c=Tj(a)}}else e.Bc&8&&(e.Bc&2?(d=e.Bc&16?6:5,e.Bc&4||(d-=1)):(d=e.Bc&1?3:1,e.Bc&4&&(d-=
|
||||
k.reset=function(){var a=!0,b=0;this.ka&&(b=Yh(this.ka));var c=!1;if(this.Fa)switch(this.Fa){case "ega":var c=!0,d=hj[this.Sg];d&&(b=d[0]);b||(b=4);break;case "mda":b=3;break;default:b=2}this.je!==b&&(this.je=b,a=!0);this.Ca=null;this.Uc=this.mi=new oj(this,1);this.zb=this.bh=new oj(this,3);c?(this.la=new oj(this,5,null,this.Vc),Hj(this)):this.la=new oj;Ij(this);this.Jd=null;this.nd=3==b?fj:3;this.Be=this.Lc=-1;this.Ae=0;Jj(this,this.nd);if(this.Ca.cb&&a){a=this.Ca.cb+this.ni;for(b=this.Ca.cb;b<a;b+=
|
||||
2)d=Math.floor(65536*Math.random()),4==this.je?(c=b>>1&255,d=d>>8&-129,d>>4==(d&15)&&(d^=15)):(c=d&255,d=(d&256?7:112)|8&d>>8),eb(this.na,b,c|d<<8);zb(this,!0)}};function Hj(a){a.la.bg&1?(a.Uc=a.mi,a.zb=a.la):(a.Uc=a.la,a.zb=a.bh)}k.save=function(){var a=new H(this);a.set(0,zj(this.mi));a.set(1,zj(this.bh));a.set(2,[this.je,this.nd,this.Jd]);a.set(3,zj(this.la));return a.data()};
|
||||
k.restore=function(a){var b=a[2];this.je=b[0];this.nd=b[1];this.Jd=b[2];this.Ca=null;this.Uc=this.mi=new oj(this,1,a[0]);this.zb=this.bh=new oj(this,3,a[1]);this.la=new oj(this,5,a[3],this.Vc);this.la.mc&&Hj(this);Ij(this);if(!Kj(this))return!1;Lj(this);return!0};
|
||||
k.ko=function(a,b,c){if(c)this.Ga("Unable to load font ROM image (error "+c+")");else{try{var d=eval("("+b+")");if(!d.length){w("Empty font ROM image: "+a);return}if(1==d.length){w(d[0]);return}if(8192==d.length)Ri(this,d,[0,6144]);else{this.Ga("Unrecognized font data length ("+d.length+")");return}}catch(e){this.Ga("Font ROM data error: "+e.message);return}this.Ta()}};
|
||||
function Mj(a,b){if(1==b)return a.td[0]=S[0],a.td[1]=S[7],a.td;if(2==b){var c=a.Ca.$e;if(a.Ca===a.la){var d=a.la.Rd[0],c=d&7;d&16&&(c|=8);18!=a.la.Rd[1]&&(c|=32)}a.td[0]=S[c&15];c=c&32?lj:kj;for(d=0;d<c.length;d++)a.td[d+1]=S[c[d]];return a.td}if(a.zb===a.bh)return S;c=null!=a.la.Rd[15]?a.la.Rd:mj;for(d=0;d<a.td.length;d++){var e=c[d]||0;a.td[d]=[(e&4?170:0)|(e&32?85:0),(e&2?170:0)|(e&16?85:0),(e&1?170:0)|(e&8?85:0),255]}return a.td}function Ri(a,b,c,d){a.Og=b;a.ai=c;a.De=d}
|
||||
function Ij(a){var b=!1;if(window&&a.Og){var c=a.De?0:2048,d=a.De?a.De:9;Nj(a,1,a.ai[0],c,d,14,a.Og,ij,jj)&&(b=!0);c=Mj(a);d=a.De?a.De:8;Nj(a,3,a.ai[1],0,d,8,a.Og,c)&&(b=!0);a.De&&Nj(a,5,a.ai[0],0,a.De,14,a.Og,c)&&(b=!0)}return b}function Nj(a,b,c,d,e,f,g,h,m){var n=!1;Oj(a,b,c,d,e,f,g,h,m)&&(n=!0);a.Gm&&Oj(a,b<<1,c,d,e,f,g,h,m)&&(n=!0);return n}
|
||||
function Oj(a,b,c,d,e,f,g,h,m){var n=!1,q=b&1?0:1,t=a.Td[b];t||(t={kc:e<<q,lc:f<<q,Ve:Array(h.length),ik:h.slice(),Ef:m,Zh:Array(h.length)});for(m=0;m<h.length;m++){var s=h[m],v=t.Ve[m]?t.ik[m]:[];if(s[0]!==v[0]||s[1]!==v[1]||s[2]!==v[2]){var n=t,v=m,A=q,D=c,ka=d,la=e,vb=f,Qc=g,Xd=[0,0,0,0],Rc=window.document.createElement("canvas");Rc.width=n.kc<<4;Rc.height=n.lc<<4;for(var Ti=Rc.getContext("2d"),Ha=void 0,Ob=void 0,gb=void 0,Sc=8>vb||!ka?vb:8,Yd=Ti.createImageData(n.kc,n.lc),Ha=0;256>Ha;Ha++){for(gb=
|
||||
0;gb<vb;gb++)for(var ql=n.Ef&&v&1&&gb>=vb-2,rl=Qc[gb<Sc?D+Ha*Sc+gb:ka+Ha*Sc+gb-Sc],Zd=0;Zd<=A;Zd++)for(Ob=0;Ob<la;Ob++){var Ui=Ob<<A,Vi=(gb<<A)+Zd,Wi=ql||rl&128>>(8<=Ob&&176<=Ha&&223>=Ha?7:Ob)?s:Xd;Pj(Yd,Ui,Vi,Wi);A&&Pj(Yd,Ui+1,Vi,Wi)}Ti.putImageData(Yd,(Ha&15)*n.kc,(Ha>>4)*n.lc)}n.Ve[v]="#"+r(s[0])+r(s[1])+r(s[2]);n.ik[v]=s;n.Zh[v]=Rc;n=!0}}a.Td[b]=t;return n}function Qj(a){0<a.Ae||0<=a.Lc?0>a.Be&&(a.Be=0):a.Be=-1}
|
||||
function Lj(a){if(a.Sb){for(var b=10;15>=b;b++)if(null==a.Ca.cc[b])return;var c=a.Ca.cc[10],b=c&31,d=a.Ca.cc[11]&31,e=a.Ca.cc[9]&31,f=!1;a.Ca===a.la&&(f=!0,7!=e||4!=b||d||(d=7));if(c&32||b>d&&!f||b>e)Rj(a);else{c=a.Ca.cc[15]+((a.Ca.cc[14]&63)<<8);a.Lc!=c&&(Rj(a),a.Lc=c);d=d-b+1;if(a.nm!=b||a.xk!=d)a.nm=b,a.xk=d;a.ee=e+1;Qj(a)}}}
|
||||
function Rj(a){if(0<=a.Lc){if(void 0!==a.dc){var b=a.dc[a.Lc];if(b&131072){var b=b&-131073,c=a.Lc%a.Bb,d=Math.floor(a.Lc/a.Bb);a.Sb&&a.Td[a.Sb]&&(a.af&&Sj(a,c,d,b,a.af),Sj(a,c,d,b));a.dc[a.Lc]=b}}a.Lc=-1}}
|
||||
function Tj(a){var b;a=a.Ca;var c=a.se[5];if(null!=c){b=2;var d=512,e=a.se[3]&31;switch(c&3){case 0:if(e){d=1024;switch(e&24){case 8:d=1536;break;case 16:d=2560;break;case 24:d=3584}a.md=e&7}break;case 1:d=4096;break;case 2:switch(e&24){default:d=8192;break;case 8:d=24576;break;case 16:d=40960;break;case 24:d=57344}}c&8&&(b=16);c&16&&(b|=1,d|=256);b|=d}return b}k.Pe=function(a){var b=this.Ca;null!=a&&b&&a!=b.yh&&(b.Qh(a),this.na.Qh(b.cb,b.tc,b.Jf))};
|
||||
function Kj(a,b){var c,d=a.Jd,e=a.Ca;if(e)if(1==e.he)d=fj;else if(5==e.he){var d=null,f=e.Vc>>2,g=32768<f?32768:f,h=e.se[6];if(null!=h){switch(h&12){case 0:e.cb=655360;e.tc=f;d=255;break;case 4:e.cb=655360;e.tc=f;d=3==a.je?15:16;break;case 8:e.cb=720896;e.tc=g;d=fj;break;case 12:e.cb=753664,e.tc=g,d=3==a.je?2:3}c=e.Ff[1]&8;f=e.cc[6]|(e.cc[7]&1)<<8;255!=d&&(h&1?753664==e.cb?d=c?7-d:6:350>f&&(d=c?13:14):c&&(d-=2));c=Tj(a)}}else e.Bc&8&&(e.Bc&2?(d=e.Bc&16?6:5,e.Bc&4||(d-=1)):(d=e.Bc&1?3:1,e.Bc&4&&(d-=
|
||||
1)));else a.Jd=null,null==d&&(d=a.nd);if(!Jj(a,d,b))return!1;a.Pe(c);return!0}
|
||||
function Jj(a,b,c){if(null!=b&&(b!=a.Jd||c)){a.ym=0;a.Jd=b;b=a.Ca||(b==fj?a.Uc:a.zb);if(b!=a.Ca||b.cb!=a.cb||b.tc!=a.tc){Rj(a);if(a.cb){if(!ab(a.na,a.cb,a.tc))return!1;a.Ca&&(a.Ca.kc=!1)}a.Ca=b;b.kc=!0;a.cb=b.cb;a.tc=b.tc;if(!Za(a.na,b.cb,b.tc,!1,b===a.la?b:null))return!1}a.Sb=0;a.Bb=a.Bh;a.qc=a.Ti;a.Oi=R[fj][2];b=0;var d=R[a.Jd];d&&(a.Bb=d[0],a.qc=d[1],a.Oi=d[2],b=d[3]||0,a.Sb=d[4],4==a.je&&a.Ca===a.la&&3==a.Sb&&(7==a.la.bc[9]?a.qc=43:a.Sb=5));a.Mk=a.Bb*a.qc;a.Ah=a.Mk/a.Oi;a.li=(a.Ah<<1)+b;a.rk=
|
||||
b?a.li+b>>1:0;13<=a.Jd&&(a.Ah<<=1);a.Td.length&&(a.yd=Math.floor(a.xd/a.Bb),a.zd=Math.floor(a.fe/a.qc),a.Sb?(b=a.Td[a.Sb],d=a.Td[a.Sb<<1],a.Fm&&80==a.Bb?d&&a.yd>=3*d.ic>>2&&(a.Sb<<=1,b=d):(d&&a.yd>=d.ic&&(a.Sb<<=1,b=d),b&&(a.yd=b.ic,a.zd=b.jc)),a.Wf=a.Xf=0,b&&(a.Wf=a.Bb*b.ic,a.Xf=a.qc*b.jc)):(a.yd=a.zd=1,a.Wf=a.Bb,a.Xf=a.qc),a.uh=a.Xc.createImageData(a.Wf,a.Xf),a.Ze=window.document.createElement("canvas"),a.Ze.width=a.Wf,a.Ze.height=a.Xf,a.af=a.Ze.getContext("2d"),a.Yj=a.Zj=0,a.ni=a.xd,a.oi=a.fe,
|
||||
b=a.xd-a.Bb*a.yd,d=a.fe-a.qc*a.zd,0<b&&(a.Yj=b>>1,a.ni-=b),0<d&&(a.Zj=d>>1,a.oi-=d),b||d)&&(a.Xc.fillStyle=a.Lb.style.backgroundColor,a.Xc.fillRect(0,0,a.xd,a.fe));!1!==c?zb(a,!0):Uj(a,!0)}return!0}function Pj(a,b,c,d){b=(b+c*a.width)*d.length;a.data[b+0]=d[0];a.data[b+1]=d[1];a.data[b+2]=d[2];a.data[b+3]=d[3]}function Uj(a,b){var c;if(b){if(c=a.Ah,void 0===a.cc||a.cc.length!=c)a.cc=Array(c)}else{if(void 0===a.cc)return;c=a.cc.length}for(var d=0;d<c;d++)a.cc[d]=-1;a.Ae=-1}
|
||||
function Sj(a,b,c,d,e){var f=d&255,g=d>>8;d=g&15;var h=a.Td[a.Sb];h.Ef&&(d=h.Ef[d]);var m=g>>4&15;h.Ef&&(m=h.Ef[m]);e?(b*=h.ic,c*=h.jc,e.fillStyle=h.Ve[m],e.fillRect(b,c,h.ic,h.jc)):(b=b*a.yd+a.Yj,c=c*a.zd+a.Zj,a.Xc.fillStyle=h.Ve[m],a.Xc.fillRect(b,c,a.yd,a.zd));g&256&&(m=(f&15)*h.ic,f=(f>>4)*h.jc,e?e.drawImage(h.Xh[d],m,f,h.ic,h.jc,b,c,h.ic,h.jc):a.Xc.drawImage(h.Xh[d],m,f,h.ic,h.jc,b,c,a.yd,a.zd));g&512&&(f=a.km,g=a.uk,e?(a.ee&&a.ee!==h.jc&&(f=Math.floor(f*h.jc/a.ee),g=Math.floor(g*h.jc/a.ee)),
|
||||
e.fillStyle=h.Ve[d],e.fillRect(b,c+f,h.ic,g)):(a.ee&&a.ee!==a.zd&&(f=Math.floor(f*a.zd/a.ee),g=Math.floor(g*a.zd/a.ee)),a.Xc.fillStyle=h.Ve[d],a.Xc.fillRect(b,c+f,a.yd,g)))}
|
||||
function zb(a,b){if(a.Nb){var c=!1;a.Ca&&(a.Ca===a.la?a.la.Bd&32&&(c=!0):a.Ca.Bc&8&&(c=!0));if(c||b){if(b)Uj(a,!0);else if(void 0===a.cc)return;var d=!1;!(b||++a.ym&15)&&0<=a.Be&&(a.Be++,d=!0);var e=0,f=a.Mk,c=a.Ca.cb,g=c+a.Ca.tc,h=(a.Ca.bc[12]<<8)+a.Ca.bc[13];a.Sb&&(h<<=1);var c=c+h,m=a.li;c+m>g&&(m=g-c,0>m&&(m=0));g=c+m;if(h=!b){for(var h=a.na,n=!0,q=c>>h.rb;0<m&&q<h.Aa.length;)h.Aa[q].mb&&(h.Aa[q].mb=n=!1,h.Aa[q].wk=!0),m-=h.ec,q++;h=n}if(h){if(!d)return;if(!a.Ae){if(0>a.Lc)return;e=a.Lc;f=e+1}}if(a.Sb){if(a.Td[a.Sb]){d=
|
||||
0;h=a.Ae=0;m=1048575;a.Ca.Bc&32&&(h=32768,m&=~h,a.Be&2||(m&=-65537));for(c+=e<<1;c<g&&e<f;)n=cb(a.na,c),n|=65536,n&h&&(a.Ae++,n&=m),e==a.Lc&&(n|=a.Be&1?131072:0),q=a.cc[e],q!=n&&(Sj(a,e%a.Bb,Math.floor(e/a.Bb),n,a.af),a.cc[e]=n,d++),c+=2,e++;d&&a.af&&a.Xc.drawImage(a.Ze,0,0,a.Wf,a.Xf,a.Yj,a.Zj,a.ni,a.oi);Qj(a)}}else if(a.rk){for(var f=g,t,s,e=c,g=a.Ae=0,d=a.Oi,h=16==d?65536:196608,m=16==d?1:2,n=Mj(a,m),v=q=0,A=a.Bb,D=0,ka=a.qc,la=0;e<f;){t=cb(a.na,e);s=a.cc[g];if(s===t)q+=d;else{a.cc[g]=t;t=t>>8|
|
||||
(t&255)<<8;s=h;var vb=16;q<A&&(A=q);for(var Qc=0;Qc<d;Qc++){var Xd=(t&(s>>=m))>>(vb-=m);Pj(a.uh,q++,v,n[Xd])}q>D&&(D=q);v<ka&&(ka=v);v>=la&&(la=v+1)}e+=2;g++;if(q>=a.Bb){q=0;v+=2;if(v>a.qc)break;v==a.qc&&(v=1,e=c+a.rk)}}A<a.Bb&&(a.af.putImageData(a.uh,0,0,A,ka,D-A,la-ka),a.Xc.drawImage(a.Ze,0,0,a.Bb,a.qc,0,0,a.xd,a.fe))}else{f=g;e=a.Ae=0;g=Mj(a);d=a.Ca.ed;m=h=0;n=a.Bb;q=0;v=a.qc;for(A=0;c<f;){D=c++-a.cb;D=d[D];ka=a.cc[e];if(ka===D)h+=8;else{a.cc[e]=D;h<n&&(n=h);for(ka=0;8>ka;ka++)la=D&2155905152,
|
||||
0>la&&(la=-la),la=T[la]||0,Pj(a.uh,h++,m,g[la]),D<<=1;h>q&&(q=h);m<v&&(v=m);m>=A&&(A=m+1)}e++;if(h>=a.Bb&&(h=0,++m>a.qc))break}n<a.Bb&&(a.af.putImageData(a.uh,0,0,n,v,q-n,A-v),a.Xc.drawImage(a.Ze,0,0,a.Bb,a.qc,0,0,a.xd,a.fe))}}}}k.un=function(a,b){return Vj(this,this.Uc,b)};k.No=function(a,b,c){a=this.Uc;a.rh=a.mc;a.mc=b&31;this.ba(a.port,b,c,"CRTC.INDX")};k.tn=function(a,b){return Wj(this,this.Uc,b)};k.Mo=function(a,b,c){Xj(this,this.Uc,b,c)};k.vn=function(a,b){return Yj(this,this.Uc,b)};
|
||||
k.Oo=function(a,b,c){a=this.Uc;this.ba(a.port+4,b,c,"MODE");a.Bc=b;Kj(this,!1)};k.wn=function(a,b){return Zj(this,this.Uc,b)};k.Tl=function(a,b,c){this.la.qh=this.la.qh&-4|b&3;this.ba(a,b,c,"FEAT")};k.Ik=function(a,b){var c=this.la.hd?this.la.Rd[this.la.Bd&31]:this.la.Bd;this.ba(960,null,b,"ATC."+(this.la.hd?this.la.ci[this.la.Bd&31]:"INDX"),c);this.la.hd=!this.la.hd;return c};
|
||||
k.Sl=function(a,b,c){var d=this.la.Bd&32;if(this.la.hd){var e=this.la.Bd&31;if(16<=e||!d)this.ba(a,b,c,"ATC."+this.la.ci[e]),this.la.Rd[e]=b;this.la.hd=!1}else this.la.Bd=b,this.ba(a,b,c,"ATC.INDX"),this.la.hd=!0,b&32&&!d&&Ij(this)&&zb(this,!0)};k.Gn=function(a,b){var c=3-((this.la.bg&12)>>2),c=this.la.Rh&-17|(this.Sg&1<<c)<<4-c;this.la.Rh=c;this.ba(962,null,b,"STATUS0",c);return c};k.Qo=function(a,b,c){this.la.bg=b;Hj(this);this.ba(962,b,c,"MISC")};
|
||||
k.Fn=function(a,b){var c=this.la.Dd;this.ba(964,null,b,"SEQ.INDX",c);return c};k.Xo=function(a,b,c){this.la.Dd=b;this.ba(964,b,c,"SEQ.INDX")};k.En=function(a,b){var c=this.la.Ff[this.la.Dd];this.ba(965,null,b,"SEQ"+this.la.ei[this.la.Dd],c);return c};k.Wo=function(a,b,c){this.ba(965,b,c,"SEQ."+this.la.ei[this.la.Dd]);this.la.Ff[this.la.Dd]=b;2==this.la.Dd&&(this.la.gb=nj[b&15])};k.mn=function(a,b){var c=this.la.Hi;this.ba(972,null,b,"GRC1",c);return c};
|
||||
k.Ho=function(a,b,c){this.la.Hi=b;this.ba(972,b,c,"GRC1")};k.nn=function(a,b){var c=this.la.Ii;this.ba(970,null,b,"GRC2",c);return c};k.Io=function(a,b,c){this.la.Ii=b;this.ba(970,b,c,"GRC2")};k.ln=function(a,b){var c=this.la.Cd;this.ba(974,null,b,"GRC.INDX",c);return c};k.Go=function(a,b,c){this.la.Cd=b;this.ba(974,b,c,"GRC.INDX")};k.kn=function(a,b){var c=this.la.se[this.la.Cd];this.ba(975,null,b,"GRC."+this.la.di[this.la.Cd],c);return c};
|
||||
k.Fo=function(a,b,c){this.ba(975,b,c,"GRC."+this.la.di[this.la.Cd]);this.la.se[this.la.Cd]=b;switch(this.la.Cd){case 0:this.la.Dh=nj[b&15];this.la.Je=this.la.Dh&~this.la.le;break;case 1:this.la.le=~nj[b&15];this.la.Je=this.la.Dh&~this.la.le;break;case 2:this.la.Pi=nj[b&15]&2155905152;break;case 3:case 5:this.Pe(Tj(this));break;case 4:this.la.Gj=(b&3)<<3;break;case 6:Kj(this,!1);break;case 7:this.la.Qi=nj[b&15^15]&2155905152;break;case 8:this.la.ob=b|b<<8|b<<16|b<<24}};
|
||||
k.bn=function(a,b){return Vj(this,this.zb,b)};k.yo=function(a,b,c){a=this.zb;a.rh=a.mc;a.mc=b&31;this.ba(a.port,b,c,"CRTC.INDX")};k.an=function(a,b){return Wj(this,this.zb,b)};k.xo=function(a,b,c){Xj(this,this.zb,b,c)};k.cn=function(a,b){return Yj(this,this.zb,b)};k.zo=function(a,b,c){a=this.zb;this.ba(a.port+4,b,c,"MODE");a.Bc=b;Kj(this,!1)};k.$m=function(a,b){var c=this.zb.$e;this.ba(this.zb.port+5,null,b,this.zb.type+".COLOR",c);return c};
|
||||
k.wo=function(a,b,c){this.ba(this.zb.port+5,b,c,this.zb.type+".COLOR");this.zb.$e!==b&&(this.zb.$e=b,Uj(this,!1))};k.dn=function(a,b){return Zj(this,this.zb,b)};function Vj(a,b,c){var d=b.mc;a.ba(b.port,null,c,"CRTC.INDX",d);return d}function Wj(a,b,c){var d;b.mc<b.Ni&&(d=b.bc[b.mc]);a.ba(b.port+1,null,c,"CRTC."+b.Qg[b.mc],d);return d}function Xj(a,b,c,d){b.mc<b.Ni&&(a.ba(b.port+1,c,d,"CRTC."+b.Qg[b.mc]),b.bc[b.mc]=c,9==b.mc&&8!=b.rh&&Kj(a,!0),Lj(a))}
|
||||
function Yj(a,b,c){var d=b.Bc;a.ba(b.port+4,null,c,"MODE",d);return d}function Zj(a,b,c){var d=0,e=F(a.S),f=e-b.Xi;0>f&&(f=0);f%b.Ri>b.Zn&&(d|=1);f%=b.Pk;f>b.bo&&(d|=8);b.Xi=e-f;b===a.la?(d|=b.vf&48^48,b.hd=!1):d=(b.vf^=9)|240;b.vf=d;a.ba(b.port+6,null,c,b===a.la?"STATUS1":"STATUS",d);return d}k.Qa=function(a,b){this.X&&(b||E(this.X,this.X.Hg))&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.Hg,e)};
|
||||
var Bj={948:Q.prototype.un,949:Q.prototype.tn,952:Q.prototype.vn,954:Q.prototype.wn,980:Q.prototype.bn,981:Q.prototype.an,984:Q.prototype.cn,985:Q.prototype.$m,986:Q.prototype.dn},Cj={948:Q.prototype.No,949:Q.prototype.Mo,952:Q.prototype.Oo,980:Q.prototype.yo,981:Q.prototype.xo,984:Q.prototype.zo,985:Q.prototype.wo},Dj={960:Q.prototype.Ik,961:Q.prototype.Ik,962:Q.prototype.Gn,964:Q.prototype.Fn,965:Q.prototype.En,970:Q.prototype.nn,972:Q.prototype.mn,974:Q.prototype.ln,975:Q.prototype.kn},Ej={954:Q.prototype.Tl,
|
||||
960:Q.prototype.Sl,961:Q.prototype.Sl,962:Q.prototype.Qo,964:Q.prototype.Xo,965:Q.prototype.Wo,970:Q.prototype.Io,972:Q.prototype.Ho,974:Q.prototype.Go,975:Q.prototype.Fo,986:Q.prototype.Tl};
|
||||
function Jj(a,b,c){if(null!=b&&(b!=a.Jd||c)){a.Bm=0;a.Jd=b;b=a.Ca||(b==fj?a.Uc:a.zb);if(b!=a.Ca||b.cb!=a.cb||b.tc!=a.tc){Rj(a);if(a.cb){if(!ab(a.na,a.cb,a.tc))return!1;a.Ca&&(a.Ca.mc=!1)}a.Ca=b;b.mc=!0;a.cb=b.cb;a.tc=b.tc;if(!Za(a.na,b.cb,b.tc,!1,b===a.la?b:null))return!1}a.Sb=0;a.Bb=a.Bh;a.rc=a.Vi;a.Qi=R[fj][2];b=0;var d=R[a.Jd];d&&(a.Bb=d[0],a.rc=d[1],a.Qi=d[2],b=d[3]||0,a.Sb=d[4],4==a.je&&a.Ca===a.la&&3==a.Sb&&(7==a.la.cc[9]?a.rc=43:a.Sb=5));a.Pk=a.Bb*a.rc;a.Ah=a.Pk/a.Qi;a.ni=(a.Ah<<1)+b;a.uk=
|
||||
b?a.ni+b>>1:0;13<=a.Jd&&(a.Ah<<=1);a.Td.length&&(a.yd=Math.floor(a.xd/a.Bb),a.zd=Math.floor(a.fe/a.rc),a.Sb?(b=a.Td[a.Sb],d=a.Td[a.Sb<<1],a.Im&&80==a.Bb?d&&a.yd>=3*d.kc>>2&&(a.Sb<<=1,b=d):(d&&a.yd>=d.kc&&(a.Sb<<=1,b=d),b&&(a.yd=b.kc,a.zd=b.lc)),a.Wf=a.Xf=0,b&&(a.Wf=a.Bb*b.kc,a.Xf=a.rc*b.lc)):(a.yd=a.zd=1,a.Wf=a.Bb,a.Xf=a.rc),a.uh=a.Xc.createImageData(a.Wf,a.Xf),a.Ze=window.document.createElement("canvas"),a.Ze.width=a.Wf,a.Ze.height=a.Xf,a.af=a.Ze.getContext("2d"),a.ak=a.bk=0,a.pi=a.xd,a.qi=a.fe,
|
||||
b=a.xd-a.Bb*a.yd,d=a.fe-a.rc*a.zd,0<b&&(a.ak=b>>1,a.pi-=b),0<d&&(a.bk=d>>1,a.qi-=d),b||d)&&(a.Xc.fillStyle=a.Lb.style.backgroundColor,a.Xc.fillRect(0,0,a.xd,a.fe));!1!==c?zb(a,!0):Uj(a,!0)}return!0}function Pj(a,b,c,d){b=(b+c*a.width)*d.length;a.data[b+0]=d[0];a.data[b+1]=d[1];a.data[b+2]=d[2];a.data[b+3]=d[3]}function Uj(a,b){var c;if(b){if(c=a.Ah,void 0===a.dc||a.dc.length!=c)a.dc=Array(c)}else{if(void 0===a.dc)return;c=a.dc.length}for(var d=0;d<c;d++)a.dc[d]=-1;a.Ae=-1}
|
||||
function Sj(a,b,c,d,e){var f=d&255,g=d>>8;d=g&15;var h=a.Td[a.Sb];h.Ef&&(d=h.Ef[d]);var m=g>>4&15;h.Ef&&(m=h.Ef[m]);e?(b*=h.kc,c*=h.lc,e.fillStyle=h.Ve[m],e.fillRect(b,c,h.kc,h.lc)):(b=b*a.yd+a.ak,c=c*a.zd+a.bk,a.Xc.fillStyle=h.Ve[m],a.Xc.fillRect(b,c,a.yd,a.zd));g&256&&(m=(f&15)*h.kc,f=(f>>4)*h.lc,e?e.drawImage(h.Zh[d],m,f,h.kc,h.lc,b,c,h.kc,h.lc):a.Xc.drawImage(h.Zh[d],m,f,h.kc,h.lc,b,c,a.yd,a.zd));g&512&&(f=a.nm,g=a.xk,e?(a.ee&&a.ee!==h.lc&&(f=Math.floor(f*h.lc/a.ee),g=Math.floor(g*h.lc/a.ee)),
|
||||
e.fillStyle=h.Ve[d],e.fillRect(b,c+f,h.kc,g)):(a.ee&&a.ee!==a.zd&&(f=Math.floor(f*a.zd/a.ee),g=Math.floor(g*a.zd/a.ee)),a.Xc.fillStyle=h.Ve[d],a.Xc.fillRect(b,c+f,a.yd,g)))}
|
||||
function zb(a,b){if(a.Nb){var c=!1;a.Ca&&(a.Ca===a.la?a.la.Bd&32&&(c=!0):a.Ca.Bc&8&&(c=!0));if(c||b){if(b)Uj(a,!0);else if(void 0===a.dc)return;var d=!1;!(b||++a.Bm&15)&&0<=a.Be&&(a.Be++,d=!0);var e=0,f=a.Pk,c=a.Ca.cb,g=c+a.Ca.tc,h=(a.Ca.cc[12]<<8)+a.Ca.cc[13];a.Sb&&(h<<=1);var c=c+h,m=a.ni;c+m>g&&(m=g-c,0>m&&(m=0));g=c+m;if(h=!b){for(var h=a.na,n=!0,q=c>>h.rb;0<m&&q<h.Aa.length;)h.Aa[q].lb&&(h.Aa[q].lb=n=!1,h.Aa[q].zk=!0),m-=h.fc,q++;h=n}if(h){if(!d)return;if(!a.Ae){if(0>a.Lc)return;e=a.Lc;f=e+1}}if(a.Sb){if(a.Td[a.Sb]){d=
|
||||
0;h=a.Ae=0;m=1048575;a.Ca.Bc&32&&(h=32768,m&=~h,a.Be&2||(m&=-65537));for(c+=e<<1;c<g&&e<f;)n=cb(a.na,c),n|=65536,n&h&&(a.Ae++,n&=m),e==a.Lc&&(n|=a.Be&1?131072:0),q=a.dc[e],q!=n&&(Sj(a,e%a.Bb,Math.floor(e/a.Bb),n,a.af),a.dc[e]=n,d++),c+=2,e++;d&&a.af&&a.Xc.drawImage(a.Ze,0,0,a.Wf,a.Xf,a.ak,a.bk,a.pi,a.qi);Qj(a)}}else if(a.uk){for(var f=g,t,s,e=c,g=a.Ae=0,d=a.Qi,h=16==d?65536:196608,m=16==d?1:2,n=Mj(a,m),v=q=0,A=a.Bb,D=0,ka=a.rc,la=0;e<f;){t=cb(a.na,e);s=a.dc[g];if(s===t)q+=d;else{a.dc[g]=t;t=t>>8|
|
||||
(t&255)<<8;s=h;var vb=16;q<A&&(A=q);for(var Qc=0;Qc<d;Qc++){var Xd=(t&(s>>=m))>>(vb-=m);Pj(a.uh,q++,v,n[Xd])}q>D&&(D=q);v<ka&&(ka=v);v>=la&&(la=v+1)}e+=2;g++;if(q>=a.Bb){q=0;v+=2;if(v>a.rc)break;v==a.rc&&(v=1,e=c+a.uk)}}A<a.Bb&&(a.af.putImageData(a.uh,0,0,A,ka,D-A,la-ka),a.Xc.drawImage(a.Ze,0,0,a.Bb,a.rc,0,0,a.xd,a.fe))}else{f=g;e=a.Ae=0;g=Mj(a);d=a.Ca.ed;m=h=0;n=a.Bb;q=0;v=a.rc;for(A=0;c<f;){D=c++-a.cb;D=d[D];ka=a.dc[e];if(ka===D)h+=8;else{a.dc[e]=D;h<n&&(n=h);for(ka=0;8>ka;ka++)la=D&2155905152,
|
||||
0>la&&(la=-la),la=T[la]||0,Pj(a.uh,h++,m,g[la]),D<<=1;h>q&&(q=h);m<v&&(v=m);m>=A&&(A=m+1)}e++;if(h>=a.Bb&&(h=0,++m>a.rc))break}n<a.Bb&&(a.af.putImageData(a.uh,0,0,n,v,q-n,A-v),a.Xc.drawImage(a.Ze,0,0,a.Bb,a.rc,0,0,a.xd,a.fe))}}}}k.xn=function(a,b){return Vj(this,this.Uc,b)};k.Qo=function(a,b,c){a=this.Uc;a.rh=a.oc;a.oc=b&31;this.ba(a.port,b,c,"CRTC.INDX")};k.wn=function(a,b){return Wj(this,this.Uc,b)};k.Po=function(a,b,c){Xj(this,this.Uc,b,c)};k.yn=function(a,b){return Yj(this,this.Uc,b)};
|
||||
k.Ro=function(a,b,c){a=this.Uc;this.ba(a.port+4,b,c,"MODE");a.Bc=b;Kj(this,!1)};k.zn=function(a,b){return Zj(this,this.Uc,b)};k.Wl=function(a,b,c){this.la.qh=this.la.qh&-4|b&3;this.ba(a,b,c,"FEAT")};k.Lk=function(a,b){var c=this.la.hd?this.la.Rd[this.la.Bd&31]:this.la.Bd;this.ba(960,null,b,"ATC."+(this.la.hd?this.la.ei[this.la.Bd&31]:"INDX"),c);this.la.hd=!this.la.hd;return c};
|
||||
k.Vl=function(a,b,c){var d=this.la.Bd&32;if(this.la.hd){var e=this.la.Bd&31;if(16<=e||!d)this.ba(a,b,c,"ATC."+this.la.ei[e]),this.la.Rd[e]=b;this.la.hd=!1}else this.la.Bd=b,this.ba(a,b,c,"ATC.INDX"),this.la.hd=!0,b&32&&!d&&Ij(this)&&zb(this,!0)};k.Jn=function(a,b){var c=3-((this.la.bg&12)>>2),c=this.la.Th&-17|(this.Sg&1<<c)<<4-c;this.la.Th=c;this.ba(962,null,b,"STATUS0",c);return c};k.To=function(a,b,c){this.la.bg=b;Hj(this);this.ba(962,b,c,"MISC")};
|
||||
k.In=function(a,b){var c=this.la.Dd;this.ba(964,null,b,"SEQ.INDX",c);return c};k.$o=function(a,b,c){this.la.Dd=b;this.ba(964,b,c,"SEQ.INDX")};k.Hn=function(a,b){var c=this.la.Ff[this.la.Dd];this.ba(965,null,b,"SEQ"+this.la.gi[this.la.Dd],c);return c};k.Zo=function(a,b,c){this.ba(965,b,c,"SEQ."+this.la.gi[this.la.Dd]);this.la.Ff[this.la.Dd]=b;2==this.la.Dd&&(this.la.gb=nj[b&15])};k.pn=function(a,b){var c=this.la.Ji;this.ba(972,null,b,"GRC1",c);return c};
|
||||
k.Ko=function(a,b,c){this.la.Ji=b;this.ba(972,b,c,"GRC1")};k.qn=function(a,b){var c=this.la.Ki;this.ba(970,null,b,"GRC2",c);return c};k.Lo=function(a,b,c){this.la.Ki=b;this.ba(970,b,c,"GRC2")};k.on=function(a,b){var c=this.la.Cd;this.ba(974,null,b,"GRC.INDX",c);return c};k.Jo=function(a,b,c){this.la.Cd=b;this.ba(974,b,c,"GRC.INDX")};k.nn=function(a,b){var c=this.la.se[this.la.Cd];this.ba(975,null,b,"GRC."+this.la.fi[this.la.Cd],c);return c};
|
||||
k.Io=function(a,b,c){this.ba(975,b,c,"GRC."+this.la.fi[this.la.Cd]);this.la.se[this.la.Cd]=b;switch(this.la.Cd){case 0:this.la.Fh=nj[b&15];this.la.Je=this.la.Fh&~this.la.le;break;case 1:this.la.le=~nj[b&15];this.la.Je=this.la.Fh&~this.la.le;break;case 2:this.la.Ri=nj[b&15]&2155905152;break;case 3:case 5:this.Pe(Tj(this));break;case 4:this.la.Jj=(b&3)<<3;break;case 6:Kj(this,!1);break;case 7:this.la.Si=nj[b&15^15]&2155905152;break;case 8:this.la.nb=b|b<<8|b<<16|b<<24}};
|
||||
k.en=function(a,b){return Vj(this,this.zb,b)};k.Bo=function(a,b,c){a=this.zb;a.rh=a.oc;a.oc=b&31;this.ba(a.port,b,c,"CRTC.INDX")};k.dn=function(a,b){return Wj(this,this.zb,b)};k.Ao=function(a,b,c){Xj(this,this.zb,b,c)};k.fn=function(a,b){return Yj(this,this.zb,b)};k.Co=function(a,b,c){a=this.zb;this.ba(a.port+4,b,c,"MODE");a.Bc=b;Kj(this,!1)};k.cn=function(a,b){var c=this.zb.$e;this.ba(this.zb.port+5,null,b,this.zb.type+".COLOR",c);return c};
|
||||
k.zo=function(a,b,c){this.ba(this.zb.port+5,b,c,this.zb.type+".COLOR");this.zb.$e!==b&&(this.zb.$e=b,Uj(this,!1))};k.gn=function(a,b){return Zj(this,this.zb,b)};function Vj(a,b,c){var d=b.oc;a.ba(b.port,null,c,"CRTC.INDX",d);return d}function Wj(a,b,c){var d;b.oc<b.Pi&&(d=b.cc[b.oc]);a.ba(b.port+1,null,c,"CRTC."+b.Qg[b.oc],d);return d}function Xj(a,b,c,d){b.oc<b.Pi&&(a.ba(b.port+1,c,d,"CRTC."+b.Qg[b.oc]),b.cc[b.oc]=c,9==b.oc&&8!=b.rh&&Kj(a,!0),Lj(a))}
|
||||
function Yj(a,b,c){var d=b.Bc;a.ba(b.port+4,null,c,"MODE",d);return d}function Zj(a,b,c){var d=0,e=F(a.S),f=e-b.$i;0>f&&(f=0);f%b.Ti>b.bo&&(d|=1);f%=b.Sk;f>b.fo&&(d|=8);b.$i=e-f;b===a.la?(d|=b.vf&48^48,b.hd=!1):d=(b.vf^=9)|240;b.vf=d;a.ba(b.port+6,null,c,b===a.la?"STATUS1":"STATUS",d);return d}k.Qa=function(a,b){this.X&&(b||E(this.X,this.X.Hg))&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.Hg,e)};
|
||||
var Bj={948:Q.prototype.xn,949:Q.prototype.wn,952:Q.prototype.yn,954:Q.prototype.zn,980:Q.prototype.en,981:Q.prototype.dn,984:Q.prototype.fn,985:Q.prototype.cn,986:Q.prototype.gn},Cj={948:Q.prototype.Qo,949:Q.prototype.Po,952:Q.prototype.Ro,980:Q.prototype.Bo,981:Q.prototype.Ao,984:Q.prototype.Co,985:Q.prototype.zo},Dj={960:Q.prototype.Lk,961:Q.prototype.Lk,962:Q.prototype.Jn,964:Q.prototype.In,965:Q.prototype.Hn,970:Q.prototype.qn,972:Q.prototype.pn,974:Q.prototype.on,975:Q.prototype.nn},Ej={954:Q.prototype.Wl,
|
||||
960:Q.prototype.Vl,961:Q.prototype.Vl,962:Q.prototype.To,964:Q.prototype.$o,965:Q.prototype.Zo,970:Q.prototype.Lo,972:Q.prototype.Ko,974:Q.prototype.Jo,975:Q.prototype.Io,986:Q.prototype.Wl};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","video"),b=0;b<a.length;b++){var c=a[b],d=z(c),e=window.document.createElement("canvas");if(void 0===e){c.innerHTML="<br/>Missing <canvas> support; try a new web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor;
|
||||
e.style.height=c.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var f=e.getContext("2d"),d=new Q(d,e,f);Oa(d,c)}});
|
||||
function V(a){this.Fk=a.adapter;switch(this.Fk){case 1:this.Nj=1016;this.kg=4;break;case 2:this.Nj=760;this.kg=3;break;default:w("Unrecognized serial adapter #"+this.Fk);return}this.ce=null;x.call(this,"SerialPort",a,V);var b=a.binding,c;a=ak;b&&(void 0===c&&(c="Panel"),(c=Na(c,this.id))&&(b=c.sa[b])&&this.xb(null,null,a,b))}y(x,V);var ak="buffer";k=V.prototype;k.ik=function(a,b){return a==this.sh?(this.Jk=b,this):null};
|
||||
k.xb=function(a,b,c,d){var e=this;switch(c){case ak:return this.sa[c]=this.ce=d,d.onkeydown=function(a){a=a||window.event;var b=a.charCode||a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),bk(e,[b]))},d.onkeypress=function(a){a=a||window.event;bk(e,[a.which||a.keyCode])},!0}return!1};k.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.ka=C(a,"ChipSet");d&&Ph(d,V);ib(b,this,ck,this.Nj);mb(b,this,dk,this.Nj);this.Ta()};
|
||||
k.$b=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.ie()};k.save=function(){var a=new H(this),b=0,c=[];c[b++]=this.ii;c[b++]=this.mk;c[b++]=this.Re;c[b++]=this.Tg;c[b++]=this.Zd;c[b++]=this.Tc;c[b++]=this.fd;c[b++]=this.Gc;c[b++]=this.kk;c[b]=this.Hf;a.set(0,c);return a.data()};k.restore=function(a){return this.ie(a[0])};
|
||||
k.ie=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.ii=a[b++];this.mk=a[b++];this.Re=a[b++];this.Tg=a[b++];this.Zd=a[b++];this.Tc=a[b++];this.fd=a[b++];this.Gc=a[b++];this.kk=a[b++];this.Hf=a[b];return!0};function bk(a,b){a.Hf=a.Hf.concat(b);ek(a)}function ek(a){0<a.Hf.length&&!(a.Gc&1)&&(a.ii=a.Hf.shift(),a.Gc|=1);var b=-1;a.Gc&1&&a.Tg&1&&(b=4);0<=b?(a.Zd&=-8,a.Zd|=b,a.ka&&a.kg&&zi(a.ka,a.kg)):(a.Zd|=1,a.ka&&a.kg&&Ai(a.ka,a.kg))}
|
||||
k.Dn=function(a,b){var c=this.Tc&128?this.Re&255:this.ii;this.ba(a,null,b,this.Tc&128?"DLL":"RBR",c);this.Gc&=-2;ek(this);return c};k.on=function(a,b){var c=this.Tc&128?this.Re>>8:this.Tg;this.ba(a,null,b,this.Tc&128?"DLM":"IER",c);return c};k.pn=function(a,b){var c=this.Zd;this.ba(a,null,b,"IIR",c);return c};k.qn=function(a,b){var c=this.Tc;this.ba(a,null,b,"LCR",c);return c};k.sn=function(a,b){var c=this.fd;this.ba(a,null,b,"MCR",c);return c};
|
||||
k.rn=function(a,b){var c=this.Gc;this.ba(a,null,b,"LSR",c);return c};k.yn=function(a,b){var c=this.kk;this.ba(a,null,b,"MSR",c);return c};k.Yo=function(a,b,c){this.ba(a,b,c,this.Tc&128?"DLL":"THR");this.Tc&128?this.Re=this.Re&-256|b:(this.mk=b,this.Gc&=-97,this.ce?(13!=b&&(8==b?this.ce.value=this.ce.value.slice(0,-1):(this.ce.value+=String.fromCharCode(b),this.ce.scrollTop=this.ce.scrollHeight)),a=!0):a=!1,a&&(this.Gc|=96))};
|
||||
k.Jo=function(a,b,c){this.ba(a,b,c,this.Tc&128?"DLM":"IER");this.Tc&128?this.Re=this.Re&255|b<<8:this.Tg=b};k.Ko=function(a,b,c){this.ba(a,b,c,"LCR");this.Tc=b};
|
||||
k.Lo=function(a,b,c){var d=this.fd;this.ba(a,b,c,"MCR");this.fd=b;this.Jk&&(d^b)&3&&(a=this.Jk,b=this.fd,(c=3==(b&3))?a.kc||(d=!1,a.fd&2||(a.reset(),a.Qa("serial mouse reset"),d=!0),a.fd&1||(a.Qa("serial mouse ID requested"),d=!0),d&&(bk(a.Sf,[77]),a.Qa("serial mouse ID sent")),fk(a,a.Lb),a.kc=c):a.kc&&(a.Qa("serial mouse inactive"),gk(a.Lb),a.kc=c),a.fd=b)};k.Qa=function(a){this.X&&E(this.X,this.X.ck)&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.ck,e)};
|
||||
var ck={0:V.prototype.Dn,1:V.prototype.on,2:V.prototype.pn,3:V.prototype.qn,4:V.prototype.sn,5:V.prototype.rn,6:V.prototype.yn},dk={0:V.prototype.Yo,1:V.prototype.Jo,3:V.prototype.Ko,4:V.prototype.Lo};Ba(function(){for(var a=B(window.document,"pcjs","serial"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new V(d);Oa(d,c)}});function hk(a){x.call(this,"Mouse",a,hk);if(this.Ji=a.serial)this.Qj="SerialPort";this.kc=!1;this.Ta()}y(x,hk);k=hk.prototype;
|
||||
k.nc=function(a,b,c,d){this.Da=a;this.na=b;this.S=c;(this.X=d)&&Ph(d,hk)};k.$b=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.Qj&&!this.Sf){for(var c=null;(c=C(this.Da,this.Qj,c))&&(!c.ik||!(this.Sf=c.ik(this.Ji,this))););if(this.Sf){if(c=C(this.Da,"Video"))this.Lb=c.Lb}else w(this.id+": "+this.Qj+" "+this.Ji+" unavailable")}this.kc?fk(this,this.Lb):gk(this.Lb)}return!0};k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.ie()};
|
||||
k.save=function(){var a=new H(this);a.set(0,this.Vj());return a.data()};k.restore=function(a){return this.ie(a[0])};k.ie=function(a){var b=0;void 0===a&&(a=[!1,-1,-1,0,0,!1,!1,0]);this.kc=a[b++];this.Cg=a[b++];this.Dg=a[b++];this.yf=a[b++];this.zf=a[b++];this.ih=a[b++];this.jh=a[b++];this.fd=a[b];return!0};k.Vj=function(){var a=0,b=[];b[a++]=this.kc;b[a++]=this.Cg;b[a++]=this.Dg;b[a++]=this.yf;b[a++]=this.zf;b[a++]=this.ih;b[a++]=this.jh;b[a]=this.fd;return b};
|
||||
function fk(a,b){b&&(a.wi||(b.addEventListener("mousemove",function(b){if(a.kc&&a.S&&a.S.Ob){if(0>a.Cg||0>a.Dg)a.Cg=b.clientX,a.Dg=b.clientY;a.yf=b.clientX-a.Cg;a.zf=b.clientY-a.Dg;(a.yf||a.zf)&&ik(a,null,b.clientX,b.clientY);a.Cg=b.clientX;a.Dg=b.clientY}},!1),b.addEventListener("mousedown",function(b){jk(a,b.button,!0)},!1),b.addEventListener("mouseup",function(b){jk(a,b.button,!1)},!1),a.wi=!0),b.style.cursor="none")}function gk(a){a&&(a.style.cursor="auto")}
|
||||
function jk(a,b,c){if(a.kc&&a.S&&a.S.Ob)switch(b){case 0:a.ih!=c&&(a.ih=c,ik(a,"mouse button1 "+(c?"dn":"up")));break;case 2:a.jh!=c&&(a.jh=c,ik(a,"mouse button2 "+(c?"dn":"up")))}}function ik(a,b,c,d){var e=64|(a.ih?32:0)|(a.jh?16:0)|(a.zf&192)>>4|(a.yf&192)>>6,f=a.yf&63,g=a.zf&63;a.Qa((b?b+": ":"")+(void 0!==d?"mouse ("+c+","+d+"): ":"")+"serial packet ["+r(e)+","+r(f)+","+r(g)+"]");bk(a.Sf,[e,f,g]);a.yf=a.zf=0}k.Qa=function(a){this.X&&E(this.X,this.X.sm)&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","mouse"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new hk(d);Oa(d,c)}});function kk(a,b,c){x.call(this,"Disk",{id:a.th+".disk"+lk++},kk);this.ia=a;this.Da=a.Da;this.X=a.X;this.Pa=b;this.mode=c;this.Kd=b.name;this.oc=b.oc;this.fc=b.fc;this.rc=b.rc;this.Mb=b.Mb;this.ef=b.ef;this.Bi=this.Ad=!1;this.create();this.re=[];this.Kg=[];this.Pd=null;this.Lk=0;this.Ei=!1;this.Ta()}var lk=0;y(x,kk);k=kk.prototype;k.nc=function(a,b,c,d){this.X=d};
|
||||
k.$b=function(a,b){b||this.Bi&&!this.Ad&&this.load(this.Kd,this.tf);return!0};k.Wb=function(a,b){if(this.Ad){var c,d=0;if(this.Ei&&!ta("Disk writes are still in progress, shut down anyway?"))return!1;for(;c=mk(this,!1);)if(d=c[0]){this.Ga('Unable to save "'+this.Kd+'" (error '+d+")");break}b&&this.Ad&&(c="action=close&volume="+this.tf,c+="&machine="+this.ia.gf(),c+="&user="+this.ia.ge(),ra(sa()+"/api/v1/disk?"+c,!0),this.Ad=!1);d||this.Ga(this.Kd+" saved")}return!0};
|
||||
k.create=function(){this.ib=[];if("preload"!=this.mode){for(var a=Array(this.oc),b=0;b<a.length;b++){for(var c=Array(this.fc),d=0;d<c.length;d++){for(var e=Array(this.rc),f=1;f<=e.length;f++)e[f-1]=nk(null,b,d,f,this.Mb,"local"==this.mode?0:null);c[d]=e}a[b]=c}this.ib=a}this.gh=0};
|
||||
k.load=function(a,b,c){var d=b;this.Kd=a;this.tf=b;this.Ck=c;0>b.indexOf("/api/v1/dump")&&(a=fa(b),"json"==a?d=encodeURI(b):"demandrw"==this.mode||"demandro"==this.mode?(a="action=open&volume="+b+("&mode="+this.mode),a+="&chs="+this.oc+":"+this.fc+":"+this.rc+":"+this.Mb,a+="&machine="+this.ia.gf(),a+="&user="+this.ia.ge(),d=sa()+"/api/v1/disk?"+a,this.Bi=!0):(c="path",d="&mbhd=10",!b.indexOf("http:")||!b.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(a)?(c="disk",d="&mbhd=0"):
|
||||
-1!==b.indexOf("/",b.length-1)&&(c="dir"),d=sa()+"/api/v1/dump?"+c+"="+encodeURIComponent(b)+(this.ef?"":d)+"&format=json"));ra(d,!0,null,this,this.co,b)};
|
||||
k.co=function(a,b,c,d){var e=null;this.ff=!1;var f=0>c&&this.Da&&!this.Da.Nb;if(this.Bi)c?this.Ga('Unable to connect to disk "'+d+'" (error '+c+": "+b+")",f):(this.Ad=!0,e=this);else if(c)this.Ga('Unable to load disk "'+this.Kd+'" (error '+c+")",f);else try{if(0<ea(a,!0).toLowerCase().indexOf("-readonly"))this.ff=!0;else{var g=b.indexOf("\n");0<g&&1024>g&&0<b.substring(0,g).indexOf("write-protected")&&(this.ff=!0)}var h;h="<"==b.substr(0,1)?["Missing disk image: "+this.Kd]:0>b.indexOf("0x")&&'["'!=
|
||||
function V(a){this.Ik=a.adapter;switch(this.Ik){case 1:this.Qj=1016;this.kg=4;break;case 2:this.Qj=760;this.kg=3;break;default:w("Unrecognized serial adapter #"+this.Ik);return}this.ce=null;x.call(this,"SerialPort",a,V);var b=a.binding,c;a=ak;b&&(void 0===c&&(c="Panel"),(c=Na(c,this.id))&&(b=c.sa[b])&&this.xb(null,null,a,b))}y(x,V);var ak="buffer";k=V.prototype;k.lk=function(a,b){return a==this.sh?(this.Mk=b,this):null};
|
||||
k.xb=function(a,b,c,d){var e=this;switch(c){case ak:return this.sa[c]=this.ce=d,d.onkeydown=function(a){a=a||window.event;var b=a.charCode||a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),bk(e,[b]))},d.onkeypress=function(a){a=a||window.event;bk(e,[a.which||a.keyCode])},!0}return!1};k.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.ka=C(a,"ChipSet");d&&Ph(d,V);ib(b,this,ck,this.Qj);mb(b,this,dk,this.Qj);this.Ta()};
|
||||
k.ac=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.ie()};k.save=function(){var a=new H(this),b=0,c=[];c[b++]=this.ki;c[b++]=this.pk;c[b++]=this.Re;c[b++]=this.Tg;c[b++]=this.Zd;c[b++]=this.Tc;c[b++]=this.fd;c[b++]=this.Gc;c[b++]=this.nk;c[b]=this.Hf;a.set(0,c);return a.data()};k.restore=function(a){return this.ie(a[0])};
|
||||
k.ie=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.ki=a[b++];this.pk=a[b++];this.Re=a[b++];this.Tg=a[b++];this.Zd=a[b++];this.Tc=a[b++];this.fd=a[b++];this.Gc=a[b++];this.nk=a[b++];this.Hf=a[b];return!0};function bk(a,b){a.Hf=a.Hf.concat(b);ek(a)}function ek(a){0<a.Hf.length&&!(a.Gc&1)&&(a.ki=a.Hf.shift(),a.Gc|=1);var b=-1;a.Gc&1&&a.Tg&1&&(b=4);0<=b?(a.Zd&=-8,a.Zd|=b,a.ka&&a.kg&&zi(a.ka,a.kg)):(a.Zd|=1,a.ka&&a.kg&&Ai(a.ka,a.kg))}
|
||||
k.Gn=function(a,b){var c=this.Tc&128?this.Re&255:this.ki;this.ba(a,null,b,this.Tc&128?"DLL":"RBR",c);this.Gc&=-2;ek(this);return c};k.rn=function(a,b){var c=this.Tc&128?this.Re>>8:this.Tg;this.ba(a,null,b,this.Tc&128?"DLM":"IER",c);return c};k.sn=function(a,b){var c=this.Zd;this.ba(a,null,b,"IIR",c);return c};k.tn=function(a,b){var c=this.Tc;this.ba(a,null,b,"LCR",c);return c};k.vn=function(a,b){var c=this.fd;this.ba(a,null,b,"MCR",c);return c};
|
||||
k.un=function(a,b){var c=this.Gc;this.ba(a,null,b,"LSR",c);return c};k.Bn=function(a,b){var c=this.nk;this.ba(a,null,b,"MSR",c);return c};k.ap=function(a,b,c){this.ba(a,b,c,this.Tc&128?"DLL":"THR");this.Tc&128?this.Re=this.Re&-256|b:(this.pk=b,this.Gc&=-97,this.ce?(13!=b&&(8==b?this.ce.value=this.ce.value.slice(0,-1):(this.ce.value+=String.fromCharCode(b),this.ce.scrollTop=this.ce.scrollHeight)),a=!0):a=!1,a&&(this.Gc|=96))};
|
||||
k.Mo=function(a,b,c){this.ba(a,b,c,this.Tc&128?"DLM":"IER");this.Tc&128?this.Re=this.Re&255|b<<8:this.Tg=b};k.No=function(a,b,c){this.ba(a,b,c,"LCR");this.Tc=b};
|
||||
k.Oo=function(a,b,c){var d=this.fd;this.ba(a,b,c,"MCR");this.fd=b;this.Mk&&(d^b)&3&&(a=this.Mk,b=this.fd,(c=3==(b&3))?a.mc||(d=!1,a.fd&2||(a.reset(),a.Qa("serial mouse reset"),d=!0),a.fd&1||(a.Qa("serial mouse ID requested"),d=!0),d&&(bk(a.Sf,[77]),a.Qa("serial mouse ID sent")),fk(a,a.Lb),a.mc=c):a.mc&&(a.Qa("serial mouse inactive"),gk(a.Lb),a.mc=c),a.fd=b)};k.Qa=function(a){this.X&&E(this.X,this.X.fk)&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.fk,e)};
|
||||
var ck={0:V.prototype.Gn,1:V.prototype.rn,2:V.prototype.sn,3:V.prototype.tn,4:V.prototype.vn,5:V.prototype.un,6:V.prototype.Bn},dk={0:V.prototype.ap,1:V.prototype.Mo,3:V.prototype.No,4:V.prototype.Oo};Ba(function(){for(var a=B(window.document,"pcjs","serial"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new V(d);Oa(d,c)}});function hk(a){x.call(this,"Mouse",a,hk);if(this.Li=a.serial)this.Tj="SerialPort";this.mc=!1;this.Ta()}y(x,hk);k=hk.prototype;
|
||||
k.pc=function(a,b,c,d){this.Da=a;this.na=b;this.S=c;(this.X=d)&&Ph(d,hk)};k.ac=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.Tj&&!this.Sf){for(var c=null;(c=C(this.Da,this.Tj,c))&&(!c.lk||!(this.Sf=c.lk(this.Li,this))););if(this.Sf){if(c=C(this.Da,"Video"))this.Lb=c.Lb}else w(this.id+": "+this.Tj+" "+this.Li+" unavailable")}this.mc?fk(this,this.Lb):gk(this.Lb)}return!0};k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.ie()};
|
||||
k.save=function(){var a=new H(this);a.set(0,this.Yj());return a.data()};k.restore=function(a){return this.ie(a[0])};k.ie=function(a){var b=0;void 0===a&&(a=[!1,-1,-1,0,0,!1,!1,0]);this.mc=a[b++];this.Cg=a[b++];this.Dg=a[b++];this.yf=a[b++];this.zf=a[b++];this.ih=a[b++];this.jh=a[b++];this.fd=a[b];return!0};k.Yj=function(){var a=0,b=[];b[a++]=this.mc;b[a++]=this.Cg;b[a++]=this.Dg;b[a++]=this.yf;b[a++]=this.zf;b[a++]=this.ih;b[a++]=this.jh;b[a]=this.fd;return b};
|
||||
function fk(a,b){b&&(a.yi||(b.addEventListener("mousemove",function(b){if(a.mc&&a.S&&a.S.Ob){if(0>a.Cg||0>a.Dg)a.Cg=b.clientX,a.Dg=b.clientY;a.yf=b.clientX-a.Cg;a.zf=b.clientY-a.Dg;(a.yf||a.zf)&&ik(a,null,b.clientX,b.clientY);a.Cg=b.clientX;a.Dg=b.clientY}},!1),b.addEventListener("mousedown",function(b){jk(a,b.button,!0)},!1),b.addEventListener("mouseup",function(b){jk(a,b.button,!1)},!1),a.yi=!0),b.style.cursor="none")}function gk(a){a&&(a.style.cursor="auto")}
|
||||
function jk(a,b,c){if(a.mc&&a.S&&a.S.Ob)switch(b){case 0:a.ih!=c&&(a.ih=c,ik(a,"mouse button1 "+(c?"dn":"up")));break;case 2:a.jh!=c&&(a.jh=c,ik(a,"mouse button2 "+(c?"dn":"up")))}}function ik(a,b,c,d){var e=64|(a.ih?32:0)|(a.jh?16:0)|(a.zf&192)>>4|(a.yf&192)>>6,f=a.yf&63,g=a.zf&63;a.Qa((b?b+": ":"")+(void 0!==d?"mouse ("+c+","+d+"): ":"")+"serial packet ["+r(e)+","+r(f)+","+r(g)+"]");bk(a.Sf,[e,f,g]);a.yf=a.zf=0}k.Qa=function(a){this.X&&E(this.X,this.X.vm)&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","mouse"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new hk(d);Oa(d,c)}});function kk(a,b,c){x.call(this,"Disk",{id:a.th+".disk"+lk++},kk);this.ia=a;this.Da=a.Da;this.X=a.X;this.Pa=b;this.mode=c;this.Kd=b.name;this.gc=b.gc;this.$b=b.$b;this.jc=b.jc;this.Mb=b.Mb;this.ef=b.ef;this.Di=this.Ad=!1;this.create();this.re=[];this.Kg=[];this.Pd=null;this.Ok=0;this.Gi=!1;this.Ta()}var lk=0;y(x,kk);k=kk.prototype;k.pc=function(a,b,c,d){this.X=d};
|
||||
k.ac=function(a,b){b||this.Di&&!this.Ad&&this.load(this.Kd,this.tf);return!0};k.Wb=function(a,b){if(this.Ad){var c,d=0;if(this.Gi&&!ta("Disk writes are still in progress, shut down anyway?"))return!1;for(;c=mk(this,!1);)if(d=c[0]){this.Ga('Unable to save "'+this.Kd+'" (error '+d+")");break}b&&this.Ad&&(c="action=close&volume="+this.tf,c+="&machine="+this.ia.gf(),c+="&user="+this.ia.ge(),ra(sa()+"/api/v1/disk?"+c,!0),this.Ad=!1);d||this.Ga(this.Kd+" saved")}return!0};
|
||||
k.create=function(){this.pb=[];if("preload"!=this.mode){for(var a=Array(this.gc),b=0;b<a.length;b++){for(var c=Array(this.$b),d=0;d<c.length;d++){for(var e=Array(this.jc),f=1;f<=e.length;f++)e[f-1]=nk(null,b,d,f,this.Mb,"local"==this.mode?0:null);c[d]=e}a[b]=c}this.pb=a}this.gh=0};
|
||||
k.load=function(a,b,c){var d=b;this.Kd=a;this.tf=b;this.Fk=c;0>b.indexOf("/api/v1/dump")&&(a=fa(b),"json"==a?d=encodeURI(b):"demandrw"==this.mode||"demandro"==this.mode?(a="action=open&volume="+b+("&mode="+this.mode),a+="&chs="+this.gc+":"+this.$b+":"+this.jc+":"+this.Mb,a+="&machine="+this.ia.gf(),a+="&user="+this.ia.ge(),d=sa()+"/api/v1/disk?"+a,this.Di=!0):(c="path",d="&mbhd=10",!b.indexOf("http:")||!b.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(a)?(c="disk",d="&mbhd=0"):
|
||||
-1!==b.indexOf("/",b.length-1)&&(c="dir"),d=sa()+"/api/v1/dump?"+c+"="+encodeURIComponent(b)+(this.ef?"":d)+"&format=json"));ra(d,!0,null,this,this.ho,b)};
|
||||
k.ho=function(a,b,c,d){var e=null;this.ff=!1;var f=0>c&&this.Da&&!this.Da.Nb;if(this.Di)c?this.Ga('Unable to connect to disk "'+d+'" (error '+c+": "+b+")",f):(this.Ad=!0,e=this);else if(c)this.Ga('Unable to load disk "'+this.Kd+'" (error '+c+")",f);else try{if(0<ea(a,!0).toLowerCase().indexOf("-readonly"))this.ff=!0;else{var g=b.indexOf("\n");0<g&&1024>g&&0<b.substring(0,g).indexOf("write-protected")&&(this.ff=!0)}var h;h="<"==b.substr(0,1)?["Missing disk image: "+this.Kd]:0>b.indexOf("0x")&&'["'!=
|
||||
b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");if(h.length)if(1==h.length)w(h[0]);else{for(b=a=0;b<h.length;b++)for(c=0;c<h[b].length;c++)for(d=0;d<h[b][c].length;d++){var m=h[b][c][d],n=m.length;void 0===n&&(n=m.length=512);var n=n>>2,q=m.pattern;void 0===q&&(q=m.pattern=0);var t=m.data;if(void 0===t){var s=m.bytes;if(void 0!==s&&s.length){for(var f=n<<2,v=s.length;v<f;v++)s[v]=q;this.fill(m,s,0)}else t=[],q=m.pattern=q|q<<8|q<<16|q<<24,m.data=
|
||||
t;delete m.bytes}nk(m,b,c);for(f=0;f<t.length;f++)a=a+t[f]&4294967295}this.ib=h;this.gh=a;e=this}else w("Empty disk image: "+this.Kd)}catch(A){w("Disk image error: "+A.message)}this.Ck&&this.Ck.call(this.ia,this.Pa,e,this.Kd,this.tf)};function nk(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Lm=b;a.Nm=c;a.Zc=a.Hc=0;a.mb=!1;return a}
|
||||
k.eo=function(a,b,c,d){a=!1;if(!c){var e=d[0],f=d[1],g=d[2],h=d[3];a=d[4];b=JSON.parse(b);for(var m=0;h--;){var n=this.seek(e,f,g,!0);if(!n)break;this.fill(n,b,m);m+=n.length;g++}}(d=d[5])&&d(c,a)};function ok(a,b,c,d,e,f){if(a.Ad){var g;g="action=read&volume="+a.tf;g+="&chs="+a.oc+":"+a.fc+":"+a.rc+":"+a.Mb;g=g+("&addr="+b+":"+c+":"+d+":"+e)+("&machine="+a.ia.gf());g+="&user="+a.ia.ge();ra(sa()+"/api/v1/disk?"+g,!0,null,a,a.eo,[b,c,d,e,!0,f])}else f&&f(-1,!1)}
|
||||
function pk(a,b,c){b.mb=!0;var d=a.re.indexOf(b);0<=d&&(a.re.splice(d,1),a.Kg.splice(d,1));a.re.push(b);a.Kg.push(oa());c&&qk(a)}function qk(a){if(a.re.length){var b=a.Kg[0]+2E3;a.Pd&&a.Lk<b&&(clearTimeout(a.Pd),a.Pd=null);if(!a.Pd){var c=oa(),b=b-c;0>b&&(b=0);2E3<b&&(b=2E3);a.Pd=setTimeout(function(){mk(a,!0)},b);a.Lk=c+b}}else a.Pd&&(clearTimeout(a.Pd),a.Pd=null)}
|
||||
function mk(a,b){b&&(a.Pd=null);var c=a.re[0];if(c){for(var d=c.Lm,e=c.Nm,c=c.sector,f=0,g=[],h=c-1;h<a.ib[d][e].length;h++){var m=a.ib[d][e][h];if(!m.mb)break;var n=a.re.indexOf(m);a.re.splice(n,1);a.Kg.splice(n,1);g=g.concat(rk(m));m.mb=!1;f++}a.Ad?(h={},a.Ei=!0,h.action="write",h.volume=a.tf,h.chs=a.oc+":"+a.fc+":"+a.rc+":"+a.Mb,h.addr=d+":"+e+":"+c+":"+f,h.machine=a.ia.gf(),h.user=a.ia.ge(),h.data=JSON.stringify(g),d=ra(sa()+"/api/v1/disk",b,h,a,a.ko,[d,e,c,f,b])):d=!1;return b||d}return!1}
|
||||
k.ko=function(a,b,c,d){a=d[0];b=d[1];var e=d[2],f=d[3];d=d[4];this.Ei=!1;if(0<=a&&a<this.ib.length&&0<=b&&b<this.ib[a].length)for(e-=1;0<f--&&0<=e&&e<this.ib[a][b].length;e++){var g=this.ib[a][b][e];c?pk(this,g,!1):g.mb||(g.Zc=g.Hc=0)}d&&qk(this)};k.info=function(){return this.ib.length?[this.ib.length,this.ib[0].length,this.ib[0][0].length,this.ib[0][0][0].length]:[0,0,0,0]};
|
||||
function sk(a){a=JSON.stringify(a.ib);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,"");return a=a.replace(/(sector|length|data|pattern):/gm,'"$1":')}
|
||||
k.seek=function(a,b,c,d,e){var f=null,g=this.Pa,h=this.ib[a];if(h){var m=h[b];if(!m&&g.Lf&&b<g.fc)for(m=h[b]=Array(g.$d),h=0;h<m.length;h++)m[h]=nk(null,a,b,h+1,g.Wa,0);if(m){for(h=0;h<m.length;h++)if(m[h].sector==c){f=m[h];if(null===f.pattern)if(d)f.pattern=0;else if(e){for(d=1;++h<m.length;)null===m[h].pattern&&d++;ok(this,a,b,c,d,function(a,b){a&&(f=null);e(f,b)});return null}break}!f&&g.Lf&&9==g.Na&&(f=m[h]=nk(null,a,b,g.Na,g.Wa,0))}}e&&e(f,!1);return f};
|
||||
t;delete m.bytes}nk(m,b,c);for(f=0;f<t.length;f++)a=a+t[f]&4294967295}this.pb=h;this.gh=a;e=this}else w("Empty disk image: "+this.Kd)}catch(A){w("Disk image error: "+A.message)}this.Fk&&this.Fk.call(this.ia,this.Pa,e,this.Kd,this.tf)};function nk(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Om=b;a.Qm=c;a.Zc=a.Hc=0;a.lb=!1;return a}
|
||||
k.io=function(a,b,c,d){a=!1;if(!c){var e=d[0],f=d[1],g=d[2],h=d[3];a=d[4];b=JSON.parse(b);for(var m=0;h--;){var n=this.seek(e,f,g,!0);if(!n)break;this.fill(n,b,m);m+=n.length;g++}}(d=d[5])&&d(c,a)};function ok(a,b,c,d,e,f){if(a.Ad){var g;g="action=read&volume="+a.tf;g+="&chs="+a.gc+":"+a.$b+":"+a.jc+":"+a.Mb;g=g+("&addr="+b+":"+c+":"+d+":"+e)+("&machine="+a.ia.gf());g+="&user="+a.ia.ge();ra(sa()+"/api/v1/disk?"+g,!0,null,a,a.io,[b,c,d,e,!0,f])}else f&&f(-1,!1)}
|
||||
function pk(a,b,c){b.lb=!0;var d=a.re.indexOf(b);0<=d&&(a.re.splice(d,1),a.Kg.splice(d,1));a.re.push(b);a.Kg.push(oa());c&&qk(a)}function qk(a){if(a.re.length){var b=a.Kg[0]+2E3;a.Pd&&a.Ok<b&&(clearTimeout(a.Pd),a.Pd=null);if(!a.Pd){var c=oa(),b=b-c;0>b&&(b=0);2E3<b&&(b=2E3);a.Pd=setTimeout(function(){mk(a,!0)},b);a.Ok=c+b}}else a.Pd&&(clearTimeout(a.Pd),a.Pd=null)}
|
||||
function mk(a,b){b&&(a.Pd=null);var c=a.re[0];if(c){for(var d=c.Om,e=c.Qm,c=c.sector,f=0,g=[],h=c-1;h<a.pb[d][e].length;h++){var m=a.pb[d][e][h];if(!m.lb)break;var n=a.re.indexOf(m);a.re.splice(n,1);a.Kg.splice(n,1);g=g.concat(rk(m));m.lb=!1;f++}a.Ad?(h={},a.Gi=!0,h.action="write",h.volume=a.tf,h.chs=a.gc+":"+a.$b+":"+a.jc+":"+a.Mb,h.addr=d+":"+e+":"+c+":"+f,h.machine=a.ia.gf(),h.user=a.ia.ge(),h.data=JSON.stringify(g),d=ra(sa()+"/api/v1/disk",b,h,a,a.no,[d,e,c,f,b])):d=!1;return b||d}return!1}
|
||||
k.no=function(a,b,c,d){a=d[0];b=d[1];var e=d[2],f=d[3];d=d[4];this.Gi=!1;if(0<=a&&a<this.pb.length&&0<=b&&b<this.pb[a].length)for(e-=1;0<f--&&0<=e&&e<this.pb[a][b].length;e++){var g=this.pb[a][b][e];c?pk(this,g,!1):g.lb||(g.Zc=g.Hc=0)}d&&qk(this)};k.info=function(){return this.pb.length?[this.pb.length,this.pb[0].length,this.pb[0][0].length,this.pb[0][0][0].length]:[0,0,0,0]};
|
||||
function sk(a){a=JSON.stringify(a.pb);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,"");return a=a.replace(/(sector|length|data|pattern):/gm,'"$1":')}
|
||||
k.seek=function(a,b,c,d,e){var f=null,g=this.Pa,h=this.pb[a];if(h){var m=h[b];if(!m&&g.Lf&&b<g.$b)for(m=h[b]=Array(g.$d),h=0;h<m.length;h++)m[h]=nk(null,a,b,h+1,g.Wa,0);if(m){for(h=0;h<m.length;h++)if(m[h].sector==c){f=m[h];if(null===f.pattern)if(d)f.pattern=0;else if(e){for(d=1;++h<m.length;)null===m[h].pattern&&d++;ok(this,a,b,c,d,function(a,b){a&&(f=null);e(f,b)});return null}break}!f&&g.Lf&&9==g.Na&&(f=m[h]=nk(null,a,b,g.Na,g.Wa,0))}}e&&e(f,!1);return f};
|
||||
k.fill=function(a,b,c){for(var 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};function rk(a){var b=a.length,c=Array(b),d=0,b=b>>2,e=a.data;a=a.pattern;for(var f=0;f<b;f++){var g=f<e.length?e[f]:a;c[d++]=g&255;c[d++]=g>>8&255;c[d++]=g>>16&255;c[d++]=g>>24&255}return c}function tk(a,b){var c=-1;if(b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c}
|
||||
k.write=function(a,b,c){if(this.ff)return!1;if(b<a.length){if(c!=tk(a,b)){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.Hc?f<a.Zc?(a.Hc+=a.Zc-f,a.Zc=f):f>=a.Zc+a.Hc&&(a.Hc+=f-(a.Zc+a.Hc)+1):(a.Zc=f,a.Hc=1);d[f]=d[f]&~(255<<b)|c<<b;this.Ad&&pk(this,a,!0)}return!0}return null};
|
||||
k.save=function(){var a=0,b=[];b[a++]=[this.tf,this.gh];if(!this.Ad&&!this.ff)for(var c=this.ib,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.Hc){for(var h=[],m=0,n=g.Zc,q=g.Zc+g.Hc;n<q;)h[m++]=g.data[n++];b[a++]=[d,e,f,g.Zc,h]}}return b};
|
||||
k.restore=function(a){var b=0,c="unsupported restore format";if(this.ib.length&&a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&e[1]!=this.gh&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.gh+")",b=-1);for(;d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],m=g[f++],n=g[f++];if(h>=this.ib.length||m>=this.ib[h].length||n>=this.ib[h][m].length){c="sector "+h+":"+m+":"+n+" out of range ("+b+" changes applied)";b=-1;break}if(this.ff){c="unable to modify write-protected disk";b=-1;break}e=
|
||||
g[f++];f=g[f++];g=e+f.length;h=this.ib[h][m][n];for(m=h.data.length;m<e;)h.data[m++]=h.pattern;m=0;h.Zc=e;for(h.Hc=f.length;e<g;)h.data[e++]=f[m++];b++}}0>b&&this.Ga("unable to restore disk '"+this.Kd+": "+c);return b};k.Qa=function(a){this.X&&E(this.X,this.X.om)&&this.X.message(a)};
|
||||
function uk(a){x.call(this,"FDC",a,uk);this.dmaRead=this.qi;this.dmaWrite=this.ri;this.dmaFormat=this.Am;this.Le=null;if(a.autoMount&&(this.Le=a.autoMount,"string"==typeof this.Le))try{this.Le=eval("("+a.autoMount+")")}catch(b){w("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.Le=null}this.wc=[]}y(x,uk);l={};aa={};
|
||||
var vk={3:{wd:3,be:0,name:aa.Jp},4:{wd:2,be:1,name:aa.Hp},5:{wd:9,be:7,name:aa.Sp},6:{wd:9,be:7,name:aa.Cp},7:{wd:2,be:0,name:aa.Ep},8:{wd:1,be:2,name:aa.Ip},10:{wd:2,be:7,name:aa.Dp},13:{wd:6,be:7,name:aa.xp},15:{wd:3,be:0,name:aa.Gp}};k=uk.prototype;
|
||||
k.save=function(){var a=0,b=[];b[a++]=[this.tf,this.gh];if(!this.Ad&&!this.ff)for(var c=this.pb,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.Hc){for(var h=[],m=0,n=g.Zc,q=g.Zc+g.Hc;n<q;)h[m++]=g.data[n++];b[a++]=[d,e,f,g.Zc,h]}}return b};
|
||||
k.restore=function(a){var b=0,c="unsupported restore format";if(this.pb.length&&a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&e[1]!=this.gh&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.gh+")",b=-1);for(;d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],m=g[f++],n=g[f++];if(h>=this.pb.length||m>=this.pb[h].length||n>=this.pb[h][m].length){c="sector "+h+":"+m+":"+n+" out of range ("+b+" changes applied)";b=-1;break}if(this.ff){c="unable to modify write-protected disk";b=-1;break}e=
|
||||
g[f++];f=g[f++];g=e+f.length;h=this.pb[h][m][n];for(m=h.data.length;m<e;)h.data[m++]=h.pattern;m=0;h.Zc=e;for(h.Hc=f.length;e<g;)h.data[e++]=f[m++];b++}}0>b&&this.Ga("unable to restore disk '"+this.Kd+": "+c);return b};k.Qa=function(a){this.X&&E(this.X,this.X.rm)&&this.X.message(a)};
|
||||
function uk(a){x.call(this,"FDC",a,uk);this.dmaRead=this.si;this.dmaWrite=this.ti;this.dmaFormat=this.Dm;this.Le=null;if(a.autoMount&&(this.Le=a.autoMount,"string"==typeof this.Le))try{this.Le=eval("("+a.autoMount+")")}catch(b){w("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.Le=null}this.wc=[]}y(x,uk);l={};aa={};
|
||||
var vk={3:{wd:3,be:0,name:aa.Mp},4:{wd:2,be:1,name:aa.Kp},5:{wd:9,be:7,name:aa.Vp},6:{wd:9,be:7,name:aa.Fp},7:{wd:2,be:0,name:aa.Hp},8:{wd:1,be:2,name:aa.Lp},10:{wd:2,be:7,name:aa.Gp},13:{wd:6,be:7,name:aa.Ap},15:{wd:3,be:0,name:aa.Jp}};k=uk.prototype;
|
||||
k.xb=function(a,b,c,d){switch(c){case "listDisks":return this.sa[c]=d,a=window.document.createElement("option"),a.value="?",a.innerHTML="User-defined URL...",d.appendChild(a),d.onchange=function(a,b){return function(){var c=a.sa.descDisk;if(c){var d=b.options[b.selectedIndex];if(d){var m={};if(d=d.getAttribute("data-value"))try{m=eval("({"+d+"})")}catch(n){w("FDC option error: "+(n.message||n))}d=m.desc;void 0===d&&(d="");m=m.href;void 0!==m&&(d='<a href="'+m+'" target="_blank">'+d+"</a>");c.innerHTML=
|
||||
d}}}}(this,d),!0;case "descDisk":case "listDrives":return this.sa[c]=d,d.onchange=function(a,b){return function(){var c=parseInt(b.value,10);isNaN(c)||wk(a,c)}}(this,d),!0;case "loadDrive":return this.sa[c]=d,d.onclick=function(a){return function(){var b,c=a.sa.listDisks,d=a.sa.listDrives;if(c&&d&&!isNaN(b=parseInt(d.value,10))&&0<=b&&b<a.za.length)if(d=c.value){c=c.options[c.selectedIndex].text;if("?"==d){d=window.prompt("Enter the URL of a disk image to load.","");if(!d)return;c=ea(d);a.ca("Attempting to load "+
|
||||
d+' as "'+c+'"')}for(;xk(a,b,c,d,!1)&&window.confirm("Click OK to reload the original disk.\n(WARNING: All disk changes will be discarded)");){for(var m=a,n=d,q=void 0,q=0;q<m.wc.length;q++)if(m.wc[q][1]==n){m.wc.splice(q,1);break}yk(a,b,!1,!0)}}else yk(a,b);else a.Ga("Nothing to load")}}(this),!0}return!1};k.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.ka=C(a,"ChipSet");this.Ed();ib(b,this,zk);mb(b,this,Ak);Cc(c,19,this,this.Mi);this.Kf()||this.Ta()};
|
||||
k.$b=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Da.Ci){this.wc=[];for(var c=0;c<this.za.length;c++)yk(this,c,!0);this.Kf(!0)}}else if(!this.restore(a))return!1;if(c=this.sa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.innerHTML="";for(var d=0;d<this.Ui;d++){var e=window.document.createElement("option");e.value=d;e.innerHTML=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.Ui&&(c.value="0",wk(this,0))}}return!0};
|
||||
k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.Ed()};k.save=function(){var a=new H(this);a.set(0,this.Sj());return a.data()};k.restore=function(a){return this.Ed(a[0])};
|
||||
k.Ed=function(a){var b=0,c,d=!0;void 0===a&&(a=[0,0,128,Array(9),0,0,0,[]]);this.fb=a[b++];b++;this.ya=a[b++];this.ac=a[b++];this.pb=a[b++];this.Xa=a[b++];this.sf=a[b++];var e=a[b++];c=a[b++];null!=c&&(this.wc=c);void 0===this.za&&(this.Ui=4,this.ka&&(this.Ui=di(this.ka)),this.za=Array(4));for(c=0;c<this.za.length;c++){var f=this.za[c];void 0===f&&(f=this.za[c]={},f.xm=$h(this.ka,c),f.oc=40,f.rc=9,2==f.xm&&(f.oc=80,f.rc=18));this.Ki(f,c,e[c])||(d=!1)}this.oe=a[b++]||0;this.Xl=a[b]||0;return d};
|
||||
k.Sj=function(){var a=0,b=[];b[a++]=this.fb;b[a++]=0;b[a++]=this.ya;b[a++]=this.ac;b[a++]=this.pb;b[a++]=this.Xa;b[a++]=this.sf;b[a++]=this.Uj();for(var c=a++,d=0;d<this.za.length;d++){var e=this.za[d];e.va&&Bk(this,e.Oe,e.va)}b[c]=this.wc;b[a++]=this.oe;b[a]=this.Xl;return b};
|
||||
k.Ki=function(a,b,c){var d=0,e=!0;a.fb=b;void 0===c&&(c=[192,!0,0,2,0]);"boolean"==typeof c[1]&&(c[1]=["Floppy Drive",a.oc||40,a.fc||c[3],a.rc||9,a.Mb||512,c[1]]);a.Ya=c[d++];a.name=c[d][0];a.oc=c[d][1];a.fc=c[d][2];a.rc=c[d][3];a.Mb=c[d][4];a.ef=c[d][5];d++;a.Ha=c[d++];a.Yd=c[d++];a.lb=c[d++];a.Yd=100<=a.Yd?a.Yd-100:a.Yd-a.lb;a.Na=c[d++];a.$d=c[d++];a.Wa=c[d++];a.Va=c[d++];a.Ra=null;a.va||(a.Oe="");var f=c[d++];f===Ck?(f=c[d++],c=c[d],xk(this,b,f,c,!0)?a.va&&Dk(this,f,c,a.va):this.Ta(!1)):void 0!==
|
||||
f&&a.va&&0>a.va.restore(f)&&(e=!1);e&&a.va&&void 0!==a.Va&&(a.Ra=a.va.seek(a.lb,a.Ha,a.Na));return e};k.Uj=function(){for(var a=0,b=[],c=0;c<this.za.length;c++)b[a++]=this.Tj(this.za[c]);return b};k.Tj=function(a){var b=0,c=[];c[b++]=a.Ya;c[b++]=[a.name,a.oc,a.fc,a.rc,a.Mb,a.ef];c[b++]=a.Ha;c[b++]=a.Yd+100;c[b++]=a.lb;c[b++]=a.Na;c[b++]=a.$d;c[b++]=a.Wa;c[b++]=a.Va;c[b++]=Ck;c[b++]=a.bm;c[b]=a.Oe;return c};k.tk=function(a){var b;a=this.za[a];if(void 0!==a){b={};for(var c in a)b[c]=a[c]}return b};
|
||||
k.em=function(a,b,c){if(a.va){var d=a.va.info(),e=d[2],f=d[1]*e;if(b+c<=d[0]*f)return a.lb=Math.floor(b/f),b%=f,a.Ha=Math.floor(b/e),a.Na=b%e+1,a.Wa=c*d[3],a.Ya=0,!0}return!1};k.Kf=function(a){a||(this.ze=0);if(this.Le)for(var b in this.Le){var c=this.Le[b];if(c.name&&c.path){var d=b.charCodeAt(0)-65;if(0<=d&&d<this.za.length){!xk(this,d,c.name,c.path,!0)&&a&&this.Ta(!1);continue}}this.Ga("Unrecognized auto-mount specification for drive "+b)}return!!this.ze};
|
||||
function xk(a,b,c,d,e){var f=a.za[b];if(d&&f.Oe!=d){yk(a,b,e,!0);if(f.Kc)return a.Ga("Drive "+b+" busy"),!0;f.Kc=!0;e&&(f.Fe=!0,a.ze++,a.Qa("loading diskette '"+c+"'"));(new kk(a,f,"preload")).load(c,d,a.Un);return!1}return!0}
|
||||
k.Un=function(a,b,c,d){a.Kc=!1;b&&b.ib.length>a.oc&&(this.Ga('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.fb)),b=null);b&&(a.va=b,a.bm=c,a.Oe=d,Dk(this,c,d,b),this.oe|=128,this.Ga('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.fb),a.Fe));a.Fe&&(a.Fe=!1,--this.ze||this.Ta());wk(this,a.fb)};
|
||||
function wk(a,b){if(0<=b&&b<a.za.length){var c=a.za[b],d=a.sa.listDisks,e=a.sa.listDrives;if(d&&e&&(e=parseInt(e.value,10),!isNaN(e)&&e==b)){for(e=0;e<d.options.length;e++)if(d.options[e].value==c.Oe){d.selectedIndex!=e&&(d.selectedIndex=e);break}e==d.options.length&&(d.selectedIndex=0)}}}function yk(a,b,c,d){var e=a.za[b];e.va&&(Bk(a,e.Oe,e.va),e.bm="",e.Oe="",e.va=null,a.oe|=128,d||a.Ga("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||wk(a,b))}
|
||||
function Dk(a,b,c,d){var e;for(e=0;e<a.wc.length;e++)if(a.wc[e][1]==c){d.restore(a.wc[e][2]);return}a.wc[e]=[b,c,[]]}function Bk(a,b,c){var d;for(d=0;d<a.wc.length;d++)if(a.wc[d][1]==b){a.wc[d][2]=c.save();break}}k.Eo=function(a,b,c){this.ba(a,b,c,"OUTPUT");b&4?this.sf&4||this.sf&8&&this.ka&&zi(this.ka,6):this.Ed();this.sf=b};k.jn=function(a,b){this.ba(a,null,b,"STATUS",this.ya);return this.ya};
|
||||
k.gn=function(a,b){var c=0;this.pb<this.Xa&&(c=this.ac[this.pb]);this.sf&8&&this.ka&&Ai(this.ka,6);this.ba(a,null,b,"DATA["+this.pb+"]",c);++this.pb>=this.Xa&&(this.ya&=-81,this.pb=this.Xa=0);return c};
|
||||
k.Do=function(a,b,c){this.ba(a,b,c,"DATA["+this.Xa+"]");this.Xa<this.ac.length&&(this.ac[this.Xa++]=b);a=this.ac[0]&31;if(void 0!==vk[a]&&this.Xa>=vk[a].wd){b=!1;this.pb=0;var d;a=this.Oa()&31;switch(a){case 3:this.Oa(l.Kp);this.Oa(l.zp);this.Kb();break;case 4:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];this.Kb();this.hb((d.Ya&4278190080)>>>24,l.Op);break;case 5:case 6:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.Ha=c>>2&1;d.lb=this.Oa(l.Sh);this.Oa(l.Th);d.Na=this.Oa(l.Wh);b=this.Oa(l.Ig);
|
||||
d.Wa=128<<b;d.$d=this.Oa(l.wp);this.Oa(l.lm);this.Oa(l.vp);6==a?this.si(d):this.ti(d);this.Kb();Ek(this,d);Fk(this,d);Gk(this,d);this.hb(d.lb,l.Sh);this.hb(d.Ha,l.Th);this.hb(d.Na,l.Wh);this.hb(b,l.Ig);b=!0;break;case 7:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.lb=d.Yd=0;d.Ya=268435488;this.Kb();b=!0;break;case 8:d=this.za[this.fb];d.Ha=0;this.Kb();Ek(this,d);this.hb(d.lb,l.Bp);this.fb=this.fb+1&3;break;case 10:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.Ha=c>>2&1;d.Na=1;b=0;d.Ya=0;d.va&&
|
||||
(d.Ra=d.va.seek(d.lb,d.Ha,d.Na))?b=d.Ra.length:d.Ya=1088;Ek(this,d);Fk(this,d);Gk(this,d);this.hb(d.lb,l.Sh);this.hb(d.Ha,l.Th);this.hb(d.Na,l.Wh);this.hb(b,l.Ig);b=!0;break;case 13:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.Ha=c>>2&1;b=this.Oa(l.Ig);d.Wa=128<<b;d.$d=this.Oa(l.Fp);this.Oa(l.lm);d.jk=this.Oa(l.up);this.vk(d);this.Kb();Ek(this,d);Fk(this,d);Gk(this,d);this.hb(d.lb,l.Sh);this.hb(d.Ha,l.Th);this.hb(d.Na,l.Wh);this.hb(b,l.Ig);b=!0;break;case 15:c=this.Oa(l.Af),this.fb=c&3,d=this.za[this.fb],
|
||||
d.Ha=c>>2&1,a=this.Oa(l.Ap),d.lb+=a-d.Yd,0>d.lb&&(d.lb=0),d.lb>=d.oc&&(d.lb=d.oc-1),d.Yd=a,d.Ya=32,0==d.lb&&(d.Ya|=268435456),this.Kb(),b=!0}0<this.Xa&&(this.ya|=80);this.sf&8&&(!d||d.Ya&8||!b||this.ka&&zi(this.ka,6))}};k.hn=function(a,b){var c=this.oe;this.oe&=-129;this.ba(a,null,b,"INPUT",c);return c};k.Co=function(a,b,c){this.ba(a,b,c,"CONTROL");this.Xl=b};k.Oa=function(){var a=this.ac[this.pb];this.pb++;return a};k.Kb=function(){this.pb=this.Xa=0};k.hb=function(a){this.ac[this.Xa++]=a};
|
||||
function Ek(a,b){a.hb(b.fb|b.Ha<<2|b.Ya&255,l.Lp)}function Fk(a,b){a.hb((b.Ya&65280)>>>8,l.Mp)}function Gk(a,b){a.hb((b.Ya&16711680)>>>16,l.Np)}k.qi=function(a,b,c){void 0===b||0>b?this.sc(a,c):c(-1,!1)};k.ri=function(a,b){return void 0!==b&&0<=b?this.Dc(a,b):-1};k.Am=function(a,b){return void 0!==b&&0<=b?this.Wj(a,b):-1};k.si=function(a){a.Ya=72;a.va&&(a.Ra=null,a.Ya=0,this.ka&&(si(this.ka,2,this,"dmaRead",a),mi(this.ka,2)))};
|
||||
k.ti=function(a){a.Ya=72;a.va&&(a.va.ff?a.Ya=576:(a.Ra=null,a.Ya=0,this.ka&&(si(this.ka,2,this,"dmaWrite",a),mi(this.ka,2))))};k.vk=function(a){a.Ya=72;a.va&&(a.Ra=null,a.Ya=0,this.ka&&(a.Ce=0,a.yc=Array(4),a.Lf=!0,a.Rf=0,si(this.ka,2,this,"dmaFormat",a),mi(this.ka,2),a.Lf=!1))};k.sc=function(a,b){var c=-1;if(!a.Ya&&a.va){do{if(a.Ra&&0<=(c=tk(a.Ra,a.Va++)))break;a.Ra=a.va.seek(a.lb,a.Ha,a.Na);if(!a.Ra){a.Ya=1088;break}a.Va=0;this.If(a)}while(1)}b(c,!1)};
|
||||
k.Dc=function(a,b){if(a.Ya||!a.va)return-1;do{if(a.Ra&&a.va.write(a.Ra,a.Va++,b))break;a.Ra=a.va.seek(a.lb,a.Ha,a.Na);if(!a.Ra){a.Ya=8256;b=-1;break}a.Va=0;this.If(a)}while(1);return b};k.If=function(a){a.Na++;a.Na>=a.rc+1&&(a.Na=1,a.Ha++,a.Ha>=a.fc&&(a.Ha=0,a.lb++))};k.Wj=function(a,b){if(a.Ya)return-1;a.yc[a.Ce++]=b;if(a.Ce==a.yc.length){a.lb=a.yc[0];a.Ha=a.yc[1];a.Na=a.yc[2];a.Wa=128<<a.yc[3];for(var c=a.Ce=0;c<a.Wa;c++)if(0>this.Dc(a,a.jk))return-1;a.Rf++}a.Rf>=a.$d&&(b=-1);return b};
|
||||
k.Mi=function(a){var b=this.S.J&255;this.X&&E(this.X,this.X.Eg)&&128>b&&(Ec(this.X,19,a),Fc(this.S,a,function(a,b){return function(e){Gc(a.X,19,e,F(a.S)-b)}}(this,F(this.S))));return!0};k.Qa=function(a){this.X&&E(this.X,this.X.Eg)&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.Eg,e)};var zk={1012:uk.prototype.jn,1013:uk.prototype.gn,1015:uk.prototype.hn},Ak={1010:uk.prototype.Eo,1013:uk.prototype.Do,1015:uk.prototype.Co};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","fdc"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new uk(d);Oa(d,c)}});function W(a){x.call(this,"HDC",a,W);this.dmaRead=this.qi;this.dmaWrite=this.ri;this.dmaWriteBuffer=this.Bm;this.dmaWriteFormat=this.Cm;this.Yh=[];if(a.drives)try{this.Yh=eval("("+a.drives+")")}catch(b){w("HDC drive configuration error: "+b.message+" ("+a.drives+")")}this.ag=(this.Ee="at"==a.type)?1:0;this.Mm=this.Ee?2:3}y(x,W);
|
||||
var Hk=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7]}];k=W.prototype;k.xb=function(){return!1};k.nc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.ka=C(a,"ChipSet");ib(b,this,this.Ee?Ik:Jk);mb(b,this,this.Ee?Kk:Lk);Cc(c,19,this,this.Mn);Cc(c,64,this,this.Mi);this.reset();this.Kf()||this.Ta()};
|
||||
k.$b=function(a,b){if(!b)if(!a||!this.restore)this.Ed(),this.Da.Ci&&this.Kf(!0);else if(!this.restore(a))return!1;return!0};k.Wb=function(a){return a&&this.save?this.save():!0};k.gf=function(){return this.Da?this.Da.gf():""};k.ge=function(){return this.Da?this.Da.ge():""};k.reset=function(){this.Ed(null,!0)};k.save=function(){var a=new H(this);a.set(0,this.Sj());return a.data()};k.restore=function(a){return this.Ed(a[0])};
|
||||
k.Ed=function(a,b){var c=0,d=!0;if(this.Ee)null==a&&(a=[0,0,0,0,0,0,0,0,64,0]),this.ne=a[c++],this.am=a[c++],this.Lh=a[c++],this.Mh=a[c++],this.Kh=a[c++],this.Jh=a[c++],this.rf=a[c++],this.ya=a[c++],this.Pj=a[c++];else{null==a&&(a=[0,0,Array(14),0,0]);this.qf=a[c++];this.ya=a[c++];this.ac=a[c++];this.pb=a[c++];this.Xa=a[c++];this.$l=a[c++];this.Zl=a[c++];this.Yl=a[c++];var e=a[c++];void 0!==e?this.hf=e:void 0===this.hf&&(this.hf=-1)}void 0===this.za&&(this.za=Array(this.Yh.length));c=a[c];void 0===
|
||||
c&&(c=[]);for(e=0;e<this.za.length;e++){void 0===this.za[e]&&(this.za[e]={});var f=this.za[e];this.Ki(e,f,this.Yh[e],c[e],b)||(d=!1);null!=this.qf&&1>=e&&(this.qf|=(f.type&3)<<(1-e<<1))}return d};
|
||||
k.Sj=function(){var a=0,b=[];this.Ee?(b[a++]=this.ne,b[a++]=this.am,b[a++]=this.Lh,b[a++]=this.Mh,b[a++]=this.Kh,b[a++]=this.Jh,b[a++]=this.rf,b[a++]=this.ya,b[a++]=this.Pj):(b[a++]=this.qf,b[a++]=this.ya,b[a++]=this.ac,b[a++]=this.pb,b[a++]=this.Xa,b[a++]=this.$l,b[a++]=this.Zl,b[a++]=this.Yl,b[a++]=this.hf);b[a]=this.Uj();return b};
|
||||
k.Ki=function(a,b,c,d,e){var f=0,g=!0;void 0===d&&(d=[0,0,!1,Array(8)]);b.fb=a;b.errorCode=d[f++];b.gm=d[f++];b.ef=d[f++];b.We=d[f++];b.Xe=d[f++];b.Ha=d[f++];b.fc=d[f++];b.Qd=d[f++];b.Na=d[f++];b.$d=d[f++];b.Wa=d[f++];b.Yg=this.Ee?0:1;b.name=c.name;void 0===b.name&&(b.name="Hard Drive");b.path=c.path;b.mode=c.mode||(b.path?"preload":"local");"demandro"!=b.mode&&"demandrw"!=b.mode||this.ge()||(b.mode="local");b.type=c.type;if(void 0===b.type||void 0===Hk[this.ag][b.type])b.type=this.Mm;c=Hk[this.ag][b.type];
|
||||
b.rc=c[2]||17;b.Mb=c[3]||512;if(e&&this.ka&&(e=this.ka,c=b.type,e.pa)){var h=e.pa[18],h=a?h&240|c:h&15|c<<4;e.pa&&(e.pa[18]=h,ai(e))}void 0===b.va&&(b.va=null,this.Ga("Type "+b.type+' "'+b.name+'" is fixed disk '+a,!0));Mk(this,b);b.Va=d[f++];b.Ra=null;b.va&&(a=d[f],void 0!==a&&0>b.va.restore(a)&&(g=!1),g&&void 0!==b.Va&&(b.Ra=b.va.seek(b.Qd,b.Ha,b.Na+b.Yg)));return g};k.Uj=function(){for(var a=0,b=[],c=0;c<this.za.length;c++)b[a++]=this.Tj(this.za[c]);return b};
|
||||
k.Tj=function(a){var b=0,c=[];c[b++]=a.errorCode;c[b++]=a.gm;c[b++]=a.ef;c[b++]=a.We;c[b++]=a.Xe;c[b++]=a.Ha;c[b++]=a.fc;c[b++]=a.Qd;c[b++]=a.Na;c[b++]=a.$d;c[b++]=a.Wa;c[b++]=a.Va;c[b]=a.va?a.va.save():null;return c};k.tk=function(a){var b;a=this.za[a];if(void 0!==a){b={};for(var c in a)b[c]=a[c]}return b};
|
||||
function Mk(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.We[2])?e=b.We[0]<<8|b.We[1]:c=b.type);null==c||d||(d=Hk[a.ag][c][1],e=Hk[a.ag][c][0]);d&&((c=Hk[a.ag][b.type])&&e!=c[0]&&d!=c[1]&&a.Ga("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.oc=e,b.fc=d,null==b.va&&(b.va=new kk(a,b,b.mode)))}}
|
||||
k.em=function(a,b,c){if(a.va){var d=a.va.info(),e=d[0];if(e){var f=d[2],g=d[1]*f;if(b+c<=e*g)return a.Qd=Math.floor(b/g),b%=g,a.Ha=Math.floor(b/f),a.Na=b%f,a.Wa=c*d[3],a.errorCode=0,!0}}return!1};
|
||||
k.Kf=function(a){a||(this.ze=0);for(var b=0;b<this.za.length;b++){var c=this.za[b];if(c.name&&c.path){var d;d=c.name;var c=c.path,e=this.za[b];e.Kc?(this.Ga("Drive "+b+" busy"),d=!0):(e.Kc=!0,e.Fe=!0,this.ze++,this.Qa("loading "+d),(e.va||new kk(this,e,e.mode)).load(d,c,this.Tn),d=!1);!d&&a&&this.Ta(!1)}else a&&void 0!==c.type&&(c.va=null,Mk(this,c,c.type))}return!!this.ze};
|
||||
k.Tn=function(a,b,c){a.Kc=!1;(a.va=b)&&this.Ga('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.fb),a.Fe);a.Fe&&(a.Fe=!1,--this.ze||this.Ta())};k.Jn=function(a,b){var c=0;this.pb<this.Xa&&(c=this.ac[this.pb]);this.ka&&Ai(this.ka,5);this.ya&=-33;this.ba(a,null,b,"DATA["+this.pb+"]",c);++this.pb>=this.Xa&&(this.pb=this.Xa=0,this.ya&=-15);return c};
|
||||
k.$o=function(a,b,c){this.ba(a,b,c,"DATA["+this.Xa+"]");this.Xa<this.ac.length&&(this.ac[this.Xa++]=b);a=12!=this.ac[0]?6:this.ac.length;6==this.Xa&&(this.ya&=-2);this.Xa>=a&&(this.ya|=2,this.ya&=-2,Nk(this))};k.Kn=function(a,b){var c=this.ya;this.ba(a,null,b,"STATUS",c);this.pb<this.Xa&&(this.ya|=1);return c};k.cp=function(a,b,c){this.ba(a,b,c,"RESET");this.$l=b;this.ka&&Ai(this.ka,5);this.Ed()};k.In=function(a,b){this.ba(a,null,b,"CONFIG",this.qf);return this.qf};
|
||||
k.bp=function(a,b,c){this.ba(a,b,c,"PULSE");this.Zl=b;this.ya=13};k.ap=function(a,b,c){this.ba(a,b,c,"PATTERN");this.Yl=b};k.Kj=function(a,b,c){this.ba(a,b,c,"NOISE")};k.Um=function(a,b){var c=-1,d=!1;if(this.Pa&&(d=0<this.Pa.Va,c=this.sc(this.Pa),this.Pa.Va==this.Pa.Mb))if(this.Pa.Wa-=this.Pa.Mb,this.Pa.Wa>=this.Pa.Mb){var e=this;this.sc(this.Pa,function(a){0<=a?e.ka&&zi(e.ka,14):(e.ya=1,e.ne=16)},!1)}else this.ya=80;d||this.ba(a,null,b,"DATA",c);return c};
|
||||
k.ro=function(a,b,c){this.Pa&&0!=this.Pa.Va||this.ba(a,b,c,"DATA");this.Pa&&this.Pa.Wa>=this.Pa.Mb&&(0>this.Dc(this.Pa,b)?(this.ya=1,this.ne=16):this.Pa.Va==this.Pa.Mb&&(this.Pa.Wa-=this.Pa.Mb,this.ka&&zi(this.ka,14),this.Pa.Wa>=this.Pa.Mb||(this.ya=80)))};k.Wm=function(a,b){var c=this.ne;this.ba(a,null,b,"ERROR",c);return c};k.vo=function(a,b,c){this.ba(a,b,c,"WPREC");this.am=b};k.Xm=function(a,b){var c=this.Lh;this.ba(a,null,b,"SECCNT",c);return c};
|
||||
k.to=function(a,b,c){this.ba(a,b,c,"SECCNT");this.Lh=b};k.Ym=function(a,b){var c=this.Mh;this.ba(a,null,b,"SECNUM",c);return c};k.uo=function(a,b,c){this.ba(a,b,c,"SECNUM");this.Mh=b};k.Tm=function(a,b){var c=this.Kh;this.ba(a,null,b,"CYLLO",c);return c};k.qo=function(a,b,c){this.ba(a,b,c,"CYLLO");this.Kh=b};k.Sm=function(a,b){var c=this.Jh;this.ba(a,null,b,"CYLHI",c);return c};k.po=function(a,b,c){this.ba(a,b,c,"CYLHI");this.Jh=b};k.Vm=function(a,b){var c=this.rf;this.ba(a,null,b,"DRVHD",c);return c};
|
||||
k.so=function(a,b,c){this.ba(a,b,c,"DRVHD");this.rf=b;this.ya=this.za[this.rf&16?1:0]?this.ya|64:this.ya&-65};k.Zm=function(a,b){var c=this.ya;this.ba(a,null,b,"STATUS",c);return c};k.oo=function(a,b,c){this.ba(a,b,c,"COMMAND");this.Pj=b;this.ka&&Ai(this.ka,14);Ok(this)};
|
||||
function Ok(a){var b=!1,c=a.Pj,d=a.rf&16?1:0,e=a.rf&15,f=a.Kh|(a.Jh&3)<<8,g=a.Mh,h=a.Lh;a.Pa=null;a.ne=0;a.ya=80;(d=a.za[d])?(d.Qd=f,d.Ha=e,d.Na=g,d.Wa=h*d.Mb,c=144<=c?c:c&240,d.Ra=null,d.errorCode=0,a.Pa=d):c=-1;switch(c&240){case 32:a.sc(d,function(b){0<=b&&a.ka?(zi(a.ka,14),a.ya=136):(a.ya=1,a.ne=16)},!1);break;case 48:a.ka?(zi(a.ka,14),a.ya=136):(a.ya=1,a.ne=4);break;case 16:b=!0;break;case 64:b=!0;break;case 144:a.ne=1;b=!0;break;case 145:d.fc=e+1,d.rc=h,b=!0}b&&a.ka&&zi(a.ka,14)}
|
||||
function Nk(a){a.pb=0;var b=a.Oa(),c=a.Oa(),d=c&32,e=d>>5,f=c&31,g=a.Oa(),h=a.Oa(),m=g<<2&768|h,n=g&63,q=a.Oa(),t=a.Oa(),s=a.za[e];s&&(s.Qd=m,s.Ha=f,s.Na=n,s.Wa=q*s.Mb);switch(b){case 3:a.Kb(s?s.errorCode:4);a.hb(c);a.hb(g);a.hb(h);a.hb(0|d);b=-1;break;case 12:for(c=0;0<=(b=a.Oa());)s&&c<s.We.length&&(s.We[c++]=b);s&&Mk(a,s);b=0;s||a.hf!=e||(a.hf=-1,b=2);a.Kb(b|d);b=-1;break;case 224:case 228:a.Kb(0|d),b=-1}if(0<=b)switch(void 0===s?b=-1:(s.errorCode=0,s.gm=0),b){case 0:a.Kb(0|d);break;case 1:s.Tp=
|
||||
t;a.Kb(0|d);break;case 5:a.Kb(0|d);break;case 8:a.si(s,function(b){a.Kb(b|d)});break;case 10:a.ti(s,function(b){a.Kb(b|d)});break;case 15:Pk(a,s,function(b){a.Kb(b|d)});break;default:a.Kb(2|d)}}k.Oa=function(){var a=-1;this.pb<this.Xa&&(a=this.ac[this.pb++]);return a};k.Kb=function(a){this.pb=this.Xa=0;void 0!==a&&this.hb(a);this.ka&&zi(this.ka,5);this.ya|=32};k.hb=function(a){this.ac[this.Xa++]=a};k.qi=function(a,b,c){void 0===b||0>b?this.sc(a,c):c(-1,!1)};
|
||||
k.ri=function(a,b){return void 0!==b&&0<=b?this.Dc(a,b):-1};k.Bm=function(a,b){var c;void 0!==b&&0<=b?(c=b,a.Va<a.Xe.length?a.Xe[a.Va++]=c:(a.errorCode=20,c=-1)):c=-1;return c};k.Cm=function(a,b){return void 0!==b&&0<=b?this.Wj(a,b):-1};k.si=function(a,b){a.errorCode=4;if(a.va&&(a.Ra=null,this.ka)){a.errorCode=0;si(this.ka,3,this,"dmaRead",a);mi(this.ka,3,function(c){c||0!=a.errorCode||(a.errorCode=4);b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
k.ti=function(a,b){a.errorCode=4;if(a.va&&(a.Ra=null,this.ka)){a.errorCode=0;si(this.ka,3,this,"dmaWrite",a);mi(this.ka,3,function(c){c||(0==a.errorCode&&(a.errorCode=4),20==a.errorCode&&(a.errorCode=0));b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};function Pk(a,b,c){b.errorCode=4;b.Xe&&b.Xe.length==b.Wa||(b.Xe=Array(b.Wa));b.Va=0;a.ka?(b.errorCode=0,si(a.ka,3,a,"dmaWriteBuffer",b),mi(a.ka,3,function(a){a||0!=b.errorCode||(b.errorCode=4);c(b.errorCode?2:0)})):c(b.errorCode?2:0)}
|
||||
k.vk=function(a,b){a.errorCode=4;if(a.va&&(a.Ra=null,this.ka)){a.Ce=0;a.yc=Array(4);a.Lf=!0;a.Rf=0;a.errorCode=0;si(this.ka,3,this,"dmaWriteFormat",a);mi(this.ka,3,function(c){c||0!=a.errorCode||(a.errorCode=4);a.Lf=!1;b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
d+' as "'+c+'"')}for(;xk(a,b,c,d,!1)&&window.confirm("Click OK to reload the original disk.\n(WARNING: All disk changes will be discarded)");){for(var m=a,n=d,q=void 0,q=0;q<m.wc.length;q++)if(m.wc[q][1]==n){m.wc.splice(q,1);break}yk(a,b,!1,!0)}}else yk(a,b);else a.Ga("Nothing to load")}}(this),!0}return!1};k.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.ka=C(a,"ChipSet");this.Ed();ib(b,this,zk);mb(b,this,Ak);Cc(c,19,this,this.Oi);this.Kf()||this.Ta()};
|
||||
k.ac=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Da.Ei){this.wc=[];for(var c=0;c<this.za.length;c++)yk(this,c,!0);this.Kf(!0)}}else if(!this.restore(a))return!1;if(c=this.sa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.innerHTML="";for(var d=0;d<this.Xi;d++){var e=window.document.createElement("option");e.value=d;e.innerHTML=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.Xi&&(c.value="0",wk(this,0))}}return!0};
|
||||
k.Wb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.Ed()};k.save=function(){var a=new H(this);a.set(0,this.Vj());return a.data()};k.restore=function(a){return this.Ed(a[0])};
|
||||
k.Ed=function(a){var b=0,c,d=!0;void 0===a&&(a=[0,0,128,Array(9),0,0,0,[]]);this.fb=a[b++];b++;this.ya=a[b++];this.bc=a[b++];this.ob=a[b++];this.Xa=a[b++];this.sf=a[b++];var e=a[b++];c=a[b++];null!=c&&(this.wc=c);void 0===this.za&&(this.Xi=4,this.ka&&(this.Xi=di(this.ka)),this.za=Array(4));for(c=0;c<this.za.length;c++){var f=this.za[c];void 0===f&&(f=this.za[c]={},f.Am=$h(this.ka,c),f.gc=40,f.jc=9,2==f.Am&&(f.gc=80,f.jc=18));this.Mi(f,c,e[c])||(d=!1)}this.oe=a[b++]||0;this.$l=a[b]||0;return d};
|
||||
k.Vj=function(){var a=0,b=[];b[a++]=this.fb;b[a++]=0;b[a++]=this.ya;b[a++]=this.bc;b[a++]=this.ob;b[a++]=this.Xa;b[a++]=this.sf;b[a++]=this.Xj();for(var c=a++,d=0;d<this.za.length;d++){var e=this.za[d];e.va&&Bk(this,e.Oe,e.va)}b[c]=this.wc;b[a++]=this.oe;b[a]=this.$l;return b};
|
||||
k.Mi=function(a,b,c){var d=0,e=!0;a.fb=b;void 0===c&&(c=[192,!0,0,2,0]);"boolean"==typeof c[1]&&(c[1]=["Floppy Drive",a.gc||40,a.$b||c[3],a.jc||9,a.Mb||512,c[1]]);a.Ya=c[d++];a.name=c[d][0];a.gc=c[d][1];a.$b=c[d][2];a.jc=c[d][3];a.Mb=c[d][4];a.ef=c[d][5];(a.Wi=c[d][6])?(a.Ch=c[d][7],a.Dh=c[d][8]):(a.Wi=a.gc,a.Ch=a.$b,a.Dh=a.jc);d++;a.Ha=c[d++];a.Yd=c[d++];a.kb=c[d++];a.Yd=100<=a.Yd?a.Yd-100:a.Yd-a.kb;a.Na=c[d++];a.$d=c[d++];a.Wa=c[d++];a.Va=c[d++];a.Ra=null;a.va||(a.Oe="");var f=c[d++];f===Ck?(f=
|
||||
c[d++],c=c[d],xk(this,b,f,c,!0)?a.va&&Dk(this,f,c,a.va):this.Ta(!1)):void 0!==f&&a.va&&0>a.va.restore(f)&&(e=!1);e&&a.va&&void 0!==a.Va&&(a.Ra=a.va.seek(a.kb,a.Ha,a.Na));return e};k.Xj=function(){for(var a=0,b=[],c=0;c<this.za.length;c++)b[a++]=this.Wj(this.za[c]);return b};k.Wj=function(a){var b=0,c=[];c[b++]=a.Ya;c[b++]=[a.name,a.gc,a.$b,a.jc,a.Mb,a.ef,a.Wi,a.Ch,a.Dh];c[b++]=a.Ha;c[b++]=a.Yd+100;c[b++]=a.kb;c[b++]=a.Na;c[b++]=a.$d;c[b++]=a.Wa;c[b++]=a.Va;c[b++]=Ck;c[b++]=a.em;c[b]=a.Oe;return c};
|
||||
k.wk=function(a){var b;a=this.za[a];if(void 0!==a){b={};for(var c in a)b[c]=a[c]}return b};k.hm=function(a,b,c){if(a.va){var d=a.va.info(),e=d[2],f=d[1]*e;if(b+c<=d[0]*f)return a.kb=Math.floor(b/f),b%=f,a.Ha=Math.floor(b/e),a.Na=b%e+1,a.Wa=c*d[3],a.Ya=0,!0}return!1};
|
||||
k.Kf=function(a){a||(this.ze=0);if(this.Le)for(var b in this.Le){var c=this.Le[b];if(c.name&&c.path){var d=b.charCodeAt(0)-65;if(0<=d&&d<this.za.length){!xk(this,d,c.name,c.path,!0)&&a&&this.Ta(!1);continue}}this.Ga("Unrecognized auto-mount specification for drive "+b)}return!!this.ze};
|
||||
function xk(a,b,c,d,e){var f=a.za[b];if(d&&f.Oe!=d){yk(a,b,e,!0);if(f.Kc)return a.Ga("Drive "+b+" busy"),!0;f.Kc=!0;e&&(f.Fe=!0,a.ze++,a.Qa("loading diskette '"+c+"'"));(new kk(a,f,"preload")).load(c,d,a.Xn);return!1}return!0}
|
||||
k.Xn=function(a,b,c,d){var e;a.Kc=!1;b&&(e=b.info(),b&&e[0]>a.gc||e[1]>a.$b||e[2]>a.jc)&&(this.Ga('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.fb)),b=null);b&&(a.va=b,a.em=c,a.Oe=d,Dk(this,c,d,b),this.oe|=128,this.Ga('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.fb),a.Fe),a.Wi=e[0],a.Ch=e[1],a.Dh=e[2]);a.Fe&&(a.Fe=!1,--this.ze||this.Ta());wk(this,a.fb)};
|
||||
function wk(a,b){if(0<=b&&b<a.za.length){var c=a.za[b],d=a.sa.listDisks,e=a.sa.listDrives;if(d&&e&&(e=parseInt(e.value,10),!isNaN(e)&&e==b)){for(e=0;e<d.options.length;e++)if(d.options[e].value==c.Oe){d.selectedIndex!=e&&(d.selectedIndex=e);break}e==d.options.length&&(d.selectedIndex=0)}}}function yk(a,b,c,d){var e=a.za[b];e.va&&(Bk(a,e.Oe,e.va),e.em="",e.Oe="",e.va=null,a.oe|=128,d||a.Ga("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||wk(a,b))}
|
||||
function Dk(a,b,c,d){var e;for(e=0;e<a.wc.length;e++)if(a.wc[e][1]==c){d.restore(a.wc[e][2]);return}a.wc[e]=[b,c,[]]}function Bk(a,b,c){var d;for(d=0;d<a.wc.length;d++)if(a.wc[d][1]==b){a.wc[d][2]=c.save();break}}k.Ho=function(a,b,c){this.ba(a,b,c,"OUTPUT");b&4?this.sf&4||this.sf&8&&this.ka&&zi(this.ka,6):this.Ed();this.sf=b};k.mn=function(a,b){this.ba(a,null,b,"STATUS",this.ya);return this.ya};
|
||||
k.kn=function(a,b){var c=0;this.ob<this.Xa&&(c=this.bc[this.ob]);this.sf&8&&this.ka&&Ai(this.ka,6);this.ba(a,null,b,"DATA["+this.ob+"]",c);++this.ob>=this.Xa&&(this.ya&=-81,this.ob=this.Xa=0);return c};
|
||||
k.Go=function(a,b,c){this.ba(a,b,c,"DATA["+this.Xa+"]");this.Xa<this.bc.length&&(this.bc[this.Xa++]=b);a=this.bc[0]&31;if(void 0!==vk[a]&&this.Xa>=vk[a].wd){b=!1;this.ob=0;var d;a=this.Oa()&31;switch(a){case 3:this.Oa(l.Np);this.Oa(l.Cp);this.Kb();break;case 4:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];this.Kb();this.hb((d.Ya&4278190080)>>>24,l.Rp);break;case 5:case 6:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.Ha=c>>2&1;d.kb=this.Oa(l.Uh);this.Oa(l.Vh);d.Na=this.Oa(l.Yh);b=this.Oa(l.Ig);
|
||||
d.Wa=128<<b;d.$d=this.Oa(l.zp);this.Oa(l.om);this.Oa(l.yp);6==a?this.ui(d):this.vi(d);this.Kb();Ek(this,d);Fk(this,d);Gk(this,d);this.hb(d.kb,l.Uh);this.hb(d.Ha,l.Vh);this.hb(d.Na,l.Yh);this.hb(b,l.Ig);b=!0;break;case 7:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.kb=d.Yd=0;d.Ya=268435488;this.Kb();b=!0;break;case 8:d=this.za[this.fb];d.Ha=0;this.Kb();Ek(this,d);this.hb(d.kb,l.Ep);this.fb=this.fb+1&3;break;case 10:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.Ha=c>>2&1;d.Na=1;b=0;d.Ya=0;d.va&&
|
||||
(d.Ra=d.va.seek(d.kb,d.Ha,d.Na))?b=d.Ra.length:d.Ya=1088;Ek(this,d);Fk(this,d);Gk(this,d);this.hb(d.kb,l.Uh);this.hb(d.Ha,l.Vh);this.hb(d.Na,l.Yh);this.hb(b,l.Ig);b=!0;break;case 13:c=this.Oa(l.Af);this.fb=c&3;d=this.za[this.fb];d.Ha=c>>2&1;b=this.Oa(l.Ig);d.Wa=128<<b;d.$d=this.Oa(l.Ip);this.Oa(l.om);d.mk=this.Oa(l.xp);this.yk(d);this.Kb();Ek(this,d);Fk(this,d);Gk(this,d);this.hb(d.kb,l.Uh);this.hb(d.Ha,l.Vh);this.hb(d.Na,l.Yh);this.hb(b,l.Ig);b=!0;break;case 15:c=this.Oa(l.Af),this.fb=c&3,d=this.za[this.fb],
|
||||
d.Ha=c>>2&1,a=this.Oa(l.Dp),d.kb+=a-d.Yd,0>d.kb&&(d.kb=0),d.kb>=d.gc&&(d.kb=d.gc-1),d.Yd=a,d.Ya=32,0==d.kb&&(d.Ya|=268435456),this.Kb(),b=!0}0<this.Xa&&(this.ya|=80);this.sf&8&&(!d||d.Ya&8||!b||this.ka&&zi(this.ka,6))}};k.ln=function(a,b){var c=this.oe;this.oe&=-129;this.ba(a,null,b,"INPUT",c);return c};k.Fo=function(a,b,c){this.ba(a,b,c,"CONTROL");this.$l=b};k.Oa=function(){var a=this.bc[this.ob];this.ob++;return a};k.Kb=function(){this.ob=this.Xa=0};k.hb=function(a){this.bc[this.Xa++]=a};
|
||||
function Ek(a,b){a.hb(b.fb|b.Ha<<2|b.Ya&255,l.Op)}function Fk(a,b){a.hb((b.Ya&65280)>>>8,l.Pp)}function Gk(a,b){a.hb((b.Ya&16711680)>>>16,l.Qp)}k.si=function(a,b,c){void 0===b||0>b?this.sc(a,c):c(-1,!1)};k.ti=function(a,b){return void 0!==b&&0<=b?this.Dc(a,b):-1};k.Dm=function(a,b){return void 0!==b&&0<=b?this.Zj(a,b):-1};k.ui=function(a){a.Ya=72;a.va&&(a.Ra=null,a.Ya=0,this.ka&&(si(this.ka,2,this,"dmaRead",a),mi(this.ka,2)))};
|
||||
k.vi=function(a){a.Ya=72;a.va&&(a.va.ff?a.Ya=576:(a.Ra=null,a.Ya=0,this.ka&&(si(this.ka,2,this,"dmaWrite",a),mi(this.ka,2))))};k.yk=function(a){a.Ya=72;a.va&&(a.Ra=null,a.Ya=0,this.ka&&(a.Ce=0,a.yc=Array(4),a.Lf=!0,a.Rf=0,si(this.ka,2,this,"dmaFormat",a),mi(this.ka,2),a.Lf=!1))};k.sc=function(a,b){var c=-1;if(!a.Ya&&a.va){do{if(a.Ra&&0<=(c=tk(a.Ra,a.Va++)))break;a.Ra=a.va.seek(a.kb,a.Ha,a.Na);if(!a.Ra){a.Ya=1088;break}a.Va=0;this.If(a)}while(1)}b(c,!1)};
|
||||
k.Dc=function(a,b){if(a.Ya||!a.va)return-1;do{if(a.Ra&&a.va.write(a.Ra,a.Va++,b))break;a.Ra=a.va.seek(a.kb,a.Ha,a.Na);if(!a.Ra){a.Ya=8256;b=-1;break}a.Va=0;this.If(a)}while(1);return b};k.If=function(a){a.Na++;a.Na>=a.Dh+1&&(a.Na=1,a.Ha++,a.Ha>=a.Ch&&(a.Ha=0,a.kb++))};k.Zj=function(a,b){if(a.Ya)return-1;a.yc[a.Ce++]=b;if(a.Ce==a.yc.length){a.kb=a.yc[0];a.Ha=a.yc[1];a.Na=a.yc[2];a.Wa=128<<a.yc[3];for(var c=a.Ce=0;c<a.Wa;c++)if(0>this.Dc(a,a.mk))return-1;a.Rf++}a.Rf>=a.$d&&(b=-1);return b};
|
||||
k.Oi=function(a){var b=this.S.J&255;this.X&&E(this.X,this.X.Eg)&&128>b&&(Ec(this.X,19,a),Fc(this.S,a,function(a,b){return function(e){Gc(a.X,19,e,F(a.S)-b)}}(this,F(this.S))));return!0};k.Qa=function(a){this.X&&E(this.X,this.X.Eg)&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.Eg,e)};var zk={1012:uk.prototype.mn,1013:uk.prototype.kn,1015:uk.prototype.ln},Ak={1010:uk.prototype.Ho,1013:uk.prototype.Go,1015:uk.prototype.Fo};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","fdc"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new uk(d);Oa(d,c)}});function W(a){x.call(this,"HDC",a,W);this.dmaRead=this.si;this.dmaWrite=this.ti;this.dmaWriteBuffer=this.Em;this.dmaWriteFormat=this.Fm;this.$h=[];if(a.drives)try{this.$h=eval("("+a.drives+")")}catch(b){w("HDC drive configuration error: "+b.message+" ("+a.drives+")")}this.ag=(this.Ee="at"==a.type)?1:0;this.Pm=this.Ee?2:3}y(x,W);
|
||||
var Hk=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7]}];k=W.prototype;k.xb=function(){return!1};k.pc=function(a,b,c,d){this.na=b;this.S=c;this.X=d;this.Da=a;this.ka=C(a,"ChipSet");ib(b,this,this.Ee?Ik:Jk);mb(b,this,this.Ee?Kk:Lk);Cc(c,19,this,this.Pn);Cc(c,64,this,this.Oi);this.reset();this.Kf()||this.Ta()};
|
||||
k.ac=function(a,b){if(!b)if(!a||!this.restore)this.Ed(),this.Da.Ei&&this.Kf(!0);else if(!this.restore(a))return!1;return!0};k.Wb=function(a){return a&&this.save?this.save():!0};k.gf=function(){return this.Da?this.Da.gf():""};k.ge=function(){return this.Da?this.Da.ge():""};k.reset=function(){this.Ed(null,!0)};k.save=function(){var a=new H(this);a.set(0,this.Vj());return a.data()};k.restore=function(a){return this.Ed(a[0])};
|
||||
k.Ed=function(a,b){var c=0,d=!0;if(this.Ee)null==a&&(a=[0,0,0,0,0,0,0,0,64,0]),this.ne=a[c++],this.dm=a[c++],this.Nh=a[c++],this.Oh=a[c++],this.Mh=a[c++],this.Lh=a[c++],this.rf=a[c++],this.ya=a[c++],this.Sj=a[c++];else{null==a&&(a=[0,0,Array(14),0,0]);this.qf=a[c++];this.ya=a[c++];this.bc=a[c++];this.ob=a[c++];this.Xa=a[c++];this.cm=a[c++];this.bm=a[c++];this.am=a[c++];var e=a[c++];void 0!==e?this.hf=e:void 0===this.hf&&(this.hf=-1)}void 0===this.za&&(this.za=Array(this.$h.length));c=a[c];void 0===
|
||||
c&&(c=[]);for(e=0;e<this.za.length;e++){void 0===this.za[e]&&(this.za[e]={});var f=this.za[e];this.Mi(e,f,this.$h[e],c[e],b)||(d=!1);null!=this.qf&&1>=e&&(this.qf|=(f.type&3)<<(1-e<<1))}return d};
|
||||
k.Vj=function(){var a=0,b=[];this.Ee?(b[a++]=this.ne,b[a++]=this.dm,b[a++]=this.Nh,b[a++]=this.Oh,b[a++]=this.Mh,b[a++]=this.Lh,b[a++]=this.rf,b[a++]=this.ya,b[a++]=this.Sj):(b[a++]=this.qf,b[a++]=this.ya,b[a++]=this.bc,b[a++]=this.ob,b[a++]=this.Xa,b[a++]=this.cm,b[a++]=this.bm,b[a++]=this.am,b[a++]=this.hf);b[a]=this.Xj();return b};
|
||||
k.Mi=function(a,b,c,d,e){var f=0,g=!0;void 0===d&&(d=[0,0,!1,Array(8)]);b.fb=a;b.errorCode=d[f++];b.jm=d[f++];b.ef=d[f++];b.We=d[f++];b.Xe=d[f++];b.Ha=d[f++];b.$b=d[f++];b.Qd=d[f++];b.Na=d[f++];b.$d=d[f++];b.Wa=d[f++];b.Yg=this.Ee?0:1;b.name=c.name;void 0===b.name&&(b.name="Hard Drive");b.path=c.path;b.mode=c.mode||(b.path?"preload":"local");"demandro"!=b.mode&&"demandrw"!=b.mode||this.ge()||(b.mode="local");b.type=c.type;if(void 0===b.type||void 0===Hk[this.ag][b.type])b.type=this.Pm;c=Hk[this.ag][b.type];
|
||||
b.jc=c[2]||17;b.Mb=c[3]||512;if(e&&this.ka&&(e=this.ka,c=b.type,e.pa)){var h=e.pa[18],h=a?h&240|c:h&15|c<<4;e.pa&&(e.pa[18]=h,ai(e))}void 0===b.va&&(b.va=null,this.Ga("Type "+b.type+' "'+b.name+'" is fixed disk '+a,!0));Mk(this,b);b.Va=d[f++];b.Ra=null;b.va&&(a=d[f],void 0!==a&&0>b.va.restore(a)&&(g=!1),g&&void 0!==b.Va&&(b.Ra=b.va.seek(b.Qd,b.Ha,b.Na+b.Yg)));return g};k.Xj=function(){for(var a=0,b=[],c=0;c<this.za.length;c++)b[a++]=this.Wj(this.za[c]);return b};
|
||||
k.Wj=function(a){var b=0,c=[];c[b++]=a.errorCode;c[b++]=a.jm;c[b++]=a.ef;c[b++]=a.We;c[b++]=a.Xe;c[b++]=a.Ha;c[b++]=a.$b;c[b++]=a.Qd;c[b++]=a.Na;c[b++]=a.$d;c[b++]=a.Wa;c[b++]=a.Va;c[b]=a.va?a.va.save():null;return c};k.wk=function(a){var b;a=this.za[a];if(void 0!==a){b={};for(var c in a)b[c]=a[c]}return b};
|
||||
function Mk(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.We[2])?e=b.We[0]<<8|b.We[1]:c=b.type);null==c||d||(d=Hk[a.ag][c][1],e=Hk[a.ag][c][0]);d&&((c=Hk[a.ag][b.type])&&e!=c[0]&&d!=c[1]&&a.Ga("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.gc=e,b.$b=d,null==b.va&&(b.va=new kk(a,b,b.mode)))}}
|
||||
k.hm=function(a,b,c){if(a.va){var d=a.va.info(),e=d[0];if(e){var f=d[2],g=d[1]*f;if(b+c<=e*g)return a.Qd=Math.floor(b/g),b%=g,a.Ha=Math.floor(b/f),a.Na=b%f,a.Wa=c*d[3],a.errorCode=0,!0}}return!1};
|
||||
k.Kf=function(a){a||(this.ze=0);for(var b=0;b<this.za.length;b++){var c=this.za[b];if(c.name&&c.path){var d;d=c.name;var c=c.path,e=this.za[b];e.Kc?(this.Ga("Drive "+b+" busy"),d=!0):(e.Kc=!0,e.Fe=!0,this.ze++,this.Qa("loading "+d),(e.va||new kk(this,e,e.mode)).load(d,c,this.Wn),d=!1);!d&&a&&this.Ta(!1)}else a&&void 0!==c.type&&(c.va=null,Mk(this,c,c.type))}return!!this.ze};
|
||||
k.Wn=function(a,b,c){a.Kc=!1;(a.va=b)&&this.Ga('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.fb),a.Fe);a.Fe&&(a.Fe=!1,--this.ze||this.Ta())};k.Mn=function(a,b){var c=0;this.ob<this.Xa&&(c=this.bc[this.ob]);this.ka&&Ai(this.ka,5);this.ya&=-33;this.ba(a,null,b,"DATA["+this.ob+"]",c);++this.ob>=this.Xa&&(this.ob=this.Xa=0,this.ya&=-15);return c};
|
||||
k.cp=function(a,b,c){this.ba(a,b,c,"DATA["+this.Xa+"]");this.Xa<this.bc.length&&(this.bc[this.Xa++]=b);a=12!=this.bc[0]?6:this.bc.length;6==this.Xa&&(this.ya&=-2);this.Xa>=a&&(this.ya|=2,this.ya&=-2,Nk(this))};k.Nn=function(a,b){var c=this.ya;this.ba(a,null,b,"STATUS",c);this.ob<this.Xa&&(this.ya|=1);return c};k.fp=function(a,b,c){this.ba(a,b,c,"RESET");this.cm=b;this.ka&&Ai(this.ka,5);this.Ed()};k.Ln=function(a,b){this.ba(a,null,b,"CONFIG",this.qf);return this.qf};
|
||||
k.ep=function(a,b,c){this.ba(a,b,c,"PULSE");this.bm=b;this.ya=13};k.dp=function(a,b,c){this.ba(a,b,c,"PATTERN");this.am=b};k.Nj=function(a,b,c){this.ba(a,b,c,"NOISE")};k.Xm=function(a,b){var c=-1,d=!1;if(this.Pa&&(d=0<this.Pa.Va,c=this.sc(this.Pa),this.Pa.Va==this.Pa.Mb))if(this.Pa.Wa-=this.Pa.Mb,this.Pa.Wa>=this.Pa.Mb){var e=this;this.sc(this.Pa,function(a){0<=a?e.ka&&zi(e.ka,14):(e.ya=1,e.ne=16)},!1)}else this.ya=80;d||this.ba(a,null,b,"DATA",c);return c};
|
||||
k.uo=function(a,b,c){this.Pa&&0!=this.Pa.Va||this.ba(a,b,c,"DATA");this.Pa&&this.Pa.Wa>=this.Pa.Mb&&(0>this.Dc(this.Pa,b)?(this.ya=1,this.ne=16):this.Pa.Va==this.Pa.Mb&&(this.Pa.Wa-=this.Pa.Mb,this.ka&&zi(this.ka,14),this.Pa.Wa>=this.Pa.Mb||(this.ya=80)))};k.Zm=function(a,b){var c=this.ne;this.ba(a,null,b,"ERROR",c);return c};k.yo=function(a,b,c){this.ba(a,b,c,"WPREC");this.dm=b};k.$m=function(a,b){var c=this.Nh;this.ba(a,null,b,"SECCNT",c);return c};
|
||||
k.wo=function(a,b,c){this.ba(a,b,c,"SECCNT");this.Nh=b};k.an=function(a,b){var c=this.Oh;this.ba(a,null,b,"SECNUM",c);return c};k.xo=function(a,b,c){this.ba(a,b,c,"SECNUM");this.Oh=b};k.Wm=function(a,b){var c=this.Mh;this.ba(a,null,b,"CYLLO",c);return c};k.to=function(a,b,c){this.ba(a,b,c,"CYLLO");this.Mh=b};k.Vm=function(a,b){var c=this.Lh;this.ba(a,null,b,"CYLHI",c);return c};k.so=function(a,b,c){this.ba(a,b,c,"CYLHI");this.Lh=b};k.Ym=function(a,b){var c=this.rf;this.ba(a,null,b,"DRVHD",c);return c};
|
||||
k.vo=function(a,b,c){this.ba(a,b,c,"DRVHD");this.rf=b;this.ya=this.za[this.rf&16?1:0]?this.ya|64:this.ya&-65};k.bn=function(a,b){var c=this.ya;this.ba(a,null,b,"STATUS",c);return c};k.ro=function(a,b,c){this.ba(a,b,c,"COMMAND");this.Sj=b;this.ka&&Ai(this.ka,14);Ok(this)};
|
||||
function Ok(a){var b=!1,c=a.Sj,d=a.rf&16?1:0,e=a.rf&15,f=a.Mh|(a.Lh&3)<<8,g=a.Oh,h=a.Nh;a.Pa=null;a.ne=0;a.ya=80;(d=a.za[d])?(d.Qd=f,d.Ha=e,d.Na=g,d.Wa=h*d.Mb,c=144<=c?c:c&240,d.Ra=null,d.errorCode=0,a.Pa=d):c=-1;switch(c&240){case 32:a.sc(d,function(b){0<=b&&a.ka?(zi(a.ka,14),a.ya=136):(a.ya=1,a.ne=16)},!1);break;case 48:a.ka?(zi(a.ka,14),a.ya=136):(a.ya=1,a.ne=4);break;case 16:b=!0;break;case 64:b=!0;break;case 144:a.ne=1;b=!0;break;case 145:d.$b=e+1,d.jc=h,b=!0}b&&a.ka&&zi(a.ka,14)}
|
||||
function Nk(a){a.ob=0;var b=a.Oa(),c=a.Oa(),d=c&32,e=d>>5,f=c&31,g=a.Oa(),h=a.Oa(),m=g<<2&768|h,n=g&63,q=a.Oa(),t=a.Oa(),s=a.za[e];s&&(s.Qd=m,s.Ha=f,s.Na=n,s.Wa=q*s.Mb);switch(b){case 3:a.Kb(s?s.errorCode:4);a.hb(c);a.hb(g);a.hb(h);a.hb(0|d);b=-1;break;case 12:for(c=0;0<=(b=a.Oa());)s&&c<s.We.length&&(s.We[c++]=b);s&&Mk(a,s);b=0;s||a.hf!=e||(a.hf=-1,b=2);a.Kb(b|d);b=-1;break;case 224:case 228:a.Kb(0|d),b=-1}if(0<=b)switch(void 0===s?b=-1:(s.errorCode=0,s.jm=0),b){case 0:a.Kb(0|d);break;case 1:s.Wp=
|
||||
t;a.Kb(0|d);break;case 5:a.Kb(0|d);break;case 8:a.ui(s,function(b){a.Kb(b|d)});break;case 10:a.vi(s,function(b){a.Kb(b|d)});break;case 15:Pk(a,s,function(b){a.Kb(b|d)});break;default:a.Kb(2|d)}}k.Oa=function(){var a=-1;this.ob<this.Xa&&(a=this.bc[this.ob++]);return a};k.Kb=function(a){this.ob=this.Xa=0;void 0!==a&&this.hb(a);this.ka&&zi(this.ka,5);this.ya|=32};k.hb=function(a){this.bc[this.Xa++]=a};k.si=function(a,b,c){void 0===b||0>b?this.sc(a,c):c(-1,!1)};
|
||||
k.ti=function(a,b){return void 0!==b&&0<=b?this.Dc(a,b):-1};k.Em=function(a,b){var c;void 0!==b&&0<=b?(c=b,a.Va<a.Xe.length?a.Xe[a.Va++]=c:(a.errorCode=20,c=-1)):c=-1;return c};k.Fm=function(a,b){return void 0!==b&&0<=b?this.Zj(a,b):-1};k.ui=function(a,b){a.errorCode=4;if(a.va&&(a.Ra=null,this.ka)){a.errorCode=0;si(this.ka,3,this,"dmaRead",a);mi(this.ka,3,function(c){c||0!=a.errorCode||(a.errorCode=4);b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
k.vi=function(a,b){a.errorCode=4;if(a.va&&(a.Ra=null,this.ka)){a.errorCode=0;si(this.ka,3,this,"dmaWrite",a);mi(this.ka,3,function(c){c||(0==a.errorCode&&(a.errorCode=4),20==a.errorCode&&(a.errorCode=0));b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};function Pk(a,b,c){b.errorCode=4;b.Xe&&b.Xe.length==b.Wa||(b.Xe=Array(b.Wa));b.Va=0;a.ka?(b.errorCode=0,si(a.ka,3,a,"dmaWriteBuffer",b),mi(a.ka,3,function(a){a||0!=b.errorCode||(b.errorCode=4);c(b.errorCode?2:0)})):c(b.errorCode?2:0)}
|
||||
k.yk=function(a,b){a.errorCode=4;if(a.va&&(a.Ra=null,this.ka)){a.Ce=0;a.yc=Array(4);a.Lf=!0;a.Rf=0;a.errorCode=0;si(this.ka,3,this,"dmaWriteFormat",a);mi(this.ka,3,function(c){c||0!=a.errorCode||(a.errorCode=4);a.Lf=!1;b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
k.sc=function(a,b,c){var d=-1;if(a.errorCode)return b&&b(d,!1),d;var e=!1!==c?1:0;if(a.Ra&&(d=tk(a.Ra,a.Va),a.Va+=e,0<=d))return b&&b(d,!1),d;if(b){var f=this;a.va.seek(a.Qd,a.Ha,a.Na+a.Yg,!1,function(c,d){var m=-1;(a.Ra=c)?(a.Va=0,f.If(a),m=tk(a.Ra,a.Va),a.Va+=e):a.errorCode=20;b(m,d)})}return d};
|
||||
k.Dc=function(a,b){if(a.errorCode)return-1;do{if(a.Ra&&a.va.write(a.Ra,a.Va++,b))break;a.va.seek(a.Qd,a.Ha,a.Na+a.Yg,!0,function(b){a.Ra=b});if(!a.Ra){a.errorCode=20;b=-1;break}a.Va=0;this.If(a)}while(1);return b};k.If=function(a){a.Na++;var b=1-a.Yg;a.Na>=a.rc+b&&(a.Na=b,a.Ha++,a.Ha>=a.fc&&(a.Ha=0,a.Qd++))};
|
||||
k.Wj=function(a,b){if(a.errorCode)return-1;a.yc[a.Ce++]=b;if(a.Ce==a.yc.length){a.Qd=a.yc[0];a.Ha=a.yc[1];a.Na=a.yc[2];a.Wa=128<<a.yc[3];for(var c=a.Ce=0;c<a.Wa;c++)if(0>this.Dc(a,a.jk))return-1;a.Rf++}a.Rf>=a.$d&&(b=-1);return b};k.Mn=function(a){var b=this.S.J&255;!(this.S.G>>8)&&128<b&&(this.hf=b-128);this.X&&E(this.X,this.X.Vh)&&128<=b&&(Ec(this.X,19,a),Fc(this.S,a,function(a,b){return function(e){Gc(a.X,19,e,F(a.S)-b)}}(this,F(this.S))));return!0};
|
||||
k.Mi=function(){var a;(a=this.S.G>>8)||(a=!this.ka)||(a=!(this.ka.tb[0].vd&64));return a?!0:!1};k.Qa=function(a){this.X&&E(this.X,this.X.Vh)&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.Vh,e)};
|
||||
var Jk={800:W.prototype.Jn,801:W.prototype.Kn,802:W.prototype.In},Ik={496:W.prototype.Um,497:W.prototype.Wm,498:W.prototype.Xm,499:W.prototype.Ym,500:W.prototype.Tm,501:W.prototype.Sm,502:W.prototype.Vm,503:W.prototype.Zm},Lk={800:W.prototype.$o,801:W.prototype.cp,802:W.prototype.bp,803:W.prototype.ap,807:W.prototype.Kj,811:W.prototype.Kj,815:W.prototype.Kj},Kk={496:W.prototype.ro,497:W.prototype.vo,498:W.prototype.to,499:W.prototype.uo,500:W.prototype.qo,501:W.prototype.po,502:W.prototype.so,503:W.prototype.oo};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","hdc"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new W(d);Oa(d,c)}});function Qk(a){x.call(this,"Debugger",a,Qk);this.$g=this.$c=-1;this.Ec=[0,0];this.ek=[0,0];this.Hh=null;this.bf=!1;this.qe=[0,0];this.xc=[];Rk(this);Sk(this);Ph(this,this,a.messages,!0);this.jb={AL:0,CL:0,DL:0,BL:0,AH:0,CH:0,DH:0,BH:0,AX:0,CX:0,DX:0,BX:0,SP:0,BP:0,SI:0,DI:0,ES:0,CS:0,SS:0,DS:0,IP:0};this.Rj=a.commands}y(x,Qk);
|
||||
k.Dc=function(a,b){if(a.errorCode)return-1;do{if(a.Ra&&a.va.write(a.Ra,a.Va++,b))break;a.va.seek(a.Qd,a.Ha,a.Na+a.Yg,!0,function(b){a.Ra=b});if(!a.Ra){a.errorCode=20;b=-1;break}a.Va=0;this.If(a)}while(1);return b};k.If=function(a){a.Na++;var b=1-a.Yg;a.Na>=a.jc+b&&(a.Na=b,a.Ha++,a.Ha>=a.$b&&(a.Ha=0,a.Qd++))};
|
||||
k.Zj=function(a,b){if(a.errorCode)return-1;a.yc[a.Ce++]=b;if(a.Ce==a.yc.length){a.Qd=a.yc[0];a.Ha=a.yc[1];a.Na=a.yc[2];a.Wa=128<<a.yc[3];for(var c=a.Ce=0;c<a.Wa;c++)if(0>this.Dc(a,a.mk))return-1;a.Rf++}a.Rf>=a.$d&&(b=-1);return b};k.Pn=function(a){var b=this.S.J&255;!(this.S.G>>8)&&128<b&&(this.hf=b-128);this.X&&E(this.X,this.X.Xh)&&128<=b&&(Ec(this.X,19,a),Fc(this.S,a,function(a,b){return function(e){Gc(a.X,19,e,F(a.S)-b)}}(this,F(this.S))));return!0};
|
||||
k.Oi=function(){var a;(a=this.S.G>>8)||(a=!this.ka)||(a=!(this.ka.tb[0].vd&64));return a?!0:!1};k.Qa=function(a){this.X&&E(this.X,this.X.Xh)&&this.X.message(a)};k.ba=function(a,b,c,d,e){this.X&&this.X.ba(this,a,b,c,d,this.X.Xh,e)};
|
||||
var Jk={800:W.prototype.Mn,801:W.prototype.Nn,802:W.prototype.Ln},Ik={496:W.prototype.Xm,497:W.prototype.Zm,498:W.prototype.$m,499:W.prototype.an,500:W.prototype.Wm,501:W.prototype.Vm,502:W.prototype.Ym,503:W.prototype.bn},Lk={800:W.prototype.cp,801:W.prototype.fp,802:W.prototype.ep,803:W.prototype.dp,807:W.prototype.Nj,811:W.prototype.Nj,815:W.prototype.Nj},Kk={496:W.prototype.uo,497:W.prototype.yo,498:W.prototype.wo,499:W.prototype.xo,500:W.prototype.to,501:W.prototype.so,502:W.prototype.vo,503:W.prototype.ro};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","hdc"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new W(d);Oa(d,c)}});function Qk(a){x.call(this,"Debugger",a,Qk);this.$g=this.$c=-1;this.Ec=[0,0];this.hk=[0,0];this.Jh=null;this.bf=!1;this.qe=[0,0];this.xc=[];Rk(this);Sk(this);Ph(this,this,a.messages,!0);this.ib={AL:0,CL:0,DL:0,BL:0,AH:0,CH:0,DH:0,BH:0,AX:0,CX:0,DX:0,BX:0,SP:0,BP:0,SI:0,DI:0,ES:0,CS:0,SS:0,DS:0,IP:0};this.Uj=a.commands}y(x,Qk);
|
||||
var Tk={"?":"help","a [#]":"assemble","b [#]":"breakpoint",c:"clear window","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]","h [#]":"halt/history","i [#]":"input port #",l:"load sector(s)",m:"messages","o [#]":"output port #",p:"step over",r:"dump/edit registers","t [#]":"step instruction(s)","u [#]":"unassemble",x:"execution options"},Uk="DB AAA AAD AAM AAS ADC ADD AND ARPL AS: BOUND BSF BSR BT BTC BTR BTS CALL CBW CLC CLD CLI CLTS CMC CMP CMPSB CMPSW CS: CWD DAA DAS DEC DIV DS: ENTER ES: ESC FADD FBLD FBSTP FCOM FCOMP FDIV FDIVR FIADD FICOM FICOMP FIDIV FIDIVR FILD FIMUL FIST FISTP FISUB FISUBR FLD FLDCW FLDENV FMUL FNSAVE FNSTCW FNSTENV FNSTSW FRSTOR FS: FST FSTP FSUB FSUBR GBP GS: HLT IDIV IMUL IN INC INS INT INT3 INTO IRET JBE JC JCXZ JG JGE JL JLE JMP JNBE JNC JNO JNP JNS JNZ JO JP JS JZ LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT LLDT LMSW LOCK LODSB LODSW LOOP LOOPNZ LOOPZ LSL LSS LTR MOV MOVSB MOVSW MOVSX MOVZX MUL NEG NOP NOT OR OS: OUT OUTS POP POPA POPF PUSH PUSHA PUSHF RCL RCR REPNZ REPZ RET RETF ROL ROR SAHF SAR SBB SCASB SCASW SETBE SETC SETG SETGE SETL SETLE SETNBE SETNC SETNO SETNP SETNS SETNZ SETO SETP SETS SETZ SGDT SHL SHLD SHR SHRD SIDT SLDT SMSW SS: STC STD STI STOSB STOSW STR SUB TEST VERR VERW WAIT XCHG XLAT XOR".split(" "),
|
||||
X="AL CL DL BL AH CH DH BH AX CX DX BX SP BP SI DI ES CS SS DS IP".split(" "),Vk="BX+SI BX+DI BP+SI BP+DI SI DI BP BX".split(" "),Y={Fg:{La:1,Ma:"mem"},bk:{La:2,Ma:"port"},Fb:{La:4,Ma:"dma"},Te:{La:8,Ma:"pic"},Ue:{La:16,Ma:"timer"},Cf:{La:32,Ma:"cmos"},tm:{La:64,Ma:"rtc"},Se:{La:128,Ma:"8042"},uc:{La:256,Ma:"chipset"},ak:{La:512,Ma:"keyboard"},Hg:{La:1024,Ma:"video"},Eg:{La:2048,Ma:"fdc"},Vh:{La:4096,Ma:"hdc"},om:{La:8192,Ma:"disk"},ck:{La:16384,Ma:"serial"},Gg:{La:32768,Ma:"speaker"},um:{La:65536,
|
||||
Ma:"state"},sm:{La:131072,Ma:"mouse"},mm:{La:262144,Ma:"computer"},nm:{La:524288,Ma:"cpu"},pm:{La:1048576,Ma:"dos"},$j:{La:2097152,Ma:"int"},rm:{La:16777216,Ma:"log"},qm:{La:268435456,Ma:"halt"}},Z=[0,0],Wk=[204,12291],Xk=[[6,12417,4257],[6,12420,4260],[6,12449,4225],[6,12452,4228],[6,12385,4097],[6,14435,4100],[136,4211],[133,8307],[129,12417,4257],[129,12420,4260],[129,12449,4225],[129,12452,4228],[129,12385,4097],[129,14435,4100],[136,4467],[133,8563],[5,12417,4257],[5,12420,4260],[5,12449,4225],
|
||||
X="AL CL DL BL AH CH DH BH AX CX DX BX SP BP SI DI ES CS SS DS IP".split(" "),Vk="BX+SI BX+DI BP+SI BP+DI SI DI BP BX".split(" "),Y={Fg:{La:1,Ma:"mem"},ek:{La:2,Ma:"port"},Fb:{La:4,Ma:"dma"},Te:{La:8,Ma:"pic"},Ue:{La:16,Ma:"timer"},Cf:{La:32,Ma:"cmos"},wm:{La:64,Ma:"rtc"},Se:{La:128,Ma:"8042"},uc:{La:256,Ma:"chipset"},dk:{La:512,Ma:"keyboard"},Hg:{La:1024,Ma:"video"},Eg:{La:2048,Ma:"fdc"},Xh:{La:4096,Ma:"hdc"},rm:{La:8192,Ma:"disk"},fk:{La:16384,Ma:"serial"},Gg:{La:32768,Ma:"speaker"},xm:{La:65536,
|
||||
Ma:"state"},vm:{La:131072,Ma:"mouse"},pm:{La:262144,Ma:"computer"},qm:{La:524288,Ma:"cpu"},sm:{La:1048576,Ma:"dos"},ck:{La:2097152,Ma:"int"},um:{La:16777216,Ma:"log"},tm:{La:268435456,Ma:"halt"}},Z=[0,0],Wk=[204,12291],Xk=[[6,12417,4257],[6,12420,4260],[6,12449,4225],[6,12452,4228],[6,12385,4097],[6,14435,4100],[136,4211],[133,8307],[129,12417,4257],[129,12420,4260],[129,12449,4225],[129,12452,4228],[129,12385,4097],[129,14435,4100],[136,4467],[133,8563],[5,12417,4257],[5,12420,4260],[5,12449,4225],
|
||||
[5,12452,4228],[5,12385,4097],[5,14435,4100],[136,4723],[133,8819],[149,12417,4257],[149,12420,4260],[149,12449,4225],[149,12452,4228],[149,12385,4097],[149,14435,4100],[136,4979],[133,9075],[7,12417,4257],[7,12420,4260],[7,12449,4225],[7,12452,4228],[7,12385,4097],[7,14435,4100],[35,15],[29],[183,12417,4257],[183,12420,4260],[183,12449,4225],[183,12452,4228],[183,12385,4097],[183,14435,4100],[27,15],[30],[190,12417,4257],[190,12420,4260],[190,12449,4225],[190,12452,4228],[190,12385,4097],[190,14435,
|
||||
4100],[176,15],[1],[24,4225,4257],[24,4228,4260],[24,4257,4225],[24,4260,4228],[24,4193,4097],[24,6243,4100],[33,15],[4],[75,14435],[75,14691],[75,14947],[75,15203],[75,15459],[75,15715],[75,15971],[75,16227],[31,14435],[31,14691],[31,14947],[31,15203],[31,15459],[31,15715],[31,15971],[31,16227],[136,6243],[136,6499],[136,6755],[136,7011],[136,7267],[136,7523],[136,7779],[136,8035],[133,10339],[133,10595],[133,10851],[133,11107],[133,11363],[133,11619],[133,11875],[133,12131],[137,32768],[134,32768],
|
||||
[10,37028,4247],[8,8323,4259],[64,49152],[70,49152],[130,49152],[9,49152],[136,36868],[73,45219,4234],[136,36866],[73,45219,4233],[76,41041,6755],[76,41044,6755],[132,39523,4161],[132,39523,4164],[95,4145],[91,4145],[82,4145],[90,4145],[98,4145],[94,4145],[81,4145],[89,4145],[97,4145],[93,4145],[96,4145],[92,4145],[86,4145],[85,4145],[87,4145],[84,4145],[191,12417,4097],[192,12420,4100],[191,12417,4097],[193,12420,4097],[184,4225,4257],[184,4228,4260],[188,12449,12417],[188,12452,12420],[120,8321,
|
||||
|
|
@ -659,80 +660,80 @@ Ma:"state"},sm:{La:131072,Ma:"mouse"},mm:{La:262144,Ma:"computer"},nm:{La:524288
|
|||
62:"close file BX",63:"read CX bytes from file BX into buffer DS:DX",64:"write CX bytes to file BX from buffer DS:DX",65:"delete file DS:DX",66:"set position CX:DX of file BX relative to AL",67:"get(0)/set(1) attributes CX of file DS:DX (AL)",68:"get device information (IOCTL)",69:"duplicate file handle BX",70:"force file handle CX to duplicate file handle BX",71:"get current directory (ds:si) for drive DL",72:"allocate memory segment with BX paragraphs",73:"free memory segment ES",74:"resize memory segment ES to BX paragraphs",
|
||||
75:"load program DS:DX using parameter block ES:BX",76:"terminate with return code AL",77:"get return code (al)",78:"find first matching file DS:DX with attributes CX",79:"find next matching file",80:"set current psp BX",81:"get current psp (bx)",82:"get system variables (es:bx)",83:"translate bpb DS:SI to dpb (es:bp)",84:"get verify flag (al)",85:"create child psp at segment DX",86:"rename file DS:DX to name ES:DI",87:"get(0)/set(1) file date DX and time CX (AL)",88:"get(0)/set(1) memory allocation strategy (AL)",
|
||||
89:"get extended error information",90:"create temporary file DS:DX with attributes CX",91:"create file DS:DX with attributes CX",92:"lock(0)/unlock(1) file BX region CX:DX length SI:DI (AL)"}};k=Qk.prototype;
|
||||
k.nc=function(a,b,c){this.na=b;this.S=c;this.Da=a;this.Im=C(a,"FDC");this.Ek=C(a,"HDC");this.Gf=Xk;80186<=this.S.Fa&&(this.Gf=Xk.slice(),this.Gf[15]=Z,80286<=this.S.Fa&&(this.Gf[15]=Wk));Cc(this.S,33,this,this.Pn);this.Ta();if(this.Rj){a=al(this,this.Rj);delete this.Rj;for(var d in a)bl(this,a[d])}};
|
||||
k.pc=function(a,b,c){this.na=b;this.S=c;this.Da=a;this.Lm=C(a,"FDC");this.Hk=C(a,"HDC");this.Gf=Xk;80186<=this.S.Fa&&(this.Gf=Xk.slice(),this.Gf[15]=Z,80286<=this.S.Fa&&(this.Gf[15]=Wk));Cc(this.S,33,this,this.Sn);this.Ta();if(this.Uj){a=al(this,this.Uj);delete this.Uj;for(var d in a)bl(this,a[d])}};
|
||||
k.xb=function(a,b,c,d){var e=this;switch(c){case "debugInput":return this.Tf=this.sa[c]=d,d.onkeypress=function(a){if(13==a.keyCode){var b=d.value;d.value="";var c=al(e,b,!0);for(b in c)bl(e,c[b]);a.preventDefault&&a.preventDefault()}},!0;case "debugEnter":return this.sa[c]=d,xa(d,function(){if(e.Tf){var a=e.Tf.value;e.Tf.value="";var b=al(e,a,!0);for(a in b)bl(e,b[a]);return!0}return!1}),!0;case "step":return this.sa[c]=d,xa(d,function(a){var b=!1;Qa(e,!0)||(Pa(e,!0),b=e.wf(a?1:0),Pa(e,!1));return b}),
|
||||
!0}return!1};k.Md=function(){this.Tf&&this.Tf.focus()};function Ph(a,b,c,d){d&&(a.bi=[]);d=0;c=al(a,c);for(var e in Y)b[e]=Y[e].La,0<=c.indexOf(Y[e].Ma)&&(d|=Y[e].La,a.ca(Y[e].Ma+" messages enabled"));void 0===a.dc&&(a.dc=0);a.dc|=d}function Qh(a,b,c){for(var d in Y)if(b==Y[d].La){a.bi[d]=c;break}}function E(a,b){return(a.dc&b)===b}
|
||||
function Ec(a,b,c){if(32>b&&16!=b&&21!=b&&22!=b&&26!=b&&28!=b){var d=a.S.G>>8,e=$k[b];if(e=e&&e[d]||""){var f=a.S;a.jb[X[0]]=r(f.G&255);a.jb[X[1]]=r(f.I&255);a.jb[X[2]]=r(f.J&255);a.jb[X[3]]=r(f.B&255);a.jb[X[4]]=r(f.G>>8);a.jb[X[5]]=r(f.I>>8);a.jb[X[6]]=r(f.J>>8);a.jb[X[7]]=r(f.B>>8);a.jb[X[8]]=u(f.G);a.jb[X[9]]=u(f.I);a.jb[X[10]]=u(f.J);a.jb[X[11]]=u(f.B);a.jb[X[12]]=u(f.Y);a.jb[X[13]]=u(f.H);a.jb[X[14]]=u(f.F);a.jb[X[15]]=u(f.D);a.jb[X[16]]=u(f.Za.oa);a.jb[X[17]]=u(f.ua.oa);a.jb[X[18]]=u(f.wb.oa);
|
||||
a.jb[X[19]]=u(f.Eb.oa);a.jb[X[20]]=u(f.qa);e=" "+ia(a.jb,e)}a.message("INT 0x"+r(b)+": AH="+r(d)+" at "+da(c-a.S.ua.Ua,a.S.ua.oa)+e)}}function Gc(a,b,c,d,e){32>b&&16!=b&&21!=b&&22!=b&&26!=b&&28!=b&&a.message("INT 0x"+r(b)+"("+c+"): C="+(Uc(a.S)?1:0)+(e||"")+" (cycles="+d+")")}
|
||||
k.ba=function(a,b,c,d,e,f,g){f||(f=0);f|=Y.bk.La;if(null==d||(this.dc&f)==f)f=null,null!=d&&(f=this.S.ua.oa,d-=this.S.ua.Ua),this.message(a.sh+"."+(null!=c?"outPort":"inPort")+"(0x"+u(b)+","+(e?e:"unknown")+(null!=c?",0x"+r(c):"")+")"+(null!=g?": 0x"+r(g):"")+(null!=d?" at "+da(d,f):""))};k.message=function(a){this.ca(a);this.S&&(this.dc&Y.qm.La&&this.S.Ab(),a=this.S,a.of=0,a.Oc-=a.A,a.A=0,a.eh())};k.Pn=function(a){E(this,this.pm)&&Ec(this,33,a);return!0};k.Ln=function(){this.ca("Type ? for list of debugger commands")};
|
||||
!0}return!1};k.Md=function(){this.Tf&&this.Tf.focus()};function Ph(a,b,c,d){d&&(a.di=[]);d=0;c=al(a,c);for(var e in Y)b[e]=Y[e].La,0<=c.indexOf(Y[e].Ma)&&(d|=Y[e].La,a.ca(Y[e].Ma+" messages enabled"));void 0===a.ec&&(a.ec=0);a.ec|=d}function Qh(a,b,c){for(var d in Y)if(b==Y[d].La){a.di[d]=c;break}}function E(a,b){return(a.ec&b)===b}
|
||||
function Ec(a,b,c){if(32>b&&16!=b&&21!=b&&22!=b&&26!=b&&28!=b){var d=a.S.G>>8,e=$k[b];if(e=e&&e[d]||""){var f=a.S;a.ib[X[0]]=r(f.G&255);a.ib[X[1]]=r(f.I&255);a.ib[X[2]]=r(f.J&255);a.ib[X[3]]=r(f.B&255);a.ib[X[4]]=r(f.G>>8);a.ib[X[5]]=r(f.I>>8);a.ib[X[6]]=r(f.J>>8);a.ib[X[7]]=r(f.B>>8);a.ib[X[8]]=u(f.G);a.ib[X[9]]=u(f.I);a.ib[X[10]]=u(f.J);a.ib[X[11]]=u(f.B);a.ib[X[12]]=u(f.Y);a.ib[X[13]]=u(f.H);a.ib[X[14]]=u(f.F);a.ib[X[15]]=u(f.D);a.ib[X[16]]=u(f.Za.oa);a.ib[X[17]]=u(f.ua.oa);a.ib[X[18]]=u(f.wb.oa);
|
||||
a.ib[X[19]]=u(f.Eb.oa);a.ib[X[20]]=u(f.qa);e=" "+ia(a.ib,e)}a.message("INT 0x"+r(b)+": AH="+r(d)+" at "+da(c-a.S.ua.Ua,a.S.ua.oa)+e)}}function Gc(a,b,c,d,e){32>b&&16!=b&&21!=b&&22!=b&&26!=b&&28!=b&&a.message("INT 0x"+r(b)+"("+c+"): C="+(Uc(a.S)?1:0)+(e||"")+" (cycles="+d+")")}
|
||||
k.ba=function(a,b,c,d,e,f,g){f||(f=0);f|=Y.ek.La;if(null==d||(this.ec&f)==f)f=null,null!=d&&(f=this.S.ua.oa,d-=this.S.ua.Ua),this.message(a.sh+"."+(null!=c?"outPort":"inPort")+"(0x"+u(b)+","+(e?e:"unknown")+(null!=c?",0x"+r(c):"")+")"+(null!=g?": 0x"+r(g):"")+(null!=d?" at "+da(d,f):""))};k.message=function(a){this.ca(a);this.S&&(this.ec&Y.tm.La&&this.S.Ab(),a=this.S,a.of=0,a.Oc-=a.A,a.A=0,a.eh())};k.Sn=function(a){E(this,this.sm)&&Ec(this,33,a);return!0};k.On=function(){this.ca("Type ? for list of debugger commands")};
|
||||
function Sk(a){var b;if(jd(a)){if(!a.Ud||!a.Ud.length){a.Ud=Array(1E4);for(b=0;b<a.Ud.length;b++)a.Ud[b]=[0,null,0];a.jf=0}if(!a.Rc||!a.Rc.length)for(a.Rc=Array(256),b=0;b<a.Rc.length;b++)a.Rc[b]=[b,0]}else a.jf=0,a.Ud=[],a.Rc=[]}k.Ne=function(a){if(!cl(this))return!1;this.S.Ne(a);return!0};
|
||||
k.wf=function(a,b,c){if(!cl(this))return!1;this.$c=0;do{a||jd(this)&&nd(this,this.S.Ba,!0);try{var d=this.S.wf(a);0<d&&(this.$c+=d,Ib(this.S,d,!0),Fb(this.S,d),this.$g++)}catch(e){this.$c=0,Sa(this.S,e.message||e)}}while(this.S.$&240);!1!==c&&Eb(this.S);Db(this,b||!1,!1);return 0<this.$c};k.Ab=function(){this.S.Ab()};function Db(a,b,c){void 0===b&&(b=!0);void 0===c&&(c=!0);a.Ec=[a.S.qa,a.S.ua.oa,void 0];b&&1!=a.lc?dl(a,null,c):el(a)}
|
||||
function cl(a){a.S&&Ra(a.S)&&a.S.Nb&&!Qa(a.S)?(a=a.S,a.jd?(a.ca(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}k.$b=function(a,b){return!b&&(this.reset(!0),this.ca(a?"resuming":"powering up"),a&&this.restore&&!this.restore(a))?!1:!0};k.Wb=function(a,b){b&&this.ca(a?"suspending":"shutting down");return a&&this.save?this.save():!0};k.reset=function(a){Sk(this);this.$c=this.$g=0;this.Ec=[this.S.qa,this.S.ua.oa,void 0];void 0===this.Ob||a||this.ca("reset");this.Ob=!1;fl(this);a||Db(this)};
|
||||
k.save=function(){var a=new H(this);a.set(0,this.Ec);a.set(1,this.qe);a.set(2,[this.Hh,this.bf,this.dc]);return a.data()};k.restore=function(a){var b=0;void 0!==a[2]&&(this.Ec=a[b++],this.qe=a[b++],this.Hh=a[b][0],this.bf=a[b][1],this.dc||(this.dc=a[b][2]));return!0};k.start=function(a,b){this.lc||this.ca("running");this.Ob=!0;this.Xn=a;this.ao=b};
|
||||
k.stop=function(a,b){if(this.Ob){this.Ob=!1;this.$c=b-this.ao;if(!this.lc){var c="stopped";if(this.$c){var d=a-this.Xn,e=0<d?Math.round(1E3*this.$c/d):0,c=c+" (";jd(this)&&(c+=this.$g+" ops, ");c+=this.$c+" cycles, "+d+" ms, "+e+" hz)"}this.ca(c)}Db(this,!0,2!=this.lc);this.Md();fl(this,this.S.Ba)}};function jd(a){return 1<a.vc.length||E(a,a.$j)}
|
||||
k.wf=function(a,b,c){if(!cl(this))return!1;this.$c=0;do{a||jd(this)&&nd(this,this.S.Ba,!0);try{var d=this.S.wf(a);0<d&&(this.$c+=d,Ib(this.S,d,!0),Fb(this.S,d),this.$g++)}catch(e){this.$c=0,Sa(this.S,e.message||e)}}while(this.S.$&240);!1!==c&&Eb(this.S);Db(this,b||!1,!1);return 0<this.$c};k.Ab=function(){this.S.Ab()};function Db(a,b,c){void 0===b&&(b=!0);void 0===c&&(c=!0);a.Ec=[a.S.qa,a.S.ua.oa,void 0];b&&1!=a.nc?dl(a,null,c):el(a)}
|
||||
function cl(a){a.S&&Ra(a.S)&&a.S.Nb&&!Qa(a.S)?(a=a.S,a.jd?(a.ca(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}k.ac=function(a,b){return!b&&(this.reset(!0),this.ca(a?"resuming":"powering up"),a&&this.restore&&!this.restore(a))?!1:!0};k.Wb=function(a,b){b&&this.ca(a?"suspending":"shutting down");return a&&this.save?this.save():!0};k.reset=function(a){Sk(this);this.$c=this.$g=0;this.Ec=[this.S.qa,this.S.ua.oa,void 0];void 0===this.Ob||a||this.ca("reset");this.Ob=!1;fl(this);a||Db(this)};
|
||||
k.save=function(){var a=new H(this);a.set(0,this.Ec);a.set(1,this.qe);a.set(2,[this.Jh,this.bf,this.ec]);return a.data()};k.restore=function(a){var b=0;void 0!==a[2]&&(this.Ec=a[b++],this.qe=a[b++],this.Jh=a[b][0],this.bf=a[b][1],this.ec||(this.ec=a[b][2]));return!0};k.start=function(a,b){this.nc||this.ca("running");this.Ob=!0;this.$n=a;this.eo=b};
|
||||
k.stop=function(a,b){if(this.Ob){this.Ob=!1;this.$c=b-this.eo;if(!this.nc){var c="stopped";if(this.$c){var d=a-this.$n,e=0<d?Math.round(1E3*this.$c/d):0,c=c+" (";jd(this)&&(c+=this.$g+" ops, ");c+=this.$c+" cycles, "+d+" ms, "+e+" hz)"}this.ca(c)}Db(this,!0,2!=this.nc);this.Md();fl(this,this.S.Ba)}};function jd(a){return 1<a.vc.length||E(a,a.ck)}
|
||||
function nd(a,b,c){if(!c&&gl(a,b,a.vc))return!0;a.Rc.length&&(a.$g++,c=bb(a.na,b),a.Rc[c][1]++,c=a.Ud[a.jf],c[0]=a.S.qa,c[1]=a.S.ua.oa,c[2]=b,++a.jf==a.Ud.length&&(a.jf=0));return!1}function qb(a,b){return gl(a,b,a.Sd)?(a.S.Ab(!0),!0):!1}function rb(a,b){return gl(a,b,a.Qc)?(a.S.Ab(!0),!0):!1}function kb(a,b,c){a.ca("break on input from port "+u(b)+": "+r(c));a.S.Ab(!0)}function ob(a,b,c){a.ca("break on output to port "+u(b)+": "+r(c));a.S.Ab(!0)}
|
||||
function hl(a,b){if(b==a.S.ua.oa)return a.S.ua;if(b==a.S.Eb.oa)return a.S.Eb;if(b==a.S.Za.oa)return a.S.Za;if(b==a.S.wb.oa)return a.S.wb;var c=new Nb(a.S);c.load(b,!0);return c}function il(a,b,c,d){var e=b[2];null==e&&(a=hl(a,b[1]),e=c?a.Yb(b[0],d||0,!0):a.Wc(b[0],d||0,!0));16711680==(e&16711680)&&(e&=1048575);return e}k.ub=function(a,b){var c=255,d=il(this,a,!1,0);0<=d&&(c=bb(this.na,d),void 0!==b&&jl(a,b));return c};
|
||||
k.Ia=function(a,b){var c=65535,d=il(this,a,!1,1);0<=d&&(c=cb(this.na,d),void 0!==b&&jl(a,b));return c};k.bd=function(a,b,c){var d=il(this,a,!0,0);0<=d&&(db(this.na,d,b),void 0!==c&&jl(a,c),Eb(this.S))};k.Nd=function(a,b,c){var d=il(this,a,!0,1);0<=d&&(eb(this.na,d,b),void 0!==c&&jl(a,c),Eb(this.S))};function $(a){return null==a[1]?"%"+p(a[2]):da(a[0],a[1])}function jl(a,b){b=void 0===b?1:b;null!=a[2]&&(a[2]+=b);null!=a[1]&&(a[0]+=b,a[0]!=(a[0]&65535)&&(a[0]&=65535,a[2]=null))}
|
||||
function Rk(a){var b;a.vc=["exec"];if(void 0!==a.Sd)for(b=1;b<a.Sd.length;b++){var c=a.na,d=il(a,a.Sd[b]);wb(c.Aa[d>>c.rb],!1)}a.Sd=["read"];if(void 0!==a.Qc)for(b=1;b<a.Qc.length;b++)c=a.na,d=il(a,a.Qc[b]),wb(c.Aa[d>>c.rb],!0);a.Qc=["write"]}k.Vd=function(a,b,c){if(!kl(this,a,b)){b[2]=il(this,b);b[3]=c;a.push(b);if(a!=this.vc){var d=this.na,e=il(this,b);d.Aa[e>>d.rb].Vd(e&d.eb,a==this.Qc)}c||this.ca("breakpoint enabled: "+$(b)+" ("+a[0]+")");Sk(this);return!0}return!1};
|
||||
function kl(a,b,c,d){var e=!1;c=il(a,c);for(var f=1;f<b.length;f++){var g=b[f];if(c==il(a,g)){e=!0;if(d){b.splice(f,1);b!=a.vc&&(d=a.na,wb(d.Aa[c>>d.rb],b==a.Qc));g[3]||a.ca("breakpoint cleared: "+$(g)+" ("+b[0]+")");Sk(a);break}a.ca("breakpoint exists: "+$(g)+" ("+b[0]+")");break}}return e}function ll(a,b){for(var c=1;c<b.length;c++)a.ca("breakpoint enabled: "+$(b[c])+" ("+b[0]+")");return b.length-1}
|
||||
function xb(a,b,c,d){if(void 0===d)xb(a,b,c,a.Sd),xb(a,b,c,a.Qc);else for(var e=1;e<d.length;e++){var f=il(a,d[e]);if(f>=b&&f<b+c){var g=a.na;g.Aa[f>>g.rb].Vd(f&g.eb,d==a.Qc)}}}function fl(a,b){if(void 0!==b)gl(a,b,a.vc,!0),a.lc=0;else for(var c=1;c<a.vc.length;c++){var d=a.vc[c];if(d[3]){if(!kl(a,a.vc,d,!0))break;c=0}}}
|
||||
function xb(a,b,c,d){if(void 0===d)xb(a,b,c,a.Sd),xb(a,b,c,a.Qc);else for(var e=1;e<d.length;e++){var f=il(a,d[e]);if(f>=b&&f<b+c){var g=a.na;g.Aa[f>>g.rb].Vd(f&g.eb,d==a.Qc)}}}function fl(a,b){if(void 0!==b)gl(a,b,a.vc,!0),a.nc=0;else for(var c=1;c<a.vc.length;c++){var d=a.vc[c];if(d[3]){if(!kl(a,a.vc,d,!0))break;c=0}}}
|
||||
function gl(a,b,c,d){var e=!1;16711680==(b&16711680)&&(b&=1048575);for(var f=1;f<c.length;f++){var g=c[f];if(b==il(a,g)){g[3]?kl(a,c,g,!0):d||a.ca("breakpoint hit: "+$(g)+" ("+c[0]+")");e=!0;break}}return e}
|
||||
function ml(a,b,c,d){var e=[b[0],b[1],b[2]],f=a.ub(b,1),g=a.Gf[f],h=g[0],m=-1;204==h&&(h=a.ub(b,1),g=Yk[h]||Z,f|=h<<8,h=g[0]);h>=Uk.length&&(m=a.ub(b,1),g=Zk[h-Uk.length][m>>3&7]);var n=2,h="";if(164<=f&&167>=f||170<=f&&175>=f)n=0;for(f=1;f<=n;f++){var q="",t=g[f];if(void 0!==t){var s=t&15;if(0!=s&&15!=s){var v=t&240;if(128<=v)if(0>m&&(m=a.ub(b,1)),160<=v)q=m>>3&7,176==(t&240)?q+=16:3<=(t&15)&&(q+=8),q=X[q];else{if(128<=v){var q=a,A=t,s=b,D="",v=m>>6,D=m&7;3>v?(A=void 0,v||6!=D?(D=Vk[D],1==v?(A=q.ub(s,
|
||||
1),A&128?(A=A<<24>>24,D+="-"+r(-A)):D+="+"+r(A)):2==v&&(A=q.Ia(s,2),D+="+"+u(A))):(A=q.Ia(s,2),D=u(A)),D="["+D+"]"):D=X[D+(1==(A&15)?0:8)];q=D}}else if(16==v)q="1";else if(0==v){q=a;v=t;s=b;A=" ";switch(v&15){case 1:v&12288&&(A=r(q.ub(s,1)));break;case 2:A=u(q.ub(s,1)<<24>>24);break;case 3:case 4:A=u(q.Ia(s,2));break;case 6:v=q.Ia(s,2);q=q.Ia(s,2);A=$([v,q,void 0]);break;default:A="imm("+u(v)+")"}q=A}else 32==v?q="["+u(a.Ia(b,2))+"]":48==v?(1==s?(q=a.ub(b,1),q=q<<24>>24):q=a.Ia(b,2),q=b[0]+q&65535,
|
||||
q=nl(a,[q,b[1],void 0])[0]||u(q)):96==v?q=X[(t&3840)>>8]:112==v?q=X[((t&3840)>>8)+16]:64==v?q="DS:[SI]":80==v&&(q="ES:[DI]");q.length||(q="type("+u(t)+")");0<h.length&&(h+=",");h+=q}}}m=$(e)+" ";n="";do n+=r(a.ub(e,1));while(e[0]!=b[0]);m+=(n+" ").substr(0,14);m+=(Uk[g[0]]+" ").substr(0,8);h&&(m+=" "+h);c&&(m=(m+" ").substr(0,50),m+=";",m=a.S.cf?m+("cycles="+F(a.S).toString()+" cs="+p(a.S.dg)):m+(c+(null!=d?"="+d.toString():"")));return m}
|
||||
function ol(a,b){var c;switch(b){case "V":c=Zc(a.S);break;case "D":c=a.S.xa&1024;break;case "I":c=a.S.xa&512;break;case "T":c=a.S.xa&256;break;case "S":c=Yc(a.S);break;case "Z":c=Xc(a.S);break;case "A":c=Wc(a.S);break;case "P":c=Vc(a.S);break;case "C":c=Uc(a.S);break;default:c=0}return" "+b+(c?"1":"0")}function pl(a,b){return a.xg+"="+u(a.oa)+(b?"["+p(a.Ua,6)+","+u(a.Nc)+"]":"")}function sl(a,b,c,d){return a+"="+(null!=b?u(b):"")+"["+p(c,6)+","+u(d-c)+"]"}
|
||||
function tl(a,b,c){var d=2==c?a.ek:a.Ec;c=d[0];var e=d[1],d=d[2];if(void 0!==b){"%"==b.charAt(0)&&(b=b.substr(1),e=null);var f=b,d=null;if(f.match(/^[a-z_][a-z0-9_]*$/i))for(var d=[],g=f.toUpperCase(),h=0;h<a.xc.length;h++){var f=a.xc[h][0],m=a.xc[h][2][g];if(void 0!==m){g=m.o;void 0!==g&&(h=m.s,void 0===h&&(h=f>>>4),d[0]=g,d[1]=h,void 0!==m.p&&(d[2]=m.p));break}}if(d&&d.length)return d;d=b.indexOf(":");0>d?null!=e?(c=ul(a,b),d=null):d=ul(a,b):(e=ul(a,b.substring(0,d)),c=ul(a,b.substring(d+1)),d=
|
||||
function tl(a,b,c){var d=2==c?a.hk:a.Ec;c=d[0];var e=d[1],d=d[2];if(void 0!==b){"%"==b.charAt(0)&&(b=b.substr(1),e=null);var f=b,d=null;if(f.match(/^[a-z_][a-z0-9_]*$/i))for(var d=[],g=f.toUpperCase(),h=0;h<a.xc.length;h++){var f=a.xc[h][0],m=a.xc[h][2][g];if(void 0!==m){g=m.o;void 0!==g&&(h=m.s,void 0===h&&(h=f>>>4),d[0]=g,d[1]=h,void 0!==m.p&&(d[2]=m.p));break}}if(d&&d.length)return d;d=b.indexOf(":");0>d?null!=e?(c=ul(a,b),d=null):d=ul(a,b):(e=ul(a,b.substring(0,d)),c=ul(a,b.substring(d+1)),d=
|
||||
null)}return[c,e,d]}
|
||||
function ul(a,b,c){var d;if(void 0!==b)switch(b=b.toUpperCase(),b){case "AX":d=a.S.G;break;case "BX":d=a.S.B;break;case "CX":d=a.S.I;break;case "DX":d=a.S.J;break;case "SI":d=a.S.F;break;case "DI":d=a.S.D;break;case "BP":d=a.S.H;break;case "SP":d=a.S.Y;break;case "CS":d=a.S.ua.oa;break;case "DS":d=a.S.Eb.oa;break;case "ES":d=a.S.Za.oa;break;case "SS":d=a.S.wb.oa;break;case "IP":d=a.S.qa;break;default:d=ca(b),void 0===d&&a.ca("invalid "+(c?c:"value")+": "+b)}else a.ca("missing "+(c?c:"value"));return d}
|
||||
function Pi(a,b,c,d){function e(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}var f=[],g=[],h;for(h in d){var m=d[h];"number"==typeof m&&(d[h]=m={o:m});var n=m.o,q=m.s,t=m.a;void 0!==n&&(void 0!==q&&(f[0]=n,f[1]=q,m.p=il(a,f)),na(g,[n,h],e));t&&(m.a=t.replace(/''/g,'"'))}a.xc.push([b,c,d,g])}
|
||||
function nl(a,b,c){for(var d=[],e=il(a,b),f=0;f<a.xc.length;f++){var g=a.xc[f][0],h=a.xc[f][1];if(e>=g&&e<g+h){b=ma(a.xc[f][3],[b[0]],function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0});0<=b?vl(a,f,b,d):c&&(b=~b,vl(a,f,b-1,d),vl(a,f,b,d));break}}return d}function vl(a,b,c,d){var e={},f=a.xc[b][3],g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.xc[b][2][h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function wl(a,b){if("?"==b)a.ca("\nfrequency commands:"),a.ca("\tclear\tclear all frequency counts");else{var c,d=0;if(a.Rc)if("clear"==b){for(c=0;c<a.Rc.length;c++)a.Rc[c]=[c,0];a.ca("frequency data cleared");d++}else if(void 0!==b)a.ca("unknown frequency command: "+b),d++;else{var e=a.Rc.slice();e.sort(function(a,b){return b[1]-a[1]});for(c=0;c<e.length;c++){var f=e[c][0],g=e[c][1];g&&(a.ca((Uk[a.Gf[f][0]]+" ").substr(0,5)+" ("+r(f)+"): "+g+" times"),d++)}}d||a.ca("no frequency data available")}}
|
||||
function xl(a,b){if("l"==b[0]&&void 0===b[1]||"?"==b[1])a.ca("\nlist/load commands:"),a.ca("\tl [address] [drive #] [sector #] [# sectors]"),a.ca("\tln [address] lists symbol(s) nearest to address");else{var c=[],d,e=0,f=0,g=!1;if("json"==b[1])g=!0;else if(d="ln"==b[0],c=tl(a,b[1],d?1:2),d){c=nl(a,c,!0);c.length?(c[0]&&a.ca(u(c[1])+": "+c[0]),4<c.length&&c[4]&&a.ca(u(c[5])+": "+c[4])):a.ca("no symbols");return}d=ul(a,b[2],"drive #");if(void 0!==d){if(!g){e=ul(a,b[3],"sector #");if(void 0===e)return;
|
||||
f=ul(a,b[4],"# of sectors");void 0===f&&(f=1)}var h=a.Im;2<=d&&a.Ek&&(d-=2,h=a.Ek);if(h){var m=h.tk(d);if(m)if(m.va)if(g)a.ca(sk(m.va));else if(h.em(m,e,f)){for(var n=0,q=!1,e=$(c);!q&&0<m.Wa--;)(function(a,b){h.sc(m,function(c){0>c?(a.ca("out of data at address "+$(b)),q=!0):(a.bd(b,c,1),n++)})})(a,c);a.ca(n+" bytes read at "+e)}else a.ca("sector "+e+" request out of range");else a.ca("drive "+d+" not loaded");else a.ca("invalid drive: "+d)}else a.ca("disk controller not present")}}}
|
||||
f=ul(a,b[4],"# of sectors");void 0===f&&(f=1)}var h=a.Lm;2<=d&&a.Hk&&(d-=2,h=a.Hk);if(h){var m=h.wk(d);if(m)if(m.va)if(g)a.ca(sk(m.va));else if(h.hm(m,e,f)){for(var n=0,q=!1,e=$(c);!q&&0<m.Wa--;)(function(a,b){h.sc(m,function(c){0>c?(a.ca("out of data at address "+$(b)),q=!0):(a.bd(b,c,1),n++)})})(a,c);a.ca(n+" bytes read at "+e)}else a.ca("sector "+e+" request out of range");else a.ca("drive "+d+" not loaded");else a.ca("invalid drive: "+d)}else a.ca("disk controller not present")}}}
|
||||
function dl(a,b,c){if(b&&"?"==b[1])a.ca("\nregister commands:"),a.ca("\tr\t\tdisplay all registers"),a.ca("\tr [target=#]\tmodify target register"),a.ca("supported targets:"),a.ca("\tall registers and flags V,D,I,S,Z,A,P,C");else{var d=!0,e;if(null!=b&&1<b.length){var f=b[1];if("p"==f)e=void 0!==a.S.Sc;else{var d=!1,g=null,h=f.indexOf("=");if(0<h)g=f.substr(h+1),f=f.substr(0,h);else if(2<b.length)g=b[2];else{a.ca("missing value for "+b[1]);return}b=parseInt(g,16);if(isNaN(b)){a.ca("invalid value: "+
|
||||
g);return}switch(f.toUpperCase()){case "AL":a.S.G=a.S.G&65280|b&255;break;case "AH":a.S.G=a.S.G&255|b<<8&255;break;case "AX":a.S.G=b&65535;break;case "BL":a.S.B=a.S.B&65280|b&255;break;case "BH":a.S.B=a.S.B&255|b<<8&255;break;case "BX":a.S.B=b&65535;break;case "CL":a.S.I=a.S.I&65280|b&255;break;case "CH":a.S.I=a.S.I&255|b<<8&255;break;case "CX":a.S.I=b&65535;break;case "DL":a.S.J=a.S.J&65280|b&255;break;case "DH":a.S.J=a.S.J&255|b<<8&255;break;case "DX":a.S.J=b&65535;break;case "SP":a.S.Y=b&65535;
|
||||
break;case "BP":a.S.H=b&65535;break;case "SI":a.S.F=b&65535;break;case "DI":a.S.D=b&65535;break;case "DS":Oc(a.S,b);break;case "ES":Tc(a.S,b);break;case "SS":Pc(a.S,b);break;case "CS":d=!0;Nc(a.S,b);a.Ec=[a.S.qa,a.S.ua.oa,void 0];break;case "IP":d=!0;I(a.S,b);a.Ec=[a.S.qa,a.S.ua.oa,void 0];break;case "C":b?ed(a.S):$c(a.S);break;case "P":b?(f=a.S,Vc(f)||(f.ja^=1)):(f=a.S,Vc(f)&&(f.ja^=1));break;case "A":b?fd(a.S):ad(a.S);break;case "Z":b?gd(a.S):bd(a.S);break;case "S":b?hd(a.S):cd(a.S);break;case "I":b?
|
||||
(f=a.S,f.xa|=512):(f=a.S,f.xa&=-513);break;case "D":b?(f=a.S,f.xa|=1024):(f=a.S,f.xa&=-1025);break;case "V":b?id(a.S):dd(a.S);break;default:a.ca("unknown register: "+f);return}Eb(a.S);a.ca("updated registers:")}}f=e;void 0===f&&(f=!!(a.S.ad&1));e="AX="+u(a.S.G)+" BX="+u(a.S.B)+" CX="+u(a.S.I)+" DX="+u(a.S.J)+" SP="+u(a.S.Y)+" BP="+u(a.S.H)+" SI="+u(a.S.F)+" DI="+u(a.S.D)+"\n";e+=pl(a.S.Eb,f)+" "+pl(a.S.Za,f)+" "+pl(a.S.wb,f);e=e+(f?"\n":" ")+(pl(a.S.ua,f)+" IP="+u(a.S.qa)+ol(a,"V")+ol(a,"D")+ol(a,
|
||||
"I")+ol(a,"T")+ol(a,"S")+ol(a,"Z")+ol(a,"A")+ol(a,"P")+ol(a,"C"));f&&(f=a.na,e+=" MS="+u(a.S.ad)+"\n"+sl("LD",a.S.Ld.oa,a.S.Ld.Ua,a.S.Ld.Nc)+" "+sl("GD",null,a.S.Sc,a.S.Ye)+" "+sl("ID",null,a.S.dd,a.S.te)+" TR="+u(a.S.Ag.oa)+" A20="+(f.ue==f.Ib?"ON":"OFF"));a.ca((c?"":"\n")+e);d&&(a.Ec=[a.S.qa,a.S.ua.oa,void 0],el(a,$(a.Ec)))}}function yl(a,b,c){var d="tr"==b;b=null!=c?parseInt(c,10):1;var e=1==b?0:1;wa(b,function(){return Pa(a,!0)&&a.wf(e,d,!1)},function(){Eb(a.S);Pa(a,!1)})}
|
||||
function el(a,b,c,d){b=tl(a,b,1);if(null!=b[0]){void 0===d&&(d=1);var e=[65535,b[1],a.na.ue];if(void 0!==c){e=tl(a,c,1);if(null==e[0]||e[0]<b[0])return;if(256<e[0]-b[0]){a.ca("range too large");return}e[0]++;d=-1}for(c=b[0]!=a.Ec[0];d--&&(null!=b[1]?b[0]<e[0]:b[2]<e[2]);){var f=a.ub(b),g=Qa(a,!1)||a.lc?a.$c:null;if(38==f||46==f||54==f||62==f||240==f||242==f||243==f)g=null,d||d++;var f=null!=g?"cycles":null,h=nl(a,b);if(h[0]){var m=h[0]+":";c=!1;h[2]&&(m+=" "+h[2]);a.ca(m)}c&&a.ca();h[3]&&(f=h[3],
|
||||
g=null);c=ml(a,b,f,g);a.ca(c);a.Ec=b;c=!1}}}function al(a,b,c){c&&(b?a.Hh=b:b=a.Hh);a=b?b.split(0<=b.indexOf("|")?"|":";"):[""];for(var d in a)a[d]=ja(a[d]);return a}
|
||||
function el(a,b,c,d){b=tl(a,b,1);if(null!=b[0]){void 0===d&&(d=1);var e=[65535,b[1],a.na.ue];if(void 0!==c){e=tl(a,c,1);if(null==e[0]||e[0]<b[0])return;if(256<e[0]-b[0]){a.ca("range too large");return}e[0]++;d=-1}for(c=b[0]!=a.Ec[0];d--&&(null!=b[1]?b[0]<e[0]:b[2]<e[2]);){var f=a.ub(b),g=Qa(a,!1)||a.nc?a.$c:null;if(38==f||46==f||54==f||62==f||240==f||242==f||243==f)g=null,d||d++;var f=null!=g?"cycles":null,h=nl(a,b);if(h[0]){var m=h[0]+":";c=!1;h[2]&&(m+=" "+h[2]);a.ca(m)}c&&a.ca();h[3]&&(f=h[3],
|
||||
g=null);c=ml(a,b,f,g);a.ca(c);a.Ec=b;c=!1}}}function al(a,b,c){c&&(b?a.Jh=b:b=a.Jh);a=b?b.split(0<=b.indexOf("|")?"|":";"):[""];for(var d in a)a[d]=ja(a[d]);return a}
|
||||
function bl(a,b){!b.length&&a.bf&&(a.ca("ended assemble @"+$(a.qe)),a.Ec=a.qe,a.bf=!1);b=b.toLowerCase();if(Ra(a)&&!Qa(a,!0)&&0<b.length){if(a.bf)b="a "+$(a.qe)+" "+b;else{var c,d,e;switch(b){case "reset":a.Da&&a.Da.reset();return;default:for(d=b.charAt(0),e=1;e<b.length;e++){c=b.charAt(e);if(" "==c)break;if("r"==d||"a">c||"z"<c){b=b.substring(0,e)+" "+b.substring(e);break}}}}c=b.split(" ");switch(c[0].charAt(0)){case "a":var f=tl(a,c[1],1);if(null!=f[0])if(a.qe=f,void 0===c[2])a.ca("begin assemble @"+
|
||||
$(f)),a.bf=!0,Eb(a.S);else if(a.ca("not supported yet"),c=[],c.length){for(var g=0;g<c.length;g++)a.bd(f,c[g],1);a.ca(ml(a,a.qe))}break;case "b":a:if(f=c[1],(c=c[0].charAt(1))&&"?"!=c)if("l"==c)f=0+ll(a,a.vc),f+=ll(a,a.Sd),(f+=ll(a,a.Qc))||a.ca("no breakpoints");else if(void 0===f)a.ca("missing breakpoint address");else{g=[];if("*"!=f&&(g=tl(a,f,1),null==g[0]))break a;f=null==g[0]?f:u(g[0]);"c"==c?null==g[0]?(Rk(a),a.ca("all breakpoints cleared")):kl(a,a.vc,g,!0)||kl(a,a.Sd,g,!0)||kl(a,a.Qc,g,!0)||
|
||||
a.ca("breakpoint missing: "+$(g)):"i"==c?a.ca("breakpoint "+(hb(a.na,g[0])?"enabled":"cleared")+": port "+f+" (input)"):"o"==c?a.ca("breakpoint "+(lb(a.na,g[0])?"enabled":"cleared")+": port "+f+" (output)"):null!=g[0]&&("p"==c?a.Vd(a.vc,g):"r"==c?a.Vd(a.Sd,g):"w"==c?a.Vd(a.Qc,g):a.ca("unknown breakpoint command: "+c))}else a.ca("\nbreakpoint commands:"),a.ca("\tbi [p]\ttoggle break on input port [p]"),a.ca("\tbo [p]\ttoggle break on output port [p]"),a.ca("\tbp [a]\tset exec breakpoint at addr [a]"),
|
||||
a.ca("\tbr [a]\tset read breakpoint at addr [a]"),a.ca("\tbw [a]\tset write breakpoint at addr [a]"),a.ca("\tbc [a]\tclear breakpoint at addr [a]"),a.ca("\tbl\tlist all breakpoints");break;case "c":a.Uf&&(a.Uf.value="");break;case "d":a:{var h=c[0],g=c[1],m=c[2],n;if("?"==g){f="symbols";for(n in Y)a.bi[n]&&(f.length&&(f+=","),f+=Y[n].Ma);f+=",state";a.ca("\ndump commands:");a.ca("\tdb [a] [#] dump bytes at address a");a.ca("\tdw [a] [#] dump words at address a");a.ca("\tds [s] dump descriptor for selector s");
|
||||
f.length&&a.ca("dumps are also available for: "+f)}else if("state"==g)a.ca(zl(a.Da,!0));else if("symbols"==g)for(c=0;c<a.xc.length;c++)for(f in g=a.xc[c][0],h=a.xc[c][2],h)"."!=f.charAt(0)&&(m=h[f],n=m.o,void 0!==n&&(m=m.s,void 0===m&&(m=g>>>4),(d=h[f].l)&&(f=d),a.ca(da(n,m)+" "+f)));else{for(n in Y)if(g==Y[n].Ma){(f=a.bi[n])?f(m):a.ca("no dump registered for "+g);break a}f=tl(a,g,2);if(null!=f[0])if("ds"==h)if(c=hl(a,f[0]),null!=c.oa){f="selector="+u(f[0])+" limit="+u(c.Nc)+" base="+p(c.Ua);if(c.ab){f+=
|
||||
a.ca("\tbr [a]\tset read breakpoint at addr [a]"),a.ca("\tbw [a]\tset write breakpoint at addr [a]"),a.ca("\tbc [a]\tclear breakpoint at addr [a]"),a.ca("\tbl\tlist all breakpoints");break;case "c":a.Uf&&(a.Uf.value="");break;case "d":a:{var h=c[0],g=c[1],m=c[2],n;if("?"==g){f="symbols";for(n in Y)a.di[n]&&(f.length&&(f+=","),f+=Y[n].Ma);f+=",state";a.ca("\ndump commands:");a.ca("\tdb [a] [#] dump bytes at address a");a.ca("\tdw [a] [#] dump words at address a");a.ca("\tds [s] dump descriptor for selector s");
|
||||
f.length&&a.ca("dumps are also available for: "+f)}else if("state"==g)a.ca(zl(a.Da,!0));else if("symbols"==g)for(c=0;c<a.xc.length;c++)for(f in g=a.xc[c][0],h=a.xc[c][2],h)"."!=f.charAt(0)&&(m=h[f],n=m.o,void 0!==n&&(m=m.s,void 0===m&&(m=g>>>4),(d=h[f].l)&&(f=d),a.ca(da(n,m)+" "+f)));else{for(n in Y)if(g==Y[n].Ma){(f=a.di[n])?f(m):a.ca("no dump registered for "+g);break a}f=tl(a,g,2);if(null!=f[0])if("ds"==h)if(c=hl(a,f[0]),null!=c.oa){f="selector="+u(f[0])+" limit="+u(c.Nc)+" base="+p(c.Ua);if(c.ab){f+=
|
||||
" access="+u(c.ab);if(c.ab&4096)c.ab&2048?(f=f+"code:"+(c.ab&512?"readable,":"execonly,"),f+=c.ab&1024?"conforming,":"nonconforming,"):(f+="data:",f+=c.ab&512?"writeable,":"readonly,",f+=c.ab&1024?"expand down,":"expand up,"),f+=c.ab&256?"accessed":"not accessed";else switch(f+="type:",c.ab&7936){case 256:f+="tss";break;case 512:f+="ldt";break;case 768:f+="tss(busy)";break;case 1024:f+="call";break;case 1280:f+="task";break;case 1536:f+="int";break;case 1792:f+="trap";break;default:f+="unknown"}f+=
|
||||
",dpl"+(c.ab>>13&24576);f+=c.ab&32768?",present":",not present"}a.ca(f)}else a.ca("invalid selector: "+u(f[0]));else{c=0;void 0!==m&&("l"==m.charAt(0)&&(m=m.substr(1)),c=parseInt(m,10));n="";c||(c=8);for(m=0;m<c;m++){e=d="";for(var g=$(f),q=0,t=0;16>t;t++){var s=a.ub(f,1);"dw"==h?t&1&&(d+=u(q|s<<8)+(7==t?" - ":" ")):d+=r(s)+(7==t?"-":" ");e+=32<=s&&128>s?String.fromCharCode(s):".";q=s}n&&(n+="\n");n+=g+" "+d+" "+e}n&&a.ca(n);a.ek=f}}}break;case "e":f=c[1];if(void 0===f)a.ca("missing address");else if(f=
|
||||
tl(a,f,2),null!=f[0])for(g=2;g<c.length;g++)h=parseInt(c[g],16),a.ca("setting "+$(f)+" to "+r(h)),a.bd(f,h,1);break;case "f":wl(a,c[1]);break;case "g":a:{f=c[1];if(void 0!==f){f=tl(a,f,1);if(null==f[0])break a;a.Vd(a.vc,f,!0)}a.Ne(!0)||a.ca('cpu not available, "g" command ignored')}break;case "h":m=c[1];if(a.Ob&&void 0===m)a.Ab();else{f="";c=10;g=a.jf;h=a.Ud;if(h.length)for(n=void 0===m?a.Rl:parseInt(m,10),isNaN(n)?n=c:f="more ",n>h.length&&(a.ca("note: only "+h.length+" available"),n=h.length),g-=
|
||||
n,0>g&&(null!=h[h.length-1][1]?g+=h.length:(n=g+n,g=0)),void 0!==m&&a.ca(n+" instructions earlier:");c&&g!=a.jf;){m=h[g];if(null==m[1])break;m=[m[0],m[1],m[2]];a.ca(ml(a,m,"history",-n));++g==h.length&&(g=0);a.Rl=--n;c--}10==c&&(a.ca("no "+f+"history available"),a.Rl=void 0)}break;case "i":(f=c[1])&&"?"!=f?(f=ul(a,f),void 0!==f&&(c=jb(a.na,f),a.ca(u(f)+": "+r(c)))):(a.ca("\ninput commands:"),a.ca("\ti [p]\tread port [p]"),a.ca("warning: port accesses can affect hardware state"));break;case "l":xl(a,
|
||||
c);break;case "m":a:{f=null;h=c[1];"?"==h&&(h=void 0);if(void 0!==h){n=0;if("all"==h)n=4294967295,h=null;else if("on"==h)f=!0,h=null;else if("off"==h)f=!1,h=null;else{for(g in Y)if(h==Y[g].Ma){n=Y[g].La;f=!!(a.dc&n);break}if(!n){a.ca("unknown message category: "+h);break a}}n&&("on"==c[2]?(a.dc|=n,f=!0):"off"==c[2]&&(a.dc&=~n,f=!1))}c=0;n="";for(g in Y)if(!h||h==Y[g].Ma)if(m=!!(a.dc&Y[g].La),null===f||f==m)n&&(n+=","),++c%10||(n+="\n\t"),n+=Y[g].Ma;void 0===h&&a.ca("\nmessage commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.ca((null!==f?f?"messages on: ":"messages off: ":"message categories:\n\t")+(n||"none"))}break;case "o":f=c[1];c=c[2];f&&"?"!=f?(f=ul(a,f,"port #"),c=ul(a,c),void 0!==f&&void 0!==c&&nb(a.na,f,c)):(a.ca("\noutput commands:"),a.ca("\to [p] [d]\twrite data [d] to port [p]"),a.ca("warning: port accesses can affect hardware state"));break;case "p":case "pr":f="pr"==c[0]?1:0;c=1+f;if(a.lc)a.ca("step in progress");else{h=!1;n=[a.S.qa,a.S.ua.oa,void 0];do switch(g=!1,a.ub(n)){case 38:case 46:case 54:case 62:case 240:jl(n,
|
||||
1);g=!0;break;case 204:case 206:a.lc=c;jl(n,1);break;case 205:case 224:case 225:case 226:a.lc=c;jl(n,2);break;case 232:a.lc=c;jl(n,3);break;case 154:a.lc=c;jl(n,5);break;case 255:a.lc=0<=ml(a,n).indexOf("CALL")?c:0;break;case 243:case 242:jl(n,1);h=g=!0;break;case 164:case 165:case 166:case 167:case 170:case 171:case 172:case 173:case 174:case 175:h&&(a.lc=c,jl(n,1))}while(g);a.lc?(a.Vd(a.vc,n,!0),a.Ne()||(a.S.Md(),a.lc=0)):yl(a,f?"tr":"t")}break;case "r":dl(a,c);break;case "t":case "tr":yl(a,c[0],
|
||||
",dpl"+(c.ab>>13&24576);f+=c.ab&32768?",present":",not present"}a.ca(f)}else a.ca("invalid selector: "+u(f[0]));else{c=0;void 0!==m&&("l"==m.charAt(0)&&(m=m.substr(1)),c=parseInt(m,10));n="";c||(c=8);for(m=0;m<c;m++){e=d="";for(var g=$(f),q=0,t=0;16>t;t++){var s=a.ub(f,1);"dw"==h?t&1&&(d+=u(q|s<<8)+(7==t?" - ":" ")):d+=r(s)+(7==t?"-":" ");e+=32<=s&&128>s?String.fromCharCode(s):".";q=s}n&&(n+="\n");n+=g+" "+d+" "+e}n&&a.ca(n);a.hk=f}}}break;case "e":f=c[1];if(void 0===f)a.ca("missing address");else if(f=
|
||||
tl(a,f,2),null!=f[0])for(g=2;g<c.length;g++)h=parseInt(c[g],16),a.ca("setting "+$(f)+" to "+r(h)),a.bd(f,h,1);break;case "f":wl(a,c[1]);break;case "g":a:{f=c[1];if(void 0!==f){f=tl(a,f,1);if(null==f[0])break a;a.Vd(a.vc,f,!0)}a.Ne(!0)||a.ca('cpu not available, "g" command ignored')}break;case "h":m=c[1];if(a.Ob&&void 0===m)a.Ab();else{f="";c=10;g=a.jf;h=a.Ud;if(h.length)for(n=void 0===m?a.Ul:parseInt(m,10),isNaN(n)?n=c:f="more ",n>h.length&&(a.ca("note: only "+h.length+" available"),n=h.length),g-=
|
||||
n,0>g&&(null!=h[h.length-1][1]?g+=h.length:(n=g+n,g=0)),void 0!==m&&a.ca(n+" instructions earlier:");c&&g!=a.jf;){m=h[g];if(null==m[1])break;m=[m[0],m[1],m[2]];a.ca(ml(a,m,"history",-n));++g==h.length&&(g=0);a.Ul=--n;c--}10==c&&(a.ca("no "+f+"history available"),a.Ul=void 0)}break;case "i":(f=c[1])&&"?"!=f?(f=ul(a,f),void 0!==f&&(c=jb(a.na,f),a.ca(u(f)+": "+r(c)))):(a.ca("\ninput commands:"),a.ca("\ti [p]\tread port [p]"),a.ca("warning: port accesses can affect hardware state"));break;case "l":xl(a,
|
||||
c);break;case "m":a:{f=null;h=c[1];"?"==h&&(h=void 0);if(void 0!==h){n=0;if("all"==h)n=4294967295,h=null;else if("on"==h)f=!0,h=null;else if("off"==h)f=!1,h=null;else{for(g in Y)if(h==Y[g].Ma){n=Y[g].La;f=!!(a.ec&n);break}if(!n){a.ca("unknown message category: "+h);break a}}n&&("on"==c[2]?(a.ec|=n,f=!0):"off"==c[2]&&(a.ec&=~n,f=!1))}c=0;n="";for(g in Y)if(!h||h==Y[g].Ma)if(m=!!(a.ec&Y[g].La),null===f||f==m)n&&(n+=","),++c%10||(n+="\n\t"),n+=Y[g].Ma;void 0===h&&a.ca("\nmessage commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.ca((null!==f?f?"messages on: ":"messages off: ":"message categories:\n\t")+(n||"none"))}break;case "o":f=c[1];c=c[2];f&&"?"!=f?(f=ul(a,f,"port #"),c=ul(a,c),void 0!==f&&void 0!==c&&nb(a.na,f,c)):(a.ca("\noutput commands:"),a.ca("\to [p] [d]\twrite data [d] to port [p]"),a.ca("warning: port accesses can affect hardware state"));break;case "p":case "pr":f="pr"==c[0]?1:0;c=1+f;if(a.nc)a.ca("step in progress");else{h=!1;n=[a.S.qa,a.S.ua.oa,void 0];do switch(g=!1,a.ub(n)){case 38:case 46:case 54:case 62:case 240:jl(n,
|
||||
1);g=!0;break;case 204:case 206:a.nc=c;jl(n,1);break;case 205:case 224:case 225:case 226:a.nc=c;jl(n,2);break;case 232:a.nc=c;jl(n,3);break;case 154:a.nc=c;jl(n,5);break;case 255:a.nc=0<=ml(a,n).indexOf("CALL")?c:0;break;case 243:case 242:jl(n,1);h=g=!0;break;case 164:case 165:case 166:case 167:case 170:case 171:case 172:case 173:case 174:case 175:h&&(a.nc=c,jl(n,1))}while(g);a.nc?(a.Vd(a.vc,n,!0),a.Ne()||(a.S.Md(),a.nc=0)):yl(a,f?"tr":"t")}break;case "r":dl(a,c);break;case "t":case "tr":yl(a,c[0],
|
||||
c[1]);break;case "u":el(a,c[1],c[2],8);break;case "x":a:if(void 0===c[1]||"?"==c[1])a.ca("\nexecution options:"),a.ca("\tcs int #\tset checksum cycle interval to #"),a.ca("\tcs start #\tset checksum cycle start count to #"),a.ca("\tcs stop #\tset checksum cycle stop count to #"),a.ca("\tsp #\t\tset speed multiplier to #");else switch(c[1]){case "cs":void 0!==c[3]&&(m=parseInt(c[3],10));switch(c[2]){case "int":a.S.lf=m;break;case "start":a.S.fg=m;break;case "stop":a.S.nf=m;break;default:a.ca("unknown cs option");
|
||||
break a}void 0!==m&&Bb(a.S);a.ca("checksums "+(a.S.cf?"enabled":"disabled"));break;case "sp":void 0!==c[2]&&Hb(a.S,parseInt(c[2],10));a.ca("target speed: "+(a.S.Ge.toFixed(2)+"Mhz")+" ("+a.S.Gd+"x)");break;default:a.ca("unknown option: "+c[1])}break;case "?":f="commands:";for(h in Tk)f+="\n"+h+" ".substr(0,7-h.length)+Tk[h];jd(a)||(f+="\nnote: frequency/history disabled if no exec breakpoints");a.ca(f);break;default:a.ca("unknown command: "+b)}}}
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Qk(d);Oa(d,c)}});function H(a,b,c){this.id=a.id;this.key=Al(a,b,c);this.X=a.X;Bl(this,a.dp)}function Al(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}function Cl(){try{return"undefined"!==typeof window.localStorage}catch(a){return!1}}
|
||||
H.prototype={set:function(a,b){this[this.id][a]=b},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.Ai=!0):this.Ai?!0:Cl()&&(a=window.localStorage.getItem(this.key))?(this[this.id]=a,this.Ai=!0):!1},parse:function(){var a=!0;try{this[this.id]=JSON.parse(this[this.id])}catch(b){w(b.message||b),a=!1}return a},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},
|
||||
clear:function(a){Bl(this);if(Cl())for(var b=0;b<window.localStorage.length;){var c=window.localStorage.key(b++);c&&(a||c.substr(0,this.key.length)==this.key)&&(window.localStorage.removeItem(c),b=0)}},Qa:function(a){this.X&&E(this.X,this.X.um)&&this.X.message(a)}};function Bl(a,b){a[a.id]={};b&&a.set("parms",b);a.Ai=!1}
|
||||
Ba(function(){for(var a=B(window.document,"pcjs","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Qk(d);Oa(d,c)}});function H(a,b,c){this.id=a.id;this.key=Al(a,b,c);this.X=a.X;Bl(this,a.gp)}function Al(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}function Cl(){try{return"undefined"!==typeof window.localStorage}catch(a){return!1}}
|
||||
H.prototype={set:function(a,b){this[this.id][a]=b},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.Ci=!0):this.Ci?!0:Cl()&&(a=window.localStorage.getItem(this.key))?(this[this.id]=a,this.Ci=!0):!1},parse:function(){var a=!0;try{this[this.id]=JSON.parse(this[this.id])}catch(b){w(b.message||b),a=!1}return a},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},
|
||||
clear:function(a){Bl(this);if(Cl())for(var b=0;b<window.localStorage.length;){var c=window.localStorage.key(b++);c&&(a||c.substr(0,this.key.length)==this.key)&&(window.localStorage.removeItem(c),b=0)}},Qa:function(a){this.X&&E(this.X,this.X.xm)&&this.X.message(a)}};function Bl(a,b){a[a.id]={};b&&a.set("parms",b);a.Ci=!1}
|
||||
function Dl(a){var b=!0;if(Cl()){var c=JSON.stringify(a[a.id]);try{window.localStorage.setItem(a.key,c)}catch(d){w("Unable to store "+c.length+" bytes in browser local storage"),b=!1}}return b}
|
||||
function El(a,b,c){x.call(this,"Computer",a,El);this.Nb=!1;this.cg=a.buswidth;this.Cc=Fl;this.yg=null;this.ph=!1;this.url=b?b.url:null;this.lp=(Math.random()+0.1).toString(36).substr(2,12);this.Pc=Gl(this);if(this.S=Na("CPU",this.id)){this.X=Na("Debugger",this.id);this.na=new Va({id:this.th+".bus",buswidth:this.cg},this.S,this.X);var d,e=La(this.id);if((this.sg=Na("Panel",this.id))&&this.sg.Uf)for(b=0;b<e.length;b++)d=e[b],d.Ga=this.sg.Ga,d.ca=this.sg.ca,d.Uf=this.sg.Uf;this.ca("PREFETCH: false, TYPEDARRAYS: false");
|
||||
for(b=0;b<e.length;b++)d=e[b],d.nc&&d.nc(this,this.na,this.S,this.X);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.Nh=d:this.Cc=parseInt(d,10));var f;if(a=Fa&&Fa.state||(f=!0,a.state))b=this.dm=a,f||(this.ph=!0,this.Cc=Fl),this.Cc&&(this.Qh=new H(this,"1.15.5"),this.Qh.load()?b=null:delete this.Qh);!b&&this.Cc&&(f=null,this.Pc&&(f=sa()+"/api/v1/user?req=load&user="+this.Pc+"&state="+Al(this,"1.15.5")),b=f)&&(this.ph=!0);b?ra(b,!0,null,this,this.io):this.Ta();c||Hl(this,this.Gh)}else w("Unable to find CPU component")}
|
||||
y(x,El);var Ck=102,Fl=0;k=El.prototype;k.gf=function(){return this.lp};k.ge=function(){return this.Pc?this.Pc:""};k.io=function(a,b,c){c?(this.Nh=null,this.ph=!1,this.Ga("Unable to load machine state from server (error "+c+(b?": "+ja(b):"")+")")):this.yg=b;this.Ta()};function Hl(a,b,c){for(var d=La(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Hl(a,b,c)});return}}b.call(a,c)}
|
||||
function El(a,b,c){x.call(this,"Computer",a,El);this.Nb=!1;this.cg=a.buswidth;this.Cc=Fl;this.yg=null;this.ph=!1;this.url=b?b.url:null;this.op=(Math.random()+0.1).toString(36).substr(2,12);this.Pc=Gl(this);if(this.S=Na("CPU",this.id)){this.X=Na("Debugger",this.id);this.na=new Va({id:this.th+".bus",buswidth:this.cg},this.S,this.X);var d,e=La(this.id);if((this.sg=Na("Panel",this.id))&&this.sg.Uf)for(b=0;b<e.length;b++)d=e[b],d.Ga=this.sg.Ga,d.ca=this.sg.ca,d.Uf=this.sg.Uf;this.ca("PREFETCH: false, TYPEDARRAYS: false");
|
||||
for(b=0;b<e.length;b++)d=e[b],d.pc&&d.pc(this,this.na,this.S,this.X);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.Ph=d:this.Cc=parseInt(d,10));var f;if(a=Fa&&Fa.state||(f=!0,a.state))b=this.gm=a,f||(this.ph=!0,this.Cc=Fl),this.Cc&&(this.Sh=new H(this,"1.15.5"),this.Sh.load()?b=null:delete this.Sh);!b&&this.Cc&&(f=null,this.Pc&&(f=sa()+"/api/v1/user?req=load&user="+this.Pc+"&state="+Al(this,"1.15.5")),b=f)&&(this.ph=!0);b?ra(b,!0,null,this,this.lo):this.Ta();c||Hl(this,this.Ih)}else w("Unable to find CPU component")}
|
||||
y(x,El);var Ck=102,Fl=0;k=El.prototype;k.gf=function(){return this.op};k.ge=function(){return this.Pc?this.Pc:""};k.lo=function(a,b,c){c?(this.Ph=null,this.ph=!1,this.Ga("Unable to load machine state from server (error "+c+(b?": "+ja(b):"")+")")):this.yg=b;this.Ta()};function Hl(a,b,c){for(var d=La(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Hl(a,b,c)});return}}b.call(a,c)}
|
||||
function Il(a,b){var c=new H(a,"1.15.5","validate");if(c.load()&&c.parse()){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.Ga("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
|
||||
k.Gh=function(a){void 0===a&&(a=this.yg?1:this.Cc);var b=!1,c=!1;this.zk=!1;var d=this.Qh||new H(this,"1.15.5");if(-1==a)b=!0;else if(a>Fl){if(d.load(this.yg)){this.uf=new H(this,"1.15.5","failsafe");this.uf.load()&&(Jl(this,d),a=2);this.uf.set("timestamp",pa());Dl(this.uf);var e=this.Cc&&!this.ph;if(1==a||ta("Click OK to restore previous PCjs machine state.")){if(c=d.parse()){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==f&&"no machine state"!=g?(this.Ga("Error: "+g),"unable to verify user"==
|
||||
g&&(ua(""),this.Pc=null)):this.ca(f+": "+g),Bl(d),d.load()?(c=d.parse(),e=!0):c=!1))}e&&Il(this,c?d:null)}else 2==a&&d.clear()}else Il(this);delete this.yg;delete this.Qh}e=La(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.S&&(c=Kl(this,g,d,b,c));b=[d,a,c];-1!=a?Hl(this,this.Ul,b):this.Ul(b)};
|
||||
function Kl(a,b,c,d,e){if(!b.Nb){b.Nb=!0;if(b.$b){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.$b(f,d)&&f&&(w("Unable to restore state for "+b.type),a.dm&&!a.yg?(c.clear(),a.Cc=Fl,window&&window.location.reload()):a.zk=!0,b.$b(null),e=!1)}if(!d&&b.sk)for(a=b.sk.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.Ul=function(a){var b=a[0],c=0>a[1];a=a[2];this.Nb=!0;this.xk||(this.ca("PCjs v1.15.5\nCopyright \u00a9 2012-2014 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>"),this.xk=!0);this.S&&Kl(this,this.S,b,c,a);this.zk&&(Jl(this,b),b.clear());!c&&this.uf&&(this.uf.clear(),delete this.uf)};
|
||||
k.Ih=function(a){void 0===a&&(a=this.yg?1:this.Cc);var b=!1,c=!1;this.Ck=!1;var d=this.Sh||new H(this,"1.15.5");if(-1==a)b=!0;else if(a>Fl){if(d.load(this.yg)){this.uf=new H(this,"1.15.5","failsafe");this.uf.load()&&(Jl(this,d),a=2);this.uf.set("timestamp",pa());Dl(this.uf);var e=this.Cc&&!this.ph;if(1==a||ta("Click OK to restore previous PCjs machine state.")){if(c=d.parse()){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==f&&"no machine state"!=g?(this.Ga("Error: "+g),"unable to verify user"==
|
||||
g&&(ua(""),this.Pc=null)):this.ca(f+": "+g),Bl(d),d.load()?(c=d.parse(),e=!0):c=!1))}e&&Il(this,c?d:null)}else 2==a&&d.clear()}else Il(this);delete this.yg;delete this.Sh}e=La(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.S&&(c=Kl(this,g,d,b,c));b=[d,a,c];-1!=a?Hl(this,this.Xl,b):this.Xl(b)};
|
||||
function Kl(a,b,c,d,e){if(!b.Nb){b.Nb=!0;if(b.ac){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ac(f,d)&&f&&(w("Unable to restore state for "+b.type),a.gm&&!a.yg?(c.clear(),a.Cc=Fl,window&&window.location.reload()):a.Ck=!0,b.ac(null),e=!1)}if(!d&&b.vk)for(a=b.vk.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.Xl=function(a){var b=a[0],c=0>a[1];a=a[2];this.Nb=!0;this.Ak||(this.ca("PCjs v1.15.5\nCopyright \u00a9 2012-2014 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>"),this.Ak=!0);this.S&&Kl(this,this.S,b,c,a);this.Ck&&(Jl(this,b),b.clear());!c&&this.uf&&(this.uf.clear(),delete this.uf)};
|
||||
function Jl(a,b){if(ta("There may be a problem with PCjs.\nClick OK to send your PCjs machine state to http://www.pcjs.org.")){var c=a.ge(),d=b.toString(),e={app:"PCjs",ver:"1.15.5"};e.url=a.url;e.user=c;e.type="bug";e.data=d;ra("http://www.pcjs.org/api/v1/report",!0,e)}}
|
||||
function zl(a,b,c){var d,e="none",f=new H(a,"1.15.5"),g=new H(a,"1.15.5","validate"),h=pa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.15.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.S&&a.S.Wb&&(c&&a.S.Ab(),d=a.S.Wb(b,c),"object"===typeof d&&f.set(a.S.id,d),c&&(a.S.Nb=!1,!1===d&&(e=null)));for(var h=La(a.id),m=0;m<h.length;m++){var n=h[m];n.Nb&&(n.Wb&&(d=n.Wb(b,c),"object"===typeof d&&f.set(n.id,d)),c&&(n.Nb=!1,!1===d&&
|
||||
(e=null)))}e&&(c?(h=d=!1,b?(a.Pc&&Ll(a,a.Pc,f.toString()),Dl(g)&&Dl(f)||(e=null,d=h=!0)):a.Cc&&(d=!0,h=3==a.Cc),d&&f.clear(h)):e=f.toString());c&&(a.Nb=!1);return e}k.reset=function(){this.na&&this.na.reset&&(this.Qa("Resetting "+this.na.type,!0),this.na.reset());for(var a=La(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.na&&c.reset&&(this.Qa("Resetting "+c.type,!0),c.reset())}};
|
||||
k.start=function(a,b){for(var c=La(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};k.stop=function(a,b){for(var c=La(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||
k.xb=function(a,b,c,d){var e=this;switch(c){case "save":return this.sa[c]=d,d.onclick=function(){var a=Gl(e,!0);if(a){var b=!(!e.Cc||e.Nh),c=zl(e,b);b?Ll(e,a,c):e.Ga("Resume disabled, machine state not saved")}},!0;case "reset":return this.sa[c]=d,d.onclick=function(){Gb(e)},!0}return!1};
|
||||
k.xb=function(a,b,c,d){var e=this;switch(c){case "save":return this.sa[c]=d,d.onclick=function(){var a=Gl(e,!0);if(a){var b=!(!e.Cc||e.Ph),c=zl(e,b);b?Ll(e,a,c):e.Ga("Resume disabled, machine state not saved")}},!0;case "reset":return this.sa[c]=d,d.onclick=function(){Gb(e)},!0}return!1};
|
||||
function Gl(a,b){var c=a.Pc;if(!c){var d;if(window)try{d=window.localStorage.getItem("user")}catch(e){}c=d;void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("To save machine states on the pcjs.org server, you need a user ID (email Jeff@pcjs.org).\n\nOnce you have an ID, enter it below.","")),c&&((c=Ml(a,c))||a.Ga("Your user ID has not been approved."))):b&&a.Ga("Browser local storage is not available")}return c}
|
||||
function Ml(a,b){a.Pc=null;var c=ra(sa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(ua(c.data),a.Pc=c.data)}catch(e){w(e.message+" ("+d+")")}return a.Pc}
|
||||
function Ll(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Al(a,"1.15.5");d.data=c;b=ra(sa()+"/api/v1/user",!1,d);d=b[1];if(b[0]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[0]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Ga("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.Ga(c),ua(""),a.Pc=null)}}
|
||||
function Gb(a){if(a.Cc&&!a.Nh){var b=1==a.Cc||!ta("Click OK to reset the PCjs machine state.\n(WARNING: All disk changes will be discarded)");zl(a,b,!0);!b&&a.dm?window&&window.location.reload():(b||(a.Ci=!0),a.Gh(Fl),a.Ci=!1)}else a.reset(),a.S&&Cb(a.S)}function C(a,b,c){a=La(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}k.Qa=function(a,b){this.X&&(b||E(this.X,this.X.mm))&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=B(c,"pcjs","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new El(g,d,!0);Oa(g,f);Hl(g,g.Gh)}});ya.show.push(function(){for(var a=B(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Na("Computer",c.id))&&c.xk&&!c.Nb&&c.Gh(-1)}});
|
||||
ya.exit.push(function(){for(var a=B(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Na("Computer",c.id))&&c.Nb&&zl(c,!(!c.Cc||c.Nh),!0)}});function Nl(a,b,c,d){var e=ra(a);if(e[0])throw Error(e[1]);return Ol(e[1],a,b,c,d)}
|
||||
function Gb(a){if(a.Cc&&!a.Ph){var b=1==a.Cc||!ta("Click OK to reset the PCjs machine state.\n(WARNING: All disk changes will be discarded)");zl(a,b,!0);!b&&a.gm?window&&window.location.reload():(b||(a.Ei=!0),a.Ih(Fl),a.Ei=!1)}else a.reset(),a.S&&Cb(a.S)}function C(a,b,c){a=La(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}k.Qa=function(a,b){this.X&&(b||E(this.X,this.X.pm))&&this.X.message(a)};
|
||||
Ba(function(){for(var a=B(window.document,"pcjs-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=B(c,"pcjs","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new El(g,d,!0);Oa(g,f);Hl(g,g.Ih)}});ya.show.push(function(){for(var a=B(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Na("Computer",c.id))&&c.Ak&&!c.Nb&&c.Ih(-1)}});
|
||||
ya.exit.push(function(){for(var a=B(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Na("Computer",c.id))&&c.Nb&&zl(c,!(!c.Cc||c.Ph),!0)}});function Nl(a,b,c,d){var e=ra(a);if(e[0])throw Error(e[1]);return Ol(e[1],a,b,c,d)}
|
||||
function Ol(a,b,c,d,e){var f=null;if(a){if(e)for(var g=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g;f=g.exec(a);){var h=f[2],m=ra(h),n=m[1];if(m[0]||!n)throw c="unable to resolve XML reference: "+f[0]+" ("+m[0]+")",Error(c);if(m=f[3]){var q=n.match(new RegExp("<"+f[1]+"[^>]*>"));if(q){for(var h=q[0],t,s=/( [a-z]+=)(['"])(.*?)\2/g;t=s.exec(m);)h=0>h.indexOf(t[1])?h.replace(">",t[0]+">"):h.replace(new RegExp(t[1]+"(['\"])(.*?)\\1"),t[0]);q[0]!=h&&(n=n.replace(q[0],h))}else throw c="missing <"+f[1]+"> in "+h,
|
||||
Error(c);}n=n.replace(/<\?xml[^>]*>[\r\n]*/,"");a=a.replace(f[0],n);g.lastIndex=0}c&&(b&&0>b.indexOf("/")&&(b=window.location.pathname+b),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" state=$2"+d+"$2":"")+(b?" url=$2"+b+"$2":"")));if(0===a.indexOf("<"))window.ActiveXObject||"ActiveXObject"in window?(e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*\]>\s*/g,"")),f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml");else throw Error("unrecognized XML: "+
|
||||
(255<a.length?a.substr(0,255)+"...":a));}return[a,f]}
|
||||
|
|
|
|||
|
|
@ -3,88 +3,88 @@ function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function h
|
|||
function t(a,b,c,d,e,f){b=!!b;var l=0,k=null,m=da(a),n=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");b&&(n.onreadystatechange=function(){4===n.readyState&&(n.onreadystatechange=void 0,k=n.responseText,200!=n.status&&(l=n.status||-1),d&&e&&e.call(d,m,k,l,f))});if(c){var q="",s;for(s in c)c.hasOwnProperty(s)&&(q&&(q+="&"),q+=s+"="+encodeURIComponent(c[s]));q=q.replace(/%20/g,"+");n.open("POST",a,b);n.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
||||
n.send(q)}else n.open("GET",a,b),n.send();a=[];b||(k=n.responseText,200!=n.status&&(l=n.status||-1),d&&e&&e.call(d,m,k,l,f),a=[l,k]);return a}function ka(){return"http://"+(window?window.location.host:"www.pcjs.org")}function u(a){window?window.alert(a):console.log(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}function ma(a){if(window)try{window.localStorage.setItem("user",a)}catch(b){}}
|
||||
function na(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)?!0:!1}return!1}var oa={init:[],show:[],exit:[]},pa=!0;function qa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function v(a){oa.init.push(a)}function ra(a){if(pa)for(var b=0;b<a.length;b++)a[b]()}qa("onload",function(){ra(oa.init)});qa("onpageshow",function(){ra(oa.show)});
|
||||
qa(na("Opera")||na("iOS")?"onunload":"onbeforeunload",function(){ra(oa.exit)});function w(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;this.ij=b.comment;this.yn=b;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.og=this.id.substr(0,b),this.Fh=this.id.substr(b+1)):this.Fh=this.id;this[a]=c;this.Ah=null;this.Yc=this.zb=this.Ec=this.qh=this.jg=!1;this.oa={};this.Na=null;this.og&&this.og.match(/\d+/);x[x.length]=this}var ta=void 0,ua={};
|
||||
qa(na("Opera")||na("iOS")?"onunload":"onbeforeunload",function(){ra(oa.exit)});function w(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;this.lj=b.comment;this.Bn=b;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.og=this.id.substr(0,b),this.Hh=this.id.substr(b+1)):this.Hh=this.id;this[a]=c;this.Ch=null;this.Yc=this.Ab=this.Ec=this.sh=this.jg=!1;this.oa={};this.Na=null;this.og&&this.og.match(/\d+/);x[x.length]=this}var ta=void 0,ua={};
|
||||
if(window){ta||(ta=window.location.search.substr(1));for(var va,wa=/\+/g,xa=/([^&=]+)=?([^&]*)/g;va=xa.exec(ta);)ua[decodeURIComponent(va[1].replace(wa," "))]=decodeURIComponent(va[2].replace(wa," "))}function ya(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function z(a,b){b.prototype=ya(a.prototype)}var x=[];
|
||||
function za(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<x.length;b++){var d=x[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Aa(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1)+a);for(c=0;c<x.length;c++)if(x[c].id===a)return x[c]}return null}
|
||||
function Ba(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<x.length;d++)if(c)c==x[d]&&(c=null);else if(!(a!=x[d].type||b&&x[d].id.indexOf(b)))return x[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("({"+a+"})")}catch(c){u(c.message+" ("+a+")")}return b}
|
||||
function B(a,b){var c,d;d=C(b.parentNode,"pcjs-control");for(c=0;c<d.length;c++){var e,f;f=d[c].childNodes;for(e=0;e<f.length;e++){var l=f[e];if(l.nodeType===window.document.ELEMENT_NODE){var k=l.getAttribute("class");if(k){var m,n;n=k.split(" ");for(m=0;m<n.length;m++)switch(k=n[m],k){case "pcjs-input":case "pcjs-output":(n=A(l))&&n.binding&&a.ub(k,n.type,n.binding,l),n=[]}}}}}}
|
||||
function B(a,b){var c,d;d=C(b.parentNode,"pcjs-control");for(c=0;c<d.length;c++){var e,f;f=d[c].childNodes;for(e=0;e<f.length;e++){var l=f[e];if(l.nodeType===window.document.ELEMENT_NODE){var k=l.getAttribute("class");if(k){var m,n;n=k.split(" ");for(m=0;m<n.length;m++)switch(k=n[m],k){case "pcjs-input":case "pcjs-output":(n=A(l))&&n.binding&&a.vb(k,n.type,n.binding,l),n=[]}}}}}}
|
||||
function C(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}
|
||||
w.prototype={toString:function(){return this.name?this.name:this.id||this.type},ub:function(a,b,c,d){switch(c){case "clear":return this.oa[c]||(this.oa[c]=d,d.onclick=function(a){return function(){a.oa.print&&(a.oa.print.value="")}}(this)),!0;case "print":return this.oa[c]||(this.ih=this.oa[c]=d,d.value="",this.Tb=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}}(d),this.xa=
|
||||
function(a,b,c){this.Tb(a,"notice",c)}),!0;default:return!1}},log:function(){},Tb:function(){},status:function(a){this.Tb(this.Fh+": "+a)},xa:function(a,b){b||u(a)},Pa:function(a){!this.Yc&&(this.jg=!1!==a)&&(this.name&&this.log("ready"),a=this.Ah,this.Ah=null,a&&a())},Sb:function(){return this.zb=!0},Jb:function(a,b){b&&(this.zb=!1);return!0}};function Ca(a,b){if(a.qh)return a.Ec&&(a.Ec=!1),a.qh=!1;if(a.Yc)return a.Tb(a.toString()+" error"),!1;a.Ec=b;return a.Ec}
|
||||
function Da(a,b){b&&(a.jg?b():a.Ah=b);return a.jg}function Ea(a,b){a.Yc=!0;a.xa("Fatal error: "+b)}window&&!window.document.ELEMENT_NODE&&(window.document.ELEMENT_NODE=1);function Fa(a){w.call(this,"Panel",a,Fa)}z(w,Fa);Fa.prototype.ub=function(a,b,c,d){return this.Fa&&this.Fa.ub(a,b,c,d)||this.ia&&this.ia.ub(a,b,c,d)||this.Qa&&this.Qa.ub(a,b,c,d)?!0:w.prototype.ub.call(this,a,b,c,d)};Fa.prototype.ic=function(a,b,c,d){this.Fa=a;this.ia=c;this.Na=d;this.Qa=D(a,"Keyboard")};
|
||||
Fa.prototype.Sb=function(a,b){b||Ga();return!0};Fa.prototype.Jb=function(){return!0};function Ga(){for(var a=!1,b=C(window.document,"pcjs","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Aa(e.id);f||(a=!0,f=new Fa(e));B(f,d);a&&f.Pa()}}v(Ga);
|
||||
function Ha(a,b,c){w.call(this,"Bus",a,Ha);this.ia=b;this.Na=c;this.hf=a.buswidth||20;this.Oe=this.wb=(1<<this.hf)-1;this.Ib=20>=this.hf?12:14;this.nc=1<<this.Ib;this.gj=this.nc>>2;this.eb=this.nc-1;this.Zf=(this.Oe+this.nc)/this.nc|0;this.Pd=this.Zf-1;this.Mf=[];this.Nf=[];this.Hh();this.Pa()}z(w,Ha);Ha.prototype.Hh=function(){this.ya=Array(this.Zf);for(var a=0;a<this.Zf;a++)this.ya[a]=new Ia(a*this.nc);this.ia.Hh(this.ya,this.Oe,this.Ib,this.eb,this.Pd);this.ia.wb=this.wb};
|
||||
Ha.prototype.reset=function(){Ja(this,!0)};function Ka(a,b,c,d,e){if(!(b&a.eb||!c||c&a.eb)){for(var f=b>>a.Ib;0<c&&f<a.ya.length;){var l=a.ya[f];if(void 0!==l&&l.size)return La(1,b,c);b=f*a.nc;a.ya[f++]=new Ia(b,a.nc,d,e);c-=a.nc}return!0}return La(2,b,c)}function Ja(a,b){if(void 0!==b&&20<a.hf){var c=a.wb&-1048577|(b?1048576:0);c!=a.wb&&(a.wb=c,a.ia&&(a.ia.wb=c))}}
|
||||
Ha.prototype.Mg=function(a,b,c){if(!(a&this.eb||!b||b&this.eb)){for(var d=a>>this.Ib;0<b;){var e=this.ya[d];if(!e.ea)return La(5,a,b);e.fe(c);b-=this.nc;d++}return!0}return La(3,a,b)};function Ma(a,b,c){if(!(b&a.eb||!c||c&a.eb)){for(var d=b>>a.Ib;0<c;)b=d*a.nc,a.ya[d++]=new Ia(b),c-=a.nc;return!0}return La(4,b,c)}function Na(a,b){return a.ya[(b&a.wb)>>a.Ib].Ki(b&a.eb)}function Oa(a,b){var c=b&a.eb,d=(b&a.wb)>>a.Ib;return c!=a.eb?a.ya[d].Bn(c):a.ya[d++].Ki(c)|a.ya[d&a.Pd].Ki(0)<<8}
|
||||
function Pa(a,b,c){a.ya[(b&a.wb)>>a.Ib].Si(b&a.eb,c&255)}function Qa(a,b,c){var d=b&a.eb;b=(b&a.wb)>>a.Ib;d!=a.eb?a.ya[b].Ln(d,c&65535):(a.ya[b++].Si(d,c&255),a.ya[b&a.Pd].Si(0,c>>8&255))}function Sa(a){for(var b=0,c=[],d=0;d<a.Zf;d++){var e=a.ya[d];if(e.Xa||e.lj){c[b++]=d;var f=c,l=b++;a:if(e=e.save()){for(var k=0,m=0,n=[];k<e.length;){for(var q=e[k],s=k+1;s<e.length&&e[s]===q;)s++;n[m++]=s-k;n[m++]=q;k=s}if(n.length<e.length){e=n;break a}}f[l]=e}}c[b]=a.Oe==a.wb;return c}
|
||||
w.prototype={toString:function(){return this.name?this.name:this.id||this.type},vb:function(a,b,c,d){switch(c){case "clear":return this.oa[c]||(this.oa[c]=d,d.onclick=function(a){return function(){a.oa.print&&(a.oa.print.value="")}}(this)),!0;case "print":return this.oa[c]||(this.kh=this.oa[c]=d,d.value="",this.Vb=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}}(d),this.xa=
|
||||
function(a,b,c){this.Vb(a,"notice",c)}),!0;default:return!1}},log:function(){},Vb:function(){},status:function(a){this.Vb(this.Hh+": "+a)},xa:function(a,b){b||u(a)},Pa:function(a){!this.Yc&&(this.jg=!1!==a)&&(this.name&&this.log("ready"),a=this.Ch,this.Ch=null,a&&a())},Ub:function(){return this.Ab=!0},Kb:function(a,b){b&&(this.Ab=!1);return!0}};function Ca(a,b){if(a.sh)return a.Ec&&(a.Ec=!1),a.sh=!1;if(a.Yc)return a.Vb(a.toString()+" error"),!1;a.Ec=b;return a.Ec}
|
||||
function Da(a,b){b&&(a.jg?b():a.Ch=b);return a.jg}function Ea(a,b){a.Yc=!0;a.xa("Fatal error: "+b)}window&&!window.document.ELEMENT_NODE&&(window.document.ELEMENT_NODE=1);function Fa(a){w.call(this,"Panel",a,Fa)}z(w,Fa);Fa.prototype.vb=function(a,b,c,d){return this.Fa&&this.Fa.vb(a,b,c,d)||this.ia&&this.ia.vb(a,b,c,d)||this.Qa&&this.Qa.vb(a,b,c,d)?!0:w.prototype.vb.call(this,a,b,c,d)};Fa.prototype.ic=function(a,b,c,d){this.Fa=a;this.ia=c;this.Na=d;this.Qa=D(a,"Keyboard")};
|
||||
Fa.prototype.Ub=function(a,b){b||Ga();return!0};Fa.prototype.Kb=function(){return!0};function Ga(){for(var a=!1,b=C(window.document,"pcjs","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Aa(e.id);f||(a=!0,f=new Fa(e));B(f,d);a&&f.Pa()}}v(Ga);
|
||||
function Ha(a,b,c){w.call(this,"Bus",a,Ha);this.ia=b;this.Na=c;this.hf=a.buswidth||20;this.Oe=this.xb=(1<<this.hf)-1;this.Ib=20>=this.hf?12:14;this.nc=1<<this.Ib;this.jj=this.nc>>2;this.eb=this.nc-1;this.Zf=(this.Oe+this.nc)/this.nc|0;this.Pd=this.Zf-1;this.Mf=[];this.Nf=[];this.Jh();this.Pa()}z(w,Ha);Ha.prototype.Jh=function(){this.ya=Array(this.Zf);for(var a=0;a<this.Zf;a++)this.ya[a]=new Ia(a*this.nc);this.ia.Jh(this.ya,this.Oe,this.Ib,this.eb,this.Pd);this.ia.xb=this.xb};
|
||||
Ha.prototype.reset=function(){Ja(this,!0)};function Ka(a,b,c,d,e){if(!(b&a.eb||!c||c&a.eb)){for(var f=b>>a.Ib;0<c&&f<a.ya.length;){var l=a.ya[f];if(void 0!==l&&l.size)return La(1,b,c);b=f*a.nc;a.ya[f++]=new Ia(b,a.nc,d,e);c-=a.nc}return!0}return La(2,b,c)}function Ja(a,b){if(void 0!==b&&20<a.hf){var c=a.xb&-1048577|(b?1048576:0);c!=a.xb&&(a.xb=c,a.ia&&(a.ia.xb=c))}}
|
||||
Ha.prototype.Og=function(a,b,c){if(!(a&this.eb||!b||b&this.eb)){for(var d=a>>this.Ib;0<b;){var e=this.ya[d];if(!e.ea)return La(5,a,b);e.fe(c);b-=this.nc;d++}return!0}return La(3,a,b)};function Ma(a,b,c){if(!(b&a.eb||!c||c&a.eb)){for(var d=b>>a.Ib;0<c;)b=d*a.nc,a.ya[d++]=new Ia(b),c-=a.nc;return!0}return La(4,b,c)}function Na(a,b){return a.ya[(b&a.xb)>>a.Ib].Ni(b&a.eb)}function Oa(a,b){var c=b&a.eb,d=(b&a.xb)>>a.Ib;return c!=a.eb?a.ya[d].En(c):a.ya[d++].Ni(c)|a.ya[d&a.Pd].Ni(0)<<8}
|
||||
function Pa(a,b,c){a.ya[(b&a.xb)>>a.Ib].Vi(b&a.eb,c&255)}function Qa(a,b,c){var d=b&a.eb;b=(b&a.xb)>>a.Ib;d!=a.eb?a.ya[b].On(d,c&65535):(a.ya[b++].Vi(d,c&255),a.ya[b&a.Pd].Vi(0,c>>8&255))}function Sa(a){for(var b=0,c=[],d=0;d<a.Zf;d++){var e=a.ya[d];if(e.Xa||e.oj){c[b++]=d;var f=c,l=b++;a:if(e=e.save()){for(var k=0,m=0,n=[];k<e.length;){for(var q=e[k],s=k+1;s<e.length&&e[s]===q;)s++;n[m++]=s-k;n[m++]=q;k=s}if(n.length<e.length){e=n;break a}}f[l]=e}}c[b]=a.Oe==a.xb;return c}
|
||||
function Ta(a,b,c,d){void 0===d&&(d=0);for(var e in c){e=parseInt(e,10);var f=a,l=e+d,k=b,m=c[e];if(void 0!==m)for(var n=e+d;n<=l;n++)void 0!==f.Mf[n]?u("Input port "+p(n,4)+" registered by "+f.Mf[n][0].id+", ignoring "+k.id):f.Mf[n]=[k,m,!1,!1]}}function Ua(a,b,c){var d=255;a=a.Mf[b];void 0!==a&&a[1]&&(d=a[1].call(a[0],b,c));return d}
|
||||
function Va(a,b,c,d){void 0===d&&(d=0);for(var e in c){e=parseInt(e,10);var f=a,l=e+d,k=b,m=c[e];if(void 0!==m)for(var n=e+d;n<=l;n++)void 0!==f.Nf[n]?u("Output port "+p(n,4)+" registered by "+f.Nf[n][0].id+", ignoring "+k.id):f.Nf[n]=[k,m,!1,!1]}}function Wa(a,b,c,d){a=a.Nf[b];void 0!==a&&a[1]&&a[1].call(a[0],b,c,d)}function La(a,b,c){u("Memory block error ("+a+","+p(b)+","+p(c)+")");return!1}
|
||||
function Ia(a,b,c,d){this.cl=b;this.la=null;this.offset=0;this.nj=c;this.ea=null;this.Xa=this.lj=!1;if(b)if(d)this.ea=d,a=[d.Ld,a-d.ab],this.la=a[0],this.offset=a[1],this.fe(d.Qe);else{this.la=Array(b>>2);for(d=0;d<this.la.length;d++)this.la[d]=0;this.fe(Xa)}else this.fe()}
|
||||
Ia.prototype={Eg:function(){return 0},Pg:function(){},zn:function(a){return this.la[a>>2]>>>((a&3)<<3)&255},Cn:function(a){var b=a>>2;a=(a&3)<<3;var c=this.la[b]>>>a;return 24>a?c&65535:c&255|(this.la[b+1]&255)<<8},Jn:function(a,b){var c=a>>2,d=(a&3)<<3;this.la[c]=this.la[c]&~(255<<d)|b<<d;this.Xa=!0},Mn:function(a,b){var c=a>>2,d=(a&3)<<3;24>d?this.la[c]=this.la[c]&~(65535<<d)|b<<d:(this.la[c]=this.la[c]&16777215|b<<24,c++,this.la[c]=this.la[c]&4294967040|b>>8);this.Xa=!0},save:function(){return this.ea?
|
||||
null:this.la},restore:function(a){return this.ea?null===a:this.cl==a.length<<2?(this.la=a,this.Xa=!0):!1},fe:function(a,b){a||(a=[]);void 0===b&&(b=!0);var c=a;this.vc=c[0]?c[0]:this.Eg;this.An=c[1]?c[1]:this.Eg;b&&(this.Ki=c[0]?c[0]:this.Eg,this.Bn=c[1]?c[1]:this.Eg);c=a;this.xc=c[2]&&!this.nj?c[2]:this.Pg;this.Kn=c[3]&&!this.nj?c[3]:this.Pg;b&&(this.Si=c[2]?c[2]:this.Pg,this.Ln=c[3]?c[3]:this.Pg)}};var Xa=[Ia.prototype.zn,Ia.prototype.Cn,Ia.prototype.Jn,Ia.prototype.Mn];
|
||||
function Ya(a,b){w.call(this,"CPU",a,Ya);var c=a.multiplier||1;this.cd=a.cycles||b;this.yd=c;this.rg=Math.round(this.cd/1E4)/100;this.we=this.rg*this.yd;this.rc=this.zb=!1;this.ph=a.autoStart;c=ua.autostart;void 0!==c&&(this.ph="true"==c?!0:"false"==c?!1:null);this.gg=!1;this.wg=this.ye=0;this.xg=a.csStart;this.kf=a.csInterval;this.lf=a.csStop;var d=this;this.Dm=function(){Za(d)};this.Pa()}z(w,Ya);g=Ya.prototype;
|
||||
g.ic=function(a,b,c,d){this.ma=b;this.Na=d;this.Fa=a;var e=D(a,"Video");e&&(this.df=function(){$a(e)},this.Ee=function(){e.Ee()});this.ga=D(a,"ChipSet");this.Pa()};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.Sb=function(a,b){if(!b){if(a&&this.restore){ab(this);if(!this.restore(a))return!1;bb(this)}else this.reset();this.Tb("No debugger detected")}this.zb=!0;!cb(this)&&this.Na&&this.Na.to();this.df();this.cf();return!0};
|
||||
g.Jb=function(a){this.zb=!1;return a&&this.save?this.save():!0};function cb(a){return!0===a.ph||null===a.ph&&void 0===a.oa.run?(Za(a),!0):!1}g.Ee=function(){};g.sj=function(){return 0};function bb(a){void 0===a.xg&&(a.xg=0);void 0===a.kf&&(a.kf=-1);void 0===a.lf&&(a.lf=-1);a.gg=0<=a.xg&&0<a.kf;a.gg&&(a.wg=0,a.ye=a.xg-a.be)}function E(a,b,c,d){void 0!==a.oa[b]&&(void 0===d&&(d=4),void 0===c&&(Ea(a,"Register "+b+" is invalid"),db(a)),c=p(c,d),a.oa[b].innerHTML!=c&&(a.oa[b].innerHTML=c))}g.cf=function(){};
|
||||
g.df=function(){};g.ub=function(a,b,c,d){var e=this;a=!1;switch(c){case "run":this.oa[c]=d;d.onclick=function(){e.rc?db(e,!0):Za(e,!0)};a=!0;break;case "reset":this.oa[c]=d;d.onclick=function(){e.Fa&&eb(e.Fa)};a=!0;break;case "speed":this.oa[c]=d;a=!0;break;case "setSpeed":this.oa[c]=d,d.onclick=function(){fb(e,e.yd<<1,!0)},d.innerHTML=this.we.toFixed(2)+"Mhz",a=!0}return a};function hb(a,b,c){a.be+=b;c&&(a.Lc=a.A=0)}
|
||||
function ib(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.yd&&a.Kc&&(d=a.Kc/a.rg);a.yj=Math.round(1E3/30);a.wm=Math.floor(a.cd/c*d);a.Oh=Math.floor(a.cd/30*d);a.Cj=Math.floor(a.cd/60*d);a.Bj=Math.floor(a.cd/2*d);b||(a.of=a.Oh,a.nf=a.Cj,a.mf=a.Bj);a.Di=0}function jb(a,b){var c=a.be+a.Bd+a.Lc-a.A;b&&1<a.yd&&a.Kc>a.rg&&(c=Math.round(c/a.yd));return c}function ab(a){a.Kc=0;a.ug=1;a.be=a.Bd=a.Lc=a.A=0;bb(a);fb(a,1)}
|
||||
function fb(a,b,c){void 0!==b&&(0.8>a.Kc/a.we&&(b=1),a.yd=b,b=a.rg*a.yd,a.we!=b&&(a.we=b,b=a.we.toFixed(2)+"Mhz",a.oa.setSpeed&&(a.oa.setSpeed.innerHTML=b),a.Tb("target speed: "+b)),c&&a.Ee());hb(a,a.Bd);a.Bd=0;a.xe=ha();a.Zd=0;ib(a)}
|
||||
function Za(a,b){if(Ca(a,!0)){a.rc||(fb(a),a.Fa&&a.Fa.start(a.xe,jb(a)),a.rc=!0,a.ga&&kb(a.ga),a.oa.run&&(a.oa.run.innerHTML="Halt"),b&&a.Ee());a.Di>=a.cd&&ib(a,!0);a.pf=0;a.tg=ha();if(a.Zd){var c=a.tg-a.Zd;c>a.yj&&(a.xe+=c,a.xe>a.tg&&(a.xe=a.tg))}try{do{a.Tk(a.gg?1:Math.round(a.wm/a.ug));var d=a.Lc-a.A;a.Bd+=d;a.pf+=d;hb(a,0,!0);var c=a,e=d;if(c.gg){var f=!1;c.wg=c.wg+c.sj()|0;c.ye-=e;0>=c.ye&&(c.ye+=c.kf,f=!0);0<=c.lf&&c.lf<=jb(c)&&(c.kf=c.lf=-1,bb(c),db(c),f=!0);f&&c.Tb(jb(c)+" cycles: checksum="+
|
||||
p(c.wg))}a.nf-=d;0>=a.nf&&(a.nf+=a.Cj,a.df());a.mf-=d;0>=a.mf&&(a.mf+=a.Bj,a.cf());a.of-=d;if(0>=a.of){a.of+=a.Oh;break}}while(a.rc)}catch(l){db(a);a.df();a.cf();a.Fa&&a.Fa.stop(ha(),jb(a));Ca(a,!1);Ea(a,l.message);return}d=setTimeout;c=a.Dm;a.Zd=ha();e=a.yj;a.pf&&(e=Math.round(e*a.pf/a.Oh));e-=a.Zd-a.tg;if(f=a.Zd-a.xe)a.Kc=Math.round(a.Bd/(10*f))/100,864E5<=f&&(a.be=0,a.ga&&lb(a.ga,!0),fb(a));if(0>e||a.Kc<a.we)e=0;a.Di+=a.pf;a.Zd+=e;d(c,e)}else a.df(),a.cf(),a.Fa&&a.Fa.stop(ha(),jb(a))}
|
||||
function db(a,b){a.Ec&&(a.qh=!0);a.Lc-=a.A;a.A=0;hb(a,a.Bd);a.Bd=0;a.rc&&(a.rc=!1,a.ga&&kb(a.ga),a.oa.run&&(a.oa.run.innerHTML="Run"));a.hg=b}g.Tk=function(){return 0};
|
||||
function Ia(a,b,c,d){this.fl=b;this.la=null;this.offset=0;this.qj=c;this.ea=null;this.Xa=this.oj=!1;if(b)if(d)this.ea=d,a=[d.Ld,a-d.ab],this.la=a[0],this.offset=a[1],this.fe(d.Qe);else{this.la=Array(b>>2);for(d=0;d<this.la.length;d++)this.la[d]=0;this.fe(Xa)}else this.fe()}
|
||||
Ia.prototype={Gg:function(){return 0},Rg:function(){},Cn:function(a){return this.la[a>>2]>>>((a&3)<<3)&255},Fn:function(a){var b=a>>2;a=(a&3)<<3;var c=this.la[b]>>>a;return 24>a?c&65535:c&255|(this.la[b+1]&255)<<8},Mn:function(a,b){var c=a>>2,d=(a&3)<<3;this.la[c]=this.la[c]&~(255<<d)|b<<d;this.Xa=!0},Pn:function(a,b){var c=a>>2,d=(a&3)<<3;24>d?this.la[c]=this.la[c]&~(65535<<d)|b<<d:(this.la[c]=this.la[c]&16777215|b<<24,c++,this.la[c]=this.la[c]&4294967040|b>>8);this.Xa=!0},save:function(){return this.ea?
|
||||
null:this.la},restore:function(a){return this.ea?null===a:this.fl==a.length<<2?(this.la=a,this.Xa=!0):!1},fe:function(a,b){a||(a=[]);void 0===b&&(b=!0);var c=a;this.vc=c[0]?c[0]:this.Gg;this.Dn=c[1]?c[1]:this.Gg;b&&(this.Ni=c[0]?c[0]:this.Gg,this.En=c[1]?c[1]:this.Gg);c=a;this.xc=c[2]&&!this.qj?c[2]:this.Rg;this.Nn=c[3]&&!this.qj?c[3]:this.Rg;b&&(this.Vi=c[2]?c[2]:this.Rg,this.On=c[3]?c[3]:this.Rg)}};var Xa=[Ia.prototype.Cn,Ia.prototype.Fn,Ia.prototype.Mn,Ia.prototype.Pn];
|
||||
function Ya(a,b){w.call(this,"CPU",a,Ya);var c=a.multiplier||1;this.cd=a.cycles||b;this.yd=c;this.rg=Math.round(this.cd/1E4)/100;this.we=this.rg*this.yd;this.rc=this.Ab=!1;this.rh=a.autoStart;c=ua.autostart;void 0!==c&&(this.rh="true"==c?!0:"false"==c?!1:null);this.gg=!1;this.wg=this.ye=0;this.xg=a.csStart;this.kf=a.csInterval;this.lf=a.csStop;var d=this;this.Gm=function(){Za(d)};this.Pa()}z(w,Ya);g=Ya.prototype;
|
||||
g.ic=function(a,b,c,d){this.ma=b;this.Na=d;this.Fa=a;var e=D(a,"Video");e&&(this.df=function(){$a(e)},this.Ee=function(){e.Ee()});this.ga=D(a,"ChipSet");this.Pa()};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.Ub=function(a,b){if(!b){if(a&&this.restore){ab(this);if(!this.restore(a))return!1;bb(this)}else this.reset();this.Vb("No debugger detected")}this.Ab=!0;!cb(this)&&this.Na&&this.Na.wo();this.df();this.cf();return!0};
|
||||
g.Kb=function(a){this.Ab=!1;return a&&this.save?this.save():!0};function cb(a){return!0===a.rh||null===a.rh&&void 0===a.oa.run?(Za(a),!0):!1}g.Ee=function(){};g.vj=function(){return 0};function bb(a){void 0===a.xg&&(a.xg=0);void 0===a.kf&&(a.kf=-1);void 0===a.lf&&(a.lf=-1);a.gg=0<=a.xg&&0<a.kf;a.gg&&(a.wg=0,a.ye=a.xg-a.be)}function E(a,b,c,d){void 0!==a.oa[b]&&(void 0===d&&(d=4),void 0===c&&(Ea(a,"Register "+b+" is invalid"),db(a)),c=p(c,d),a.oa[b].innerHTML!=c&&(a.oa[b].innerHTML=c))}g.cf=function(){};
|
||||
g.df=function(){};g.vb=function(a,b,c,d){var e=this;a=!1;switch(c){case "run":this.oa[c]=d;d.onclick=function(){e.rc?db(e,!0):Za(e,!0)};a=!0;break;case "reset":this.oa[c]=d;d.onclick=function(){e.Fa&&eb(e.Fa)};a=!0;break;case "speed":this.oa[c]=d;a=!0;break;case "setSpeed":this.oa[c]=d,d.onclick=function(){fb(e,e.yd<<1,!0)},d.innerHTML=this.we.toFixed(2)+"Mhz",a=!0}return a};function hb(a,b,c){a.be+=b;c&&(a.Lc=a.A=0)}
|
||||
function ib(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.yd&&a.Kc&&(d=a.Kc/a.rg);a.Bj=Math.round(1E3/30);a.zm=Math.floor(a.cd/c*d);a.Qh=Math.floor(a.cd/30*d);a.Fj=Math.floor(a.cd/60*d);a.Ej=Math.floor(a.cd/2*d);b||(a.of=a.Qh,a.nf=a.Fj,a.mf=a.Ej);a.Gi=0}function jb(a,b){var c=a.be+a.Bd+a.Lc-a.A;b&&1<a.yd&&a.Kc>a.rg&&(c=Math.round(c/a.yd));return c}function ab(a){a.Kc=0;a.ug=1;a.be=a.Bd=a.Lc=a.A=0;bb(a);fb(a,1)}
|
||||
function fb(a,b,c){void 0!==b&&(0.8>a.Kc/a.we&&(b=1),a.yd=b,b=a.rg*a.yd,a.we!=b&&(a.we=b,b=a.we.toFixed(2)+"Mhz",a.oa.setSpeed&&(a.oa.setSpeed.innerHTML=b),a.Vb("target speed: "+b)),c&&a.Ee());hb(a,a.Bd);a.Bd=0;a.xe=ha();a.Zd=0;ib(a)}
|
||||
function Za(a,b){if(Ca(a,!0)){a.rc||(fb(a),a.Fa&&a.Fa.start(a.xe,jb(a)),a.rc=!0,a.ga&&kb(a.ga),a.oa.run&&(a.oa.run.innerHTML="Halt"),b&&a.Ee());a.Gi>=a.cd&&ib(a,!0);a.pf=0;a.tg=ha();if(a.Zd){var c=a.tg-a.Zd;c>a.Bj&&(a.xe+=c,a.xe>a.tg&&(a.xe=a.tg))}try{do{a.Wk(a.gg?1:Math.round(a.zm/a.ug));var d=a.Lc-a.A;a.Bd+=d;a.pf+=d;hb(a,0,!0);var c=a,e=d;if(c.gg){var f=!1;c.wg=c.wg+c.vj()|0;c.ye-=e;0>=c.ye&&(c.ye+=c.kf,f=!0);0<=c.lf&&c.lf<=jb(c)&&(c.kf=c.lf=-1,bb(c),db(c),f=!0);f&&c.Vb(jb(c)+" cycles: checksum="+
|
||||
p(c.wg))}a.nf-=d;0>=a.nf&&(a.nf+=a.Fj,a.df());a.mf-=d;0>=a.mf&&(a.mf+=a.Ej,a.cf());a.of-=d;if(0>=a.of){a.of+=a.Qh;break}}while(a.rc)}catch(l){db(a);a.df();a.cf();a.Fa&&a.Fa.stop(ha(),jb(a));Ca(a,!1);Ea(a,l.message);return}d=setTimeout;c=a.Gm;a.Zd=ha();e=a.Bj;a.pf&&(e=Math.round(e*a.pf/a.Qh));e-=a.Zd-a.tg;if(f=a.Zd-a.xe)a.Kc=Math.round(a.Bd/(10*f))/100,864E5<=f&&(a.be=0,a.ga&&lb(a.ga,!0),fb(a));if(0>e||a.Kc<a.we)e=0;a.Gi+=a.pf;a.Zd+=e;d(c,e)}else a.df(),a.cf(),a.Fa&&a.Fa.stop(ha(),jb(a))}
|
||||
function db(a,b){a.Ec&&(a.sh=!0);a.Lc-=a.A;a.A=0;hb(a,a.Bd);a.Bd=0;a.rc&&(a.rc=!1,a.ga&&kb(a.ga),a.oa.run&&(a.oa.run.innerHTML="Run"));a.hg=b}g.Wk=function(){return 0};
|
||||
var mb=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,
|
||||
0,0,1,1,0,1,0,0,1];function nb(a,b,c){this.ia=a;this.gb=this.ua=0;this.ad=65535;this.uc=this.lc=0;this.Jg=b;ob(this,c)}function pb(a){this.ua=a;this.ad=65535;return this.gb=a<<4}
|
||||
function qb(a){var b,c;a&4?(b=this.ia.De.gb,c=this.ia.De.ad):(b=this.ia.Rc,c=this.ia.Ne);b+=a&65528;if(b+7<=c){this.Ic=rb;this.Nb=tb;this.ia.A-=15;c=F(this.ia,b+0);var d=F(this.ia,b+4),e=F(this.ia,b+2)|(d&255)<<16;F(this.ia,b+6);b=d&7936;if(b&4096){2048==(b&2560)&&(this.Nb=ub);if(b&2048||!(b&512))this.Nb=vb;this.ua=a;this.ad=c;this.lc=d;this.uc=(d&24576)>>13;return this.gb=e}if(b&&768>=b)return this.ua=a,this.ad=c,this.lc=d,this.uc=(d&24576)>>13,this.gb=e}return-1}
|
||||
function wb(a){return this.gb+a}function xb(a){return this.gb+a}function rb(a,b,c){return a+b<=this.ad?this.gb+a:ub.call(this,0,0,c)}function ub(a,b,c){c||yb.call(this.ia,13,0);return-1}function tb(a,b,c){return a+b<=this.ad?this.gb+a:vb.call(this,0,0,c)}function vb(a,b,c){c||yb.call(this.ia,13,0);return-1}nb.prototype.save=function(){return[this.ua,this.gb,this.ad,this.lc,this.uc,this.Jg]};
|
||||
nb.prototype.restore=function(a){"number"==typeof a?this.load(a):(this.ua=a[0],this.gb=a[1],this.ad=a[2],this.lc=a[3],this.uc=a[4],this.Jg=a[5])};function ob(a,b){void 0===b&&(b=!!(a.ia.ed&1));b?(a.load=qb,a.Ic=rb,a.Nb=tb):(a.load=pb,a.Ic=wb,a.Nb=xb)}
|
||||
function zb(a){this.Ca=a.model||8088;var b=0;switch(this.Ca){default:case 8088:b=4772727;break;case 80286:b=6E6}Ya.call(this,a,b);this.Wi=61442;this.Kf=4;this.ze=255;this.Ei=4;this.Z=5;this.na=6;this.ba=7;this.ca=8;this.P=9;this.U=11;this.V=12;this.$d=4;this.Ej=60;this.Fj=83;this.Bb=3;this.fb=9;this.Qb=16;this.zg=1;this.Jj=19;this.Lj=28;this.Nj=16;this.Mj=21;this.Kj=37;this.Hj=2;this.Xh=9;this.Ij=5;this.Gj=33;this.Zh=10;this.Yh=8;this.tf=3;this.sf=15;this.ak=51;this.bk=1;this.ck=2;this.dk=4;this.$j=
|
||||
32;this.fk=this.$h=15;this.Cb=16;this.Db=4;this.hk=11;this.gk=18;this.ek=24;this.mb=4;this.ik=2;this.ai=16;this.jk=17;this.fi=18;this.kk=19;this.ei=5;this.gi=6;this.pk=2;this.ok=8;this.mk=9;this.ii=this.hi=this.lk=this.nk=10;this.Pj=80;this.Rj=144;this.Oj=86;this.Qj=154;this.Tj=101;this.Vj=165;this.Sj=107;this.Uj=171;this.rk=70;this.tk=113;this.qk=76;this.sk=124;this.Xj=80;this.Zj=128;this.Wj=86;this.Yj=134;this.vf=3;this.uf=16;this.ni=10;this.mi=8;this.uk=51;this.Rb=8;this.vk=17;this.wk=36;this.$b=
|
||||
11;this.xk=16;this.wf=10;this.sb=2;this.Uh=18;this.Vh=9-this.sb;this.Wh=17-this.sb;this.bi=12;this.ci=9-this.sb;this.di=13-this.sb;this.ji=18;this.ki=9-this.sb;this.li=17-this.sb;this.oi=15;this.pi=9-this.sb;this.qi=15-this.sb;this.ui=11;this.vi=9-this.sb;this.wi=10-this.sb;this.yk=8;this.Bk=12;this.zk=18;this.Ak=17;this.Ck=15;this.si=8;this.ri=20;this.ti=2;this.zi=3;this.xf=9;this.yi=5;this.xi=11;this.Bi=4;this.Ai=17;this.Dk=11;this.Ma=Ab.slice();80186<=this.Ca&&(this.ze=31,this.Ma[15]=G,this.Ma[96]=
|
||||
Bb,this.Ma[97]=Cb,this.Ma[98]=Db,this.Ma[99]=G,this.Ma[100]=G,this.Ma[101]=G,this.Ma[102]=G,this.Ma[103]=G,this.Ma[104]=Eb,this.Ma[105]=Fb,this.Ma[106]=Gb,this.Ma[107]=Hb,this.Ma[108]=Ib,this.Ma[109]=Jb,this.Ma[110]=Kb,this.Ma[111]=Lb,this.Ma[192]=Mb,this.Ma[193]=Nb,this.Ma[200]=Ob,this.Ma[201]=Pb,this.Ma[241]=Qb,Rb[7]=Sb,Tb[7]=Sb,80286<=this.Ca&&(this.Wi=2,this.Kf=0,this.Ma[15]=Ub,this.Ma[99]=Vb,this.Ma[84]=Wb,this.P=this.ca=this.ba=this.na=this.Z=this.Ei=0,this.V=this.U=1,this.$d=3,this.Ej=14,this.Fj=
|
||||
16,this.Bb=2,this.Qb=this.fb=7,this.zg=0,this.Jj=7,this.Lj=13,this.Nj=7,this.Mj=11,this.Kj=16,this.Hj=3,this.Xh=6,this.Ij=2,this.Gj=13,this.Yh=this.Zh=5,this.tf=2,this.sf=7,this.ak=23,this.bk=0,this.ck=1,this.dk=3,this.$j=17,this.$h=7,this.fk=11,this.Cb=7,this.Db=3,this.hk=7,this.gk=11,this.ek=15,this.mb=2,this.ik=3,this.ai=7,this.kk=this.fi=this.jk=8,this.gi=this.ei=4,this.pk=2,this.ok=3,this.mk=5,this.nk=2,this.lk=3,this.hi=5,this.ii=3,this.Pj=14,this.Rj=22,this.Oj=17,this.Qj=25,this.Tj=17,this.Vj=
|
||||
25,this.Sj=20,this.Uj=28,this.rk=13,this.tk=21,this.qk=16,this.sk=24,this.Xj=13,this.Zj=21,this.Wj=16,this.Yj=24,this.vf=2,this.uf=7,this.mi=this.ni=5,this.uk=19,this.vk=this.Rb=5,this.wk=17,this.$b=3,this.xk=5,this.wf=3,this.sb=0,this.Uh=8,this.Vh=5,this.Wh=9,this.ci=this.bi=5,this.di=4,this.ki=this.ji=5,this.li=4,this.oi=7,this.pi=5,this.qi=8,this.ui=3,this.vi=4,this.wi=3,this.Bk=this.yk=11,this.Ak=this.zk=15,this.Ck=7,this.si=5,this.ri=8,this.ti=0,this.zi=2,this.xf=6,this.yi=3,this.xi=6,this.Bi=
|
||||
3,this.Dk=this.Ai=5));this.Zk=[];this.Xi=[];this.Lc=this.eh=0;this.hg=!1;this.ya=[];this.Oe=this.wb=this.Ib=this.eb=this.Pd=0;this.S=this.ml;this.T=this.nl;this.N=this.om;this.O=this.pm;this.Q=this.Hn;this.R=this.In;Xb(this)}z(Ya,zb);g=zb.prototype;g.Hh=function(a,b,c,d,e){this.ya=a;this.Oe=this.wb=b;this.Ib=c;this.eb=d;this.Pd=e};g.reset=function(){this.rc&&db(this);Xb(this);ab(this);this.Yc=!1};
|
||||
function Xb(a){a.G=0;a.B=0;a.I=0;a.J=0;a.X=0;a.H=0;a.F=0;a.D=0;a.ed=65520;a.Sc=0;a.me=1023;a.qc={Fi:0,ua:0,lc:0,qg:-1};a.Ia=new nb(a,"CS");a.cc=new nb(a,"DS");a.Ub=new nb(a,"SS");a.ib=new nb(a,"ES");a.Rk=new nb(a,"ZERO");Yb(a,0,65535);80286<=a.Ca&&(a.Rc=a.Ne=0,a.De=new nb(a,"LDT",!0),a.Lg=new nb(a,"TSS",!0),a.tb=new nb(a,"VER",!0),Yb(a,65520,61440),a.Ia.gb=16711680);Zb(a,0);$b(a);a.Ya=0;a.nb=a.Bf=-1;a.Vf=0;a.da=a.Ba=-1;a.C=a.cc;a.M=a.Ub;a.Y=a.pa=0}
|
||||
g.sj=function(){var a=this.G+this.B+this.I+this.J+this.X+this.H+this.F+this.D|0;return a=a+this.qa+this.Ia.ua+this.cc.ua+this.Ub.ua+this.ib.ua+ac(this)|0};function bc(a,b){var c=a.Xi[b];null!=c&&(c(--a.eh),delete a.Xi[b])}function $b(a,b){void 0===b&&(b=!!(a.ed&1));cc=b?dc:ec;ob(a.Ia,b);ob(a.cc,b);ob(a.Ub,b);ob(a.ib,b)}
|
||||
g.save=function(){var a=new H(this);a.set(0,[this.G,this.B,this.I,this.J,this.X,this.H,this.F,this.D]);a.set(1,[this.qa,this.Ia.save(),this.cc.save(),this.Ub.save(),this.ib.save(),ac(this),null!=this.Rc?[this.ed,this.Rc,this.Ne,this.Sc,this.me,this.De.save(),this.Lg.save()]:null]);a.set(2,[this.C.Jg,this.M.Jg,this.Y,this.pa,this.Ya,this.da,this.Ba]);a.set(3,[this.ug,this.be,this.yd]);a.set(4,Sa(this.ma));return a.data()};
|
||||
g.restore=function(a){var b;b=a[0];this.G=b[0];this.B=b[1];this.I=b[2];this.J=b[3];this.X=b[4];this.H=b[5];this.F=b[6];this.D=b[7];b=a[1];this.Ia.restore(b[1]);this.cc.restore(b[2]);this.Ub.restore(b[3]);this.ib.restore(b[4]);Zb(this,b[5]);var c=b[6];c&&c.length&&(this.ed=c[0],this.Rc=c[1],this.Ne=c[2],this.Sc=c[3],this.me=c[4],this.De.restore(c[5]),this.Lg.restore(c[6]),$b(this));I(this,b[0]);b=a[2];this.C=fc(this,b[0]);this.M=fc(this,b[1]);this.Y=b[2];this.pa=b[3];this.Ya=b[4];this.da=b[5];this.Ba=
|
||||
b[6];b=a[3];this.ug=b[0];this.be=b[1];fb(this,b[2]);a:{b=this.ma;a=a[4];for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.gj){for(var f=0,l=Array(b.gj),k=0;k<e.length-1;)for(var m=e[k++],n=e[k++];m--;)l[f++]=n;e=l}f=b.ya[d];if(!f||!f.restore(e)){u("Unable to restore memory block "+d);b=!1;break a}}void 0!==a[c]&&Ja(b,a[c]);b=!0}return b};
|
||||
function fc(a,b){switch(b){case "CS":return a.Ia;case "DS":return a.cc;case "SS":return a.Ub;case "ES":return a.ib;case "ZERO":return a.Rk;default:return[0,b,0,0,""]}}function gc(a,b){var c;if(a.ed&1){if(c=a.Sc+(b<<3),c+7<=a.me){a.qc.Fi=F(a,c);a.qc.ua=F(a,c+2);a.qc.lc=F(a,c+4);switch(a.qc.lc&7936){case 1536:a.qc.qg=-17153;break;case 1792:a.qc.qg=-16641;break;default:return!1}return!0}}else if(c=a.Sc+(b<<2),c+7<=a.me)return a.qc.Fi=F(a,c),a.qc.ua=F(a,c+2),a.qc.qg=-769,!0;return!1}
|
||||
function hc(a,b){a.Da=a.Ia.load(b)+a.qa;a.Y|=a.Kf}function ic(a,b){a.cc.load(b);a.Y|=a.Kf}function jc(a,b){a.Ub.load(b);a.Y|=4}function kc(a,b){a.ib.load(b);a.Y|=a.Kf}function I(a,b){a.Da=a.Ia.gb+(a.qa=b&65535)}function Yb(a,b,c){a.Da=a.Ia.load(c)+(a.qa=b)}function J(a,b){a.Da=a.Ia.gb+(a.qa=a.qa+b&65535)}function oc(a){return a.W&a.$?1:0}function pc(a){return mb[a.fa&255]?4:0}function qc(a){return(a.fa^a.ha)&16?16:0}function rc(a){return a.W&a.$-1?0:64}function sc(a){return a.fa&a.$>>1?128:0}
|
||||
0,0,1,1,0,1,0,0,1];function nb(a,b,c){this.ia=a;this.hb=this.ua=0;this.ad=65535;this.uc=this.lc=0;this.Lg=b;ob(this,c)}function pb(a){this.ua=a;this.ad=65535;return this.hb=a<<4}
|
||||
function qb(a){var b,c;a&4?(b=this.ia.De.hb,c=this.ia.De.ad):(b=this.ia.Rc,c=this.ia.Ne);b+=a&65528;if(b+7<=c){this.Ic=rb;this.Ob=tb;this.ia.A-=15;c=F(this.ia,b+0);var d=F(this.ia,b+4),e=F(this.ia,b+2)|(d&255)<<16;F(this.ia,b+6);b=d&7936;if(b&4096){2048==(b&2560)&&(this.Ob=ub);if(b&2048||!(b&512))this.Ob=vb;this.ua=a;this.ad=c;this.lc=d;this.uc=(d&24576)>>13;return this.hb=e}if(b&&768>=b)return this.ua=a,this.ad=c,this.lc=d,this.uc=(d&24576)>>13,this.hb=e}return-1}
|
||||
function wb(a){return this.hb+a}function xb(a){return this.hb+a}function rb(a,b,c){return a+b<=this.ad?this.hb+a:ub.call(this,0,0,c)}function ub(a,b,c){c||yb.call(this.ia,13,0);return-1}function tb(a,b,c){return a+b<=this.ad?this.hb+a:vb.call(this,0,0,c)}function vb(a,b,c){c||yb.call(this.ia,13,0);return-1}nb.prototype.save=function(){return[this.ua,this.hb,this.ad,this.lc,this.uc,this.Lg]};
|
||||
nb.prototype.restore=function(a){"number"==typeof a?this.load(a):(this.ua=a[0],this.hb=a[1],this.ad=a[2],this.lc=a[3],this.uc=a[4],this.Lg=a[5])};function ob(a,b){void 0===b&&(b=!!(a.ia.ed&1));b?(a.load=qb,a.Ic=rb,a.Ob=tb):(a.load=pb,a.Ic=wb,a.Ob=xb)}
|
||||
function zb(a){this.Ca=a.model||8088;var b=0;switch(this.Ca){default:case 8088:b=4772727;break;case 80286:b=6E6}Ya.call(this,a,b);this.Zi=61442;this.Kf=4;this.ze=255;this.Hi=4;this.Z=5;this.na=6;this.ba=7;this.ca=8;this.P=9;this.U=11;this.V=12;this.$d=4;this.Hj=60;this.Ij=83;this.Cb=3;this.fb=9;this.Rb=16;this.Bg=1;this.Mj=19;this.Oj=28;this.Qj=16;this.Pj=21;this.Nj=37;this.Kj=2;this.$h=9;this.Lj=5;this.Jj=33;this.bi=10;this.ai=8;this.tf=3;this.sf=15;this.dk=51;this.ek=1;this.fk=2;this.gk=4;this.ck=
|
||||
32;this.ik=this.ci=15;this.Db=16;this.Eb=4;this.kk=11;this.jk=18;this.hk=24;this.nb=4;this.lk=2;this.di=16;this.mk=17;this.ii=18;this.nk=19;this.hi=5;this.ji=6;this.sk=2;this.rk=8;this.pk=9;this.li=this.ki=this.ok=this.qk=10;this.Sj=80;this.Uj=144;this.Rj=86;this.Tj=154;this.Wj=101;this.Yj=165;this.Vj=107;this.Xj=171;this.uk=70;this.wk=113;this.tk=76;this.vk=124;this.$j=80;this.bk=128;this.Zj=86;this.ak=134;this.vf=3;this.uf=16;this.qi=10;this.pi=8;this.xk=51;this.Sb=8;this.yk=17;this.zk=36;this.ac=
|
||||
11;this.Ak=16;this.wf=10;this.tb=2;this.Xh=18;this.Yh=9-this.tb;this.Zh=17-this.tb;this.ei=12;this.fi=9-this.tb;this.gi=13-this.tb;this.mi=18;this.ni=9-this.tb;this.oi=17-this.tb;this.ri=15;this.si=9-this.tb;this.ti=15-this.tb;this.xi=11;this.yi=9-this.tb;this.zi=10-this.tb;this.Bk=8;this.Ek=12;this.Ck=18;this.Dk=17;this.Fk=15;this.vi=8;this.ui=20;this.wi=2;this.Ci=3;this.xf=9;this.Bi=5;this.Ai=11;this.Ei=4;this.Di=17;this.Gk=11;this.Ma=Ab.slice();80186<=this.Ca&&(this.ze=31,this.Ma[15]=G,this.Ma[96]=
|
||||
Bb,this.Ma[97]=Cb,this.Ma[98]=Db,this.Ma[99]=G,this.Ma[100]=G,this.Ma[101]=G,this.Ma[102]=G,this.Ma[103]=G,this.Ma[104]=Eb,this.Ma[105]=Fb,this.Ma[106]=Gb,this.Ma[107]=Hb,this.Ma[108]=Ib,this.Ma[109]=Jb,this.Ma[110]=Kb,this.Ma[111]=Lb,this.Ma[192]=Mb,this.Ma[193]=Nb,this.Ma[200]=Ob,this.Ma[201]=Pb,this.Ma[241]=Qb,Rb[7]=Sb,Tb[7]=Sb,80286<=this.Ca&&(this.Zi=2,this.Kf=0,this.Ma[15]=Ub,this.Ma[99]=Vb,this.Ma[84]=Wb,this.P=this.ca=this.ba=this.na=this.Z=this.Hi=0,this.V=this.U=1,this.$d=3,this.Hj=14,this.Ij=
|
||||
16,this.Cb=2,this.Rb=this.fb=7,this.Bg=0,this.Mj=7,this.Oj=13,this.Qj=7,this.Pj=11,this.Nj=16,this.Kj=3,this.$h=6,this.Lj=2,this.Jj=13,this.ai=this.bi=5,this.tf=2,this.sf=7,this.dk=23,this.ek=0,this.fk=1,this.gk=3,this.ck=17,this.ci=7,this.ik=11,this.Db=7,this.Eb=3,this.kk=7,this.jk=11,this.hk=15,this.nb=2,this.lk=3,this.di=7,this.nk=this.ii=this.mk=8,this.ji=this.hi=4,this.sk=2,this.rk=3,this.pk=5,this.qk=2,this.ok=3,this.ki=5,this.li=3,this.Sj=14,this.Uj=22,this.Rj=17,this.Tj=25,this.Wj=17,this.Yj=
|
||||
25,this.Vj=20,this.Xj=28,this.uk=13,this.wk=21,this.tk=16,this.vk=24,this.$j=13,this.bk=21,this.Zj=16,this.ak=24,this.vf=2,this.uf=7,this.pi=this.qi=5,this.xk=19,this.yk=this.Sb=5,this.zk=17,this.ac=3,this.Ak=5,this.wf=3,this.tb=0,this.Xh=8,this.Yh=5,this.Zh=9,this.fi=this.ei=5,this.gi=4,this.ni=this.mi=5,this.oi=4,this.ri=7,this.si=5,this.ti=8,this.xi=3,this.yi=4,this.zi=3,this.Ek=this.Bk=11,this.Dk=this.Ck=15,this.Fk=7,this.vi=5,this.ui=8,this.wi=0,this.Ci=2,this.xf=6,this.Bi=3,this.Ai=6,this.Ei=
|
||||
3,this.Gk=this.Di=5));this.bl=[];this.$i=[];this.Lc=this.gh=0;this.hg=!1;this.ya=[];this.Oe=this.xb=this.Ib=this.eb=this.Pd=0;this.S=this.pl;this.T=this.ql;this.N=this.rm;this.O=this.sm;this.Q=this.Kn;this.R=this.Ln;Xb(this)}z(Ya,zb);g=zb.prototype;g.Jh=function(a,b,c,d,e){this.ya=a;this.Oe=this.xb=b;this.Ib=c;this.eb=d;this.Pd=e};g.reset=function(){this.rc&&db(this);Xb(this);ab(this);this.Yc=!1};
|
||||
function Xb(a){a.G=0;a.B=0;a.I=0;a.J=0;a.X=0;a.H=0;a.F=0;a.D=0;a.ed=65520;a.Sc=0;a.me=1023;a.qc={Ii:0,ua:0,lc:0,qg:-1};a.Ia=new nb(a,"CS");a.cc=new nb(a,"DS");a.Wb=new nb(a,"SS");a.jb=new nb(a,"ES");a.Uk=new nb(a,"ZERO");Yb(a,0,65535);80286<=a.Ca&&(a.Rc=a.Ne=0,a.De=new nb(a,"LDT",!0),a.Ng=new nb(a,"TSS",!0),a.ub=new nb(a,"VER",!0),Yb(a,65520,61440),a.Ia.hb=16711680);Zb(a,0);$b(a);a.Ya=0;a.ob=a.Bf=-1;a.Vf=0;a.da=a.Ba=-1;a.C=a.cc;a.M=a.Wb;a.Y=a.pa=0}
|
||||
g.vj=function(){var a=this.G+this.B+this.I+this.J+this.X+this.H+this.F+this.D|0;return a=a+this.qa+this.Ia.ua+this.cc.ua+this.Wb.ua+this.jb.ua+ac(this)|0};function bc(a,b){var c=a.$i[b];null!=c&&(c(--a.gh),delete a.$i[b])}function $b(a,b){void 0===b&&(b=!!(a.ed&1));cc=b?dc:ec;ob(a.Ia,b);ob(a.cc,b);ob(a.Wb,b);ob(a.jb,b)}
|
||||
g.save=function(){var a=new H(this);a.set(0,[this.G,this.B,this.I,this.J,this.X,this.H,this.F,this.D]);a.set(1,[this.qa,this.Ia.save(),this.cc.save(),this.Wb.save(),this.jb.save(),ac(this),null!=this.Rc?[this.ed,this.Rc,this.Ne,this.Sc,this.me,this.De.save(),this.Ng.save()]:null]);a.set(2,[this.C.Lg,this.M.Lg,this.Y,this.pa,this.Ya,this.da,this.Ba]);a.set(3,[this.ug,this.be,this.yd]);a.set(4,Sa(this.ma));return a.data()};
|
||||
g.restore=function(a){var b;b=a[0];this.G=b[0];this.B=b[1];this.I=b[2];this.J=b[3];this.X=b[4];this.H=b[5];this.F=b[6];this.D=b[7];b=a[1];this.Ia.restore(b[1]);this.cc.restore(b[2]);this.Wb.restore(b[3]);this.jb.restore(b[4]);Zb(this,b[5]);var c=b[6];c&&c.length&&(this.ed=c[0],this.Rc=c[1],this.Ne=c[2],this.Sc=c[3],this.me=c[4],this.De.restore(c[5]),this.Ng.restore(c[6]),$b(this));I(this,b[0]);b=a[2];this.C=fc(this,b[0]);this.M=fc(this,b[1]);this.Y=b[2];this.pa=b[3];this.Ya=b[4];this.da=b[5];this.Ba=
|
||||
b[6];b=a[3];this.ug=b[0];this.be=b[1];fb(this,b[2]);a:{b=this.ma;a=a[4];for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.jj){for(var f=0,l=Array(b.jj),k=0;k<e.length-1;)for(var m=e[k++],n=e[k++];m--;)l[f++]=n;e=l}f=b.ya[d];if(!f||!f.restore(e)){u("Unable to restore memory block "+d);b=!1;break a}}void 0!==a[c]&&Ja(b,a[c]);b=!0}return b};
|
||||
function fc(a,b){switch(b){case "CS":return a.Ia;case "DS":return a.cc;case "SS":return a.Wb;case "ES":return a.jb;case "ZERO":return a.Uk;default:return[0,b,0,0,""]}}function gc(a,b){var c;if(a.ed&1){if(c=a.Sc+(b<<3),c+7<=a.me){a.qc.Ii=F(a,c);a.qc.ua=F(a,c+2);a.qc.lc=F(a,c+4);switch(a.qc.lc&7936){case 1536:a.qc.qg=-17153;break;case 1792:a.qc.qg=-16641;break;default:return!1}return!0}}else if(c=a.Sc+(b<<2),c+7<=a.me)return a.qc.Ii=F(a,c),a.qc.ua=F(a,c+2),a.qc.qg=-769,!0;return!1}
|
||||
function hc(a,b){a.Da=a.Ia.load(b)+a.qa;a.Y|=a.Kf}function ic(a,b){a.cc.load(b);a.Y|=a.Kf}function jc(a,b){a.Wb.load(b);a.Y|=4}function kc(a,b){a.jb.load(b);a.Y|=a.Kf}function I(a,b){a.Da=a.Ia.hb+(a.qa=b&65535)}function Yb(a,b,c){a.Da=a.Ia.load(c)+(a.qa=b)}function J(a,b){a.Da=a.Ia.hb+(a.qa=a.qa+b&65535)}function oc(a){return a.W&a.$?1:0}function pc(a){return mb[a.fa&255]?4:0}function qc(a){return(a.fa^a.ha)&16?16:0}function rc(a){return a.W&a.$-1?0:64}function sc(a){return a.fa&a.$>>1?128:0}
|
||||
function tc(a){return(a.fa^a.ha^a.fa>>1)&a.$>>1?2048:0}function uc(a){a.W&=~a.$}function vc(a){a.ha=a.fa&16|a.ha&-17}function wc(a){a.W|=a.$-1}function xc(a){a.fa&=~a.$;a.ha=a.fa&32896|a.ha&-32897}function yc(a){a.W|=a.$}function zc(a){a.ha=~(a.fa&16)&16|a.ha&-17}function Ac(a){a.W&=~(a.$-1)}function Bc(a){sc(a)||(a.fa^=a.$>>1|a.$>>2,a.ha^=32896)}function Cc(a){a.fa|=a.$;a.ha=a.fa&32896|a.ha&-32897}function ac(a){return a.Ha&-2262|oc(a)|pc(a)|qc(a)|rc(a)|sc(a)|tc(a)}
|
||||
function Zb(a,b){a.$=256;a.W=a.fa=a.ha=0;b&1&&yc(a);b&4||(a.fa|=1);b&16&&(a.ha|=16);b&64||wc(a);b&128&&Bc(a);b&2048&&Cc(a);a.Ha=a.Ha&-1793|b&1792|a.Wi;a.Ha&256&&(a.Ya|=2,a.Y|=4)}
|
||||
g.ub=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.oa[c]=d;e=!0;break;default:e=Ya.prototype.ub.call(this,a,b,c,d)}return e};function Dc(a,b){return a.ya[(b&a.wb)>>a.Ib].vc(b&a.eb)}
|
||||
function F(a,b){var c=b&a.eb,d=(b&a.wb)>>a.Ib;a.A-=a.Ei;return c!=a.eb?a.ya[d].An(c):a.ya[d++].vc(c)|a.ya[d&a.Pd].vc(0)<<8}function Ec(a,b,c){a.ya[(b&a.wb)>>a.Ib].xc(b&a.eb,c&255)}function Fc(a,b,c){var d=b&a.eb;b=(b&a.wb)>>a.Ib;a.A-=a.Ei;d!=a.eb?a.ya[b].Kn(d,c&65535):(a.ya[b++].xc(d,c&255),a.ya[b&a.Pd].xc(0,c>>8&255))}g.ml=function(a,b){this.Ff=a;this.da=a.Ic(this.yf=b,0);return this.Y&1?0:Dc(this,this.da)};g.nl=function(a,b){this.Ff=a;this.da=a.Ic(this.yf=b,1);return this.Y&1?0:F(this,this.da)};
|
||||
g.om=function(a,b){this.Ff=a;this.Ba=this.da=a.Ic(this.yf=b,0);return this.Y&1?0:Dc(this,this.da)};g.pm=function(a,b){this.Ff=a;this.Ba=this.da=a.Ic(this.yf=b,1);return this.Y&1?0:F(this,this.da)};g.Hn=function(a){this.Y&2||Ec(this,this.Ff.Nb(this.yf,1),a)};g.In=function(a){this.Y&2||Fc(this,this.Ff.Nb(this.yf,2),a)};g.aa=function(){var a=Dc(this,this.Da);this.Da=this.Ia.gb+(this.qa=this.qa+1&65535);return a};
|
||||
g.L=function(){var a=Dc(this,this.Da)<<24>>24;this.Da=this.Ia.gb+(this.qa=this.qa+1&65535);return a&65535};g.K=function(){var a=F(this,this.Da);this.Da=this.Ia.gb+(this.qa=this.qa+2&65535);return a};g.Aa=function(){var a=this.X;this.X=this.X+2&65535;return F(this,this.Ub.Ic(a,1))};function K(a,b){var c=a.X=a.X-2&65535;Fc(a,a.Ub.Nb(c,1),b)}
|
||||
g.cf=function(){E(this,"AX",this.G);E(this,"BX",this.B);E(this,"CX",this.I);E(this,"DX",this.J);E(this,"SP",this.X);E(this,"BP",this.H);E(this,"SI",this.F);E(this,"DI",this.D);E(this,"CS",this.Ia.ua);E(this,"DS",this.cc.ua);E(this,"SS",this.Ub.ua);E(this,"ES",this.ib.ua);E(this,"IP",this.qa);var a=ac(this);E(this,"PS",a);E(this,"C",a&1?1:0,1);E(this,"P",a&4?1:0,1);E(this,"A",a&16?1:0,1);E(this,"Z",a&64?1:0,1);E(this,"S",a&128?1:0,1);E(this,"T",a&256?1:0,1);E(this,"I",a&512?1:0,1);E(this,"D",a&1024?
|
||||
function Zb(a,b){a.$=256;a.W=a.fa=a.ha=0;b&1&&yc(a);b&4||(a.fa|=1);b&16&&(a.ha|=16);b&64||wc(a);b&128&&Bc(a);b&2048&&Cc(a);a.Ha=a.Ha&-1793|b&1792|a.Zi;a.Ha&256&&(a.Ya|=2,a.Y|=4)}
|
||||
g.vb=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.oa[c]=d;e=!0;break;default:e=Ya.prototype.vb.call(this,a,b,c,d)}return e};function Dc(a,b){return a.ya[(b&a.xb)>>a.Ib].vc(b&a.eb)}
|
||||
function F(a,b){var c=b&a.eb,d=(b&a.xb)>>a.Ib;a.A-=a.Hi;return c!=a.eb?a.ya[d].Dn(c):a.ya[d++].vc(c)|a.ya[d&a.Pd].vc(0)<<8}function Ec(a,b,c){a.ya[(b&a.xb)>>a.Ib].xc(b&a.eb,c&255)}function Fc(a,b,c){var d=b&a.eb;b=(b&a.xb)>>a.Ib;a.A-=a.Hi;d!=a.eb?a.ya[b].Nn(d,c&65535):(a.ya[b++].xc(d,c&255),a.ya[b&a.Pd].xc(0,c>>8&255))}g.pl=function(a,b){this.Ff=a;this.da=a.Ic(this.yf=b,0);return this.Y&1?0:Dc(this,this.da)};g.ql=function(a,b){this.Ff=a;this.da=a.Ic(this.yf=b,1);return this.Y&1?0:F(this,this.da)};
|
||||
g.rm=function(a,b){this.Ff=a;this.Ba=this.da=a.Ic(this.yf=b,0);return this.Y&1?0:Dc(this,this.da)};g.sm=function(a,b){this.Ff=a;this.Ba=this.da=a.Ic(this.yf=b,1);return this.Y&1?0:F(this,this.da)};g.Kn=function(a){this.Y&2||Ec(this,this.Ff.Ob(this.yf,1),a)};g.Ln=function(a){this.Y&2||Fc(this,this.Ff.Ob(this.yf,2),a)};g.aa=function(){var a=Dc(this,this.Da);this.Da=this.Ia.hb+(this.qa=this.qa+1&65535);return a};
|
||||
g.L=function(){var a=Dc(this,this.Da)<<24>>24;this.Da=this.Ia.hb+(this.qa=this.qa+1&65535);return a&65535};g.K=function(){var a=F(this,this.Da);this.Da=this.Ia.hb+(this.qa=this.qa+2&65535);return a};g.Aa=function(){var a=this.X;this.X=this.X+2&65535;return F(this,this.Wb.Ic(a,1))};function K(a,b){var c=a.X=a.X-2&65535;Fc(a,a.Wb.Ob(c,1),b)}
|
||||
g.cf=function(){E(this,"AX",this.G);E(this,"BX",this.B);E(this,"CX",this.I);E(this,"DX",this.J);E(this,"SP",this.X);E(this,"BP",this.H);E(this,"SI",this.F);E(this,"DI",this.D);E(this,"CS",this.Ia.ua);E(this,"DS",this.cc.ua);E(this,"SS",this.Wb.ua);E(this,"ES",this.jb.ua);E(this,"IP",this.qa);var a=ac(this);E(this,"PS",a);E(this,"C",a&1?1:0,1);E(this,"P",a&4?1:0,1);E(this,"A",a&16?1:0,1);E(this,"Z",a&64?1:0,1);E(this,"S",a&128?1:0,1);E(this,"T",a&256?1:0,1);E(this,"I",a&512?1:0,1);E(this,"D",a&1024?
|
||||
1:0,1);E(this,"O",a&2048?1:0,1);this.oa.speed&&(this.oa.speed.innerHTML=this.rc&&this.Kc?this.Kc.toFixed(2)+"Mhz":"Stopped")};
|
||||
g.Tk=function(a){this.hg=!0;this.Lc=this.A=a;this.ga&&lb(this.ga);a||!this.Na||this.Na.ro(this.Na.Un)||(this.Y|=4);do{if(a=this.Y&240)this.pa|=a;else if(this.Cg=this.Da,this.da=this.Ba=-1,this.C=this.cc,this.M=this.Ub,this.pa=this.Y&256,this.Ya){a:{if(!(this.Y&4))if(this.Ya&1&&this.Ha&512){if(a=Gc(this.ga),-1<=a&&(this.Ya&=-2,0<=a)){this.Ya&=-5;Hc.call(this,a,null,11);break a}}else if(this.Ya&2){this.Ya&=-3;Hc.call(this,1,null,11);break a}if(a=this.Ya&8){a=this.ga;for(var b=!1,c=0;c<a.va;c++)for(var d=
|
||||
a.va[c],e=0;e<d.La.length;e++){var f=d.La[e];f.bd||(Ic(a,f),f.bd||(b=!0))}a=!b}a&&(this.Ya&=-9)}if(this.Ya&4){this.Y=this.A=0;break}}this.Y=0;this.Ma[this.aa()].call(this)}while(0<this.A);return this.hg?this.Lc-this.A:void 0===this.hg?0:-1};v(function(){for(var a=C(window.document,"pcjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new zb(d);B(d,c)}});function Jc(a,b){this.ha=a^b;this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=a+b)&255}
|
||||
function Kc(a,b){this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=this.ha=a|b)&255}function Lc(a,b){this.ha=a^b;this.W=this.fa=a+b+(this.W&this.$?1:0);this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return this.W&255}function Mc(a,b){this.ha=a^b;this.W=this.fa=a-b-(this.W&this.$?1:0);this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return this.W&255}
|
||||
function Nc(a,b){this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=this.ha=a&b)&255}function Oc(a,b){this.ha=a^b;this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=a-b)&255}function Pc(a,b){this.$=256;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=this.ha=a^b)&255}function Qc(a,b){this.ha=a^b;this.$=256;this.W=this.fa=a-b;this.A-=0>this.Ba?0>this.da?this.Bb:this.Xh:this.fb;this.Y|=2;return a}
|
||||
function Rc(a,b){this.ha=a^b;this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=a+b)&65535}function Sc(a,b){this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=this.ha=a|b)&65535}function Tc(a,b){this.ha=a^b;this.W=this.fa=a+b+(this.W&this.$?1:0);this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return this.W&65535}
|
||||
function Uc(a,b){this.ha=a^b;this.W=this.fa=a-b-(this.W&this.$?1:0);this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return this.W&65535}function Vc(a,b){this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=this.ha=a&b)&65535}function Wc(a,b){this.ha=a^b;this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=a-b)&65535}
|
||||
function Xc(a,b){this.$=65536;this.A-=0>this.Ba?0>this.da?this.Bb:this.fb:this.Qb;return(this.W=this.fa=this.ha=a^b)&65535}function Yc(a,b){this.ha=a^b;this.$=65536;this.W=this.fa=a-b;this.A-=0>this.Ba?0>this.da?this.Bb:this.Xh:this.fb;this.Y|=2;return a}function Zc(a,b){this.W=this.W&this.$-1|(a&b?this.$:0);(a^a>>1)&b>>1?Cc(this):xc(this)}function $c(a,b){var c=a;if(b){var d,e=b&7;e?c=(d=a<<e|a>>8-e)&255:d=a<<8;Zc.call(this,d,256)}return c}
|
||||
g.Wk=function(a){this.hg=!0;this.Lc=this.A=a;this.ga&&lb(this.ga);a||!this.Na||this.Na.uo(this.Na.Xn)||(this.Y|=4);do{if(a=this.Y&240)this.pa|=a;else if(this.Eg=this.Da,this.da=this.Ba=-1,this.C=this.cc,this.M=this.Wb,this.pa=this.Y&256,this.Ya){a:{if(!(this.Y&4))if(this.Ya&1&&this.Ha&512){if(a=Gc(this.ga),-1<=a&&(this.Ya&=-2,0<=a)){this.Ya&=-5;Hc.call(this,a,null,11);break a}}else if(this.Ya&2){this.Ya&=-3;Hc.call(this,1,null,11);break a}if(a=this.Ya&8){a=this.ga;for(var b=!1,c=0;c<a.va;c++)for(var d=
|
||||
a.va[c],e=0;e<d.La.length;e++){var f=d.La[e];f.bd||(Ic(a,f),f.bd||(b=!0))}a=!b}a&&(this.Ya&=-9)}if(this.Ya&4){this.Y=this.A=0;break}}this.Y=0;this.Ma[this.aa()].call(this)}while(0<this.A);return this.hg?this.Lc-this.A:void 0===this.hg?0:-1};v(function(){for(var a=C(window.document,"pcjs","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new zb(d);B(d,c)}});function Jc(a,b){this.ha=a^b;this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=a+b)&255}
|
||||
function Kc(a,b){this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=this.ha=a|b)&255}function Lc(a,b){this.ha=a^b;this.W=this.fa=a+b+(this.W&this.$?1:0);this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return this.W&255}function Mc(a,b){this.ha=a^b;this.W=this.fa=a-b-(this.W&this.$?1:0);this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return this.W&255}
|
||||
function Nc(a,b){this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=this.ha=a&b)&255}function Oc(a,b){this.ha=a^b;this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=a-b)&255}function Pc(a,b){this.$=256;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=this.ha=a^b)&255}function Qc(a,b){this.ha=a^b;this.$=256;this.W=this.fa=a-b;this.A-=0>this.Ba?0>this.da?this.Cb:this.$h:this.fb;this.Y|=2;return a}
|
||||
function Rc(a,b){this.ha=a^b;this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=a+b)&65535}function Sc(a,b){this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=this.ha=a|b)&65535}function Tc(a,b){this.ha=a^b;this.W=this.fa=a+b+(this.W&this.$?1:0);this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return this.W&65535}
|
||||
function Uc(a,b){this.ha=a^b;this.W=this.fa=a-b-(this.W&this.$?1:0);this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return this.W&65535}function Vc(a,b){this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=this.ha=a&b)&65535}function Wc(a,b){this.ha=a^b;this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=a-b)&65535}
|
||||
function Xc(a,b){this.$=65536;this.A-=0>this.Ba?0>this.da?this.Cb:this.fb:this.Rb;return(this.W=this.fa=this.ha=a^b)&65535}function Yc(a,b){this.ha=a^b;this.$=65536;this.W=this.fa=a-b;this.A-=0>this.Ba?0>this.da?this.Cb:this.$h:this.fb;this.Y|=2;return a}function Zc(a,b){this.W=this.W&this.$-1|(a&b?this.$:0);(a^a>>1)&b>>1?Cc(this):xc(this)}function $c(a,b){var c=a;if(b){var d,e=b&7;e?c=(d=a<<e|a>>8-e)&255:d=a<<8;Zc.call(this,d,256)}return c}
|
||||
function ad(a,b){var c=a;if(b){var d,e=b&15;e?c=(d=a<<e|a>>16-e)&65535:d=a<<16;Zc.call(this,d,65536)}return c}function bd(a,b){var c=a;if(b){var d,c=b&7,c=d=(a>>c|a<<8-c)&255;d&128&&(d|=256);Zc.call(this,d,256)}return c}function cd(a,b){var c=a;if(b){var d,c=b&15,c=d=(a>>c|a<<16-c)&65535;d&32768&&(d|=65536);Zc.call(this,d,65536)}return c}function dd(a,b){var c=a;if(b){var d;(d=(b&this.ze)%9)?(d=a<<d|(this.W&this.$?1:0)<<d-1|a>>9-d,c=d&255):d=a|(this.W&this.$?1:0)<<8;Zc.call(this,d,256)}return c}
|
||||
function ed(a,b){var c=a;if(b){var d;(d=(b&this.ze)%17)?(d=a<<d|(this.W&this.$?1:0)<<d-1|a>>17-d,c=d&65535):d=a|(this.W&this.$?1:0)<<16;Zc.call(this,d,65536)}return c}function fd(a,b){var c=a;b&&(c=(b&this.ze)%9,c=a>>c|(this.W&this.$?1:0)<<8-c|a<<9-c,Zc.call(this,c,256),c&=255);return c}function gd(a,b){var c=a;b&&(c=(b&this.ze)%17,c=a>>c|(this.W&this.$?1:0)<<16-c|a<<17-c,Zc.call(this,c,65536),c&=65535);return c}
|
||||
function hd(a,b){var c=a;b&&(c=8<b?this.W=this.fa=0:(this.W=this.fa=a<<b)&255,this.ha=0,this.$=256);return c}function id(a,b){var c=a;b&&(c=16<b?this.W=this.fa=0:(this.W=this.fa=a<<b)&65535,this.ha=0,this.$=65536);return c}function md(a,b){if(b){var c=8<b?0:a>>b-1;this.W=this.fa=c>>1;this.W=c&1?this.W|256:this.W&-257;this.ha=a^this.W;this.$=256;a=this.W}return a&255}
|
||||
function nd(a,b){if(b){var c=16<b?0:a>>b-1;this.W=this.fa=c>>1;this.W=c&1?this.W|65536:this.W&-65537;this.ha=a^this.W;this.$=65536;a=this.W}return a&65535}function od(a,b){if(b){8<b&&(b=9);var c=a<<24>>24>>b-1;this.W=this.fa=c>>1;this.W=c&1?this.W|256:this.W&-257;this.ha=a^this.W;this.$=256;a=this.W}return a&255}function pd(a,b){if(b){16<b&&(b=17);var c=a<<16>>16>>b-1;this.W=this.fa=c>>1;this.W=c&1?this.W|65536:this.W&-65537;this.ha=a^this.W;this.$=65536;a=this.W}return a&65535}
|
||||
function qd(){this.A-=0>this.da?2:this.Ck;return 1}function rd(){var a=this.I&this.ze;this.A-=(0>this.da?this.si:this.ri)+(a<<this.ti);return a}function sd(){var a=this.aa();this.A-=(0>this.da?this.si:this.ri)+(a<<this.ti);return a}function td(){return null}function ud(a){yb.call(this,13,0);return a}function Sb(a){G.call(this);return a}function L(a){N.call(this);return a}
|
||||
var vd=[Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc],wd=[Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc],xd=[function(a,b){this.A-=0>this.Ba?this.Rb:this.vk;return b},ud,ud,ud,ud,ud,ud,ud],yd=[function(a,b){this.A-=0>this.Ba?this.nk:this.lk;return b},L,L,L,L,L,L,L],zd=[$c,bd,dd,fd,hd,md,L,od],Ad=[ad,cd,ed,gd,id,nd,L,pd],Cd=[function(a,b){b=this.aa();this.W=this.fa=this.ha=a&b;this.$=256;this.A-=0>this.da?this.yi:this.xi;this.Y|=2;return a},L,function(a){this.A-=0>this.da?this.vf:this.uf;return a^255},function(a,b){b=0;this.ha=a^b;this.$=256;
|
||||
this.A-=0>this.da?this.vf:this.uf;return(this.W=this.fa=b-a)&255},function(a){this.G=this.nb=(this.W=(this.G&255)*a)&65535;this.ha=this.fa=this.W;this.$=256;this.G&65280?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.rk:this.qk;this.Y|=2;return a},function(a){var b=(this.G<<24>>24)*(a<<24>>24);this.G=this.nb=b&65535;this.W=this.ha=this.fa=b;this.$=256;127<b||-128>b?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.Xj:this.Wj;this.Y|=2;return a},function(a){if(!a)return Bd.call(this),
|
||||
a;var b=this.G/a;if(255<b)return Bd.call(this),a;this.nb=this.G=b&255|(this.G%a&255)<<8;this.fa=this.ha=this.W=b|256;this.$=256;this.A-=0>this.da?this.Pj:this.Oj;this.Y|=2;return a},function(a){if(!a)return Bd.call(this),a;var b=(this.G<<16>>16)/(a<<24>>24);if(b>b<<24>>24&65535)return Bd.call(this),a;this.nb=this.G=b&255|((this.G<<16>>16)%(a<<24>>24)&255)<<8;this.fa=this.ha=this.W=b|256;this.$=256;this.A-=0>this.da?this.Tj:this.Sj;this.Y|=2;return a}],Dd=[function(a,b){b=this.K();this.W=this.fa=this.ha=
|
||||
a&b;this.$=65536;this.A-=0>this.da?this.yi:this.xi;this.Y|=2;return a},L,function(a){this.A-=0>this.da?this.vf:this.uf;return a^65535},function(a,b){b=0;this.ha=a^b;this.$=65536;this.A-=0>this.da?this.vf:this.uf;return(this.W=this.fa=b-a)&65535},function(a){this.nb=this.G=(this.W=this.G*a)&65535;this.Bf=this.J=this.W>>16&65535;this.ha=this.fa=this.W;this.$=65536;this.J?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.tk:this.sk;this.Y|=2;return a},function(a){var b=(this.G<<16>>16)*
|
||||
(a<<16>>16);this.G=this.nb=b&65535;this.J=this.Bf=b>>16&65535;this.W=this.ha=this.fa=b;this.$=65536;32767<b||-32768>b?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.Zj:this.Yj;this.Y|=2;return a},function(a,b){if(!a)return Bd.call(this),a;b=this.G+65536*this.J;var c=Math.floor(b/a);if(65536<=c)return Bd.call(this),a;this.nb=this.G=c&65535;this.Bf=this.J=b%a&65535;this.fa=this.ha=this.W=c|65536;this.$=65536;this.A-=0>this.da?this.Rj:this.Qj;this.Y|=2;return a},function(a,b){if(!a)return Bd.call(this),
|
||||
a;var c=a<<16>>16;b=this.J<<16|this.G;var d=Math.floor(b/c);if(d!=(d&65535)<<16>>16)return Bd.call(this),a;this.nb=this.G=d&65535;this.Bf=this.J=b%c&65535;this.fa=this.ha=this.W=d|65536;this.$=65536;this.A-=0>this.da?this.Vj:this.Uj;this.Y|=2;return a}],Rb=[function(a){this.ha=a;a=(this.fa=a+1)&255;this.W=a|(this.W&this.$?1:0)<<8;this.$=256;this.A-=0>this.da?this.tf:this.sf;return a},function(a){this.ha=a;a=(this.fa=a-1)&255;this.W=a|(this.W&this.$?1:0)<<8;this.$=256;this.A-=0>this.da?this.tf:this.sf;
|
||||
return a},L,L,L,L,L,L],Tb=[function(a){this.ha=a;a=(this.fa=a+1)&65535;this.W=a|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=0>this.da?this.tf:this.sf;return a},function(a){this.ha=a;a=(this.fa=a-1)&65535;this.W=a|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=0>this.da?this.tf:this.sf;return a},function(a){K(this,this.qa);I(this,a);this.A-=0>this.da?this.Nj:this.Mj;this.Y|=2;return a},function(a){if(0>this.da)return L.call(this,a);K(this,this.Ia.ua);K(this,this.qa);Yb(this,a,F(this,this.da+2));this.A-=
|
||||
this.Kj;this.Y|=2;return a},function(a){I(this,a);this.A-=0>this.da?this.hk:this.gk;this.Y|=2;return a},function(a){if(0>this.da)return L.call(this,a);Yb(this,a,F(this,this.da+2));this.A-=this.ek;this.Y|=2;return a},function(a){var b=a;this.Y&512&&(a=a-2&65535,80286>this.Ca&&(b=a));K(this,b);this.A-=0>this.da?this.$b:this.xk;this.Y|=2;return a},ud],Ed=[$c,bd,dd,fd,hd,md,L,od],Fd=[ad,cd,ed,gd,id,nd,L,pd];function Gd(a,b){this.A-=0>this.Ba?0>this.da?this.pk:this.ok:this.mk;return b}
|
||||
function Hd(){return Gd.call(this,0,this.nb)}function Id(a,b){this.W=this.fa=this.ha=a&b;this.$=256;this.A-=0>this.Ba?0>this.da?this.zi:this.xf:this.xf;this.Y|=2;return a}function Jd(a,b){this.W=this.fa=this.ha=a&b;this.$=65536;this.A-=0>this.Ba?0>this.da?this.zi:this.xf:this.xf;this.Y|=2;return a}function Kd(a,b){var c=(b<<16>>16)*(this.aa()<<24>>24);this.W=this.ha=this.fa=c;this.$=256;32767<c||-32768>c?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?21:24;return c&65535}
|
||||
function Ld(a,b){var c=(b<<16>>16)*(this.K()<<16>>16);this.W=this.ha=this.fa=c;this.$=65536;32767<c||-32768>c?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?21:24;return c&65535}function Md(a){return a}function Nd(a){if(0>this.da)return N.call(this),a;this.A-=this.ik;return this.da}function Od(a,b){if(0>this.da)return N.call(this),a;ic(this,F(this,this.da+2));this.A-=this.ai;return b}
|
||||
function Pd(a,b){if(0>this.da)return N.call(this),a;kc(this,F(this,this.da+2));this.A-=this.ai;return b}function Qd(a){if(0>this.da)return G.call(this),a;var b=a<<16>>16,c=F(this,this.da)<<16>>16,d=F(this,this.da+2)<<16>>16;this.A-=this.Gj;if(b<c||b>d)I(this,this.Cg-this.Ia.gb),Hc.call(this,5,null,0);this.Y|=2;return a}function Rd(a,b){this.A-=10+(0>this.da?0:1);if((a&3)<(b&3))return a=a&-4|b&3,Ac(this),a;wc(this);return a}
|
||||
function Sd(a,b){this.A-=14+(0>this.da?0:2);if(0<=this.tb.load(b,!0)&&this.tb.uc>=(this.Ia.ua&3)&&this.tb.uc>=(b&3))return Ac(this),this.tb.lc&65280;wc(this);return a}function Td(a,b){this.A-=14+(0>this.da?0:2);if(b&65528&&0<=this.tb.load(b,!0)&&(3072==(this.tb.lc&3072)||this.tb.uc>=(this.Ia.ua&3))&&this.tb.uc>=(b&3))return Ac(this),this.tb.ad;wc(this);return a}
|
||||
function Ud(a,b){if(0>this.da){switch(this.Vf&7){case 0:this.G=this.G&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.J=this.J&-256|a;break;case 3:this.B=this.B&-256|a;break;case 4:this.G=this.G&255|a<<8;break;case 5:this.I=this.I&255|a<<8;break;case 6:this.J=this.J&255|a<<8;break;case 7:this.B=this.B&255|a<<8}this.A-=this.Bi}else this.Ba=this.da,this.Q(a),this.A-=this.Ai;return b}
|
||||
function Vd(a,b){if(0>this.da){switch(this.Vf&7){case 0:this.G=a;break;case 1:this.I=a;break;case 2:this.J=a;break;case 3:this.B=a;break;case 4:this.X=a;break;case 5:this.H=a;break;case 6:this.F=a;break;case 7:this.D=a}this.A-=this.Bi}else this.Ba=this.da,this.R(a),this.A-=this.Ai;return b}function Hc(a,b,c){gc(this,a)&&(K(this,ac(this)),this.Ha&=this.qc.qg,K(this,this.Ia.ua),K(this,this.qa),null!=b&&K(this,b),Yb(this,this.qc.Fi,this.qc.ua),this.A-=this.ak+c)}
|
||||
function Bd(){I(this,this.Cg-this.Ia.gb);Hc.call(this,0,null,2)}function yb(a,b){80186<=this.Ca&&(I(this,this.Cg-this.Ia.gb),Hc.call(this,a,b,0))}function G(){yb.call(this,6);db(this)}function N(){I(this,this.Cg-this.Ia.gb);var a=Na(this.ma,this.Da),b=this.qa,c=this.Ia.ua;Ea(this,"Undefined opcode 0x"+p(a,2)+" at "+(void 0!==c?p(c,4)+":"+p(b,4):p(b)));db(this)}function Wd(a){a=a.call(this,this.G&255,this.G&255);this.G=this.G&-256|a}
|
||||
function qd(){this.A-=0>this.da?2:this.Fk;return 1}function rd(){var a=this.I&this.ze;this.A-=(0>this.da?this.vi:this.ui)+(a<<this.wi);return a}function sd(){var a=this.aa();this.A-=(0>this.da?this.vi:this.ui)+(a<<this.wi);return a}function td(){return null}function ud(a){yb.call(this,13,0);return a}function Sb(a){G.call(this);return a}function L(a){N.call(this);return a}
|
||||
var vd=[Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc],wd=[Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc],xd=[function(a,b){this.A-=0>this.Ba?this.Sb:this.yk;return b},ud,ud,ud,ud,ud,ud,ud],yd=[function(a,b){this.A-=0>this.Ba?this.qk:this.ok;return b},L,L,L,L,L,L,L],zd=[$c,bd,dd,fd,hd,md,L,od],Ad=[ad,cd,ed,gd,id,nd,L,pd],Cd=[function(a,b){b=this.aa();this.W=this.fa=this.ha=a&b;this.$=256;this.A-=0>this.da?this.Bi:this.Ai;this.Y|=2;return a},L,function(a){this.A-=0>this.da?this.vf:this.uf;return a^255},function(a,b){b=0;this.ha=a^b;this.$=256;
|
||||
this.A-=0>this.da?this.vf:this.uf;return(this.W=this.fa=b-a)&255},function(a){this.G=this.ob=(this.W=(this.G&255)*a)&65535;this.ha=this.fa=this.W;this.$=256;this.G&65280?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.uk:this.tk;this.Y|=2;return a},function(a){var b=(this.G<<24>>24)*(a<<24>>24);this.G=this.ob=b&65535;this.W=this.ha=this.fa=b;this.$=256;127<b||-128>b?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.$j:this.Zj;this.Y|=2;return a},function(a){if(!a)return Bd.call(this),
|
||||
a;var b=this.G/a;if(255<b)return Bd.call(this),a;this.ob=this.G=b&255|(this.G%a&255)<<8;this.fa=this.ha=this.W=b|256;this.$=256;this.A-=0>this.da?this.Sj:this.Rj;this.Y|=2;return a},function(a){if(!a)return Bd.call(this),a;var b=(this.G<<16>>16)/(a<<24>>24);if(b>b<<24>>24&65535)return Bd.call(this),a;this.ob=this.G=b&255|((this.G<<16>>16)%(a<<24>>24)&255)<<8;this.fa=this.ha=this.W=b|256;this.$=256;this.A-=0>this.da?this.Wj:this.Vj;this.Y|=2;return a}],Dd=[function(a,b){b=this.K();this.W=this.fa=this.ha=
|
||||
a&b;this.$=65536;this.A-=0>this.da?this.Bi:this.Ai;this.Y|=2;return a},L,function(a){this.A-=0>this.da?this.vf:this.uf;return a^65535},function(a,b){b=0;this.ha=a^b;this.$=65536;this.A-=0>this.da?this.vf:this.uf;return(this.W=this.fa=b-a)&65535},function(a){this.ob=this.G=(this.W=this.G*a)&65535;this.Bf=this.J=this.W>>16&65535;this.ha=this.fa=this.W;this.$=65536;this.J?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.wk:this.vk;this.Y|=2;return a},function(a){var b=(this.G<<16>>16)*
|
||||
(a<<16>>16);this.G=this.ob=b&65535;this.J=this.Bf=b>>16&65535;this.W=this.ha=this.fa=b;this.$=65536;32767<b||-32768>b?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?this.bk:this.ak;this.Y|=2;return a},function(a,b){if(!a)return Bd.call(this),a;b=this.G+65536*this.J;var c=Math.floor(b/a);if(65536<=c)return Bd.call(this),a;this.ob=this.G=c&65535;this.Bf=this.J=b%a&65535;this.fa=this.ha=this.W=c|65536;this.$=65536;this.A-=0>this.da?this.Uj:this.Tj;this.Y|=2;return a},function(a,b){if(!a)return Bd.call(this),
|
||||
a;var c=a<<16>>16;b=this.J<<16|this.G;var d=Math.floor(b/c);if(d!=(d&65535)<<16>>16)return Bd.call(this),a;this.ob=this.G=d&65535;this.Bf=this.J=b%c&65535;this.fa=this.ha=this.W=d|65536;this.$=65536;this.A-=0>this.da?this.Yj:this.Xj;this.Y|=2;return a}],Rb=[function(a){this.ha=a;a=(this.fa=a+1)&255;this.W=a|(this.W&this.$?1:0)<<8;this.$=256;this.A-=0>this.da?this.tf:this.sf;return a},function(a){this.ha=a;a=(this.fa=a-1)&255;this.W=a|(this.W&this.$?1:0)<<8;this.$=256;this.A-=0>this.da?this.tf:this.sf;
|
||||
return a},L,L,L,L,L,L],Tb=[function(a){this.ha=a;a=(this.fa=a+1)&65535;this.W=a|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=0>this.da?this.tf:this.sf;return a},function(a){this.ha=a;a=(this.fa=a-1)&65535;this.W=a|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=0>this.da?this.tf:this.sf;return a},function(a){K(this,this.qa);I(this,a);this.A-=0>this.da?this.Qj:this.Pj;this.Y|=2;return a},function(a){if(0>this.da)return L.call(this,a);K(this,this.Ia.ua);K(this,this.qa);Yb(this,a,F(this,this.da+2));this.A-=
|
||||
this.Nj;this.Y|=2;return a},function(a){I(this,a);this.A-=0>this.da?this.kk:this.jk;this.Y|=2;return a},function(a){if(0>this.da)return L.call(this,a);Yb(this,a,F(this,this.da+2));this.A-=this.hk;this.Y|=2;return a},function(a){var b=a;this.Y&512&&(a=a-2&65535,80286>this.Ca&&(b=a));K(this,b);this.A-=0>this.da?this.ac:this.Ak;this.Y|=2;return a},ud],Ed=[$c,bd,dd,fd,hd,md,L,od],Fd=[ad,cd,ed,gd,id,nd,L,pd];function Gd(a,b){this.A-=0>this.Ba?0>this.da?this.sk:this.rk:this.pk;return b}
|
||||
function Hd(){return Gd.call(this,0,this.ob)}function Id(a,b){this.W=this.fa=this.ha=a&b;this.$=256;this.A-=0>this.Ba?0>this.da?this.Ci:this.xf:this.xf;this.Y|=2;return a}function Jd(a,b){this.W=this.fa=this.ha=a&b;this.$=65536;this.A-=0>this.Ba?0>this.da?this.Ci:this.xf:this.xf;this.Y|=2;return a}function Kd(a,b){var c=(b<<16>>16)*(this.aa()<<24>>24);this.W=this.ha=this.fa=c;this.$=256;32767<c||-32768>c?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?21:24;return c&65535}
|
||||
function Ld(a,b){var c=(b<<16>>16)*(this.K()<<16>>16);this.W=this.ha=this.fa=c;this.$=65536;32767<c||-32768>c?(yc(this),Cc(this)):(uc(this),xc(this));this.A-=0>this.da?21:24;return c&65535}function Md(a){return a}function Nd(a){if(0>this.da)return N.call(this),a;this.A-=this.lk;return this.da}function Od(a,b){if(0>this.da)return N.call(this),a;ic(this,F(this,this.da+2));this.A-=this.di;return b}
|
||||
function Pd(a,b){if(0>this.da)return N.call(this),a;kc(this,F(this,this.da+2));this.A-=this.di;return b}function Qd(a){if(0>this.da)return G.call(this),a;var b=a<<16>>16,c=F(this,this.da)<<16>>16,d=F(this,this.da+2)<<16>>16;this.A-=this.Jj;if(b<c||b>d)I(this,this.Eg-this.Ia.hb),Hc.call(this,5,null,0);this.Y|=2;return a}function Rd(a,b){this.A-=10+(0>this.da?0:1);if((a&3)<(b&3))return a=a&-4|b&3,Ac(this),a;wc(this);return a}
|
||||
function Sd(a,b){this.A-=14+(0>this.da?0:2);if(0<=this.ub.load(b,!0)&&this.ub.uc>=(this.Ia.ua&3)&&this.ub.uc>=(b&3))return Ac(this),this.ub.lc&65280;wc(this);return a}function Td(a,b){this.A-=14+(0>this.da?0:2);if(b&65528&&0<=this.ub.load(b,!0)&&(3072==(this.ub.lc&3072)||this.ub.uc>=(this.Ia.ua&3))&&this.ub.uc>=(b&3))return Ac(this),this.ub.ad;wc(this);return a}
|
||||
function Ud(a,b){if(0>this.da){switch(this.Vf&7){case 0:this.G=this.G&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.J=this.J&-256|a;break;case 3:this.B=this.B&-256|a;break;case 4:this.G=this.G&255|a<<8;break;case 5:this.I=this.I&255|a<<8;break;case 6:this.J=this.J&255|a<<8;break;case 7:this.B=this.B&255|a<<8}this.A-=this.Ei}else this.Ba=this.da,this.Q(a),this.A-=this.Di;return b}
|
||||
function Vd(a,b){if(0>this.da){switch(this.Vf&7){case 0:this.G=a;break;case 1:this.I=a;break;case 2:this.J=a;break;case 3:this.B=a;break;case 4:this.X=a;break;case 5:this.H=a;break;case 6:this.F=a;break;case 7:this.D=a}this.A-=this.Ei}else this.Ba=this.da,this.R(a),this.A-=this.Di;return b}function Hc(a,b,c){gc(this,a)&&(K(this,ac(this)),this.Ha&=this.qc.qg,K(this,this.Ia.ua),K(this,this.qa),null!=b&&K(this,b),Yb(this,this.qc.Ii,this.qc.ua),this.A-=this.dk+c)}
|
||||
function Bd(){I(this,this.Eg-this.Ia.hb);Hc.call(this,0,null,2)}function yb(a,b){80186<=this.Ca&&(I(this,this.Eg-this.Ia.hb),Hc.call(this,a,b,0))}function G(){yb.call(this,6);db(this)}function N(){I(this,this.Eg-this.Ia.hb);var a=Na(this.ma,this.Da),b=this.qa,c=this.Ia.ua;Ea(this,"Undefined opcode 0x"+p(a,2)+" at "+(void 0!==c?p(c,4)+":"+p(b,4):p(b)));db(this)}function Wd(a){a=a.call(this,this.G&255,this.G&255);this.G=this.G&-256|a}
|
||||
function Xd(a){a=a.call(this,this.G&255,this.I&255);this.G=this.G&-256|a}function Yd(a){a=a.call(this,this.G&255,this.J&255);this.G=this.G&-256|a}function Zd(a){a=a.call(this,this.G&255,this.B&255);this.G=this.G&-256|a}function $d(a){a=a.call(this,this.G&255,this.G>>8);this.G=this.G&-256|a}function ae(a){a=a.call(this,this.G&255,this.I>>8);this.G=this.G&-256|a}function be(a){a=a.call(this,this.G&255,this.J>>8);this.G=this.G&-256|a}
|
||||
function ce(a){a=a.call(this,this.G&255,this.B>>8);this.G=this.G&-256|a}function de(a){a=a.call(this,this.I&255,this.G&255);this.I=this.I&-256|a}function ee(a){a=a.call(this,this.I&255,this.I&255);this.I=this.I&-256|a}function fe(a){a=a.call(this,this.I&255,this.J&255);this.I=this.I&-256|a}function ge(a){a=a.call(this,this.I&255,this.B&255);this.I=this.I&-256|a}function he(a){a=a.call(this,this.I&255,this.G>>8);this.I=this.I&-256|a}
|
||||
function ie(a){a=a.call(this,this.I&255,this.I>>8);this.I=this.I&-256|a}function je(a){a=a.call(this,this.I&255,this.J>>8);this.I=this.I&-256|a}function ke(a){a=a.call(this,this.I&255,this.B>>8);this.I=this.I&-256|a}function le(a){a=a.call(this,this.J&255,this.G&255);this.J=this.J&-256|a}function me(a){a=a.call(this,this.J&255,this.I&255);this.J=this.J&-256|a}function ne(a){a=a.call(this,this.J&255,this.J&255);this.J=this.J&-256|a}
|
||||
|
|
@ -359,268 +359,268 @@ function(a,b){this.X=a[4].call(this,this.X,b.call(this))},function(a,b){this.H=a
|
|||
b.call(this))},function(a,b){this.H=a[5].call(this,this.H,b.call(this))},function(a,b){this.F=a[5].call(this,this.F,b.call(this))},function(a,b){this.D=a[5].call(this,this.D,b.call(this))},function(a,b){this.G=a[6].call(this,this.G,b.call(this))},function(a,b){this.I=a[6].call(this,this.I,b.call(this))},function(a,b){this.J=a[6].call(this,this.J,b.call(this))},function(a,b){this.B=a[6].call(this,this.B,b.call(this))},function(a,b){this.Y|=512;this.X=a[6].call(this,this.X,b.call(this))},function(a,
|
||||
b){this.H=a[6].call(this,this.H,b.call(this))},function(a,b){this.F=a[6].call(this,this.F,b.call(this))},function(a,b){this.D=a[6].call(this,this.D,b.call(this))},function(a,b){this.G=a[7].call(this,this.G,b.call(this))},function(a,b){this.I=a[7].call(this,this.I,b.call(this))},function(a,b){this.J=a[7].call(this,this.J,b.call(this))},function(a,b){this.B=a[7].call(this,this.B,b.call(this))},function(a,b){this.X=a[7].call(this,this.X,b.call(this))},function(a,b){this.H=a[7].call(this,this.H,b.call(this))},
|
||||
function(a,b){this.F=a[7].call(this,this.F,b.call(this))},function(a,b){this.D=a[7].call(this,this.D,b.call(this))}],xg=[function(){var a=this.aa();16>(a&56)&&(this.Y|=1);vg[a].call(this,cc,td)},function(){var a=this.aa();a&16||(this.Y|=1);vg[a].call(this,wg,td)},function(){P[this.aa()].call(this,Sd)},function(){P[this.aa()].call(this,Td)},N,N,N,N,N,N,N,G,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
|
||||
N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N],dc=[function(){this.A-=2+(0>this.da?0:1);return this.De.ua},function(){this.A-=2+(0>this.da?0:1);return this.Lg.ua},function(a){this.Y|=2;this.De.load(a);this.A-=
|
||||
17+(0>this.da?0:2);return a},function(a){this.Y|=2;this.Lg.load(a);this.A-=17+(0>this.da?0:2);return a},function(a){this.Y|=2;this.A-=14+(0>this.da?0:2);if(0<=this.tb.load(a,!0)&&2048!=(this.tb.lc&2560)&&(3072==(this.tb.lc&3072)||this.tb.uc>=(this.Ia.ua&3)&&this.tb.uc>=(a&3)))return Ac(this),a;wc(this);return a},function(a){this.Y|=2;this.A-=14+(0>this.da?0:2);if(0<=this.tb.load(a,!0)&&512==(this.tb.lc&2560)&&this.tb.uc>=(this.Ia.ua&3)&&this.tb.uc>=(a&3))return Ac(this),a;wc(this);return a},L,L],
|
||||
N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N],dc=[function(){this.A-=2+(0>this.da?0:1);return this.De.ua},function(){this.A-=2+(0>this.da?0:1);return this.Ng.ua},function(a){this.Y|=2;this.De.load(a);this.A-=
|
||||
17+(0>this.da?0:2);return a},function(a){this.Y|=2;this.Ng.load(a);this.A-=17+(0>this.da?0:2);return a},function(a){this.Y|=2;this.A-=14+(0>this.da?0:2);if(0<=this.ub.load(a,!0)&&2048!=(this.ub.lc&2560)&&(3072==(this.ub.lc&3072)||this.ub.uc>=(this.Ia.ua&3)&&this.ub.uc>=(a&3)))return Ac(this),a;wc(this);return a},function(a){this.Y|=2;this.A-=14+(0>this.da?0:2);if(0<=this.ub.load(a,!0)&&512==(this.ub.lc&2560)&&this.ub.uc>=(this.Ia.ua&3)&&this.ub.uc>=(a&3))return Ac(this),a;wc(this);return a},L,L],
|
||||
ec=[Sb,Sb,Sb,Sb,Sb,Sb,L,L],cc=ec,wg=[function(a){0>this.da?G.call(this):(Fc(this,this.da+2,this.Rc),Ec(this,this.da+4,this.Rc>>16),a=this.Ne-this.Rc,this.A-=11);return a},function(a){0>this.da?G.call(this):(Fc(this,this.da+2,this.Sc),Ec(this,this.da+4,this.Sc>>16),a=this.me-this.Sc,this.A-=12);return a},function(a){0>this.da?G.call(this):(this.Rc=F(this,this.da+2)|Dc(this,this.da+4)<<16,this.Ne=this.Rc+a,this.Y|=2,this.A-=11);return a},function(a){0>this.da?G.call(this):(this.Sc=F(this,this.da+2)|
|
||||
Dc(this,this.da+4)<<16,this.me=this.Sc+a,this.Y|=2,this.A-=12);return a},function(){this.A-=2+(0>this.da?0:1);return this.ed},L,function(a){this.ed=this.ed&65520|a&-65521;this.A-=3+(0>this.da?0:3);this.ed&1&&$b(this,!0);this.Y|=2;return a},L];function Ub(){xg[this.aa()].call(this)}function Wb(){K(this,this.X);this.A-=this.$b}function Bb(){var a=this.X;K(this,this.G);K(this,this.I);K(this,this.J);K(this,this.B);K(this,a);K(this,this.H);K(this,this.F);K(this,this.D);this.A-=this.wk}
|
||||
function Cb(){this.D=this.Aa();this.F=this.Aa();this.H=this.Aa();this.X+=2;this.B=this.Aa();this.J=this.Aa();this.I=this.Aa();this.G=this.Aa();this.A-=this.uk}function Db(){P[this.aa()].call(this,Qd)}function Vb(){O[this.aa()].call(this,Rd)}function Eb(){K(this,this.K());this.A-=this.$b}function Fb(){P[this.aa()].call(this,Ld)}function Gb(){K(this,this.aa());this.A-=this.$b}function Hb(){P[this.aa()].call(this,Kd)}
|
||||
function Ib(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=Ua(this.ma,this.J,this.Da-b-1);Ec(this,this.ib.Nb(this.D,0),d);this.D=this.D+(this.Ha&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}}
|
||||
function Jb(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=this.Da-b-1,d=Ua(this.ma,this.J,d)|Ua(this.ma,this.J,d)<<8;Fc(this,this.ib.Nb(this.D,1),d);this.D=this.D+(this.Ha&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}}
|
||||
Dc(this,this.da+4)<<16,this.me=this.Sc+a,this.Y|=2,this.A-=12);return a},function(){this.A-=2+(0>this.da?0:1);return this.ed},L,function(a){this.ed=this.ed&65520|a&-65521;this.A-=3+(0>this.da?0:3);this.ed&1&&$b(this,!0);this.Y|=2;return a},L];function Ub(){xg[this.aa()].call(this)}function Wb(){K(this,this.X);this.A-=this.ac}function Bb(){var a=this.X;K(this,this.G);K(this,this.I);K(this,this.J);K(this,this.B);K(this,a);K(this,this.H);K(this,this.F);K(this,this.D);this.A-=this.zk}
|
||||
function Cb(){this.D=this.Aa();this.F=this.Aa();this.H=this.Aa();this.X+=2;this.B=this.Aa();this.J=this.Aa();this.I=this.Aa();this.G=this.Aa();this.A-=this.xk}function Db(){P[this.aa()].call(this,Qd)}function Vb(){O[this.aa()].call(this,Rd)}function Eb(){K(this,this.K());this.A-=this.ac}function Fb(){P[this.aa()].call(this,Ld)}function Gb(){K(this,this.aa());this.A-=this.ac}function Hb(){P[this.aa()].call(this,Kd)}
|
||||
function Ib(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=Ua(this.ma,this.J,this.Da-b-1);Ec(this,this.jb.Ob(this.D,0),d);this.D=this.D+(this.Ha&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}}
|
||||
function Jb(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=this.Da-b-1,d=Ua(this.ma,this.J,d)|Ua(this.ma,this.J,d)<<8;Fc(this,this.jb.Ob(this.D,1),d);this.D=this.D+(this.Ha&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}}
|
||||
function Kb(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=Dc(this,this.cc.Ic(this.F,0));this.F=this.F+(this.Ha&1024?-1:1)&65535;this.A-=c;this.I-=b;Wa(this.ma,this.J,d,this.Da-b-1);a&&(J(this,-2),this.Y|=256)}}
|
||||
function Lb(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=F(this,this.cc.Ic(this.F,1));this.F=this.F+(this.Ha&1024?-2:2)&65535;this.A-=c;this.I-=b;b=this.Da-b-1;Wa(this.ma,this.J,d&255,b);Wa(this.ma,this.J,d>>8,b);a&&(J(this,-2),this.Y|=256)}}function yg(){var a=this.L();tc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function zg(){var a=this.L();tc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}
|
||||
function Ag(){var a=this.L();oc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Bg(){var a=this.L();oc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}function Cg(){var a=this.L();rc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Dg(){var a=this.L();rc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}function Eg(){var a=this.L();oc(this)||rc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}
|
||||
function Fg(){var a=this.L();oc(this)||rc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}function Gg(){var a=this.L();sc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Hg(){var a=this.L();sc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}function Ig(){var a=this.L();pc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Jg(){var a=this.L();pc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}
|
||||
function Kg(){var a=this.L();!sc(this)!=!tc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Lg(){var a=this.L();!sc(this)==!tc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Mg(){var a=this.L();rc(this)||!sc(this)!=!tc(this)?(I(this,this.qa+a),this.A-=this.Cb):this.A-=this.Db}function Ng(){var a=this.L();rc(this)||!sc(this)!=!tc(this)?this.A-=this.Db:(I(this,this.qa+a),this.A-=this.Cb)}
|
||||
function Og(){ug[this.aa()].call(this,vd,this.aa);this.A-=0>this.Ba?1:this.zg}function Mb(){ug[this.aa()].call(this,Ed,sd)}function Nb(){vg[this.aa()].call(this,Fd,sd)}function Pg(){var a=this.K();I(this,this.Aa());this.X=this.X+a&65535;this.A-=this.Bk}function Qg(){I(this,this.Aa());this.A-=this.yk}
|
||||
function Ob(){var a=this.K(),b=this.aa()&31;this.A-=11;K(this,this.H);var c=this.X;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.H=this.H-2&65535,K(this,F(this,this.Ub.Ic(this.H,1)));K(this,c)}this.H=c;this.X=this.X-a&65535}function Pb(){this.X=this.H;this.H=this.Aa();this.A-=5}function Rg(){var a=this.K();Yb(this,this.Aa(),this.Aa());this.X=this.X+a&65535;this.eh&&bc(this,this.Da);this.A-=this.Ak}function Sg(){Yb(this,this.Aa(),this.Aa());this.A-=this.zk}
|
||||
function Tg(){P[this.aa()].call(this,Md);this.A-=8}function Ug(){this.Y|=36;this.A-=this.sb}function Qb(){N.call(this)}
|
||||
var Ab=[function(){var a=this.aa();sg[a].call(this,Jc)},function(){O[this.aa()].call(this,Rc)},function(){tg[this.aa()].call(this,Jc)},function(){P[this.aa()].call(this,Rc)},function(){this.G=this.G&-256|Jc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Rc.call(this,this.G,this.K());this.A--},function(){K(this,this.ib.ua);this.A-=this.wf},function(){kc(this,this.Aa());this.A-=this.Rb},function(){sg[this.aa()].call(this,Kc)},function(){O[this.aa()].call(this,Sc)},function(){tg[this.aa()].call(this,
|
||||
Kc)},function(){P[this.aa()].call(this,Sc)},function(){this.G=this.G&-256|Kc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Sc.call(this,this.G,this.K());this.A--},function(){K(this,this.Ia.ua);this.A-=this.wf},function(){hc(this,this.Aa());this.A-=this.Rb},function(){sg[this.aa()].call(this,Lc)},function(){O[this.aa()].call(this,Tc)},function(){tg[this.aa()].call(this,Lc)},function(){P[this.aa()].call(this,Tc)},function(){this.G=this.G&-256|Lc.call(this,this.G&255,this.aa());this.A--},
|
||||
function(){this.G=Tc.call(this,this.G,this.K());this.A--},function(){K(this,this.Ub.ua);this.A-=this.wf},function(){jc(this,this.Aa());this.A-=this.Rb},function(){sg[this.aa()].call(this,Mc)},function(){O[this.aa()].call(this,Uc)},function(){tg[this.aa()].call(this,Mc)},function(){P[this.aa()].call(this,Uc)},function(){this.G=this.G&-256|Mc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Uc.call(this,this.G,this.K());this.A--},function(){K(this,this.cc.ua);this.A-=this.wf},function(){ic(this,
|
||||
this.Aa());this.A-=this.Rb},function(){sg[this.aa()].call(this,Nc)},function(){O[this.aa()].call(this,Vc)},function(){tg[this.aa()].call(this,Nc)},function(){P[this.aa()].call(this,Vc)},function(){this.G=this.G&-256|Nc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Vc.call(this,this.G,this.K());this.A--},function(){this.Y|=20;this.C=this.M=this.ib;this.A-=this.sb},function(){var a=this.G&255,b=qc(this),c=this.W&this.$;if(9<(a&15)||b)a+=6,b=!0;if(159<a||c)a+=96,c=!0;this.G=this.G&-256|
|
||||
(this.W=this.fa=a&255);this.$=65536;c&&(this.W|=this.$);b?zc(this):vc(this);this.A-=this.$d},function(){sg[this.aa()].call(this,Oc)},function(){O[this.aa()].call(this,Wc)},function(){tg[this.aa()].call(this,Oc)},function(){P[this.aa()].call(this,Wc)},function(){this.G=this.G&-256|Oc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Wc.call(this,this.G,this.K());this.A--},function(){this.Y|=20;this.C=this.M=this.Ia;this.A-=this.sb},function(){var a=this.G&255,b=qc(this),c=this.W&this.$;if(9<
|
||||
(a&15)||b)a-=6,b=!0;if(159<a||c)a-=96,c=!0;this.G=this.G&-256|(this.W=this.fa=a&255);this.$=65536;c&&(this.W|=this.$);b?zc(this):vc(this);this.A-=this.$d},function(){sg[this.aa()].call(this,Pc)},function(){O[this.aa()].call(this,Xc)},function(){tg[this.aa()].call(this,Pc)},function(){P[this.aa()].call(this,Xc)},function(){this.G=this.G&-256|Pc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Xc.call(this,this.G,this.K());this.A--},function(){this.Y|=20;this.C=this.M=this.Ub;this.A-=this.sb},
|
||||
function Lb(){var a=1,b=0,c=5;this.pa&192&&(a=this.I,b=1,this.pa&256&&(c=4));if(a--){var d=F(this,this.cc.Ic(this.F,1));this.F=this.F+(this.Ha&1024?-2:2)&65535;this.A-=c;this.I-=b;b=this.Da-b-1;Wa(this.ma,this.J,d&255,b);Wa(this.ma,this.J,d>>8,b);a&&(J(this,-2),this.Y|=256)}}function yg(){var a=this.L();tc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function zg(){var a=this.L();tc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}
|
||||
function Ag(){var a=this.L();oc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Bg(){var a=this.L();oc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}function Cg(){var a=this.L();rc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Dg(){var a=this.L();rc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}function Eg(){var a=this.L();oc(this)||rc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}
|
||||
function Fg(){var a=this.L();oc(this)||rc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}function Gg(){var a=this.L();sc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Hg(){var a=this.L();sc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}function Ig(){var a=this.L();pc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Jg(){var a=this.L();pc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}
|
||||
function Kg(){var a=this.L();!sc(this)!=!tc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Lg(){var a=this.L();!sc(this)==!tc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Mg(){var a=this.L();rc(this)||!sc(this)!=!tc(this)?(I(this,this.qa+a),this.A-=this.Db):this.A-=this.Eb}function Ng(){var a=this.L();rc(this)||!sc(this)!=!tc(this)?this.A-=this.Eb:(I(this,this.qa+a),this.A-=this.Db)}
|
||||
function Og(){ug[this.aa()].call(this,vd,this.aa);this.A-=0>this.Ba?1:this.Bg}function Mb(){ug[this.aa()].call(this,Ed,sd)}function Nb(){vg[this.aa()].call(this,Fd,sd)}function Pg(){var a=this.K();I(this,this.Aa());this.X=this.X+a&65535;this.A-=this.Ek}function Qg(){I(this,this.Aa());this.A-=this.Bk}
|
||||
function Ob(){var a=this.K(),b=this.aa()&31;this.A-=11;K(this,this.H);var c=this.X;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.H=this.H-2&65535,K(this,F(this,this.Wb.Ic(this.H,1)));K(this,c)}this.H=c;this.X=this.X-a&65535}function Pb(){this.X=this.H;this.H=this.Aa();this.A-=5}function Rg(){var a=this.K();Yb(this,this.Aa(),this.Aa());this.X=this.X+a&65535;this.gh&&bc(this,this.Da);this.A-=this.Dk}function Sg(){Yb(this,this.Aa(),this.Aa());this.A-=this.Ck}
|
||||
function Tg(){P[this.aa()].call(this,Md);this.A-=8}function Ug(){this.Y|=36;this.A-=this.tb}function Qb(){N.call(this)}
|
||||
var Ab=[function(){var a=this.aa();sg[a].call(this,Jc)},function(){O[this.aa()].call(this,Rc)},function(){tg[this.aa()].call(this,Jc)},function(){P[this.aa()].call(this,Rc)},function(){this.G=this.G&-256|Jc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Rc.call(this,this.G,this.K());this.A--},function(){K(this,this.jb.ua);this.A-=this.wf},function(){kc(this,this.Aa());this.A-=this.Sb},function(){sg[this.aa()].call(this,Kc)},function(){O[this.aa()].call(this,Sc)},function(){tg[this.aa()].call(this,
|
||||
Kc)},function(){P[this.aa()].call(this,Sc)},function(){this.G=this.G&-256|Kc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Sc.call(this,this.G,this.K());this.A--},function(){K(this,this.Ia.ua);this.A-=this.wf},function(){hc(this,this.Aa());this.A-=this.Sb},function(){sg[this.aa()].call(this,Lc)},function(){O[this.aa()].call(this,Tc)},function(){tg[this.aa()].call(this,Lc)},function(){P[this.aa()].call(this,Tc)},function(){this.G=this.G&-256|Lc.call(this,this.G&255,this.aa());this.A--},
|
||||
function(){this.G=Tc.call(this,this.G,this.K());this.A--},function(){K(this,this.Wb.ua);this.A-=this.wf},function(){jc(this,this.Aa());this.A-=this.Sb},function(){sg[this.aa()].call(this,Mc)},function(){O[this.aa()].call(this,Uc)},function(){tg[this.aa()].call(this,Mc)},function(){P[this.aa()].call(this,Uc)},function(){this.G=this.G&-256|Mc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Uc.call(this,this.G,this.K());this.A--},function(){K(this,this.cc.ua);this.A-=this.wf},function(){ic(this,
|
||||
this.Aa());this.A-=this.Sb},function(){sg[this.aa()].call(this,Nc)},function(){O[this.aa()].call(this,Vc)},function(){tg[this.aa()].call(this,Nc)},function(){P[this.aa()].call(this,Vc)},function(){this.G=this.G&-256|Nc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Vc.call(this,this.G,this.K());this.A--},function(){this.Y|=20;this.C=this.M=this.jb;this.A-=this.tb},function(){var a=this.G&255,b=qc(this),c=this.W&this.$;if(9<(a&15)||b)a+=6,b=!0;if(159<a||c)a+=96,c=!0;this.G=this.G&-256|
|
||||
(this.W=this.fa=a&255);this.$=65536;c&&(this.W|=this.$);b?zc(this):vc(this);this.A-=this.$d},function(){sg[this.aa()].call(this,Oc)},function(){O[this.aa()].call(this,Wc)},function(){tg[this.aa()].call(this,Oc)},function(){P[this.aa()].call(this,Wc)},function(){this.G=this.G&-256|Oc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Wc.call(this,this.G,this.K());this.A--},function(){this.Y|=20;this.C=this.M=this.Ia;this.A-=this.tb},function(){var a=this.G&255,b=qc(this),c=this.W&this.$;if(9<
|
||||
(a&15)||b)a-=6,b=!0;if(159<a||c)a-=96,c=!0;this.G=this.G&-256|(this.W=this.fa=a&255);this.$=65536;c&&(this.W|=this.$);b?zc(this):vc(this);this.A-=this.$d},function(){sg[this.aa()].call(this,Pc)},function(){O[this.aa()].call(this,Xc)},function(){tg[this.aa()].call(this,Pc)},function(){P[this.aa()].call(this,Xc)},function(){this.G=this.G&-256|Pc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Xc.call(this,this.G,this.K());this.A--},function(){this.Y|=20;this.C=this.M=this.Wb;this.A-=this.tb},
|
||||
function(){var a=this.G&255,b=this.G>>8,c,d=qc(this);9<(a&15)||d?(a=a+6&15,b=b+1&255,c=d=!0):c=d=!1;this.G=b<<8|(this.W=a);this.$=65536;c&&(this.W|=this.$);d?zc(this):vc(this);this.A-=this.$d},function(){sg[this.aa()].call(this,Qc)},function(){O[this.aa()].call(this,Yc)},function(){tg[this.aa()].call(this,Qc)},function(){P[this.aa()].call(this,Yc)},function(){this.G=this.G&-256|Qc.call(this,this.G&255,this.aa());this.A--},function(){this.G=Yc.call(this,this.G,this.K());this.A--},function(){this.Y|=
|
||||
20;this.C=this.M=this.cc;this.A-=this.sb},function(){var a=this.G&255,b=this.G>>8,c,d=qc(this);9<(a&15)||d?(a=a-6&15,b=b-1&255,c=d=!0):c=d=!1;this.G=b<<8|(this.W=a);this.$=65536;c&&(this.W|=this.$);d?zc(this):vc(this);this.A-=this.$d},function(){this.ha=this.G;this.G=(this.fa=this.G+1)&65535;this.W=this.G|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.I;this.I=(this.fa=this.I+1)&65535;this.W=this.I|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.J;
|
||||
20;this.C=this.M=this.cc;this.A-=this.tb},function(){var a=this.G&255,b=this.G>>8,c,d=qc(this);9<(a&15)||d?(a=a-6&15,b=b-1&255,c=d=!0):c=d=!1;this.G=b<<8|(this.W=a);this.$=65536;c&&(this.W|=this.$);d?zc(this):vc(this);this.A-=this.$d},function(){this.ha=this.G;this.G=(this.fa=this.G+1)&65535;this.W=this.G|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.I;this.I=(this.fa=this.I+1)&65535;this.W=this.I|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.J;
|
||||
this.J=(this.fa=this.J+1)&65535;this.W=this.J|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.B;this.B=(this.fa=this.B+1)&65535;this.W=this.B|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.X;this.X=(this.fa=this.X+1)&65535;this.W=this.X|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.H;this.H=(this.fa=this.H+1)&65535;this.W=this.H|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.F;this.F=(this.fa=this.F+
|
||||
1)&65535;this.W=this.F|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.D;this.D=(this.fa=this.D+1)&65535;this.W=this.D|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.G;this.G=(this.fa=this.G-1)&65535;this.W=this.G|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.I;this.I=(this.fa=this.I-1)&65535;this.W=this.I|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.J;this.J=(this.fa=this.J-1)&65535;this.W=this.J|
|
||||
(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.B;this.B=(this.fa=this.B-1)&65535;this.W=this.B|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.X;this.X=(this.fa=this.X-1)&65535;this.W=this.X|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.H;this.H=(this.fa=this.H-1)&65535;this.W=this.H|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){this.ha=this.F;this.F=(this.fa=this.F-1)&65535;this.W=this.F|(this.W&this.$?1:0)<<
|
||||
16;this.$=65536;this.A-=2},function(){this.ha=this.D;this.D=(this.fa=this.D-1)&65535;this.W=this.D|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){K(this,this.G);this.A-=this.$b},function(){K(this,this.I);this.A-=this.$b},function(){K(this,this.J);this.A-=this.$b},function(){K(this,this.B);this.A-=this.$b},function(){K(this,this.X-2&65535);this.A-=this.$b},function(){K(this,this.H);this.A-=this.$b},function(){K(this,this.F);this.A-=this.$b},function(){K(this,this.D);this.A-=this.$b},function(){this.G=
|
||||
this.Aa();this.A-=this.Rb},function(){this.I=this.Aa();this.A-=this.Rb},function(){this.J=this.Aa();this.A-=this.Rb},function(){this.B=this.Aa();this.A-=this.Rb},function(){this.X=this.Aa();this.A-=this.Rb},function(){this.H=this.Aa();this.A-=this.Rb},function(){this.F=this.Aa();this.A-=this.Rb},function(){this.D=this.Aa();this.A-=this.Rb},yg,zg,Ag,Bg,Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,yg,zg,Ag,Bg,Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,function(){vg[this.aa()].call(this,wd,this.K);this.A-=0>this.Ba?
|
||||
1:this.zg},Og,function(){vg[this.aa()].call(this,wd,this.L);this.A-=0>this.Ba?1:this.zg},function(){sg[this.aa()].call(this,Id)},function(){O[this.aa()].call(this,Jd)},function(){tg[this.Vf=this.aa()].call(this,Ud)},function(){P[this.Vf=this.aa()].call(this,Vd)},function(){this.Y|=1;sg[this.aa()].call(this,Gd)},function(){this.Y|=1;O[this.aa()].call(this,Gd)},function(){tg[this.aa()].call(this,Gd)},function(){P[this.aa()].call(this,Gd)},function(){var a=this.aa();switch((a&56)>>3){case 0:this.nb=
|
||||
this.ib.ua;break;case 1:this.nb=this.Ia.ua;break;case 2:this.nb=this.Ub.ua;break;case 3:this.nb=this.cc.ua;break;default:N.call(this);return}this.Y|=1;O[a].call(this,Hd)},function(){this.Y|=1;this.C=this.M=this.Rk;P[this.aa()].call(this,Nd)},function(){var a,b=this.aa(),c=(b&56)>>3;switch(c){case 0:a=this.G;break;case 2:a=this.J;break;case 3:a=this.B;break;default:if(80286<=this.Ca){G.call(this);return}switch(c){case 1:a=this.I;break;case 4:a=this.X;break;case 5:a=this.H;break;case 6:a=this.F;break;
|
||||
16;this.$=65536;this.A-=2},function(){this.ha=this.D;this.D=(this.fa=this.D-1)&65535;this.W=this.D|(this.W&this.$?1:0)<<16;this.$=65536;this.A-=2},function(){K(this,this.G);this.A-=this.ac},function(){K(this,this.I);this.A-=this.ac},function(){K(this,this.J);this.A-=this.ac},function(){K(this,this.B);this.A-=this.ac},function(){K(this,this.X-2&65535);this.A-=this.ac},function(){K(this,this.H);this.A-=this.ac},function(){K(this,this.F);this.A-=this.ac},function(){K(this,this.D);this.A-=this.ac},function(){this.G=
|
||||
this.Aa();this.A-=this.Sb},function(){this.I=this.Aa();this.A-=this.Sb},function(){this.J=this.Aa();this.A-=this.Sb},function(){this.B=this.Aa();this.A-=this.Sb},function(){this.X=this.Aa();this.A-=this.Sb},function(){this.H=this.Aa();this.A-=this.Sb},function(){this.F=this.Aa();this.A-=this.Sb},function(){this.D=this.Aa();this.A-=this.Sb},yg,zg,Ag,Bg,Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,yg,zg,Ag,Bg,Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,function(){vg[this.aa()].call(this,wd,this.K);this.A-=0>this.Ba?
|
||||
1:this.Bg},Og,function(){vg[this.aa()].call(this,wd,this.L);this.A-=0>this.Ba?1:this.Bg},function(){sg[this.aa()].call(this,Id)},function(){O[this.aa()].call(this,Jd)},function(){tg[this.Vf=this.aa()].call(this,Ud)},function(){P[this.Vf=this.aa()].call(this,Vd)},function(){this.Y|=1;sg[this.aa()].call(this,Gd)},function(){this.Y|=1;O[this.aa()].call(this,Gd)},function(){tg[this.aa()].call(this,Gd)},function(){P[this.aa()].call(this,Gd)},function(){var a=this.aa();switch((a&56)>>3){case 0:this.ob=
|
||||
this.jb.ua;break;case 1:this.ob=this.Ia.ua;break;case 2:this.ob=this.Wb.ua;break;case 3:this.ob=this.cc.ua;break;default:N.call(this);return}this.Y|=1;O[a].call(this,Hd)},function(){this.Y|=1;this.C=this.M=this.Uk;P[this.aa()].call(this,Nd)},function(){var a,b=this.aa(),c=(b&56)>>3;switch(c){case 0:a=this.G;break;case 2:a=this.J;break;case 3:a=this.B;break;default:if(80286<=this.Ca){G.call(this);return}switch(c){case 1:a=this.I;break;case 4:a=this.X;break;case 5:a=this.H;break;case 6:a=this.F;break;
|
||||
case 7:a=this.D}}P[b].call(this,Gd);switch(c){case 0:kc(this,this.G);this.G=a;break;case 1:hc(this,this.I);this.I=a;break;case 2:jc(this,this.J);this.J=a;break;case 3:ic(this,this.B);this.B=a;break;case 4:kc(this,this.X);this.X=a;break;case 5:hc(this,this.H);this.H=a;break;case 6:jc(this,this.F);this.F=a;break;case 7:ic(this,this.D),this.D=a}},function(){this.Y|=1;vg[this.aa()].call(this,xd,this.Aa)},function(){this.A-=3},function(){var a=this.G;this.G=this.I;this.I=a;this.A-=3},function(){var a=
|
||||
this.G;this.G=this.J;this.J=a;this.A-=3},function(){var a=this.G;this.G=this.B;this.B=a;this.A-=3},function(){var a=this.G;this.G=this.X;this.X=a;this.A-=3},function(){var a=this.G;this.G=this.H;this.H=a;this.A-=3},function(){var a=this.G;this.G=this.F;this.F=a;this.A-=3},function(){var a=this.G;this.G=this.D;this.D=a;this.A-=3},function(){this.G=this.G<<24>>24&65535;this.A-=2},function(){this.J=this.G&32768?65535:0;this.A-=this.Ij},function(){var a=this.K(),b=this.K();K(this,this.Ia.ua);K(this,this.qa);
|
||||
Yb(this,a,b);this.A-=this.Lj},function(){N.call(this)},function(){K(this,ac(this));this.A-=this.$b},function(){Zb(this,this.Aa());this.A-=this.Rb},function(){var a=this.G>>8;a&1?yc(this):uc(this);a&4?pc(this)||(this.fa^=1):pc(this)&&(this.fa^=1);a&16?zc(this):vc(this);a&64?Ac(this):wc(this);a&128?Bc(this):sc(this)&&(this.fa^=this.$>>1|this.$>>2,this.ha^=32896);this.A-=this.mb},function(){this.G=this.G&255|(ac(this)&213)<<8;this.A-=this.mb},function(){this.G=this.G&-256|this.S(this.C,this.K());this.A-=
|
||||
this.hi},function(){this.G=this.T(this.C,this.K());this.A-=this.hi},function(){var a=this.K(),b=this.G;Ec(this,this.C.Nb(a,0),b);this.A-=this.ii},function(){var a=this.K(),b=this.G;Fc(this,this.C.Nb(a,1),b);this.A-=this.ii},function(){var a=1,b=0,c=this.ji;this.pa&192&&(a=this.I,b=1,c=this.li,this.pa&256||(this.A-=this.ki));if(a--){var d=this.Ha&1024?-1:1,e=this.S(this.C,this.F);Ec(this,this.ib.Nb(this.D,0),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.pa&16?-3:
|
||||
-2),this.Y|=256)}},function(){var a=1,b=0,c=this.ji;this.pa&192&&(a=this.I,b=1,c=this.li,this.pa&256||(this.A-=this.ki));if(a--){var d=this.Ha&1024?-2:2,e=this.T(this.C,this.F);Fc(this,this.ib.Nb(this.D,1),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.pa&16?-3:-2),this.Y|=256)}},function(){var a=1,b=0,c=this.Uh;this.pa&192&&(a=this.I,b=1,c=this.Wh,this.pa&256||(this.A-=this.Vh));if(a--){var d=this.Ha&1024?-1:1,e=this.S(this.C,this.F),f=this.N(this.ib,this.D);Qc.call(this,
|
||||
e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.fb;this.I-=b;a&&rc(this)==(this.pa&64)&&(J(this,this.pa&16?-3:-2),this.Y|=256)}},function(){var a=1,b=0,c=this.Uh;this.pa&192&&(a=this.I,b=1,c=this.Wh,this.pa&256||(this.A-=this.Vh));if(a--){var d=this.Ha&1024?-2:2,e=this.T(this.C,this.F),f=this.O(this.ib,this.D);Yc.call(this,e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.fb;this.I-=b;a&&rc(this)==(this.pa&64)&&(J(this,this.pa&16?-3:-2),this.Y|=256)}},function(){this.W=
|
||||
this.fa=this.ha=this.G&255&this.aa();this.$=256;this.A-=this.$d},function(){this.W=this.fa=this.ha=this.G&this.K();this.$=65536;this.A-=this.$d},function(){var a=1,b=0,c=this.ui;this.pa&192&&(a=this.I,b=1,c=this.wi,this.pa&256||(this.A-=this.vi));if(a--){var d=this.G;Ec(this,this.ib.Nb(this.D,0),d);this.D=this.D+(this.Ha&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}},function(){var a=1,b=0,c=this.ui;this.pa&192&&(a=this.I,b=1,c=this.wi,this.pa&256||(this.A-=this.vi));if(a--){var d=
|
||||
this.G;Fc(this,this.ib.Nb(this.D,1),d);this.D=this.D+(this.Ha&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}},function(){var a=1,b=0,c=this.bi;this.pa&192&&(a=this.I,b=1,c=this.di,this.pa&256||(this.A-=this.ci));a--&&(this.G=this.G&-256|this.S(this.C,this.F),this.F=this.F+(this.Ha&1024?-1:1)&65535,this.A-=c,this.I-=b,a&&(J(this,this.pa&16?-3:-2),this.Y|=256))},function(){var a=1,b=0,c=this.bi;this.pa&192&&(a=this.I,b=1,c=this.di,this.pa&256||(this.A-=this.ci));a--&&(this.G=this.T(this.C,
|
||||
this.F),this.F=this.F+(this.Ha&1024?-2:2)&65535,this.A-=c,this.I-=b,a&&(J(this,this.pa&16?-3:-2),this.Y|=256))},function(){var a=1,b=0,c=this.oi;this.pa&192&&(a=this.I,b=1,c=this.qi,this.pa&256||(this.A-=this.pi));a--&&(Qc.call(this,this.G&255,this.N(this.ib,this.D)),this.D=this.D+(this.Ha&1024?-1:1)&65535,this.A-=c-this.fb,this.I-=b,a&&rc(this)==(this.pa&64)&&(J(this,-2),this.Y|=256))},function(){var a=1,b=0,c=this.oi;this.pa&192&&(a=this.I,b=1,c=this.qi,this.pa&256||(this.A-=this.pi));a--&&(Yc.call(this,
|
||||
this.G,this.O(this.ib,this.D)),this.D=this.D+(this.Ha&1024?-2:2)&65535,this.A-=c-this.fb,this.I-=b,a&&rc(this)==(this.pa&64)&&(J(this,-2),this.Y|=256))},function(){this.G=this.G&-256|this.aa();this.A-=this.mb},function(){this.I=this.I&-256|this.aa();this.A-=this.mb},function(){this.J=this.J&-256|this.aa();this.A-=this.mb},function(){this.B=this.B&-256|this.aa();this.A-=this.mb},function(){this.G=this.G&255|this.aa()<<8;this.A-=this.mb},function(){this.I=this.I&255|this.aa()<<8;this.A-=this.mb},function(){this.J=
|
||||
this.J&255|this.aa()<<8;this.A-=this.mb},function(){this.B=this.B&255|this.aa()<<8;this.A-=this.mb},function(){this.G=this.K();this.A-=this.mb},function(){this.I=this.K();this.A-=this.mb},function(){this.J=this.K();this.A-=this.mb},function(){this.B=this.K();this.A-=this.mb},function(){this.X=this.K();this.A-=this.mb},function(){this.H=this.K();this.A-=this.mb},function(){this.F=this.K();this.A-=this.mb},function(){this.D=this.K();this.A-=this.mb},Pg,Qg,Pg,Qg,function(){P[this.aa()].call(this,Pd)},
|
||||
function(){P[this.aa()].call(this,Od)},function(){this.Y|=1;ug[this.aa()].call(this,yd,this.aa)},function(){this.Y|=1;vg[this.aa()].call(this,yd,this.K)},Rg,Sg,Rg,Sg,function(){Hc.call(this,3,null,this.bk)},function(){var a=this.aa(),b;a:{b=this.Zk[a];if(void 0!==b)for(var c=0;c<b.length;c++)if(!b[c][1].call(b[c][0],this.Da)){b=!1;break a}b=!0}b?Hc.call(this,a,null,0):this.A--},function(){tc(this)?Hc.call(this,4,null,this.ck):this.A-=this.dk},function(){Yb(this,this.Aa(),this.Aa());Zb(this,this.Aa());
|
||||
this.eh&&bc(this,this.Da);this.A-=this.$j},function(){ug[this.aa()].call(this,zd,qd)},function(){vg[this.aa()].call(this,Ad,qd)},function(){ug[this.aa()].call(this,zd,rd)},function(){vg[this.aa()].call(this,Ad,rd)},function(){var a=this.aa(),b=this.G&255;this.G=(b/a&255)<<8|b%a;this.$=256;this.W=this.fa=b;this.A-=this.Fj},function(){var a=this.aa();this.W=this.fa=this.G=(this.G>>8)*a+this.G&255;this.$=256;this.A-=this.Ej},function(){this.G=this.G&-256|(oc(this)?255:0);this.A-=2},function(){this.G=
|
||||
this.G&-256|this.S(this.C,this.B+(this.G&255)&65535);this.A-=this.Dk},Tg,Tg,Tg,Tg,Tg,Tg,Tg,Tg,function(){var a=this.L();(this.I=this.I-1&65535)&&this.W&this.$-1?(I(this,this.qa+a),this.A-=this.kk):this.A-=this.ei},function(){var a=this.L();!(this.I=this.I-1&65535)||this.W&this.$-1?this.A-=this.gi:(I(this,this.qa+a),this.A-=this.fi)},function(){var a=this.L();(this.I=this.I-1&65535)?(I(this,this.qa+a),this.A-=this.jk):this.A-=this.ei},function(){var a=this.L();this.I?this.A-=this.gi:(I(this,this.qa+
|
||||
a),this.A-=this.fi)},function(){var a=this.aa();this.G=this.G&-256|Ua(this.ma,a,this.Da-2);this.A-=this.Zh},function(){var a=this.aa();this.G=Ua(this.ma,a,this.Da-1)|Ua(this.ma,a+1&65535,this.Da-2)<<8;this.A-=this.Zh},function(){var a=this.aa();Wa(this.ma,a,this.G&255,this.Da-2);this.A-=this.ni},function(){var a=this.aa();Wa(this.ma,a,this.G&255,this.Da-2);Wa(this.ma,a+1&65535,this.G>>8,this.Da-2);this.A-=this.ni},function(){var a=this.K();K(this,this.qa);I(this,this.qa+a);this.A-=this.Jj},function(){var a=
|
||||
this.K();I(this,this.qa+a);this.A-=this.$h},function(){Yb(this,this.K(),this.K());this.A-=this.fk},function(){var a=this.L();I(this,this.qa+a);this.A-=this.$h},function(){this.G=this.G&-256|Ua(this.ma,this.J,this.Da-1);this.A-=this.Yh},function(){this.G=Ua(this.ma,this.J,this.Da-1)|Ua(this.ma,this.J+1&65535,this.Da-1)<<8;this.A-=this.Yh},function(){Wa(this.ma,this.J,this.G&255,this.Da-1);this.A-=this.mi},function(){Wa(this.ma,this.J,this.G&255,this.Da-1);Wa(this.ma,this.J+1&65535,this.G>>8,this.Da-
|
||||
1);this.A-=this.mi},Ug,Ug,function(){this.Y|=132;this.A-=this.sb},function(){this.Y|=68;this.A-=this.sb},function(){this.Ya|=4;this.A-=2;this.Ha&512||db(this)},function(){oc(this)?uc(this):yc(this);this.A-=2},function(){this.nb=-1;ug[this.aa()].call(this,Cd,td);0<=this.nb&&(this.G=this.nb)},function(){this.nb=-1;vg[this.aa()].call(this,Dd,td);0<=this.nb&&(this.G=this.nb,this.J=this.Bf)},function(){this.W&=~this.$;this.A-=2},function(){this.W|=this.$;this.A-=2},function(){this.Ha&=-513;this.A-=this.Hj},
|
||||
this.G;this.G=this.J;this.J=a;this.A-=3},function(){var a=this.G;this.G=this.B;this.B=a;this.A-=3},function(){var a=this.G;this.G=this.X;this.X=a;this.A-=3},function(){var a=this.G;this.G=this.H;this.H=a;this.A-=3},function(){var a=this.G;this.G=this.F;this.F=a;this.A-=3},function(){var a=this.G;this.G=this.D;this.D=a;this.A-=3},function(){this.G=this.G<<24>>24&65535;this.A-=2},function(){this.J=this.G&32768?65535:0;this.A-=this.Lj},function(){var a=this.K(),b=this.K();K(this,this.Ia.ua);K(this,this.qa);
|
||||
Yb(this,a,b);this.A-=this.Oj},function(){N.call(this)},function(){K(this,ac(this));this.A-=this.ac},function(){Zb(this,this.Aa());this.A-=this.Sb},function(){var a=this.G>>8;a&1?yc(this):uc(this);a&4?pc(this)||(this.fa^=1):pc(this)&&(this.fa^=1);a&16?zc(this):vc(this);a&64?Ac(this):wc(this);a&128?Bc(this):sc(this)&&(this.fa^=this.$>>1|this.$>>2,this.ha^=32896);this.A-=this.nb},function(){this.G=this.G&255|(ac(this)&213)<<8;this.A-=this.nb},function(){this.G=this.G&-256|this.S(this.C,this.K());this.A-=
|
||||
this.ki},function(){this.G=this.T(this.C,this.K());this.A-=this.ki},function(){var a=this.K(),b=this.G;Ec(this,this.C.Ob(a,0),b);this.A-=this.li},function(){var a=this.K(),b=this.G;Fc(this,this.C.Ob(a,1),b);this.A-=this.li},function(){var a=1,b=0,c=this.mi;this.pa&192&&(a=this.I,b=1,c=this.oi,this.pa&256||(this.A-=this.ni));if(a--){var d=this.Ha&1024?-1:1,e=this.S(this.C,this.F);Ec(this,this.jb.Ob(this.D,0),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.pa&16?-3:
|
||||
-2),this.Y|=256)}},function(){var a=1,b=0,c=this.mi;this.pa&192&&(a=this.I,b=1,c=this.oi,this.pa&256||(this.A-=this.ni));if(a--){var d=this.Ha&1024?-2:2,e=this.T(this.C,this.F);Fc(this,this.jb.Ob(this.D,1),e);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c;this.I-=b;a&&(J(this,this.pa&16?-3:-2),this.Y|=256)}},function(){var a=1,b=0,c=this.Xh;this.pa&192&&(a=this.I,b=1,c=this.Zh,this.pa&256||(this.A-=this.Yh));if(a--){var d=this.Ha&1024?-1:1,e=this.S(this.C,this.F),f=this.N(this.jb,this.D);Qc.call(this,
|
||||
e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.fb;this.I-=b;a&&rc(this)==(this.pa&64)&&(J(this,this.pa&16?-3:-2),this.Y|=256)}},function(){var a=1,b=0,c=this.Xh;this.pa&192&&(a=this.I,b=1,c=this.Zh,this.pa&256||(this.A-=this.Yh));if(a--){var d=this.Ha&1024?-2:2,e=this.T(this.C,this.F),f=this.O(this.jb,this.D);Yc.call(this,e,f);this.F=this.F+d&65535;this.D=this.D+d&65535;this.A-=c-this.fb;this.I-=b;a&&rc(this)==(this.pa&64)&&(J(this,this.pa&16?-3:-2),this.Y|=256)}},function(){this.W=
|
||||
this.fa=this.ha=this.G&255&this.aa();this.$=256;this.A-=this.$d},function(){this.W=this.fa=this.ha=this.G&this.K();this.$=65536;this.A-=this.$d},function(){var a=1,b=0,c=this.xi;this.pa&192&&(a=this.I,b=1,c=this.zi,this.pa&256||(this.A-=this.yi));if(a--){var d=this.G;Ec(this,this.jb.Ob(this.D,0),d);this.D=this.D+(this.Ha&1024?-1:1)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}},function(){var a=1,b=0,c=this.xi;this.pa&192&&(a=this.I,b=1,c=this.zi,this.pa&256||(this.A-=this.yi));if(a--){var d=
|
||||
this.G;Fc(this,this.jb.Ob(this.D,1),d);this.D=this.D+(this.Ha&1024?-2:2)&65535;this.A-=c;this.I-=b;a&&(J(this,-2),this.Y|=256)}},function(){var a=1,b=0,c=this.ei;this.pa&192&&(a=this.I,b=1,c=this.gi,this.pa&256||(this.A-=this.fi));a--&&(this.G=this.G&-256|this.S(this.C,this.F),this.F=this.F+(this.Ha&1024?-1:1)&65535,this.A-=c,this.I-=b,a&&(J(this,this.pa&16?-3:-2),this.Y|=256))},function(){var a=1,b=0,c=this.ei;this.pa&192&&(a=this.I,b=1,c=this.gi,this.pa&256||(this.A-=this.fi));a--&&(this.G=this.T(this.C,
|
||||
this.F),this.F=this.F+(this.Ha&1024?-2:2)&65535,this.A-=c,this.I-=b,a&&(J(this,this.pa&16?-3:-2),this.Y|=256))},function(){var a=1,b=0,c=this.ri;this.pa&192&&(a=this.I,b=1,c=this.ti,this.pa&256||(this.A-=this.si));a--&&(Qc.call(this,this.G&255,this.N(this.jb,this.D)),this.D=this.D+(this.Ha&1024?-1:1)&65535,this.A-=c-this.fb,this.I-=b,a&&rc(this)==(this.pa&64)&&(J(this,-2),this.Y|=256))},function(){var a=1,b=0,c=this.ri;this.pa&192&&(a=this.I,b=1,c=this.ti,this.pa&256||(this.A-=this.si));a--&&(Yc.call(this,
|
||||
this.G,this.O(this.jb,this.D)),this.D=this.D+(this.Ha&1024?-2:2)&65535,this.A-=c-this.fb,this.I-=b,a&&rc(this)==(this.pa&64)&&(J(this,-2),this.Y|=256))},function(){this.G=this.G&-256|this.aa();this.A-=this.nb},function(){this.I=this.I&-256|this.aa();this.A-=this.nb},function(){this.J=this.J&-256|this.aa();this.A-=this.nb},function(){this.B=this.B&-256|this.aa();this.A-=this.nb},function(){this.G=this.G&255|this.aa()<<8;this.A-=this.nb},function(){this.I=this.I&255|this.aa()<<8;this.A-=this.nb},function(){this.J=
|
||||
this.J&255|this.aa()<<8;this.A-=this.nb},function(){this.B=this.B&255|this.aa()<<8;this.A-=this.nb},function(){this.G=this.K();this.A-=this.nb},function(){this.I=this.K();this.A-=this.nb},function(){this.J=this.K();this.A-=this.nb},function(){this.B=this.K();this.A-=this.nb},function(){this.X=this.K();this.A-=this.nb},function(){this.H=this.K();this.A-=this.nb},function(){this.F=this.K();this.A-=this.nb},function(){this.D=this.K();this.A-=this.nb},Pg,Qg,Pg,Qg,function(){P[this.aa()].call(this,Pd)},
|
||||
function(){P[this.aa()].call(this,Od)},function(){this.Y|=1;ug[this.aa()].call(this,yd,this.aa)},function(){this.Y|=1;vg[this.aa()].call(this,yd,this.K)},Rg,Sg,Rg,Sg,function(){Hc.call(this,3,null,this.ek)},function(){var a=this.aa(),b;a:{b=this.bl[a];if(void 0!==b)for(var c=0;c<b.length;c++)if(!b[c][1].call(b[c][0],this.Da)){b=!1;break a}b=!0}b?Hc.call(this,a,null,0):this.A--},function(){tc(this)?Hc.call(this,4,null,this.fk):this.A-=this.gk},function(){Yb(this,this.Aa(),this.Aa());Zb(this,this.Aa());
|
||||
this.gh&&bc(this,this.Da);this.A-=this.ck},function(){ug[this.aa()].call(this,zd,qd)},function(){vg[this.aa()].call(this,Ad,qd)},function(){ug[this.aa()].call(this,zd,rd)},function(){vg[this.aa()].call(this,Ad,rd)},function(){var a=this.aa(),b=this.G&255;this.G=(b/a&255)<<8|b%a;this.$=256;this.W=this.fa=b;this.A-=this.Ij},function(){var a=this.aa();this.W=this.fa=this.G=(this.G>>8)*a+this.G&255;this.$=256;this.A-=this.Hj},function(){this.G=this.G&-256|(oc(this)?255:0);this.A-=2},function(){this.G=
|
||||
this.G&-256|this.S(this.C,this.B+(this.G&255)&65535);this.A-=this.Gk},Tg,Tg,Tg,Tg,Tg,Tg,Tg,Tg,function(){var a=this.L();(this.I=this.I-1&65535)&&this.W&this.$-1?(I(this,this.qa+a),this.A-=this.nk):this.A-=this.hi},function(){var a=this.L();!(this.I=this.I-1&65535)||this.W&this.$-1?this.A-=this.ji:(I(this,this.qa+a),this.A-=this.ii)},function(){var a=this.L();(this.I=this.I-1&65535)?(I(this,this.qa+a),this.A-=this.mk):this.A-=this.hi},function(){var a=this.L();this.I?this.A-=this.ji:(I(this,this.qa+
|
||||
a),this.A-=this.ii)},function(){var a=this.aa();this.G=this.G&-256|Ua(this.ma,a,this.Da-2);this.A-=this.bi},function(){var a=this.aa();this.G=Ua(this.ma,a,this.Da-1)|Ua(this.ma,a+1&65535,this.Da-2)<<8;this.A-=this.bi},function(){var a=this.aa();Wa(this.ma,a,this.G&255,this.Da-2);this.A-=this.qi},function(){var a=this.aa();Wa(this.ma,a,this.G&255,this.Da-2);Wa(this.ma,a+1&65535,this.G>>8,this.Da-2);this.A-=this.qi},function(){var a=this.K();K(this,this.qa);I(this,this.qa+a);this.A-=this.Mj},function(){var a=
|
||||
this.K();I(this,this.qa+a);this.A-=this.ci},function(){Yb(this,this.K(),this.K());this.A-=this.ik},function(){var a=this.L();I(this,this.qa+a);this.A-=this.ci},function(){this.G=this.G&-256|Ua(this.ma,this.J,this.Da-1);this.A-=this.ai},function(){this.G=Ua(this.ma,this.J,this.Da-1)|Ua(this.ma,this.J+1&65535,this.Da-1)<<8;this.A-=this.ai},function(){Wa(this.ma,this.J,this.G&255,this.Da-1);this.A-=this.pi},function(){Wa(this.ma,this.J,this.G&255,this.Da-1);Wa(this.ma,this.J+1&65535,this.G>>8,this.Da-
|
||||
1);this.A-=this.pi},Ug,Ug,function(){this.Y|=132;this.A-=this.tb},function(){this.Y|=68;this.A-=this.tb},function(){this.Ya|=4;this.A-=2;this.Ha&512||db(this)},function(){oc(this)?uc(this):yc(this);this.A-=2},function(){this.ob=-1;ug[this.aa()].call(this,Cd,td);0<=this.ob&&(this.G=this.ob)},function(){this.ob=-1;vg[this.aa()].call(this,Dd,td);0<=this.ob&&(this.G=this.ob,this.J=this.Bf)},function(){this.W&=~this.$;this.A-=2},function(){this.W|=this.$;this.A-=2},function(){this.Ha&=-513;this.A-=this.Kj},
|
||||
function(){this.Ha|=512;this.Y|=4;this.A-=2},function(){this.Ha&=-1025;this.A-=2},function(){this.Ha|=1024;this.A-=2},function(){ug[this.aa()].call(this,Rb,td)},function(){vg[this.aa()].call(this,Tb,td)}];
|
||||
function Q(a){w.call(this,"ChipSet",a,Q);this.Ca=a.model;this.Ca=void 0!==this.Ca?parseInt(this.Ca,10):Vg;this.Eb=0;var b=a.sw1;if(b)this.Eb=Wg(b,Xg|Yg.Yk);else if(b=a.fdrives||2,this.Eb|=Zg.Sg,b--,this.Eb|=(b&3)<<Zg.Ke,b=a.monitor||(this.Ca<$g?"mono":"ega"),void 0!==ah[b])this.Eb|=ah[b]<<Yg.Ke;this.Gd=Wg(a.sw2||"11110000",0);this.nm=this.Ca==Vg?16:64;this.Ve=this.We=1;this.Ca>=$g&&(this.Ve=this.We=2);this.kg=a.scaleTimers||!1;this.Gn=a.rtcDate;this.pj=!1;a.sound&&window&&"webkitAudioContext"in window&&
|
||||
(this.hh=new webkitAudioContext);this.reset();this.Pa()}z(w,Q);var Vg=5150,$g=5170,ah={none:0,tv:1,color:2,mono:3,ega:0},Zg={Sg:1,ONE:0,no:64,lo:128,Sn:192,Je:192,Ke:6},Xg=12,Yg={mo:16,Nn:32,Yk:48,Je:48,Ke:4};g=Q.prototype;
|
||||
g.ub=function(a,b,c,d){switch(c){case "sw1":return this.oa[c]=d,bh(this,c,d,this.Eb,{0:this.Ca==Vg?"Bootable Floppy Drive":"Loop on POST",1:this.Ca==Vg?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Ca==Vg)return this.oa[c]=d,bh(this,c,d,this.Gd,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.oa[c]=d,!0}return!1};
|
||||
g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.Qa=D(a,"Keyboard");this.Ek=Math.round(c.cd/1193181);Ta(b,this,ch);Va(b,this,dh);this.Ca<$g?(Ta(b,this,eh),Va(b,this,fh)):(Ta(b,this,gh),Va(b,this,hh))};g.Sb=function(a,b){if(!b)if(!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};g.Jb=function(a){return a&&this.save?this.save():!0};
|
||||
g.reset=function(a){var b;this.Gc=this.Eb;this.ge=this.Gd;ih(this);this.va=Array(this.Ve);for(b=0;b<this.Ve;b++)jh(this,b);this.ob=Array(this.We);kh(this,0,32);1<this.We&&kh(this,1,160);this.dh=void 0;this.Gb=Array(3);for(b=0;b<this.Gb.length;b++)lh(this,b);this.Ue=this.ah=this.hc=this.Xf=void 0;this.Wf=0;if(this.Ca>=$g){this.bb=16;this.Tc=0;this.kd=16;this.Rf=0;this.Md=160;512<=mh(this)&&(this.Md|=16);3==nh(this)&&(this.Md|=64);this.Zg=3;this.Uf=0;this.Hb=Array(7);this.ne=0;a||(this.ka=Array(64));
|
||||
oh(this,this.Gn);for(a=14;46>a;a++)void 0===this.ka[a]&&(this.ka[a]=0);this.ka[20]=this.Gc&(Yg.Je|2|Zg.Sg|Zg.Je);this.ka[16]=ph(this,0)<<4|ph(this,1);qh(this)}};
|
||||
function oh(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.Tb("CMOS date invalid ("+b+"), using "+c)):b&&a.Tb("CMOS date: "+c);a.ka[0]=c.getSeconds();a.ka[1]=0;a.ka[2]=c.getMinutes();a.ka[3]=0;a.ka[4]=c.getHours();a.ka[5]=0;a.ka[6]=c.getDay()+1;a.ka[7]=c.getDate();a.ka[8]=c.getMonth()+1;c=c.getFullYear();a.ka[9]=c%100;c/=100;a.ka[50]=c%10|c/10<<4;a.jf=-1;a.ka[10]=38;a.ka[11]=2;a.ka[12]=0;a.ka[13]=128}
|
||||
function Q(a){w.call(this,"ChipSet",a,Q);this.Ca=a.model;this.Ca=void 0!==this.Ca?parseInt(this.Ca,10):Vg;this.Fb=0;var b=a.sw1;if(b)this.Fb=Wg(b,Xg|Yg.al);else if(b=a.fdrives||2,this.Fb|=Zg.Ug,b--,this.Fb|=(b&3)<<Zg.Ke,b=a.monitor||(this.Ca<$g?"mono":"ega"),void 0!==ah[b])this.Fb|=ah[b]<<Yg.Ke;this.Gd=Wg(a.sw2||"11110000",0);this.qm=this.Ca==Vg?16:64;this.Ve=this.We=1;this.Ca>=$g&&(this.Ve=this.We=2);this.kg=a.scaleTimers||!1;this.Jn=a.rtcDate;this.sj=!1;a.sound&&window&&"webkitAudioContext"in window&&
|
||||
(this.jh=new webkitAudioContext);this.reset();this.Pa()}z(w,Q);var Vg=5150,$g=5170,ah={none:0,tv:1,color:2,mono:3,ega:0},Zg={Ug:1,ONE:0,qo:64,oo:128,Vn:192,Je:192,Ke:6},Xg=12,Yg={po:16,Qn:32,al:48,Je:48,Ke:4};g=Q.prototype;
|
||||
g.vb=function(a,b,c,d){switch(c){case "sw1":return this.oa[c]=d,bh(this,c,d,this.Fb,{0:this.Ca==Vg?"Bootable Floppy Drive":"Loop on POST",1:this.Ca==Vg?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Ca==Vg)return this.oa[c]=d,bh(this,c,d,this.Gd,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.oa[c]=d,!0}return!1};
|
||||
g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.Qa=D(a,"Keyboard");this.Hk=Math.round(c.cd/1193181);Ta(b,this,ch);Va(b,this,dh);this.Ca<$g?(Ta(b,this,eh),Va(b,this,fh)):(Ta(b,this,gh),Va(b,this,hh))};g.Ub=function(a,b){if(!b)if(!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};g.Kb=function(a){return a&&this.save?this.save():!0};
|
||||
g.reset=function(a){var b;this.Gc=this.Fb;this.ge=this.Gd;ih(this);this.va=Array(this.Ve);for(b=0;b<this.Ve;b++)jh(this,b);this.pb=Array(this.We);kh(this,0,32);1<this.We&&kh(this,1,160);this.fh=void 0;this.Gb=Array(3);for(b=0;b<this.Gb.length;b++)lh(this,b);this.Ue=this.dh=this.hc=this.Xf=void 0;this.Wf=0;if(this.Ca>=$g){this.bb=16;this.Tc=0;this.kd=16;this.Rf=0;this.Md=160;512<=mh(this)&&(this.Md|=16);3==nh(this)&&(this.Md|=64);this.ah=3;this.Uf=0;this.Hb=Array(7);this.ne=0;a||(this.ka=Array(64));
|
||||
oh(this,this.Jn);for(a=14;46>a;a++)void 0===this.ka[a]&&(this.ka[a]=0);this.ka[20]=this.Gc&(Yg.Je|2|Zg.Ug|Zg.Je);this.ka[16]=ph(this,0)<<4|ph(this,1);qh(this)}};
|
||||
function oh(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.Vb("CMOS date invalid ("+b+"), using "+c)):b&&a.Vb("CMOS date: "+c);a.ka[0]=c.getSeconds();a.ka[1]=0;a.ka[2]=c.getMinutes();a.ka[3]=0;a.ka[4]=c.getHours();a.ka[5]=0;a.ka[6]=c.getDay()+1;a.ka[7]=c.getDate();a.ka[8]=c.getMonth()+1;c=c.getFullYear();a.ka[9]=c%100;c/=100;a.ka[50]=c%10|c/10<<4;a.jf=-1;a.ka[10]=38;a.ka[11]=2;a.ka[12]=0;a.ka[13]=128}
|
||||
function qh(a){for(var b=0,c=16;46>c;c++)b+=a.ka[c];a.ka[47]=b&255;a.ka[46]=b>>8}
|
||||
g.save=function(){var a=new H(this);a.set(0,[this.Eb,this.Gd,this.Gc,this.ge]);for(var b=[],c=0;c<this.va;c++){var d=[],e=this.va[c];d[0]=e.pd;d[1]=e.$g;d[2]=e.dj;d[3]=e.yb;for(var f=[],l=0;l<e.La.length;l++){var k=[],m=e.La[l];k[0]=m.bd;k[1]=m.Zi;k[2]=m.pc;k[3]=m.vb;k[4]=m.Ob;k[5]=m.mode;k[6]=m.zc;k[8]=m.Dn;k[9]=m.En;f[l]=k}d[4]=f;b[c]=d}a.set(1,[b]);b=[];for(c=0;c<this.ob.length;c++)d=[],e=this.ob[c],d[0]=e.qf,d[1]=e.Kd,d[2]=e.dd,d[3]=e.nd,d[4]=e.xb,d[5]=e.yc,d[6]=e.Nd,d[7]=e.Te,b[c]=d;a.set(2,
|
||||
[b]);b=[];for(c=0;c<this.Gb.length;c++)d=[],e=this.Gb[c],d[0]=e.pc,d[1]=e.Dc,d[2]=e.Ob,d[3]=e.$e,d[4]=e.fj,d[5]=e.mode,d[6]=e.Cf,d[7]=e.sd,d[8]=e.Ud,d[9]=e.Jc,d[10]=e.ef,d[11]=e.qe,d[12]=e.Dd,b[c]=d;a.set(3,[this.dh,b]);a.set(4,[this.Xf,this.hc,this.ah,this.Ue,this.Wf]);this.Ca>=$g&&(a.set(5,[this.bb,this.Tc,this.kd,this.Rf,this.Md,this.Zg]),a.set(6,[this.Uf,this.Hb,this.ne,this.ka,this.jf]));return a.data()};
|
||||
g.restore=function(a){var b,c;b=a[0];this.Eb=b[0];this.Gd=b[1];this.Gc=b[2];this.ge=b[3];b=a[1];this.va=Array(this.Ve);for(c=0;c<this.Ve;c++)jh(this,c,1==b.length?b[0][c]:b);b=a[2];this.ob=Array(this.We);for(c=0;c<this.We;c++)kh(this,c,0===c?32:160,b[0][c]);b=a[3];this.dh=b[0];this.Gb=Array(3);for(c=0;c<this.Gb.length;c++)lh(this,c,b[1][c]);b=a[4];this.Xf=b[0];this.hc=b[1];this.ah=b[2];this.Ue=b[3];this.Wf=b[4];if(b=a[5])this.bb=b[0],this.Tc=b[1],this.kd=b[2],this.Rf=b[3],this.Md=b[4],this.Zg=b[5];
|
||||
if(b=a[6])this.Uf=b[0],this.Hb=b[1],this.ne=b[2],this.ka=b[3],this.jf=b[4],oh(this);return!0};function jh(a,b,c){a=a.va[b]={};c&&5==c.length||(c=[0,void 0,void 0,0,[]]);a.pd=c[0];a.$g=c[1];a.dj=c[2];a.yb=c[3];a.um=b<<2;a.La=Array(4);for(b=0;b<a.La.length;b++)rh(a,b,c[4][b])}function rh(a,b,c){var d=a.La[b]={};if(void 0===c||8!=c.length)c=[!0,[],[],[],[]];d.ea=a;d.uj=b;d.bd=c[0];d.Zi=c[1];d.pc=c[2];d.vb=c[3];d.Ob=c[4];d.mode=c[5];d.zc=c[6];sh(d,c[8],c[9])}
|
||||
function sh(a,b,c,d){"string"==typeof b&&(b=Aa(b));b&&(a.bg=null,a.Dn=b.id,a.En=c,a.ag=b,a.Bh=b[c],a.Bg=d)}function kh(a,b,c,d){a=a.ob[b]={};d&&8==d.length||(d=[0,[void 0,void 0,void 0,void 0]]);a.port=c;a.so=b<<3;a.qf=d[0];a.Kd=d[1];a.dd=d[2];a.nd=d[3];a.xb=d[4];a.yc=d[5];a.Nd=d[6];a.Te=d[7]}
|
||||
function lh(a,b,c){a=a.Gb[b]={};if(void 0===c||13!=c.length)c=[[],[],[],[]];a.pc=c[0];a.Dc=c[1];a.Ob=c[2];a.$e=c[3];a.fj=c[4];a.mode=c[5];a.Cf=c[6];a.sd=c[7];a.Ud=c[8];a.Jc=c[9];a.ef=c[10];a.qe=c[11];a.Dd=c[12]}function mh(a,b){return((((b?a.Eb:a.Gc)&12)>>2)+1)*a.nm+32*((b?a.Gd:a.ge)&15)}function th(a,b){var c=b?a.Eb:a.Gc;return a.Ca!=Vg||c&Zg.Sg?((c&Zg.Je)>>Zg.Ke)+1:0}function ph(a,b){return b<th(a)?a.Ca<$g?1:2:0}function nh(a,b){return((b?a.Eb:a.Gc)&Yg.Je)>>Yg.Ke}
|
||||
function bh(a,b,c,d,e){for(var f="",l=1;8>=l;l++){var k="pcjs-bitCell";l||(k+=" pcjs-bitCellLeft");f+='<div id="'+(b+"-"+l)+'" class="'+k+'" data-value="0">'+l+"</div>\n"}c.innerHTML=f;b=C(c,"pcjs-bitCell");c=null;for(l=0;l<b.length;l++)void 0!==e&&void 0!==e[l]&&(c=e[l]),c&&b[l].setAttribute("title",c),uh(b[l],d&1<<l?!1:!0),b[l].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");uh(b,c);var d=b.getAttribute("id").split("-"),e=1<<parseInt(d[1],10)-1;switch(d[0]){case "sw1":a.Eb=
|
||||
a.Eb&~e|(c?0:e);break;case "sw2":a.Gd=a.Gd&~e|(c?0:e)}ih(a)}}(a,b[l])}function uh(a,b){a.setAttribute("data-value",b?"1":"0");a.style.color=b?"#ffffff":"#000000";a.style.backgroundColor=b?"#000000":"#ffffff"}function ih(a){var b=a.oa.swdesc,c={0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"};if(void 0!==b){var d;d=""+(mh(a,!0)+"Kb");d+=", "+c[nh(a,!0)]+" Monitor";d+=", "+th(a,!0)+" Floppy Drives";if(void 0!==a.Gc&&a.Gc!=a.Eb||void 0!==a.ge&&a.ge!=a.Gd)d+=" (Reset required)";b.innerHTML=d}}
|
||||
function vh(a,b,c){a=a.va[b];c=a.La[c].vb[a.yb];a.yb^=1;return c}function wh(a,b,c,d){a=a.va[b];c=a.La[c];c.vb[a.yb]=c.Zi[a.yb]=d;a.yb^=1}function xh(a,b,c){a=a.va[b];c=a.La[c].Ob[a.yb];a.yb^=1;return c}function yh(a,b,c,d){a=a.va[b];c=a.La[c];c.Ob[a.yb]=c.pc[a.yb]=d;a.yb^=1}function zh(a,b){var c=a.va[b],d=c.pd|1;c.pd&=-16;return d}function Ah(a,b,c){a=a.va[b];b=c&3;a.pd=a.pd&~(16<<b)|(c&4)<<b+2;a.dj=c}function Bh(a,b,c){b=a.va[b];var d=c&3,e=b.La[d];e.bd=c&4?!0:!1;e.bd||Ch(a,b.um+d)}
|
||||
function Dh(a,b,c){return a.va[b].La[c].zc}function Eh(a,b,c,d,e){sh(a.va[b>>2].La[b&3],c,d,e)}function Ch(a,b,c){b=a.va[b>>2].La[b&3];b.ag&&b.Bh&&b.Bg?(c&&(b.bg=c),b.bd||Ic(a,b,!0)):c&&c(!0)}
|
||||
function Ic(a,b,c){c&&(b.count=b.Ob[1]<<8|b.Ob[0],b.Vk=b.mode&12,b.qj=b.Yc=!1);for(var d=!1;0<=b.count&&(c=b.zc<<16|b.vb[1]<<8|b.vb[0],4==b.Vk?(d=!0,function(c){b.Bh.call(b.ag,b.Bg,-1,function(f,l){0>f&&(b.qj||(b.qj=!0),f=255);b.bd||Pa(a.ma,c,f);(d=l)&&setTimeout(function(){Fh(b)||Ic(a,b)},0)})}(c)):8==b.Vk?(c=Na(a.ma,c),0>b.Bh.call(b.ag,b.Bg,c)&&(b.Yc=!0)):b.Yc=!0),!d&&!Fh(b););}
|
||||
function Fh(a){if(!a.Yc&&0<=--a.count&&(a.mode&32?(a.vb[0]--,0>a.vb[0]&&(a.vb[0]=255,a.vb[1]--,0>a.vb[1]&&(a.vb[1]=255))):(a.vb[0]++,255<a.vb[0]&&(a.vb[0]=0,a.vb[1]++,255<a.vb[1]&&(a.vb[1]=0))),!a.bd))return!1;var b=a.ea;b.pd=b.pd&~(16<<a.uj)|1<<a.uj;a.mode&16||(a.bd=!0,a.ag=a.Bg=null);a.bg&&(a.bg(!a.Yc),a.bg=null);return!0}function Gh(a,b){var c=0,d=a.ob[b];if(void 0!==d.Te)switch(d.Te&3){case 2:c=d.xb;break;case 3:c=d.yc}return c}
|
||||
function Hh(a,b,c){var d=a.ob[b];if(c&16)d.dd=0,d.Kd[d.dd++]=c,d.nd=0,d.Nd=7,d.xb=d.yc=0,d.Te=10;else if(c&8)d.Te=c;else{var e=c&224;if(e&32){var f=0;if(96==(e&96))f=1<<(c&7);else for(c=d.Nd+1;;){c&=7;e=1<<c;if(d.yc&e){f=e;break}if(c++==d.Nd)break}d.yc&f&&(d.yc&=~f,Ih(a,b))}else 192==e&&(d.Nd=c&7)}}function Jh(a,b,c){var d=a.ob[b];d.dd<d.Kd.length?(d.Kd[d.dd++]=c,2==d.dd&&d.Kd[0]&2&&d.dd++,3!=d.dd||d.Kd[0]&1||d.dd++):(d.nd=c,d=a.ia,d.Y|=4,Ih(a,b,b||253!=c?0:6))}
|
||||
function Ih(a,b,c){b=a.ob[b];var d=((b.yc|b.nd)^255)&b.xb;a=a.ia;a.ga&&(a.Ya=d?a.Ya|1:a.Ya&-2);d&&c&&(b.qf=c)}function R(a,b,c){var d=b>>3,e=a.ob[d];e.xb|=1<<(b&7);e.qf=c||0;1==d&&(a.ob[0].xb|=4);Ih(a,d)}function Kh(a,b){var c=b>>3,d=a.ob[c],e=1<<(b&7);d.xb&e&&(d.xb&=~e,1!=c||d.xb||(a.ob[0].xb&=-5),Ih(a,c))}
|
||||
function Gc(a,b){void 0===b&&(b=0);var c=-1,d=a.ob[b];if(d.qf)c=-2,d.qf--;else for(var e=d.xb&((d.yc|d.nd)^255),f=d.Nd+1;;){var f=f&7,l=1<<f;if(e&l){c=b||2!=f?d.Kd[1]+f:Gc(a,1);0<=c&&(d.yc|=l,d.xb&=~l);break}if(f++==d.Nd)break}return c}function Lh(a,b){var c=a.Gb[b];c.sd==c.Ud&&Mh(a,b);if(c.ef)return c.$e[c.sd++];Nh(a,b);return c.Ob[c.sd++]}
|
||||
function Oh(a,b,c){var d=a.Gb[b];d.sd==d.Ud&&Mh(a,b);d.pc[d.sd++]=c;if(d.sd==d.Ud){d.qe&&0!=d.mode&&8!=d.mode||(d.ef=!1,d.Ob[0]=d.Dc[0]=d.pc[0],d.Ob[1]=d.Dc[1]=d.pc[1],d.Dd=jb(a.ia,a.kg),d.qe=!0,d.Jc=0!=d.mode,0==b&&Kh(a,0));2==b&&kb(a);if(0==b){var e=Ph(a,0);2048<=e&&(a.ia.ug=Math.round(65536/e))}0==b&&0==d.mode&&16==d.Cf&&(b=a.ia,b.rc&&(a=b.A-c*a.Ek,b.A-=a,b.Lc-=a))}}g.jm=function(){return null};
|
||||
g.tn=function(a,b){this.dh=b;var c=(b&192)>>6;if(3!=c){var d=b&1,e=b&14,f=b&48;if(f){var l=this.Gb[c];l.Cf=f;l.mode=e;l.fj=d;l.pc=[0,0];l.Ob=[0,0];l.$e=[0,0];l.Jc=!1;l.ef=!1;l.qe=!1;Mh(this,c);0==c&&Kh(this,0);2==c&&255==this.ob[0].nd&&77==this.hc&&(c=this.Gb[0],c.Dc[0]=c.pc[0],c.Dc[1]=c.pc[1],c.Dd=jb(this.ia,this.kg))}else Nh(this,c),d=this.Gb[c],d.$e[0]=d.Ob[0],d.$e[1]=d.Ob[1],d.ef=!0,Mh(this,c)}};function Ph(a,b){var c=a.Gb[b],d=c.pc[1]<<8|c.pc[0];d||(d=1==c.Ud?256:65536);return d}
|
||||
g.save=function(){var a=new H(this);a.set(0,[this.Fb,this.Gd,this.Gc,this.ge]);for(var b=[],c=0;c<this.va;c++){var d=[],e=this.va[c];d[0]=e.pd;d[1]=e.bh;d[2]=e.gj;d[3]=e.zb;for(var f=[],l=0;l<e.La.length;l++){var k=[],m=e.La[l];k[0]=m.bd;k[1]=m.bj;k[2]=m.pc;k[3]=m.wb;k[4]=m.Pb;k[5]=m.mode;k[6]=m.zc;k[8]=m.Gn;k[9]=m.Hn;f[l]=k}d[4]=f;b[c]=d}a.set(1,[b]);b=[];for(c=0;c<this.pb.length;c++)d=[],e=this.pb[c],d[0]=e.qf,d[1]=e.Kd,d[2]=e.dd,d[3]=e.nd,d[4]=e.yb,d[5]=e.yc,d[6]=e.Nd,d[7]=e.Te,b[c]=d;a.set(2,
|
||||
[b]);b=[];for(c=0;c<this.Gb.length;c++)d=[],e=this.Gb[c],d[0]=e.pc,d[1]=e.Dc,d[2]=e.Pb,d[3]=e.$e,d[4]=e.ij,d[5]=e.mode,d[6]=e.Cf,d[7]=e.sd,d[8]=e.Ud,d[9]=e.Jc,d[10]=e.ef,d[11]=e.qe,d[12]=e.Dd,b[c]=d;a.set(3,[this.fh,b]);a.set(4,[this.Xf,this.hc,this.dh,this.Ue,this.Wf]);this.Ca>=$g&&(a.set(5,[this.bb,this.Tc,this.kd,this.Rf,this.Md,this.ah]),a.set(6,[this.Uf,this.Hb,this.ne,this.ka,this.jf]));return a.data()};
|
||||
g.restore=function(a){var b,c;b=a[0];this.Fb=b[0];this.Gd=b[1];this.Gc=b[2];this.ge=b[3];b=a[1];this.va=Array(this.Ve);for(c=0;c<this.Ve;c++)jh(this,c,1==b.length?b[0][c]:b);b=a[2];this.pb=Array(this.We);for(c=0;c<this.We;c++)kh(this,c,0===c?32:160,b[0][c]);b=a[3];this.fh=b[0];this.Gb=Array(3);for(c=0;c<this.Gb.length;c++)lh(this,c,b[1][c]);b=a[4];this.Xf=b[0];this.hc=b[1];this.dh=b[2];this.Ue=b[3];this.Wf=b[4];if(b=a[5])this.bb=b[0],this.Tc=b[1],this.kd=b[2],this.Rf=b[3],this.Md=b[4],this.ah=b[5];
|
||||
if(b=a[6])this.Uf=b[0],this.Hb=b[1],this.ne=b[2],this.ka=b[3],this.jf=b[4],oh(this);return!0};function jh(a,b,c){a=a.va[b]={};c&&5==c.length||(c=[0,void 0,void 0,0,[]]);a.pd=c[0];a.bh=c[1];a.gj=c[2];a.zb=c[3];a.xm=b<<2;a.La=Array(4);for(b=0;b<a.La.length;b++)rh(a,b,c[4][b])}function rh(a,b,c){var d=a.La[b]={};if(void 0===c||8!=c.length)c=[!0,[],[],[],[]];d.ea=a;d.xj=b;d.bd=c[0];d.bj=c[1];d.pc=c[2];d.wb=c[3];d.Pb=c[4];d.mode=c[5];d.zc=c[6];sh(d,c[8],c[9])}
|
||||
function sh(a,b,c,d){"string"==typeof b&&(b=Aa(b));b&&(a.bg=null,a.Gn=b.id,a.Hn=c,a.ag=b,a.Dh=b[c],a.Dg=d)}function kh(a,b,c,d){a=a.pb[b]={};d&&8==d.length||(d=[0,[void 0,void 0,void 0,void 0]]);a.port=c;a.vo=b<<3;a.qf=d[0];a.Kd=d[1];a.dd=d[2];a.nd=d[3];a.yb=d[4];a.yc=d[5];a.Nd=d[6];a.Te=d[7]}
|
||||
function lh(a,b,c){a=a.Gb[b]={};if(void 0===c||13!=c.length)c=[[],[],[],[]];a.pc=c[0];a.Dc=c[1];a.Pb=c[2];a.$e=c[3];a.ij=c[4];a.mode=c[5];a.Cf=c[6];a.sd=c[7];a.Ud=c[8];a.Jc=c[9];a.ef=c[10];a.qe=c[11];a.Dd=c[12]}function mh(a,b){return((((b?a.Fb:a.Gc)&12)>>2)+1)*a.qm+32*((b?a.Gd:a.ge)&15)}function th(a,b){var c=b?a.Fb:a.Gc;return a.Ca!=Vg||c&Zg.Ug?((c&Zg.Je)>>Zg.Ke)+1:0}function ph(a,b){return b<th(a)?a.Ca<$g?1:2:0}function nh(a,b){return((b?a.Fb:a.Gc)&Yg.Je)>>Yg.Ke}
|
||||
function bh(a,b,c,d,e){for(var f="",l=1;8>=l;l++){var k="pcjs-bitCell";l||(k+=" pcjs-bitCellLeft");f+='<div id="'+(b+"-"+l)+'" class="'+k+'" data-value="0">'+l+"</div>\n"}c.innerHTML=f;b=C(c,"pcjs-bitCell");c=null;for(l=0;l<b.length;l++)void 0!==e&&void 0!==e[l]&&(c=e[l]),c&&b[l].setAttribute("title",c),uh(b[l],d&1<<l?!1:!0),b[l].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");uh(b,c);var d=b.getAttribute("id").split("-"),e=1<<parseInt(d[1],10)-1;switch(d[0]){case "sw1":a.Fb=
|
||||
a.Fb&~e|(c?0:e);break;case "sw2":a.Gd=a.Gd&~e|(c?0:e)}ih(a)}}(a,b[l])}function uh(a,b){a.setAttribute("data-value",b?"1":"0");a.style.color=b?"#ffffff":"#000000";a.style.backgroundColor=b?"#000000":"#ffffff"}function ih(a){var b=a.oa.swdesc,c={0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"};if(void 0!==b){var d;d=""+(mh(a,!0)+"Kb");d+=", "+c[nh(a,!0)]+" Monitor";d+=", "+th(a,!0)+" Floppy Drives";if(void 0!==a.Gc&&a.Gc!=a.Fb||void 0!==a.ge&&a.ge!=a.Gd)d+=" (Reset required)";b.innerHTML=d}}
|
||||
function vh(a,b,c){a=a.va[b];c=a.La[c].wb[a.zb];a.zb^=1;return c}function wh(a,b,c,d){a=a.va[b];c=a.La[c];c.wb[a.zb]=c.bj[a.zb]=d;a.zb^=1}function xh(a,b,c){a=a.va[b];c=a.La[c].Pb[a.zb];a.zb^=1;return c}function yh(a,b,c,d){a=a.va[b];c=a.La[c];c.Pb[a.zb]=c.pc[a.zb]=d;a.zb^=1}function zh(a,b){var c=a.va[b],d=c.pd|1;c.pd&=-16;return d}function Ah(a,b,c){a=a.va[b];b=c&3;a.pd=a.pd&~(16<<b)|(c&4)<<b+2;a.gj=c}function Bh(a,b,c){b=a.va[b];var d=c&3,e=b.La[d];e.bd=c&4?!0:!1;e.bd||Ch(a,b.xm+d)}
|
||||
function Dh(a,b,c){return a.va[b].La[c].zc}function Eh(a,b,c,d,e){sh(a.va[b>>2].La[b&3],c,d,e)}function Ch(a,b,c){b=a.va[b>>2].La[b&3];b.ag&&b.Dh&&b.Dg?(c&&(b.bg=c),b.bd||Ic(a,b,!0)):c&&c(!0)}
|
||||
function Ic(a,b,c){c&&(b.count=b.Pb[1]<<8|b.Pb[0],b.Yk=b.mode&12,b.tj=b.Yc=!1);for(var d=!1;0<=b.count&&(c=b.zc<<16|b.wb[1]<<8|b.wb[0],4==b.Yk?(d=!0,function(c){b.Dh.call(b.ag,b.Dg,-1,function(f,l){0>f&&(b.tj||(b.tj=!0),f=255);b.bd||Pa(a.ma,c,f);(d=l)&&setTimeout(function(){Fh(b)||Ic(a,b)},0)})}(c)):8==b.Yk?(c=Na(a.ma,c),0>b.Dh.call(b.ag,b.Dg,c)&&(b.Yc=!0)):b.Yc=!0),!d&&!Fh(b););}
|
||||
function Fh(a){if(!a.Yc&&0<=--a.count&&(a.mode&32?(a.wb[0]--,0>a.wb[0]&&(a.wb[0]=255,a.wb[1]--,0>a.wb[1]&&(a.wb[1]=255))):(a.wb[0]++,255<a.wb[0]&&(a.wb[0]=0,a.wb[1]++,255<a.wb[1]&&(a.wb[1]=0))),!a.bd))return!1;var b=a.ea;b.pd=b.pd&~(16<<a.xj)|1<<a.xj;a.mode&16||(a.bd=!0,a.ag=a.Dg=null);a.bg&&(a.bg(!a.Yc),a.bg=null);return!0}function Gh(a,b){var c=0,d=a.pb[b];if(void 0!==d.Te)switch(d.Te&3){case 2:c=d.yb;break;case 3:c=d.yc}return c}
|
||||
function Hh(a,b,c){var d=a.pb[b];if(c&16)d.dd=0,d.Kd[d.dd++]=c,d.nd=0,d.Nd=7,d.yb=d.yc=0,d.Te=10;else if(c&8)d.Te=c;else{var e=c&224;if(e&32){var f=0;if(96==(e&96))f=1<<(c&7);else for(c=d.Nd+1;;){c&=7;e=1<<c;if(d.yc&e){f=e;break}if(c++==d.Nd)break}d.yc&f&&(d.yc&=~f,Ih(a,b))}else 192==e&&(d.Nd=c&7)}}function Jh(a,b,c){var d=a.pb[b];d.dd<d.Kd.length?(d.Kd[d.dd++]=c,2==d.dd&&d.Kd[0]&2&&d.dd++,3!=d.dd||d.Kd[0]&1||d.dd++):(d.nd=c,d=a.ia,d.Y|=4,Ih(a,b,b||253!=c?0:6))}
|
||||
function Ih(a,b,c){b=a.pb[b];var d=((b.yc|b.nd)^255)&b.yb;a=a.ia;a.ga&&(a.Ya=d?a.Ya|1:a.Ya&-2);d&&c&&(b.qf=c)}function R(a,b,c){var d=b>>3,e=a.pb[d];e.yb|=1<<(b&7);e.qf=c||0;1==d&&(a.pb[0].yb|=4);Ih(a,d)}function Kh(a,b){var c=b>>3,d=a.pb[c],e=1<<(b&7);d.yb&e&&(d.yb&=~e,1!=c||d.yb||(a.pb[0].yb&=-5),Ih(a,c))}
|
||||
function Gc(a,b){void 0===b&&(b=0);var c=-1,d=a.pb[b];if(d.qf)c=-2,d.qf--;else for(var e=d.yb&((d.yc|d.nd)^255),f=d.Nd+1;;){var f=f&7,l=1<<f;if(e&l){c=b||2!=f?d.Kd[1]+f:Gc(a,1);0<=c&&(d.yc|=l,d.yb&=~l);break}if(f++==d.Nd)break}return c}function Lh(a,b){var c=a.Gb[b];c.sd==c.Ud&&Mh(a,b);if(c.ef)return c.$e[c.sd++];Nh(a,b);return c.Pb[c.sd++]}
|
||||
function Oh(a,b,c){var d=a.Gb[b];d.sd==d.Ud&&Mh(a,b);d.pc[d.sd++]=c;if(d.sd==d.Ud){d.qe&&0!=d.mode&&8!=d.mode||(d.ef=!1,d.Pb[0]=d.Dc[0]=d.pc[0],d.Pb[1]=d.Dc[1]=d.pc[1],d.Dd=jb(a.ia,a.kg),d.qe=!0,d.Jc=0!=d.mode,0==b&&Kh(a,0));2==b&&kb(a);if(0==b){var e=Ph(a,0);2048<=e&&(a.ia.ug=Math.round(65536/e))}0==b&&0==d.mode&&16==d.Cf&&(b=a.ia,b.rc&&(a=b.A-c*a.Hk,b.A-=a,b.Lc-=a))}}g.mm=function(){return null};
|
||||
g.wn=function(a,b){this.fh=b;var c=(b&192)>>6;if(3!=c){var d=b&1,e=b&14,f=b&48;if(f){var l=this.Gb[c];l.Cf=f;l.mode=e;l.ij=d;l.pc=[0,0];l.Pb=[0,0];l.$e=[0,0];l.Jc=!1;l.ef=!1;l.qe=!1;Mh(this,c);0==c&&Kh(this,0);2==c&&255==this.pb[0].nd&&77==this.hc&&(c=this.Gb[0],c.Dc[0]=c.pc[0],c.Dc[1]=c.pc[1],c.Dd=jb(this.ia,this.kg))}else Nh(this,c),d=this.Gb[c],d.$e[0]=d.Pb[0],d.$e[1]=d.Pb[1],d.ef=!0,Mh(this,c)}};function Ph(a,b){var c=a.Gb[b],d=c.pc[1]<<8|c.pc[0];d||(d=1==c.Ud?256:65536);return d}
|
||||
function Mh(a,b){var c=a.Gb[b];c.sd=32==c.Cf?1:0;c.Ud=48==c.Cf?2:1}
|
||||
function Nh(a,b,c){var d=a.Gb[b];if(d.qe&&(2!=b||a.hc&1)){var e=jb(a.ia,a.kg),f=(e-d.Dd)/a.Ek|0;0>f&&(d.Dd=e,f=0);var l=Ph(a,b),k=a.Gb[b],m=k.Dc[1]<<8|k.Dc[0];m||(m=1==k.Ud?256:65536);k=m-f;0==d.mode?(0>=k&&(k=0),k||(d.Jc=!0,d.qe=!1,b||R(a,0))):4==d.mode?(d.Jc=1!=k,0>=k&&(k=l+k,0>=k&&(k=l),d.Dc[0]=k&255,d.Dc[1]=k>>8,d.Dd=e,!b&&d.Jc&&R(a,0))):6==d.mode&&(k-=f,0>=k&&(d.Jc=!d.Jc,k=l+k,0>=k&&(k=l),d.Dc[0]=k&255,d.Dc[1]=k>>8,d.Dd=e,!b&&d.Jc&&R(a,0)));d.Ob[0]=k&255;d.Ob[1]=k>>8;c&&(a.Dd=0)}return d}
|
||||
function lb(a,b){for(var c=0;c<a.Gb.length;c++)Nh(a,c,b);if(a.Ca>=$g){var c=0,d=a.ia.cd,e=jb(a.ia,a.kg);if(0<=a.jf&&(c=e-a.jf,Math.floor(c/d)&&60<=++a.ka[0]&&(a.ka[0]=0,60<=++a.ka[2]&&(a.ka[2]=0,24<=++a.ka[4])))){a.ka[4]=0;a.ka[6]=a.ka[6]%7+1;var f=a.ka[9],l=ja[a.ka[8]-1];28==l&&0===f%4&&(f%100||0===f%400)&&l++;++a.ka[7]>l&&(a.ka[7]=1,12<++a.ka[8]&&(a.ka[8]=1,a.ka[9]=(a.ka[9]+1)%100))}a.jf=e-c%d}}g.bm=function(){var a=this.Xf;this.Ue&16&&(this.hc&128?a=this.Gc:this.Qa&&(a=Uh(this.Qa)));return a};
|
||||
g.mn=function(a,b){this.Xf=b};g.cm=function(){return this.hc};g.nn=function(a,b){Vh(this,b);this.Qa&&Wh(this.Qa,b&128?!1:!0,b&64?!0:!1)};function Vh(a,b){var c=!!(b&2),d=!!(a.hc&2);a.hc=b;c!=d&&kb(a,c)}g.dm=function(){var a=0,a=this.Ca==Vg?this.hc&4?a|this.ge&15:a|this.ge>>4&1:this.hc&8?a|this.Gc>>4:a|this.Gc&15;this.hc&1&&Nh(this,2).Jc&&(a=this.hc&2?a|32:a|16);return a};g.on=function(a,b){this.ah=b};g.em=function(){return this.Ue};g.pn=function(a,b){this.Ue=b};
|
||||
g.sl=function(){var a=this.Rf;this.bb&=-258;var b=this.Qa&&Uh(this.Qa,!0);b&&Xh(this,b);return a};g.Gm=function(a,b){if(this.bb&8)switch(this.Tc){case 96:Yh(this,b);break;case 209:Zh(this,b);break;default:if(Yh(this,this.kd&-17),this.Qa){var c=-1;switch(b){case 255:c=250,$h(this.Qa)}Xh(this,c)}}this.Tc=b;this.bb&=-9};g.tl=function(){return this.hc&-209|(jb(this.ia)&64?16:0)};g.Hm=function(a,b){Vh(this,b)};g.ul=function(){var a=this.bb&255;this.bb&256&&(this.bb|=1,this.bb&=-257);return a};
|
||||
g.Fm=function(a,b){this.Tc=b;this.bb|=8;var c=0;240<=this.Tc&&(c=this.Tc^15,this.Tc=240);switch(this.Tc){case 192:Xh(this,this.Md);break;case 173:Yh(this,this.kd|16);break;case 174:Yh(this,this.kd&-17);break;case 170:this.Qa&&ai(this.Qa,!0);Yh(this,this.kd|16);Xh(this,85);Zh(this,3);break;case 224:Xh(this,this.kd&16?0:1);break;case 240:c&1&&Xb(this.ia)}};function Yh(a,b){a.kd=b;a.bb=a.bb&-5|b&4;a.Qa&&Wh(a.Qa,!!(b&8),!(b&16))&&Xh(a,Uh(a.Qa,!0))}function Xh(a,b){0<=b&&(a.Rf=b,a.bb&=-2,a.bb|=256)}
|
||||
function Zh(a,b){a.Zg=b;Ja(a.ma,!!(b&2));b&1||Xb(a.ia)}g.Il=function(){return this.ne};g.Um=function(a,b){this.ne=b;this.Wf=b&128?0:128};g.Jl=function(){var a=this.ne&63;if(13>=a){var b=this.ka[a];if(10>a){var c=!1;4!=a&&5!=a||this.ka[11]&2||(b=12>b?b?b:12:(b-=12)?b+128:140,c=!0);this.ka[11]&4||(c&&128<b&&(b-=48),b=b%10|b/10<<4)}else 10==a&&(this.ka[a]^=128);a=b}else a=this.ka[a];return a};
|
||||
g.Vm=function(a,b){var c=this.ne&63,d=this.ka,e;if(13>=c){if(e=b,10>c){var f=!1;this.ka[11]&4||(e=10*(e>>4)+(e&15),f=!0);if(4==c||5==c)f&&12<e&&(e+=48),this.ka[11]&2||(12>=e?e=12==e?0:e:(e-=116,e=24==e?12:e))}}else e=b;d[c]=e};g.$l=function(){return this.Uf};g.jn=function(a,b){this.Uf=b};g.ln=function(a,b){this.Wf=b};function Wg(a,b){if(void 0===a)return b;for(var c=0,d=1,e=0;e<a.length;e++)"0"==a.charAt(e)&&(c|=d),d<<=1;return c}
|
||||
function kb(a,b){if(a.hh){void 0!==b?a.pj=b:b=a.pj&&a.ia&&a.ia.rc;var c=Math.round(1193181/Ph(a,2));if(20>c||2E4<c)b=!1;b?a.Oc?a.Oc.frequency.value=c:(a.Oc=a.hh.createOscillator(),a.Oc.type=1,a.Oc.connect(a.hh.destination),a.Oc.frequency.value=c,a.Oc.noteOn(0)):a.Oc&&(a.Oc.noteOff(0),a.Oc.disconnect(),delete a.Oc)}}
|
||||
var ch={0:function(){return vh(this,0,0)},1:function(){return xh(this,0,0)},2:function(){return vh(this,0,1)},3:function(){return xh(this,0,1)},4:function(){return vh(this,0,2)},5:function(){return xh(this,0,2)},6:function(){return vh(this,0,3)},7:function(){return xh(this,0,3)},8:function(){return zh(this,0)},32:function(){return Gh(this,0)},33:function(){return this.ob[0].nd},64:function(){return Lh(this,0)},65:function(){return Lh(this,1)},66:function(){return Lh(this,2)},67:Q.prototype.jm,129:function(){return Dh(this,
|
||||
0,2)},130:function(){return Dh(this,0,3)},131:function(){return Dh(this,0,1)},135:function(){return Dh(this,0,0)}},eh={96:Q.prototype.bm,97:Q.prototype.cm,98:Q.prototype.dm,99:Q.prototype.em},gh={96:Q.prototype.sl,97:Q.prototype.tl,100:Q.prototype.ul,112:Q.prototype.Il,113:Q.prototype.Jl,128:Q.prototype.$l,132:function(){return this.Hb[0]},133:function(){return this.Hb[1]},134:function(){return this.Hb[2]},136:function(){return this.Hb[3]},137:function(){return Dh(this,1,2)},138:function(){return Dh(this,
|
||||
1,3)},139:function(){return Dh(this,1,1)},140:function(){return this.Hb[4]},141:function(){return this.Hb[5]},142:function(){return this.Hb[6]},143:function(){return Dh(this,1,0)},160:function(){return Gh(this,1)},161:function(){return this.ob[1].nd},192:function(){return vh(this,1,0)},194:function(){return xh(this,1,0)},196:function(){return vh(this,1,1)},198:function(){return xh(this,1,1)},200:function(){return vh(this,1,2)},202:function(){return xh(this,1,2)},204:function(){return vh(this,1,3)},
|
||||
206:function(){return xh(this,1,3)},208:function(){return zh(this,1)}},dh={0:function(a,b){wh(this,0,0,b)},1:function(a,b){yh(this,0,0,b)},2:function(a,b){wh(this,0,1,b)},3:function(a,b){yh(this,0,1,b)},4:function(a,b){wh(this,0,2,b)},5:function(a,b){yh(this,0,2,b)},6:function(a,b){wh(this,0,3,b)},7:function(a,b){yh(this,0,3,b)},8:function(a,b){this.va[0].$g=b},9:function(a,b){Ah(this,0,b)},10:function(a,b){Bh(this,0,b)},11:function(a,b){this.va[0].La[b&3].mode=b},12:function(){this.va[0].yb=0},13:function(){for(var a=
|
||||
this.va[0],b=0;b<a.La.length;b++)rh(a,b)},32:function(a,b){Hh(this,0,b)},33:function(a,b){Jh(this,0,b)},64:function(a,b){Oh(this,0,b)},65:function(a,b){Oh(this,1,b)},66:function(a,b){Oh(this,2,b)},67:Q.prototype.tn,129:function(a,b){this.va[0].La[2].zc=b},130:function(a,b){this.va[0].La[3].zc=b},131:function(a,b){this.va[0].La[1].zc=b},135:function(a,b){this.va[0].La[0].zc=b}},fh={96:Q.prototype.mn,97:Q.prototype.nn,98:Q.prototype.on,99:Q.prototype.pn,160:Q.prototype.ln},hh={96:Q.prototype.Gm,97:Q.prototype.Hm,
|
||||
100:Q.prototype.Fm,112:Q.prototype.Um,113:Q.prototype.Vm,128:Q.prototype.jn,132:function(a,b){this.Hb[0]=b},133:function(a,b){this.Hb[1]=b},134:function(a,b){this.Hb[2]=b},136:function(a,b){this.Hb[3]=b},137:function(a,b){this.va[1].La[2].zc=b},138:function(a,b){this.va[1].La[3].zc=b},139:function(a,b){this.va[1].La[1].zc=b},140:function(a,b){this.Hb[4]=b},141:function(a,b){this.Hb[5]=b},142:function(a,b){this.Hb[6]=b},143:function(a,b){this.va[1].La[0].zc=b},160:function(a,b){Hh(this,1,b)},161:function(a,
|
||||
b){Jh(this,1,b)},192:function(a,b){wh(this,1,0,b)},194:function(a,b){yh(this,1,0,b)},196:function(a,b){wh(this,1,1,b)},198:function(a,b){yh(this,1,1,b)},200:function(a,b){wh(this,1,2,b)},202:function(a,b){yh(this,1,2,b)},204:function(a,b){wh(this,1,3,b)},206:function(a,b){yh(this,1,3,b)},208:function(a,b){this.va[1].$g=b},210:function(a,b){Ah(this,1,b)},212:function(a,b){Bh(this,1,b)},214:function(a,b){this.va[1].La[b&3].mode=b},216:function(){this.va[1].yb=0},218:function(){for(var a=this.va[1],
|
||||
b=0;b<a.La.length;b++)rh(a,b)}};v(function(){for(var a=C(window.document,"pcjs","chipset"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Q(d);B(d,c);ih(d)}});function bi(a){w.call(this,"ROM",a,bi);this.jb=null;this.$i=a.addr;this.Ng=a.size;this.$k=a.alias;this.Df=a.file;this.vj=a.notify;if(this.Df){a=this.Df;var b=ea(this.Df);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.Df+"&format=bytes&decimal=true");t(a,!0,null,this,bi.prototype.Am)}}z(w,bi);
|
||||
bi.prototype.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;ci(this)};bi.prototype.Sb=function(){this.Yg&&(this.Na&&this.Na.po(this.$i,this.Ng,this.Yg),delete this.Yg);return!0};bi.prototype.Jb=function(){return!0};
|
||||
bi.prototype.Am=function(a,b,c){if(c)this.xa("Unable to load system ROM (error "+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),e=d.bytes,f=d.data;if(e)this.jb=e;else if(f)for(this.jb=Array(4*f.length),c=b=0;b<f.length;b++)this.jb[c++]=f[b]&255,this.jb[c++]=f[b]>>8&255,this.jb[c++]=f[b]>>16&255,this.jb[c++]=f[b]>>24&255;else this.jb=d;this.Yg=d.symbols;if(!this.jb.length){u("Empty ROM: "+a);return}if(1==this.jb.length){u(this.jb[0]);return}}catch(l){this.xa("ROM data error: "+
|
||||
l.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.jb=Array(a.length),d=0;d<a.length;d++)this.jb[d]=parseInt(a[d],16);ci(this)}};function ci(a){if(!Da(a))if(!a.Df)a.Pa();else if(a.jb&&a.ma){if(a.jb.length!=a.Ng)Ea(a,"ROM size (0x"+p(a.jb.length)+") does not match specified size (0x"+p(a.Ng)+")");else if(di(a,a.$i)&&di(a,a.$k)){if(a.vj){var b=Aa(a.vj,a.id);b&&("ega"==b.Ca&&ei(b,a.jb,[8752,12640],8),b.Pa())}delete a.jb}a.Pa()}}
|
||||
function di(a,b){if(null==b)return!0;if(Ka(a.ma,b,a.Ng,!0)){for(var c=0;c<a.jb.length;c++)Pa(a.ma,b+c,a.jb[c]);return!0}return!1}v(function(){for(var a=C(window.document,"pcjs","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new bi(d);B(d,c)}});function fi(a){w.call(this,"RAM",a,fi);this.Qf=a.addr;this.gd=a.size;this.kl=a.test;this.hl=!!this.gd;this.dg=!1}z(w,fi);fi.prototype.ic=function(a,b,c){this.ma=b;this.ia=c;this.Fa=a;this.ga=D(a,"ChipSet");this.Pa()};
|
||||
fi.prototype.Sb=function(a,b){b||this.reset();return!0};fi.prototype.Jb=function(){return!0};
|
||||
fi.prototype.reset=function(){if(!this.Qf&&!this.hl&&this.ga){var a=1024*mh(this.ga);this.gd&&a!=this.gd&&(Ma(this.ma,this.Qf,this.gd),this.dg=!1);this.gd=a}!this.dg&&this.gd&&Ka(this.ma,this.Qf,this.gd)&&(this.dg=!0,this.status(Math.floor(this.gd/1024)+"Kb"));if(this.dg){if(this.kl||Qa(this.ma,1138,4660),this.ga&&(a=this.ga,a.ka)){var b=1048576>this.Qf?21:23,c=a.ka[b]|a.ka[b+1]<<8,c=c+(this.gd>>10);a.ka[b]=c&255;a.ka[b+1]=c>>8;qh(a)}}else u("No RAM allocated")};
|
||||
v(function(){for(var a=C(window.document,"pcjs","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new fi(d);B(d,c)}});function gi(a){w.call(this,"Keyboard",a,gi);this.Xg={};this.sm=250;this.tm=100;this.Pa()}z(w,gi);
|
||||
function Nh(a,b,c){var d=a.Gb[b];if(d.qe&&(2!=b||a.hc&1)){var e=jb(a.ia,a.kg),f=(e-d.Dd)/a.Hk|0;0>f&&(d.Dd=e,f=0);var l=Ph(a,b),k=a.Gb[b],m=k.Dc[1]<<8|k.Dc[0];m||(m=1==k.Ud?256:65536);k=m-f;0==d.mode?(0>=k&&(k=0),k||(d.Jc=!0,d.qe=!1,b||R(a,0))):4==d.mode?(d.Jc=1!=k,0>=k&&(k=l+k,0>=k&&(k=l),d.Dc[0]=k&255,d.Dc[1]=k>>8,d.Dd=e,!b&&d.Jc&&R(a,0))):6==d.mode&&(k-=f,0>=k&&(d.Jc=!d.Jc,k=l+k,0>=k&&(k=l),d.Dc[0]=k&255,d.Dc[1]=k>>8,d.Dd=e,!b&&d.Jc&&R(a,0)));d.Pb[0]=k&255;d.Pb[1]=k>>8;c&&(a.Dd=0)}return d}
|
||||
function lb(a,b){for(var c=0;c<a.Gb.length;c++)Nh(a,c,b);if(a.Ca>=$g){var c=0,d=a.ia.cd,e=jb(a.ia,a.kg);if(0<=a.jf&&(c=e-a.jf,Math.floor(c/d)&&60<=++a.ka[0]&&(a.ka[0]=0,60<=++a.ka[2]&&(a.ka[2]=0,24<=++a.ka[4])))){a.ka[4]=0;a.ka[6]=a.ka[6]%7+1;var f=a.ka[9],l=ja[a.ka[8]-1];28==l&&0===f%4&&(f%100||0===f%400)&&l++;++a.ka[7]>l&&(a.ka[7]=1,12<++a.ka[8]&&(a.ka[8]=1,a.ka[9]=(a.ka[9]+1)%100))}a.jf=e-c%d}}g.em=function(){var a=this.Xf;this.Ue&16&&(this.hc&128?a=this.Gc:this.Qa&&(a=Uh(this.Qa)));return a};
|
||||
g.pn=function(a,b){this.Xf=b};g.fm=function(){return this.hc};g.qn=function(a,b){Vh(this,b);this.Qa&&Wh(this.Qa,b&128?!1:!0,b&64?!0:!1)};function Vh(a,b){var c=!!(b&2),d=!!(a.hc&2);a.hc=b;c!=d&&kb(a,c)}g.gm=function(){var a=0,a=this.Ca==Vg?this.hc&4?a|this.ge&15:a|this.ge>>4&1:this.hc&8?a|this.Gc>>4:a|this.Gc&15;this.hc&1&&Nh(this,2).Jc&&(a=this.hc&2?a|32:a|16);return a};g.rn=function(a,b){this.dh=b};g.hm=function(){return this.Ue};g.sn=function(a,b){this.Ue=b};
|
||||
g.vl=function(){var a=this.Rf;this.bb&=-258;var b=this.Qa&&Uh(this.Qa,!0);b&&Xh(this,b);return a};g.Jm=function(a,b){if(this.bb&8)switch(this.Tc){case 96:Yh(this,b);break;case 209:Zh(this,b);break;default:if(Yh(this,this.kd&-17),this.Qa){var c=-1;switch(b){case 255:c=250,$h(this.Qa)}Xh(this,c)}}this.Tc=b;this.bb&=-9};g.wl=function(){return this.hc&-209|(jb(this.ia)&64?16:0)};g.Km=function(a,b){Vh(this,b)};g.xl=function(){var a=this.bb&255;this.bb&256&&(this.bb|=1,this.bb&=-257);return a};
|
||||
g.Im=function(a,b){this.Tc=b;this.bb|=8;var c=0;240<=this.Tc&&(c=this.Tc^15,this.Tc=240);switch(this.Tc){case 192:Xh(this,this.Md);break;case 173:Yh(this,this.kd|16);break;case 174:Yh(this,this.kd&-17);break;case 170:this.Qa&&ai(this.Qa,!0);Yh(this,this.kd|16);Xh(this,85);Zh(this,3);break;case 224:Xh(this,this.kd&16?0:1);break;case 240:c&1&&Xb(this.ia)}};function Yh(a,b){a.kd=b;a.bb=a.bb&-5|b&4;a.Qa&&Wh(a.Qa,!!(b&8),!(b&16))&&Xh(a,Uh(a.Qa,!0))}function Xh(a,b){0<=b&&(a.Rf=b,a.bb&=-2,a.bb|=256)}
|
||||
function Zh(a,b){a.ah=b;Ja(a.ma,!!(b&2));b&1||Xb(a.ia)}g.Ll=function(){return this.ne};g.Xm=function(a,b){this.ne=b;this.Wf=b&128?0:128};g.Ml=function(){var a=this.ne&63;if(13>=a){var b=this.ka[a];if(10>a){var c=!1;4!=a&&5!=a||this.ka[11]&2||(b=12>b?b?b:12:(b-=12)?b+128:140,c=!0);this.ka[11]&4||(c&&128<b&&(b-=48),b=b%10|b/10<<4)}else 10==a&&(this.ka[a]^=128);a=b}else a=this.ka[a];return a};
|
||||
g.Ym=function(a,b){var c=this.ne&63,d=this.ka,e;if(13>=c){if(e=b,10>c){var f=!1;this.ka[11]&4||(e=10*(e>>4)+(e&15),f=!0);if(4==c||5==c)f&&12<e&&(e+=48),this.ka[11]&2||(12>=e?e=12==e?0:e:(e-=116,e=24==e?12:e))}}else e=b;d[c]=e};g.cm=function(){return this.Uf};g.mn=function(a,b){this.Uf=b};g.on=function(a,b){this.Wf=b};function Wg(a,b){if(void 0===a)return b;for(var c=0,d=1,e=0;e<a.length;e++)"0"==a.charAt(e)&&(c|=d),d<<=1;return c}
|
||||
function kb(a,b){if(a.jh){void 0!==b?a.sj=b:b=a.sj&&a.ia&&a.ia.rc;var c=Math.round(1193181/Ph(a,2));if(20>c||2E4<c)b=!1;b?a.Oc?a.Oc.frequency.value=c:(a.Oc=a.jh.createOscillator(),a.Oc.type=1,a.Oc.connect(a.jh.destination),a.Oc.frequency.value=c,a.Oc.noteOn(0)):a.Oc&&(a.Oc.noteOff(0),a.Oc.disconnect(),delete a.Oc)}}
|
||||
var ch={0:function(){return vh(this,0,0)},1:function(){return xh(this,0,0)},2:function(){return vh(this,0,1)},3:function(){return xh(this,0,1)},4:function(){return vh(this,0,2)},5:function(){return xh(this,0,2)},6:function(){return vh(this,0,3)},7:function(){return xh(this,0,3)},8:function(){return zh(this,0)},32:function(){return Gh(this,0)},33:function(){return this.pb[0].nd},64:function(){return Lh(this,0)},65:function(){return Lh(this,1)},66:function(){return Lh(this,2)},67:Q.prototype.mm,129:function(){return Dh(this,
|
||||
0,2)},130:function(){return Dh(this,0,3)},131:function(){return Dh(this,0,1)},135:function(){return Dh(this,0,0)}},eh={96:Q.prototype.em,97:Q.prototype.fm,98:Q.prototype.gm,99:Q.prototype.hm},gh={96:Q.prototype.vl,97:Q.prototype.wl,100:Q.prototype.xl,112:Q.prototype.Ll,113:Q.prototype.Ml,128:Q.prototype.cm,132:function(){return this.Hb[0]},133:function(){return this.Hb[1]},134:function(){return this.Hb[2]},136:function(){return this.Hb[3]},137:function(){return Dh(this,1,2)},138:function(){return Dh(this,
|
||||
1,3)},139:function(){return Dh(this,1,1)},140:function(){return this.Hb[4]},141:function(){return this.Hb[5]},142:function(){return this.Hb[6]},143:function(){return Dh(this,1,0)},160:function(){return Gh(this,1)},161:function(){return this.pb[1].nd},192:function(){return vh(this,1,0)},194:function(){return xh(this,1,0)},196:function(){return vh(this,1,1)},198:function(){return xh(this,1,1)},200:function(){return vh(this,1,2)},202:function(){return xh(this,1,2)},204:function(){return vh(this,1,3)},
|
||||
206:function(){return xh(this,1,3)},208:function(){return zh(this,1)}},dh={0:function(a,b){wh(this,0,0,b)},1:function(a,b){yh(this,0,0,b)},2:function(a,b){wh(this,0,1,b)},3:function(a,b){yh(this,0,1,b)},4:function(a,b){wh(this,0,2,b)},5:function(a,b){yh(this,0,2,b)},6:function(a,b){wh(this,0,3,b)},7:function(a,b){yh(this,0,3,b)},8:function(a,b){this.va[0].bh=b},9:function(a,b){Ah(this,0,b)},10:function(a,b){Bh(this,0,b)},11:function(a,b){this.va[0].La[b&3].mode=b},12:function(){this.va[0].zb=0},13:function(){for(var a=
|
||||
this.va[0],b=0;b<a.La.length;b++)rh(a,b)},32:function(a,b){Hh(this,0,b)},33:function(a,b){Jh(this,0,b)},64:function(a,b){Oh(this,0,b)},65:function(a,b){Oh(this,1,b)},66:function(a,b){Oh(this,2,b)},67:Q.prototype.wn,129:function(a,b){this.va[0].La[2].zc=b},130:function(a,b){this.va[0].La[3].zc=b},131:function(a,b){this.va[0].La[1].zc=b},135:function(a,b){this.va[0].La[0].zc=b}},fh={96:Q.prototype.pn,97:Q.prototype.qn,98:Q.prototype.rn,99:Q.prototype.sn,160:Q.prototype.on},hh={96:Q.prototype.Jm,97:Q.prototype.Km,
|
||||
100:Q.prototype.Im,112:Q.prototype.Xm,113:Q.prototype.Ym,128:Q.prototype.mn,132:function(a,b){this.Hb[0]=b},133:function(a,b){this.Hb[1]=b},134:function(a,b){this.Hb[2]=b},136:function(a,b){this.Hb[3]=b},137:function(a,b){this.va[1].La[2].zc=b},138:function(a,b){this.va[1].La[3].zc=b},139:function(a,b){this.va[1].La[1].zc=b},140:function(a,b){this.Hb[4]=b},141:function(a,b){this.Hb[5]=b},142:function(a,b){this.Hb[6]=b},143:function(a,b){this.va[1].La[0].zc=b},160:function(a,b){Hh(this,1,b)},161:function(a,
|
||||
b){Jh(this,1,b)},192:function(a,b){wh(this,1,0,b)},194:function(a,b){yh(this,1,0,b)},196:function(a,b){wh(this,1,1,b)},198:function(a,b){yh(this,1,1,b)},200:function(a,b){wh(this,1,2,b)},202:function(a,b){yh(this,1,2,b)},204:function(a,b){wh(this,1,3,b)},206:function(a,b){yh(this,1,3,b)},208:function(a,b){this.va[1].bh=b},210:function(a,b){Ah(this,1,b)},212:function(a,b){Bh(this,1,b)},214:function(a,b){this.va[1].La[b&3].mode=b},216:function(){this.va[1].zb=0},218:function(){for(var a=this.va[1],
|
||||
b=0;b<a.La.length;b++)rh(a,b)}};v(function(){for(var a=C(window.document,"pcjs","chipset"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Q(d);B(d,c);ih(d)}});function bi(a){w.call(this,"ROM",a,bi);this.kb=null;this.cj=a.addr;this.Pg=a.size;this.cl=a.alias;this.Df=a.file;this.yj=a.notify;if(this.Df){a=this.Df;var b=ea(this.Df);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.Df+"&format=bytes&decimal=true");t(a,!0,null,this,bi.prototype.Dm)}}z(w,bi);
|
||||
bi.prototype.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;ci(this)};bi.prototype.Ub=function(){this.$g&&(this.Na&&this.Na.so(this.cj,this.Pg,this.$g),delete this.$g);return!0};bi.prototype.Kb=function(){return!0};
|
||||
bi.prototype.Dm=function(a,b,c){if(c)this.xa("Unable to load system ROM (error "+c+")");else{if("["==b.charAt(0)||"{"==b.charAt(0))try{var d=eval("("+b+")"),e=d.bytes,f=d.data;if(e)this.kb=e;else if(f)for(this.kb=Array(4*f.length),c=b=0;b<f.length;b++)this.kb[c++]=f[b]&255,this.kb[c++]=f[b]>>8&255,this.kb[c++]=f[b]>>16&255,this.kb[c++]=f[b]>>24&255;else this.kb=d;this.$g=d.symbols;if(!this.kb.length){u("Empty ROM: "+a);return}if(1==this.kb.length){u(this.kb[0]);return}}catch(l){this.xa("ROM data error: "+
|
||||
l.message);return}else for(a=b.replace(/\n/gm," ").replace(/ +$/,"").split(" "),this.kb=Array(a.length),d=0;d<a.length;d++)this.kb[d]=parseInt(a[d],16);ci(this)}};function ci(a){if(!Da(a))if(!a.Df)a.Pa();else if(a.kb&&a.ma){if(a.kb.length!=a.Pg)Ea(a,"ROM size (0x"+p(a.kb.length)+") does not match specified size (0x"+p(a.Pg)+")");else if(di(a,a.cj)&&di(a,a.cl)){if(a.yj){var b=Aa(a.yj,a.id);b&&("ega"==b.Ca&&ei(b,a.kb,[8752,12640],8),b.Pa())}delete a.kb}a.Pa()}}
|
||||
function di(a,b){if(null==b)return!0;if(Ka(a.ma,b,a.Pg,!0)){for(var c=0;c<a.kb.length;c++)Pa(a.ma,b+c,a.kb[c]);return!0}return!1}v(function(){for(var a=C(window.document,"pcjs","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new bi(d);B(d,c)}});function fi(a){w.call(this,"RAM",a,fi);this.Qf=a.addr;this.gd=a.size;this.nl=a.test;this.kl=!!this.gd;this.dg=!1}z(w,fi);fi.prototype.ic=function(a,b,c){this.ma=b;this.ia=c;this.Fa=a;this.ga=D(a,"ChipSet");this.Pa()};
|
||||
fi.prototype.Ub=function(a,b){b||this.reset();return!0};fi.prototype.Kb=function(){return!0};
|
||||
fi.prototype.reset=function(){if(!this.Qf&&!this.kl&&this.ga){var a=1024*mh(this.ga);this.gd&&a!=this.gd&&(Ma(this.ma,this.Qf,this.gd),this.dg=!1);this.gd=a}!this.dg&&this.gd&&Ka(this.ma,this.Qf,this.gd)&&(this.dg=!0,this.status(Math.floor(this.gd/1024)+"Kb"));if(this.dg){if(this.nl||Qa(this.ma,1138,4660),this.ga&&(a=this.ga,a.ka)){var b=1048576>this.Qf?21:23,c=a.ka[b]|a.ka[b+1]<<8,c=c+(this.gd>>10);a.ka[b]=c&255;a.ka[b+1]=c>>8;qh(a)}}else u("No RAM allocated")};
|
||||
v(function(){for(var a=C(window.document,"pcjs","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new fi(d);B(d,c)}});function gi(a){w.call(this,"Keyboard",a,gi);this.Zg={};this.vm=250;this.wm=100;this.Pa()}z(w,gi);
|
||||
var hi={esc:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9,9:10,0:11,"-":12,"=":13,backspace:14,tab:15,q:16,w:17,e:18,r:19,t:20,y:21,u:22,i:23,o:24,p:25,"[":26,"]":27,enter:28,ctrl:29,a:30,s:31,d:32,f:33,g:34,h:35,j:36,k:37,l:38,";":39,squote:40,bquote:41,lshift:42,bslash:43,z:44,x:45,c:46,v:47,b:48,n:49,m:50,",":51,".":52,"/":53,rshift:54,prtsc:55,alt:56,space:57,"caps-lock":58,f1:59,f2:60,f3:61,f4:62,f5:63,f6:64,f7:65,f8:66,f9:67,f10:68,"num-lock":69,"scroll-lock":70,home:71,"up-arrow":72,"page-up":73,"num-minus":74,
|
||||
"left-arrow":75,center:76,"right-arrow":77,"num-plus":78,end:79,"down-arrow":80,"page-down":81,ins:82,del:83},ii={tab:9,esc:27,rshift:224,lshift:240,ctrl:241,alt:242,"caps-lock":244,f1:336,f2:337,f3:338,f4:339,f5:340,f6:341,f7:342,f8:343,f9:344,f10:345,"left-arrow":261,"up-arrow":262,"right-arrow":263,"down-arrow":264,"ctrl-c":3,"ctrl-break":254,"ctrl-alt-del":255},S=[];S[32]=57;S[49]=2;S[33]=61442;S[50]=3;S[64]=61443;S[51]=4;S[35]=61444;S[52]=5;S[36]=61445;S[53]=6;S[37]=61446;S[54]=7;S[94]=61447;
|
||||
S[55]=8;S[38]=61448;S[56]=9;S[42]=61449;S[57]=10;S[40]=61450;S[48]=11;S[41]=61451;S[45]=12;S[95]=61452;S[61]=13;S[43]=61453;S[113]=16;S[81]=61456;S[119]=17;S[87]=61457;S[101]=18;S[69]=61458;S[114]=19;S[82]=61459;S[116]=20;S[84]=61460;S[121]=21;S[89]=61461;S[117]=22;S[85]=61462;S[105]=23;S[73]=61463;S[111]=24;S[79]=61464;S[112]=25;S[80]=61465;S[91]=26;S[123]=61466;S[93]=27;S[125]=61467;S[97]=30;S[65]=61470;S[115]=31;S[83]=61471;S[100]=32;S[68]=61472;S[102]=33;S[70]=61473;S[103]=34;S[71]=61474;
|
||||
S[104]=35;S[72]=61475;S[106]=36;S[74]=61476;S[107]=37;S[75]=61477;S[108]=38;S[76]=61478;S[59]=39;S[58]=61479;S[39]=40;S[34]=61480;S[96]=41;S[126]=61481;S[92]=43;S[124]=61483;S[122]=44;S[90]=61484;S[120]=45;S[88]=61485;S[99]=46;S[67]=61486;S[118]=47;S[86]=61487;S[98]=48;S[66]=61488;S[110]=49;S[78]=61489;S[109]=50;S[77]=61490;S[44]=51;S[60]=61491;S[46]=52;S[62]=61492;S[47]=53;S[63]=61493;S[8]=14;S[9]=15;S[13]=28;S[27]=1;S[240]=42;S[224]=54;S[241]=29;S[242]=56;S[244]=58;S[336]=59;S[337]=60;S[338]=61;
|
||||
S[339]=62;S[340]=63;S[341]=64;S[342]=65;S[343]=66;S[344]=67;S[345]=68;S[261]=75;S[262]=72;S[263]=77;S[264]=80;S[254]=61766;S[255]=15921491;g=gi.prototype;
|
||||
g.ub=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.oa[a])switch(c){case "kbd":return this.oa[a]=d,d.onkeydown=function(a){return ji(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.wa&32?e.wa&=-33:b=e.wa&12?!1:!ki(e,a);return b},d.onkeyup=function(a){return ji(e,a,!1)},!0;default:if(void 0!==ii[c]&&"button"==b)return this.oa[a]=d,d.onclick=function(a,b,c){return function(){a.ia&&a.ia.Ee();return!ki(a,c)}}(this,c,ii[c]),!0;if(void 0!==hi[c])return this.oa[a]=
|
||||
d,b=function(a,b,c){return function(){li(a,c)}}(this,c,hi[c]),c=function(a,b,c){return function(){li(a,c)}}(this,c,hi[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c):(d.onmousedown=b,d.onmouseup=d.onmouseout=c),!0}return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.ga=D(a,"ChipSet")};g.Pa=function(){this.il=(this.rl=na("iOS"))||na("Android");return w.prototype.Pa.call(this)};function $h(a){a.gc=[170];a.ga&&R(a.ga,1,4)}
|
||||
function Wh(a,b,c){var d=!1;a.sh!==c&&(a.sh=a.xh=c);a.ig!==b&&(a.ig=b)&&!a.xh&&ai(a);a.ig&&a.xh&&($h(a),a.xh=!1,d=!0);return d}function Uh(a,b){var c=0;a.gc.length&&(c=a.gc[0],b&&ai(a));return c}function ai(a,b){0<a.gc.length&&(b?a.gc=[]:(a.gc.shift(),0<a.gc.length&&a.ga&&R(a.ga,1)))}g.Sb=function(a,b){return!b&&(this.reset(),a&&this.restore&&!this.restore(a))?!1:!0};g.Jb=function(a){return a&&this.save?this.save():!0};
|
||||
g.reset=function(){this.xd();this.wa=0;this.gc=[];if(this.Pc)for(var a in this.Pc)null!==a.match(/^[0-9]+$/)||this.Pc[a]&&clearTimeout(this.Pc[a]);this.Pc=[];this.Ik=this.de=0};g.save=function(){var a=new H(this);a.set(0,this.Qi());return a.data()};g.restore=function(a){return this.xd(a[0])};g.xd=function(a){var b=0;void 0===a&&(a=[]);this.sh=a[b++];this.ig=a[b];return!0};g.Qi=function(){var a=0,b=[];b[a++]=this.sh;b[a]=this.ig;return b};
|
||||
function li(a,b){var c=b&127,d=c==b;if(a.gc)if(20>a.gc.length){if(!(!d&&!a.Xg[c]||d&&a.Xg[c])){a.Xg[c]=d;a.gc.push(b);1==a.gc.length&&a.ga&&R(a.ga,1);for(var e in hi)if(hi[e]==c){(c=a.oa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.gc.length&&a.gc.push(255)}function mi(a,b){var c=b?a.tm:a.sm;a.ia&&a.ia.Kc&&(c/=a.ia.Kc);return c}function ni(a,b){!a.de||void 0!==b&&b==a.de||(clearTimeout(a.Pc[a.de]),oi(a,a.de,!1))}
|
||||
function ji(a,b,c){var d,e=!c,f=b.keyCode;c&&(a.Ik=f);240==f+224?(a.wa&=-2,c&&(a.wa|=1),f+=224,e=!1):241==f+224?(a.wa&=-5,c&&(a.wa|=4),f+=224,e=!1):242==f+224?(a.wa&=-9,c&&(a.wa|=8),f+=224,e=!1):244==f+224?(a.wa&=-17,c&&(a.wa|=16),f+=224,d=ki(a,f)):91==f?(a.wa&=-33,c&&(a.wa|=32),e=!1,d=!0):9==f||27==f||8==f?(8==f&&4==(a.wa&12)&&(f=254),d=c?!ki(a,f):!1):void 0!==S[f+224]?f+=224:b.altKey||b.ctrlKey?65<=f&&90>=f&&(f+=32):d=!0;e&&(a.wa&=-33,a.il||f!=a.Ik||ni(a));void 0===d&&(d=!oi(a,f,c));return d}
|
||||
g.vb=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.oa[a])switch(c){case "kbd":return this.oa[a]=d,d.onkeydown=function(a){return ji(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.wa&32?e.wa&=-33:b=e.wa&12?!1:!ki(e,a);return b},d.onkeyup=function(a){return ji(e,a,!1)},!0;default:if(void 0!==ii[c]&&"button"==b)return this.oa[a]=d,d.onclick=function(a,b,c){return function(){a.ia&&a.ia.Ee();return!ki(a,c)}}(this,c,ii[c]),!0;if(void 0!==hi[c])return this.oa[a]=
|
||||
d,b=function(a,b,c){return function(){li(a,c)}}(this,c,hi[c]),c=function(a,b,c){return function(){li(a,c)}}(this,c,hi[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c):(d.onmousedown=b,d.onmouseup=d.onmouseout=c),!0}return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.ga=D(a,"ChipSet")};g.Pa=function(){this.ll=(this.ul=na("iOS"))||na("Android");return w.prototype.Pa.call(this)};function $h(a){a.gc=[170];a.ga&&R(a.ga,1,4)}
|
||||
function Wh(a,b,c){var d=!1;a.uh!==c&&(a.uh=a.zh=c);a.ig!==b&&(a.ig=b)&&!a.zh&&ai(a);a.ig&&a.zh&&($h(a),a.zh=!1,d=!0);return d}function Uh(a,b){var c=0;a.gc.length&&(c=a.gc[0],b&&ai(a));return c}function ai(a,b){0<a.gc.length&&(b?a.gc=[]:(a.gc.shift(),0<a.gc.length&&a.ga&&R(a.ga,1)))}g.Ub=function(a,b){return!b&&(this.reset(),a&&this.restore&&!this.restore(a))?!1:!0};g.Kb=function(a){return a&&this.save?this.save():!0};
|
||||
g.reset=function(){this.xd();this.wa=0;this.gc=[];if(this.Pc)for(var a in this.Pc)null!==a.match(/^[0-9]+$/)||this.Pc[a]&&clearTimeout(this.Pc[a]);this.Pc=[];this.Lk=this.de=0};g.save=function(){var a=new H(this);a.set(0,this.Ti());return a.data()};g.restore=function(a){return this.xd(a[0])};g.xd=function(a){var b=0;void 0===a&&(a=[]);this.uh=a[b++];this.ig=a[b];return!0};g.Ti=function(){var a=0,b=[];b[a++]=this.uh;b[a]=this.ig;return b};
|
||||
function li(a,b){var c=b&127,d=c==b;if(a.gc)if(20>a.gc.length){if(!(!d&&!a.Zg[c]||d&&a.Zg[c])){a.Zg[c]=d;a.gc.push(b);1==a.gc.length&&a.ga&&R(a.ga,1);for(var e in hi)if(hi[e]==c){(c=a.oa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.gc.length&&a.gc.push(255)}function mi(a,b){var c=b?a.wm:a.vm;a.ia&&a.ia.Kc&&(c/=a.ia.Kc);return c}function ni(a,b){!a.de||void 0!==b&&b==a.de||(clearTimeout(a.Pc[a.de]),oi(a,a.de,!1))}
|
||||
function ji(a,b,c){var d,e=!c,f=b.keyCode;c&&(a.Lk=f);240==f+224?(a.wa&=-2,c&&(a.wa|=1),f+=224,e=!1):241==f+224?(a.wa&=-5,c&&(a.wa|=4),f+=224,e=!1):242==f+224?(a.wa&=-9,c&&(a.wa|=8),f+=224,e=!1):244==f+224?(a.wa&=-17,c&&(a.wa|=16),f+=224,d=ki(a,f)):91==f?(a.wa&=-33,c&&(a.wa|=32),e=!1,d=!0):9==f||27==f||8==f?(8==f&&4==(a.wa&12)&&(f=254),d=c?!ki(a,f):!1):void 0!==S[f+224]?f+=224:b.altKey||b.ctrlKey?65<=f&&90>=f&&(f+=32):d=!0;e&&(a.wa&=-33,a.ll||f!=a.Lk||ni(a));void 0===d&&(d=!oi(a,f,c));return d}
|
||||
function ki(a,b,c){var d=!1;ni(a,b);oi(a,b,!0)&&(c?oi(a,b,!1):(c=!1,a.Pc[b]&&(clearTimeout(a.Pc[b]),c=!0),c=mi(a,c),a.Pc[a.de=b]=setTimeout(function(a){return function(){oi(a,b,!1)}}(a),c)),d=!0);return d}
|
||||
function oi(a,b,c){var d=!1;c||(a.Pc[b]=null,a.de==b&&(a.de=0));var e=S[b];void 0===e&&1<=b&&26>=b&&(e=S[b+64]&255|61696);if(void 0!==e){14==e&&12==(a.wa&12)&&(e=83);b=[];for(b.push(e&255|(c?0:128));e>>=8;){var d=0,f=e&255;240==f?a.wa&17||(d=42):224==f?a.wa&18||(d=54):241==f?a.wa&4||(d=29):242==f&&(a.wa&8||(d=56));d&&(c?b.unshift(d):b.push(d|128))}for(c=0;c<b.length;c++)li(a,b[c]);d=!0}return d}
|
||||
v(function(){for(var a=C(window.document,"pcjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new gi(d);B(d,c)}});
|
||||
function T(a,b,c,d){w.call(this,"Video",a,T);this.Ca=a.model;this.Bc=0;"ega"==this.Ca&&(this.Pk=a.switches,this.Bc=a.memory||0);this.Nc=a.mode;if(void 0===this.Nc||void 0===U[this.Nc])this.Nc=pi;this.yg=a.charCols;this.Ph=a.charRows;if(void 0===this.yg||void 0===this.Ph)this.yg=U[this.Nc][0],this.Ph=U[this.Nc][1];this.Vc=a.screenWidth;this.ud=a.screenHeight;this.jl=a.scale;this.gl=12<=Math.round(this.Vc/this.yg);this.ll=a.touchScreen;this.qb=b;this.Cc=c;this.Uk=d;this.ab=this.dc=0;this.jd=[];this.Qc=
|
||||
Array(16);this.th=!1;var e=this;this.qb&&(this.qb.onfocus=function(){e.th=!0},this.qb.onblur=function(){e.th=!1});if(a=a.fontROM)"json"!=ea(a)&&(a=ka()+"/api/v1/dump?file="+a+"&format=bytes"),t(a,!0,null,this,this.Bm)}z(w,T);
|
||||
var qi={2:{Sh:15700,Rh:208,Hi:85,Ii:96},3:{Sh:18432,Rh:364,Hi:85,Ii:96},4:{Sh:21850,Rh:364,Hi:85,Ii:96}},ri={6:[1,3,!0],7:[2,3,!0],8:[6,3,!0],9:[4,3,!0],10:[3,1,!0],11:[3,2,!0],0:[1,3,!1],1:[2,3,!1],2:[6,3,!1],3:[4,3,!1],4:[3,1,!1],5:[3,2,!1]},pi=7,U=[,[40,25,1,0,3],,[80,25,1,0,3],[320,200,8,192],,[640,200,16,192]];U[pi]=[80,25,1,0,1];U[13]=[320,200,16];U[14]=[640,200,16];U[15]=[640,350,16];U[16]=[640,350,16];U[0]=U[1];U[2]=U[3];U[5]=U[4];var si=Array(5);si[0]=[0,0,0,255];si[1]=[127,192,127,255];
|
||||
function T(a,b,c,d){w.call(this,"Video",a,T);this.Ca=a.model;this.Bc=0;"ega"==this.Ca&&(this.Sk=a.switches,this.Bc=a.memory||0);this.Nc=a.mode;if(void 0===this.Nc||void 0===U[this.Nc])this.Nc=pi;this.yg=a.charCols;this.Rh=a.charRows;if(void 0===this.yg||void 0===this.Rh)this.yg=U[this.Nc][0],this.Rh=U[this.Nc][1];this.Vc=a.screenWidth;this.ud=a.screenHeight;this.ml=a.scale;this.jl=12<=Math.round(this.Vc/this.yg);this.ol=a.touchScreen;this.rb=b;this.Cc=c;this.Xk=d;this.ab=this.dc=0;this.jd=[];this.Qc=
|
||||
Array(16);this.vh=!1;var e=this;this.rb&&(this.rb.onfocus=function(){e.vh=!0},this.rb.onblur=function(){e.vh=!1});if(a=a.fontROM)"json"!=ea(a)&&(a=ka()+"/api/v1/dump?file="+a+"&format=bytes"),t(a,!0,null,this,this.Em)}z(w,T);
|
||||
var qi={2:{Vh:15700,Uh:208,Ki:85,Li:96},3:{Vh:18432,Uh:364,Ki:85,Li:96},4:{Vh:21850,Uh:364,Ki:85,Li:96}},ri={6:[1,3,!0],7:[2,3,!0],8:[6,3,!0],9:[4,3,!0],10:[3,1,!0],11:[3,2,!0],0:[1,3,!1],1:[2,3,!1],2:[6,3,!1],3:[4,3,!1],4:[3,1,!1],5:[3,2,!1]},pi=7,U=[,[40,25,1,0,3],,[80,25,1,0,3],[320,200,8,192],,[640,200,16,192]];U[pi]=[80,25,1,0,1];U[13]=[320,200,16];U[14]=[640,200,16];U[15]=[640,350,16];U[16]=[640,350,16];U[0]=U[1];U[2]=U[3];U[5]=U[4];var si=Array(5);si[0]=[0,0,0,255];si[1]=[127,192,127,255];
|
||||
si[2]=[127,192,127,255];si[3]=[127,255,127,255];si[4]=[127,255,127,255];var ti=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],W=Array(16);W[0]=[0,0,0,255];W[1]=[0,0,170,255];W[2]=[0,170,0,255];W[3]=[0,170,170,255];W[4]=[170,0,0,255];W[5]=[170,0,170,255];W[6]=[170,85,0,255];W[7]=[170,170,170,255];W[8]=[85,85,85,255];W[9]=[85,85,255,255];W[10]=[85,255,85,255];W[11]=[85,255,255,255];W[12]=[255,85,85,255];W[13]=[255,85,255,255];W[14]=[255,255,85,255];W[15]=[255,255,255,255];
|
||||
var ui=[2,4,6],vi=[3,5,7],wi=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],xi=[0,255,65280,65535,16711680,16711935,16776960,16777215,4278190080,4278190335,4278255360,4278255615,4294901760,4294902015,4294967040,4294967295],X=[0];X[128]=1;X[32768]=2;X[32896]=3;X[8388608]=4;X[8388736]=5;X[8421376]=6;X[8421504]=7;X[2147483648]=8;X[2147483776]=9;X[2147516416]=10;X[2147516544]=11;X[2155872256]=12;X[2155872384]=13;X[2155905024]=14;X[2155905152]=15;
|
||||
function yi(a,b,c,d){if(void 0!==b&&(!c||c.length)){var e=zi[b],f=a.Ad||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(Ai)];this.ng=b;this.ab=e[2];this.dc=e[3];this.Bc=d||e[4];65536<=this.Bc&&720896<=this.ab&&(this.dc=Math.min(this.Bc>>2,32768));this.Yb=c[0];this.jc=c[1];this.Ye=c[2];this.Gf=c[3];this.sc=c[4]&255;this.mg=c[4]>>8&255;this.Vb=c[5];this.Jh=Ai;if(5==b){this.Jh=Bi;b=c[6];void 0===b&&(b=[!1,0,Array(20),0,3==f?0:1,0,0,Array(5),0,0,0,Array(9),0,this.Bc,Array(this.Bc>>2),771,0,4294967295,
|
||||
0,4294967295,0,4294967295,0]);this.vd=b[0];this.Yd=b[1];this.Id=b[2];this.Ri=b[3];this.sg=b[4];this.zh=b[5];this.ve=b[6];this.Of=b[7];this.Ch=b[8];this.Dh=b[9];this.ue=b[10];this.je=b[11];this.kb=b[12];d=this.Bc>>2;if((this.Ld=b[14])&&this.Ld.length<d){for(var e=this.Ld,l=0,k=Array(d),m=0;m<e.length-1;){for(var n=e[m++],q=e[m++];n--;)k[l]=q,l+=2;l==d&&(l=1)}this.Ld=k}this.Mg(b[15]);this.Ci=b[16];this.Ua=b[17];this.Mc=b[18];this.Za=b[19];this.Ag=b[20];this.Cd=b[21];this.ae=b[22];this.Lh=b[23];this.Mh=
|
||||
b[24]}f=qi[f]||qi[3];this.Nh=a.ia.cd/f.Sh|0;this.vm=this.Nh*f.Hi/100|0;this.Dj=this.Nh*f.Rh;this.xm=this.Dj*f.Ii/100|0;this.Th=null==c[7]?0:c[7]}}var Ai=18,Bi=25;function Ci(a){return this.vc(a)|this.vc(a+1)<<8}function Di(a,b){this.xc(a,b&255);this.xc(a+1,b>>8&255)}var Y=[,,function(a){a+=this.offset;return(this.ea.kb=this.la[a])>>this.ea.Ci&255},function(a){a+=this.offset;var b=a&-2;return(a&1?this.la[b]>>8:this.la[b])&255}];
|
||||
Y[16]=function(a){a+=this.offset;a=this.la[a];for(var b=this.ea.Lh&this.ea.Mh,c=0,d=128;d;)(a&b)==b&&(c|=d),b>>>=1,d>>=1;return c};Y[512]=function(a,b){var c=a+this.offset,d;d=this.la[c]&~this.ea.Ua|(b|b<<8|b<<16|b<<24)&this.ea.Ua;d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[1024]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[1536]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d&=this.ea.kb;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[2560]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d|=this.ea.kb;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[3584]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d^=this.ea.kb;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};Y[768]=function(a,b){a+=this.offset;var c,d=a&-2;c=this.ea.Ua&(d==a?16711935:4278255360);c=(b|b<<8|b<<16|b<<24)&c|this.la[d]&~c;c=c&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[d]!=c&&(this.la[d]=c,this.Xa=!0)};
|
||||
Y[4096]=function(a){a+=this.offset;var b=this.la[a]&~this.ea.Ua|this.ea.kb&this.ea.Ua;this.la[a]!=b&&(this.la[a]=b,this.Xa=!0)};Y[8192]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};Y[24576]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d&this.ea.kb,d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[40960]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d|this.ea.kb,d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};Y[57344]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d^this.ea.kb,d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.kb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
function Ei(a){var b=[];if(void 0!==a.ng){b[0]=a.Yb;b[1]=a.jc;b[2]=a.Ye;b[3]=a.Gf;b[4]=a.sc|a.mg<<8;b[5]=a.Vb;if(5==a.ng){var c=[];c[0]=a.vd;c[1]=a.Yd;c[2]=a.Id;c[3]=a.Ri;c[4]=a.sg;c[5]=a.zh;c[6]=a.ve;c[7]=a.Of;c[8]=a.Ch;c[9]=a.Dh;c[10]=a.ue;c[11]=a.je;c[12]=a.kb;c[13]=a.Bc;var d;a:if(d=a.Ld){var e=0,f=[];if(void 0!==d[0])for(var l=0;2>l;l++)for(var k=l;k<d.length;){for(var m=d[k],n=k+2;n<d.length&&d[n]===m;)n+=2;f[e++]=n-k>>1;f[e++]=m;k=n}if(f.length<d.length){d=f;break a}}c[14]=d;c[15]=a.Ih;c[16]=
|
||||
a.Ci;c[17]=a.Ua;c[18]=a.Mc;c[19]=a.Za;c[20]=a.Ag;c[21]=a.Cd;c[22]=a.ae;c[23]=a.Lh;c[24]=a.Mh;b[6]=c}b[7]=a.Th}return b}yi.prototype.Mg=function(a){if(null!=a&&a!=this.Ih){var b=a&255,c=Y[b];c||b&1&&(c=Y[1]);var b=a&65280,d=Y[b];d||b&256&&(d=Y[256]);this.Qe||(this.Qe=[null,Ci,null,Di]);this.Qe[0]=c;this.Qe[2]=d;this.Ih=a}};var zi=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];g=T.prototype;
|
||||
g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;Ta(b,this,Fi);Va(b,this,Gi);"ega"==this.Ca&&(Ta(b,this,Hi),Va(b,this,Ii));(this.Qa=D(a,"Keyboard"))&&this.qb&&this.Qa.ub("input",this.Uk?"textarea":"canvas","kbd",this.Uk||this.qb);this.Sf=9;(this.ga=D(a,"ChipSet"))&&this.Pk&&(this.Sf=Wg(this.Pk,this.Sf));this.Qa&&this.ll&&Ji(this)};g.ub=function(a,b,c,d){var e=this;switch(c){case "refresh":return this.oa[c]=d,d.onclick=function(){$a(e,!0)},!0}return!1};g.Ee=function(){this.qb&&this.qb.focus()};
|
||||
function Ji(a){var b=a.qb;b&&!a.rh&&(b.addEventListener("touchstart",function(b){Ki(a,b)},!1),b.addEventListener("touchmove",function(b){Ki(a,b)},!0),b.addEventListener("touchend",function(){},!1),a.rh=!0)}
|
||||
function Ki(a,b){a.th&&b.preventDefault();var c=0,d=0,e=a.qb;do isNaN(e.offsetLeft)||(c+=e.offsetLeft,d+=e.offsetTop);while(e=e.offsetParent);c=a.Vc/a.qb.offsetWidth*(b.targetTouches[0].pageX-c)/(a.Vc/3)|0;d=a.ud/a.qb.offsetHeight*(b.targetTouches[0].pageY-d)/(a.ud/3)|0;1!=d?d?ki(a.Qa,264,!0):ki(a.Qa,262,!0):1!=c&&(c?ki(a.Qa,263,!0):ki(a.Qa,261,!0))}g.Sb=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
g.Jb=function(a){return a&&this.save?this.save():!0};
|
||||
g.reset=function(){var a=!0,b=0;this.ga&&(b=nh(this.ga));var c=!1;if(this.Ca)switch(this.Ca){case "ega":var c=!0,d=ri[this.Sf];d&&(b=d[0]);b||(b=4);break;case "mda":b=3;break;default:b=2}this.Ad!==b&&(this.Ad=b,a=!0);this.za=null;this.Ac=this.fh=new yi(this,1);this.Mb=this.$f=new yi(this,3);c?(this.ja=new yi(this,5,null,this.Bc),Li(this)):this.ja=new yi;Mi(this);this.zd=null;this.Nc=3==b?pi:3;this.Sd=this.tc=-1;this.Rd=0;Ni(this,this.Nc);if(this.za.ab&&a){a=this.za.ab+this.gh;for(b=this.za.ab;b<a;b+=
|
||||
2)d=Math.floor(65536*Math.random()),4==this.Ad?(c=b>>1&255,d=d>>8&-129,d>>4==(d&15)&&(d^=15)):(c=d&255,d=(d&256?7:112)|8&d>>8),Qa(this.ma,b,c|d<<8);$a(this,!0)}};function Li(a){a.ja.sg&1?(a.Ac=a.fh,a.Mb=a.ja):(a.Ac=a.ja,a.Mb=a.$f)}g.save=function(){var a=new H(this);a.set(0,Ei(this.fh));a.set(1,Ei(this.$f));a.set(2,[this.Ad,this.Nc,this.zd]);a.set(3,Ei(this.ja));return a.data()};
|
||||
g.restore=function(a){var b=a[2];this.Ad=b[0];this.Nc=b[1];this.zd=b[2];this.za=null;this.Ac=this.fh=new yi(this,1,a[0]);this.Mb=this.$f=new yi(this,3,a[1]);this.ja=new yi(this,5,a[3],this.Bc);this.ja.Yb&&Li(this);Mi(this);if(!Oi(this))return!1;Pi(this);return!0};
|
||||
g.Bm=function(a,b,c){if(c)this.xa("Unable to load font ROM image (error "+c+")");else{try{var d=eval("("+b+")");if(!d.length){u("Empty font ROM image: "+a);return}if(1==d.length){u(d[0]);return}if(8192==d.length)ei(this,d,[0,6144]);else{this.xa("Unrecognized font data length ("+d.length+")");return}}catch(e){this.xa("Font ROM data error: "+e.message);return}this.Pa()}};
|
||||
function Qi(a,b){if(1==b)return a.Qc[0]=W[0],a.Qc[1]=W[7],a.Qc;if(2==b){var c=a.za.Ye;if(a.za===a.ja){var d=a.ja.Id[0],c=d&7;d&16&&(c|=8);18!=a.ja.Id[1]&&(c|=32)}a.Qc[0]=W[c&15];c=c&32?vi:ui;for(d=0;d<c.length;d++)a.Qc[d+1]=W[c[d]];return a.Qc}if(a.Mb===a.$f)return W;c=null!=a.ja.Id[15]?a.ja.Id:wi;for(d=0;d<a.Qc.length;d++){var e=c[d]||0;a.Qc[d]=[(e&4?170:0)|(e&32?85:0),(e&2?170:0)|(e&16?85:0),(e&1?170:0)|(e&8?85:0),255]}return a.Qc}function ei(a,b,c,d){a.Pf=b;a.Wg=c;a.Vd=d}
|
||||
function Mi(a){var b=!1;if(window&&a.Pf){var c=a.Vd?0:2048,d=a.Vd?a.Vd:9;Ri(a,1,a.Wg[0],c,d,14,a.Pf,si,ti)&&(b=!0);c=Qi(a);d=a.Vd?a.Vd:8;Ri(a,3,a.Wg[1],0,d,8,a.Pf,c)&&(b=!0);a.Vd&&Ri(a,5,a.Wg[0],0,a.Vd,14,a.Pf,c)&&(b=!0)}return b}function Ri(a,b,c,d,e,f,l,k,m){var n=!1;Si(a,b,c,d,e,f,l,k,m)&&(n=!0);a.gl&&Si(a,b<<1,c,d,e,f,l,k,m)&&(n=!0);return n}
|
||||
function Si(a,b,c,d,e,f,l,k,m){var n=!1,q=b&1?0:1,s=a.jd[b];s||(s={Wb:e<<q,Xb:f<<q,ie:Array(k.length),Yi:k.slice(),Le:m,Ug:Array(k.length)});for(m=0;m<k.length;m++){var r=k[m],y=s.ie[m]?s.Yi[m]:[];if(r[0]!==y[0]||r[1]!==y[1]||r[2]!==y[2]){var n=s,y=m,M=q,V=c,aa=d,ba=e,gb=f,lc=l,jd=[0,0,0,0],mc=window.document.createElement("canvas");mc.width=n.Wb<<4;mc.height=n.Xb<<4;for(var Qh=mc.getContext("2d"),sa=void 0,sb=void 0,Ra=void 0,nc=8>gb||!aa?gb:8,kd=Qh.createImageData(n.Wb,n.Xb),sa=0;256>sa;sa++){for(Ra=
|
||||
0;Ra<gb;Ra++)for(var Rj=n.Le&&y&1&&Ra>=gb-2,Sj=lc[Ra<nc?V+sa*nc+Ra:aa+sa*nc+Ra-nc],ld=0;ld<=M;ld++)for(sb=0;sb<ba;sb++){var Rh=sb<<M,Sh=(Ra<<M)+ld,Th=Rj||Sj&128>>(8<=sb&&176<=sa&&223>=sa?7:sb)?r:jd;Ti(kd,Rh,Sh,Th);M&&Ti(kd,Rh+1,Sh,Th)}Qh.putImageData(kd,(sa&15)*n.Wb,(sa>>4)*n.Xb)}n.ie[y]="#"+p(r[0],2)+p(r[1],2)+p(r[2],2);n.Yi[y]=r;n.Ug[y]=mc;n=!0}}a.jd[b]=s;return n}function Ui(a){0<a.Rd||0<=a.tc?0>a.Sd&&(a.Sd=0):a.Sd=-1}
|
||||
function Pi(a){if(a.Ab){for(var b=10;15>=b;b++)if(null==a.za.Vb[b])return;var c=a.za.Vb[10],b=c&31,d=a.za.Vb[11]&31,e=a.za.Vb[9]&31,f=!1;a.za===a.ja&&(f=!0,7!=e||4!=b||d||(d=7));if(c&32||b>d&&!f||b>e)Vi(a);else{c=a.za.Vb[15]+((a.za.Vb[14]&63)<<8);a.tc!=c&&(Vi(a),a.tc=c);d=d-b+1;if(a.Wk!=b||a.jj!=d)a.Wk=b,a.jj=d;a.td=e+1;Ui(a)}}}
|
||||
function Vi(a){if(0<=a.tc){if(void 0!==a.Lb){var b=a.Lb[a.tc];if(b&131072){var b=b&-131073,c=a.tc%a.lb,d=Math.floor(a.tc/a.lb);a.Ab&&a.jd[a.Ab]&&(a.pe&&Wi(a,c,d,b,a.pe),Wi(a,c,d,b));a.Lb[a.tc]=b}}a.tc=-1}}
|
||||
function Xi(a){var b;a=a.za;var c=a.je[5];if(null!=c){b=2;var d=512,e=a.je[3]&31;switch(c&3){case 0:if(e){d=1024;switch(e&24){case 8:d=1536;break;case 16:d=2560;break;case 24:d=3584}a.Mc=e&7}break;case 1:d=4096;break;case 2:switch(e&24){default:d=8192;break;case 8:d=24576;break;case 16:d=40960;break;case 24:d=57344}}c&8&&(b=16);c&16&&(b|=1,d|=256);b|=d}return b}g.fe=function(a){var b=this.za;null!=a&&b&&a!=b.Ih&&(b.Mg(a),this.ma.Mg(b.ab,b.dc,b.Qe))};
|
||||
function Oi(a,b){var c,d=a.zd,e=a.za;if(e)if(1==e.ng)d=pi;else if(5==e.ng){var d=null,f=e.Bc>>2,l=32768<f?32768:f,k=e.je[6];if(null!=k){switch(k&12){case 0:e.ab=655360;e.dc=f;d=255;break;case 4:e.ab=655360;e.dc=f;d=3==a.Ad?15:16;break;case 8:e.ab=720896;e.dc=l;d=pi;break;case 12:e.ab=753664,e.dc=l,d=3==a.Ad?2:3}c=e.Of[1]&8;f=e.Vb[6]|(e.Vb[7]&1)<<8;255!=d&&(k&1?753664==e.ab?d=c?7-d:6:350>f&&(d=c?13:14):c&&(d-=2));c=Xi(a)}}else e.jc&8&&(e.jc&2?(d=e.jc&16?6:5,e.jc&4||(d-=1)):(d=e.jc&1?3:1,e.jc&4&&(d-=
|
||||
function yi(a,b,c,d){if(void 0!==b&&(!c||c.length)){var e=zi[b],f=a.Ad||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(Ai)];this.ng=b;this.ab=e[2];this.dc=e[3];this.Bc=d||e[4];65536<=this.Bc&&720896<=this.ab&&(this.dc=Math.min(this.Bc>>2,32768));this.$b=c[0];this.jc=c[1];this.Ye=c[2];this.Gf=c[3];this.sc=c[4]&255;this.mg=c[4]>>8&255;this.Xb=c[5];this.Lh=Ai;if(5==b){this.Lh=Bi;b=c[6];void 0===b&&(b=[!1,0,Array(20),0,3==f?0:1,0,0,Array(5),0,0,0,Array(9),0,this.Bc,Array(this.Bc>>2),771,0,4294967295,
|
||||
0,4294967295,0,4294967295,0]);this.vd=b[0];this.Yd=b[1];this.Id=b[2];this.Ui=b[3];this.sg=b[4];this.Bh=b[5];this.ve=b[6];this.Of=b[7];this.Eh=b[8];this.Fh=b[9];this.ue=b[10];this.je=b[11];this.lb=b[12];d=this.Bc>>2;if((this.Ld=b[14])&&this.Ld.length<d){for(var e=this.Ld,l=0,k=Array(d),m=0;m<e.length-1;){for(var n=e[m++],q=e[m++];n--;)k[l]=q,l+=2;l==d&&(l=1)}this.Ld=k}this.Og(b[15]);this.Fi=b[16];this.Ua=b[17];this.Mc=b[18];this.Za=b[19];this.Cg=b[20];this.Cd=b[21];this.ae=b[22];this.Nh=b[23];this.Oh=
|
||||
b[24]}f=qi[f]||qi[3];this.Ph=a.ia.cd/f.Vh|0;this.ym=this.Ph*f.Ki/100|0;this.Gj=this.Ph*f.Uh;this.Am=this.Gj*f.Li/100|0;this.Wh=null==c[7]?0:c[7]}}var Ai=18,Bi=25;function Ci(a){return this.vc(a)|this.vc(a+1)<<8}function Di(a,b){this.xc(a,b&255);this.xc(a+1,b>>8&255)}var Y=[,,function(a){a+=this.offset;return(this.ea.lb=this.la[a])>>this.ea.Fi&255},function(a){a+=this.offset;var b=a&-2;return(a&1?this.la[b]>>8:this.la[b])&255}];
|
||||
Y[16]=function(a){a+=this.offset;a=this.la[a];for(var b=this.ea.Nh&this.ea.Oh,c=0,d=128;d;)(a&b)==b&&(c|=d),b>>>=1,d>>=1;return c};Y[512]=function(a,b){var c=a+this.offset,d;d=this.la[c]&~this.ea.Ua|(b|b<<8|b<<16|b<<24)&this.ea.Ua;d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[1024]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[1536]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d&=this.ea.lb;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[2560]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d|=this.ea.lb;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[3584]=function(a,b){var c=a+this.offset;b=b>>this.ea.Mc|b<<8-this.ea.Mc&255;var d;d=(b|b<<8|b<<16|b<<24)&this.ea.Cd|this.ea.ae;d^=this.ea.lb;d=d&this.ea.Ua|this.la[c]&~this.ea.Ua;d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};Y[768]=function(a,b){a+=this.offset;var c,d=a&-2;c=this.ea.Ua&(d==a?16711935:4278255360);c=(b|b<<8|b<<16|b<<24)&c|this.la[d]&~c;c=c&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[d]!=c&&(this.la[d]=c,this.Xa=!0)};
|
||||
Y[4096]=function(a){a+=this.offset;var b=this.la[a]&~this.ea.Ua|this.ea.lb&this.ea.Ua;this.la[a]!=b&&(this.la[a]=b,this.Xa=!0)};Y[8192]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};Y[24576]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d&this.ea.lb,d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
Y[40960]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d|this.ea.lb,d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};Y[57344]=function(a,b){var c=a+this.offset,d=xi[b&15],d=d^this.ea.lb,d=d&this.ea.Ua|this.la[c]&~this.ea.Ua,d=d&this.ea.Za|this.ea.lb&~this.ea.Za;this.la[c]!=d&&(this.la[c]=d,this.Xa=!0)};
|
||||
function Ei(a){var b=[];if(void 0!==a.ng){b[0]=a.$b;b[1]=a.jc;b[2]=a.Ye;b[3]=a.Gf;b[4]=a.sc|a.mg<<8;b[5]=a.Xb;if(5==a.ng){var c=[];c[0]=a.vd;c[1]=a.Yd;c[2]=a.Id;c[3]=a.Ui;c[4]=a.sg;c[5]=a.Bh;c[6]=a.ve;c[7]=a.Of;c[8]=a.Eh;c[9]=a.Fh;c[10]=a.ue;c[11]=a.je;c[12]=a.lb;c[13]=a.Bc;var d;a:if(d=a.Ld){var e=0,f=[];if(void 0!==d[0])for(var l=0;2>l;l++)for(var k=l;k<d.length;){for(var m=d[k],n=k+2;n<d.length&&d[n]===m;)n+=2;f[e++]=n-k>>1;f[e++]=m;k=n}if(f.length<d.length){d=f;break a}}c[14]=d;c[15]=a.Kh;c[16]=
|
||||
a.Fi;c[17]=a.Ua;c[18]=a.Mc;c[19]=a.Za;c[20]=a.Cg;c[21]=a.Cd;c[22]=a.ae;c[23]=a.Nh;c[24]=a.Oh;b[6]=c}b[7]=a.Wh}return b}yi.prototype.Og=function(a){if(null!=a&&a!=this.Kh){var b=a&255,c=Y[b];c||b&1&&(c=Y[1]);var b=a&65280,d=Y[b];d||b&256&&(d=Y[256]);this.Qe||(this.Qe=[null,Ci,null,Di]);this.Qe[0]=c;this.Qe[2]=d;this.Kh=a}};var zi=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];g=T.prototype;
|
||||
g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;Ta(b,this,Fi);Va(b,this,Gi);"ega"==this.Ca&&(Ta(b,this,Hi),Va(b,this,Ii));(this.Qa=D(a,"Keyboard"))&&this.rb&&this.Qa.vb("input",this.Xk?"textarea":"canvas","kbd",this.Xk||this.rb);this.Sf=9;(this.ga=D(a,"ChipSet"))&&this.Sk&&(this.Sf=Wg(this.Sk,this.Sf));this.Qa&&this.ol&&Ji(this)};g.vb=function(a,b,c,d){var e=this;switch(c){case "refresh":return this.oa[c]=d,d.onclick=function(){$a(e,!0)},!0}return!1};g.Ee=function(){this.rb&&this.rb.focus()};
|
||||
function Ji(a){var b=a.rb;b&&!a.th&&(b.addEventListener("touchstart",function(b){Ki(a,b)},!1),b.addEventListener("touchmove",function(b){Ki(a,b)},!0),b.addEventListener("touchend",function(){},!1),a.th=!0)}
|
||||
function Ki(a,b){a.vh&&b.preventDefault();var c=0,d=0,e=a.rb;do isNaN(e.offsetLeft)||(c+=e.offsetLeft,d+=e.offsetTop);while(e=e.offsetParent);c=a.Vc/a.rb.offsetWidth*(b.targetTouches[0].pageX-c)/(a.Vc/3)|0;d=a.ud/a.rb.offsetHeight*(b.targetTouches[0].pageY-d)/(a.ud/3)|0;1!=d?d?ki(a.Qa,264,!0):ki(a.Qa,262,!0):1!=c&&(c?ki(a.Qa,263,!0):ki(a.Qa,261,!0))}g.Ub=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
g.Kb=function(a){return a&&this.save?this.save():!0};
|
||||
g.reset=function(){var a=!0,b=0;this.ga&&(b=nh(this.ga));var c=!1;if(this.Ca)switch(this.Ca){case "ega":var c=!0,d=ri[this.Sf];d&&(b=d[0]);b||(b=4);break;case "mda":b=3;break;default:b=2}this.Ad!==b&&(this.Ad=b,a=!0);this.za=null;this.Ac=this.hh=new yi(this,1);this.Nb=this.$f=new yi(this,3);c?(this.ja=new yi(this,5,null,this.Bc),Li(this)):this.ja=new yi;Mi(this);this.zd=null;this.Nc=3==b?pi:3;this.Sd=this.tc=-1;this.Rd=0;Ni(this,this.Nc);if(this.za.ab&&a){a=this.za.ab+this.ih;for(b=this.za.ab;b<a;b+=
|
||||
2)d=Math.floor(65536*Math.random()),4==this.Ad?(c=b>>1&255,d=d>>8&-129,d>>4==(d&15)&&(d^=15)):(c=d&255,d=(d&256?7:112)|8&d>>8),Qa(this.ma,b,c|d<<8);$a(this,!0)}};function Li(a){a.ja.sg&1?(a.Ac=a.hh,a.Nb=a.ja):(a.Ac=a.ja,a.Nb=a.$f)}g.save=function(){var a=new H(this);a.set(0,Ei(this.hh));a.set(1,Ei(this.$f));a.set(2,[this.Ad,this.Nc,this.zd]);a.set(3,Ei(this.ja));return a.data()};
|
||||
g.restore=function(a){var b=a[2];this.Ad=b[0];this.Nc=b[1];this.zd=b[2];this.za=null;this.Ac=this.hh=new yi(this,1,a[0]);this.Nb=this.$f=new yi(this,3,a[1]);this.ja=new yi(this,5,a[3],this.Bc);this.ja.$b&&Li(this);Mi(this);if(!Oi(this))return!1;Pi(this);return!0};
|
||||
g.Em=function(a,b,c){if(c)this.xa("Unable to load font ROM image (error "+c+")");else{try{var d=eval("("+b+")");if(!d.length){u("Empty font ROM image: "+a);return}if(1==d.length){u(d[0]);return}if(8192==d.length)ei(this,d,[0,6144]);else{this.xa("Unrecognized font data length ("+d.length+")");return}}catch(e){this.xa("Font ROM data error: "+e.message);return}this.Pa()}};
|
||||
function Qi(a,b){if(1==b)return a.Qc[0]=W[0],a.Qc[1]=W[7],a.Qc;if(2==b){var c=a.za.Ye;if(a.za===a.ja){var d=a.ja.Id[0],c=d&7;d&16&&(c|=8);18!=a.ja.Id[1]&&(c|=32)}a.Qc[0]=W[c&15];c=c&32?vi:ui;for(d=0;d<c.length;d++)a.Qc[d+1]=W[c[d]];return a.Qc}if(a.Nb===a.$f)return W;c=null!=a.ja.Id[15]?a.ja.Id:wi;for(d=0;d<a.Qc.length;d++){var e=c[d]||0;a.Qc[d]=[(e&4?170:0)|(e&32?85:0),(e&2?170:0)|(e&16?85:0),(e&1?170:0)|(e&8?85:0),255]}return a.Qc}function ei(a,b,c,d){a.Pf=b;a.Yg=c;a.Vd=d}
|
||||
function Mi(a){var b=!1;if(window&&a.Pf){var c=a.Vd?0:2048,d=a.Vd?a.Vd:9;Ri(a,1,a.Yg[0],c,d,14,a.Pf,si,ti)&&(b=!0);c=Qi(a);d=a.Vd?a.Vd:8;Ri(a,3,a.Yg[1],0,d,8,a.Pf,c)&&(b=!0);a.Vd&&Ri(a,5,a.Yg[0],0,a.Vd,14,a.Pf,c)&&(b=!0)}return b}function Ri(a,b,c,d,e,f,l,k,m){var n=!1;Si(a,b,c,d,e,f,l,k,m)&&(n=!0);a.jl&&Si(a,b<<1,c,d,e,f,l,k,m)&&(n=!0);return n}
|
||||
function Si(a,b,c,d,e,f,l,k,m){var n=!1,q=b&1?0:1,s=a.jd[b];s||(s={Yb:e<<q,Zb:f<<q,ie:Array(k.length),aj:k.slice(),Le:m,Wg:Array(k.length)});for(m=0;m<k.length;m++){var r=k[m],y=s.ie[m]?s.aj[m]:[];if(r[0]!==y[0]||r[1]!==y[1]||r[2]!==y[2]){var n=s,y=m,M=q,V=c,aa=d,ba=e,gb=f,lc=l,jd=[0,0,0,0],mc=window.document.createElement("canvas");mc.width=n.Yb<<4;mc.height=n.Zb<<4;for(var Qh=mc.getContext("2d"),sa=void 0,sb=void 0,Ra=void 0,nc=8>gb||!aa?gb:8,kd=Qh.createImageData(n.Yb,n.Zb),sa=0;256>sa;sa++){for(Ra=
|
||||
0;Ra<gb;Ra++)for(var Rj=n.Le&&y&1&&Ra>=gb-2,Sj=lc[Ra<nc?V+sa*nc+Ra:aa+sa*nc+Ra-nc],ld=0;ld<=M;ld++)for(sb=0;sb<ba;sb++){var Rh=sb<<M,Sh=(Ra<<M)+ld,Th=Rj||Sj&128>>(8<=sb&&176<=sa&&223>=sa?7:sb)?r:jd;Ti(kd,Rh,Sh,Th);M&&Ti(kd,Rh+1,Sh,Th)}Qh.putImageData(kd,(sa&15)*n.Yb,(sa>>4)*n.Zb)}n.ie[y]="#"+p(r[0],2)+p(r[1],2)+p(r[2],2);n.aj[y]=r;n.Wg[y]=mc;n=!0}}a.jd[b]=s;return n}function Ui(a){0<a.Rd||0<=a.tc?0>a.Sd&&(a.Sd=0):a.Sd=-1}
|
||||
function Pi(a){if(a.Bb){for(var b=10;15>=b;b++)if(null==a.za.Xb[b])return;var c=a.za.Xb[10],b=c&31,d=a.za.Xb[11]&31,e=a.za.Xb[9]&31,f=!1;a.za===a.ja&&(f=!0,7!=e||4!=b||d||(d=7));if(c&32||b>d&&!f||b>e)Vi(a);else{c=a.za.Xb[15]+((a.za.Xb[14]&63)<<8);a.tc!=c&&(Vi(a),a.tc=c);d=d-b+1;if(a.Zk!=b||a.mj!=d)a.Zk=b,a.mj=d;a.td=e+1;Ui(a)}}}
|
||||
function Vi(a){if(0<=a.tc){if(void 0!==a.Mb){var b=a.Mb[a.tc];if(b&131072){var b=b&-131073,c=a.tc%a.mb,d=Math.floor(a.tc/a.mb);a.Bb&&a.jd[a.Bb]&&(a.pe&&Wi(a,c,d,b,a.pe),Wi(a,c,d,b));a.Mb[a.tc]=b}}a.tc=-1}}
|
||||
function Xi(a){var b;a=a.za;var c=a.je[5];if(null!=c){b=2;var d=512,e=a.je[3]&31;switch(c&3){case 0:if(e){d=1024;switch(e&24){case 8:d=1536;break;case 16:d=2560;break;case 24:d=3584}a.Mc=e&7}break;case 1:d=4096;break;case 2:switch(e&24){default:d=8192;break;case 8:d=24576;break;case 16:d=40960;break;case 24:d=57344}}c&8&&(b=16);c&16&&(b|=1,d|=256);b|=d}return b}g.fe=function(a){var b=this.za;null!=a&&b&&a!=b.Kh&&(b.Og(a),this.ma.Og(b.ab,b.dc,b.Qe))};
|
||||
function Oi(a,b){var c,d=a.zd,e=a.za;if(e)if(1==e.ng)d=pi;else if(5==e.ng){var d=null,f=e.Bc>>2,l=32768<f?32768:f,k=e.je[6];if(null!=k){switch(k&12){case 0:e.ab=655360;e.dc=f;d=255;break;case 4:e.ab=655360;e.dc=f;d=3==a.Ad?15:16;break;case 8:e.ab=720896;e.dc=l;d=pi;break;case 12:e.ab=753664,e.dc=l,d=3==a.Ad?2:3}c=e.Of[1]&8;f=e.Xb[6]|(e.Xb[7]&1)<<8;255!=d&&(k&1?753664==e.ab?d=c?7-d:6:350>f&&(d=c?13:14):c&&(d-=2));c=Xi(a)}}else e.jc&8&&(e.jc&2?(d=e.jc&16?6:5,e.jc&4||(d-=1)):(d=e.jc&1?3:1,e.jc&4&&(d-=
|
||||
1)));else a.zd=null,null==d&&(d=a.Nc);if(!Ni(a,d,b))return!1;a.fe(c);return!0}
|
||||
function Ni(a,b,c){if(null!=b&&(b!=a.zd||c)){a.bl=0;a.zd=b;b=a.za||(b==pi?a.Ac:a.Mb);if(b!=a.za||b.ab!=a.ab||b.dc!=a.dc){Vi(a);if(a.ab){if(!Ma(a.ma,a.ab,a.dc))return!1;a.za&&(a.za.Yb=!1)}a.za=b;b.Yb=!0;a.ab=b.ab;a.dc=b.dc;if(!Ka(a.ma,b.ab,b.dc,!1,b===a.ja?b:null))return!1}a.Ab=0;a.lb=a.yg;a.ac=a.Ph;a.Kh=U[pi][2];b=0;var d=U[a.zd];d&&(a.lb=d[0],a.ac=d[1],a.Kh=d[2],b=d[3]||0,a.Ab=d[4],4==a.Ad&&a.za===a.ja&&3==a.Ab&&(7==a.ja.Vb[9]?a.ac=43:a.Ab=5));a.Aj=a.lb*a.ac;a.vg=a.Aj/a.Kh;a.gh=(a.vg<<1)+b;a.hj=
|
||||
b?a.gh+b>>1:0;13<=a.zd&&(a.vg<<=1);a.jd.length&&(a.Wc=Math.floor(a.Vc/a.lb),a.Xc=Math.floor(a.ud/a.ac),a.Ab?(b=a.jd[a.Ab],d=a.jd[a.Ab<<1],a.jl&&80==a.lb?d&&a.Wc>=3*d.Wb>>2&&(a.Ab<<=1,b=d):(d&&a.Wc>=d.Wb&&(a.Ab<<=1,b=d),b&&(a.Wc=b.Wb,a.Xc=b.Xb)),a.af=a.bf=0,b&&(a.af=a.lb*b.Wb,a.bf=a.ac*b.Xb)):(a.Wc=a.Xc=1,a.af=a.lb,a.bf=a.ac),a.pg=a.Cc.createImageData(a.af,a.bf),a.oe=window.document.createElement("canvas"),a.oe.width=a.af,a.oe.height=a.bf,a.pe=a.oe.getContext("2d"),a.Ui=a.Vi=0,a.jh=a.Vc,a.kh=a.ud,
|
||||
b=a.Vc-a.lb*a.Wc,d=a.ud-a.ac*a.Xc,0<b&&(a.Ui=b>>1,a.jh-=b),0<d&&(a.Vi=d>>1,a.kh-=d),b||d)&&(a.Cc.fillStyle=a.qb.style.backgroundColor,a.Cc.fillRect(0,0,a.Vc,a.ud));!1!==c?$a(a,!0):Yi(a,!0)}return!0}function Ti(a,b,c,d){b=(b+c*a.width)*d.length;a.data[b+0]=d[0];a.data[b+1]=d[1];a.data[b+2]=d[2];a.data[b+3]=d[3]}function Yi(a,b){var c;if(b){if(c=a.vg,void 0===a.Lb||a.Lb.length!=c)a.Lb=Array(c)}else{if(void 0===a.Lb)return;c=a.Lb.length}for(var d=0;d<c;d++)a.Lb[d]=-1;a.Rd=-1}
|
||||
function Wi(a,b,c,d,e){var f=d&255,l=d>>8;d=l&15;var k=a.jd[a.Ab];k.Le&&(d=k.Le[d]);var m=l>>4&15;k.Le&&(m=k.Le[m]);e?(b*=k.Wb,c*=k.Xb,e.fillStyle=k.ie[m],e.fillRect(b,c,k.Wb,k.Xb)):(b=b*a.Wc+a.Ui,c=c*a.Xc+a.Vi,a.Cc.fillStyle=k.ie[m],a.Cc.fillRect(b,c,a.Wc,a.Xc));l&256&&(m=(f&15)*k.Wb,f=(f>>4)*k.Xb,e?e.drawImage(k.Ug[d],m,f,k.Wb,k.Xb,b,c,k.Wb,k.Xb):a.Cc.drawImage(k.Ug[d],m,f,k.Wb,k.Xb,b,c,a.Wc,a.Xc));l&512&&(f=a.Wk,l=a.jj,e?(a.td&&a.td!==k.Xb&&(f=Math.floor(f*k.Xb/a.td),l=Math.floor(l*k.Xb/a.td)),
|
||||
e.fillStyle=k.ie[d],e.fillRect(b,c+f,k.Wb,l)):(a.td&&a.td!==a.Xc&&(f=Math.floor(f*a.Xc/a.td),l=Math.floor(l*a.Xc/a.td)),a.Cc.fillStyle=k.ie[d],a.Cc.fillRect(b,c+f,a.Wc,l)))}
|
||||
function $a(a,b){if(a.zb){var c=!1;a.za&&(a.za===a.ja?a.ja.Yd&32&&(c=!0):a.za.jc&8&&(c=!0));if(c||b){if(b)Yi(a,!0);else if(void 0===a.Lb)return;var d=!1;!(b||++a.bl&15)&&0<=a.Sd&&(a.Sd++,d=!0);var e=0,f=a.Aj,c=a.za.ab,l=c+a.za.dc,k=(a.za.Vb[12]<<8)+a.za.Vb[13];a.Ab&&(k<<=1);var c=c+k,m=a.gh;c+m>l&&(m=l-c,0>m&&(m=0));l=c+m;if(k=!b){for(var k=a.ma,n=!0,q=c>>k.Ib;0<m&&q<k.ya.length;)k.ya[q].Xa&&(k.ya[q].Xa=n=!1,k.ya[q].lj=!0),m-=k.nc,q++;k=n}if(k){if(!d)return;if(!a.Rd){if(0>a.tc)return;e=a.tc;f=e+1}}if(a.Ab){if(a.jd[a.Ab]){d=
|
||||
0;k=a.Rd=0;m=1048575;a.za.jc&32&&(k=32768,m&=~k,a.Sd&2||(m&=-65537));for(c+=e<<1;c<l&&e<f;)n=Oa(a.ma,c),n|=65536,n&k&&(a.Rd++,n&=m),e==a.tc&&(n|=a.Sd&1?131072:0),q=a.Lb[e],q!=n&&(Wi(a,e%a.lb,Math.floor(e/a.lb),n,a.pe),a.Lb[e]=n,d++),c+=2,e++;d&&a.pe&&a.Cc.drawImage(a.oe,0,0,a.af,a.bf,a.Ui,a.Vi,a.jh,a.kh);Ui(a)}}else if(a.hj){for(var f=l,s,r,e=c,l=a.Rd=0,d=a.Kh,k=16==d?65536:196608,m=16==d?1:2,n=Qi(a,m),y=q=0,M=a.lb,V=0,aa=a.ac,ba=0;e<f;){s=Oa(a.ma,e);r=a.Lb[l];if(r===s)q+=d;else{a.Lb[l]=s;s=s>>8|
|
||||
(s&255)<<8;r=k;var gb=16;q<M&&(M=q);for(var lc=0;lc<d;lc++){var jd=(s&(r>>=m))>>(gb-=m);Ti(a.pg,q++,y,n[jd])}q>V&&(V=q);y<aa&&(aa=y);y>=ba&&(ba=y+1)}e+=2;l++;if(q>=a.lb){q=0;y+=2;if(y>a.ac)break;y==a.ac&&(y=1,e=c+a.hj)}}M<a.lb&&(a.pe.putImageData(a.pg,0,0,M,aa,V-M,ba-aa),a.Cc.drawImage(a.oe,0,0,a.lb,a.ac,0,0,a.Vc,a.ud))}else{f=l;e=a.Rd=0;l=Qi(a);d=a.za.Ld;m=k=0;n=a.lb;q=0;y=a.ac;for(M=0;c<f;){V=c++-a.ab;V=d[V];aa=a.Lb[e];if(aa===V)k+=8;else{a.Lb[e]=V;k<n&&(n=k);for(aa=0;8>aa;aa++)ba=V&2155905152,
|
||||
0>ba&&(ba=-ba),ba=X[ba]||0,Ti(a.pg,k++,m,l[ba]),V<<=1;k>q&&(q=k);m<y&&(y=m);m>=M&&(M=m+1)}e++;if(k>=a.lb&&(k=0,++m>a.ac))break}n<a.lb&&(a.pe.putImageData(a.pg,0,0,n,y,q-n,M-y),a.Cc.drawImage(a.oe,0,0,a.lb,a.ac,0,0,a.Vc,a.ud))}}}}g.Xl=function(){return this.Ac.sc};g.gn=function(a,b){var c=this.Ac;c.mg=c.sc;c.sc=b&31};g.Wl=function(){return Zi(this.Ac)};g.fn=function(a,b){$i(this,this.Ac,b)};g.Yl=function(){return this.Ac.jc};g.hn=function(a,b){this.Ac.jc=b;Oi(this,!1)};
|
||||
g.Zl=function(){return aj(this,this.Ac)};g.Gk=function(a,b){this.ja.zh=this.ja.zh&-4|b&3};g.wj=function(){var a=this.ja.vd?this.ja.Id[this.ja.Yd&31]:this.ja.Yd;this.ja.vd=!this.ja.vd;return a};g.Fk=function(a,b){var c=this.ja.Yd&32;if(this.ja.vd){var d=this.ja.Yd&31;if(16<=d||!c)this.ja.Id[d]=b;this.ja.vd=!1}else this.ja.Yd=b,this.ja.vd=!0,b&32&&!c&&Mi(this)&&$a(this,!0)};g.im=function(){var a=3-((this.ja.sg&12)>>2),a=this.ja.Ri&-17|(this.Sf&1<<a)<<4-a;return this.ja.Ri=a};
|
||||
g.kn=function(a,b){this.ja.sg=b;Li(this)};g.hm=function(){return this.ja.ve};g.rn=function(a,b){this.ja.ve=b};g.gm=function(){return this.ja.Of[this.ja.ve]};g.qn=function(a,b){this.ja.Of[this.ja.ve]=b;2==this.ja.ve&&(this.ja.Ua=xi[b&15])};g.Pl=function(){return this.ja.Ch};g.an=function(a,b){this.ja.Ch=b};g.Ql=function(){return this.ja.Dh};g.bn=function(a,b){this.ja.Dh=b};g.Ol=function(){return this.ja.ue};g.$m=function(a,b){this.ja.ue=b};g.Nl=function(){return this.ja.je[this.ja.ue]};
|
||||
g.Zm=function(a,b){this.ja.je[this.ja.ue]=b;switch(this.ja.ue){case 0:this.ja.Ag=xi[b&15];this.ja.ae=this.ja.Ag&~this.ja.Cd;break;case 1:this.ja.Cd=~xi[b&15];this.ja.ae=this.ja.Ag&~this.ja.Cd;break;case 2:this.ja.Lh=xi[b&15]&2155905152;break;case 3:case 5:this.fe(Xi(this));break;case 4:this.ja.Ci=(b&3)<<3;break;case 6:Oi(this,!1);break;case 7:this.ja.Mh=xi[b&15^15]&2155905152;break;case 8:this.ja.Za=b|b<<8|b<<16|b<<24}};g.Fl=function(){return this.Mb.sc};
|
||||
g.Sm=function(a,b){var c=this.Mb;c.mg=c.sc;c.sc=b&31};g.El=function(){return Zi(this.Mb)};g.Rm=function(a,b){$i(this,this.Mb,b)};g.Gl=function(){return this.Mb.jc};g.Tm=function(a,b){this.Mb.jc=b;Oi(this,!1)};g.Dl=function(){return this.Mb.Ye};g.Qm=function(a,b){this.Mb.Ye!==b&&(this.Mb.Ye=b,Yi(this,!1))};g.Hl=function(){return aj(this,this.Mb)};function Zi(a){var b;a.sc<a.Jh&&(b=a.Vb[a.sc]);return b}function $i(a,b,c){b.sc<b.Jh&&(b.Vb[b.sc]=c,9==b.sc&&8!=b.mg&&Oi(a,!0),Pi(a))}
|
||||
function aj(a,b){var c=0,d=jb(a.ia),e=d-b.Th;0>e&&(e=0);e%b.Nh>b.vm&&(c|=1);e%=b.Dj;e>b.xm&&(c|=8);b.Th=d-e;b===a.ja?(c|=b.Gf&48^48,b.vd=!1):c=(b.Gf^=9)|240;return b.Gf=c}
|
||||
var Fi={948:T.prototype.Xl,949:T.prototype.Wl,952:T.prototype.Yl,954:T.prototype.Zl,980:T.prototype.Fl,981:T.prototype.El,984:T.prototype.Gl,985:T.prototype.Dl,986:T.prototype.Hl},Gi={948:T.prototype.gn,949:T.prototype.fn,952:T.prototype.hn,980:T.prototype.Sm,981:T.prototype.Rm,984:T.prototype.Tm,985:T.prototype.Qm},Hi={960:T.prototype.wj,961:T.prototype.wj,962:T.prototype.im,964:T.prototype.hm,965:T.prototype.gm,970:T.prototype.Ql,972:T.prototype.Pl,974:T.prototype.Ol,975:T.prototype.Nl},Ii={954:T.prototype.Gk,
|
||||
960:T.prototype.Fk,961:T.prototype.Fk,962:T.prototype.kn,964:T.prototype.rn,965:T.prototype.qn,970:T.prototype.bn,972:T.prototype.an,974:T.prototype.$m,975:T.prototype.Zm,986:T.prototype.Gk};
|
||||
function Ni(a,b,c){if(null!=b&&(b!=a.zd||c)){a.el=0;a.zd=b;b=a.za||(b==pi?a.Ac:a.Nb);if(b!=a.za||b.ab!=a.ab||b.dc!=a.dc){Vi(a);if(a.ab){if(!Ma(a.ma,a.ab,a.dc))return!1;a.za&&(a.za.$b=!1)}a.za=b;b.$b=!0;a.ab=b.ab;a.dc=b.dc;if(!Ka(a.ma,b.ab,b.dc,!1,b===a.ja?b:null))return!1}a.Bb=0;a.mb=a.yg;a.bc=a.Rh;a.Mh=U[pi][2];b=0;var d=U[a.zd];d&&(a.mb=d[0],a.bc=d[1],a.Mh=d[2],b=d[3]||0,a.Bb=d[4],4==a.Ad&&a.za===a.ja&&3==a.Bb&&(7==a.ja.Xb[9]?a.bc=43:a.Bb=5));a.Dj=a.mb*a.bc;a.vg=a.Dj/a.Mh;a.ih=(a.vg<<1)+b;a.kj=
|
||||
b?a.ih+b>>1:0;13<=a.zd&&(a.vg<<=1);a.jd.length&&(a.Wc=Math.floor(a.Vc/a.mb),a.Xc=Math.floor(a.ud/a.bc),a.Bb?(b=a.jd[a.Bb],d=a.jd[a.Bb<<1],a.ml&&80==a.mb?d&&a.Wc>=3*d.Yb>>2&&(a.Bb<<=1,b=d):(d&&a.Wc>=d.Yb&&(a.Bb<<=1,b=d),b&&(a.Wc=b.Yb,a.Xc=b.Zb)),a.af=a.bf=0,b&&(a.af=a.mb*b.Yb,a.bf=a.bc*b.Zb)):(a.Wc=a.Xc=1,a.af=a.mb,a.bf=a.bc),a.pg=a.Cc.createImageData(a.af,a.bf),a.oe=window.document.createElement("canvas"),a.oe.width=a.af,a.oe.height=a.bf,a.pe=a.oe.getContext("2d"),a.Xi=a.Yi=0,a.lh=a.Vc,a.mh=a.ud,
|
||||
b=a.Vc-a.mb*a.Wc,d=a.ud-a.bc*a.Xc,0<b&&(a.Xi=b>>1,a.lh-=b),0<d&&(a.Yi=d>>1,a.mh-=d),b||d)&&(a.Cc.fillStyle=a.rb.style.backgroundColor,a.Cc.fillRect(0,0,a.Vc,a.ud));!1!==c?$a(a,!0):Yi(a,!0)}return!0}function Ti(a,b,c,d){b=(b+c*a.width)*d.length;a.data[b+0]=d[0];a.data[b+1]=d[1];a.data[b+2]=d[2];a.data[b+3]=d[3]}function Yi(a,b){var c;if(b){if(c=a.vg,void 0===a.Mb||a.Mb.length!=c)a.Mb=Array(c)}else{if(void 0===a.Mb)return;c=a.Mb.length}for(var d=0;d<c;d++)a.Mb[d]=-1;a.Rd=-1}
|
||||
function Wi(a,b,c,d,e){var f=d&255,l=d>>8;d=l&15;var k=a.jd[a.Bb];k.Le&&(d=k.Le[d]);var m=l>>4&15;k.Le&&(m=k.Le[m]);e?(b*=k.Yb,c*=k.Zb,e.fillStyle=k.ie[m],e.fillRect(b,c,k.Yb,k.Zb)):(b=b*a.Wc+a.Xi,c=c*a.Xc+a.Yi,a.Cc.fillStyle=k.ie[m],a.Cc.fillRect(b,c,a.Wc,a.Xc));l&256&&(m=(f&15)*k.Yb,f=(f>>4)*k.Zb,e?e.drawImage(k.Wg[d],m,f,k.Yb,k.Zb,b,c,k.Yb,k.Zb):a.Cc.drawImage(k.Wg[d],m,f,k.Yb,k.Zb,b,c,a.Wc,a.Xc));l&512&&(f=a.Zk,l=a.mj,e?(a.td&&a.td!==k.Zb&&(f=Math.floor(f*k.Zb/a.td),l=Math.floor(l*k.Zb/a.td)),
|
||||
e.fillStyle=k.ie[d],e.fillRect(b,c+f,k.Yb,l)):(a.td&&a.td!==a.Xc&&(f=Math.floor(f*a.Xc/a.td),l=Math.floor(l*a.Xc/a.td)),a.Cc.fillStyle=k.ie[d],a.Cc.fillRect(b,c+f,a.Wc,l)))}
|
||||
function $a(a,b){if(a.Ab){var c=!1;a.za&&(a.za===a.ja?a.ja.Yd&32&&(c=!0):a.za.jc&8&&(c=!0));if(c||b){if(b)Yi(a,!0);else if(void 0===a.Mb)return;var d=!1;!(b||++a.el&15)&&0<=a.Sd&&(a.Sd++,d=!0);var e=0,f=a.Dj,c=a.za.ab,l=c+a.za.dc,k=(a.za.Xb[12]<<8)+a.za.Xb[13];a.Bb&&(k<<=1);var c=c+k,m=a.ih;c+m>l&&(m=l-c,0>m&&(m=0));l=c+m;if(k=!b){for(var k=a.ma,n=!0,q=c>>k.Ib;0<m&&q<k.ya.length;)k.ya[q].Xa&&(k.ya[q].Xa=n=!1,k.ya[q].oj=!0),m-=k.nc,q++;k=n}if(k){if(!d)return;if(!a.Rd){if(0>a.tc)return;e=a.tc;f=e+1}}if(a.Bb){if(a.jd[a.Bb]){d=
|
||||
0;k=a.Rd=0;m=1048575;a.za.jc&32&&(k=32768,m&=~k,a.Sd&2||(m&=-65537));for(c+=e<<1;c<l&&e<f;)n=Oa(a.ma,c),n|=65536,n&k&&(a.Rd++,n&=m),e==a.tc&&(n|=a.Sd&1?131072:0),q=a.Mb[e],q!=n&&(Wi(a,e%a.mb,Math.floor(e/a.mb),n,a.pe),a.Mb[e]=n,d++),c+=2,e++;d&&a.pe&&a.Cc.drawImage(a.oe,0,0,a.af,a.bf,a.Xi,a.Yi,a.lh,a.mh);Ui(a)}}else if(a.kj){for(var f=l,s,r,e=c,l=a.Rd=0,d=a.Mh,k=16==d?65536:196608,m=16==d?1:2,n=Qi(a,m),y=q=0,M=a.mb,V=0,aa=a.bc,ba=0;e<f;){s=Oa(a.ma,e);r=a.Mb[l];if(r===s)q+=d;else{a.Mb[l]=s;s=s>>8|
|
||||
(s&255)<<8;r=k;var gb=16;q<M&&(M=q);for(var lc=0;lc<d;lc++){var jd=(s&(r>>=m))>>(gb-=m);Ti(a.pg,q++,y,n[jd])}q>V&&(V=q);y<aa&&(aa=y);y>=ba&&(ba=y+1)}e+=2;l++;if(q>=a.mb){q=0;y+=2;if(y>a.bc)break;y==a.bc&&(y=1,e=c+a.kj)}}M<a.mb&&(a.pe.putImageData(a.pg,0,0,M,aa,V-M,ba-aa),a.Cc.drawImage(a.oe,0,0,a.mb,a.bc,0,0,a.Vc,a.ud))}else{f=l;e=a.Rd=0;l=Qi(a);d=a.za.Ld;m=k=0;n=a.mb;q=0;y=a.bc;for(M=0;c<f;){V=c++-a.ab;V=d[V];aa=a.Mb[e];if(aa===V)k+=8;else{a.Mb[e]=V;k<n&&(n=k);for(aa=0;8>aa;aa++)ba=V&2155905152,
|
||||
0>ba&&(ba=-ba),ba=X[ba]||0,Ti(a.pg,k++,m,l[ba]),V<<=1;k>q&&(q=k);m<y&&(y=m);m>=M&&(M=m+1)}e++;if(k>=a.mb&&(k=0,++m>a.bc))break}n<a.mb&&(a.pe.putImageData(a.pg,0,0,n,y,q-n,M-y),a.Cc.drawImage(a.oe,0,0,a.mb,a.bc,0,0,a.Vc,a.ud))}}}}g.$l=function(){return this.Ac.sc};g.kn=function(a,b){var c=this.Ac;c.mg=c.sc;c.sc=b&31};g.Zl=function(){return Zi(this.Ac)};g.jn=function(a,b){$i(this,this.Ac,b)};g.am=function(){return this.Ac.jc};g.ln=function(a,b){this.Ac.jc=b;Oi(this,!1)};
|
||||
g.bm=function(){return aj(this,this.Ac)};g.Jk=function(a,b){this.ja.Bh=this.ja.Bh&-4|b&3};g.zj=function(){var a=this.ja.vd?this.ja.Id[this.ja.Yd&31]:this.ja.Yd;this.ja.vd=!this.ja.vd;return a};g.Ik=function(a,b){var c=this.ja.Yd&32;if(this.ja.vd){var d=this.ja.Yd&31;if(16<=d||!c)this.ja.Id[d]=b;this.ja.vd=!1}else this.ja.Yd=b,this.ja.vd=!0,b&32&&!c&&Mi(this)&&$a(this,!0)};g.lm=function(){var a=3-((this.ja.sg&12)>>2),a=this.ja.Ui&-17|(this.Sf&1<<a)<<4-a;return this.ja.Ui=a};
|
||||
g.nn=function(a,b){this.ja.sg=b;Li(this)};g.km=function(){return this.ja.ve};g.un=function(a,b){this.ja.ve=b};g.jm=function(){return this.ja.Of[this.ja.ve]};g.tn=function(a,b){this.ja.Of[this.ja.ve]=b;2==this.ja.ve&&(this.ja.Ua=xi[b&15])};g.Sl=function(){return this.ja.Eh};g.dn=function(a,b){this.ja.Eh=b};g.Tl=function(){return this.ja.Fh};g.en=function(a,b){this.ja.Fh=b};g.Rl=function(){return this.ja.ue};g.cn=function(a,b){this.ja.ue=b};g.Ql=function(){return this.ja.je[this.ja.ue]};
|
||||
g.bn=function(a,b){this.ja.je[this.ja.ue]=b;switch(this.ja.ue){case 0:this.ja.Cg=xi[b&15];this.ja.ae=this.ja.Cg&~this.ja.Cd;break;case 1:this.ja.Cd=~xi[b&15];this.ja.ae=this.ja.Cg&~this.ja.Cd;break;case 2:this.ja.Nh=xi[b&15]&2155905152;break;case 3:case 5:this.fe(Xi(this));break;case 4:this.ja.Fi=(b&3)<<3;break;case 6:Oi(this,!1);break;case 7:this.ja.Oh=xi[b&15^15]&2155905152;break;case 8:this.ja.Za=b|b<<8|b<<16|b<<24}};g.Il=function(){return this.Nb.sc};
|
||||
g.Vm=function(a,b){var c=this.Nb;c.mg=c.sc;c.sc=b&31};g.Hl=function(){return Zi(this.Nb)};g.Um=function(a,b){$i(this,this.Nb,b)};g.Jl=function(){return this.Nb.jc};g.Wm=function(a,b){this.Nb.jc=b;Oi(this,!1)};g.Gl=function(){return this.Nb.Ye};g.Tm=function(a,b){this.Nb.Ye!==b&&(this.Nb.Ye=b,Yi(this,!1))};g.Kl=function(){return aj(this,this.Nb)};function Zi(a){var b;a.sc<a.Lh&&(b=a.Xb[a.sc]);return b}function $i(a,b,c){b.sc<b.Lh&&(b.Xb[b.sc]=c,9==b.sc&&8!=b.mg&&Oi(a,!0),Pi(a))}
|
||||
function aj(a,b){var c=0,d=jb(a.ia),e=d-b.Wh;0>e&&(e=0);e%b.Ph>b.ym&&(c|=1);e%=b.Gj;e>b.Am&&(c|=8);b.Wh=d-e;b===a.ja?(c|=b.Gf&48^48,b.vd=!1):c=(b.Gf^=9)|240;return b.Gf=c}
|
||||
var Fi={948:T.prototype.$l,949:T.prototype.Zl,952:T.prototype.am,954:T.prototype.bm,980:T.prototype.Il,981:T.prototype.Hl,984:T.prototype.Jl,985:T.prototype.Gl,986:T.prototype.Kl},Gi={948:T.prototype.kn,949:T.prototype.jn,952:T.prototype.ln,980:T.prototype.Vm,981:T.prototype.Um,984:T.prototype.Wm,985:T.prototype.Tm},Hi={960:T.prototype.zj,961:T.prototype.zj,962:T.prototype.lm,964:T.prototype.km,965:T.prototype.jm,970:T.prototype.Tl,972:T.prototype.Sl,974:T.prototype.Rl,975:T.prototype.Ql},Ii={954:T.prototype.Jk,
|
||||
960:T.prototype.Ik,961:T.prototype.Ik,962:T.prototype.nn,964:T.prototype.un,965:T.prototype.tn,970:T.prototype.en,972:T.prototype.dn,974:T.prototype.cn,975:T.prototype.bn,986:T.prototype.Jk};
|
||||
v(function(){for(var a=C(window.document,"pcjs","video"),b=0;b<a.length;b++){var c=a[b],d=A(c),e=window.document.createElement("canvas");if(void 0===e){c.innerHTML="<br/>Missing <canvas> support; try a new web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor;
|
||||
e.style.height=c.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var f=e.getContext("2d"),d=new T(d,e,f);B(d,c)}});
|
||||
function Z(a){this.tj=a.adapter;switch(this.tj){case 1:this.Ji=1016;this.rf=4;break;case 2:this.Ji=760;this.rf=3;break;default:u("Unrecognized serial adapter #"+this.tj);return}this.rd=null;w.call(this,"SerialPort",a,Z);var b=a.binding,c;a=bj;b&&(void 0===c&&(c="Panel"),(c=Ba(c,this.id))&&(b=c.oa[b])&&this.ub(null,null,a,b))}z(w,Z);var bj="buffer";g=Z.prototype;g.aj=function(a,b){return a==this.Fh?(this.xj=b,this):null};
|
||||
g.ub=function(a,b,c,d){var e=this;switch(c){case bj:return this.oa[c]=this.rd=d,d.onkeydown=function(a){a=a||window.event;var b=a.charCode||a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),cj(e,[b]))},d.onkeypress=function(a){a=a||window.event;cj(e,[a.which||a.keyCode])},!0}return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.ga=D(a,"ChipSet");Ta(b,this,dj,this.Ji);Va(b,this,ej,this.Ji);this.Pa()};
|
||||
g.Sb=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Jb=function(a){return a&&this.save?this.save():!0};g.reset=function(){this.xd()};g.save=function(){var a=new H(this),b=0,c=[];c[b++]=this.bh;c[b++]=this.ej;c[b++]=this.he;c[b++]=this.Tf;c[b++]=this.md;c[b++]=this.Od;c[b++]=this.Hc;c[b++]=this.mc;c[b++]=this.cj;c[b]=this.Me;a.set(0,c);return a.data()};g.restore=function(a){return this.xd(a[0])};
|
||||
g.xd=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.bh=a[b++];this.ej=a[b++];this.he=a[b++];this.Tf=a[b++];this.md=a[b++];this.Od=a[b++];this.Hc=a[b++];this.mc=a[b++];this.cj=a[b++];this.Me=a[b];return!0};function cj(a,b){a.Me=a.Me.concat(b);fj(a)}function fj(a){0<a.Me.length&&!(a.mc&1)&&(a.bh=a.Me.shift(),a.mc|=1);var b=-1;a.mc&1&&a.Tf&1&&(b=4);0<=b?(a.md&=-8,a.md|=b,a.ga&&a.rf&&R(a.ga,a.rf)):(a.md|=1,a.ga&&a.rf&&Kh(a.ga,a.rf))}
|
||||
g.fm=function(){var a=this.Od&128?this.he&255:this.bh;this.mc&=-2;fj(this);return a};g.Rl=function(){return this.Od&128?this.he>>8:this.Tf};g.Sl=function(){return this.md};g.Tl=function(){return this.Od};g.Vl=function(){return this.Hc};g.Ul=function(){return this.mc};g.am=function(){return this.cj};
|
||||
g.sn=function(a,b){if(this.Od&128)this.he=this.he&-256|b;else{this.ej=b;this.mc&=-97;var c;this.rd?(13!=b&&(8==b?this.rd.value=this.rd.value.slice(0,-1):(this.rd.value+=String.fromCharCode(b),this.rd.scrollTop=this.rd.scrollHeight)),c=!0):c=!1;c&&(this.mc|=96)}};g.cn=function(a,b){this.Od&128?this.he=this.he&255|b<<8:this.Tf=b};g.dn=function(a,b){this.Od=b};
|
||||
g.en=function(a,b){var c=this.Hc;this.Hc=b;if(this.xj&&(c^b)&3){var c=this.xj,d=this.Hc,e=3==(d&3);if(e){if(!c.Yb){var f=!1;c.Hc&2||(c.reset(),f=!0);c.Hc&1||(f=!0);f&&cj(c.Ze,[77]);gj(c,c.qb);c.Yb=e}}else c.Yb&&(hj(c.qb),c.Yb=e);c.Hc=d}};var dj={0:Z.prototype.fm,1:Z.prototype.Rl,2:Z.prototype.Sl,3:Z.prototype.Tl,4:Z.prototype.Vl,5:Z.prototype.Ul,6:Z.prototype.am},ej={0:Z.prototype.sn,1:Z.prototype.cn,3:Z.prototype.dn,4:Z.prototype.en};
|
||||
v(function(){for(var a=C(window.document,"pcjs","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Z(d);B(d,c)}});function ij(a){w.call(this,"Mouse",a,ij);if(this.Eh=a.serial)this.Mi="SerialPort";this.Yb=!1;this.Pa()}z(w,ij);g=ij.prototype;g.ic=function(a,b,c,d){this.Fa=a;this.ma=b;this.ia=c;this.Na=d};
|
||||
g.Sb=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.Mi&&!this.Ze){for(var c=null;(c=D(this.Fa,this.Mi,c))&&(!c.aj||!(this.Ze=c.aj(this.Eh,this))););if(this.Ze){if(c=D(this.Fa,"Video"))this.qb=c.qb}else u(this.id+": "+this.Mi+" "+this.Eh+" unavailable")}this.Yb?gj(this,this.qb):hj(this.qb)}return!0};g.Jb=function(a){return a&&this.save?this.save():!0};g.reset=function(){this.xd()};g.save=function(){var a=new H(this);a.set(0,this.Qi());return a.data()};
|
||||
g.restore=function(a){return this.xd(a[0])};g.xd=function(a){var b=0;void 0===a&&(a=[!1,-1,-1,0,0,!1,!1,0]);this.Yb=a[b++];this.Hf=a[b++];this.If=a[b++];this.Ge=a[b++];this.He=a[b++];this.eg=a[b++];this.fg=a[b++];this.Hc=a[b];return!0};g.Qi=function(){var a=0,b=[];b[a++]=this.Yb;b[a++]=this.Hf;b[a++]=this.If;b[a++]=this.Ge;b[a++]=this.He;b[a++]=this.eg;b[a++]=this.fg;b[a]=this.Hc;return b};
|
||||
function gj(a,b){b&&(a.rh||(b.addEventListener("mousemove",function(b){if(a.Yb&&a.ia&&a.ia.rc){if(0>a.Hf||0>a.If)a.Hf=b.clientX,a.If=b.clientY;a.Ge=b.clientX-a.Hf;a.He=b.clientY-a.If;(a.Ge||a.He)&&jj(a);a.Hf=b.clientX;a.If=b.clientY}},!1),b.addEventListener("mousedown",function(b){kj(a,b.button,!0)},!1),b.addEventListener("mouseup",function(b){kj(a,b.button,!1)},!1),a.rh=!0),b.style.cursor="none")}function hj(a){a&&(a.style.cursor="auto")}
|
||||
function kj(a,b,c){if(a.Yb&&a.ia&&a.ia.rc)switch(b){case 0:a.eg!=c&&(a.eg=c,jj(a));break;case 2:a.fg!=c&&(a.fg=c,jj(a))}}function jj(a){cj(a.Ze,[64|(a.eg?32:0)|(a.fg?16:0)|(a.He&192)>>4|(a.Ge&192)>>6,a.Ge&63,a.He&63]);a.Ge=a.He=0}v(function(){for(var a=C(window.document,"pcjs","mouse"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new ij(d);B(d,c)}});
|
||||
function lj(a,b,c){w.call(this,"Disk",{id:a.og+".disk"+mj++},lj);this.ea=a;this.Fa=a.Fa;this.Na=a.Na;this.Oa=b;this.mode=c;this.fd=b.name;this.Zb=b.Zb;this.Pb=b.Pb;this.bc=b.bc;this.rb=b.rb;this.re=b.re;this.vh=this.Zc=!1;this.create();this.Jd=[];this.Lf=[];this.hd=null;this.zj=0;this.yh=!1;this.Pa()}var mj=0;z(w,lj);g=lj.prototype;g.ic=function(a,b,c,d){this.Na=d};g.Sb=function(a,b){b||this.vh&&!this.Zc&&this.load(this.fd,this.Ce);return!0};
|
||||
g.Jb=function(a,b){if(this.Zc){var c,d=0;if(this.yh&&!la("Disk writes are still in progress, shut down anyway?"))return!1;for(;c=nj(this,!1);)if(d=c[0]){this.xa('Unable to save "'+this.fd+'" (error '+d+")");break}b&&this.Zc&&(c="action=close&volume="+this.Ce,c+="&machine="+this.ea.te(),c+="&user="+this.ea.wd(),t(ka()+"/api/v1/disk?"+c,!0),this.Zc=!1);d||this.xa(this.fd+" saved")}return!0};
|
||||
g.create=function(){this.Fb=[];if("preload"!=this.mode){for(var a=Array(this.Zb),b=0;b<a.length;b++){for(var c=Array(this.Pb),d=0;d<c.length;d++){for(var e=Array(this.bc),f=1;f<=e.length;f++)e[f-1]=oj(null,b,d,f,this.rb,"local"==this.mode?0:null);c[d]=e}a[b]=c}this.Fb=a}this.cg=0};
|
||||
g.load=function(a,b,c){var d=b;this.fd=a;this.Ce=b;this.rj=c;0>b.indexOf("/api/v1/dump")&&(a=ea(b),"json"==a?d=encodeURI(b):"demandrw"==this.mode||"demandro"==this.mode?(a="action=open&volume="+b+("&mode="+this.mode),a+="&chs="+this.Zb+":"+this.Pb+":"+this.bc+":"+this.rb,a+="&machine="+this.ea.te(),a+="&user="+this.ea.wd(),d=ka()+"/api/v1/disk?"+a,this.vh=!0):(c="path",d="&mbhd=10",!b.indexOf("http:")||!b.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(a)?(c="disk",d="&mbhd=0"):
|
||||
-1!==b.indexOf("/",b.length-1)&&(c="dir"),d=ka()+"/api/v1/dump?"+c+"="+encodeURIComponent(b)+(this.re?"":d)+"&format=json"));t(d,!0,null,this,this.ym,b)};
|
||||
g.ym=function(a,b,c,d){var e=null;this.se=!1;var f=0>c&&this.Fa&&!this.Fa.zb;if(this.vh)c?this.xa('Unable to connect to disk "'+d+'" (error '+c+": "+b+")",f):(this.Zc=!0,e=this);else if(c)this.xa('Unable to load disk "'+this.fd+'" (error '+c+")",f);else try{if(0<da(a,!0).toLowerCase().indexOf("-readonly"))this.se=!0;else{var l=b.indexOf("\n");0<l&&1024>l&&0<b.substring(0,l).indexOf("write-protected")&&(this.se=!0)}var k;k="<"==b.substr(0,1)?["Missing disk image: "+this.fd]:0>b.indexOf("0x")&&'["'!=
|
||||
function Z(a){this.wj=a.adapter;switch(this.wj){case 1:this.Mi=1016;this.rf=4;break;case 2:this.Mi=760;this.rf=3;break;default:u("Unrecognized serial adapter #"+this.wj);return}this.rd=null;w.call(this,"SerialPort",a,Z);var b=a.binding,c;a=bj;b&&(void 0===c&&(c="Panel"),(c=Ba(c,this.id))&&(b=c.oa[b])&&this.vb(null,null,a,b))}z(w,Z);var bj="buffer";g=Z.prototype;g.dj=function(a,b){return a==this.Hh?(this.Aj=b,this):null};
|
||||
g.vb=function(a,b,c,d){var e=this;switch(c){case bj:return this.oa[c]=this.rd=d,d.onkeydown=function(a){a=a||window.event;var b=a.charCode||a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),cj(e,[b]))},d.onkeypress=function(a){a=a||window.event;cj(e,[a.which||a.keyCode])},!0}return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.ga=D(a,"ChipSet");Ta(b,this,dj,this.Mi);Va(b,this,ej,this.Mi);this.Pa()};
|
||||
g.Ub=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Kb=function(a){return a&&this.save?this.save():!0};g.reset=function(){this.xd()};g.save=function(){var a=new H(this),b=0,c=[];c[b++]=this.eh;c[b++]=this.hj;c[b++]=this.he;c[b++]=this.Tf;c[b++]=this.md;c[b++]=this.Od;c[b++]=this.Hc;c[b++]=this.mc;c[b++]=this.fj;c[b]=this.Me;a.set(0,c);return a.data()};g.restore=function(a){return this.xd(a[0])};
|
||||
g.xd=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.eh=a[b++];this.hj=a[b++];this.he=a[b++];this.Tf=a[b++];this.md=a[b++];this.Od=a[b++];this.Hc=a[b++];this.mc=a[b++];this.fj=a[b++];this.Me=a[b];return!0};function cj(a,b){a.Me=a.Me.concat(b);fj(a)}function fj(a){0<a.Me.length&&!(a.mc&1)&&(a.eh=a.Me.shift(),a.mc|=1);var b=-1;a.mc&1&&a.Tf&1&&(b=4);0<=b?(a.md&=-8,a.md|=b,a.ga&&a.rf&&R(a.ga,a.rf)):(a.md|=1,a.ga&&a.rf&&Kh(a.ga,a.rf))}
|
||||
g.im=function(){var a=this.Od&128?this.he&255:this.eh;this.mc&=-2;fj(this);return a};g.Ul=function(){return this.Od&128?this.he>>8:this.Tf};g.Vl=function(){return this.md};g.Wl=function(){return this.Od};g.Yl=function(){return this.Hc};g.Xl=function(){return this.mc};g.dm=function(){return this.fj};
|
||||
g.vn=function(a,b){if(this.Od&128)this.he=this.he&-256|b;else{this.hj=b;this.mc&=-97;var c;this.rd?(13!=b&&(8==b?this.rd.value=this.rd.value.slice(0,-1):(this.rd.value+=String.fromCharCode(b),this.rd.scrollTop=this.rd.scrollHeight)),c=!0):c=!1;c&&(this.mc|=96)}};g.fn=function(a,b){this.Od&128?this.he=this.he&255|b<<8:this.Tf=b};g.gn=function(a,b){this.Od=b};
|
||||
g.hn=function(a,b){var c=this.Hc;this.Hc=b;if(this.Aj&&(c^b)&3){var c=this.Aj,d=this.Hc,e=3==(d&3);if(e){if(!c.$b){var f=!1;c.Hc&2||(c.reset(),f=!0);c.Hc&1||(f=!0);f&&cj(c.Ze,[77]);gj(c,c.rb);c.$b=e}}else c.$b&&(hj(c.rb),c.$b=e);c.Hc=d}};var dj={0:Z.prototype.im,1:Z.prototype.Ul,2:Z.prototype.Vl,3:Z.prototype.Wl,4:Z.prototype.Yl,5:Z.prototype.Xl,6:Z.prototype.dm},ej={0:Z.prototype.vn,1:Z.prototype.fn,3:Z.prototype.gn,4:Z.prototype.hn};
|
||||
v(function(){for(var a=C(window.document,"pcjs","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Z(d);B(d,c)}});function ij(a){w.call(this,"Mouse",a,ij);if(this.Gh=a.serial)this.Pi="SerialPort";this.$b=!1;this.Pa()}z(w,ij);g=ij.prototype;g.ic=function(a,b,c,d){this.Fa=a;this.ma=b;this.ia=c;this.Na=d};
|
||||
g.Ub=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.Pi&&!this.Ze){for(var c=null;(c=D(this.Fa,this.Pi,c))&&(!c.dj||!(this.Ze=c.dj(this.Gh,this))););if(this.Ze){if(c=D(this.Fa,"Video"))this.rb=c.rb}else u(this.id+": "+this.Pi+" "+this.Gh+" unavailable")}this.$b?gj(this,this.rb):hj(this.rb)}return!0};g.Kb=function(a){return a&&this.save?this.save():!0};g.reset=function(){this.xd()};g.save=function(){var a=new H(this);a.set(0,this.Ti());return a.data()};
|
||||
g.restore=function(a){return this.xd(a[0])};g.xd=function(a){var b=0;void 0===a&&(a=[!1,-1,-1,0,0,!1,!1,0]);this.$b=a[b++];this.Hf=a[b++];this.If=a[b++];this.Ge=a[b++];this.He=a[b++];this.eg=a[b++];this.fg=a[b++];this.Hc=a[b];return!0};g.Ti=function(){var a=0,b=[];b[a++]=this.$b;b[a++]=this.Hf;b[a++]=this.If;b[a++]=this.Ge;b[a++]=this.He;b[a++]=this.eg;b[a++]=this.fg;b[a]=this.Hc;return b};
|
||||
function gj(a,b){b&&(a.th||(b.addEventListener("mousemove",function(b){if(a.$b&&a.ia&&a.ia.rc){if(0>a.Hf||0>a.If)a.Hf=b.clientX,a.If=b.clientY;a.Ge=b.clientX-a.Hf;a.He=b.clientY-a.If;(a.Ge||a.He)&&jj(a);a.Hf=b.clientX;a.If=b.clientY}},!1),b.addEventListener("mousedown",function(b){kj(a,b.button,!0)},!1),b.addEventListener("mouseup",function(b){kj(a,b.button,!1)},!1),a.th=!0),b.style.cursor="none")}function hj(a){a&&(a.style.cursor="auto")}
|
||||
function kj(a,b,c){if(a.$b&&a.ia&&a.ia.rc)switch(b){case 0:a.eg!=c&&(a.eg=c,jj(a));break;case 2:a.fg!=c&&(a.fg=c,jj(a))}}function jj(a){cj(a.Ze,[64|(a.eg?32:0)|(a.fg?16:0)|(a.He&192)>>4|(a.Ge&192)>>6,a.Ge&63,a.He&63]);a.Ge=a.He=0}v(function(){for(var a=C(window.document,"pcjs","mouse"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new ij(d);B(d,c)}});
|
||||
function lj(a,b,c){w.call(this,"Disk",{id:a.og+".disk"+mj++},lj);this.ea=a;this.Fa=a.Fa;this.Na=a.Na;this.Oa=b;this.mode=c;this.fd=b.name;this.Qb=b.Qb;this.Jb=b.Jb;this.Tb=b.Tb;this.sb=b.sb;this.re=b.re;this.xh=this.Zc=!1;this.create();this.Jd=[];this.Lf=[];this.hd=null;this.Cj=0;this.Ah=!1;this.Pa()}var mj=0;z(w,lj);g=lj.prototype;g.ic=function(a,b,c,d){this.Na=d};g.Ub=function(a,b){b||this.xh&&!this.Zc&&this.load(this.fd,this.Ce);return!0};
|
||||
g.Kb=function(a,b){if(this.Zc){var c,d=0;if(this.Ah&&!la("Disk writes are still in progress, shut down anyway?"))return!1;for(;c=nj(this,!1);)if(d=c[0]){this.xa('Unable to save "'+this.fd+'" (error '+d+")");break}b&&this.Zc&&(c="action=close&volume="+this.Ce,c+="&machine="+this.ea.te(),c+="&user="+this.ea.wd(),t(ka()+"/api/v1/disk?"+c,!0),this.Zc=!1);d||this.xa(this.fd+" saved")}return!0};
|
||||
g.create=function(){this.gb=[];if("preload"!=this.mode){for(var a=Array(this.Qb),b=0;b<a.length;b++){for(var c=Array(this.Jb),d=0;d<c.length;d++){for(var e=Array(this.Tb),f=1;f<=e.length;f++)e[f-1]=oj(null,b,d,f,this.sb,"local"==this.mode?0:null);c[d]=e}a[b]=c}this.gb=a}this.cg=0};
|
||||
g.load=function(a,b,c){var d=b;this.fd=a;this.Ce=b;this.uj=c;0>b.indexOf("/api/v1/dump")&&(a=ea(b),"json"==a?d=encodeURI(b):"demandrw"==this.mode||"demandro"==this.mode?(a="action=open&volume="+b+("&mode="+this.mode),a+="&chs="+this.Qb+":"+this.Jb+":"+this.Tb+":"+this.sb,a+="&machine="+this.ea.te(),a+="&user="+this.ea.wd(),d=ka()+"/api/v1/disk?"+a,this.xh=!0):(c="path",d="&mbhd=10",!b.indexOf("http:")||!b.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(a)?(c="disk",d="&mbhd=0"):
|
||||
-1!==b.indexOf("/",b.length-1)&&(c="dir"),d=ka()+"/api/v1/dump?"+c+"="+encodeURIComponent(b)+(this.re?"":d)+"&format=json"));t(d,!0,null,this,this.Bm,b)};
|
||||
g.Bm=function(a,b,c,d){var e=null;this.se=!1;var f=0>c&&this.Fa&&!this.Fa.Ab;if(this.xh)c?this.xa('Unable to connect to disk "'+d+'" (error '+c+": "+b+")",f):(this.Zc=!0,e=this);else if(c)this.xa('Unable to load disk "'+this.fd+'" (error '+c+")",f);else try{if(0<da(a,!0).toLowerCase().indexOf("-readonly"))this.se=!0;else{var l=b.indexOf("\n");0<l&&1024>l&&0<b.substring(0,l).indexOf("write-protected")&&(this.se=!0)}var k;k="<"==b.substr(0,1)?["Missing disk image: "+this.fd]:0>b.indexOf("0x")&&'["'!=
|
||||
b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");if(k.length)if(1==k.length)u(k[0]);else{for(b=a=0;b<k.length;b++)for(c=0;c<k[b].length;c++)for(d=0;d<k[b][c].length;d++){var m=k[b][c][d],n=m.length;void 0===n&&(n=m.length=512);var n=n>>2,q=m.pattern;void 0===q&&(q=m.pattern=0);var s=m.data;if(void 0===s){var r=m.bytes;if(void 0!==r&&r.length){for(var f=n<<2,y=r.length;y<f;y++)r[y]=q;this.fill(m,r,0)}else s=[],q=m.pattern=q|q<<8|q<<16|q<<24,m.data=
|
||||
s;delete m.bytes}oj(m,b,c);for(f=0;f<s.length;f++)a=a+s[f]&4294967295}this.Fb=k;this.cg=a;e=this}else u("Empty disk image: "+this.fd)}catch(M){u("Disk image error: "+M.message)}this.rj&&this.rj.call(this.ea,this.Oa,e,this.fd,this.Ce)};function oj(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ol=b;a.ql=c;a.Fc=a.oc=0;a.Xa=!1;return a}
|
||||
g.zm=function(a,b,c,d){a=!1;if(!c){var e=d[0],f=d[1],l=d[2],k=d[3];a=d[4];b=JSON.parse(b);for(var m=0;k--;){var n=this.seek(e,f,l,!0);if(!n)break;this.fill(n,b,m);m+=n.length;l++}}(d=d[5])&&d(c,a)};function pj(a,b,c,d,e,f){if(a.Zc){var l;l="action=read&volume="+a.Ce;l+="&chs="+a.Zb+":"+a.Pb+":"+a.bc+":"+a.rb;l=l+("&addr="+b+":"+c+":"+d+":"+e)+("&machine="+a.ea.te());l+="&user="+a.ea.wd();t(ka()+"/api/v1/disk?"+l,!0,null,a,a.zm,[b,c,d,e,!0,f])}else f&&f(-1,!1)}
|
||||
function qj(a,b,c){b.Xa=!0;var d=a.Jd.indexOf(b);0<=d&&(a.Jd.splice(d,1),a.Lf.splice(d,1));a.Jd.push(b);a.Lf.push(ha());c&&rj(a)}function rj(a){if(a.Jd.length){var b=a.Lf[0]+2E3;a.hd&&a.zj<b&&(clearTimeout(a.hd),a.hd=null);if(!a.hd){var c=ha(),b=b-c;0>b&&(b=0);2E3<b&&(b=2E3);a.hd=setTimeout(function(){nj(a,!0)},b);a.zj=c+b}}else a.hd&&(clearTimeout(a.hd),a.hd=null)}
|
||||
function nj(a,b){b&&(a.hd=null);var c=a.Jd[0];if(c){for(var d=c.ol,e=c.ql,c=c.sector,f=0,l=[],k=c-1;k<a.Fb[d][e].length;k++){var m=a.Fb[d][e][k];if(!m.Xa)break;var n=a.Jd.indexOf(m);a.Jd.splice(n,1);a.Lf.splice(n,1);l=l.concat(sj(m));m.Xa=!1;f++}a.Zc?(k={},a.yh=!0,k.action="write",k.volume=a.Ce,k.chs=a.Zb+":"+a.Pb+":"+a.bc+":"+a.rb,k.addr=d+":"+e+":"+c+":"+f,k.machine=a.ea.te(),k.user=a.ea.wd(),k.data=JSON.stringify(l),d=t(ka()+"/api/v1/disk",b,k,a,a.Em,[d,e,c,f,b])):d=!1;return b||d}return!1}
|
||||
g.Em=function(a,b,c,d){a=d[0];b=d[1];var e=d[2],f=d[3];d=d[4];this.yh=!1;if(0<=a&&a<this.Fb.length&&0<=b&&b<this.Fb[a].length)for(e-=1;0<f--&&0<=e&&e<this.Fb[a][b].length;e++){var l=this.Fb[a][b][e];c?qj(this,l,!1):l.Xa||(l.Fc=l.oc=0)}d&&rj(this)};
|
||||
g.seek=function(a,b,c,d,e){var f=null,l=this.Oa,k=this.Fb[a];if(k){var m=k[b];if(!m&&l.Se&&b<l.Pb)for(m=k[b]=Array(l.od),k=0;k<m.length;k++)m[k]=oj(null,a,b,k+1,l.$a,0);if(m){for(k=0;k<m.length;k++)if(m[k].sector==c){f=m[k];if(null===f.pattern)if(d)f.pattern=0;else if(e){for(d=1;++k<m.length;)null===m[k].pattern&&d++;pj(this,a,b,c,d,function(a,b){a&&(f=null);e(f,b)});return null}break}!f&&l.Se&&9==l.Ka&&(f=m[k]=oj(null,a,b,l.Ka,l.$a,0))}}e&&e(f,!1);return f};
|
||||
s;delete m.bytes}oj(m,b,c);for(f=0;f<s.length;f++)a=a+s[f]&4294967295}this.gb=k;this.cg=a;e=this}else u("Empty disk image: "+this.fd)}catch(M){u("Disk image error: "+M.message)}this.uj&&this.uj.call(this.ea,this.Oa,e,this.fd,this.Ce)};function oj(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.rl=b;a.tl=c;a.Fc=a.oc=0;a.Xa=!1;return a}
|
||||
g.Cm=function(a,b,c,d){a=!1;if(!c){var e=d[0],f=d[1],l=d[2],k=d[3];a=d[4];b=JSON.parse(b);for(var m=0;k--;){var n=this.seek(e,f,l,!0);if(!n)break;this.fill(n,b,m);m+=n.length;l++}}(d=d[5])&&d(c,a)};function pj(a,b,c,d,e,f){if(a.Zc){var l;l="action=read&volume="+a.Ce;l+="&chs="+a.Qb+":"+a.Jb+":"+a.Tb+":"+a.sb;l=l+("&addr="+b+":"+c+":"+d+":"+e)+("&machine="+a.ea.te());l+="&user="+a.ea.wd();t(ka()+"/api/v1/disk?"+l,!0,null,a,a.Cm,[b,c,d,e,!0,f])}else f&&f(-1,!1)}
|
||||
function qj(a,b,c){b.Xa=!0;var d=a.Jd.indexOf(b);0<=d&&(a.Jd.splice(d,1),a.Lf.splice(d,1));a.Jd.push(b);a.Lf.push(ha());c&&rj(a)}function rj(a){if(a.Jd.length){var b=a.Lf[0]+2E3;a.hd&&a.Cj<b&&(clearTimeout(a.hd),a.hd=null);if(!a.hd){var c=ha(),b=b-c;0>b&&(b=0);2E3<b&&(b=2E3);a.hd=setTimeout(function(){nj(a,!0)},b);a.Cj=c+b}}else a.hd&&(clearTimeout(a.hd),a.hd=null)}
|
||||
function nj(a,b){b&&(a.hd=null);var c=a.Jd[0];if(c){for(var d=c.rl,e=c.tl,c=c.sector,f=0,l=[],k=c-1;k<a.gb[d][e].length;k++){var m=a.gb[d][e][k];if(!m.Xa)break;var n=a.Jd.indexOf(m);a.Jd.splice(n,1);a.Lf.splice(n,1);l=l.concat(sj(m));m.Xa=!1;f++}a.Zc?(k={},a.Ah=!0,k.action="write",k.volume=a.Ce,k.chs=a.Qb+":"+a.Jb+":"+a.Tb+":"+a.sb,k.addr=d+":"+e+":"+c+":"+f,k.machine=a.ea.te(),k.user=a.ea.wd(),k.data=JSON.stringify(l),d=t(ka()+"/api/v1/disk",b,k,a,a.Hm,[d,e,c,f,b])):d=!1;return b||d}return!1}
|
||||
g.Hm=function(a,b,c,d){a=d[0];b=d[1];var e=d[2],f=d[3];d=d[4];this.Ah=!1;if(0<=a&&a<this.gb.length&&0<=b&&b<this.gb[a].length)for(e-=1;0<f--&&0<=e&&e<this.gb[a][b].length;e++){var l=this.gb[a][b][e];c?qj(this,l,!1):l.Xa||(l.Fc=l.oc=0)}d&&rj(this)};g.info=function(){return this.gb.length?[this.gb.length,this.gb[0].length,this.gb[0][0].length,this.gb[0][0][0].length]:[0,0,0,0]};
|
||||
g.seek=function(a,b,c,d,e){var f=null,l=this.Oa,k=this.gb[a];if(k){var m=k[b];if(!m&&l.Se&&b<l.Jb)for(m=k[b]=Array(l.od),k=0;k<m.length;k++)m[k]=oj(null,a,b,k+1,l.$a,0);if(m){for(k=0;k<m.length;k++)if(m[k].sector==c){f=m[k];if(null===f.pattern)if(d)f.pattern=0;else if(e){for(d=1;++k<m.length;)null===m[k].pattern&&d++;pj(this,a,b,c,d,function(a,b){a&&(f=null);e(f,b)});return null}break}!f&&l.Se&&9==l.Ka&&(f=m[k]=oj(null,a,b,l.Ka,l.$a,0))}}e&&e(f,!1);return f};
|
||||
g.fill=function(a,b,c){for(var 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};function sj(a){var b=a.length,c=Array(b),d=0,b=b>>2,e=a.data;a=a.pattern;for(var f=0;f<b;f++){var l=f<e.length?e[f]:a;c[d++]=l&255;c[d++]=l>>8&255;c[d++]=l>>16&255;c[d++]=l>>24&255}return c}function tj(a,b){var c=-1;if(b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c}
|
||||
g.write=function(a,b,c){if(this.se)return!1;if(b<a.length){if(c!=tj(a,b)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var l=d.length;l<=f;l++)d[l]=e;a.oc?f<a.Fc?(a.oc+=a.Fc-f,a.Fc=f):f>=a.Fc+a.oc&&(a.oc+=f-(a.Fc+a.oc)+1):(a.Fc=f,a.oc=1);d[f]=d[f]&~(255<<b)|c<<b;this.Zc&&qj(this,a,!0)}return!0}return null};
|
||||
g.save=function(){var a=0,b=[];b[a++]=[this.Ce,this.cg];if(!this.Zc&&!this.se)for(var c=this.Fb,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 l=c[d][e][f];if(l.oc){for(var k=[],m=0,n=l.Fc,q=l.Fc+l.oc;n<q;)k[m++]=l.data[n++];b[a++]=[d,e,f,l.Fc,k]}}return b};
|
||||
g.restore=function(a){var b=0,c="unsupported restore format";if(this.Fb.length&&a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&e[1]!=this.cg&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.cg+")",b=-1);for(;d<a.length&&0<=b;){var f=0,l=a[d++],k=l[f++],m=l[f++],n=l[f++];if(k>=this.Fb.length||m>=this.Fb[k].length||n>=this.Fb[k][m].length){c="sector "+k+":"+m+":"+n+" out of range ("+b+" changes applied)";b=-1;break}if(this.se){c="unable to modify write-protected disk";b=-1;break}e=
|
||||
l[f++];f=l[f++];l=e+f.length;k=this.Fb[k][m][n];for(m=k.data.length;m<e;)k.data[m++]=k.pattern;m=0;k.Fc=e;for(k.oc=f.length;e<l;)k.data[e++]=f[m++];b++}}0>b&&this.xa("unable to restore disk '"+this.fd+": "+c);return b};
|
||||
function uj(a){w.call(this,"FDC",a,uj);this.dmaRead=this.lh;this.dmaWrite=this.mh;this.dmaFormat=this.dl;this.ce=null;if(a.autoMount&&(this.ce=a.autoMount,"string"==typeof this.ce))try{this.ce=eval("("+a.autoMount+")")}catch(b){u("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.ce=null}this.ec=[]}z(w,uj);h={};ca={};
|
||||
var vj={3:{Uc:3,qd:0,name:ca.eo},4:{Uc:2,qd:1,name:ca.bo},5:{Uc:9,qd:7,name:ca.oo},6:{Uc:9,qd:7,name:ca.Xn},7:{Uc:2,qd:0,name:ca.Zn},8:{Uc:1,qd:2,name:ca.co},10:{Uc:2,qd:7,name:ca.Yn},13:{Uc:6,qd:7,name:ca.Rn},15:{Uc:3,qd:0,name:ca.ao}};g=uj.prototype;
|
||||
g.ub=function(a,b,c,d){switch(c){case "listDisks":return this.oa[c]=d,a=window.document.createElement("option"),a.value="?",a.innerHTML="User-defined URL...",d.appendChild(a),d.onchange=function(a,b){return function(){var c=a.oa.descDisk;if(c){var d=b.options[b.selectedIndex];if(d){var m={};if(d=d.getAttribute("data-value"))try{m=eval("({"+d+"})")}catch(n){u("FDC option error: "+(n.message||n))}d=m.desc;void 0===d&&(d="");m=m.href;void 0!==m&&(d='<a href="'+m+'" target="_blank">'+d+"</a>");c.innerHTML=
|
||||
d}}}}(this,d),!0;case "descDisk":case "listDrives":return this.oa[c]=d,d.onchange=function(a,b){return function(){var c=parseInt(b.value,10);isNaN(c)||wj(a,c)}}(this,d),!0;case "loadDrive":return this.oa[c]=d,d.onclick=function(a){return function(){var b,c=a.oa.listDisks,d=a.oa.listDrives;if(c&&d&&!isNaN(b=parseInt(d.value,10))&&0<=b&&b<a.ta.length)if(d=c.value){c=c.options[c.selectedIndex].text;if("?"==d){d=window.prompt("Enter the URL of a disk image to load.","");if(!d)return;c=da(d);a.Tb("Attempting to load "+
|
||||
g.save=function(){var a=0,b=[];b[a++]=[this.Ce,this.cg];if(!this.Zc&&!this.se)for(var c=this.gb,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 l=c[d][e][f];if(l.oc){for(var k=[],m=0,n=l.Fc,q=l.Fc+l.oc;n<q;)k[m++]=l.data[n++];b[a++]=[d,e,f,l.Fc,k]}}return b};
|
||||
g.restore=function(a){var b=0,c="unsupported restore format";if(this.gb.length&&a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&e[1]!=this.cg&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.cg+")",b=-1);for(;d<a.length&&0<=b;){var f=0,l=a[d++],k=l[f++],m=l[f++],n=l[f++];if(k>=this.gb.length||m>=this.gb[k].length||n>=this.gb[k][m].length){c="sector "+k+":"+m+":"+n+" out of range ("+b+" changes applied)";b=-1;break}if(this.se){c="unable to modify write-protected disk";b=-1;break}e=
|
||||
l[f++];f=l[f++];l=e+f.length;k=this.gb[k][m][n];for(m=k.data.length;m<e;)k.data[m++]=k.pattern;m=0;k.Fc=e;for(k.oc=f.length;e<l;)k.data[e++]=f[m++];b++}}0>b&&this.xa("unable to restore disk '"+this.fd+": "+c);return b};
|
||||
function uj(a){w.call(this,"FDC",a,uj);this.dmaRead=this.nh;this.dmaWrite=this.oh;this.dmaFormat=this.gl;this.ce=null;if(a.autoMount&&(this.ce=a.autoMount,"string"==typeof this.ce))try{this.ce=eval("("+a.autoMount+")")}catch(b){u("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.ce=null}this.ec=[]}z(w,uj);h={};ca={};
|
||||
var vj={3:{Uc:3,qd:0,name:ca.io},4:{Uc:2,qd:1,name:ca.fo},5:{Uc:9,qd:7,name:ca.ro},6:{Uc:9,qd:7,name:ca.$n},7:{Uc:2,qd:0,name:ca.bo},8:{Uc:1,qd:2,name:ca.ho},10:{Uc:2,qd:7,name:ca.ao},13:{Uc:6,qd:7,name:ca.Un},15:{Uc:3,qd:0,name:ca.eo}};g=uj.prototype;
|
||||
g.vb=function(a,b,c,d){switch(c){case "listDisks":return this.oa[c]=d,a=window.document.createElement("option"),a.value="?",a.innerHTML="User-defined URL...",d.appendChild(a),d.onchange=function(a,b){return function(){var c=a.oa.descDisk;if(c){var d=b.options[b.selectedIndex];if(d){var m={};if(d=d.getAttribute("data-value"))try{m=eval("({"+d+"})")}catch(n){u("FDC option error: "+(n.message||n))}d=m.desc;void 0===d&&(d="");m=m.href;void 0!==m&&(d='<a href="'+m+'" target="_blank">'+d+"</a>");c.innerHTML=
|
||||
d}}}}(this,d),!0;case "descDisk":case "listDrives":return this.oa[c]=d,d.onchange=function(a,b){return function(){var c=parseInt(b.value,10);isNaN(c)||wj(a,c)}}(this,d),!0;case "loadDrive":return this.oa[c]=d,d.onclick=function(a){return function(){var b,c=a.oa.listDisks,d=a.oa.listDrives;if(c&&d&&!isNaN(b=parseInt(d.value,10))&&0<=b&&b<a.ta.length)if(d=c.value){c=c.options[c.selectedIndex].text;if("?"==d){d=window.prompt("Enter the URL of a disk image to load.","");if(!d)return;c=da(d);a.Vb("Attempting to load "+
|
||||
d+' as "'+c+'"')}for(;xj(a,b,c,d,!1)&&window.confirm("Click OK to reload the original disk.\n(WARNING: All disk changes will be discarded)");){for(var m=a,n=d,q=void 0,q=0;q<m.ec.length;q++)if(m.ec[q][1]==n){m.ec.splice(q,1);break}yj(a,b,!1,!0)}}else yj(a,b);else a.xa("Nothing to load")}}(this),!0}return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.ga=D(a,"ChipSet");this.$c();Ta(b,this,zj);Va(b,this,Aj);this.Re()||this.Pa()};
|
||||
g.Sb=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Fa.wh){this.ec=[];for(var c=0;c<this.ta.length;c++)yj(this,c,!0);this.Re(!0)}}else if(!this.restore(a))return!1;if(c=this.oa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.innerHTML="";for(var d=0;d<this.Qh;d++){var e=window.document.createElement("option");e.value=d;e.innerHTML=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.Qh&&(c.value="0",wj(this,0))}}return!0};
|
||||
g.Jb=function(a){return a&&this.save?this.save():!0};g.reset=function(){this.$c()};g.save=function(){var a=new H(this);a.set(0,this.Ni());return a.data()};g.restore=function(a){return this.$c(a[0])};
|
||||
g.$c=function(a){var b=0,c,d=!0;void 0===a&&(a=[0,0,128,Array(9),0,0,0,[]]);this.Sa=a[b++];b++;this.sa=a[b++];this.Kb=a[b++];this.hb=a[b++];this.Wa=a[b++];this.Be=a[b++];var e=a[b++];c=a[b++];null!=c&&(this.ec=c);void 0===this.ta&&(this.Qh=4,this.ga&&(this.Qh=th(this.ga)),this.ta=Array(4));for(c=0;c<this.ta.length;c++){var f=this.ta[c];void 0===f&&(f=this.ta[c]={},f.al=ph(this.ga,c),f.Zb=40,f.bc=9,2==f.al&&(f.Zb=80,f.bc=18));this.Gh(f,c,e[c])||(d=!1)}this.Fd=a[b++]||0;this.Jk=a[b]||0;return d};
|
||||
g.Ni=function(){var a=0,b=[];b[a++]=this.Sa;b[a++]=0;b[a++]=this.sa;b[a++]=this.Kb;b[a++]=this.hb;b[a++]=this.Wa;b[a++]=this.Be;b[a++]=this.Pi();for(var c=a++,d=0;d<this.ta.length;d++){var e=this.ta[d];e.ra&&Bj(this,e.ee,e.ra)}b[c]=this.ec;b[a++]=this.Fd;b[a]=this.Jk;return b};
|
||||
g.Gh=function(a,b,c){var d=0,e=!0;a.Sa=b;void 0===c&&(c=[192,!0,0,2,0]);"boolean"==typeof c[1]&&(c[1]=["Floppy Drive",a.Zb||40,a.Pb||c[3],a.bc||9,a.rb||512,c[1]]);a.Ra=c[d++];a.name=c[d][0];a.Zb=c[d][1];a.Pb=c[d][2];a.bc=c[d][3];a.rb=c[d][4];a.re=c[d][5];d++;a.Ea=c[d++];a.ld=c[d++];a.cb=c[d++];a.ld=100<=a.ld?a.ld-100:a.ld-a.cb;a.Ka=c[d++];a.od=c[d++];a.$a=c[d++];a.Ta=c[d++];a.Ja=null;a.ra||(a.ee="");var f=c[d++];f===Cj?(f=c[d++],c=c[d],xj(this,b,f,c,!0)?a.ra&&Dj(this,f,c,a.ra):this.Pa(!1)):void 0!==
|
||||
f&&a.ra&&0>a.ra.restore(f)&&(e=!1);e&&a.ra&&void 0!==a.Ta&&(a.Ja=a.ra.seek(a.cb,a.Ea,a.Ka));return e};g.Pi=function(){for(var a=0,b=[],c=0;c<this.ta.length;c++)b[a++]=this.Oi(this.ta[c]);return b};g.Oi=function(a){var b=0,c=[];c[b++]=a.Ra;c[b++]=[a.name,a.Zb,a.Pb,a.bc,a.rb,a.re];c[b++]=a.Ea;c[b++]=a.ld+100;c[b++]=a.cb;c[b++]=a.Ka;c[b++]=a.od;c[b++]=a.$a;c[b++]=a.Ta;c[b++]=Cj;c[b++]=a.Ok;c[b]=a.ee;return c};
|
||||
g.Re=function(a){a||(this.Qd=0);if(this.ce)for(var b in this.ce){var c=this.ce[b];if(c.name&&c.path){var d=b.charCodeAt(0)-65;if(0<=d&&d<this.ta.length){!xj(this,d,c.name,c.path,!0)&&a&&this.Pa(!1);continue}}this.xa("Unrecognized auto-mount specification for drive "+b)}return!!this.Qd};function xj(a,b,c,d,e){var f=a.ta[b];if(d&&f.ee!=d){yj(a,b,e,!0);if(f.Ec)return a.xa("Drive "+b+" busy"),!0;f.Ec=!0;e&&(f.Xd=!0,a.Qd++);(new lj(a,f,"preload")).load(c,d,a.rm);return!1}return!0}
|
||||
g.rm=function(a,b,c,d){a.Ec=!1;b&&b.Fb.length>a.Zb&&(this.xa('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.Sa)),b=null);b&&(a.ra=b,a.Ok=c,a.ee=d,Dj(this,c,d,b),this.Fd|=128,this.xa('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.Sa),a.Xd));a.Xd&&(a.Xd=!1,--this.Qd||this.Pa());wj(this,a.Sa)};
|
||||
function wj(a,b){if(0<=b&&b<a.ta.length){var c=a.ta[b],d=a.oa.listDisks,e=a.oa.listDrives;if(d&&e&&(e=parseInt(e.value,10),!isNaN(e)&&e==b)){for(e=0;e<d.options.length;e++)if(d.options[e].value==c.ee){d.selectedIndex!=e&&(d.selectedIndex=e);break}e==d.options.length&&(d.selectedIndex=0)}}}function yj(a,b,c,d){var e=a.ta[b];e.ra&&(Bj(a,e.ee,e.ra),e.Ok="",e.ee="",e.ra=null,a.Fd|=128,d||a.xa("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||wj(a,b))}
|
||||
function Dj(a,b,c,d){var e;for(e=0;e<a.ec.length;e++)if(a.ec[e][1]==c){d.restore(a.ec[e][2]);return}a.ec[e]=[b,c,[]]}function Bj(a,b,c){var d;for(d=0;d<a.ec.length;d++)if(a.ec[d][1]==b){a.ec[d][2]=c.save();break}}g.Ym=function(a,b){b&4?this.Be&4||this.Be&8&&this.ga&&R(this.ga,6):this.$c();this.Be=b};g.Ml=function(){return this.sa};g.Kl=function(){var a=0;this.hb<this.Wa&&(a=this.Kb[this.hb]);this.Be&8&&this.ga&&Kh(this.ga,6);++this.hb>=this.Wa&&(this.sa&=-81,this.hb=this.Wa=0);return a};
|
||||
g.Xm=function(a,b){this.Wa<this.Kb.length&&(this.Kb[this.Wa++]=b);var c=this.Kb[0]&31;if(void 0!==vj[c]&&this.Wa>=vj[c].Uc){var d=!1;this.hb=0;var e,f,c=this.Ga()&31;switch(c){case 3:this.Ga(h.fo);this.Ga(h.Tn);this.pb();break;case 4:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];this.pb();this.Va((e.Ra&4278190080)>>>24,h.ko);break;case 5:case 6:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.Ea=f>>2&1;e.cb=this.Ga(h.Qg);this.Ga(h.Rg);e.Ka=this.Ga(h.Tg);d=this.Ga(h.Jf);e.$a=128<<d;e.od=this.Ga(h.Qn);
|
||||
this.Ga(h.Xk);this.Ga(h.Pn);6==c?this.nh(e):this.oh(e);this.pb();Ej(this,e);Fj(this,e);Gj(this,e);this.Va(e.cb,h.Qg);this.Va(e.Ea,h.Rg);this.Va(e.Ka,h.Tg);this.Va(d,h.Jf);d=!0;break;case 7:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.cb=e.ld=0;e.Ra=268435488;this.pb();d=!0;break;case 8:e=this.ta[this.Sa];e.Ea=0;this.pb();Ej(this,e);this.Va(e.cb,h.Wn);this.Sa=this.Sa+1&3;break;case 10:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.Ea=f>>2&1;e.Ka=1;d=0;e.Ra=0;e.ra&&(e.Ja=e.ra.seek(e.cb,e.Ea,e.Ka))?
|
||||
d=e.Ja.length:e.Ra=1088;Ej(this,e);Fj(this,e);Gj(this,e);this.Va(e.cb,h.Qg);this.Va(e.Ea,h.Rg);this.Va(e.Ka,h.Tg);this.Va(d,h.Jf);d=!0;break;case 13:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.Ea=f>>2&1;d=this.Ga(h.Jf);e.$a=128<<d;e.od=this.Ga(h.$n);this.Ga(h.Xk);e.bj=this.Ga(h.On);this.kj(e);this.pb();Ej(this,e);Fj(this,e);Gj(this,e);this.Va(e.cb,h.Qg);this.Va(e.Ea,h.Rg);this.Va(e.Ka,h.Tg);this.Va(d,h.Jf);d=!0;break;case 15:f=this.Ga(h.Ie),this.Sa=f&3,e=this.ta[this.Sa],e.Ea=f>>2&1,c=this.Ga(h.Vn),
|
||||
e.cb+=c-e.ld,0>e.cb&&(e.cb=0),e.cb>=e.Zb&&(e.cb=e.Zb-1),e.ld=c,e.Ra=32,0==e.cb&&(e.Ra|=268435456),this.pb(),d=!0}0<this.Wa&&(this.sa|=80);this.Be&8&&(!e||e.Ra&8||!d||this.ga&&R(this.ga,6))}};g.Ll=function(){var a=this.Fd;this.Fd&=-129;return a};g.Wm=function(a,b){this.Jk=b};g.Ga=function(){var a=this.Kb[this.hb];this.hb++;return a};g.pb=function(){this.hb=this.Wa=0};g.Va=function(a){this.Kb[this.Wa++]=a};function Ej(a,b){a.Va(b.Sa|b.Ea<<2|b.Ra&255,h.ho)}
|
||||
function Fj(a,b){a.Va((b.Ra&65280)>>>8,h.io)}function Gj(a,b){a.Va((b.Ra&16711680)>>>16,h.jo)}g.lh=function(a,b,c){void 0===b||0>b?this.vc(a,c):c(-1,!1)};g.mh=function(a,b){return void 0!==b&&0<=b?this.xc(a,b):-1};g.dl=function(a,b){return void 0!==b&&0<=b?this.Ti(a,b):-1};g.nh=function(a){a.Ra=72;a.ra&&(a.Ja=null,a.Ra=0,this.ga&&(Eh(this.ga,2,this,"dmaRead",a),Ch(this.ga,2)))};
|
||||
g.oh=function(a){a.Ra=72;a.ra&&(a.ra.se?a.Ra=576:(a.Ja=null,a.Ra=0,this.ga&&(Eh(this.ga,2,this,"dmaWrite",a),Ch(this.ga,2))))};g.kj=function(a){a.Ra=72;a.ra&&(a.Ja=null,a.Ra=0,this.ga&&(a.Td=0,a.fc=Array(4),a.Se=!0,a.Xe=0,Eh(this.ga,2,this,"dmaFormat",a),Ch(this.ga,2),a.Se=!1))};g.vc=function(a,b){var c=-1;if(!a.Ra&&a.ra){do{if(a.Ja&&0<=(c=tj(a.Ja,a.Ta++)))break;a.Ja=a.ra.seek(a.cb,a.Ea,a.Ka);if(!a.Ja){a.Ra=1088;break}a.Ta=0;this.Pe(a)}while(1)}b(c,!1)};
|
||||
g.xc=function(a,b){if(a.Ra||!a.ra)return-1;do{if(a.Ja&&a.ra.write(a.Ja,a.Ta++,b))break;a.Ja=a.ra.seek(a.cb,a.Ea,a.Ka);if(!a.Ja){a.Ra=8256;b=-1;break}a.Ta=0;this.Pe(a)}while(1);return b};g.Pe=function(a){a.Ka++;a.Ka>=a.bc+1&&(a.Ka=1,a.Ea++,a.Ea>=a.Pb&&(a.Ea=0,a.cb++))};g.Ti=function(a,b){if(a.Ra)return-1;a.fc[a.Td++]=b;if(a.Td==a.fc.length){a.cb=a.fc[0];a.Ea=a.fc[1];a.Ka=a.fc[2];a.$a=128<<a.fc[3];for(var c=a.Td=0;c<a.$a;c++)if(0>this.xc(a,a.bj))return-1;a.Xe++}a.Xe>=a.od&&(b=-1);return b};
|
||||
var zj={1012:uj.prototype.Ml,1013:uj.prototype.Kl,1015:uj.prototype.Ll},Aj={1010:uj.prototype.Ym,1013:uj.prototype.Xm,1015:uj.prototype.Wm};v(function(){for(var a=C(window.document,"pcjs","fdc"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new uj(d);B(d,c)}});
|
||||
function $(a){w.call(this,"HDC",a,$);this.dmaRead=this.lh;this.dmaWrite=this.mh;this.dmaWriteBuffer=this.el;this.dmaWriteFormat=this.fl;this.Vg=[];if(a.drives)try{this.Vg=eval("("+a.drives+")")}catch(b){u("HDC drive configuration error: "+b.message+" ("+a.drives+")")}this.gf=(this.Wd="at"==a.type)?1:0;this.pl=this.Wd?2:3}z(w,$);
|
||||
var Hj=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7]}];g=$.prototype;g.ub=function(){return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.ga=D(a,"ChipSet");Ta(b,this,this.Wd?Ij:Jj);Va(b,this,this.Wd?Kj:Lj);this.reset();this.Re()||this.Pa()};
|
||||
g.Sb=function(a,b){if(!b)if(!a||!this.restore)this.$c(),this.Fa.wh&&this.Re(!0);else if(!this.restore(a))return!1;return!0};g.Jb=function(a){return a&&this.save?this.save():!0};g.te=function(){return this.Fa?this.Fa.te():""};g.wd=function(){return this.Fa?this.Fa.wd():""};g.reset=function(){this.$c(null,!0)};g.save=function(){var a=new H(this);a.set(0,this.Ni());return a.data()};g.restore=function(a){return this.$c(a[0])};
|
||||
g.$c=function(a,b){var c=0,d=!0;if(this.Wd)null==a&&(a=[0,0,0,0,0,0,0,0,64,0]),this.Ed=a[c++],this.Nk=a[c++],this.Hg=a[c++],this.Ig=a[c++],this.Gg=a[c++],this.Fg=a[c++],this.Ae=a[c++],this.sa=a[c++],this.Li=a[c++];else{null==a&&(a=[0,0,Array(14),0,0]);this.Af=a[c++];this.sa=a[c++];this.Kb=a[c++];this.hb=a[c++];this.Wa=a[c++];this.Mk=a[c++];this.Lk=a[c++];this.Kk=a[c++];var e=a[c++];void 0!==e?this.ff=e:void 0===this.ff&&(this.ff=-1)}void 0===this.ta&&(this.ta=Array(this.Vg.length));c=a[c];void 0===
|
||||
c&&(c=[]);for(e=0;e<this.ta.length;e++){void 0===this.ta[e]&&(this.ta[e]={});var f=this.ta[e];this.Gh(e,f,this.Vg[e],c[e],b)||(d=!1);null!=this.Af&&1>=e&&(this.Af|=(f.type&3)<<(1-e<<1))}return d};
|
||||
g.Ni=function(){var a=0,b=[];this.Wd?(b[a++]=this.Ed,b[a++]=this.Nk,b[a++]=this.Hg,b[a++]=this.Ig,b[a++]=this.Gg,b[a++]=this.Fg,b[a++]=this.Ae,b[a++]=this.sa,b[a++]=this.Li):(b[a++]=this.Af,b[a++]=this.sa,b[a++]=this.Kb,b[a++]=this.hb,b[a++]=this.Wa,b[a++]=this.Mk,b[a++]=this.Lk,b[a++]=this.Kk,b[a++]=this.ff);b[a]=this.Pi();return b};
|
||||
g.Gh=function(a,b,c,d,e){var f=0,l=!0;void 0===d&&(d=[0,0,!1,Array(8)]);b.Sa=a;b.errorCode=d[f++];b.Sk=d[f++];b.re=d[f++];b.ke=d[f++];b.le=d[f++];b.Ea=d[f++];b.Pb=d[f++];b.Hd=d[f++];b.Ka=d[f++];b.od=d[f++];b.$a=d[f++];b.Yf=this.Wd?0:1;b.name=c.name;void 0===b.name&&(b.name="Hard Drive");b.path=c.path;b.mode=c.mode||(b.path?"preload":"local");"demandro"!=b.mode&&"demandrw"!=b.mode||this.wd()||(b.mode="local");b.type=c.type;if(void 0===b.type||void 0===Hj[this.gf][b.type])b.type=this.pl;c=Hj[this.gf][b.type];
|
||||
b.bc=c[2]||17;b.rb=c[3]||512;if(e&&this.ga&&(e=this.ga,c=b.type,e.ka)){var k=e.ka[18],k=a?k&240|c:k&15|c<<4;e.ka&&(e.ka[18]=k,qh(e))}void 0===b.ra&&(b.ra=null,this.xa("Type "+b.type+' "'+b.name+'" is fixed disk '+a,!0));Mj(this,b);b.Ta=d[f++];b.Ja=null;b.ra&&(a=d[f],void 0!==a&&0>b.ra.restore(a)&&(l=!1),l&&void 0!==b.Ta&&(b.Ja=b.ra.seek(b.Hd,b.Ea,b.Ka+b.Yf)));return l};g.Pi=function(){for(var a=0,b=[],c=0;c<this.ta.length;c++)b[a++]=this.Oi(this.ta[c]);return b};
|
||||
g.Oi=function(a){var b=0,c=[];c[b++]=a.errorCode;c[b++]=a.Sk;c[b++]=a.re;c[b++]=a.ke;c[b++]=a.le;c[b++]=a.Ea;c[b++]=a.Pb;c[b++]=a.Hd;c[b++]=a.Ka;c[b++]=a.od;c[b++]=a.$a;c[b++]=a.Ta;c[b]=a.ra?a.ra.save():null;return c};
|
||||
function Mj(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.ke[2])?e=b.ke[0]<<8|b.ke[1]:c=b.type);null==c||d||(d=Hj[a.gf][c][1],e=Hj[a.gf][c][0]);d&&((c=Hj[a.gf][b.type])&&e!=c[0]&&d!=c[1]&&a.xa("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.Zb=e,b.Pb=d,null==b.ra&&(b.ra=new lj(a,b,b.mode)))}}
|
||||
g.Re=function(a){a||(this.Qd=0);for(var b=0;b<this.ta.length;b++){var c=this.ta[b];if(c.name&&c.path){var d;d=c.name;var c=c.path,e=this.ta[b];e.Ec?(this.xa("Drive "+b+" busy"),d=!0):(e.Ec=!0,e.Xd=!0,this.Qd++,(e.ra||new lj(this,e,e.mode)).load(d,c,this.qm),d=!1);!d&&a&&this.Pa(!1)}else a&&void 0!==c.type&&(c.ra=null,Mj(this,c,c.type))}return!!this.Qd};g.qm=function(a,b,c){a.Ec=!1;(a.ra=b)&&this.xa('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.Sa),a.Xd);a.Xd&&(a.Xd=!1,--this.Qd||this.Pa())};
|
||||
g.lm=function(){var a=0;this.hb<this.Wa&&(a=this.Kb[this.hb]);this.ga&&Kh(this.ga,5);this.sa&=-33;++this.hb>=this.Wa&&(this.hb=this.Wa=0,this.sa&=-15);return a};g.un=function(a,b){this.Wa<this.Kb.length&&(this.Kb[this.Wa++]=b);var c=12!=this.Kb[0]?6:this.Kb.length;6==this.Wa&&(this.sa&=-2);this.Wa>=c&&(this.sa|=2,this.sa&=-2,Nj(this))};g.mm=function(){var a=this.sa;this.hb<this.Wa&&(this.sa|=1);return a};g.xn=function(a,b){this.Mk=b;this.ga&&Kh(this.ga,5);this.$c()};g.km=function(){return this.Af};
|
||||
g.wn=function(a,b){this.Lk=b;this.sa=13};g.vn=function(a,b){this.Kk=b};g.Gi=function(){};g.xl=function(){var a=-1;if(this.Oa&&(a=this.vc(this.Oa),this.Oa.Ta==this.Oa.rb))if(this.Oa.$a-=this.Oa.rb,this.Oa.$a>=this.Oa.rb){var b=this;this.vc(this.Oa,function(a){0<=a?b.ga&&R(b.ga,14):(b.sa=1,b.Ed=16)},!1)}else this.sa=80;return a};
|
||||
g.Lm=function(a,b){this.Oa&&this.Oa.$a>=this.Oa.rb&&(0>this.xc(this.Oa,b)?(this.sa=1,this.Ed=16):this.Oa.Ta==this.Oa.rb&&(this.Oa.$a-=this.Oa.rb,this.ga&&R(this.ga,14),this.Oa.$a>=this.Oa.rb||(this.sa=80)))};g.zl=function(){return this.Ed};g.Pm=function(a,b){this.Nk=b};g.Al=function(){return this.Hg};g.Nm=function(a,b){this.Hg=b};g.Bl=function(){return this.Ig};g.Om=function(a,b){this.Ig=b};g.wl=function(){return this.Gg};g.Km=function(a,b){this.Gg=b};g.vl=function(){return this.Fg};
|
||||
g.Jm=function(a,b){this.Fg=b};g.yl=function(){return this.Ae};g.Mm=function(a,b){this.Ae=b;this.sa=this.ta[this.Ae&16?1:0]?this.sa|64:this.sa&-65};g.Cl=function(){return this.sa};g.Im=function(a,b){this.Li=b;this.ga&&Kh(this.ga,14);Oj(this)};
|
||||
function Oj(a){var b=!1,c=a.Li,d=a.Ae&16?1:0,e=a.Ae&15,f=a.Gg|(a.Fg&3)<<8,l=a.Ig,k=a.Hg;a.Oa=null;a.Ed=0;a.sa=80;(d=a.ta[d])?(d.Hd=f,d.Ea=e,d.Ka=l,d.$a=k*d.rb,c=144<=c?c:c&240,d.Ja=null,d.errorCode=0,a.Oa=d):c=-1;switch(c&240){case 32:a.vc(d,function(b){0<=b&&a.ga?(R(a.ga,14),a.sa=136):(a.sa=1,a.Ed=16)},!1);break;case 48:a.ga?(R(a.ga,14),a.sa=136):(a.sa=1,a.Ed=4);break;case 16:b=!0;break;case 64:b=!0;break;case 144:a.Ed=1;b=!0;break;case 145:d.Pb=e+1,d.bc=k,b=!0}b&&a.ga&&R(a.ga,14)}
|
||||
function Nj(a){a.hb=0;var b=a.Ga(),c=a.Ga(),d=c&32,e=d>>5,f=c&31,l=a.Ga(),k=a.Ga(),m=l<<2&768|k,n=l&63,q=a.Ga(),s=a.Ga(),r=a.ta[e];r&&(r.Hd=m,r.Ea=f,r.Ka=n,r.$a=q*r.rb);switch(b){case 3:a.pb(r?r.errorCode:4);a.Va(c);a.Va(l);a.Va(k);a.Va(0|d);b=-1;break;case 12:for(c=0;0<=(b=a.Ga());)r&&c<r.ke.length&&(r.ke[c++]=b);r&&Mj(a,r);b=0;r||a.ff!=e||(a.ff=-1,b=2);a.pb(b|d);b=-1;break;case 224:case 228:a.pb(0|d),b=-1}if(0<=b)switch(void 0===r?b=-1:(r.errorCode=0,r.Sk=0),b){case 0:a.pb(0|d);break;case 1:r.qo=
|
||||
s;a.pb(0|d);break;case 5:a.pb(0|d);break;case 8:a.nh(r,function(b){a.pb(b|d)});break;case 10:a.oh(r,function(b){a.pb(b|d)});break;case 15:Pj(a,r,function(b){a.pb(b|d)});break;default:a.pb(2|d)}}g.Ga=function(){var a=-1;this.hb<this.Wa&&(a=this.Kb[this.hb++]);return a};g.pb=function(a){this.hb=this.Wa=0;void 0!==a&&this.Va(a);this.ga&&R(this.ga,5);this.sa|=32};g.Va=function(a){this.Kb[this.Wa++]=a};g.lh=function(a,b,c){void 0===b||0>b?this.vc(a,c):c(-1,!1)};
|
||||
g.mh=function(a,b){return void 0!==b&&0<=b?this.xc(a,b):-1};g.el=function(a,b){var c;void 0!==b&&0<=b?(c=b,a.Ta<a.le.length?a.le[a.Ta++]=c:(a.errorCode=20,c=-1)):c=-1;return c};g.fl=function(a,b){return void 0!==b&&0<=b?this.Ti(a,b):-1};g.nh=function(a,b){a.errorCode=4;if(a.ra&&(a.Ja=null,this.ga)){a.errorCode=0;Eh(this.ga,3,this,"dmaRead",a);Ch(this.ga,3,function(c){c||0!=a.errorCode||(a.errorCode=4);b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
g.oh=function(a,b){a.errorCode=4;if(a.ra&&(a.Ja=null,this.ga)){a.errorCode=0;Eh(this.ga,3,this,"dmaWrite",a);Ch(this.ga,3,function(c){c||(0==a.errorCode&&(a.errorCode=4),20==a.errorCode&&(a.errorCode=0));b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};function Pj(a,b,c){b.errorCode=4;b.le&&b.le.length==b.$a||(b.le=Array(b.$a));b.Ta=0;a.ga?(b.errorCode=0,Eh(a.ga,3,a,"dmaWriteBuffer",b),Ch(a.ga,3,function(a){a||0!=b.errorCode||(b.errorCode=4);c(b.errorCode?2:0)})):c(b.errorCode?2:0)}
|
||||
g.kj=function(a,b){a.errorCode=4;if(a.ra&&(a.Ja=null,this.ga)){a.Td=0;a.fc=Array(4);a.Se=!0;a.Xe=0;a.errorCode=0;Eh(this.ga,3,this,"dmaWriteFormat",a);Ch(this.ga,3,function(c){c||0!=a.errorCode||(a.errorCode=4);a.Se=!1;b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
g.Ub=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Fa.yh){this.ec=[];for(var c=0;c<this.ta.length;c++)yj(this,c,!0);this.Re(!0)}}else if(!this.restore(a))return!1;if(c=this.oa.listDrives){for(;c.firstChild;)c.removeChild(c.firstChild);c.innerHTML="";for(var d=0;d<this.Th;d++){var e=window.document.createElement("option");e.value=d;e.innerHTML=String.fromCharCode(65+d)+":";c.appendChild(e)}0<this.Th&&(c.value="0",wj(this,0))}}return!0};
|
||||
g.Kb=function(a){return a&&this.save?this.save():!0};g.reset=function(){this.$c()};g.save=function(){var a=new H(this);a.set(0,this.Qi());return a.data()};g.restore=function(a){return this.$c(a[0])};
|
||||
g.$c=function(a){var b=0,c,d=!0;void 0===a&&(a=[0,0,128,Array(9),0,0,0,[]]);this.Sa=a[b++];b++;this.sa=a[b++];this.Lb=a[b++];this.ib=a[b++];this.Wa=a[b++];this.Be=a[b++];var e=a[b++];c=a[b++];null!=c&&(this.ec=c);void 0===this.ta&&(this.Th=4,this.ga&&(this.Th=th(this.ga)),this.ta=Array(4));for(c=0;c<this.ta.length;c++){var f=this.ta[c];void 0===f&&(f=this.ta[c]={},f.dl=ph(this.ga,c),f.Qb=40,f.Tb=9,2==f.dl&&(f.Qb=80,f.Tb=18));this.Ih(f,c,e[c])||(d=!1)}this.Fd=a[b++]||0;this.Mk=a[b]||0;return d};
|
||||
g.Qi=function(){var a=0,b=[];b[a++]=this.Sa;b[a++]=0;b[a++]=this.sa;b[a++]=this.Lb;b[a++]=this.ib;b[a++]=this.Wa;b[a++]=this.Be;b[a++]=this.Si();for(var c=a++,d=0;d<this.ta.length;d++){var e=this.ta[d];e.ra&&Bj(this,e.ee,e.ra)}b[c]=this.ec;b[a++]=this.Fd;b[a]=this.Mk;return b};
|
||||
g.Ih=function(a,b,c){var d=0,e=!0;a.Sa=b;void 0===c&&(c=[192,!0,0,2,0]);"boolean"==typeof c[1]&&(c[1]=["Floppy Drive",a.Qb||40,a.Jb||c[3],a.Tb||9,a.sb||512,c[1]]);a.Ra=c[d++];a.name=c[d][0];a.Qb=c[d][1];a.Jb=c[d][2];a.Tb=c[d][3];a.sb=c[d][4];a.re=c[d][5];(a.Sh=c[d][6])?(a.zg=c[d][7],a.Ag=c[d][8]):(a.Sh=a.Qb,a.zg=a.Jb,a.Ag=a.Tb);d++;a.Ea=c[d++];a.ld=c[d++];a.cb=c[d++];a.ld=100<=a.ld?a.ld-100:a.ld-a.cb;a.Ka=c[d++];a.od=c[d++];a.$a=c[d++];a.Ta=c[d++];a.Ja=null;a.ra||(a.ee="");var f=c[d++];f===Cj?(f=
|
||||
c[d++],c=c[d],xj(this,b,f,c,!0)?a.ra&&Dj(this,f,c,a.ra):this.Pa(!1)):void 0!==f&&a.ra&&0>a.ra.restore(f)&&(e=!1);e&&a.ra&&void 0!==a.Ta&&(a.Ja=a.ra.seek(a.cb,a.Ea,a.Ka));return e};g.Si=function(){for(var a=0,b=[],c=0;c<this.ta.length;c++)b[a++]=this.Ri(this.ta[c]);return b};g.Ri=function(a){var b=0,c=[];c[b++]=a.Ra;c[b++]=[a.name,a.Qb,a.Jb,a.Tb,a.sb,a.re,a.Sh,a.zg,a.Ag];c[b++]=a.Ea;c[b++]=a.ld+100;c[b++]=a.cb;c[b++]=a.Ka;c[b++]=a.od;c[b++]=a.$a;c[b++]=a.Ta;c[b++]=Cj;c[b++]=a.Rk;c[b]=a.ee;return c};
|
||||
g.Re=function(a){a||(this.Qd=0);if(this.ce)for(var b in this.ce){var c=this.ce[b];if(c.name&&c.path){var d=b.charCodeAt(0)-65;if(0<=d&&d<this.ta.length){!xj(this,d,c.name,c.path,!0)&&a&&this.Pa(!1);continue}}this.xa("Unrecognized auto-mount specification for drive "+b)}return!!this.Qd};function xj(a,b,c,d,e){var f=a.ta[b];if(d&&f.ee!=d){yj(a,b,e,!0);if(f.Ec)return a.xa("Drive "+b+" busy"),!0;f.Ec=!0;e&&(f.Xd=!0,a.Qd++);(new lj(a,f,"preload")).load(c,d,a.um);return!1}return!0}
|
||||
g.um=function(a,b,c,d){var e;a.Ec=!1;b&&(e=b.info(),b&&e[0]>a.Qb||e[1]>a.Jb||e[2]>a.Tb)&&(this.xa('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.Sa)),b=null);b&&(a.ra=b,a.Rk=c,a.ee=d,Dj(this,c,d,b),this.Fd|=128,this.xa('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.Sa),a.Xd),a.Sh=e[0],a.zg=e[1],a.Ag=e[2]);a.Xd&&(a.Xd=!1,--this.Qd||this.Pa());wj(this,a.Sa)};
|
||||
function wj(a,b){if(0<=b&&b<a.ta.length){var c=a.ta[b],d=a.oa.listDisks,e=a.oa.listDrives;if(d&&e&&(e=parseInt(e.value,10),!isNaN(e)&&e==b)){for(e=0;e<d.options.length;e++)if(d.options[e].value==c.ee){d.selectedIndex!=e&&(d.selectedIndex=e);break}e==d.options.length&&(d.selectedIndex=0)}}}function yj(a,b,c,d){var e=a.ta[b];e.ra&&(Bj(a,e.ee,e.ra),e.Rk="",e.ee="",e.ra=null,a.Fd|=128,d||a.xa("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||wj(a,b))}
|
||||
function Dj(a,b,c,d){var e;for(e=0;e<a.ec.length;e++)if(a.ec[e][1]==c){d.restore(a.ec[e][2]);return}a.ec[e]=[b,c,[]]}function Bj(a,b,c){var d;for(d=0;d<a.ec.length;d++)if(a.ec[d][1]==b){a.ec[d][2]=c.save();break}}g.an=function(a,b){b&4?this.Be&4||this.Be&8&&this.ga&&R(this.ga,6):this.$c();this.Be=b};g.Pl=function(){return this.sa};g.Nl=function(){var a=0;this.ib<this.Wa&&(a=this.Lb[this.ib]);this.Be&8&&this.ga&&Kh(this.ga,6);++this.ib>=this.Wa&&(this.sa&=-81,this.ib=this.Wa=0);return a};
|
||||
g.$m=function(a,b){this.Wa<this.Lb.length&&(this.Lb[this.Wa++]=b);var c=this.Lb[0]&31;if(void 0!==vj[c]&&this.Wa>=vj[c].Uc){var d=!1;this.ib=0;var e,f,c=this.Ga()&31;switch(c){case 3:this.Ga(h.jo);this.Ga(h.Wn);this.qb();break;case 4:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];this.qb();this.Va((e.Ra&4278190080)>>>24,h.no);break;case 5:case 6:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.Ea=f>>2&1;e.cb=this.Ga(h.Sg);this.Ga(h.Tg);e.Ka=this.Ga(h.Vg);d=this.Ga(h.Jf);e.$a=128<<d;e.od=this.Ga(h.Tn);
|
||||
this.Ga(h.$k);this.Ga(h.Sn);6==c?this.ph(e):this.qh(e);this.qb();Ej(this,e);Fj(this,e);Gj(this,e);this.Va(e.cb,h.Sg);this.Va(e.Ea,h.Tg);this.Va(e.Ka,h.Vg);this.Va(d,h.Jf);d=!0;break;case 7:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.cb=e.ld=0;e.Ra=268435488;this.qb();d=!0;break;case 8:e=this.ta[this.Sa];e.Ea=0;this.qb();Ej(this,e);this.Va(e.cb,h.Zn);this.Sa=this.Sa+1&3;break;case 10:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.Ea=f>>2&1;e.Ka=1;d=0;e.Ra=0;e.ra&&(e.Ja=e.ra.seek(e.cb,e.Ea,e.Ka))?
|
||||
d=e.Ja.length:e.Ra=1088;Ej(this,e);Fj(this,e);Gj(this,e);this.Va(e.cb,h.Sg);this.Va(e.Ea,h.Tg);this.Va(e.Ka,h.Vg);this.Va(d,h.Jf);d=!0;break;case 13:f=this.Ga(h.Ie);this.Sa=f&3;e=this.ta[this.Sa];e.Ea=f>>2&1;d=this.Ga(h.Jf);e.$a=128<<d;e.od=this.Ga(h.co);this.Ga(h.$k);e.ej=this.Ga(h.Rn);this.nj(e);this.qb();Ej(this,e);Fj(this,e);Gj(this,e);this.Va(e.cb,h.Sg);this.Va(e.Ea,h.Tg);this.Va(e.Ka,h.Vg);this.Va(d,h.Jf);d=!0;break;case 15:f=this.Ga(h.Ie),this.Sa=f&3,e=this.ta[this.Sa],e.Ea=f>>2&1,c=this.Ga(h.Yn),
|
||||
e.cb+=c-e.ld,0>e.cb&&(e.cb=0),e.cb>=e.Qb&&(e.cb=e.Qb-1),e.ld=c,e.Ra=32,0==e.cb&&(e.Ra|=268435456),this.qb(),d=!0}0<this.Wa&&(this.sa|=80);this.Be&8&&(!e||e.Ra&8||!d||this.ga&&R(this.ga,6))}};g.Ol=function(){var a=this.Fd;this.Fd&=-129;return a};g.Zm=function(a,b){this.Mk=b};g.Ga=function(){var a=this.Lb[this.ib];this.ib++;return a};g.qb=function(){this.ib=this.Wa=0};g.Va=function(a){this.Lb[this.Wa++]=a};function Ej(a,b){a.Va(b.Sa|b.Ea<<2|b.Ra&255,h.ko)}
|
||||
function Fj(a,b){a.Va((b.Ra&65280)>>>8,h.lo)}function Gj(a,b){a.Va((b.Ra&16711680)>>>16,h.mo)}g.nh=function(a,b,c){void 0===b||0>b?this.vc(a,c):c(-1,!1)};g.oh=function(a,b){return void 0!==b&&0<=b?this.xc(a,b):-1};g.gl=function(a,b){return void 0!==b&&0<=b?this.Wi(a,b):-1};g.ph=function(a){a.Ra=72;a.ra&&(a.Ja=null,a.Ra=0,this.ga&&(Eh(this.ga,2,this,"dmaRead",a),Ch(this.ga,2)))};
|
||||
g.qh=function(a){a.Ra=72;a.ra&&(a.ra.se?a.Ra=576:(a.Ja=null,a.Ra=0,this.ga&&(Eh(this.ga,2,this,"dmaWrite",a),Ch(this.ga,2))))};g.nj=function(a){a.Ra=72;a.ra&&(a.Ja=null,a.Ra=0,this.ga&&(a.Td=0,a.fc=Array(4),a.Se=!0,a.Xe=0,Eh(this.ga,2,this,"dmaFormat",a),Ch(this.ga,2),a.Se=!1))};g.vc=function(a,b){var c=-1;if(!a.Ra&&a.ra){do{if(a.Ja&&0<=(c=tj(a.Ja,a.Ta++)))break;a.Ja=a.ra.seek(a.cb,a.Ea,a.Ka);if(!a.Ja){a.Ra=1088;break}a.Ta=0;this.Pe(a)}while(1)}b(c,!1)};
|
||||
g.xc=function(a,b){if(a.Ra||!a.ra)return-1;do{if(a.Ja&&a.ra.write(a.Ja,a.Ta++,b))break;a.Ja=a.ra.seek(a.cb,a.Ea,a.Ka);if(!a.Ja){a.Ra=8256;b=-1;break}a.Ta=0;this.Pe(a)}while(1);return b};g.Pe=function(a){a.Ka++;a.Ka>=a.Ag+1&&(a.Ka=1,a.Ea++,a.Ea>=a.zg&&(a.Ea=0,a.cb++))};g.Wi=function(a,b){if(a.Ra)return-1;a.fc[a.Td++]=b;if(a.Td==a.fc.length){a.cb=a.fc[0];a.Ea=a.fc[1];a.Ka=a.fc[2];a.$a=128<<a.fc[3];for(var c=a.Td=0;c<a.$a;c++)if(0>this.xc(a,a.ej))return-1;a.Xe++}a.Xe>=a.od&&(b=-1);return b};
|
||||
var zj={1012:uj.prototype.Pl,1013:uj.prototype.Nl,1015:uj.prototype.Ol},Aj={1010:uj.prototype.an,1013:uj.prototype.$m,1015:uj.prototype.Zm};v(function(){for(var a=C(window.document,"pcjs","fdc"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new uj(d);B(d,c)}});
|
||||
function $(a){w.call(this,"HDC",a,$);this.dmaRead=this.nh;this.dmaWrite=this.oh;this.dmaWriteBuffer=this.hl;this.dmaWriteFormat=this.il;this.Xg=[];if(a.drives)try{this.Xg=eval("("+a.drives+")")}catch(b){u("HDC drive configuration error: "+b.message+" ("+a.drives+")")}this.gf=(this.Wd="at"==a.type)?1:0;this.sl=this.Wd?2:3}z(w,$);
|
||||
var Hj=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7]}];g=$.prototype;g.vb=function(){return!1};g.ic=function(a,b,c,d){this.ma=b;this.ia=c;this.Na=d;this.Fa=a;this.ga=D(a,"ChipSet");Ta(b,this,this.Wd?Ij:Jj);Va(b,this,this.Wd?Kj:Lj);this.reset();this.Re()||this.Pa()};
|
||||
g.Ub=function(a,b){if(!b)if(!a||!this.restore)this.$c(),this.Fa.yh&&this.Re(!0);else if(!this.restore(a))return!1;return!0};g.Kb=function(a){return a&&this.save?this.save():!0};g.te=function(){return this.Fa?this.Fa.te():""};g.wd=function(){return this.Fa?this.Fa.wd():""};g.reset=function(){this.$c(null,!0)};g.save=function(){var a=new H(this);a.set(0,this.Qi());return a.data()};g.restore=function(a){return this.$c(a[0])};
|
||||
g.$c=function(a,b){var c=0,d=!0;if(this.Wd)null==a&&(a=[0,0,0,0,0,0,0,0,64,0]),this.Ed=a[c++],this.Qk=a[c++],this.Jg=a[c++],this.Kg=a[c++],this.Ig=a[c++],this.Hg=a[c++],this.Ae=a[c++],this.sa=a[c++],this.Oi=a[c++];else{null==a&&(a=[0,0,Array(14),0,0]);this.Af=a[c++];this.sa=a[c++];this.Lb=a[c++];this.ib=a[c++];this.Wa=a[c++];this.Pk=a[c++];this.Ok=a[c++];this.Nk=a[c++];var e=a[c++];void 0!==e?this.ff=e:void 0===this.ff&&(this.ff=-1)}void 0===this.ta&&(this.ta=Array(this.Xg.length));c=a[c];void 0===
|
||||
c&&(c=[]);for(e=0;e<this.ta.length;e++){void 0===this.ta[e]&&(this.ta[e]={});var f=this.ta[e];this.Ih(e,f,this.Xg[e],c[e],b)||(d=!1);null!=this.Af&&1>=e&&(this.Af|=(f.type&3)<<(1-e<<1))}return d};
|
||||
g.Qi=function(){var a=0,b=[];this.Wd?(b[a++]=this.Ed,b[a++]=this.Qk,b[a++]=this.Jg,b[a++]=this.Kg,b[a++]=this.Ig,b[a++]=this.Hg,b[a++]=this.Ae,b[a++]=this.sa,b[a++]=this.Oi):(b[a++]=this.Af,b[a++]=this.sa,b[a++]=this.Lb,b[a++]=this.ib,b[a++]=this.Wa,b[a++]=this.Pk,b[a++]=this.Ok,b[a++]=this.Nk,b[a++]=this.ff);b[a]=this.Si();return b};
|
||||
g.Ih=function(a,b,c,d,e){var f=0,l=!0;void 0===d&&(d=[0,0,!1,Array(8)]);b.Sa=a;b.errorCode=d[f++];b.Vk=d[f++];b.re=d[f++];b.ke=d[f++];b.le=d[f++];b.Ea=d[f++];b.Jb=d[f++];b.Hd=d[f++];b.Ka=d[f++];b.od=d[f++];b.$a=d[f++];b.Yf=this.Wd?0:1;b.name=c.name;void 0===b.name&&(b.name="Hard Drive");b.path=c.path;b.mode=c.mode||(b.path?"preload":"local");"demandro"!=b.mode&&"demandrw"!=b.mode||this.wd()||(b.mode="local");b.type=c.type;if(void 0===b.type||void 0===Hj[this.gf][b.type])b.type=this.sl;c=Hj[this.gf][b.type];
|
||||
b.Tb=c[2]||17;b.sb=c[3]||512;if(e&&this.ga&&(e=this.ga,c=b.type,e.ka)){var k=e.ka[18],k=a?k&240|c:k&15|c<<4;e.ka&&(e.ka[18]=k,qh(e))}void 0===b.ra&&(b.ra=null,this.xa("Type "+b.type+' "'+b.name+'" is fixed disk '+a,!0));Mj(this,b);b.Ta=d[f++];b.Ja=null;b.ra&&(a=d[f],void 0!==a&&0>b.ra.restore(a)&&(l=!1),l&&void 0!==b.Ta&&(b.Ja=b.ra.seek(b.Hd,b.Ea,b.Ka+b.Yf)));return l};g.Si=function(){for(var a=0,b=[],c=0;c<this.ta.length;c++)b[a++]=this.Ri(this.ta[c]);return b};
|
||||
g.Ri=function(a){var b=0,c=[];c[b++]=a.errorCode;c[b++]=a.Vk;c[b++]=a.re;c[b++]=a.ke;c[b++]=a.le;c[b++]=a.Ea;c[b++]=a.Jb;c[b++]=a.Hd;c[b++]=a.Ka;c[b++]=a.od;c[b++]=a.$a;c[b++]=a.Ta;c[b]=a.ra?a.ra.save():null;return c};
|
||||
function Mj(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.ke[2])?e=b.ke[0]<<8|b.ke[1]:c=b.type);null==c||d||(d=Hj[a.gf][c][1],e=Hj[a.gf][c][0]);d&&((c=Hj[a.gf][b.type])&&e!=c[0]&&d!=c[1]&&a.xa("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.Qb=e,b.Jb=d,null==b.ra&&(b.ra=new lj(a,b,b.mode)))}}
|
||||
g.Re=function(a){a||(this.Qd=0);for(var b=0;b<this.ta.length;b++){var c=this.ta[b];if(c.name&&c.path){var d;d=c.name;var c=c.path,e=this.ta[b];e.Ec?(this.xa("Drive "+b+" busy"),d=!0):(e.Ec=!0,e.Xd=!0,this.Qd++,(e.ra||new lj(this,e,e.mode)).load(d,c,this.tm),d=!1);!d&&a&&this.Pa(!1)}else a&&void 0!==c.type&&(c.ra=null,Mj(this,c,c.type))}return!!this.Qd};g.tm=function(a,b,c){a.Ec=!1;(a.ra=b)&&this.xa('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.Sa),a.Xd);a.Xd&&(a.Xd=!1,--this.Qd||this.Pa())};
|
||||
g.om=function(){var a=0;this.ib<this.Wa&&(a=this.Lb[this.ib]);this.ga&&Kh(this.ga,5);this.sa&=-33;++this.ib>=this.Wa&&(this.ib=this.Wa=0,this.sa&=-15);return a};g.xn=function(a,b){this.Wa<this.Lb.length&&(this.Lb[this.Wa++]=b);var c=12!=this.Lb[0]?6:this.Lb.length;6==this.Wa&&(this.sa&=-2);this.Wa>=c&&(this.sa|=2,this.sa&=-2,Nj(this))};g.pm=function(){var a=this.sa;this.ib<this.Wa&&(this.sa|=1);return a};g.An=function(a,b){this.Pk=b;this.ga&&Kh(this.ga,5);this.$c()};g.nm=function(){return this.Af};
|
||||
g.zn=function(a,b){this.Ok=b;this.sa=13};g.yn=function(a,b){this.Nk=b};g.Ji=function(){};g.Al=function(){var a=-1;if(this.Oa&&(a=this.vc(this.Oa),this.Oa.Ta==this.Oa.sb))if(this.Oa.$a-=this.Oa.sb,this.Oa.$a>=this.Oa.sb){var b=this;this.vc(this.Oa,function(a){0<=a?b.ga&&R(b.ga,14):(b.sa=1,b.Ed=16)},!1)}else this.sa=80;return a};
|
||||
g.Om=function(a,b){this.Oa&&this.Oa.$a>=this.Oa.sb&&(0>this.xc(this.Oa,b)?(this.sa=1,this.Ed=16):this.Oa.Ta==this.Oa.sb&&(this.Oa.$a-=this.Oa.sb,this.ga&&R(this.ga,14),this.Oa.$a>=this.Oa.sb||(this.sa=80)))};g.Cl=function(){return this.Ed};g.Sm=function(a,b){this.Qk=b};g.Dl=function(){return this.Jg};g.Qm=function(a,b){this.Jg=b};g.El=function(){return this.Kg};g.Rm=function(a,b){this.Kg=b};g.zl=function(){return this.Ig};g.Nm=function(a,b){this.Ig=b};g.yl=function(){return this.Hg};
|
||||
g.Mm=function(a,b){this.Hg=b};g.Bl=function(){return this.Ae};g.Pm=function(a,b){this.Ae=b;this.sa=this.ta[this.Ae&16?1:0]?this.sa|64:this.sa&-65};g.Fl=function(){return this.sa};g.Lm=function(a,b){this.Oi=b;this.ga&&Kh(this.ga,14);Oj(this)};
|
||||
function Oj(a){var b=!1,c=a.Oi,d=a.Ae&16?1:0,e=a.Ae&15,f=a.Ig|(a.Hg&3)<<8,l=a.Kg,k=a.Jg;a.Oa=null;a.Ed=0;a.sa=80;(d=a.ta[d])?(d.Hd=f,d.Ea=e,d.Ka=l,d.$a=k*d.sb,c=144<=c?c:c&240,d.Ja=null,d.errorCode=0,a.Oa=d):c=-1;switch(c&240){case 32:a.vc(d,function(b){0<=b&&a.ga?(R(a.ga,14),a.sa=136):(a.sa=1,a.Ed=16)},!1);break;case 48:a.ga?(R(a.ga,14),a.sa=136):(a.sa=1,a.Ed=4);break;case 16:b=!0;break;case 64:b=!0;break;case 144:a.Ed=1;b=!0;break;case 145:d.Jb=e+1,d.Tb=k,b=!0}b&&a.ga&&R(a.ga,14)}
|
||||
function Nj(a){a.ib=0;var b=a.Ga(),c=a.Ga(),d=c&32,e=d>>5,f=c&31,l=a.Ga(),k=a.Ga(),m=l<<2&768|k,n=l&63,q=a.Ga(),s=a.Ga(),r=a.ta[e];r&&(r.Hd=m,r.Ea=f,r.Ka=n,r.$a=q*r.sb);switch(b){case 3:a.qb(r?r.errorCode:4);a.Va(c);a.Va(l);a.Va(k);a.Va(0|d);b=-1;break;case 12:for(c=0;0<=(b=a.Ga());)r&&c<r.ke.length&&(r.ke[c++]=b);r&&Mj(a,r);b=0;r||a.ff!=e||(a.ff=-1,b=2);a.qb(b|d);b=-1;break;case 224:case 228:a.qb(0|d),b=-1}if(0<=b)switch(void 0===r?b=-1:(r.errorCode=0,r.Vk=0),b){case 0:a.qb(0|d);break;case 1:r.to=
|
||||
s;a.qb(0|d);break;case 5:a.qb(0|d);break;case 8:a.ph(r,function(b){a.qb(b|d)});break;case 10:a.qh(r,function(b){a.qb(b|d)});break;case 15:Pj(a,r,function(b){a.qb(b|d)});break;default:a.qb(2|d)}}g.Ga=function(){var a=-1;this.ib<this.Wa&&(a=this.Lb[this.ib++]);return a};g.qb=function(a){this.ib=this.Wa=0;void 0!==a&&this.Va(a);this.ga&&R(this.ga,5);this.sa|=32};g.Va=function(a){this.Lb[this.Wa++]=a};g.nh=function(a,b,c){void 0===b||0>b?this.vc(a,c):c(-1,!1)};
|
||||
g.oh=function(a,b){return void 0!==b&&0<=b?this.xc(a,b):-1};g.hl=function(a,b){var c;void 0!==b&&0<=b?(c=b,a.Ta<a.le.length?a.le[a.Ta++]=c:(a.errorCode=20,c=-1)):c=-1;return c};g.il=function(a,b){return void 0!==b&&0<=b?this.Wi(a,b):-1};g.ph=function(a,b){a.errorCode=4;if(a.ra&&(a.Ja=null,this.ga)){a.errorCode=0;Eh(this.ga,3,this,"dmaRead",a);Ch(this.ga,3,function(c){c||0!=a.errorCode||(a.errorCode=4);b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
g.qh=function(a,b){a.errorCode=4;if(a.ra&&(a.Ja=null,this.ga)){a.errorCode=0;Eh(this.ga,3,this,"dmaWrite",a);Ch(this.ga,3,function(c){c||(0==a.errorCode&&(a.errorCode=4),20==a.errorCode&&(a.errorCode=0));b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};function Pj(a,b,c){b.errorCode=4;b.le&&b.le.length==b.$a||(b.le=Array(b.$a));b.Ta=0;a.ga?(b.errorCode=0,Eh(a.ga,3,a,"dmaWriteBuffer",b),Ch(a.ga,3,function(a){a||0!=b.errorCode||(b.errorCode=4);c(b.errorCode?2:0)})):c(b.errorCode?2:0)}
|
||||
g.nj=function(a,b){a.errorCode=4;if(a.ra&&(a.Ja=null,this.ga)){a.Td=0;a.fc=Array(4);a.Se=!0;a.Xe=0;a.errorCode=0;Eh(this.ga,3,this,"dmaWriteFormat",a);Ch(this.ga,3,function(c){c||0!=a.errorCode||(a.errorCode=4);a.Se=!1;b(a.errorCode?2:0)});return}b(a.errorCode?2:0)};
|
||||
g.vc=function(a,b,c){var d=-1;if(a.errorCode)return b&&b(d,!1),d;var e=!1!==c?1:0;if(a.Ja&&(d=tj(a.Ja,a.Ta),a.Ta+=e,0<=d))return b&&b(d,!1),d;if(b){var f=this;a.ra.seek(a.Hd,a.Ea,a.Ka+a.Yf,!1,function(c,d){var m=-1;(a.Ja=c)?(a.Ta=0,f.Pe(a),m=tj(a.Ja,a.Ta),a.Ta+=e):a.errorCode=20;b(m,d)})}return d};
|
||||
g.xc=function(a,b){if(a.errorCode)return-1;do{if(a.Ja&&a.ra.write(a.Ja,a.Ta++,b))break;a.ra.seek(a.Hd,a.Ea,a.Ka+a.Yf,!0,function(b){a.Ja=b});if(!a.Ja){a.errorCode=20;b=-1;break}a.Ta=0;this.Pe(a)}while(1);return b};g.Pe=function(a){a.Ka++;var b=1-a.Yf;a.Ka>=a.bc+b&&(a.Ka=b,a.Ea++,a.Ea>=a.Pb&&(a.Ea=0,a.Hd++))};
|
||||
g.Ti=function(a,b){if(a.errorCode)return-1;a.fc[a.Td++]=b;if(a.Td==a.fc.length){a.Hd=a.fc[0];a.Ea=a.fc[1];a.Ka=a.fc[2];a.$a=128<<a.fc[3];for(var c=a.Td=0;c<a.$a;c++)if(0>this.xc(a,a.bj))return-1;a.Xe++}a.Xe>=a.od&&(b=-1);return b};
|
||||
var Jj={800:$.prototype.lm,801:$.prototype.mm,802:$.prototype.km},Ij={496:$.prototype.xl,497:$.prototype.zl,498:$.prototype.Al,499:$.prototype.Bl,500:$.prototype.wl,501:$.prototype.vl,502:$.prototype.yl,503:$.prototype.Cl},Lj={800:$.prototype.un,801:$.prototype.xn,802:$.prototype.wn,803:$.prototype.vn,807:$.prototype.Gi,811:$.prototype.Gi,815:$.prototype.Gi},Kj={496:$.prototype.Lm,497:$.prototype.Pm,498:$.prototype.Nm,499:$.prototype.Om,500:$.prototype.Km,501:$.prototype.Jm,502:$.prototype.Mm,503:$.prototype.Im};
|
||||
v(function(){for(var a=C(window.document,"pcjs","hdc"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new $(d);B(d,c)}});function H(a,b,c){this.id=a.id;this.key=Qj(a,b,c);this.Na=a.Na;Tj(this,a.yn)}function Qj(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}function Uj(){try{return"undefined"!==typeof window.localStorage}catch(a){return!1}}
|
||||
H.prototype={set:function(a,b){this[this.id][a]=b},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.uh=!0):this.uh?!0:Uj()&&(a=window.localStorage.getItem(this.key))?(this[this.id]=a,this.uh=!0):!1},parse:function(){var a=!0;try{this[this.id]=JSON.parse(this[this.id])}catch(b){u(b.message||b),a=!1}return a},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},
|
||||
clear:function(a){Tj(this);if(Uj())for(var b=0;b<window.localStorage.length;){var c=window.localStorage.key(b++);c&&(a||c.substr(0,this.key.length)==this.key)&&(window.localStorage.removeItem(c),b=0)}}};function Tj(a,b){a[a.id]={};b&&a.set("parms",b);a.uh=!1}function Vj(a){var b=!0;if(Uj()){var c=JSON.stringify(a[a.id]);try{window.localStorage.setItem(a.key,c)}catch(d){u("Unable to store "+c.length+" bytes in browser local storage"),b=!1}}return b}
|
||||
function Wj(a,b,c){w.call(this,"Computer",a,Wj);this.zb=!1;this.hf=a.buswidth;this.kc=Xj;this.Ef=null;this.lg=!1;this.url=b?b.url:null;this.Fn=(Math.random()+0.1).toString(36).substr(2,12);this.wc=Yj(this);if(this.ia=Ba("CPU",this.id)){this.Na=Ba("Debugger",this.id);this.ma=new Ha({id:this.og+".bus",buswidth:this.hf},this.ia,this.Na);var d,e=za(this.id);if((this.zf=Ba("Panel",this.id))&&this.zf.ih)for(b=0;b<e.length;b++)d=e[b],d.xa=this.zf.xa,d.Tb=this.zf.Tb,d.ih=this.zf.ih;this.Tb("PREFETCH: false, TYPEDARRAYS: false");
|
||||
for(b=0;b<e.length;b++)d=e[b],d.ic&&d.ic(this,this.ma,this.ia,this.Na);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.Kg=d:this.kc=parseInt(d,10));var f;if(a=ua&&ua.state||(f=!0,a.state))b=this.Qk=a,f||(this.lg=!0,this.kc=Xj),this.kc&&(this.Og=new H(this,"1.15.5"),this.Og.load()?b=null:delete this.Og);!b&&this.kc&&(f=null,this.wc&&(f=ka()+"/api/v1/user?req=load&user="+this.wc+"&state="+Qj(this,"1.15.5")),b=f)&&(this.lg=!0);b?t(b,!0,null,this,this.Cm):this.Pa();c||Zj(this,this.Dg)}else u("Unable to find CPU component")}
|
||||
z(w,Wj);var Cj=102,Xj=0;g=Wj.prototype;g.te=function(){return this.Fn};g.wd=function(){return this.wc?this.wc:""};g.Cm=function(a,b,c){c?(this.Kg=null,this.lg=!1,this.xa("Unable to load machine state from server (error "+c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):this.Ef=b;this.Pa()};function Zj(a,b,c){for(var d=za(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Da(f)){Da(f,function(){Zj(a,b,c)});return}}b.call(a,c)}
|
||||
g.xc=function(a,b){if(a.errorCode)return-1;do{if(a.Ja&&a.ra.write(a.Ja,a.Ta++,b))break;a.ra.seek(a.Hd,a.Ea,a.Ka+a.Yf,!0,function(b){a.Ja=b});if(!a.Ja){a.errorCode=20;b=-1;break}a.Ta=0;this.Pe(a)}while(1);return b};g.Pe=function(a){a.Ka++;var b=1-a.Yf;a.Ka>=a.Tb+b&&(a.Ka=b,a.Ea++,a.Ea>=a.Jb&&(a.Ea=0,a.Hd++))};
|
||||
g.Wi=function(a,b){if(a.errorCode)return-1;a.fc[a.Td++]=b;if(a.Td==a.fc.length){a.Hd=a.fc[0];a.Ea=a.fc[1];a.Ka=a.fc[2];a.$a=128<<a.fc[3];for(var c=a.Td=0;c<a.$a;c++)if(0>this.xc(a,a.ej))return-1;a.Xe++}a.Xe>=a.od&&(b=-1);return b};
|
||||
var Jj={800:$.prototype.om,801:$.prototype.pm,802:$.prototype.nm},Ij={496:$.prototype.Al,497:$.prototype.Cl,498:$.prototype.Dl,499:$.prototype.El,500:$.prototype.zl,501:$.prototype.yl,502:$.prototype.Bl,503:$.prototype.Fl},Lj={800:$.prototype.xn,801:$.prototype.An,802:$.prototype.zn,803:$.prototype.yn,807:$.prototype.Ji,811:$.prototype.Ji,815:$.prototype.Ji},Kj={496:$.prototype.Om,497:$.prototype.Sm,498:$.prototype.Qm,499:$.prototype.Rm,500:$.prototype.Nm,501:$.prototype.Mm,502:$.prototype.Pm,503:$.prototype.Lm};
|
||||
v(function(){for(var a=C(window.document,"pcjs","hdc"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new $(d);B(d,c)}});function H(a,b,c){this.id=a.id;this.key=Qj(a,b,c);this.Na=a.Na;Tj(this,a.Bn)}function Qj(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}function Uj(){try{return"undefined"!==typeof window.localStorage}catch(a){return!1}}
|
||||
H.prototype={set:function(a,b){this[this.id][a]=b},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.wh=!0):this.wh?!0:Uj()&&(a=window.localStorage.getItem(this.key))?(this[this.id]=a,this.wh=!0):!1},parse:function(){var a=!0;try{this[this.id]=JSON.parse(this[this.id])}catch(b){u(b.message||b),a=!1}return a},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},
|
||||
clear:function(a){Tj(this);if(Uj())for(var b=0;b<window.localStorage.length;){var c=window.localStorage.key(b++);c&&(a||c.substr(0,this.key.length)==this.key)&&(window.localStorage.removeItem(c),b=0)}}};function Tj(a,b){a[a.id]={};b&&a.set("parms",b);a.wh=!1}function Vj(a){var b=!0;if(Uj()){var c=JSON.stringify(a[a.id]);try{window.localStorage.setItem(a.key,c)}catch(d){u("Unable to store "+c.length+" bytes in browser local storage"),b=!1}}return b}
|
||||
function Wj(a,b,c){w.call(this,"Computer",a,Wj);this.Ab=!1;this.hf=a.buswidth;this.kc=Xj;this.Ef=null;this.lg=!1;this.url=b?b.url:null;this.In=(Math.random()+0.1).toString(36).substr(2,12);this.wc=Yj(this);if(this.ia=Ba("CPU",this.id)){this.Na=Ba("Debugger",this.id);this.ma=new Ha({id:this.og+".bus",buswidth:this.hf},this.ia,this.Na);var d,e=za(this.id);if((this.zf=Ba("Panel",this.id))&&this.zf.kh)for(b=0;b<e.length;b++)d=e[b],d.xa=this.zf.xa,d.Vb=this.zf.Vb,d.kh=this.zf.kh;this.Vb("PREFETCH: false, TYPEDARRAYS: false");
|
||||
for(b=0;b<e.length;b++)d=e[b],d.ic&&d.ic(this,this.ma,this.ia,this.Na);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.Mg=d:this.kc=parseInt(d,10));var f;if(a=ua&&ua.state||(f=!0,a.state))b=this.Tk=a,f||(this.lg=!0,this.kc=Xj),this.kc&&(this.Qg=new H(this,"1.15.5"),this.Qg.load()?b=null:delete this.Qg);!b&&this.kc&&(f=null,this.wc&&(f=ka()+"/api/v1/user?req=load&user="+this.wc+"&state="+Qj(this,"1.15.5")),b=f)&&(this.lg=!0);b?t(b,!0,null,this,this.Fm):this.Pa();c||Zj(this,this.Fg)}else u("Unable to find CPU component")}
|
||||
z(w,Wj);var Cj=102,Xj=0;g=Wj.prototype;g.te=function(){return this.In};g.wd=function(){return this.wc?this.wc:""};g.Fm=function(a,b,c){c?(this.Mg=null,this.lg=!1,this.xa("Unable to load machine state from server (error "+c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):this.Ef=b;this.Pa()};function Zj(a,b,c){for(var d=za(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Da(f)){Da(f,function(){Zj(a,b,c)});return}}b.call(a,c)}
|
||||
function ak(a,b){var c=new H(a,"1.15.5","validate");if(c.load()&&c.parse()){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.xa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
|
||||
g.Dg=function(a){void 0===a&&(a=this.Ef?1:this.kc);var b=!1,c=!1;this.oj=!1;var d=this.Og||new H(this,"1.15.5");if(-1==a)b=!0;else if(a>Xj){if(d.load(this.Ef)){this.Fe=new H(this,"1.15.5","failsafe");this.Fe.load()&&(bk(this,d),a=2);this.Fe.set("timestamp",ia());Vj(this.Fe);var e=this.kc&&!this.lg;if(1==a||la("Click OK to restore previous PCjs machine state.")){if(c=d.parse()){var f=d.get("code"),l=d.get("data");f&&("ok"==f?d.load(l):("error"==f&&"no machine state"!=l?(this.xa("Error: "+l),"unable to verify user"==
|
||||
l&&(ma(""),this.wc=null)):this.Tb(f+": "+l),Tj(d),d.load()?(c=d.parse(),e=!0):c=!1))}e&&ak(this,c?d:null)}else 2==a&&d.clear()}else ak(this);delete this.Ef;delete this.Og}e=za(this.id);for(f=0;f<e.length;f++)l=e[f],l!==this&&l!=this.ia&&(c=ck(this,l,d,b,c));b=[d,a,c];-1!=a?Zj(this,this.Hk,b):this.Hk(b)};
|
||||
function ck(a,b,c,d,e){if(!b.zb){b.zb=!0;if(b.Sb){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Sb(f,d)&&f&&(u("Unable to restore state for "+b.type),a.Qk&&!a.Ef?(c.clear(),a.kc=Xj,window&&window.location.reload()):a.oj=!0,b.Sb(null),e=!1)}if(!d&&b.ij)for(a=b.ij.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.Hk=function(a){var b=a[0],c=0>a[1];a=a[2];this.zb=!0;this.mj||(this.Tb("PCjs v1.15.5\nCopyright \u00a9 2012-2014 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>"),this.mj=!0);this.ia&&ck(this,this.ia,b,c,a);this.oj&&(bk(this,b),b.clear());!c&&this.Fe&&(this.Fe.clear(),delete this.Fe)};
|
||||
g.Fg=function(a){void 0===a&&(a=this.Ef?1:this.kc);var b=!1,c=!1;this.rj=!1;var d=this.Qg||new H(this,"1.15.5");if(-1==a)b=!0;else if(a>Xj){if(d.load(this.Ef)){this.Fe=new H(this,"1.15.5","failsafe");this.Fe.load()&&(bk(this,d),a=2);this.Fe.set("timestamp",ia());Vj(this.Fe);var e=this.kc&&!this.lg;if(1==a||la("Click OK to restore previous PCjs machine state.")){if(c=d.parse()){var f=d.get("code"),l=d.get("data");f&&("ok"==f?d.load(l):("error"==f&&"no machine state"!=l?(this.xa("Error: "+l),"unable to verify user"==
|
||||
l&&(ma(""),this.wc=null)):this.Vb(f+": "+l),Tj(d),d.load()?(c=d.parse(),e=!0):c=!1))}e&&ak(this,c?d:null)}else 2==a&&d.clear()}else ak(this);delete this.Ef;delete this.Qg}e=za(this.id);for(f=0;f<e.length;f++)l=e[f],l!==this&&l!=this.ia&&(c=ck(this,l,d,b,c));b=[d,a,c];-1!=a?Zj(this,this.Kk,b):this.Kk(b)};
|
||||
function ck(a,b,c,d,e){if(!b.Ab){b.Ab=!0;if(b.Ub){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ub(f,d)&&f&&(u("Unable to restore state for "+b.type),a.Tk&&!a.Ef?(c.clear(),a.kc=Xj,window&&window.location.reload()):a.rj=!0,b.Ub(null),e=!1)}if(!d&&b.lj)for(a=b.lj.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.Kk=function(a){var b=a[0],c=0>a[1];a=a[2];this.Ab=!0;this.pj||(this.Vb("PCjs v1.15.5\nCopyright \u00a9 2012-2014 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>"),this.pj=!0);this.ia&&ck(this,this.ia,b,c,a);this.rj&&(bk(this,b),b.clear());!c&&this.Fe&&(this.Fe.clear(),delete this.Fe)};
|
||||
function bk(a,b){if(la("There may be a problem with PCjs.\nClick OK to send your PCjs machine state to http://www.pcjs.org.")){var c=a.wd(),d=b.toString(),e={app:"PCjs",ver:"1.15.5"};e.url=a.url;e.user=c;e.type="bug";e.data=d;t("http://www.pcjs.org/api/v1/report",!0,e)}}
|
||||
function dk(a,b,c){var d,e="none",f=new H(a,"1.15.5"),l=new H(a,"1.15.5","validate"),k=ia();l.set("timestamp",k);f.set("timestamp",k);f.set("version","1.15.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.ia&&a.ia.Jb&&(c&&db(a.ia),d=a.ia.Jb(b,c),"object"===typeof d&&f.set(a.ia.id,d),c&&(a.ia.zb=!1,!1===d&&(e=null)));for(var k=za(a.id),m=0;m<k.length;m++){var n=k[m];n.zb&&(n.Jb&&(d=n.Jb(b,c),"object"===typeof d&&f.set(n.id,d)),c&&(n.zb=!1,!1===
|
||||
d&&(e=null)))}e&&(c?(k=d=!1,b?(a.wc&&ek(a,a.wc,f.toString()),Vj(l)&&Vj(f)||(e=null,d=k=!0)):a.kc&&(d=!0,k=3==a.kc),d&&f.clear(k)):e=f.toString());c&&(a.zb=!1);return e}g.reset=function(){this.ma&&this.ma.reset&&this.ma.reset();for(var a=za(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ma&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=za(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
||||
g.stop=function(a,b){for(var c=za(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};g.ub=function(a,b,c,d){var e=this;switch(c){case "save":return this.oa[c]=d,d.onclick=function(){var a=Yj(e,!0);if(a){var b=!(!e.kc||e.Kg),c=dk(e,b);b?ek(e,a,c):e.xa("Resume disabled, machine state not saved")}},!0;case "reset":return this.oa[c]=d,d.onclick=function(){eb(e)},!0}return!1};
|
||||
function dk(a,b,c){var d,e="none",f=new H(a,"1.15.5"),l=new H(a,"1.15.5","validate"),k=ia();l.set("timestamp",k);f.set("timestamp",k);f.set("version","1.15.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.ia&&a.ia.Kb&&(c&&db(a.ia),d=a.ia.Kb(b,c),"object"===typeof d&&f.set(a.ia.id,d),c&&(a.ia.Ab=!1,!1===d&&(e=null)));for(var k=za(a.id),m=0;m<k.length;m++){var n=k[m];n.Ab&&(n.Kb&&(d=n.Kb(b,c),"object"===typeof d&&f.set(n.id,d)),c&&(n.Ab=!1,!1===
|
||||
d&&(e=null)))}e&&(c?(k=d=!1,b?(a.wc&&ek(a,a.wc,f.toString()),Vj(l)&&Vj(f)||(e=null,d=k=!0)):a.kc&&(d=!0,k=3==a.kc),d&&f.clear(k)):e=f.toString());c&&(a.Ab=!1);return e}g.reset=function(){this.ma&&this.ma.reset&&this.ma.reset();for(var a=za(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ma&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=za(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
||||
g.stop=function(a,b){for(var c=za(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};g.vb=function(a,b,c,d){var e=this;switch(c){case "save":return this.oa[c]=d,d.onclick=function(){var a=Yj(e,!0);if(a){var b=!(!e.kc||e.Mg),c=dk(e,b);b?ek(e,a,c):e.xa("Resume disabled, machine state not saved")}},!0;case "reset":return this.oa[c]=d,d.onclick=function(){eb(e)},!0}return!1};
|
||||
function Yj(a,b){var c=a.wc;if(!c){var d;if(window)try{d=window.localStorage.getItem("user")}catch(e){}c=d;void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("To save machine states on the pcjs.org server, you need a user ID (email Jeff@pcjs.org).\n\nOnce you have an ID, enter it below.","")),c&&((c=fk(a,c))||a.xa("Your user ID has not been approved."))):b&&a.xa("Browser local storage is not available")}return c}
|
||||
function fk(a,b){a.wc=null;var c=t(ka()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(ma(c.data),a.wc=c.data)}catch(e){u(e.message+" ("+d+")")}return a.wc}
|
||||
function ek(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Qj(a,"1.15.5");d.data=c;b=t(ka()+"/api/v1/user",!1,d);d=b[1];if(b[0]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[0]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.xa("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.xa(c),ma(""),a.wc=null)}}
|
||||
function eb(a){if(a.kc&&!a.Kg){var b=1==a.kc||!la("Click OK to reset the PCjs machine state.\n(WARNING: All disk changes will be discarded)");dk(a,b,!0);!b&&a.Qk?window&&window.location.reload():(b||(a.wh=!0),a.Dg(Xj),a.wh=!1)}else a.reset(),a.ia&&cb(a.ia)}function D(a,b,c){a=za(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}
|
||||
v(function(){for(var a=C(window.document,"pcjs-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=C(c,"pcjs","computer"),e=0;e<c.length;e++){var f=c[e],l=A(f),l=new Wj(l,d,!0);B(l,f);Zj(l,l.Dg)}});oa.show.push(function(){for(var a=C(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ba("Computer",c.id))&&c.mj&&!c.zb&&c.Dg(-1)}});
|
||||
oa.exit.push(function(){for(var a=C(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ba("Computer",c.id))&&c.zb&&dk(c,!(!c.kc||c.Kg),!0)}});function gk(a,b,c,d){var e=t(a);if(e[0])throw Error(e[1]);return hk(e[1],a,b,c,d)}
|
||||
function eb(a){if(a.kc&&!a.Mg){var b=1==a.kc||!la("Click OK to reset the PCjs machine state.\n(WARNING: All disk changes will be discarded)");dk(a,b,!0);!b&&a.Tk?window&&window.location.reload():(b||(a.yh=!0),a.Fg(Xj),a.yh=!1)}else a.reset(),a.ia&&cb(a.ia)}function D(a,b,c){a=za(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}
|
||||
v(function(){for(var a=C(window.document,"pcjs-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=C(c,"pcjs","computer"),e=0;e<c.length;e++){var f=c[e],l=A(f),l=new Wj(l,d,!0);B(l,f);Zj(l,l.Fg)}});oa.show.push(function(){for(var a=C(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ba("Computer",c.id))&&c.pj&&!c.Ab&&c.Fg(-1)}});
|
||||
oa.exit.push(function(){for(var a=C(window.document,"pcjs","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ba("Computer",c.id))&&c.Ab&&dk(c,!(!c.kc||c.Mg),!0)}});function gk(a,b,c,d){var e=t(a);if(e[0])throw Error(e[1]);return hk(e[1],a,b,c,d)}
|
||||
function hk(a,b,c,d,e){var f=null;if(a){if(e)for(var l=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g;f=l.exec(a);){var k=f[2],m=t(k),n=m[1];if(m[0]||!n)throw c="unable to resolve XML reference: "+f[0]+" ("+m[0]+")",Error(c);if(m=f[3]){var q=n.match(new RegExp("<"+f[1]+"[^>]*>"));if(q){for(var k=q[0],s,r=/( [a-z]+=)(['"])(.*?)\2/g;s=r.exec(m);)k=0>k.indexOf(s[1])?k.replace(">",s[0]+">"):k.replace(new RegExp(s[1]+"(['\"])(.*?)\\1"),s[0]);q[0]!=k&&(n=n.replace(q[0],k))}else throw c="missing <"+f[1]+"> in "+k,Error(c);
|
||||
}n=n.replace(/<\?xml[^>]*>[\r\n]*/,"");a=a.replace(f[0],n);l.lastIndex=0}c&&(b&&0>b.indexOf("/")&&(b=window.location.pathname+b),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" state=$2"+d+"$2":"")+(b?" url=$2"+b+"$2":"")));if(0===a.indexOf("<"))window.ActiveXObject||"ActiveXObject"in window?(e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*\]>\s*/g,"")),f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml");else throw Error("unrecognized XML: "+
|
||||
(255<a.length?a.substr(0,255)+"...":a));}return[a,f]}
|
||||
|
|
|
|||
Loading…
Reference in a new issue