ingnore invalid scancodes

This commit is contained in:
Eggert Jung
2025-04-28 01:49:09 +02:00
parent bccd23c0c6
commit 2c60b88849
4 changed files with 10 additions and 8 deletions

View File

@@ -51,9 +51,10 @@ void TextWindow::getPos(int& rel_x, int& rel_y) const {
}
void TextWindow::scrollUp(){
for(uint8_t row = from_row; row < to_row; row++){
for(uint8_t row = from_row; row < to_row-1; row++){
memmove(&CGA::TEXT_BUFFER_BASE[row*CGA::COLUMNS + from_col], &CGA::TEXT_BUFFER_BASE[(row+1)*CGA::COLUMNS + from_col], 2*(to_col-from_col));
}
memset(&CGA::TEXT_BUFFER_BASE[(to_row-1)*CGA::COLUMNS + from_col] , 0, 2*(to_col-from_col));
}
void TextWindow::print(const char* str, size_t length, CGA::Attribute attrib) {
@@ -76,7 +77,7 @@ void TextWindow::print(const char* str, size_t length, CGA::Attribute attrib) {
if(from_col+x_now >= to_col-1){
x_now = 0;
if(from_row + y_now >= to_row-1){
//TODO scrollUp()
scrollUp();
}
else{
y_now++;