Skip to content

Commit fb35ede

Browse files
Tests: Work around MAME 0.284 issue
MAME 0.284 (presumably inadvertantly) changed the name of the item used to access RAM directly in the ":ram" device. See mamedev/mame#14762 for more details. Hunt for the item name using pattern matching to get the tests working again.
1 parent 2640666 commit fb35ede

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/lib/apple2.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,16 @@ end
634634
-- 0x0nnnn to access Main RAM and 0x1nnnn to acces Aux RAM. For
635635
-- LCBANK2 use 0xbCnnnn instead of 0xDnnnn.
636636

637-
local ram = emu.item(machine.devices[":ram"].items["0/m_pointer"])
637+
-- RAM should be device tag ":ram" item name "0/m_pointer" but
638+
-- MAME 0.284 introduced https://github.com/mamedev/mame/issues/14762
639+
-- so hunt for it using pattern matching.
640+
local ram
641+
for i,_ in pairs(machine.devices[":ram"].items) do
642+
if i:match("0/.*m_pointer") then
643+
ram = emu.item(machine.devices[":ram"].items[i])
644+
break
645+
end
646+
end
638647

639648
local function swizzle(addr)
640649
-- Assume LCBANK1 is desired

0 commit comments

Comments
 (0)