Prev: 39928 Up: Map Next: 39979
39952: 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 39952 LD E,70 Set the attribute to 70.
39954 CALL AttributeAddress Convert the position into an address in the attribute buffer.
39957 SRL C Divide the height by eight to get the number of rows of cells.
39959 SRL C
39961 SRL C
Set_Area_Attributes_Row_Loop 39963 PUSH BC Stash the counters on the stack.
39964 PUSH HL Stash the address on the stack.
Set_Area_Attributes_Cell_Loop 39965 LD (HL),E Set the attribute of the cell.
39966 INC L Move on to the next cell.
39967 DJNZ Set_Area_Attributes_Cell_Loop Decrease the width counter and loop back until the row is done.
39969 POP HL Restore the address from the stack.
39970 LD BC,32 Set the size of a row of cells to 32.
39973 ADD HL,BC Move down to the next row of cells.
39974 POP BC Restore the counters from the stack.
39975 DEC C Decrease the row counter and loop back until all of the rows of cells are done.
39976 JR NZ,Set_Area_Attributes_Row_Loop
39978 RET Return.
Prev: 39928 Up: Map Next: 39979