User File #638321327352809218

Upload All User Files

#638321327352809218 - Millipede trackball input display script for MAME (by Feos)

millipedetrackball.lua
System: Arcade
64 downloads
Uploaded 10/5/2023 7:58 PM by Technoturnovers (see all 7)
This script shows an OSD of the current internal values of the trackball for Millipede running under MAME, made to help with a BizHawk github issue I'm about to open regarding problems with trackball support in MAMEHawk.
local function getscreen()
    for k,v in pairs(manager.machine.screens) do return v end
end

local screen = getscreen()

local function framecount()
    x = manager.machine.ioport.ports[":TRACK0_X"]:read()
    y = manager.machine.ioport.ports[":TRACK0_Y"]:read()
    
    str = string.format("x: %d\ny: %d", x, y)
    --print(str)
    screen:draw_text(0, 0, str, 0xffffffff, 0xff000000)
end

emu.register_frame_done(framecount)