Prev: A793 Up: Map Next: A836
A7A4: Draw drones for multiple weapon
Used by the routine at 9470.
A7A4 LD A,($A1EE) Return if Rex is dead
A7A7 OR A
A7A8 RET NZ
A7A9 LD A,($A1AC) Return is weapon of Rex isn't multiple
A7AC CP $03
A7AE RET NZ
A7AF LD A,($A1F9) Return if Rex is teleporting
A7B2 OR A
A7B3 RET NZ
A7B4 LD IY,$5E4E Set IY the base address for drone configuration
A7B8 LD A,($A1AD) Set B the number of drones. Number of drones = 3 + multiple weapon energy level
A7BB ADD A,$03
A7BD LD B,A
A7BE PUSH BC Save BC
A7BF LD A,(IY+$02) Set A to the index into the offset position for drones
A7C2 SLA A Point HL to the address for the offset position
A7C4 LD E,A
A7C5 LD D,$00
A7C7 LD HL,$A836
A7CA ADD HL,DE
A7CB LD A,($A24F) Set A to the x-position of Rex
A7CE DEC A Computes x-position of drone based on x-offset and x-position of Rex Drone x-position = Rex x-position + x-offset - 1
A7CF ADD A,(HL)
A7D0 LD (IY+$00),A Set x-position of drone in table configuration buffer
A7D3 INC HL Increment address into offset position table
A7D4 LD A,($A250) Set A to the y-position of Rex
A7D7 ADD A,$02 Computes y-position of drone based on x-offset and y-position of Rex Drone y-position = Rex y-position + y-offset + 2
A7D9 ADD A,(HL)
A7DA LD (IY+$01),A Set y-position of drone in table configuration buffer
A7DD LD L,A Computes in HL the address into room graphic data for the drone position
A7DE LD H,$00
A7E0 ADD HL,HL
A7E1 ADD HL,HL
A7E2 ADD HL,HL
A7E3 ADD HL,HL
A7E4 ADD HL,HL
A7E5 LD DE,$E7FF
A7E8 ADD HL,DE
A7E9 LD E,(IY+$00)
A7EC SRL E
A7EE SRL E
A7F0 SRL E
A7F2 LD D,$00
A7F4 ADD HL,DE
A7F5 PUSH HL Save HL
A7F6 LD A,(IY+$00) Computes in DE the graphic data of drone based on his x-position (x-position & 0x7) * 8 = index into graphic data table
A7F9 AND $07
A7FB SLA A
A7FD SLA A
A7FF SLA A
A801 LD E,A
A802 LD D,$00
A804 LD HL,$A8B6
A807 ADD HL,DE
A808 EX DE,HL
A809 POP HL Restore HL
A80A LD B,$04 Set B to the height of the drone sprite
A80C PUSH BC Save BC
A80D LD A,(DE) Copy into room graphic data the drone graphic data
A80E OR (HL)
A80F LD (HL),A
A810 INC DE Increase address for graphic data of drone and room graphic data
A811 INC HL
A812 LD A,(DE) Copy into room graphic data the drone graphic data
A813 OR (HL)
A814 LD (HL),A
A815 INC DE Increment address for graphic data of drone
A816 LD BC,$001F Point HL to the next row in room graphic data
A819 ADD HL,BC
A81A POP BC Restore BC
A81B DJNZ $A80C Jump until drone is drawn
A81D LD A,(IY+$02) Increment index into the offset position table for the drone
A820 INC A
A821 LD (IY+$02),A
A824 CP $40 Reset the index position if has reached to the end
A826 JP NZ,$A82D
A829 LD (IY+$02),$00
A82D LD DE,$0003 Point IY to the next drone configuration
A830 ADD IY,DE
A832 POP BC Restore BC
A833 DJNZ $A7BE Jump back and process next drone
A835 RET
Prev: A793 Up: Map Next: A836