Prev: 858B Up: Map Next: 864A
860D: Print: Scroll The Line Buffer
Used by the routine at Print_Character.
Scrolls the line buffer up by four rows of 20 bytes and fills the vacated row with spaces.
Print_ScrollTheLineBuffer 860D PUSH HL Save HL, DE, BC and AF, and point HL at the screen line 5080.
860E PUSH DE
860F PUSH BC
8610 PUSH AF
8611 LD HL,$5080
8614 LD DE,$5060 Point DE at the line buffer.
8617 LD A,$04 Load 04 before the day and night test.
8619 LD B,$00 Start the token count at zero.
Print_ScrollTheLineBuffer_ScrollOneCharacterRow 861B PUSH HL Save the screen pointers and count 08 pixel rows.
861C PUSH DE
861D LD C,$08
Print_ScrollTheLineBuffer_Loop 861F PUSH HL Copy the prepared bytes.
8620 PUSH DE
8621 PUSH BC
8622 LD C,$20
8624 LDIR
8626 POP BC Restore the screen pointers from the stack, step to the next pixel row, and jump back to Print_ScrollTheLineBuffer_Loop until the count in C reaches zero.
8627 POP DE
8628 POP HL
8629 INC H
862A INC D
862B DEC C
862C JR NZ,Print_ScrollTheLineBuffer_Loop
862E POP DE Restore the saved screen pointers from the stack and set BC to 20, one screen row.
862F POP HL
8630 LD C,$20
8632 ADD HL,BC Step one screen row, 20 bytes.
8633 EX DE,HL Swap the two screen pointers.
8634 ADD HL,BC Step the other pointer one screen row, 20 bytes.
8635 EX DE,HL Swap the two screen pointers.
8636 DEC A Jump back to Print_ScrollTheLineBuffer_ScrollOneCharacterRow until the row count in A reaches zero.
8637 JR NZ,Print_ScrollTheLineBuffer_ScrollOneCharacterRow
8639 LD B,$20 Count 20 passes.
863B LD HL,$50E0 Point HL at the attribute line.
863E LD A,$20 Use the character ' '.
Blank the new line with spaces.
Print_ScrollTheLineBuffer_BlankTheNewLine 8640 CALL Print_RomFont Call Print_RomFont to draw this character with the ROM font.
8643 DJNZ Print_ScrollTheLineBuffer_BlankTheNewLine Loop back to Print_ScrollTheLineBuffer_BlankTheNewLine until 20 runs out.
8645 POP AF Restore AF, BC, DE and HL from the stack.
8646 POP BC
8647 POP DE
8648 POP HL
8649 RET Return.
Prev: 858B Up: Map Next: 864A