win32 - added toggle for binding savestates to movies

This commit is contained in:
adelikat 2008-10-19 14:06:10 +00:00
parent de92a9a9ba
commit ed0a6e5753
7 changed files with 22 additions and 7 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.3 yet to be released---
19-oct-2008 - adelikat - winew - added a toggle for binding savestates to movies
18-oct-2008 - adelikat - Win32 - added -cfg (config file) command line argument
08-oct-2008 - zeromus - SF [ 2073105 ] Laptop Volume Control keys make FCEUX go crazy and crash
08-oct-2008 - zeromus - SF [ 2073113 ] Child windows inside debugging window get invalid sizes

View File

@ -33,6 +33,7 @@
#include "video.h"
#include "memwatch.h"
#include "fceu.h"
#include "file.h"
extern CFGSTRUCT NetplayConfig[];
extern CFGSTRUCT InputConfig[];
@ -200,6 +201,7 @@ static CFGSTRUCT fceuconfig[] = {
AC(AutoFireOffset),
AC(DesynchAutoFire),
AC(lagCounterDisplay),
AC(bindSavestate),
//ACS(memwLastfile[2048]),
ENDCFGSTRUCT

View File

@ -79,6 +79,7 @@ BEGIN
MENUITEM "Enable Background Input", MENU_BACKGROUND_INPUT
MENUITEM "Enable Auto-save", MENU_ENABLE_AUTOSAVE
MENUITEM "Frame Adv. - Skip Lag", MENU_DISPLAY_FA_LAGSKIP
MENUITEM "Bind savestates to movie", MENU_CONFIG_BINDSAVES
POPUP "Display"
BEGIN
MENUITEM "Movie Status Icon", MENU_SHOW_STATUS_ICON

View File

@ -536,6 +536,8 @@
#define MENU_INPUTDISPLAY_2 40252
#define MENU_INPUTDISPLAY_4 40253
#define ID_DISPLAY_FRAMECOUNTER 40254
#define ID_CONFIG_BINDSAVESTATESTOMOVIE 40255
#define MENU_CONFIG_BINDSAVES 40256
#define IDC_DEBUGGER_ICONTRAY 55535
#define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426
@ -545,7 +547,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 124
#define _APS_NEXT_COMMAND_VALUE 40255
#define _APS_NEXT_COMMAND_VALUE 40257
#define _APS_NEXT_CONTROL_VALUE 1181
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -59,6 +59,7 @@
#include "movie.h"
#include "fceulua.h"
#include "utils/xstring.h"
#include "file.h"
#include <fstream>
@ -300,6 +301,7 @@ void UpdateCheckedMenuItems()
{
CheckMenuItem(fceumenu, polo2[x], *polo[x] ? MF_CHECKED : MF_UNCHECKED);
}
CheckMenuItem(fceumenu, MENU_CONFIG_BINDSAVES, bindSavestate?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);
@ -1209,6 +1211,9 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case ID_FILE_STOPLUASCRIPT:
FCEU_LuaStop();
break;
case MENU_CONFIG_BINDSAVES:
bindSavestate ^= 1;
UpdateCheckedMenuItems();
case MENU_DISPLAY_LAGCOUNTER:
lagCounterDisplay ^= 1;
UpdateCheckedMenuItems();

View File

@ -48,7 +48,7 @@
using namespace std;
bool bindSavestate = true; //Toggle that determines if a savestate filename will include the movie filename
static std::string BaseDirectory;
static char FileExt[2048]; //Includes the . character, as in ".nes"
char FileBase[2048];
@ -600,15 +600,17 @@ std::string FCEU_MakeFName(int type, int id1, const char *cd1)
break;
case FCEUMKF_STATE:
{
mfnString = GetMfn();
if (bindSavestate) mfnString = GetMfn();
else mfnString = "";
if (mfnString.length() < 60) //This caps the movie filename length before adding it to the savestate filename.
mfn = mfnString.c_str(); //This helps prevent possible crashes from savestate filenames of excessive length.
else {
std::string mfnStringTemp = mfnString.substr(0,60);
mfn = mfnStringTemp.c_str(); //mfn is the movie filename
}
else
{
std::string mfnStringTemp = mfnString.substr(0,60);
mfn = mfnStringTemp.c_str(); //mfn is the movie filename
}

View File

@ -6,6 +6,8 @@
#include "types.h"
#include "utils/memorystream.h"
extern bool bindSavestate;
struct FCEUFILE {
//the stream you can use to access the data
std::iostream *stream;