Starting work on disambiguating PCjs the emulator from PCjs the project/website; the emulator will become PCx86

This commit is contained in:
Jeff Parsons 2016-05-16 20:53:57 -07:00
commit 288f28055d
1519 changed files with 16242 additions and 6939 deletions

View file

@ -12,7 +12,7 @@ It is our *private* counterpart to the **node_modules** folder, where all *publi
The project includes these emulation modules:
* [PCjs](pcjs/), the x86-based PC emulation module
* [PCx86](pcx86/), the x86-based PC emulation module
* [PC8080](pc8080/), the 8080-based machine emulation module
* [C1Pjs](c1pjs/), the 6502-based Challenger 1P emulation module

View file

@ -35,7 +35,17 @@
/**
* @define {string}
*/
var C1PJSCLASS = "c1pjs"; // this @define is the default application class (formerly APPCLASS) to use for C1Pjs
var APPCLASS = "c1pjs"; // this @define is the default application class (eg, "pcx86", "c1pjs")
/**
* @define {string}
*/
var APPNAME = "C1Pjs"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
/**
* @define {string}
*/
var C1PJSCLASS = "c1pjs"; // this @define is the default application class (formerly APPCLASS) to use for C1Pjs; TODO: Remove
/**
* @define {boolean}
@ -50,4 +60,4 @@ var C1PJSCLASS = "c1pjs"; // this @define is the default application class
* I would like to skip loading debugger.js altogether. When doing that, we must ALSO arrange for an additional file
* (nodebugger.js) to be loaded immediately after this file, which *explicitly* overrides DEBUGGER with *false*.
*/
var DEBUGGER = true; // this @define is overridden by the Closure Compiler to remove Debugger-related support
var DEBUGGER = true; // this @define is overridden by the Closure Compiler to remove Debugger-related support

View file

