![]() |
Routines |
Prev: E5FE | Up: Map | Next: E641 |
Used by the routine at C07A.
|
||||
This routine alternates the INK and PAPER colours of the sky above the landscape to flash between yellow and blue.
![]()
It checks the INK and PAPER colours of the byte (1 or 6) and toggles between them.
The effect doesn't filter out squares in the left/right border - because a section on the left has yellow in it, it gets affected - see Bugs - Intro sequence - lightning effect colour bleeds into border.
|
||||
E610 | LD B,$FF | 255 bytes covers a couple of rows more than the first third of the screen. | ||
E612 | LD HL,$5840 | Screen attribute address - top left of the screen, then two rows down below the top border | ||
Determine INK colour in screen attribute byte:
|
||||
E615 | LD A,(HL) | Get screen attribute byte | ||
E616 | LD D,A | Store in D register | ||
E617 | AND $07 | Get the INK value from the screen attribute byte (0-7) | ||
E619 | CP $01 | Is it blue (INK 1)? | ||
E61B | JR NZ,$E621 | |||
E61D | LD A,$06 | If so, set the INK colour to yellow (6) and skip next check | ||
E61F | JR $E627 | |||
E621 | CP $06 | Is the INK colour yellow (6)? | ||
E623 | JR NZ,$E627 | |||
E625 | LD A,$01 | If so, Set the INK colour to blue | ||
Determine PAPER colour to paint sky - alternating between yellow and blue:
|
||||
E627 | LD E,A | Copy INK colour into E register - blue (1) or yellow (6) | ||
E628 | LD A,D | Get screen attribute byte | ||
E629 | AND $38 | Filter out everything but the PAPER colour (bits 3-5) | ||
E62B | CP $08 | Is it blue (PAPER 1)? | ||
E62D | JR NZ,$E633 | |||
E62F | LD A,$30 | If so, set to yellow (PAPER 6) and skip next check | ||
E631 | JR $E639 | |||
E633 | CP $30 | Is it yellow (PAPER 6)? | ||
E635 | JR NZ,$E639 | |||
E637 | LD A,$08 | If so, set to blue (PAPER 1) | ||
Combine calculated INK and PAPER parts of attribute byte:
|
||||
E639 | OR E | Combine PAPER value with INK value calculated earlier | ||
E63A | LD (HL),A | ...and print onto screen | ||
E63B | INC HL | Move right one square | ||
E63C | AND $10 | This instruction has no effect, as the A register is assigned a new value within the next couple of instructions | ||
E63E | DJNZ $E615 | Repeat x 255, covering the top third of the screen (and a bit more). | ||
E640 | RET | Return to the routine at C07A |
Prev: E5FE | Up: Map | Next: E641 |