small cleanup

This commit is contained in:
aliaspider 2014-11-02 07:00:31 +01:00
parent 188fe860e0
commit d2c9eb147d
4 changed files with 18 additions and 42 deletions

View File

@ -1,7 +1,7 @@
DEBUG = 0
PERF_TEST = 1
HAVE_GRIFFIN = 1
LOAD_FROM_MEMORY_TEST = 1
HAVE_GRIFFIN = 0
LOAD_FROM_MEMORY_TEST = 0
ifeq ($(platform),)
platform = unix

View File

@ -248,12 +248,6 @@ void _splitpath(const char* path, char* drive, char* dir, char* fname,
}
}
const char* S9xGetSnapshotDirectory()
{
return ".";
}
const char* S9xGetFilename(const char* ex)
{
static char filename [PATH_MAX + 1];
@ -261,12 +255,8 @@ const char* S9xGetFilename(const char* ex)
char dir [_MAX_DIR + 1];
char fname [_MAX_FNAME + 1];
char ext [_MAX_EXT + 1];
_splitpath(Memory.ROMFilename, drive, dir, fname, ext);
strcpy(filename, S9xGetSnapshotDirectory());
strcat(filename, SLASH_STR);
strcat(filename, fname);
strcat(filename, ex);
_makepath(filename, drive, dir, fname, ex);
return (filename);
}
@ -503,17 +493,13 @@ char* osd_GetPackDir()
static char filename[_MAX_PATH];
memset(filename, 0, _MAX_PATH);
if (strlen(S9xGetSnapshotDirectory()) != 0)
strcpy(filename, S9xGetSnapshotDirectory());
else
{
char dir [_MAX_DIR + 1];
char drive [_MAX_DRIVE + 1];
char name [_MAX_FNAME + 1];
char ext [_MAX_EXT + 1];
_splitpath(Memory.ROMFilename, drive, dir, name, ext);
_makepath(filename, drive, dir, NULL, NULL);
}
char dir [_MAX_DIR + 1];
char drive [_MAX_DRIVE + 1];
char name [_MAX_FNAME + 1];
char ext [_MAX_EXT + 1];
_splitpath(Memory.ROMFilename, drive, dir, name, ext);
_makepath(filename, drive, dir, NULL, NULL);
if (!strncmp((char*)&Memory.ROM [0xffc0], "SUPER POWER LEAG 4 ", 21))
{
@ -559,8 +545,8 @@ void retro_get_system_info(struct retro_system_info* info)
info->need_fullpath = true;
#endif
info->valid_extensions = "smc|fig|sfc|gd3|gd7|dx2|bsx|swc";
info->library_version = "v1.4";
info->library_name = "SNES9x(CATSFC)";
info->library_version = "v1.43";
info->library_name = "CATSFC(SNES9x)";
info->block_extract = false;
}

View File

@ -120,7 +120,6 @@ const char* S9xBasename(const char* filename);
int S9xFStrcmp(FILE*, const char*);
const char* S9xGetHomeDirectory();
const char* S9xGetSnapshotDirectory();
const char* S9xGetSRAMFilename();
const char* S9xGetFilename(const char* extension);

View File

@ -99,14 +99,12 @@
#define chdir _chdir
#define getcwd _getcwd
#endif
#define FREEZEFOLDER GUI.FreezeFileDir
//zinx suggested this, for *nix compatibility
#define PATH_MAX MAX_PATH
#else // Unix
#include "display.h"
#include <limits.h>
#include <unistd.h>
#define FREEZEFOLDER S9xGetSnapshotDirectory ()
#endif
const char* S9xGetFilename(const char*);
@ -398,19 +396,12 @@ void ReadPackData()
char dir [_MAX_DIR + 1];
char fname [_MAX_FNAME + 1];
char ext [_MAX_EXT + 1];
if (strlen(FREEZEFOLDER))
{
//splitpath (Memory.ROMFilename, drive, dir, fname, ext);
strcpy(name, FREEZEFOLDER);
strcat(name, "/");
}
else
{
splitpath(Memory.ROMFilename, drive, dir, fname, ext);
strcpy(name, drive);
//strcat(filename, "\\");
strcat(name, dir);
}
splitpath(Memory.ROMFilename, drive, dir, fname, ext);
strcpy(name, drive);
//strcat(filename, "\\");
strcat(name, dir);
strcat(name, pfold);
char bfname[11];
sprintf(bfname, "%06X.bin", table);