mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Exclude non-CPUs from numerical indexing for debugger commands
This commit is contained in:
parent
88d4191991
commit
1a3b2ef914
@ -461,12 +461,17 @@ bool debugger_commands::validate_cpu_parameter(const char *param, device_t *&res
|
||||
return false;
|
||||
}
|
||||
|
||||
/* if we got a valid one, return */
|
||||
device_execute_interface *exec = execute_interface_iterator(m_machine.root_device()).byindex(cpunum);
|
||||
if (exec != nullptr)
|
||||
// attempt to find by numerical index
|
||||
int index = 0;
|
||||
for (device_execute_interface &exec : execute_interface_iterator(m_machine.root_device()))
|
||||
{
|
||||
result = &exec->device();
|
||||
return true;
|
||||
// real CPUs should have pcbase
|
||||
const device_state_interface *state;
|
||||
if (exec.device().interface(state) && state->state_string(STATE_GENPCBASE) != "???" && index++ == cpunum)
|
||||
{
|
||||
result = &exec.device();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* if out of range, complain */
|
||||
|
Loading…
Reference in New Issue
Block a user