Merge pull request #7853 from Wiimpathy/Wii_fixes

WII: Fix .cfg not found with loaders + compiling with external libogc
This commit is contained in:
Twinaphex 2018-12-31 20:38:11 +01:00 committed by GitHub
commit b9c6cdf50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View File

@ -158,8 +158,6 @@ else ifeq ($(libogc_platform), 1)
endif
endif
LIBS += -logc
ifeq ($(EXTERNAL_LIBOGC), 1)
LIBS += -lfat
endif
@ -176,6 +174,8 @@ else ifeq ($(libogc_platform), 1)
endif
endif
LIBS += -logc
CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
HAVE_RUNAHEAD := 1

View File

@ -42,12 +42,13 @@ endif
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map
LIBS := -lwiiuse -logc -lbte
ifeq ($(EXTERNAL_LIBOGC), 1)
LIBS += -lfat
LIBS := -lfat
endif
LIBS += -lwiiuse -logc -lbte
APP_BOOTER_DIR = wii/app_booter
OBJ = frontend/frontend_salamander.o \

View File

@ -209,7 +209,21 @@ static void frontend_gx_get_environment_settings(
chdir("carda:/retroarch");
#endif
getcwd(g_defaults.dirs[DEFAULT_DIR_CORE], PATH_MAX_LENGTH);
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
/* When using external loaders(Wiiflow etc.), getcwd doesn't return the path correctly and
* as a result the cfg file is not found. */
if (*argc > 2 && argv[1] != NULL && argv[2] != NULL)
{
if(gx_devices[GX_DEVICE_SD].mounted)
{
chdir("sd:/");
}
else if(gx_devices[GX_DEVICE_USB].mounted)
{
chdir("usb:/");
}
}
#endif
last_slash = strrchr(g_defaults.dirs[DEFAULT_DIR_CORE], '/');
if (last_slash)
*last_slash = 0;