2 * \file tpl_drv_video.h
\r
3 * \brief Video Driver Interface Definitions
\r
4 * \note For AcessOS Version 1
\r
6 * Video drivers extend the common driver interface tpl_drv_common.h
\r
7 * and must support _at least_ the IOCtl numbers defined in this file
\r
8 * to be compatable with Acess.
\r
11 * As said, a compatable driver must implement these calls correctly,
\r
12 * but they may choose not to allow direct user access to the framebuffer.
\r
14 * \section Screen Contents
\r
15 * Reads and writes to the driver's file while in component colour modes
\r
16 * must correspond to a change of the contents of the screen. The framebuffer
\r
17 * must start at offset 0 in the file.
\r
18 * In pallete colour modes the LFB is preceded by a 1024 byte pallete (allowing
\r
19 * room for 256 entries of 32-bits each)
\r
21 #ifndef _TPL_VIDEO_H
\r
22 #define _TPL_VIDEO_H
\r
24 #include <tpl_drv_common.h>
\r
27 * \enum eTplVideo_IOCtl
\r
28 * \brief Common Video IOCtl Calls
\r
29 * \extends eTplDrv_IOCtl
\r
31 enum eTplVideo_IOCtl {
\r
32 //! \brief Set Mode - (int mode)
\r
33 VIDEO_IOCTL_SETMODE = 4,
\r
34 //! \brief Get Mode - (int *mode)
\r
35 VIDEO_IOCTL_GETMODE,
\r
36 //! \brief Find a matching mode - (tVideo_IOCtl_Mode *info)
\r
37 VIDEO_IOCTL_FINDMODE,
\r
38 //! \brief Get mode info - (tVideo_IOCtl_Mode *info)
\r
39 VIDEO_IOCTL_MODEINFO,
\r
40 //! \brief Sets the cursor position (tVideo_IOCtl_Pos *pos)
\r
41 VIDEO_IOCTL_SETCURSOR,
\r
42 //! \brief Request access to Framebuffer - (void *dest), Return Boolean Success
\r
47 * \brief Mode Structure used in IOCtl Calls
\r
49 struct sVideo_IOCtl_Mode {
\r
50 short id; //!< Mide ID
\r
51 Uint16 width; //!< Width
\r
52 Uint16 height; //!< Height
\r
53 Uint8 bpp; //!< Bits per Pixel
\r
54 Uint8 flags; //!< Mode Flags
\r
56 typedef struct sVideo_IOCtl_Mode tVideo_IOCtl_Mode; //!< Mode Type
\r
58 //! \name Video Mode flags
\r
61 * \brief Text Mode Flag
\r
62 * \note A text mode should have the ::sVideo_IOCtl_Mode.bpp set to 12
\r
64 #define VIDEO_FLAG_TEXT 0x1
\r
66 * \brief Slow (non-accellerated mode)
\r
68 #define VIDEO_FLAG_SLOW 0x2
\r
72 * \brief Describes a position in the video framebuffer
\r
74 typedef struct sVideo_IOCtl_Pos tVideo_IOCtl_Pos;
\r
75 struct sVideo_IOCtl_Pos {
\r
76 Sint16 x; //!< X Coordinate
\r
77 Sint16 y; //!< Y Coordinate
\r
81 * \brief Virtual Terminal Representation of a character
\r
83 typedef struct sVT_Char tVT_Char;
\r
85 Uint32 Ch; //!< UTF-32 Character
\r
88 Uint16 BGCol; //!< 12-bit Foreground Colour
\r
89 Uint16 FGCol; //!< 12-bit Background Colour
\r
91 Uint32 Colour; //!< Compound colour for ease of access
\r
96 * \name Basic builtin colour definitions
\r
99 #define VT_COL_BLACK 0x0000
\r
100 #define VT_COL_GREY 0x0888
\r
101 #define VT_COL_LTGREY 0x0CCC
\r
102 #define VT_COL_WHITE 0x0FFF
\r
107 //! \brief Defines the width of a rendered character
\r
108 extern int giVT_CharWidth;
\r
109 //! \brief Defines the height of a rendered character
\r
110 extern int giVT_CharHeight;
\r
112 * \fn void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC)
\r
113 * \brief Renders a character to a buffer
\r
114 * \param Codepoint Unicode character to render
\r
115 * \param Buffer Buffer to render to (32-bpp)
\r
116 * \param Pitch Number of DWords per line
\r
117 * \param BGC 32-bit Background Colour
\r
118 * \param FGC 32-bit Foreground Colour
\r
120 extern void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC);
\r
122 * \fn Uint32 VT_Colour12to24(Uint16 Col12)
\r
123 * \brief Converts a colour from 12bpp to 32bpp
\r
124 * \param Col12 12-bpp input colour
\r
125 * \return Expanded 32-bpp (24-bit colour) version of \a Col12
\r
127 extern Uint32 VT_Colour12to24(Uint16 Col12);
\r