rendered paste bodyunsigned short* videoram = (unsigned short*)0xB8000;int width = 80;int height = 25;void vgacon_init(){}void vgacon_clear(){ memset (videoram, 0, (( width * height) * 2)); /* a VGA character is 16bits wide */}void vgacon_scroll(int lines){ unsigned short size = lines * width; unsigned short *src = videoram + size; memcpy (videoram, src, ((width * height) - size)*2); /* a VGA character is 16bits wide */ memset ((unsigned short*)videoram + ((width * height) - size), 0, (size * 2));}void vgacon_putc(unsigned short x, unsigned short y, unsigned short character, unsigned short attributes){ unsigned short* where = videoram + ((width*x)+y); unsigned attr = attributes << 8; *where = character | attr;}