Now that PCjs supports specific steppings, set the reset revision number accordingly

This commit is contained in:
Jeff Parsons 2015-10-30 08:29:08 -07:00
commit 4403f90b5d
3 changed files with 51 additions and 5 deletions

View file

@ -46,10 +46,15 @@ var X86 = {
/*
* 80386 CPU stepping identifiers (supported)
*/
STEPPING_80386_A0: (80386+0xA0),
STEPPING_80386_B0: (80386+0xB0), // for now, the only B0 difference is support for XBTS
STEPPING_80386_B1: (80386+0xB1), // our version of the B1 stepping also includes the infamous 32-bit multiplication bug
STEPPING_80386_A0: (80386+0xA0), // we have very little information about this stepping...
STEPPING_80386_A1: (80386+0xA1), // we know much more about the A1 stepping (see /blog/2015/02/23/README.md)
STEPPING_80386_B0: (80386+0xB0), // for now, the only B0 difference in PCjs is support for XBTS and IBTS
STEPPING_80386_B1: (80386+0xB1), // our implementation of the B1 stepping also includes the infamous 32-bit multiplication bug
STEPPING_80386_B2: (80386+0xB2), // this is an imaginary stepping that simply means "B1 without the 32-bit multiplication bug" (ie, a B1 with the "double sigma" stamp)
STEPPING_80386_C0: (80386+0xC0), // this presumably fixed lots of B1 issues, but it seems to have been quickly superseded by the D0
STEPPING_80386_D0: (80386+0xD0), // we don't have any detailed information (eg, errata) for these later steppings
STEPPING_80386_D1: (80386+0xD1),
STEPPING_80386_D2: (80386+0xD2),
/*
* This constant is used to mark points in the code where the physical address being returned

View file

@ -1064,7 +1064,26 @@ X86CPU.prototype.resetRegs = function()
this.setSS(0);
if (I386 && this.model >= X86.MODEL_80386) {
this.regEDX = 0x0304; // Intel errata sheets indicate this is what an 80386-C0 reported
/*
* Here lies everything I currently know about 80386 stepping revision numbers...
*/
switch(this.stepping) {
case X86.STEPPING_80386_B0:
case X86.STEPPING_80386_B1:
this.regEDX = 0x0303;
break;
case X86.STEPPING_80386_C0:
this.regEDX = 0x0304;
break;
case X86.STEPPING_80386_D0:
this.regEDX = 0x0305;
break;
case X86.STEPPING_80386_D1:
case X86.STEPPING_80386_D2:
default:
this.regEDX = 0x0308; // in the absence of a specific stepping, default to the highest known revision
break;
}
this.regCR0 = X86.CR0.ET; // formerly MSW
this.regCR1 = 0; // reserved
this.regCR2 = 0; // page fault linear address (PFLA)