Prev: 39610 Up: Map Next: 39663
39627: 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 39627 POP BC Restore the attribute and graphic ID from the stack.
39628 CALL GetBlendInstruction Call GetBlendInstruction to get the instruction to mix the graphic with the screen.
39631 LD (39645),A Write it over the instruction at 39645.
39634 CALL GetGraphicDetails Call GetGraphicDetails to get the details of the graphic.
39637 CALL FindLastRow Call FindLastRow to move on to the last row.
DrawGraphic_Flipped_Row 39640 PUSH BC Stash the width and height on the stack.
39641 PUSH DE Stash the position in the graphic on the stack.
39642 PUSH HL Stash the screen address on the stack.
DrawGraphic_Flipped_Byte 39643 LD A,(DE) Fetch the next byte of the graphic.
39644 INC DE Move DE on to the next byte.
39645 NOP This is replaced by an instruction that mixes A with the screen.
39646 LD (HL),A Write A to the screen.
39647 INC L Move HL on to the next byte.
39648 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.
39650 POP HL Restore the screen address from the stack.
39651 CALL ScreenPosition1PixelAbove Call ScreenPosition1PixelAbove to move up a line.
39654 POP DE Restore the position in the graphic from the stack.
39655 POP BC Restore the width and height from the stack.
39656 CALL SubtractWidthFromAddress Call SubtractWidthFromAddress to move back to the previous row of the graphic.
39659 DEC C Decrease the height by one and loop back to DrawGraphic_Flipped_Row until all of the rows have been done.
39660 JR NZ,DrawGraphic_Flipped_Row
39662 RET Return.
Prev: 39610 Up: Map Next: 39663