0.0.2d: Added BGA support, graphics!
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
#include <vga/vga.h>
|
||||
#include <stdio.h>
|
||||
#include <port_io.h>
|
||||
#include <new_tty.h>
|
||||
#include <fs/vfs.h>
|
||||
|
||||
#include <tty.h>
|
||||
|
||||
@ -18,6 +20,19 @@ void terminal_initialize(void)
|
||||
terminal_update_cursor();
|
||||
}
|
||||
|
||||
ssize_t tty_write(struct file* f, const char* buf, size_t size)
|
||||
{
|
||||
/*struct tty* tty = (struct tty*)f->private_data;*/
|
||||
|
||||
for (size_t i = 0; i < size; i++)
|
||||
{
|
||||
/*tty_putchar(tty, buf[i]);*/ /* do this when we have multiple TTY outputs & stuff */
|
||||
terminal_putchar(buf[i]);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
void terminal_get_cursor(int* row, int* column)
|
||||
{
|
||||
*row = (int) terminal_row;
|
||||
@ -106,7 +121,7 @@ void terminal_putchar(const char c)
|
||||
|
||||
return;
|
||||
}
|
||||
else if (uc == '\b')
|
||||
/*else if (uc == '\b')
|
||||
{
|
||||
if (terminal_column == 0)
|
||||
{
|
||||
@ -117,7 +132,7 @@ void terminal_putchar(const char c)
|
||||
}
|
||||
else
|
||||
{
|
||||
terminal_update_cursor(); /* For good measure */
|
||||
terminal_update_cursor();
|
||||
|
||||
return;
|
||||
}
|
||||
@ -131,6 +146,31 @@ void terminal_putchar(const char c)
|
||||
|
||||
terminal_update_cursor();
|
||||
|
||||
return;
|
||||
}*/
|
||||
else if (uc == '\b')
|
||||
{
|
||||
if (terminal_column == 0)
|
||||
{
|
||||
if (terminal_row > 0)
|
||||
{
|
||||
terminal_row--;
|
||||
terminal_column = VGA_WIDTH - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
terminal_update_cursor();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
terminal_column--;
|
||||
}
|
||||
|
||||
terminal_update_cursor();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user