Prev: 41497 Up: Map Next: 41678
41536: Draw Side Panel Attributes
Used by the routine at EnterRoom.
Sets the attributes of the side panel. The whole panel is filled with a colour that is picked from the attribute of the room, and then a shape and some bands of colour are put on top. ClearPlayArea_Row, which fills a block of cells with a value, does most of the work.
Before After
panel-attributes-before panel-attributes-after
DrawSidePanelAttrs 41536 LD HL,192 HL=192 (the Y position is 0 and the X position is 192), which is the top left of the side panel.
41539 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41542 LD BC,2072 B=8 (the width of the panel in cells) and C=24 (the number of rows).
Pick the colour for the panel. Take the inverse of bits 0-2 of the attribute of the room, unless that is less than 2 when 68 is used.
41545 LD A,(24090) Fetch the room attribute from CurrentRoom_Attribute.
41548 CPL Flip the bits.
41549 AND %00000111 Keep only bits 0-2.
41551 CP 2 Jump to DrawSidePanelAttrs_Colour if the colour is 2 or more.
41553 JR NC,DrawSidePanelAttrs_Colour
41555 LD A,68 A=68.
DrawSidePanelAttrs_Colour 41557 LD E,A Keep the attribute of the panel in E.
41558 PUSH DE Stash the attribute of the panel on the stack.
DrawSidePanelAttrs_Row 41559 PUSH BC Stash the width and the number of rows on the stack.
41560 PUSH HL Stash the attribute address on the stack.
DrawSidePanelAttrs_Cell 41561 LD (HL),E Write the attribute of the panel to the cell.
41562 INC L Move to the next cell.
41563 DJNZ DrawSidePanelAttrs_Cell Decrease the width by one and loop back to DrawSidePanelAttrs_Cell until the row is done.
41565 POP HL Restore the attribute address from the stack.
41566 LD BC,32 BC=0032.
41569 ADD HL,BC Move down a row.
41570 POP BC Restore the width and the number of rows from the stack.
41571 DEC C Decrease the number of rows by one and loop back to DrawSidePanelAttrs_Row until all of the rows have been set.
41572 JR NZ,DrawSidePanelAttrs_Row
Fill a square of three by three cells, and then a cell and a square of two by two cells below it, with the attribute of the room. Then put the attribute of the panel back in the middle of the three by three square.
41574 LD HL,37064 HL=37064 (the Y position is 144 and the X position is 200).
41577 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41580 LD A,(24090) Fetch the room attribute from CurrentRoom_Attribute.
41583 LD BC,771 B=3 (the width) and C=3 (the number of rows).
41586 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells with the attribute of the room.
41589 INC L Move to the next cell.
41590 LD (HL),A Write the attribute of the room to the cell.
41591 ADD HL,DE Move down a row (DE is 0032 after the call).
41592 LD BC,514 B=2 (the width) and C=2 (the number of rows).
41595 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells with the attribute of the room.
41598 LD HL,39120 HL=39120 (the Y position is 152 and the X position is 208).
41601 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41604 POP DE Restore the attribute of the panel from the stack.
41605 LD (HL),E Write it to the cell.
Colour the bands of the panel from the bottom upwards. Each is filled with ClearPlayArea_Row.
41606 LD HL,32200 HL=32200 (the Y position is 125 and the X position is 200).
41609 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41612 LD BC,1539 B=6 (the width) and C=3 (the number of rows).
41615 LD A,71 A=71 (bright white).
41617 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells.
41620 LD HL,24520 HL=24520 (the Y position is 95 and the X position is 200).
41623 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41626 LD BC,1540 B=6 (the width) and C=4 (the number of rows).
41629 LD A,70 A=70 (bright yellow).
41631 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells.
41634 LD HL,18632 HL=18632 (the Y position is 72 and the X position is 200).
41637 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41640 LD BC,1537 B=6 (the width) and C=1 (the number of rows).
41643 LD A,69 A=69 (bright cyan).
41645 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells.
41648 LD BC,1537 B=6 (the width) and C=1 (the number of rows).
41651 LD A,71 A=71 (bright white).
41653 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells in the next row down.
41656 LD HL,14536 HL=14536 (the Y position is 56 and the X position is 200).
41659 CALL AttributeAddress Call AttributeAddress to get the attribute address of the position.
41662 LD BC,1537 B=6 (the width) and C=1 (the number of rows).
41665 LD A,67 A=67 (bright magenta).
41667 CALL ClearPlayArea_Row Call ClearPlayArea_Row to fill the cells.
41670 LD BC,1537 B=6 (the width) and C=1 (the number of rows).
41673 LD A,71 A=71 (bright white).
41675 JP ClearPlayArea_Row Jump to ClearPlayArea_Row to fill the cells in the next row down.
Prev: 41497 Up: Map Next: 41678