local space = manager.machine.devices[":maincpu"].spaces["program"] local out = io.open("writes.log", "w") local function tap(lo, hi, name) return space:install_write_tap(lo, hi, name, function(offset, data, mask) local t = manager.machine.time out:write(string.format("S %X %X %d.%018d\n", offset, data & 0xff, t.seconds, t.attoseconds)) end) end taps = {} for _, base in ipairs({0x000, 0x100, 0x200, 0x300}) do table.insert(taps, tap(base + 0x15, base + 0x1a, "tia" .. base)) table.insert(taps, tap(base + 0x01, base + 0x01, "ctl" .. base)) end table.insert(taps, tap(0x4000, 0x400f, "pokey4000")) table.insert(taps, space:install_read_tap(0x4000, 0x400f, "pokeyread", function(offset, data, mask) local t = manager.machine.time out:write(string.format("R %X %X %d.%018d\n", offset, data & 0xff, t.seconds, t.attoseconds)) end)) table.insert(taps, tap(0x0450, 0x045f, "pokey450")) table.insert(taps, tap(0x0440, 0x044f, "pokey440")) table.insert(taps, tap(0x0800, 0x080f, "pokey800")) emu.add_machine_stop_notifier(function() out:close() end) local slot = "?" for tag, _ in pairs(manager.machine.devices) do if tag:find("^:cartslot:[^:]+$") then slot = tag:sub(11) end end local log = io.open("slot.txt", "w") log:write(slot .. "\n") log:close()