mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
move melon_fopen() to Platform.cpp
melon_fopen_local() will need fixoring
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user