Prev: 48006 Up: Map Next: 48212
48042: Draw Game Screen
Used by the routine at WinRound.
Resets the map and draws the parts of the game screen that are not the play window: the rows of beads above the message area, the message area itself with its rounded box, and the box for the battery meter with its title. It is used when a game is started, and when a round has been completed.
Before After
draw-game-screen-before draw-game-screen-after
DrawGameScreen 48042 CALL ResetMap Reset the map using ResetMap.
48045 LD HL,37889 Point HL at BorderGraphics.
48048 LD (38424),HL ...and use them as the current character set.
Draw the two rows of beads that divide the play window from the message area.
48051 LD HL,20512 Point HL at the start of the row on character row 17.
48054 LD BC,6145 The row is 24 characters wide (B) and starts with character 1 (C).
48057 CALL PrintBorderRow Draw the row using PrintBorderRow.
48060 LD BC,5634 The row is 22 characters wide and starts with character 2.
48063 LD HL,20481 Point HL at the start of the row on character row 16, one column in.
48066 CALL PrintBorderRow Draw the row.
48069 LD HL,23072 Point HL at the attributes of the lower row.
48072 LD (HL),72 Set the first attribute, blue paper with black ink.
48074 INC HL Move on to the second cell.
48075 LD BC,5705 There are 22 cells, and the attribute is blue paper with blue ink.
48078 CALL FillAttributeRow Set the attributes using FillAttributeRow.
48081 LD (HL),65 Set the last attribute, blue ink on a black paper.
48083 LD HL,23041 Point HL at the attributes of the upper row.
48086 LD BC,5704 There are 22 cells, and the attribute is blue paper with black ink.
48089 CALL FillAttributeRow Set the attributes.
48092 CALL ClearMessageArea Clear the message area using ClearMessageArea.
48095 LD A,71 Fill the attributes of the message area with bright white using FillMessageAttributes.
48097 CALL FillMessageAttributes
48100 LD HL,(23606) Fetch the address of the ROM character set...
48103 LD (38424),HL ...and use it as the current character set.
48106 LD HL,36872 Point HL at the position of the title of the battery meter.
48109 LD DE,48331 Point DE at Message_Battery.
48112 CALL PrintDoubleHeightText Print it using PrintDoubleHeightText.
Draw the rounded box of the message area, which is made of four rows of characters.
48115 LD HL,48212 Point HL at MessageBoxGraphics.
48118 LD (38424),HL ...and use them as the current character set.
48121 LD DE,48268 Point DE at MessageBox_Top.
48124 LD HL,40992 Point HL at the position of the top row.
48127 CALL PrintStringColour_CustomFont Print it using PrintStringColour_CustomFont.
48130 LD DE,48289 Point DE at MessageBox_Middle.
48133 LD HL,43040 Point HL at the position of the second row.
48136 CALL PrintStringColour_CustomFont Print it.
48139 LD DE,48289 Point DE at the middle row of the box again.
48142 LD HL,45088 Point HL at the position of the third row.
48145 CALL PrintStringColour_CustomFont Print it.
48148 LD DE,48310 Point DE at MessageBox_Bottom.
48151 LD HL,47136 Point HL at the position of the bottom row.
48154 CALL PrintStringColour_CustomFont Print it.
Draw the box for the battery meter.
48157 LD HL,48355 Point HL at BatteryMeterBoxGraphics.
48160 LD (38424),HL ...and use them as the current character set.
48163 LD HL,36928 Point HL at the position of the box.
48166 LD DE,48339 Point DE at BatteryMeterBox.
DrawGameScreen_Attributes 48169 PUSH HL Save the position.
48170 CALL AttributeAddress Find the address of the attributes using AttributeAddress.
48173 LD A,(DE) Fetch the attribute...
48174 INC DE ...and move on to the first character.
48175 LD C,A Keep the attribute.
48176 LD B,2 There are two rows of characters.
DrawGameScreen_Row 48178 PUSH DE Save the address of the characters...
48179 PUSH HL ...and the address of the attributes.
DrawGameScreen_Cell 48180 LD (HL),C Set an attribute.
48181 LD A,(DE) Fetch a character...
48182 INC DE ...and move on to the next one.
48183 INC L Move on to the next attribute.
48184 BIT 7,A Loop back until the last character has been reached.
48186 JR Z,DrawGameScreen_Cell
48188 POP HL Restore the address of the attributes...
48189 LD DE,32 ...and move down to the next row...
48192 ADD HL,DE ...of the attributes.
48193 POP DE Restore the address of the characters.
48194 DJNZ DrawGameScreen_Row Loop back until both rows have been done.
48196 POP HL Restore the position of the box.
48197 CALL ScreenAddress Find the screen address using ScreenAddress.
DrawGameScreen_Character 48200 LD A,(DE) Fetch a character.
48201 INC DE Move on to the next one.
48202 BIT 7,A Jump to PrintBigDigit to print the last character of the box.
48204 JP NZ,PrintBigDigit
48207 CALL PrintBigDigit Print a character using PrintBigDigit.
48210 JR DrawGameScreen_Character Loop back until the whole box has been printed.
Prev: 48006 Up: Map Next: 48212