cli: fix boost input detection
until now, the boost key was hardcoded to 'o' even when the config said otherwise, and not treated in case of a joypad at all. when triggered with the o key, it even behaved differently than the gtk ui - the boost wasn't released together with the key, but only when pressed again, so it was more like a shortcut for "disable fps limiter". this change implements the desired outcome of the second part of PR #822, but without introducing more hacks and relying on magic values. closes #822
This commit is contained in:
parent
58bbe693e1
commit
3ddb2669a9
|
@ -255,7 +255,6 @@ EXPORTED int desmume_draw_window_init(BOOL auto_pause, BOOL use_opengl_if_possib
|
||||||
// TODO: Make configurable instead.
|
// TODO: Make configurable instead.
|
||||||
load_default_config(cli_kb_cfg);
|
load_default_config(cli_kb_cfg);
|
||||||
|
|
||||||
ctrls_cfg.boost = 0;
|
|
||||||
ctrls_cfg.sdl_quit = 0;
|
ctrls_cfg.sdl_quit = 0;
|
||||||
ctrls_cfg.auto_pause = auto_pause;
|
ctrls_cfg.auto_pause = auto_pause;
|
||||||
ctrls_cfg.focused = 1;
|
ctrls_cfg.focused = 1;
|
||||||
|
|
|
@ -546,7 +546,6 @@ int main(int argc, char ** argv) {
|
||||||
osd = new OSDCLASS(-1);
|
osd = new OSDCLASS(-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ctrls_cfg.boost = 0;
|
|
||||||
ctrls_cfg.sdl_quit = 0;
|
ctrls_cfg.sdl_quit = 0;
|
||||||
ctrls_cfg.auto_pause = my_config.auto_pause;
|
ctrls_cfg.auto_pause = my_config.auto_pause;
|
||||||
ctrls_cfg.focused = 1;
|
ctrls_cfg.focused = 1;
|
||||||
|
@ -577,7 +576,7 @@ int main(int argc, char ** argv) {
|
||||||
#ifdef DISPLAY_FPS
|
#ifdef DISPLAY_FPS
|
||||||
now = SDL_GetTicks();
|
now = SDL_GetTicks();
|
||||||
#endif
|
#endif
|
||||||
if ( !my_config.disable_limiter && !ctrls_cfg.boost) {
|
if ( !my_config.disable_limiter && !(ctrls_cfg.keypad & KEYMASK_(KEY_BOOST - 1))) {
|
||||||
#ifndef DISPLAY_FPS
|
#ifndef DISPLAY_FPS
|
||||||
now = SDL_GetTicks();
|
now = SDL_GetTicks();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -430,7 +430,6 @@ do_process_joystick_events( u16 *keypad, SDL_Event *event) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Joystick button pressed */
|
/* Joystick button pressed */
|
||||||
/* FIXME: Add support for BOOST */
|
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
key_code = ((event->jbutton.which & 15) << 12) | JOY_BUTTON << 8 | (event->jbutton.button & 255);
|
key_code = ((event->jbutton.which & 15) << 12) | JOY_BUTTON << 8 | (event->jbutton.button & 255);
|
||||||
key = lookup_joy_key( key_code );
|
key = lookup_joy_key( key_code );
|
||||||
|
@ -536,15 +535,6 @@ process_ctrls_event( SDL_Event& event,
|
||||||
driver->AddLine("Fake mic disabled");
|
driver->AddLine("Fake mic disabled");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case SDLK_o:
|
|
||||||
cfg->boost = !cfg->boost;
|
|
||||||
if (cfg->boost)
|
|
||||||
driver->AddLine("Boost mode enabled");
|
|
||||||
else
|
|
||||||
driver->AddLine("Boost mode disabled");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDLK_LSHIFT:
|
case SDLK_LSHIFT:
|
||||||
shift_pressed &= ~1;
|
shift_pressed &= ~1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -89,7 +89,6 @@ struct ctrls_event_config {
|
||||||
int auto_pause;
|
int auto_pause;
|
||||||
int focused;
|
int focused;
|
||||||
int sdl_quit;
|
int sdl_quit;
|
||||||
int boost;
|
|
||||||
int fake_mic;
|
int fake_mic;
|
||||||
void *screen_texture;
|
void *screen_texture;
|
||||||
void (*resize_cb)(u16 width, u16 height, void *screen_texture);
|
void (*resize_cb)(u16 width, u16 height, void *screen_texture);
|
||||||
|
|
Loading…
Reference in New Issue