⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alt_up_vga.h

📁 VGA Component for Altera SOPC Builder on DE2
💻 H
字号:
#ifndef __ALT_UP_CHARACTER_VGA_H__
#define __ALT_UP_CHARACTER_VGA_H__

#include <stddef.h>
#include <alt_types.h>

//////////////////////////////////////////////////////////////////////////////////////
// Pixel Mode Functions
//////////////////////////////////////////////////////////////////////////////////////

/**
 * @brief Draw a pixel in the location specified by <em>(x, y)</em> on the VGA monitor
 *
 * @param pixel	-- the pixel
 * @param x	-- the \em x coordinate
 * @param y	-- the \em y coordinate
 *
 * @return 0 for success, -1 for error (such as out of bounds)
 **/
int alt_up_vga_draw_pixel(alt_u32 pixel, unsigned x, unsigned y);

//////////////////////////////////////////////////////////////////////////////////////
// Character Mode Functions
//////////////////////////////////////////////////////////////////////////////////////
/**
 * @brief Draw a character to the location specified by <em>(x, y)</em> on the
 * VGA monitor with white color and transparent background
 *
 * @param ch -- the character to draw
 * @param x  -- the \em x coordinate
 * @param y  -- the \em y coordinate
 *
 * @return 0 for success, -1 for error (such as out of bounds)
 **/
int alt_up_vga_draw_char_1b(alt_u8 ch, unsigned x, unsigned y);

/* ************************************************************************
 * The following functions is not supported by the hardware currently. They  
 * will be supported in future releases.
 * ************************************************************************/

/**
 * @brief Draw a character to the location specified by <em>(x, y)</em> on the
 * VGA monitor by specifying the R, G, B value of the character (9-bit color
 * mode)
 *
 * @param ch  -- the character to draw
 * @param x  -- the \em x coordinate
 * @param y  -- the \em y coordinate
 * @param r  -- the Red value for the character foreground. Ranging from 0 to 7 (3 bits).
 * @param g  -- the Green color value for the character foreground. Ranging from 0 to 7 (3 bits). 
 * @param b  -- the Blue color value for the character foreground. Ranging from 0 to 7 (3 bits).
 *
 * @return 0 for success, -1 for error (coordinates out of boundary or invalid color values)
 **/
int alt_up_vga_draw_char_9b(alt_u8 ch, unsigned x, unsigned y, unsigned r, unsigned g, unsigned b);

/**
 * @brief Draw a character to the location specified by <em>(x, y)</em> on the
 * VGA monitor by specifying the foreground, background and its transparency
 * value of the character (8-bit color mode)
 *
 * @param ch  -- the character to draw
 * @param x  -- the \em x coordinate
 * @param y  -- the \em y coordinate
 * @param fg  -- the foreground color index, ranging from 0 to 15 (4 bits)
 * @param bg  -- the background color index, ranging from 0 to 15 (4 bits)
 * @param transparency  -- the Blue color value for the character foreground. Either 0 or 1 (1 bit).
 *
 * @return 0 for success, -1 for error (coordinates out of boundary or invalid color values)
 **/
int alt_up_vga_draw_char_8b(alt_u8 ch, unsigned x, unsigned y, unsigned fg, unsigned bg, unsigned transparency);

/**
 * @brief Draw a character to the location specified by <em>(x, y)</em> on the
 * VGA monitor by specifying the foreground color index of the character (4-bit
 * color mode)
 *
 * @param ch  -- the character to draw
 * @param x  -- the \em x coordinate
 * @param y  -- the \em y coordinate
 * @param fg  -- the foreground color index, ranging from 0 to 15 (4 bits)
 *
 * @return 0 for success, -1 for error (coordinates out of boundary or invalid color values)
 **/
int alt_up_vga_draw_char_4b(alt_u8 ch, unsigned x, unsigned y, unsigned fg);
#endif /* __ALT_UP_CHARACTER_VGA_H__ */


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -