Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Luascript for bizhawk 1.11.6
- -- by mugg1991 27th Mar 2016
- -- Stuart Little 2 (UE).gba
- 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+25, 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+34,y+8,s,0xFFffffff)
- end
- client.SetGameExtraPadding(0,28,0,0)
- event.onloadstate(function()
- XspeedSame=0
- end)
- addressTable={
- -- xpos ypos xspeed yspeed xcam ycam
- [-1]={-1,-1,-1,-1},
- [1]={0x040300,0x040304,0x04030c,0x040310,nil,nil}, --Level 1
- [2]={0x040468,0x04046c,nil,nil,0x04060e,nil}, --Level 2
- [3]={0,0,0,0,0,0}, --Level 3
- [4]={0,0,0,0,0,0}, --Level 4
- [5]={0,0,0,0,0,0}, --Level 5
- [6]={0,0,0,0,0,0}, --Level 6
- [7]={0,0,0,0,0,0}, --Level 7
- [8]={0,0,0,0,0,0}, --Level 8
- [9]={0,0,0,0,0,0}, --Level 9
- [10]={0,0,0,0,0,0}, --Level 10
- [11]={0,0,0,0,0,0}, --Level 11
- [12]={0,0,0,0,0,0} -- Level 12 are there even so many levels idk
- }
- valueTable={
- ["xpos"]=nil,
- ["ypos"]=nil,
- ["xspeed"]=nil,
- ["yspeed"]=nil,
- ["xcam"]=nil,
- ["ycam"]=nil
- }
- valueNameTable={
- [1]="xpos",
- [2]="ypos",
- [3]="xspeed",
- [4]="yspeed",
- [5]="xcam",
- [6]="ycam"
- }
- while true do
- memory.usememorydomain("Combined WRAM")
- Level=memory.read_u8(0x009784)+1
- if Level <1 or Level > 10 then Level=-1 end
- for i=1,6,1 do
- if addressTable[Level][i]~=nil then
- if valueNameTable[i]=="xcam" then
- valueTable[valueNameTable[i]]=memory.read_u16_le(addressTable[Level][i])
- else
- valueTable[valueNameTable[i]]=memory.read_s32_le(addressTable[Level][i])
- end
- else
- valueTable[valueNameTable[i]]="x"
- end
- end
- drawFrameCountAndInput(10,34)
- text(210,2,"Level",0xffA08000)
- text(210,10,Level,0xffA0A0A0)
- if addressTable[Level][1]~=0 then
- text(10,2,"Pos",0xffA08000)
- text(80,2,"Speed",0xffA08000)
- text(150,2,"Cam",0xffA08000)
- count=1
- for i=1,3,1 do
- for p=1,2,1 do
- text(i*70-60,p*8+2,valueTable[valueNameTable[count]],0xffA0A0A0)
- count=count+1
- end
- end
- elseif addressTable[Level][1]==-1 then
- text(60,8,"not a valid address set",0xffA0A0A0)
- else
- text(60,8,"sorry, but I guess you have\nsome address finding to do :)",0xffA0A0A0)
- end
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement