REDIVIVUS

Proposals / #787

Type the active Mac grid-search inputs and fully defined results

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-02

Ghidra vmac 110 · 9528519

Mac0016a831/0016a91a use EDX as int* X output, ECX as existing D2InventoryGridInfoStrc*, Stack4 as int* Y output and Stack8/12 as unsigned byte dimensions. Mac0016aa22 uses the same grid/dimensions with numeric X/Y. All native callers, pointer-producing grid helper and full bodies were checked. Searches store DWORD coordinates and return fullEAX0/1; scoring ends with MOVZX EAX,AL on every return, so its full32-bit result is0..255. Recover those input types/names and BOOL/uint32_t results. Preserve existing __regparm3, all six current slots and the unread undefined4 param_1 in EAX unchanged; no original meaning/type/arity is inferred for that existing slot. No incoming EAX bits are read before native definitions. All changed slots retain their widths/positions; chosen function names and layouts remain. Static Mac proof only.

Changes 3, applied together

  1. Set prototype mac 0x0016a831

    signatureundefined INVENTORY_FindBestFitGridPosition(undefined4 param_1, int * param_2, int param_3, int * param_4, undefined1 param_5, undefined1 param_6)→BOOL INVENTORY_FindBestFitGridPosition(undefined4 param_1, int * pOutX, D2InventoryGridInfoStrc * pGridInfo, int * pOutY, byte nItemWidth, byte nItemHeight)
    convention__regparm3
  2. Set prototype mac 0x0016a91a

    signatureundefined INVENTORY_FindFirstFreeGridPosition(undefined4 param_1, int * param_2, int param_3, int * param_4, undefined1 param_5, undefined1 param_6)→BOOL INVENTORY_FindFirstFreeGridPosition(undefined4 param_1, int * pOutX, D2InventoryGridInfoStrc * pGridInfo, int * pOutY, byte nItemWidth, byte nItemHeight)
    convention__regparm3
  3. Set prototype mac 0x0016aa22

    signatureundefined INVENTORY_GetGridPlacementScore(undefined4 param_1, int param_2, int param_3, int param_4, byte param_5, byte param_6)→uint32_t INVENTORY_GetGridPlacementScore(undefined4 param_1, int nX, D2InventoryGridInfoStrc * pGridInfo, int nY, byte nItemWidth, byte nItemHeight)
    convention__regparm3