other changes
This commit is contained in:
parent
1841db88b1
commit
6dc29e41ee
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
mkdir -p obj/
|
||||
|
||||
INCLUDE="-Isys/drv/vga/include -Isys/include"
|
||||
CFLAGS="-g -m32 -ffreestanding -Wall -Wextra -pedantic -nostdlib $INCLUDE"
|
||||
ASFLAGS="-felf32"
|
||||
|
|
|
@ -10,7 +10,7 @@ s32 unused = 0;
|
|||
s8 *vga_vidmem = (s8 *)0xb8000;
|
||||
s8 vga_unused = 0;
|
||||
|
||||
void vga_write(s8 *, s32, s8);
|
||||
void vga_write(s8 *, s16, s8);
|
||||
void vga_clearscreen(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
#include <video.h>
|
||||
|
||||
void
|
||||
vga_write(s8 *sequence, s32 size, s8 flags)
|
||||
vga_write(s8 *sequence, s16 size, s8 flags)
|
||||
{
|
||||
if (size > VGA_TEXT_SIZE) {
|
||||
s32 using_size = size - VGA_SIZE;
|
||||
s16 using_size = size - VGA_TEXT_SIZE;
|
||||
|
||||
for (s32 i = 0; i <= VGA_SIZE; i++) {
|
||||
for (s16 i = 0; i <= VGA_SIZE; i++) {
|
||||
vga_vidmem[i] = sequence[using_size + i];
|
||||
vga_vidmem[++i] = flags;
|
||||
}
|
||||
|
@ -16,6 +16,15 @@ vga_write(s8 *sequence, s32 size, s8 flags)
|
|||
return;
|
||||
}
|
||||
|
||||
s16 needed_space = size + unused - VGA_TEXT_SIZE;
|
||||
if (needed_space >= 0) {
|
||||
for (s16 i = 0; i <= VGA_SIZE - needed_space; i++) {
|
||||
vga_vidmem[i] = vga_vidmem[i + needed_space];
|
||||
}
|
||||
|
||||
unused = VGA_SIZE - needed_space;
|
||||
}
|
||||
|
||||
while (*sequence != '\0') {
|
||||
vga_vidmem[unused++] = *sequence;
|
||||
*sequence++;
|
||||
|
@ -26,7 +35,7 @@ vga_write(s8 *sequence, s32 size, s8 flags)
|
|||
void
|
||||
vga_clearscreen(void)
|
||||
{
|
||||
for (int i = 0; i <= VGA_SIZE; i++) {
|
||||
for (s16 i = 0; i <= VGA_SIZE; i++) {
|
||||
vga_vidmem[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
#include <types.h>
|
||||
|
||||
void
|
||||
sysinit(void)
|
||||
{
|
||||
vga_clearscreen();
|
||||
vga_write("Om Smart.", 9, 0x0F);
|
||||
vga_write("Om Smarter.", 11, 0x0F);
|
||||
vga_write("fish stick.", 10, 0x0F);
|
||||
for (s16 i = 0; i <= 2000; i += 20) {
|
||||
vga_write("Om Smart!", 9, 0x0F);
|
||||
vga_write("Om Smarter!", 11, 0x0F);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue