mirror of
https://github.com/holub/mame
synced 2025-05-31 18:11:50 +03:00
siblingdevice now checks for and removes a leading "^" to
indicate the owner. This allows "^" to be used to reference the owning device in device callbacks, among other things.
This commit is contained in:
parent
52ccf5ffbc
commit
643793cce6
@ -769,6 +769,9 @@ inline device_t *device_t::siblingdevice(const char *tag) const
|
|||||||
if (tag == NULL || *tag == 0)
|
if (tag == NULL || *tag == 0)
|
||||||
return const_cast<device_t *>(this);
|
return const_cast<device_t *>(this);
|
||||||
|
|
||||||
|
// leading caret implies the owner, just skip it
|
||||||
|
if (tag[0] == '^') tag++;
|
||||||
|
|
||||||
// query relative to the parent
|
// query relative to the parent
|
||||||
return (m_owner != NULL) ? m_owner->subdevice(tag) : NULL;
|
return (m_owner != NULL) ? m_owner->subdevice(tag) : NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user