From 3eb348a9308d624b5d6f0dea997376c7e121c48a Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sun, 14 Mar 2010 12:15:58 +0000 Subject: [PATCH] Reset the C64 when invoking start --- Src/gui/disc_menu.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Src/gui/disc_menu.cpp b/Src/gui/disc_menu.cpp index e25186d..63838e2 100644 --- a/Src/gui/disc_menu.cpp +++ b/Src/gui/disc_menu.cpp @@ -61,6 +61,24 @@ public: } }; +class StartGameListener : public TimeoutHandler +{ +public: + StartGameListener() + { + Gui::gui->status_bar->queueMessage("Resetting the C64"); + TheC64->Reset(); + Gui::gui->timerController->arm(this, 4000); + } + + virtual void timeoutCallback() + { + Gui::gui->status_bar->queueMessage("Invoking the load sequence"); + TheC64->startFakeKeySequence("\nLOAD \"*\",8,1\nRUN\n"); + delete this; + } +}; + class DiscMenu : public FileBrowser, TimeoutHandler { friend class DiscView; @@ -139,9 +157,10 @@ public: { /* Timeout and save the screenshot if there isn't one */ new SaveScreenshot(); + /* And the start sequence */ + new StartGameListener(); Gui::gui->exitMenu(); - TheC64->startFakeKeySequence("\nLOAD \"*\",8,1\nRUN\n"); } }