Prev: 8761 Up: Map Next: 87C9
876B: Scroll the story up a line
Used by the routine at STORY_CHAR.
Character rows 1 to 17 move up to 0 to 16, attributes with them, and row 17 is cleared to 42 spaces. The picture is in rows 0 to 15, so it goes up and off the top as the story goes on.
SCROLL_STORY 876B PUSH AF
876C PUSH BC
876D PUSH HL
876E PUSH DE
876F LD HL,$4020
8772 LD DE,$4000
8775 LD A,$11
8777 LD B,$00
SCROLL_STORY_0 8779 PUSH HL
877A PUSH DE
877B LD C,$08
SCROLL_STORY_1 877D PUSH HL
877E PUSH DE
877F PUSH BC
8780 LD C,$20
8782 LDIR
8784 POP BC
8785 POP DE
8786 POP HL
8787 INC H
8788 INC D
8789 DEC C
878A JR NZ,SCROLL_STORY_1
878C POP DE
878D POP HL
878E LD C,$20
8790 ADD HL,BC
8791 EX DE,HL
8792 ADD HL,BC
8793 EX DE,HL
8794 PUSH AF
8795 LD A,D
8796 AND $07
8798 JR Z,SCROLL_STORY_2
879A LD A,D
879B ADD A,$07
879D LD D,A
SCROLL_STORY_2 879E LD A,H
879F AND $07
87A1 JR Z,SCROLL_STORY_3
87A3 LD A,H
87A4 ADD A,$07
87A6 LD H,A
SCROLL_STORY_3 87A7 POP AF
87A8 DEC A
87A9 JR NZ,SCROLL_STORY_0
87AB LD HL,$5820
87AE LD DE,$5800
87B1 LD BC,$0220
87B4 LDIR
87B6 LD B,$2A
87B8 LD HL,$5020
87BB LD C,$01
87BD LD A,$20
SCROLL_STORY_4 87BF CALL NARROW_CHAR
87C2 DJNZ SCROLL_STORY_4
87C4 POP DE
87C5 POP HL
87C6 POP BC
87C7 POP AF
87C8 RET
Prev: 8761 Up: Map Next: 87C9