diff --git a/SConstruct b/SConstruct index aef2435f..f21bb292 100644 --- a/SConstruct +++ b/SConstruct @@ -15,6 +15,7 @@ opts.AddVariables( BoolVariable('FRAMESKIP', 'Enable frameskipping', 1), BoolVariable('OPENGL', 'Enable OpenGL support', 1), BoolVariable('LSB_FIRST', 'Least signficant byte first (non-PPC)', 1), + BoolVariable('SHOWFPS', 'Show the running frames per second.)', 0), # TODO: move this to runtime configuration option BoolVariable('DEBUG', 'Build with debugging symbols', 1), BoolVariable('LUA', 'Enable Lua support', 1), BoolVariable('NEWPPU', 'Enable new PPU core', 1), @@ -141,6 +142,9 @@ if env['DEBUG']: else: env.Append(CCFLAGS = ['-O2']) +if env['SHOWFPS']: + env.Append(CPPDEFINES=["SHOWFPS"]) + if env['PLATFORM'] != 'win32' and env['PLATFORM'] != 'cygwin' and env['CREATE_AVI']: env.Append(CPPDEFINES=["CREATE_AVI"]) else: diff --git a/changelog.txt b/changelog.txt index 481dc5ee..d15dd98d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,4 @@ - +10-Aug-2012 - prg - sdl: fix and enable SHOWFPS build option (TODO: make runtime option) 10-Aug-2012 - AnS - Debugger: "Address Bookmark Add" field follows disassembly window scrolling position 08-Aug-2012 - AnS - Taseditor: frame counter display is auto-on when Taseditor launches 08-Aug-2012 - AnS - Debugger: improved stack display diff --git a/src/video.cpp b/src/video.cpp index e5329255..0cf0df34 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -760,7 +760,7 @@ void ShowFPS(void) boop[boopcount] = FCEUD_GetTime(); sprintf(fpsmsg, "%8.1f",(double)booplimit / ((double)da / FCEUD_GetTimeFreq())); - DrawTextTrans(ClipSidesOffset+XBuf + (256-8-8*8) + (FSettings.FirstSLine+4)*256,256,fpsmsg,4); + DrawTextTrans(ClipSidesOffset+XBuf + (256-8-8*8) + (FSettings.FirstSLine+4)*256,256, (uint8*)fpsmsg ,4); // It's not averaging FPS over exactly 1 second, but it's close enough. boopcount = (boopcount + 1) % booplimit; }