Prev: D730 Up: Map Next: D7A2
D732: Move horizontal objects in the room
Used by the routine at E592.
Input
A Number of objects to draw
IY Pointer to the room's sprite table
D732 AND A Return if there are zero objects to draw.
D733 RET Z
D734 LD B,A Put the count of objects in B.
D735 PUSH BC Remember the count in BC.
D736 LD E,(IY+$04)
D739 LD D,(IY+$01) Put the current Y co-ordinate in D.
D73C DEC (IY+$06) Decrement the frame count.
D73F JR NZ,$D78A Jump forward if it hasn't hit zero.
D741 LD A,(IY+$07) Set the frame count back to the highest value.
D744 LD (IY+$06),A
D747 BIT 7,E
D749 JR NZ,$D76E
D74B LD A,E
D74C AND $07
D74E CP $07
D750 JR Z,$D755
D752 INC E
D753 JR $D78A
D755 LD A,D
D756 CP (IY+$02)
D759 JR NZ,$D75F
D75B LD E,$80
D75D JR $D78A
D75F DEC D
D760 PUSH DE
D761 LD A,($D72F)
D764 ADD A,D
D765 LD D,A
D766 CALL $D7A2 Draw in the attributes.
D769 POP DE
D76A LD E,$04
D76C JR $D78A
D76E LD A,E
D76F AND $07
D771 CP $03
D773 JR Z,$D778
D775 INC E
D776 JR $D78A
D778 LD A,D
D779 CP (IY+$03)
D77C JR NZ,$D782
D77E LD E,$04
D780 JR $D78A
D782 PUSH DE
D783 CALL $D7A2 Draw in the attributes.
D786 POP DE
D787 LD E,$80
D789 INC D
D78A LD (IY+$01),D
D78D LD A,(IY+$04)
D790 AND $40
D792 OR E
D793 LD (IY+$04),A
D796 CALL $D7B7 Draw the sprite.
D799 POP BC Restore the count in BC.
D79A LD DE,$0008 Move forward to the next object.
D79D ADD IY,DE
D79F DJNZ $D735 Loop until all objects of this type are drawn.
D7A1 RET
Prev: D730 Up: Map Next: D7A2