More PCjs/PCx86 disambiguation

This commit is contained in:
Jeff Parsons 2016-05-17 00:04:51 -07:00
commit a1e999e0c4
92 changed files with 3553 additions and 3555 deletions

View file

@ -6,8 +6,7 @@
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
* PCjs is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
@ -22,12 +21,12 @@
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.COPYRIGHT).
* that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
*
* Some PCjs files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* PCjs program for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
* ROM files, and disk image files. Those external resource files are not considered part of PCjs
* for purposes of the GNU General Public License, and the author does not claim any copyright
* as to their contents.
*/
/*
@ -218,7 +217,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
}
}
this.println(Computer.APPNAME + " v" + Computer.APPVERSION + "\n" + Computer.COPYRIGHT + "\n" + Computer.LICENSE);
this.println(PCX86.APPNAME + " v" + PCX86.APPVERSION + "\n" + COPYRIGHT + "\n" + LICENSE);
if (DEBUG && this.messageEnabled()) this.printMessage("PREFETCH: " + PREFETCH + ", TYPEDARRAYS: " + TYPEDARRAYS);
@ -269,7 +268,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
this.resume = Computer.RESUME_NONE;
}
if (this.resume) {
this.stateComputer = new State(this, Computer.APPVERSION);
this.stateComputer = new State(this, PCX86.APPVERSION);
if (this.stateComputer.load()) {
sStatePath = null;
} else {
@ -306,22 +305,6 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
Component.subclass(Computer);
/*
* NOTE: 1.01 is the first version to provide limited save/restore support using localStorage.
* From this point on, care must be taken to insure that any new version that's incompatible with
* 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 || "PCx86";
Computer.APPVERSION = APPVERSION;
Computer.COPYRIGHT = "Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>";
/*
* I think it's a good idea to also display a GPL notice, putting people on notice that even
* the "compiled" source code has all the same GPL requirements as the uncompiled source code.
*/
Computer.LICENSE = "License: GPL version 3 or later <http://gnu.org/licenses/gpl.html>";
Computer.STATE_FAILSAFE = "failsafe";
Computer.STATE_VALIDATE = "validate";
Computer.STATE_TIMESTAMP = "timestamp";
@ -501,7 +484,7 @@ Computer.prototype.wait = function(fn, parms)
Computer.prototype.validateState = function(stateComputer)
{
var fValid = true;
var stateValidate = new State(this, Computer.APPVERSION, Computer.STATE_VALIDATE);
var stateValidate = new State(this, PCX86.APPVERSION, Computer.STATE_VALIDATE);
if (stateValidate.load() && stateValidate.parse()) {
var sTimestampValidate = stateValidate.get(Computer.STATE_TIMESTAMP);
var sTimestampComputer = stateComputer ? stateComputer.get(Computer.STATE_TIMESTAMP) : "unknown";
@ -544,7 +527,7 @@ Computer.prototype.powerOn = function(resume)
var fRepower = false;
var fRestore = false;
this.fRestoreError = false;
var stateComputer = this.stateComputer || new State(this, Computer.APPVERSION);
var stateComputer = this.stateComputer || new State(this, PCX86.APPVERSION);
if (resume == Computer.RESUME_REPOWER) {
fRepower = true;
@ -557,7 +540,7 @@ Computer.prototype.powerOn = function(resume)
* Which means, of course, that if a previous "failsafe" checkpoint already exists, something bad
* may have happened the last time around.
*/
this.stateFailSafe = new State(this, Computer.APPVERSION, Computer.STATE_FAILSAFE);
this.stateFailSafe = new State(this, PCX86.APPVERSION, Computer.STATE_FAILSAFE);
if (this.stateFailSafe.load()) {
this.powerReport(stateComputer);
/*
@ -577,7 +560,7 @@ Computer.prototype.powerOn = function(resume)
this.stateFailSafe.store();
var fValidate = this.resume && !this.fServerState;
if (resume == Computer.RESUME_AUTO || web.confirmUser("Click OK to restore the previous " + Computer.APPNAME + " machine state, or CANCEL to reset the machine.")) {
if (resume == Computer.RESUME_AUTO || web.confirmUser("Click OK to restore the previous " + PCX86.APPNAME + " machine state, or CANCEL to reset the machine.")) {
fRestore = stateComputer.parse();
if (fRestore) {
var sCode = stateComputer.get(UserAPI.RES.CODE);
@ -850,8 +833,8 @@ Computer.prototype.checkPower = function()
*/
Computer.prototype.powerReport = function(stateComputer)
{
if (web.confirmUser("There may be a problem with your " + Computer.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + Computer.APPNAME + " machine state to http://" + SITEHOST + ".")) {
web.sendReport(Computer.APPNAME, Computer.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
if (web.confirmUser("There may be a problem with your " + PCX86.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + PCX86.APPNAME + " machine state to http://" + SITEHOST + ".")) {
web.sendReport(PCX86.APPNAME, PCX86.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
}
};
@ -900,8 +883,8 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
}
this.nPowerChange--;
var stateComputer = new State(this, Computer.APPVERSION);
var stateValidate = new State(this, Computer.APPVERSION, Computer.STATE_VALIDATE);
var stateComputer = new State(this, PCX86.APPVERSION);
var stateValidate = new State(this, PCX86.APPVERSION, Computer.STATE_VALIDATE);
var sTimestamp = usr.getTimestamp();
stateValidate.set(Computer.STATE_TIMESTAMP, sTimestamp);
@ -1257,7 +1240,7 @@ Computer.prototype.getServerStatePath = function()
if (DEBUG && this.messageEnabled()) {
this.printMessage(Computer.STATE_USERID + " for load: " + this.sUserID);
}
sStatePath = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.LOAD + '&' + UserAPI.QUERY.USER + '=' + this.sUserID + '&' + UserAPI.QUERY.STATE + '=' + State.key(this, Computer.APPVERSION);
sStatePath = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.LOAD + '&' + UserAPI.QUERY.USER + '=' + this.sUserID + '&' + UserAPI.QUERY.STATE + '=' + State.key(this, PCX86.APPVERSION);
} else {
if (DEBUG && this.messageEnabled()) {
this.printMessage(Computer.STATE_USERID + " unavailable");
@ -1325,7 +1308,7 @@ Computer.prototype.storeServerState = function(sUserID, sState, fSync)
var dataPost = {};
dataPost[UserAPI.QUERY.REQ] = UserAPI.REQ.STORE;
dataPost[UserAPI.QUERY.USER] = sUserID;
dataPost[UserAPI.QUERY.STATE] = State.key(this, Computer.APPVERSION);
dataPost[UserAPI.QUERY.STATE] = State.key(this, PCX86.APPVERSION);
dataPost[UserAPI.QUERY.DATA] = sState;
var sRequest = web.getHost() + UserAPI.ENDPOINT;
if (!fSync) {
@ -1394,7 +1377,7 @@ Computer.prototype.onReset = function()
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
*/
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + Computer.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + PCX86.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
this.powerOff(fSave, true);
/*
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
@ -1540,16 +1523,16 @@ Computer.init = function()
/*
* In non-COMPILED builds, embedMachine() may have set XMLVERSION.
*/
if (!COMPILED && XMLVERSION) Computer.APPVERSION = XMLVERSION;
if (!COMPILED && PCX86.XMLVERSION) PCX86.APPVERSION = PCX86.XMLVERSION;
var aeMachines = Component.getElementsByClass(document, APPCLASS + "-machine");
var aeMachines = Component.getElementsByClass(document, PCX86.APPCLASS + "-machine");
for (var iMachine = 0; iMachine < aeMachines.length; iMachine++) {
var eMachine = aeMachines[iMachine];
var parmsMachine = Component.getComponentParms(eMachine);
var aeComputers = Component.getElementsByClass(eMachine, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(eMachine, PCX86.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
@ -1571,7 +1554,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, APPCLASS);
Component.bindComponentControls(computer, eComputer, PCX86.APPCLASS);
/*
* Power on the computer, giving every component the opportunity to reset or restore itself.
@ -1592,7 +1575,7 @@ Computer.init = function()
*/
Computer.show = function()
{
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, PCX86.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);
@ -1641,7 +1624,7 @@ Computer.show = function()
*/
Computer.exit = function()
{
var aeComputers = Component.getElementsByClass(document, APPCLASS, "computer");
var aeComputers = Component.getElementsByClass(document, PCX86.APPCLASS, "computer");
for (var iComputer = 0; iComputer < aeComputers.length; iComputer++) {
var eComputer = aeComputers[iComputer];
var parmsComputer = Component.getComponentParms(eComputer);