mirror of
https://github.com/holub/mame
synced 2025-06-02 10:59:52 +03:00
**FOR REVIEW**
Log: Added preliminary support for saving debugger window locations. [Andrew Gardner] (Notes) * I only save the values for the SDL debugger for now. * There is no loading of these values yet, but if this patch is confirmed good, loading should be relatively straightforward to add. * There is a slight chance this might not compile on OSes other than linux. I will be available via e-mail for the next 10 hours and will assist with any compilation problems if they occur. * The patch seems like the "right way" to do things, but if I am doing anything suspect, please feel free to make suggestions and corrections.
This commit is contained in:
parent
1f6995b11c
commit
79aab2108b
@ -11,6 +11,7 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "debugger.h"
|
||||
#include "osdepend.h"
|
||||
#include "debug/debugcpu.h"
|
||||
#include "debug/debugcmd.h"
|
||||
#include "debug/debugcon.h"
|
||||
@ -89,6 +90,9 @@ void debugger_init(running_machine *machine)
|
||||
|
||||
/* listen in on the errorlog */
|
||||
machine->add_logerror_callback(debug_errorlog_write_line);
|
||||
|
||||
/* initialize osd debugger features */
|
||||
osd_init_debugger(machine);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,7 @@ class device_t;
|
||||
-----------------------------------------------------------------------------*/
|
||||
void osd_init(running_machine *machine);
|
||||
|
||||
void osd_init_debugger(running_machine *machine);
|
||||
void osd_wait_for_debugger(device_t *device, int firststop);
|
||||
|
||||
|
||||
|
@ -135,6 +135,15 @@ void osd_init(running_machine *machine)
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_init_debugger
|
||||
//============================================================
|
||||
|
||||
void osd_init_debugger(running_machine *machine)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_wait_for_debugger
|
||||
//============================================================
|
||||
|
@ -62,6 +62,14 @@ static void debugwin_view_update(debug_view &view, void *osdprivate);
|
||||
static void console_create_window(running_machine *machine);
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_init_debugger
|
||||
//============================================================
|
||||
|
||||
void osd_init_debugger(running_machine *machine)
|
||||
{
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_wait_for_debugger
|
||||
//============================================================
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "debug-sup.h"
|
||||
#include "debug-cb.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
//============================================================
|
||||
// PARAMETERS
|
||||
//============================================================
|
||||
@ -87,7 +89,6 @@ static win_i *win_list;
|
||||
|
||||
static void debugmain_init(running_machine *machine);
|
||||
|
||||
|
||||
//============================================================
|
||||
// run_func_on_win_list
|
||||
//============================================================
|
||||
@ -444,6 +445,69 @@ static void debugmain_set_cpu(running_device *device)
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// configuration_load
|
||||
//============================================================
|
||||
|
||||
static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode)
|
||||
{
|
||||
/* we only care about game files */
|
||||
if (config_type != CONFIG_TYPE_GAME)
|
||||
return;
|
||||
|
||||
/* might not have any data */
|
||||
if (parentnode == NULL)
|
||||
return;
|
||||
|
||||
// debug // printf("CONFIG LOAD\n");
|
||||
//gtk_window_move(GTK_WINDOW(dmain->win), 100, 100);
|
||||
//gtk_window_resize(GTK_WINDOW(dmain->win), 1000, 500);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// configuration_save
|
||||
//============================================================
|
||||
|
||||
static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode)
|
||||
{
|
||||
/* we only care about game files */
|
||||
if (config_type != CONFIG_TYPE_GAME)
|
||||
return;
|
||||
|
||||
// Loop over all the nodes
|
||||
for(win_i *p = win_list; p != NULL; p = p->next)
|
||||
{
|
||||
/* create a node */
|
||||
xml_data_node *debugger_node;
|
||||
debugger_node = xml_add_child(parentnode, "window", NULL);
|
||||
|
||||
xml_set_attribute_int(debugger_node, "type", p->type);
|
||||
|
||||
if (debugger_node != NULL)
|
||||
{
|
||||
int x, y;
|
||||
gtk_window_get_position(GTK_WINDOW(p->win), &x, &y);
|
||||
xml_set_attribute_int(debugger_node, "position_x", x);
|
||||
xml_set_attribute_int(debugger_node, "position_y", y);
|
||||
|
||||
gtk_window_get_size(GTK_WINDOW(p->win), &x, &y);
|
||||
xml_set_attribute_int(debugger_node, "size_x", x);
|
||||
xml_set_attribute_int(debugger_node, "size_y", y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_init_debugger
|
||||
//============================================================
|
||||
|
||||
void osd_init_debugger(running_machine *machine)
|
||||
{
|
||||
/* register callbacks */
|
||||
config_register(machine, "debugger_sdl", configuration_load, configuration_save);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_wait_for_debugger
|
||||
@ -468,7 +532,6 @@ void osd_wait_for_debugger(running_device *device, int firststop)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// debugwin_update_during_game
|
||||
//============================================================
|
||||
@ -483,7 +546,6 @@ void debugwin_update_during_game(running_machine *machine)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// debugmain_process_string
|
||||
//============================================================
|
||||
@ -1143,6 +1205,10 @@ on_memoryview_key_press_event (GtkWidget *widget,
|
||||
#include "emu.h"
|
||||
|
||||
// win32 stubs for linking
|
||||
void osd_init_debugger(running_machine *machine)
|
||||
{
|
||||
}
|
||||
|
||||
void osd_wait_for_debugger(running_device *device, int firststop)
|
||||
{
|
||||
}
|
||||
|
@ -261,6 +261,15 @@ static void smart_show_all(BOOL show);
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_init_debugger
|
||||
//============================================================
|
||||
|
||||
void osd_init_debugger(running_machine *machine)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_wait_for_debugger
|
||||
//============================================================
|
||||
|
Loading…
Reference in New Issue
Block a user