* emulation settings dialog

* proper setting for booting directly or from BIOS
* fix shit, again
This commit is contained in:
StapleButter
2017-03-29 20:23:41 +02:00
parent f88226c99f
commit 2db5b21760
7 changed files with 153 additions and 24 deletions

View File

@ -165,8 +165,6 @@ InputConfigDialog::InputConfigDialog(wxWindow* parent)
polltimer = new wxTimer(this);
pollid = 0;
keystate = SDL_GetKeyboardState(&nkeys);
njoys = SDL_NumJoysticks();
if (njoys) joy = SDL_JoystickOpen(0);
}
@ -210,8 +208,27 @@ void InputConfigDialog::OnKeyDown(wxKeyEvent& event)
pollbtn->Refresh();
return;
}
else if ((code == SDL_SCANCODE_BACKSPACE) && (pollid >= 200))
{
id = pollid - 200;
if (id >= 12) return;
if (pollid >= 200) return;
joymapping[id] = -1;
char keyname[16];
JoyMappingName(joymapping[id], keyname);
pollbtn->SetLabel(keyname);
polltimer->Stop();
pollid = 0;
pollbtn->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
pollbtn->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
pollbtn->Refresh();
return;
}
if (pollid >= 12) return;
keymapping[id] = code;
@ -272,23 +289,6 @@ void InputConfigDialog::OnPoll(wxTimerEvent& event)
int id = pollid - 200;
if (id >= 12) return;
if (keystate[SDL_SCANCODE_BACKSPACE])
{
joymapping[id] = -1;
char keyname[16];
JoyMappingName(joymapping[id], keyname);
pollbtn->SetLabel(keyname);
polltimer->Stop();
pollid = 0;
pollbtn->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
pollbtn->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
pollbtn->Refresh();
return;
}
int nbuttons = SDL_JoystickNumButtons(joy);
for (int i = 0; i < nbuttons; i++)
{