Prev: 9BF8 Up: Map Next: 9C2B
9C10: Set Area Attributes
Used by the routines at Draw_Ceiling, Draw_Top_Right_Corner and Draw_Right_Wall.
Sets the attributes of a rectangle of character cells to yellow ink on black paper (bright). The rectangle is given in pixels.
Input
BC Size (B is the width in cells, C is the height in pixels)
HL Position (L is the x position, H is the y position)
Set_Area_Attributes 9C10 LD E,$46 Set the attribute to 46.
9C12 CALL AttributeAddress Convert the position into an address in the attribute buffer.
9C15 SRL C Divide the height by eight to get the number of rows of cells.
9C17 SRL C
9C19 SRL C
Set_Area_Attributes_Row_Loop 9C1B PUSH BC Stash the counters on the stack.
9C1C PUSH HL Stash the address on the stack.
Set_Area_Attributes_Cell_Loop 9C1D LD (HL),E Set the attribute of the cell.
9C1E INC L Move on to the next cell.
9C1F DJNZ Set_Area_Attributes_Cell_Loop Decrease the width counter and loop back until the row is done.
9C21 POP HL Restore the address from the stack.
9C22 LD BC,$0020 Set the size of a row of cells to 20.
9C25 ADD HL,BC Move down to the next row of cells.
9C26 POP BC Restore the counters from the stack.
9C27 DEC C Decrease the row counter and loop back until all of the rows of cells are done.
9C28 JR NZ,Set_Area_Attributes_Row_Loop
9C2A RET Return.
Prev: 9BF8 Up: Map Next: 9C2B