Isotarge

Barebones DK64 Position (BizHawk)

Feb 20th, 2017
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. while true do
  2.     local player = mainmemory.read_u32_be(0x7FBB4C);
  3.     if player >= 0x80000000 and player < 0x80800000 then
  4.         player = player - 0x80000000;
  5.         local xPos = mainmemory.readfloat(player + 0x7C, true);
  6.         local yPos = mainmemory.readfloat(player + 0x80, true);
  7.         local zPos = mainmemory.readfloat(player + 0x84, true);
  8.         gui.text(2, 70, "Player X: "..xPos);
  9.         gui.text(2, 86, "Player Y: "..yPos);
  10.         gui.text(2, 100, "Player Z: "..zPos);
  11.     else
  12.         gui.text(2, 70, "Player not found");
  13.     end
  14.     local camera = mainmemory.read_u32_be(0x7FB968);
  15.     if camera >= 0x80000000 and camera < 0x80800000 then
  16.         camera = camera - 0x80000000;
  17.         local xPos = mainmemory.readfloat(camera + 0x1FC, true);
  18.         local yPos = mainmemory.readfloat(camera + 0x200, true);
  19.         local zPos = mainmemory.readfloat(camera + 0x204, true);
  20.         gui.text(2, 132, "Camera X: "..xPos);
  21.         gui.text(2, 148, "Camera Y: "..yPos);
  22.         gui.text(2, 164, "Camera Z: "..zPos);
  23.     else
  24.         gui.text(2, 132, "Camera not found");
  25.     end
  26.     emu.yield();
  27. end
Advertisement
Add Comment
Please, Sign In to add comment