Make cycles=auto look more beautiful ;)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2504
This commit is contained in:
parent
3656d0e599
commit
4ab4344906
2 changed files with 12 additions and 9 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cpu.cpp,v 1.77 2006-02-12 23:28:21 harekiet Exp $ */
|
||||
/* $Id: cpu.cpp,v 1.78 2006-02-14 13:04:01 qbix79 Exp $ */
|
||||
|
||||
#include <assert.h>
|
||||
#include "dosbox.h"
|
||||
|
@ -1877,7 +1877,7 @@ void CPU_ENTER(bool use32,Bitu bytes,Bitu level) {
|
|||
|
||||
extern void GFX_SetTitle(Bits cycles ,Bits frameskip,bool paused);
|
||||
static void CPU_CycleIncrease(bool pressed) {
|
||||
if (!pressed)
|
||||
if (!pressed || CPU_CycleAuto)
|
||||
return;
|
||||
Bits old_cycles=CPU_CycleMax;
|
||||
if(CPU_CycleUp < 100){
|
||||
|
@ -1893,7 +1893,7 @@ static void CPU_CycleIncrease(bool pressed) {
|
|||
}
|
||||
|
||||
static void CPU_CycleDecrease(bool pressed) {
|
||||
if (!pressed)
|
||||
if (!pressed || CPU_CycleAuto)
|
||||
return;
|
||||
if(CPU_CycleDown < 100){
|
||||
CPU_CycleMax = (Bits)(CPU_CycleMax / (1 + (float)CPU_CycleDown / 100.0));
|
||||
|
@ -1964,10 +1964,10 @@ public:
|
|||
CPU_Cycles=0;
|
||||
const char *cyclesLine = section->Get_string("cycles");
|
||||
if (!strcasecmp(cyclesLine,"auto")) {
|
||||
CPU_CycleMax=0;
|
||||
CPU_CycleMax=0;
|
||||
CPU_CycleAuto=true;
|
||||
} else {
|
||||
CPU_CycleMax=atoi(cyclesLine);
|
||||
CPU_CycleMax=atoi(cyclesLine);
|
||||
CPU_CycleAuto=false;
|
||||
}
|
||||
CPU_CycleUp=section->Get_int("cycleup");
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: sdlmain.cpp,v 1.105 2006-02-14 08:49:30 qbix79 Exp $ */
|
||||
/* $Id: sdlmain.cpp,v 1.106 2006-02-14 13:04:02 qbix79 Exp $ */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
@ -208,6 +208,7 @@ struct SDL_Block {
|
|||
static SDL_Block sdl;
|
||||
|
||||
extern char * RunningProgram;
|
||||
extern bool CPU_CycleAuto;
|
||||
//Globals for keyboard initialisation
|
||||
bool startup_state_numlock=false;
|
||||
bool startup_state_capslock=false;
|
||||
|
@ -217,10 +218,12 @@ void GFX_SetTitle(Bits cycles,Bits frameskip,bool paused){
|
|||
static Bits internal_frameskip=0;
|
||||
if(cycles != -1) internal_cycles = cycles;
|
||||
if(frameskip != -1) internal_frameskip = frameskip;
|
||||
if(paused)
|
||||
sprintf(title,"DOSBox %s,Cpu Cycles: %8d, Frameskip %2d, Program: %8s PAUSED",VERSION,internal_cycles,internal_frameskip,RunningProgram);
|
||||
if(CPU_CycleAuto)
|
||||
sprintf(title,"DOSBox %s,Cpu Cycles: auto, Frameskip %2d, Program: %8s",VERSION,internal_frameskip,RunningProgram);
|
||||
else
|
||||
sprintf(title,"DOSBox %s,Cpu Cycles: %8d, Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram);
|
||||
sprintf(title,"DOSBox %s,Cpu Cycles: %8d, Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram);
|
||||
|
||||
if(paused) strcat(title," PAUSED");
|
||||
SDL_WM_SetCaption(title,VERSION);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue