REDIVIVUS

Proposals / #1028

gnUniqueCursorFrame and gnPentaSpinCursorFrame are signed ints: each wraps at its int frame count with JL

applied · by Niehztog · submitted 2026-11-02, applied 2026-11-02

Ghidra v1841 · 4ca0e98

D2COMP_DrawCompositeUnit advances the two cursor animation frames and wraps each at its frame count, which the database already types int (gnUniqueCursorMaxFrames 0x0087e848, gnPentaSpinCursorMaxFrames 0x0087e854). Both compares are signed: 00503e10 MOV EAX,[0x0087e84c] / ADD EAX,1 / 00503e18 CMP EAX,[0x0087e848] / 00503e23 JL, and 00503e2f MOV EAX,[0x0087e858] / ADD EAX,1 / 00503e37 CMP EAX,[0x0087e854] / 00503e42 JL. As undefined4 the generator declares the counters uint32_t, which makes both compares unsigned (JB). Recompiled with VC8 SP1 (the 1.14d compiler) on main f26206a with both as int: the two jumps come out as the original's JL, and no function in the TU changes status.

Changes 2, applied together

  1. Retype global win 0x0087e84c

    typeundefined4 (4 bytes)→int
  2. Retype global win 0x0087e858

    typeundefined4 (4 bytes)→int