fix incorrect FAT file loading

This commit is contained in:
dborth 2008-10-03 05:26:01 +00:00
parent 830ef92806
commit 1c92d45bc1
4 changed files with 9 additions and 9 deletions

View File

@ -234,11 +234,12 @@ LoadBufferFromFAT (char *filepath, bool silent)
return 0;
}
/*** This is really nice, just load the file and decode it ***/
while ((read = fread (savebuffer + boffset, 1, 1024, handle)) > 0)
{
boffset += read;
}
// Just load the file up
fseek(handle, 0, SEEK_END); // go to end of file
size = ftell(handle); // get filesize
fseek(handle, 0, SEEK_SET); // go to start of file
fread (sbuffer, 1, size, handle);
fclose (handle);
fclose (handle);

View File

@ -345,8 +345,7 @@ int FileSelector (int method)
break;
case METHOD_SMB:
ARAM_ROMSIZE =
LoadSMBFile ();
ARAM_ROMSIZE = LoadSMBFile ();
break;
}

View File

@ -28,7 +28,7 @@
#include "snapshot.h"
#include "srtc.h"
#include "Snes9xGX.h"
#include "snes9xGX.h"
#include "images/saveicon.h"
#include "freeze.h"
#include "filesel.h"

View File

@ -25,7 +25,7 @@
#include "video.h"
#include "menudraw.h"
#include "filesel.h"
#include "Snes9xGX.h"
#include "snes9xGX.h"
bool networkInit = false;
bool networkShareInit = false;