2 ; Christian Groessler, June 2004
4 ; void __fastcall__ _scroll (signed char numlines);
5 ; numlines > 0 scrolls up
6 ; numlines < 0 scrolls down
10 .importzp tmp1,tmp4,ptr1,ptr2
11 .import __mul40,_clrscr
25 adc #1 ; make positive
28 cmp #24 ; scroll >= the whole screen?
39 sta ptr1+1 ; point to last line on screen
54 lda #24 ; # of lines on screen
56 sbc tmp1 ; # of lines to move
59 ;very simple, could be improved
61 scrold: ldy #39 ; # of chars on a line - 1
81 ; fill new scrolled in lines with space
83 ldx tmp1 ; # of new lines
100 up: sta tmp1 ; # of lines to scroll
101 cmp #24 ; scroll >= the whole screen?
105 ;multiply by 40 (xsize)
106 up_ok: jsr __mul40 ; carry is cleared by __mul40
107 adc SAVMSC ; add start of screen mem
116 lda #24 ; # of lines on screen
118 sbc tmp1 ; # of lines to move
121 ;very simple, could be improved
123 scroll: ldy #39 ; # of chars on a line - 1
143 ; fill new scrolled in lines with space
145 ldx tmp1 ; # of new lines