Skip to content
Snippets Groups Projects
Commit 331cfcc5 authored by deuce's avatar deuce
Browse files

Two additional output optimizations:

1) When right movement can be done using spaces, use up to four.
2) Attempt to detect scrolled screens.  I doubt this will work very often
though.  I'll need to actually check for multiple lines scrolled and changes
to the last line before the scroll.
parent da4146e3
No related branches found
No related tags found
No related merge requests found
......@@ -287,6 +287,8 @@ int ansi_puttext(int sx, int sy, int ex, int ey, void* buf)
ansivmem[(ti.screenheight-1)*ti.screenwidth+x]=(ti.attribute<<8)|' ';
i=1;
}
#endif
#if 1
/* Check if this *includes* a scroll */
if(sx==1 && sy==1 && ex==ti.screenwidth && ey==ti.screenheight
&& memcmp(buf,ansivmem,ti.screenwidth*(ti.screenheight-1)*2)==0) {
......@@ -296,6 +298,7 @@ int ansi_puttext(int sx, int sy, int ex, int ey, void* buf)
ansi_sendstr("\n\n\n\n\n",ti.screenheight-ansi_row-1);
}
else {
char str[6];
sprintf(str,"\033[%dB",ti.screenheight-ansi_row-1);
ansi_sendstr(str,-1);
}
......@@ -801,6 +804,19 @@ void ansi_gotoxy(int x, int y)
}
/* Must need to move right then */
/* Check if we can use spaces */
if(x-ansi_col-1 < 4) {
int i;
/* If all the intervening cells are spaces with the current BG, we're good */
for(i=0; i<x-ansi_col-1; i++) {
if(ansivmem[y*ansi_cols+ansi_col+i-1]!=ansi_curr_attr | ' ')
break;
}
if(i==x-ansi_col-1) {
ansi_sendstr(" ",x-ansi_col-1);
return;
}
}
if(x==ansi_col+2)
strcpy(str,"\033[C");
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment