You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
704 B

#define __LIBRARY__
#include<stdio.h>
#include<unistd.h>
#include<errno.h>
#include <stdlib.h>
#include <assert.h>
#define vga_graph_memstart 0xA0000
#define vga_graph_memsize 64000
#define cursor_side 6
#define vga_width 320
#define vga_height 200
int i, j, x_pos = 20, y_pos = 20;
char* p = vga_graph_memstart;
_always_inline _syscall0(int, init_graphics)
void test_graphics() {
init_graphics();
for (i = 0; i < vga_graph_memsize; i++)
*p++ = 3;
for (i = x_pos - cursor_side; i <= x_pos + cursor_side; i++)
for (j = y_pos - cursor_side; j <= y_pos + cursor_side; j++)
{
p = (char*)vga_graph_memstart + j * vga_width + i;
*p = 12;
}
}
int main(void)
{
test_graphics();
return 0;
}