Reset the C64 when invoking start

This commit is contained in:
simon.kagstrom 2010-03-14 12:15:58 +00:00
parent a470e21b63
commit 3eb348a930

View File

@ -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");
}
}