distate: Expose state_find_entry (nw)

This commit is contained in:
AJR 2019-03-16 19:46:53 -04:00
parent b5c19e9fb2
commit 1a66b2ff1e
2 changed files with 4 additions and 4 deletions

View File

@ -467,7 +467,7 @@ bool debugger_commands::validate_cpu_parameter(const char *param, device_t *&res
{
// real CPUs should have pcbase
const device_state_interface *state;
if (exec.device().interface(state) && state->state_string(STATE_GENPCBASE) != "???" && index++ == cpunum)
if (exec.device().interface(state) && state->state_find_entry(STATE_GENPCBASE) != nullptr && index++ == cpunum)
{
result = &exec.device();
return true;

View File

@ -250,6 +250,9 @@ public:
void set_state_string(int index, const char *string);
void set_pc(offs_t pc) { set_state_int(STATE_GENPC, pc); }
// find the entry for a given index
const device_state_entry *state_find_entry(int index) const;
// deliberately ambiguous functions; if you have the state interface
// just use it directly
device_state_interface &state() { return *this; }
@ -293,9 +296,6 @@ protected:
// internal operation overrides
virtual void interface_post_start() override;
// find the entry for a given index
const device_state_entry *state_find_entry(int index) const;
// constants
static constexpr int FAST_STATE_MIN = -4; // range for fast state
static constexpr int FAST_STATE_MAX = 256; // lookups