Prev: 9D47 Up: Map Next: 9DA0
9D6F: Set Attributes Rotated Left
The handler of SetGraphicAttributes for a graphic that is turned a quarter turn anti-clockwise. This is the same as SetAttributes_Upright, except that each row of the screen is made from a column of the attributes, from the right-hand side to the left-hand side.
SetAttributes_RotatedLeft 9D6F POP BC Restore the attribute and graphic ID from the stack.
9D70 CALL GetGraphicAttributeDetails Call GetGraphicAttributeDetails to get the details of the attributes.
9D73 LD A,B Fetch the width.
9D74 EXX Switch to the shadow registers.
9D75 LD B,A Keep the number of columns in B'.
9D76 EXX Switch back to the main registers.
9D77 CALL AddWidthToAddress Call AddWidthToAddress to move DE on to the second row.
SetAttributes_RotatedLeft_Row 9D7A DEC DE Move DE back to the previous column (at first, the last byte of the first row).
9D7B PUSH BC Stash the width and height on the stack.
9D7C PUSH DE Stash the position in the attributes on the stack.
9D7D PUSH HL Stash the attribute buffer address on the stack.
SetAttributes_RotatedLeft_Cell 9D7E LD A,(DE) Fetch the next attribute.
9D7F AND A Jump to SetAttributes_RotatedLeft_Next if it is 00.
9D80 JR Z,SetAttributes_RotatedLeft_Next
9D82 CP $FF Jump to SetAttributes_RotatedLeft_Write if it is not FF.
9D84 JR NZ,SetAttributes_RotatedLeft_Write
9D86 LD A,($5E1A) Fetch the room attribute from CurrentRoom_Attribute.
SetAttributes_RotatedLeft_Write 9D89 LD (HL),A Write A to the attribute buffer.
SetAttributes_RotatedLeft_Next 9D8A CALL AddWidthToAddress Call AddWidthToAddress to move down to the next row of the attributes.
9D8D INC L Move HL on to the next cell.
9D8E DEC C Decrease the height by one and loop back to SetAttributes_RotatedLeft_Cell until all of the rows have been set.
9D8F JR NZ,SetAttributes_RotatedLeft_Cell
9D91 POP HL Restore the attribute buffer address from the stack.
9D92 LD BC,$0020 BC=0020 (the size of a row of the attribute buffer).
9D95 AND A Move up a row.
9D96 SBC HL,BC
9D98 POP DE Restore the position in the attributes from the stack.
9D99 POP BC Restore the width and height from the stack.
9D9A EXX Switch to the shadow registers.
9D9B DEC B Decrease the number of columns by one.
9D9C EXX Switch back to the main registers.
9D9D JR NZ,SetAttributes_RotatedLeft_Row Jump to SetAttributes_RotatedLeft_Row until all of the columns are done.
9D9F RET Return.
Prev: 9D47 Up: Map Next: 9DA0