![]() |
Routines |
Prev: 7C03 | Up: Map | Next: 7E21 |
|
||||
The previous drawing routine at 7C03 has only drawn the graphic pixels. The following set of routines adds the colours.
![]()
The majority of the game border is yellow, so initially the whole screen is set to this colour (INK 0, PAPER 6).
|
||||
7CAD | LD HL,$5800 | Start of screen display attribute area (top left) | ||
7CB0 | LD B,$00 | This will run the routine 256 times (first iteration will DEC B which puts it at 255) | ||
7CB2 | LD (HL),$30 | Set byte to INK 0, PAPER 6. | ||
7CB4 | INC HL | ...and the next one... | ||
7CB5 | LD (HL),$30 | |||
7CB7 | INC HL | ...and also a third one... | ||
7CB8 | LD (HL),$30 | |||
7CBA | INC HL | |||
7CBB | DJNZ $7CB2 | 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).
|
||||
7CBD | LD HL,$5842 | |||
7CC0 | LD C,$0E | Number of character rows to colour (14) | ||
7CC2 | LD B,$1C | Number of columns to colour (28) | ||
7CC4 | LD (HL),$04 | Set colour to green (INK 4, PAPER 0) | ||
7CC6 | INC HL | Move to next attribute square | ||
7CC7 | DJNZ $7CC4 | Repeat for 28 columns | ||
7CC9 | INC HL | Advance 4 squares to get to the next row | ||
7CCA | INC HL | |||
7CCB | INC HL | |||
7CCC | INC HL | |||
7CCD | DEC C | Repeat for 14 rows | ||
7CCE | JR NZ,$7CC2 | |||
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
|
||||
7CD0 | LD HL,$581C | |||
7CD3 | LD (HL),$20 | INK 0, PAPER 4 | ||
7CD5 | INC HL | |||
7CD6 | LD (HL),$20 | |||
7CD8 | LD HL,$583D | ...and the square below | ||
7CDB | LD (HL),$20 | |||
Next, the strip of rightmost two columns for the first 12 screen character rows
|
||||
7CDD | LD HL,$581E | |||
7CE0 | LD B,$0C | 12 rows | ||
7CE2 | LD DE,$001E | Offset ready to add to move down to the next character line | ||
7CE5 | LD (HL),$20 | Set the two attributes to green | ||
7CE7 | INC HL | |||
7CE8 | LD (HL),$20 | INK 0, PAPER 4 | ||
7CEA | INC HL | |||
7CEB | ADD HL,DE | Move down to the next row | ||
7CEC | DJNZ $7CE5 | Repeat for the 12 rows | ||
Strip of 3 cyan attributes for the dragon's belly in the right column
|
||||
7CEE | LD HL,$589E | |||
7CF1 | LD (HL),$28 | INK 0, PAPER 5 | ||
7CF3 | LD HL,$58BE | |||
7CF6 | LD (HL),$28 | |||
7CF8 | LD HL,$58DE | |||
7CFB | LD (HL),$28 | |||
Colour the winged skull at the top of the screen in magenta
|
||||
7CFD | LD HL,$580A | |||
7D00 | LD B,$0C | 12 columns | ||
7D02 | LD (HL),$18 | INK 0, PAPER 3 | ||
7D04 | INC HL | Move along the next square and repeat 12 times | ||
7D05 | DJNZ $7D02 | |||
7D07 | LD HL,$5829 | Repeat for the second row of the winged skull | ||
7D0A | LD B,$0E | A couple more squares (14) for this line | ||
7D0C | LD (HL),$18 | INK 0, PAPER 3 | ||
7D0E | INC HL | |||
7D0F | DJNZ $7D0C | |||
The above routine has also covered the skull between the wings magenta. So we'll re-colour it white:
|
||||
7D11 | LD HL,$580F | Display attribute address for skull in middle of top border | ||
7D14 | LD (HL),$38 | Colour the next two squares white (INK 0, PAPER 7) | ||
7D16 | INC HL | |||
7D17 | LD (HL),$38 | |||
7D19 | LD HL,$582F | Do the same for the second row of the skull | ||
7D1C | LD (HL),$38 | |||
7D1E | INC HL | |||
7D1F | LD (HL),$38 | |||
7D21 | 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)
|
||||
7D22 | LD HL,$5820 | Starting point in screen display attributes | ||
7D25 | LD B,$17 | 23 rows | ||
7D27 | LD DE,$0020 | Offset ready to add to jump to the next character row | ||
7D2A | LD (HL),$20 | INK 0, PAPER 4 | ||
7D2C | ADD HL,DE | Jump to the next row and repeat (23 rows) | ||
7D2D | DJNZ $7D2A | |||
Yellow bit of snake's tail midway down the screen, left column:
|
||||
7D2F | LD HL,$5980 | |||
7D32 | LD (HL),$30 | INK 0, PAPER 6 | ||
Left column, square immediately to the right of the top of the devil's wing, set to green colour:
|
||||
7D34 | LD HL,$59A1 | |||
7D37 | LD (HL),$20 | 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 | ||
7D39 | LD HL,$5802 | |||
Snake (green) and mini-spider (cyan) in top left of screen
|
||||
7D3C | LD (HL),$20 | INK 0, PAPER 4 (green) for the first two blocks | ||
7D3E | INC HL | |||
7D3F | LD (HL),$20 | |||
7D41 | INC HL | |||
7D42 | LD (HL),$28 | INK 0, PAPER 5 (cyan) for the small spider | ||
7D44 | INC HL | |||
7D45 | LD (HL),$20 | ...then back to green for the last two blocks of the snake's head | ||
7D47 | INC HL | |||
7D48 | LD (HL),$20 | |||
Two squares of the bottom of the snake's head (green)
|
||||
7D4A | LD HL,$5825 | |||
7D4D | LD (HL),$20 | INK 0, PAPER 4 | ||
7D4F | INC HL | |||
7D50 | LD (HL),$20 | |||
Two squares for skull in top left of screen (white)
|
||||
7D52 | LD HL,$5800 | |||
7D55 | LD (HL),$38 | INK 0, PAPER 7 (white) | ||
7D57 | INC HL | |||
7D58 | LD (HL),$38 | |||
4 red character squares in the fire breathed by the dragon in the top right of the screen
|
||||
7D5A | LD HL,$5817 | |||
7D5D | LD (HL),$10 | INK 0, PAPER 2 | ||
7D5F | LD HL,$5839 | |||
7D62 | LD (HL),$10 | |||
7D64 | LD HL,$5819 | |||
7D67 | LD (HL),$10 | |||
7D69 | LD HL,$583B | |||
7D6C | LD (HL),$10 | |||
7 red character squares in the devil's wing that overlaps the left column
|
||||
7D6E | LD HL,$59A0 | |||
7D71 | LD (HL),$10 | |||
7D73 | LD HL,$59C0 | |||
7D76 | LD (HL),$10 | |||
7D78 | INC HL | |||
7D79 | LD (HL),$10 | |||
7D7B | LD HL,$59E0 | |||
7D7E | LD (HL),$10 | |||
7D80 | INC HL | |||
7D81 | LD (HL),$10 | |||
7D83 | LD HL,$5A00 | |||
7D86 | LD (HL),$10 | |||
7D88 | INC HL | |||
7D89 | LD (HL),$10 | |||
...And red squares for the rest of the devil - 6 rows x 3 characters
|
||||
7D8B | INC HL | Move to starting position | ||
7D8C | LD B,$06 | 6 rows | ||
7D8E | LD DE,$001D | 29 spaces - offset to allow moving to position in next line (plus 3 squares filled = 32) | ||
7D91 | LD (HL),$10 | INK 0, PAPER 2 (red) for 3 squares | ||
7D93 | INC HL | |||
7D94 | LD (HL),$10 | |||
7D96 | INC HL | |||
7D97 | LD (HL),$10 | |||
7D99 | INC HL | |||
7D9A | ADD HL,DE | Add offset to move attribute display address to next line | ||
7D9B | DJNZ $7D91 | Repeat colouring for the 6 rows of the devil | ||
7D9D | LD HL,$5A21 | ...And red for the last bit of devil wing overlapping the pillar | ||
7DA0 | LD (HL),$10 | |||
4 character squares of white for the bottom of the word 'MAGIC' in the bottom left corner
|
||||
7DA2 | LD HL,$5AE2 | |||
7DA5 | LD (HL),$38 | INK 0, PAPER 7 (white) | ||
7DA7 | INC HL | |||
7DA8 | LD (HL),$38 | |||
7DAA | INC HL | |||
7DAB | LD (HL),$38 | |||
7DAD | INC HL | |||
7DAE | LD (HL),$38 | |||
Strip of 20 white attribute squares for the very top of the scroll
|
||||
7DB0 | LD HL,$5A06 | |||
7DB3 | LD B,$14 | 20 squares to colour | ||
7DB5 | LD (HL),$38 | INK 0, PAPER 7 (white) | ||
7DB7 | INC HL | Move right to next square | ||
7DB8 | DJNZ $7DB5 | Repeat for all 20 | ||
A bunch of white squares for the angel in the bottom right of the screen
|
||||
7DBA | LD HL,$5A1C | |||
7DBD | LD (HL),$38 | INK 0, PAPER 7 (white) | ||
7DBF | LD HL,$59BF | |||
7DC2 | LD (HL),$38 | |||
7DC4 | LD HL,$59DF | |||
7DC7 | LD (HL),$38 | |||
7DC9 | LD HL,$59FE | |||
7DCC | LD (HL),$38 | |||
7DCE | INC HL | |||
7DCF | LD (HL),$38 | |||
7DD1 | LD HL,$5A0D | The next 3 squares are in the top of the scroll which has already been coloured in 7DB0, so the code for colouring these 3 squares is unnecessary | ||
7DD4 | LD (HL),$38 | |||
7DD6 | INC HL | |||
7DD7 | LD (HL),$38 | |||
7DD9 | INC HL | |||
7DDA | LD (HL),$38 | |||
7DDC | LD HL,$5A1D | Other various white squares for the angel | ||
7DDF | LD (HL),$38 | |||
7DE1 | INC HL | |||
7DE2 | LD (HL),$38 | |||
7DE4 | INC HL | |||
7DE5 | LD (HL),$38 | |||
7DE7 | LD HL,$5A3D | |||
7DEA | LD (HL),$38 | |||
7DEC | INC HL | |||
7DED | LD (HL),$38 | |||
7DEF | INC HL | |||
7DF0 | LD (HL),$38 | |||
7DF2 | LD HL,$5A5D | |||
7DF5 | LD (HL),$38 | |||
7DF7 | INC HL | |||
7DF8 | LD (HL),$38 | |||
A couple of cyan squares in the 'wispy bits' to the left of the angel:
|
||||
7DFA | LD HL,$5A9B | |||
7DFD | LD (HL),$28 | INK 0, PAPER 5 (cyan) | ||
7DFF | LD HL,$5ABA | |||
7E02 | LD (HL),$28 | |||
7E04 | INC HL | ...and a couple of green ones between them | ||
7E05 | LD (HL),$20 | INK 0, PAPER 4 (green) | ||
7E07 | LD HL,$5ADA | |||
7E0A | LD (HL),$20 | |||
...and a few more cyan & green squares to the right of the angel
|
||||
7E0C | LD HL,$5A3F | |||
7E0F | LD DE,$0020 | Offset of 32 spaces to add to display address to move to line below | ||
7E12 | LD (HL),$28 | INK 0, PAPER 5 (cyan) | ||
7E14 | ADD HL,DE | ADD HL, DE moves the screen display address down one character square | ||
7E15 | LD (HL),$28 | |||
7E17 | ADD HL,DE | |||
7E18 | LD (HL),$28 | |||
7E1A | ADD HL,DE | |||
7E1B | LD (HL),$20 | INK 0, PAPER 4 (green) | ||
7E1D | ADD HL,DE | |||
7E1E | LD (HL),$20 | |||
7E20 | ADD HL,DE |
Prev: 7C03 | Up: Map | Next: 7E21 |