add automatic core selection;
switch back to default cycles/core on program exit Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2663
This commit is contained in:
parent
930207e209
commit
8dd057d52e
4 changed files with 58 additions and 19 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cpu.cpp,v 1.82 2006-06-25 18:49:32 c2woody Exp $ */
|
||||
/* $Id: cpu.cpp,v 1.83 2006-06-29 09:10:09 c2woody Exp $ */
|
||||
|
||||
#include <assert.h>
|
||||
#include "dosbox.h"
|
||||
|
@ -47,7 +47,7 @@ Bits CPU_CycleUp = 0;
|
|||
Bits CPU_CycleDown = 0;
|
||||
CPU_Decoder * cpudecoder;
|
||||
bool CPU_CycleAutoAdjust;
|
||||
bool CPU_AutoDetermineMode;
|
||||
Bitu CPU_AutoDetermineMode;
|
||||
|
||||
void CPU_Core_Full_Init(void);
|
||||
void CPU_Core_Normal_Init(void);
|
||||
|
@ -1441,17 +1441,21 @@ void CPU_SET_CRX(Bitu cr,Bitu value) {
|
|||
LOG(LOG_CPU,LOG_NORMAL)("Protected mode");
|
||||
PAGING_Enable((value & CR0_PAGING)>0);
|
||||
|
||||
if (!CPU_AutoDetermineMode) break;
|
||||
if (!(CPU_AutoDetermineMode&CPU_AUTODETERMINE_MASK)) break;
|
||||
|
||||
CPU_AutoDetermineMode=false;
|
||||
CPU_CycleAutoAdjust=true;
|
||||
CPU_CycleLeft=0;
|
||||
CPU_Cycles=0;
|
||||
CPU_CycleMax=0;
|
||||
/* #if (C_DYNAMIC_X86)
|
||||
CPU_Core_Dyn_X86_Cache_Init(true);
|
||||
cpudecoder=&CPU_Core_Dyn_X86_Run;
|
||||
#endif */
|
||||
if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CYCLES) {
|
||||
CPU_CycleAutoAdjust=true;
|
||||
CPU_CycleLeft=0;
|
||||
CPU_Cycles=0;
|
||||
CPU_CycleMax=0;
|
||||
}
|
||||
#if (C_DYNAMIC_X86)
|
||||
if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) {
|
||||
CPU_Core_Dyn_X86_Cache_Init(true);
|
||||
cpudecoder=&CPU_Core_Dyn_X86_Run;
|
||||
}
|
||||
#endif
|
||||
CPU_AutoDetermineMode<<=CPU_AUTODETERMINE_SHIFT;
|
||||
GFX_SetTitle(-1,-1,false);
|
||||
} else {
|
||||
cpu.pmode=false;
|
||||
|
@ -1989,16 +1993,20 @@ public:
|
|||
}
|
||||
bool Change_Config(Section* newconfig){
|
||||
Section_prop * section=static_cast<Section_prop *>(newconfig);
|
||||
CPU_AutoDetermineMode=CPU_AUTODETERMINE_NONE;
|
||||
CPU_CycleLeft=0;//needed ?
|
||||
CPU_Cycles=0;
|
||||
const char *cyclesLine = section->Get_string("cycles");
|
||||
CPU_AutoDetermineMode=false;
|
||||
if (!strcasecmp(cyclesLine,"max")) {
|
||||
CPU_CycleMax=0;
|
||||
CPU_CycleAutoAdjust=true;
|
||||
} else {
|
||||
if (!strcasecmp(cyclesLine,"auto")) CPU_AutoDetermineMode=true;
|
||||
CPU_CycleMax=atoi(cyclesLine);
|
||||
if (!strcasecmp(cyclesLine,"auto")) {
|
||||
CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CYCLES;
|
||||
CPU_CycleMax=3000;
|
||||
} else {
|
||||
CPU_CycleMax=atoi(cyclesLine);
|
||||
}
|
||||
CPU_CycleAutoAdjust=false;
|
||||
}
|
||||
CPU_CycleUp=section->Get_int("cycleup");
|
||||
|
@ -2015,6 +2023,9 @@ public:
|
|||
#if (C_DYNAMIC_X86)
|
||||
else if (!strcasecmp(core,"dynamic")) {
|
||||
cpudecoder=&CPU_Core_Dyn_X86_Run;
|
||||
} else if (!strcasecmp(core,"auto")) {
|
||||
cpudecoder=&CPU_Core_Normal_Run;
|
||||
CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CORE;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue