Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate screen buffer #244

Draft
wants to merge 2 commits into
base: xterm-emu
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions kermit/k95/ckcmai.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,12 +1235,12 @@ int os2pm = 0; /* OS/2 Presentation Manager flag */
#ifdef OS2
#include "ckocon.h"
#ifdef KUI
int tt_rows[VNUM] = {24,24,25,1}; /* Rows (height) */
int tt_cols[VNUM] = {80,80,80,80}; /* Columns (width) */
int tt_rows[VNUM] = {24,24,24,25,1}; /* Rows (height) */
int tt_cols[VNUM] = {80,80,80,80,80}; /* Columns (width) */
int cmd_rows = 24, cmd_cols = 80; /* Command/console screen dimensions */
#else /* KUI */
int tt_rows[VNUM] = {-1,24,25,1}; /* Rows (height) */
int tt_cols[VNUM] = {-1,80,80,80}; /* Columns (width) */
int tt_rows[VNUM] = {-1,24,24,25,1}; /* Rows (height) */
int tt_cols[VNUM] = {-1,80,80,80,80}; /* Columns (width) */
int cmd_rows = -1, cmd_cols = -1; /* Command/console screen dimensions */
#endif /* KUI */
int k95stdio = 0; /* Stdio threads */
Expand Down
13 changes: 9 additions & 4 deletions kermit/k95/ckctel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4814,10 +4814,15 @@ tn_xdoop(z, echo, fn) CHAR z; int echo; int (*fn)();
#ifndef NOLOCAL
if (tcp_incoming) {
#ifdef OS2
tt_cols[VTERM] = w;
tt_rows[VTERM] = h;
VscrnSetWidth(VTERM, w);
VscrnSetHeight(VTERM, h+(tt_status[VTERM]?1:0));
tt_cols[VTERM_A] = w;
tt_rows[VTERM_A] = h;
VscrnSetWidth(VTERM_A, w);
VscrnSetHeight(VTERM_A, h+(tt_status[VTERM_A]?1:0));

tt_cols[VTERM_B] = w;
tt_rows[VTERM_B] = h;
VscrnSetWidth(VTERM_B, w);
VscrnSetHeight(VTERM_B, h+(tt_status[VTERM_B]?1:0));
#else /* OS2 */
tt_cols = w;
tt_rows = h;
Expand Down
46 changes: 27 additions & 19 deletions kermit/k95/ckoco2.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ extern int OSVer;
#include "ckokey.h"

videobuffer vscrn[VNUM] = {{0,0,0,0,0,0,{0,0},0,-1,-1,-1,-1,{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},0,0},
{0,0,0,0,0,0,{0,0},0,-1,-1,-1,-1,{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},0,0},
{0,0,0,0,0,0,{0,0},0,-1,-1,-1,-1,{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},0,0},
{0,0,0,0,0,0,{0,0},0,-1,-1,-1,-1,{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},0,0},
{0,0,0,0,0,0,{0,0},0,-1,-1,-1,-1,{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},0,0}};
Expand Down Expand Up @@ -1486,8 +1487,11 @@ Set132Cols( int mode )
}


if (mode == VTERM)
VscrnSetWidth( VTERM, 132 );
if (IS_VTERM(mode)) {
VscrnSetWidth(VTERM_A, 132);
VscrnSetWidth(VTERM_B, 132);
VscrnSetHeight( mode == VTERM_A ? VTERM_B : mode, mi.row );
}
else if ( tt_modechg == TVC_ENA )
VscrnSetWidth( mode, mi.col );
else if ( tt_modechg == TVC_W95 )
Expand Down Expand Up @@ -1560,9 +1564,11 @@ Set80Cols( int mode )
return 1;
}

if ( mode == VTERM )
VscrnSetWidth( VTERM, 80 );
else if ( tt_modechg == TVC_ENA )
if ( mode == VTERM_A || mode == VTERM_B ) {
VscrnSetWidth(VTERM_A, 80);
VscrnSetWidth(VTERM_B, 80);
VscrnSetHeight( mode == VTERM_A ? VTERM_B : mode, mi.row ) ;
} else if ( tt_modechg == TVC_ENA )
VscrnSetWidth( mode, mi.col );
else if ( tt_modechg == TVC_W95 )
VscrnSetWidth( mode, 80 );
Expand Down Expand Up @@ -1712,7 +1718,7 @@ SetCols( int mode )
}

#ifdef OLDDIRTY
static int isdirty[VNUM] = {0,0,0,0} ;
static int isdirty[VNUM] = {0,0,0,0,0} ;
#endif

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -2838,17 +2844,17 @@ VscrnGetCurPos( BYTE vmode )
}


static viocell * cellmem[VNUM] = { NULL, NULL, NULL, NULL } ;
static unsigned short * attrmem[VNUM] = { NULL, NULL, NULL, NULL } ;
static unsigned short * hyperlinkmem[VNUM] = { NULL, NULL, NULL, NULL } ;
static viocell * cellmem[VNUM] = { NULL, NULL, NULL, NULL, NULL } ;
static unsigned short * attrmem[VNUM] = { NULL, NULL, NULL, NULL, NULL } ;
static unsigned short * hyperlinkmem[VNUM] = { NULL, NULL, NULL, NULL, NULL } ;

/*---------------------------------------------------------------------------*/
/* VscrnSetBufferSize */
/*---------------------------------------------------------------------------*/
ULONG
VscrnSetBufferSize( BYTE vmode, ULONG newsize )
{
static ULONG oldsize[VNUM]={0,0,0,0} ;
static ULONG oldsize[VNUM]={0,0,0,0,0} ;
int i ;
videobuffer TmpScrn ;
videoline * line ;
Expand Down Expand Up @@ -3864,7 +3870,8 @@ TermScrnUpd( void * threadinfo)

rc = CreateVscrnTimerSem( TRUE );
rc = CreateVscrnMuxWait(VCMD) ;
rc = CreateVscrnMuxWait(VTERM) ;
rc = CreateVscrnMuxWait(VTERM_A) ;
rc = CreateVscrnMuxWait(VTERM_B) ;
rc = CreateVscrnMuxWait(VCS) ;

rc = StartVscrnTimer( tt_update );
Expand Down Expand Up @@ -4539,7 +4546,8 @@ TermScrnUpd( void * threadinfo)
#endif /* NT */

CloseVscrnMuxWait(VCMD) ;
CloseVscrnMuxWait(VTERM) ;
CloseVscrnMuxWait(VTERM_A) ;
CloseVscrnMuxWait(VTERM_B) ;
CloseVscrnMuxWait(VCS) ;
CloseVscrnTimerSem() ;
free(thecells) ;
Expand Down Expand Up @@ -4841,10 +4849,10 @@ VscrnInit( BYTE vmode )
#endif /* KUI */
}

if ( vmode == VTERM )
if ( IS_VTERM(vmode) )
{
if (!scrninitialized[VTERM]) {
scrninitialized[VTERM] = 1;
if (!scrninitialized[vmode]) {
scrninitialized[vmode] = 1;
attribute = defaultattribute = colornormal;
underlineattribute = colorunderline ;
reverseattribute = colorreverse ;
Expand All @@ -4853,10 +4861,10 @@ VscrnInit( BYTE vmode )
borderattribute = colorborder ;
updmode = tt_updmode ; /* Set screen update mode */
}
if ( marginbot == VscrnGetHeight(VTERM)-(tt_status[vmode]?1:0) ||
VscrnGetHeight(VTERM) < 0 ||
marginbot > tt_rows[VTERM] )
marginbot = tt_rows[VTERM];
if ( marginbot == VscrnGetHeight(vmode)-(tt_status[vmode]?1:0) ||
VscrnGetHeight(vmode) < 0 ||
marginbot > tt_rows[vmode] )
marginbot = tt_rows[vmode];
}

VscrnSetWidth( vmode, tt_cols[vmode] ) ;
Expand Down
Loading