Skip to content

Bad RAM device item tag introduced by refactor #14762

@inexorabletash

Description

@inexorabletash

MAME version

0.284

System information

Noticed via Lua scripting

INI configuration details

Emulated system/software

apple2ee

Incorrect behaviour

Prior to 0.284 the RAM device for apple2ee devices could be accessed from Lua scripting via:

local ram = emu.item(manager.machine.devices[":ram"].items["0/m_pointer"])

This change broke the tag used for the item:

3071a89#diff-088ac161ad0bca958371661fb995dea98ebb0311b84ae1e5e2a2e4891aed6298R174-R181

-	save_pointer(NAME(m_pointer), m_size);
+	save_pointer(NAME(reinterpret_cast<u8 *>(m_pointer.get())), m_size);

Device item tags aren't expected to be stable, but that's almost certainly not what was intended.

Expected behaviour

With an apple2ee device for example, launched with:

mame64 -skip_gameinfo -nosamples -window -nomax -resolution '560x384' -nounevenstretch -mouse -video none -sound none 'apple2ee' -nothrottle -nosleep -console

[MAME]> for i, _ in pairs(manager.machine.devices[":ram"].items) do print(i) end
0/m_unscaled_clock
0/m_clock_scale
0/m_size
0/m_pointer

Steps to reproduce

With an apple2ee device for example, launched with:

mame64 -skip_gameinfo -nosamples -window -nomax -resolution '560x384' -nounevenstretch -mouse -video none -sound none 'apple2ee' -nothrottle -nosleep -console

[MAME]> for i, _ in pairs(manager.machine.devices[":ram"].items) do print(i) end
0/m_unscaled_clock
0/m_clock_scale
0/m_size
0/reinterpret_cast<u8 *>(m_pointer.get())

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions