Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- launch with a scrpt:
- -- mame btoads -autoboot_script test.lua
- screen = manager:machine().screens[":screen"]
- memory = manager:machine().devices[":maincpu"].spaces["program"]
- --screen:draw_box(20, 20, 80, 80, 0xdd000022, 0xffffffff)
- function thing()
- local astart = 0x4800
- local asize = 0x0400
- local aend = astart + asize - 1
- local line = 16
- local word = 2
- local height = 0x0200
- local chw = 12
- local chh = 6
- local chcol = 0xffff0000
- local blw = chw*20
- local blh = chh*32
- for i=astart,aend,line do
- local x = (i%line)*chw + math.floor(i/height)*blw - math.floor(i/asize)*blw*2 + 10
- local y = chh*math.floor(i/line) - math.floor(i/height)*blh + 5
- screen:draw_text(x, y, string.format("%04X:", i), chcol)
- end
- for i=astart,aend,word do
- local v = memory:read_u16(i)
- local x = (i%line)*chw + math.floor(i/height)*blw - math.floor(i/asize)*blw*2 + 40
- local y = chh*math.floor(i/line) - math.floor(i/height)*blh + 5
- screen:draw_text(x, y, string.format("%04X", v), chcol)
- end
- end
- emu.register_frame_done(thing, "frame")
Advertisement
Add Comment
Please, Sign In to add comment