Assorted changes after upgrading WebStorm and Node

This commit is contained in:
Jeff Parsons 2015-03-31 17:23:18 -07:00 committed by jeffpar
commit 8ac1219c13
7 changed files with 19 additions and 22 deletions

View file

@ -2075,7 +2075,7 @@ if (DEBUGGER) {
this.nCycles = 0;
this.cpu.setError(e.message || e);
}
} while (this.cpu.opFlags & X86.OPFLAG.PREFIXES);
} while (this.cpu.opFlags & X86.OPFLAG_PREFIXES);
/*
* Because we called cpu.stepCPU() and not cpu.runCPU(), we must nudge the cpu's update code,

View file

@ -411,25 +411,25 @@ X86.BACKTRACK = {
* "direct" designation; other processors must adjust these bits accordingly. The final
* adjusted value is stored in PS_DIRECT.
*/
X86.PS.DIRECT_8086 = (X86.PS.TF | X86.PS.IF | X86.PS.DF);
X86.PS_DIRECT_8086 = (X86.PS.TF | X86.PS.IF | X86.PS.DF);
/*
* These are the default "always set" PS bits for the 8086/8088; other processors must
* adjust these bits accordingly. The final adjusted value is stored in PS_SET.
*/
X86.PS.SET_8086 = (X86.PS.BIT1 | X86.PS.IOPL.MASK | X86.PS.NT | X86.PS.BIT15);
X86.PS_SET_8086 = (X86.PS.BIT1 | X86.PS.IOPL.MASK | X86.PS.NT | X86.PS.BIT15);
/*
* These PS arithmetic and logical flags may be "cached" across several result registers;
* whether or not they're currently cached depends on the RESULT bits in resultType.
*/
X86.PS.CACHED = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF | X86.PS.OF);
X86.PS_CACHED = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF | X86.PS.OF);
/*
* PS.SAHF is a subset of the arithmetic flags, and refers only to those flags that the
* PS_SAHF is a subset of the arithmetic flags, and refers only to those flags that the
* SAHF and LAHF "8080 legacy" opcodes affect.
*/
X86.PS.SAHF = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF);
X86.PS_SAHF = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF);
/*
* Before we zero opFlags, we first see if any of the following PREFIX bits were set. If any were set,
@ -437,6 +437,6 @@ X86.PS.SAHF = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF);
* instructions like LODS, MOVS, STOS, CMPS, etc, a way of determining which prefixes, if any, immediately
* preceded them.
*/
X86.OPFLAG.PREFIXES = (X86.OPFLAG.SEG | X86.OPFLAG.LOCK | X86.OPFLAG.REPZ | X86.OPFLAG.REPNZ | X86.OPFLAG.DATASIZE | X86.OPFLAG.ADDRSIZE);
X86.OPFLAG_PREFIXES = (X86.OPFLAG.SEG | X86.OPFLAG.LOCK | X86.OPFLAG.REPZ | X86.OPFLAG.REPNZ | X86.OPFLAG.DATASIZE | X86.OPFLAG.ADDRSIZE);
if (typeof module !== 'undefined') module.exports = X86;

View file

