fixing print function slowly but surely

This commit is contained in:
shockrahwow 2019-01-23 01:12:36 -08:00
parent 39c96dd3c0
commit e2315fc3cc
2 changed files with 6 additions and 23 deletions

View File

@ -5,21 +5,6 @@
// Memory at this section is divided into 16-bit cells
// | 15-8 | 7-4 | 0-3
// | Asci | FG | BG
// The following colors are available(from 0x0 to 0xF):
// Black Blue Green Cyan Red Magenta
// Brown LightGrey DarkGrey LightBlue LightGreen
// LightCyan LightRed LightMagenta LightBrown White
/*
enum typedef Colors{
Black, Blue, Green,
Cyan, Red, Magenta,
Brown, LightGrey, DarkGrey,
LightBlue, LightGreen, LightCyan,
LightRed, LightMagenta, LightBrown,
White,
};
*/
#include "framebuffer.h"
static char* Frame_Buffer = (char*)FRAME_BUFFER_ADDR;
@ -38,15 +23,12 @@ void clear_buffer() {
*fp = 0x00;
}
}
static void print(char* str) {
unsigned idx = 0;
char* c = str;
while(c != 0x00) {
write_cell(idx, *c, Green, White);
idx += 2;
void print(char* str) {
for(unsigned i =0;i<strlen(str);i+=2) {
write_cell(i, str[i], Green, White);
}
}
void yote() {
print(" JankOS ");
print("asdf");
}

View File

@ -1,3 +1,4 @@
#include "stl/string.h"
#define COLUMNS 80
#define ROWS 25
#define AREA ( COLUMNS * ROWS )
@ -25,6 +26,6 @@ void write_cell(unsigned cell, char c , char fg, char bg);
void clear_buffer();
static void print(char* str);
void print(char* str);
void yote();