Code: Select all
type
TAttrChar = packed record
chChar: Char;
btAttribute: Byte;
end;
PAttrChar = ^TAttrChar;
var
btAttribute: Byte;
procedure ClearScreen();
var
acChar: TAttrChar;
begin
acChar.chChar:= Char($20);
acChar.btAttribute:= btAttribute;
FillWord(pVideoMemory^,25*80,Word(acChar));
end;
Code: Select all
void cls()
{
unsigned blank;
int i;
/* Again, we need the 'short' that will be used to
* represent a space with color */
blank = 0x20 | (attrib << 8);
/* Sets the entire screen to spaces in our current
* color */
for(i = 0; i < 25; i++)
memsetw (textmemptr + i * 80, blank, 80);
/* Update out virtual cursor, and then move the
* hardware cursor */
csr_x = 0;
csr_y = 0;
move_csr();
}