ok, let's try SpaceZap
download from
https://github.com/FrankRizzo890/SpaceZapBotextract the sz.lua and make a few changes:
--local cpu = manager:machine().devices[":maincpu"]
local cpu = manager.machine.devices[":maincpu"]
local mem = cpu.spaces["program"]
--local ioport = manager:machine():ioport()
local ioport = manager.machine.ioport
local in0 = ioport.ports[":P1HANDLE"]
local in1 = ioport.ports[":P3HANDLE"]
then just put the file in your mame directory and dofile("sz.lua") from the lua console.
[MAME]> dofile("sz.lua")
[MAME]>
[LUA ERROR] in execute_function: sz.lua:194: number (global 'test') has no integer representation
[LUA ERROR] in execute_function: sz.lua:163: number (global 'test') has no integer representation
It shows a bunch of errors, but it seems to work despite them.
It seems to have something to do with reading u64 and then getting a really big number and not being able to convert to an integer possibly?
test = mem:read_u64(0x5ECE + (i * 8))
if test ~= 0 then
if (test & 0xFF) ~= 0 then
just as a test of numerical precision:
[MAME]> a=1e15+1 print(a&0x3)
1
[MAME]> a=1e20+1 print(a&0x3)
error: [string "..."]:2: number (global 'a') has no integer representation
[MAME]> print(a)
1e+20