Commit b51022b3 authored by jdgleaver's avatar jdgleaver
Browse files

Add 'LOW_MEMORY' build flag to force content loading from file on RAM-limited platforms

parent f2f80a8e
WANT_ZIP=0 WANT_ZIP=0
LOW_MEMORY=0
TARGET_NAME := race TARGET_NAME := race
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
...@@ -333,6 +334,7 @@ else ifeq ($(platform), rs90) ...@@ -333,6 +334,7 @@ else ifeq ($(platform), rs90)
PLATFORM_DEFINES := -DCC_RESAMPLER -DCC_RESAMPLER_NO_HIGHPASS PLATFORM_DEFINES := -DCC_RESAMPLER -DCC_RESAMPLER_NO_HIGHPASS
CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32 CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32
CXXFLAGS += $(CFLAGS) CXXFLAGS += $(CFLAGS)
LOW_MEMORY = 1
# GCW0 # GCW0
else ifeq ($(platform), gcw0) else ifeq ($(platform), gcw0)
...@@ -566,6 +568,10 @@ ifeq ($(WANT_ZIP),1) ...@@ -566,6 +568,10 @@ ifeq ($(WANT_ZIP),1)
FLAGS += -DWANT_ZIP FLAGS += -DWANT_ZIP
endif endif
ifeq ($(LOW_MEMORY), 1)
FLAGS += -DLOW_MEMORY
endif
ifeq (,$(findstring msvc,$(platform))) ifeq (,$(findstring msvc,$(platform)))
FLAGS += -fomit-frame-pointer FLAGS += -fomit-frame-pointer
endif endif
......
...@@ -141,7 +141,11 @@ void retro_set_environment(retro_environment_t cb) ...@@ -141,7 +141,11 @@ void retro_set_environment(retro_environment_t cb)
static const struct retro_system_content_info_override content_overrides[] = { static const struct retro_system_content_info_override content_overrides[] = {
{ {
RACE_EXTENSIONS, /* extensions */ RACE_EXTENSIONS, /* extensions */
#if defined(LOW_MEMORY)
true, /* need_fullpath */
#else
false, /* need_fullpath */ false, /* need_fullpath */
#endif
false /* persistent_data */ false /* persistent_data */
}, },
{ NULL, false, false } { NULL, false, false }
...@@ -333,9 +337,10 @@ bool retro_load_game(const struct retro_game_info *info) ...@@ -333,9 +337,10 @@ bool retro_load_game(const struct retro_game_info *info)
/* Attempt to fetch extended game info */ /* Attempt to fetch extended game info */
if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &info_ext)) if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &info_ext))
{ {
#if !defined(LOW_MEMORY)
content_data = (const unsigned char *)info_ext->data; content_data = (const unsigned char *)info_ext->data;
content_size = info_ext->size; content_size = info_ext->size;
#endif
if (info_ext->file_in_archive) if (info_ext->file_in_archive)
{ {
/* We don't have a 'physical' file in this /* We don't have a 'physical' file in this
...@@ -359,9 +364,6 @@ bool retro_load_game(const struct retro_game_info *info) ...@@ -359,9 +364,6 @@ bool retro_load_game(const struct retro_game_info *info)
if (!info || !info->path) if (!info || !info->path)
return false; return false;
content_data = NULL;
content_size = 0;
strncpy(content_path, info->path, sizeof(content_path)); strncpy(content_path, info->path, sizeof(content_path));
content_path[sizeof(content_path) - 1] = '\0'; content_path[sizeof(content_path) - 1] = '\0';
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment