dwt: visual injection experiments via the returning rdebug jump

This commit is contained in:
SDD committed 2026-10-18 03:22:59 +03:00
1 parent 1e5c095b72
commit 05f1895bf5
80 files changed
+3252

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
-- frame_clock.lua -- read-only frame counter side channel for host-driven tests.
--
-- Writes the current frame number to $FRAME_CLOCK once per frame so a host
-- client can align an injection with a known emulated frame (and therefore with
-- the driver's VT1200_DUMP_FRAMES schedule). No breakpoints, no memory writes
-- except this file. Optionally exits at $FRAME_STOP.
local machine = manager.machine
local path = os.getenv("FRAME_CLOCK")
local stop = tonumber(os.getenv("FRAME_STOP") or "0")
local f = 0
emu.register_frame_done(function()
f = f + 1
if path then
local fh = io.open(path, "w")
if fh then
fh:write(string.format("%d\n", f))
fh:close()
end
end
if stop > 0 and f >= stop then
print(string.format("frame_clock: stopping at frame %d", f))
machine:exit()
end
end, "vt1200-frame-clock")