Prev: 5B00 Up: Map Next: 607B
6000: Scroll the screen right one column
Used by the routine at 64D2.
6000 EXX
6001 LD HL,$581E Point HL' and DE' at the rightmost end of the top row of attribute bytes on the screen
6004 LD DE,$581F
6007 LD BC,$001F We need to scroll 31 attribute bytes at a time
600A EXX
600B LD HL,$401E Point HL and DE at the rightmost end of the top row of pixels on the screen
600E LD DE,$401F
6011 LD BC,$001F We need to scroll 31 display file bytes at a time
6014 LD A,$15 There are 21 rows of character squares to scroll
6016 EX AF,AF'
6017 LD A,$08 Each row of character squares contains 8 rows of pixels
6019 PUSH HL
601A PUSH DE
601B LDDR Scroll a row of pixels right one column
601D POP DE
601E POP HL
601F LD C,$1F BC=001F
6021 INC H Point HL and DE at the next row of pixels
6022 INC D
6023 DEC A Next row in this block of 8x32
6024 JR NZ,$6019 Jump back until this 8x32 pixel block has been scrolled
6026 EXX
6027 LDDR Scroll a row of attribute bytes right one column
6029 LD C,$3F Point HL' and DE' at the rightmost end of the next row of attribute bytes on the screen
602B ADD HL,BC
602C EX DE,HL
602D ADD HL,BC
602E EX DE,HL
602F LD C,$1F BC'=001F
6031 EXX
6032 LD A,$20 Point HL and DE at the rightmost end of the top row of the next 8x32 block of pixels
6034 ADD A,E
6035 LD E,A
6036 LD A,$20
6038 ADD A,L
6039 LD L,A
603A EX AF,AF'
603B DEC A Next row of character squares
603C JR Z,$604E Exit this loop if all 21 rows have been scrolled right
603E CP $0D Have we reached the middle third of the screen?
6040 JR Z,$6016 Jump if so
6042 CP $05 Have we reached the bottom third of the screen?
6044 JR Z,$6016 Jump if so
6046 EX AF,AF'
6047 LD A,H Point HL and DE at the rightmost end of the top row of the next 8x32 block of pixels
6048 SUB $08
604A LD H,A
604B LD D,A
604C JR $6017 Jump back to deal with the next row of character squares
The 21 rows of character squares have been scrolled one place to the right. Now the leftmost column needs to be filled.
604E EXX
604F LD HL,$5800 Point HL' and DE' at the attribute file and display file addresses for the top left of the screen, and set BC'=0020; however, these values are not used
6052 LD DE,$4000
6055 INC C
6056 EXX
6057 LD A,($7F00) A=leftmost column of the skool on-screen (0-64)
605A DEC A We are scrolling one column right
605B LD ($7F00),A
This entry point is used by the routine at 609B with A holding the x-coordinate of the rightmost column of the skool on-screen (31-95).
605E LD E,A E=X (x-coordinate of the far left or far right column of the skool currently on-screen)
605F LD D,$98 D=Y (this is the y-coordinate of the top row of the screen)
6061 LD B,$15 There are 21 rows on the screen
6063 PUSH DE
6064 PUSH BC
6065 CALL $610B Print the character square at (X,Y)
6068 POP BC
6069 POP DE
606A LD A,H Point HL at the attribute file address corresponding to the skool coordinates (X,Y)
606B RRCA
606C RRCA
606D RRCA
606E ADD A,$4F
6070 LD H,A
6071 SET 7,E Point DE at the attribute byte for the skool coordinates (X,Y)
6073 LD A,(DE) Pick the attribute byte up in A
6074 RES 7,E Restore the skool coordinates (X,Y) to DE
6076 LD (HL),A Poke the attribute byte onto the screen
6077 INC D Next row (Y) of the screen
6078 DJNZ $6063 Jump back until all 21 rows are done
607A RET
Prev: 5B00 Up: Map Next: 607B