![]() |
Routines |
| Prev: 9E21 | Up: Map | Next: 9E86 |
|
The handler of SetGraphicAttributes for a graphic that is turned a quarter turn clockwise. This is the same as SetAttributes_Transposed, except that it starts from the last row and works back up with SubtractWidthFromAddress.
|
||||
| SetAttributes_RotatedRight | 9E55 | POP BC | Restore the attribute and graphic ID from the stack. | |
| 9E56 | CALL GetGraphicAttributeDetails | Call GetGraphicAttributeDetails to get the details of the attributes. | ||
| 9E59 | LD A,B | Fetch the width. | ||
| 9E5A | EXX | Switch to the shadow registers. | ||
| 9E5B | LD B,A | Keep the number of columns in B'. | ||
| 9E5C | EXX | Switch back to the main registers. | ||
| 9E5D | CALL FindLastRow | Call FindLastRow to move on to the last row. | ||
| SetAttributes_RotatedRight_Row | 9E60 | PUSH BC | Stash the width and height on the stack. | |
| 9E61 | PUSH DE | Stash the position in the attributes on the stack. | ||
| 9E62 | PUSH HL | Stash the attribute buffer address on the stack. | ||
| SetAttributes_RotatedRight_Cell | 9E63 | LD A,(DE) | Fetch the next attribute. | |
| 9E64 | AND A | Jump to SetAttributes_RotatedRight_Next if it is 00. | ||
| 9E65 | JR Z,SetAttributes_RotatedRight_Next | |||
| 9E67 | CP $FF | Jump to SetAttributes_RotatedRight_Write if it is not FF. | ||
| 9E69 | JR NZ,SetAttributes_RotatedRight_Write | |||
| 9E6B | LD A,($5E1A) | Fetch the room attribute from CurrentRoom_Attribute. | ||
| SetAttributes_RotatedRight_Write | 9E6E | LD (HL),A | Write A to the attribute buffer. | |
| SetAttributes_RotatedRight_Next | 9E6F | CALL SubtractWidthFromAddress | Call SubtractWidthFromAddress to move up to the previous row of the attributes. | |
| 9E72 | INC L | Move HL on to the next cell. | ||
| 9E73 | DEC C | Decrease the height by one and loop back to SetAttributes_RotatedRight_Cell until all of the rows have been set. | ||
| 9E74 | JR NZ,SetAttributes_RotatedRight_Cell | |||
| 9E76 | POP HL | Restore the attribute buffer address from the stack. | ||
| 9E77 | LD BC,$0020 | BC=0020 (the size of a row of the attribute buffer). | ||
| 9E7A | AND A | Move up a row. | ||
| 9E7B | SBC HL,BC | |||
| 9E7D | POP DE | Restore the position in the attributes from the stack. | ||
| 9E7E | POP BC | Restore the width and height from the stack. | ||
| 9E7F | INC DE | Move DE on to the next column. | ||
| 9E80 | EXX | Switch to the shadow registers. | ||
| 9E81 | DEC B | Decrease the number of columns by one. | ||
| 9E82 | EXX | Switch back to the main registers. | ||
| 9E83 | JR NZ,SetAttributes_RotatedRight_Row | Jump to SetAttributes_RotatedRight_Row until all of the columns are done. | ||
| 9E85 | RET | Return. | ||
| Prev: 9E21 | Up: Map | Next: 9E86 |