| Routines

E87C: Scroll the screen up 6 rows

Used by the routine at EC7B.
E87C | LD HL,$E7EC | Set the instruction at E7EB to 'LD BC,$0020'
E87F | LD (HL),$20
E881 | LD L,$EF | Set the instruction at E7EE to 'LDIR'
E883 | LD (HL),$B0
E885 | LD B,$06 | 6 rows will be scrolled on
E887 | PUSH BC | Save the primary screen row counter
This entry point is used by the routine at FC6A.
E888 | LD B,$13 | There are 19 screen rows to move up
E88A | LD DE,$5800 | DE=destination attribute file address (top row)
E88D | LD HL,$5820 | HL=source attribute file address (second row from the top)
E890 | PUSH BC | Save the secondary screen row counter
E891 | PUSH HL | Save the source attribute file address
E892 | PUSH DE | Save the destination attribute file address
E893 | CALL $E7E8 | Move one screen row up
E896 | POP HL | HL=source attribute file address
E897 | LD C,$20 | Point HL at the next row down in the attribute file
E899 | ADD HL,BC
E89A | EX DE,HL | Transfer this address to DE
E89B | POP HL | HL=destination attribute file address
E89C | ADD HL,BC | Point HL at the next row down in the attribute file
E89D | POP BC | Restore the secondary screen row counter to B
E89E | DJNZ $E890 | Jump back until all 19 screen rows have been moved up
E8A0 | LD HL,$7FFF | 7FFF holds the y-coordinate of the topmost row of the play area on screen
E8A3 | INC (HL) | Increment this
E8A4 | LD HL,$131F | L=31 (rightmost screen column), H=19 (bottom row of the screen)
E8A7 | PUSH HL | Save the screen coordinates briefly
E8A8 | CALL $E70C | Print a tile at screen coordinates (L,19)
E8AB | POP HL | Restore the screen coordinates to HL
E8AC | DEC L | Have we printed every tile in the row yet?
E8AD | JP P,$E8A7 | Jump back if not
E8B0 | POP BC | Restore the primary screen row counter to B
E8B1 | DJNZ $E887 | Jump back until 6 rows have been scrolled on
E8B3 | RET |