summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blastem.c4
-rw-r--r--nuklear_ui/blastem_nuklear.c26
2 files changed, 24 insertions, 6 deletions
diff --git a/blastem.c b/blastem.c
index 40077f9..24c1ecd 100644
--- a/blastem.c
+++ b/blastem.c
@@ -562,7 +562,9 @@ int main(int argc, char ** argv)
current_system = menu_system;
menu = 1;
}
- current_system->resume_context(current_system);
+ if (!current_system->next_rom) {
+ current_system->resume_context(current_system);
+ }
} else {
break;
}
diff --git a/nuklear_ui/blastem_nuklear.c b/nuklear_ui/blastem_nuklear.c
index 8ff1821..694ba7b 100644
--- a/nuklear_ui/blastem_nuklear.c
+++ b/nuklear_ui/blastem_nuklear.c
@@ -23,7 +23,7 @@ void view_play(struct nk_context *context)
}
-void view_load(struct nk_context *context)
+void view_file_browser(struct nk_context *context, uint8_t normal_open)
{
static char *current_path;
static dir_entry *entries;
@@ -79,11 +79,16 @@ void view_load(struct nk_context *context)
free_dir_list(entries, num_entries);
entries = NULL;
} else {
- if (current_system) {
- current_system->next_rom = full_path;
- current_system->request_exit(current_system);
+ if(normal_open) {
+ if (current_system) {
+ current_system->next_rom = full_path;
+ current_system->request_exit(current_system);
+ } else {
+ init_system_with_media(full_path, SYSTEM_UNKNOWN);
+ free(full_path);
+ }
} else {
- init_system_with_media(full_path, SYSTEM_UNKNOWN);
+ lockon_media(full_path);
free(full_path);
}
current_view = view_play;
@@ -93,6 +98,16 @@ void view_load(struct nk_context *context)
}
}
+void view_load(struct nk_context *context)
+{
+ view_file_browser(context, 1);
+}
+
+void view_lock_on(struct nk_context *context)
+{
+ view_file_browser(context, 0);
+}
+
void view_about(struct nk_context *context)
{
}
@@ -191,6 +206,7 @@ void view_pause(struct nk_context *context)
static menu_item items[] = {
{"Resume", view_play},
{"Load ROM", view_load},
+ {"Lock On", view_lock_on},
{"Save State", view_save_state},
{"Load State", view_load_state},
{"Exit", NULL}