2008-08-06 03:09:59 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Snes9x 1.50
|
|
|
|
*
|
|
|
|
* Nintendo Gamecube Port
|
|
|
|
* softdev July 2006
|
|
|
|
* crunchy2 May 2007
|
|
|
|
*
|
|
|
|
* sdload.cpp
|
|
|
|
*
|
|
|
|
* Load ROMS from SD Card
|
|
|
|
****************************************************************************/
|
|
|
|
#include <gccore.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ogcsys.h>
|
2008-08-06 03:39:43 +02:00
|
|
|
#include "sdload.h"
|
2008-08-06 03:55:59 +02:00
|
|
|
#include "unzip.h"
|
2008-08-06 03:09:59 +02:00
|
|
|
#include "memmap.h"
|
|
|
|
#include "video.h"
|
|
|
|
#include "ftfont.h"
|
|
|
|
#include "dvd.h"
|
|
|
|
#include "filesel.h"
|
|
|
|
#include "sram.h"
|
|
|
|
#include "preferences.h"
|
|
|
|
|
|
|
|
#include <zlib.h>
|
|
|
|
extern unsigned char savebuffer[];
|
|
|
|
extern char output[16384];
|
2008-08-06 03:39:43 +02:00
|
|
|
FILE * filehandle;
|
2008-08-06 03:55:59 +02:00
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
char currSDdir[MAXPATHLEN];
|
2008-08-06 03:09:59 +02:00
|
|
|
extern int offset;
|
|
|
|
extern int selection;
|
|
|
|
|
2008-08-06 04:31:44 +02:00
|
|
|
extern int loadtype;
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
extern FILEENTRIES filelist[MAXFILES];
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2008-08-06 03:55:59 +02:00
|
|
|
/***************************************************************************
|
|
|
|
* FileSortCallback
|
|
|
|
*
|
|
|
|
* Quick sort callback to sort file entries with the following order:
|
|
|
|
* .
|
|
|
|
* ..
|
|
|
|
* <dirs>
|
|
|
|
* <files>
|
|
|
|
***************************************************************************/
|
|
|
|
static int FileSortCallback(const void *f1, const void *f2)
|
|
|
|
{
|
|
|
|
/* Special case for implicit directories */
|
|
|
|
if(((FILEENTRIES *)f1)->filename[0] == '.' || ((FILEENTRIES *)f2)->filename[0] == '.')
|
|
|
|
{
|
|
|
|
if(strcmp(((FILEENTRIES *)f1)->filename, ".") == 0) { return -1; }
|
|
|
|
if(strcmp(((FILEENTRIES *)f2)->filename, ".") == 0) { return 1; }
|
|
|
|
if(strcmp(((FILEENTRIES *)f1)->filename, "..") == 0) { return -1; }
|
|
|
|
if(strcmp(((FILEENTRIES *)f2)->filename, "..") == 0) { return 1; }
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If one is a file and one is a directory the directory is first. */
|
|
|
|
if(((FILEENTRIES *)f1)->flags == 1 && ((FILEENTRIES *)f2)->flags == 0) return -1;
|
|
|
|
if(((FILEENTRIES *)f1)->flags == 0 && ((FILEENTRIES *)f2)->flags == 1) return 1;
|
|
|
|
|
|
|
|
return stricmp(((FILEENTRIES *)f1)->filename, ((FILEENTRIES *)f2)->filename);
|
|
|
|
}
|
|
|
|
|
2008-08-06 03:09:59 +02:00
|
|
|
/***************************************************************************
|
2008-08-06 04:31:44 +02:00
|
|
|
* Update FAT (sdcard, usb) curent directory name
|
2008-08-06 03:09:59 +02:00
|
|
|
***************************************************************************/
|
2008-08-06 04:31:44 +02:00
|
|
|
int updateFATdirname()
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
|
|
|
int size=0;
|
|
|
|
char *test;
|
|
|
|
char temp[1024];
|
|
|
|
|
|
|
|
/* current directory doesn't change */
|
|
|
|
if (strcmp(filelist[selection].filename,".") == 0) return 0;
|
|
|
|
|
|
|
|
/* go up to parent directory */
|
|
|
|
else if (strcmp(filelist[selection].filename,"..") == 0)
|
|
|
|
{
|
|
|
|
/* determine last subdirectory namelength */
|
2008-08-06 03:39:43 +02:00
|
|
|
sprintf(temp,"%s",currSDdir);
|
|
|
|
test = strtok(temp,"/");
|
|
|
|
while (test != NULL) {
|
2008-08-06 03:09:59 +02:00
|
|
|
size = strlen(test);
|
2008-08-06 03:39:43 +02:00
|
|
|
test = strtok(NULL,"/");
|
2008-08-06 03:09:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* remove last subdirectory name */
|
2008-08-06 03:39:43 +02:00
|
|
|
size = strlen(currSDdir) - size - 1;
|
|
|
|
currSDdir[size] = 0;
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
/* handles root name */
|
2008-08-06 03:39:43 +02:00
|
|
|
if (strcmp(currSDdir, "/") == 0)
|
|
|
|
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2008-08-06 03:39:43 +02:00
|
|
|
else /* Open a directory */
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
|
|
|
/* test new directory namelength */
|
2008-08-06 03:39:43 +02:00
|
|
|
if ((strlen(currSDdir)+1+strlen(filelist[selection].filename)) < MAXPATHLEN)
|
|
|
|
{
|
|
|
|
/* handles root name */
|
|
|
|
sprintf(temp, "/%s/..", SNESROMDIR);
|
|
|
|
if (strcmp(currSDdir, temp) == 0)
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf(currSDdir,"%s",ROOTSDDIR);
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
/* update current directory name */
|
|
|
|
sprintf(currSDdir, "%s/%s",currSDdir, filelist[selection].filename);
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
WaitPrompt((char*)"Dirname is too long !");
|
|
|
|
return -1;
|
|
|
|
}
|
2008-08-06 03:09:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************
|
2008-08-06 04:31:44 +02:00
|
|
|
* Browse FAT (sdcard, usb) subdirectories
|
2008-08-06 03:09:59 +02:00
|
|
|
***************************************************************************/
|
2008-08-06 04:31:44 +02:00
|
|
|
int parseFATdirectory() {
|
2008-08-06 03:39:43 +02:00
|
|
|
int nbfiles = 0;
|
|
|
|
DIR_ITER *sddir;
|
|
|
|
char filename[MAXPATHLEN];
|
|
|
|
struct stat filestat;
|
|
|
|
char msg[128];
|
|
|
|
|
|
|
|
/* initialize selection */
|
|
|
|
selection = offset = 0;
|
|
|
|
|
|
|
|
/* open the directory */
|
|
|
|
sddir = diropen(currSDdir);
|
|
|
|
if (sddir == NULL) {
|
2008-08-06 04:31:44 +02:00
|
|
|
/*** if we can't open the previous dir, open root dir ***/
|
|
|
|
if (loadtype == LOAD_USB)
|
|
|
|
sprintf(currSDdir,"fat4:/");
|
|
|
|
else // LOAD_SDC
|
|
|
|
//sprintf(currSDdir,"%s",ROOTSDDIR);
|
|
|
|
sprintf(currSDdir,"fat3:/");
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
sddir = diropen(currSDdir);
|
|
|
|
WaitPrompt(msg);
|
|
|
|
if (sddir == NULL) {
|
|
|
|
sprintf(msg, "Error opening %s", currSDdir);
|
|
|
|
WaitPrompt(msg);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
/* Move to DVD structure - this is required for the file selector */
|
2008-08-06 03:39:43 +02:00
|
|
|
while(dirnext(sddir,filename,&filestat) == 0) {
|
|
|
|
if(strcmp(filename,".") != 0) {
|
|
|
|
memset(&filelist[nbfiles], 0, sizeof(FILEENTRIES));
|
|
|
|
strncpy(filelist[nbfiles].filename, filename, MAXPATHLEN);
|
|
|
|
strncpy(filelist[nbfiles].displayname, filename, MAXDISPLAY+1); // crop name for display
|
|
|
|
filelist[nbfiles].length = filestat.st_size;
|
|
|
|
filelist[nbfiles].flags = (filestat.st_mode & _IFDIR) == 0 ? 0 : 1;
|
|
|
|
nbfiles++;
|
|
|
|
}
|
|
|
|
}
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
/*** close directory ***/
|
|
|
|
dirclose(sddir);
|
2008-08-06 03:55:59 +02:00
|
|
|
|
|
|
|
/* Sort the file list */
|
|
|
|
qsort(filelist, nbfiles, sizeof(FILEENTRIES), FileSortCallback);
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
return nbfiles;
|
2008-08-06 03:09:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* LoadSDFile
|
|
|
|
****************************************************************************/
|
2008-08-06 04:31:44 +02:00
|
|
|
extern bool haveSDdir;
|
|
|
|
extern bool haveUSBdir;
|
2008-08-06 03:09:59 +02:00
|
|
|
int
|
|
|
|
LoadSDFile (char *filename, int length)
|
|
|
|
{
|
|
|
|
char zipbuffer[2048];
|
2008-08-06 03:39:43 +02:00
|
|
|
char filepath[MAXPATHLEN];
|
|
|
|
FILE *handle;
|
2008-08-06 03:55:59 +02:00
|
|
|
unsigned char *rbuffer;
|
|
|
|
u32 size;
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2008-08-06 03:55:59 +02:00
|
|
|
rbuffer = (unsigned char *) Memory.ROM;
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
/* Check filename length */
|
2008-08-06 03:39:43 +02:00
|
|
|
if ((strlen(currSDdir)+1+strlen(filelist[selection].filename)) < MAXPATHLEN)
|
|
|
|
sprintf(filepath, "%s/%s",currSDdir,filelist[selection].filename);
|
2008-08-06 03:09:59 +02:00
|
|
|
else
|
|
|
|
{
|
2008-08-06 03:39:43 +02:00
|
|
|
WaitPrompt((char*) "Maximum Filename Length reached !");
|
2008-08-06 03:09:59 +02:00
|
|
|
haveSDdir = 0; // reset everything before next access
|
2008-08-06 04:31:44 +02:00
|
|
|
haveUSBdir = 0;
|
2008-08-06 03:09:59 +02:00
|
|
|
return -1;
|
|
|
|
}
|
2008-08-06 04:31:44 +02:00
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
handle = fopen (filepath, "rb");
|
2008-08-06 03:09:59 +02:00
|
|
|
if (handle > 0)
|
|
|
|
{
|
2008-08-06 03:39:43 +02:00
|
|
|
fread (zipbuffer, 1, 2048, handle);
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
if (IsZipFile (zipbuffer))
|
|
|
|
{
|
2008-08-06 03:55:59 +02:00
|
|
|
/*** Unzip the ROM ***/
|
|
|
|
size = UnZipBuffer (rbuffer, 0, 0, handle); // unzip from SD
|
2008-08-06 03:39:43 +02:00
|
|
|
|
|
|
|
fclose (handle);
|
2008-08-06 03:55:59 +02:00
|
|
|
return size;
|
2008-08-06 03:39:43 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/*** Just load the file up ***/
|
|
|
|
|
|
|
|
fseek(handle, 0, SEEK_END);
|
|
|
|
length = ftell(handle); // get filesize
|
|
|
|
fseek(handle, 2048, SEEK_SET); // seek back to point where we left off
|
|
|
|
|
|
|
|
sprintf (filepath, "Loading %d bytes", length);
|
|
|
|
ShowAction (filepath);
|
|
|
|
memcpy (rbuffer, zipbuffer, 2048); // copy what we already read
|
|
|
|
fread (rbuffer + 2048, 1, length - 2048, handle);
|
|
|
|
fclose (handle);
|
|
|
|
|
|
|
|
return length;
|
|
|
|
}
|
2008-08-06 03:09:59 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-06 03:39:43 +02:00
|
|
|
WaitPrompt((char*) "Error opening file");
|
2008-08-06 03:09:59 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Load savebuffer from SD card file
|
|
|
|
****************************************************************************/
|
|
|
|
int
|
2008-08-06 03:39:43 +02:00
|
|
|
LoadBufferFromSD (char *filepath, bool silent)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
2008-08-06 03:39:43 +02:00
|
|
|
FILE *handle;
|
2008-08-06 03:09:59 +02:00
|
|
|
int offset = 0;
|
|
|
|
int read = 0;
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
handle = fopen (filepath, "rb");
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
if (handle <= 0)
|
|
|
|
{
|
|
|
|
if ( !silent )
|
|
|
|
{
|
|
|
|
char msg[100];
|
|
|
|
sprintf(msg, "Couldn't open %s", filepath);
|
|
|
|
WaitPrompt (msg);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
memset (savebuffer, 0, 0x22000);
|
|
|
|
|
|
|
|
/*** This is really nice, just load the file and decode it ***/
|
2008-08-06 03:39:43 +02:00
|
|
|
while ((read = fread (savebuffer + offset, 1, 1024, handle)) > 0)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
|
|
|
offset += read;
|
|
|
|
}
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
fclose (handle);
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Write savebuffer to SD card file
|
|
|
|
****************************************************************************/
|
|
|
|
int
|
2008-08-06 03:39:43 +02:00
|
|
|
SaveBufferToSD (char *filepath, int datasize, bool silent)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
2008-08-06 03:39:43 +02:00
|
|
|
FILE *handle;
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
if (datasize)
|
|
|
|
{
|
2008-08-06 03:39:43 +02:00
|
|
|
handle = fopen (filepath, "wb");
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
if (handle <= 0)
|
|
|
|
{
|
|
|
|
char msg[100];
|
|
|
|
sprintf(msg, "Couldn't save %s", filepath);
|
|
|
|
WaitPrompt (msg);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
fwrite (savebuffer, 1, datasize, handle);
|
|
|
|
fclose (handle);
|
2008-08-06 03:09:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return datasize;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Save SRAM to SD Card
|
|
|
|
****************************************************************************/
|
2008-08-06 03:55:59 +02:00
|
|
|
void SaveSRAMToSD (bool silent)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
|
|
|
char filepath[1024];
|
|
|
|
int datasize;
|
|
|
|
int offset;
|
|
|
|
|
2008-08-06 03:55:59 +02:00
|
|
|
if (!silent)
|
|
|
|
ShowAction ((char*) "Saving SRAM to SD...");
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
#ifdef SDUSE_LFN
|
2008-08-06 04:31:44 +02:00
|
|
|
sprintf (filepath, "%s/%s/%s.srm", ROOTSDDIR, SNESSAVEDIR, Memory.ROMFilename);
|
2008-08-06 03:09:59 +02:00
|
|
|
#else
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf (filepath, "%s/%s/%08x.srm", ROOTSDDIR, SNESSAVEDIR, Memory.ROMCRC32);
|
2008-08-06 03:09:59 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
datasize = prepareEXPORTsavedata ();
|
|
|
|
|
|
|
|
if ( datasize )
|
|
|
|
{
|
|
|
|
offset = SaveBufferToSD (filepath, datasize, silent);
|
|
|
|
|
|
|
|
if ( (offset > 0) && (!silent) )
|
|
|
|
{
|
|
|
|
sprintf (filepath, "Wrote %d bytes", offset);
|
|
|
|
WaitPrompt (filepath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Load SRAM From SD Card
|
|
|
|
****************************************************************************/
|
|
|
|
void
|
2008-08-06 03:55:59 +02:00
|
|
|
LoadSRAMFromSD (bool silent)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
2008-08-06 04:31:44 +02:00
|
|
|
char filepath[MAXPATHLEN];
|
2008-08-06 03:09:59 +02:00
|
|
|
int offset = 0;
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
ShowAction ((char*) "Loading SRAM from SD...");
|
2008-08-06 04:31:44 +02:00
|
|
|
|
|
|
|
// check for 'old' version of sram
|
|
|
|
sprintf (filepath, "%s/%s/%s.srm", ROOTSDDIR, SNESSAVEDIR, Memory.ROMName); // Build old SRAM filename
|
|
|
|
|
|
|
|
offset = LoadBufferFromSD (filepath, silent); // load file
|
|
|
|
|
|
|
|
if (offset > 0) // old sram found
|
|
|
|
{
|
|
|
|
if (WaitPromptChoice ((char*)"Old SRAM found. Convert and delete?", (char*)"Cancel", (char*)"Do it"))
|
|
|
|
{
|
|
|
|
decodesavedata (offset);
|
|
|
|
remove (filepath); // delete old sram
|
|
|
|
SaveSRAMToSD (silent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
#ifdef SDUSE_LFN
|
2008-08-06 04:31:44 +02:00
|
|
|
sprintf (filepath, "%s/%s/%s.srm", ROOTSDDIR, SNESSAVEDIR, Memory.ROMFilename);
|
2008-08-06 03:09:59 +02:00
|
|
|
#else
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf (filepath, "%s/%s/%08x.srm", ROOTSDDIR, SNESSAVEDIR, Memory.ROMCRC32);
|
2008-08-06 03:09:59 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
offset = LoadBufferFromSD (filepath, silent);
|
|
|
|
|
|
|
|
if (offset > 0)
|
|
|
|
{
|
|
|
|
decodesavedata (offset);
|
|
|
|
if ( !silent )
|
|
|
|
{
|
|
|
|
sprintf (filepath, "Loaded %d bytes", offset);
|
|
|
|
WaitPrompt(filepath);
|
|
|
|
}
|
|
|
|
S9xSoftReset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Save Preferences to SD Card
|
|
|
|
****************************************************************************/
|
|
|
|
void
|
2008-08-06 03:55:59 +02:00
|
|
|
SavePrefsToSD (bool silent)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
|
|
|
char filepath[1024];
|
|
|
|
int datasize;
|
|
|
|
int offset;
|
|
|
|
|
2008-08-06 03:55:59 +02:00
|
|
|
if (!silent)
|
|
|
|
ShowAction ((char*) "Saving prefs to SD...");
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
#ifdef SDUSE_LFN
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf (filepath, "%s/%s/%s", ROOTSDDIR, SNESSAVEDIR, PREFS_FILE_NAME);
|
2008-08-06 03:09:59 +02:00
|
|
|
#else
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf (filepath, "%s/%s/%s", ROOTSDDIR, SNESSAVEDIR, PREFS_FILE_NAME);
|
2008-08-06 03:09:59 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
datasize = preparePrefsData ();
|
|
|
|
offset = SaveBufferToSD (filepath, datasize, silent);
|
|
|
|
|
|
|
|
if ( (offset > 0) && (!silent) )
|
|
|
|
{
|
|
|
|
sprintf (filepath, "Wrote %d bytes", offset);
|
|
|
|
WaitPrompt (filepath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Load Preferences from SD Card
|
|
|
|
****************************************************************************/
|
|
|
|
void
|
2008-08-06 03:55:59 +02:00
|
|
|
LoadPrefsFromSD (bool silent)
|
2008-08-06 03:09:59 +02:00
|
|
|
{
|
|
|
|
char filepath[1024];
|
|
|
|
int offset = 0;
|
|
|
|
|
2008-08-06 03:39:43 +02:00
|
|
|
ShowAction ((char*) "Loading prefs from SD...");
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
#ifdef SDUSE_LFN
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf (filepath, "%s/%s/%s", ROOTSDDIR, SNESSAVEDIR, PREFS_FILE_NAME);
|
2008-08-06 03:09:59 +02:00
|
|
|
#else
|
2008-08-06 03:55:59 +02:00
|
|
|
sprintf (filepath, "%s/%s/%s", ROOTSDDIR, SNESSAVEDIR, PREFS_FILE_NAME);
|
2008-08-06 03:09:59 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
offset = LoadBufferFromSD (filepath, silent);
|
|
|
|
|
|
|
|
if (offset > 0)
|
|
|
|
{
|
|
|
|
decodePrefsData ();
|
|
|
|
if ( !silent )
|
|
|
|
{
|
|
|
|
sprintf (filepath, "Loaded %d bytes", offset);
|
|
|
|
WaitPrompt(filepath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|