summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-07-06 00:52:36 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-07-06 00:52:36 +0000
commit5d21c672af07fa461ae6e0e989d2a866aff509b0 (patch)
treec0762c8e0af859079898f6442488d8f929e8e5d8 /src/emu/ui.c
parent995097894f775112942bbe13549c9ef8ab6ef3e4 (diff)
Moved debugging structure away from CPUs only and attached to all
devices. Debugger now creates one for each device. C++-ified most debugger operations to hang off the debugging class, and updated most callers. This still needs a little cleanup, but it fixes most issues introduced when the CPUs were moved to their own devices. Got rid of cpu_count, cpu_first, cpu_next, etc. as they were badly broken. Also removed cpu_is_executing, cpu_is_suspended, cpu_get_local_time, and cpu_abort_timeslice. Some minor name changes: state_value() -> state() state_set_value() -> set_state()
Diffstat (limited to 'src/emu/ui.c')
-rw-r--r--src/emu/ui.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/emu/ui.c b/src/emu/ui.c
index 6fe2bcd4c56..1366554e2a7 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -998,25 +998,29 @@ static astring &warnings_string(running_machine *machine, astring &string)
astring &game_info_astring(running_machine *machine, astring &string)
{
int scrcount = screen_count(*machine->config);
- device_t *scandevice;
- device_t *device;
int found_sound = FALSE;
- int count;
/* print description, manufacturer, and CPU: */
string.printf("%s\n%s %s\n\nCPU:\n", machine->gamedrv->description, machine->gamedrv->year, machine->gamedrv->manufacturer);
/* loop over all CPUs */
- for (device = machine->firstcpu; device != NULL; device = scandevice)
+ device_execute_interface *exec;
+ int count = 1;
+ for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
+ // skip over any we already claimed
+ if (--count != 0)
+ continue;
+
/* get cpu specific clock that takes internal multiplier/dividers into account */
- int clock = device->clock();
+ int clock = exec->device().clock();
/* count how many identical CPUs we have */
count = 1;
- for (scandevice = device->typenext(); scandevice != NULL; scandevice = scandevice->typenext())
+ device_execute_interface *scan;
+ for (bool gotone = exec->next(scan); gotone; gotone = scan->next(scan))
{
- if (device->type() != scandevice->type() || device->clock() != scandevice->clock())
+ if (exec->device().type() != scan->device().type() || exec->device().clock() != scan->device().clock())
break;
count++;
}
@@ -1024,7 +1028,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
/* if more than one, prepend a #x in front of the CPU name */
if (count > 1)
string.catprintf("%d" UTF8_MULTIPLY, count);
- string.cat(device->name());
+ string.cat(exec->device().name());
/* display clock in kHz or MHz */
if (clock >= 1000000)
@@ -1645,10 +1649,11 @@ static slider_state *slider_init(running_machine *machine)
/* add CPU overclocking (cheat only) */
if (options_get_bool(machine->options(), OPTION_CHEAT))
{
- for (device = machine->firstcpu; device != NULL; device = cpu_next(device))
+ device_execute_interface *exec;
+ for (bool gotone = machine->m_devicelist.first(exec); exec != NULL; gotone = exec->next(exec))
{
- void *param = (void *)device;
- string.printf("Overclock CPU %s", device->tag());
+ void *param = (void *)&exec->device();
+ string.printf("Overclock CPU %s", exec->device().tag());
*tailptr = slider_alloc(machine, string, 10, 1000, 2000, 1, slider_overclock, param);
tailptr = &(*tailptr)->next;
}