sdl now builds, but archives are currently broken.
This commit is contained in:
parent
595881979c
commit
6cffaa98ee
18
src/file.cpp
18
src/file.cpp
|
@ -250,7 +250,7 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext
|
||||||
//try to setup the ips file
|
//try to setup the ips file
|
||||||
if(ipsfn && read)
|
if(ipsfn && read)
|
||||||
ipsfile=FCEUD_UTF8fopen(ipsfn,"rb");
|
ipsfile=FCEUD_UTF8fopen(ipsfn,"rb");
|
||||||
|
#ifdef WIN32
|
||||||
if(read)
|
if(read)
|
||||||
{
|
{
|
||||||
ArchiveScanRecord asr = FCEUD_ScanArchive(fileToOpen);
|
ArchiveScanRecord asr = FCEUD_ScanArchive(fileToOpen);
|
||||||
|
@ -281,6 +281,22 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext
|
||||||
return fceufp;
|
return fceufp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
std::fstream* fp = FCEUD_UTF8_fstream(fileToOpen,mode);
|
||||||
|
if(!fp)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
fceufp = new FCEUFILE();
|
||||||
|
fceufp->filename = fileToOpen;
|
||||||
|
fceufp->archiveIndex = -1;
|
||||||
|
fceufp->stream = (std::iostream*)fp;
|
||||||
|
FCEU_fseek(fceufp,0,SEEK_END);
|
||||||
|
fceufp->size = FCEU_ftell(fceufp);
|
||||||
|
FCEU_fseek(fceufp,0,SEEK_SET);
|
||||||
|
return fceufp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue