; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
; ³ (c) Lord Julus - 2000		 Vxtasy #1 - Magazine source code ³
; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

;===========( Page down procedure )==========================================

pagedown proc near
	cmp overend, 1			  ; can we still go ?
	je over_page_down		  ;
					  ;
	lea di, lastlinepos		  ; go to the last line position
	call fill_dxcx			  ;
	call move_from_0		  ;
					  ;
	call check_fseek		  ;
	lea di, firstlinepos		  ; make it the firstline position
	call fill_axdx			  ;
	call read_all_lines		  ; and read lines
					  ;
	mov cx, 24d-skip_above-skip_below+1
	mov ax, linesread		  ;
	add crtdispline, ax		  ;
	sub cx, linesread		  ; did we read all lines ?
	jz over_page_down		  ;
	call endproc			  ; if no, we are at end...
					  ;
over_page_down: 			  ;
	ret				  ;
pagedown endp				  ;

;===========( Page up procedure )============================================

pageup proc near			  ;
	lea di, firstlinepos		  ; go to the firstline
	call fill_dxcx			  ;
	call move_from_0		  ;
					  ;
	mov cx, 25d-skip_above-skip_below ;
	call go_back_cx_lines		  ; go back one page
	jc page_up_at_top		  ;
					  ;
	call check_fseek		  ;
	lea di, firstlinepos		  ;
	call fill_axdx			  ;
	call read_all_lines		  ; and read a new page
	ret				  ;
					  ;
page_up_at_top: 			  ;
	mov miscdata, 0 		  ;
	call homeproc			  ;
	ret				  ;
pageup endp				  ;
;============================================================================