Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2025
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.18 KB | Gaming | 0 0
  1. console.clear()
  2. memory.usememorydomain("System Bus")
  3.  
  4. client.SetGameExtraPadding(0,0,134,0)
  5.  
  6. local MouseX    = 0
  7. local MouseY    = 0
  8. local clickedFrames = 0
  9. local clicked       = false
  10. local prevframe = emu.framecount()
  11.  
  12. function arrowDown(xpos,ypos,col)
  13.     gui.drawLine(xpos,ypos,xpos+6,ypos,col)
  14.     gui.drawLine(xpos+1,ypos+1,xpos+5,ypos+1,col)
  15.     gui.drawLine(xpos+2,ypos+2,xpos+4,ypos+2,col)
  16.     gui.drawPixel(xpos+3,ypos+3,col)
  17. end
  18.  
  19. function arrowUp(xpos,ypos,col)
  20.     gui.drawLine(xpos,ypos,xpos+6,ypos,col)
  21.     gui.drawLine(xpos+1,ypos-1,xpos+5,ypos-1,col)
  22.     gui.drawLine(xpos+2,ypos-2,xpos+4,ypos-2,col)
  23.     gui.drawPixel(xpos+3,ypos-3,col)
  24. end
  25.  
  26. local addressList={
  27.     --address color note
  28. [1]={0x0040,0xFFA0A0A0,"VBLANK START"},
  29. [2]={0x2258,0xFFFFE000,"READ FFEA"},
  30. [3]={0x225D,0xFFFFE000,"READ FFE9"},
  31. [4]={0x2267,0xFFFF7000,"UPDATE FFE9(+1)"},
  32. [5]={0x2198,0xFFFFE000,"READ FFEA"},
  33. [6]={0x218A,0xFFFF7000,"UPDATE FFEA(03)"},
  34. [7]={0x2195,0xFFFF7000,"UPDATE FFEA(00)"},
  35. [8]={0x22A6,0xFFFF7000,"UPDATE FFEA(02)"},
  36. [9]={0x0067,0xFFA0A0A0,"0067"},
  37. [10]={0x06E7,0xFF00E0FF,"FFFE5->HL"},
  38. [11]={0x0723,0xFF0070FF,"UPDATE FFFE5"},
  39. [12]={0x21D8,0xFF00E0FF,"READ FFE5"}
  40. }  
  41.  
  42. local addressListFrame={}
  43.  
  44. local address=0
  45. local col=0
  46. local index=1
  47. local ListOffset=1
  48. local Mouse={}
  49.    
  50. function text(x, y, text, color, backcolor)
  51.     --gui.drawText(x, y, text,color,backcolor,10,"Arial")
  52.     gui.pixelText(x, y, text, color, backcolor)
  53. end
  54.    
  55. local addAddress=function(n)
  56.     addressListFrame[index]=n
  57.     index=index+1
  58. end
  59.    
  60. for n=1,#addressList do
  61.     address=addressList[n][1]
  62.     color=addressList[n][2]
  63.     label=addressList[n][3]
  64.  
  65.     event.onmemoryexecute(function()
  66.         addAddress(n)
  67.     end,address)
  68.    
  69.     event.onmemoryread(function()
  70.         addAddress(n)
  71.     end,address)
  72.    
  73.     event.onmemorywrite(function()
  74.         addAddress(n)
  75.     end,address)
  76. end
  77.    
  78. event.onframestart(function()
  79.     addressListFrame={}
  80.     ListOffset=1
  81. end)
  82.  
  83. event.onloadstate(function()
  84.     addressListFrame={}
  85.     ListOffset=1
  86. end)
  87.    
  88. while true do
  89.  
  90.     thisframe=emu.framecount()
  91.     MouseX = input.getmouse().X
  92.     MouseY = input.getmouse().Y
  93.     clicked = input.getmouse().Left
  94.     if clicked then clickedFrames = clickedFrames + 1
  95.     else clickedFrames = 0 end
  96.        
  97.     text(164,2,"FRAME " .. emu.framecount(),0xFFA060A0)
  98.     n=1
  99.     for s=ListOffset,#addressListFrame do
  100.         z=addressListFrame[s]
  101.         text(164,4+n*7,string.upper(string.format("%04x",addressList[z][1])),0xFFFFFFFF)
  102.         text(186,4+n*7,addressList[z][3],addressList[z][2])
  103.         n=n+1
  104.     end
  105.    
  106.     index=1
  107.    
  108.     if MouseX>280 and MouseX<290 and MouseY>120 and MouseY<128 then
  109.         if clicked and clickedFrames%2==1 then
  110.             if ListOffset>1 then
  111.                 ListOffset=ListOffset-1
  112.             end
  113.         end
  114.  
  115.         arrowUp(282,123,0xFFFFFFFF)
  116.     else   
  117.         arrowUp(282,123,0xA0FFFFFF)    
  118.     end
  119.    
  120.     if MouseX>280 and MouseX<290 and MouseY>130 and MouseY<138 then
  121.         if clicked and clickedFrames%2==1 then
  122.             if ListOffset<#addressListFrame-13 then
  123.                 ListOffset=ListOffset+1
  124.             end
  125.         end
  126.  
  127.         arrowDown(282,133,0xFFFFFFFF)
  128.     else   
  129.         arrowDown(282,133,0xA0FFFFFF)      
  130.     end
  131.    
  132.     text(281,104,ListOffset-1,0xFFE0E0E0)
  133.  
  134.    
  135.     if client.ispaused() then
  136.         gui.DrawFinish()
  137.         emu.yield()
  138.     else
  139.         emu.frameadvance()
  140.     end
  141.  
  142.     prevframe=thisframe
  143.     clicked=false
  144. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement