let this be like it was for standalone

This commit is contained in:
radius 2017-02-08 20:10:45 -05:00
parent 048a1058b8
commit 812c72cc90
2 changed files with 22 additions and 2 deletions

17
NDS.cpp
View File

@ -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
}

View File

@ -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");