Prev: BF85 Up: Map Next: BFE3
BFB8: Select Mirrored Draw
Used by the routines at DrawPiece and RunFrame.
Used when the ship is drawn. If it is facing left, moves the horizontal position to the other side of the sprite by its width in 5C29 and points IX at the routine for the width in the table at DrawMirroredRowDirectly, which draws a mirrored sprite.
Input
HL Position
Output
IX Address of the routine
SelectMirroredDraw BFB8 LD A,($C8FD) The ship's facing.
BFBB BIT 7,A Return if bit 7 of A is clear.
BFBD RET Z
BFBE LD B,$F9 B=F9.
BFC0 LD A,($5C29) The sprite width in bytes.
BFC3 DEC A Step A back.
BFC4 ADD A,L A gains L.
BFC5 LD L,A L=A.
BFC6 LD A,($5C29) The sprite width in bytes.
BFC9 LD IX,$A7D6 The draw mirrored row directly.
BFCD CP $06 Return if A is 06.
BFCF RET Z
BFD0 LD IX,$A7DD The second mirrored-row draw.
BFD4 CP $05 Return if A is 05.
BFD6 RET Z
BFD7 LD IX,$A7E4 The third mirrored-row draw.
BFDB CP $04 Return if A is 04.
BFDD RET Z
BFDE LD IX,$A7EB The fourth mirrored-row draw.
BFE2 RET Return.
Prev: BF85 Up: Map Next: BFE3