Prev: CB88 Up: Map Next: CF0A
CE7B: Draw the windows borders in the display file
Used by the routine at A13E.
Input
IX Address of the text definition data
A Color attribute for the windows border
C Color attribute for the windows body
H Horizontal position
L Vertical position
D Length of the longest line
E Number of lines
CE7B PUSH IX Save IX
CE7D LD ($A093),A Save color attribute for the windows border at A093
CE80 LD A,D Save the length of the longest line at A02A
CE81 LD ($A02A),A
CE84 LD A,E Save number of lines at A02B
CE85 LD ($A02B),A
CE88 LD A,H Save horizontal position at A028
CE89 LD ($A028),A
CE8C LD A,L Save vertical position at A029
CE8D LD ($A029),A
CE90 LD A,C Save color attribute for the windows body at A09F
CE91 LD ($A09F),A
CE94 LD A,($A029) Set HL to the vertical position of the windows
CE97 LD L,A
CE98 LD H,$00
CE9A ADD HL,HL Computes the offset of the horizontal position into the attribute file
CE9B ADD HL,HL
CE9C ADD HL,HL
CE9D ADD HL,HL
CE9E ADD HL,HL
CE9F LD A,($A028) Set DE to the horizontal position of the windows
CEA2 LD E,A
CEA3 LD D,$00
CEA5 ADD HL,DE Add the vertical position to the offset previously computed
CEA6 LD DE,$5802 Point HL to the address of the windows location into the attribute file
CEA9 ADD HL,DE
CEAA PUSH HL Save HL
CEAB LD A,($A02B) Pick up the number of lines
CEAE ADD A,$02 Adds two to the number of lines (border top and bottom) to obtain the height of the windows
CEB0 LD B,A Set B to the height of the windows
CEB1 LD A,($A02A) Pick up the length of the longest line
CEB4 ADD A,$02 Adds two to the height of the longest line (border left and right) to obtain the height of the windows
CEB6 LD E,A Set E to the width of the windows
CEB7 LD A,($A093) Pick up the color attribute for the windows border
CEBA CALL $D909 Fill the windows (border included) with the color attribute of the borders
CEBD POP HL Restore HL
CEBE LD DE,$0021 Point HL to the address of the first line of the windows into the attribute file
CEC1 ADD HL,DE
CEC2 LD A,($A02B) Set B to the number of lines
CEC5 LD B,A
CEC6 LD A,($A02A) Set E to the length of the longest line
CEC9 LD E,A
CECA LD A,($A09F) Pick up the color attribute for the windows body
CECD CALL $D909 Fill the windows (only body) with the color attribute of the body
CED0 LD A,($A029) Set HL to the vertical position
CED3 LD L,A
CED4 LD H,$00
CED6 ADD HL,HL Computes the pixel of the vertical position (x8)
CED7 ADD HL,HL
CED8 ADD HL,HL
CED9 ADD HL,HL
CEDA LD DE,$ABDD Point HL to the display file lookup table corresponding to this vertical pixel
CEDD ADD HL,DE
CEDE LD IX,$6120 Point IX to the graphics data of the top-left border windows tile
CEE2 LD IY,$6140 Point IY to the graphics data of the top-middle border windows tile
CEE6 CALL $CF0A Draw the top border of the windows
CEE9 LD A,($A02B) Set B to the number of lines
CEEC LD B,A
CEED PUSH BC Save BC
CEEE LD IX,$61B8 Point IX to the graphics data of the left border windows tile
CEF2 LD IY,$61C8 Point IY to the graphics data of the middle border windows tile (black tile)
CEF6 CALL $CF0A Draw the middle border of the windows
CEF9 POP BC Restore BC
CEFA DJNZ $CEED Jump back while there are lines to draw
CEFC LD IX,$6130 Point IX to the graphics data of the bottom-left border windows tile
CF00 LD IY,$6158 Point IY to the graphics data of the bottom-middle border windows tile
CF04 CALL $CF0A Draw the bottom border of the windows
CF07 POP IX Restore IX
CF09 RET
Prev: CB88 Up: Map Next: CF0A