From 012d12d6913fc5ff50cd46a272f0d30a4bf495e0 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Wed, 7 Jan 2004 21:37:47 +0000 Subject: [PATCH] add option to select cpu core in config file Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1544 --- src/cpu/cpu.cpp | 23 +++++++++++++++++++---- src/dosbox.cpp | 6 ++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index 4a221399..6e5ea0b3 100644 --- a/src/cpu/cpu.cpp +++ b/src/cpu/cpu.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cpu.cpp,v 1.46 2004-01-01 12:26:08 harekiet Exp $ */ +/* $Id: cpu.cpp,v 1.47 2004-01-07 21:37:47 harekiet Exp $ */ #include #include "dosbox.h" @@ -26,6 +26,7 @@ #include "keyboard.h" #include "setup.h" #include "paging.h" +#include "support.h" Bitu DEBUG_EnableDebugger(void); @@ -1255,9 +1256,6 @@ void CPU_Init(Section* sec) { #if (C_DYNAMIC_X86) CPU_Core_Dyn_X86_Init(); #endif - cpudecoder=&startcpu_core; - - CPU_JMP(false,0,0); //Setup the first cpu core KEYBOARD_AddEvent(KBD_f11,KBD_MOD_CTRL,CPU_CycleDecrease); KEYBOARD_AddEvent(KBD_f12,KBD_MOD_CTRL,CPU_CycleIncrease); @@ -1266,6 +1264,23 @@ void CPU_Init(Section* sec) { CPU_CycleMax=section->Get_int("cycles");; CPU_CycleUp=section->Get_int("cycleup"); CPU_CycleDown=section->Get_int("cycledown"); + const char * core=section->Get_string("core"); + cpudecoder=&CPU_Core_Normal_Run; + if (!strcasecmp(core,"normal")) { + cpudecoder=&CPU_Core_Normal_Run; + } else if (!strcasecmp(core,"full")) { + cpudecoder=&CPU_Core_Full_Run; + } +#if (C_DYNAMIC_X86) + else if (!strcasecmp(core,"dynamic")) { + cpudecoder=&CPU_Core_Dyn_X86_Run; + } +#endif + else { + LOG_MSG("CPU:Unknown core type %s, switcing back to normal.",core); + } + CPU_JMP(false,0,0); //Setup the first cpu core + if (!CPU_CycleMax) CPU_CycleMax = 1800; if(!CPU_CycleUp) CPU_CycleUp = 500; if(!CPU_CycleDown) CPU_CycleDown = 20; diff --git a/src/dosbox.cpp b/src/dosbox.cpp index a518deb7..ea0d5053 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -221,10 +221,16 @@ void DOSBOX_Init(void) { ); secprop=control->AddSection_prop("cpu",&CPU_Init); + secprop->Add_string("core","normal"); secprop->Add_int("cycles",1800); secprop->Add_int("cycleup",500); secprop->Add_int("cycledown",20); MSG_Add("CPU_CONFIGFILE_HELP", + "core -- CPU Core used in emulation: normal,full" +#if (C_DYNAMIC_X86) + ",dynamic" +#endif + ".\n" "cycles -- Amount of instructions dosbox tries to emulate each millsecond.\n" " Setting this higher than your machine can handle is bad!\n" "cycleup -- Amount of cycles to increase/decrease with keycombo.\n"