mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
Two patches applied.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -312,3 +312,7 @@ autom4te.cache/
|
||||
autom4te.cache/*
|
||||
.DS_Store
|
||||
windows-installer/DOSBox-X-setup-*.exe
|
||||
*.o
|
||||
*.a
|
||||
*.deps
|
||||
dosbox-x
|
||||
|
@@ -49,6 +49,7 @@
|
||||
#define CPU_ARCHTYPE_486NEW 0x45
|
||||
#define CPU_ARCHTYPE_PENTIUM 0x50
|
||||
#define CPU_ARCHTYPE_P55CSLOW 0x55
|
||||
#define CPU_ARCHTYPE_PPROSLOW 0x60
|
||||
|
||||
/* CPU Cycle Timing */
|
||||
extern Bit32s CPU_Cycles;
|
||||
|
@@ -260,6 +260,57 @@ bool CPU_WRMSR();
|
||||
reg_eax=(Bit32u)(tsc&0xffffffff);
|
||||
}
|
||||
break;
|
||||
|
||||
// Pentium Pro Conditional Moves
|
||||
CASE_0F_W(0x40) /* CMOVO */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_O); break;
|
||||
CASE_0F_W(0x41) /* CMOVNO */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NO); break;
|
||||
CASE_0F_W(0x42) /* CMOVB */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_B); break;
|
||||
CASE_0F_W(0x43) /* CMOVNB */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NB); break;
|
||||
CASE_0F_W(0x44) /* CMOVZ */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_Z); break;
|
||||
CASE_0F_W(0x45) /* CMOVNZ */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NZ); break;
|
||||
CASE_0F_W(0x46) /* CMOVBE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_BE); break;
|
||||
CASE_0F_W(0x47) /* CMOVNBE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NBE); break;
|
||||
CASE_0F_W(0x48) /* CMOVS */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_S); break;
|
||||
CASE_0F_W(0x49) /* CMOVNS */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NS); break;
|
||||
CASE_0F_W(0x4A) /* CMOVP */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_P); break;
|
||||
CASE_0F_W(0x4B) /* CMOVNP */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NP); break;
|
||||
CASE_0F_W(0x4C) /* CMOVL */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_L); break;
|
||||
CASE_0F_W(0x4D) /* CMOVNL */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NL); break;
|
||||
CASE_0F_W(0x4E) /* CMOVLE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_LE); break;
|
||||
CASE_0F_W(0x4F) /* CMOVNLE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond16(TFLG_NLE); break;
|
||||
|
||||
CASE_0F_B(0x32) /* RDMSR */
|
||||
{
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PENTIUM) goto illegal_opcode;
|
||||
|
@@ -144,6 +144,57 @@
|
||||
*rmrd=(Bit32u)limit;
|
||||
}
|
||||
break;
|
||||
|
||||
// Pentium Pro
|
||||
CASE_0F_D(0x40) /* CMOVO */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_O); break;
|
||||
CASE_0F_D(0x41) /* CMOVNO */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NO); break;
|
||||
CASE_0F_D(0x42) /* CMOVB */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_B); break;
|
||||
CASE_0F_D(0x43) /* CMOVNB */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NB); break;
|
||||
CASE_0F_D(0x44) /* CMOVZ */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_Z); break;
|
||||
CASE_0F_D(0x45) /* CMOVNZ */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NZ); break;
|
||||
CASE_0F_D(0x46) /* CMOVBE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_BE); break;
|
||||
CASE_0F_D(0x47) /* CMOVNBE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NBE); break;
|
||||
CASE_0F_D(0x48) /* CMOVS */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_S); break;
|
||||
CASE_0F_D(0x49) /* CMOVNS */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NS); break;
|
||||
CASE_0F_D(0x4A) /* CMOVP */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_P); break;
|
||||
CASE_0F_D(0x4B) /* CMOVNP */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NP); break;
|
||||
CASE_0F_D(0x4C) /* CMOVL */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_L); break;
|
||||
CASE_0F_D(0x4D) /* CMOVNL */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NL); break;
|
||||
CASE_0F_D(0x4E) /* CMOVLE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_LE); break;
|
||||
CASE_0F_D(0x4F) /* CMOVNLE */
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_PPROSLOW) goto illegal_opcode;
|
||||
MoveCond32(TFLG_NLE); break;
|
||||
|
||||
CASE_0F_D(0x80) /* JO */
|
||||
JumpCond32_d(TFLG_O);break;
|
||||
CASE_0F_D(0x81) /* JNO */
|
||||
|
@@ -84,6 +84,17 @@ static INLINE Bit32s Fetchds() {
|
||||
continue; \
|
||||
}
|
||||
|
||||
#define MoveCond16(COND) { \
|
||||
GetRMrw; \
|
||||
if (rm >= 0xc0 ) {GetEArw; if (COND) *rmrw=*earw;}\
|
||||
else {GetEAa; if (COND) *rmrw=LoadMw(eaa);} \
|
||||
}
|
||||
|
||||
#define MoveCond32(COND) { \
|
||||
GetRMrd; \
|
||||
if (rm >= 0xc0 ) {GetEArd; if (COND) *rmrd=*eard;}\
|
||||
else {GetEAa; if (COND) *rmrd=LoadMd(eaa);} \
|
||||
}
|
||||
|
||||
#define SETcc(cc) \
|
||||
{ \
|
||||
|
@@ -2495,7 +2495,7 @@ bool CPU_PopSeg(SegNames seg,bool use32) {
|
||||
extern bool enable_fpu;
|
||||
|
||||
bool CPU_CPUID(void) {
|
||||
if (CPU_ArchitectureType<CPU_ARCHTYPE_486NEW) return false;
|
||||
if (CPU_ArchitectureType < CPU_ARCHTYPE_486NEW) return false;
|
||||
switch (reg_eax) {
|
||||
case 0: /* Vendor ID String and maximum level? */
|
||||
reg_eax=1; /* Maximum level */
|
||||
@@ -2504,26 +2504,31 @@ bool CPU_CPUID(void) {
|
||||
reg_ecx='n' | ('t' << 8) | ('e' << 16) | ('l'<< 24);
|
||||
break;
|
||||
case 1: /* get processor type/family/model/stepping and feature flags */
|
||||
if ((CPU_ArchitectureType==CPU_ARCHTYPE_486NEW) ||
|
||||
(CPU_ArchitectureType==CPU_ARCHTYPE_MIXED)) {
|
||||
if ((CPU_ArchitectureType == CPU_ARCHTYPE_486NEW) ||
|
||||
(CPU_ArchitectureType == CPU_ARCHTYPE_MIXED)) {
|
||||
reg_eax=0x402; /* intel 486dx */
|
||||
reg_ebx=0; /* Not Supported */
|
||||
reg_ecx=0; /* No features */
|
||||
reg_edx=enable_fpu?1:0; /* FPU */
|
||||
} else if (CPU_ArchitectureType==CPU_ARCHTYPE_PENTIUM) {
|
||||
} else if (CPU_ArchitectureType == CPU_ARCHTYPE_PENTIUM) {
|
||||
reg_eax=0x513; /* intel pentium */
|
||||
reg_ebx=0; /* Not Supported */
|
||||
reg_ecx=0; /* No features */
|
||||
reg_edx=0x00000010|(enable_fpu?1:0); /* FPU+TimeStamp/RDTSC */
|
||||
if (enable_msr) reg_edx |= 0x20; /* ModelSpecific/MSR */
|
||||
if (enable_cmpxchg8b) reg_edx |= 0x100; /* CMPXCHG8B */
|
||||
} else if (CPU_ArchitectureType==CPU_ARCHTYPE_P55CSLOW) {
|
||||
} else if (CPU_ArchitectureType == CPU_ARCHTYPE_P55CSLOW) {
|
||||
reg_eax=0x543; /* intel pentium mmx (P55C) */
|
||||
reg_ebx=0; /* Not Supported */
|
||||
reg_ecx=0; /* No features */
|
||||
reg_edx=0x00800010|(enable_fpu?1:0); /* FPU+TimeStamp/RDTSC+MMX+ModelSpecific/MSR */
|
||||
if (enable_msr) reg_edx |= 0x20; /* ModelSpecific/MSR */
|
||||
if (enable_cmpxchg8b) reg_edx |= 0x100; /* CMPXCHG8B */
|
||||
} else if (CPU_ArchitectureType == CPU_ARCHTYPE_PPROSLOW) {
|
||||
reg_eax=0x612; /* intel pentium pro */
|
||||
reg_ebx=0; /* Not Supported */
|
||||
reg_ecx=0; /* No features */
|
||||
reg_edx=0x00008011; /* FPU+TimeStamp/RDTSC */
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -3041,6 +3046,8 @@ public:
|
||||
CPU_ArchitectureType = CPU_ARCHTYPE_PENTIUM;
|
||||
} else if (cputype == "pentium_mmx") {
|
||||
CPU_ArchitectureType = CPU_ARCHTYPE_P55CSLOW;
|
||||
} else if (cputype == "ppro_slow") {
|
||||
CPU_ArchitectureType = CPU_ARCHTYPE_PPROSLOW;
|
||||
}
|
||||
|
||||
/* WARNING */
|
||||
|
@@ -833,7 +833,7 @@ void DOSBOX_SetupConfigSections(void) {
|
||||
const char* blocksizes[] = {"1024", "2048", "4096", "8192", "512", "256", 0};
|
||||
const char* capturechromaformats[] = { "auto", "4:4:4", "4:2:2", "4:2:0", 0};
|
||||
const char* auxdevices[] = {"none","2button","3button","intellimouse","intellimouse45",0};
|
||||
const char* cputype_values[] = {"auto", "8086", "8086_prefetch", "80186", "80186_prefetch", "286", "286_prefetch", "386", "386_prefetch", "486", "pentium", "pentium_mmx", 0};
|
||||
const char* cputype_values[] = {"auto", "8086", "8086_prefetch", "80186", "80186_prefetch", "286", "286_prefetch", "386", "386_prefetch", "486", "pentium", "pentium_mmx", "ppro_slow", 0};
|
||||
const char* rates[] = { "44100", "48000", "32000","22050", "16000", "11025", "8000", "49716", 0 };
|
||||
const char* oplrates[] = { "44100", "49716", "48000", "32000","22050", "16000", "11025", "8000", 0 };
|
||||
const char* devices[] = { "default", "win32", "alsa", "oss", "coreaudio", "coremidi", "mt32", "synth", "timidity", "none", 0}; // FIXME: add some way to offer the actually available choices.
|
||||
|
Reference in New Issue
Block a user