Prev: 9ABA Up: Map Next: 9AEF
9ACB: Draw Graphic Flipped
The handler of DrawGraphic for a graphic that is flipped top to bottom. This is the same as DrawGraphic_Upright, except that it starts from the last row and works up using SubtractWidthFromAddress.
DrawGraphic_Flipped 9ACB POP BC Restore the attribute and graphic ID from the stack.
9ACC CALL GetBlendInstruction Call GetBlendInstruction to get the instruction to mix the graphic with the screen.
9ACF LD ($9ADD),A Write it over the instruction at 9ADD.
9AD2 CALL GetGraphicDetails Call GetGraphicDetails to get the details of the graphic.
9AD5 CALL FindLastRow Call FindLastRow to move on to the last row.
DrawGraphic_Flipped_Row 9AD8 PUSH BC Stash the width and height on the stack.
9AD9 PUSH DE Stash the position in the graphic on the stack.
9ADA PUSH HL Stash the screen address on the stack.
DrawGraphic_Flipped_Byte 9ADB LD A,(DE) Fetch the next byte of the graphic.
9ADC INC DE Move DE on to the next byte.
9ADD NOP This is replaced by an instruction that mixes A with the screen.
9ADE LD (HL),A Write A to the screen.
9ADF INC L Move HL on to the next byte.
9AE0 DJNZ DrawGraphic_Flipped_Byte Decrease the width by one and loop back to DrawGraphic_Flipped_Byte until all of the bytes in the row have been drawn.
9AE2 POP HL Restore the screen address from the stack.
9AE3 CALL ScreenPosition1PixelAbove Call ScreenPosition1PixelAbove to move up a line.
9AE6 POP DE Restore the position in the graphic from the stack.
9AE7 POP BC Restore the width and height from the stack.
9AE8 CALL SubtractWidthFromAddress Call SubtractWidthFromAddress to move back to the previous row of the graphic.
9AEB DEC C Decrease the height by one and loop back to DrawGraphic_Flipped_Row until all of the rows have been done.
9AEC JR NZ,DrawGraphic_Flipped_Row
9AEE RET Return.
Prev: 9ABA Up: Map Next: 9AEF