vga.h (1089B)
1 #ifndef VGA_H 2 #define VGA_H 3 4 #include <stdint.h> 5 6 // VGA mem addr 7 #define VGA_TEXT_BUFFER 0xB8000 // Text mode video memory 8 #define VGA_GRAPHICS_BUFFER 0xA0000 // Graphics mode video memory 9 10 // VGA mode 13h dimensions 11 #define VGA_WIDTH 320 12 #define VGA_HEIGHT 200 13 14 // VGA register IO ports 15 #define VGA_AC_INDEX 0x3C0 // attribute controller index 16 #define VGA_AC_WRITE 0x3C0 // attribute controller write 17 #define VGA_AC_READ 0x3C1 // attribute controller read 18 #define VGA_MISC_WRITE 0x3C2 // miscellaneous output register 19 #define VGA_SEQ_INDEX 0x3C4 // sequencer index 20 #define VGA_SEQ_DATA 0x3C5 // sequencer data 21 #define VGA_GC_INDEX 0x3CE // graphics controller index 22 #define VGA_GC_DATA 0x3CF // graphics controller data 23 #define VGA_CRTC_INDEX 0x3D4 // CRT controller index 24 #define VGA_CRTC_DATA 0x3D5 // CRT controller data 25 #define VGA_INSTAT_READ 0x3DA // input status read 26 27 void vga_set_mode_13h(void); 28 void vga_put_pixel(uint16_t x, uint16_t y, uint8_t color); 29 void vga_clear_screen(uint8_t color); 30 31 #endif