summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/debugwin.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-18 09:34:43 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-18 09:34:43 +0000
commite738b79785852050ce8b83e369a7fc4dd46a071b (patch)
tree1ac39e9f40790b375c57fea4e5d56ca8d132babc /src/osd/sdl/debugwin.c
parent3f87f47a2ecdccb9d9627d0d52b76f262becb949 (diff)
Correct a long-standing design flaw: device configuration state
is now separate from runtime device state. I have larger plans for devices, so there is some temporary scaffolding to hold everything together, but this first step does separate things out. There is a new class 'running_device' which represents the state of a live device. A list of these running_devices sits in machine->devicelist and is created when a running_machine is instantiated. To access the configuration state, use device->baseconfig() which returns a reference to the configuration. The list of running_devices in machine->devicelist has a 1:1 correspondance with the list of device configurations in machine->config->devicelist, and most navigation options work equally on either (scanning by class, type, etc.) For the most part, drivers will now deal with running_device objects instead of const device_config objects. In fact, in order to do this patch, I did the following global search & replace: const device_config -> running_device device->static_config -> device->baseconfig().static_config device->inline_config -> device->baseconfig().inline_config and then fixed up the compiler errors that fell out. Some specifics: Removed device_get_info_* functions and replaced them with methods called get_config_*. Added methods for get_runtime_* to access runtime state from the running_device. DEVICE_GET_INFO callbacks are only passed a device_config *. This means they have no access to the token or runtime state at all. For most cases this is fine. Added new DEVICE_GET_RUNTIME_INFO callback that is passed the running_device for accessing data that is live at runtime. In the future this will go away to make room for a cleaner mechanism. Cleaned up the handoff of memory regions from the memory subsystem to the devices.
Diffstat (limited to 'src/osd/sdl/debugwin.c')
-rw-r--r--src/osd/sdl/debugwin.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/osd/sdl/debugwin.c b/src/osd/sdl/debugwin.c
index f44fb75926a..0be5318285e 100644
--- a/src/osd/sdl/debugwin.c
+++ b/src/osd/sdl/debugwin.c
@@ -41,7 +41,7 @@ typedef struct {
debug_view *console;
debug_view *disasm;
debug_view *registers;
- const device_config *cpu; // current CPU
+ running_device *cpu; // current CPU
running_machine *machine; // machine
} debugmain_i;
@@ -81,7 +81,7 @@ typedef struct memorycombo_item
UINT8 prefsize;
running_machine *machine; // machine
const memory_subview_item *subview; // subview
- const device_config *device; // CPU device
+ running_device *device; // CPU device
} memorycombo_item;
@@ -281,7 +281,7 @@ void debugmain_comments_activate(GtkMenuItem *item, gpointer user_data)
}
}
-static void debugmain_set_cpu(const device_config *cpu)
+static void debugmain_set_cpu(running_device *cpu)
{
if (cpu != dmain->cpu)
{
@@ -315,7 +315,7 @@ static void debugmain_set_cpu(const device_config *cpu)
// The entry point
-void osd_wait_for_debugger(const device_config *device, int firststop)
+void osd_wait_for_debugger(running_device *device, int firststop)
{
// create a console window
if(!dmain)
@@ -439,7 +439,7 @@ static void memorywin_new(running_machine *machine)
{
memorywin_i *mem;
int item, cursel;
- const device_config *curcpu = debug_cpu_get_visible_cpu(machine);
+ running_device *curcpu = debug_cpu_get_visible_cpu(machine);
const memory_subview_item *subview;
mem = (memorywin_i *) malloc(sizeof(*mem));
@@ -566,7 +566,7 @@ static void disasmwin_new(running_machine *machine)
{
disasmwin_i *dis;
int item, cursel;
- const device_config *curcpu = debug_cpu_get_visible_cpu(machine);
+ running_device *curcpu = debug_cpu_get_visible_cpu(machine);
const disasm_subview_item *subview;
char title[256];
@@ -782,7 +782,7 @@ void on_dbpl_activate(GtkMenuItem *item, gpointer user_data)
#include "emu.h"
// win32 stubs for linking
-void osd_wait_for_debugger(const device_config *device, int firststop)
+void osd_wait_for_debugger(running_device *device, int firststop)
{
}