svnno****@sourc*****
svnno****@sourc*****
2010年 12月 21日 (火) 13:11:15 JST
Revision: 4243 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4243 Author: doda Date: 2010-12-21 13:11:15 +0900 (Tue, 21 Dec 2010) Log Message: ----------- DECFI/DECBI 制御シーケンスに対応。 Modified Paths: -------------- trunk/teraterm/teraterm/buffer.c trunk/teraterm/teraterm/buffer.h trunk/teraterm/teraterm/vtterm.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/buffer.c =================================================================== --- trunk/teraterm/teraterm/buffer.c 2010-12-20 08:00:10 UTC (rev 4242) +++ trunk/teraterm/teraterm/buffer.c 2010-12-21 04:11:15 UTC (rev 4243) @@ -3432,3 +3432,57 @@ BuffUpdateRect(XStart, CursorY, XStart+Count, CursorY); } + +void BuffScrollLeft(int count) +{ + int i; + LONG Ptr; + + UpdateStr(); + + Ptr = GetLinePtr(PageStart); + for (i = 1; i < NumOfLines - StatusLine; i++) { + memmove(&(CodeBuff[Ptr]), &(CodeBuff[Ptr+count]), NumOfColumns - count); + memmove(&(AttrBuff[Ptr]), &(AttrBuff[Ptr+count]), NumOfColumns - count); + memmove(&(AttrBuff2[Ptr]), &(AttrBuff2[Ptr+count]), NumOfColumns - count); + memmove(&(AttrBuffFG[Ptr]), &(AttrBuffFG[Ptr+count]), NumOfColumns - count); + memmove(&(AttrBuffBG[Ptr]), &(AttrBuffBG[Ptr+count]), NumOfColumns - count); + + memset(&(CodeBuff[Ptr+NumOfColumns-count]), 0x20, count); + memset(&(AttrBuff[Ptr+NumOfColumns-count]), AttrDefault, count); + memset(&(AttrBuff2[Ptr+NumOfColumns-count]), AttrDefault, count); + memset(&(AttrBuffFG[Ptr+NumOfColumns-count]), AttrDefaultFG, count); + memset(&(AttrBuffBG[Ptr+NumOfColumns-count]), AttrDefaultBG, count); + + Ptr = NextLinePtr(Ptr); + } + + BuffUpdateRect(0, 0, NumOfColumns-1, NumOfLines-1); +} + +void BuffScrollRight(int count) +{ + int i; + LONG Ptr; + + UpdateStr(); + + Ptr = GetLinePtr(PageStart); + for (i = 1; i < NumOfLines - StatusLine; i++) { + memmove(&(CodeBuff[Ptr+count]), &(CodeBuff[Ptr]), NumOfColumns - count); + memmove(&(AttrBuff[Ptr+count]), &(AttrBuff[Ptr]), NumOfColumns - count); + memmove(&(AttrBuff2[Ptr+count]), &(AttrBuff2[Ptr]), NumOfColumns - count); + memmove(&(AttrBuffFG[Ptr+count]), &(AttrBuffFG[Ptr]), NumOfColumns - count); + memmove(&(AttrBuffBG[Ptr+count]), &(AttrBuffBG[Ptr]), NumOfColumns - count); + + memset(&(CodeBuff[Ptr]), 0x20, count); + memset(&(AttrBuff[Ptr]), AttrDefault, count); + memset(&(AttrBuff2[Ptr]), AttrDefault, count); + memset(&(AttrBuffFG[Ptr]), AttrDefaultFG, count); + memset(&(AttrBuffBG[Ptr]), AttrDefaultBG, count); + + Ptr = NextLinePtr(Ptr); + } + + BuffUpdateRect(0, 0, NumOfColumns-1, NumOfLines-1); +} Modified: trunk/teraterm/teraterm/buffer.h =================================================================== --- trunk/teraterm/teraterm/buffer.h 2010-12-20 08:00:10 UTC (rev 4242) +++ trunk/teraterm/teraterm/buffer.h 2010-12-21 04:11:15 UTC (rev 4243) @@ -76,6 +76,8 @@ void BuffSelectedEraseHomeToCur(); void BuffSelectedEraseScreen(); void BuffSelectEraseBox(int XStart, int YStart, int XEnd, int YEnd); +void BuffScrollLeft(int count); +void BuffScrollRight(int count); extern int StatusLine; extern int CursorTop, CursorBottom; Modified: trunk/teraterm/teraterm/vtterm.c =================================================================== --- trunk/teraterm/teraterm/vtterm.c 2010-12-20 08:00:10 UTC (rev 4242) +++ trunk/teraterm/teraterm/vtterm.c 2010-12-21 04:11:15 UTC (rev 4243) @@ -1226,8 +1226,22 @@ /* no intermediate char */ case 0: switch (b) { + case '6': // DECBI + if (CursorX == 0) { + BuffScrollRight(1); + } + else { + CursorX--; + } case '7': SaveCursor(); break; case '8': RestoreCursor(); break; + case '9': // DECFI + if (CursorX == NumOfColumns-1) { + BuffScrollLeft(1); + } + else { + CursorX++; + } case '=': AppliKeyMode = TRUE; break; case '>': AppliKeyMode = FALSE; break; case 'D': /* IND */