REDIVIVUS

Proposals / #675

Return room pointers from the two Windows tile-coordinate searches

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-01

Ghidra v1797 · 3bccb89

Win 00619b10 and 00619b60 return D2RoomStrc* or null, currently int32_t. The first loads the typed act's room head at +16, follows each room's +124 next link and returns the selected pointer. The second loads an element of the typed room-pointer array at +0, preserves it across the coordinate test, and explicitly moves it to EAX; exhausted scans clear full EAX. Complete CFGs prove no other returning values. Existing layouts and independent producers agree: AllocRoom allocates 128 bytes and links that same object into act+16/room+124; the adjacency producer fills entries from RoomEx+48, an existing D2RoomStrc* field. Restore only the return types, preserving three dword stack inputs, names, stdcall and RET12. Both functions have no incoming references, so no current caller or runtime benefit is claimed. Complete target, predicate and producer bodies are independently decoded from the original Windows PE; error paths terminate through the verified CRT ExitProcess chain.

Changes 2, applied together

  1. Set prototype win 0x00619b10

    signatureint32_t FindRoomByTileCoordinates(D2DrlgActStrc * pDrlgAct, int32_t nX, int32_t nY)→D2RoomStrc * FindRoomByTileCoordinates(D2DrlgActStrc * pDrlgAct, int32_t nX, int32_t nY)
    convention__stdcall
  2. Set prototype win 0x00619b60

    signatureint32_t GetAdjacentRoomByCoordinates(D2RoomStrc * pRoom, int32_t nX, int32_t nY)→D2RoomStrc * GetAdjacentRoomByCoordinates(D2RoomStrc * pRoom, int32_t nX, int32_t nY)
    convention__stdcall