![]() |
Routines |
| Prev: 9ACB | Up: Map | Next: 9B14 |
|
The handler of DrawGraphic for a graphic that is turned a half turn. This is the same as DrawGraphic_Mirrored, except that it starts from the end of the last row.
|
||||
| DrawGraphic_RotatedHalf | 9AEF | POP BC | Restore the attribute and graphic ID from the stack. | |
| 9AF0 | CALL GetBlendInstruction | Call GetBlendInstruction to get the instruction to mix the graphic with the screen. | ||
| 9AF3 | LD ($9B06),A | Write it over the instruction at 9B06. | ||
| 9AF6 | CALL GetGraphicDetails | Call GetGraphicDetails to get the details of the graphic. | ||
| 9AF9 | CALL FindLastRow | Call FindLastRow to move on to the last row. | ||
| 9AFC | CALL AddWidthToAddress | Call AddWidthToAddress to move on to the end of the last row. | ||
| DrawGraphic_RotatedHalf_Row | 9AFF | PUSH BC | Stash the width and height on the stack. | |
| 9B00 | PUSH HL | Stash the screen address on the stack. | ||
| DrawGraphic_RotatedHalf_Byte | 9B01 | DEC DE | Move DE back one byte. | |
| 9B02 | LD A,(DE) | Fetch the byte of the graphic. | ||
| 9B03 | CALL ReverseBits | Call ReverseBits to reverse the bits. | ||
| 9B06 | NOP | This is replaced by an instruction that mixes A with the screen. | ||
| 9B07 | LD (HL),A | Write A to the screen. | ||
| 9B08 | INC L | Move HL on to the next byte. | ||
| 9B09 | DJNZ DrawGraphic_RotatedHalf_Byte | Decrease the width by one and loop back to DrawGraphic_RotatedHalf_Byte until all of the bytes in the row have been drawn. | ||
| 9B0B | POP HL | Restore the screen address from the stack. | ||
| 9B0C | CALL ScreenPosition1PixelAbove | Call ScreenPosition1PixelAbove to move up a line. | ||
| 9B0F | POP BC | Restore the width and height from the stack. | ||
| 9B10 | DEC C | Decrease the height by one and loop back to DrawGraphic_RotatedHalf_Row until all of the rows have been done. | ||
| 9B11 | JR NZ,DrawGraphic_RotatedHalf_Row | |||
| 9B13 | RET | Return. | ||
| Prev: 9ACB | Up: Map | Next: 9B14 |