Prev: 8C04 Up: Map Next: 8C3F
8C05: Add an object's acceleration to its velocity, within its top speed
Called by the update routines move_missile, update_cloud, update_small_object, update_tough_attacker and update_attacker. Velocity (+7 +8 in X, +9 +A in Y) and acceleration (+B +C, +E +F) are signed 8.8 numbers, high byte first. The top speed is (+$10 AND 7) + 1 whole pixels a pass; a velocity that goes past it is set to exactly that (limit_speed).
Input
IX The object
accelerate 8C05 LD A,(IX+$10) The limits, n and -(n + 1)
8C08 AND $07
8C0A INC A
8C0B LD (speed_limit),A
8C0E CPL
8C0F LD (speed_limit_down),A
8C12 LD H,(IX+$07) X velocity plus X acceleration, limited
8C15 LD L,(IX+$08)
8C18 LD D,(IX+$0B)
8C1B LD E,(IX+$0C)
8C1E ADD HL,DE
8C1F CALL limit_speed
8C22 LD (IX+$07),H
8C25 LD (IX+$08),L
8C28 LD H,(IX+$09) Y velocity plus Y acceleration, limited
8C2B LD L,(IX+$0A)
8C2E LD D,(IX+$0E)
8C31 LD E,(IX+$0F)
8C34 ADD HL,DE
8C35 CALL limit_speed
8C38 LD (IX+$09),H
8C3B LD (IX+$0A),L
8C3E RET
Prev: 8C04 Up: Map Next: 8C3F