benilla-re systems structs docs

s_displacementCaseIndex

global · collision

Address
0x7c547c · 15 bytes, up to 0x7c548a
Type
uint8_t[15]
Meaning
Holds the case index for modes 1 to 15 of the displacement dispatcher
Confidence
verified, proof one
Finding
collision/kinematics#displacement-dispatcher

Finding: Displacement dispatcher in collision: kinematics

0x7c5360(ms, override, out) returns 0 for ms = 0. Else t = fl(ms · 0.001) (0x3a83126f, ms unsigned), and builds a mode. With 0x30 set or override not null it calls 0x7c4f30(t, override) and sets bit 2 unless 0x2000 (falling) is set; with 0xc0, swimming or not, it calls 0x7c4f80(t) and sets bit 8; 0x3 sets bit 1 and 0xc bit 4. The mode picks the displacement:

modes (1 move, 2 turn, 4 strafe, 8 pitch)handlerreturns
0none1
1, 4, 5, 120x7c4ed0, straight line1
2, 8, 10none0
3, 6, 7, 140x7c52c0, turn arc1
9, 130x7c5180, pitch arc1
11, 150x7c4fd0, turn and pitch1

With no handler out is untouched; every caller zeroes it first.

The derivation is in the doc.