Prev: 9D6F Up: Map Next: 9DCE
9DA0: Set Attributes Transposed
The handler of SetGraphicAttributes for a graphic that is flipped along the diagonal from top left to bottom right. This is the same as SetAttributes_RotatedLeft, except that the columns of the attributes are used from the left-hand side to the right-hand side.
SetAttributes_Transposed 9DA0 POP BC Restore the attribute and graphic ID from the stack.
9DA1 CALL GetGraphicAttributeDetails Call GetGraphicAttributeDetails to get the details of the attributes.
9DA4 LD A,B Fetch the width.
9DA5 EXX Switch to the shadow registers.
9DA6 LD B,A Keep the number of columns in B'.
9DA7 EXX Switch back to the main registers.
SetAttributes_Transposed_Row 9DA8 PUSH BC Stash the width and height on the stack.
9DA9 PUSH DE Stash the position in the attributes on the stack.
9DAA PUSH HL Stash the attribute buffer address on the stack.
SetAttributes_Transposed_Cell 9DAB LD A,(DE) Fetch the next attribute.
9DAC AND A Jump to SetAttributes_Transposed_Next if it is 00.
9DAD JR Z,SetAttributes_Transposed_Next
9DAF CP $FF Jump to SetAttributes_Transposed_Write if it is not FF.
9DB1 JR NZ,SetAttributes_Transposed_Write
9DB3 LD A,($5E1A) Fetch the room attribute from CurrentRoom_Attribute.
SetAttributes_Transposed_Write 9DB6 LD (HL),A Write A to the attribute buffer.
SetAttributes_Transposed_Next 9DB7 CALL AddWidthToAddress Call AddWidthToAddress to move down to the next row of the attributes.
9DBA INC L Move HL on to the next cell.
9DBB DEC C Decrease the height by one and loop back to SetAttributes_Transposed_Cell until all of the rows have been set.
9DBC JR NZ,SetAttributes_Transposed_Cell
9DBE POP HL Restore the attribute buffer address from the stack.
9DBF LD BC,$0020 BC=0020 (the size of a row of the attribute buffer).
9DC2 AND A Move up a row.
9DC3 SBC HL,BC
9DC5 POP DE Restore the position in the attributes from the stack.
9DC6 POP BC Restore the width and height from the stack.
9DC7 INC DE Move DE on to the next column.
9DC8 EXX Switch to the shadow registers.
9DC9 DEC B Decrease the number of columns by one.
9DCA EXX Switch back to the main registers.
9DCB JR NZ,SetAttributes_Transposed_Row Jump to SetAttributes_Transposed_Row until all of the columns are done.
9DCD RET Return.
Prev: 9D6F Up: Map Next: 9DCE