Jimmie1717 icon

BizHawk: Majora's Mask (U) Explosive Positions

Jimmie1717 | PRO | 01/23/17 02:14:50 AM UTC | 0 ⭐ | 1448 👁️ | Never ⏰ | []
Lua |

2.04 KB

|

None

|

0 👍

/

0 👎

-- Majora's Mask (U): Explosives Positions Script
-- by Jimmie1717
-- BizHawk 1.11.8.2
 
-- Setup for 640x480 Display.
-- Positions will be shown in the bottle right corner.
-- Adjust "anchor_x/y" on lines 24/25 if you want it to display somewhere else on screen.
 
console.clear();
gui.defaultTextBackground(0x00000000);
 
-- Global
readDWord               = memory.read_u32_be;
readFloat               = memory.readfloat;
writeDWord              = memory.write_u32_be;
writeFloat              = memory.writefloat;
drawText                = gui.drawText;
 
-- Explosive Pointer
local explosive_pointer = 0x3E87F8;
 
function explosivesPositionsDisplay()
 
    local anchor_x      = 579;
    local anchor_y      = 320;
    
    local pointer       = readDWord(explosive_pointer);
    
    -- Loop through current explosives out.
    for i = 1, 3, 1 do
    
        if (pointer ~= 0x00000000 and pointer > 0x80000000) then
            local x     = pointer - 0x80000000 + 0x00000024;
            local y     = pointer - 0x80000000 + 0x00000028;
            local z     = pointer - 0x80000000 + 0x0000002C;
            
            drawText(anchor_x + 1, anchor_y + 1, string.format("%s %d:", "Bomb ", i), "BLACK");
            drawText(anchor_x + 0, anchor_y + 0, string.format("%s %d:", "Bomb ", i));
            drawText(anchor_x + 6, anchor_y + 13, string.format("% 7.1f", readFloat(x, true)), "BLACK");
            drawText(anchor_x + 5, anchor_y + 12, string.format("% 7.1f", readFloat(x, true)));
            drawText(anchor_x + 6, anchor_y + 25, string.format("% 7.1f", readFloat(y, true)), "BLACK");
            drawText(anchor_x + 5, anchor_y + 24, string.format("% 7.1f", readFloat(y, true)));
            drawText(anchor_x + 6, anchor_y + 37, string.format("% 7.1f", readFloat(z, true)), "BLACK");
            drawText(anchor_x + 5, anchor_y + 36, string.format("% 7.1f", readFloat(z, true)));
            
            anchor_y    = anchor_y + 54;
            
            pointer     = readDWord(pointer - 0x80000000 + 0x0000012C);
        else
            break;
        end
        
    end
end
 
-- Core Loop
while true do
        
    -- Call Display Function if the pointer is not null.
    if (readDWord(explosive_pointer) ~= 0x00000000) then
        explosivesPositionsDisplay();
    end
    
    emu.frameadvance()
        
end

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