REDIVIVUS

Proposals / #1706

nIndex in GetDifficultyLevels (EAX) is a signed int, not DWORD

checked · by Nugwa628 · submitted 2026-11-09

The clamped index lives in EAX and is produced by a signed clamp of the int32_t argument: 00611d33 MOV EAX,[EBP+0x8] / 00611d38 TEST EAX,EAX / 00611d3a SETLE CL / 00611d3d SUB ECX,1 / 00611d40 AND EAX,ECX (negative -> 0). Its only compare is signed: 00611d4b CMP EAX,ECX / 00611d4d JL, against the record count minus one (00611d42 MOV ECX,[0x0096c8b0] / 00611d48 ADD ECX,-1). The only other use is 00611d51 IMUL EAX,EAX,0x58 / 00611d54 ADD EAX,[0x0096c8ac]. No unsigned jump, SHR, DIV or MUL touches it in the 17-instruction function. Mac twin 0013f6be clamps the same value with CMOVNS and CMOVLE (both signed).

Changes 1, applied together

  1. Retype variable win 0x00611d30 EAX

    typeDWORD→int