@ -50,7 +50,7 @@ if (typeof module != "undefined") { // we can't simply test for NODE, since
var web = require("../../shared/lib/weblib");
var DiskAPI = require("../../shared/lib/diskapi");
var DumpAPI = require("../../shared/lib/dumpapi");
var X86 = require("../../pcjs/lib/x86");
var X86 = require("../../pcx86/lib/x86");
/**
* @class exports
* @property {string} name
@ -566,9 +566,9 @@ DiskDump.asTextFileExts = [".MD", ".ME", ".ASM", ".BAS", ".TXT", ".XML"];
*
* Examples
* ---
* node modules/diskdump/bin/diskdump --disk=../jsmachines/disks/pc/games/infocom/zork1/zork1.dsk
* node modules/diskdump/bin/diskdump --dir=./apps/pc/1981/visicalc/ --format=img --output=./apps/pc/1981/visicalc/disk.img
* node modules/diskdump/bin/diskdump --path=./apps/pc/1981/visicalc/bin/vc.com;../README.md --format=json --output=./apps/pc/1981/visicalc/disk.json
* node modules/diskdump/bin/diskdump --disk=../jsmachines/disks/pcx86/games/infocom/zork1/zork1.dsk
* node modules/diskdump/bin/diskdump --dir=./apps/pcx86/1981/visicalc/ --format=img --output=./apps/pcx86/1981/visicalc/disk.img
* node modules/diskdump/bin/diskdump --path=./apps/pcx86/1981/visicalc/bin/vc.com;../README.md --format=json --output=./apps/pcx86/1981/visicalc/disk.json
*/
DiskDump.CLI = function()
{
@ -866,7 +866,7 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
if (i > 0) sPrefix = ' prefix="' + sTitle.substr(0, i) + '"';
}
sXML = '<?xml version="1.0" encoding="UTF-8"?>\n';
sXML += '<?xml-stylesheet type="text/xsl" href="/versions/pcjs/' + pkg.version + '/manifest.xsl"?>\n';
sXML += '<?xml-stylesheet type="text/xsl" href="/versions/pcx86/' + pkg.version + '/manifest.xsl"?>\n';
sXML += '<manifest type="software">\n';
sXML += '\t<title' + sPrefix + '>' + sTitle + '</title>\n';
sXML += '</manifest>';

View file

@ -54,7 +54,7 @@ var usr = require("../../shared/lib/usrlib");
* @property {Array.<string>} c1pCSSFiles
* @property {Array.<string>} c1pJSFiles
* @property {Array.<string>} pcCSSFiles
* @property {Array.<string>} pcJSFiles
* @property {Array.<string>} pcX86Files
* @property {Array.<string>} pc8080Files
*/
var pkg = require("../../../package.json");
@ -153,7 +153,7 @@ var sMachineXMLFile = "machine.xml";
var sManifestXMLFile = "manifest.xml";
/*
* We need lists of the uncompiled scripts for C1Pjs and PCjs, indexed by machine class, so that if we have
* We need lists of the uncompiled scripts for C1Pjs and PCx86, indexed by machine class, so that if we have
* to inject those individual scripts into the current document, all the ordering dependencies will be honored
* (which is why processMachines() can't simply enumerate all the .js files in the respective script folder).
*
@ -166,7 +166,7 @@ var sManifestXMLFile = "manifest.xml";
*/
var aMachineFiles = {
'c1p': pkg.c1pCSSFiles.concat(pkg.c1pJSFiles),
'pc': pkg.pcCSSFiles.concat(pkg.pcJSFiles),
'pcx86': pkg.pcCSSFiles.concat(pkg.pcX86Files),
'pc8080': pkg.pcCSSFiles.concat(pkg.pc8080Files)
};
var aMachineFileTypes = {
@ -546,7 +546,7 @@ HTMLOut.filter = function(req, res, next)
}
/*
* Next, check for API requests (eg, "/api/v1/dump?disk=/disks/pc/dos/ibm/2.00/PCDOS200-DISK1.json&format=img")
* Next, check for API requests (eg, "/api/v1/dump?disk=/disks/pcx86/dos/ibm/2.00/PCDOS200-DISK1.json&format=img")
*
* We perform this before the trailing-slash-redirect check below, because we don't require our API endpoints to
* have a trailing slash.
@ -565,7 +565,7 @@ HTMLOut.filter = function(req, res, next)
* crack at the URL and redirect with a trailing slash as appropriate.
*
* This isn't just a cosmetic issue, because without "strict routing" and the "express-slash" module,
* URLs like "http://localhost:8088/devices/pc/machine/5150/mda/64kb/debugger" will cause problems for
* URLs like "http://localhost:8088/devices/pcx86/machine/5150/mda/64kb/debugger" will cause problems for
* client-side JavaScript when it tries to do an XMLHttpRequest with a relative filename (eg, "machine.xml");
* that request will fetch the "machine.xml" in the parent directory instead of the "debugger" directory.
*
@ -793,7 +793,7 @@ HTMLOut.prototype.setData = function(err, sData, sFile, fTemplate)
* We cheat slightly and insert one of those tokens right now, because otherwise
* the template file itself would not render correctly in your web browser.
*/
this.sTemplate = sData.replace("/modules/shared/templates/common.css", "/versions/pcjs/<!-- pcjs:version -->/common.css");
this.sTemplate = sData.replace("/modules/shared/templates/common.css", "/versions/pcx86/<!-- pcjs:version -->/common.css");
this.sHTML = this.sTemplate;
/*
@ -967,7 +967,7 @@ HTMLOut.prototype.getVersion = function(sToken, sIndent, aParms)
* Use the same test that processMachines() uses for setting fCompiled: if we're not using compiled code,
* then we should be using "current" CSS and template files (as opposed to version-specific template files).
*
* NOTE: I used to create a symlink in each app's "versions" directory (eg, /versions/pcjs/current ->
* NOTE: I used to create a symlink in each app's "versions" directory (eg, /versions/pcx86/current ->
* ../../modules/shared/templates), so that when fDebug was true, I could simply insert "current" in
* place of a version number. However, that symlink didn't get added to the repository, and I'm not sure
* all operating systems would deal with it properly even if was added, so now I'm treating the "version"
@ -1330,7 +1330,7 @@ HTMLOut.prototype.getBlog = function(sToken, sIndent, aParms)
*
* getBlog() gets first crack; if we're in a blog folder, it will display the appropriate blog entries.
* If getBlog() declines the request, we move on to getManifestXML(), because we have some folders where
* there's BOTH a manifest and a README, such as /apps/pc/1981/visicalc, and we want the manifest to take
* there's BOTH a manifest and a README, such as /apps/pcx86/1981/visicalc, and we want the manifest to take
* priority. getManifestXML() will, in turn, pass the request on to getMarkdownFile(), which will, in turn,
* pass the request on to getMachineXML().
*
@ -1427,11 +1427,11 @@ HTMLOut.prototype.getMachineXML = function(sToken, sIndent, aParms, sXMLFile, sS
if (aMatch) {
var sStyleSheet = aMatch[1];
/*
* Recognized machine stylesheets are either "production" stylesheets in ("/versions/pcjs"|"/versions/c1pjs")
* or "development" stylesheets in ("/modules/pcjs/templates"|"/modules/c1pjs/templates").
* Recognized machine stylesheets are either "production" stylesheets in ("/versions/pcx86"|"/versions/c1pjs")
* or "development" stylesheets in ("/modules/pcx86/templates"|"/modules/c1pjs/templates").
*
* The common denominator in both sets is either "/pc" or "/c1p", which in turn indicates the class of machine
* (ie, "PCjs" or "C1Pjs").
* (ie, "PCx86" or "C1Pjs").
*/
aMatch = sStyleSheet.match(/\/(pc|c1p)([^/]*)/);
if (aMatch) {
@ -1442,7 +1442,7 @@ HTMLOut.prototype.getMachineXML = function(sToken, sIndent, aParms, sXMLFile, sS
*
* The string we initialize the MarkOut object should look like one of
*
* '[Embedded PC](machine.xml "PCjs:machineID:stylesheet:version:options:state")'
* '[Embedded PC](machine.xml "PCx86:machineID:stylesheet:version:options:state")'
* '[Embedded C1P](machine.xml "C1Pjs:machineID:stylesheet:version:options:state")'
*
* where machineID is the machine "id" embedded in the XML, stylesheet is the path to the XML stylesheet,
@ -1450,7 +1450,7 @@ HTMLOut.prototype.getMachineXML = function(sToken, sIndent, aParms, sXMLFile, sS
* options is a comma-delimited series of, well, options; the only option we currently output is "debugger"
* if a <debugger> element is present in the machine XML.
*/
var sMachineID = "machine" + sMachineClass; // fallback to either "machinePCjs" or "machineC1Pjs" if no ID found
var sMachineID = "machine" + sMachineClass; // fallback to either "machinePCx86" or "machineC1Pjs" if no ID found
aMatch = sXML.match(/<machine.*?\sid=(['"])(.*?)\1[^>]*>/);
if (aMatch) sMachineID = aMatch[2];
@ -1494,7 +1494,7 @@ HTMLOut.prototype.getMachineXML = function(sToken, sIndent, aParms, sXMLFile, sS
*
* But, instead of displaying a cryptic error message inside our beautiful HTML template, eg:
*
* HTMLOut error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pc/machine/5160/cga/256kb/win101/debugger/machine.xml'
* HTMLOut error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pcx86/machine/5160/cga/256kb/win101/debugger/machine.xml'
*
* we have one more fallback: a random string! Less useful, but more entertaining. Well, maybe not even that.
*
@ -1719,7 +1719,7 @@ HTMLOut.prototype.getMarkdownFile = function(sFile, sToken, sIndent, aParms, sPr
/*
* Instead of displaying a cryptic error message inside our beautiful HTML template, eg:
*
* HTMLOut error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pc/machine/5160/cga/256kb/win101/debugger/README.md'
* HTMLOut error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pcx86/machine/5160/cga/256kb/win101/debugger/README.md'
*
* which is all this will give us:
*

View file

@ -93,35 +93,35 @@ var logFile = null;
var aExternalRedirects = {
"/c1p": "/docs/c1pjs/",
"/c1pjs": "/docs/c1pjs/",
"/pc": "/docs/about/pcjs/",
"/pcjs": "/docs/about/pcjs/",
"/pc": "/docs/about/pcx86/",
"/pcjs": "/docs/about/pcx86/",
"/configs/c1p/embed": "/docs/c1pjs/embed/",
"/configs/c1p/machines/array": "/devices/c1p/machine/8kb/array/",
"/configs/c1p/machines/array.xml": "/devices/c1p/machine/8kb/array/",
"/configs/c1p/machines/machine.xml": "/devices/c1p/machine/8kb/large/",
"/configs/pc/disks": "/disks/pc/",
"/configs/pc/machines/5150/mda/demo/pc-mda-64k.xml": "/devices/pc/machine/5150/mda/64kb/",
"/configs/pc/machines/5150/cga/donkey/pc-cga-64k.xml": "/devices/pc/machine/5150/cga/64kb/donkey/",
"/configs/pc/machines/5150/cga/donkey/pc-dbg-64k.xml": "/devices/pc/machine/5150/cga/64kb/donkey/debugger/",
"/configs/pc/machines/5160/cga/demo": "/devices/pc/machine/5160/cga/256kb/demo/",
"/configs/pc/machines/5160/cga/demo/xt-cga-256k.xml": "/devices/pc/machine/5160/cga/256kb/demo/",
"/configs/pc/machines/5160/cga/demo/xt-dbg-256k.xml": "/devices/pc/machine/5160/cga/256kb/demo/debugger/",
"/configs/pc/machines/5160/cga/win101/xt-cga-win101.xml": "/devices/pc/machine/5160/cga/256kb/win101/",
"/configs/pc/machines/5160/cga/machine-512k-win101.xml": "/devices/pc/machine/5160/cga/512kb/win101/softkbd/",
"/configs/pc/disks": "/disks/pcx86/",
"/configs/pc/machines/5150/mda/demo/pc-mda-64k.xml": "/devices/pcx86/machine/5150/mda/64kb/",
"/configs/pc/machines/5150/cga/donkey/pc-cga-64k.xml": "/devices/pcx86/machine/5150/cga/64kb/donkey/",
"/configs/pc/machines/5150/cga/donkey/pc-dbg-64k.xml": "/devices/pcx86/machine/5150/cga/64kb/donkey/debugger/",
"/configs/pc/machines/5160/cga/demo": "/devices/pcx86/machine/5160/cga/256kb/demo/",
"/configs/pc/machines/5160/cga/demo/xt-cga-256k.xml": "/devices/pcx86/machine/5160/cga/256kb/demo/",
"/configs/pc/machines/5160/cga/demo/xt-dbg-256k.xml": "/devices/pcx86/machine/5160/cga/256kb/demo/debugger/",
"/configs/pc/machines/5160/cga/win101/xt-cga-win101.xml": "/devices/pcx86/machine/5160/cga/256kb/win101/",
"/configs/pc/machines/5160/cga/machine-512k-win101.xml": "/devices/pcx86/machine/5160/cga/512kb/win101/softkbd/",
"/demos/c1p/embed.html": "/docs/c1pjs/embed/",
"/demos/c1p/embed.xml": "/devices/c1p/machine/8kb/embed/machine.xml",
"/demos/pc/cga": "/devices/pc/machine/5150/cga/",
"/demos/pc/donkey/pc-cga-64k.xml": "/devices/pc/machine/5150/cga/64kb/donkey/",
"/demos/pc/cga-win101": "/devices/pc/machine/5160/cga/256kb/win101/",
"/demos/pc/cga-win101/xt-cga-win101.xml": "/devices/pc/machine/5160/cga/256kb/win101/",
"/demos/pc/cga": "/devices/pcx86/machine/5150/cga/",
"/demos/pc/donkey/pc-cga-64k.xml": "/devices/pcx86/machine/5150/cga/64kb/donkey/",
"/demos/pc/cga-win101": "/devices/pcx86/machine/5160/cga/256kb/win101/",
"/demos/pc/cga-win101/xt-cga-win101.xml": "/devices/pcx86/machine/5160/cga/256kb/win101/",
"/devices/c1p/array.xml": "/devices/c1p/machine/8kb/array/",
"/devices/pc/5160/cga/machine-dos400m.xml": "/devices/pc/machine/5160/cga/640kb/dos400m/",
"/videos/pcjs": "/devices/pc/machine/5160/cga/640kb/dos400m/"
"/devices/pc/5160/cga/machine-dos400m.xml": "/devices/pcx86/machine/5160/cga/640kb/dos400m/",
"/videos/pcjs": "/devices/pcx86/machine/5160/cga/640kb/dos400m/"
};
var aExternalRedirectPatterns = {
"^/configs/c1p/machines/?(.*)": "/devices/c1p/machine/$1",
"^/configs/pc/machines/?(.*)": "/devices/pc/machine/$1"
"^/configs/pc/machines/?(.*)": "/devices/pcx86/machine/$1"
};
/*
@ -133,8 +133,8 @@ var aExternalRedirectPatterns = {
* Feel free to use subgroups on the left-hand side, and references to them (eg, $1, $2, etc) on the right.
*/
var aInternalRedirectPatterns = {
// "^/apps/pc/visicalc/": "/apps/pc/1981/visicalc/",
// "^/demos/pc/.*": "/devices/pc/machine/"
// "^/apps/pc/visicalc/": "/apps/pcx86/1981/visicalc/",
// "^/demos/pc/.*": "/devices/pcx86/machine/"
};
/**
@ -253,7 +253,7 @@ HTTPAPI.filterAPI = function(req, res, next)
* If we're still here, the API request didn't pass muster.
*
* TODO: Consider providing some simple usage info, and changing the nResponse to 200,
* since the API endpoints will eventually be documented in /docs/pcjs/.
* since the API endpoints will eventually be documented in /docs/pcx86/.
*/
var nResponse = 400; // default to "Bad Request"
var sResponse = "unrecognized API request: " + asURL[0] + "\n";

View file

@ -232,7 +232,7 @@ MarkOut.setOptions = function(options)
* The infoMachine object should contain, at a minimum:
*
* {
* 'class': sMachineClass, // eg, "pc"
* 'class': sMachineClass, // eg, "pcx86"
* 'func': sMachineFunc,
* 'id': sMachineID,
* 'xml': sMachineXMLFile,
@ -343,8 +343,8 @@ MarkOut.aHTMLEntities = {
* 'config' (eg, "machine.xml")
* 'template' (eg, "machine.xsl")
* 'uncompiled' (eg, true)
* 'autoMount' (eg, {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pc/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}})
* 'drives' (eg, [{name:"68Mb Hard Drive",type:4,path:"http://archive.pcjs.org/disks/pc/fixed/68mb/win95.json"}])
* 'autoMount' (eg, {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pcx86/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}})
* 'drives' (eg, [{name:"68Mb Hard Drive",type:4,path:"http://archive.pcjs.org/disks/pcx86/fixed/68mb/win95.json"}])
* 'parms'
*
* Non-reserved properties include:
@ -463,7 +463,7 @@ MarkOut.prototype.convertMD = function(sIndent)
*
* Here's an example of "autoMount" output:
*
* {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pc/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}}
* {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pcx86/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}}
*
* Note that the the only required property for a drive object is 'path'; if 'name' is omitted,
* the FDC component will search for the given 'path' and use whatever name it can find.
@ -1093,23 +1093,23 @@ MarkOut.prototype.convertMDImageLinks = function(sBlock, sIndent)
* Before we call convertMDLinks() to process any normal Markdown-style links, we first look for our own
* special flavor of "machine" Markdown links; ie:
*
* [IBM PC](/devices/pc/machine/5150/mda/64kb/ "PCjs:demoPC:stylesheet:version:options:parms")
* [IBM PC](/devices/pcx86/machine/5150/mda/64kb/ "PCx86:demoPC:stylesheet:version:options:parms")
*
* where a special title attribute triggers generation of an embedded machine rather than a link.
*
* Use "PCjs" or "C1Pjs" to automatically include the latest version of either "pc.js" or "c1p.js", followed
* Use "PCx86" or "C1Pjs" to automatically include the latest version of either "pcx86.js" or "c1p.js", followed
* by a colon and the ID you want to use for the embedded <div>. If you need to use the script with the built-in
* Debugger (ie, either "pc-dbg.js" or "c1p-dbg.js"), then include "debugger" in the list of comma-delimited
* options, as in:
*
* [IBM PC](/devices/pc/machine/5150/mda/64kb/ "PCjs:demoPC:::debugger")
* [IBM PC](/devices/pcx86/machine/5150/mda/64kb/ "PCx86:demoPC:::debugger")
*
* If the link ends with a slash, then it's an implied reference to a "machine.xml".
*
* UPDATE: Since parms containing JSON may also contain colons, machine Markdown links may now use '!' or '|'
* instead of ':' as separators. In fact, whichever separator is used first will be used throughout; eg:
*
* [IBM PC](/devices/pc/machine/5150/mda/64kb/ "PCjs!demoPC!stylesheet!version!options!parms")
* [IBM PC](/devices/pcx86/machine/5150/mda/64kb/ "PCx86!demoPC!stylesheet!version!options!parms")
*
* Granted, there are a number of things we could be smarter about. First, you probably don't care about the
* ID for the <div>; it's purely a mechanism for telling the script where to embed the machine, so we could
@ -1149,7 +1149,7 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
sMachineID = aMatch[2];
if (this.aMachineDefs[sMachineID]) {
var machine = this.aMachineDefs[sMachineID];
sMachine = machine['type'] || "pc";
sMachine = machine['type'] || "pcx86";
sMachineOptions = ((sMachine.indexOf("-dbg") > 0 || machine['debugger'] == "true")? "debugger" : "");
sMachine = sMachine.replace("-dbg", "").toUpperCase();
sMachineXMLFile = machine['config'] || this.sMachineFile || "machine.xml";

View file

@ -1506,14 +1506,14 @@ Computer.init = function()
*/
if (!COMPILED && XMLVERSION) Computer.APPVERSION = XMLVERSION;
var aeMachines = Component.getElementsByClass(document, PCJSCLASS + "-machine");
var aeMachines = Component.getElementsByClass(document, APPCLASS + "-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");
var aeComputers = Component.getElementsByClass(eMachine, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
@ -1535,7 +1535,7 @@ Computer.init = function()
* but "reset" now provides a way to force the machine to start from scratch again, so "erase"
* may be redundant now.
*/
Component.bindComponentControls(computer, eComputer, PCJSCLASS);
Component.bindComponentControls(computer, eComputer, APPCLASS);
/*
* Power on the computer, giving every component the opportunity to reset or restore itself.
@ -1556,7 +1556,7 @@ Computer.init = function()
*/
Computer.show = function()
{
var aeComputers = Component.getElementsByClass(document, PCJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);
@ -1605,7 +1605,7 @@ Computer.show = function()
*/
Computer.exit = function()
{
var aeComputers = Component.getElementsByClass(document, PCJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);

View file

@ -1417,12 +1417,12 @@ CPUState.prototype.stepCPU = function(nMinCycles)
*/
CPUState.init = function()
{
var aeCPUs = Component.getElementsByClass(document, PCJSCLASS, "cpu");
var aeCPUs = Component.getElementsByClass(document, APPCLASS, "cpu");
for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new CPUState(parmsCPU);
Component.bindComponentControls(cpu, eCPU, PCJSCLASS);
Component.bindComponentControls(cpu, eCPU, APPCLASS);
}
};

View file

@ -4776,12 +4776,12 @@ if (DEBUGGER) {
*/
Debugger.init = function()
{
var aeDbg = Component.getElementsByClass(document, PCJSCLASS, "debugger");
var aeDbg = Component.getElementsByClass(document, APPCLASS, "debugger");
for (var iDbg = 0; iDbg < aeDbg.length; iDbg++) {
var eDbg = aeDbg[iDbg];
var parmsDbg = Component.getComponentParms(eDbg);
var dbg = new Debugger(parmsDbg);
Component.bindComponentControls(dbg, eDbg, PCJSCLASS);
Component.bindComponentControls(dbg, eDbg, APPCLASS);
}
};

View file

@ -35,7 +35,7 @@
/**
* @define {string}
*/
var PCJSCLASS = "pc8080"; // this @define is the default application class (formerly APPCLASS) to use
var APPCLASS = "pc8080"; // this @define is the default application class (formerly APPCLASS) to use
/**
* @define {boolean}
@ -71,7 +71,7 @@ var BYTEARRAYS = false;
var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined');
if (NODE) {
global.PCJSCLASS = PCJSCLASS;
global.APPCLASS = APPCLASS;
global.DEBUGGER = DEBUGGER;
global.BYTEARRAYS = BYTEARRAYS;
global.TYPEDARRAYS = TYPEDARRAYS;

View file

@ -220,12 +220,12 @@ Keyboard.STUPID_KEYCODES[Keyboard.KEYCODE.FF_DASH] = Keyboard.ASCII['-'];
*/
Keyboard.init = function()
{
var aeKbd = Component.getElementsByClass(document, PCJSCLASS, "keyboard");
var aeKbd = Component.getElementsByClass(document, APPCLASS, "keyboard");
for (var iKbd = 0; iKbd < aeKbd.length; iKbd++) {
var eKbd = aeKbd[iKbd];
var parmsKbd = Component.getComponentParms(eKbd);
var kbd = new Keyboard(parmsKbd);
Component.bindComponentControls(kbd, eKbd, PCJSCLASS);
Component.bindComponentControls(kbd, eKbd, APPCLASS);
}
};

View file

@ -163,7 +163,7 @@ Panel.prototype.updateStatus = function(fForce)
Panel.init = function()
{
var fReady = false;
var aePanels = Component.getElementsByClass(document, PCJSCLASS, "panel");
var aePanels = Component.getElementsByClass(document, APPCLASS, "panel");
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
var ePanel = aePanels[iPanel];
var parmsPanel = Component.getComponentParms(ePanel);
@ -172,7 +172,7 @@ Panel.init = function()
fReady = true;
panel = new Panel(parmsPanel);
}
Component.bindComponentControls(panel, ePanel, PCJSCLASS);
Component.bindComponentControls(panel, ePanel, APPCLASS);
if (fReady) panel.setReady();
}
};

View file

@ -180,12 +180,12 @@ RAM.prototype.restore = function(data)
*/
RAM.init = function()
{
var aeRAM = Component.getElementsByClass(document, PCJSCLASS, "ram");
var aeRAM = Component.getElementsByClass(document, APPCLASS, "ram");
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new RAM(parmsRAM);
Component.bindComponentControls(ram, eRAM, PCJSCLASS);
Component.bindComponentControls(ram, eRAM, APPCLASS);
}
};

View file

@ -371,12 +371,12 @@ ROM.prototype.cloneROM = function(addr)
*/
ROM.init = function()
{
var aeROM = Component.getElementsByClass(document, PCJSCLASS, "rom");
var aeROM = Component.getElementsByClass(document, APPCLASS, "rom");
for (var iROM = 0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new ROM(parmsROM);
Component.bindComponentControls(rom, eROM, PCJSCLASS);
Component.bindComponentControls(rom, eROM, APPCLASS);
}
};

View file

@ -583,7 +583,7 @@ Video.prototype.updateScreen = function(n)
*/
Video.init = function()
{
var aeVideo = Component.getElementsByClass(document, PCJSCLASS, "video");
var aeVideo = Component.getElementsByClass(document, APPCLASS, "video");
for (var iVideo = 0; iVideo < aeVideo.length; iVideo++) {
var eVideo = aeVideo[iVideo];
var parmsVideo = Component.getComponentParms(eVideo);
@ -707,7 +707,7 @@ Video.init = function()
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
* even the "Refresh" button is just a diagnostic tool, to ensure that the screen contents are up-to-date.
*/
Component.bindComponentControls(video, eVideo, PCJSCLASS);
Component.bindComponentControls(video, eVideo, APPCLASS);
}
};

View file

@ -9,7 +9,7 @@ permalink: /modules/pc8080/
Overview
---
PC8080 is our 8080-based machine emulation module. The code is derived from [PCjs](/modules/pcjs/).
PC8080 is our 8080-based machine emulation module. The code is derived from [PCx86](/modules/pcx86/).
It is still a work-in-progress. See the list of available [PC8080 Machines](/devices/pc8080/machine/), including
[Space Invaders (1978)](/devices/pc8080/machine/invaders/).

View file

@ -890,7 +890,7 @@ Bus.prototype.checkPortInputNotify = function(port, size, addrIP)
* @param {number} end address
*
Bus.prototype.removePortInputNotify = function(start, end)
{
{
for (var port = start; port < end; port++) {
if (this.aPortInputNotify[port]) {
delete this.aPortInputNotify[port];
@ -1036,7 +1036,7 @@ Bus.prototype.checkPortOutputNotify = function(port, size, data, addrIP)
* @param {number} end address
*
Bus.prototype.removePortOutputNotify = function(start, end)
{
{
for (var port = start; port < end; port++) {
if (this.aPortOutputNotify[port]) {
delete this.aPortOutputNotify[port];

View file

@ -551,12 +551,12 @@ ChipSet.aPortOutput = {
*/
ChipSet.init = function()
{
var aeChipSet = Component.getElementsByClass(document, PCJSCLASS, "chipset");
var aeChipSet = Component.getElementsByClass(document, APPCLASS, "chipset");
for (var iChip = 0; iChip < aeChipSet.length; iChip++) {
var eChipSet = aeChipSet[iChip];
var parmsChipSet = Component.getComponentParms(eChipSet);
var chipset = new ChipSet(parmsChipSet);
Component.bindComponentControls(chipset, eChipSet, PCJSCLASS);
Component.bindComponentControls(chipset, eChipSet, APPCLASS);
}
};

View file

@ -1505,14 +1505,14 @@ Computer.init = function()
*/
if (!COMPILED && XMLVERSION) Computer.APPVERSION = XMLVERSION;
var aeMachines = Component.getElementsByClass(document, PCJSCLASS + "-machine");
var aeMachines = Component.getElementsByClass(document, APPCLASS + "-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");
var aeComputers = Component.getElementsByClass(eMachine, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
@ -1534,7 +1534,7 @@ Computer.init = function()
* but "reset" now provides a way to force the machine to start from scratch again, so "erase"
* may be redundant now.
*/
Component.bindComponentControls(computer, eComputer, PCJSCLASS);
Component.bindComponentControls(computer, eComputer, APPCLASS);
/*
* Power on the computer, giving every component the opportunity to reset or restore itself.
@ -1555,7 +1555,7 @@ Computer.init = function()
*/
Computer.show = function()
{
var aeComputers = Component.getElementsByClass(document, PCJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);
@ -1604,7 +1604,7 @@ Computer.show = function()
*/
Computer.exit = function()
{
var aeComputers = Component.getElementsByClass(document, PCJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);

View file

@ -1153,12 +1153,12 @@ CPUState.prototype.stepCPU = function(nMinCycles)
*/
CPUState.init = function()
{
var aeCPUs = Component.getElementsByClass(document, PCJSCLASS, "cpu");
var aeCPUs = Component.getElementsByClass(document, APPCLASS, "cpu");
for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new CPUState(parmsCPU);
Component.bindComponentControls(cpu, eCPU, PCJSCLASS);
Component.bindComponentControls(cpu, eCPU, APPCLASS);
}
};

View file

@ -4776,12 +4776,12 @@ if (DEBUGGER) {
*/
Debugger.init = function()
{
var aeDbg = Component.getElementsByClass(document, PCJSCLASS, "debugger");
var aeDbg = Component.getElementsByClass(document, APPCLASS, "debugger");
for (var iDbg = 0; iDbg < aeDbg.length; iDbg++) {
var eDbg = aeDbg[iDbg];
var parmsDbg = Component.getComponentParms(eDbg);
var dbg = new Debugger(parmsDbg);
Component.bindComponentControls(dbg, eDbg, PCJSCLASS);
Component.bindComponentControls(dbg, eDbg, APPCLASS);
}
};

View file

@ -35,7 +35,12 @@
/**
* @define {string}
*/
var PCJSCLASS = "pc8080"; // this @define is the default application class (formerly APPCLASS) to use
var APPCLASS = "pc8080"; // this @define is the default application class (eg, "pcx86", "c1pjs")
/**
* @define {string}
*/
var APPNAME = "PC8080"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
/**
* @define {boolean}
@ -71,7 +76,8 @@ var BYTEARRAYS = false;
var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined');
if (NODE) {
global.PCJSCLASS = PCJSCLASS;
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.BYTEARRAYS = BYTEARRAYS;
global.TYPEDARRAYS = TYPEDARRAYS;

View file

@ -453,12 +453,12 @@ Keyboard.prototype.onSoftKeyDown = function(sSoftCode, fDown)
*/
Keyboard.init = function()
{
var aeKbd = Component.getElementsByClass(document, PCJSCLASS, "keyboard");
var aeKbd = Component.getElementsByClass(document, APPCLASS, "keyboard");
for (var iKbd = 0; iKbd < aeKbd.length; iKbd++) {
var eKbd = aeKbd[iKbd];
var parmsKbd = Component.getComponentParms(eKbd);
var kbd = new Keyboard(parmsKbd);
Component.bindComponentControls(kbd, eKbd, PCJSCLASS);
Component.bindComponentControls(kbd, eKbd, APPCLASS);
}
};

View file

@ -163,7 +163,7 @@ Panel.prototype.updateStatus = function(fForce)
Panel.init = function()
{
var fReady = false;
var aePanels = Component.getElementsByClass(document, PCJSCLASS, "panel");
var aePanels = Component.getElementsByClass(document, APPCLASS, "panel");
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
var ePanel = aePanels[iPanel];
var parmsPanel = Component.getComponentParms(ePanel);
@ -172,7 +172,7 @@ Panel.init = function()
fReady = true;
panel = new Panel(parmsPanel);
}
Component.bindComponentControls(panel, ePanel, PCJSCLASS);
Component.bindComponentControls(panel, ePanel, APPCLASS);
if (fReady) panel.setReady();
}
};

View file

@ -180,12 +180,12 @@ RAM.prototype.restore = function(data)
*/
RAM.init = function()
{
var aeRAM = Component.getElementsByClass(document, PCJSCLASS, "ram");
var aeRAM = Component.getElementsByClass(document, APPCLASS, "ram");
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new RAM(parmsRAM);
Component.bindComponentControls(ram, eRAM, PCJSCLASS);
Component.bindComponentControls(ram, eRAM, APPCLASS);
}
};

View file

@ -505,12 +505,12 @@ ROM.prototype.cloneROM = function(addr)
*/
ROM.init = function()
{
var aeROM = Component.getElementsByClass(document, PCJSCLASS, "rom");
var aeROM = Component.getElementsByClass(document, APPCLASS, "rom");
for (var iROM = 0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new ROM(parmsROM);
Component.bindComponentControls(rom, eROM, PCJSCLASS);
Component.bindComponentControls(rom, eROM, APPCLASS);
}
};

View file

@ -593,7 +593,7 @@ Video.prototype.updateScreen = function(n)
*/
Video.init = function()
{
var aeVideo = Component.getElementsByClass(document, PCJSCLASS, "video");
var aeVideo = Component.getElementsByClass(document, APPCLASS, "video");
for (var iVideo = 0; iVideo < aeVideo.length; iVideo++) {
var eVideo = aeVideo[iVideo];
var parmsVideo = Component.getComponentParms(eVideo);
@ -717,7 +717,7 @@ Video.init = function()
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
* even the "Refresh" button is just a diagnostic tool, to ensure that the screen contents are up-to-date.
*/
Component.bindComponentControls(video, eVideo, PCJSCLASS);
Component.bindComponentControls(video, eVideo, APPCLASS);
}
};

View file

@ -1,15 +1,17 @@
---
layout: page
title: IBM PC Emulation Module (PCjs)
permalink: /modules/pcjs/
title: IBM PC Emulation Module (PCx86)
permalink: /modules/pcx86/
redirect_from:
- /modules/pcjs/
---
IBM PC Emulation Module (PCjs)
IBM PC Emulation Module (PCx86)
===
Overview
---
The PCjs IBM PC emulation module is the engine powering all our [IBM PC Machines](/devices/pc/machine/).
PCx86, the PCjs IBM PC emulation module, is the engine powering all our [IBM PC Machines](/devices/pcx86/machine/).
This module divides PC functionality into variety of logical and visual components.
In general, each JavaScript file is responsible for a single component or set of related components (eg,
@ -19,14 +21,14 @@ controllers, etc.
*Component* is an overloaded term, since **Component** is also the name of the shared base class in
[component.js](../shared/lib/component.js) used by most machine components. A few low-level components
(eg, the **Memory** and **State** components, the Card class of the **Video** component, the Color and Rectangle
classes of the **Panel** component, etc) do not extend **Component**, so don't assume that every PCjs object has
classes of the **Panel** component, etc) do not extend **Component**, so don't assume that every PCx86 object has
access to [component.js](../shared/lib/component.js) methods.
Examples of non-device components include visual components like [panel.js](lib/panel.js) and
[debugger.js](lib/debugger.js), and sub-components like [x86ops.js](lib/x86ops.js) and [x86func.js](lib/x86func.js),
which separate the CPU functionality of [x86.js](lib/x86.js) into more manageable pieces.
These components should always be loaded or compiled in the order listed by the *pcJSFiles* property in
These components should always be loaded or compiled in the order listed by the *pcX86Files* property in
[package.json](../../package.json), which includes all the necessary *shared* components as well.
At the time of this writing, the recommended order is:
@ -39,36 +41,36 @@ At the time of this writing, the recommended order is:
* [shared/usrlib.js](../shared/lib/usrlib.js)
* [shared/weblib.js](../shared/lib/weblib.js)
* [shared/component.js](../shared/lib/component.js)
* [pcjs/defines.js](lib/defines.js)
* [pcjs/x86.js](lib/x86.js)
* [pcjs/interrupts.js](lib/interrupts.js)
* [pcjs/messages.js](lib/messages.js)
* [pcjs/panel.js](lib/panel.js)
* [pcjs/bus.js](lib/bus.js)
* [pcjs/memory.js](lib/memory.js)
* [pcjs/cpu.js](lib/cpu.js)
* [pcjs/x86seg.js](lib/x86seg.js)
* [pcjs/x86cpu.js](lib/x86cpu.js)
* [pcjs/x86fpu.js](lib/x86fpu.js)
* [pcjs/x86func.js](lib/x86func.js)
* [pcjs/x86help.js](lib/x86help.js)
* [pcjs/x86mods.js](lib/x86mods.js)
* [pcjs/x86ops.js](lib/x86ops.js)
* [pcjs/x86op0f.js](lib/x86op0f.js)
* [pcjs/chipset.js](lib/chipset.js)
* [pcjs/rom.js](lib/rom.js)
* [pcjs/ram.js](lib/ram.js)
* [pcjs/keyboard.js](lib/keyboard.js)
* [pcjs/video.js](lib/video.js)
* [pcjs/parallelport.js](lib/parallelport.js)
* [pcjs/serialport.js](lib/serialport.js)
* [pcjs/mouse.js](lib/mouse.js)
* [pcjs/disk.js](lib/disk.js)
* [pcjs/fdc.js](lib/fdc.js)
* [pcjs/hdc.js](lib/hdc.js)
* [pcjs/debugger.js](lib/debugger.js)
* [pcjs/state.js](lib/state.js)
* [pcjs/computer.js](lib/computer.js)
* [pcx86/defines.js](lib/defines.js)
* [pcx86/x86.js](lib/x86.js)
* [pcx86/interrupts.js](lib/interrupts.js)
* [pcx86/messages.js](lib/messages.js)
* [pcx86/panel.js](lib/panel.js)
* [pcx86/bus.js](lib/bus.js)
* [pcx86/memory.js](lib/memory.js)
* [pcx86/cpu.js](lib/cpu.js)
* [pcx86/x86seg.js](lib/x86seg.js)
* [pcx86/x86cpu.js](lib/x86cpu.js)
* [pcx86/x86fpu.js](lib/x86fpu.js)
* [pcx86/x86func.js](lib/x86func.js)
* [pcx86/x86help.js](lib/x86help.js)
* [pcx86/x86mods.js](lib/x86mods.js)
* [pcx86/x86ops.js](lib/x86ops.js)
* [pcx86/x86op0f.js](lib/x86op0f.js)
* [pcx86/chipset.js](lib/chipset.js)
* [pcx86/rom.js](lib/rom.js)
* [pcx86/ram.js](lib/ram.js)
* [pcx86/keyboard.js](lib/keyboard.js)
* [pcx86/video.js](lib/video.js)
* [pcx86/parallelport.js](lib/parallelport.js)
* [pcx86/serialport.js](lib/serialport.js)
* [pcx86/mouse.js](lib/mouse.js)
* [pcx86/disk.js](lib/disk.js)
* [pcx86/fdc.js](lib/fdc.js)
* [pcx86/hdc.js](lib/hdc.js)
* [pcx86/debugger.js](lib/debugger.js)
* [pcx86/state.js](lib/state.js)
* [pcx86/computer.js](lib/computer.js)
* [shared/embed.js](../shared/lib/embed.js)
* [shared/save.js](../shared/lib/save.js)

View file

@ -1,9 +1,15 @@
Running PCjs From The Command-Line
---
layout: page
title: Running PCx86 From The Command-Line
permalink: /modules/pcx86/bin/
---
Running PCx86 From The Command-Line
---
In this *bin* directory, run:
node pcjs --cmd="load ibm5150.json"
node pcx86 --cmd="load ibm5150.json"
The following output should appear:
@ -18,8 +24,8 @@ The following output should appear:
ibm5150.debugger object created
warning: Component type 'Panel' not found
ibm5150.pc-mda-64k object created
PCjs> ramLow: 64Kb allocated
PCjs v1.x.x
PCx86> ramLow: 64Kb allocated
PCx86 v1.x.x
Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Type ? for list of debugger commands
@ -35,7 +41,7 @@ Start the machine with a `g` command:
and after about 10 seconds, dump the machine's video buffer with `d b000:0`:
PCjs> d b000:0
PCx86> d b000:0
B000:0000 43 07 75 07 72 07 72 07-65 07 6E 07 74 07 20 07 C.u.r.r.e.n.t. .
B000:0010 64 07 61 07 74 07 65 07-20 07 69 07 73 07 20 07 d.a.t.e. .i.s. .
B000:0020 54 07 75 07 65 07 20 07-20 07 31 07 2D 07 30 07 T.u.e. . .1.-.0.

View file

@ -21,14 +21,14 @@
"name": "",
"addr": 0xf6000,
"size": 0x08000,
"file": "/devices/pc/rom/5150/basic/BASIC100.json",
"file": "/devices/pcx86/rom/5150/basic/BASIC100.json",
"notify": ""
},
{ "id": "romBIOS",
"name": "",
"addr": 0xfe000,
"size": 0x02000,
"file": "/devices/pc/rom/5150/1981-04-24/PCBIOS-REV1.json",
"file": "/devices/pcx86/rom/5150/1981-04-24/PCBIOS-REV1.json",
"notify": ""
}
],
@ -42,7 +42,7 @@
"scale": true,
"charCols": 80,
"charRows": 25,
"fontROM": "/devices/pc/video/ibm/mda/ibm-mda.json",
"fontROM": "/devices/pcx86/video/ibm/mda/ibm-mda.json",
"screenColor": "black",
"touchScreen": false
}
@ -69,11 +69,11 @@
"autoMount": {
"A": {
"name": "PC-DOS 2.00 (Disk 1)",
"path": "/disks/pc/dos/ibm/2.00/PCDOS200-DISK1.json"
"path": "/disks/pcx86/dos/ibm/2.00/PCDOS200-DISK1.json"
},
"B": {
"name": "PC-DOS 2.00 (Disk 2)",
"path": "/disks/pc/dos/ibm/2.00/PCDOS200-DISK2.json"
"path": "/disks/pcx86/dos/ibm/2.00/PCDOS200-DISK2.json"
}
}
},
@ -90,5 +90,5 @@
"name": "",
"messages": ""
},
"xml": "/devices/pc/machine/5150/mda/64kb/machine.xml"
"xml": "/devices/pcx86/machine/5150/mda/64kb/machine.xml"
}

View file

@ -23,7 +23,7 @@
"addr": 983296,
"size": 65276,
"alias": 4294902016,
"file": "/tests/pc/80386/test386.json",
"file": "/tests/pcx86/80386/test386.json",
"notify": ""
}
],
@ -37,7 +37,7 @@
"scale": true,
"charCols": 80,
"charRows": 25,
"fontROM": "/devices/pc/video/ibm/mda/ibm-mda.json",
"fontROM": "/devices/pcx86/video/ibm/mda/ibm-mda.json",
"screenColor": "black",
"touchScreen": false
}
@ -64,11 +64,11 @@
"autoMount": {
"A": {
"name": "PC-DOS 2.00 (Disk 1)",
"path": "/disks/pc/dos/ibm/2.00/PCDOS200-DISK1.json"
"path": "/disks/pcx86/dos/ibm/2.00/PCDOS200-DISK1.json"
},
"B": {
"name": "PC-DOS 2.00 (Disk 2)",
"path": "/disks/pc/dos/ibm/2.00/PCDOS200-DISK2.json"
"path": "/disks/pcx86/dos/ibm/2.00/PCDOS200-DISK2.json"
}
}
},

View file

@ -6,13 +6,13 @@
"sub": true,
"globalstrict": true,
"globals": {
"APPCLASS": true,
"APPNAME": false,
"APPVERSION": false,
"SITEHOST": false,
"COMPILED": true,
"DEBUG": true,
"MAXDEBUG": false,
"PCJSCLASS": true,
"DEBUGGER": true,
"PREFETCH": true,
"FATARRAYS": true,
@ -35,23 +35,14 @@
"Memory": true,
"Mouse": true,
"Panel": true,
"ParallelPort": true,
"RAM": true,
"ROM": true,
"SerialPort": true,
"Video": true,
"X86": true,
"X86Seg": true,
"X86CPU": true,
"X86Func": true,
"X86OpXX": true,
"X86Op0F": true,
"X86ModB": true,
"X86ModW": true,
"X86ModB16": true,
"X86ModW16": true,
"X86ModB32": true,
"X86ModW32": true,
"X86ModSIB": true,
"X86Seg": true,
"str": true,
"usr": true,
"web": true,

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Bus component.
* @fileoverview Implements the PCx86 Bus component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-04
@ -1022,15 +1022,15 @@ Bus.prototype.addBackTrackObject = function(obj, bto, off)
*
* Error: assertion failure in deskpro386.bus
* at Bus.Component.assert (http://pcjs:8088/modules/shared/lib/component.js:732:31)
* at Bus.addBackTrackObject (http://pcjs:8088/modules/pcjs/lib/bus.js:980:18)
* at onATCReadData (http://pcjs:8088/modules/pcjs/lib/hdc.js:1410:35)
* at HDC.readData (http://pcjs:8088/modules/pcjs/lib/hdc.js:2573:23)
* at HDC.inATCByte (http://pcjs:8088/modules/pcjs/lib/hdc.js:1398:20)
* at HDC.inATCData (http://pcjs:8088/modules/pcjs/lib/hdc.js:1487:17)
* at Bus.checkPortInputNotify (http://pcjs:8088/modules/pcjs/lib/bus.js:1457:38)
* at X86CPU.INSw (http://pcjs:8088/modules/pcjs/lib/x86ops.js:1640:26)
* at X86CPU.stepCPU (http://pcjs:8088/modules/pcjs/lib/x86cpu.js:4637:37)
* at X86CPU.CPU.runCPU (http://pcjs:8088/modules/pcjs/lib/cpu.js:1014:22)
* at Bus.addBackTrackObject (http://pcjs:8088/modules/pcx86/lib/bus.js:980:18)
* at onATCReadData (http://pcjs:8088/modules/pcx86/lib/hdc.js:1410:35)
* at HDC.readData (http://pcjs:8088/modules/pcx86/lib/hdc.js:2573:23)
* at HDC.inATCByte (http://pcjs:8088/modules/pcx86/lib/hdc.js:1398:20)
* at HDC.inATCData (http://pcjs:8088/modules/pcx86/lib/hdc.js:1487:17)
* at Bus.checkPortInputNotify (http://pcjs:8088/modules/pcx86/lib/bus.js:1457:38)
* at X86CPU.INSw (http://pcjs:8088/modules/pcx86/lib/x86ops.js:1640:26)
* at X86CPU.stepCPU (http://pcjs:8088/modules/pcx86/lib/x86cpu.js:4637:37)
* at X86CPU.CPU.runCPU (http://pcjs:8088/modules/pcx86/lib/cpu.js:1014:22)
*
* TODO: Investigate. For now, BACKTRACK is completely disabled (in part because it also needs
* to be revamped for machines with paging enabled).
@ -1551,7 +1551,7 @@ Bus.prototype.checkPortInputNotify = function(port, size, addrLIP)
* @param {number} end address
*
Bus.prototype.removePortInputNotify = function(start, end)
{
{
for (var port = start; port < end; port++) {
if (this.aPortInputNotify[port]) {
delete this.aPortInputNotify[port];
@ -1697,7 +1697,7 @@ Bus.prototype.checkPortOutputNotify = function(port, size, data, addrLIP)
* @param {number} end address
*
Bus.prototype.removePortOutputNotify = function(start, end)
{
{
for (var port = start; port < end; port++) {
if (this.aPortOutputNotify[port]) {
delete this.aPortOutputNotify[port];

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs ChipSet component.
* @fileoverview Implements the PCx86 ChipSet component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-14
@ -131,7 +131,7 @@ function ChipSet(parmsChipSet)
bSwitches = this.parseDIPSwitches(parmsChipSet[ChipSet.CONTROLS.SW2]);
this.aDIPSwitches[1] = [bSwitches, bSwitches];
this.sCellClass = PCJSCLASS + "-bitCell";
this.sCellClass = APPCLASS + "-bitCell";
this.cDMACs = this.cPICs = 1;
if (this.model >= ChipSet.MODEL_5170) {
@ -5357,7 +5357,7 @@ ChipSet.prototype.set8042OutPort = function(b)
/**
* notifyKbdData(b)
*
* In the old days of PCjs, the Keyboard component would simply call setIRR() when it had some data for the
* In the old days of PCx86, the Keyboard component would simply call setIRR() when it had some data for the
* keyboard controller. However, the Keyboard's sole responsibility is to emulate an actual keyboard and call
* notifyKbdData() whenever it has some data; it's not allowed to mess with IRQ lines.
*
@ -5981,12 +5981,12 @@ if (DESKPRO386) {
*/
ChipSet.init = function()
{
var aeChipSet = Component.getElementsByClass(document, PCJSCLASS, "chipset");
var aeChipSet = Component.getElementsByClass(document, APPCLASS, "chipset");
for (var iChip = 0; iChip < aeChipSet.length; iChip++) {
var eChipSet = aeChipSet[iChip];
var parmsChipSet = Component.getComponentParms(eChipSet);
var chipset = new ChipSet(parmsChipSet);
Component.bindComponentControls(chipset, eChipSet, PCJSCLASS);
Component.bindComponentControls(chipset, eChipSet, APPCLASS);
chipset.updateDIPSwitchDescriptions();
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Computer component.
* @fileoverview Implements the PCx86 Computer component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-15
@ -33,8 +33,8 @@
/*
* BUILD INSTRUCTIONS
*
* To build PCjs (pc.js), run Google's Closure Compiler, replacing "*.js" with the input file sequence defined
* by the "pcJSFiles" property in package.json:
* To build PCx86 (pcx86.js), run Google's Closure Compiler, replacing "*.js" with the input file sequence defined
* by the "pcX86Files" property in package.json:
*
* java -jar compiler.jar
* --compilation_level ADVANCED_OPTIMIZATIONS
@ -48,7 +48,7 @@
*
* http://closure-compiler.googlecode.com/files/compiler-latest.zip
*
* The PCjs JavaScript files do have some initialization-order dependencies. If you load the files individually,
* The PCx86 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),
@ -312,7 +312,7 @@ Component.subclass(Computer);
* previous localStorage data be released with a version number that is at least 1 greater,
* since we're tagging the localStorage data with the integer portion of the version string.
*/
Computer.APPNAME = APPNAME || "PCjs";
Computer.APPNAME = APPNAME || "PCx86";
Computer.APPVERSION = APPVERSION;
Computer.COPYRIGHT = "Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>";
@ -1542,14 +1542,14 @@ Computer.init = function()
*/
if (!COMPILED && XMLVERSION) Computer.APPVERSION = XMLVERSION;
var aeMachines = Component.getElementsByClass(document, PCJSCLASS + "-machine");
var aeMachines = Component.getElementsByClass(document, APPCLASS + "-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");
var aeComputers = Component.getElementsByClass(eMachine, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
@ -1571,7 +1571,7 @@ Computer.init = function()
* but "reset" now provides a way to force the machine to start from scratch again, so "erase"
* may be redundant now.
*/
Component.bindComponentControls(computer, eComputer, PCJSCLASS);
Component.bindComponentControls(computer, eComputer, APPCLASS);
/*
* Power on the computer, giving every component the opportunity to reset or restore itself.
@ -1592,7 +1592,7 @@ Computer.init = function()
*/
Computer.show = function()
{
var aeComputers = Component.getElementsByClass(document, PCJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);
@ -1641,7 +1641,7 @@ Computer.show = function()
*/
Computer.exit = function()
{
var aeComputers = Component.getElementsByClass(document, PCJSCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs CPU component.
* @fileoverview Implements the PCx86 CPU component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-04

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Debugger component.
* @fileoverview Implements the PCx86 Debugger component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-21
@ -106,13 +106,13 @@ var DbgAddr;
* GLOBALALLOC: KRNL386.EXE 0001:022B len 0xC570
*
* And then you just need to do a bit more sleuthing to find the right CODE segment. And that just
* got easier, now that the PCjs Debugger mimics portions of the Windows Debugger INT 0x41 interface;
* got easier, now that the PCx86 Debugger mimics portions of the Windows Debugger INT 0x41 interface;
* see intWindowsDebugger() for details. So even if you neglect to run WDEB386.EXE /E inside the
* machine before running Windows, you should still see notifications like:
*
* KERNEL!undefined code(0001)=#0397 len 0000C580
*
* in the PCjs Debugger output window, as segments are being loaded by the Windows kernel.
* in the PCx86 Debugger output window, as segments are being loaded by the Windows kernel.
*/
/**
@ -3888,7 +3888,7 @@ if (DEBUGGER) {
*/
Debugger.prototype.init = function()
{
this.println("Type ? for help with PCjs Debugger commands");
this.println("Type ? for help with PCx86 Debugger commands");
this.updateStatus();
if (this.sInitCommands) {
var sCmds = this.sInitCommands;
@ -7315,7 +7315,7 @@ if (DEBUGGER) {
* DEBUG.COM changed "PC" to refer to the 16-bit flags register (Program or Processor Control?)
* I've elected to go for PC-DOS 3.00+ compatibility, since that will be more widely known.
*
* PCjs prefers "PS" (Processor Status) for accessing the FLAGS register in its 16-bit (or 32-bit)
* PCx86 prefers "PS" (Processor Status) for accessing the FLAGS register in its 16-bit (or 32-bit)
* entirety. Individual flag bits can also be accessed as 1-bit registers, using the names shown
* below ("C", "P", "A", "Z", etc.)
*/
@ -8158,7 +8158,7 @@ if (DEBUGGER) {
}
break;
}
this.println((APPNAME || "PCjs") + " version " + (XMLVERSION || APPVERSION) + " (" + this.cpu.model + (COMPILED? ",RELEASE" : (DEBUG? ",DEBUG" : ",NODEBUG")) + (PREFETCH? ",PREFETCH" : ",NOPREFETCH") + (TYPEDARRAYS? ",TYPEDARRAYS" : (BYTEARRAYS? ",BYTEARRAYS" : ",LONGARRAYS")) + (BACKTRACK? ",BACKTRACK" : ",NOBACKTRACK") + ')');
this.println((APPNAME || "PCx86") + " version " + (XMLVERSION || APPVERSION) + " (" + this.cpu.model + (COMPILED? ",RELEASE" : (DEBUG? ",DEBUG" : ",NODEBUG")) + (PREFETCH? ",PREFETCH" : ",NOPREFETCH") + (TYPEDARRAYS? ",TYPEDARRAYS" : (BYTEARRAYS? ",BYTEARRAYS" : ",LONGARRAYS")) + (BACKTRACK? ",BACKTRACK" : ",NOBACKTRACK") + ')');
this.println(web.getUserAgent());
break;
case 'x':
@ -8219,12 +8219,12 @@ if (DEBUGGER) {
*/
Debugger.init = function()
{
var aeDbg = Component.getElementsByClass(document, PCJSCLASS, "debugger");
var aeDbg = Component.getElementsByClass(document, APPCLASS, "debugger");
for (var iDbg = 0; iDbg < aeDbg.length; iDbg++) {
var eDbg = aeDbg[iDbg];
var parmsDbg = Component.getComponentParms(eDbg);
var dbg = new Debugger(parmsDbg);
Component.bindComponentControls(dbg, eDbg, PCJSCLASS);
Component.bindComponentControls(dbg, eDbg, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview PCjs-specific compile-time definitions.
* @fileoverview PCx86-specific compile-time definitions.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2014-May-08
@ -35,7 +35,12 @@
/**
* @define {string}
*/
var PCJSCLASS = "pcjs"; // this @define is the default application class (formerly APPCLASS) to use for PCjs
var APPCLASS = "pcx86"; // this @define is the default application class (eg, "pcx86", "c1pjs")
/**
* @define {string}
*/
var APPNAME = "PCx86"; // this @define is the default application name (eg, "PCx86", "C1Pjs")
/**
* @define {boolean}
@ -144,7 +149,8 @@ var DESKPRO386 = I386;
var PAGEBLOCKS = I386;
if (NODE) {
global.PCJSCLASS = PCJSCLASS;
global.APPCLASS = APPCLASS;
global.APPNAME = APPNAME;
global.DEBUGGER = DEBUGGER;
global.PREFETCH = PREFETCH;
global.BYTEARRAYS = BYTEARRAYS;

View file

@ -71,9 +71,9 @@
* 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
* requested by the PCx86 machine, PCx86 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
* Dirty sectors (ie, those that the PCx86 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.
*
@ -129,7 +129,7 @@
*
* 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
* This preserves the promise that EVERYTHING a user does within a PCx86 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.
@ -138,7 +138,7 @@
* 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
* So, every PCx86 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.
*
@ -1399,7 +1399,7 @@ Disk.prototype.doneLoad = function(sURL, sDiskData, nErrorCode)
* 0-based "physical" sector numbers for disk-relative block addresses (aka PBAs or Physical Block Addresses).
*
* Also, our use of the term LBA differs from that of more modern disk controllers; in the pre-modern world
* of PCjs, what we call PBA numbers are what those controllers would later call LBA numbers.
* of PCx86, what we call PBA numbers are what those controllers would later call LBA numbers.
*
* @this {Disk}
* @return {Array.<FileInfo>|undefined}

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Floppy Drive Controller (FDC) component.
* @fileoverview Implements the PCx86 Floppy Drive Controller (FDC) component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Aug-09
@ -2723,12 +2723,12 @@ FDC.aPortOutput = {
* any associated HTML controls to the new component.
*/
FDC.init = function() {
var aeFDC = Component.getElementsByClass(document, PCJSCLASS, "fdc");
var aeFDC = Component.getElementsByClass(document, APPCLASS, "fdc");
for (var iFDC = 0; iFDC < aeFDC.length; iFDC++) {
var eFDC = aeFDC[iFDC];
var parmsFDC = Component.getComponentParms(eFDC);
var fdc = new FDC(parmsFDC);
Component.bindComponentControls(fdc, eFDC, PCJSCLASS);
Component.bindComponentControls(fdc, eFDC, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Hard Drive Controller (HDC) component.
* @fileoverview Implements the PCx86 Hard Drive Controller (HDC) component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Nov-26
@ -791,7 +791,7 @@ HDC.prototype.initController = function(data, fHard)
* and if the components were split, then I'd have to create a third component for that common code (although again,
* disk management probably belongs in its own component anyway).
*
* However, let's not forget that since my overall plan is to have only one PCjs "binary", everything's going to end
* However, let's not forget that since my overall plan is to have only one PCx86 "binary", everything's going to end
* up in the same bucket anyway, so let's not be too obsessive about organizational details. As long as the number
* of these conditionals is small and they're not performance-critical, this seems much ado about nothing.
*/
@ -2959,7 +2959,7 @@ HDC.prototype.intBIOSDisk = function(addr)
* ROM BIOS initialization, IRQ.FDC hasn't been unmasked yet.
*
* My work-around: have the HDC component hook INT 0x40, and every time an INT 0x40 is issued with AH=0 and
* IRQ.FDC masked, bypass the INT 0x40 interrupt. This is as close as PCjs has come to patching any BIOS code
* IRQ.FDC masked, bypass the INT 0x40 interrupt. This is as close as PCx86 has come to patching any BIOS code
* (something I've refused to do), and even here, I'm not doing it out of necessity, just annoyance.
*
* @this {HDC}
@ -3043,12 +3043,12 @@ HDC.aATCPortOutput = {
*/
HDC.init = function()
{
var aeHDC = Component.getElementsByClass(document, PCJSCLASS, "hdc");
var aeHDC = Component.getElementsByClass(document, APPCLASS, "hdc");
for (var iHDC = 0; iHDC < aeHDC.length; iHDC++) {
var eHDC = aeHDC[iHDC];
var parmsHDC = Component.getComponentParms(eHDC);
var hdc = new HDC(parmsHDC);
Component.bindComponentControls(hdc, eHDC, PCJSCLASS);
Component.bindComponentControls(hdc, eHDC, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview PCjs-specific BIOS/DOS interrupt definitions.
* @fileoverview PCx86-specific BIOS/DOS interrupt definitions.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2014-Dec-11

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Keyboard component.
* @fileoverview Implements the PCx86 Keyboard component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-20
@ -1363,14 +1363,16 @@ Keyboard.prototype.setModel = function(sModel)
{
var iModel = 0;
this.model = null;
if (sModel) {
if (typeof sModel == "string") {
this.model = sModel.toUpperCase();
iModel = Keyboard.MODELS.indexOf(this.model);
if (iModel < 0) iModel = 0;
}
sModel = Keyboard.MODELS[iModel];
this.modelCountry = sModel.substr(0, 2);
this.modelKeys = parseInt(sModel.substr(2), 10);
if (sModel) {
this.modelCountry = sModel.substr(0, 2);
this.modelKeys = parseInt(sModel.substr(2), 10);
}
};
/**
@ -2550,12 +2552,12 @@ Keyboard.prototype.keySimulate = function(simCode, fDown)
*/
Keyboard.init = function()
{
var aeKbd = Component.getElementsByClass(document, PCJSCLASS, "keyboard");
var aeKbd = Component.getElementsByClass(document, APPCLASS, "keyboard");
for (var iKbd = 0; iKbd < aeKbd.length; iKbd++) {
var eKbd = aeKbd[iKbd];
var parmsKbd = Component.getComponentParms(eKbd);
var kbd = new Keyboard(parmsKbd);
Component.bindComponentControls(kbd, eKbd, PCJSCLASS);
Component.bindComponentControls(kbd, eKbd, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs "physical" Memory component.
* @fileoverview Implements the PCx86 "physical" Memory component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-04

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Mouse component.
* @fileoverview Implements the PCx86 Mouse component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jul-01
@ -720,12 +720,12 @@ Mouse.prototype.notifyMCR = function(bMCR)
*/
Mouse.init = function()
{
var aeMouse = Component.getElementsByClass(document, PCJSCLASS, "mouse");
var aeMouse = Component.getElementsByClass(document, APPCLASS, "mouse");
for (var iMouse = 0; iMouse < aeMouse.length; iMouse++) {
var eMouse = aeMouse[iMouse];
var parmsMouse = Component.getComponentParms(eMouse);
var mouse = new Mouse(parmsMouse);
Component.bindComponentControls(mouse, eMouse, PCJSCLASS);
Component.bindComponentControls(mouse, eMouse, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Panel component.
* @fileoverview Implements the PCx86 Panel component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-19
@ -972,7 +972,7 @@ Panel.prototype.centerText = function(sText)
Panel.init = function()
{
var fReady = false;
var aePanels = Component.getElementsByClass(document, PCJSCLASS, "panel");
var aePanels = Component.getElementsByClass(document, APPCLASS, "panel");
for (var iPanel=0; iPanel < aePanels.length; iPanel++) {
var ePanel = aePanels[iPanel];
var parmsPanel = Component.getComponentParms(ePanel);
@ -981,7 +981,7 @@ Panel.init = function()
fReady = true;
panel = new Panel(parmsPanel);
}
Component.bindComponentControls(panel, ePanel, PCJSCLASS);
Component.bindComponentControls(panel, ePanel, APPCLASS);
if (fReady) panel.setReady();
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs ParallelPort component.
* @fileoverview Implements the PCx86 ParallelPort component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jul-01
@ -503,12 +503,12 @@ ParallelPort.aPortOutput = {
*/
ParallelPort.init = function()
{
var aeParallel = Component.getElementsByClass(document, PCJSCLASS, "parallel");
var aeParallel = Component.getElementsByClass(document, APPCLASS, "parallel");
for (var iParallel = 0; iParallel < aeParallel.length; iParallel++) {
var eParallel = aeParallel[iParallel];
var parmsParallel = Component.getComponentParms(eParallel);
var parallel = new ParallelPort(parmsParallel);
Component.bindComponentControls(parallel, eParallel, PCJSCLASS);
Component.bindComponentControls(parallel, eParallel, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs RAM component.
* @fileoverview Implements the PCx86 RAM component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-15
@ -184,12 +184,12 @@ RAM.prototype.reset = function()
* Technically, that memory is part of the first 1Mb of memory that also provides up to 640Kb
* of conventional memory (ie, memory below 1Mb).
*
* However, PCjs doesn't support individual memory allocations that (a) are discontiguous
* However, PCx86 doesn't support individual memory allocations that (a) are discontiguous
* or (b) dynamically change location. Components must simulate those features by performing
* a separate allocation for each starting address, and removing/adding memory allocations
* whenever their starting address changes.
*
* Therefore, a DeskPro 386's first 1Mb of physical memory is allocated by PCjs in two pieces,
* Therefore, a DeskPro 386's first 1Mb of physical memory is allocated by PCx86 in two pieces,
* and the second piece must have an ID of "ramCPQ", triggering the additional allocation of
* COMPAQ-specific memory-mapped registers.
*
@ -264,12 +264,12 @@ RAM.prototype.restore = function(data)
*/
RAM.init = function()
{
var aeRAM = Component.getElementsByClass(document, PCJSCLASS, "ram");
var aeRAM = Component.getElementsByClass(document, APPCLASS, "ram");
for (var iRAM = 0; iRAM < aeRAM.length; iRAM++) {
var eRAM = aeRAM[iRAM];
var parmsRAM = Component.getComponentParms(eRAM);
var ram = new RAM(parmsRAM);
Component.bindComponentControls(ram, eRAM, PCJSCLASS);
Component.bindComponentControls(ram, eRAM, APPCLASS);
}
};
@ -278,7 +278,7 @@ RAM.init = function()
*
* DeskPro 386 machines came with a minimum of 1Mb of RAM, which could be configured (via jumpers)
* for 256Kb, 512Kb or 640Kb of conventional memory, starting at address 0x00000000, with the
* remainder (768Kb, 512Kb, or 384Kb) accessible only at an address just below 0x01000000. In PCjs,
* remainder (768Kb, 512Kb, or 384Kb) accessible only at an address just below 0x01000000. In PCx86,
* this second chunk of RAM must be separately allocated, with an ID of "ramCPQ".
*
* The typical configuration was 640Kb of conventional memory, leaving 384Kb accessible at 0x00FA0000.

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs ROM component.
* @fileoverview Implements the PCx86 ROM component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-15
@ -81,9 +81,7 @@ function ROM(parmsROM)
* Most ROMs are not aliased, in which case the 'alias' property should have the default value of null.
*/
this.addrAlias = parmsROM['alias'];
this.sFilePath = parmsROM['file'];
this.sFileName = str.getBaseName(this.sFilePath);
/*
* The 'notify' property can now (as of v1.18.2) contain an array of parameters that the notified
@ -107,13 +105,14 @@ function ROM(parmsROM)
}
if (this.sFilePath) {
var sFileURL = this.sFilePath;
var sFileName = str.getBaseName(sFileURL);
if (DEBUG) this.log('load("' + sFileURL + '")');
/*
* If the selected ROM file has a ".json" extension, then we assume it's pre-converted
* JSON-encoded ROM data, so we load it as-is; ditto for ROM files with a ".hex" extension.
* Otherwise, we ask our server-side ROM converter to return the file in a JSON-compatible format.
*/
var sFileExt = str.getExtension(this.sFileName);
var sFileExt = str.getExtension(sFileName);
if (sFileExt != DumpAPI.FORMAT.JSON && sFileExt != DumpAPI.FORMAT.HEX) {
sFileURL = web.getHost() + DumpAPI.ENDPOINT + '?' + DumpAPI.QUERY.FILE + '=' + this.sFilePath + '&' + DumpAPI.QUERY.FORMAT + '=' + DumpAPI.FORMAT.BYTES + '&' + DumpAPI.QUERY.DECIMAL + '=true';
}
@ -417,12 +416,13 @@ ROM.prototype.cloneROM = function(addr)
*/
ROM.init = function()
{
var aeROM = Component.getElementsByClass(document, PCJSCLASS, "rom");
var sAppClass = APPCLASS;
var aeROM = Component.getElementsByClass(document, sAppClass, "rom");
for (var iROM = 0; iROM < aeROM.length; iROM++) {
var eROM = aeROM[iROM];
var parmsROM = Component.getComponentParms(eROM);
var rom = new ROM(parmsROM);
Component.bindComponentControls(rom, eROM, PCJSCLASS);
Component.bindComponentControls(rom, eROM, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs SerialPort component.
* @fileoverview Implements the PCx86 SerialPort component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jul-01
@ -207,7 +207,7 @@ SerialPort.DL_DEFAULT = 0x180; // we select an arbitrary default Diviso
*
* The Microsoft Windows 1.01 serial mouse driver ISR issues an EOI before it has safely exited, presumably
* relying on the fact that a 1200 baud serial device would not normally interrupt frequently enough to blow
* the stack. However, in PCjs, all you have to do is enable Debugger messages on every serial interrupt
* the stack. However, in PCx86, all you have to do is enable Debugger messages on every serial interrupt
* and mouse event, eg:
*
* m serial on;m pic on;m mouse on
@ -897,12 +897,12 @@ SerialPort.aPortOutput = {
*/
SerialPort.init = function()
{
var aeSerial = Component.getElementsByClass(document, PCJSCLASS, "serial");
var aeSerial = Component.getElementsByClass(document, APPCLASS, "serial");
for (var iSerial = 0; iSerial < aeSerial.length; iSerial++) {
var eSerial = aeSerial[iSerial];
var parmsSerial = Component.getComponentParms(eSerial);
var serial = new SerialPort(parmsSerial);
Component.bindComponentControls(serial, eSerial, PCJSCLASS);
Component.bindComponentControls(serial, eSerial, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview The State class used by C1Pjs and PCjs.
* @fileoverview The State class used by C1Pjs and PCx86.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-May-14

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements the PCjs Video component.
* @fileoverview Implements the PCx86 Video component.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Jun-15
@ -7258,7 +7258,7 @@ Video.aVGAPortOutput = {
*/
Video.init = function()
{
var aeVideo = Component.getElementsByClass(document, PCJSCLASS, "video");
var aeVideo = Component.getElementsByClass(document, APPCLASS, "video");
for (var iVideo = 0; iVideo < aeVideo.length; iVideo++) {
var eVideo = aeVideo[iVideo];
var parmsVideo = Component.getComponentParms(eVideo);
@ -7382,7 +7382,7 @@ Video.init = function()
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
* even the "Refresh" button is just a diagnostic tool, to ensure that the screen contents are up-to-date.
*/
Component.bindComponentControls(video, eVideo, PCJSCLASS);
Component.bindComponentControls(video, eVideo, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Defines PCjs x86 constants.
* @fileoverview Defines PCx86 constants.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-05
@ -48,7 +48,7 @@ var X86 = {
*/
STEPPING_80386_A0: (80386+0xA0), // we have very little information about this stepping...
STEPPING_80386_A1: (80386+0xA1), // we know much more about the A1 stepping (see /blog/2015/02/23/README.md)
STEPPING_80386_B0: (80386+0xB0), // for now, the only B0 difference in PCjs is support for XBTS and IBTS
STEPPING_80386_B0: (80386+0xB0), // for now, the only B0 difference in PCx86 is support for XBTS and IBTS
STEPPING_80386_B1: (80386+0xB1), // our implementation of the B1 stepping also includes the infamous 32-bit multiplication bug
STEPPING_80386_B2: (80386+0xB2), // this is an imaginary stepping that simply means "B1 without the 32-bit multiplication bug" (ie, a B1 with the "double sigma" stamp)
STEPPING_80386_C0: (80386+0xC0), // this presumably fixed lots of B1 issues, but it seems to have been quickly superseded by the D0

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs 8086/8088 CPU logic.
* @fileoverview Implements PCx86 8086/8088 CPU logic.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-05
@ -3998,10 +3998,10 @@ X86CPU.prototype.pushWord = function(w)
* I/O (ie, even while we're waiting for the remote I/O to finish), so the ChipSet component should avoid
* calling setDMA() whenever possible.
*
* TODO: While comparing SYMDEB tracing in both PCjs and VMware, I noticed that after single-stepping ANY
* TODO: While comparing SYMDEB tracing in both PCx86 and VMware, I noticed that after single-stepping ANY
* segment-load instruction, SYMDEB would get control immediately after that instruction in VMware, whereas
* I delay acknowledgment of the Trap flag until the *following* instruction, so in PCjs, SYMDEB doesn't get
* control until the following instruction. I think PCjs behavior is correct, at least for SS.
* I delay acknowledgment of the Trap flag until the *following* instruction, so in PCx86, SYMDEB doesn't get
* control until the following instruction. I think PCx86 behavior is correct, at least for SS.
*
* ERRATA: Early revisions of the 8086/8088 failed to suppress hardware interrupts (and possibly also Trap
* acknowledgements) after an SS load, but Intel corrected the problem at some point; however, I don't know when
@ -4398,12 +4398,12 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
*/
X86CPU.init = function()
{
var aeCPUs = Component.getElementsByClass(document, PCJSCLASS, "cpu");
var aeCPUs = Component.getElementsByClass(document, APPCLASS, "cpu");
for (var iCPU = 0; iCPU < aeCPUs.length; iCPU++) {
var eCPU = aeCPUs[iCPU];
var parmsCPU = Component.getComponentParms(eCPU);
var cpu = new X86CPU(parmsCPU);
Component.bindComponentControls(cpu, eCPU, PCJSCLASS);
Component.bindComponentControls(cpu, eCPU, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs 8087 FPU logic.
* @fileoverview Implements PCx86 8087 FPU logic.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2015-Nov-09
@ -3363,12 +3363,12 @@ X86FPU.afnPreserveExceptions = [
*/
X86FPU.init = function()
{
var aeFPUs = Component.getElementsByClass(document, PCJSCLASS, "fpu");
var aeFPUs = Component.getElementsByClass(document, APPCLASS, "fpu");
for (var iFPU = 0; iFPU < aeFPUs.length; iFPU++) {
var eFPU = aeFPUs[iFPU];
var parmsFPU = Component.getComponentParms(eFPU);
var fpu = new X86FPU(parmsFPU);
Component.bindComponentControls(fpu, eFPU, PCJSCLASS);
Component.bindComponentControls(fpu, eFPU, APPCLASS);
}
};

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs 8086 opcode helpers.
* @fileoverview Implements PCx86 8086 opcode helpers.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-05

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs opcode helpers.
* @fileoverview Implements PCx86 opcode helpers.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2016-Mar-04

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs general-purpose ModRegRM decoding.
* @fileoverview Implements PCx86 general-purpose ModRegRM decoding.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2016-Mar-06
@ -38,7 +38,7 @@ if (NODE) {
}
/*
* Before 80386 support was added to PCjs, the approach to decoding ModRegRM bytes (which I usually
* Before 80386 support was added to PCx86, the approach to decoding ModRegRM bytes (which I usually
* just call ModRM bytes) used one generated function per ModRM value. This was optimal for 16-bit processors,
* because the functions were small, and it was maximally efficient, turning the entire ModRM decoding operation
* into one table lookup and function call.
@ -54,7 +54,7 @@ if (NODE) {
* smaller file (x86mods.js) replaces a host of older files (x86modb.js, x86modw.js, x86modb16.js, x86modw16.js,
* x86modb32.js, x86modw32.js, and x86modsib.js).
*
* You can dig up the older files from the repository if you're curious, or you can run /modules/pcjs/bin/x86gen.js to
* You can dig up the older files from the repository if you're curious, or you can run /modules/pcx86/bin/x86gen.js to
* get a sense of what they contained (x86gen.js created most of the code, but it still had to be massaged afterward).
*/

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs 0x0F two-byte opcodes
* @fileoverview Implements PCx86 0x0F two-byte opcodes
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-05

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs 8086 opcode decoding.
* @fileoverview Implements PCx86 8086 opcode decoding.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-Sep-05
@ -4541,7 +4541,7 @@ X86.aOps = [
* 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 letter suffixes:
*
* Opcodes Intel PCjs PC Mag TechRef
* Opcodes Intel PCx86 PC Mag TechRef
* ------- ----- ---- --------------
* 0x80-0x83 Grp1 Grp1b and Grp1w Group A
* 0xC0-0xC1 Grp2 Grp2b and Grp2w (opGRP2bn/wn) Group B

View file

@ -1,5 +1,5 @@
/**
* @fileoverview Implements PCjs X86 Segment Registers
* @fileoverview Implements PCx86 X86 Segment Registers
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2014-Sep-10
@ -577,7 +577,7 @@ X86Seg.prototype.loadDesc = function(sel, acc, base, limit)
/*
* NOTE: This code must take care to leave the mode of the TSS, LDT, and VER segment registers alone;
* in particular, we must not allow a real-mode LOADALL to modify their mode, because the rest of PCjs
* in particular, we must not allow a real-mode LOADALL to modify their mode, because the rest of PCx86
* assumes that their mode will never change (they were allocated with fProt set to true).
*/
if (this.id < X86Seg.ID.TSS) this.updateMode(true);
@ -617,7 +617,7 @@ X86Seg.prototype.loadDesc6 = function(addrDesc, sel)
/*
* NOTE: This code must take care to leave the mode of the TSS, LDT, and VER segment registers alone;
* in particular, we must not allow a real-mode LOADALL to modify their mode, because the rest of PCjs
* in particular, we must not allow a real-mode LOADALL to modify their mode, because the rest of PCx86
* assumes that their mode will never change (they were allocated with fProt set to true).
*/
if (this.id < X86Seg.ID.TSS) this.updateMode(true);
@ -1393,7 +1393,7 @@ X86Seg.prototype.setBase = function(addr)
/**
* save()
*
* Early versions of PCjs saved only segment selectors, since that's all that mattered in real-mode;
* Early versions of PCx86 saved only segment selectors, since that's all that mattered in real-mode;
* newer versions need to save/restore all the "core" properties of the X86Seg object (ie, properties other
* than those that updateMode() will take care of restoring later).
*
@ -1424,7 +1424,7 @@ X86Seg.prototype.save = function()
/**
* restore(a)
*
* Early versions of PCjs saved only segment selectors, since that's all that mattered in real-mode;
* Early versions of PCx86 saved only segment selectors, since that's all that mattered in real-mode;
* newer versions need to save/restore all the "core" properties of the X86Seg object (ie, properties other
* than those that updateMode() will take care of restoring later).
*

View file

@ -1,5 +1,5 @@
{
"name": "PCjs",
"name": "PCx86",
"description": "IBM PC Emulator",
"author": "Jeff Parsons <Jeff@pcjs.org>",
"licenses": [
@ -9,6 +9,6 @@
}
],
"bin": {
"example": "./bin/pcjs"
"example": "./bin/pcx86"
}
}

View file

@ -1,5 +1,5 @@
/**
* @fileoverview The Component class used by C1Pjs and PCjs.
* @fileoverview The Component class used by C1Pjs and PCx86.
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* Created 2012-May-14

View file

@ -32,11 +32,6 @@
"use strict";
/**
* @define {string}
*/
var APPNAME = ""; // this @define is overridden by the Closure Compiler with either "PCjs" or "C1Pjs"
/**
* @define {string}
*/
@ -79,7 +74,6 @@ if (typeof module !== 'undefined') {
if (NODE) {
global.window = false; // provides an alternative "if (typeof window === 'undefined')" (ie, "if (window) ...")
global.APPNAME = APPNAME;
global.APPVERSION = APPVERSION;
global.XMLVERSION = XMLVERSION;
global.SITEHOST = SITEHOST;

View file

@ -373,7 +373,7 @@ function embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
* *something* will have happened.
*
* Note that it is the HTMLOut module (in processMachines()) that ultimately decides which scripts to
* include and then generates the embedPC() and/or embedC1P() calls.
* include and then generates the embedXXX() call.
*/
var aeWarning = (eMachine && Component.getElementsByClass(eMachine, "machine-warning"));
eWarning = (aeWarning && aeWarning[0]) || eMachine;
@ -401,7 +401,7 @@ function embedMachine(sName, sVersion, idMachine, sXMLFile, sXSLFile, sParms)
head.appendChild(style);
}
var sAppClass = sName.toLowerCase(); // eg, "pcjs" or "c1pjs"
var sAppClass = sName.toLowerCase(); // eg, "pcx86" or "c1pjs"
if (!sXSLFile) {
/*
* Now that PCjs is an open-source project, we can make the following test more flexible,
@ -535,7 +535,7 @@ function embedC1P(idMachine, sXMLFile, sXSLFile)
}
/**
* embedPC(idMachine, sXMLFile, sXSLFile, sParms)
* embedPCx86(idMachine, sXMLFile, sXSLFile, sParms)
*
* @param {string} idMachine
* @param {string} sXMLFile
@ -543,10 +543,10 @@ function embedC1P(idMachine, sXMLFile, sXSLFile)
* @param {string} [sParms]
* @return {boolean} true if successful, false if error
*/
function embedPC(idMachine, sXMLFile, sXSLFile, sParms)
function embedPCx86(idMachine, sXMLFile, sXSLFile, sParms)
{
if (fAsync) web.enablePageEvents(false);
return embedMachine("PCjs", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
return embedMachine("PCx86", APPVERSION, idMachine, sXMLFile, sXSLFile, sParms);
}
/**
@ -569,7 +569,7 @@ function embedPC8080(idMachine, sXMLFile, sXSLFile, sParms)
* by adding them as (named) properties of a global object.
*/
if (APPNAME == "C1Pjs") window['embedC1P'] = embedC1P;
if (APPNAME == "PCjs") window['embedPC'] = embedPC;
if (APPNAME == "PCx86") window['embedPCx86'] = embedPCx86;
if (APPNAME == "PC8080") window['embedPC8080'] = embedPC8080;
window['enableEvents'] = web.enablePageEvents;

View file

@ -22,7 +22,7 @@ panel) on a web page.
[*machine.xsl*](machine.xsl) is an XML stylesheet that takes things a step further and transforms a machine XML
into a stand-alone HTML document, which also includes all necessary compiled scripts (eg, c1p.js, c1p-dbg.js,
pc.js or pc-dbg.js). Most machine XML files explicitly link to this stylesheet, so that simply loading the XML
pcx86.js or pcx86-dbg.js). Most machine XML files explicitly link to this stylesheet, so that simply loading the XML
file in your web browser creates a working virtual machine.
[*manifest.xsl*](manifest.xsl) is an XML stylesheet that renders a software manifest XML file into a standalone

View file

@ -32,7 +32,7 @@
</xsl:template>
<xsl:template name="machine">
<xsl:param name="href">/devices/pc/machine/5150/mda/64kb/machine.xml</xsl:param>
<xsl:param name="href" select="''"/>
<xsl:param name="state" select="''"/>
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="$href"/></xsl:variable>
<xsl:apply-templates select="document($componentFile)/machine">
@ -509,7 +509,7 @@
</xsl:if>
</xsl:if>
</xsl:variable>
<!-- TODO: Think about incorporating the optional "desc" tag into the disk description (see /disks/pc/tools/microsoft/c/4.00/manifest.xml) -->
<!-- TODO: Think about incorporating the optional "desc" tag into the disk description (see /disks/pcx86/tools/microsoft/c/4.00/manifest.xml) -->
<xsl:if test="@href">
<option value="{@href}" data-value="{{{$link}}}"><xsl:value-of select="$name"/></option>
</xsl:if>