Add start sequence faking

This commit is contained in:
simon.kagstrom 2010-01-25 10:59:08 +00:00
parent 6d8fd6fc92
commit 5a0a4dbb82
3 changed files with 24 additions and 4 deletions

View File

@ -1,5 +1,7 @@
#include <unistd.h> /* unlink */
#include <C64.h>
#include "menu.hh"
#include "file_browser.hh"
#include "game_info.hh"
@ -25,6 +27,8 @@ public:
void setDirectory(const char *path);
void runStartSequence(bool what);
/* Inherited */
void runLogic();
@ -43,6 +47,7 @@ public:
DiscMenu(Font *font) :
FileBrowser(game_exts, font), TimeoutHandler()
{
this->runStartSequence = false;
}
~DiscMenu()
@ -101,6 +106,9 @@ public:
else
Gui::gui->updateGameInfo(new GameInfo(fileName));
Gui::gui->popView();
if (this->runStartSequence)
TheC64->startFakeKeySequence("\nLOAD \"*\",8,1\nRUN\n");
}
virtual void hoverCallback(int which)
@ -120,6 +128,8 @@ public:
Gui::gui->timerController->disarm(this);
Gui::gui->popView();
}
bool runStartSequence;
};
@ -145,6 +155,11 @@ void DiscView::setDirectory(const char *path)
this->menu->setDirectory(path);
}
void DiscView::runStartSequence(bool what)
{
this->menu->runStartSequence = what;
}
void DiscView::runLogic()
{
this->menu->runLogic();

View File

@ -57,10 +57,10 @@ public:
this->updatePauseState();
break;
case 2: /* Insert disc */
if (this->p_submenus[0].sel == 0) {
Gui::gui->dv->setDirectory("discs");
Gui::gui->pushView(Gui::gui->dv);
}
Gui::gui->dv->runStartSequence(this->p_submenus[0].sel == 1);
break;
case 4: /* Load/save states */
break;

View File

@ -33,6 +33,11 @@ public:
return this->have_a_break;
}
void startFakeKeySequence(const char *what)
{
printf("Faking %s\n", what);
}
int network_connection_type;
private: