frame adv - skip lag feature implemented
This commit is contained in:
parent
7ce23d6b38
commit
7d03ee4fc9
|
@ -1,5 +1,7 @@
|
|||
---version 2.0.2 released---
|
||||
|
||||
07-aug-2008 - adelikat - new toggle - frame adv. - lag skip (menu item + hotkey mapping + saved in config)
|
||||
07-aug-2008 - adelikat - put in -32000 protection on all dialogs that remember x,y
|
||||
06-aug-2008 - adelikat - change config filename from fceu98.cfg to fceux.cfg
|
||||
06-aug-2008 - zeromus - add lagcounter and lagflag to savestate
|
||||
06-aug-2008 - zeromus - SF case 2040448 (View Slots bug - does not include new savestate naming)
|
||||
|
|
|
@ -41,6 +41,7 @@ extern int EnableAutosave;
|
|||
extern int AFon, AFoff, AutoFireOffset;
|
||||
extern int DesynchAutoFire;
|
||||
extern bool lagCounterDisplay;
|
||||
extern bool frameAdvanceLagSkip;
|
||||
|
||||
extern uint8 gNoBGFillColor;
|
||||
|
||||
|
@ -156,6 +157,7 @@ static CFGSTRUCT fceuconfig[] = {
|
|||
AC(MemWatchLoadOnStart),
|
||||
AC(MemWatchLoadFileOnStart),
|
||||
AC(EnableAutosave),
|
||||
AC(frameAdvanceLagSkip),
|
||||
|
||||
AC(allowUDLR),
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ BEGIN
|
|||
MENUITEM "Enable Run in Background", MENU_RUN_IN_BACKGROUND
|
||||
MENUITEM "Enable Background Input", MENU_BACKGROUND_INPUT
|
||||
MENUITEM "Enable Auto-save", MENU_ENABLE_AUTOSAVE
|
||||
MENUITEM "Frame Adv. - Skip Lag", MENU_DISPLAY_FA_LAGSKIP
|
||||
POPUP "Display"
|
||||
BEGIN
|
||||
MENUITEM "Movie Status Icon", MENU_SHOW_STATUS_ICON
|
||||
|
|
|
@ -515,6 +515,8 @@
|
|||
#define FCEU_DISPLAY_LAGCOUNTER 40235
|
||||
#define MENU_DISPLAY_INPUTDISPLAY 40236
|
||||
#define MENU_DISPLAY_LAGCOUNTER 40237
|
||||
#define ID_DISPLAY_FRAMEADV 40238
|
||||
#define MENU_DISPLAY_FA_LAGSKIP 40239
|
||||
#define IDC_DEBUGGER_ICONTRAY 55535
|
||||
#define MW_ValueLabel2 65423
|
||||
#define MW_ValueLabel1 65426
|
||||
|
@ -524,7 +526,7 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 124
|
||||
#define _APS_NEXT_COMMAND_VALUE 40238
|
||||
#define _APS_NEXT_COMMAND_VALUE 40240
|
||||
#define _APS_NEXT_CONTROL_VALUE 1179
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
|
||||
extern FCEUGI *GameInfo;
|
||||
extern int EnableAutosave;
|
||||
extern bool frameAdvanceLagSkip;
|
||||
|
||||
// Extern functions
|
||||
|
||||
|
@ -299,6 +300,7 @@ void UpdateCheckedMenuItems()
|
|||
{
|
||||
CheckMenuItem(fceumenu, polo2[x], *polo[x] ? MF_CHECKED : MF_UNCHECKED);
|
||||
}
|
||||
CheckMenuItem(fceumenu, MENU_DISPLAY_FA_LAGSKIP, frameAdvanceLagSkip?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(fceumenu, MENU_DISPLAY_LAGCOUNTER, lagCounterDisplay?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(fceumenu, MENU_DISPLAY_BG, bg?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(fceumenu, MENU_DISPLAY_OBJ, spr?MF_CHECKED:MF_UNCHECKED);
|
||||
|
@ -1178,6 +1180,9 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
|
|||
case MENU_DISPLAY_LAGCOUNTER:
|
||||
lagCounterDisplay ^= 1;
|
||||
UpdateCheckedMenuItems();
|
||||
case MENU_DISPLAY_FA_LAGSKIP:
|
||||
frameAdvanceLagSkip ^= 1;
|
||||
UpdateCheckedMenuItems();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
43
src/fceu.cpp
43
src/fceu.cpp
|
@ -61,6 +61,8 @@
|
|||
|
||||
int AFon = 1, AFoff = 1, AutoFireOffset = 0; //For keeping track of autofire settings
|
||||
bool justLagged = false;
|
||||
bool frameAdvanceLagSkip = false; //If this is true, frame advance will skip over lag frame (i.e. it will emulate 2 frames instead of 1)
|
||||
//TODO: SDL version - hotkey item only, but no default mapping
|
||||
FCEUGI::FCEUGI()
|
||||
: filename(0)
|
||||
, archiveFilename(0)
|
||||
|
@ -576,21 +578,34 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
|
|||
*SoundBuf=WaveFinal;
|
||||
*SoundBufSize=ssize;
|
||||
|
||||
//if we were asked to frame advance, then since we have just finished
|
||||
//a frame, we should switch to regular pause
|
||||
if(EmulationPaused&2)
|
||||
{
|
||||
EmulationPaused = 1; // restore paused flag
|
||||
|
||||
//mute the frame advance if the user requested it
|
||||
#ifdef WIN32
|
||||
if(soundoptions&SO_MUTEFA)
|
||||
*SoundBufSize=0; // keep sound muted
|
||||
#endif
|
||||
|
||||
JustFrameAdvanced = true;
|
||||
//if we were asked to frame advance, then since we have just finished a frame, we should switch to regular pause
|
||||
if (frameAdvanceLagSkip)
|
||||
{ //Holy nested loops Batman!
|
||||
if (!lagFlag)
|
||||
{
|
||||
if(EmulationPaused&2)
|
||||
{
|
||||
EmulationPaused = 1; // restore paused flag
|
||||
#ifdef WIN32
|
||||
if(soundoptions&SO_MUTEFA) //mute the frame advance if the user requested it
|
||||
*SoundBufSize=0; // keep sound muted
|
||||
#endif
|
||||
JustFrameAdvanced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(EmulationPaused&2)
|
||||
{
|
||||
EmulationPaused = 1; // restore paused flag
|
||||
#ifdef WIN32
|
||||
if(soundoptions&SO_MUTEFA) //mute the frame advance if the user requested it
|
||||
*SoundBufSize=0; // keep sound muted
|
||||
#endif
|
||||
JustFrameAdvanced = true;
|
||||
}
|
||||
} //I apologize to anyone who comes in and tries to fgiure this if branching out
|
||||
currMovieData.TryDumpIncremental();
|
||||
if (lagFlag)
|
||||
{
|
||||
|
|
|
@ -75,6 +75,7 @@ extern INPUTCFC *FCEU_InitBarcodeWorld(void);
|
|||
unsigned int lagCounter;
|
||||
bool lagCounterDisplay;
|
||||
char lagFlag;
|
||||
extern bool frameAdvanceLagSkip;
|
||||
//-------------
|
||||
|
||||
static uint8 joy_readbit[2];
|
||||
|
@ -584,6 +585,7 @@ static void LaunchPPU(void);
|
|||
static void LaunchHex(void);
|
||||
static void LaunchTraceLogger(void);
|
||||
static void LaunchCodeDataLogger(void);
|
||||
static void FA_SkipLag(void);
|
||||
|
||||
struct EMUCMDTABLE FCEUI_CommandTable[]=
|
||||
{
|
||||
|
@ -721,7 +723,8 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
|
|||
{ EMUCMD_TOOL_OPENHEX, EMUCMDTYPE_TOOL, LaunchHex, 0, 0, "Open Hex Editor", 0},
|
||||
{ EMUCMD_TOOL_OPENPPU, EMUCMDTYPE_TOOL, LaunchPPU, 0, 0, "Open PPU Viewer", 0},
|
||||
{ EMUCMD_TOOL_OPENTRACELOGGER, EMUCMDTYPE_TOOL, LaunchTraceLogger, 0, 0, "Open Trace Logger", 0},
|
||||
{ EMUCMD_TOOL_OPENCDLOGGER, EMUCMDTYPE_TOOL, LaunchCodeDataLogger, 0, 0, "Open Code/Data Logger", 0}
|
||||
{ EMUCMD_TOOL_OPENCDLOGGER, EMUCMDTYPE_TOOL, LaunchCodeDataLogger, 0, 0, "Open Code/Data Logger", 0},
|
||||
{ EMUCMD_FRAMEADV_SKIPLAG, EMUCMDTYPE_MISC, FA_SkipLag, 0, 0, "Frame Adv.-Skip Lag", 0}
|
||||
};
|
||||
|
||||
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
|
||||
|
@ -906,3 +909,7 @@ static void LaunchCodeDataLogger(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void FA_SkipLag(void)
|
||||
{
|
||||
frameAdvanceLagSkip ^= 1;
|
||||
}
|
|
@ -236,6 +236,7 @@ enum EMUCMD
|
|||
EMUCMD_TOOL_OPENPPU,
|
||||
EMUCMD_TOOL_OPENTRACELOGGER,
|
||||
EMUCMD_TOOL_OPENCDLOGGER,
|
||||
EMUCMD_FRAMEADV_SKIPLAG,
|
||||
|
||||
EMUCMD_MAX
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue