Removed all obsolete @suppress directives
This commit is contained in:
parent
a99a91999d
commit
426fd0ff40
60 changed files with 6221 additions and 340 deletions
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file tests raw floating point access using typed arrays.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2014-Aug-20
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file generates PCjs 8086 mode-byte decoders.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-08
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Bus component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-04
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs ChipSet component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-14
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -952,14 +951,13 @@ ChipSet.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
if (DEBUGGER) {
|
||||
if (dbg) {
|
||||
var chipset = this;
|
||||
dbg.messageInit(ChipSet);
|
||||
dbg.messageDump(ChipSet.MESSAGE_PIC, function onDumpPIC() {
|
||||
dbg.messageDump(Debugger.MESSAGE_PIC, function onDumpPIC() {
|
||||
chipset.dumpPIC();
|
||||
});
|
||||
dbg.messageDump(ChipSet.MESSAGE_TIMER, function onDumpTimer() {
|
||||
dbg.messageDump(Debugger.MESSAGE_TIMER, function onDumpTimer() {
|
||||
chipset.dumpTimer();
|
||||
});
|
||||
dbg.messageDump(ChipSet.MESSAGE_CMOS, function onDumpCMOS() {
|
||||
dbg.messageDump(Debugger.MESSAGE_CMOS, function onDumpCMOS() {
|
||||
chipset.dumpCMOS();
|
||||
});
|
||||
}
|
||||
|
|
@ -2098,7 +2096,7 @@ ChipSet.prototype.inDMAChannelAddr = function(iDMAC, iChannel, port, addrFrom)
|
|||
var channel = controller.aChannels[iChannel];
|
||||
var b = channel.addrCurrent[controller.bIndex];
|
||||
controller.bIndex ^= 0x1;
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", ChipSet.MESSAGE_DMA, b);
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", Debugger.MESSAGE_DMA, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -2115,7 +2113,7 @@ ChipSet.prototype.inDMAChannelAddr = function(iDMAC, iChannel, port, addrFrom)
|
|||
ChipSet.prototype.outDMAChannelAddr = function outDMAChannelAddr(iDMAC, iChannel, port, bOut, addrFrom)
|
||||
{
|
||||
var controller = this.aDMACs[iDMAC];
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".ADDR[" + controller.bIndex + "]", Debugger.MESSAGE_DMA);
|
||||
var channel = controller.aChannels[iChannel];
|
||||
channel.addrCurrent[controller.bIndex] = channel.addrInit[controller.bIndex] = bOut;
|
||||
controller.bIndex ^= 0x1;
|
||||
|
|
@ -2137,7 +2135,7 @@ ChipSet.prototype.inDMAChannelCount = function(iDMAC, iChannel, port, addrFrom)
|
|||
var channel = controller.aChannels[iChannel];
|
||||
var b = channel.countCurrent[controller.bIndex];
|
||||
controller.bIndex ^= 0x1;
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", ChipSet.MESSAGE_DMA, b);
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", Debugger.MESSAGE_DMA, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -2154,7 +2152,7 @@ ChipSet.prototype.inDMAChannelCount = function(iDMAC, iChannel, port, addrFrom)
|
|||
ChipSet.prototype.outDMAChannelCount = function(iDMAC, iChannel, port, bOut, addrFrom)
|
||||
{
|
||||
var controller = this.aDMACs[iDMAC];
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".COUNT[" + controller.bIndex + "]", Debugger.MESSAGE_DMA);
|
||||
var channel = controller.aChannels[iChannel];
|
||||
channel.countCurrent[controller.bIndex] = channel.countInit[controller.bIndex] = bOut;
|
||||
controller.bIndex ^= 0x1;
|
||||
|
|
@ -2195,7 +2193,7 @@ ChipSet.prototype.inDMAStatus = function(iDMAC, port, addrFrom)
|
|||
var controller = this.aDMACs[iDMAC];
|
||||
var b = controller.bStatus | 0x1;
|
||||
controller.bStatus &= ~0xf;
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".STATUS", ChipSet.MESSAGE_DMA, b);
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".STATUS", Debugger.MESSAGE_DMA, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -2210,7 +2208,7 @@ ChipSet.prototype.inDMAStatus = function(iDMAC, port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outDMACmd = function(iDMAC, port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CMD", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CMD", Debugger.MESSAGE_DMA);
|
||||
this.aDMACs[iDMAC].bCmd = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -2236,7 +2234,7 @@ ChipSet.prototype.outDMACmd = function(iDMAC, port, bOut, addrFrom)
|
|||
ChipSet.prototype.outDMAReq = function(iDMAC, port, bOut, addrFrom)
|
||||
{
|
||||
var controller = this.aDMACs[iDMAC];
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".REQ", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".REQ", Debugger.MESSAGE_DMA);
|
||||
/*
|
||||
* Bits 0-1 contain the channel number
|
||||
*/
|
||||
|
|
@ -2261,7 +2259,7 @@ ChipSet.prototype.outDMAReq = function(iDMAC, port, bOut, addrFrom)
|
|||
ChipSet.prototype.outDMAMask = function(iDMAC, port, bOut, addrFrom)
|
||||
{
|
||||
var controller = this.aDMACs[iDMAC];
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MASK", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MASK", Debugger.MESSAGE_DMA);
|
||||
var iChannel = bOut & ChipSet.DMA_MASK.CHANNEL;
|
||||
var channel = controller.aChannels[iChannel];
|
||||
channel.masked = (bOut & ChipSet.DMA_MASK.CHANNEL_SET? true : false);
|
||||
|
|
@ -2279,7 +2277,7 @@ ChipSet.prototype.outDMAMask = function(iDMAC, port, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outDMAMode = function(iDMAC, port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MODE", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".MODE", Debugger.MESSAGE_DMA);
|
||||
var iChannel = bOut & ChipSet.DMA_MODE.CHANNEL;
|
||||
this.aDMACs[iDMAC].aChannels[iChannel].mode = bOut;
|
||||
};
|
||||
|
|
@ -2298,7 +2296,7 @@ ChipSet.prototype.outDMAMode = function(iDMAC, port, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outDMAIndex = function(iDMAC, port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".INDEX", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".INDEX", Debugger.MESSAGE_DMA);
|
||||
this.aDMACs[iDMAC].bIndex = 0;
|
||||
};
|
||||
|
||||
|
|
@ -2313,7 +2311,7 @@ ChipSet.prototype.outDMAIndex = function(iDMAC, port, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outDMAClear = function(iDMAC, port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CLEAR", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CLEAR", Debugger.MESSAGE_DMA);
|
||||
/*
|
||||
* The value written to this port doesn't matter; any write triggers a "master clear" operation
|
||||
*/
|
||||
|
|
@ -2336,7 +2334,7 @@ ChipSet.prototype.outDMAClear = function(iDMAC, port, bOut, addrFrom)
|
|||
ChipSet.prototype.inDMAPageReg = function(iDMAC, iChannel, port, addrFrom)
|
||||
{
|
||||
var bIn = this.aDMACs[iDMAC].aChannels[iChannel].bPage;
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", ChipSet.MESSAGE_DMA, bIn);
|
||||
this.messagePort(port, null, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", Debugger.MESSAGE_DMA, bIn);
|
||||
return bIn;
|
||||
};
|
||||
|
||||
|
|
@ -2352,7 +2350,7 @@ ChipSet.prototype.inDMAPageReg = function(iDMAC, iChannel, port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outDMAPageReg = function(iDMAC, iChannel, port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA" + iDMAC + ".CHANNEL" + iChannel + ".PAGE", Debugger.MESSAGE_DMA);
|
||||
this.aDMACs[iDMAC].aChannels[iChannel].bPage = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -2368,7 +2366,7 @@ ChipSet.prototype.outDMAPageReg = function(iDMAC, iChannel, port, bOut, addrFrom
|
|||
ChipSet.prototype.inDMAPageSpare = function(iSpare, port, addrFrom)
|
||||
{
|
||||
var bIn = this.abDMAPageSpare[iSpare];
|
||||
this.messagePort(port, null, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", ChipSet.MESSAGE_DMA, bIn);
|
||||
this.messagePort(port, null, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", Debugger.MESSAGE_DMA, bIn);
|
||||
return bIn;
|
||||
};
|
||||
|
||||
|
|
@ -2383,7 +2381,7 @@ ChipSet.prototype.inDMAPageSpare = function(iSpare, port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outDMAPageSpare = function(iSpare, port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", ChipSet.MESSAGE_DMA);
|
||||
this.messagePort(port, bOut, addrFrom, "DMA.SPARE" + iSpare + ".PAGE", Debugger.MESSAGE_DMA);
|
||||
this.abDMAPageSpare[iSpare] = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -2451,7 +2449,7 @@ ChipSet.prototype.requestDMA = function(iDMAChannel, done)
|
|||
var channel = controller.aChannels[iChannel];
|
||||
|
||||
if (!channel.component || !channel.fnTransfer || !channel.obj) {
|
||||
if (DEBUG) this.messageDebugger("requestDMA(" + iDMAChannel + "): not connected to a component", ChipSet.MESSAGE_DMA);
|
||||
if (DEBUG) this.messageDebugger("requestDMA(" + iDMAChannel + "): not connected to a component", Debugger.MESSAGE_DMA);
|
||||
if (done) done(true);
|
||||
return;
|
||||
}
|
||||
|
|
@ -2466,7 +2464,7 @@ ChipSet.prototype.requestDMA = function(iDMAChannel, done)
|
|||
if (done) channel.done = done;
|
||||
|
||||
if (channel.masked) {
|
||||
if (DEBUG) this.messageDebugger("requestDMA(" + iDMAChannel + "): channel masked, request queued", ChipSet.MESSAGE_DMA);
|
||||
if (DEBUG) this.messageDebugger("requestDMA(" + iDMAChannel + "): channel masked, request queued", Debugger.MESSAGE_DMA);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2517,7 +2515,7 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
|
|||
var addr = (channel.bPage << 16) | (channel.addrCurrent[1] << 8) | channel.addrCurrent[0];
|
||||
if (DEBUG && DEBUGGER && channel.sAddrDebug === null) {
|
||||
channel.sAddrDebug = str.toHex(addr >> 4, 4) + ":" + str.toHex(addr & 0xf, 4);
|
||||
if (this.dbg && this.dbg.messageEnabled(ChipSet.MESSAGE_DMA | (iDMAChannel == ChipSet.DMA_FDC? ChipSet.MESSAGE_FDC : (iDMAChannel == ChipSet.DMA_HDC? ChipSet.MESSAGE_HDC : ChipSet.MESSAGE_LOG))) && channel.xfer != ChipSet.DMA_MODE.XFER_WRITE) {
|
||||
if (this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_DMA | (iDMAChannel == ChipSet.DMA_FDC? Debugger.MESSAGE_FDC : (iDMAChannel == ChipSet.DMA_HDC? Debugger.MESSAGE_HDC : Debugger.MESSAGE_LOG))) && channel.xfer != ChipSet.DMA_MODE.XFER_WRITE) {
|
||||
this.dbg.message("advanceDMA(" + iDMAChannel + ") transferring " + channel.cbDebug + " bytes from " + channel.sAddrDebug);
|
||||
this.dbg.doDump("db", channel.sAddrDebug, "l" + Math.floor((channel.cbDebug + 15) / 16));
|
||||
}
|
||||
|
|
@ -2528,7 +2526,7 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
|
|||
channel.fnTransfer.call(channel.component, channel.obj, -1, function onTransferDMA(b, fAsync) {
|
||||
if (b < 0) {
|
||||
if (!channel.fWarning) {
|
||||
if (DEBUG) obj.messageDebugger("advanceDMA(" + iDMAChannel + ") ran out of data, assuming 0xff", ChipSet.MESSAGE_DMA);
|
||||
if (DEBUG) obj.messageDebugger("advanceDMA(" + iDMAChannel + ") ran out of data, assuming 0xff", Debugger.MESSAGE_DMA);
|
||||
channel.fWarning = true;
|
||||
}
|
||||
/*
|
||||
|
|
@ -2575,7 +2573,7 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (DEBUG) this.messageDebugger("advanceDMA(" + iDMAChannel + ") unsupported xfer mode: " + str.toHexWord(channel.xfer), ChipSet.MESSAGE_DMA);
|
||||
if (DEBUG) this.messageDebugger("advanceDMA(" + iDMAChannel + ") unsupported xfer mode: " + str.toHexWord(channel.xfer), Debugger.MESSAGE_DMA);
|
||||
channel.fError = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -2627,7 +2625,7 @@ ChipSet.prototype.updateDMA = function(channel)
|
|||
channel.component = channel.obj = null;
|
||||
}
|
||||
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(ChipSet.MESSAGE_DMA | (iDMAChannel == ChipSet.DMA_FDC? ChipSet.MESSAGE_FDC : (iDMAChannel == ChipSet.DMA_HDC? ChipSet.MESSAGE_HDC : ChipSet.MESSAGE_LOG))) && channel.xfer == ChipSet.DMA_MODE.XFER_WRITE && channel.sAddrDebug) {
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_DMA | (iDMAChannel == ChipSet.DMA_FDC? Debugger.MESSAGE_FDC : (iDMAChannel == ChipSet.DMA_HDC? Debugger.MESSAGE_HDC : Debugger.MESSAGE_LOG))) && channel.xfer == ChipSet.DMA_MODE.XFER_WRITE && channel.sAddrDebug) {
|
||||
this.dbg.message("updateDMA(" + iDMAChannel + ") transferred " + channel.cbDebug + " bytes to " + channel.sAddrDebug);
|
||||
this.dbg.doDump("db", channel.sAddrDebug, "l" + Math.floor((channel.cbDebug + 15) / 16));
|
||||
}
|
||||
|
|
@ -2669,7 +2667,7 @@ ChipSet.prototype.inPICLo = function(iPIC, addrFrom)
|
|||
break;
|
||||
}
|
||||
}
|
||||
this.messagePort(pic.port, null, addrFrom, "PIC" + iPIC, ChipSet.MESSAGE_PIC, b);
|
||||
this.messagePort(pic.port, null, addrFrom, "PIC" + iPIC, Debugger.MESSAGE_PIC, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -2684,7 +2682,7 @@ ChipSet.prototype.inPICLo = function(iPIC, addrFrom)
|
|||
ChipSet.prototype.outPICLo = function(iPIC, bOut, addrFrom)
|
||||
{
|
||||
var pic = this.aPICs[iPIC];
|
||||
this.messagePort(pic.port, bOut, addrFrom, "PIC" + iPIC, ChipSet.MESSAGE_PIC);
|
||||
this.messagePort(pic.port, bOut, addrFrom, "PIC" + iPIC, Debugger.MESSAGE_PIC);
|
||||
if (bOut & ChipSet.PIC_LO.ICW1) {
|
||||
/*
|
||||
* This must be an ICW1...
|
||||
|
|
@ -2766,11 +2764,11 @@ ChipSet.prototype.outPICLo = function(iPIC, bOut, addrFrom)
|
|||
}
|
||||
var nIRQ = (nIRL == null? undefined : pic.nIRQBase + nIRL);
|
||||
if (pic.bISR & bIREnd) {
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): IRQ " + nIRQ + " going out of service", ChipSet.MESSAGE_PIC, nIRQ);
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): IRQ " + nIRQ + " going out of service", Debugger.MESSAGE_PIC, nIRQ);
|
||||
pic.bISR &= ~bIREnd;
|
||||
this.checkIRR(iPIC);
|
||||
} else {
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): unexpected EOI command, IRQ " + nIRQ + " not in service", ChipSet.MESSAGE_PIC);
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): unexpected EOI command, IRQ " + nIRQ + " not in service", Debugger.MESSAGE_PIC);
|
||||
}
|
||||
/*
|
||||
* TODO: Support EOI commands with automatic rotation (eg, ChipSet.PIC_LO.OCW2_EOI_ROT and ChipSet.PIC_LO.OCW2_EOI_ROTSPEC)
|
||||
|
|
@ -2786,7 +2784,7 @@ ChipSet.prototype.outPICLo = function(iPIC, bOut, addrFrom)
|
|||
/*
|
||||
* TODO: Remaining commands to support: ChipSet.PIC_LO.OCW2_SET_ROTAUTO and ChipSet.PIC_LO.OCW2_CLR_ROTAUTO
|
||||
*/
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): unsupported OCW2 command: " + str.toHexByte(bOut), ChipSet.MESSAGE_PIC);
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): unsupported OCW2 command: " + str.toHexByte(bOut), Debugger.MESSAGE_PIC);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
|
|
@ -2796,7 +2794,7 @@ ChipSet.prototype.outPICLo = function(iPIC, bOut, addrFrom)
|
|||
* that's unfortunate, because I don't support them yet.
|
||||
*/
|
||||
if (bOut & (ChipSet.PIC_LO.OCW3_POLL_CMD | ChipSet.PIC_LO.OCW3_SMM_CMD)) {
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): unsupported OCW3 command: " + str.toHexByte(bOut), ChipSet.MESSAGE_PIC);
|
||||
if (DEBUG) this.messageDebugger("outPIC" + iPIC + "(" + str.toHexByte(pic.port) + "): unsupported OCW3 command: " + str.toHexByte(bOut), Debugger.MESSAGE_PIC);
|
||||
}
|
||||
pic.bOCW3 = bOut;
|
||||
}
|
||||
|
|
@ -2814,7 +2812,7 @@ ChipSet.prototype.inPICHi = function(iPIC, addrFrom)
|
|||
{
|
||||
var pic = this.aPICs[iPIC];
|
||||
var b = pic.bIMR;
|
||||
this.messagePort(pic.port+1, null, addrFrom, "PIC" + iPIC, ChipSet.MESSAGE_PIC, b);
|
||||
this.messagePort(pic.port+1, null, addrFrom, "PIC" + iPIC, Debugger.MESSAGE_PIC, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -2829,7 +2827,7 @@ ChipSet.prototype.inPICHi = function(iPIC, addrFrom)
|
|||
ChipSet.prototype.outPICHi = function(iPIC, bOut, addrFrom)
|
||||
{
|
||||
var pic = this.aPICs[iPIC];
|
||||
this.messagePort(pic.port+1, bOut, addrFrom, "PIC" + iPIC, ChipSet.MESSAGE_PIC);
|
||||
this.messagePort(pic.port+1, bOut, addrFrom, "PIC" + iPIC, Debugger.MESSAGE_PIC);
|
||||
if (pic.nICW < pic.aICW.length) {
|
||||
pic.aICW[pic.nICW++] = bOut;
|
||||
if (pic.nICW == 2 && (pic.aICW[0] & ChipSet.PIC_LO.ICW1_SNGL))
|
||||
|
|
@ -2887,7 +2885,7 @@ ChipSet.prototype.setIRR = function(nIRQ, nDelay)
|
|||
var nIRL = nIRQ & 0x7;
|
||||
var pic = this.aPICs[iPIC];
|
||||
pic.bIRR |= 1 << nIRL;
|
||||
if (DEBUG) this.messageDebugger("setIRR(" + nIRQ + ")", ChipSet.MESSAGE_PIC, nIRQ);
|
||||
if (DEBUG) this.messageDebugger("setIRR(" + nIRQ + ")", Debugger.MESSAGE_PIC, nIRQ);
|
||||
pic.nDelay = nDelay || 0;
|
||||
/*
|
||||
* When any slave IRR goes high, I'm assuming that the master's slave IRR line should go high as well
|
||||
|
|
@ -2910,7 +2908,7 @@ ChipSet.prototype.clearIRR = function(nIRQ)
|
|||
var bIRR = (1 << nIRL);
|
||||
if (pic.bIRR & bIRR) {
|
||||
pic.bIRR &= ~bIRR;
|
||||
if (DEBUG) this.messageDebugger("clearIRR(" + nIRQ + ")", ChipSet.MESSAGE_PIC, nIRQ);
|
||||
if (DEBUG) this.messageDebugger("clearIRR(" + nIRQ + ")", Debugger.MESSAGE_PIC, nIRQ);
|
||||
/*
|
||||
* When all slave IRRs go low, I'm assuming that the master's slave IRR line should go low as well
|
||||
*/
|
||||
|
|
@ -3006,7 +3004,7 @@ ChipSet.prototype.getIRRVector = function(iPIC)
|
|||
}
|
||||
|
||||
var nIRQ = pic.nIRQBase + nIRL;
|
||||
if (DEBUG) this.messageDebugger("getIRRVector(): IRQ " + nIRQ + " going into service", ChipSet.MESSAGE_PIC, nIRQ);
|
||||
if (DEBUG) this.messageDebugger("getIRRVector(): IRQ " + nIRQ + " going into service", Debugger.MESSAGE_PIC, nIRQ);
|
||||
if (MAXDEBUG && DEBUGGER) {
|
||||
this.acInterrupts[nIRQ]++;
|
||||
}
|
||||
|
|
@ -3040,7 +3038,7 @@ ChipSet.prototype.inTimer = function(iTimer, addrFrom)
|
|||
}
|
||||
this.updateTimer(iTimer);
|
||||
b = timer.countCurrent[timer.countIndex++];
|
||||
this.messagePort(ChipSet.TIMER0.PORT + iTimer, null, addrFrom, "TIMER" + iTimer, ChipSet.MESSAGE_TIMER, b);
|
||||
this.messagePort(ChipSet.TIMER0.PORT + iTimer, null, addrFrom, "TIMER" + iTimer, Debugger.MESSAGE_TIMER, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3054,7 +3052,7 @@ ChipSet.prototype.inTimer = function(iTimer, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outTimer = function(iTimer, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(ChipSet.TIMER0.PORT + iTimer, bOut, addrFrom, "TIMER" + iTimer, ChipSet.MESSAGE_TIMER);
|
||||
this.messagePort(ChipSet.TIMER0.PORT + iTimer, bOut, addrFrom, "TIMER" + iTimer, Debugger.MESSAGE_TIMER);
|
||||
|
||||
var timer = this.aTimers[iTimer];
|
||||
if (timer.countIndex == timer.countBytes) this.resetTimerIndex(iTimer);
|
||||
|
|
@ -3137,8 +3135,8 @@ ChipSet.prototype.outTimer = function(iTimer, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.inTimerCtrl = function(port, addrFrom)
|
||||
{
|
||||
this.messagePort(port, null, addrFrom, "TIMER_CTRL", ChipSet.MESSAGE_TIMER);
|
||||
if (DEBUG) this.messageDebugger("TIMER_CTRL: Read-Back command not supported (yet)", ChipSet.MESSAGE_TIMER);
|
||||
this.messagePort(port, null, addrFrom, "TIMER_CTRL", Debugger.MESSAGE_TIMER);
|
||||
if (DEBUG) this.messageDebugger("TIMER_CTRL: Read-Back command not supported (yet)", Debugger.MESSAGE_TIMER);
|
||||
return null;
|
||||
};
|
||||
|
||||
|
|
@ -3152,14 +3150,14 @@ ChipSet.prototype.inTimerCtrl = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outTimerCtrl = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "TIMER_CTRL", ChipSet.MESSAGE_TIMER);
|
||||
this.messagePort(port, bOut, addrFrom, "TIMER_CTRL", Debugger.MESSAGE_TIMER);
|
||||
this.bTimerCtrl = bOut;
|
||||
/*
|
||||
* Extract the SC (Select Counter) bits
|
||||
*/
|
||||
var iTimer = (bOut & ChipSet.TIMER_CTRL.SC) >> 6;
|
||||
if (iTimer == 0x3) {
|
||||
if (DEBUG) this.messageDebugger("TIMER_CTRL: Read-Back command not supported (yet)", ChipSet.MESSAGE_TIMER);
|
||||
if (DEBUG) this.messageDebugger("TIMER_CTRL: Read-Back command not supported (yet)", Debugger.MESSAGE_TIMER);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
|
|
@ -3210,7 +3208,7 @@ ChipSet.prototype.outTimerCtrl = function(port, bOut, addrFrom)
|
|||
timer.countStart[0] = timer.countInit[0];
|
||||
timer.countStart[1] = timer.countInit[1];
|
||||
timer.nStartCycles = this.cpu.getCycles(this.fScaleTimers);
|
||||
if (DEBUG) this.messageDebugger("TIMER0 count reset @" + timer.nStartCycles + " cycles", ChipSet.MESSAGE_TIMER);
|
||||
if (DEBUG) this.messageDebugger("TIMER0 count reset @" + timer.nStartCycles + " cycles", Debugger.MESSAGE_TIMER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3396,7 +3394,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
|
|||
var ticks = ((nCycles - timer.nStartCycles) / this.nTicksDivisor) | 0;
|
||||
|
||||
if (ticks < 0) {
|
||||
if (DEBUG) this.messageDebugger("updateTimer(" + iTimer + "): negative tick count (" + ticks + ")", ChipSet.MESSAGE_TIMER);
|
||||
if (DEBUG) this.messageDebugger("updateTimer(" + iTimer + "): negative tick count (" + ticks + ")", Debugger.MESSAGE_TIMER);
|
||||
timer.nStartCycles = nCycles;
|
||||
ticks = 0;
|
||||
}
|
||||
|
|
@ -3414,7 +3412,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
|
|||
*/
|
||||
if (timer.mode == ChipSet.TIMER_CTRL.MODE0) {
|
||||
if (count <= 0) count = 0;
|
||||
if (DEBUG) this.messageDebugger("updateTimer(" + iTimer + "): MODE0 timer count=" + count, ChipSet.MESSAGE_TIMER);
|
||||
if (DEBUG) this.messageDebugger("updateTimer(" + iTimer + "): MODE0 timer count=" + count, Debugger.MESSAGE_TIMER);
|
||||
if (!count) {
|
||||
timer.fOUT = true;
|
||||
timer.fCounting = false;
|
||||
|
|
@ -3447,7 +3445,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
|
|||
if (count <= 0) {
|
||||
count = countInit + count;
|
||||
if (count <= 0) {
|
||||
// this.messageDebugger("updateTimer(" + iTimer + "): underflow=" + count, ChipSet.MESSAGE_TIMER);
|
||||
// this.messageDebugger("updateTimer(" + iTimer + "): underflow=" + count, Debugger.MESSAGE_TIMER);
|
||||
count = countInit;
|
||||
}
|
||||
timer.countStart[0] = count & 0xff;
|
||||
|
|
@ -3477,7 +3475,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
|
|||
timer.fOUT = !timer.fOUT;
|
||||
count = countInit + count;
|
||||
if (count <= 0) {
|
||||
// this.messageDebugger("updateTimer(" + iTimer + "): underflow=" + count, ChipSet.MESSAGE_TIMER);
|
||||
// this.messageDebugger("updateTimer(" + iTimer + "): underflow=" + count, Debugger.MESSAGE_TIMER);
|
||||
count = countInit;
|
||||
}
|
||||
if (MAXDEBUG && DEBUGGER && !iTimer) {
|
||||
|
|
@ -3497,7 +3495,7 @@ ChipSet.prototype.updateTimer = function(iTimer, fCycleReset)
|
|||
}
|
||||
}
|
||||
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(ChipSet.MESSAGE_TIMER)) {
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_TIMER)) {
|
||||
this.log("TIMER" + iTimer + " count: " + count + ", ticks: " + ticks + ", fired: " + (fFired? "true" : "false"));
|
||||
}
|
||||
|
||||
|
|
@ -3541,7 +3539,7 @@ ChipSet.prototype.inPPIA = function(port, addrFrom)
|
|||
b = this.kbd.readScanCode();
|
||||
}
|
||||
}
|
||||
this.messagePort(port, null, addrFrom, "PPI_A", ChipSet.MESSAGE_CHIPSET, b);
|
||||
this.messagePort(port, null, addrFrom, "PPI_A", Debugger.MESSAGE_CHIPSET, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3555,7 +3553,7 @@ ChipSet.prototype.inPPIA = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outPPIA = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_A", ChipSet.MESSAGE_CHIPSET);
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_A", Debugger.MESSAGE_CHIPSET);
|
||||
this.bPPIA = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -3570,7 +3568,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", ChipSet.MESSAGE_CHIPSET, b);
|
||||
this.messagePort(port, null, addrFrom, "PPI_B", Debugger.MESSAGE_CHIPSET, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3584,7 +3582,7 @@ ChipSet.prototype.inPPIB = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outPPIB = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_B", ChipSet.MESSAGE_CHIPSET);
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_B", Debugger.MESSAGE_CHIPSET);
|
||||
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);
|
||||
};
|
||||
|
|
@ -3661,7 +3659,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", ChipSet.MESSAGE_CHIPSET | ChipSet.MESSAGE_MEM, b);
|
||||
this.messagePort(port, null, addrFrom, "PPI_C", Debugger.MESSAGE_CHIPSET | Debugger.MESSAGE_MEM, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3675,7 +3673,7 @@ ChipSet.prototype.inPPIC = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outPPIC = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_C", ChipSet.MESSAGE_CHIPSET);
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_C", Debugger.MESSAGE_CHIPSET);
|
||||
this.bPPIC = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -3690,7 +3688,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", ChipSet.MESSAGE_CHIPSET, b);
|
||||
this.messagePort(port, null, addrFrom, "PPI_CTRL", Debugger.MESSAGE_CHIPSET, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3704,7 +3702,7 @@ ChipSet.prototype.inPPICtrl = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outPPICtrl = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_CTRL", ChipSet.MESSAGE_CHIPSET);
|
||||
this.messagePort(port, bOut, addrFrom, "PPI_CTRL", Debugger.MESSAGE_CHIPSET);
|
||||
this.bPPICtrl = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -3719,7 +3717,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", ChipSet.MESSAGE_8042, b);
|
||||
this.messagePort(port, null, addrFrom, "8042_OUTBUFF", Debugger.MESSAGE_8042, b);
|
||||
this.b8042Status &= ~(ChipSet.KBC.STATUS.OUTBUFF_FULL | ChipSet.KBC.STATUS.OUTBUFF_DELAY);
|
||||
var bNext = this.kbd && this.kbd.readScanCode(true);
|
||||
if (bNext) this.set8042OutBuff(bNext);
|
||||
|
|
@ -3740,7 +3738,7 @@ ChipSet.prototype.in8042OutBuff = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "8042_INBUF.DATA", ChipSet.MESSAGE_8042);
|
||||
this.messagePort(port, bOut, addrFrom, "8042_INBUF.DATA", Debugger.MESSAGE_8042);
|
||||
|
||||
if (this.b8042Status & ChipSet.KBC.STATUS.CMD_FLAG) {
|
||||
switch (this.b8042InBuff) {
|
||||
|
|
@ -3866,7 +3864,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", ChipSet.MESSAGE_8042 | ChipSet.MESSAGE_LOG, b);
|
||||
this.messagePort(port, null, addrFrom, "8042_RWREG", Debugger.MESSAGE_8042 | Debugger.MESSAGE_LOG, b);
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3880,7 +3878,7 @@ ChipSet.prototype.in8042RWReg = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.out8042RWReg = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "8042_RWREG", ChipSet.MESSAGE_8042);
|
||||
this.messagePort(port, bOut, addrFrom, "8042_RWREG", Debugger.MESSAGE_8042);
|
||||
this.updatePPIB(bOut);
|
||||
};
|
||||
|
||||
|
|
@ -3894,7 +3892,7 @@ ChipSet.prototype.out8042RWReg = function(port, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.in8042Status = function(port, addrFrom)
|
||||
{
|
||||
this.messagePort(port, null, addrFrom, "8042_STATUS", ChipSet.MESSAGE_8042, this.b8042Status);
|
||||
this.messagePort(port, null, addrFrom, "8042_STATUS", Debugger.MESSAGE_8042, this.b8042Status);
|
||||
var b = this.b8042Status & 0xff;
|
||||
/*
|
||||
* There's code in the 5170 BIOS (F000:03BF) that writes an 8042 command (0xAA), waits for
|
||||
|
|
@ -3932,7 +3930,7 @@ ChipSet.prototype.in8042Status = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.out8042InBuffCmd = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "8042_INBUFF.CMD", ChipSet.MESSAGE_8042);
|
||||
this.messagePort(port, bOut, addrFrom, "8042_INBUFF.CMD", Debugger.MESSAGE_8042);
|
||||
Component.assert(!(this.b8042Status & ChipSet.KBC.STATUS.INBUFF_FULL));
|
||||
this.b8042InBuff = bOut;
|
||||
|
||||
|
|
@ -3961,7 +3959,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.messageDebugger("keyboard disabled", ChipSet.MESSAGE_KBD);
|
||||
if (DEBUG) this.messageDebugger("keyboard disabled", Debugger.MESSAGE_KBD);
|
||||
/*
|
||||
* 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.BATSUCCESS response code? Seems like an odd thing for
|
||||
|
|
@ -3971,13 +3969,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 (DEBUG) this.messageDebugger("keyboard re-enabled", ChipSet.MESSAGE_KBD);
|
||||
if (DEBUG) this.messageDebugger("keyboard re-enabled", Debugger.MESSAGE_KBD);
|
||||
break;
|
||||
|
||||
case ChipSet.KBC.CMD.SELF_TEST: // 0xAA
|
||||
if (this.kbd) this.kbd.shiftScanCode(true);
|
||||
this.set8042CmdData(this.b8042CmdData | ChipSet.KBC.DATA.CMD.NO_CLOCK);
|
||||
if (DEBUG) this.messageDebugger("keyboard disabled on reset", ChipSet.MESSAGE_KBD);
|
||||
if (DEBUG) this.messageDebugger("keyboard disabled on reset", Debugger.MESSAGE_KBD);
|
||||
this.set8042OutBuff(ChipSet.KBC.DATA.SELF_TEST.OK);
|
||||
this.set8042OutPort(ChipSet.KBC.OUTPORT.NO_RESET | ChipSet.KBC.OUTPORT.A20_ON);
|
||||
break;
|
||||
|
|
@ -4088,7 +4086,7 @@ ChipSet.prototype.set8042OutPort = function(b)
|
|||
*/
|
||||
ChipSet.prototype.inCMOSAddr = function(port, addrFrom)
|
||||
{
|
||||
this.messagePort(port, null, addrFrom, "CMOS_ADDR", ChipSet.MESSAGE_CMOS, this.bCMOSAddr);
|
||||
this.messagePort(port, null, addrFrom, "CMOS_ADDR", Debugger.MESSAGE_CMOS, this.bCMOSAddr);
|
||||
return this.bCMOSAddr;
|
||||
};
|
||||
|
||||
|
|
@ -4102,7 +4100,7 @@ ChipSet.prototype.inCMOSAddr = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outCMOSAddr = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "CMOS_ADDR", ChipSet.MESSAGE_CMOS);
|
||||
this.messagePort(port, bOut, addrFrom, "CMOS_ADDR", Debugger.MESSAGE_CMOS);
|
||||
this.bCMOSAddr = bOut;
|
||||
this.bNMI = (bOut & ChipSet.CMOS.ADDR.NMI_DISABLE)? ChipSet.NMI.DISABLE : ChipSet.NMI.ENABLE;
|
||||
};
|
||||
|
|
@ -4119,7 +4117,7 @@ ChipSet.prototype.inCMOSData = function(port, addrFrom)
|
|||
{
|
||||
var bAddr = this.bCMOSAddr & ChipSet.CMOS.ADDR.MASK;
|
||||
var bIn = (bAddr <= ChipSet.CMOS.ADDR.RTC_STATUSD? this.getRTCByte(bAddr) : this.abCMOSData[bAddr]);
|
||||
this.messagePort(port, null, addrFrom, "CMOS_DATA[" + str.toHexByte(bAddr) + "]", ChipSet.MESSAGE_CMOS, bIn);
|
||||
this.messagePort(port, null, addrFrom, "CMOS_DATA[" + str.toHexByte(bAddr) + "]", Debugger.MESSAGE_CMOS, bIn);
|
||||
return bIn;
|
||||
};
|
||||
|
||||
|
|
@ -4134,7 +4132,7 @@ ChipSet.prototype.inCMOSData = function(port, addrFrom)
|
|||
ChipSet.prototype.outCMOSData = function(port, bOut, addrFrom)
|
||||
{
|
||||
var bAddr = this.bCMOSAddr & ChipSet.CMOS.ADDR.MASK;
|
||||
this.messagePort(port, bOut, addrFrom, "CMOS_DATA[" + str.toHexByte(bAddr) + "]", ChipSet.MESSAGE_CMOS);
|
||||
this.messagePort(port, bOut, addrFrom, "CMOS_DATA[" + str.toHexByte(bAddr) + "]", Debugger.MESSAGE_CMOS);
|
||||
this.abCMOSData[bAddr] = (bAddr <= ChipSet.CMOS.ADDR.RTC_STATUSD? this.setRTCByte(bAddr, bOut) : bOut);
|
||||
};
|
||||
|
||||
|
|
@ -4148,7 +4146,7 @@ ChipSet.prototype.outCMOSData = function(port, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.inMFGData = function(port, addrFrom)
|
||||
{
|
||||
this.messagePort(port, null, addrFrom, "MFG_DATA", ChipSet.MESSAGE_CHIPSET, this.bMFGData);
|
||||
this.messagePort(port, null, addrFrom, "MFG_DATA", Debugger.MESSAGE_CHIPSET, this.bMFGData);
|
||||
return this.bMFGData;
|
||||
};
|
||||
|
||||
|
|
@ -4162,7 +4160,7 @@ ChipSet.prototype.inMFGData = function(port, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outMFGData = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "MFG_DATA", ChipSet.MESSAGE_CHIPSET);
|
||||
this.messagePort(port, bOut, addrFrom, "MFG_DATA", Debugger.MESSAGE_CHIPSET);
|
||||
this.bMFGData = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -4178,7 +4176,7 @@ ChipSet.prototype.outMFGData = function(port, bOut, addrFrom)
|
|||
*/
|
||||
ChipSet.prototype.outNMI = function(port, bOut, addrFrom)
|
||||
{
|
||||
this.messagePort(port, bOut, addrFrom, "NMI", ChipSet.MESSAGE_CHIPSET);
|
||||
this.messagePort(port, bOut, addrFrom, "NMI", Debugger.MESSAGE_CHIPSET);
|
||||
this.bNMI = bOut;
|
||||
};
|
||||
|
||||
|
|
@ -4206,7 +4204,7 @@ ChipSet.prototype.intBIOSRTC = function(addr)
|
|||
{
|
||||
if (DEBUGGER) {
|
||||
var AH = this.cpu.regAX >> 8;
|
||||
if (this.dbg && this.dbg.messageEnabled(ChipSet.MESSAGE_RTC)) {
|
||||
if (this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_RTC)) {
|
||||
this.dbg.messageInt(ChipSet.BIOS.INT_RTC, addr);
|
||||
this.cpu.addIntReturn(addr, function(chipset, nCycles) {
|
||||
return function onBIOSRTCReturn(nLevel) {
|
||||
|
|
@ -4272,13 +4270,13 @@ ChipSet.prototype.setSpeaker = function(fOn)
|
|||
if (fOn) {
|
||||
if (this.sourceAudio) {
|
||||
this.sourceAudio['frequency']['value'] = freq;
|
||||
this.messageDebugger("speaker set to " + freq + "hz", ChipSet.MESSAGE_SPEAKER);
|
||||
this.messageDebugger("speaker set to " + freq + "hz", Debugger.MESSAGE_SPEAKER);
|
||||
} 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;
|
||||
this.messageDebugger("speaker on at " + freq + "hz", ChipSet.MESSAGE_SPEAKER);
|
||||
this.messageDebugger("speaker on at " + freq + "hz", Debugger.MESSAGE_SPEAKER);
|
||||
this.sourceAudio['noteOn'](0); // aka start()
|
||||
}
|
||||
} else {
|
||||
|
|
@ -4286,11 +4284,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?
|
||||
this.messageDebugger("speaker off at " + freq + "hz", ChipSet.MESSAGE_SPEAKER);
|
||||
this.messageDebugger("speaker off at " + freq + "hz", Debugger.MESSAGE_SPEAKER);
|
||||
}
|
||||
}
|
||||
} else if (fOn) {
|
||||
this.messageDebugger("BEEP", ChipSet.MESSAGE_SPEAKER);
|
||||
this.messageDebugger("BEEP", Debugger.MESSAGE_SPEAKER);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -4310,9 +4308,9 @@ ChipSet.prototype.setSpeaker = function(fOn)
|
|||
ChipSet.prototype.messageDebugger = function(sMessage, bitsMessage, nIRQ)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (bitsMessage == null) bitsMessage = ChipSet.MESSAGE_CHIPSET;
|
||||
if (bitsMessage == null) bitsMessage = Debugger.MESSAGE_CHIPSET;
|
||||
if (nIRQ !== undefined) {
|
||||
bitsMessage |= (nIRQ == ChipSet.IRQ.TIMER0? ChipSet.MESSAGE_TIMER : (nIRQ == ChipSet.IRQ.KBD? ChipSet.MESSAGE_KBD : (nIRQ == ChipSet.IRQ.FDC? ChipSet.MESSAGE_FDC : 0)));
|
||||
bitsMessage |= (nIRQ == ChipSet.IRQ.TIMER0? Debugger.MESSAGE_TIMER : (nIRQ == ChipSet.IRQ.KBD? Debugger.MESSAGE_KBD : (nIRQ == ChipSet.IRQ.FDC? Debugger.MESSAGE_FDC : 0)));
|
||||
}
|
||||
if (this.dbg.messageEnabled(bitsMessage)) this.dbg.message(sMessage);
|
||||
}
|
||||
|
|
@ -4337,7 +4335,7 @@ ChipSet.prototype.messageDebugger = function(sMessage, bitsMessage, nIRQ)
|
|||
ChipSet.prototype.messagePort = function(port, bOut, addrFrom, name, bitsMessage, bIn)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (bitsMessage == null) bitsMessage = ChipSet.MESSAGE_CHIPSET;
|
||||
if (bitsMessage == null) bitsMessage = Debugger.MESSAGE_CHIPSET;
|
||||
this.dbg.messagePort(this, port, bOut, addrFrom, name, bitsMessage, bIn);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Computer component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-15
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -1186,7 +1185,7 @@ Computer.prototype.getComponentByType = function(sType, componentPrev)
|
|||
Computer.prototype.messageDebugger = function(sMessage, fForce)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (fForce || this.dbg.messageEnabled(this.dbg.MESSAGE_CMP)) this.dbg.message(sMessage);
|
||||
if (fForce || this.dbg.messageEnabled(Debugger.MESSAGE_CMP)) this.dbg.message(sMessage);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs CPU component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-04
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -914,7 +913,7 @@ CPU.prototype.calcRemainingTime = function()
|
|||
*/
|
||||
this.nRecalcCycles += this.nCyclesThisRun;
|
||||
|
||||
if (DEBUG && this.dbg && this.dbg.messageEnabled(this.dbg.MESSAGE_LOG) && msRemainsThisRun) {
|
||||
if (DEBUG && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_LOG) && msRemainsThisRun) {
|
||||
this.dbg.message("at " + this.msEndThisRun + "ms, calcRemainingTime returned " + msRemainsThisRun + "ms to sleep");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Debugger component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-21
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -59,7 +58,7 @@ if (DEBUGGER) {
|
|||
* commands: string containing zero or more commands, separated by ';'
|
||||
*
|
||||
* messages: string containing zero or more message categories to enable;
|
||||
* multiple categories must be separated by '|' or ';'. Parsed by messageInit().
|
||||
* multiple categories must be separated by '|' or ';'. Parsed by initMessages().
|
||||
*
|
||||
* The Debugger component is an optional component that implements a variety of user
|
||||
* commands for controlling the CPU, dumping and editing memory, etc.
|
||||
|
|
@ -142,7 +141,7 @@ function Debugger(parmsDbg)
|
|||
/*
|
||||
* Initialize Debugger message support
|
||||
*/
|
||||
this.messageInit(this, parmsDbg['messages'], true);
|
||||
this.initMessages(parmsDbg['messages']);
|
||||
|
||||
/*
|
||||
* This object is filled in by updateRegValues() whenever we need a fresh snapshot.
|
||||
|
|
@ -170,6 +169,31 @@ function Debugger(parmsDbg)
|
|||
} // endif DEBUGGER
|
||||
}
|
||||
|
||||
Debugger.MESSAGE_MEM = 0x00000001;
|
||||
Debugger.MESSAGE_PORT = 0x00000002;
|
||||
Debugger.MESSAGE_DMA = 0x00000004;
|
||||
Debugger.MESSAGE_PIC = 0x00000008;
|
||||
Debugger.MESSAGE_TIMER = 0x00000010;
|
||||
Debugger.MESSAGE_CMOS = 0x00000020;
|
||||
Debugger.MESSAGE_RTC = 0x00000040;
|
||||
Debugger.MESSAGE_8042 = 0x00000080;
|
||||
Debugger.MESSAGE_CHIPSET = 0x00000100;
|
||||
Debugger.MESSAGE_KBD = 0x00000200;
|
||||
Debugger.MESSAGE_VIDEO = 0x00000400;
|
||||
Debugger.MESSAGE_FDC = 0x00000800;
|
||||
Debugger.MESSAGE_HDC = 0x00001000;
|
||||
Debugger.MESSAGE_DISK = 0x00002000;
|
||||
Debugger.MESSAGE_SERIAL = 0x00004000;
|
||||
Debugger.MESSAGE_SPEAKER = 0x00008000;
|
||||
Debugger.MESSAGE_STATE = 0x00010000;
|
||||
Debugger.MESSAGE_MOUSE = 0x00020000;
|
||||
Debugger.MESSAGE_CMP = 0x00040000;
|
||||
Debugger.MESSAGE_CPU = 0x00080000;
|
||||
Debugger.MESSAGE_DOS = 0x00100000;
|
||||
Debugger.MESSAGE_INT = 0x00200000;
|
||||
Debugger.MESSAGE_LOG = 0x01000000;
|
||||
Debugger.MESSAGE_HALT = 0x10000000;
|
||||
|
||||
if (DEBUGGER) {
|
||||
|
||||
Component.subclass(Component, Debugger);
|
||||
|
|
@ -414,34 +438,6 @@ if (DEBUGGER) {
|
|||
Debugger.TYPE_286 = (Debugger.CPU_286 << 14);
|
||||
Debugger.TYPE_386 = (Debugger.CPU_386 << 14);
|
||||
|
||||
/**
|
||||
* @class Debugger
|
||||
* @property {Object} MESSAGES
|
||||
* @property {number} MESSAGE_MEM
|
||||
* @property {number} MESSAGE_PORT
|
||||
* @property {number} MESSAGE_DMA
|
||||
* @property {number} MESSAGE_PIC
|
||||
* @property {number} MESSAGE_TIMER
|
||||
* @property {number} MESSAGE_CMOS
|
||||
* @property {number} MESSAGE_RTC
|
||||
* @property {number} MESSAGE_8042
|
||||
* @property {number} MESSAGE_CHIPSET
|
||||
* @property {number} MESSAGE_KBD
|
||||
* @property {number} MESSAGE_VIDEO
|
||||
* @property {number} MESSAGE_FDC
|
||||
* @property {number} MESSAGE_HDC
|
||||
* @property {number} MESSAGE_DISK
|
||||
* @property {number} MESSAGE_SERIAL
|
||||
* @property {number} MESSAGE_SPEAKER
|
||||
* @property {number} MESSAGE_STATE
|
||||
* @property {number} MESSAGE_MOUSE
|
||||
* @property {number} MESSAGE_CMP
|
||||
* @property {number} MESSAGE_CPU
|
||||
* @property {number} MESSAGE_DOS
|
||||
* @property {number} MESSAGE_INT
|
||||
* @property {number} MESSAGE_LOG
|
||||
*/
|
||||
|
||||
/*
|
||||
* Message categories supported by the messageEnabled() function and other assorted message
|
||||
* functions. Each category has a corresponding bit value that can be combined (ie, OR'ed) as
|
||||
|
|
@ -452,46 +448,39 @@ if (DEBUGGER) {
|
|||
* m port off
|
||||
* ...
|
||||
*
|
||||
* Every caller of messageInit() receives all the MESSAGE_* properties as bit values; for example,
|
||||
* after ChipSet calls messageInit(ChipSet), ChipSet.MESSAGE_MEM will be 0x0001, and so on.
|
||||
*
|
||||
* We also call messageInit() on behalf the current Debugger instance so that other components have
|
||||
* the option of accessing the properties indirectly (eg, this.dbg.MESSAGE_MEM), since the Debugger
|
||||
* component is not a required component.
|
||||
*
|
||||
* NOTE: The order of these categories can be rearranged, alphabetized, etc, as desired; just be
|
||||
* aware that changing the bit values could break saved Debugger states (not a huge concern, just
|
||||
* something to be aware of).
|
||||
*/
|
||||
Debugger.MESSAGES = {
|
||||
MESSAGE_MEM: {BIT: 0x00000001, OP: "mem"},
|
||||
MESSAGE_PORT: {BIT: 0x00000002, OP: "port"},
|
||||
MESSAGE_DMA: {BIT: 0x00000004, OP: "dma"},
|
||||
MESSAGE_PIC: {BIT: 0x00000008, OP: "pic"},
|
||||
MESSAGE_TIMER: {BIT: 0x00000010, OP: "timer"},
|
||||
MESSAGE_CMOS: {BIT: 0x00000020, OP: "cmos"},
|
||||
MESSAGE_RTC: {BIT: 0x00000040, OP: "rtc"},
|
||||
MESSAGE_8042: {BIT: 0x00000080, OP: "8042"},
|
||||
MESSAGE_CHIPSET:{BIT: 0x00000100, OP: "chipset"}, // ie, anything else in ChipSet besides DMA, PIC, TIMER, CMOS, RTC and 8042
|
||||
MESSAGE_KBD: {BIT: 0x00000200, OP: "keyboard"},
|
||||
MESSAGE_VIDEO: {BIT: 0x00000400, OP: "video"},
|
||||
MESSAGE_FDC: {BIT: 0x00000800, OP: "fdc"},
|
||||
MESSAGE_HDC: {BIT: 0x00001000, OP: "hdc"},
|
||||
MESSAGE_DISK: {BIT: 0x00002000, OP: "disk"},
|
||||
MESSAGE_SERIAL: {BIT: 0x00004000, OP: "serial"},
|
||||
MESSAGE_SPEAKER:{BIT: 0x00008000, OP: "speaker"},
|
||||
MESSAGE_STATE: {BIT: 0x00010000, OP: "state"},
|
||||
MESSAGE_MOUSE: {BIT: 0x00020000, OP: "mouse"},
|
||||
MESSAGE_CMP: {BIT: 0x00040000, OP: "computer"},
|
||||
MESSAGE_CPU: {BIT: 0x00080000, OP: "cpu"},
|
||||
MESSAGE_DOS: {BIT: 0x00100000, OP: "dos"},
|
||||
MESSAGE_INT: {BIT: 0x00200000, OP: "int"},
|
||||
MESSAGE_LOG: {BIT: 0x01000000, OP: "log"},
|
||||
"mem": Debugger.MESSAGE_MEM,
|
||||
"port": Debugger.MESSAGE_PORT,
|
||||
"dma": Debugger.MESSAGE_DMA,
|
||||
"pic": Debugger.MESSAGE_PIC,
|
||||
"timer": Debugger.MESSAGE_TIMER,
|
||||
"cmos": Debugger.MESSAGE_CMOS,
|
||||
"rtc": Debugger.MESSAGE_RTC,
|
||||
"8042": Debugger.MESSAGE_8042,
|
||||
"chipset": Debugger.MESSAGE_CHIPSET, // ie, anything else in ChipSet besides DMA, PIC, TIMER, CMOS, RTC and 8042
|
||||
"keyboard": Debugger.MESSAGE_KBD,
|
||||
"video": Debugger.MESSAGE_VIDEO,
|
||||
"fdc": Debugger.MESSAGE_FDC,
|
||||
"hdc": Debugger.MESSAGE_HDC,
|
||||
"disk": Debugger.MESSAGE_DISK,
|
||||
"serial": Debugger.MESSAGE_SERIAL,
|
||||
"speaker": Debugger.MESSAGE_SPEAKER,
|
||||
"state": Debugger.MESSAGE_STATE,
|
||||
"mouse": Debugger.MESSAGE_MOUSE,
|
||||
"computer": Debugger.MESSAGE_CMP,
|
||||
"cpu": Debugger.MESSAGE_CPU,
|
||||
"dos": Debugger.MESSAGE_DOS,
|
||||
"int": Debugger.MESSAGE_INT,
|
||||
"log": Debugger.MESSAGE_LOG,
|
||||
/*
|
||||
* Now we turn to message actions rather than message types; for example, setting "halt"
|
||||
* on or off doesn't enable "halt" messages, but rather halts the CPU on any above message.
|
||||
*/
|
||||
MESSAGE_HALT: {BIT: 0x10000000, OP: "halt"}
|
||||
"halt": Debugger.MESSAGE_HALT
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -1288,27 +1277,24 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* messageInit(o, sEnable, fDebugger)
|
||||
* initMessages(sEnable)
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {Object} o
|
||||
* @param {string} [sEnable] contains zero or more message categories to enable, separated by '|' or ';'
|
||||
* @param {boolean} [fDebugger] is true to perform Debugger-specific initialization (eg, array of dumpers)
|
||||
* @param {string|undefined} sEnable contains zero or more message categories to enable, separated by '|' or ';'
|
||||
*/
|
||||
Debugger.prototype.messageInit = function(o, sEnable, fDebugger)
|
||||
Debugger.prototype.initMessages = function(sEnable)
|
||||
{
|
||||
if (fDebugger) this.afnDumpers = [];
|
||||
var bitsEnable = 0;
|
||||
this.afnDumpers = [];
|
||||
this.bitsMessageEnabled = 0;
|
||||
var aEnable = this.parseCommand(sEnable);
|
||||
for (var m in Debugger.MESSAGES) {
|
||||
o[m] = Debugger.MESSAGES[m].BIT;
|
||||
if (aEnable.indexOf(Debugger.MESSAGES[m].OP) >= 0) {
|
||||
bitsEnable |= Debugger.MESSAGES[m].BIT;
|
||||
this.println(Debugger.MESSAGES[m].OP + " messages enabled");
|
||||
if (aEnable.length) {
|
||||
for (var m in Debugger.MESSAGES) {
|
||||
if (aEnable.indexOf(m) >= 0) {
|
||||
this.bitsMessageEnabled |= Debugger.MESSAGES[m];
|
||||
this.println(m + " messages enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.bitsMessageEnabled === undefined) this.bitsMessageEnabled = 0;
|
||||
this.bitsMessageEnabled |= bitsEnable;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1322,7 +1308,7 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.messageDump = function(bitMessage, fnDumper)
|
||||
{
|
||||
for (var m in Debugger.MESSAGES) {
|
||||
if (bitMessage == Debugger.MESSAGES[m].BIT) {
|
||||
if (bitMessage == Debugger.MESSAGES[m]) {
|
||||
this.afnDumpers[m] = fnDumper;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1435,7 +1421,7 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.messageMem = function(component, addr, fWrite, addrFrom, name, bitsMessage)
|
||||
{
|
||||
if (!bitsMessage) bitsMessage = 0;
|
||||
bitsMessage |= Debugger.MESSAGES.MESSAGE_MEM.BIT;
|
||||
bitsMessage |= Debugger.MESSAGES_MEM;
|
||||
if (addrFrom == null || (this.bitsMessageEnabled & bitsMessage) == bitsMessage) {
|
||||
var b = this.bus.getByteDirect(addr);
|
||||
this.message(component.idComponent + "." + (fWrite? "setByte" : "getByte") + "(0x" + str.toHexAddr(addr) + ")" + (addrFrom != null? (" at " + str.toHexAddr(addrFrom)) : "") + ": " + (name? (name + "=") : "") + str.toHexByte(b));
|
||||
|
|
@ -1458,7 +1444,7 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.messagePort = function(component, port, bOut, addrFrom, name, bitsMessage, bIn)
|
||||
{
|
||||
if (!bitsMessage) bitsMessage = 0;
|
||||
bitsMessage |= Debugger.MESSAGES.MESSAGE_PORT.BIT;
|
||||
bitsMessage |= Debugger.MESSAGE_PORT;
|
||||
if (addrFrom == null || (this.bitsMessageEnabled & bitsMessage) == bitsMessage) {
|
||||
var segFrom = null;
|
||||
if (addrFrom != null) {
|
||||
|
|
@ -1480,7 +1466,7 @@ if (DEBUGGER) {
|
|||
this.println(sMessage); // + " (" + this.cpu.getCycles() + " cycles)"
|
||||
|
||||
if (this.cpu) {
|
||||
if (this.bitsMessageEnabled & Debugger.MESSAGES.MESSAGE_HALT.BIT) {
|
||||
if (this.bitsMessageEnabled & Debugger.MESSAGE_HALT) {
|
||||
this.cpu.haltCPU();
|
||||
}
|
||||
/*
|
||||
|
|
@ -1556,7 +1542,7 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.intDOSCall = function(addr)
|
||||
{
|
||||
if (this.messageEnabled(this.MESSAGE_DOS | this.MESSAGE_INT)) this.messageInt(Debugger.INT_DOS, addr);
|
||||
if (this.messageEnabled(Debugger.MESSAGE_DOS | Debugger.MESSAGE_INT)) this.messageInt(Debugger.INT_DOS, addr);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
@ -1932,7 +1918,7 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.checksEnabled = function(fBreak)
|
||||
{
|
||||
return ((DEBUG && !fBreak)? true : (this.aBreakExec.length > 1 || this.messageEnabled(this.MESSAGE_INT) /* || this.aBreakRead.length > 1 || this.aBreakWrite.length > 1 */));
|
||||
return ((DEBUG && !fBreak)? true : (this.aBreakExec.length > 1 || this.messageEnabled(Debugger.MESSAGE_INT) /* || this.aBreakRead.length > 1 || this.aBreakWrite.length > 1 */));
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -2917,7 +2903,6 @@ if (DEBUGGER) {
|
|||
* @param {string|undefined} sValue
|
||||
* @param {string} [sName] is the name of the value, if any
|
||||
* @return {number|undefined} numeric value, or undefined if sValue is either undefined or invalid
|
||||
* @suppress {checkTypes}
|
||||
*/
|
||||
Debugger.prototype.parseValue = function(sValue, sName)
|
||||
{
|
||||
|
|
@ -3421,7 +3406,7 @@ if (DEBUGGER) {
|
|||
for (m in Debugger.MESSAGES) {
|
||||
if (this.afnDumpers[m]) {
|
||||
if (sDumpers.length) sDumpers += ",";
|
||||
sDumpers = sDumpers + Debugger.MESSAGES[m].OP;
|
||||
sDumpers = sDumpers + m;
|
||||
}
|
||||
}
|
||||
sDumpers += ",state";
|
||||
|
|
@ -3441,7 +3426,7 @@ if (DEBUGGER) {
|
|||
return;
|
||||
}
|
||||
for (m in Debugger.MESSAGES) {
|
||||
if (sAddr == Debugger.MESSAGES[m].OP) {
|
||||
if (sAddr == m) {
|
||||
var fnDumper = this.afnDumpers[m];
|
||||
if (fnDumper) {
|
||||
fnDumper(sLen);
|
||||
|
|
@ -3923,8 +3908,8 @@ if (DEBUGGER) {
|
|||
sCategory = null;
|
||||
} else {
|
||||
for (m in Debugger.MESSAGES) {
|
||||
if (sCategory == Debugger.MESSAGES[m].OP) {
|
||||
bitsMessage = Debugger.MESSAGES[m].BIT;
|
||||
if (sCategory == m) {
|
||||
bitsMessage = Debugger.MESSAGES[m];
|
||||
fCriteria = !!(this.bitsMessageEnabled & bitsMessage);
|
||||
break;
|
||||
}
|
||||
|
|
@ -3952,13 +3937,13 @@ if (DEBUGGER) {
|
|||
var n = 0;
|
||||
var sCategories = "";
|
||||
for (m in Debugger.MESSAGES) {
|
||||
if (!sCategory || sCategory == Debugger.MESSAGES[m].OP) {
|
||||
var bitMessage = Debugger.MESSAGES[m].BIT;
|
||||
if (!sCategory || sCategory == m) {
|
||||
var bitMessage = Debugger.MESSAGES[m];
|
||||
var fEnabled = !!(this.bitsMessageEnabled & bitMessage);
|
||||
if (fCriteria !== null && fCriteria != fEnabled) continue;
|
||||
if (sCategories) sCategories += ",";
|
||||
if (!(++n % 10)) sCategories += "\n\t"; // jshint ignore:line
|
||||
sCategories += Debugger.MESSAGES[m].OP;
|
||||
sCategories += m;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements disk image support for both FDC and HDC.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Nov-26
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -685,7 +684,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
|
|||
* conversion to a forward-compatible 'data' array.
|
||||
*/
|
||||
else {
|
||||
if (MAXDEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(this.dbg.MESSAGE_DISK)) {
|
||||
if (MAXDEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_DISK)) {
|
||||
var sCylinders = aDiskData.length + " track" + (aDiskData.length > 1 ? "s" : "");
|
||||
var nHeads = aDiskData[0].length;
|
||||
var sHeads = nHeads + " head" + (nHeads > 1 ? "s" : "");
|
||||
|
|
@ -1528,7 +1527,7 @@ Disk.prototype.restore = function(deltas)
|
|||
Disk.prototype.messageDebugger = function(sMessage)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_DISK)) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_DISK)) {
|
||||
this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Floppy Drive Controller (FDC) component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Aug-09
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -561,7 +560,6 @@ FDC.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
bus.addPortInputTable(this, FDC.aPortInput);
|
||||
bus.addPortOutputTable(this, FDC.aPortOutput);
|
||||
if (DEBUGGER) {
|
||||
if (dbg) dbg.messageInit(FDC);
|
||||
cpu.addIntNotify(FDC.BIOS.INT_DISKETTE, this, this.intBIOSDiskette);
|
||||
}
|
||||
|
||||
|
|
@ -1879,7 +1877,7 @@ FDC.prototype.popCmd = function(name)
|
|||
{
|
||||
Component.assert((!this.regDataIndex || name !== undefined) && this.regDataIndex < this.regDataTotal);
|
||||
var bCmd = this.regDataArray[this.regDataIndex];
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(FDC.MESSAGE_FDC)) {
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_FDC)) {
|
||||
var bCmdMasked = bCmd & FDC.REG_DATA.CMD.MASK;
|
||||
if (!name && !this.regDataIndex && FDC.aCmdInfo[bCmdMasked]) name = FDC.aCmdInfo[bCmdMasked].name;
|
||||
this.dbg.message("FDC.CMD[" + (name || this.regDataIndex) + "]: 0x" + str.toHexByte(bCmd));
|
||||
|
|
@ -1933,7 +1931,7 @@ FDC.prototype.beginResult = function()
|
|||
*/
|
||||
FDC.prototype.pushResult = function(bResult, name)
|
||||
{
|
||||
if (DEBUG) this.messageDebugger("FDC.RES[" + (name || this.regDataTotal) + "]: 0x" + str.toHexByte(bResult), FDC.MESSAGE_FDC);
|
||||
if (DEBUG) this.messageDebugger("FDC.RES[" + (name || this.regDataTotal) + "]: 0x" + str.toHexByte(bResult), Debugger.MESSAGE_FDC);
|
||||
this.regDataArray[this.regDataTotal++] = bResult;
|
||||
};
|
||||
|
||||
|
|
@ -2321,7 +2319,7 @@ FDC.prototype.intBIOSDiskette = function(addr)
|
|||
{
|
||||
if (DEBUGGER) {
|
||||
var DL = this.cpu.regDX & 0xff;
|
||||
if (this.dbg && this.dbg.messageEnabled(FDC.MESSAGE_FDC | FDC.MESSAGE_INT) && DL < 0x80) {
|
||||
if (this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_FDC | Debugger.MESSAGE_INT) && DL < 0x80) {
|
||||
this.dbg.messageInt(FDC.BIOS.INT_DISKETTE, addr);
|
||||
this.cpu.addIntReturn(addr, function(fdc, nCycles) {
|
||||
return function onBIOSDisketteReturn(nLevel) {
|
||||
|
|
@ -2345,7 +2343,7 @@ FDC.prototype.intBIOSDiskette = function(addr)
|
|||
FDC.prototype.messageDebugger = function(sMessage, bitsMessage)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (bitsMessage == null) bitsMessage = FDC.MESSAGE_FDC;
|
||||
if (bitsMessage == null) bitsMessage = Debugger.MESSAGE_FDC;
|
||||
if (this.dbg.messageEnabled(bitsMessage)) this.dbg.message(sMessage);
|
||||
}
|
||||
};
|
||||
|
|
@ -2364,7 +2362,7 @@ FDC.prototype.messageDebugger = function(sMessage, bitsMessage)
|
|||
*/
|
||||
FDC.prototype.messagePort = function(port, bOut, addrFrom, name, bIn)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) this.dbg.messagePort(this, port, bOut, addrFrom, name, FDC.MESSAGE_FDC, bIn);
|
||||
if (DEBUGGER && this.dbg) this.dbg.messagePort(this, port, bOut, addrFrom, name, Debugger.MESSAGE_FDC, bIn);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Hard Drive Controller (HDC) component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Nov-26
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -536,7 +535,6 @@ HDC.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
bus.addPortOutputTable(this, this.fATC? HDC.aATCPortOutput : HDC.aXTCPortOutput);
|
||||
|
||||
if (DEBUGGER) {
|
||||
if (dbg) dbg.messageInit(HDC);
|
||||
cpu.addIntNotify(HDC.BIOS.INT_DISK, this, this.intBIOSDisk);
|
||||
cpu.addIntNotify(HDC.BIOS.INT_DISKETTE, this, this.intBIOSDiskette);
|
||||
}
|
||||
|
|
@ -1795,7 +1793,7 @@ HDC.prototype.doATCommand = function()
|
|||
this.drive = drive;
|
||||
}
|
||||
|
||||
if (DEBUG) this.messageDebugger("HDC.doATCommand(" + str.toHexByte(bCmd) + "): " + HDC.aATCCommands[bCmd], HDC.MESSAGE_PORT | HDC.MESSAGE_HDC);
|
||||
if (DEBUG) this.messageDebugger("HDC.doATCommand(" + str.toHexByte(bCmd) + "): " + HDC.aATCCommands[bCmd], Debugger.MESSAGE_PORT | Debugger.MESSAGE_HDC);
|
||||
|
||||
switch (bCmd & HDC.ATC.COMMAND.MASK) {
|
||||
|
||||
|
|
@ -1881,7 +1879,7 @@ HDC.prototype.doATCommand = function()
|
|||
|
||||
default:
|
||||
if (DEBUG) this.messageDebugger("HDC.doATCommand(" + str.toHexByte(this.regCommand) + "): " + (bCmd < 0? ("invalid drive (" + iDrive + ")") : "unsupported operation"));
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(HDC.MESSAGE_HDC) && bCmd >= 0) this.cpu.haltCPU();
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_HDC) && bCmd >= 0) this.cpu.haltCPU();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2050,7 +2048,7 @@ HDC.prototype.doXTCommand = function()
|
|||
default:
|
||||
if (DEBUG) this.messageDebugger("HDC.doXTCommand(" + str.toHexByte(bCmdOrig) + "): " + (bCmd < 0? ("invalid drive (" + iDrive + ")") : "unsupported operation"));
|
||||
this.beginResult(HDC.XTC.DATA.STATUS_ERROR | bDrive);
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(HDC.MESSAGE_HDC) && bCmd >= 0) this.cpu.haltCPU();
|
||||
if (DEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_HDC) && bCmd >= 0) this.cpu.haltCPU();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2068,7 +2066,7 @@ HDC.prototype.popCmd = function()
|
|||
var bCmdIndex = this.regDataIndex;
|
||||
if (bCmdIndex < this.regDataTotal) {
|
||||
bCmd = this.regDataArray[this.regDataIndex++];
|
||||
if (DEBUG) this.messageDebugger("HDC.CMD[" + bCmdIndex + "]: 0x" + str.toHexByte(bCmd) + (!bCmdIndex && HDC.aXTCCommands[bCmd]? (" (" + HDC.aXTCCommands[bCmd] + ")") : ""), (bCmdIndex > 0? HDC.MESSAGE_PORT : 0) | HDC.MESSAGE_HDC);
|
||||
if (DEBUG) this.messageDebugger("HDC.CMD[" + bCmdIndex + "]: 0x" + str.toHexByte(bCmd) + (!bCmdIndex && HDC.aXTCCommands[bCmd]? (" (" + HDC.aXTCCommands[bCmd] + ")") : ""), (bCmdIndex > 0? Debugger.MESSAGE_PORT : 0) | Debugger.MESSAGE_HDC);
|
||||
}
|
||||
return bCmd;
|
||||
};
|
||||
|
|
@ -2104,7 +2102,7 @@ HDC.prototype.beginResult = function(bResult)
|
|||
*/
|
||||
HDC.prototype.pushResult = function(bResult)
|
||||
{
|
||||
if (DEBUG) this.messageDebugger("HDC.RES[" + this.regDataTotal + "]: 0x" + str.toHexByte(bResult), (this.regDataTotal > 0? HDC.MESSAGE_PORT : 0) | HDC.MESSAGE_HDC);
|
||||
if (DEBUG) this.messageDebugger("HDC.RES[" + this.regDataTotal + "]: 0x" + str.toHexByte(bResult), (this.regDataTotal > 0? Debugger.MESSAGE_PORT : 0) | Debugger.MESSAGE_HDC);
|
||||
this.regDataArray[this.regDataTotal++] = bResult;
|
||||
};
|
||||
|
||||
|
|
@ -2634,7 +2632,7 @@ HDC.prototype.intBIOSDisk = function(addr)
|
|||
var DL = this.cpu.regDX & 0xff;
|
||||
if (!AH && DL > 0x80) this.iDriveAllowFail = DL - 0x80;
|
||||
if (DEBUGGER) {
|
||||
if (this.dbg && this.dbg.messageEnabled(HDC.MESSAGE_HDC | HDC.MESSAGE_INT) && DL >= 0x80) {
|
||||
if (this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_HDC | Debugger.MESSAGE_INT) && DL >= 0x80) {
|
||||
this.dbg.messageInt(HDC.BIOS.INT_DISK, addr);
|
||||
this.cpu.addIntReturn(addr, function (hdc, nCycles) {
|
||||
return function onBIOSDiskReturn(nLevel) {
|
||||
|
|
@ -2697,7 +2695,7 @@ HDC.prototype.intBIOSDiskette = function(addr)
|
|||
HDC.prototype.messageDebugger = function(sMessage, bitsMessage)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (bitsMessage == null) bitsMessage = HDC.MESSAGE_HDC;
|
||||
if (bitsMessage == null) bitsMessage = Debugger.MESSAGE_HDC;
|
||||
if (this.dbg.messageEnabled(bitsMessage)) this.dbg.message(sMessage);
|
||||
}
|
||||
};
|
||||
|
|
@ -2716,7 +2714,7 @@ HDC.prototype.messageDebugger = function(sMessage, bitsMessage)
|
|||
*/
|
||||
HDC.prototype.messagePort = function(port, bOut, addrFrom, name, bIn)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) this.dbg.messagePort(this, port, bOut, addrFrom, name, HDC.MESSAGE_HDC, bIn);
|
||||
if (DEBUGGER && this.dbg) this.dbg.messagePort(this, port, bOut, addrFrom, name, Debugger.MESSAGE_HDC, bIn);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Keyboard component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-20
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -1361,7 +1360,7 @@ Keyboard.prototype.keyEventSimulate = function(charCode, fDown, simCode)
|
|||
Keyboard.prototype.messageDebugger = function(sMessage, fPort)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_KBD | (fPort ? this.dbg.MESSAGE_PORT : 0))) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_KBD | (fPort ? Debugger.MESSAGE_PORT : 0))) {
|
||||
this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs "physical" Memory component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-04
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -167,7 +166,7 @@ Memory.prototype = {
|
|||
* @return {number}
|
||||
*/
|
||||
readNone: function(off) {
|
||||
if (DEBUGGER && this.dbg.messageEnabled(this.dbg.MESSAGE_MEM) && !off) {
|
||||
if (DEBUGGER && this.dbg.messageEnabled(Debugger.MESSAGE_MEM) && !off) {
|
||||
this.dbg.message("attempt to read invalid block %" + str.toHex(this.addr) + " from " + str.toHexAddr(this.cpu.regIP, this.cpu.segCS.sel));
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -180,7 +179,7 @@ Memory.prototype = {
|
|||
* @param {number} v (could be either a byte or word value, since we use the same handler for both kinds of accesses)
|
||||
*/
|
||||
writeNone: function(off, v) {
|
||||
if (DEBUGGER && this.dbg.messageEnabled(this.dbg.MESSAGE_MEM) && !off) {
|
||||
if (DEBUGGER && this.dbg.messageEnabled(Debugger.MESSAGE_MEM) && !off) {
|
||||
this.dbg.message("attempt to write 0x" + str.toHexWord(v) + " to invalid block %" + str.toHex(this.addr) + " from " + str.toHexAddr(this.cpu.regIP, this.cpu.segCS.sel));
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Mouse component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jul-01
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -173,9 +172,6 @@ Mouse.prototype.initBus = function(cmp, bus, cpu, dbg) {
|
|||
this.bus = bus;
|
||||
this.cpu = cpu;
|
||||
this.dbg = dbg;
|
||||
if (DEBUGGER && dbg) {
|
||||
dbg.messageInit(Mouse);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -556,7 +552,7 @@ Mouse.prototype.notifyMCR = function(bMCR) {
|
|||
*/
|
||||
Mouse.prototype.messageDebugger = function(sMessage) {
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_MOUSE)) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_MOUSE)) {
|
||||
this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Panel component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-19
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs RAM component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-15
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs ROM component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-15
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs SerialPort component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jul-01
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -337,9 +336,6 @@ SerialPort.prototype.initBus = function(cmp, bus, cpu, dbg) {
|
|||
this.cpu = cpu;
|
||||
this.dbg = dbg;
|
||||
this.chipset = cmp.getComponentByType("ChipSet");
|
||||
if (DEBUGGER && dbg) {
|
||||
dbg.messageInit(SerialPort);
|
||||
}
|
||||
bus.addPortInputTable(this, SerialPort.aPortInput, this.portBase);
|
||||
bus.addPortOutputTable(this, SerialPort.aPortOutput, this.portBase);
|
||||
this.setReady();
|
||||
|
|
@ -721,7 +717,7 @@ SerialPort.prototype.echoByte = function(b) {
|
|||
*/
|
||||
SerialPort.prototype.messageDebugger = function(sMessage) {
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_SERIAL)) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_SERIAL)) {
|
||||
this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
|
|
@ -741,7 +737,7 @@ SerialPort.prototype.messageDebugger = function(sMessage) {
|
|||
*/
|
||||
SerialPort.prototype.messagePort = function(port, bOut, addrFrom, name, bIn) {
|
||||
if (DEBUGGER && this.dbg) {
|
||||
this.dbg.messagePort(this, port, bOut, addrFrom, name, this.dbg.MESSAGE_SERIAL, bIn);
|
||||
this.dbg.messagePort(this, port, bOut, addrFrom, name, Debugger.MESSAGE_SERIAL, bIn);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ State.prototype = {
|
|||
*/
|
||||
messageDebugger: function(sMessage) {
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_STATE)) this.dbg.message(sMessage);
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_STATE)) this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements the PCjs Video component.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Jun-15
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -1955,9 +1954,8 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
|
||||
if (DEBUGGER && dbg) {
|
||||
var video = this;
|
||||
dbg.messageInit(Video);
|
||||
this.cpu.addIntNotify(Video.BIOS.INT_VIDEO, this, this.intBIOSVideo);
|
||||
dbg.messageDump(Video.MESSAGE_VIDEO, function onDumpVideo(sParm) {
|
||||
dbg.messageDump(Debugger.MESSAGE_VIDEO, function onDumpVideo(sParm) {
|
||||
video.dumpVideo(sParm);
|
||||
});
|
||||
}
|
||||
|
|
@ -1990,7 +1988,7 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
Video.prototype.intBIOSVideo = function(addr)
|
||||
{
|
||||
if (DEBUGGER) {
|
||||
if (this.dbg && this.dbg.messageEnabled(Video.MESSAGE_VIDEO | Video.MESSAGE_INT)) {
|
||||
if (this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_VIDEO | Debugger.MESSAGE_INT)) {
|
||||
this.dbg.messageInt(Video.BIOS.INT_VIDEO, addr);
|
||||
this.cpu.addIntReturn(addr, function (video, nCycles) {
|
||||
return function onBIOSVideoReturn(nLevel) {
|
||||
|
|
@ -3743,7 +3741,7 @@ Video.prototype.updateChar = function(col, row, data, context)
|
|||
this.contextScreen.fillRect(xDst, yDst, this.cxScreenCell, this.cyScreenCell);
|
||||
}
|
||||
|
||||
if (MAXDEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Video.MESSAGE_VIDEO | Video.MESSAGE_LOG)) {
|
||||
if (MAXDEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_VIDEO | Debugger.MESSAGE_LOG)) {
|
||||
this.log("updateCharBgnd(" + col + "," + row + "," + bChar + "): filled " + xDst + "," + yDst);
|
||||
}
|
||||
|
||||
|
|
@ -3754,7 +3752,7 @@ Video.prototype.updateChar = function(col, row, data, context)
|
|||
var xSrcFgnd = (bChar & 0xf) * font.cxCell;
|
||||
var ySrcFgnd = (bChar >> 4) * font.cyCell;
|
||||
|
||||
if (MAXDEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Video.MESSAGE_VIDEO | Video.MESSAGE_LOG)) {
|
||||
if (MAXDEBUG && DEBUGGER && this.dbg && this.dbg.messageEnabled(Debugger.MESSAGE_VIDEO | Debugger.MESSAGE_LOG)) {
|
||||
this.log("updateCharFgnd(" + col + "," + row + "," + bChar + "): draw from " + xSrcFgnd + "," + ySrcFgnd + " (" + font.cxCell + "," + font.cyCell + ") to " + xDst + "," + yDst);
|
||||
}
|
||||
|
||||
|
|
@ -4927,7 +4925,7 @@ Video.prototype.dumpVideo = function(sParm)
|
|||
Video.prototype.messageDebugger = function(sMessage, fForce)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (fForce || this.dbg.messageEnabled(Video.MESSAGE_VIDEO)) {
|
||||
if (fForce || this.dbg.messageEnabled(Debugger.MESSAGE_VIDEO)) {
|
||||
this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
|
|
@ -4948,7 +4946,7 @@ Video.prototype.messageDebugger = function(sMessage, fForce)
|
|||
Video.prototype.messagePort = function(port, bOut, addrFrom, name, bIn)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
this.dbg.messagePort(this, port, bOut, addrFrom, name, Video.MESSAGE_VIDEO, bIn);
|
||||
this.dbg.messagePort(this, port, bOut, addrFrom, name, Debugger.MESSAGE_VIDEO, bIn);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Defines PCjs x86 constants.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs 8086/8088 CPU logic.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -925,7 +924,7 @@ X86CPU.prototype.checkIntNotify = function(nInt)
|
|||
* Enabling MESSAGE_INT messages is one of the criteria that's also included in fDebugCheck, so for maximum
|
||||
* speed, we check fDebugCheck first.
|
||||
*/
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_INT)) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_INT)) {
|
||||
this.dbg.messageInt(nInt, this.regEIP);
|
||||
this.addIntReturn(this.regEIP, function(cpu, nCycles) {
|
||||
return function onIntReturn(nLevel) {
|
||||
|
|
@ -2472,7 +2471,7 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
|
|||
* One exception I make here is when you've asked the Debugger to display PIC messages, the idea being that
|
||||
* if you're watching the PIC that closely, then you want to hardware interrupts to occur regardless.
|
||||
*/
|
||||
if (!nMinCycles && this.dbg && !this.dbg.messageEnabled(this.dbg.MESSAGE_PIC)) this.opFlags |= X86.OPFLAG.NOINTR;
|
||||
if (!nMinCycles && this.dbg && !this.dbg.messageEnabled(Debugger.MESSAGE_PIC)) this.opFlags |= X86.OPFLAG.NOINTR;
|
||||
|
||||
do {
|
||||
var opPrefixes = this.opFlags & X86.OPFLAG.PREFIXES;
|
||||
|
|
@ -2579,7 +2578,7 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
|
|||
X86CPU.prototype.messageDebugger = function(sMessage)
|
||||
{
|
||||
if (DEBUGGER && this.dbg) {
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_MEM)) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_MEM)) {
|
||||
this.dbg.message(sMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs 8086 group opcode helpers.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs 8086 opcode helpers.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -447,7 +446,7 @@ var X86Help = {
|
|||
/*
|
||||
* NOTE: By using Debugger.message(), we have the option of setting "m halt on" and halting on messages like this.
|
||||
*/
|
||||
if (this.dbg.messageEnabled(this.dbg.MESSAGE_CPU)) {
|
||||
if (this.dbg.messageEnabled(Debugger.MESSAGE_CPU)) {
|
||||
this.dbg.message("Fault 0x" + str.toHexByte(nFault) + (nError != null? " (0x" + str.toHexWord(nError) + ")" : "") + " on opcode 0x" + str.toHexByte(this.bus.getByteDirect(this.regEIP)) + " at " + str.toHexAddr(this.regIP, this.segCS.sel));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs 8086 mode-byte decoding.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs 0x0F two-byte opcodes
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs 8086 opcode decoding.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Sep-05
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview Implements PCjs X86 Segment objects
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2014-Sep-10
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
|
|||
Loading…
Reference in a new issue