From 57a47a036def842a28d611c1f56c9ed73c71975a Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Mon, 25 Jan 2010 15:23:00 +0000 Subject: [PATCH] Make it possible to load files --- Src/gui/disc_menu.cpp | 6 +++++- Src/gui/gui.cpp | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Src/gui/disc_menu.cpp b/Src/gui/disc_menu.cpp index 5ccd1cd..ae2a74a 100644 --- a/Src/gui/disc_menu.cpp +++ b/Src/gui/disc_menu.cpp @@ -63,7 +63,8 @@ public: save_game = fileName; else save_game = save_game + 1; /* Skip '/' */ - strncpy(Gui::gui->np->DrivePath[0], fileName, sizeof(Gui::gui->np->DrivePath[0])); + snprintf(Gui::gui->np->DrivePath[0], sizeof(Gui::gui->np->DrivePath[0]), + "%s/%s", Gui::gui->game_base_path, fileName); if (ext_matches_list(fileName, prg_exts)) { char tmp_filename[255]; @@ -108,7 +109,10 @@ public: Gui::gui->popView(); if (this->runStartSequence) + { + Gui::gui->exitMenu(); TheC64->startFakeKeySequence("\nLOAD \"*\",8,1\nRUN\n"); + } } virtual void hoverCallback(int which) diff --git a/Src/gui/gui.cpp b/Src/gui/gui.cpp index af51760..3e71ce5 100644 --- a/Src/gui/gui.cpp +++ b/Src/gui/gui.cpp @@ -296,11 +296,10 @@ GuiView *Gui::popView() void Gui::exitMenu() { - printf("Exiting the menu system\n"); - /* Pop all views */ while (this->popView()) ; + ThePrefs = *this->np; TheC64->NewPrefs(this->np); }