mirror of
https://github.com/holub/mame
synced 2025-06-03 19:36:26 +03:00
Added DEBUG_FLAG_OSD_ENABLED to allow coexistence of debuggers going forward.
Replaced all occurrences of OPTION_DEBUG in src/osd/* by checking machine->debug_flags Replaced all occurrences of DEBUG_FLAG_ENABLED in src/osd/* by DEBUG_FLAG_OSD_ENABLED For the time being, DEBUG_FLAG_OSD_ENABLED is default (set in mame.c) Debugger: avoid clearing DEBUG_FLAG_OSD_ENABLED
This commit is contained in:
parent
7b3fa34c6a
commit
88946d721a
@ -2000,8 +2000,9 @@ static void compute_debug_flags(running_device *device)
|
|||||||
running_machine *machine = device->machine;
|
running_machine *machine = device->machine;
|
||||||
debugcpu_private *global = machine->debugcpu_data;
|
debugcpu_private *global = machine->debugcpu_data;
|
||||||
|
|
||||||
/* clear out all global flags by default */
|
/* clear out global flags by default, keep DEBUG_FLAG_OSD_ENABLED */
|
||||||
machine->debug_flags = DEBUG_FLAG_ENABLED;
|
machine->debug_flags &= DEBUG_FLAG_OSD_ENABLED;
|
||||||
|
machine->debug_flags |= DEBUG_FLAG_ENABLED;
|
||||||
|
|
||||||
/* if we are ignoring this CPU, or if events are pending, we're done */
|
/* if we are ignoring this CPU, or if events are pending, we're done */
|
||||||
if ((info->flags & DEBUG_FLAG_OBSERVING) == 0 || mame_is_scheduled_event_pending(machine) || mame_is_save_or_load_pending(machine))
|
if ((info->flags & DEBUG_FLAG_OBSERVING) == 0 || mame_is_scheduled_event_pending(machine) || mame_is_save_or_load_pending(machine))
|
||||||
|
@ -1317,7 +1317,7 @@ running_machine::running_machine(const game_driver *driver)
|
|||||||
|
|
||||||
/* fetch core options */
|
/* fetch core options */
|
||||||
sample_rate = options_get_int(mame_options(), OPTION_SAMPLERATE);
|
sample_rate = options_get_int(mame_options(), OPTION_SAMPLERATE);
|
||||||
debug_flags = options_get_bool(mame_options(), OPTION_DEBUG) ? (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) : 0;
|
debug_flags = options_get_bool(mame_options(), OPTION_DEBUG) ? (DEBUG_FLAG_ENABLED | DEBUG_FLAG_OSD_ENABLED | DEBUG_FLAG_CALL_HOOK) : 0;
|
||||||
}
|
}
|
||||||
catch (std::bad_alloc &)
|
catch (std::bad_alloc &)
|
||||||
{
|
{
|
||||||
|
@ -62,6 +62,7 @@ enum
|
|||||||
#define DEBUG_FLAG_WPW_PROGRAM 0x00000100 /* watchpoints are enabled for PROGRAM memory writes */
|
#define DEBUG_FLAG_WPW_PROGRAM 0x00000100 /* watchpoints are enabled for PROGRAM memory writes */
|
||||||
#define DEBUG_FLAG_WPW_DATA 0x00000200 /* watchpoints are enabled for DATA memory writes */
|
#define DEBUG_FLAG_WPW_DATA 0x00000200 /* watchpoints are enabled for DATA memory writes */
|
||||||
#define DEBUG_FLAG_WPW_IO 0x00000400 /* watchpoints are enabled for IO memory writes */
|
#define DEBUG_FLAG_WPW_IO 0x00000400 /* watchpoints are enabled for IO memory writes */
|
||||||
|
#define DEBUG_FLAG_OSD_ENABLED 0x00001000 /* The OSD debugger is enabled */
|
||||||
|
|
||||||
|
|
||||||
/* MESS vs. MAME abstractions */
|
/* MESS vs. MAME abstractions */
|
||||||
|
@ -1118,7 +1118,7 @@ void sdlinput_init(running_machine *machine)
|
|||||||
// register the mice
|
// register the mice
|
||||||
sdlinput_register_mice(machine);
|
sdlinput_register_mice(machine);
|
||||||
|
|
||||||
if (machine->debug_flags & DEBUG_FLAG_ENABLED)
|
if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
{
|
{
|
||||||
mame_printf_warning("Debug Build: Disabling input grab for -debug\n");
|
mame_printf_warning("Debug Build: Disabling input grab for -debug\n");
|
||||||
mouse_enabled = 0;
|
mouse_enabled = 0;
|
||||||
|
@ -541,7 +541,7 @@ void osd_init(running_machine *machine)
|
|||||||
defines_verbose();
|
defines_verbose();
|
||||||
|
|
||||||
if (!SDLMAME_HAS_DEBUGGER)
|
if (!SDLMAME_HAS_DEBUGGER)
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
{
|
{
|
||||||
mame_printf_error("sdlmame: -debug not supported on X11-less builds\n\n");
|
mame_printf_error("sdlmame: -debug not supported on X11-less builds\n\n");
|
||||||
osd_exit(machine);
|
osd_exit(machine);
|
||||||
|
@ -354,7 +354,7 @@ void osd_update(running_machine *machine, int skip_redraw)
|
|||||||
sdlinput_poll(machine);
|
sdlinput_poll(machine);
|
||||||
check_osd_inputs(machine);
|
check_osd_inputs(machine);
|
||||||
|
|
||||||
if (machine->debug_flags & DEBUG_FLAG_ENABLED)
|
if ((machine->debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
|
||||||
debugwin_update_during_game(machine);
|
debugwin_update_during_game(machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ static void extract_video_config(running_machine *machine)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
video_config.windowed = TRUE;
|
video_config.windowed = TRUE;
|
||||||
|
|
||||||
stemp = options_get_string(mame_options(), SDLOPTION_EFFECT);
|
stemp = options_get_string(mame_options(), SDLOPTION_EFFECT);
|
||||||
|
@ -510,7 +510,7 @@ static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt )
|
|||||||
ASSERT_WINDOW_THREAD();
|
ASSERT_WINDOW_THREAD();
|
||||||
|
|
||||||
// if we are in debug mode, never go full screen
|
// if we are in debug mode, never go full screen
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
if (window->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// If we are going fullscreen (leaving windowed) remember our windowed size
|
// If we are going fullscreen (leaving windowed) remember our windowed size
|
||||||
@ -642,7 +642,7 @@ static void sdlwindow_update_cursor_state(running_machine *machine, sdl_window_i
|
|||||||
#if (SDL_VERSION_ATLEAST(1,3,0))
|
#if (SDL_VERSION_ATLEAST(1,3,0))
|
||||||
// do not do mouse capture if the debugger's enabled to avoid
|
// do not do mouse capture if the debugger's enabled to avoid
|
||||||
// the possibility of losing control
|
// the possibility of losing control
|
||||||
if (!options_get_bool(mame_options(), OPTION_DEBUG))
|
if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
||||||
{
|
{
|
||||||
//FIXME: SDL1.3: really broken: the whole SDL code
|
//FIXME: SDL1.3: really broken: the whole SDL code
|
||||||
// will only work correct with relative mouse movements ...
|
// will only work correct with relative mouse movements ...
|
||||||
@ -665,7 +665,7 @@ static void sdlwindow_update_cursor_state(running_machine *machine, sdl_window_i
|
|||||||
#else
|
#else
|
||||||
// do not do mouse capture if the debugger's enabled to avoid
|
// do not do mouse capture if the debugger's enabled to avoid
|
||||||
// the possibility of losing control
|
// the possibility of losing control
|
||||||
if (!options_get_bool(mame_options(), OPTION_DEBUG))
|
if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
||||||
{
|
{
|
||||||
if ( window->fullscreen || sdlinput_should_hide_mouse(machine) )
|
if ( window->fullscreen || sdlinput_should_hide_mouse(machine) )
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ void winvideo_init(running_machine *machine)
|
|||||||
SetForegroundWindow(win_window_list->hwnd);
|
SetForegroundWindow(win_window_list->hwnd);
|
||||||
|
|
||||||
// possibly create the debug window, but don't show it yet
|
// possibly create the debug window, but don't show it yet
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
debugwin_init_windows();
|
debugwin_init_windows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ static void extract_video_config(running_machine *machine)
|
|||||||
video_config.numscreens = options_get_int(mame_options(), WINOPTION_NUMSCREENS);
|
video_config.numscreens = options_get_int(mame_options(), WINOPTION_NUMSCREENS);
|
||||||
|
|
||||||
// if we are in debug mode, never go full screen
|
// if we are in debug mode, never go full screen
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
video_config.windowed = TRUE;
|
video_config.windowed = TRUE;
|
||||||
stemp = options_get_string(mame_options(), WINOPTION_EFFECT);
|
stemp = options_get_string(mame_options(), WINOPTION_EFFECT);
|
||||||
if (strcmp(stemp, "none") != 0)
|
if (strcmp(stemp, "none") != 0)
|
||||||
|
@ -301,7 +301,7 @@ static void winwindow_exit(running_machine *machine)
|
|||||||
assert(GetCurrentThreadId() == main_threadid);
|
assert(GetCurrentThreadId() == main_threadid);
|
||||||
|
|
||||||
// possibly kill the debug window
|
// possibly kill the debug window
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
debugwin_destroy_windows();
|
debugwin_destroy_windows();
|
||||||
|
|
||||||
// free all the windows
|
// free all the windows
|
||||||
@ -386,7 +386,7 @@ void winwindow_process_events(running_machine *machine, int ingame)
|
|||||||
assert(GetCurrentThreadId() == main_threadid);
|
assert(GetCurrentThreadId() == main_threadid);
|
||||||
|
|
||||||
// if we're running, disable some parts of the debugger
|
// if we're running, disable some parts of the debugger
|
||||||
if (ingame && (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
|
if (ingame && (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
|
||||||
debugwin_update_during_game(machine);
|
debugwin_update_during_game(machine);
|
||||||
|
|
||||||
// remember the last time we did this
|
// remember the last time we did this
|
||||||
@ -514,8 +514,9 @@ void winwindow_toggle_full_screen(void)
|
|||||||
assert(GetCurrentThreadId() == main_threadid);
|
assert(GetCurrentThreadId() == main_threadid);
|
||||||
|
|
||||||
// if we are in debug mode, never go full screen
|
// if we are in debug mode, never go full screen
|
||||||
if (options_get_bool(mame_options(), OPTION_DEBUG))
|
for (window = win_window_list; window != NULL; window = window->next)
|
||||||
return;
|
if (window->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||||
|
return;
|
||||||
|
|
||||||
// toggle the window mode
|
// toggle the window mode
|
||||||
video_config.windowed = !video_config.windowed;
|
video_config.windowed = !video_config.windowed;
|
||||||
|
@ -339,7 +339,7 @@ void osd_init(running_machine *machine)
|
|||||||
const char *stemp;
|
const char *stemp;
|
||||||
|
|
||||||
// thread priority
|
// thread priority
|
||||||
if (!options_get_bool(mame_options(), OPTION_DEBUG))
|
if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
||||||
SetThreadPriority(GetCurrentThread(), options_get_int(mame_options(), WINOPTION_PRIORITY));
|
SetThreadPriority(GetCurrentThread(), options_get_int(mame_options(), WINOPTION_PRIORITY));
|
||||||
|
|
||||||
// ensure we get called on the way out
|
// ensure we get called on the way out
|
||||||
|
Loading…
Reference in New Issue
Block a user