![]() |
Routines |
| Prev: F09D | Up: Map | Next: F0DE |
|
Used by the routine at Cycle_Border_Colour.
Writes the two-colour attribute border frame to attribute RAM at 5800 using D as the outer border colour and E as the inner border colour. The outer colour fills a two-cell-wide band around the edge; the inner colour fills the adjacent band one cell inside that.
|
||||||||||
| Fill_Border_Attributes | F0AE | LD HL,$5800 | Point HL to the start of the attribute area at 5800. | |||||||
|
Fill the top two-row border band.
|
||||||||||
| F0B1 | LD B,$21 | Set the outer top row cell count to 21. | ||||||||
| Fill_Border_Top_Outer_Loop | F0B3 | LD (HL),D | Write the outer border colour to 21 consecutive cells. | |||||||
| F0B4 | INC HL | |||||||||
| F0B5 | DJNZ Fill_Border_Top_Outer_Loop | |||||||||
| F0B7 | LD B,$1E | Set the inner top row cell count to 1E. | ||||||||
| Fill_Border_Top_Inner_Loop | F0B9 | LD (HL),E | Write the inner border colour to the next 1E cells. | |||||||
| F0BA | INC HL | |||||||||
| F0BB | DJNZ Fill_Border_Top_Inner_Loop | |||||||||
| F0BD | LD (HL),D | Write the outer border colour to close the inner top row. | ||||||||
| F0BE | INC HL | |||||||||
|
Fill the 14 inner rows with border cells on each side.
|
||||||||||
| F0BF | LD A,$14 | Set the inner row counter to 14. | ||||||||
| Fill_Border_Inner_Row_Loop | F0C1 | LD (HL),D | Write the outer border colour to the left border cell. | |||||||
| F0C2 | INC HL | |||||||||
| F0C3 | LD (HL),E | Write the inner border colour and skip 1D cells across the inner area. | ||||||||
| F0C4 | LD BC,$001D | |||||||||
| F0C7 | ADD HL,BC | |||||||||
| F0C8 | LD (HL),E | Write the inner border colour to the last inner cell. | ||||||||
| F0C9 | INC HL | |||||||||
| F0CA | LD (HL),D | Write the outer border colour to the right border cell. | ||||||||
| F0CB | INC HL | |||||||||
| F0CC | DEC A | Repeat for each inner row. | ||||||||
| F0CD | JR NZ,Fill_Border_Inner_Row_Loop | |||||||||
|
Fill the bottom two-row border band.
|
||||||||||
| F0CF | LD (HL),D | Write the outer border colour to close the last inner row. | ||||||||
| F0D0 | INC HL | |||||||||
| F0D1 | LD B,$1E | Set the inner bottom row cell count to 1E. | ||||||||
| Fill_Border_Bottom_Inner_Loop | F0D3 | LD (HL),E | Write the inner border colour to the next 1E cells. | |||||||
| F0D4 | INC HL | |||||||||
| F0D5 | DJNZ Fill_Border_Bottom_Inner_Loop | |||||||||
| F0D7 | LD B,$21 | Set the outer bottom row cell count to 21. | ||||||||
| Fill_Border_Bottom_Outer_Loop | F0D9 | LD (HL),D | Write the outer border colour to 21 consecutive cells. | |||||||
| F0DA | INC HL | |||||||||
| F0DB | DJNZ Fill_Border_Bottom_Outer_Loop | |||||||||
| F0DD | RET | Return. | ||||||||
| Prev: F09D | Up: Map | Next: F0DE |