Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
RACE
Commits
b51022b3
Commit
b51022b3
authored
Jul 16, 2021
by
jdgleaver
Browse files
Add 'LOW_MEMORY' build flag to force content loading from file on RAM-limited platforms
parent
f2f80a8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
b51022b3
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
...
...
libretro/libretro.c
View file @
b51022b3
...
...
@@ -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'
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment