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