I've been trying to figure out the correct syntax for running "wpset" and "bpset" using Lua on MAME. I have been continually crashing MAME with a "Segmentation fault: 11" and I could really use a sanity check.
I've been referencing the MAME Lua documentation and have also found some quasi examples on this forum, but I haven't had any success. If anyone could help point me in the right direction on the proper syntax for these commands, I would be extremely grateful. Thanks!
Link to the relevant MAME Lua documentation: https://docs.mamedev.org/techspecs/luareference.html?highlight=debugger#debugger
Below is the code I've been attempting to use:
Code: Select all
-- variables
cpu = manager.machine.devices[":maincpu"]
programSpace = cpu.spaces["program"]
-- bpset attempts
cpu.bpset(0x00470e, function() print("test") end)
-- gives me the following message "error: [string "..."]:2: attempt to call a nil value (field 'bpset')"
cpu.debug:bpset(0x00470e, function() print("test") end)
-- crashes mame and gives me the following error "Segmentation fault: 11"
-- wpset attempts
cpu.debug.wpset(programSpace, "rw", 0x10d4bc, 1, function() print("test") end)
-- crashes mame and gives me the following error "Segmentation fault: 11"