-- Acceptance test: drive the modelled VSXXX-AB tablet with the host absolute -- pointer and show the emulated cursor following it -- a corner, the opposite -- corner, and the centre. -- -- VT1200_TABLET=1 VT1200_SKIP_LEVEL1=1 \ -- VT1200_DUMP_FRAMES=4600,4850,5100 VT1200_DUMP_DIR= \ -- vt1200 ... -autoboot_script harness/mame/tab_inject.lua -- -- Coordinates are the tablet's own: 0..2199 (11 in at 200 counts/in, VCB02 D.1), -- Y screen-style downward (the device inverts it for the DEC report). A report -- is emitted whenever the position changes, so the cursor jumps between points -- and holds. local machine = manager.machine local ports = machine.ioport.ports local tx = ports[":tablet:TABLET_X"].fields["Tablet X"] local ty = ports[":tablet:TABLET_Y"].fields["Tablet Y"] local PTS = { { 4400, 0, 0, "corner top-left" }, { 4650, 2199, 2199, "corner bot-right" }, { 4900, 1100, 1100, "centre" }, } local frames = 0 local next = 1 emu.register_frame_done(function() frames = frames + 1 if next <= #PTS and frames == PTS[next][1] then tx:set_value(PTS[next][2]) ty:set_value(PTS[next][3]) print(string.format("tab: frame %d %-18s x=%d y=%d", frames, PTS[next][4], PTS[next][2], PTS[next][3])) next = next + 1 end if frames >= 5150 then machine:exit() end end, "vt1200-tab-inject")