RevScroll(screen, amount) register TScreen *screen; register int amount;
RevScroll(register TScreen *screen, register int amount)
RevScroll(screen, amount)register TScreen *screen;register int amount;{	register int i = screen->bot_marg - screen->top_marg + 1;	register int shift;	register int bot;	register int refreshtop;	register int refreshheight;	register int scrolltop;	register int scrollheight;	if(screen->cursor_state)		HideCursor();	if (amount > i)		amount = i;    if(screen->jumpscroll) {	if(screen->scroll_amt < 0) {		if(-screen->refresh_amt + amount > i)			FlushScroll(screen);		screen->scroll_amt -= amount;		screen->refresh_amt -= amount;	} else {		if(screen->scroll_amt > 0)			FlushScroll(screen);		screen->scroll_amt = -amount;		screen->refresh_amt = -amount;	}    } else {	shift = -screen->topline;	bot = screen->max_row - shift;	refreshheight = amount;	scrollheight = screen->bot_marg - screen->top_marg -	 refreshheight + 1;	refreshtop = screen->top_marg + shift;	scrolltop = refreshtop + refreshheight;	if((i = screen->bot_marg - bot) > 0)		scrollheight -= i;	if((i = screen->top_marg + refreshheight - 1 - bot) > 0)		refreshheight -= i;	if (screen->multiscroll && amount == 1 &&	    screen->topline == 0 && screen->top_marg == 0 &&	    screen->bot_marg == screen->max_row) {	    if (screen->incopy < 0 && screen->scrolls == 0)		CopyWait(screen);	    screen->scrolls++;	}	scrolling_copy_area(screen, scrolltop-amount, scrollheight, -amount);	if(refreshheight > 0) {		ClearCurBackground(screen,		    (int) refreshtop * FontHeight(screen) + screen->border,		    (int) OriginX(screen),		    (unsigned) refreshheight * FontHeight(screen),		    (unsigned) Width(screen));	}    }    ScrnInsertLine(screen, screen->visbuf, screen->bot_marg, screen->top_marg,		   amount, screen->max_col + 1);}