Prev: 34459 Up: Map Next: 34761
34667: Scroll Line
Used by the routine at 34459.
ScrollLine 34667 PUSH AF Push AF, BC, HL and DE on the stack.
34668 PUSH BC
34669 PUSH HL
34670 PUSH DE
Set up the initial values.
34671 LD HL,16416 HL=$4020 (source).
34674 LD DE,16384 DE=$4000 (target).
34677 LD A,17 A=$11 (number of lines to shift).
34679 LD B,0 B=$00.
ScrollLine_Loop 34681 PUSH HL Stash HL and DE on the stack.
34682 PUSH DE
34683 LD C,8 C=$08 (byte counter).
ScrollLine_Line 34685 PUSH HL Stash HL, DE and BC on the stack.
34686 PUSH DE
34687 PUSH BC
34688 LD C,32 C=$20 (column counter - i.e. one row).
34690 LDIR Copy the row up one.
34692 POP BC Restore BC, DE and HL from the stack.
34693 POP DE
34694 POP HL
34695 INC H Increment the MSB of HL and DE by one to point to the next line down.
34696 INC D
34697 DEC C Decrease our byte counter in C by one.
34698 JR NZ,ScrollLine_Line Jump back to ScrollLine_Line unless the whole line is moved (i.e. C is now zero).
34700 POP DE Restore DE and HL from the stack. They are now at their values prior to the line move ScrollLine_Loop.
34701 POP HL
34702 LD C,32 DE=DE + $20 and HL=HL + $20.
34704 ADD HL,BC
34705 EX DE,HL
34706 ADD HL,BC
34707 EX DE,HL
34708 PUSH AF Stash AF on the stack.
34709 LD A,D A=D.
34710 AND %00000111 Keep only bits 0-2.
34712 JR Z,ScrollLine_SkipDE Skip to ScrollLine_SkipDE if zero.
Handle changing the target between each screen buffer area.
34714 LD A,D D=D + $07.
34715 ADD A,7
34717 LD D,A
ScrollLine_SkipDE 34718 LD A,H A=H.
34719 AND %00000111 Keep only bits 0-2.
34721 JR Z,ScrollLine_SkipHL Skip to ScrollLine_SkipHL if zero.
Handle changing the source between each screen buffer area.
34723 LD A,H H=H + $07.
34724 ADD A,7
34726 LD H,A
ScrollLine_SkipHL 34727 POP AF Restore AF containing the line counter from the stack.
34728 DEC A Decrease A by one.
34729 JR NZ,ScrollLine_Loop Loop back to ScrollLine_Loop until the line counter is zero.
Handle the attributes.
34731 LD HL,22560 Move the attributes up one character block.
34734 LD DE,22528
34737 LD BC,544
34740 LDIR
This creates the indent.
34742 LD B,42 Set a counter for 042 spaces.
34744 LD HL,20512 Set the target screen location to 20512.
34747 LD C,1 C=$01 (bit offset).
34749 LD A,32 A=ASCII "SPACE".
ScrollLine_Spacing 34751 CALL PrintPropChar Call PrintPropChar.
34754 DJNZ ScrollLine_Spacing Decrease counter by one and loop back to ScrollLine_Spacing until counter is zero.
Housekeeping and return.
34756 POP DE Restore DE, HL, BC and AF off the stack.
34757 POP HL
34758 POP BC
34759 POP AF
34760 RET Return.
Prev: 34459 Up: Map Next: 34761