fix directories configuration stuff
This commit is contained in:
parent
437c1f65ec
commit
2dcd90fc6c
23
src/driver.h
23
src/driver.h
|
@ -240,17 +240,20 @@ int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare
|
||||||
void FCEUI_CheatSearchShowExcluded(void);
|
void FCEUI_CheatSearchShowExcluded(void);
|
||||||
void FCEUI_CheatSearchSetCurrentAsOriginal(void);
|
void FCEUI_CheatSearchSetCurrentAsOriginal(void);
|
||||||
|
|
||||||
#define FCEUIOD_STATE 0
|
#define FCEUIOD_ROMS 0
|
||||||
#define FCEUIOD_SNAPS 1
|
#define FCEUIOD_NV 1
|
||||||
#define FCEUIOD_NV 2
|
#define FCEUIOD_STATES 2
|
||||||
#define FCEUIOD_CHEATS 3
|
#define FCEUIOD_FDSROM 3
|
||||||
#define FCEUIOD_MISC 4
|
#define FCEUIOD_SNAPS 4
|
||||||
#define FCEUIOD_MEMW 5
|
#define FCEUIOD_CHEATS 5
|
||||||
#define FCEUIOD_BBOT 6
|
#define FCEUIOD_MOVIES 6
|
||||||
#define FCEUIOD_MACRO 7
|
#define FCEUIOD_MEMW 7
|
||||||
#define FCEUIOD_FDSROM 8
|
#define FCEUIOD_BBOT 8
|
||||||
|
#define FCEUIOD_MACRO 9
|
||||||
|
#define FCEUIOD_INPUT 10
|
||||||
|
#define FCEUIOD_LUA 11
|
||||||
|
|
||||||
#define FCEUIOD__COUNT 9
|
#define FCEUIOD__COUNT 12
|
||||||
|
|
||||||
void FCEUI_SetDirOverride(int which, char *n);
|
void FCEUI_SetDirOverride(int which, char *n);
|
||||||
|
|
||||||
|
|
|
@ -108,16 +108,19 @@ static CFGSTRUCT fceuconfig[] = {
|
||||||
|
|
||||||
ACS(gfsdir),
|
ACS(gfsdir),
|
||||||
|
|
||||||
NACS("odcheats",directory_names[0]),
|
NACS("odroms",directory_names[0]),
|
||||||
NACS("odmisc",directory_names[1]),
|
NACS("odnonvol",directory_names[1]),
|
||||||
NACS("odnonvol",directory_names[2]),
|
NACS("odstates",directory_names[2]),
|
||||||
NACS("odstates",directory_names[3]),
|
NACS("odfdsrom",directory_names[3]),
|
||||||
NACS("odsnaps",directory_names[4]),
|
NACS("odsnaps",directory_names[4]),
|
||||||
NACS("odmemwatch",directory_names[5]),
|
NACS("odcheats",directory_names[5]),
|
||||||
NACS("odbasicbot",directory_names[6]),
|
NACS("odmovies",directory_names[6]),
|
||||||
NACS("odmacro",directory_names[7]),
|
NACS("odmemwatch",directory_names[7]),
|
||||||
NACS("odfdsrom",directory_names[8]),
|
NACS("odbasicbot",directory_names[8]),
|
||||||
NACS("odbase",directory_names[9]),
|
NACS("odmacro",directory_names[9]),
|
||||||
|
NACS("odinput",directory_names[10]),
|
||||||
|
NACS("odlua",directory_names[11]),
|
||||||
|
NACS("odbase",directory_names[12]),
|
||||||
|
|
||||||
AC(winspecial),
|
AC(winspecial),
|
||||||
AC(winsizemulx),
|
AC(winsizemulx),
|
||||||
|
|
|
@ -28,7 +28,7 @@ void CloseDirectoriesDialog(HWND hwndDlg)
|
||||||
for(unsigned int curr_dir = 0; curr_dir < NUMBER_OF_DIRECTORIES; curr_dir++)
|
for(unsigned int curr_dir = 0; curr_dir < NUMBER_OF_DIRECTORIES; curr_dir++)
|
||||||
{
|
{
|
||||||
LONG len;
|
LONG len;
|
||||||
len = SendDlgItemMessage(hwndDlg, EDIT_CHEATS + curr_dir, WM_GETTEXTLENGTH, 0, 0);
|
len = SendDlgItemMessage(hwndDlg, EDIT_ROMS + curr_dir, WM_GETTEXTLENGTH, 0, 0);
|
||||||
|
|
||||||
if(len <= 0)
|
if(len <= 0)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ void CloseDirectoriesDialog(HWND hwndDlg)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!GetDlgItemText(hwndDlg, EDIT_CHEATS + curr_dir, directory_names[curr_dir], len))
|
if(!GetDlgItemText(hwndDlg, EDIT_ROMS + curr_dir, directory_names[curr_dir], len))
|
||||||
{
|
{
|
||||||
free(directory_names[curr_dir]);
|
free(directory_names[curr_dir]);
|
||||||
directory_names[curr_dir] = 0;
|
directory_names[curr_dir] = 0;
|
||||||
|
@ -102,7 +102,7 @@ static BOOL CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
// Initialize the directories textboxes
|
// Initialize the directories textboxes
|
||||||
for(unsigned int curr_dir = 0; curr_dir < NUMBER_OF_DIRECTORIES; curr_dir++)
|
for(unsigned int curr_dir = 0; curr_dir < NUMBER_OF_DIRECTORIES; curr_dir++)
|
||||||
{
|
{
|
||||||
SetDlgItemText(hwndDlg, EDIT_CHEATS + curr_dir, directory_names[curr_dir]);
|
SetDlgItemText(hwndDlg, EDIT_ROMS + curr_dir, directory_names[curr_dir]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the screenshot naming checkbox if necessary
|
// Check the screenshot naming checkbox if necessary
|
||||||
|
@ -123,25 +123,32 @@ static BOOL CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if( !(wParam >> 16) )
|
if( !(wParam >> 16) )
|
||||||
{
|
{
|
||||||
if( (wParam & 0xFFFF) >= BUTTON_CHEATS && (wParam & 0xFFFF) <= BUTTON_CHEATS + NUMBER_OF_DIRECTORIES)
|
if( (wParam & 0xFFFF) >= BUTTON_ROMS && (wParam & 0xFFFF) <= BUTTON_ROMS + NUMBER_OF_DIRECTORIES)
|
||||||
{
|
{
|
||||||
// If a directory selection button was pressed, ask the
|
// If a directory selection button was pressed, ask the
|
||||||
// user for a directory.
|
// user for a directory.
|
||||||
|
|
||||||
static char *helpert[6] = {
|
static char *helpert[13] = {
|
||||||
"Cheats",
|
"Roms",
|
||||||
"Miscellaneous",
|
"Battery Saves",
|
||||||
"Nonvolatile Game Data",
|
|
||||||
"Save States",
|
"Save States",
|
||||||
"Screen Snapshots",
|
"FDS Bios Rom",
|
||||||
|
"Screenshots",
|
||||||
|
"Cheats",
|
||||||
|
"Movies",
|
||||||
|
"Memory Watch",
|
||||||
|
"Basic Bot",
|
||||||
|
"Macro files",
|
||||||
|
"Input Presets",
|
||||||
|
"Lua Scripts",
|
||||||
"Base Directory"
|
"Base Directory"
|
||||||
};
|
};
|
||||||
|
|
||||||
char name[MAX_PATH];
|
char name[MAX_PATH];
|
||||||
|
|
||||||
if(BrowseForFolder(hwndDlg, helpert[ ( (wParam & 0xFFFF) - BUTTON_CHEATS)], name))
|
if(BrowseForFolder(hwndDlg, helpert[ ( (wParam & 0xFFFF) - BUTTON_ROMS)], name))
|
||||||
{
|
{
|
||||||
SetDlgItemText(hwndDlg, EDIT_CHEATS + ((wParam & 0xFFFF) - BUTTON_CHEATS), name);
|
SetDlgItemText(hwndDlg, EDIT_ROMS + ((wParam & 0xFFFF) - BUTTON_ROMS), name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else switch(wParam & 0xFFFF)
|
else switch(wParam & 0xFFFF)
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ static void PresetExport(int preset)
|
||||||
ofn.lpstrFile=nameo;
|
ofn.lpstrFile=nameo;
|
||||||
ofn.nMaxFile=256;
|
ofn.nMaxFile=256;
|
||||||
ofn.Flags=OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT;
|
ofn.Flags=OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT;
|
||||||
ofn.lpstrInitialDir=InputPresetDir;
|
ofn.lpstrInitialDir=FCEU_GetPath(FCEUMKF_INPUT);
|
||||||
if(GetSaveFileName(&ofn))
|
if(GetSaveFileName(&ofn))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1590,7 +1590,7 @@ static void PresetImport(int preset)
|
||||||
ofn.lpstrFile=nameo;
|
ofn.lpstrFile=nameo;
|
||||||
ofn.nMaxFile=256;
|
ofn.nMaxFile=256;
|
||||||
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
|
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
|
||||||
ofn.lpstrInitialDir=InputPresetDir;
|
ofn.lpstrInitialDir=FCEU_GetPath(FCEUMKF_INPUT);
|
||||||
|
|
||||||
if(GetOpenFileName(&ofn))
|
if(GetOpenFileName(&ofn))
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,8 +106,8 @@ double winsizemulx = 1, winsizemuly = 1;
|
||||||
|
|
||||||
|
|
||||||
// Contains the names of the overridden standard directories
|
// Contains the names of the overridden standard directories
|
||||||
// in the order cheats, misc, nonvol, states, snaps, memwatch, basicbot, macro, fds,..., base
|
// in the order roms, nonvol, states, fdsrom, snaps, cheats, movies, memwatch, basicbot, macro, input presets, lua scripts, base
|
||||||
char *directory_names[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
char *directory_names[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle of the main window.
|
* Handle of the main window.
|
||||||
|
@ -160,16 +160,19 @@ void SetDirs()
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
static int jlist[10]= {
|
static int jlist[13]= {
|
||||||
FCEUIOD_CHEATS,
|
FCEUIOD_ROMS,
|
||||||
FCEUIOD_MISC,
|
|
||||||
FCEUIOD_NV,
|
FCEUIOD_NV,
|
||||||
FCEUIOD_STATE,
|
FCEUIOD_STATES,
|
||||||
|
FCEUIOD_FDSROM,
|
||||||
FCEUIOD_SNAPS,
|
FCEUIOD_SNAPS,
|
||||||
|
FCEUIOD_CHEATS,
|
||||||
|
FCEUIOD_MOVIES,
|
||||||
FCEUIOD_MEMW,
|
FCEUIOD_MEMW,
|
||||||
FCEUIOD_BBOT,
|
FCEUIOD_BBOT,
|
||||||
FCEUIOD_MACRO,
|
FCEUIOD_MACRO,
|
||||||
FCEUIOD_FDSROM,
|
FCEUIOD_INPUT,
|
||||||
|
FCEUIOD_LUA,
|
||||||
FCEUIOD__COUNT};
|
FCEUIOD__COUNT};
|
||||||
|
|
||||||
FCEUI_SetSnapName(eoptions & EO_SNAPNAME);
|
FCEUI_SetSnapName(eoptions & EO_SNAPNAME);
|
||||||
|
@ -179,9 +182,9 @@ void SetDirs()
|
||||||
FCEUI_SetDirOverride(jlist[x], directory_names[x]);
|
FCEUI_SetDirOverride(jlist[x], directory_names[x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(directory_names[10])
|
if(directory_names[12])
|
||||||
{
|
{
|
||||||
FCEUI_SetBaseDirectory(directory_names[10]);
|
FCEUI_SetBaseDirectory(directory_names[12]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,12 +39,25 @@ static int status_icon = 1;
|
||||||
static int vmod = 0;
|
static int vmod = 0;
|
||||||
static char *gfsdir=0;
|
static char *gfsdir=0;
|
||||||
|
|
||||||
extern char* directory_names[10];
|
extern char* directory_names[13];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the names of the default directories.
|
* Contains the names of the default directories.
|
||||||
**/
|
**/
|
||||||
static const char *default_directory_names[9] = {"cheats", "movie", "sav", "fcs", "snaps", "memwatch", "basicbot", "macro", ""};
|
static const char *default_directory_names[12] = {
|
||||||
|
"", // roms
|
||||||
|
"sav", // nonvol
|
||||||
|
"fcs", // states
|
||||||
|
"", // fdsrom
|
||||||
|
"snaps", // snaps
|
||||||
|
"cheats", // cheats
|
||||||
|
"movies", // movies
|
||||||
|
"tools", // memwatch
|
||||||
|
"tools", // basicbot
|
||||||
|
"tools", // macro
|
||||||
|
"tools", // input presets
|
||||||
|
"tools" // lua scripts
|
||||||
|
};
|
||||||
|
|
||||||
#define NUMBER_OF_DIRECTORIES sizeof(directory_names) / sizeof(*directory_names)
|
#define NUMBER_OF_DIRECTORIES sizeof(directory_names) / sizeof(*directory_names)
|
||||||
#define NUMBER_OF_DEFAULT_DIRECTORIES sizeof(default_directory_names) / sizeof(*default_directory_names)
|
#define NUMBER_OF_DEFAULT_DIRECTORIES sizeof(default_directory_names) / sizeof(*default_directory_names)
|
||||||
|
|
Binary file not shown.
|
@ -9,7 +9,7 @@
|
||||||
#define GUI_BOT_VALUES 2
|
#define GUI_BOT_VALUES 2
|
||||||
#define BTN_CANCEL 2
|
#define BTN_CANCEL 2
|
||||||
#define MENU_OPEN_FILE 100
|
#define MENU_OPEN_FILE 100
|
||||||
#define EDIT_CHEATS 100
|
#define EDIT_ROMS 100
|
||||||
#define MENU_CLOSE_FILE 101
|
#define MENU_CLOSE_FILE 101
|
||||||
#define IDI_ICON1 101
|
#define IDI_ICON1 101
|
||||||
#define CB_DISABLE_SPEED_THROTTLING 101
|
#define CB_DISABLE_SPEED_THROTTLING 101
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
#define MENU_STOP_AVI 152
|
#define MENU_STOP_AVI 152
|
||||||
#define MENU_EXIT 153
|
#define MENU_EXIT 153
|
||||||
#define MENU_RESET 200
|
#define MENU_RESET 200
|
||||||
#define BUTTON_CHEATS 200
|
#define BUTTON_ROMS 200
|
||||||
#define TXT_PAD1 200
|
#define TXT_PAD1 200
|
||||||
#define BTN_RESTORE_DEFAULTS 200
|
#define BTN_RESTORE_DEFAULTS 200
|
||||||
#define BTN_CLEAR 200
|
#define BTN_CLEAR 200
|
||||||
|
|
|
@ -520,7 +520,7 @@ void LoadNewGamey(HWND hParent, const char *initialdir)
|
||||||
ofn.lpstrFile=nameo;
|
ofn.lpstrFile=nameo;
|
||||||
ofn.nMaxFile=256;
|
ofn.nMaxFile=256;
|
||||||
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; //OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK;
|
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; //OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK;
|
||||||
ofn.lpstrInitialDir = initialdir ? initialdir : gfsdir;
|
ofn.lpstrInitialDir = initialdir ? initialdir : FCEU_GetPath(FCEUMKF_ROMS);
|
||||||
|
|
||||||
// Show the Open File dialog
|
// Show the Open File dialog
|
||||||
if(GetOpenFileName(&ofn))
|
if(GetOpenFileName(&ofn))
|
||||||
|
|
125
src/file.cpp
125
src/file.cpp
|
@ -599,7 +599,7 @@ void FCEUI_SetBaseDirectory(const char *dir)
|
||||||
BaseDirectory[2047] = 0;
|
BaseDirectory[2047] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *odirs[FCEUIOD__COUNT]={0,0,0,0,0}; // odirs, odors. ^_^
|
static char *odirs[FCEUIOD__COUNT]={0,0,0,0,0,0,0,0,0,0,0,0}; // odirs, odors. ^_^
|
||||||
|
|
||||||
void FCEUI_SetDirOverride(int which, char *n)
|
void FCEUI_SetDirOverride(int which, char *n)
|
||||||
{
|
{
|
||||||
|
@ -611,7 +611,7 @@ void FCEUI_SetDirOverride(int which, char *n)
|
||||||
|
|
||||||
if(GameInfo) /* Rebuild cache of present states/movies. */
|
if(GameInfo) /* Rebuild cache of present states/movies. */
|
||||||
{
|
{
|
||||||
if(which==FCEUIOD_STATE)
|
if(which==FCEUIOD_STATES)
|
||||||
{
|
{
|
||||||
FCEUSS_CheckStates();
|
FCEUSS_CheckStates();
|
||||||
}
|
}
|
||||||
|
@ -638,25 +638,47 @@ char* FCEU_GetPath(int type)
|
||||||
char *ret=0;
|
char *ret=0;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case FCEUMKF_STATE:if(odirs[FCEUIOD_STATE])
|
case FCEUMKF_STATE:
|
||||||
ret=strdup(odirs[FCEUIOD_STATE]);
|
if(odirs[FCEUIOD_STATES])
|
||||||
|
ret=strdup(odirs[FCEUIOD_STATES]);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"fcs",BaseDirectory);
|
asprintf(&ret,"%s"PSS"fcs",BaseDirectory);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_MOVIE:if(odirs[FCEUIOD_MISC])
|
case FCEUMKF_MOVIE:
|
||||||
ret=strdup(odirs[FCEUIOD_MISC]);
|
if(odirs[FCEUIOD_MOVIES])
|
||||||
|
ret=strdup(odirs[FCEUIOD_MOVIES]);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"movie",BaseDirectory);
|
asprintf(&ret,"%s"PSS"movies",BaseDirectory);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_MEMW:if(odirs[FCEUIOD_MEMW])
|
case FCEUMKF_MEMW:
|
||||||
|
if(odirs[FCEUIOD_MEMW])
|
||||||
ret=strdup(odirs[FCEUIOD_MEMW]);
|
ret=strdup(odirs[FCEUIOD_MEMW]);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"memwatch",BaseDirectory);
|
asprintf(&ret,"%s"PSS"tools",BaseDirectory);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_BBOT:if(odirs[FCEUIOD_BBOT])
|
case FCEUMKF_BBOT:
|
||||||
|
if(odirs[FCEUIOD_BBOT])
|
||||||
ret=strdup(odirs[FCEUIOD_BBOT]);
|
ret=strdup(odirs[FCEUIOD_BBOT]);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"basicbot",BaseDirectory);
|
asprintf(&ret,"%s"PSS"tools",BaseDirectory);
|
||||||
|
break;
|
||||||
|
case FCEUMKF_ROMS:
|
||||||
|
if(odirs[FCEUIOD_ROMS])
|
||||||
|
ret=strdup(odirs[FCEUIOD_ROMS]);
|
||||||
|
else
|
||||||
|
asprintf(&ret,"%s",BaseDirectory);
|
||||||
|
break;
|
||||||
|
case FCEUMKF_INPUT:
|
||||||
|
if(odirs[FCEUIOD_INPUT])
|
||||||
|
ret=strdup(odirs[FCEUIOD_INPUT]);
|
||||||
|
else
|
||||||
|
asprintf(&ret,"%s"PSS"tools",BaseDirectory);
|
||||||
|
break;
|
||||||
|
case FCEUMKF_LUA:
|
||||||
|
if(odirs[FCEUIOD_LUA])
|
||||||
|
ret=strdup(odirs[FCEUIOD_LUA]);
|
||||||
|
else
|
||||||
|
asprintf(&ret,"%s"PSS"tools",BaseDirectory);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
|
@ -668,13 +690,15 @@ char *FCEU_MakePath(int type, const char* filebase)
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case FCEUMKF_MOVIE:if(odirs[FCEUIOD_MISC])
|
case FCEUMKF_MOVIE:
|
||||||
asprintf(&ret,"%s"PSS"%s",odirs[FCEUIOD_MISC],filebase);
|
if(odirs[FCEUIOD_MOVIES])
|
||||||
|
asprintf(&ret,"%s"PSS"%s",odirs[FCEUIOD_MOVIES],filebase);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"movie"PSS"%s",BaseDirectory,filebase);
|
asprintf(&ret,"%s"PSS"movies"PSS"%s",BaseDirectory,filebase);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_STATE:if(odirs[FCEUIOD_STATE])
|
case FCEUMKF_STATE:
|
||||||
asprintf(&ret,"%s"PSS"%s",odirs[FCEUIOD_STATE],filebase);
|
if(odirs[FCEUIOD_STATES])
|
||||||
|
asprintf(&ret,"%s"PSS"%s",odirs[FCEUIOD_STATES],filebase);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"fcs"PSS"%s",BaseDirectory,filebase);
|
asprintf(&ret,"%s"PSS"fcs"PSS"%s",BaseDirectory,filebase);
|
||||||
break;
|
break;
|
||||||
|
@ -690,32 +714,33 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case FCEUMKF_NPTEMP: asprintf(&ret,"%s"PSS"m590plqd94fo.tmp",BaseDirectory);break;
|
case FCEUMKF_NPTEMP: asprintf(&ret,"%s"PSS"m590plqd94fo.tmp",BaseDirectory);break;
|
||||||
case FCEUMKF_MOVIE:if(id1>=0)
|
case FCEUMKF_MOVIE:
|
||||||
|
if(id1>=0)
|
||||||
{
|
{
|
||||||
if(odirs[FCEUIOD_MISC])
|
if(odirs[FCEUIOD_MOVIES])
|
||||||
asprintf(&ret,"%s"PSS"%s.%d.fcm",odirs[FCEUIOD_MISC],FileBase,id1);
|
asprintf(&ret,"%s"PSS"%s.%d.fcm",odirs[FCEUIOD_MOVIES],FileBase,id1);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"movie"PSS"%s.%d.fcm",BaseDirectory,FileBase,id1);
|
asprintf(&ret,"%s"PSS"movies"PSS"%s.%d.fcm",BaseDirectory,FileBase,id1);
|
||||||
if(stat(ret,&tmpstat)==-1)
|
if(stat(ret,&tmpstat)==-1)
|
||||||
{
|
{
|
||||||
if(odirs[FCEUIOD_MISC])
|
if(odirs[FCEUIOD_MOVIES])
|
||||||
asprintf(&ret,"%s"PSS"%s.%d.fcm",odirs[FCEUIOD_MISC],FileBase,id1);
|
asprintf(&ret,"%s"PSS"%s.%d.fcm",odirs[FCEUIOD_MOVIES],FileBase,id1);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"movie"PSS"%s.%d.fcm",BaseDirectory,FileBase,id1);
|
asprintf(&ret,"%s"PSS"movies"PSS"%s.%d.fcm",BaseDirectory,FileBase,id1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(odirs[FCEUIOD_MISC])
|
if(odirs[FCEUIOD_MOVIES])
|
||||||
asprintf(&ret,"%s"PSS"%s.fcm",odirs[FCEUIOD_MISC],FileBase);
|
asprintf(&ret,"%s"PSS"%s.fcm",odirs[FCEUIOD_MOVIES],FileBase);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"movie"PSS"%s.fcm",BaseDirectory,FileBase);
|
asprintf(&ret,"%s"PSS"movies"PSS"%s.fcm",BaseDirectory,FileBase);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_STATE:
|
case FCEUMKF_STATE:
|
||||||
if(odirs[FCEUIOD_STATE])
|
if(odirs[FCEUIOD_STATES])
|
||||||
{
|
{
|
||||||
asprintf(&ret,"%s"PSS"%s.fc%d",odirs[FCEUIOD_STATE],FileBase,id1);
|
asprintf(&ret,"%s"PSS"%s.fc%d",odirs[FCEUIOD_STATES],FileBase,id1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -723,9 +748,9 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
}
|
}
|
||||||
if(stat(ret,&tmpstat)==-1)
|
if(stat(ret,&tmpstat)==-1)
|
||||||
{
|
{
|
||||||
if(odirs[FCEUIOD_STATE])
|
if(odirs[FCEUIOD_STATES])
|
||||||
{
|
{
|
||||||
asprintf(&ret,"%s"PSS"%s.fc%d",odirs[FCEUIOD_STATE],FileBase,id1);
|
asprintf(&ret,"%s"PSS"%s.fc%d",odirs[FCEUIOD_STATES],FileBase,id1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -749,12 +774,14 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
asprintf(&ret,"%s"PSS"snaps"PSS"%d.%s",BaseDirectory,id1,cd1);
|
asprintf(&ret,"%s"PSS"snaps"PSS"%d.%s",BaseDirectory,id1,cd1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_FDS:if(odirs[FCEUIOD_NV])
|
case FCEUMKF_FDS:
|
||||||
|
if(odirs[FCEUIOD_NV])
|
||||||
asprintf(&ret,"%s"PSS"%s.fds",odirs[FCEUIOD_NV],FileBase);
|
asprintf(&ret,"%s"PSS"%s.fds",odirs[FCEUIOD_NV],FileBase);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"sav"PSS"%s.fds",BaseDirectory,FileBase);
|
asprintf(&ret,"%s"PSS"sav"PSS"%s.fds",BaseDirectory,FileBase);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_SAV:if(odirs[FCEUIOD_NV])
|
case FCEUMKF_SAV:
|
||||||
|
if(odirs[FCEUIOD_NV])
|
||||||
asprintf(&ret,"%s"PSS"%s.%s",odirs[FCEUIOD_NV],FileBase,cd1);
|
asprintf(&ret,"%s"PSS"%s.%s",odirs[FCEUIOD_NV],FileBase,cd1);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"sav"PSS"%s.%s",BaseDirectory,FileBase,cd1);
|
asprintf(&ret,"%s"PSS"sav"PSS"%s.%s",BaseDirectory,FileBase,cd1);
|
||||||
|
@ -767,9 +794,9 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_REWINDSTATE:
|
case FCEUMKF_REWINDSTATE:
|
||||||
if(odirs[FCEUIOD_STATE])
|
if(odirs[FCEUIOD_STATES])
|
||||||
{
|
{
|
||||||
asprintf(&ret,"%s"PSS"rewind%d.fcs",odirs[FCEUIOD_STATE],id1);
|
asprintf(&ret,"%s"PSS"rewind%d.fcs",odirs[FCEUIOD_STATES],id1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -777,9 +804,9 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
}
|
}
|
||||||
if(stat(ret,&tmpstat)==-1)
|
if(stat(ret,&tmpstat)==-1)
|
||||||
{
|
{
|
||||||
if(odirs[FCEUIOD_STATE])
|
if(odirs[FCEUIOD_STATES])
|
||||||
{
|
{
|
||||||
asprintf(&ret,"%s"PSS"rewind%d.fcs",odirs[FCEUIOD_STATE],id1);
|
asprintf(&ret,"%s"PSS"rewind%d.fcs",odirs[FCEUIOD_STATES],id1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -793,8 +820,7 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"cheats"PSS"%s.cht",BaseDirectory,FileBase);
|
asprintf(&ret,"%s"PSS"cheats"PSS"%s.cht",BaseDirectory,FileBase);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_IPS: asprintf(&ret,"%s"PSS"%s%s.ips",FileBaseDirectory,FileBase,FileExt);
|
case FCEUMKF_IPS:asprintf(&ret,"%s"PSS"%s%s.ips",FileBaseDirectory,FileBase,FileExt);break;
|
||||||
break;
|
|
||||||
case FCEUMKF_GGROM:asprintf(&ret,"%s"PSS"gg.rom",BaseDirectory);break;
|
case FCEUMKF_GGROM:asprintf(&ret,"%s"PSS"gg.rom",BaseDirectory);break;
|
||||||
case FCEUMKF_FDSROM:
|
case FCEUMKF_FDSROM:
|
||||||
if(odirs[FCEUIOD_FDSROM])
|
if(odirs[FCEUIOD_FDSROM])
|
||||||
|
@ -802,26 +828,19 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"disksys.rom",BaseDirectory,FileBase);
|
asprintf(&ret,"%s"PSS"disksys.rom",BaseDirectory,FileBase);
|
||||||
break;
|
break;
|
||||||
case FCEUMKF_PALETTE:
|
case FCEUMKF_PALETTE:asprintf(&ret,"%s"PSS"%s.pal",BaseDirectory,FileBase);break;
|
||||||
if(odirs[FCEUIOD_MISC])
|
|
||||||
asprintf(&ret,"%s"PSS"%s.pal",odirs[FCEUIOD_MISC],FileBase);
|
|
||||||
else
|
|
||||||
asprintf(&ret,"%s"PSS"%s.pal",BaseDirectory,FileBase);
|
|
||||||
break;
|
|
||||||
case FCEUMKF_MOVIEGLOB:
|
case FCEUMKF_MOVIEGLOB:
|
||||||
if(odirs[FCEUIOD_MISC])
|
if(odirs[FCEUIOD_MOVIES])
|
||||||
// asprintf(&ret,"%s"PSS"%s*.fcm",odirs[FCEUIOD_MISC],FileBase);
|
// asprintf(&ret,"%s"PSS"%s*.fcm",odirs[FCEUIOD_MOVIES],FileBase);
|
||||||
asprintf(&ret,"%s"PSS"*.???",odirs[FCEUIOD_MISC]);
|
asprintf(&ret,"%s"PSS"*.???",odirs[FCEUIOD_MOVIES]);
|
||||||
else
|
else
|
||||||
// asprintf(&ret,"%s"PSS"fcs"PSS"%s*.fcm",BaseDirectory,FileBase);
|
// asprintf(&ret,"%s"PSS"fcs"PSS"%s*.fcm",BaseDirectory,FileBase);
|
||||||
asprintf(&ret,"%s"PSS"movie"PSS"*.???",BaseDirectory);
|
asprintf(&ret,"%s"PSS"movies"PSS"*.???",BaseDirectory);
|
||||||
break;
|
|
||||||
case FCEUMKF_MOVIEGLOB2:
|
|
||||||
asprintf(&ret,"%s"PSS"*.???",BaseDirectory);
|
|
||||||
break;
|
break;
|
||||||
|
case FCEUMKF_MOVIEGLOB2:asprintf(&ret,"%s"PSS"*.???",BaseDirectory);break;
|
||||||
case FCEUMKF_STATEGLOB:
|
case FCEUMKF_STATEGLOB:
|
||||||
if(odirs[FCEUIOD_STATE])
|
if(odirs[FCEUIOD_STATES])
|
||||||
asprintf(&ret,"%s"PSS"%s*.fc?",odirs[FCEUIOD_STATE],FileBase);
|
asprintf(&ret,"%s"PSS"%s*.fc?",odirs[FCEUIOD_STATES],FileBase);
|
||||||
else
|
else
|
||||||
asprintf(&ret,"%s"PSS"fcs"PSS"%s*.fc?",BaseDirectory,FileBase);
|
asprintf(&ret,"%s"PSS"fcs"PSS"%s*.fc?",BaseDirectory,FileBase);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,5 +43,8 @@ char *FCEU_MakeFName(int type, int id1, char *cd1);
|
||||||
#define FCEUMKF_REWINDSTATE 15
|
#define FCEUMKF_REWINDSTATE 15
|
||||||
#define FCEUMKF_MEMW 16
|
#define FCEUMKF_MEMW 16
|
||||||
#define FCEUMKF_BBOT 17
|
#define FCEUMKF_BBOT 17
|
||||||
|
#define FCEUMKF_ROMS 18
|
||||||
|
#define FCEUMKF_INPUT 19
|
||||||
|
#define FCEUMKF_LUA 20
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue