mirror of
https://github.com/dborth/fceugx.git
synced 2024-11-01 06:55:05 +01:00
fix WiiSD ZIP lockup
This commit is contained in:
parent
2feeacec70
commit
4b4bedcb28
@ -574,8 +574,6 @@ int parseWiiSDdirectory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (VFAT_readdir(&vfsdir) == FS_SUCCESS) {
|
while (VFAT_readdir(&vfsdir) == FS_SUCCESS) {
|
||||||
sprintf(msg, "VFAT Adding %s", vfsdir.longname);
|
|
||||||
ShowAction(msg);
|
|
||||||
memset (&filelist[numstored], 0, sizeof (FILEENTRIES));
|
memset (&filelist[numstored], 0, sizeof (FILEENTRIES));
|
||||||
strncpy(filelist[numstored].filename,(char *)(vfsdir.longname), MAX_LONG_NAME);
|
strncpy(filelist[numstored].filename,(char *)(vfsdir.longname), MAX_LONG_NAME);
|
||||||
filelist[numstored].filename[MAX_LONG_NAME-1] = 0;
|
filelist[numstored].filename[MAX_LONG_NAME-1] = 0;
|
||||||
@ -586,10 +584,6 @@ int parseWiiSDdirectory() {
|
|||||||
}
|
}
|
||||||
VFAT_closedir(&vfsdir);
|
VFAT_closedir(&vfsdir);
|
||||||
|
|
||||||
entries = nbfiles;
|
|
||||||
if (entries < 0) entries = 0;
|
|
||||||
if (entries > MAXFILES) entries = MAXFILES;
|
|
||||||
|
|
||||||
return numstored;
|
return numstored;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,6 +17,13 @@
|
|||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <sdcard.h>
|
#include <sdcard.h>
|
||||||
|
|
||||||
|
#ifdef HW_RVL
|
||||||
|
#include "wiisd/tff.h"
|
||||||
|
|
||||||
|
extern VFATFS vfs;
|
||||||
|
extern FSDIRENTRY vfsfile;
|
||||||
|
extern int UseWiiSDCARD;
|
||||||
|
#endif
|
||||||
extern sd_file *filehandle;
|
extern sd_file *filehandle;
|
||||||
extern int UseSDCARD;
|
extern int UseSDCARD;
|
||||||
|
|
||||||
@ -160,6 +167,9 @@ int unzipDVDFile( unsigned char *outbuffer,
|
|||||||
discoffset += 2048;
|
discoffset += 2048;
|
||||||
if ( UseSDCARD )
|
if ( UseSDCARD )
|
||||||
SDCARD_ReadFile(filehandle, &readbuffer, 2048);
|
SDCARD_ReadFile(filehandle, &readbuffer, 2048);
|
||||||
|
#ifdef HW_RVL
|
||||||
|
else if (UseWiiSDCARD) VFAT_fread(&vfsfile, &readbuffer, 2048);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
dvd_read(&readbuffer, 2048, discoffset);
|
dvd_read(&readbuffer, 2048, discoffset);
|
||||||
|
|
||||||
@ -169,6 +179,9 @@ int unzipDVDFile( unsigned char *outbuffer,
|
|||||||
|
|
||||||
if ( UseSDCARD )
|
if ( UseSDCARD )
|
||||||
SDCARD_CloseFile(filehandle);
|
SDCARD_CloseFile(filehandle);
|
||||||
|
#ifdef HW_RVL
|
||||||
|
else if (UseWiiSDCARD) VFAT_fclose(&vfsfile);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( res == Z_STREAM_END ) {
|
if ( res == Z_STREAM_END ) {
|
||||||
if ( FLIP32(pkzip.uncompressedSize == (u32)bufferoffset ) )
|
if ( FLIP32(pkzip.uncompressedSize == (u32)bufferoffset ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user