Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.clear()
- memory.usememorydomain("System Bus")
- client.SetGameExtraPadding(0,0,134,0)
- local MouseX = 0
- local MouseY = 0
- local clickedFrames = 0
- local clicked = false
- local prevframe = emu.framecount()
- function arrowDown(xpos,ypos,col)
- gui.drawLine(xpos,ypos,xpos+6,ypos,col)
- gui.drawLine(xpos+1,ypos+1,xpos+5,ypos+1,col)
- gui.drawLine(xpos+2,ypos+2,xpos+4,ypos+2,col)
- gui.drawPixel(xpos+3,ypos+3,col)
- end
- function arrowUp(xpos,ypos,col)
- gui.drawLine(xpos,ypos,xpos+6,ypos,col)
- gui.drawLine(xpos+1,ypos-1,xpos+5,ypos-1,col)
- gui.drawLine(xpos+2,ypos-2,xpos+4,ypos-2,col)
- gui.drawPixel(xpos+3,ypos-3,col)
- end
- local addressList={
- --address color note
- [1]={0x0040,0xFFA0A0A0,"VBLANK START"},
- [2]={0x2258,0xFFFFE000,"READ FFEA"},
- [3]={0x225D,0xFFFFE000,"READ FFE9"},
- [4]={0x2267,0xFFFF7000,"UPDATE FFE9(+1)"},
- [5]={0x2198,0xFFFFE000,"READ FFEA"},
- [6]={0x218A,0xFFFF7000,"UPDATE FFEA(03)"},
- [7]={0x2195,0xFFFF7000,"UPDATE FFEA(00)"},
- [8]={0x22A6,0xFFFF7000,"UPDATE FFEA(02)"},
- [9]={0x0067,0xFFA0A0A0,"0067"},
- [10]={0x06E7,0xFF00E0FF,"FFFE5->HL"},
- [11]={0x0723,0xFF0070FF,"UPDATE FFFE5"},
- [12]={0x21D8,0xFF00E0FF,"READ FFE5"}
- }
- local addressListFrame={}
- local address=0
- local col=0
- local index=1
- local ListOffset=1
- local Mouse={}
- function text(x, y, text, color, backcolor)
- --gui.drawText(x, y, text,color,backcolor,10,"Arial")
- gui.pixelText(x, y, text, color, backcolor)
- end
- local addAddress=function(n)
- addressListFrame[index]=n
- index=index+1
- end
- for n=1,#addressList do
- address=addressList[n][1]
- color=addressList[n][2]
- label=addressList[n][3]
- event.onmemoryexecute(function()
- addAddress(n)
- end,address)
- event.onmemoryread(function()
- addAddress(n)
- end,address)
- event.onmemorywrite(function()
- addAddress(n)
- end,address)
- end
- event.onframestart(function()
- addressListFrame={}
- ListOffset=1
- end)
- event.onloadstate(function()
- addressListFrame={}
- ListOffset=1
- end)
- while true do
- thisframe=emu.framecount()
- MouseX = input.getmouse().X
- MouseY = input.getmouse().Y
- clicked = input.getmouse().Left
- if clicked then clickedFrames = clickedFrames + 1
- else clickedFrames = 0 end
- text(164,2,"FRAME " .. emu.framecount(),0xFFA060A0)
- n=1
- for s=ListOffset,#addressListFrame do
- z=addressListFrame[s]
- text(164,4+n*7,string.upper(string.format("%04x",addressList[z][1])),0xFFFFFFFF)
- text(186,4+n*7,addressList[z][3],addressList[z][2])
- n=n+1
- end
- index=1
- if MouseX>280 and MouseX<290 and MouseY>120 and MouseY<128 then
- if clicked and clickedFrames%2==1 then
- if ListOffset>1 then
- ListOffset=ListOffset-1
- end
- end
- arrowUp(282,123,0xFFFFFFFF)
- else
- arrowUp(282,123,0xA0FFFFFF)
- end
- if MouseX>280 and MouseX<290 and MouseY>130 and MouseY<138 then
- if clicked and clickedFrames%2==1 then
- if ListOffset<#addressListFrame-13 then
- ListOffset=ListOffset+1
- end
- end
- arrowDown(282,133,0xFFFFFFFF)
- else
- arrowDown(282,133,0xA0FFFFFF)
- end
- text(281,104,ListOffset-1,0xFFE0E0E0)
- if client.ispaused() then
- gui.DrawFinish()
- emu.yield()
- else
- emu.frameadvance()
- end
- prevframe=thisframe
- clicked=false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement