Prev: B7E0 Up: Map Next: B890
B866: Be carried along by a block of graphic 140-143
Used by the routine at ADJ_DZ_FOR_OBJ_INTERSECT.
Called by ADJ_DZ_FOR_OBJ_INTERSECT when the object met in Z is one of graphics 140-143. These four share the plain block's sprite but move what meets them, in practice what stands on them: on every other turn (bit 0 of TURNS set) the mover's step gets two units in the direction the graphic's low two bits pick from the table at CONVEYOR_STEPS -- 140 +U, 141 -U, 142 +V, 143 -V. Only the first mover in a turn is pushed: bit 3 of the block's +$0D, set by ADJ_DZ_FOR_OBJ_INTERSECT just after this, is cleared only by the block's own update routine (CONVEYOR_PLUS_U and its three neighbours).
None of this ran in the build's sessions. It was run in the simulator instead: the player's legs falling onto each of the four graphics were given +2 U, -2 U, +2 V and -2 V on an odd turn, nothing on an even one, and nothing with the block's bit 3 already set.
Input
A the obstacle's graphic
IX the mover
IY the block
CONVEYOR_PUSH B866 BIT 3,(IY+$0D) something has met the block already this turn
B86A RET NZ
B86B AND $03 DE = the graphic's low two bits, times two
B86D ADD A,A
B86E PUSH DE
B86F PUSH HL
B870 LD D,$00
B872 LD E,A
B873 LD A,(TURNS) only on odd turns
B876 AND $01
B878 JR Z,CONVEYOR_PUSH_0
B87A LD HL,CONVEYOR_STEPS the table's dU and dV added to the mover's
B87D ADD HL,DE
B87E LD A,(HL)
B87F ADD A,(IX+$09)
B882 LD (IX+$09),A
B885 INC HL
B886 LD A,(HL)
B887 ADD A,(IX+$0A)
B88A LD (IX+$0A),A
CONVEYOR_PUSH_0 B88D POP HL DE and HL back
B88E POP DE
B88F RET
Prev: B7E0 Up: Map Next: B890