mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Make new internal debugger windows appear in a cascade-like position, and give some windows better default sizes. Change render_target::debug_top() to put targets at the end of the target list, fixing the order in which windows are rendered (nothing else uses this function).
This commit is contained in:
parent
40768ae7dd
commit
043eed6171
@ -1456,13 +1456,13 @@ void render_target::debug_free(render_container &container)
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// debug_top - move a debug view container to
|
||||
// the top of the list
|
||||
// debug_append - move a debug view container to
|
||||
// the end of the list
|
||||
//-------------------------------------------------
|
||||
|
||||
void render_target::debug_top(render_container &container)
|
||||
void render_target::debug_append(render_container &container)
|
||||
{
|
||||
m_debug_containers.prepend(m_debug_containers.detach(container));
|
||||
m_debug_containers.append(m_debug_containers.detach(container));
|
||||
}
|
||||
|
||||
|
||||
|
@ -942,7 +942,7 @@ public:
|
||||
// debug containers
|
||||
render_container *debug_alloc();
|
||||
void debug_free(render_container &container);
|
||||
void debug_top(render_container &container);
|
||||
void debug_append(render_container &container);
|
||||
|
||||
// resolve tag lookups
|
||||
void resolve_tags();
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include "debug/debugvw.h"
|
||||
#include "debug/dvdisasm.h"
|
||||
#include "debug/dvmemory.h"
|
||||
#include "debug/dvbpoints.h"
|
||||
#include "debug/dvwpoints.h"
|
||||
#include "debug/debugcon.h"
|
||||
#include "debug/debugcpu.h"
|
||||
|
||||
@ -275,6 +277,7 @@ static DView * focus_view;
|
||||
|
||||
static ui_menu * menu;
|
||||
static DView_edit * cur_editor;
|
||||
static int win_count;
|
||||
|
||||
static void set_focus_view(DView *dv)
|
||||
{
|
||||
@ -289,7 +292,7 @@ static void set_focus_view(DView *dv)
|
||||
focus_view = dv;
|
||||
LIST_REMOVE(list, dv, DView);
|
||||
LIST_ADD_FRONT(list, dv, DView);
|
||||
dv->target->debug_top(*dv->container);
|
||||
dv->target->debug_append(*dv->container);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1012,6 +1015,10 @@ static void on_memory_window_activate(DView *dv, const ui_menu_event *event)
|
||||
ndv->editor.container = &dv->machine().render().ui_container();
|
||||
source = ndv->view->source();
|
||||
dview_set_title(ndv, source->name());
|
||||
ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
|
||||
ndv->bounds.setx(0,500);
|
||||
win_count++;
|
||||
|
||||
set_focus_view(ndv);
|
||||
}
|
||||
|
||||
@ -1028,8 +1035,9 @@ static void on_disassembly_window_activate(DView *dv, const ui_menu_event *event
|
||||
ndv->editor.container = &dv->machine().render().ui_container();
|
||||
source = ndv->view->source();
|
||||
dview_set_title(ndv, source->name());
|
||||
ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
|
||||
win_count++;
|
||||
set_focus_view(ndv);
|
||||
|
||||
}
|
||||
|
||||
static void on_disasm_cpu_activate(DView *dv, const ui_menu_event *event)
|
||||
@ -1055,6 +1063,37 @@ static void on_log_window_activate(DView *dv, const ui_menu_event *event)
|
||||
target = &dv->machine().render().ui_target();
|
||||
ndv = dview_alloc(target, dv->machine(), DVT_LOG, 0);
|
||||
dview_set_title(ndv, "Log");
|
||||
ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
|
||||
ndv->bounds.setx(0,600);
|
||||
win_count++;
|
||||
set_focus_view(ndv);
|
||||
}
|
||||
|
||||
static void on_bp_window_activate(DView *dv, const ui_menu_event *event)
|
||||
{
|
||||
DView *ndv;
|
||||
render_target *target;
|
||||
|
||||
target = &dv->machine().render().ui_target();
|
||||
ndv = dview_alloc(target, dv->machine(), DVT_BREAK_POINTS, 0);
|
||||
dview_set_title(ndv, "Breakpoints");
|
||||
ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
|
||||
ndv->bounds.setx(0,600);
|
||||
win_count++;
|
||||
set_focus_view(ndv);
|
||||
}
|
||||
|
||||
static void on_wp_window_activate(DView *dv, const ui_menu_event *event)
|
||||
{
|
||||
DView *ndv;
|
||||
render_target *target;
|
||||
|
||||
target = &dv->machine().render().ui_target();
|
||||
ndv = dview_alloc(target, dv->machine(), DVT_WATCH_POINTS, 0);
|
||||
dview_set_title(ndv, "Watchpoints");
|
||||
ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
|
||||
ndv->bounds.setx(0,600);
|
||||
win_count++;
|
||||
set_focus_view(ndv);
|
||||
}
|
||||
|
||||
@ -1062,6 +1101,7 @@ static void on_close_activate(DView *dv, const ui_menu_event *event)
|
||||
{
|
||||
if (focus_view == dv)
|
||||
set_focus_view(dv->next);
|
||||
win_count--;
|
||||
dview_free(dv);
|
||||
}
|
||||
|
||||
@ -1299,6 +1339,12 @@ static void CreateMainMenu(running_machine &machine)
|
||||
case DVT_STATE:
|
||||
title = "State:";
|
||||
break;
|
||||
case DVT_BREAK_POINTS:
|
||||
title = "Breakpoints:";
|
||||
break;
|
||||
case DVT_WATCH_POINTS:
|
||||
title = "Watchpoints:";
|
||||
break;
|
||||
}
|
||||
|
||||
menu->item_append(title.append(focus_view->title).c_str(), nullptr, MENU_FLAG_DISABLE, nullptr);
|
||||
@ -1356,6 +1402,8 @@ static void CreateMainMenu(running_machine &machine)
|
||||
menu->item_append("New Memory Window", nullptr, 0, (void *)on_memory_window_activate);
|
||||
menu->item_append("New Disassembly Window", nullptr, 0, (void *)on_disassembly_window_activate);
|
||||
menu->item_append("New Error Log Window", nullptr, 0, (void *)on_log_window_activate);
|
||||
menu->item_append("New Breakpoints Window", nullptr, 0, (void *)on_bp_window_activate);
|
||||
menu->item_append("New Watchpoints Window", nullptr, 0, (void *)on_wp_window_activate);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append("Run", nullptr, 0, (void *)on_run_activate);
|
||||
menu->item_append("Run and Hide Debugger", nullptr, 0, (void *)on_run_h_activate);
|
||||
@ -1568,15 +1616,10 @@ static void dview_update_view(DView *dv)
|
||||
|
||||
static void update_views(void)
|
||||
{
|
||||
DView *dv, *prev;
|
||||
DView *dv;
|
||||
|
||||
LIST_GET_LAST(list, dv);
|
||||
while (dv != nullptr)
|
||||
{
|
||||
for(dv=list;dv!=nullptr;dv=dv->next)
|
||||
dview_update_view(dv);
|
||||
LIST_GET_PREVIOUS(list, dv, prev);
|
||||
dv = prev;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1587,20 +1630,28 @@ void debug_internal::wait_for_debugger(device_t &device, bool firststop)
|
||||
render_target *target = &device.machine().render().ui_target();
|
||||
|
||||
//set_view_by_name(target, "Debug");
|
||||
win_count = 0;
|
||||
|
||||
DView *disassembly = dview_alloc(target, device.machine(), DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
|
||||
disassembly->editor.active = TRUE;
|
||||
disassembly->editor.container = &device.machine().render().ui_container();
|
||||
disassembly->ofs_x = 300;
|
||||
|
||||
dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
|
||||
disassembly->ofs_x = 500;
|
||||
disassembly->bounds.setx(0,600);
|
||||
win_count++;
|
||||
|
||||
DView *statewin = dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
|
||||
statewin->ofs_x = 350;
|
||||
statewin->bounds.set(0,150,0,600);
|
||||
win_count++;
|
||||
|
||||
DView *console = dview_alloc(target, device.machine(), DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
|
||||
dview_set_title(console, "Console");
|
||||
console->editor.active = TRUE;
|
||||
console->editor.container = &device.machine().render().ui_container();
|
||||
console->bounds.setx(0,600);
|
||||
console->ofs_x = 600;
|
||||
console->ofs_x = 500;
|
||||
console->ofs_y = 300;
|
||||
win_count++;
|
||||
set_focus_view(console);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user