Implemented Escape Sequences!!!!

This commit is contained in:
2024-05-28 20:42:03 +02:00
parent 74c38342d7
commit 7a2afbd653
8 changed files with 126 additions and 27 deletions
-9
View File
@@ -4,15 +4,6 @@
#include <memory/addresses.h>
#include <stdint.h>
#define BLACK 0x00000000 // 0
#define RED 0x00ff0000 // 1
#define GREEN 0x0000ff00 // 2
#define YELLOW 0x00ffff00 // 3
#define BLUE 0x000000ff // 4
#define MAGENTA 0x00ff00ff // 5
#define CYAN 0x0000ffff // 6
#define WHITE 0x00ffffff // 7
#define BG_COLOR 0x00010b17
#define FG_COLOR 0x00ebddf4
+3 -6
View File
@@ -8,9 +8,6 @@
#include <stdint.h>
#include <string.h>
uint32_t bgColor = BG_COLOR;
uint32_t fgColor = FG_COLOR;
// TODO: Make this check if it's a valid font
// TODO: Make it take a fileEntry_t?
uint8_t loadFont(char* filename) {
@@ -21,7 +18,7 @@ uint8_t loadFont(char* filename) {
}
// TODO: Reimplement larger text
void putcAt(char c, uint32_t x, uint32_t y) {
void drawChar(char c, uint32_t x, uint32_t y, uint32_t fgColor, uint32_t bgColor) {
// Font info
char* font = (char*)FONT_LOC;
uint8_t charWidth = *(uint8_t*)FONT_WIDTH;
@@ -65,7 +62,7 @@ void scroll() { // TODO: Make this faster (still kinda slow, but memcpy32() help
memcpy32((char*)address, (char*)(address - bytesPerLine), bytesPerLine);
}
uint32_t color = convertColor(bgColor);
uint32_t color = convertColor(terminal->bg);
uint8_t* lastLine = (uint8_t*)(vidmem + (lines-1) * bytesPerLine);
uint8_t bytesPerPx = (gfxMode->bpp+1) / 8;
@@ -80,7 +77,7 @@ void scroll() { // TODO: Make this faster (still kinda slow, but memcpy32() help
}
// TODO: Make this comply with the new terminal.h thing!
void clear() {
void clearScreen(uint32_t bgColor) {
uint8_t* vidmem = (uint8_t*)gfxMode->physicalBasePtr;
uint8_t bytesPerPx = (gfxMode->bpp+1) / 8;