fix fds loading
This commit is contained in:
parent
81d4767443
commit
c6b90a037e
|
@ -188,9 +188,13 @@ 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);
|
||||||
|
|
||||||
|
//.rom
|
||||||
#define FCEUIOD_ROMS 0
|
#define FCEUIOD_ROMS 0
|
||||||
|
//NV = nonvolatile. save data.
|
||||||
#define FCEUIOD_NV 1
|
#define FCEUIOD_NV 1
|
||||||
|
//savestates
|
||||||
#define FCEUIOD_STATES 2
|
#define FCEUIOD_STATES 2
|
||||||
|
//.fds ?
|
||||||
#define FCEUIOD_FDSROM 3
|
#define FCEUIOD_FDSROM 3
|
||||||
#define FCEUIOD_SNAPS 4
|
#define FCEUIOD_SNAPS 4
|
||||||
#define FCEUIOD_CHEATS 5
|
#define FCEUIOD_CHEATS 5
|
||||||
|
|
|
@ -401,6 +401,8 @@ ArchiveScanRecord FCEUD_ScanArchive(std::string fname)
|
||||||
|
|
||||||
//check the file against the signatures
|
//check the file against the signatures
|
||||||
std::fstream* inf = FCEUD_UTF8_fstream(fname,"rb");
|
std::fstream* inf = FCEUD_UTF8_fstream(fname,"rb");
|
||||||
|
if(!inf) return ArchiveScanRecord();
|
||||||
|
|
||||||
int matchingFormat = -1;
|
int matchingFormat = -1;
|
||||||
for(uint32 i=0;i<(int)formatRecords.size();i++)
|
for(uint32 i=0;i<(int)formatRecords.size();i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1188,7 +1188,11 @@ std::fstream* FCEUD_UTF8_fstream(const char *n, const char *m)
|
||||||
else if(!strcmp(m,"a+") || !strcmp(m,"a+b"))
|
else if(!strcmp(m,"a+") || !strcmp(m,"a+b"))
|
||||||
mode |= std::ios_base::in | std::ios_base::out | std::ios_base::app;
|
mode |= std::ios_base::in | std::ios_base::out | std::ios_base::app;
|
||||||
|
|
||||||
return new std::fstream(n,mode);
|
std::fstream *fs = new std::fstream(n,mode);
|
||||||
|
if(!fs->is_open()) {
|
||||||
|
delete fs;
|
||||||
|
return 0;
|
||||||
|
} else return fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *FCEUD_UTF8fopen(const char *n, const char *m)
|
FILE *FCEUD_UTF8fopen(const char *n, const char *m)
|
||||||
|
|
Loading…
Reference in New Issue