Improved (more like fixed) a couple things

This commit is contained in:
cowmonk 2025-04-17 23:21:59 -07:00
parent 16103b0011
commit 4a6c2e2656
2 changed files with 4 additions and 4 deletions

View file

@ -37,7 +37,7 @@ term_putentryat(char c, uint8_t color, size_t x, size_t y)
void void
term_putchar(char c) term_putchar(char c)
{ {
term_putentryat(c, term_color, term_row); term_putentryat(c, term_color, term_col, term_row);
if (++term_col == VGA_WIDTH) { if (++term_col == VGA_WIDTH) {
term_col = 0; term_col = 0;
if (++term_row == VGA_HEIGHT) { if (++term_row == VGA_HEIGHT) {
@ -49,7 +49,7 @@ term_putchar(char c)
void void
term_writestr(const char* data) term_writestr(const char* data)
{ {
for (size_t i = 0; i < strlen(data); i++) { for (size_t i = 0; data[i] != '\0'; i++) {
term_putchar(data[i]); term_putchar(data[i]);
} }
} }

View file

@ -41,10 +41,10 @@ vga_entry(unsigned char uc, uint8_t color)
#define VGA_HEIGHT 25 #define VGA_HEIGHT 25
#define VGA_MEMORY 0xB8000 /* VGA memory location */ #define VGA_MEMORY 0xB8000 /* VGA memory location */
void term init(void); void term_init(void);
void term_setcolor(uint8_t color); void term_setcolor(uint8_t color);
void term_putentryat(char c, uint8_t color, size_t x, size_t y); void term_putentryat(char c, uint8_t color, size_t x, size_t y);
void term_putchar(char c); void term_putchar(char c);
void term_writestr(const char* data); void term_writestr(const char* data);
#endif #VGA_H #endif // VGA_H