Attempt to fix Issue #52
This commit is contained in:
parent
91c408468a
commit
959c94fcdf
|
@ -14,9 +14,9 @@ inline FILE *FCEUD_UTF8fopen(const std::string &n, const char *mode) { return FC
|
||||||
EMUFILE_FILE* FCEUD_UTF8_fstream(const char *n, const char *m);
|
EMUFILE_FILE* FCEUD_UTF8_fstream(const char *n, const char *m);
|
||||||
inline EMUFILE_FILE* FCEUD_UTF8_fstream(const std::string &n, const char *m) { return FCEUD_UTF8_fstream(n.c_str(),m); }
|
inline EMUFILE_FILE* FCEUD_UTF8_fstream(const std::string &n, const char *m) { return FCEUD_UTF8_fstream(n.c_str(),m); }
|
||||||
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex);
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex);
|
||||||
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex, bool* userCancel);
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex, int* userCancel);
|
||||||
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename);
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename);
|
||||||
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, bool* userCancel);
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, int* userCancel);
|
||||||
ArchiveScanRecord FCEUD_ScanArchive(std::string fname);
|
ArchiveScanRecord FCEUD_ScanArchive(std::string fname);
|
||||||
|
|
||||||
//mbg 7/23/06
|
//mbg 7/23/06
|
||||||
|
|
|
@ -1042,5 +1042,7 @@ void FCEUD_TurboOff (void) { NoWaiting&=~1; }
|
||||||
void FCEUD_TurboToggle(void) { NoWaiting^= 1; }
|
void FCEUD_TurboToggle(void) { NoWaiting^= 1; }
|
||||||
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string &fname, int innerIndex) { return 0; }
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string &fname, int innerIndex) { return 0; }
|
||||||
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename) { return 0; }
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename) { return 0; }
|
||||||
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string &fname, int innerIndex, int* userCancel) { return 0; }
|
||||||
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, int* userCancel) { return 0; }
|
||||||
ArchiveScanRecord FCEUD_ScanArchive(std::string fname) { return ArchiveScanRecord(); }
|
ArchiveScanRecord FCEUD_ScanArchive(std::string fname) { return ArchiveScanRecord(); }
|
||||||
|
|
||||||
|
|
|
@ -486,7 +486,7 @@ extern HWND hAppWnd;
|
||||||
|
|
||||||
//TODO - factor out the filesize and name extraction code from below (it is already done once above)
|
//TODO - factor out the filesize and name extraction code from below (it is already done once above)
|
||||||
|
|
||||||
static FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, int innerIndex, bool* userCancel)
|
static FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, int innerIndex, int* userCancel)
|
||||||
{
|
{
|
||||||
FCEUFILE* fp = 0;
|
FCEUFILE* fp = 0;
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ static FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, s
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(userCancel)
|
if(userCancel)
|
||||||
*userCancel = true;
|
*userCancel = 1;
|
||||||
}//if returned a file from the fileselector
|
}//if returned a file from the fileselector
|
||||||
|
|
||||||
} //if we opened the 7z correctly
|
} //if we opened the 7z correctly
|
||||||
|
@ -576,7 +576,7 @@ static FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, s
|
||||||
return FCEUD_OpenArchive(asr, fname, innerFilename, innerIndex, NULL);
|
return FCEUD_OpenArchive(asr, fname, innerFilename, innerIndex, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex, bool* userCancel)
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex, int* userCancel)
|
||||||
{
|
{
|
||||||
return FCEUD_OpenArchive(asr, fname, 0, innerIndex, userCancel);
|
return FCEUD_OpenArchive(asr, fname, 0, innerIndex, userCancel);
|
||||||
}
|
}
|
||||||
|
@ -586,7 +586,7 @@ FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int
|
||||||
return FCEUD_OpenArchive(asr, fname, 0, innerIndex);
|
return FCEUD_OpenArchive(asr, fname, 0, innerIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, bool* userCancel)
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, int* userCancel)
|
||||||
{
|
{
|
||||||
return FCEUD_OpenArchive(asr, fname, innerFilename, -1, userCancel);
|
return FCEUD_OpenArchive(asr, fname, innerFilename, -1, userCancel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,10 @@ void initArchiveSystem();
|
||||||
|
|
||||||
//if you want to autopilot this, pass in an innerfilename to try and automatically load
|
//if you want to autopilot this, pass in an innerfilename to try and automatically load
|
||||||
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename);
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename);
|
||||||
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, bool* userCancel);
|
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename, int* userCancel);
|
||||||
|
|
||||||
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex);
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex);
|
||||||
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex, bool* userCancel);
|
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex, int* userCancel);
|
||||||
|
|
||||||
//scans a file to see if it is an archive you can handle
|
//scans a file to see if it is an archive you can handle
|
||||||
ArchiveScanRecord FCEUD_ScanArchive(std::string fname);
|
ArchiveScanRecord FCEUD_ScanArchive(std::string fname);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
|
@ -415,7 +415,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
||||||
// indicator for if the operaton was canceled by user
|
// indicator for if the operaton was canceled by user
|
||||||
// currently there's only one situation:
|
// currently there's only one situation:
|
||||||
// the user clicked cancel form the open from archive dialog
|
// the user clicked cancel form the open from archive dialog
|
||||||
bool userCancel = false;
|
int userCancel = 0;
|
||||||
fp = FCEU_fopen(name, 0, "rb", 0, -1, romextensions, &userCancel);
|
fp = FCEU_fopen(name, 0, "rb", 0, -1, romextensions, &userCancel);
|
||||||
|
|
||||||
if (!fp)
|
if (!fp)
|
||||||
|
|
|
@ -256,7 +256,7 @@ zpfail:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext, int index, const char** extensions, bool* userCancel)
|
FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext, int index, const char** extensions, int* userCancel)
|
||||||
{
|
{
|
||||||
FILE *ipsfile=0;
|
FILE *ipsfile=0;
|
||||||
FCEUFILE *fceufp=0;
|
FCEUFILE *fceufp=0;
|
||||||
|
|
|
@ -122,7 +122,7 @@ struct ArchiveScanRecord
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext, int index=-1, const char** extensions = 0, bool* userCancel = NULL);
|
FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext, int index=-1, const char** extensions = 0, int* userCancel = 0);
|
||||||
bool FCEU_isFileInArchive(const char *path);
|
bool FCEU_isFileInArchive(const char *path);
|
||||||
int FCEU_fclose(FCEUFILE*);
|
int FCEU_fclose(FCEUFILE*);
|
||||||
uint64 FCEU_fread(void *ptr, size_t size, size_t nmemb, FCEUFILE*);
|
uint64 FCEU_fread(void *ptr, size_t size, size_t nmemb, FCEUFILE*);
|
||||||
|
|
Loading…
Reference in New Issue