Fix for MT03621: Hitting F6 without -cheat trigger causes crash

now cheat toggling has no effect if there is no OPTION_CHEAT among mame_options().
This commit is contained in:
Fabio Priuli 2010-01-06 16:03:02 +00:00
parent ca5e8764f2
commit 49b2d89ab2
2 changed files with 4 additions and 4 deletions

View File

@ -1238,8 +1238,8 @@ static UINT32 handler_ingame(running_machine *machine, UINT32 state)
mame_pause(machine, !mame_is_paused(machine)); mame_pause(machine, !mame_is_paused(machine));
} }
/* handle a toggle cheats request */ /* handle a toggle cheats request, but only if cheats are on */
if (ui_input_pressed(machine, IPT_UI_TOGGLE_CHEAT)) if (options_get_bool(mame_options(), OPTION_CHEAT) && ui_input_pressed(machine, IPT_UI_TOGGLE_CHEAT))
cheat_set_global_enable(machine, !cheat_get_global_enable(machine)); cheat_set_global_enable(machine, !cheat_get_global_enable(machine));
/* toggle movie recording */ /* toggle movie recording */

View File

@ -1221,8 +1221,8 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
if (!ignorepause && exclusive_input_pressed(menu, IPT_UI_PAUSE, 0)) if (!ignorepause && exclusive_input_pressed(menu, IPT_UI_PAUSE, 0))
mame_pause(menu->machine, !mame_is_paused(menu->machine)); mame_pause(menu->machine, !mame_is_paused(menu->machine));
/* handle a toggle cheats request */ /* handle a toggle cheats request, but only if cheats are on */
if (ui_input_pressed_repeat(menu->machine, IPT_UI_TOGGLE_CHEAT, 0)) if (options_get_bool(mame_options(), OPTION_CHEAT) && ui_input_pressed_repeat(menu->machine, IPT_UI_TOGGLE_CHEAT, 0))
cheat_set_global_enable(menu->machine, !cheat_get_global_enable(menu->machine)); cheat_set_global_enable(menu->machine, !cheat_get_global_enable(menu->machine));
/* see if any other UI keys are pressed */ /* see if any other UI keys are pressed */