Mac D2WINFONT_DrawTextWithOptionalBackground: __cdecl void (wszText, nX, nY, ePalette, bDrawBackground, eDrawMode)
Ghidra vmac 111 · 3c6740e
Mac body takes six stack arguments and no register inputs (ECX/EDX are only written before use): [EBP+8] is handed in ECX to the text-width/draw calls (the wide string), [EBP+0xc]/[EBP+0x10] are the X/Y origin, [EBP+0x14] the palette, [EBP+0x18] is tested for non-zero to draw the padded background box, and [EBP+0x1c] is the draw mode forwarded to the final draw. Windows twin D2WINFONT_DrawTextWithOptionalBackground 0x00502360 is void (WCHAR * wszText, int32_t nX, int32_t nY, GLOBALPALLETE eGlobalPalette, int32_t bDrawBackground, DRAWMODE eDrawMode); same order on Mac, all on the stack.
Changes 1, applied together
Set prototype
mac 0x00048480signatureundefined D2WINFONT_DrawTextWithOptionalBackground(void)→void D2WINFONT_DrawTextWithOptionalBackground(WCHAR * wszText, int32_t nX, int32_t nY, GLOBALPALLETE eGlobalPalette, int32_t bDrawBackground, DRAWMODE eDrawMode)conventionunknown→__cdecl