head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2007.10.09.19.27.04; author madscientist159; state Exp; branches; next ; commitid 1b84470bd6064567; desc @@ 1.1 log @*** empty log message *** @ text @ #define VGA_LINES_PER_ROW 75 unsigned char vga_current_line = 0; unsigned char vga_current_row = 0; unsigned char VGAcolor; PutVGAChar(unsigned char CH, char color) { VGAcolor = color; WriteVGAData(CH); } WriteVGAData(Data) { Xuint32 VGAAddress; VGAAddress = (((vga_current_row * VGA_LINES_PER_ROW) + vga_current_line) << 18); // Character location VGAAddress = VGAAddress + (VGAcolor << 14); // 7 is the foreground color white VGAAddress = VGAAddress + (Data << 6); // The character to write WriteREG (XPAR_S3E_VGA_CHAR_DEV_0_BASEADDR,USER,0x0,VGAAddress); vga_current_line = vga_current_line + 1; if (vga_current_line > VGA_LINES_PER_ROW) { vga_current_line = 0; vga_current_row = vga_current_row + 1; } } WriteVGAString(char*STR, char color) { int i=0; Xuint32 VGAAddress; while (STR[i]!='\0') { VGAcolor = color; WriteVGAData(STR[i]); i++; } VGAcolor = color; WriteVGAData(0x20); } //---------------------------------------------------------------------------------- // // Colors are controlled through the lower four bits of the color parameter. // Bit zero (the LSB) controls the red portion of the color (on or off). // Bit one controls green, bit two controls blue. // Bit three, if set, inverts the character. // //---------------------------------------------------------------------------------- // Example Call: vga_current_row = 0; vga_current_line = 0; WriteVGAString("Testing VGA Generator Core",0x7); // White, noninverted@