REDIVIVUS

Proposals / #760

Recover the complete Mac inventory grid-placement contract

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

Ghidra vmac 109 · 39698f0

Complete799-byte Mac placer takes ECX inventory, EDX item, then four full stack dwords: X,Y,grid index,inventory page. Unit type4/item data and inventory magic/links prove pointer types. X/Y feed existing static-unit coordinate setters; grid0/1 select body/belt, grid>=2 uses page dimensions and stores grid+1 in item data. Inventory page feeds existing GetGridDimensions. Every one of4 callers prepares these exact6 inputs; body/belt pass constant grids0/1, coordinate/auto callers add2. Native return CFG proves only literal0/1 reach the full EAX status load. Recover BOOL __fastcc with precise pointers and four int32_t scalars, preserving full-width reads and actual caller cleanup. Independent Windows twin is corroboration only; its custom ABI is not imported. Existing selected names, shared structures and callers receive no edits.

Changes 1, applied together

  1. Set prototype mac 0x00167cb1

    signatureundefined INVENTORY_PlaceItemInGrid(void)→BOOL INVENTORY_PlaceItemInGrid(D2InventoryStrc * pInventory, D2UnitStrc * pItem, int32_t nX, int32_t nY, int32_t nGridIndex, int32_t eInventoryPage)
    conventionunknown→__fastcc