summaryrefslogtreecommitdiff
path: root/kernel/Helpers/memPrint.cpp
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-07-28 14:19:00 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-07-28 14:19:00 +0400
commite0c565f7ff7620dca9dfc6c607f4798f5291c7bf (patch)
treec18099687db0202e32ae47f4c991b895191f030e /kernel/Helpers/memPrint.cpp
parentaac010a9e30e479968e277ebdaf41ad366a77098 (diff)
Go back to C and adapt codeHEADmasterdevelop
Diffstat (limited to 'kernel/Helpers/memPrint.cpp')
-rw-r--r--kernel/Helpers/memPrint.cpp125
1 files changed, 0 insertions, 125 deletions
diff --git a/kernel/Helpers/memPrint.cpp b/kernel/Helpers/memPrint.cpp
deleted file mode 100644
index 179b821..0000000
--- a/kernel/Helpers/memPrint.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-#include "./memPrint.hpp"
-
-
-
-//Constructor
-memPrint::memPrint(){
-
- //Initialise position
- this->m_cursorX=0;
- this->m_cursorY=0;
-
- //Initialise color
- this->setBackground(BLACK);
- this->setForeground(WHITE);
-
-}
-
-//Destructor
-memPrint::~memPrint(){
-
-}
-
-
-//Move cursor
-void memPrint::updateCursor(){
-
-
- //Update X axis
- this->m_cursorX++;
-
- //Check X value
- if(this->m_cursorX >= MAXCURSORX){
-
- //If X is out of the screen
- this->m_cursorX=0;
-
- //Update Y
- this->m_cursorY++;
-
- //Check Y value
- if(this->m_cursorY >= MAXCURSORY){
-
- //If Y is out of the screen
- this->scrollUp(1);
-
- //Decrease Y value
- this->m_cursorY--;
- }
-
-
- }
-
-
-}
-
-//Change character background color
-void memPrint::setBackground(colorBios color){
- u8 newColor= (color << 4);
- this->m_colors= newColor | ((this->m_colors << 4) >> 4);
-}
-
-//Change character color
-void memPrint::setForeground(colorBios color){
- u8 newColor= color;
- this->m_colors= newColor | ((this->m_colors >> 4) << 4);
-}
-
-//Print a char
-void memPrint::putChar(u8 character){
-
- //Get the adresse with the cursor position
- char *adress= ((char *) MEMPRINTSTARTADR) + (this->m_cursorX * 2) + (this->m_cursorY * MAXCURSORX * 2);
-
- //Copy the character
- *adress=character;
-
- //Copy his attribute
- adress++;
- *adress=this->m_colors;
-
- //Update cursor position
- this->updateCursor();
-
-}
-
-
-//Print a char*
-void memPrint::print(char *str){
- while(*str!=0x0){
- this->putChar(*str);
- str++;
- }
-}
-
-//Clear the screen
-void memPrint::clear(){
- this->scrollUp(MAXCURSORY);
-}
-
-//Scroll up "number" times
-void memPrint::scrollUp(u8 number){
-
- //Get number of adress (char & his attribute) to scroll
- int nbAdrToScroll=number*MAXCURSORX*2;
-
-
- //Scroll all of the characters and attributes
- for(int i=0;i!=MAXCURSORX*2*MAXCURSORY;i++){
-
- //Get source character or attribute
- char* source=(((char *)MEMPRINTSTARTADR) + i);
-
- //Get destination character or attribute
- char* dest=source-nbAdrToScroll;
-
- //Check if destination is out of the screen
- if(dest >= (char *)MEMPRINTSTARTADR)
- *dest=*source;
-
- //Remove data from source
- *source=0x0;
-
- }
-
-}