-removed two redundant methods

-wbfs stuff is mem1 overjoy as we said :P
This commit is contained in:
fix94.1 2012-06-07 05:14:51 +00:00
parent 2fceea113f
commit e233a56d2f
4 changed files with 12 additions and 35 deletions

View File

@ -38,6 +38,7 @@
#include "mem2.hpp"
#include "wbfs.h"
#include "gecko.h"
#include "fileOps.h"
u8 *confbuffer ATTRIBUTE_ALIGN(32);
u8 CCode[0x1008];
@ -422,18 +423,6 @@ u32 Nand::__configsetsetting(const char *item, const char *val)
return 0;
}
bool Nand::__FileExists(const char *path, ...)
{
FILE *f = fopen(path, "rb");
if (f != 0)
{
gprintf("File \"%s\" exists\n", path);
fclose(f);
return true;
}
return false;
}
void Nand::__FATify(char *ptr, const char *str)
{
char ctr;
@ -620,7 +609,7 @@ s32 Nand::__DumpNandFile(const char *source, const char *dest)
return 0;
}
if(__FileExists(dest))
if(fsop_FileExist(dest))
remove(dest);
FILE *file = fopen(dest, "wb");

View File

@ -101,7 +101,6 @@ class Nand
u32 __configsetbyte(const char *item, u8 val);
u32 __configsetbigarray(const char *item, void *val, u32 size);
u32 __configsetsetting(const char *item, const char *val);
bool __FileExists(const char *path, ...);
void __NANDify(char *str);
void __FATify(char *dst, const char *src);
s32 __Unescaped2x(const char *path);

View File

@ -14,11 +14,11 @@
#define wbfs_fatal(x) do { gprintf(x); wd_last_error = 1; } while(0)
#define wbfs_error(x) do { gprintf(x); wd_last_error = 2; } while(0)
#define wbfs_malloc(x) MEM2_alloc(x)
#define wbfs_free(x) MEM2_free(x)
#define wbfs_malloc(x) MEM1_alloc(x)
#define wbfs_free(x) MEM1_free(x)
#define wbfs_ioalloc(x) MEM2_memalign(32, x)
#define wbfs_iofree(x) MEM2_free(x)
#define wbfs_ioalloc(x) MEM1_memalign(32, x)
#define wbfs_iofree(x) MEM1_free(x)
#define wbfs_be16(x) (*((u16*)(x)))
#define wbfs_be32(x) (*((u32*)(x)))

View File

@ -7,24 +7,13 @@
#include "lockMutex.hpp"
#include "gecko/gecko.h"
#include "defines.h"
#include "fileOps.h"
static inline int loopNum(int i, int s)
{
return i < 0 ? (s - (-i % s)) % s : i % s;
}
static bool __FileExists(const char *path)
{
FILE *f = fopen(path, "rb");
if (f != 0)
{
//gprintf("File \"%s\" exists\n", path);
fclose(f);
return true;
}
return false;
}
static bool _saveExists(const char *path)
{
DIR *d;
@ -57,20 +46,20 @@ bool CMenu::_TestEmuNand(int epart, const char *path, bool indept)
{
// Check Wiimotes && Region
snprintf(testpath, sizeof(testpath), "%s:%s/shared2/sys/SYSCONF", DeviceName[epart], path);
if(!__FileExists(testpath))
if(!fsop_FileExist(testpath))
{
//gprintf("Nandcheck: SYSCONF not found\n");
haveValidENand = false;
}
snprintf(testpath, sizeof(testpath), "%s:%s/title/00000001/00000002/data/setting.txt", DeviceName[epart], path);
if(!__FileExists(testpath))
if(!fsop_FileExist(testpath))
{
//gprintf("Nandcheck: setting.txt not found\n");
haveValidENand = false;
}
// Check Mii's
snprintf(testpath, sizeof(testpath), "%s:%s/shared2/menu/FaceLib/RFL_DB.dat", DeviceName[epart], path);
if(!__FileExists(testpath))
if(!fsop_FileExist(testpath))
{
//gprintf("Nandcheck: Mii's not found\n");
haveValidENand = false;