From d4046475294fc49ed269842867d5e6df131b6f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Thu, 9 Aug 2007 19:52:33 +0000 Subject: [PATCH] enable core=auto switching for recompiling core as well Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2957 --- src/cpu/cpu.cpp | 12 ++++++++++-- src/dos/dos_execute.cpp | 4 ++-- src/dosbox.cpp | 14 +++++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index fd4e6d61..311e1d58 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.102 2007-06-12 20:22:07 c2woody Exp $ */ +/* $Id: cpu.cpp,v 1.103 2007-08-09 19:52:32 c2woody Exp $ */ #include #include @@ -1487,11 +1487,16 @@ void CPU_SET_CRX(Bitu cr,Bitu value) { } else { GFX_SetTitle(-1,-1,false); } - #if (C_DYNAMIC_X86) +#if (C_DYNAMIC_X86) if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) { CPU_Core_Dyn_X86_Cache_Init(true); cpudecoder=&CPU_Core_Dyn_X86_Run; } +#elif (C_DYNREC) + if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) { + CPU_Core_Dynrec_Cache_Init(true); + cpudecoder=&CPU_Core_Dynrec_Run; + } #endif CPU_AutoDetermineMode<<=CPU_AUTODETERMINE_SHIFT; } else { @@ -2183,6 +2188,9 @@ public: #elif (C_DYNREC) else if (!strcasecmp(core,"dynamic")) { cpudecoder=&CPU_Core_Dynrec_Run; + } else if (!strcasecmp(core,"auto")) { + cpudecoder=&CPU_Core_Normal_Run; + CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CORE; } #endif else { diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index 6d3ea569..7ceab107 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_execute.cpp,v 1.60 2007-01-11 16:31:10 c2woody Exp $ */ +/* $Id: dos_execute.cpp,v 1.61 2007-08-09 19:52:33 c2woody Exp $ */ #include #include @@ -151,7 +151,7 @@ bool DOS_Terminate(bool tsr) { } else { GFX_SetTitle(-1,-1,false); } -#if (C_DYNAMIC_X86) +#if (C_DYNAMIC_X86) || (C_DYNREC) if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) { cpudecoder=&CPU_Core_Normal_Run; CPU_CycleLeft=0; diff --git a/src/dosbox.cpp b/src/dosbox.cpp index b90f32cb..0395a6fe 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dosbox.cpp,v 1.119 2007-08-07 21:01:08 c2woody Exp $ */ +/* $Id: dosbox.cpp,v 1.120 2007-08-09 19:52:33 c2woody Exp $ */ #include #include @@ -299,7 +299,7 @@ void DOSBOX_Init(void) { MSG_Add("DOSBOX_CONFIGFILE_HELP", "language -- Select another language file.\n" - "memsize -- Amount of memory dosbox has in megabytes.\n" + "memsize -- Amount of memory DOSBox has in megabytes.\n" "machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.\n" "captures -- Directory where things like wave,midi,screenshot get captured.\n" ); @@ -309,7 +309,7 @@ void DOSBOX_Init(void) { secprop->Add_bool("aspect",false); secprop->Add_string("scaler","normal2x"); MSG_Add("RENDER_CONFIGFILE_HELP", - "frameskip -- How many frames dosbox skips before drawing one.\n" + "frameskip -- How many frames DOSBox skips before drawing one.\n" "aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n" "scaler -- Scaler used to enlarge/enhance low resolution modes.\n" " Supported are none,normal2x,normal3x,advmame2x,advmame3x,hq2x,hq3x,\n" @@ -320,7 +320,7 @@ void DOSBOX_Init(void) { ); secprop=control->AddSection_prop("cpu",&CPU_Init,true);//done -#if (C_DYNAMIC_X86) +#if (C_DYNAMIC_X86) || (C_DYNREC) secprop->Add_string("core","auto"); #else secprop->Add_string("core","normal"); @@ -330,12 +330,12 @@ void DOSBOX_Init(void) { secprop->Add_int("cycledown",20); MSG_Add("CPU_CONFIGFILE_HELP", "core -- CPU Core used in emulation: normal,simple" -#if (C_DYNAMIC_X86) +#if (C_DYNAMIC_X86) || (C_DYNREC) ",dynamic,auto.\n" " auto switches from normal to dynamic if appropriate" #endif ".\n" - "cycles -- Amount of instructions dosbox tries to emulate each millisecond.\n" + "cycles -- Amount of instructions DOSBox tries to emulate each millisecond.\n" " Setting this value too high results in sound dropouts and lags.\n" " You can also let DOSBox guess the correct value by setting it to max.\n" " The default setting (auto) switches to max if appropriate.\n" @@ -395,7 +395,7 @@ void DOSBOX_Init(void) { MSG_Add("SBLASTER_CONFIGFILE_HELP", "sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.\n" "sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.\n" - "mixer -- Allow the soundblaster mixer to modify the dosbox mixer.\n" + "mixer -- Allow the soundblaster mixer to modify the DOSBox mixer.\n" "oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.\n" " On auto the mode is determined by sblaster type.\n" " All OPL modes are 'Adlib', except for CMS.\n"