summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-11-08 22:03:34 -0800
committerMichael Pavone <pavone@retrodev.com>2015-11-08 22:03:34 -0800
commit7d6031ae997cfd08b51e687cc68d11d572b23bf7 (patch)
tree171a5092126e95f3ccd17a8a2c0c98434b7a7e7e /menu.c
parent9fed70ee51604f4bdf49dfebad4658c5cc2bfdd1 (diff)
Make menu stuff work on Android (theoretically)
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/menu.c b/menu.c
index 3266ea6..4631737 100644
--- a/menu.c
+++ b/menu.c
@@ -59,7 +59,15 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value)
if (!menu) {
gen->extra = menu = calloc(1, sizeof(menu_context));
menu->curpath = tern_find_path(config, "ui\0initial_path\0").ptrval;
- menu->curpath = menu->curpath ? strdup(menu->curpath) : strdup(get_home_dir());
+ if (menu->curpath) {
+ menu->curpath = strdup(menu->curpath);
+ } else {
+#ifdef __ANDROID__
+ menu->curpath = strdup(SDL_AndroidGetExternalStoragePath());
+#else
+ menu->curpath = strdup(get_home_dir());
+#endif
+ }
}
if (menu->state) {
uint32_t dst = menu->latch << 16 | value;
@@ -141,7 +149,6 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value)
char *pieces[] = {menu->curpath, "/", buf};
gen->next_rom = alloc_concat_m(3, pieces);
m68k->should_return = 1;
- fprintf(stderr, "MENU: Selected ROM %s\n", buf);
break;
}
default: