Prev: 57897 Up: Map Next: 58230
58089: Draw Frame
Used by the routines at ShowTitleMenu and DrawPanel.
Draws a frame, from an entry of 5 bytes in the table at FrameTable, and moves on to the next entry. The edges of the frame are made with DrawFrameLeft, DrawFrameLeft_Draw and DrawFrameBar, and the corners with DrawFrameCorners.
draw-frame
Input
IX The entry of the frame
Output
IX The next entry
DrawFrame 58089 LD A,(IX+4) Fetch the attribute of the frame.
58092 LD (43748),A Store it in the colour rectangle at 43748.
58095 LD L,(IX+0) Fetch the x position of the frame into L.
58098 LD H,(IX+1) Fetch the y position of the frame into H.
58101 PUSH HL Save the position.
58102 PUSH HL Save it again.
58103 INC H Move down a pixel line, to the row below the frame.
58104 LD C,(IX+2) Fetch the width of the frame.
58107 LD B,1 Set the height of the rectangle to one row.
58109 LD (43746),BC Store the width and the height in the rectangle.
58113 CALL FillScratchRectangle Colour the row below the frame.
58116 POP HL Restore the position.
58117 LD B,(IX+3) Fetch the height of the frame in pixel lines.
58120 LD A,H Copy the y position into A.
58121 SUB B Subtract the height of the frame.
58122 LD H,A Copy it into H, to find the row above the frame.
58123 CALL FillScratchRectangle Colour the row above the frame.
58126 POP HL Restore the position.
58127 DEC L Move one pixel to the left, beside the frame.
58128 INC H Move down a pixel line.
58129 PUSH HL Save the position.
58130 LD C,1 Set the width of the rectangle to one cell.
58132 LD A,(IX+3) Fetch the height of the frame.
58135 ADD A,23 Round it up to a whole number of rows.
58137 SRL A Halve it.
58139 SRL A Halve it again.
58141 SRL A Halve it a third time, to find the height in rows.
58143 LD B,A Copy it into B.
58144 LD (43746),BC Store the width and the height in the rectangle.
58148 CALL FillScratchRectangle Colour the column on the left of the frame.
58151 POP HL Restore the position.
58152 LD A,(IX+2) Fetch the width of the frame.
58155 ADD A,A Double it.
58156 ADD A,A Double it again.
58157 ADD A,A Double it a third time, to find the width in pixels.
58158 ADD A,L Add the x position.
58159 INC A Add one to find the column on the right of the frame.
58160 LD L,A Copy it into L.
58161 CALL FillScratchRectangle Colour the column on the right of the frame.
58164 LD L,(IX+0) Fetch the x position of the frame into L.
58167 LD H,(IX+1) Fetch the y position of the frame into H.
58170 CALL DrawFrameLeft Draw the left edge of the frame.
58173 LD A,L Fetch the x position of the left edge.
58174 ADD A,(IX+2) Add the width of the frame.
58177 INC A Add one.
58178 LD L,A Copy the position of the right edge into L.
58179 CALL DrawFrameLeft_Draw Draw the right edge of the frame.
58182 LD A,(IX+1) Fetch the y position of the frame.
58185 ADD A,6 Add 6 to find the y position of the bottom bar.
58187 LD H,A Copy it into H.
58188 SUB (IX+3) Subtract the height of the frame.
58191 SUB 8 Subtract eight to find the y position of the top bar.
58193 LD (58200),A Patch it into the instruction at 58200.
58196 CALL DrawFrameBar Draw the bottom bar of the frame.
58199 LD H,0 Set H to the y position of the top bar (this is patched at 58200).
58201 CALL DrawFrameBar Draw the top bar of the frame.
58204 LD DE,58252 Point DE at FrameCornerPictures.
58207 LD A,(IX+1) Fetch the y position of the frame.
58210 ADD A,6 Add 6 to find the y position of the bottom bar.
58212 CALL DrawFrameCorners Draw the corners of the bottom bar.
58215 LD A,(IX+1) Fetch the y position of the frame.
58218 SUB (IX+3) Subtract the height of the frame.
58221 CALL DrawFrameCorners Draw the corners of the top bar.
58224 LD DE,5 Set the length of an entry of the frame table.
58227 ADD IX,DE Move IX on to the next entry.
58229 RET Return.
Prev: 57897 Up: Map Next: 58230