Prev: 607B Up: Map Next: 60F9
609B: Scroll the screen left one column
Used by the routine at 64DC.
609B EXX
609C LD HL,$5801 Point HL' and DE' at the leftmost end of the top row of attribute bytes on the screen
609F LD DE,$5800
60A2 LD BC,$001F We need to scroll 31 attribute bytes at a time
60A5 EXX
60A6 LD HL,$4001 Point HL and DE at the leftmost end of the top row of pixels on the screen
60A9 LD DE,$4000
60AC LD BC,$001F We need to scroll 31 display file bytes at a time
60AF LD A,$15 There are 21 rows of character squares to scroll
60B1 EX AF,AF'
60B2 LD A,$08 Each row of character squares contains 8 rows of pixels
60B4 PUSH HL
60B5 PUSH DE
60B6 LDIR Scroll a row of pixels left one column
60B8 POP DE
60B9 POP HL
60BA INC D Point HL and DE at the next row of pixels
60BB INC H
60BC LD C,$1F BC=001F
60BE DEC A Next row in this block of 8x32
60BF JR NZ,$60B4 Jump back until this 8x32 pixel block has been scrolled
60C1 EXX
60C2 LDIR Scroll a row of attribute bytes left one column
60C4 INC HL Point HL' and DE' at the leftmost end of the next row of attribute bytes on the screen
60C5 INC DE
60C6 LD C,$1F BC'=001F
60C8 EXX
60C9 LD A,$20 Point HL and DE at the leftmost end of the top row of the next 8x32 block of pixels
60CB ADD A,E
60CC LD E,A
60CD LD A,$20
60CF ADD A,L
60D0 LD L,A
60D1 EX AF,AF'
60D2 DEC A Next row of character squares
60D3 JR Z,$60E5 Exit this loop if all 21 rows have been scrolled left
60D5 CP $05 Have we reached the bottom third of the screen?
60D7 JR Z,$60B1 Jump if so
60D9 CP $0D Have we reached the middle third of the screen?
60DB JR Z,$60B1 Jump if so
60DD EX AF,AF'
60DE LD A,H Point HL and DE at the leftmost end of the top row of the next 8x32 block of pixels
60DF SUB $08
60E1 LD H,A
60E2 LD D,A
60E3 JR $60B2 Jump back to deal with the next row of character squares
The 21 rows of character squares have been scrolled one place to the left. Now the rightmost column needs to be filled.
60E5 EXX
60E6 LD HL,$581F Point HL' and DE' at the attribute file and display file addresses for the top right of the screen, and set BC'=0020; however, these values are not used
60E9 LD DE,$401F
60EC INC C
60ED EXX
60EE LD A,($7F00) A=leftmost column of the skool on-screen (0-64)
60F1 INC A We are scrolling one column left
60F2 LD ($7F00),A
60F5 ADD A,C A=rightmost column of the skool on-screen (31-95)
60F6 JP $605E Fill in the rightmost column
Prev: 607B Up: Map Next: 60F9