REDIVIVUS

Proposals / #1285

Mac D2GFX_SetPalette: void __cdecl (void* pPalette)

checked · by KierTaylor · submitted 2026-11-06

The Mac body reads only [EBP+8] (the palette pointer). If it is non-NULL, 0x400 bytes (256 PALETTEENTRY) are copied into the global palette buffer, then the code tail-jumps to renderer slot +0x7c; if it is NULL it calls that slot with the buffer and returns (plain RET). Callers (D2WINPAL_LoadActPalette 0x0004bde6, D2WINPAL_LoadPaletteFiles 0x0004c20c, D2GFX_SwitchModule 0x002b4bba) pass one pointer. Same as the Windows twin 0x004f63d0 (LPPALETTEENTRY pPalette), but LPPALETTEENTRY is not in the Mac DB, so the arg is void*.

Changes 1, applied together

  1. Set prototype mac 0x002b5170

    signatureundefined D2GFX_SetPalette(void)→void D2GFX_SetPalette(void* pPalette)
    conventionunknown→__cdecl