Prev: D6BD Up: Map Next: D72E
D6BF: Move vertical objects in the room
Used by the routine at E592.
Input
A Number of objects
IY Pointer to the room's sprite table
D6BF AND A Return if there are 0 objects to draw.
D6C0 RET Z
D6C1 LD B,A Put the count of objects in B.
D6C2 PUSH BC Remember the count in BC.
D6C3 LD D,(IY+$04)
D6C6 LD E,(IY+$00) Put the current Y co-ordinate in E.
D6C9 DEC (IY+$06) Decrement the frame count.
D6CC JR NZ,$D716 Jump forward if it hasn't hit zero.
D6CE LD A,(IY+$07) Set the frame count back to the highest value.
D6D1 LD (IY+$06),A
D6D4 BIT 7,D
D6D6 JR NZ,$D6FA
D6D8 LD A,D
D6D9 AND $07
D6DB JR Z,$D6E0
D6DD DEC D
D6DE JR $D716
D6E0 LD A,E
D6E1 CP (IY+$02)
D6E4 JR NZ,$D6EA
D6E6 LD D,$81
D6E8 JR $D716
D6EA PUSH DE
D6EB LD A,($D6BB)
D6EE DEC A
D6EF ADD A,E
D6F0 LD E,A
D6F1 CALL $D7D6 Draw in the attributes.
D6F4 POP DE
D6F5 DEC E
D6F6 LD D,$03
D6F8 JR $D716
D6FA LD A,D
D6FB AND $07
D6FD CP $04
D6FF JR Z,$D704
D701 INC D
D702 JR $D716
D704 LD A,E
D705 CP (IY+$03)
D708 JR NZ,$D70E
D70A LD D,$03
D70C JR $D716
D70E PUSH DE
D70F CALL $D7D6 Draw in the attributes.
D712 POP DE
D713 LD D,$81
D715 INC E
D716 LD (IY+$00),E
D719 LD A,(IY+$04)
D71C AND $40
D71E OR D
D71F LD (IY+$04),A
D722 CALL $D7E7 Draw the sprite.
D725 POP BC Restore the count in BC.
D726 LD DE,$0008 Move forward to the next object.
D729 ADD IY,DE
D72B DJNZ $D6C2 Loop until all objects of this type are drawn.
D72D RET
Prev: D6BD Up: Map Next: D72E