Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Luascript for Bizhawk 1.11.6
- -- by mugg1991 28th Aug 2016
- -- Bubble Ghost (U) [!].gb
- memory.usememorydomain("System Bus")
- client.setwindowsize(3)
- function text(x, y, text, col1, col2)
- if col2==nil then col2=0x00000000 end
- gui.pixelText(x, y, text,col1,col2)
- end
- function box(x,y,x2,y2,col1,col2)
- gui.drawBox(x,y,x2,y2,col1,col2)
- end
- function line(x,y,x2,y2,col)
- gui.drawLine(x,y,x2,y2,col)
- end
- function pixel(x,y,col)
- gui.drawPixel(x,y,col)
- end
- function img(x,y,path)
- gui.drawImage(path,x,y)
- end
- local drawFramecountAndInput = function(x,y)
- if movie.mode()=="PLAY" then
- text(x-6, y,emu.framecount().."/"..movie.length(),0xFFFFFFFF)
- else
- text(x-6, y,emu.framecount(),0xFFFFFFFF)
- end
- text(x-6, y+7,emu.lagcount(),0xFFF08080)
- if emu.islagged() then
- text(x+8, y+7,"*",0xFFF08080)
- 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-6,y+14,s,0xFFffffff)
- end
- event.onloadstate(function()
- end)
- event.onexit(function()
- client.SetGameExtraPadding(0,0,0,0)
- client.SetClientExtraPadding(0,0,0,0)
- end)
- client.SetGameExtraPadding(0,26,0,0)
- while true do
- player_xpos= memory.read_u8(0xe161)
- player_ypos= memory.read_u8(0xe162)
- ball_xpos= memory.read_u8(0xe16a)
- ball_ypos= memory.read_u8(0xe16b)
- ball_speedcounter= memory.read_u8(0xc16e)
- if ball_speedcounter==0xFF then ball_speedcounter=0 end
- ball_speedcounter= 20-ball_speedcounter
- ball_speed= memory.read_u8(0xc16f)
- timer= 7-(memory.read_u8(0xc0f2)-1)%8
- box(-1,-1,160,26,0xFF1A1A1A,0xFF1A1A1A)
- drawFramecountAndInput(14,4)
- text(52,1,"player",0xFFA0A0A0)
- text(86,1,"ball",0xFFA0A0A0)
- text(112,1,"speed",0xFFA0A0A0)
- text(52,9,player_xpos,0xFFD0A020)
- text(52,16,player_ypos,0xFFD0A020)
- text(86,9,ball_xpos,0xFFD0A020)
- text(86,16,ball_ypos,0xFFD0A020)
- text(112,9,ball_speed,0xFFD0A020)
- text(122,9,"("..ball_speedcounter..")",0xFFD0A020)
- text(122,16,"("..timer..")",0xFFD0A020)
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement