Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Luascript for bizhawk 1.11.6
- -- by mugg1991
- -- Gremlins 2 The New Batch gb
- function text(x, y, text, color)
- gui.pixelText(x, y, text,color,0x00000000)
- end
- ----------------------------------------------------------------------
- local drawFrameCountAndInput = function(x,y)
- if movie.mode()=="PLAY" then
- text(x, y,emu.framecount().."/"..movie.length(),0xFFFFFFFF)
- else
- text(x, y,emu.framecount(),0xFFFFFFFF)
- end
- text(x, y+8,emu.lagcount(),0xFFF05050)
- if emu.islagged() then
- text(x-5, y+8,"*",0xFFF05050)
- end
- local inputtable = {}
- if movie.mode()=="INACTIVE" then
- inputtable = joypad.getimmediate()
- elseif movie.mode()=="PLAY" or movie.mode()=="RECORD" then
- inputtable = movie.getinput(emu.framecount()-1)
- end
- local buttons = {["Up"]="^", ["Down"]="v", ["Left"]="<", ["Right"]=">", ["Select"]="s", ["Start"]="S", ["A"]="A", ["B"]="B", ["L"]="L", ["R"]="R"}
- local s = ""
- for k,v in pairs(inputtable) do
- if v==true then
- s=s..buttons[k]
- end
- end
- text(x,y+16,s,0xFFffffff)
- end
- function hex(num)
- local dig = 2
- local hexstr = '0123456789ABCDEF'
- local s = ''
- --while num > 0 do
- while dig > 0 do -- use digit instead so there is padding
- local mod = math.fmod(num, 16)
- s = string.sub(hexstr, mod+1, mod+1) .. s
- num = math.floor(num / 16)
- dig = dig - 1
- end
- if s == '' then s = '0' end
- return s
- end
- client.SetGameExtraPadding(0,28,0,0)
- memory.usememorydomain("System Bus")
- while true do
- --declare values:
- Xpos = memory.read_u16_be(0xff96)
- Ypos = memory.read_u16_be(0xff98)
- Invinc = 0x40 - memory.read_u8(0xc0cb)
- if Invinc == 0x40 then Invinc = "" end
- SuitcaseHitpoints = memory.read_u8(0xc0ae)
- if SuitcaseHitpoints < 1 then SuitcaseHitpoints="" end
- HP = memory.read_u8(0xc0c6)+1
- if HP > 9 or HP < 1 then HP="Dead" end
- BossHP = memory.read_u8(0xc200)
- if BossHP == 0 then BossHP="" end
- --display values:
- text(43,10,"X",0x80FFFFFF)
- text(43,18,"Y",0x80FFFFFF)
- text(50,10,Xpos,0xFFFFFFFF)
- text(50,18,Ypos,0xFFFFFFFF)
- text(84,10,"Inv",0x80FFFFFF)
- text(100,10,Invinc,0xFFFFD040)
- text(80,18,"Case",0x80FFFFFF)
- text(100,18,SuitcaseHitpoints,0xFFFFD040)
- text(130,10,"HP",0x80FFFFFF)
- text(140,10,HP,0xFFFFFFFF)
- text(114,18,"BossHP",0x80FFFFFF)
- text(140,18,BossHP,0xFFFFFFFF)
- drawFrameCountAndInput(10,2)
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement