// === CONSTANTS ===
#define NUM_VTS 4
#define MAX_INPUT_CHARS 64
-#define VT_SCROLLBACK 4 // 4 Screens of text
+#define VT_SCROLLBACK 1 // 4 Screens of text
#define DEFAULT_OUTPUT "/Devices/VGA"
#define DEFAULT_INPUT "/Devices/PS2Keyboard"
#define DEFAULT_WIDTH 80
gVT_Terminals[i].WritePos = 0;
gVT_Terminals[i].ViewPos = 0;
- gVT_Terminals[i].Buffer = malloc( DEFAULT_WIDTH*DEFAULT_HEIGHT*sizeof(tVT_Char) );
- memset( gVT_Terminals[i].Buffer, 0, DEFAULT_WIDTH*DEFAULT_HEIGHT*sizeof(tVT_Char) );
+ gVT_Terminals[i].Buffer = malloc( DEFAULT_WIDTH*DEFAULT_HEIGHT*VT_SCROLLBACK*sizeof(tVT_Char) );
+ memset( gVT_Terminals[i].Buffer, 0, DEFAULT_WIDTH*DEFAULT_HEIGHT*VT_SCROLLBACK*sizeof(tVT_Char) );
gVT_Terminals[i].Name[0] = '0'+i;
gVT_Terminals[i].Name[1] = '\0';
base = Term->Width*(Term->Height*VT_SCROLLBACK-1);
// Scroll Back
- memcpy( Term->Text, &Term->Text[Term->Width], base*sizeof(tVT_Char) );
+ memcpy(
+ Term->Text,
+ &Term->Text[Term->Width],
+ Term->Width*(Term->Height-1)*VT_SCROLLBACK*sizeof(tVT_Char)
+ );
// Clear last row
for( i = 0; i < Term->Width; i ++ )