Prev: 40303 Up: Map Next: 40398
40352: 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 40352 POP BC Restore the attribute and graphic ID from the stack.
40353 CALL GetGraphicAttributeDetails Call GetGraphicAttributeDetails to get the details of the attributes.
40356 LD A,B Fetch the width.
40357 EXX Switch to the shadow registers.
40358 LD B,A Keep the number of columns in B'.
40359 EXX Switch back to the main registers.
SetAttributes_Transposed_Row 40360 PUSH BC Stash the width and height on the stack.
40361 PUSH DE Stash the position in the attributes on the stack.
40362 PUSH HL Stash the attribute buffer address on the stack.
SetAttributes_Transposed_Cell 40363 LD A,(DE) Fetch the next attribute.
40364 AND A Jump to SetAttributes_Transposed_Next if it is 0.
40365 JR Z,SetAttributes_Transposed_Next
40367 CP 255 Jump to SetAttributes_Transposed_Write if it is not 255.
40369 JR NZ,SetAttributes_Transposed_Write
40371 LD A,(24090) Fetch the room attribute from CurrentRoom_Attribute.
SetAttributes_Transposed_Write 40374 LD (HL),A Write A to the attribute buffer.
SetAttributes_Transposed_Next 40375 CALL AddWidthToAddress Call AddWidthToAddress to move down to the next row of the attributes.
40378 INC L Move HL on to the next cell.
40379 DEC C Decrease the height by one and loop back to SetAttributes_Transposed_Cell until all of the rows have been set.
40380 JR NZ,SetAttributes_Transposed_Cell
40382 POP HL Restore the attribute buffer address from the stack.
40383 LD BC,32 BC=0032 (the size of a row of the attribute buffer).
40386 AND A Move up a row.
40387 SBC HL,BC
40389 POP DE Restore the position in the attributes from the stack.
40390 POP BC Restore the width and height from the stack.
40391 INC DE Move DE on to the next column.
40392 EXX Switch to the shadow registers.
40393 DEC B Decrease the number of columns by one.
40394 EXX Switch back to the main registers.
40395 JR NZ,SetAttributes_Transposed_Row Jump to SetAttributes_Transposed_Row until all of the columns are done.
40397 RET Return.
Prev: 40303 Up: Map Next: 40398