diff --git a/NDS.cpp b/NDS.cpp index 9da3755a..43ff8d34 100644 --- a/NDS.cpp +++ b/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 { @@ -221,11 +223,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); @@ -235,8 +241,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 @@ -312,8 +322,13 @@ void Reset() // test //LoadROM(); //LoadFirmware(); +#ifdef __LIBRETRO__ if (NDSCart::LoadROM(retro_game_path)) Running = true; // hax +#else + if (NDSCart::LoadROM("nsmb.nds")) + Running = true; // hax +#endif } diff --git a/SPI.cpp b/SPI.cpp index fd3a615e..1e78b9af 100644 --- a/SPI.cpp +++ b/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");