local frames = 0 emu.addEventCallback(function() frames = frames + 1 local s = emu.read(0x6000, emu.memType.nesDebug) local sig = emu.read(0x6001, emu.memType.nesDebug) == 0xDE and emu.read(0x6002, emu.memType.nesDebug) == 0xB0 and emu.read(0x6003, emu.memType.nesDebug) == 0x61 if sig and s < 0x80 then local t = {} for a = 0x6004, 0x6800 do local c = emu.read(a, emu.memType.nesDebug); if c == 0 then break end; t[#t+1] = string.char(c) end emu.log(string.format("frame %d result %02X: %s", frames, s, (table.concat(t):gsub("\n", " / ")))) emu.stop(s) end end, emu.eventType.endFrame)