MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Print

Method Print

Kernel/src/videoconsole.cpp:37–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void VideoConsole::Print(char c, uint8_t r, uint8_t g, uint8_t b){
38 switch(c){
39 case '\n':
40 cursorX = 0;
41 cursorY++;
42 break;
43 case '\b':
44 cursorX--;
45 if(cursorX < 0){
46 cursorX = widthInCharacters - 1;
47 cursorY--;
48 if(cursorY < 0){
49 cursorX = cursorY = 0;
50 }
51 }
52 break;
53 default:
54 characterBuffer[cursorY * widthInCharacters + cursorX] = {c, r, g, b};
55 cursorX++;
56 break;
57 }
58 if(cursorX >= widthInCharacters){
59 cursorX = 0;
60 cursorY++;
61 }
62 if(cursorY >= heightInCharacters) Scroll();
63}
64
65void VideoConsole::Clear(uint8_t r, uint8_t g, uint8_t b){
66 memset(characterBuffer,0, widthInCharacters*heightInCharacters*sizeof(ConsoleCharacter));

Callers

nothing calls this directly

Calls 2

PrintFunction · 0.85
ScrollFunction · 0.50

Tested by

no test coverage detected