Prev: 61528 Up: Map Next: 61586
61539: Draw Colour Ring
Used by the routine at Draw_Concentric_Rings.
Draws one rectangular colour ring with its top-left corner at column B, row C. The horizontal edges span columns B to 255-B and are drawn via Fill_Row; the vertical edges span rows C to 191-C and are drawn via Fill_Column.
Input
BC Corner offset (B = column, C = row)
Draw the top and bottom horizontal edges.
Draw_Colour_Ring 61539 LD H,B Load the corner position into HL and copy the column to A.
61540 LD L,C
61541 LD A,B
61542 SLA A Calculate the horizontal edge length as 256 minus 2 times the column offset.
61544 NEG
61546 LD D,A
61547 PUSH BC Stash the corner, draw the top edge rightward via Fill_Row, and restore.
61548 CALL Fill_Row
61551 POP BC
61552 LD H,B Set the position to the bottom edge at row 191 minus C.
61553 LD A,191
61555 SUB C
61556 LD L,A
61557 PUSH BC Stash the corner, draw the bottom edge rightward via Fill_Row, and restore.
61558 CALL Fill_Row
61561 POP BC
Draw the left and right vertical edges.
61562 LD H,B Reset the corner position and calculate the vertical edge length as 192 minus 2 times the row offset.
61563 LD L,C
61564 LD E,C
61565 SLA E
61567 LD A,192
61569 SUB E
61570 LD D,A
61571 PUSH BC Stash the corner, draw the left edge downward via Fill_Column, and restore.
61572 CALL Fill_Column
61575 POP BC
61576 LD L,C Set the position to the right edge at column 255 minus B.
61577 LD A,B
61578 CPL
61579 LD H,A
61580 PUSH BC Stash the corner, draw the right edge downward via Fill_Column, and restore.
61581 CALL Fill_Column
61584 POP BC
61585 RET Return.
Prev: 61528 Up: Map Next: 61586