- [NEW] Es pot accedir al dialeg de configuracio dels joysticks des del menú
This commit is contained in:
18
main.cpp
18
main.cpp
@@ -36,6 +36,11 @@ namespace actions
|
||||
zxscreen::refresh(dt);
|
||||
}
|
||||
|
||||
void exitButNotContinue()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
int fastload(int value)
|
||||
{
|
||||
zx_tape::toggleOption(ZXTAPE_OPTION_FAST_LOAD);
|
||||
@@ -107,6 +112,13 @@ namespace actions
|
||||
zx_system::shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int configureJoysticks(int value)
|
||||
{
|
||||
ui::setDialog(dialogs::joysticks::show);
|
||||
ui::menu::exitButNotContinue();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void init_menu()
|
||||
@@ -144,6 +156,8 @@ void init_menu()
|
||||
menu = ui::menu::addsubmenu("EMULATION");
|
||||
ui::menu::addbooloption(menu, "STOP ON INVALID OP", z80::getOption(Z80_OPTION_STOP_ON_INVALID), actions::decZoom);
|
||||
ui::menu::addoption(menu, "SHOW ANALYZER", actions::showAnalyzer);
|
||||
ui::menu::addoption(menu, "CONFIGURE JOYSTICKS", actions::configureJoysticks);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -178,9 +192,7 @@ int main(int argc, char *argv[])
|
||||
if (e.type == SDL_JOYDEVICEADDED) {
|
||||
const uint8_t index = gamepad::add(e.jdevice.which, GAMEPAD_TYPE_ANY);
|
||||
printf("JOYSTICK CONECTAT: %i\n", e.jdevice.which);
|
||||
//if (!first_time)
|
||||
dialogs::joysticks::init(index);
|
||||
// [TODO] Mostrar dialeg de triar tipus de joystick
|
||||
if (!first_time) dialogs::joysticks::init(index);
|
||||
}
|
||||
if (e.type == SDL_JOYDEVICEREMOVED) {
|
||||
gamepad::remove(e.jdevice.which);
|
||||
|
||||
Reference in New Issue
Block a user