diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-11-08 18:38:33 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-11-08 18:38:33 -0800 |
commit | 9fed70ee51604f4bdf49dfebad4658c5cc2bfdd1 (patch) | |
tree | 7d254c9b85e2018c79718ab4762d98fbbaf171a8 /menu.c | |
parent | ce3e0b6afab1258cbe01ab82101f2c0f07a578e6 (diff) |
ROM is now run after being selected in menu. Initial path for menu is read from config file.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -58,7 +58,8 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value) menu_context *menu = gen->extra; if (!menu) { gen->extra = menu = calloc(1, sizeof(menu_context)); - menu->curpath = strdup(get_home_dir()); + menu->curpath = tern_find_path(config, "ui\0initial_path\0").ptrval; + menu->curpath = menu->curpath ? strdup(menu->curpath) : strdup(get_home_dir()); } if (menu->state) { uint32_t dst = menu->latch << 16 | value; @@ -137,6 +138,8 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value) case 2: { char buf[4096]; copy_string_from_guest(m68k, dst, buf, sizeof(buf)); + 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; |