From 6576b3c499a0e7630e81c53739201c4cd11259fc Mon Sep 17 00:00:00 2001 From: radius Date: Wed, 8 Feb 2017 20:10:45 -0500 Subject: [PATCH] let this be like it was for standalone --- src/NDS.cpp | 12 +++++++++++- src/SPI.cpp | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/NDS.cpp b/src/NDS.cpp index 40416717..dbe04cdb 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -29,8 +29,10 @@ #include "RTC.h" #include "Wifi.h" +#ifdef __LIBRETRO__ extern char retro_base_directory[4096]; extern char retro_game_path[4096]; +#endif namespace NDS { @@ -222,11 +224,15 @@ void Reset() FILE* f; u32 i; +#ifdef __LIBRETRO__ char path[2048]; snprintf(path, sizeof(path), "%s/bios9.bin", retro_base_directory); f = fopen(path, "rb"); +#else + f = fopen("bios9.bin", "rb"); +#endif if (!f) - printf("ARM9 BIOS not found at %s\n"); + printf("ARM9 BIOS not found\n"); else { fseek(f, 0, SEEK_SET); @@ -236,8 +242,12 @@ void Reset() fclose(f); } +#ifdef __LIBRETRO__ snprintf(path, sizeof(path), "%s/bios7.bin", retro_base_directory); f = fopen(path, "rb"); +#else + f = fopen("bios7.bin", "rb"); +#endif if (!f) printf("ARM7 BIOS not found\n"); else diff --git a/src/SPI.cpp b/src/SPI.cpp index 34cb1d7b..5dd4ae15 100644 --- a/src/SPI.cpp +++ b/src/SPI.cpp @@ -21,7 +21,9 @@ #include "NDS.h" #include "SPI.h" +#ifdef __LIBRETRO__ extern char retro_base_directory[4096]; +#endif namespace SPI_Firmware { @@ -87,10 +89,13 @@ void Reset() { if (Firmware) delete[] Firmware; Firmware = NULL; - +#ifdef __LIBRETRO__ char path[2047]; snprintf(path, sizeof(path), "%s/firmware.bin", retro_base_directory); FILE* f = fopen(path, "rb"); +#else + FILE* f = fopen("firmware.bin", "rb"); +#endif if (!f) { printf("firmware.bin not found\n");