idk what this is but it works

This commit is contained in:
spikey 2024-02-18 00:21:22 -05:00
parent fdd2244198
commit 60059ca578
2 changed files with 11 additions and 9 deletions

View File

@ -9,31 +9,31 @@ vga_write(s8 *sequence, s16 size, s8 flags)
for (s16 i = 0; i <= VGA_SIZE; i++) { for (s16 i = 0; i <= VGA_SIZE; i++) {
vga_vidmem[i] = sequence[using_size + i]; vga_vidmem[i] = sequence[using_size + i];
vga_vidmem[++i] = flags; vga_vidmem[++i] = flags; }
}
unused = 2001; unused = 4001;
return; return;
} }
s16 needed_space = (size + unused) * 2 - VGA_SIZE; s16 needed_space = size * 2 + unused - VGA_SIZE;
if (needed_space >= 0) { if (needed_space >= 0) {
for (s16 i = 0; i <= VGA_SIZE - needed_space; i++) { for (s16 i = 0; i <= VGA_SIZE - needed_space; i++) {
vga_vidmem[i] = vga_vidmem[i++ + needed_space]; vga_vidmem[i] = vga_vidmem[((needed_space / 2) - (needed_space / 2) % 2) + i];
} }
unused = VGA_SIZE - needed_space; unused = VGA_SIZE - needed_space;
} }
for (s16 i = 0; i < size; i++) { for (s16 i = 0; i < size; i++) {
vga_vidmem[unused * 2] = sequence[i]; vga_vidmem[unused++] = sequence[i];
vga_vidmem[(unused++ * 2) + 1] = flags; vga_vidmem[unused++] = flags;
} }
} }
void void
vga_clearscreen(void) vga_clearscreen(void)
{ {
unused = 0;
for (s16 i = 0; i <= VGA_SIZE; i++) { for (s16 i = 0; i <= VGA_SIZE; i++) {
vga_vidmem[i] = 0; vga_vidmem[i] = 0;
} }

View File

@ -4,9 +4,11 @@ void
sysinit(void) sysinit(void)
{ {
vga_clearscreen(); vga_clearscreen();
for (s16 i = 0; i < 100; i++) { vga_write("Om Smert.", 9, 0x0F);
vga_write("Om Smarter.", 11, 0x0F);
for (s16 i = 0; i < 99; i++) {
vga_write("Om Smart.", 9, 0x0F); vga_write("Om Smart.", 9, 0x0F);
vga_write("Om Smarter.", 11, 0x0F); vga_write("Om Smarter.", 11, 0x0F);
} }
vga_write("fish stick.", 10, 0x07); vga_write("fish stick", 10, 0x07);
} }