REDIVIVUS

Proposals / #982

gpInvCursorItem (0x007bcbd8) is a signed int: the inventory mouse Y, compared with JL/JG/JLE

stale · by Niehztog · submitted 2026-11-02

The analysis holds (the global receives the mouse message's Y beside gnInvMouseX and every compare is signed), but 0x007bcbd8 is already typed int in the database, so there is nothing left to apply.

The global is undefined4, which the source generator emits as uint32_t. Every comparison the original makes with it is signed: INV_DrawNpcButtonTooltip loads it (004886f7) and tests it against the button's top and the panel's bottom with JL (00488702), JG (0048870e), JLE (0048875a) and JL (00488771); INV_HandleShopLeftClick (00488c0e JGE) and INPUT_InventoryLeftClick (004920f3 JLE) do the same. An unsigned global compiles to JB/JA/JBE there. It holds the mouse Y beside gnInvMouseX (0x007bca4c, int): it is assigned the mouse message's Y and passed with gnInvMouseX to the shop and bank hit tests. Recompiled with VC8 SP1 (oracle, tree 3dba660), the four jumps come out as the original's and INV_DrawNpcButtonTooltip goes from 0.953 to 0.984; no function lost. Only the type changes: the name, which reads like a pointer, is a chosen one.

Changes 1, applied together

  1. Retype global win 0x007bcbd8

    typeundefined4 (4 bytes)→int