diff options
author | StapleButter <thetotalworm@gmail.com> | 2018-12-11 21:34:05 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2018-12-11 21:34:05 +0100 |
commit | 40f3f91368be1994155f61c8e186109698520a79 (patch) | |
tree | d30f5ce7b3b2f9a3a4e40405b331bfde9a92cdba /src/SPI.cpp | |
parent | 9a0bf912d9f3886cb96d02dfb1f2d182d3b57643 (diff) |
move config-file seeking code to its own thing.
look also into the same directory as melonDS. make it the preferred place for storing melonDS.ini.
rewrite WinMain() wrapper.
Diffstat (limited to 'src/SPI.cpp')
-rw-r--r-- | src/SPI.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SPI.cpp b/src/SPI.cpp index 3ffb20f..76b5b75 100644 --- a/src/SPI.cpp +++ b/src/SPI.cpp @@ -22,6 +22,7 @@ #include "Config.h" #include "NDS.h" #include "SPI.h" +#include "melon_fopen.h" namespace SPI_Firmware @@ -89,7 +90,7 @@ void Reset() if (Firmware) delete[] Firmware; Firmware = NULL; - FILE* f = Config::GetConfigFile("firmware.bin", "rb"); + FILE* f = melon_fopen_local("firmware.bin", "rb"); if (!f) { printf("firmware.bin not found\n"); @@ -129,7 +130,7 @@ void Reset() // take a backup char* firmbkp = "firmware.bin.bak"; - f = Config::GetConfigFile(firmbkp, "rb"); + f = melon_fopen_local(firmbkp, "rb"); if (f) fclose(f); else { @@ -324,7 +325,7 @@ void Write(u8 val, u32 hold) if (!hold && (CurCmd == 0x02 || CurCmd == 0x0A)) { - FILE* f = Config::GetConfigFile("firmware.bin", "r+b"); + FILE* f = melon_fopen_local("firmware.bin", "r+b"); if (f) { u32 cutoff = 0x7FA00 & FirmwareMask; |