Prev: 99C9 Up: Map Next: 9A0A
99E5: Draw Graphic Mirrored
The handler of DrawGraphic for a graphic that is mirrored from left to right. Each row is read from its end and the bits of each byte are reversed with ReverseBits.
DrawGraphic_Mirrored 99E5 POP BC Restore the attribute and graphic ID from the stack.
99E6 CALL GetBlendInstruction Call GetBlendInstruction to get the instruction to mix the graphic with the screen.
99E9 LD ($99F9),A Write it over the instruction at 99F9.
99EC CALL GetGraphicDetails Call GetGraphicDetails to get the details of the graphic.
DrawGraphic_Mirrored_Row 99EF PUSH BC Stash the width and height on the stack.
99F0 PUSH HL Stash the screen address on the stack.
99F1 CALL AddWidthToAddress Call AddWidthToAddress to move DE on to the end of the row.
DrawGraphic_Mirrored_Byte 99F4 DEC DE Move DE back one byte.
99F5 LD A,(DE) Fetch the byte of the graphic.
99F6 CALL ReverseBits Call ReverseBits to reverse the bits.
99F9 NOP This is replaced by an instruction that mixes A with the screen.
99FA LD (HL),A Write A to the screen.
99FB INC L Move HL on to the next byte.
99FC DJNZ DrawGraphic_Mirrored_Byte Decrease the width by one and loop back to DrawGraphic_Mirrored_Byte until all of the bytes in the row have been drawn.
99FE POP HL Restore the screen address from the stack.
99FF CALL ScreenPosition1PixelAbove Call ScreenPosition1PixelAbove to move up a line.
9A02 POP BC Restore the width and height from the stack.
9A03 CALL AddWidthToAddress Call AddWidthToAddress to move DE on to the start of the next row.
9A06 DEC C Decrease the height by one and loop back to DrawGraphic_Mirrored_Row until all of the rows have been done.
9A07 JR NZ,DrawGraphic_Mirrored_Row
9A09 RET Return.
Prev: 99C9 Up: Map Next: 9A0A