mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-10-30 12:03:54 +02:00
The terminal tells the two pointing devices apart from the 'T' self-test device code (0010 mouse / 0100 tablet) and switches report framing on it: 3-byte relative for the mouse, 5-byte absolute (header 110) for the tablet. Verified against the running OS: with the tablet it reads the self-test as A0 04 00 00 and then reads RHRB in groups of 5 (groups of 3 for the mouse). Refactor the VSXXX model into a shared base + mouse/tablet subclasses and select the device on DUART2-B with VT1200_TABLET=1 (default: the mouse, so the mouse stays and is selectable, not replaced). The tablet reports its documented 0..2199 active area (VCB02 D.1) and reads the host pointer through IPT_LIGHTGUN_X/Y, MAME's absolute control, so the emulated cursor follows the host pointer positionally: corner (0,0) -> (194,38), centre (1100,1100) -> (704,467), corner (2199,2199) -> (1214,898), reproducible pixel-for-pixel on a repeated coordinate. Driving it from the host mouse needs '-lightgun -lightgun_device mouse' (documented for run.sh; run.sh is not edited here). The mouse and keyboard are unchanged, and all baselines hold: no env PC=3FDCE400 samples=198 (3 PCs); VT1200_IO_PATH_STUB=1 samples=53 (75 PCs); ROM md5 unchanged. Nothing is tuned to satisfy level 0's I/O data path test.
39 lines
1.3 KiB
Lua
39 lines
1.3 KiB
Lua
-- 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=<dir> \
|
|
-- <mame> 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")
|