From 2be70c3b7c3cb806614318858090c039bdfd4fc5 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 7 Feb 2015 16:56:02 -0500 Subject: fix RNG with zero seed, rename VGA->GFX --- drivers/include/gfx.h | 40 ++++++++++++++++++++++++++++++++++++++++ drivers/include/vga.h | 44 -------------------------------------------- 2 files changed, 40 insertions(+), 44 deletions(-) create mode 100644 drivers/include/gfx.h delete mode 100644 drivers/include/vga.h (limited to 'drivers/include') diff --git a/drivers/include/gfx.h b/drivers/include/gfx.h new file mode 100644 index 0000000..bafd7a3 --- /dev/null +++ b/drivers/include/gfx.h @@ -0,0 +1,40 @@ +#include + +enum vga_color_t { + VGA_BLACK = 0, + VGA_BLUE = 1, + VGA_GREEN = 2, + VGA_CYAN = 3, + VGA_RED = 4, + VGA_MAGENTA = 5, + VGA_BROWN = 6, + VGA_LIGHT_GRAY = 7, + VGA_DARK_GRAY = 8, + VGA_LIGHT_BLUE = 9, + VGA_LIGHT_GREEN = 10, + VGA_LIGHT_CYAN = 11, + VGA_LIGHT_RED = 12, + VGA_LIGHT_MAGENTA = 13, + VGA_LIGHT_BROWN = 14, + VGA_WHITE = 15 +}; + +#define VGA_WIDTH 80 +#define VGA_HEIGHT 25 + +#define VGA_MAKE_COLOR(fg, bg) (fg | bg << 4) +#define VGA_MAKE_ENTRY(ch, col) (((uint16_t)ch)|((uint16_t)col<<8)) +#define VGA_RGBPACK(r, g, b) ((r << 16)|(g << 8)|(b << 0)) + +#define GFX_WHITE 0xFFFFFF +#define GFX_BLACK 0x000000 + +struct vbe_info_t; + +void gfx_init(struct vbe_info_t *vbe_mode_info); + +void gfx_drawpixel(int x, int y, uint32_t color); + +void gfx_clear(uint32_t color); + +extern const uint16_t *gfx_width, *gfx_height; diff --git a/drivers/include/vga.h b/drivers/include/vga.h deleted file mode 100644 index 8ea478b..0000000 --- a/drivers/include/vga.h +++ /dev/null @@ -1,44 +0,0 @@ -#include - -enum vga_color_t { - VGA_BLACK = 0, - VGA_BLUE = 1, - VGA_GREEN = 2, - VGA_CYAN = 3, - VGA_RED = 4, - VGA_MAGENTA = 5, - VGA_BROWN = 6, - VGA_LIGHT_GRAY = 7, - VGA_DARK_GRAY = 8, - VGA_LIGHT_BLUE = 9, - VGA_LIGHT_GREEN = 10, - VGA_LIGHT_CYAN = 11, - VGA_LIGHT_RED = 12, - VGA_LIGHT_MAGENTA = 13, - VGA_LIGHT_BROWN = 14, - VGA_WHITE = 15 -}; - -#define VGA_WIDTH 80 -#define VGA_HEIGHT 25 - -#define VGA_SEQ_INDEX 0x3C4 -#define VGA_SEQ_DATA 0x3C5 -#define VGA_GC_INDEX 0x3CE -#define VGA_GC_DATA 0x3CF -#define VGA_CRTC_INDEX 0x3D4 -#define VGA_CRTC_DATA 0x3D5 - -#define VGA_MAKE_COLOR(fg, bg) (fg | bg << 4) -#define VGA_MAKE_ENTRY(ch, col) (((uint16_t)ch)|((uint16_t)col<<8)) -#define VGA_RGBPACK(r, g, b) ((r << 16)|(g << 8)|(b << 0)) - -struct vbe_info_t; - -void vga_init(struct vbe_info_t *vbe_mode_info); - -void vga_drawpixel(int x, int y, uint32_t color); - -void vga_clear(uint32_t color); - -extern const uint16_t *vga_width, *vga_height; -- cgit v1.1