mirror of
https://github.com/libretro/Mu.git
synced 2026-09-24 15:46:20 +00:00
Fill initial RAM with garbage so PalmOS is much more likely to find it invalid; Add RetroArch run command if it exists in PATH.
This commit is contained in:
@@ -32,6 +32,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set(MU_LIBRETRO_DIR "$ENV{APPDATA}/RetroArch")
|
||||
endif()
|
||||
else()
|
||||
find_program(RETROARCH_APP retroarch)
|
||||
if(RETROARCH_APP)
|
||||
get_filename_component(MU_LIBRETRO_DIR "${RETROARCH_APP}" DIRECTORY)
|
||||
endif()
|
||||
|
||||
set(MU_LIBRETRO_EXTENSION "")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -712,12 +712,16 @@ bool retro_load_game(const struct retro_game_info *info){
|
||||
strlcat(saveRamPath, osVersion, PATH_MAX_LENGTH);
|
||||
strlcat(saveRamPath, ".ram", PATH_MAX_LENGTH);
|
||||
saveRamFile = filestream_open(saveRamPath, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if(saveRamFile){
|
||||
hasSram = true;
|
||||
|
||||
// There is now always SRAM because it gets initialized to garbage
|
||||
hasSram = true;
|
||||
|
||||
if(saveRamFile) {
|
||||
if(filestream_get_size(saveRamFile) == emulatorGetRamSize()){
|
||||
filestream_read(saveRamFile, palmRam, emulatorGetRamSize());
|
||||
swap16BufferIfLittle(palmRam, emulatorGetRamSize() / sizeof(uint16_t));
|
||||
}
|
||||
|
||||
filestream_close(saveRamFile);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user