REDIVIVUS

Proposals / #1134

Type the 3 Mac preset-object-load quest hooks with QUEST_DispatchPresetObjectLoad's cdecl args

approved · by KierTaylor · submitted 2026-11-05, approved 2026-11-05

Mac QUEST_DispatchPresetObjectLoad (0x00217143, __cdecl pGame, pUnit, pPresetUnit) tail-JMPs to Q31_OnPresetObjectLoad, Q33_OnPresetObjectLoad1 and Q33_OnPresetObjectLoad2 after POP EBP, so they receive its three stack args unchanged. Each body reads [EBP+8], passes it as pGame to GetQuestDataByQuestNoInternal (0x0021326f), reads [EBP+0x10], passes it as pSrcPresetUnits (D2PresetUnitStrc*) to DRLGPRESET_CopyPresetObjects (0x0015ed41), never reads ECX/EDX on entry and ends in a plain RET. All three are currently "undefined (void)" with an unknown convention. [EBP+0xc] (pUnit) is unused but present in the shared frame. Note: the Windows twins type their stack arg as D2MapAIStrc* pMapAI, but at 0x00587964 it goes in EDX to DRLGPRESET_CopyPresetObjects (0x006660b0) as the preset list, and their plates say pPresetUnit. This proposal leaves Windows unchanged.

Changes 3, applied together

  1. Set prototype mac 0x0023b037

    signatureundefined Q31_OnPresetObjectLoad(void)→void Q31_OnPresetObjectLoad(D2GameStrc * pGame, D2UnitStrc * pUnit, D2PresetUnitStrc * pPresetUnit)
    conventionunknown→__cdecl
  2. Set prototype mac 0x0023f7df

    signatureundefined Q33_OnPresetObjectLoad1(void)→void Q33_OnPresetObjectLoad1(D2GameStrc * pGame, D2UnitStrc * pUnit, D2PresetUnitStrc * pPresetUnit)
    conventionunknown→__cdecl
  3. Set prototype mac 0x0023f88d

    signatureundefined Q33_OnPresetObjectLoad2(void)→void Q33_OnPresetObjectLoad2(D2GameStrc * pGame, D2UnitStrc * pUnit, D2PresetUnitStrc * pPresetUnit)
    conventionunknown→__cdecl