Prev: 31747 Up: Map Next: 32289
31917: Draw game screen decorative border (colours)
The previous drawing routine at 31747 has only drawn the graphic pixels. The following set of routines adds the colours.
game border full
The majority of the game border is yellow, so initially the whole screen is set to this colour (INK 0, PAPER 6).
31917 LD HL,22528 Start of screen display attribute area (top left)
31920 LD B,0 This will run the routine 256 times (first iteration will DEC B which puts it at 255)
31922 LD (HL),48 Set byte to INK 0, PAPER 6.
31924 INC HL ...and the next one...
31925 LD (HL),48
31927 INC HL ...and also a third one...
31928 LD (HL),48
31930 INC HL
31931 DJNZ 31922 Repeat until whole screen covered (256 x 3 = 768 bytes)
There's an inner green rectangular border inside the decorative border area (pixels not drawn yet). This section sets that rectangle to green (INK 4, PAPER 0).
31933 LD HL,22594
31936 LD C,14 Number of character rows to colour (14)
31938 LD B,28 Number of columns to colour (28)
31940 LD (HL),4 Set colour to green (INK 4, PAPER 0)
31942 INC HL Move to next attribute square
31943 DJNZ 31940 Repeat for 28 columns
31945 INC HL Advance 4 squares to get to the next row
31946 INC HL
31947 INC HL
31948 INC HL
31949 DEC C Repeat for 14 rows
31950 JR NZ,31938
Some other attributes to set in the border; first, green colour for 2 spaces of the dragon head in the top right of the screen
31952 LD HL,22556
31955 LD (HL),32 INK 0, PAPER 4
31957 INC HL
31958 LD (HL),32
31960 LD HL,22589 ...and the square below
31963 LD (HL),32
Next, the strip of rightmost two columns for the first 12 screen character rows
31965 LD HL,22558
31968 LD B,12 12 rows
31970 LD DE,30 Offset ready to add to move down to the next character line
31973 LD (HL),32 Set the two attributes to green
31975 INC HL
31976 LD (HL),32 INK 0, PAPER 4
31978 INC HL
31979 ADD HL,DE Move down to the next row
31980 DJNZ 31973 Repeat for the 12 rows
Strip of 3 cyan attributes for the dragon's belly in the right column
31982 LD HL,22686
31985 LD (HL),40 INK 0, PAPER 5
31987 LD HL,22718
31990 LD (HL),40
31992 LD HL,22750
31995 LD (HL),40
Colour the winged skull at the top of the screen in magenta
31997 LD HL,22538
32000 LD B,12 12 columns
32002 LD (HL),24 INK 0, PAPER 3
32004 INC HL Move along the next square and repeat 12 times
32005 DJNZ 32002
32007 LD HL,22569 Repeat for the second row of the winged skull
32010 LD B,14 A couple more squares (14) for this line
32012 LD (HL),24 INK 0, PAPER 3
32014 INC HL
32015 DJNZ 32012
The above routine has also covered the skull between the wings magenta. So we'll re-colour it white:
32017 LD HL,22543 Display attribute address for skull in middle of top border
32020 LD (HL),56 Colour the next two squares white (INK 0, PAPER 7)
32022 INC HL
32023 LD (HL),56
32025 LD HL,22575 Do the same for the second row of the skull
32028 LD (HL),56
32030 INC HL
32031 LD (HL),56
32033 INC HL (this instruction is not needed)
Set the whole of the far left column (snake & pillar) green, starting 1 character down (below the skull)
32034 LD HL,22560 Starting point in screen display attributes
32037 LD B,23 23 rows
32039 LD DE,32 Offset ready to add to jump to the next character row
32042 LD (HL),32 INK 0, PAPER 4
32044 ADD HL,DE Jump to the next row and repeat (23 rows)
32045 DJNZ 32042
Yellow bit of snake's tail midway down the screen, left column:
32047 LD HL,22912
32050 LD (HL),48 INK 0, PAPER 6
Left column, square immediately to the right of the top of the devil's wing, set to green colour:
32052 LD HL,22945
32055 LD (HL),32 For consistency this value should probably be 48 - yellow (INK 0, PAPER 6) - as the rest of the right hand side of this pillar is yellow
32057 LD HL,22530
Snake (green) and mini-spider (cyan) in top left of screen
32060 LD (HL),32 INK 0, PAPER 4 (green) for the first two blocks
32062 INC HL
32063 LD (HL),32
32065 INC HL
32066 LD (HL),40 INK 0, PAPER 5 (cyan) for the small spider
32068 INC HL
32069 LD (HL),32 ...then back to green for the last two blocks of the snake's head
32071 INC HL
32072 LD (HL),32
Two squares of the bottom of the snake's head (green)
32074 LD HL,22565
32077 LD (HL),32 INK 0, PAPER 4
32079 INC HL
32080 LD (HL),32
Two squares for skull in top left of screen (white)
32082 LD HL,22528
32085 LD (HL),56 INK 0, PAPER 7 (white)
32087 INC HL
32088 LD (HL),56
4 red character squares in the fire breathed by the dragon in the top right of the screen
32090 LD HL,22551
32093 LD (HL),16 INK 0, PAPER 2
32095 LD HL,22585
32098 LD (HL),16
32100 LD HL,22553
32103 LD (HL),16
32105 LD HL,22587
32108 LD (HL),16
7 red character squares in the devil's wing that overlaps the left column
32110 LD HL,22944
32113 LD (HL),16
32115 LD HL,22976
32118 LD (HL),16
32120 INC HL
32121 LD (HL),16
32123 LD HL,23008
32126 LD (HL),16
32128 INC HL
32129 LD (HL),16
32131 LD HL,23040
32134 LD (HL),16
32136 INC HL
32137 LD (HL),16
...And red squares for the rest of the devil - 6 rows x 3 characters
32139 INC HL Move to starting position
32140 LD B,6 6 rows
32142 LD DE,29 29 spaces - offset to allow moving to position in next line (plus 3 squares filled = 32)
32145 LD (HL),16 INK 0, PAPER 2 (red) for 3 squares
32147 INC HL
32148 LD (HL),16
32150 INC HL
32151 LD (HL),16
32153 INC HL
32154 ADD HL,DE Add offset to move attribute display address to next line
32155 DJNZ 32145 Repeat colouring for the 6 rows of the devil
32157 LD HL,23073 ...And red for the last bit of devil wing overlapping the pillar
32160 LD (HL),16
4 character squares of white for the bottom of the word 'MAGIC' in the bottom left corner
32162 LD HL,23266
32165 LD (HL),56 INK 0, PAPER 7 (white)
32167 INC HL
32168 LD (HL),56
32170 INC HL
32171 LD (HL),56
32173 INC HL
32174 LD (HL),56
Strip of 20 white attribute squares for the very top of the scroll
32176 LD HL,23046
32179 LD B,20 20 squares to colour
32181 LD (HL),56 INK 0, PAPER 7 (white)
32183 INC HL Move right to next square
32184 DJNZ 32181 Repeat for all 20
A bunch of white squares for the angel in the bottom right of the screen
32186 LD HL,23068
32189 LD (HL),56 INK 0, PAPER 7 (white)
32191 LD HL,22975
32194 LD (HL),56
32196 LD HL,23007
32199 LD (HL),56
32201 LD HL,23038
32204 LD (HL),56
32206 INC HL
32207 LD (HL),56
32209 LD HL,23053 The next 3 squares are in the top of the scroll which has already been coloured in 32176, so the code for colouring these 3 squares is unnecessary
32212 LD (HL),56
32214 INC HL
32215 LD (HL),56
32217 INC HL
32218 LD (HL),56
32220 LD HL,23069 Other various white squares for the angel
32223 LD (HL),56
32225 INC HL
32226 LD (HL),56
32228 INC HL
32229 LD (HL),56
32231 LD HL,23101
32234 LD (HL),56
32236 INC HL
32237 LD (HL),56
32239 INC HL
32240 LD (HL),56
32242 LD HL,23133
32245 LD (HL),56
32247 INC HL
32248 LD (HL),56
A couple of cyan squares in the 'wispy bits' to the left of the angel:
32250 LD HL,23195
32253 LD (HL),40 INK 0, PAPER 5 (cyan)
32255 LD HL,23226
32258 LD (HL),40
32260 INC HL ...and a couple of green ones between them
32261 LD (HL),32 INK 0, PAPER 4 (green)
32263 LD HL,23258
32266 LD (HL),32
...and a few more cyan & green squares to the right of the angel
32268 LD HL,23103
32271 LD DE,32 Offset of 32 spaces to add to display address to move to line below
32274 LD (HL),40 INK 0, PAPER 5 (cyan)
32276 ADD HL,DE ADD HL, DE moves the screen display address down one character square
32277 LD (HL),40
32279 ADD HL,DE
32280 LD (HL),40
32282 ADD HL,DE
32283 LD (HL),32 INK 0, PAPER 4 (green)
32285 ADD HL,DE
32286 LD (HL),32
32288 ADD HL,DE
Prev: 31747 Up: Map Next: 32289