Advertisement
fig02

mzx fire ww script

Feb 22nd, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var test_addr = 0x8016B600;
  2. var exec_addr = 0x800D41DC;
  3.  
  4. var log_state = 1;
  5. var save_ctx = 0x8011A5D0;
  6. //var id = events.onexec(0x8009A750);
  7.  
  8. var particleHash = {
  9. }
  10.  
  11.  
  12. events.onexec(0x8009A750, function()
  13. {
  14.     console.log("---- SCENE NEW ----")
  15.     console.log("ENT: " + mem.s32[save_ctx].toString(16));
  16.     console.log("Cutscene Pointer: "+ mem.u32[gpr.a0+0x1D68].toString(16))
  17. })
  18.  
  19. //Particle Logging
  20. var particle_id = -1;
  21. var hit = 0;
  22. events.onexec(0x8001B468, function()
  23. {
  24.     particle_id = gpr.a1;
  25.    
  26.    
  27.    
  28.     if (!particleHash.hasOwnProperty(gpr.ra))
  29.     {
  30.         particleHash[gpr.ra] = true;
  31.         console.log("! " + (gpr.ra-8).toString(16) + " new particle request source 0x"
  32.         + gpr.a1.toString(16))
  33.     }
  34. })
  35. events.onexec(0x8001B4E0, function()
  36. {
  37.     console.log(": Allocating Particle 0x" + particle_id.toString(16) + " code")
  38. })
  39. /*
  40. var AllocTemp = 0;
  41.  
  42. events.onexec(0x800CE17C, function()
  43. {
  44.     AllocTemp = gpr.a1;
  45. })
  46. */
  47.  
  48. events.onexec(0x800CE2AC, function()
  49. {
  50.     //console.log("0x800CE17C: )
  51.     console.log(": " + gpr.v0.toString(16) +" " + mem.s32[gpr.v0-0x2C].toString(16) +" - Tail End Allocation" )
  52. })
  53.  
  54. events.onexec(0x80080A3C, function()
  55. {
  56.     console.log("---- LOAD ROOM " + gpr.a2 + " ----")
  57. })
  58.  
  59. events.onexec(0x800CCBB8, function()
  60. {
  61.     if (log_state == 1)
  62.     {
  63.         console.log(": "
  64.         +  mem.u32[gpr.sp+0x10].toString(16)
  65.         + " = " + gpr.a0.toString(16)
  66.         + ":" + gpr.a1.toString(16)
  67.         + " " + gpr.a2.toString(16)
  68.         + ":" + gpr.a3.toString(16) )
  69.     }
  70. })
  71.  
  72.  
  73. /*
  74. events.onexec(exec_addr, function()
  75. {
  76.     var line = "a0: " + gpr.a0.toString(16)
  77.     + " a1: " + gpr.a1.toString(16)
  78.     + " a2: " + gpr.a2.toString(16)
  79.     + " a3: " + gpr.a3.toString(16)
  80.     + " ra: " + gpr.ra.toString(16);
  81.     console.log(line)
  82. });
  83. */
  84. //console.log(Object.keys(gpr));
  85. //console.log(events.onexec);
  86.  
  87. function GetEntrypointStats()
  88. {
  89.     return "sp: " + gpr.sp.toString(16)
  90.     + " a0: " + gpr.a0.toString(16)
  91.     + " a1: " + gpr.a1.toString(16)
  92.     + " a2: " + gpr.a2.toString(16)
  93.     + " a3: " + gpr.a3.toString(16)
  94.     + " ra: " + gpr.ra.toString(16);
  95. }
  96.  
  97. function PrintFunctionEntryCSV()
  98. {
  99.     return gpr.sp.toString(16)
  100.     + "," + gpr.a0.toString(16)
  101.     + "," + gpr.a1.toString(16)
  102.     + "," + gpr.a2.toString(16)
  103.     + "," + gpr.a3.toString(16)
  104.     + "," + gpr.ra.toString(16);
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement