Prev: 9DF8 Up: Map Next: 9E55
9E21: Set Attributes Transposed Flipped
The handler of SetGraphicAttributes for a graphic that is flipped along the diagonal from bottom left to top right. This is the same as SetAttributes_RotatedLeft, except that it starts from the last row and works back up with SubtractWidthFromAddress.
SetAttributes_TransposedFlipped 9E21 POP BC Restore the attribute and graphic ID from the stack.
9E22 CALL GetGraphicAttributeDetails Call GetGraphicAttributeDetails to get the details of the attributes.
9E25 LD A,B Fetch the width.
9E26 EXX Switch to the shadow registers.
9E27 LD B,A Keep the number of columns in B'.
9E28 EXX Switch back to the main registers.
9E29 CALL FindLastRow Call FindLastRow to move on to the last row.
9E2C CALL AddWidthToAddress Call AddWidthToAddress to move DE on to the end of the last row.
SetAttributes_TransposedFlipped_Row 9E2F DEC DE Move DE back to the previous column (at first, the last byte of the last row).
9E30 PUSH BC Stash the width and height on the stack.
9E31 PUSH DE Stash the position in the attributes on the stack.
9E32 PUSH HL Stash the attribute buffer address on the stack.
SetAttributes_TransposedFlipped_Cell 9E33 LD A,(DE) Fetch the next attribute.
9E34 AND A Jump to SetAttributes_TransposedFlipped_Next if it is 00.
9E35 JR Z,SetAttributes_TransposedFlipped_Next
9E37 CP $FF Jump to SetAttributes_TransposedFlipped_Write if it is not FF.
9E39 JR NZ,SetAttributes_TransposedFlipped_Write
9E3B LD A,($5E1A) Fetch the room attribute from CurrentRoom_Attribute.
SetAttributes_TransposedFlipped_Write 9E3E LD (HL),A Write A to the attribute buffer.
SetAttributes_TransposedFlipped_Next 9E3F CALL SubtractWidthFromAddress Call SubtractWidthFromAddress to move up to the previous row of the attributes.
9E42 INC L Move HL on to the next cell.
9E43 DEC C Decrease the height by one and loop back to SetAttributes_TransposedFlipped_Cell until all of the rows have been set.
9E44 JR NZ,SetAttributes_TransposedFlipped_Cell
9E46 POP HL Restore the attribute buffer address from the stack.
9E47 LD BC,$0020 BC=0020 (the size of a row of the attribute buffer).
9E4A AND A Move up a row.
9E4B SBC HL,BC
9E4D POP DE Restore the position in the attributes from the stack.
9E4E POP BC Restore the width and height from the stack.
9E4F EXX Switch to the shadow registers.
9E50 DEC B Decrease the number of columns by one.
9E51 EXX Switch back to the main registers.
9E52 JR NZ,SetAttributes_TransposedFlipped_Row Jump to SetAttributes_TransposedFlipped_Row until all of the columns are done.
9E54 RET Return.
Prev: 9DF8 Up: Map Next: 9E55