-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save SRAM and state on Android shutdown #17577
base: master
Are you sure you want to change the base?
Conversation
location/drivers/android.c
Outdated
/* Flush SRAM to disk */ | ||
command_event(CMD_EVENT_SAVE_FILES, NULL); | ||
|
||
/* TODO: Save config? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As hinted at by the original PR, there's this UWP function that seems to save the config:
Line 515 in 73bc409
if (config_save_file(config_path)) |
I'm not sure if these two functions are supposed to be functionally equivalent.
androidlocation_t *androidlocation = (androidlocation_t*)data; | ||
JNIEnv *env = jni_thread_getenv(); | ||
if (!env) | ||
if (!androidlocation || !env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why the original PR added this check. If androidlocation
is nullptr, handling it like this is probably wrong.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 Probably in case the app was told to stop multiple times, to avoid multiple unnecessary writes? Not sure it really matters, the calls are supposed to be smart enough to know that nothing needs to be written.
The original PR replicated the code changes in the header (!) inside AFAICT, |
return; | ||
|
||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the iOS version: https://github.com/libretro/RetroArch/blob/master/ui/drivers/ui_cocoatouch.m#L793
We can see that the only event called is CMD_EVENT_SAVE_FILES
. I commented out this code block for now but left the code until I gain more clarity from the discussion in other threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS is probably wrong here.
Guidelines
Description
Bring relevant changes in #14804 forward to latest upstream.
Related Issues
#14518
Reviewers
@hizzlekizzle
@warmenhoven