Added title support
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1274
This commit is contained in:
parent
e088330dea
commit
d079c8388a
3 changed files with 25 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cpu.cpp,v 1.33 2003-09-29 21:05:59 qbix79 Exp $ */
|
||||
|
||||
#include <assert.h>
|
||||
#include "dosbox.h"
|
||||
|
@ -828,12 +829,14 @@ void CPU_HLT(void) {
|
|||
}
|
||||
|
||||
|
||||
extern void GFX_SetTitle(Bits cycles ,Bits frameskip);
|
||||
static void CPU_CycleIncrease(void) {
|
||||
Bits old_cycles=CPU_CycleMax;
|
||||
CPU_CycleMax=(Bits)(CPU_CycleMax*1.2);
|
||||
CPU_CycleLeft=0;CPU_Cycles=0;
|
||||
if (CPU_CycleMax==old_cycles) CPU_CycleMax++;
|
||||
LOG_MSG("CPU:%d cycles",CPU_CycleMax);
|
||||
GFX_SetTitle(CPU_CycleMax,-1);
|
||||
}
|
||||
|
||||
static void CPU_CycleDecrease(void) {
|
||||
|
@ -841,6 +844,7 @@ static void CPU_CycleDecrease(void) {
|
|||
CPU_CycleLeft=0;CPU_Cycles=0;
|
||||
if (!CPU_CycleMax) CPU_CycleMax=1;
|
||||
LOG_MSG("CPU:%d cycles",CPU_CycleMax);
|
||||
GFX_SetTitle(CPU_CycleMax,-1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -881,7 +885,7 @@ void CPU_Init(Section* sec) {
|
|||
CPU_CycleMax=section->Get_int("cycles");;
|
||||
if (!CPU_CycleMax) CPU_CycleMax=1500;
|
||||
CPU_CycleLeft=0;
|
||||
|
||||
GFX_SetTitle(CPU_CycleMax,-1);
|
||||
MSG_Add("CPU_CONFIGFILE_HELP","The amount of cycles to execute each loop. Lowering this setting will slowdown dosbox\n");
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: render.cpp,v 1.16 2003-09-29 21:05:05 qbix79 Exp $ */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
|
@ -357,14 +359,17 @@ normalop:
|
|||
GFX_Start();
|
||||
}
|
||||
|
||||
extern void GFX_SetTitle(Bits cycles, Bits frameskip);
|
||||
static void IncreaseFrameSkip(void) {
|
||||
if (render.frameskip.max<10) render.frameskip.max++;
|
||||
LOG_MSG("Frame Skip at %d",render.frameskip.max);
|
||||
GFX_SetTitle(-1,render.frameskip.max);
|
||||
}
|
||||
|
||||
static void DecreaseFrameSkip(void) {
|
||||
if (render.frameskip.max>0) render.frameskip.max--;
|
||||
LOG_MSG("Frame Skip at %d",render.frameskip.max);
|
||||
GFX_SetTitle(-1,render.frameskip.max);
|
||||
}
|
||||
|
||||
void RENDER_Init(Section * sec) {
|
||||
|
@ -394,5 +399,6 @@ void RENDER_Init(Section * sec) {
|
|||
}
|
||||
KEYBOARD_AddEvent(KBD_f7,KBD_MOD_CTRL,DecreaseFrameSkip);
|
||||
KEYBOARD_AddEvent(KBD_f8,KBD_MOD_CTRL,IncreaseFrameSkip);
|
||||
GFX_SetTitle(-1,render.frameskip.max);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: sdlmain.cpp,v 1.43 2003-09-29 21:04:31 qbix79 Exp $ */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
@ -78,6 +81,16 @@ struct SDL_Block {
|
|||
static SDL_Block sdl;
|
||||
static void CaptureMouse(void);
|
||||
|
||||
void GFX_SetTitle(Bits cycles,Bits frameskip){
|
||||
char title[200]={0};
|
||||
static internal_cycles=0;
|
||||
static internal_frameskip=0;
|
||||
if(cycles != -1) internal_cycles = cycles;
|
||||
if(frameskip != -1) internal_frameskip = frameskip;
|
||||
sprintf(title,"Cpu Cycles: %8d, Frameskip %2d",internal_cycles,internal_frameskip);
|
||||
SDL_WM_SetCaption(title,VERSION);
|
||||
}
|
||||
|
||||
/* Reset the screen with current values in the sdl structure */
|
||||
static void ResetScreen(void) {
|
||||
GFX_Stop();
|
||||
|
@ -102,7 +115,7 @@ static void ResetScreen(void) {
|
|||
);
|
||||
|
||||
|
||||
SDL_WM_SetCaption(VERSION,VERSION);
|
||||
GFX_SetTitle(-1,-1);
|
||||
|
||||
Bitu flags=MODE_SET;
|
||||
if (sdl.full_screen) flags|=MODE_FULLSCREEN;
|
||||
|
|
Loading…
Add table
Reference in a new issue