Frame counter can now display when no movie is loaded. (If no movie, reset and power reset the counter to 0).

This commit is contained in:
adelikat 2008-11-11 22:58:29 +00:00
parent 3a8eb3ea3a
commit 0a5f20c034
3 changed files with 18 additions and 2 deletions

View File

@ -590,7 +590,6 @@ int main(int argc,char *argv[])
fullscreen = !!fullscreen; fullscreen = !!fullscreen;
soundo = !!soundo; soundo = !!soundo;
frame_display = !!frame_display; frame_display = !!frame_display;
//input_display = !!input_display; adelikat - input_display has 4 states, not 2, this shouldn't be done
allowUDLR = !!allowUDLR; allowUDLR = !!allowUDLR;
pauseAfterPlayback = !!pauseAfterPlayback; pauseAfterPlayback = !!pauseAfterPlayback;
EnableBackgroundInput = !!EnableBackgroundInput; EnableBackgroundInput = !!EnableBackgroundInput;

View File

@ -541,12 +541,21 @@ void FCEUI_VSUniCoin(void)
FCEU_QSimpleCommand(FCEUNPCMD_VSUNICOIN); FCEU_QSimpleCommand(FCEUNPCMD_VSUNICOIN);
} }
//Resets the frame counter if movie inactive and rom is reset or power-cycle
void ResetFrameCounter()
{
extern EMOVIEMODE movieMode;
if(movieMode == MOVIEMODE_INACTIVE)
currFrameCounter = 0;
}
//Resets the NES //Resets the NES
void FCEUI_ResetNES(void) void FCEUI_ResetNES(void)
{ {
if(!FCEU_IsValidUI(FCEUI_RESET)) if(!FCEU_IsValidUI(FCEUI_RESET))
return; return;
FCEU_QSimpleCommand(FCEUNPCMD_RESET); FCEU_QSimpleCommand(FCEUNPCMD_RESET);
ResetFrameCounter();
} }
//Powers off the NES //Powers off the NES
@ -555,6 +564,7 @@ void FCEUI_PowerNES(void)
if(!FCEU_IsValidUI(FCEUI_POWER)) if(!FCEU_IsValidUI(FCEUI_POWER))
return; return;
FCEU_QSimpleCommand(FCEUNPCMD_POWER); FCEU_QSimpleCommand(FCEUNPCMD_POWER);
ResetFrameCounter();
} }
const char* FCEUI_CommandTypeNames[]= const char* FCEUI_CommandTypeNames[]=

View File

@ -947,6 +947,13 @@ void FCEU_DrawMovies(uint8 *XBuf)
if(counterbuf[0]) if(counterbuf[0])
DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(24), 256, (uint8*)counterbuf, 0x20+0x80); DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(24), 256, (uint8*)counterbuf, 0x20+0x80);
} }
else
{
char counterbuf[32] = {0};
sprintf(counterbuf,"%d (no movie)",currFrameCounter);
if(counterbuf[0])
DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(24), 256, (uint8*)counterbuf, 0x20+0x80);
}
} }
void FCEU_DrawLagCounter(uint8 *XBuf) void FCEU_DrawLagCounter(uint8 *XBuf)