Advertisement
MrCheeze

OoT debug log lua script for BizHawk

Apr 29th, 2021
1,365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. output_string = ''
  2.  
  3. event.onmemoryread(function()
  4.     local str_ptr = emu.getregister('s2_lo') % 0x100000000
  5.     local count = emu.getregister('s3_lo') % 0x100000000
  6.    
  7.     while (count > 0) do
  8.         local char = string.char(mainmemory.readbyte(str_ptr - 0x80000000))
  9.         if char == '\n' then
  10.             print(output_string)
  11.             output_string = ''
  12.         else
  13.             output_string = output_string .. char
  14.         end
  15.         count = count - 1
  16.         str_ptr = str_ptr + 1
  17.     end
  18.    
  19. end, 0xB3FF0000)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement