1
This commit is contained in:
churl
2022-05-23 11:52:38 +02:00
parent c0ee06f21e
commit d6d071d6fd
3 changed files with 3 additions and 2 deletions

0
.gitignore vendored Executable file → Normal file
View File

View File

@ -3,7 +3,7 @@
// Can't initialize in constructor as memory management already needs working CGA for output // Can't initialize in constructor as memory management already needs working CGA for output
// NOTE: This has to be called when memorymanagement is active // NOTE: This has to be called when memorymanagement is active
void BufferedCGA::init(unsigned int pages) { void BufferedCGA::init(unsigned int pages) {
this->scrollback_buffer = new ScrollbackBuffer(ROWS, pages); this->scrollback_buffer = new ScrollbackBuffer(ROWS, pages); // No delete since it's only off when shutting the os down
this->screen_buffer = new CGA::cga_page_t; this->screen_buffer = new CGA::cga_page_t;
if (this->scrollback_buffer == NULL || this->screen_buffer == NULL) { if (this->scrollback_buffer == NULL || this->screen_buffer == NULL) {

View File

@ -20,9 +20,10 @@ public:
ScrollbackBuffer(unsigned char rows, unsigned char pages) ScrollbackBuffer(unsigned char rows, unsigned char pages)
: pos(0), pages(pages), rows(rows * pages) { : pos(0), pages(pages), rows(rows * pages) {
this->buffer = new CGA::cga_page_t[pages]; // Allocate with new because it's quite large this->buffer = new CGA::cga_page_t[pages]; // Allocate with new because it's quite large (and I want to use the allocator)
this->clear(); // Null out the buffer so no crap gets displayed this->clear(); // Null out the buffer so no crap gets displayed
} }
~ScrollbackBuffer() { ~ScrollbackBuffer() {
delete[] this->buffer; delete[] this->buffer;
} }