Prev: E842 Up: Map Next: E879
E845: Scroll the screen right 8 columns
Used by the routine at F18E.
E845 LD HL,$E7EC Set the instruction at E7EB to 'LD BC,$001F'
E848 LD (HL),$1F
E84A LD L,$EF Set the instruction at E7EE to 'LDDR'
E84C LD (HL),$B8
E84E LD B,$08 There are 8 columns to scroll on
E850 PUSH BC Save the column counter
E851 LD B,$14 There are 20 rows to be scrolled right
E853 LD HL,$581E Point HL at the attribute byte for the cell at screen coordinates (0,0)
E856 LD D,H Point DE at the attribute byte for the adjacent cell on the right
E857 LD E,L
E858 INC E
E859 PUSH BC Save the row counter
E85A PUSH HL Save the source attribute file address
E85B CALL $E7E8 Shift this row of the screen right
E85E POP HL Restore the source attribute file address to HL
E85F LD C,$20 Point HL at the next row down in the attribute file
E862 POP BC Restore the row counter to B
E863 DJNZ $E856 Jump back until all 20 rows have been scrolled right
E865 LD HL,$7FFE 7FFE holds the x-coordinate of the leftmost column of the play area on screen
E868 DEC (HL) Decrement this x-coordinate
E869 LD HL,$1300 L=0 (leftmost screen column), H=19 (bottom row of the screen)
E86C PUSH HL Save the screen coordinates
E86D CALL $E70C Print a tile at screen coordinates (0,H)
E870 POP HL Restore the screen coordinates to HL
E871 DEC H Have we printed every tile in the column yet?
E872 JP P,$E86C Jump back if not
E875 POP BC Restore the column counter to B
E876 DJNZ $E850 Jump back until 8 columns have been scrolled on
E878 RET
Prev: E842 Up: Map Next: E879