mirror of
https://github.com/holub/mame
synced 2025-07-08 11:21:56 +03:00
Added logic to track OSD updates separately from internal view updates in the
debugger. In order to get the OSD to update, a new function debug_view_flush_updates() must be called. Currently this is automatically called before osd_wait_for_debugger(), and during the periodic updates while executing. The OSD code may occasionally need to call it under other circumstances (for example, the Windows code calls it explicitly while tracking scrollbar thumbs to get live scrolling).
This commit is contained in:
parent
fb25927452
commit
5b64c00674
@ -392,6 +392,7 @@ void debug_cpu_start_hook(const device_config *device, attotime endtime)
|
||||
if (device == global->visiblecpu && osd_ticks() > global->last_periodic_update_time + osd_ticks_per_second()/4)
|
||||
{
|
||||
debug_view_update_all(device->machine);
|
||||
debug_view_flush_updates(device->machine);
|
||||
global->last_periodic_update_time = osd_ticks();
|
||||
}
|
||||
|
||||
@ -532,6 +533,7 @@ void debug_cpu_instruction_hook(const device_config *device, offs_t curpc)
|
||||
else if ((info->flags & DEBUG_FLAG_STEPPING_OUT) == 0 && (info->stepsleft < 200 || info->stepsleft % 100 == 0))
|
||||
{
|
||||
debug_view_update_all(device->machine);
|
||||
debug_view_flush_updates(device->machine);
|
||||
debugger_refresh_display(device->machine);
|
||||
}
|
||||
}
|
||||
@ -579,6 +581,9 @@ void debug_cpu_instruction_hook(const device_config *device, offs_t curpc)
|
||||
sound_mute(TRUE);
|
||||
while (global->execution_state == EXECUTION_STATE_STOPPED)
|
||||
{
|
||||
/* flush any pending updates before waiting again */
|
||||
debug_view_flush_updates(device->machine);
|
||||
|
||||
/* clear the memory modified flag and wait */
|
||||
global->memory_modified = FALSE;
|
||||
osd_wait_for_debugger(device, firststop);
|
||||
|
@ -111,6 +111,7 @@ struct _debug_view
|
||||
UINT8 recompute; /* does this view require a recomputation? */
|
||||
UINT8 update_level; /* update level; updates when this hits 0 */
|
||||
UINT8 update_pending; /* true if there is a pending update */
|
||||
UINT8 osd_update_pending; /* true if there is a pending update */
|
||||
debug_view_char * viewdata; /* current array of view data */
|
||||
int viewdata_size; /* number of elements of the viewdata array */
|
||||
};
|
||||
@ -489,8 +490,9 @@ void debug_view_end_update(debug_view *view)
|
||||
{
|
||||
int size;
|
||||
|
||||
/* no longer pending */
|
||||
/* no longer pending, but flag for the OSD */
|
||||
view->update_pending = FALSE;
|
||||
view->osd_update_pending = TRUE;
|
||||
|
||||
/* resize the viewdata if needed */
|
||||
size = view->visible.x * view->visible.y;
|
||||
@ -503,10 +505,6 @@ void debug_view_end_update(debug_view *view)
|
||||
/* update the view */
|
||||
if (view->cb.update != NULL)
|
||||
(*view->cb.update)(view);
|
||||
|
||||
/* update the owner */
|
||||
if (view->osdupdate != NULL)
|
||||
(*view->osdupdate)(view, view->osdprivate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -515,6 +513,32 @@ void debug_view_end_update(debug_view *view)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
debug_view_flush_updates - force all updates
|
||||
to notify the OSD
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debug_view_flush_updates(running_machine *machine)
|
||||
{
|
||||
debugvw_private *global = machine->debugvw_data;
|
||||
debug_view *view;
|
||||
|
||||
/* skip if we're not ready yet */
|
||||
if (global == NULL)
|
||||
return;
|
||||
|
||||
/* loop over each view and force an update */
|
||||
for (view = global->viewlist; view != NULL; view = view->next)
|
||||
if (view->osd_update_pending)
|
||||
{
|
||||
/* update the owner */
|
||||
if (view->osdupdate != NULL)
|
||||
(*view->osdupdate)(view, view->osdprivate);
|
||||
view->osd_update_pending = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
debug_view_update_all - force all views to
|
||||
refresh
|
||||
|
@ -183,6 +183,9 @@ void debug_view_begin_update(debug_view *view);
|
||||
/* complete a sequence of changes so that only one update occurs */
|
||||
void debug_view_end_update(debug_view *view);
|
||||
|
||||
/* flush any pending updates to the OSD layer */
|
||||
void debug_view_flush_updates(running_machine *machine);
|
||||
|
||||
/* force all views to refresh */
|
||||
void debug_view_update_all(running_machine *machine);
|
||||
|
||||
|
@ -1417,6 +1417,7 @@ static LRESULT CALLBACK debugwin_view_proc(HWND wnd, UINT message, WPARAM wparam
|
||||
debug_view_xy topleft = debug_view_get_visible_position(info->view);
|
||||
topleft.x = debugwin_view_process_scroll(info, LOWORD(wparam), (HWND)lparam);
|
||||
debug_view_set_visible_position(info->view, topleft);
|
||||
debug_view_flush_updates(info->owner->machine);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1426,6 +1427,7 @@ static LRESULT CALLBACK debugwin_view_proc(HWND wnd, UINT message, WPARAM wparam
|
||||
debug_view_xy topleft = debug_view_get_visible_position(info->view);
|
||||
topleft.y = debugwin_view_process_scroll(info, LOWORD(wparam), (HWND)lparam);
|
||||
debug_view_set_visible_position(info->view, topleft);
|
||||
debug_view_flush_updates(info->owner->machine);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user