Fixed inspections
This commit is contained in:
parent
6360fda120
commit
66456ecf54
6 changed files with 38 additions and 46 deletions
|
|
@ -39,7 +39,6 @@ if (NODE) {
|
|||
var Memory = require("./memory");
|
||||
var Messages = require("./messages");
|
||||
var State = require("./state");
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -768,7 +767,7 @@ Bus.prototype.getLong = function(addr)
|
|||
* @this {Bus}
|
||||
* @param {number} addr is a physical address
|
||||
* @return {number} long (32-bit) value at that address
|
||||
*/
|
||||
*
|
||||
Bus.prototype.getLongDirect = function(addr)
|
||||
{
|
||||
var off = addr & this.nBlockLimit;
|
||||
|
|
@ -776,12 +775,12 @@ Bus.prototype.getLongDirect = function(addr)
|
|||
if (off < this.nBlockLimit - 2) {
|
||||
return this.aMemBlocks[iBlock].readLongDirect(off, addr);
|
||||
}
|
||||
/*
|
||||
* I think the previous version of this function tried to be too clever (ie, reading the last
|
||||
* long in the current block and the first long in the next block and masking/combining the results),
|
||||
* which may have also created some undesirable side-effects for custom memory controllers.
|
||||
* This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
||||
*/
|
||||
//
|
||||
// I think the previous version of this function tried to be too clever (ie, reading the last
|
||||
// long in the current block and the first long in the next block and masking/combining the results),
|
||||
// which may have also created some undesirable side-effects for custom memory controllers.
|
||||
// This simpler (and probably more reliable) approach is to simply read the long as individual bytes.
|
||||
//
|
||||
var l = 0;
|
||||
var cb = 4, nShift = 0;
|
||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||
|
|
@ -795,6 +794,7 @@ Bus.prototype.getLongDirect = function(addr)
|
|||
}
|
||||
return l;
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* setByte(addr, b)
|
||||
|
|
@ -912,7 +912,7 @@ Bus.prototype.setLong = function(addr, l)
|
|||
* @this {Bus}
|
||||
* @param {number} addr is a physical address
|
||||
* @param {number} l is the long (32-bit) value to write
|
||||
*/
|
||||
*
|
||||
Bus.prototype.setLongDirect = function(addr, l)
|
||||
{
|
||||
var off = addr & this.nBlockLimit;
|
||||
|
|
@ -921,12 +921,12 @@ Bus.prototype.setLongDirect = function(addr, l)
|
|||
this.aMemBlocks[iBlock].writeLongDirect(off, l, addr);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* I think the previous version of this function tried to be too clever (ie, reading and rewriting
|
||||
* the last long in the current block, and then reading and rewriting the first long in the next
|
||||
* block), which may have also created some undesirable side-effects for custom memory controllers.
|
||||
* This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
||||
*/
|
||||
//
|
||||
// I think the previous version of this function tried to be too clever (ie, reading and rewriting
|
||||
// the last long in the current block, and then reading and rewriting the first long in the next
|
||||
// block), which may have also created some undesirable side-effects for custom memory controllers.
|
||||
// This simpler (and probably more reliable) approach is to simply write the long as individual bytes.
|
||||
//
|
||||
var cb = 4;
|
||||
var cbBlock = 4 - (off & 0x3); // (off & 0x3) will be 1, 2 or 3, so cbBlock will be 3, 2, or 1
|
||||
while (cb--) {
|
||||
|
|
@ -938,6 +938,7 @@ Bus.prototype.setLongDirect = function(addr, l)
|
|||
l >>>= 8;
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* addBackTrackObject(obj, bto, off)
|
||||
|
|
@ -1207,11 +1208,12 @@ Bus.prototype.getBackTrackObject = function(bti)
|
|||
* @this {Bus}
|
||||
* @param {number} addr
|
||||
* @return {Object|null}
|
||||
*/
|
||||
*
|
||||
Bus.prototype.getBackTrackObjectFromAddr = function(addr)
|
||||
{
|
||||
return BACKTRACK? this.getBackTrackObject(this.readBackTrack(addr)) : null;
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* getBackTrackInfo(bti, fSymbol, fNearest)
|
||||
|
|
@ -1247,11 +1249,12 @@ Bus.prototype.getBackTrackInfo = function(bti, fSymbol, fNearest)
|
|||
* @this {Bus}
|
||||
* @param {number} addr
|
||||
* @return {string|null}
|
||||
*/
|
||||
*
|
||||
Bus.prototype.getBackTrackInfoFromAddr = function(addr)
|
||||
{
|
||||
return BACKTRACK? this.getBackTrackInfo(this.readBackTrack(addr)) : null;
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* getSymbol(addr, fNearest)
|
||||
|
|
|
|||
|
|
@ -2830,7 +2830,7 @@ ChipSet.prototype.outDMAPageSpare = function(iSpare, port, bOut, addrFrom)
|
|||
* Called by the CPU whenever INTR.DMA is set.
|
||||
*
|
||||
* @return {boolean} true if one or more async DMA channels are still active (unmasked), false to reset INTR.DMA
|
||||
*/
|
||||
*
|
||||
ChipSet.prototype.checkDMA = function()
|
||||
{
|
||||
var fActive = false;
|
||||
|
|
@ -2846,6 +2846,7 @@ ChipSet.prototype.checkDMA = function()
|
|||
}
|
||||
return fActive;
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* connectDMA(iDMAChannel, component, sFunction, obj)
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@
|
|||
/*
|
||||
* BUILD INSTRUCTIONS
|
||||
*
|
||||
* To build PCjs (pc.js), run Google's Closure Compiler, replacing "*.js" with
|
||||
* the input file sequence defined by the "pcJSFiles" property in package.json:
|
||||
* To build PCjs (pc.js), run Google's Closure Compiler, replacing "*.js" with the input file sequence defined
|
||||
* by the "pcJSFiles" property in package.json:
|
||||
*
|
||||
* java -jar compiler.jar
|
||||
* --compilation_level ADVANCED_OPTIMIZATIONS
|
||||
|
|
@ -43,23 +43,19 @@
|
|||
* --js *.js
|
||||
* --js_output_file pc.js
|
||||
*
|
||||
* Google's Closure Compiler (compiler.jar) is documented at
|
||||
* https://developers.google.com/closure/compiler/ and is available
|
||||
* for download here:
|
||||
* Google's Closure Compiler (compiler.jar) is documented at https://developers.google.com/closure/compiler/
|
||||
* and is available for download here:
|
||||
*
|
||||
* http://closure-compiler.googlecode.com/files/compiler-latest.zip
|
||||
*
|
||||
* The PCjs JavaScript files do have some initialization-order dependencies.
|
||||
* If you load the files individually, it's recommended that you load them in
|
||||
* the same order that they're compiled.
|
||||
* The PCjs JavaScript files do have some initialization-order dependencies. If you load the files individually,
|
||||
* it's recommended that you load them in the same order that they're compiled.
|
||||
*
|
||||
* Generally speaking, component.js should be first, computer.js should be
|
||||
* last (of the files based on component.js), and panel.js should be listed
|
||||
* early so that the Control Panel is ready as soon as possible.
|
||||
* 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.
|
||||
*
|
||||
* Another recent ordering requirement is that rom.js must be loaded before
|
||||
* ram.js; this was true before, but now it's required, because I'm starting
|
||||
* to add ROM BIOS Data Area definitions to rom.js, and since the data area
|
||||
* Another recent ordering requirement is that rom.js must be loaded before ram.js; this was true before, but now
|
||||
* it's required, because I'm starting to add ROM BIOS Data Area definitions to rom.js, and since the data area
|
||||
* is in RAM, ram.js may want access to some of those definitions.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ CPU.prototype.setBurstCycles = function(nCycles)
|
|||
* TODO: If the delta is negative, we could simply ignore the request, but we must first carefully
|
||||
* consider the impact on the ChipSet timers.
|
||||
*/
|
||||
if (DEBUG) this.nSnapCycles -= nDelta;
|
||||
// if (DEBUG) this.nSnapCycles -= nDelta;
|
||||
this.nStepCycles -= nDelta;
|
||||
this.nBurstCycles -= nDelta;
|
||||
return true;
|
||||
|
|
@ -1160,7 +1160,7 @@ CPU.prototype.yieldCPU = function()
|
|||
this.aCounts.nCyclesNextYield = 0; // this will break us out of runCPU(), once we break out of stepCPU()
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0; // this will break us out of stepCPU()
|
||||
if (DEBUG) this.nSnapCycles = this.nBurstCycles;
|
||||
// if (DEBUG) this.nSnapCycles = this.nBurstCycles;
|
||||
/*
|
||||
* The Debugger calls yieldCPU() after every message() to ensure browser responsiveness, but it looks
|
||||
* odd for those messages to show CPU state changes but for the CPU's own status display to not (ditto
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ if (DEBUGGER) {
|
|||
var Component = require("../../shared/lib/component");
|
||||
var Interrupts = require("./interrupts");
|
||||
var Messages = require("./messages");
|
||||
var Bus = require("./bus");
|
||||
var Memory = require("./memory");
|
||||
var Keyboard = require("./keyboard");
|
||||
var State = require("./state");
|
||||
|
|
@ -124,7 +123,6 @@ function Debugger(parmsDbg)
|
|||
* updated by initBus().
|
||||
*/
|
||||
this.cchReg = 4;
|
||||
this.maskReg = 0xffff;
|
||||
this.cchAddr = 5;
|
||||
this.maskAddr = 0xfffff;
|
||||
|
||||
|
|
@ -1464,10 +1462,7 @@ if (DEBUGGER) {
|
|||
* pre-80286 CPUs. But at least I'm being up front about it.
|
||||
*/
|
||||
this.aaOpDescs[0x0F] = Debugger.aOpDesc0F;
|
||||
if (I386 && this.cpu.model >= X86.MODEL_80386) {
|
||||
this.cchReg = 8;
|
||||
this.maskReg = 0xffffffff|0;
|
||||
}
|
||||
if (I386 && this.cpu.model >= X86.MODEL_80386) this.cchReg = 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1857,7 +1852,6 @@ if (DEBUGGER) {
|
|||
*/
|
||||
Debugger.prototype.intWindowsDebuggerRM = function(addr)
|
||||
{
|
||||
var dbgAddr;
|
||||
var cpu = this.cpu;
|
||||
var AL = cpu.regEAX & 0xff;
|
||||
var AH = (cpu.regEAX >> 8) & 0xff;
|
||||
|
|
@ -2936,7 +2930,7 @@ if (DEBUGGER) {
|
|||
var blockPTE = bus.aMemBlocks[(addrPTE & bus.nBusMask) >>> bus.nBlockShift];
|
||||
var lPTE = blockPTE.readLong(offPTE);
|
||||
var addrPhys = (lPTE & X86.PTE.FRAME) + (addr & X86.LADDR.OFFSET);
|
||||
var blockPhys = bus.aMemBlocks[(addrPhys & bus.nBusMask) >>> bus.nBlockShift];
|
||||
//var blockPhys = bus.aMemBlocks[(addrPhys & bus.nBusMask) >>> bus.nBlockShift];
|
||||
/*
|
||||
* And here ends the code that is remarkably similar to mapPageBlock(), with fSuppress set.
|
||||
*/
|
||||
|
|
@ -6960,7 +6954,6 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.doMouse = function(sAction, sDelta)
|
||||
{
|
||||
if (this.mouse) {
|
||||
var xDelta = 0, yDelta = 0;
|
||||
var sign = 1;
|
||||
if (sDelta.charAt(0) == '-') {
|
||||
sign = -1;
|
||||
|
|
@ -7753,7 +7746,6 @@ if (DEBUGGER) {
|
|||
|
||||
while (cb > 0 && n--) {
|
||||
|
||||
var bOpcode = this.getByte(dbgAddr);
|
||||
var addr = dbgAddr.addr;
|
||||
var nSequence = (this.isBusy(false) || this.nStep)? this.nCycles : null;
|
||||
var sComment = (nSequence != null? "cycles" : null);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Messages = require("./messages");
|
||||
var Memory = require("./memory");
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -528,7 +527,7 @@ X86Seg.prototype.checkWriteDebugger = function checkWriteDebugger(off, cb)
|
|||
* @param {number} sel (protected-mode only)
|
||||
* @param {boolean} [fGDT] is true if sel must be in the GDT
|
||||
* @return {number} ACC field from descriptor, or X86.DESC.ACC.INVALID if error
|
||||
*/
|
||||
*
|
||||
X86Seg.prototype.loadAcc = function(sel, fGDT)
|
||||
{
|
||||
var addrDT;
|
||||
|
|
@ -551,6 +550,7 @@ X86Seg.prototype.loadAcc = function(sel, fGDT)
|
|||
X86.fnFault.call(cpu, X86.EXCEPTION.GP_FAULT, sel & X86.ERRCODE.SELMASK);
|
||||
return X86.DESC.ACC.INVALID;
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* loadDesc6(addrDesc, sel)
|
||||
|
|
|
|||
Loading…
Reference in a new issue