Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function text(x, y, text, color)
- gui.pixelText(x, y, text,color,0x00000000)
- end
- function box(x,y,x2,y2)
- gui.drawBox(x,y,x2,y2,0xFF000000,0xA0000000)
- end
- function img(path,x,y)
- gui.drawImage(path,x,y)
- 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+15, 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
- drawFrameCountAndInput(10,2)
- Minutes = memory.read_u8(0xc804)
- Seconds = memory.read_u8(0xc803)
- Milliseconds = memory.read_u8(0xc802)
- MinutesLeft = memory.read_u8(0xc882)
- SecondsLeft = memory.read_u8(0xc881)
- MillisecondsLeft = memory.read_u8(0xc880)
- Speed1 = memory.read_s8(0xc810) -- pixels to advance screen
- Speed2 = memory.read_u16_le(0xc38a)
- Nitros1 = memory.read_u8(0xc792)
- Nitros2 = memory.read_u8(0xc812)
- Indicator = memory.read_u8(0xc780)
- if Indicator==1 then Nitros=Nitros1 else Nitros=Nitros2 end
- X = memory.read_u16_le(0xe903) -- might be screen, idk
- text(45,2,"Time: "..hex(Minutes)..":"..hex(Seconds).."."..hex(Milliseconds),0xFFFFFFFF)
- text(48,10,"Gas: "..hex(MinutesLeft)..":"..hex(SecondsLeft).."."..hex(MillisecondsLeft),0xFFFFFFFF)
- text(110,2,"Spd: "..Speed2,0xFFFFFFFF)
- text(110,10,"Ntr: "..Nitros,0xFFFFFFFF)
- text(110,18,"xpos: "..X,0xFFFFFFFF)
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement