v1.16.5: Getting ready for 2015

This commit is contained in:
Jeff Parsons 2014-12-29 23:06:28 -08:00 committed by jeffpar
commit b8407aa96d
217 changed files with 6813 additions and 722 deletions

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.
@ -96,7 +96,7 @@ function C1PComputer(parmsComputer, modules)
C1PComputer.sAppName = APPNAME || "C1Pjs";
C1PComputer.sAppVer = APPVERSION;
C1PComputer.sCopyright = "Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>";
C1PComputer.sCopyright = "Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>";
Component.subclass(Component, C1PComputer);

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-21
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Aug-09
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-20
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-19
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jul-01
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, which is part of the JavaScript Machines Project (aka JSMachines)
* at <http://jsmachines.net/> and <http://pcjs.org/>.

View file

@ -168,7 +168,7 @@
<xsl:otherwise/>
</xsl:choose>
<div class="{$APPCLASS}-copyright">
<a href="http://{$SITEHOST}/{$APPCLASS}" target="_blank">C1Pjs</a> v<xsl:value-of select="$APPVERSION"/> © 2012-2014 by <a href="http://twitter.com/jeffpar" target="_blank">@jeffpar</a>
<a href="http://{$SITEHOST}/{$APPCLASS}" target="_blank">C1Pjs</a> v<xsl:value-of select="$APPVERSION"/> © 2012-2015 by <a href="http://twitter.com/jeffpar" target="_blank">@jeffpar</a>
</div>
<div style="clear:both"></div>
</xsl:if>

View file

@ -6,7 +6,7 @@
* @suppress {missingProperties}
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -37,4 +37,4 @@ var path = require("path");
var fs = require("fs");
var lib = path.join(path.dirname(fs.realpathSync(__filename)), "../lib/");
require(lib + "diskdump.js").CLI();
require(lib + "diskdump.js").CLI();

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-02-01
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -174,7 +174,7 @@ DiskDump.setLogFile = function(file) {
* Class constants
*/
DiskDump.sAPIURL = "http://www.pcjs.org" + DumpAPI.ENDPOINT;
DiskDump.sCopyright = "© 2012-2014 by Jeff Parsons (@jeffpar)";
DiskDump.sCopyright = "© 2012-2015 by Jeff Parsons (@jeffpar)";
DiskDump.sNotice = DiskDump.sAPIURL + " " + DiskDump.sCopyright;
DiskDump.sUsage = "Usage: " + DiskDump.sAPIURL + "?" + DumpAPI.QUERY.PATH + "={url}&amp;" + DumpAPI.QUERY.FORMAT + "=json|data|hex|bytes|img";

View file

@ -6,7 +6,7 @@
* @suppress {missingProperties}
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -37,4 +37,4 @@ var path = require("path");
var fs = require("fs");
var lib = path.join(path.dirname(fs.realpathSync(__filename)), "../lib/");
require(lib + "filedump.js").CLI();
require(lib + "filedump.js").CLI();

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-02-01
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -76,7 +76,7 @@ function FileDump(sFormat, fComments, fDecimal, sServerRoot)
* Class constants
*/
FileDump.sAPIURL = "http://www.pcjs.org" + DumpAPI.ENDPOINT;
FileDump.sCopyright = "© 2012-2014 by Jeff Parsons (@jeffpar)";
FileDump.sCopyright = "© 2012-2015 by Jeff Parsons (@jeffpar)";
FileDump.sNotice = FileDump.sAPIURL + " " + FileDump.sCopyright;
FileDump.sUsage = "Usage: " + FileDump.sAPIURL + "?" + DumpAPI.QUERY.FILE + "=({path}|{URL})&" + DumpAPI.QUERY.FORMAT + "=(json|data|hex|bytes|rom)";

View file

@ -4,7 +4,7 @@
* @version 1.1
* Created 2014-Mar-22
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of C1Pjs, PCjs, and other related components written
* by Jeff Parsons and originally published at cpusim.org and jsmachines.net.

View file

@ -6,7 +6,7 @@
* @suppress {missingProperties}
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -37,4 +37,4 @@ var path = require("path");
var fs = require("fs");
var lib = path.join(path.dirname(fs.realpathSync(__filename)), "../lib/");
require(lib + "htmlout.js").CLI();
require(lib + "htmlout.js").CLI();

View file

@ -1110,7 +1110,9 @@ HTMLOut.prototype.getDirList = function(sToken, sIndent, aParms)
*/
HTMLOut.prototype.getYear = function(sToken, sIndent, aParms)
{
this.aTokens[sToken] = new Date().getFullYear().toString();
var year = new Date().getFullYear();
if (year < 2015) year = 2015;
this.aTokens[sToken] = year.toString();
};
/**

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-02-14
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -6,7 +6,7 @@
* @suppress {missingProperties}
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -37,4 +37,4 @@ var path = require("path");
var fs = require("fs");
var lib = path.join(path.dirname(fs.realpathSync(__filename)), "../lib/");
require(lib + "markout.js").CLI();
require(lib + "markout.js").CLI();

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-02-14
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-Aug-20
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -6,7 +6,7 @@
* @suppress {missingProperties}
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-14
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -1333,17 +1333,17 @@ ChipSet.prototype.getRTCCycleLimit = function(nCycles)
if (nCyclesUpdate > 0) {
if (nCycles > nCyclesUpdate) {
if (DEBUG && this.messageEnabled(Messages.RTC)) {
this.messagePrint("getRTCCycleLimit(" + nCycles + "): reduced to " + nCyclesUpdate + " cycles", true);
this.printMessage("getRTCCycleLimit(" + nCycles + "): reduced to " + nCyclesUpdate + " cycles", true);
}
nCycles = nCyclesUpdate;
} else {
if (DEBUG && this.messageEnabled(Messages.RTC)) {
this.messagePrint("getRTCCycleLimit(" + nCycles + "): already less than " + nCyclesUpdate + " cycles", true);
this.printMessage("getRTCCycleLimit(" + nCycles + "): already less than " + nCyclesUpdate + " cycles", true);
}
}
} else {
if (DEBUG && this.messageEnabled(Messages.RTC)) {
this.messagePrint("RTC next update has passed by " + nCyclesUpdate + " cycles", true);
this.printMessage("RTC next update has passed by " + nCyclesUpdate + " cycles", true);
}
}
}
@ -1402,9 +1402,9 @@ ChipSet.prototype.updateRTCTime = function()
if (DEBUG) {
if (nCyclesUpdate - this.nRTCCyclesNextUpdate > this.nRTCCyclesPerPeriod) {
if (bPrev & ChipSet.CMOS.STATUSC.PF) {
this.messagePrint("RTC interrupt handler failed to clear STATUSC", Messages.RTC);
this.printMessage("RTC interrupt handler failed to clear STATUSC", Messages.RTC);
} else {
this.messagePrint("CPU took too long trigger new RTC periodic interrupt", Messages.RTC);
this.printMessage("CPU took too long trigger new RTC periodic interrupt", Messages.RTC);
}
}
}
@ -2290,7 +2290,7 @@ ChipSet.prototype.inDMAChannelAddr = function(iDMAC, iChannel, port, addrFrom)
var channel = controller.aChannels[iChannel];
var b = channel.addrCurrent[controller.bIndex];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", b, true);
this.printMessageIO(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", b, true);
}
controller.bIndex ^= 0x1;
/*
@ -2327,7 +2327,7 @@ ChipSet.prototype.outDMAChannelAddr = function outDMAChannelAddr(iDMAC, iChannel
{
var controller = this.aDMACs[iDMAC];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", null, true);
}
var channel = controller.aChannels[iChannel];
channel.addrCurrent[controller.bIndex] = channel.addrInit[controller.bIndex] = bOut;
@ -2350,7 +2350,7 @@ ChipSet.prototype.inDMAChannelCount = function(iDMAC, iChannel, port, addrFrom)
var channel = controller.aChannels[iChannel];
var b = channel.countCurrent[controller.bIndex];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", b, true);
this.printMessageIO(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", b, true);
}
controller.bIndex ^= 0x1;
/*
@ -2391,7 +2391,7 @@ ChipSet.prototype.outDMAChannelCount = function(iDMAC, iChannel, port, bOut, add
{
var controller = this.aDMACs[iDMAC];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", null, true);
}
var channel = controller.aChannels[iChannel];
channel.countCurrent[controller.bIndex] = channel.countInit[controller.bIndex] = bOut;
@ -2434,7 +2434,7 @@ ChipSet.prototype.inDMAStatus = function(iDMAC, port, addrFrom)
var b = controller.bStatus | ChipSet.DMA_STATUS.CH0_TC;
controller.bStatus &= ~ChipSet.DMA_STATUS.ALL_TC;
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".STATUS", b, true);
this.printMessageIO(port, null, addrFrom, "DMA" + iDMAC + ".STATUS", b, true);
}
return b;
};
@ -2451,7 +2451,7 @@ ChipSet.prototype.inDMAStatus = function(iDMAC, port, addrFrom)
ChipSet.prototype.outDMACmd = function(iDMAC, port, bOut, addrFrom)
{
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CMD", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".CMD", null, true);
}
this.aDMACs[iDMAC].bCmd = bOut;
};
@ -2479,7 +2479,7 @@ ChipSet.prototype.outDMAReq = function(iDMAC, port, bOut, addrFrom)
{
var controller = this.aDMACs[iDMAC];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".REQ", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".REQ", null, true);
}
/*
* Bits 0-1 contain the channel number
@ -2506,7 +2506,7 @@ ChipSet.prototype.outDMAMask = function(iDMAC, port, bOut, addrFrom)
{
var controller = this.aDMACs[iDMAC];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MASK", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".MASK", null, true);
}
var iChannel = bOut & ChipSet.DMA_MASK.CHANNEL;
var channel = controller.aChannels[iChannel];
@ -2526,7 +2526,7 @@ ChipSet.prototype.outDMAMask = function(iDMAC, port, bOut, addrFrom)
ChipSet.prototype.outDMAMode = function(iDMAC, port, bOut, addrFrom)
{
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MODE", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".MODE", null, true);
}
var iChannel = bOut & ChipSet.DMA_MODE.CHANNEL;
this.aDMACs[iDMAC].aChannels[iChannel].mode = bOut;
@ -2547,7 +2547,7 @@ ChipSet.prototype.outDMAMode = function(iDMAC, port, bOut, addrFrom)
ChipSet.prototype.outDMAResetFF = function(iDMAC, port, bOut, addrFrom)
{
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".RESET_FF", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".RESET_FF", null, true);
}
this.aDMACs[iDMAC].bIndex = 0;
};
@ -2564,7 +2564,7 @@ ChipSet.prototype.outDMAResetFF = function(iDMAC, port, bOut, addrFrom)
ChipSet.prototype.outDMAMasterClear = function(iDMAC, port, bOut, addrFrom)
{
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MASTER_CLEAR", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".MASTER_CLEAR", null, true);
}
/*
* The value written to this port doesn't matter; any write triggers a "master clear" operation
@ -2591,7 +2591,7 @@ ChipSet.prototype.inDMAPageReg = function(iDMAC, iChannel, port, addrFrom)
{
var bIn = this.aDMACs[iDMAC].aChannels[iChannel].bPage;
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", bIn, true);
this.printMessageIO(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", bIn, true);
}
return bIn;
};
@ -2609,7 +2609,7 @@ ChipSet.prototype.inDMAPageReg = function(iDMAC, iChannel, port, addrFrom)
ChipSet.prototype.outDMAPageReg = function(iDMAC, iChannel, port, bOut, addrFrom)
{
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", null, true);
}
this.aDMACs[iDMAC].aChannels[iChannel].bPage = bOut;
};
@ -2627,7 +2627,7 @@ ChipSet.prototype.inDMAPageSpare = function(iSpare, port, addrFrom)
{
var bIn = this.abDMAPageSpare[iSpare];
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, null, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", bIn, true);
this.printMessageIO(port, null, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", bIn, true);
}
return bIn;
};
@ -2644,7 +2644,7 @@ ChipSet.prototype.inDMAPageSpare = function(iSpare, port, addrFrom)
ChipSet.prototype.outDMAPageSpare = function(iSpare, port, bOut, addrFrom)
{
if (this.messageEnabled(Messages.DMA | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", null, true);
this.printMessageIO(port, bOut, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", null, true);
}
this.abDMAPageSpare[iSpare] = bOut;
};
@ -2714,7 +2714,7 @@ ChipSet.prototype.requestDMA = function(iDMAChannel, done)
if (!channel.component || !channel.fnTransfer || !channel.obj) {
if (DEBUG && this.messageEnabled(Messages.DMA | Messages.DATA)) {
this.messagePrint("requestDMA(" + iDMAChannel + "): not connected to a component", true);
this.printMessage("requestDMA(" + iDMAChannel + "): not connected to a component", true);
}
if (done) done(true);
return;
@ -2731,7 +2731,7 @@ ChipSet.prototype.requestDMA = function(iDMAChannel, done)
if (channel.masked) {
if (DEBUG && this.messageEnabled(Messages.DMA | Messages.DATA)) {
this.messagePrint("requestDMA(" + iDMAChannel + "): channel masked, request queued", true);
this.printMessage("requestDMA(" + iDMAChannel + "): channel masked, request queued", true);
}
return;
}
@ -2786,7 +2786,7 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
if (DEBUG && DEBUGGER && channel.sAddrDebug === null) {
channel.sAddrDebug = str.toHex(addr >> 4, 4) + ":" + str.toHex(addr & 0xf, 4);
if (this.messageEnabled(this.messageBitsDMA(iDMAChannel)) && channel.xfer != ChipSet.DMA_MODE.XFER_WRITE) {
this.messagePrint("advanceDMA(" + iDMAChannel + ") transferring " + channel.cbDebug + " bytes from " + channel.sAddrDebug, true);
this.printMessage("advanceDMA(" + iDMAChannel + ") transferring " + channel.cbDebug + " bytes from " + channel.sAddrDebug, true);
this.dbg.doDump("db", channel.sAddrDebug, "l" + channel.cbDebug);
}
}
@ -2797,7 +2797,7 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
if (b < 0) {
if (!channel.fWarning) {
if (DEBUG && chipset.messageEnabled(Messages.DMA)) {
chipset.messagePrint("advanceDMA(" + iDMAChannel + ") ran out of data, assuming 0xff", true);
chipset.printMessage("advanceDMA(" + iDMAChannel + ") ran out of data, assuming 0xff", true);
}
channel.fWarning = true;
}
@ -2809,8 +2809,8 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
if (!channel.masked) {
chipset.bus.setByte(addrCur, b);
if (BACKTRACK) {
if (!off && obj.file) {
chipset.println('loading ' + obj.file.sPath + '[' + obj.offFile + '] at %' + str.toHex(addrCur));
if (!off && obj.file && chipset.messageEnabled(Messages.DISK)) {
chipset.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] at %" + str.toHex(addrCur), true);
}
bto = chipset.bus.addBackTrackObject(obj, bto, off);
chipset.bus.writeBackTrackObject(addrCur, bto, off);
@ -2841,7 +2841,7 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
}
else {
if (DEBUG && this.messageEnabled(Messages.DMA | Messages.WARN)) {
this.messagePrint("advanceDMA(" + iDMAChannel + ") unsupported xfer mode: " + str.toHexWord(channel.xfer), true);
this.printMessage("advanceDMA(" + iDMAChannel + ") unsupported xfer mode: " + str.toHexWord(channel.xfer), true);
}
channel.fError = true;
}
@ -2896,7 +2896,7 @@ ChipSet.prototype.updateDMA = function(channel)
}
if (DEBUG && this.messageEnabled(this.messageBitsDMA(iDMAChannel)) && channel.xfer == ChipSet.DMA_MODE.XFER_WRITE && channel.sAddrDebug) {
this.messagePrint("updateDMA(" + iDMAChannel + ") transferred " + channel.cbDebug + " bytes to " + channel.sAddrDebug, true);
this.printMessage("updateDMA(" + iDMAChannel + ") transferred " + channel.cbDebug + " bytes to " + channel.sAddrDebug, true);
this.dbg.doDump("db", channel.sAddrDebug, "l" + channel.cbDebug);
}
@ -2938,7 +2938,7 @@ ChipSet.prototype.inPICLo = function(iPIC, addrFrom)
}
}
if (this.messageEnabled(Messages.PIC | Messages.PORT | Messages.CHIPSET)) {
this.messagePort(pic.port, null, addrFrom, "PIC" + iPIC, b, true);
this.printMessageIO(pic.port, null, addrFrom, "PIC" + iPIC, b, true);
}
return b;
};
@ -2955,7 +2955,7 @@ ChipSet.prototype.outPICLo = function(iPIC, bOut, addrFrom)
{
var pic = this.aPICs[iPIC];
if (this.messageEnabled(Messages.PIC | Messages.PORT | Messages.CHIPSET)) {
this.messagePort(pic.port, bOut, addrFrom, "PIC" + iPIC, null, true);
this.printMessageIO(pic.port, bOut, addrFrom, "PIC" + iPIC, null, true);
}
if (bOut & ChipSet.PIC_LO.ICW1) {
/*
@ -3039,13 +3039,13 @@ ChipSet.prototype.outPICLo = function(iPIC, bOut, addrFrom)
var nIRQ = (nIRL == null? undefined : pic.nIRQBase + nIRL);
if (pic.bISR & bIREnd) {
if (DEBUG && this.messageEnabled(this.messageBitsIRQ(nIRQ))) {
this.messagePrint("outPIC" + iPIC + "(0x" + str.toHexByte(pic.port) + "): IRQ " + nIRQ + " going out of service", true);
this.printMessage("outPIC" + iPIC + "(0x" + str.toHexByte(pic.port) + "): IRQ " + nIRQ + " going out of service", true);
}
pic.bISR &= ~bIREnd;
this.checkIRR();
} else {
if (DEBUG && this.messageEnabled(Messages.PIC | Messages.WARN)) {
this.messagePrint("outPIC" + iPIC + "(0x" + str.toHexByte(pic.port) + "): unexpected EOI command, IRQ " + nIRQ + " not in service", true);
this.printMessage("outPIC" + iPIC + "(0x" + str.toHexByte(pic.port) + "): unexpected EOI command, IRQ " + nIRQ + " not in service", true);
if (!SAMPLER && MAXDEBUG) this.dbg.stopCPU();
}
}
@ -3098,7 +3098,7 @@ ChipSet.prototype.inPICHi = function(iPIC, addrFrom)
var pic = this.aPICs[iPIC];
var b = pic.bIMR;
if (this.messageEnabled(Messages.PIC | Messages.PORT | Messages.CHIPSET)) {
this.messagePort(pic.port+1, null, addrFrom, "PIC" + iPIC, b, true);
this.printMessageIO(pic.port+1, null, addrFrom, "PIC" + iPIC, b, true);
}
return b;
};
@ -3115,7 +3115,7 @@ ChipSet.prototype.outPICHi = function(iPIC, bOut, addrFrom)
{
var pic = this.aPICs[iPIC];
if (this.messageEnabled(Messages.PIC | Messages.PORT | Messages.CHIPSET)) {
this.messagePort(pic.port+1, bOut, addrFrom, "PIC" + iPIC, null, true);
this.printMessageIO(pic.port+1, bOut, addrFrom, "PIC" + iPIC, null, true);
}
if (pic.nICW < pic.aICW.length) {
pic.aICW[pic.nICW++] = bOut;
@ -3174,7 +3174,7 @@ ChipSet.prototype.setIRR = function(nIRQ, nDelay)
if (!(pic.bIRR & bIRR)) {
pic.bIRR |= bIRR;
if (DEBUG && this.messageEnabled(this.messageBitsIRQ(nIRQ) | Messages.CHIPSET)) {
this.messagePrint("setIRR(" + nIRQ + ")", true);
this.printMessage("setIRR(" + nIRQ + ")", true);
}
pic.nDelay = nDelay || 0;
this.checkIRR();
@ -3196,7 +3196,7 @@ ChipSet.prototype.clearIRR = function(nIRQ)
if (pic.bIRR & bIRR) {
pic.bIRR &= ~bIRR;
if (DEBUG && this.messageEnabled(this.messageBitsIRQ(nIRQ) | Messages.CHIPSET)) {
this.messagePrint("clearIRR(" + nIRQ + ")", true);
this.printMessage("clearIRR(" + nIRQ + ")", true);
}
this.checkIRR();
}
@ -3323,7 +3323,7 @@ ChipSet.prototype.getIRRVector = function(iPIC)
var nIRQ = pic.nIRQBase + nIRL;
if (DEBUG && this.messageEnabled(this.messageBitsIRQ(nIRQ))) {
this.messagePrint("getIRRVector(): IRQ " + nIRQ + " interrupting @" + str.toHexAddr(this.cpu.regIP, this.cpu.segCS.sel) + " stack=" + str.toHexAddr(this.cpu.regSP, this.cpu.segSS.sel), true);
this.printMessage("getIRRVector(): IRQ " + nIRQ + " interrupting @" + str.toHexAddr(this.cpu.regIP, this.cpu.segCS.sel) + " stack=" + str.toHexAddr(this.cpu.regSP, this.cpu.segSS.sel), true);
}
if (MAXDEBUG && DEBUGGER) {
this.acInterrupts[nIRQ]++;
@ -3360,7 +3360,7 @@ ChipSet.prototype.inTimer = function(iTimer, addrFrom)
this.updateTimer(iTimer);
b = timer.countCurrent[timer.countIndex++];
if (this.messageEnabled(Messages.TIMER | Messages.PORT)) {
this.messagePort(ChipSet.TIMER0.PORT + iTimer, null, addrFrom, "TIMER" + iTimer, b, true);
this.printMessageIO(ChipSet.TIMER0.PORT + iTimer, null, addrFrom, "TIMER" + iTimer, b, true);
}
return b;
};
@ -3385,7 +3385,7 @@ ChipSet.prototype.inTimer = function(iTimer, addrFrom)
ChipSet.prototype.outTimer = function(iTimer, bOut, addrFrom)
{
if (this.messageEnabled(Messages.TIMER | Messages.PORT)) {
this.messagePort(ChipSet.TIMER0.PORT + iTimer, bOut, addrFrom, "TIMER" + iTimer, null, true);
this.printMessageIO(ChipSet.TIMER0.PORT + iTimer, bOut, addrFrom, "TIMER" + iTimer, null, true);
}
var timer = this.aTimers[iTimer];
if (timer.countIndex == timer.countBytes) this.resetTimerIndex(iTimer);
@ -3438,8 +3438,8 @@ ChipSet.prototype.outTimer = function(iTimer, bOut, addrFrom)
*/
ChipSet.prototype.inTimerCtrl = function(port, addrFrom)
{
this.messagePort(port, null, addrFrom, "TIMER_CTRL", null, Messages.TIMER);
if (DEBUG) this.messagePrint("TIMER_CTRL: Read-Back command not supported (yet)", Messages.TIMER);
this.printMessageIO(port, null, addrFrom, "TIMER_CTRL", null, Messages.TIMER);
if (DEBUG) this.printMessage("TIMER_CTRL: Read-Back command not supported (yet)", Messages.TIMER);
return null;
};
@ -3454,13 +3454,13 @@ ChipSet.prototype.inTimerCtrl = function(port, addrFrom)
ChipSet.prototype.outTimerCtrl = function(port, bOut, addrFrom)
{
this.bTimerCtrl = bOut;
this.messagePort(port, bOut, addrFrom, "TIMER_CTRL", null, Messages.TIMER);
this.printMessageIO(port, bOut, addrFrom, "TIMER_CTRL", null, Messages.TIMER);
/*
* Extract the SC (Select Counter) bits
*/
var iTimer = (bOut & ChipSet.TIMER_CTRL.SC) >> 6;
if (iTimer == 0x3) {
if (DEBUG) this.messagePrint("TIMER_CTRL: Read-Back command not supported (yet)", Messages.TIMER);
if (DEBUG) this.printMessage("TIMER_CTRL: Read-Back command not supported (yet)", Messages.TIMER);
return;
}
/*
@ -3512,7 +3512,7 @@ ChipSet.prototype.outTimerCtrl = function(port, bOut, addrFrom)
timer.countStart[1] = timer.countInit[1];
timer.nCyclesStart = this.cpu.getCycles(this.fScaleTimers);
if (DEBUG && this.messageEnabled(Messages.TIMER)) {
this.messagePrint("TIMER0 count reset @" + timer.nCyclesStart + " cycles", true);
this.printMessage("TIMER0 count reset @" + timer.nCyclesStart + " cycles", true);
}
}
}
@ -3715,7 +3715,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
if (ticksElapsed < 0) {
if (DEBUG && this.messageEnabled(Messages.TIMER)) {
this.messagePrint("updateTimer(" + iTimer + "): negative tick count (" + ticksElapsed + ")", true);
this.printMessage("updateTimer(" + iTimer + "): negative tick count (" + ticksElapsed + ")", true);
}
timer.nCyclesStart = nCycles;
ticksElapsed = 0;
@ -3735,7 +3735,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
if (timer.mode == ChipSet.TIMER_CTRL.MODE0) {
if (count <= 0) count = 0;
if (DEBUG && this.messageEnabled(Messages.TIMER)) {
this.messagePrint("updateTimer(" + iTimer + "): MODE0 timer count=" + count, true);
this.printMessage("updateTimer(" + iTimer + "): MODE0 timer count=" + count, true);
}
if (!count) {
timer.fOUT = true;
@ -3770,7 +3770,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
count = countInit + count;
if (count <= 0) {
if (DEBUG && this.messageEnabled(Messages.TIMER)) {
this.messagePrint("updateTimer(" + iTimer + "): underflow=" + count, true);
this.printMessage("updateTimer(" + iTimer + "): underflow=" + count, true);
}
count = countInit;
}
@ -3802,7 +3802,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
count = countInit + count;
if (count <= 0) {
if (DEBUG && this.messageEnabled(Messages.TIMER)) {
this.messagePrint("updateTimer(" + iTimer + "): underflow=" + count, true);
this.printMessage("updateTimer(" + iTimer + "): underflow=" + count, true);
}
count = countInit;
}
@ -3866,7 +3866,7 @@ ChipSet.prototype.inPPIA = function(port, addrFrom)
b = this.kbd.readScanCode();
}
}
this.messagePort(port, null, addrFrom, "PPI_A", b);
this.printMessageIO(port, null, addrFrom, "PPI_A", b);
return b;
};
@ -3880,7 +3880,7 @@ ChipSet.prototype.inPPIA = function(port, addrFrom)
*/
ChipSet.prototype.outPPIA = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "PPI_A");
this.printMessageIO(port, bOut, addrFrom, "PPI_A");
this.bPPIA = bOut;
};
@ -3895,7 +3895,7 @@ ChipSet.prototype.outPPIA = function(port, bOut, addrFrom)
ChipSet.prototype.inPPIB = function(port, addrFrom)
{
var b = this.bPPIB;
this.messagePort(port, null, addrFrom, "PPI_B", b);
this.printMessageIO(port, null, addrFrom, "PPI_B", b);
return b;
};
@ -3909,7 +3909,7 @@ ChipSet.prototype.inPPIB = function(port, addrFrom)
*/
ChipSet.prototype.outPPIB = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "PPI_B");
this.printMessageIO(port, bOut, addrFrom, "PPI_B");
this.updatePPIB(bOut);
if (this.kbd) this.kbd.setEnable((bOut & ChipSet.PPI_B.CLEAR_KBD)? false : true, (bOut & ChipSet.PPI_B.CLK_KBD)? true : false);
};
@ -3986,7 +3986,7 @@ ChipSet.prototype.inPPIC = function(port, addrFrom)
* The ROM BIOS polls this port incessantly during its memory tests, checking for memory parity errors
* (which of course we never report), so we further restrict these port messages to MESSAGE_MEM.
*/
this.messagePort(port, null, addrFrom, "PPI_C", b, Messages.CHIPSET | Messages.MEM);
this.printMessageIO(port, null, addrFrom, "PPI_C", b, Messages.CHIPSET | Messages.MEM);
return b;
};
@ -4000,7 +4000,7 @@ ChipSet.prototype.inPPIC = function(port, addrFrom)
*/
ChipSet.prototype.outPPIC = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "PPI_C");
this.printMessageIO(port, bOut, addrFrom, "PPI_C");
this.bPPIC = bOut;
};
@ -4015,7 +4015,7 @@ ChipSet.prototype.outPPIC = function(port, bOut, addrFrom)
ChipSet.prototype.inPPICtrl = function(port, addrFrom)
{
var b = this.bPPICtrl;
this.messagePort(port, null, addrFrom, "PPI_CTRL", b);
this.printMessageIO(port, null, addrFrom, "PPI_CTRL", b);
return b;
};
@ -4029,7 +4029,7 @@ ChipSet.prototype.inPPICtrl = function(port, addrFrom)
*/
ChipSet.prototype.outPPICtrl = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "PPI_CTRL");
this.printMessageIO(port, bOut, addrFrom, "PPI_CTRL");
this.bPPICtrl = bOut;
};
@ -4044,7 +4044,7 @@ ChipSet.prototype.outPPICtrl = function(port, bOut, addrFrom)
ChipSet.prototype.in8042OutBuff = function(port, addrFrom)
{
var b = this.b8042OutBuff;
this.messagePort(port, null, addrFrom, "8042_OUTBUFF", b, Messages.C8042);
this.printMessageIO(port, null, addrFrom, "8042_OUTBUFF", b, Messages.C8042);
this.b8042Status &= ~(ChipSet.KBC.STATUS.OUTBUFF_FULL | ChipSet.KBC.STATUS.OUTBUFF_DELAY);
if (this.kbd) this.kbd.checkScanCode();
return b;
@ -4064,7 +4064,7 @@ ChipSet.prototype.in8042OutBuff = function(port, addrFrom)
*/
ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "8042_INBUF.DATA", null, Messages.C8042);
this.printMessageIO(port, bOut, addrFrom, "8042_INBUF.DATA", null, Messages.C8042);
if (this.b8042Status & ChipSet.KBC.STATUS.CMD_FLAG) {
switch (this.b8042InBuff) {
@ -4190,7 +4190,7 @@ ChipSet.prototype.in8042RWReg = function(port, addrFrom)
* Thanks to the WAITF function, this has become a very "busy" port, so let's not generate messages
* unless both MESSAGE_8042 *and* MESSAGE_LOG are set.
*/
this.messagePort(port, null, addrFrom, "8042_RWREG", b, Messages.C8042);
this.printMessageIO(port, null, addrFrom, "8042_RWREG", b, Messages.C8042);
return b;
};
@ -4204,7 +4204,7 @@ ChipSet.prototype.in8042RWReg = function(port, addrFrom)
*/
ChipSet.prototype.out8042RWReg = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "8042_RWREG", null, Messages.C8042);
this.printMessageIO(port, bOut, addrFrom, "8042_RWREG", null, Messages.C8042);
this.updatePPIB(bOut);
};
@ -4218,7 +4218,7 @@ ChipSet.prototype.out8042RWReg = function(port, bOut, addrFrom)
*/
ChipSet.prototype.in8042Status = function(port, addrFrom)
{
this.messagePort(port, null, addrFrom, "8042_STATUS", this.b8042Status, Messages.C8042);
this.printMessageIO(port, null, addrFrom, "8042_STATUS", this.b8042Status, Messages.C8042);
var b = this.b8042Status & 0xff;
/*
* There's code in the 5170 BIOS (F000:03BF) that writes an 8042 command (0xAA), waits for
@ -4256,7 +4256,7 @@ ChipSet.prototype.in8042Status = function(port, addrFrom)
*/
ChipSet.prototype.out8042InBuffCmd = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "8042_INBUFF.CMD", null, Messages.C8042);
this.printMessageIO(port, bOut, addrFrom, "8042_INBUFF.CMD", null, Messages.C8042);
this.assert(!(this.b8042Status & ChipSet.KBC.STATUS.INBUFF_FULL));
this.b8042InBuff = bOut;
@ -4285,7 +4285,7 @@ ChipSet.prototype.out8042InBuffCmd = function(port, bOut, addrFrom)
case ChipSet.KBC.CMD.DISABLE_KBD: // 0xAD
this.set8042CmdData(this.b8042CmdData | ChipSet.KBC.DATA.CMD.NO_CLOCK);
if (DEBUG) this.messagePrint("keyboard disabled", Messages.KEYBOARD | Messages.PORT);
if (DEBUG) this.printMessage("keyboard disabled", Messages.KEYBOARD | Messages.PORT);
/*
* NOTE: The MODEL_5170 BIOS calls "KBD_RESET" (F000:17D2) while the keyboard interface is disabled,
* yet we must still deliver the Keyboard's CMDRES.BAT_OK response code? Seems like an odd thing for
@ -4296,13 +4296,13 @@ ChipSet.prototype.out8042InBuffCmd = function(port, bOut, addrFrom)
case ChipSet.KBC.CMD.ENABLE_KBD: // 0xAE
this.set8042CmdData(this.b8042CmdData & ~ChipSet.KBC.DATA.CMD.NO_CLOCK);
if (this.kbd) this.kbd.checkScanCode();
if (DEBUG) this.messagePrint("keyboard re-enabled", Messages.KEYBOARD | Messages.PORT);
if (DEBUG) this.printMessage("keyboard re-enabled", Messages.KEYBOARD | Messages.PORT);
break;
case ChipSet.KBC.CMD.SELF_TEST: // 0xAA
if (this.kbd) this.kbd.flushScanCode();
this.set8042CmdData(this.b8042CmdData | ChipSet.KBC.DATA.CMD.NO_CLOCK);
if (DEBUG) this.messagePrint("keyboard disabled on reset", Messages.KEYBOARD | Messages.PORT);
if (DEBUG) this.printMessage("keyboard disabled on reset", Messages.KEYBOARD | Messages.PORT);
this.set8042OutBuff(ChipSet.KBC.DATA.SELF_TEST.OK);
this.set8042OutPort(ChipSet.KBC.OUTPORT.NO_RESET | ChipSet.KBC.OUTPORT.A20_ON);
break;
@ -4324,7 +4324,7 @@ ChipSet.prototype.out8042InBuffCmd = function(port, bOut, addrFrom)
default:
if (DEBUG && this.messageEnabled(Messages.C8042)) {
this.messagePrint("unrecognized 8042 command: " + str.toHexByte(this.b8042InBuff), true);
this.printMessage("unrecognized 8042 command: " + str.toHexByte(this.b8042InBuff), true);
this.dbg.stopCPU();
}
break;
@ -4377,7 +4377,7 @@ ChipSet.prototype.set8042OutBuff = function(b)
this.b8042Status &= ~ChipSet.KBC.STATUS.OUTBUFF_FULL;
this.b8042Status |= ChipSet.KBC.STATUS.OUTBUFF_DELAY;
if (DEBUG && this.messageEnabled(Messages.KEYBOARD | Messages.PORT)) {
this.messagePrint("set8042OutBuff(0x" + str.toHexByte(b) + ")", true);
this.printMessage("set8042OutBuff(0x" + str.toHexByte(b) + ")", true);
}
}
};
@ -4399,7 +4399,7 @@ ChipSet.prototype.set8042OutPort = function(b)
* determine if that's what the caller intended.
*/
if (DEBUG && this.messageEnabled(Messages.C8042)) {
this.messagePrint("unexpected 8042 output port reset: " + str.toHexByte(b), true);
this.printMessage("unexpected 8042 output port reset: " + str.toHexByte(b), true);
this.dbg.stopCPU();
}
this.cpu.resetRegs();
@ -4509,12 +4509,12 @@ ChipSet.prototype.notifyKbdData = function(b)
}
else {
if (DEBUG && this.messageEnabled(Messages.KEYBOARD | Messages.PORT)) {
this.messagePrint("notifyKbdData(0x" + str.toHexByte(b) + "): output buffer full", true);
this.printMessage("notifyKbdData(0x" + str.toHexByte(b) + "): output buffer full", true);
}
}
} else {
if (DEBUG && this.messageEnabled(Messages.KEYBOARD | Messages.PORT)) {
this.messagePrint("notifyKbdData(0x" + str.toHexByte(b) + "): disabled", true);
this.printMessage("notifyKbdData(0x" + str.toHexByte(b) + "): disabled", true);
}
}
}
@ -4530,7 +4530,7 @@ ChipSet.prototype.notifyKbdData = function(b)
*/
ChipSet.prototype.inCMOSAddr = function(port, addrFrom)
{
this.messagePort(port, null, addrFrom, "CMOS.ADDR", this.bCMOSAddr, Messages.CMOS);
this.printMessageIO(port, null, addrFrom, "CMOS.ADDR", this.bCMOSAddr, Messages.CMOS);
return this.bCMOSAddr;
};
@ -4544,7 +4544,7 @@ ChipSet.prototype.inCMOSAddr = function(port, addrFrom)
*/
ChipSet.prototype.outCMOSAddr = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "CMOS.ADDR", null, Messages.CMOS);
this.printMessageIO(port, bOut, addrFrom, "CMOS.ADDR", null, Messages.CMOS);
this.bCMOSAddr = bOut;
this.bNMI = (bOut & ChipSet.CMOS.ADDR.NMI_DISABLE)? ChipSet.NMI.DISABLE : ChipSet.NMI.ENABLE;
};
@ -4562,7 +4562,7 @@ ChipSet.prototype.inCMOSData = function(port, addrFrom)
var bAddr = this.bCMOSAddr & ChipSet.CMOS.ADDR.MASK;
var bIn = (bAddr <= ChipSet.CMOS.ADDR.STATUSD? this.getRTCByte(bAddr) : this.abCMOSData[bAddr]);
if (this.messageEnabled(Messages.CMOS | Messages.PORT)) {
this.messagePort(port, null, addrFrom, "CMOS.DATA[" + str.toHexByte(bAddr) + "]", bIn, true);
this.printMessageIO(port, null, addrFrom, "CMOS.DATA[" + str.toHexByte(bAddr) + "]", bIn, true);
}
if (addrFrom != null) {
if (bAddr == ChipSet.CMOS.ADDR.STATUSC) {
@ -4577,7 +4577,7 @@ ChipSet.prototype.inCMOSData = function(port, addrFrom)
* occurs in a timely manner, too.
*/
if ((bIn & ChipSet.CMOS.STATUSC.PF) && (this.abCMOSData[ChipSet.CMOS.ADDR.STATUSB] & ChipSet.CMOS.STATUSB.PIE)) {
if (DEBUG) this.messagePrint("RTC periodic interrupt cleared", Messages.RTC);
if (DEBUG) this.printMessage("RTC periodic interrupt cleared", Messages.RTC);
this.setRTCCycleLimit();
}
}
@ -4597,16 +4597,16 @@ ChipSet.prototype.outCMOSData = function(port, bOut, addrFrom)
{
var bAddr = this.bCMOSAddr & ChipSet.CMOS.ADDR.MASK;
if (this.messageEnabled(Messages.CMOS | Messages.PORT)) {
this.messagePort(port, bOut, addrFrom, "CMOS.DATA[" + str.toHexByte(bAddr) + "]", null, true);
this.printMessageIO(port, bOut, addrFrom, "CMOS.DATA[" + str.toHexByte(bAddr) + "]", null, true);
}
var bDelta = bOut ^ this.abCMOSData[bAddr];
this.abCMOSData[bAddr] = (bAddr <= ChipSet.CMOS.ADDR.STATUSD? this.setRTCByte(bAddr, bOut) : bOut);
if (bAddr == ChipSet.CMOS.ADDR.STATUSB && (bDelta & ChipSet.CMOS.STATUSB.PIE)) {
if (bOut & ChipSet.CMOS.STATUSB.PIE) {
if (DEBUG) this.messagePrint("RTC periodic interrupts enabled", Messages.RTC);
if (DEBUG) this.printMessage("RTC periodic interrupts enabled", Messages.RTC);
this.setRTCCycleLimit();
} else {
if (DEBUG) this.messagePrint("RTC periodic interrupts disabled", Messages.RTC);
if (DEBUG) this.printMessage("RTC periodic interrupts disabled", Messages.RTC);
}
}
};
@ -4621,7 +4621,7 @@ ChipSet.prototype.outCMOSData = function(port, bOut, addrFrom)
*/
ChipSet.prototype.inMFGData = function(port, addrFrom)
{
this.messagePort(port, null, addrFrom, "MFG_DATA", this.bMFGData);
this.printMessageIO(port, null, addrFrom, "MFG_DATA", this.bMFGData);
return this.bMFGData;
};
@ -4635,7 +4635,7 @@ ChipSet.prototype.inMFGData = function(port, addrFrom)
*/
ChipSet.prototype.outMFGData = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "MFG_DATA");
this.printMessageIO(port, bOut, addrFrom, "MFG_DATA");
this.bMFGData = bOut;
};
@ -4651,7 +4651,7 @@ ChipSet.prototype.outMFGData = function(port, bOut, addrFrom)
*/
ChipSet.prototype.outNMI = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "NMI");
this.printMessageIO(port, bOut, addrFrom, "NMI");
this.bNMI = bOut;
};
@ -4670,7 +4670,7 @@ ChipSet.prototype.outCoprocClear = function(port, bOut, addrFrom)
/*
* TODO: Implement
*/
this.messagePort(port, bOut, addrFrom, "COPROC.CLEAR");
this.printMessageIO(port, bOut, addrFrom, "COPROC.CLEAR");
this.assert(!bOut);
};
@ -4689,7 +4689,7 @@ ChipSet.prototype.outCoprocReset = function(port, bOut, addrFrom)
/*
* TODO: Implement
*/
this.messagePort(port, bOut, addrFrom, "COPROC.RESET");
this.printMessageIO(port, bOut, addrFrom, "COPROC.RESET");
this.assert(!bOut);
};
@ -4786,13 +4786,13 @@ ChipSet.prototype.setSpeaker = function(fOn)
if (fOn) {
if (this.sourceAudio) {
this.sourceAudio['frequency']['value'] = freq;
if (this.messageEnabled(Messages.SPEAKER)) this.messagePrint("speaker set to " + freq + "hz", true);
if (this.messageEnabled(Messages.SPEAKER)) this.printMessage("speaker set to " + freq + "hz", true);
} else {
this.sourceAudio = this.contextAudio['createOscillator']();
this.sourceAudio['type'] = 1; // 0: sine wave, 1: square wave, 2: sawtooth wave, 3: triangle wave
this.sourceAudio['connect'](this.contextAudio['destination']);
this.sourceAudio['frequency']['value'] = freq;
if (this.messageEnabled(Messages.SPEAKER)) this.messagePrint("speaker on at " + freq + "hz", true);
if (this.messageEnabled(Messages.SPEAKER)) this.printMessage("speaker on at " + freq + "hz", true);
this.sourceAudio['noteOn'](0); // aka start()
}
} else {
@ -4800,11 +4800,11 @@ ChipSet.prototype.setSpeaker = function(fOn)
this.sourceAudio['noteOff'](0); // aka stop()
this.sourceAudio['disconnect'](); // QUESTION: is this automatic following a stop(), since this particular source cannot be started again?
delete this.sourceAudio; // QUESTION: ditto?
if (this.messageEnabled(Messages.SPEAKER)) this.messagePrint("speaker off at " + freq + "hz", true);
if (this.messageEnabled(Messages.SPEAKER)) this.printMessage("speaker off at " + freq + "hz", true);
}
}
} else if (fOn) {
this.messagePrint("BEEP", Messages.SPEAKER);
this.printMessage("BEEP", Messages.SPEAKER);
}
};

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -174,7 +174,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
}
}
if (DEBUG && this.messageEnabled()) this.messagePrint("PREFETCH: " + PREFETCH + ", TYPEDARRAYS: " + TYPEDARRAYS);
if (DEBUG && this.messageEnabled()) this.printMessage("PREFETCH: " + PREFETCH + ", TYPEDARRAYS: " + TYPEDARRAYS);
/*
* Iterate through all the components again and call their initBus() handler, if any
@ -260,7 +260,7 @@ Component.subclass(Component, Computer);
*/
Computer.sAppName = APPNAME || "PCjs";
Computer.sAppVer = APPVERSION;
Computer.sCopyright = "Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>";
Computer.sCopyright = "Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>";
/*
* I think it's a good idea to also display a GPL notice, putting people on notice that even
@ -320,7 +320,7 @@ Computer.prototype.onLoadSetReady = function(sStateFile, sStateData, nErrorCode)
if (!nErrorCode) {
this.sStateData = sStateData;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("loaded state file " + sStateFile.replace(this.sUserID || "xxx", "xxx"));
this.printMessage("loaded state file " + sStateFile.replace(this.sUserID || "xxx", "xxx"));
}
} else {
this.sResumePath = null;
@ -362,7 +362,7 @@ Computer.prototype.wait = function(fn, parms)
return;
}
}
if (DEBUG && this.messageEnabled()) this.messagePrint("Computer.wait(ready)");
if (DEBUG && this.messageEnabled()) this.printMessage("Computer.wait(ready)");
fn.call(this, parms);
};
@ -388,7 +388,7 @@ Computer.prototype.validateState = function(stateComputer)
if (!stateComputer) stateValidate.clear();
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("Last state: " + sTimestampComputer + " (validate: " + sTimestampValidate + ")");
this.printMessage("Last state: " + sTimestampComputer + " (validate: " + sTimestampValidate + ")");
}
}
}
@ -410,7 +410,7 @@ Computer.prototype.powerOn = function(resume)
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint("Computer.powerOn(" + (resume == Computer.RESUME_REPOWER ? "repower" : (resume ? "resume" : "")) + ")");
this.printMessage("Computer.powerOn(" + (resume == Computer.RESUME_REPOWER ? "repower" : (resume ? "resume" : "")) + ")");
}
var fRepower = false;
@ -649,7 +649,7 @@ Computer.prototype.donePowerOn = function(aParms)
var fRestore = aParms[2];
if (DEBUG && this.aFlags.fPowered && this.messageEnabled()) {
this.messagePrint("Computer.donePowerOn(): redundant");
this.printMessage("Computer.donePowerOn(): redundant");
}
this.aFlags.fPowered = true;
@ -735,7 +735,7 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
var sState = "none";
if (DEBUG && this.messageEnabled()) {
this.messagePrint("Computer.powerOff(" + (fSave ? "save" : "nosave") + (fShutdown ? ",shutdown" : "") + ")");
this.printMessage("Computer.powerOff(" + (fSave ? "save" : "nosave") + (fShutdown ? ",shutdown" : "") + ")");
}
var stateComputer = new State(this, Computer.sAppVer);
@ -842,14 +842,14 @@ Computer.prototype.powerOff = function(fSave, fShutdown)
Computer.prototype.reset = function()
{
if (this.bus && this.bus.reset) {
this.messagePrint("Resetting " + this.bus.type);
this.printMessage("Resetting " + this.bus.type);
this.bus.reset();
}
var aComponents = Component.getComponents(this.id);
for (var iComponent = 0; iComponent < aComponents.length; iComponent++) {
var component = aComponents[iComponent];
if (component !== this && component !== this.bus && component.reset) {
this.messagePrint("Resetting " + component.type);
this.printMessage("Resetting " + component.type);
component.reset();
}
}
@ -989,7 +989,7 @@ Computer.prototype.verifyUserID = function(sUserID)
{
this.sUserID = null;
var fMessages = DEBUG && this.messageEnabled();
if (fMessages) this.messagePrint("verifyUserID(" + sUserID + ")");
if (fMessages) this.printMessage("verifyUserID(" + sUserID + ")");
var sRequest = web.getHost() + UserAPI.ENDPOINT + '?' + UserAPI.QUERY.REQ + '=' + UserAPI.REQ.VERIFY + '&' + UserAPI.QUERY.USER + '=' + sUserID;
var response = web.loadResource(sRequest);
var nErrorCode = response[0];
@ -999,16 +999,16 @@ Computer.prototype.verifyUserID = function(sUserID)
response = eval("(" + sResponse + ")");
if (response.code && response.code == UserAPI.CODE.OK) {
web.setLocalStorageItem(Computer.STATE_USERID, response.data);
if (fMessages) this.messagePrint(Computer.STATE_USERID + " updated: " + response.data);
if (fMessages) this.printMessage(Computer.STATE_USERID + " updated: " + response.data);
this.sUserID = response.data;
} else {
if (fMessages) this.messagePrint(response.code + ": " + response.data);
if (fMessages) this.printMessage(response.code + ": " + response.data);
}
} catch (e) {
Component.error(e.message + " (" + sResponse + ")");
}
} else {
if (fMessages) this.messagePrint("invalid response (error " + nErrorCode + ")");
if (fMessages) this.printMessage("invalid response (error " + nErrorCode + ")");
}
return this.sUserID;
};
@ -1024,12 +1024,12 @@ Computer.prototype.getServerStatePath = function()
var sStatePath = null;
if (this.sUserID) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint(Computer.STATE_USERID + " for load: " + this.sUserID);
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.sAppVer);
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint(Computer.STATE_USERID + " unavailable");
this.printMessage(Computer.STATE_USERID + " unavailable");
}
}
return sStatePath;
@ -1051,7 +1051,7 @@ Computer.prototype.saveServerState = function(sUserID, sState)
*/
if (sState) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("size of server state: " + sState.length + " bytes");
this.printMessage("size of server state: " + sState.length + " bytes");
}
var response = this.storeServerState(sUserID, sState, true);
if (response && response[UserAPI.RES.CODE] == UserAPI.CODE.OK) {
@ -1068,7 +1068,7 @@ Computer.prototype.saveServerState = function(sUserID, sState)
}
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("no state to store");
this.printMessage("no state to store");
}
}
};
@ -1085,7 +1085,7 @@ Computer.prototype.saveServerState = function(sUserID, sState)
Computer.prototype.storeServerState = function(sUserID, sState, fSync)
{
if (DEBUG && this.messageEnabled()) {
this.messagePrint(Computer.STATE_USERID + " for store: " + sUserID);
this.printMessage(Computer.STATE_USERID + " for store: " + sUserID);
}
/*
* TODO: Determine whether or not any browsers cancel our request if we're called during a browser "shutdown" event,
@ -1110,7 +1110,7 @@ Computer.prototype.storeServerState = function(sUserID, sState, fSync)
}
sResponse = '{"' + UserAPI.RES.CODE + '":' + response[0] + ',"' + UserAPI.RES.DATA + '":"' + sResponse + '"}';
}
if (DEBUG && this.messageEnabled()) this.messagePrint(sResponse);
if (DEBUG && this.messageEnabled()) this.printMessage(sResponse);
return JSON.parse(sResponse);
}
return null;
@ -1217,7 +1217,7 @@ Computer.init = function()
var computer = new Computer(parmsComputer, parmsMachine, true);
if (DEBUG && computer.messageEnabled()) {
computer.messagePrint("onInit(" + computer.aFlags.fPowered + ")");
computer.printMessage("onInit(" + computer.aFlags.fPowered + ")");
}
/*
@ -1255,7 +1255,7 @@ Computer.show = function()
if (computer) {
if (DEBUG && computer.messageEnabled()) {
computer.messagePrint("onShow(" + computer.fInitialized + "," + computer.aFlags.fPowered + ")");
computer.printMessage("onShow(" + computer.fInitialized + "," + computer.aFlags.fPowered + ")");
}
if (computer.fInitialized && !computer.aFlags.fPowered) {
@ -1304,7 +1304,7 @@ Computer.exit = function()
if (computer) {
if (DEBUG && computer.messageEnabled()) {
computer.messagePrint("onExit(" + computer.aFlags.fPowered + ")");
computer.printMessage("onExit(" + computer.aFlags.fPowered + ")");
}
if (computer.aFlags.fPowered) {

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-21
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Nov-26
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -445,7 +445,7 @@ Disk.prototype.create = function(mode, nCylinders, nHeads, nSectors, cbSector)
*/
if (this.mode != DiskAPI.MODE.PRELOAD) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("blank disk for \"" + this.sDiskName + "\": " + this.nCylinders + " cylinders, " + this.nHeads + " head(s)");
this.printMessage("blank disk for \"" + this.sDiskName + "\": " + this.nCylinders + " cylinders, " + this.nHeads + " head(s)");
}
var aCylinders = new Array(this.nCylinders);
for (var iCylinder = 0; iCylinder < aCylinders.length; iCylinder++) {
@ -506,7 +506,7 @@ Disk.prototype.load = function(sDiskName, sDiskPath, file, fnNotify, controller)
if (DEBUG) {
var sMessage = 'load("' + sDiskName + '","' + sDiskPath + '")';
this.controller.log(sMessage);
this.messagePrint(sMessage);
this.printMessage(sMessage);
}
if (this.fnNotify) {
@ -661,7 +661,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
if (this.fOnDemand) {
if (!nErrorCode) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint('doneLoad("' + sDiskFile + '","' + sDiskPath + '")');
this.printMessage('doneLoad("' + sDiskFile + '","' + sDiskPath + '")');
}
this.fRemote = true;
this.buildFileTable();
@ -681,7 +681,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
this.controller.notice("Unable to load disk \"" + this.sDiskName + "\" (error " + nErrorCode + ")", fPrintOnly);
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint('doneLoad("' + sDiskFile + '","' + sDiskPath + '")');
this.printMessage('doneLoad("' + sDiskFile + '","' + sDiskPath + '")');
}
try {
/*
@ -779,7 +779,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
var sHeads = nHeads + " head" + (nHeads > 1 ? "s" : "");
var nSectorsPerTrack = aDiskData[0][0].length;
var sSectorsPerTrack = nSectorsPerTrack + " sector" + (nSectorsPerTrack > 1 ? "s" : "") + "/track";
this.messagePrint(sCylinders + ", " + sHeads + ", " + sSectorsPerTrack);
this.printMessage(sCylinders + ", " + sHeads + ", " + sSectorsPerTrack);
}
/*
* Before the image is usable, we must "normalize" all the sectors. In the past, this meant
@ -898,7 +898,7 @@ Disk.prototype.buildFileTable = function()
var sectorBoot = this.getSector(0);
if (!sectorBoot) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("buildFileTable(): unable to read boot sector");
this.printMessage("buildFileTable(): unable to read boot sector");
}
return;
}
@ -953,7 +953,7 @@ Disk.prototype.buildFileTable = function()
}
if (!fValid) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("buildFileTable(): unrecognized " + cbDisk + "-byte disk image with " + this.cbSector + "-byte sectors");
this.printMessage("buildFileTable(): unrecognized " + cbDisk + "-byte disk image with " + this.cbSector + "-byte sectors");
}
return;
}
@ -991,7 +991,7 @@ Disk.prototype.buildFileTable = function()
dir.iClusterMax = (dir.nFATBits == 12? DiskAPI.FAT12.CLUSNUM_MAX : DiskAPI.FAT16.CLUSNUM_MAX);
if (DEBUG && this.messageEnabled()) {
this.messagePrint("buildFileTable()\n\tlbaFAT: " + dir.lbaFAT + "\n\tlbaRoot: " + dir.lbaRoot + "\n\tlbaData: " + dir.lbaData + "\n\tlbaTotal: " + dir.lbaTotal + "\n\tnClusterSecs: " + dir.nClusterSecs + "\n\tnClusters: " + dir.nClusters);
this.printMessage("buildFileTable()\n\tlbaFAT: " + dir.lbaFAT + "\n\tlbaRoot: " + dir.lbaRoot + "\n\tlbaData: " + dir.lbaData + "\n\tlbaTotal: " + dir.lbaTotal + "\n\tnClusterSecs: " + dir.nClusterSecs + "\n\tnClusters: " + dir.nClusters);
}
/*
@ -1001,7 +1001,7 @@ Disk.prototype.buildFileTable = function()
i = (dir.lbaTotal - dir.lbaData) % dir.nClusterSecs;
if (i) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("buildFileTable(): " + cbDisk + "-byte disk image wasting " + i + " sectors");
this.printMessage("buildFileTable(): " + cbDisk + "-byte disk image wasting " + i + " sectors");
}
}
@ -1048,7 +1048,7 @@ Disk.prototype.getDir = function(dir, sDisk, sDir, apba)
dir.sDir = sDir + "\\";
if (DEBUG && this.messageEnabled()) this.messagePrint('getDir("' + sDisk + '","' + dir.sDir + '")');
if (DEBUG && this.messageEnabled()) this.printMessage('getDir("' + sDisk + '","' + dir.sDir + '")');
for (var iSector = 0; iSector < apba.length; iSector++) {
var pba = apba[iSector];
@ -1060,8 +1060,8 @@ Disk.prototype.getDir = function(dir, sDisk, sDir, apba)
if (dir.sName == null || dir.sName == "." || dir.sName == "..") continue;
var sPath = dir.sDir + dir.sName;
if (DEBUG && this.messageEnabled(Messages.DISK | Messages.DATA)) {
this.messagePrint('"' + sPath + '" size=' + dir.cbSize + ' cluster=' + dir.iCluster + ' sectors=' + JSON.stringify(dir.apba));
if (dir.apba.length) this.messagePrint(this.dumpSector(this.getSector(dir.apba[0]), dir.apba[0], sPath));
this.printMessage('"' + sPath + '" size=' + dir.cbSize + ' cluster=' + dir.iCluster + ' sectors=' + JSON.stringify(dir.apba));
if (dir.apba.length) this.printMessage(this.dumpSector(this.getSector(dir.apba[0]), dir.apba[0], sPath));
}
this.aFileTable.push({sPath: sPath, sName: dir.sName, bAttr: dir.bAttr, cbSize: dir.cbSize, apba: dir.apba, disk: this});
}
@ -1116,7 +1116,7 @@ Disk.prototype.getDirEntry = function(dir, pba, i)
dir.pbaDirCache = pba;
dir.sectorDirCache = this.getSector(dir.pbaDirCache);
if (DEBUG && this.messageEnabled(Messages.DISK | Messages.DATA)) {
this.messagePrint(this.dumpSector(dir.sectorDirCache, dir.pbaDirCache, dir.sDir));
this.printMessage(this.dumpSector(dir.sectorDirCache, dir.pbaDirCache, dir.sDir));
}
}
if (dir.sectorDirCache) {
@ -1251,7 +1251,7 @@ Disk.prototype.updateSector = function(file, pba, off)
this.assert(sector['sector'] == iSector +1);
if (sector.file) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint('"' + sector.file.sPath + '" cross-linked at offset ' + sector.file.offFile + ' with "' + file.sPath + '" at offset ' + off);
this.printMessage('"' + sector.file.sPath + '" cross-linked at offset ' + sector.file.offFile + ' with "' + file.sPath + '" at offset ' + off);
}
return false;
}
@ -1259,7 +1259,7 @@ Disk.prototype.updateSector = function(file, pba, off)
sector.offFile = off;
return true;
}
if (DEBUG && this.messageEnabled()) this.messagePrint("unable to map PBA " + pba + " to CHS");
if (DEBUG && this.messageEnabled()) this.printMessage("unable to map PBA " + pba + " to CHS");
return false;
};
@ -1384,7 +1384,7 @@ Disk.prototype.connectRemoteDisk = function(sDiskPath)
Disk.prototype.readRemoteSectors = function(iCylinder, iHead, iSector, nSectors, fAsync, done)
{
if (DEBUG && this.messageEnabled()) {
this.messagePrint("readRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ")");
this.printMessage("readRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ")");
}
if (this.fRemote) {
@ -1434,7 +1434,7 @@ Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode,
var sector = this.seek(iCylinder, iHead, iSector, true);
if (!sector) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("doneReadRemoteSectors(): seek(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ") failed");
this.printMessage("doneReadRemoteSectors(): seek(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ") failed");
}
break;
}
@ -1449,7 +1449,7 @@ Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode,
fAsync = sectorInfo[4];
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("doneReadRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ") returned error " + nErrorCode);
this.printMessage("doneReadRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ") returned error " + nErrorCode);
}
}
var done = sectorInfo[5];
@ -1479,7 +1479,7 @@ Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode,
Disk.prototype.writeRemoteSectors = function(iCylinder, iHead, iSector, nSectors, abSectors, fAsync)
{
if (DEBUG && this.messageEnabled()) {
this.messagePrint("writeRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ")");
this.printMessage("writeRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ")");
}
if (this.fRemote) {
@ -1525,7 +1525,7 @@ Disk.prototype.doneWriteRemoteSectors = function(sURLName, sURLData, nErrorCode,
}
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("doneWriteRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + sector['sector'] + ") returned error " + nErrorCode);
this.printMessage("doneWriteRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + sector['sector'] + ") returned error " + nErrorCode);
}
this.queueDirtySector(sector, false);
}
@ -1584,7 +1584,7 @@ Disk.prototype.queueDirtySector = function(sector, fAsync)
this.aDirtyTimestamps.push(usr.getTime());
if (DEBUG && this.messageEnabled()) {
this.messagePrint("queueDirtySector(CHS=" + sector.iCylinder + ':' + sector.iHead + ':' + sector['sector'] + "): " + this.aDirtySectors.length + " dirty");
this.printMessage("queueDirtySector(CHS=" + sector.iCylinder + ':' + sector.iHead + ':' + sector['sector'] + "): " + this.aDirtySectors.length + " dirty");
}
return fAsync && this.updateWriteTimer();
@ -1655,7 +1655,7 @@ Disk.prototype.findDirtySectors = function(fAsync)
var j = this.aDirtySectors.indexOf(sectorNext);
this.assert(j >= 0, "findDirtySectors(CHS=" + iCylinder + ':' + iHead + ':' + sectorNext['sector'] + ") missing from aDirtySectors");
if (DEBUG && this.messageEnabled()) {
this.messagePrint("findDirtySectors(CHS=" + iCylinder + ':' + iHead + ':' + sectorNext['sector'] + ")");
this.printMessage("findDirtySectors(CHS=" + iCylinder + ':' + iHead + ':' + sectorNext['sector'] + ")");
}
this.aDirtySectors.splice(j, 1);
this.aDirtyTimestamps.splice(j, 1);
@ -1830,7 +1830,7 @@ Disk.prototype.read = function(sector, ibSector, fCompare)
var b = -1;
if (sector) {
if (DEBUG && !ibSector && !fCompare && this.messageEnabled()) {
this.messagePrint('read("' + this.sDiskFile + '",CHS=' + sector.iCylinder + ':' + sector.iHead + ':' + sector['sector'] + ')');
this.printMessage('read("' + this.sDiskFile + '",CHS=' + sector.iCylinder + ':' + sector.iHead + ':' + sector['sector'] + ')');
}
if (ibSector < sector['length']) {
var adw = sector['data'];
@ -1857,7 +1857,7 @@ Disk.prototype.write = function(sector, ibSector, b)
return false;
if (DEBUG && !ibSector && this.messageEnabled()) {
this.messagePrint('write("' + this.sDiskFile + '",CHS=' + sector.iCylinder + ':' + sector.iHead + ':' + sector['sector'] + ')');
this.printMessage('write("' + this.sDiskFile + '",CHS=' + sector.iCylinder + ':' + sector.iHead + ':' + sector['sector'] + ')');
}
if (ibSector < sector['length']) {
@ -1929,7 +1929,7 @@ Disk.prototype.save = function()
}
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint('save("' + this.sDiskName + '"): saved ' + (deltas.length - 1) + ' change(s)');
this.printMessage('save("' + this.sDiskName + '"): saved ' + (deltas.length - 1) + ' change(s)');
}
return deltas;
};
@ -2059,7 +2059,7 @@ Disk.prototype.restore = function(deltas)
this.controller.notice("unable to restore disk '" + this.sDiskName + ": " + sReason);
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint('restore("' + this.sDiskName + '"): restored ' + nChanges + ' change(s)');
this.printMessage('restore("' + this.sDiskName + '"): restored ' + nChanges + ' change(s)');
}
}
return nChanges;

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Aug-09
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -781,7 +781,7 @@ FDC.prototype.initController = function(data)
this.regControl = data[i] || FDC.REG_CONTROL.RATE500K; // default to maximum data rate
if (DEBUG && this.messageEnabled()) {
this.messagePrint("FDC initialized for " + this.aDrives.length + " drive(s)");
this.printMessage("FDC initialized for " + this.aDrives.length + " drive(s)");
}
return fSuccess;
};
@ -1287,7 +1287,7 @@ FDC.prototype.loadDiskette = function(iDrive, sDisketteName, sDiskettePath, fAut
if (fAutoMount) {
drive.fAutoMount = true;
this.cAutoMount++;
if (this.messageEnabled()) this.messagePrint("loading diskette '" + sDisketteName + "'");
if (this.messageEnabled()) this.printMessage("loading diskette '" + sDisketteName + "'");
}
drive.fLocal = !!file;
var disk = new Disk(this, drive, DiskAPI.MODE.PRELOAD);
@ -1536,13 +1536,13 @@ FDC.prototype.addDiskHistory = function(sDisketteName, sDiskettePath, disk)
if (this.aDiskHistory[i][1] == sDiskettePath) {
var nChanges = disk.restore(this.aDiskHistory[i][2]);
if (DEBUG && this.messageEnabled()) {
this.messagePrint("disk '" + sDisketteName + "' restored from history (" + nChanges + " changes)");
this.printMessage("disk '" + sDisketteName + "' restored from history (" + nChanges + " changes)");
}
return;
}
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint("disk '" + sDisketteName + "' added to history (nothing to restore)");
this.printMessage("disk '" + sDisketteName + "' added to history (nothing to restore)");
}
this.aDiskHistory[i] = [sDisketteName, sDiskettePath, []];
};
@ -1561,13 +1561,13 @@ FDC.prototype.removeDiskHistory = function(sDisketteName, sDiskettePath)
if (this.aDiskHistory[i][1] == sDiskettePath) {
this.aDiskHistory.splice(i, 1);
if (DEBUG && this.messageEnabled()) {
this.messagePrint("disk '" + sDisketteName + "' removed from history");
this.printMessage("disk '" + sDisketteName + "' removed from history");
}
return;
}
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint("unable to remove disk '" + sDisketteName + "' from history (" + sDiskettePath + ")");
this.printMessage("unable to remove disk '" + sDisketteName + "' from history (" + sDiskettePath + ")");
}
};
@ -1586,7 +1586,7 @@ FDC.prototype.updateDiskHistory = function(sDisketteName, sDiskettePath, disk)
if (this.aDiskHistory[i][1] == sDiskettePath) {
this.aDiskHistory[i][2] = disk.save();
if (DEBUG && this.messageEnabled()) {
this.messagePrint("disk '" + sDisketteName + "' updated in history");
this.printMessage("disk '" + sDisketteName + "' updated in history");
}
return;
}
@ -1598,7 +1598,7 @@ FDC.prototype.updateDiskHistory = function(sDisketteName, sDiskettePath, disk)
* before unloading, the fact that the disk is no longer listed here can't be treated as an error.
*/
if (DEBUG && this.messageEnabled()) {
this.messagePrint("unable to update disk '" + sDisketteName + "' in history (" + sDiskettePath + ")");
this.printMessage("unable to update disk '" + sDisketteName + "' in history (" + sDiskettePath + ")");
}
};
@ -1612,7 +1612,7 @@ FDC.prototype.updateDiskHistory = function(sDisketteName, sDiskettePath, disk)
*/
FDC.prototype.outFDCOutput = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "OUTPUT");
this.printMessageIO(port, bOut, addrFrom, "OUTPUT");
if (!(bOut & FDC.REG_OUTPUT.ENABLE)) {
this.initController();
/*
@ -1664,7 +1664,7 @@ FDC.prototype.outFDCOutput = function(port, bOut, addrFrom)
*/
FDC.prototype.inFDCStatus = function(port, addrFrom)
{
this.messagePort(port, null, addrFrom, "STATUS", this.regStatus);
this.printMessageIO(port, null, addrFrom, "STATUS", this.regStatus);
return this.regStatus;
};
@ -1689,7 +1689,7 @@ FDC.prototype.inFDCData = function(port, addrFrom)
if (this.chipset) this.chipset.clearIRR(ChipSet.IRQ.FDC);
}
if (this.messageEnabled()) {
this.messagePort(port, null, addrFrom, "DATA[" + this.regDataIndex + "]", bIn);
this.printMessageIO(port, null, addrFrom, "DATA[" + this.regDataIndex + "]", bIn);
}
if (++this.regDataIndex >= this.regDataTotal) {
this.regStatus &= ~(FDC.REG_STATUS.READ_DATA | FDC.REG_STATUS.BUSY);
@ -1709,7 +1709,7 @@ FDC.prototype.inFDCData = function(port, addrFrom)
FDC.prototype.outFDCData = function(port, bOut, addrFrom)
{
if (this.messageEnabled()) {
this.messagePort(port, bOut, addrFrom, "DATA[" + this.regDataTotal + "]");
this.printMessageIO(port, bOut, addrFrom, "DATA[" + this.regDataTotal + "]");
}
if (this.regDataTotal < this.regDataArray.length) {
@ -1724,7 +1724,7 @@ FDC.prototype.outFDCData = function(port, bOut, addrFrom)
return;
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint("unsupported FDC command: " + str.toHexByte(bCmd));
this.printMessage("unsupported FDC command: " + str.toHexByte(bCmd));
this.dbg.stopCPU();
}
};
@ -1744,7 +1744,7 @@ FDC.prototype.inFDCInput = function(port, addrFrom)
* TODO: Determine when the DISK_CHANGE bit is *really* cleared (this is just a guess)
*/
this.regInput &= ~FDC.REG_INPUT.DISK_CHANGE;
this.messagePort(port, null, addrFrom, "INPUT", bIn);
this.printMessageIO(port, null, addrFrom, "INPUT", bIn);
return bIn;
};
@ -1758,7 +1758,7 @@ FDC.prototype.inFDCInput = function(port, addrFrom)
*/
FDC.prototype.outFDCControl = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "CONTROL");
this.printMessageIO(port, bOut, addrFrom, "CONTROL");
this.regControl = bOut;
};
@ -1953,7 +1953,7 @@ FDC.prototype.doCmd = function()
default:
if (DEBUG && this.messageEnabled()) {
this.messagePrint("FDC operation unsupported (command=0x: " + str.toHexByte(bCmd) + ")");
this.printMessage("FDC operation unsupported (command=0x: " + str.toHexByte(bCmd) + ")");
this.dbg.stopCPU();
}
break;
@ -2034,7 +2034,7 @@ FDC.prototype.popCmd = function(name)
if (DEBUG && this.messageEnabled(Messages.PORT | Messages.FDC)) {
var bCmdMasked = bCmd & FDC.REG_DATA.CMD.MASK;
if (!name && !this.regDataIndex && FDC.aCmdInfo[bCmdMasked]) name = FDC.aCmdInfo[bCmdMasked].name;
this.messagePrint("FDC.CMD[" + (name || this.regDataIndex) + "]: 0x" + str.toHexByte(bCmd), true);
this.printMessage("FDC.CMD[" + (name || this.regDataIndex) + "]: 0x" + str.toHexByte(bCmd), true);
}
this.regDataIndex++;
return bCmd;
@ -2086,7 +2086,7 @@ FDC.prototype.beginResult = function()
FDC.prototype.pushResult = function(bResult, name)
{
if (DEBUG && this.messageEnabled(Messages.PORT | Messages.FDC)) {
this.messagePrint("FDC.RES[" + (name || this.regDataTotal) + "]: 0x" + str.toHexByte(bResult), true);
this.printMessage("FDC.RES[" + (name || this.regDataTotal) + "]: 0x" + str.toHexByte(bResult), true);
}
this.regDataArray[this.regDataTotal++] = bResult;
};
@ -2152,7 +2152,7 @@ FDC.prototype.dmaRead = function(drive, b, done)
/*
* The DMA controller should be ASKING for data, not GIVING us data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaRead(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaRead(): invalid DMA acknowledgement");
done(-1, false);
};
@ -2171,7 +2171,7 @@ FDC.prototype.dmaWrite = function(drive, b)
/*
* The DMA controller should be GIVING us data, not ASKING for data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaWrite(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaWrite(): invalid DMA acknowledgement");
return -1;
};
@ -2190,7 +2190,7 @@ FDC.prototype.dmaFormat = function(drive, b)
/*
* The DMA controller should be GIVING us data, not ASKING for data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaFormat(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaFormat(): invalid DMA acknowledgement");
return -1;
};
@ -2211,7 +2211,7 @@ FDC.prototype.doRead = function(drive)
if (drive.disk) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("FDC.doRead(CHS=" + drive.bCylinder + ':' + drive.bHead + ':' + drive.bSector + ",PBA=" + (drive.bCylinder * (drive.disk.nHeads * drive.disk.nSectors) + drive.bHead * drive.disk.nSectors + drive.bSector-1) + ')');
this.printMessage("FDC.doRead(CHS=" + drive.bCylinder + ':' + drive.bHead + ':' + drive.bSector + ",PBA=" + (drive.bCylinder * (drive.disk.nHeads * drive.disk.nSectors) + drive.bHead * drive.disk.nSectors + drive.bSector-1) + ')');
}
drive.sector = null;
drive.resCode = FDC.REG_DATA.RES.NONE;
@ -2234,7 +2234,7 @@ FDC.prototype.doWrite = function(drive)
if (drive.disk) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("FDC.doWrite(CHS=" + drive.bCylinder + ':' + drive.bHead + ':' + drive.bSector + ",PBA=" + (drive.bCylinder * (drive.disk.nHeads * drive.disk.nSectors) + drive.bHead * drive.disk.nSectors + drive.bSector-1) + ')');
this.printMessage("FDC.doWrite(CHS=" + drive.bCylinder + ':' + drive.bHead + ':' + drive.bSector + ",PBA=" + (drive.bCylinder * (drive.disk.nHeads * drive.disk.nSectors) + drive.bHead * drive.disk.nSectors + drive.bSector-1) + ')');
}
if (drive.disk.fWriteProtected) {
drive.resCode = FDC.REG_DATA.RES.NOT_WRITABLE | FDC.REG_DATA.RES.INCOMPLETE;
@ -2437,7 +2437,7 @@ FDC.prototype.writeFormat = function(drive, b)
drive.nBytes = 128 << drive.abFormat[3];// N (0 => 128, 1 => 256, 2 => 512, 3 => 1024)
drive.cbFormat = 0;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("writeFormat(head=" + str.toHexByte(drive.bHead) + ",cyl=" + str.toHexByte(drive.bCylinder) + ",sec=" + str.toHexByte(drive.bSector) + ",len=" + str.toHexWord(drive.nBytes) + ")");
this.printMessage("writeFormat(head=" + str.toHexByte(drive.bHead) + ",cyl=" + str.toHexByte(drive.bCylinder) + ",sec=" + str.toHexByte(drive.bSector) + ",len=" + str.toHexWord(drive.nBytes) + ")");
}
for (var i = 0; i < drive.nBytes; i++) {
if (this.writeByte(drive, drive.bFiller) < 0) {

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Nov-26
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -748,7 +748,7 @@ HDC.prototype.initController = function(data, fHard)
}
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC initialized for " + this.aDrives.length + " drive(s)");
this.printMessage("HDC initialized for " + this.aDrives.length + " drive(s)");
}
return fSuccess;
};
@ -1149,7 +1149,7 @@ HDC.prototype.loadDisk = function(iDrive, sDiskName, sDiskPath, fAutoMount)
if (fAutoMount) {
drive.fAutoMount = true;
this.cAutoMount++;
if (this.messageEnabled()) this.messagePrint("loading " + sDiskName);
if (this.messageEnabled()) this.printMessage("loading " + sDiskName);
}
var disk = drive.disk || new Disk(this, drive, drive.mode);
disk.load(sDiskName, sDiskPath, null, this.doneLoadDisk);
@ -1223,7 +1223,7 @@ HDC.prototype.inXTCData = function(port, addrFrom)
if (this.chipset) this.chipset.clearIRR(ChipSet.IRQ.XTC);
this.regStatus &= ~HDC.XTC.STATUS.INTERRUPT;
this.messagePort(port, null, addrFrom, "DATA[" + this.regDataIndex + "]", bIn);
this.printMessageIO(port, null, addrFrom, "DATA[" + this.regDataIndex + "]", bIn);
if (++this.regDataIndex >= this.regDataTotal) {
this.regDataIndex = this.regDataTotal = 0;
this.regStatus &= ~(HDC.XTC.STATUS.IOMODE | HDC.XTC.STATUS.BUS | HDC.XTC.STATUS.BUSY);
@ -1241,7 +1241,7 @@ HDC.prototype.inXTCData = function(port, addrFrom)
*/
HDC.prototype.outXTCData = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "DATA[" + this.regDataTotal + "]");
this.printMessageIO(port, bOut, addrFrom, "DATA[" + this.regDataTotal + "]");
if (this.regDataTotal < this.regDataArray.length) {
this.regDataArray[this.regDataTotal++] = bOut;
}
@ -1276,7 +1276,7 @@ HDC.prototype.outXTCData = function(port, bOut, addrFrom)
HDC.prototype.inXTCStatus = function(port, addrFrom)
{
var b = this.regStatus;
this.messagePort(port, null, addrFrom, "STATUS", b);
this.printMessageIO(port, null, addrFrom, "STATUS", b);
/*
* HACK: The HDC BIOS will not finish the HDC.XTC.DATA.CMD.INIT_DRIVE sequence unless it sees XTC.STATUS.REQ set again, nor will
* it read any of the XTC.DATA bytes returned from a HDC.XTC.DATA.CMD.REQUEST_SENSE command unless XTC.STATUS.REQ is set again, so
@ -1298,7 +1298,7 @@ HDC.prototype.inXTCStatus = function(port, addrFrom)
*/
HDC.prototype.outXTCReset = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "RESET");
this.printMessageIO(port, bOut, addrFrom, "RESET");
/*
* Not sure what to do with this value, and the value itself may be "don't care", but we'll save it anyway.
*/
@ -1317,7 +1317,7 @@ HDC.prototype.outXTCReset = function(port, bOut, addrFrom)
*/
HDC.prototype.inXTCConfig = function(port, addrFrom)
{
this.messagePort(port, null, addrFrom, "CONFIG", this.regConfig);
this.printMessageIO(port, null, addrFrom, "CONFIG", this.regConfig);
return this.regConfig;
};
@ -1331,7 +1331,7 @@ HDC.prototype.inXTCConfig = function(port, addrFrom)
*/
HDC.prototype.outXTCPulse = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "PULSE");
this.printMessageIO(port, bOut, addrFrom, "PULSE");
/*
* Not sure what to do with this value, and the value itself may be "don't care", but we'll save it anyway.
*/
@ -1358,7 +1358,7 @@ HDC.prototype.outXTCPulse = function(port, bOut, addrFrom)
*/
HDC.prototype.outXTCPattern = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "PATTERN");
this.printMessageIO(port, bOut, addrFrom, "PATTERN");
this.regPattern = bOut;
};
@ -1372,7 +1372,7 @@ HDC.prototype.outXTCPattern = function(port, bOut, addrFrom)
*/
HDC.prototype.outXTCNoise = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "NOISE");
this.printMessageIO(port, bOut, addrFrom, "NOISE");
};
/**
@ -1398,8 +1398,8 @@ HDC.prototype.inATCData = function(port, addrFrom)
bIn = this.readByte(this.drive, function(b, fAsync, obj, off) {
hdc.assert(!fAsync);
if (BACKTRACK) {
if (!off && obj.file) {
hdc.println("loading " + obj.file.sPath + '[' + obj.offFile + "] via port 0x" + str.toHexWord(port));
if (!off && obj.file && hdc.messageEnabled(Messages.DISK)) {
hdc.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] via port 0x" + str.toHexWord(port), true);
}
/*
* TODO: We could define a cached BTO that's reset prior to a new ATC command, and then pass that
@ -1415,11 +1415,11 @@ HDC.prototype.inATCData = function(port, addrFrom)
if (this.drive.ibSector == 1) {
/*
* messagePort() calls, if enabled, can be overwhelming for this port, so limit them to the first byte
* printMessageIO() calls, if enabled, can be overwhelming for this port, so limit them to the first byte
* of each sector.
*/
if (this.messageEnabled(Messages.PORT | Messages.HDC)) {
this.messagePort(port, null, addrFrom, "DATA[" + this.drive.ibSector + "]", bIn);
this.printMessageIO(port, null, addrFrom, "DATA[" + this.drive.ibSector + "]", bIn);
}
}
else if (this.drive.ibSector == this.drive.cbSector) {
@ -1451,7 +1451,7 @@ HDC.prototype.inATCData = function(port, addrFrom)
*/
hdc.regStatus = HDC.ATC.STATUS.ERROR;
hdc.regError = HDC.ATC.ERROR.NO_CHS;
if (DEBUG) hdc.messagePrint("HDC.inATCData(): read failed");
if (DEBUG) hdc.printMessage("HDC.inATCData(): read failed");
}
}, false);
} else {
@ -1483,16 +1483,16 @@ HDC.prototype.outATCData = function(port, bOut, addrFrom)
this.regStatus = HDC.ATC.STATUS.ERROR;
this.regError = HDC.ATC.ERROR.NO_CHS;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.outATCData(" + str.toHexByte(bOut) + "): write failed");
this.printMessage("HDC.outATCData(" + str.toHexByte(bOut) + "): write failed");
}
}
else if (this.drive.ibSector == 1) {
/*
* messagePort() calls, if enabled, can be overwhelming for this port, so limit them to the first byte
* printMessageIO() calls, if enabled, can be overwhelming for this port, so limit them to the first byte
* of each sector.
*/
if (this.messageEnabled(Messages.PORT | Messages.HDC)) {
this.messagePort(port, bOut, addrFrom, "DATA[" + this.drive.ibSector + "]");
this.printMessageIO(port, bOut, addrFrom, "DATA[" + this.drive.ibSector + "]");
}
}
else if (this.drive.ibSector == this.drive.cbSector) {
@ -1517,7 +1517,7 @@ HDC.prototype.outATCData = function(port, bOut, addrFrom)
* TODO: What to do about unexpected writes? The number of bytes has exceeded what the command specified.
*/
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.outATCData(" + str.toHexByte(bOut) + "): write exceeds count (" + this.drive.nBytes + ")");
this.printMessage("HDC.outATCData(" + str.toHexByte(bOut) + "): write exceeds count (" + this.drive.nBytes + ")");
}
}
} else {
@ -1525,7 +1525,7 @@ HDC.prototype.outATCData = function(port, bOut, addrFrom)
* TODO: What to do about unexpected writes? No command was specified.
*/
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.outATCData(" + str.toHexByte(bOut) + "): write without command");
this.printMessage("HDC.outATCData(" + str.toHexByte(bOut) + "): write without command");
}
}
};
@ -1541,7 +1541,7 @@ HDC.prototype.outATCData = function(port, bOut, addrFrom)
HDC.prototype.inATCError = function(port, addrFrom)
{
var bIn = this.regError;
this.messagePort(port, null, addrFrom, "ERROR", bIn);
this.printMessageIO(port, null, addrFrom, "ERROR", bIn);
return bIn;
};
@ -1555,7 +1555,7 @@ HDC.prototype.inATCError = function(port, addrFrom)
*/
HDC.prototype.outATCWPreC = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "WPREC");
this.printMessageIO(port, bOut, addrFrom, "WPREC");
this.regWPreC = bOut;
};
@ -1570,7 +1570,7 @@ HDC.prototype.outATCWPreC = function(port, bOut, addrFrom)
HDC.prototype.inATCSecCnt = function(port, addrFrom)
{
var bIn = this.regSecCnt;
this.messagePort(port, null, addrFrom, "SECCNT", bIn);
this.printMessageIO(port, null, addrFrom, "SECCNT", bIn);
return bIn;
};
@ -1584,7 +1584,7 @@ HDC.prototype.inATCSecCnt = function(port, addrFrom)
*/
HDC.prototype.outATCSecCnt = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "SECCNT");
this.printMessageIO(port, bOut, addrFrom, "SECCNT");
this.regSecCnt = bOut;
};
@ -1599,7 +1599,7 @@ HDC.prototype.outATCSecCnt = function(port, bOut, addrFrom)
HDC.prototype.inATCSecNum = function(port, addrFrom)
{
var bIn = this.regSecNum;
this.messagePort(port, null, addrFrom, "SECNUM", bIn);
this.printMessageIO(port, null, addrFrom, "SECNUM", bIn);
return bIn;
};
@ -1613,7 +1613,7 @@ HDC.prototype.inATCSecNum = function(port, addrFrom)
*/
HDC.prototype.outATCSecNum = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "SECNUM");
this.printMessageIO(port, bOut, addrFrom, "SECNUM");
this.regSecNum = bOut;
};
@ -1628,7 +1628,7 @@ HDC.prototype.outATCSecNum = function(port, bOut, addrFrom)
HDC.prototype.inATCCylLo = function(port, addrFrom)
{
var bIn = this.regCylLo;
this.messagePort(port, null, addrFrom, "CYLLO", bIn);
this.printMessageIO(port, null, addrFrom, "CYLLO", bIn);
return bIn;
};
@ -1642,7 +1642,7 @@ HDC.prototype.inATCCylLo = function(port, addrFrom)
*/
HDC.prototype.outATCCylLo = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "CYLLO");
this.printMessageIO(port, bOut, addrFrom, "CYLLO");
this.regCylLo = bOut;
};
@ -1657,7 +1657,7 @@ HDC.prototype.outATCCylLo = function(port, bOut, addrFrom)
HDC.prototype.inATCCylHi = function(port, addrFrom)
{
var bIn = this.regCylHi;
this.messagePort(port, null, addrFrom, "CYLHI", bIn);
this.printMessageIO(port, null, addrFrom, "CYLHI", bIn);
return bIn;
};
@ -1671,7 +1671,7 @@ HDC.prototype.inATCCylHi = function(port, addrFrom)
*/
HDC.prototype.outATCCylHi = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "CYLHI");
this.printMessageIO(port, bOut, addrFrom, "CYLHI");
this.regCylHi = bOut;
};
@ -1686,7 +1686,7 @@ HDC.prototype.outATCCylHi = function(port, bOut, addrFrom)
HDC.prototype.inATCDrvHd = function(port, addrFrom)
{
var bIn = this.regDrvHd;
this.messagePort(port, null, addrFrom, "DRVHD", bIn);
this.printMessageIO(port, null, addrFrom, "DRVHD", bIn);
return bIn;
};
@ -1700,7 +1700,7 @@ HDC.prototype.inATCDrvHd = function(port, addrFrom)
*/
HDC.prototype.outATCDrvHd = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "DRVHD");
this.printMessageIO(port, bOut, addrFrom, "DRVHD");
this.regDrvHd = bOut;
/*
* The MODEL_5170_REV3 BIOS (see "POST2_CHK_HF2" @F000:14FC) probes for a 2nd hard drive when the number
@ -1736,7 +1736,7 @@ HDC.prototype.outATCDrvHd = function(port, bOut, addrFrom)
HDC.prototype.inATCStatus = function(port, addrFrom)
{
var bIn = this.regStatus;
this.messagePort(port, null, addrFrom, "STATUS", bIn);
this.printMessageIO(port, null, addrFrom, "STATUS", bIn);
/*
* Despite what IBM's documentation for the "Personal Computer AT Fixed Disk and Diskette Drive Adapter"
* (August 31, 1984) says (ie, "A read of the status register clears interrupt request 14"), we cannot
@ -1768,7 +1768,7 @@ HDC.prototype.inATCStatus = function(port, addrFrom)
*/
HDC.prototype.outATCCommand = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "COMMAND");
this.printMessageIO(port, bOut, addrFrom, "COMMAND");
this.regCommand = bOut;
if (this.chipset) this.chipset.clearIRR(ChipSet.IRQ.ATC);
this.doATC();
@ -1786,7 +1786,7 @@ HDC.prototype.outATCCommand = function(port, bOut, addrFrom)
*/
HDC.prototype.outATCFDR = function(port, bOut, addrFrom)
{
this.messagePort(port, bOut, addrFrom, "FDR");
this.printMessageIO(port, bOut, addrFrom, "FDR");
/*
* I'm not really sure if I should set HDC.ATC.DIAG.NO_ERROR in regError after *every* write where
* HDC.ATC.FDR.RESET is clear, or only after it has transitioned from set to clear; since the BIOS only
@ -1846,14 +1846,14 @@ HDC.prototype.doATC = function()
}
if (DEBUG && this.messageEnabled(Messages.HDC)) {
this.messagePrint("HDC.doATC(0x" + str.toHexByte(bCmd) + "): " + HDC.aATCCommands[bCmd], true);
this.printMessage("HDC.doATC(0x" + str.toHexByte(bCmd) + "): " + HDC.aATCCommands[bCmd], true);
}
switch (bCmd & HDC.ATC.COMMAND.MASK) {
case HDC.ATC.COMMAND.READ_DATA:
if (DEBUG && this.messageEnabled(Messages.HDC)) {
this.messagePrint("HDC.doRead(" + iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + nSectors + ")", true);
this.printMessage("HDC.doRead(" + iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + nSectors + ")", true);
}
/*
* We're using a call to readByte() that disables auto-increment, so that once we've got the first
@ -1882,7 +1882,7 @@ HDC.prototype.doATC = function()
case HDC.ATC.COMMAND.WRITE_DATA:
if (DEBUG && this.messageEnabled(Messages.HDC)) {
this.messagePrint("HDC.doWrite(" + iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + nSectors + ")", true);
this.printMessage("HDC.doWrite(" + iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + nSectors + ")", true);
}
this.regStatus = HDC.ATC.STATUS.DATA_REQ;
break;
@ -1931,7 +1931,7 @@ HDC.prototype.doATC = function()
default:
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.doATC(0x" + str.toHexByte(this.regCommand) + "): " + (bCmd < 0? ("invalid drive (" + iDrive + ")") : "unsupported operation"));
this.printMessage("HDC.doATC(0x" + str.toHexByte(this.regCommand) + "): " + (bCmd < 0? ("invalid drive (" + iDrive + ")") : "unsupported operation"));
if (bCmd >= 0) this.dbg.stopCPU();
}
break;
@ -1975,9 +1975,9 @@ HDC.prototype.setATCIRR = function(fWrite)
* has a low tolerance for fast controller interrupts during multi-sector operations.
*/
this.chipset.setIRR(ChipSet.IRQ.ATC, 120);
if (DEBUG) this.messagePrint("HDC.setATCIRR(): enabled", Messages.PIC | Messages.HDC);
if (DEBUG) this.printMessage("HDC.setATCIRR(): enabled", Messages.PIC | Messages.HDC);
} else {
if (DEBUG) this.messagePrint("HDC.setATCIRR(): disabled", Messages.PIC | Messages.HDC);
if (DEBUG) this.printMessage("HDC.setATCIRR(): disabled", Messages.PIC | Messages.HDC);
}
}
};
@ -2059,7 +2059,7 @@ HDC.prototype.doXTC = function()
bDataStatus = HDC.XTC.DATA.STATUS.OK;
if (!drive && this.iDriveAllowFail == iDrive) {
this.iDriveAllowFail = -1;
if (DEBUG) this.messagePrint("HDC.doXTC(): fake failure triggered");
if (DEBUG) this.printMessage("HDC.doXTC(): fake failure triggered");
bDataStatus = HDC.XTC.DATA.STATUS.ERROR;
}
this.beginResult(bDataStatus | bDrive);
@ -2096,7 +2096,7 @@ HDC.prototype.doXTC = function()
case HDC.XTC.DATA.CMD.RECALIBRATE: // 0x01
drive.bControl = bControl;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.doXTC(): drive " + iDrive + " control byte: 0x" + str.toHexByte(bControl));
this.printMessage("HDC.doXTC(): drive " + iDrive + " control byte: 0x" + str.toHexByte(bControl));
}
this.beginResult(HDC.XTC.DATA.STATUS.OK | bDrive);
break;
@ -2134,7 +2134,7 @@ HDC.prototype.doXTC = function()
default:
this.beginResult(HDC.XTC.DATA.STATUS.ERROR | bDrive);
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.doXTC(0x" + str.toHexByte(bCmdOrig) + "): " + (bCmd < 0? ("invalid drive (" + iDrive + ")") : "unsupported operation"));
this.printMessage("HDC.doXTC(0x" + str.toHexByte(bCmdOrig) + "): " + (bCmd < 0? ("invalid drive (" + iDrive + ")") : "unsupported operation"));
if (bCmd >= 0) this.dbg.stopCPU();
}
break;
@ -2155,7 +2155,7 @@ HDC.prototype.popCmd = function()
if (bCmdIndex < this.regDataTotal) {
bCmd = this.regDataArray[this.regDataIndex++];
if (DEBUG && this.messageEnabled((bCmdIndex > 0? Messages.PORT : 0) | Messages.HDC)) {
this.messagePrint("HDC.CMD[" + bCmdIndex + "]: 0x" + str.toHexByte(bCmd) + (!bCmdIndex && HDC.aXTCCommands[bCmd]? (" (" + HDC.aXTCCommands[bCmd] + ")") : ""), true);
this.printMessage("HDC.CMD[" + bCmdIndex + "]: 0x" + str.toHexByte(bCmd) + (!bCmdIndex && HDC.aXTCCommands[bCmd]? (" (" + HDC.aXTCCommands[bCmd] + ")") : ""), true);
}
}
return bCmd;
@ -2173,7 +2173,7 @@ HDC.prototype.beginResult = function(bResult)
if (bResult !== undefined) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.beginResult(0x" + str.toHexByte(bResult) + ")");
this.printMessage("HDC.beginResult(0x" + str.toHexByte(bResult) + ")");
}
this.pushResult(bResult);
}
@ -2195,7 +2195,7 @@ HDC.prototype.beginResult = function(bResult)
HDC.prototype.pushResult = function(bResult)
{
if (DEBUG && this.messageEnabled((this.regDataTotal > 0? Messages.PORT : 0) | Messages.HDC)) {
this.messagePrint("HDC.RES[" + this.regDataTotal + "]: 0x" + str.toHexByte(bResult), true);
this.printMessage("HDC.RES[" + this.regDataTotal + "]: 0x" + str.toHexByte(bResult), true);
}
this.regDataArray[this.regDataTotal++] = bResult;
};
@ -2217,7 +2217,7 @@ HDC.prototype.dmaRead = function(drive, b, done)
/*
* The DMA controller should be ASKING for data, not GIVING us data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaRead(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaRead(): invalid DMA acknowledgement");
done(-1, false);
};
@ -2236,7 +2236,7 @@ HDC.prototype.dmaWrite = function(drive, b)
/*
* The DMA controller should be GIVING us data, not ASKING for data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaWrite(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaWrite(): invalid DMA acknowledgement");
return -1;
};
@ -2255,7 +2255,7 @@ HDC.prototype.dmaWriteBuffer = function(drive, b)
/*
* The DMA controller should be GIVING us data, not ASKING for data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaWriteBuffer(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaWriteBuffer(): invalid DMA acknowledgement");
return -1;
};
@ -2274,7 +2274,7 @@ HDC.prototype.dmaWriteFormat = function(drive, b)
/*
* The DMA controller should be GIVING us data, not ASKING for data; this suggests an internal DMA miscommunication
*/
if (DEBUG) this.messagePrint("dmaWriteFormat(): invalid DMA acknowledgement");
if (DEBUG) this.printMessage("dmaWriteFormat(): invalid DMA acknowledgement");
return -1;
};
@ -2290,7 +2290,7 @@ HDC.prototype.doDMARead = function(drive, done)
drive.errorCode = HDC.XTC.DATA.ERR.NOT_READY;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.doDMARead(" + drive.iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + ((drive.nBytes / drive.cbSector)|0) + ")");
this.printMessage("HDC.doDMARead(" + drive.iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + ((drive.nBytes / drive.cbSector)|0) + ")");
}
if (drive.disk) {
@ -2334,7 +2334,7 @@ HDC.prototype.doDMAWrite = function(drive, done)
drive.errorCode = HDC.XTC.DATA.ERR.NOT_READY;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.doDMAWrite(" + drive.iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + ((drive.nBytes / drive.cbSector)|0) + ")");
this.printMessage("HDC.doDMAWrite(" + drive.iDrive + ',' + drive.wCylinder + ':' + drive.bHead + ':' + drive.bSector + ',' + ((drive.nBytes / drive.cbSector)|0) + ")");
}
if (drive.disk) {
@ -2384,7 +2384,7 @@ HDC.prototype.doDMAWriteBuffer = function(drive, done)
{
drive.errorCode = HDC.XTC.DATA.ERR.NOT_READY;
if (DEBUG) this.messagePrint("HDC.doDMAWriteBuffer()");
if (DEBUG) this.printMessage("HDC.doDMAWriteBuffer()");
if (!drive.abSector || drive.abSector.length != drive.nBytes) {
drive.abSector = new Array(drive.nBytes);
@ -2687,7 +2687,7 @@ HDC.prototype.writeFormat = function(drive, b)
drive.cbFormat = 0;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("HDC.writeFormat(" + drive.wCylinder + ":" + drive.bHead + ":" + drive.bSector + ":" + drive.nBytes + ")");
this.printMessage("HDC.writeFormat(" + drive.wCylinder + ":" + drive.bHead + ":" + drive.bSector + ":" + drive.nBytes + ")");
}
for (var i = 0; i < drive.nBytes; i++) {
@ -2772,7 +2772,7 @@ HDC.prototype.intBIOSDiskette = function(addr)
{
var AH = this.cpu.regAX >> 8;
if ((!AH && this.chipset && this.chipset.checkIMR(ChipSet.IRQ.FDC))) {
if (DEBUG) this.messagePrint("HDC.intBIOSDiskette(): skipping useless INT 0x40 diskette reset");
if (DEBUG) this.printMessage("HDC.intBIOSDiskette(): skipping useless INT 0x40 diskette reset");
return false;
}
return true;

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-Dec-11
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-20
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -68,7 +68,7 @@ function Keyboard(parmsKbd)
this.fMobile = web.isMobile();
this.fMSIE = web.isUserAgent("MSIE");
this.messagePrint("mobile keyboard support: " + (this.fMobile? "true" : "false"));
this.printMessage("mobile keyboard support: " + (this.fMobile? "true" : "false"));
/*
* This is count of the number of "soft keyboard" keys present. At the moment, its only
@ -1020,7 +1020,7 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control)
this.bindings[id] = control;
control.onclick = function(kbd, sKey, simCode) {
return function onClickKeyboard(event) {
if (!COMPILED && kbd.messageEnabled()) kbd.messagePrint(sKey + " clicked", Messages.KEYS);
if (!COMPILED && kbd.messageEnabled()) kbd.printMessage(sKey + " clicked", Messages.KEYS);
if (kbd.cpu) kbd.cpu.setFocus();
kbd.updateShiftState(simCode, true); // future-proofing if/when any LOCK keys are added to CLICKCODES
kbd.addActiveKey(simCode, true);
@ -1152,7 +1152,7 @@ Keyboard.prototype.resetDevice = function(fNotify)
/*
* TODO: There's more to reset, like LED indicators, default type rate, and emptying the scan code buffer.
*/
this.messagePrint("keyboard reset", Messages.KEYBOARD | Messages.PORT);
this.printMessage("keyboard reset", Messages.KEYBOARD | Messages.PORT);
this.abScanBuffer = [Keyboard.CMDRES.BAT_OK];
if (fNotify && this.chipset) this.chipset.notifyKbdData(this.abScanBuffer[0]);
};
@ -1175,7 +1175,7 @@ Keyboard.prototype.setEnable = function(fData, fClock)
var fReset = false;
if (this.fClock !== fClock) {
if (!COMPILED && this.messageEnabled(Messages.KEYBOARD | Messages.PORT)) {
this.messagePrint("keyboard clock line changing to " + fClock, true);
this.printMessage("keyboard clock line changing to " + fClock, true);
}
/*
* Toggling the clock line low and then high signals a "reset", which we acknowledge once the
@ -1185,7 +1185,7 @@ Keyboard.prototype.setEnable = function(fData, fClock)
}
if (this.fData !== fData) {
if (!COMPILED && this.messageEnabled(Messages.KEYBOARD | Messages.PORT)) {
this.messagePrint("keyboard data line changing to " + fData, true);
this.printMessage("keyboard data line changing to " + fData, true);
}
this.fData = fData;
/*
@ -1243,7 +1243,7 @@ Keyboard.prototype.checkScanCode = function()
b = this.abScanBuffer[0];
if (this.chipset) this.chipset.notifyKbdData(b);
}
if (this.messageEnabled()) this.messagePrint("scan code 0x" + str.toHexByte(b) + " available");
if (this.messageEnabled()) this.printMessage("scan code 0x" + str.toHexByte(b) + " available");
return b;
};
@ -1261,7 +1261,7 @@ Keyboard.prototype.readScanCode = function()
if (this.abScanBuffer.length) {
b = this.abScanBuffer[0];
}
if (this.messageEnabled()) this.messagePrint("scan code 0x" + str.toHexByte(b) + " delivered");
if (this.messageEnabled()) this.printMessage("scan code 0x" + str.toHexByte(b) + " delivered");
return b;
};
@ -1275,7 +1275,7 @@ Keyboard.prototype.readScanCode = function()
Keyboard.prototype.flushScanCode = function()
{
this.abScanBuffer = [];
if (this.messageEnabled()) this.messagePrint("scan codes flushed");
if (this.messageEnabled()) this.printMessage("scan codes flushed");
};
/**
@ -1302,7 +1302,7 @@ Keyboard.prototype.shiftScanCode = function(fNotify)
this.chipset.notifyKbdData(this.abScanBuffer[0]);
}
}
if (this.messageEnabled()) this.messagePrint("scan codes shifted, notify " + (fNotify? "true" : "false"));
if (this.messageEnabled()) this.printMessage("scan codes shifted, notify " + (fNotify? "true" : "false"));
}
};
@ -1469,7 +1469,7 @@ Keyboard.prototype.addScanCode = function(bScan)
*/
if (this.abScanBuffer) {
if (this.abScanBuffer.length < Keyboard.LIMIT.MAX_SCANCODES) {
if (this.messageEnabled()) this.messagePrint("scan code 0x" + str.toHexByte(bScan) + " buffered");
if (this.messageEnabled()) this.printMessage("scan code 0x" + str.toHexByte(bScan) + " buffered");
this.abScanBuffer.push(bScan);
if (this.abScanBuffer.length == 1) {
if (this.chipset) this.chipset.notifyKbdData(bScan);
@ -1479,7 +1479,7 @@ Keyboard.prototype.addScanCode = function(bScan)
if (this.abScanBuffer.length == Keyboard.LIMIT.MAX_SCANCODES) {
this.abScanBuffer.push(Keyboard.CMDRES.BUFF_FULL);
}
this.messagePrint("scan code buffer overflow");
this.printMessage("scan code buffer overflow");
}
};
@ -1659,7 +1659,7 @@ Keyboard.prototype.addActiveKey = function(simCode, fPress)
{
if (!Keyboard.SIMCODES[simCode]) {
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("addActiveKey(" + simCode + "," + (fPress? "press" : "down") + "): unrecognized", true);
this.printMessage("addActiveKey(" + simCode + "," + (fPress? "press" : "down") + "): unrecognized", true);
}
return;
}
@ -1697,7 +1697,7 @@ Keyboard.prototype.addActiveKey = function(simCode, fPress)
}
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("addActiveKey(" + simCode + "," + (fPress? "press" : "down") + "): " + (i < 0? "already active" : (i == this.aKeysActive.length? "adding" : "updating")), true);
this.printMessage("addActiveKey(" + simCode + "," + (fPress? "press" : "down") + "): " + (i < 0? "already active" : (i == this.aKeysActive.length? "adding" : "updating")), true);
}
if (i < 0) return;
@ -1798,7 +1798,7 @@ Keyboard.prototype.removeActiveKey = function(simCode, fFlush)
{
if (!Keyboard.SIMCODES[simCode]) {
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("removeActiveKey(" + simCode + "): unrecognized", true);
this.printMessage("removeActiveKey(" + simCode + "): unrecognized", true);
}
return false;
}
@ -1821,10 +1821,10 @@ Keyboard.prototype.removeActiveKey = function(simCode, fFlush)
}
}
if (!COMPILED && !fFlush && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("removeActiveKey(" + simCode + "): " + (fRemoved? "removed" : "not active"), true);
this.printMessage("removeActiveKey(" + simCode + "): " + (fRemoved? "removed" : "not active"), true);
}
if (!this.aKeysActive.length && this.fToggleCapsLock) {
if (!COMPILED) this.messagePrint("removeActiveKey(): inverting caps-lock now", Messages.KEYS);
if (!COMPILED) this.printMessage("removeActiveKey(): inverting caps-lock now", Messages.KEYS);
this.updateShiftState(Keyboard.SIMCODE.CAPS_LOCK);
this.fToggleCapsLock = false;
}
@ -1848,7 +1848,7 @@ Keyboard.prototype.updateActiveKey = function(key, msTimer)
}
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint((msTimer? '\n' : "") + "updateActiveKey(" + key.simCode + (msTimer? "," + msTimer + "ms" : "") + "): " + (key.fDown? "down" : "up"), true);
this.printMessage((msTimer? '\n' : "") + "updateActiveKey(" + key.simCode + (msTimer? "," + msTimer + "ms" : "") + "): " + (key.fDown? "down" : "up"), true);
}
this.keySimulate(key.simCode, key.fDown);
@ -1919,7 +1919,7 @@ Keyboard.prototype.getSimCode = function(keyCode, fShifted)
Keyboard.prototype.onFocusChange = function(fFocus)
{
if (this.fHasFocus != fFocus && !COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("onFocusChange(" + (fFocus? "true" : "false") + ")", true);
this.printMessage("onFocusChange(" + (fFocus? "true" : "false") + ")", true);
}
this.fHasFocus = fFocus;
/*
@ -2046,7 +2046,7 @@ Keyboard.prototype.onKeyDown = function(event, fDown)
}
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("\nonKey" + (fDown? "Down" : "Up") + "(" + keyCode + "): " + (fIgnore? "ignore" : (fPass? "true" : "false")), true);
this.printMessage("\nonKey" + (fDown? "Down" : "Up") + "(" + keyCode + "): " + (fIgnore? "ignore" : (fPass? "true" : "false")), true);
}
/*
@ -2086,7 +2086,7 @@ Keyboard.prototype.onKeyPress = function(event)
var simCode = this.checkActiveKey();
if (simCode && this.isAlphaKey(simCode) && this.isAlphaKey(keyCode) && simCode != keyCode) {
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("onKeyPress(" + keyCode + ") out of sync with " + simCode + ", invert caps-lock", true);
this.printMessage("onKeyPress(" + keyCode + ") out of sync with " + simCode + ", invert caps-lock", true);
}
this.fToggleCapsLock = true;
keyCode = simCode;
@ -2100,7 +2100,7 @@ Keyboard.prototype.onKeyPress = function(event)
var fPass = !Keyboard.SIMCODES[keyCode] || !!(this.bitsState & Keyboard.STATE.CMD);
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("\nonKeyPress(" + keyCode + "): " + (fPass? "true" : "false"), true);
this.printMessage("\nonKeyPress(" + keyCode + "): " + (fPass? "true" : "false"), true);
}
if (!fPass) {
@ -2190,7 +2190,7 @@ Keyboard.prototype.keySimulate = function(simCode, fDown)
}
if (!COMPILED && this.messageEnabled(Messages.KEYS)) {
this.messagePrint("keySimulate(" + simCode + "," + (fDown? "down" : "up") + "): " + (fSimulated? "true" : "false"), true);
this.printMessage("keySimulate(" + simCode + "," + (fDown? "down" : "up") + "): " + (fSimulated? "true" : "false"), true);
}
return fSimulated;

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-Dec-11
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jul-01
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -544,7 +544,7 @@ Mouse.prototype.sendPacket = function(sDiag, xDiag, yDiag)
var b2 = this.xDelta & 0x3F;
var b3 = this.yDelta & 0x3F;
if (this.messageEnabled(Messages.SERIAL)) {
this.messagePrint((sDiag? (sDiag + ": ") : "") + (yDiag !== undefined? ("mouse (" + xDiag + "," + yDiag + "): ") : "") + "serial packet [" + str.toHexByte(b1) + "," + str.toHexByte(b2) + "," + str.toHexByte(b3) + "]", 0, true);
this.printMessage((sDiag? (sDiag + ": ") : "") + (yDiag !== undefined? ("mouse (" + xDiag + "," + yDiag + "): ") : "") + "serial packet [" + str.toHexByte(b1) + "," + str.toHexByte(b2) + "," + str.toHexByte(b3) + "]", 0, true);
}
this.componentAdapter.sendRBR([b1, b2, b3]);
this.xDelta = this.yDelta = 0;
@ -576,11 +576,11 @@ Mouse.prototype.notifyMCR = function(bMCR)
var fIdentify = false;
if (!(this.bMCR & SerialPort.MCR.RTS)) {
this.reset();
this.messagePrint("serial mouse reset");
this.printMessage("serial mouse reset");
fIdentify = true;
}
if (!(this.bMCR & SerialPort.MCR.DTR)) {
this.messagePrint("serial mouse ID requested");
this.printMessage("serial mouse ID requested");
fIdentify = true;
}
if (fIdentify) {
@ -605,7 +605,7 @@ Mouse.prototype.notifyMCR = function(bMCR)
* I'm calling this good enough for now.
*/
this.componentAdapter.sendRBR([Mouse.ID_SERIAL, Mouse.ID_SERIAL]);
this.messagePrint("serial mouse ID sent");
this.printMessage("serial mouse ID sent");
}
this.captureMouse(this.inputScreen);
this.setActive(fActive);
@ -624,7 +624,7 @@ Mouse.prototype.notifyMCR = function(bMCR)
* a mouse device that's still powered may still send event data to the serial port, and if there was software
* polling the serial port, it might expect to see that data. Unlikely, but not impossible.
*/
this.messagePrint("serial mouse inactive");
this.printMessage("serial mouse inactive");
this.releaseMouse(this.inputScreen);
this.setActive(fActive);
}

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-19
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jul-01
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -512,7 +512,7 @@ SerialPort.prototype.advanceRBR = function() {
*/
SerialPort.prototype.inRBR = function(port, addrFrom) {
var b = ((this.bLCR & SerialPort.LCR.DLAB) ? (this.wDL & 0xff) : this.bRBR);
this.messagePort(port, null, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLL" : "RBR", b);
this.printMessageIO(port, null, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLL" : "RBR", b);
this.bLSR &= ~SerialPort.LSR.DR;
this.advanceRBR();
return b;
@ -528,7 +528,7 @@ SerialPort.prototype.inRBR = function(port, addrFrom) {
*/
SerialPort.prototype.inIER = function(port, addrFrom) {
var b = ((this.bLCR & SerialPort.LCR.DLAB) ? (this.wDL >> 8) : this.bIER);
this.messagePort(port, null, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLM" : "IER", b);
this.printMessageIO(port, null, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLM" : "IER", b);
return b;
};
@ -542,7 +542,7 @@ SerialPort.prototype.inIER = function(port, addrFrom) {
*/
SerialPort.prototype.inIIR = function(port, addrFrom) {
var b = this.bIIR;
this.messagePort(port, null, addrFrom, "IIR", b);
this.printMessageIO(port, null, addrFrom, "IIR", b);
return b;
};
@ -556,7 +556,7 @@ SerialPort.prototype.inIIR = function(port, addrFrom) {
*/
SerialPort.prototype.inLCR = function(port, addrFrom) {
var b = this.bLCR;
this.messagePort(port, null, addrFrom, "LCR", b);
this.printMessageIO(port, null, addrFrom, "LCR", b);
return b;
};
@ -570,7 +570,7 @@ SerialPort.prototype.inLCR = function(port, addrFrom) {
*/
SerialPort.prototype.inMCR = function(port, addrFrom) {
var b = this.bMCR;
this.messagePort(port, null, addrFrom, "MCR", b);
this.printMessageIO(port, null, addrFrom, "MCR", b);
return b;
};
@ -584,7 +584,7 @@ SerialPort.prototype.inMCR = function(port, addrFrom) {
*/
SerialPort.prototype.inLSR = function(port, addrFrom) {
var b = this.bLSR;
this.messagePort(port, null, addrFrom, "LSR", b);
this.printMessageIO(port, null, addrFrom, "LSR", b);
return b;
};
@ -598,7 +598,7 @@ SerialPort.prototype.inLSR = function(port, addrFrom) {
*/
SerialPort.prototype.inMSR = function(port, addrFrom) {
var b = this.bMSR;
this.messagePort(port, null, addrFrom, "MSR", b);
this.printMessageIO(port, null, addrFrom, "MSR", b);
return b;
};
@ -611,7 +611,7 @@ SerialPort.prototype.inMSR = function(port, addrFrom) {
* @param {number} [addrFrom] (not defined whenever the Debugger tries to write the specified port)
*/
SerialPort.prototype.outTHR = function(port, bOut, addrFrom) {
this.messagePort(port, bOut, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLL" : "THR");
this.printMessageIO(port, bOut, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLL" : "THR");
if (this.bLCR & SerialPort.LCR.DLAB) {
this.wDL = (this.wDL & ~0xff) | bOut;
} else {
@ -635,7 +635,7 @@ SerialPort.prototype.outTHR = function(port, bOut, addrFrom) {
* @param {number} [addrFrom] (not defined whenever the Debugger tries to write the specified port)
*/
SerialPort.prototype.outIER = function(port, bOut, addrFrom) {
this.messagePort(port, bOut, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLM" : "IER");
this.printMessageIO(port, bOut, addrFrom, (this.bLCR & SerialPort.LCR.DLAB) ? "DLM" : "IER");
if (this.bLCR & SerialPort.LCR.DLAB) {
this.wDL = (this.wDL & 0xff) | (bOut << 8);
} else {
@ -652,7 +652,7 @@ SerialPort.prototype.outIER = function(port, bOut, addrFrom) {
* @param {number} [addrFrom] (not defined whenever the Debugger tries to write the specified port)
*/
SerialPort.prototype.outLCR = function(port, bOut, addrFrom) {
this.messagePort(port, bOut, addrFrom, "LCR");
this.printMessageIO(port, bOut, addrFrom, "LCR");
this.bLCR = bOut;
};
@ -666,7 +666,7 @@ SerialPort.prototype.outLCR = function(port, bOut, addrFrom) {
*/
SerialPort.prototype.outMCR = function(port, bOut, addrFrom) {
var bPrev = this.bMCR;
this.messagePort(port, bOut, addrFrom, "MCR");
this.printMessageIO(port, bOut, addrFrom, "MCR");
this.bMCR = bOut;
if (this.mouse && (bPrev ^ bOut) & (SerialPort.MCR.DTR | SerialPort.MCR.RTS)) {
this.mouse.notifyMCR(this.bMCR);

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-May-14
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -279,7 +279,7 @@ State.prototype = {
this[this.id] = s;
this.fLoaded = true;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("localStorage(" + this.key + "): " + s.length + " bytes loaded");
this.printMessage("localStorage(" + this.key + "): " + s.length + " bytes loaded");
}
return true;
}
@ -318,7 +318,7 @@ State.prototype = {
var s = JSON.stringify(this[this.id]);
if (web.setLocalStorageItem(this.key, s)) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("localStorage(" + this.key + "): " + s.length + " bytes stored");
this.printMessage("localStorage(" + this.key + "): " + s.length + " bytes stored");
}
} else {
/*
@ -378,7 +378,7 @@ State.prototype = {
if (sKey && (fAll || sKey.substr(0, this.key.length) == this.key)) {
web.removeLocalStorageItem(sKey);
if (DEBUG && this.messageEnabled()) {
this.messagePrint("localStorage(" + sKey + ") removed");
this.printMessage("localStorage(" + sKey + ") removed");
}
aKeys.splice(i, 1);
i = 0;
@ -404,12 +404,12 @@ State.prototype = {
return false;
},
/**
* messagePrint(sMessage)
* printMessage(sMessage)
*
* @this {State}
* @param {string} sMessage is any caller-defined message string
*/
messagePrint: function(sMessage) {
printMessage: function(sMessage) {
if (DEBUGGER && this.dbg) this.dbg.message(sMessage);
}
};

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Jun-15
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -2013,7 +2013,7 @@ Video.prototype.setBinding = function(sHTMLType, sBinding, control)
this.sLockMessage = control.textContent;
if (this.inputScreen && this.inputScreen.lockPointer) {
control.onclick = function onClickLockPointer() {
if (DEBUG) video.messagePrint("lockPointer()");
if (DEBUG) video.printMessage("lockPointer()");
video.lockPointer(true);
};
} else {
@ -2024,7 +2024,7 @@ Video.prototype.setBinding = function(sHTMLType, sBinding, control)
case "refresh":
control.onclick = function onClickRefresh() {
if (DEBUG) video.messagePrint("refreshScreen()");
if (DEBUG) video.printMessage("refreshScreen()");
video.updateScreen(true);
};
return true;
@ -2183,7 +2183,7 @@ Video.prototype.captureTouch = function()
Video.prototype.onFocusChange = function(fFocus)
{
if (this.fHasFocus != fFocus && DEBUG && this.messageEnabled()) {
this.messagePrint("onFocusChange(" + (fFocus? "true" : "false") + ")", true);
this.printMessage("onFocusChange(" + (fFocus? "true" : "false") + ")", true);
}
/*
* As per http://stackoverflow.com/questions/6740253/disable-scrolling-when-changing-focus-form-elements-ipad-web-app,
@ -2216,7 +2216,7 @@ Video.prototype.releaseTouch = function()
*/
Video.prototype.onTouchStart = function(event)
{
if (DEBUG) this.messagePrint("onTouchStart()");
if (DEBUG) this.printMessage("onTouchStart()");
this.processTouchEvent(event, true);
};
@ -2228,7 +2228,7 @@ Video.prototype.onTouchStart = function(event)
*/
Video.prototype.onTouchMove = function(event)
{
if (DEBUG) this.messagePrint("onTouchMove()");
if (DEBUG) this.printMessage("onTouchMove()");
this.processTouchEvent(event, false);
};
@ -2240,7 +2240,7 @@ Video.prototype.onTouchMove = function(event)
*/
Video.prototype.onTouchEnd = function(event)
{
if (DEBUG) this.messagePrint("onTouchEnd()");
if (DEBUG) this.printMessage("onTouchEnd()");
};
/**
@ -2703,7 +2703,7 @@ Video.prototype.onROMLoad = function(abROM)
* TODO: Unlike the MDA/CGA font data, we may want to hang onto this data, so that we can regenerate
* the color font(s) whenever the foreground and/or background colors have been changed.
*/
if (DEBUG) this.messagePrint("onROMLoad(): EGA fonts loaded");
if (DEBUG) this.printMessage("onROMLoad(): EGA fonts loaded");
this.setFontData(abROM, [0x2230, 0x3160], 8);
}
this.setReady();
@ -2886,7 +2886,7 @@ Video.prototype.buildFont = function(nFont, offData, offSplit, cxChar, cyChar, a
var fChanges = false;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("buildFont(" + nFont + "): building " + Video.cardSpecs[nFont][0] + " font");
this.printMessage("buildFont(" + nFont + "): building " + Video.cardSpecs[nFont][0] + " font");
}
if (this.createFont(nFont, offData, offSplit, cxChar, cyChar, abFontData, aRGBColors, aColorMap)) fChanges = true;
@ -2898,7 +2898,7 @@ Video.prototype.buildFont = function(nFont, offData, offSplit, cxChar, cyChar, a
if (this.fDoubleFont) {
nFont <<= 1;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("buildFont(" + nFont + "): building " + Video.cardSpecs[nFont >> 1][0] + " double-size font");
this.printMessage("buildFont(" + nFont + "): building " + Video.cardSpecs[nFont >> 1][0] + " double-size font");
}
if (this.createFont(nFont, offData, offSplit, cxChar, cyChar, abFontData, aRGBColors, aColorMap)) fChanges = true;
}
@ -2947,7 +2947,7 @@ Video.prototype.createFont = function(nFont, offData, offSplit, cxChar, cyChar,
var rgbColorOrig = font.aCSSColors[iColor]? font.aRGBColors[iColor] : [];
if (rgbColor[0] !== rgbColorOrig[0] || rgbColor[1] !== rgbColorOrig[1] || rgbColor[2] !== rgbColorOrig[2]) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("creating font color " + iColor + " for font " + nFont);
this.printMessage("creating font color " + iColor + " for font " + nFont);
}
this.createFontColor(font, iColor, rgbColor, nDouble, offData, offSplit, cxChar, cyChar, abFontData);
fChanges = true;
@ -3179,7 +3179,7 @@ Video.prototype.checkCursor = function()
var iCellCursor = (this.cardActive.aCRTCRegs[Card.CRTC.CURSOR_ADDR_LO] + ((this.cardActive.aCRTCRegs[Card.CRTC.CURSOR_ADDR_HI] & Card.CRTC.ADDR_HI_MASK) << 8));
if (this.iCellCursor != iCellCursor) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("checkCursor(): cursor moved from " + this.iCellCursor + " to " + iCellCursor);
this.printMessage("checkCursor(): cursor moved from " + this.iCellCursor + " to " + iCellCursor);
}
this.removeCursor();
this.iCellCursor = iCellCursor;
@ -3234,7 +3234,7 @@ Video.prototype.removeCursor = function()
this.updateChar(col, row, data);
}
if (DEBUG && this.messageEnabled()) {
this.messagePrint("removeCursor(): removed from " + row + "," + col);
this.printMessage("removeCursor(): removed from " + row + "," + col);
}
this.aCellCache[this.iCellCursor] = data;
}
@ -3301,7 +3301,7 @@ Video.prototype.getAccess = function()
break;
default:
if (DEBUG && this.messageEnabled()) {
this.messagePrint("getAccess(): invalid GRC mode (" + str.toHexByte(regGRCMode) + ")");
this.printMessage("getAccess(): invalid GRC mode (" + str.toHexByte(regGRCMode) + ")");
}
break;
}
@ -3329,7 +3329,7 @@ Video.prototype.setAccess = function(nAccess)
if (nAccess != null && card && nAccess != card.nAccess) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("setAccess(0x" + str.toHexWord(nAccess) + ")");
this.printMessage("setAccess(0x" + str.toHexWord(nAccess) + ")");
}
card.setMemoryAccess(nAccess);
@ -3666,7 +3666,7 @@ Video.prototype.setMode = function(nMode, fForce)
if (nMode != null && (nMode != this.nMode || fForce)) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("setMode(0x" + str.toHexWord(nMode) + (fForce? ",force" : "") + ")");
this.printMessage("setMode(0x" + str.toHexWord(nMode) + (fForce? ",force" : "") + ")");
}
this.cUpdates = 0; // count updateScreen() calls as a means of driving blink updates
@ -3692,7 +3692,7 @@ Video.prototype.setMode = function(nMode, fForce)
if (this.addrBuffer) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("setMode(" + nMode + "): removing 0x" + str.toHex(this.sizeBuffer) + " bytes from 0x" + str.toHex(this.addrBuffer));
this.printMessage("setMode(" + nMode + "): removing 0x" + str.toHex(this.sizeBuffer) + " bytes from 0x" + str.toHex(this.addrBuffer));
}
if (!this.bus.removeMemory(this.addrBuffer, this.sizeBuffer)) {
@ -3711,7 +3711,7 @@ Video.prototype.setMode = function(nMode, fForce)
this.sizeBuffer = card.sizeBuffer;
if (DEBUG && this.messageEnabled()) {
this.messagePrint("setMode(" + nMode + "): adding 0x" + str.toHex(this.sizeBuffer) + " bytes to 0x" + str.toHex(this.addrBuffer));
this.printMessage("setMode(" + nMode + "): adding 0x" + str.toHex(this.sizeBuffer) + " bytes to 0x" + str.toHex(this.addrBuffer));
}
var controller = (card === this.cardEGA? card : null);
@ -4379,7 +4379,7 @@ Video.prototype.inMDAStatus = function(port, addrFrom)
Video.prototype.outFeat = function(port, bOut, addrFrom)
{
this.cardEGA.featReg = (this.cardEGA.featReg & ~Card.FEAT_CTRL.BITS) | (bOut & Card.FEAT_CTRL.BITS);
this.messagePort(port, bOut, addrFrom, "FEAT");
this.printMessageIO(port, bOut, addrFrom, "FEAT");
};
/**
@ -4394,7 +4394,7 @@ Video.prototype.inATC = function(port, addrFrom)
{
var b = this.cardEGA.fATCData? this.cardEGA.aATCRegs[this.cardEGA.iATCReg & Card.ATC.INDX_MASK] : this.cardEGA.iATCReg;
if (this.messageEnabled()) {
this.messagePort(Card.ATC.PORT, null, addrFrom, "ATC." + (this.cardEGA.fATCData? this.cardEGA.asATCRegs[this.cardEGA.iATCReg & Card.ATC.INDX_MASK] : "INDX"), b);
this.printMessageIO(Card.ATC.PORT, null, addrFrom, "ATC." + (this.cardEGA.fATCData? this.cardEGA.asATCRegs[this.cardEGA.iATCReg & Card.ATC.INDX_MASK] : "INDX"), b);
}
this.cardEGA.fATCData = !this.cardEGA.fATCData;
return b;
@ -4413,16 +4413,16 @@ Video.prototype.outATC = function(port, bOut, addrFrom)
var fPalEnabled = (this.cardEGA.iATCReg & Card.ATC.INDX_PAL_ENABLE);
if (!this.cardEGA.fATCData) {
this.cardEGA.iATCReg = bOut;
this.messagePort(port, bOut, addrFrom, "ATC.INDX");
this.printMessageIO(port, bOut, addrFrom, "ATC.INDX");
this.cardEGA.fATCData = true;
if ((bOut & Card.ATC.INDX_PAL_ENABLE) && !fPalEnabled) {
if (!this.buildFonts()) {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("outATC(" + str.toHexByte(bOut) + "): no font changes required");
this.printMessage("outATC(" + str.toHexByte(bOut) + "): no font changes required");
}
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("outATC(" + str.toHexByte(bOut) + "): redraw screen for font changes");
this.printMessage("outATC(" + str.toHexByte(bOut) + "): redraw screen for font changes");
}
this.updateScreen(true);
}
@ -4432,7 +4432,7 @@ Video.prototype.outATC = function(port, bOut, addrFrom)
if (iReg >= Card.ATC.PALETTE_REGS || !fPalEnabled) {
if (Video.TRAPALL || this.cardEGA.aATCRegs[iReg] !== bOut) {
if (this.messageEnabled()) {
this.messagePort(port, bOut, addrFrom, "ATC." + this.cardEGA.asATCRegs[iReg]);
this.printMessageIO(port, bOut, addrFrom, "ATC." + this.cardEGA.asATCRegs[iReg]);
}
this.cardEGA.aATCRegs[iReg] = bOut;
}
@ -4458,7 +4458,7 @@ Video.prototype.inStatus0 = function(port, addrFrom)
* TODO: Figure out where Card.STATUS0.FEAT bits should come from....
*/
this.cardEGA.status0 = b;
this.messagePort(Card.STATUS0.PORT, null, addrFrom, "STATUS0", b);
this.printMessageIO(Card.STATUS0.PORT, null, addrFrom, "STATUS0", b);
return b;
};
@ -4472,7 +4472,7 @@ Video.prototype.outMisc = function(port, bOut, addrFrom)
{
this.cardEGA.miscReg = bOut;
this.enableEGA();
this.messagePort(Card.MISC.PORT, bOut, addrFrom, "MISC");
this.printMessageIO(Card.MISC.PORT, bOut, addrFrom, "MISC");
};
/**
@ -4486,7 +4486,7 @@ Video.prototype.outMisc = function(port, bOut, addrFrom)
Video.prototype.inSEQIndx = function(port, addrFrom)
{
var b = this.cardEGA.iSEQReg;
this.messagePort(Card.SEQ.INDX.PORT, null, addrFrom, "SEQ.INDX", b);
this.printMessageIO(Card.SEQ.INDX.PORT, null, addrFrom, "SEQ.INDX", b);
return b;
};
@ -4501,7 +4501,7 @@ Video.prototype.inSEQIndx = function(port, addrFrom)
Video.prototype.outSEQIndx = function(port, bOut, addrFrom)
{
this.cardEGA.iSEQReg = bOut;
this.messagePort(Card.SEQ.INDX.PORT, bOut, addrFrom, "SEQ.INDX");
this.printMessageIO(Card.SEQ.INDX.PORT, bOut, addrFrom, "SEQ.INDX");
};
/**
@ -4516,7 +4516,7 @@ Video.prototype.inSEQData = function(port, addrFrom)
{
var b = this.cardEGA.aSEQRegs[this.cardEGA.iSEQReg];
if (this.messageEnabled()) {
this.messagePort(Card.SEQ.DATA.PORT, null, addrFrom, "SEQ" + this.cardEGA.asSEQRegs[this.cardEGA.iSEQReg], b);
this.printMessageIO(Card.SEQ.DATA.PORT, null, addrFrom, "SEQ" + this.cardEGA.asSEQRegs[this.cardEGA.iSEQReg], b);
}
return b;
};
@ -4533,7 +4533,7 @@ Video.prototype.outSEQData = function(port, bOut, addrFrom)
{
if (Video.TRAPALL || this.cardEGA.aSEQRegs[this.cardEGA.iSEQReg] !== bOut) {
if (this.messageEnabled()) {
this.messagePort(Card.SEQ.DATA.PORT, bOut, addrFrom, "SEQ." + this.cardEGA.asSEQRegs[this.cardEGA.iSEQReg]);
this.printMessageIO(Card.SEQ.DATA.PORT, bOut, addrFrom, "SEQ." + this.cardEGA.asSEQRegs[this.cardEGA.iSEQReg]);
}
this.cardEGA.aSEQRegs[this.cardEGA.iSEQReg] = bOut;
}
@ -4553,7 +4553,7 @@ Video.prototype.outSEQData = function(port, bOut, addrFrom)
Video.prototype.inGRCPos1 = function(port, addrFrom)
{
var b = this.cardEGA.iGRCPos1;
this.messagePort(Card.GRC.POS1_PORT, null, addrFrom, "GRC1", b);
this.printMessageIO(Card.GRC.POS1_PORT, null, addrFrom, "GRC1", b);
return b;
};
@ -4574,7 +4574,7 @@ Video.prototype.inGRCPos1 = function(port, addrFrom)
Video.prototype.outGRCPos1 = function(port, bOut, addrFrom)
{
this.cardEGA.iGRCPos1 = bOut;
this.messagePort(Card.GRC.POS1_PORT, bOut, addrFrom, "GRC1");
this.printMessageIO(Card.GRC.POS1_PORT, bOut, addrFrom, "GRC1");
};
/**
@ -4588,7 +4588,7 @@ Video.prototype.outGRCPos1 = function(port, bOut, addrFrom)
Video.prototype.inGRCPos2 = function(port, addrFrom)
{
var b = this.cardEGA.iGRCPos2;
this.messagePort(Card.GRC.POS2_PORT, null, addrFrom, "GRC2", b);
this.printMessageIO(Card.GRC.POS2_PORT, null, addrFrom, "GRC2", b);
return b;
};
@ -4608,7 +4608,7 @@ Video.prototype.inGRCPos2 = function(port, addrFrom)
Video.prototype.outGRCPos2 = function(port, bOut, addrFrom)
{
this.cardEGA.iGRCPos2 = bOut;
this.messagePort(Card.GRC.POS2_PORT, bOut, addrFrom, "GRC2");
this.printMessageIO(Card.GRC.POS2_PORT, bOut, addrFrom, "GRC2");
};
/**
@ -4622,7 +4622,7 @@ Video.prototype.outGRCPos2 = function(port, bOut, addrFrom)
Video.prototype.inGRCIndx = function(port, addrFrom)
{
var b = this.cardEGA.iGRCReg;
this.messagePort(Card.GRC.INDX.PORT, null, addrFrom, "GRC.INDX", b);
this.printMessageIO(Card.GRC.INDX.PORT, null, addrFrom, "GRC.INDX", b);
return b;
};
@ -4637,7 +4637,7 @@ Video.prototype.inGRCIndx = function(port, addrFrom)
Video.prototype.outGRCIndx = function(port, bOut, addrFrom)
{
this.cardEGA.iGRCReg = bOut;
this.messagePort(Card.GRC.INDX.PORT, bOut, addrFrom, "GRC.INDX");
this.printMessageIO(Card.GRC.INDX.PORT, bOut, addrFrom, "GRC.INDX");
};
/**
@ -4652,7 +4652,7 @@ Video.prototype.inGRCData = function(port, addrFrom)
{
var b = this.cardEGA.aGRCRegs[this.cardEGA.iGRCReg];
if (this.messageEnabled()) {
this.messagePort(Card.GRC.DATA.PORT, null, addrFrom, "GRC." + this.cardEGA.asGRCRegs[this.cardEGA.iGRCReg], b);
this.printMessageIO(Card.GRC.DATA.PORT, null, addrFrom, "GRC." + this.cardEGA.asGRCRegs[this.cardEGA.iGRCReg], b);
}
return b;
};
@ -4669,7 +4669,7 @@ Video.prototype.outGRCData = function(port, bOut, addrFrom)
{
if (Video.TRAPALL || this.cardEGA.aGRCRegs[this.cardEGA.iGRCReg] !== bOut) {
if (this.messageEnabled()) {
this.messagePort(Card.GRC.DATA.PORT, bOut, addrFrom, "GRC." + this.cardEGA.asGRCRegs[this.cardEGA.iGRCReg]);
this.printMessageIO(Card.GRC.DATA.PORT, bOut, addrFrom, "GRC." + this.cardEGA.asGRCRegs[this.cardEGA.iGRCReg]);
}
this.cardEGA.aGRCRegs[this.cardEGA.iGRCReg] = bOut;
}
@ -4796,7 +4796,7 @@ Video.prototype.inCGAColor = function(port, addrFrom)
{
var b = this.cardColor.colorReg;
if (this.messageEnabled()) {
this.messagePort(this.cardColor.port + 5, null, addrFrom, this.cardColor.type + ".COLOR", b);
this.printMessageIO(this.cardColor.port + 5, null, addrFrom, this.cardColor.type + ".COLOR", b);
}
return b;
};
@ -4812,7 +4812,7 @@ Video.prototype.inCGAColor = function(port, addrFrom)
Video.prototype.outCGAColor = function(port, bOut, addrFrom)
{
if (this.messageEnabled()) {
this.messagePort(this.cardColor.port + 5, bOut, addrFrom, this.cardColor.type + ".COLOR");
this.printMessageIO(this.cardColor.port + 5, bOut, addrFrom, this.cardColor.type + ".COLOR");
}
if (this.cardColor.colorReg !== bOut) {
this.cardColor.colorReg = bOut;
@ -4848,7 +4848,7 @@ Video.prototype.inCGAStatus = function(port, addrFrom)
Video.prototype.inCRTCIndx = function(card, addrFrom)
{
var b = card.iCRTCReg;
this.messagePort(card.port, null, addrFrom, "CRTC.INDX", b);
this.printMessageIO(card.port, null, addrFrom, "CRTC.INDX", b);
return b;
};
@ -4864,7 +4864,7 @@ Video.prototype.outCRTCIndx = function(card, bOut, addrFrom)
{
card.iCRTCPrev = card.iCRTCReg;
card.iCRTCReg = bOut & Card.CGA.CRTC.INDX.MASK;
this.messagePort(card.port, bOut, addrFrom, "CRTC.INDX");
this.printMessageIO(card.port, bOut, addrFrom, "CRTC.INDX");
};
/**
@ -4880,7 +4880,7 @@ Video.prototype.inCRTCData = function(card, addrFrom)
var b;
if (card.iCRTCReg < card.nCRTCRegs) b = card.aCRTCRegs[card.iCRTCReg];
if (this.messageEnabled()) {
this.messagePort(card.port + 1, null, addrFrom, "CRTC." + card.asCRTCRegs[card.iCRTCReg], b);
this.printMessageIO(card.port + 1, null, addrFrom, "CRTC." + card.asCRTCRegs[card.iCRTCReg], b);
}
return b;
};
@ -4898,7 +4898,7 @@ Video.prototype.outCRTCData = function(card, bOut, addrFrom)
if (card.iCRTCReg < card.nCRTCRegs) {
if (Video.TRAPALL || card.aCRTCRegs[card.iCRTCReg] !== bOut) {
if (this.messageEnabled()) {
this.messagePort(card.port + 1, bOut, addrFrom, "CRTC." + card.asCRTCRegs[card.iCRTCReg]);
this.printMessageIO(card.port + 1, bOut, addrFrom, "CRTC." + card.asCRTCRegs[card.iCRTCReg]);
}
card.aCRTCRegs[card.iCRTCReg] = bOut;
}
@ -4917,7 +4917,7 @@ Video.prototype.outCRTCData = function(card, bOut, addrFrom)
this.checkCursor();
} else {
if (DEBUG && this.messageEnabled()) {
this.messagePrint("outCRTCData(): ignoring unexpected write to CRTC[" + str.toHexByte(card.iCRTCReg) + "]: " + str.toHexByte(bOut));
this.printMessage("outCRTCData(): ignoring unexpected write to CRTC[" + str.toHexByte(card.iCRTCReg) + "]: " + str.toHexByte(bOut));
}
}
};
@ -4933,7 +4933,7 @@ Video.prototype.outCRTCData = function(card, bOut, addrFrom)
Video.prototype.inCardMode = function(card, addrFrom)
{
var b = card.modeReg;
this.messagePort(card.port + 4, null, addrFrom, "MODE", b);
this.printMessageIO(card.port + 4, null, addrFrom, "MODE", b);
return b;
};
@ -4947,7 +4947,7 @@ Video.prototype.inCardMode = function(card, addrFrom)
*/
Video.prototype.outCardMode = function(card, bOut, addrFrom)
{
this.messagePort(card.port + 4, bOut, addrFrom, "MODE");
this.printMessageIO(card.port + 4, bOut, addrFrom, "MODE");
card.modeReg = bOut;
this.checkMode(false);
};
@ -5034,7 +5034,7 @@ Video.prototype.inCardStatus = function(card, addrFrom)
b = (card.statusReg ^= (Card.CGA.STATUS.DISP_ENABLE | Card.CGA.STATUS.VERT_RETRACE)) | 0xf0;
}
card.statusReg = b;
this.messagePort(card.port + 6, null, addrFrom, (card === this.cardEGA? "STATUS1" : "STATUS"), b);
this.printMessageIO(card.port + 6, null, addrFrom, (card === this.cardEGA? "STATUS1" : "STATUS"), b);
return b;
};

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -326,12 +326,13 @@ var X86 = {
}
};
if (BACKTRACK) {
X86.BACKTRACK = {
SP_LO: 0,
SP_HI: 0
};
}
/*
* BACKTRACK-related definitions (used only if BACKTRACK is defined)
*/
X86.BACKTRACK = {
SP_LO: 0,
SP_HI: 0
};
/*
* Some PS flags are stored directly in regPS, hence the "direct" designation.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -1075,7 +1075,7 @@ X86CPU.prototype.setProtMode = function(fProt)
fProt = !!(this.regMSW & X86.MSW.PE);
}
if (!fProt) {
this.messagePrint("returning to real-mode");
this.printMessage("returning to real-mode");
}
this.aOpGrp6 = (fProt? X86Op0F.aOpGrp6Prot : X86Op0F.aOpGrp6Real);
this.segCS.updateMode(fProt);
@ -2121,7 +2121,7 @@ X86CPU.prototype.getBytePrefetch = function(addr)
var b;
if (!this.cbPrefetchQueued) {
if (MAXDEBUG) {
this.messagePrint(" getBytePrefetch[" + this.iPrefetchTail + "]: filling");
this.printMessage(" getBytePrefetch[" + this.iPrefetchTail + "]: filling");
this.assert(addr == this.addrPrefetchHead, "X86CPU.getBytePrefetch(" + str.toHex(addr) + "): invalid head address (" + str.toHex(this.addrPrefetchHead) + ")");
this.assert(this.iPrefetchTail == this.iPrefetchHead, "X86CPU.getBytePrefetch(" + str.toHex(addr) + "): head (" + this.iPrefetchHead + ") does not match tail (" + this.iPrefetchTail + ")");
}
@ -2141,7 +2141,7 @@ X86CPU.prototype.getBytePrefetch = function(addr)
}
b = this.aPrefetch[this.iPrefetchTail] & 0xff;
if (MAXDEBUG) {
this.messagePrint(" getBytePrefetch[" + this.iPrefetchTail + "]: " + str.toHex(addr) + ":" + str.toHexByte(b));
this.printMessage(" getBytePrefetch[" + this.iPrefetchTail + "]: " + str.toHex(addr) + ":" + str.toHexByte(b));
this.assert(addr == (this.aPrefetch[this.iPrefetchTail] >> 8), "X86CPU.getBytePrefetch(" + str.toHex(addr) + "): invalid tail address (" + str.toHex(this.aPrefetch[this.iPrefetchTail] >> 8) + ")");
}
this.iPrefetchTail = (this.iPrefetchTail + 1) & X86CPU.PREFETCH.MASK;
@ -2184,7 +2184,7 @@ X86CPU.prototype.fillPrefetch = function(n)
var addr = this.addrPrefetchHead;
var b = this.aMemBlocks[(addr & this.addrMemMask) >> this.blockShift].readByte(addr & this.blockLimit);
this.aPrefetch[this.iPrefetchHead] = b | (addr << 8);
if (MAXDEBUG) this.messagePrint(" fillPrefetch[" + this.iPrefetchHead + "]: " + str.toHex(addr) + ":" + str.toHexByte(b));
if (MAXDEBUG) this.printMessage(" fillPrefetch[" + this.iPrefetchHead + "]: " + str.toHex(addr) + ":" + str.toHexByte(b));
this.addrPrefetchHead = (addr + 1) & this.addrMemMask;
this.iPrefetchHead = (this.iPrefetchHead + 1) & X86CPU.PREFETCH.MASK;
this.cbPrefetchQueued++;
@ -2209,7 +2209,7 @@ X86CPU.prototype.flushPrefetch = function(addr)
{
this.addrPrefetchHead = addr;
this.iPrefetchTail = this.iPrefetchHead = this.cbPrefetchQueued = this.cbPrefetchValid = 0;
if (MAXDEBUG && addr !== undefined) this.messagePrint(" flushPrefetch[-]: " + str.toHex(addr));
if (MAXDEBUG && addr !== undefined) this.printMessage(" flushPrefetch[-]: " + str.toHex(addr));
};
/**
@ -2232,7 +2232,7 @@ X86CPU.prototype.advancePrefetch = function(inc)
this.cbPrefetchQueued -= inc;
} else {
this.flushPrefetch(this.regEIP);
if (MAXDEBUG) this.messagePrint("advancePrefetch(" + inc + "): flushed");
if (MAXDEBUG) this.printMessage("advancePrefetch(" + inc + "): flushed");
}
};

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -573,7 +573,7 @@ var X86Help = {
opHelpFault: function(nFault, nError, fHalt)
{
if (!this.aFlags.fComplete) {
this.messagePrint("Fault " + str.toHexByte(nFault) + " blocked by Debugger", Messages.WARN);
this.printMessage("Fault " + str.toHexByte(nFault) + " blocked by Debugger", Messages.WARN);
this.setIP(this.opEA - this.segCS.base);
return;
}
@ -686,22 +686,22 @@ var X86Help = {
if (this.messageEnabled(bitsMessage) || fHalt) {
var sMessage = (fHalt? '\n' : '') + "Fault " + str.toHexByte(nFault) + (nError != null? " (" + str.toHexWord(nError) + ")" : "") + " on opcode 0x" + str.toHexByte(bOpcode) + " at " + str.toHexAddr(this.regIP, this.segCS.sel) + " (%" + str.toHex(this.regEIP, 6) + ")";
var fRunning = this.aFlags.fRunning;
if (this.messagePrint(sMessage, bitsMessage)) {
if (this.printMessage(sMessage, bitsMessage)) {
if (fHalt) {
/*
* By setting fHalt to fRunning (which is true while running but false while single-stepping),
* this allows a fault to be dispatched when you single-step over a faulting instruction; you can
* then continue single-stepping into the fault handler, or start running again.
*
* Note that we had to capture fRunning before calling messagePrint(), because if MESSAGE.HALT
* is set, messagePrint() will have already halted the CPU.
* Note that we had to capture fRunning before calling printMessage(), because if MESSAGE.HALT
* is set, printMessage() will have already halted the CPU.
*/
fHalt = fRunning;
this.dbg.stopCPU();
}
} else {
/*
* If messagePrint() returned false, then messageEnabled() must have returned false as well, which
* If printMessage() returned false, then messageEnabled() must have returned false as well, which
* means that fHalt must be true. Which means we should shut the machine down.
*/
this.assert(fHalt);

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Sep-05
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.
@ -1985,7 +1985,7 @@ var X86OpXX = {
* op=0x9B (wait)
*/
opWAIT: function() {
this.messagePrint("WAIT not implemented", Messages.CPU);
this.printMessage("WAIT not implemented", Messages.CPU);
this.nStepCycles--;
},
/**

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-Sep-10
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -221,7 +221,7 @@
<xsl:otherwise/>
</xsl:choose>
<div class="{$APPCLASS}-copyright">
<a href="http://{$SITEHOST}" target="_blank">PCjs</a> v<xsl:value-of select="$APPVERSION"/> © 2012-2014 by <a href="http://twitter.com/jeffpar" target="_blank">@jeffpar</a>
<a href="http://{$SITEHOST}" target="_blank">PCjs</a> v<xsl:value-of select="$APPVERSION"/> © 2012-2015 by <a href="http://twitter.com/jeffpar" target="_blank">@jeffpar</a>
</div>
<div style="clear:both"> </div>
</xsl:if>

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-May-14
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
@ -952,7 +952,7 @@ Component.prototype = {
return false;
},
/**
* messagePrint(sMessage, bitsMessage, fAddress)
* printMessage(sMessage, bitsMessage, fAddress)
*
* If bitsMessage is not specified, the component's MESSAGE category is used.
* If bitsMessage is true, the message is displayed regardless.
@ -963,7 +963,7 @@ Component.prototype = {
* @param {boolean} [fAddress] is true to display the current address
* @return {boolean} true if Debugger available, false if not
*/
messagePrint: function(sMessage, bitsMessage, fAddress) {
printMessage: function(sMessage, bitsMessage, fAddress) {
if (DEBUGGER && this.dbg) {
if (bitsMessage === true || this.messageEnabled(bitsMessage | 0)) {
this.dbg.message(sMessage, fAddress);
@ -973,7 +973,7 @@ Component.prototype = {
return false;
},
/**
* messagePort(port, bOut, addrFrom, name, bIn, bitsMessage)
* printMessageIO(port, bOut, addrFrom, name, bIn, bitsMessage)
*
* If bitsMessage is not specified, the component's MESSAGE category is used.
* If bitsMessage is true, the message is displayed as long as MESSAGE.PORT is enabled.
@ -986,7 +986,7 @@ Component.prototype = {
* @param {number|null} [bIn] is the input value, if known, on an input operation
* @param {number|boolean} [bitsMessage] is zero or more MESSAGE_* category flag(s)
*/
messagePort: function(port, bOut, addrFrom, name, bIn, bitsMessage) {
printMessageIO: function(port, bOut, addrFrom, name, bIn, bitsMessage) {
if (DEBUGGER && this.dbg) {
if (bitsMessage === true) {
bitsMessage = 0;

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Aug-28
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2012-Dec-04
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-03-16
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-Aug-22
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 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/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-05-07
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-13
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-Apr-29
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-03-09
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-May-13
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-03-09
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -4,7 +4,7 @@
* @version 1.0
* Created 2014-05-08
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2015 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -39,7 +39,7 @@
<div class="common-bottom">
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> website © 2012-2014 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> website © 2012-2015 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright">PCjs and C1Pjs released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
</p>
</div>