REDIVIVUS

Proposals / #1090

Type client draw, sound, gateway and sprite cache parameters held as integers as the struct pointers they are

checked · by dtchitt · submitted 2026-11-03

Ten client parameters typed int or int32_t hold a pointer, and each body reads only fields of that struct at their width. DRAW_UpdateTileVisibilityBounds reads bPerspectiveHasEffectOnSprite (0x28) and grows nMinTileX..nMaxTileY (0x2c to 0x38) of D2DrawFloorStrc. DRLGGRID_SetOutRoomEdgeFlags reads pDrlgLevelData (0x14) of the D2DrlgLevelStrc its caller passes. SOUND_StopUnitSound reads nSoundId (0x4), nChannelHandle (0x8) and 0x30, and sets 0x3d, of D2SoundChannelStrc. SetCurGateway (?SetCurGateway@BNGatewayAccess@@QAGXH@Z, this on the stack) reads pGatewayData (0x10) and writes nCurGatewayIdx (0xc) and bDirty (0x4) of D2BNetGatewayAccessStr. GFXUTIL_GetOverlayFrameDelay reads neOverlayId (0x4) and nRandomOffset (0x18). The sprite cache helpers walk pLruHead..pPriorityLruTail (0x14 to 0x20) of D2GfxMemoryStrc and dwFlags, dwLastAccess, pNext, pPrev (0xc to 0x18) of D2SpriteCacheEntryStrc.

Changes 10, applied together

  1. Retype variable win 0x004dde80 ECX

    typeint32_t→D2DrawFloorStrc *
  2. Retype variable win 0x00680a70 ECX

    typeint→D2DrlgLevelStrc *
  3. Retype variable win 0x004ba760 ESI

    typeint32_t→D2SoundChannelStrc *
  4. Retype variable win 0x00518150 Stack[0x4]

    typeint32_t→D2BNetGatewayAccessStr *
  5. Retype variable win 0x004dbe20 EDX

    typeint32_t→D2GfxUnknown_0xa8 *
  6. Retype variable win 0x005ff1b0 ECX

    typeint32_t→D2GfxMemoryStrc *
  7. Retype variable win 0x005ff1b0 EAX

    typeint32_t→D2SpriteCacheEntryStrc *
  8. Retype variable win 0x005ff060 EAX

    typeint32_t→D2GfxMemoryStrc *
  9. Retype variable win 0x005ff060 ESI

    typeint32_t→D2SpriteCacheEntryStrc *
  10. Retype variable win 0x005ff5b0 EDX

    typeint32_t→D2SpriteCacheEntryStrc *