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 implements the C1Pjs 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>
|
||||
|
|
@ -53,7 +52,7 @@
|
|||
* The C1Pjs JavaScript files do have some initialization-order dependencies.
|
||||
* If you load the files individually, it's recommended that you load them in
|
||||
* the same order that they're compiled (see above).
|
||||
*
|
||||
*
|
||||
* Generally speaking, component.js should be first, computer.js should be
|
||||
* last (of the files based on component.js), and panel.js should be listed
|
||||
* early so that the Control Panel is ready as soon as possible.
|
||||
|
|
@ -74,13 +73,13 @@
|
|||
* play nice and use only its assigned section of abMemory -- and pretend it's an array
|
||||
* of bytes, when in fact it's an array of floating-point values (the only primitive
|
||||
* numeric data type that JavaScript provides).
|
||||
*
|
||||
*
|
||||
* This component also insures that all the other components are ready; in particular,
|
||||
* this means that the ROM and Video components have finished loading their resources
|
||||
* and are ready for operation. Other components become ready as soon as we call their
|
||||
* setBuffer() method (eg, CPU, RAM, Keyboard, Debugger, SerialPort, DiskController), and
|
||||
* others, like Panel, become ready even earlier, at the end of their initialization.
|
||||
*
|
||||
*
|
||||
* Once every component has indicated it's ready, we call its setPower() notification
|
||||
* function (if it has one; it's optional). We call the CPU's setPower() function last,
|
||||
* so that the CPU is assured that all other components are ready and "powered".
|
||||
|
|
@ -91,7 +90,7 @@
|
|||
function C1PComputer(parmsComputer, modules)
|
||||
{
|
||||
Component.call(this, "C1PComputer", parmsComputer);
|
||||
|
||||
|
||||
this.modules = modules;
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +125,7 @@ C1PComputer.prototype.reset = function(fPowerOn)
|
|||
|
||||
/**
|
||||
* @this {C1PComputer}
|
||||
*
|
||||
*
|
||||
* Called by the CPU to notify all component start() handlers
|
||||
*/
|
||||
C1PComputer.prototype.start = function()
|
||||
|
|
@ -146,7 +145,7 @@ C1PComputer.prototype.start = function()
|
|||
* @this {C1PComputer}
|
||||
* @param {number} msStart
|
||||
* @param {number} nCycles
|
||||
*
|
||||
*
|
||||
* Called by the CPU to notify all component stop() handlers
|
||||
*/
|
||||
C1PComputer.prototype.stop = function(msStart, nCycles)
|
||||
|
|
@ -191,7 +190,7 @@ C1PComputer.prototype.setBinding = function(c, t, s, e)
|
|||
* @this {C1PComputer}
|
||||
* @param {string} sType
|
||||
* @return {Component}
|
||||
*
|
||||
*
|
||||
* NOTE: If there are multiple components for a given type, we may need to provide a means of discriminating.
|
||||
*/
|
||||
C1PComputer.prototype.getComponentByType = function(sType)
|
||||
|
|
@ -232,11 +231,11 @@ C1PComputer.power = function(computer)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The entire computer is finally ready; we call our own setReady() for completeness, not because any
|
||||
* other component actually cares when we're ready.
|
||||
*/
|
||||
*/
|
||||
computer.setReady();
|
||||
|
||||
computer.println(C1PComputer.sAppName + " v" + C1PComputer.sAppVer + "\n" + C1PComputer.sCopyright);
|
||||
|
|
@ -273,13 +272,13 @@ C1PComputer.init = function()
|
|||
|
||||
var abMemory;
|
||||
var addrStart = 0, addrEnd = 0;
|
||||
|
||||
|
||||
for (var iAddr=0; iAddr < parmsComputer['modules'].length; iAddr++) {
|
||||
var addrInfo = parmsComputer['modules'][iAddr];
|
||||
/*
|
||||
* The first address range (ie, the CPU range) must specify the range for the entire
|
||||
* address space (abMemory), which we allocate and zero-initialize.
|
||||
*
|
||||
*
|
||||
* NOTE: We might consider doing what the Video component does on first reset: initializing
|
||||
* the entire memory buffer to random values. However, a constant (eg, 0xA5) might be
|
||||
* more useful, acting as a crude indicator of memory the client code hasn't written yet.
|
||||
|
|
@ -308,7 +307,7 @@ C1PComputer.init = function()
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (abMemory === undefined) {
|
||||
Component.error("<module type=\"cpu\"> definition must appear first in the <computer> specification");
|
||||
return;
|
||||
|
|
@ -317,7 +316,7 @@ C1PComputer.init = function()
|
|||
/*
|
||||
* Let's see if the Debugger is installed (NOTE: its ID must be "debugger", and only one per machine is supported);
|
||||
* the Debugger needs our setBuffer(), setPower() and reset() notifications, and this relieves us from having an explicit
|
||||
* <module> entry for type="debugger".
|
||||
* <module> entry for type="debugger".
|
||||
*/
|
||||
component = Component.getComponentByID('debugger', parmsComputer['id']);
|
||||
if (component) {
|
||||
|
|
@ -326,12 +325,12 @@ C1PComputer.init = function()
|
|||
component.setBuffer(abMemory, addrStart, addrEnd, modules['cpu'][0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var computer = new C1PComputer(parmsComputer, modules);
|
||||
|
||||
/*
|
||||
* Let's see if the Control Panel is installed (NOTE: its ID must be "panel", and only one per machine is supported);
|
||||
* the Panel needs our setPower() notifications, and this relieves us from having an explicit <module> entry for type="panel".
|
||||
* Let's see if the Control Panel is installed (NOTE: its ID must be "panel", and only one per machine is supported);
|
||||
* the Panel needs our setPower() notifications, and this relieves us from having an explicit <module> entry for type="panel".
|
||||
*/
|
||||
var panel = Component.getComponentByID('panel', parmsComputer['id']);
|
||||
if (panel) {
|
||||
|
|
@ -355,7 +354,7 @@ C1PComputer.init = function()
|
|||
* We may eventually add a "Power" button, but for now, all we have is a "Reset" button
|
||||
*/
|
||||
Component.bindComponentControls(computer, eComputer, C1PJSCLASS);
|
||||
|
||||
|
||||
/*
|
||||
* "Power" the computer automatically
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file implements the C1Pjs 6502 CPU 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 This file implements the C1Pjs 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>
|
||||
|
|
@ -35,12 +34,12 @@
|
|||
|
||||
/**
|
||||
* C1PDebugger(parmsDbg)
|
||||
*
|
||||
*
|
||||
* The C1PDebugger component has no required (parmsDbg) properties.
|
||||
*
|
||||
* The C1PDebugger component is an optional component that implements a variety of user
|
||||
* commands for controlling the CPU, dumping and editing memory, etc.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
*/
|
||||
|
|
@ -49,7 +48,7 @@ function C1PDebugger(parmsDbg)
|
|||
if (DEBUGGER) {
|
||||
|
||||
Component.call(this, "C1PDebugger", parmsDbg);
|
||||
|
||||
|
||||
/*
|
||||
* This keeps track of instruction activity, but only when tracing or when
|
||||
* Debugger checks have been enabled (eg, one or more breakpoints have been set).
|
||||
|
|
@ -58,25 +57,25 @@ function C1PDebugger(parmsDbg)
|
|||
* We set it here to -1 to indicate that the CPU has not yet initialized us.
|
||||
*/
|
||||
this.cIns = -1;
|
||||
|
||||
|
||||
/*
|
||||
* Some commands, like the dump (d) command, start at nextAddr when no address
|
||||
* is given (and they also update nextAddr when they're done).
|
||||
*/
|
||||
this.nextAddr = 0;
|
||||
|
||||
|
||||
/*
|
||||
* When Enter is pressed on an empty input buffer, we default to the previous
|
||||
* command, which is preserved here.
|
||||
*/
|
||||
this.prevCmd = null;
|
||||
|
||||
|
||||
/*
|
||||
* fAssemble is true when "assemble mode" is active, false when not.
|
||||
*/
|
||||
this.fAssemble = false;
|
||||
this.addrAssembleNext = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the lists of breakpoint addresses. aExecBreak is a list (Array) of addresses
|
||||
* to halt at whenever attempting to execute an instruction at the corresponding address,
|
||||
|
|
@ -84,7 +83,7 @@ function C1PDebugger(parmsDbg)
|
|||
* respectively, occurs at the corresponding address.
|
||||
*/
|
||||
this.clearBreakpoints();
|
||||
|
||||
|
||||
/*
|
||||
* Instead of pre-allocating these arrays, we wait until our reset() function is called.
|
||||
* These arrays are updated in checkInstruction(), but the CPU will never actually call it
|
||||
|
|
@ -94,7 +93,7 @@ function C1PDebugger(parmsDbg)
|
|||
this.iStepHistory = 0;
|
||||
this.aStepHistory = [];
|
||||
this.aaOpcodeFreqs = [];
|
||||
|
||||
|
||||
/*
|
||||
* This "info" buffer is a lightweight logging mechanism that has minimal impact on the
|
||||
* browser (unlike printing to either window.console.log or an HTML control, which can make
|
||||
|
|
@ -106,7 +105,7 @@ function C1PDebugger(parmsDbg)
|
|||
this.iInfoBuffer = 0;
|
||||
this.aInfoBuffer = new Array(10000);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Message categories supported by the message() function; they are designed to be combined
|
||||
* (ie, OR'ed) as needed. The Debugger's "option" command is used to turn message categories
|
||||
|
|
@ -131,7 +130,7 @@ function C1PDebugger(parmsDbg)
|
|||
'disk': this.MESSAGE_DISK,
|
||||
'serial': this.MESSAGE_SERIAL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* The aaOperations array is indexed by opcode, and each element is a sub-array that
|
||||
* describes the corresponding opcode. The sub-elements are as follows:
|
||||
|
|
@ -202,7 +201,7 @@ function C1PDebugger(parmsDbg)
|
|||
this.OP_TYA = 55;
|
||||
this.OP_SIM = 56;
|
||||
this.OP_DB = 57;
|
||||
|
||||
|
||||
this.aOpCodes = [
|
||||
"ADC","AND","ASL","BCC","BCS","BEQ","BIT","BMI",
|
||||
"BNE","BPL","BRK","BVC","BVS","CLC","CLD","CLI",
|
||||
|
|
@ -213,13 +212,13 @@ function C1PDebugger(parmsDbg)
|
|||
"STX","STY","TAX","TAY","TSX","TXA","TXS","TYA",
|
||||
"SIM",".DB"
|
||||
];
|
||||
|
||||
|
||||
this.aOpSimCodes = [
|
||||
"HLT", "MSG"
|
||||
];
|
||||
|
||||
|
||||
this.setOpModes(true);
|
||||
|
||||
|
||||
this.aaOperations = [
|
||||
/* 0x00 */ [this.OP_BRK],
|
||||
/* 0x01 */ [this.OP_ORA, 1, this.MODE_INDX],
|
||||
|
|
@ -657,7 +656,7 @@ if (DEBUGGER) {
|
|||
|
||||
var sRegEx = "";
|
||||
var iMode, sMode;
|
||||
|
||||
|
||||
if (fClassic) {
|
||||
this.aOpModes = [
|
||||
"A", // MODE_ACC
|
||||
|
|
@ -986,7 +985,7 @@ if (DEBUGGER) {
|
|||
* NOTE: We keep track of zero-page writes mainly as a reminder to look into whether it makes sense
|
||||
* for the CPU to calculate zero-page EAs using a different variable (eg, regEAWriteZP instead of regEAWrite),
|
||||
* because write-notification handlers never care about page zero accesses, and while write breakpoints *may*
|
||||
* care, it may not be worth the cost of tracking writes to page zero if there's an associated perf penalty.
|
||||
* care, it may not be worth the cost of tracking writes to page zero if there's an associated perf penalty.
|
||||
*/
|
||||
if (!(addr & 0xff00))
|
||||
this.cWritesZP++;
|
||||
|
|
@ -1207,7 +1206,7 @@ if (DEBUGGER) {
|
|||
|
||||
/**
|
||||
* @this {C1PDebugger}
|
||||
* @param {number} addr to compare to addrTempBP; the latter is cleared if there's a match
|
||||
* @param {number} addr to compare to addrTempBP; the latter is cleared if there's a match
|
||||
*/
|
||||
C1PDebugger.prototype.clearTempBreakpoint = function(addr)
|
||||
{
|
||||
|
|
@ -1517,7 +1516,6 @@ if (DEBUGGER) {
|
|||
* @this {C1PDebugger}
|
||||
* @param {string|undefined} [sAddr]
|
||||
* @return {number|undefined}
|
||||
* @suppress {checkTypes}
|
||||
*/
|
||||
C1PDebugger.prototype.getUserAddr = function(sAddr)
|
||||
{
|
||||
|
|
@ -1843,7 +1841,7 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Prints the contents of the Debugger's "info" buffer (filled by calls like cpu.dbg.info())
|
||||
* Prints the contents of the Debugger's "info" buffer (filled by calls like cpu.dbg.info())
|
||||
* @this {C1PDebugger}
|
||||
* @param {string|undefined} sCount
|
||||
* @return {boolean|undefined} true only if the "info" command is supported
|
||||
|
|
@ -2127,7 +2125,7 @@ if (DEBUGGER) {
|
|||
sCmd = dbg.prevCmd;
|
||||
}
|
||||
if (dbg.isReady() && !dbg.isBusy(true) && sCmd.length > 0) {
|
||||
|
||||
|
||||
if (dbg.fAssemble) {
|
||||
sCmd = "a " + str.toHexWord(dbg.addrAssembleNext) + " " + sCmd;
|
||||
}
|
||||
|
|
@ -2139,10 +2137,10 @@ if (DEBUGGER) {
|
|||
var ch = sCmd.charAt(0).toLowerCase();
|
||||
sCmd = ch + " " + sCmd.substr(1);
|
||||
}
|
||||
|
||||
|
||||
var asArgs = sCmd.split(" ");
|
||||
dbg.prevCmd = asArgs[0];
|
||||
|
||||
|
||||
switch(asArgs[0].toLowerCase()) {
|
||||
case "a":
|
||||
dbg.doAssemble(asArgs);
|
||||
|
|
@ -2189,14 +2187,14 @@ if (DEBUGGER) {
|
|||
break;
|
||||
case "i":
|
||||
if (dbg.doInfo(asArgs[1])) break;
|
||||
/* falls through */
|
||||
/* falls through */
|
||||
default:
|
||||
dbg.println("unknown command: " + sCmd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* C1PDebugger.init()
|
||||
*
|
||||
|
|
@ -2217,7 +2215,7 @@ if (DEBUGGER) {
|
|||
Component.bindComponentControls(dbg, eDbg, C1PJSCLASS);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Initialize every Debugger module on the page (as IF there's ever going to be more than one ;-))
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file implements the C1Pjs DiskController 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>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file implements the C1Pjs 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>
|
||||
|
|
@ -327,7 +326,7 @@ C1PKeyboard.prototype.reset = function()
|
|||
*
|
||||
* Like bitsShift, this 8x8 array (8 byte values, each with 8 bits) represents
|
||||
* the physical state of the keyboard, encoded in C1P format; the C1P won't
|
||||
* actually see data this until updateMemory() decides it's time to propagate it.
|
||||
* actually see data this until updateMemory() decides it's time to propagate it.
|
||||
*/
|
||||
this.abKbdCols = [this.BIT_SHIFTLOCK,0x00,0x00,0x00,0x00,0x00,0x00,0x00];
|
||||
|
||||
|
|
@ -539,7 +538,7 @@ C1PKeyboard.prototype.setReady = function()
|
|||
|
||||
/**
|
||||
* calcReleaseDelay(fRepeat
|
||||
*
|
||||
*
|
||||
* This attempts to scale our default "release" delay appropriately for the current CPU speed.
|
||||
*
|
||||
* Note that if the effective CPU speed exceeds 16Mhz, it becomes very difficult to rely on timer-driven key events
|
||||
|
|
@ -631,7 +630,7 @@ C1PKeyboard.prototype.injectKeysFromBuffer = function(msDelay)
|
|||
*
|
||||
* UPDATE: Even though keyPressSimulate() currently has some code to do this automatically now,
|
||||
* it's really intended as a work-around for a SHIFT-related problem on iOS devices only, so
|
||||
* we can't rely on that in the general case.
|
||||
* we can't rely on that in the general case.
|
||||
*/
|
||||
if (ch >= 0x41 && ch <= 0x5A)
|
||||
ch += 0x20;
|
||||
|
|
@ -711,7 +710,7 @@ C1PKeyboard.prototype.keyEvent = function(event, fDown)
|
|||
* browser will see it and give focus to the next control. But the "down" side is that
|
||||
* that no "press" event will be generated. This puts it in the same category as ESC,
|
||||
* which also generates "down" and "up" events (LOTS of "down" events for that matter),
|
||||
* but no "press" event. However, the C1P has no TAB key, so it's safe to completely ignore.
|
||||
* but no "press" event. However, the C1P has no TAB key, so it's safe to completely ignore.
|
||||
*/
|
||||
fPass = fAutoClear = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file implements the C1Pjs 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>
|
||||
|
|
@ -44,7 +43,7 @@
|
|||
function C1PPanel(parmsPanel)
|
||||
{
|
||||
Component.call(this, "C1PPanel", parmsPanel);
|
||||
|
||||
|
||||
this.fPower = false;
|
||||
}
|
||||
|
||||
|
|
@ -90,19 +89,19 @@ C1PPanel.prototype.setPower = function(fOn, cmp)
|
|||
|
||||
/**
|
||||
* C1PPanel.init()
|
||||
*
|
||||
*
|
||||
* This function operates on every element (e) of class "panel", and initializes
|
||||
* all the necessary HTML to construct the Panel module(s) as spec'ed.
|
||||
*
|
||||
* Note that each element (e) of class "panel" is expected to have a "data-value"
|
||||
* attribute containing the same JSON-encoded parameters that the Panel constructor
|
||||
* expects.
|
||||
*
|
||||
*
|
||||
* NOTE: Unlike most other component init() functions, this one is designed to be
|
||||
* called multiple times: once at load time, so that we can binding our print()
|
||||
* function to the panel's output control ASAP, and again when the Computer component
|
||||
* is verifying that all components are ready and invoking their setPower() functions.
|
||||
*
|
||||
*
|
||||
* Our setPower() method gives us a second opportunity to notify any components that
|
||||
* that might care (eg, CPU, Keyboard, and Debugger) that we have some controls they
|
||||
* might want to use.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file implements the C1Pjs 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 This file implements the C1Pjs 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 This file implements the C1Pjs 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>
|
||||
|
|
@ -47,7 +46,7 @@ function C1PSerialPort(parmsSerial)
|
|||
|
||||
this.fPower = false;
|
||||
this.fDemo = parmsSerial['demo'];
|
||||
|
||||
|
||||
this.STATUS_NONE = 0x00;
|
||||
this.STATUS_DATA = 0x01; // indicates data available
|
||||
|
||||
|
|
@ -155,7 +154,7 @@ C1PSerialPort.prototype.setBuffer = function(abMemory, start, end, cpu)
|
|||
* @this {C1PSerialPort}
|
||||
* @param {boolean} fOn
|
||||
* @param {C1PComputer} cmp
|
||||
*
|
||||
*
|
||||
* We make a note of the Computer component, so that we can invoke its reset() method whenever we need to
|
||||
* simulate a warm start, and we query the Keyboard component so that we can use its injectKeys() function.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview This file implements the C1Pjs 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>
|
||||
|
|
@ -35,7 +34,7 @@
|
|||
|
||||
/**
|
||||
* C1PVideo(parmsVideo, eCanvas, context, imgChars)
|
||||
*
|
||||
*
|
||||
* The Video component can be configured with the following (parmsVideo) properties:
|
||||
*
|
||||
* model: model number (one of: 540 or 600; 600 is the default)
|
||||
|
|
@ -56,7 +55,7 @@
|
|||
* must be given to it by the Computer object. We allocate a separate buffer, called
|
||||
* the screen buffer, into which we periodically copy the contents of the video buffer
|
||||
* via updateScreen(); any differences between the two buffers are then rendered in the
|
||||
* associated window, via updateWindow().
|
||||
* associated window, via updateWindow().
|
||||
*
|
||||
* When updateScreen() finds a byte in the screen buffer must be redisplayed, it converts
|
||||
* the offset of that byte into a (col,row) character position for the updateWindow() function,
|
||||
|
|
@ -71,7 +70,7 @@
|
|||
* columns, the practical maximum is 24 rows x 24 columns; the last 4 rows of the video buffer
|
||||
* are never used, and while content scrolls through the top 4 lines of the buffer, it is never
|
||||
* assumed that you can see the top 4 lines.
|
||||
*
|
||||
*
|
||||
* This is partially confirmed by the "C1P Character Graphics Reference Manual", p3, which says
|
||||
* that the "the visible character field consists of 25 lines of 25 columns" and that the "first
|
||||
* visible character in the upper left of the screen is accessed via address 53379," or 0xD083,
|
||||
|
|
@ -79,66 +78,66 @@
|
|||
* regarding "25 lines of 25 columns" seems to be off by one in both dimensions. And why would
|
||||
* they say that the first visible address is 0xD083 instead of 0xD085? An indentation of 5 bytes,
|
||||
* rather than 3, would be more consistent with how the C1P ROMs use video memory.
|
||||
*
|
||||
*
|
||||
* Model 540 Video Board vs. Model 600 "Superboard II"
|
||||
* ---------------------------------------------------
|
||||
* This emulation was originally written for the Model 600 "Superboard II" (eg, Challenger 1P).
|
||||
* Support for the Model 540 video board (as used in the Challenger II-4P and II-8P) was added
|
||||
* later.
|
||||
*
|
||||
*
|
||||
* NOTE: When Model 540 video emulation is enabled, Model 542 keyboard emulation must also be
|
||||
* enabled, because the former always came with the latter keyboard interface; this is why when
|
||||
* we call this.setModel(540), we must also notify the Keyboard via kbd.setModel(542).
|
||||
*
|
||||
*
|
||||
* Key features/differences of the Model 540 video board include:
|
||||
*
|
||||
*
|
||||
* 2K (8 pages) of video memory located at 0xD000-0xD7FF
|
||||
* Two display modes: 32 rows x 64 cols (default on power up), and 32 rows x 32 cols
|
||||
* 64 bytes per screen row, regardless which display mode is selected
|
||||
* The following options can be selected via WRITE to port address 0xDE00:
|
||||
* Bit 0: clear to enable 32/64 mode (default on power up), set to enable 32/32
|
||||
* Bit 1: 1=tone on (542 keyboard)
|
||||
* Bit 2: 1=color on (Rev. B only?)
|
||||
* Bit 2: 1=color on (Rev. B only?)
|
||||
* bit 3: 1=enable 38-40Khz AC Home control output (Rev. B only?)
|
||||
* Video timing counter status via READ from port address 0xDE00:
|
||||
* Bit 7: 0 for 1/120 second, then 1 for 1/120 second, based on video clock (60Hz)
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @extends Component
|
||||
*/
|
||||
function C1PVideo(parmsVideo, eCanvas, context, imgChars)
|
||||
{
|
||||
Component.call(this, "C1PVideo", parmsVideo);
|
||||
|
||||
|
||||
this.nDefaultModel = parmsVideo['model'];
|
||||
this.nDefaultCols = parmsVideo['charCols'];
|
||||
this.nDefaultRows = parmsVideo['charRows'];
|
||||
|
||||
|
||||
this.cxScreen = parmsVideo['screenWidth'];
|
||||
this.cyScreen = parmsVideo['screenHeight'];
|
||||
|
||||
|
||||
/*
|
||||
* These (source) character dimensions are tentative, and may not even be provided,
|
||||
* but they will become definitive once imgChars has finished loading and setReady() is called.
|
||||
*/
|
||||
this.cxChar = parmsVideo['charWidth'];
|
||||
this.cyChar = parmsVideo['charHeight'];
|
||||
|
||||
|
||||
/*
|
||||
* This is a preliminary call to setDimensions(), to initialize default screen buffer and
|
||||
* window dimensions. A more extensive call to setDimensions() will take place when setModel()
|
||||
* is called later, from reset() and possibly via the tripGuard() handler.
|
||||
*
|
||||
*
|
||||
* This preliminary call merely establishes a default screen buffer size, so that when
|
||||
* setBuffer() is called, it's able to verify the assigned address space is at least as big
|
||||
* setBuffer() is called, it's able to verify the assigned address space is at least as big
|
||||
* as the screen buffer.
|
||||
*/
|
||||
this.setDimensions();
|
||||
|
||||
|
||||
this.eCanvas = eCanvas;
|
||||
this.context = context;
|
||||
this.imgChars = imgChars;
|
||||
|
||||
|
||||
/*
|
||||
* QUESTION: Does this video port exist only on the Model 540?
|
||||
*/
|
||||
|
|
@ -155,7 +154,7 @@ Component.subclass(Component, C1PVideo);
|
|||
C1PVideo.prototype.reset = function(fPowerOn)
|
||||
{
|
||||
this.setModel(this.nDefaultModel);
|
||||
|
||||
|
||||
if (this.abMem) {
|
||||
/*
|
||||
* Let's treat every reset like a power-cycle, just for fun.
|
||||
|
|
@ -245,7 +244,7 @@ C1PVideo.prototype.setDimensions = function(nCols, nRows, iRowTop, nRowsVisible)
|
|||
|
||||
/**
|
||||
* @this {C1PVideo}
|
||||
*
|
||||
*
|
||||
* cxScreen and cyScreen give us the overall dimensions of the destination surface. Dividing that by the number of
|
||||
* columns and rows yields a target cell size (cxCharDst,cyCharDst), which may or may not map 1-1 to the source cell size
|
||||
* (cxChar,cyChar).
|
||||
|
|
@ -283,7 +282,7 @@ C1PVideo.prototype.setModel = function(nModel)
|
|||
* buffer range, not the FIRST byte, which has the same effect but with the
|
||||
* added benefit of deferring any screen update until after the "Model 540"
|
||||
* screen initialization code has completely blanked the entire 2K buffer,
|
||||
* avoiding a brief flicker of unsightly characters.
|
||||
* avoiding a brief flicker of unsightly characters.
|
||||
*/
|
||||
this.addrGuard = this.offVideoLimit + this.cbScreen - 1;
|
||||
this.cpu.addWriteNotify(this.addrGuard, this.addrGuard, this, this.tripGuard);
|
||||
|
|
@ -315,7 +314,7 @@ C1PVideo.prototype.setPower = function(fOn, cmp)
|
|||
/*
|
||||
* If we have an associated keyboard, then ensure that the keyboard will be notified whenever
|
||||
* the canvas gets focus and receives input.
|
||||
*
|
||||
*
|
||||
* Also, when simulating a Model 540 video board, we need to access to the Keyboard component due
|
||||
* to some shared I/O responsibilities; ie, bit 1 of the video control port at 0xDE00 enables whatever
|
||||
* tone has been selected via the keyboard frequency port at 0xDF01 (frequency == 49152/n, where n
|
||||
|
|
@ -340,7 +339,7 @@ C1PVideo.prototype.setPower = function(fOn, cmp)
|
|||
|
||||
/**
|
||||
* @this {C1PVideo}
|
||||
*
|
||||
*
|
||||
* cxChar and cyChar are the source cell size. Originally, those values came strictly from the parmsVideo
|
||||
* 'charWidth' and 'charHeight' properties. Now, if those aren't defined (which is normally the case now),
|
||||
* then we infer the source cell size from the dimensions of imgChars, which is expected to be a 16x16 array of
|
||||
|
|
@ -372,7 +371,7 @@ C1PVideo.prototype.getByte = function(addr, addrFrom)
|
|||
* The only documented READ bit in addrVideoPort is bit 7, which is supposed to alternate between
|
||||
* 0 and 1 every 1/120 of a second. There's no way we're going to add special code to the emulator to update
|
||||
* this stupid byte every 8,333 cycles (assuming 1Mhz operation), so clearly we're going to fake it.
|
||||
*
|
||||
*
|
||||
* Faking it means that any polling code will unavoidably get a stale value the FIRST time it reads bit 7.
|
||||
* However, we can still do a pretty good job of faking any EXTENSIVE polling: get the number of cycles
|
||||
* executed so far, divide that by 8333, floor the quotient, and then set/clear bit 7 according to whether the
|
||||
|
|
@ -410,7 +409,7 @@ C1PVideo.prototype.tripGuard = function(addr, addrFrom)
|
|||
/*
|
||||
* The CPU has just written to the guard address we established just beyond the video buffer's 1K boundary,
|
||||
* implying that the system thinks we have a 2K buffer instead. So we bump our model to 540, bump the
|
||||
* associated keyboard model to 542, and remove this guard handler.
|
||||
* associated keyboard model to 542, and remove this guard handler.
|
||||
*/
|
||||
this.setModel(540);
|
||||
if (this.kbd) this.kbd.setModel(542);
|
||||
|
|
@ -431,7 +430,7 @@ C1PVideo.prototype.initScreen = function()
|
|||
|
||||
/**
|
||||
* updateScreen() updates the screen buffer from the video buffer and updates the window with any changes.
|
||||
*
|
||||
*
|
||||
* @this {C1PVideo}
|
||||
* @return {boolean}
|
||||
*
|
||||
|
|
@ -474,19 +473,19 @@ C1PVideo.prototype.writeByte = function(offset, b)
|
|||
|
||||
/**
|
||||
* updateWindow() updates a particular position (row,col) in the associated window with the given byte (b)
|
||||
*
|
||||
*
|
||||
* @this {C1PVideo}
|
||||
* @param {number} col
|
||||
* @param {number} row
|
||||
* @param {number} b
|
||||
* @return {boolean} true if successful, false if not
|
||||
*
|
||||
* @return {boolean} true if successful, false if not
|
||||
*
|
||||
* I originally used (screenWidth,screenHeight) == (512,448) and (cols,rows) == (32,32) and (cxChar,cyChar) == (16,16),
|
||||
* and I simply copied the source cells 1-to-1 to the destination (16,16), knowing that we would never try to display more
|
||||
* than 28 rows (the last 4 rows of the 32 possible rows were never used to display any content). However, I should still
|
||||
* have ignored any attempt to draw past row 28 (aka screenHeight 448). I now perform row clipping and biasing, according
|
||||
* to the first visible row (iRowTop) and total visible rows (nRowsVisible).
|
||||
*
|
||||
*
|
||||
* Moreover, I no longer copy the source cell images to the destination 1-to-1. I calculate (cxCharDst,cyCharDst) separately
|
||||
* (see setDrawingDimensions). And I no longer assume that (cxChar,cyChar) are (16,16); once the source image file has finished
|
||||
* loading, I calculate (cxChar,cyChar) based on the size of image file (see setReady). I made this change when I created
|
||||
|
|
@ -527,7 +526,7 @@ C1PVideo.init = function()
|
|||
for (var iVideo=0; iVideo < aeVideo.length; iVideo++) {
|
||||
var eVideo = aeVideo[iVideo];
|
||||
var parmsVideo = Component.getComponentParms(eVideo);
|
||||
|
||||
|
||||
/*
|
||||
* As noted in keyboard.js, the keyboard on an iOS device pops up with the SHIFT key depressed,
|
||||
* which is not the initial keyboard state that the C1P expects. I originally tried to fix that by
|
||||
|
|
@ -545,7 +544,7 @@ C1PVideo.init = function()
|
|||
eCanvas.setAttribute("class", C1PJSCLASS + "-canvas");
|
||||
eCanvas.setAttribute("width", parmsVideo['screenWidth']);
|
||||
eCanvas.setAttribute("height", parmsVideo['screenHeight']);
|
||||
|
||||
|
||||
eCanvas.setAttribute("contenteditable", "true");
|
||||
eCanvas.setAttribute("autocapitalize", "off");
|
||||
eCanvas.setAttribute("autocorrect", "off");
|
||||
|
|
@ -569,7 +568,7 @@ C1PVideo.init = function()
|
|||
|
||||
/*
|
||||
* Now we can create the Video object, record it, and wire it up to the associated document elements.
|
||||
*
|
||||
*
|
||||
* Regarding "new Image()", see https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement.Image:
|
||||
*
|
||||
* This constructor exists for historical reasons only and returns an HTMLImageElement instance just as
|
||||
|
|
@ -577,7 +576,7 @@ C1PVideo.init = function()
|
|||
*/
|
||||
var imgCharSet = new Image();
|
||||
var contextVideo = eCanvas.getContext("2d");
|
||||
var video = new C1PVideo(parmsVideo, eCanvas, contextVideo, imgCharSet);
|
||||
var video = new C1PVideo(parmsVideo, eCanvas, contextVideo, imgCharSet);
|
||||
imgCharSet.onload = function(video, sCharSet) {
|
||||
return function() {
|
||||
if (DEBUG) video.log("onload(): finished loading " + sCharSet);
|
||||
|
|
@ -588,7 +587,7 @@ C1PVideo.init = function()
|
|||
|
||||
/*
|
||||
* Bind any video-specific controls (eg, the Refresh button). There are no essential controls, however;
|
||||
* even the "Refresh" button is just a diagnostic tool, to verify that the screen contents are up-to-date.
|
||||
* even the "Refresh" button is just a diagnostic tool, to verify that the screen contents are up-to-date.
|
||||
*/
|
||||
Component.bindComponentControls(video, eVideo, C1PJSCLASS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* @fileoverview C1Pjs and PCjs embedding functionality.
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @version 1.0
|
||||
* @suppress {missingProperties}
|
||||
* Created 2012-Aug-28
|
||||
*
|
||||
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
|
||||
|
|
@ -140,10 +139,10 @@ function parseXML(sXML, sXMLFile, idMachine, sStateFile, fResolve, display, done
|
|||
* browsers do that, that's not helpful.
|
||||
*
|
||||
* The best I can do at this stage (assuming web.loadResource() didn't drop any error information on the floor)
|
||||
* is verify that the requested resource "looks like" valid XML (in other words, it begins with a "<").
|
||||
* is verify that the requested resource "looks like" valid XML (in other words, it begins with a '<').
|
||||
*/
|
||||
var xmlDoc = null;
|
||||
if (sXML.indexOf("<") === 0) {
|
||||
if (sXML.charAt(0) == '<') {
|
||||
try {
|
||||
if (window.ActiveXObject || "ActiveXObject" in window) { // second test is required for IE11 on Windows 8.1
|
||||
/*
|
||||
|
|
@ -154,7 +153,7 @@ function parseXML(sXML, sXMLFile, idMachine, sStateFile, fResolve, display, done
|
|||
}
|
||||
xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
|
||||
xmlDoc.async = false;
|
||||
xmlDoc.loadXML(sXML);
|
||||
xmlDoc['loadXML'](sXML);
|
||||
} else {
|
||||
xmlDoc = (new window.DOMParser()).parseFromString(sXML, "text/xml");
|
||||
}
|
||||
|
|
@ -390,7 +389,7 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile
|
|||
displayError("failed to load XML file: " + sXMLFile);
|
||||
}
|
||||
};
|
||||
if (sXMLFile.substr(0, 1) != "<") {
|
||||
if (sXMLFile.charAt(0) != '<') {
|
||||
loadXML(sXMLFile, idElement, sStateFile, true, displayMessage, loadXSL);
|
||||
} else {
|
||||
parseXML(sXMLFile, null, idElement, sStateFile, false, displayMessage, loadXSL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue