REDIVIVUS

Proposals / #1273

Mac SUNITPROXY_InitNpcTradeItems: void __fastcall (D2GameStrc* pGame ECX, void* pTradeList EDX, int32_t nNpcTableIdx)

checked · by KierTaylor · submitted 2026-11-06

ECX = pGame (its memory pool at +0x1c is passed to the Fog alloc, and it is saved to [EBP-0x10]). EDX -> ESI = the trade-list block (count written to +4, then the allocated buffer). [EBP+8] = nNpcTableIdx (halts if >= 0x11 at line 0xa4, then indexes a 16-byte static table). There are no other stack reads; void. Both SUNITPROXY_AllocNpcControl sites (0x0028be10, 0x0028be39) load ECX=ESI (pGame), EDX=LEA [EDI+EBX+0x2c] and [ESP]=a table index (9/0x10/0xe/0xf). Same roles as the Windows twin 0x00535fb0 (nNpcTableIdx EAX, pGame EBX, pTradeList EDI). Typed void* because the block has a count at +4.

Changes 1, applied together

  1. Set prototype mac 0x0028bf48

    signatureundefined SUNITPROXY_InitNpcTradeItems(void)→void SUNITPROXY_InitNpcTradeItems(D2GameStrc* pGame, void* pTradeList, int32_t nNpcTableIdx)
    conventionunknown→__fastcall