Autofire offset and alternate A and B remebered in config

This commit is contained in:
adelikat 2008-07-03 18:56:44 +00:00
parent eb0f6caf4d
commit b09d9b62a6
4 changed files with 18 additions and 3 deletions

View File

@ -57,7 +57,8 @@ extern int CDLogger_wndx, CDLogger_wndy;
extern int GGConv_wndx, GGConv_wndy;
extern int TasEdit_wndx, TasEdit_wndy;
extern int EnableAutosave;
extern int AFon, AFoff;
extern int AFon, AFoff, AutoFireOffset;
extern int DesynchAutoFire;
//Structure that contains configuration information
static CFGSTRUCT fceuconfig[] = {
@ -192,6 +193,8 @@ static CFGSTRUCT fceuconfig[] = {
AC(pauseAfterPlayback),
AC(AFon),
AC(AFoff),
AC(AutoFireOffset),
AC(DesynchAutoFire),
//ACS(memwLastfile[2048]),
ENDCFGSTRUCT

View File

@ -41,6 +41,7 @@ extern int pauseAfterPlayback;
extern int EnableBackgroundInput;
extern int AFon;
extern int AFoff;
extern int AutoFireOffset;
extern int vmod;

View File

@ -113,6 +113,7 @@ static uint32 mousex,mousey,mouseb;
static int vchanged = 0;
int GetCheckedAutoFirePattern();
int GetCheckedAutoFireOffset();
int GetCheckedAutoFirePattern()
{
@ -136,6 +137,16 @@ int GetCheckedAutoFirePattern()
return MENU_AUTOFIRE_PATTERN_1;
}
int GetCheckedAutoFireOffset()
{
if (AutoFireOffset == 1) return MENU_AUTOFIRE_OFFSET_2;
if (AutoFireOffset == 2) return MENU_AUTOFIRE_OFFSET_3;
if (AutoFireOffset == 3) return MENU_AUTOFIRE_OFFSET_4;
if (AutoFireOffset == 4) return MENU_AUTOFIRE_OFFSET_5;
if (AutoFireOffset == 5) return MENU_AUTOFIRE_OFFSET_6;
return MENU_AUTOFIRE_OFFSET_1;
}
// Internal functions
void SplitRecentArchiveFilename(std::string src, std::string& archive, std::string& file)
@ -336,6 +347,7 @@ void UpdateCheckedMenuItems()
x = 0;
CheckedAutoFirePattern = GetCheckedAutoFirePattern();
CheckedAutoFireOffset = GetCheckedAutoFireOffset();
while(AutoFirePatternIDs[x])
{
CheckMenuItem(fceumenu, AutoFirePatternIDs[x],

View File

@ -57,7 +57,7 @@
#include "drivers/sdl/sdl.h"
#endif
int AFon, AFoff;
int AFon, AFoff, AutoFireOffset = 0;
static void CloseGame(void)
{
@ -443,7 +443,6 @@ void FCEUI_Kill(void)
int rapidAlternator = 0;
int AutoFirePattern[8] = {1,0,0,0,0,0,0,0};
int AutoFirePatternLength = 2;
int AutoFireOffset = 0;
void SetAutoFirePattern(int onframes, int offframes)
{