local dbg = manager.machine.debugger dbg.visible_cpu = manager.machine.devices[":maincpu"] dbg:command('wpiset A0,20,w,1,{logerror "W %X %X %d %d %d\\n",wpaddr&0xff,wpdata,totalcycles,beamy,beamx; g}') dbg:command('wpiset A0,20,r,1,{logerror "R %X %X %d %d %d\\n",wpaddr&0xff,wpdata,totalcycles,beamy,beamx; g}') dbg:command("go") vdp_device = nil for tag, device in pairs(manager.machine.devices) do if device.shortname:match("^tms9") then vdp_device = device end end stop_notifier = emu.add_machine_stop_notifier(function() local space = vdp_device.spaces["vram"] local out = io.open("/data/emu/tms9918-python/tests/mame_traces/coleco-Zaxxon-play/vram.bin", "wb") for address = 0, 0x3FFF do out:write(string.char(space:read_u8(address))) end out:close() end) presses = {{":STD_KEYPAD1", "1 (pad 1)", 14.0}} press_notifier = emu.add_machine_periodic_notifier(function() local now = manager.machine.time.seconds for _, press in ipairs(presses) do local field = manager.machine.ioport.ports[press[1]].fields[press[2]] field:set_value((now >= press[3] and now < press[3] + 0.25) and 1 or 0) end end)