@ -42,9 +42,6 @@ if (typeof module !== 'undefined') {
var CPU = require("./cpu");
var X86 = require("./x86");
var X86Seg = require("./x86seg");
var X86Func = require("./x86func");
var X86OpXX = require("./x86opxx");
var X86Op0F = require("./x86op0f");
var X86ModB = require("./x86modb");
var X86ModW = require("./x86modw");
}
@ -712,8 +709,8 @@ X86CPU.prototype.setAddressMask = function(busMask)
*/
X86CPU.prototype.initProcessor = function()
{
this.PS_SET = X86.PS.SET_8086;
this.PS_DIRECT = X86.PS.DIRECT_8086;
this.PS_SET = X86.PS_SET_8086;
this.PS_DIRECT = X86.PS_DIRECT_8086;
this.OPFLAG_NOINTR_8086 = X86.OPFLAG.NOINTR;
this.nShiftCountMask = 0xff; // on an 8086/8088, all shift counts are used as-is
@ -2251,7 +2248,7 @@ X86CPU.prototype.setOF = function()
*/
X86CPU.prototype.getPS = function()
{
return (this.regPS & ~X86.PS.CACHED) | (this.getCF() | this.getPF() | this.getAF() | this.getZF() | this.getSF() | this.getOF());
return (this.regPS & ~X86.PS_CACHED) | (this.getCF() | this.getPF() | this.getAF() | this.getZF() | this.getSF() | this.getOF());
};
/**
@ -2324,7 +2321,7 @@ X86CPU.prototype.setPS = function(regPS, cpl)
}
this.resultType = X86.RESULT.BYTE;
this.regPS = (this.regPS & ~(this.PS_DIRECT|X86.PS.CACHED)) | (regPS & (this.PS_DIRECT|X86.PS.CACHED)) | this.PS_SET;
this.regPS = (this.regPS & ~(this.PS_DIRECT|X86.PS_CACHED)) | (regPS & (this.PS_DIRECT|X86.PS_CACHED)) | this.PS_SET;
if (this.regPS & X86.PS.TF) {
this.intFlags |= X86.INTFLAG.TRAP;
@ -3432,7 +3429,7 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
if (!nMinCycles && !this.messageEnabled(Messages.PIC)) this.opFlags |= X86.OPFLAG.NOINTR;
do {
var opPrefixes = this.opFlags & X86.OPFLAG.PREFIXES;
var opPrefixes = this.opFlags & X86.OPFLAG_PREFIXES;
if (opPrefixes) {
this.opPrefixes |= opPrefixes;
} else {
@ -3554,7 +3551,7 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
/*
* Make sure that every instruction is assessing a cycle cost, and that the cost is a net positive.
*/
if (this.aFlags.fComplete && this.nStepCycles >= this.nSnapCycles && !(this.opFlags & X86.OPFLAG.PREFIXES)) {
if (this.aFlags.fComplete && this.nStepCycles >= this.nSnapCycles && !(this.opFlags & X86.OPFLAG_PREFIXES)) {
this.println("cycle miscount: " + (this.nSnapCycles - this.nStepCycles));
this.setIP(this.opLIP - this.segCS.base);
this.stopCPU();

View file

@ -963,7 +963,7 @@ X86.fnIRET = function IRET()
if (this.regPS & X86.PS.NT) {
var addrNew = this.segTSS.base;
var sel = this.getShort(addrNew + X86.TSS.PREV_TSS);
X86Seg.switchTSS.call(this.segCS, sel, false);
this.segCS.switchTSS(sel, false);
return;
}
}

View file

@ -2559,7 +2559,7 @@ X86.opSAHF = function SAHF()
/*
* NOTE: While it make seem more efficient to do this:
*
* this.setPS((this.getPS() & ~X86.PS.SAHF) | ((this.regEAX >> 8) & X86.PS.SAHF));
* this.setPS((this.getPS() & ~X86.PS_SAHF) | ((this.regEAX >> 8) & X86.PS_SAHF));
*
* getPS() forces any "cached" flags to be resolved first, and setPS() must do extra work above
* and beyond setting the arithmetic and logical flags, so on balance, the code below may be more
@ -2572,7 +2572,7 @@ X86.opSAHF = function SAHF()
if (ah & X86.PS.ZF) this.setZF(); else this.clearZF();
if (ah & X86.PS.SF) this.setSF(); else this.clearSF();
this.nStepCycles -= this.CYCLES.nOpCyclesLAHF;
this.assert((this.getPS() & X86.PS.SAHF) == (ah & X86.PS.SAHF));
this.assert((this.getPS() & X86.PS_SAHF) == (ah & X86.PS_SAHF));
};
/**
@ -2582,7 +2582,7 @@ X86.opSAHF = function SAHF()
*/
X86.opLAHF = function LAHF()
{
this.regEAX = (this.regEAX & ~0xff00) | (this.getPS() & X86.PS.SAHF) << 8;
this.regEAX = (this.regEAX & ~0xff00) | (this.getPS() & X86.PS_SAHF) << 8;
this.nStepCycles -= this.CYCLES.nOpCyclesLAHF;
};

View file

@ -1,6 +1,6 @@
{
"name": "PCjs",
"version": "1.15.9",
"version": "1.17.5",
"description": "IBM PC Emulator",
"author": "Jeff Parsons <Jeff@pcjs.org>",
"licenses": [

View file

@ -107,7 +107,7 @@
"./modules/pcjs/lib/x86seg.js",
"./modules/pcjs/lib/x86cpu.js",
"./modules/pcjs/lib/x86func.js",
"./modules/pcjs/lib/x86opxx.js",
"./modules/pcjs/lib/x86ops.js",
"./modules/pcjs/lib/x86op0f.js",
"./modules/pcjs/lib/x86modb.js",
"./modules/pcjs/lib/x86modw.js",