Prev: 7CAD Up: Map Next: 7F25
7E21: Draw the inner border for the intro sequence
After drawing the decorative border, this routine draws the rectangular 'spiky' border at the edge of the picture that you can see during the intro sequence.
Graphics for the border and backdrop are stored at 825F.
intro inner border
The border on the left hand side of the screen is drawn first:
7E21 LD A,$01 1 column
7E23 LD ($8BAF),A
7E26 LD A,$0C 12 rows
7E28 LD ($8BB0),A
7E2B LD HL,$825F Address pointer for left-hand border graphic
7E2E LD ($7CC4),HL Store the border graphic address. This appears to be overwriting earlier code. However, this code that's overwritten is part of the decorative border which is already drawn, so doesn't need to be executed again.
7E31 LD HL,$4062 Set screen display address
7E34 CALL $8227 Drawing routine (to draw the graphic 12 times in a vertical line)
...Then the border on the right hand side
7E37 LD A,$01 1 column
7E39 LD ($8BAF),A
7E3C LD A,$0C 12 rows
7E3E LD ($8BB0),A
7E41 LD HL,$827F Address pointer for right-hand border graphic
7E44 LD ($7CC4),HL Store the border graphic address. This looks like a mistake as it seems to be overwriting earlier code at 7CC4. However, this code is part of the decorative border drawing so doesn't need to be executed again.
7E47 LD HL,$407D Set screen address
7E4A CALL $8227 Drawing routine (to draw the graphic 12 times in a vertical line)
Draw the top right 'corner piece' of the border
7E4D LD A,$01 Just 1 character (1 row, 1 column)
7E4F LD ($8BAF),A
7E52 LD A,$01
7E54 LD ($8BB0),A
7E57 LD HL,$8287 Store address of top right-hand corner graphic
7E5A LD ($7CC4),HL
7E5D LD HL,$405D Set screen display address
7E60 CALL $8227 Draw the graphic
Draw the bottom left 'corner piece' of the border
7E63 LD A,$01 Just 1 character (1 row, 1 column)
7E65 LD ($8BAF),A
7E68 LD A,$01
7E6A LD ($8BB0),A
7E6D LD HL,$8267 Store address of bottom left-hand corner graphic
7E70 LD ($7CC4),HL
7E73 LD HL,$48E2 Set screen display address
7E76 CALL $8227 Draw the graphic
Draw the bottom right 'corner piece' of the border
7E79 LD A,$01 Just 1 character (1 row, 1 column)
7E7B LD ($8BAF),A
7E7E LD A,$01
7E80 LD ($8BB0),A
7E83 LD HL,$8277 Store address of bottom right-hand corner graphic
7E86 LD ($7CC4),HL
7E89 LD HL,$48FD Set screen display address
7E8C CALL $8227 Draw the graphic
Draw bottom border
7E8F LD A,$1A 26 columns to draw
7E91 LD ($8BAF),A
7E94 LD A,$01 1 row
7E96 LD ($8BB0),A
7E99 LD HL,$828F Store address of bottom border graphic
7E9C LD ($7CC4),HL
7E9F LD HL,$4043 Set screen display address
7EA2 CALL $8227 Draw the border
Draw top border
7EA5 LD A,$1A 26 columns to draw
7EA7 LD ($8BAF),A
7EAA LD A,$01 1 row
7EAC LD ($8BB0),A
7EAF LD HL,$826F Store address of bottom border graphic
7EB2 LD ($7CC4),HL
7EB5 LD HL,$48E3 Set screen display address
7EB8 CALL $8227 Draw the border
Draw the top left 'corner piece' of the border
7EBB LD A,$01 Just 1 character (1 row, 1 column)
7EBD LD ($8BAF),A
7EC0 LD A,$01
7EC2 LD ($8BB0),A
7EC5 LD HL,$8297 Store address of top left-hand corner graphic
7EC8 LD ($7CC4),HL
7ECB LD HL,$4042 Set screen display address
7ECE CALL $8227 Draw the graphic
Now set the colours (dark blue) to the top 6 lines of the 'inner screen' (including the border)
7ED1 LD HL,$5842 Set the display address position on screen (top left)
7ED4 LD C,$06 6 rows to colour
7ED6 LD B,$1C 28 columns across the screen
7ED8 LD (HL),$08 Set colour of block to blue (INK 0, PAPER 1)
7EDA INC HL Move right to the next square
7EDB DJNZ $7ED8 ...and repeat until the row is finished
7EDD INC HL Advance screen display position by 4, which takes us back to the left but to the next row down
7EDE INC HL
7EDF INC HL
7EE0 INC HL
7EE1 DEC C Row counter reduced by one
7EE2 JR NZ,$7ED6 Repeat until colour in all rows coloured
Set colour for the sky section (stars/moon) to white
7EE4 LD ($7CC4),HL Pointer is now beneath the first 6 rows - store it
7EE7 LD HL,$5863 Set screen address pointer to just inside the top left border
7EEA LD C,$02 Top 2 rows of the picture
7EEC LD B,$1A ...and 26 columns, just inside the border
7EEE LD (HL),$0F Set the screen attribute block colour (INK 7, PAPER 1)
7EF0 INC HL Move right to the next character square
7EF1 DJNZ $7EEE ...and repeat until all 26 columns are coloured in
7EF3 INC HL Keep moving the screen display position right until back on the left of the screen, one row down
7EF4 INC HL
7EF5 INC HL
7EF6 INC HL
7EF7 INC HL
7EF8 INC HL
7EF9 DEC C Decrement row counter, and repeat until all 2 rows are coloured in
7EFA JR NZ,$7EEC
Set black colour for the next 8 rows of the graphics scene (just below the top of the sky)
7EFC LD HL,($7CC4) Retrieve the screen attribute display address pointer, just over a third of the way down the screen
7EFF LD C,$08 8 rows to colour
7F01 LD B,$1C 28 columns (this will also include the bottom half of the border)
7F03 LD (HL),$00 INK 0, PAPER 0
7F05 INC HL Move right to the next character square
7F06 DJNZ $7F03 Repeat until all 28 columns are filled in
7F08 INC HL Keep moving right until back on the left of the screen, one row down
7F09 INC HL
7F0A INC HL
7F0B INC HL
7F0C DEC C Decrement row counter, and repeat until all 8 rows are coloured in
7F0D JR NZ,$7F01
Set the bottom part of the intro screen to yellow (this will be Maroc's colour)
7F0F LD HL,($7CC4) Retrieve the screen address pointer, just over a third of the way down the screen
7F12 INC HL Move right one square, so just inside the (invisible) border
7F13 LD C,$07 7 rows to colour in
7F15 LD B,$1A ...and 26 columns
7F17 LD (HL),$06 Set colour of the square to yellow - INK 0, PAPER 7
7F19 INC HL Move right to the next square
7F1A DJNZ $7F17 ...and repeat so the row of 26 squares is coloured in
7F1C INC HL Keep moving the screen display address pointer right until back on the left side of the screen, one row down
7F1D INC HL
7F1E INC HL
7F1F INC HL
7F20 INC HL
7F21 INC HL
7F22 DEC C Decrement the row counter, and repeat until all 7 rows are coloured in
7F23 JR NZ,$7F15
Prev: 7CAD Up: Map Next: 7F25