![]() |
Routines |
| Prev: 39627 | Up: Map | Next: 39700 |
|
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 | 39663 | POP BC | Restore the attribute and graphic ID from the stack. | |
| 39664 | CALL GetBlendInstruction | Call GetBlendInstruction to get the instruction to mix the graphic with the screen. | ||
| 39667 | LD (39686),A | Write it over the instruction at 39686. | ||
| 39670 | CALL GetGraphicDetails | Call GetGraphicDetails to get the details of the graphic. | ||
| 39673 | CALL FindLastRow | Call FindLastRow to move on to the last row. | ||
| 39676 | CALL AddWidthToAddress | Call AddWidthToAddress to move on to the end of the last row. | ||
| DrawGraphic_RotatedHalf_Row | 39679 | PUSH BC | Stash the width and height on the stack. | |
| 39680 | PUSH HL | Stash the screen address on the stack. | ||
| DrawGraphic_RotatedHalf_Byte | 39681 | DEC DE | Move DE back one byte. | |
| 39682 | LD A,(DE) | Fetch the byte of the graphic. | ||
| 39683 | CALL ReverseBits | Call ReverseBits to reverse the bits. | ||
| 39686 | NOP | This is replaced by an instruction that mixes A with the screen. | ||
| 39687 | LD (HL),A | Write A to the screen. | ||
| 39688 | INC L | Move HL on to the next byte. | ||
| 39689 | 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. | ||
| 39691 | POP HL | Restore the screen address from the stack. | ||
| 39692 | CALL ScreenPosition1PixelAbove | Call ScreenPosition1PixelAbove to move up a line. | ||
| 39695 | POP BC | Restore the width and height from the stack. | ||
| 39696 | DEC C | Decrease the height by one and loop back to DrawGraphic_RotatedHalf_Row until all of the rows have been done. | ||
| 39697 | JR NZ,DrawGraphic_RotatedHalf_Row | |||
| 39699 | RET | Return. | ||
| Prev: 39627 | Up: Map | Next: 39700 |