diff --git a/arch/textwindow.cc b/arch/textwindow.cc index de030de..0103137 100644 --- a/arch/textwindow.cc +++ b/arch/textwindow.cc @@ -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++; diff --git a/debug/output.h b/debug/output.h index 230a603..2d63bba 100644 --- a/debug/output.h +++ b/debug/output.h @@ -43,7 +43,8 @@ * possible that the debug output in a multi core system is displayed * on the wrong (previous) core. */ -#define DBG nullstream +#include "arch/lapic.h" +#define DBG dout[LAPIC::getID()] #include "../arch/core.h" #include "../device/textstream.h" diff --git a/device/ps2controller.cc b/device/ps2controller.cc index bf78986..f29638f 100644 --- a/device/ps2controller.cc +++ b/device/ps2controller.cc @@ -112,15 +112,15 @@ bool fetch(Key &pressed) { uint8_t status_reg = ctrl_port.inb(); if(status_reg & IS_MOUSE || !(status_reg & HAS_OUTPUT) ) return false; // TODO Remove mouse events from buffer + DBG_VERBOSE << "status: " << hex << static_cast(status_reg) << "\n" << flush; uint8_t out_buffer = data_port.inb(); + DBG_VERBOSE << "scancode: " << hex << static_cast(out_buffer) << "\n" << flush; pressed = key_decoder.decode(out_buffer); - - if (pressed.alt() || pressed.ctrl() || pressed.shift) { + if (pressed.alt() || pressed.ctrl() || pressed.shift || !pressed.valid()) return false; - } else return true; } diff --git a/main.cc b/main.cc index a545b91..c9b38e1 100644 --- a/main.cc +++ b/main.cc @@ -108,8 +108,8 @@ extern "C" int main_ap() { //uint8_t from = static_cast(LAPIC::getID()) * 20; //uint8_t to = from+20; //dout[LAPIC::getID()] = TextStream(from, to, 0, 6, false); - dout[LAPIC::getID()] << "test\n" << flush; - dout[LAPIC::getID()] << static_cast(LAPIC::getID()) << flush; + DBG << "test\n" << flush; + DBG << static_cast(LAPIC::getID()) << flush; return 0; }