move melon_fopen() to Platform.cpp

melon_fopen_local() will need fixoring
This commit is contained in:
Arisotura
2019-03-27 04:23:03 +01:00
parent 5d127f9e55
commit 6d7e80b677
8 changed files with 44 additions and 33 deletions

View File

@ -24,6 +24,7 @@
#include "CRC32.h"
#include "melon_fopen.h"
#include "Platform.h"
namespace NDSCart_SRAM
@ -117,7 +118,7 @@ void LoadSave(const char* path, u32 type)
strncpy(SRAMPath, path, 1023);
SRAMPath[1023] = '\0';
FILE* f = melon_fopen(path, "rb");
FILE* f = Platform::OpenFile(path, "rb");
if (f)
{
fseek(f, 0, SEEK_END);
@ -177,7 +178,7 @@ void RelocateSave(const char* path, bool write)
strncpy(SRAMPath, path, 1023);
SRAMPath[1023] = '\0';
FILE* f = melon_fopen(path, "wb");
FILE* f = Platform::OpenFile(path, "wb");
if (!f)
{
printf("NDSCart_SRAM::RelocateSave: failed to create new file. fuck\n");
@ -444,7 +445,7 @@ void Write(u8 val, u32 hold)
if (islast && (CurCmd == 0x02 || CurCmd == 0x0A) && (SRAMLength > 0))
{
FILE* f = melon_fopen(SRAMPath, "wb");
FILE* f = Platform::OpenFile(SRAMPath, "wb");
if (f)
{
fwrite(SRAM, SRAMLength, 1, f);
@ -872,7 +873,7 @@ bool LoadROM(const char* path, const char* sram, bool direct)
// TODO: streaming mode? for really big ROMs or systems with limited RAM
// for now we're lazy
FILE* f = melon_fopen(path, "rb");
FILE* f = Platform::OpenFile(path, "rb");
if (!f)
{
return false;