return 0;
}
-int DrvUtil_Video_WriteLFB(int Mode, tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t Length, void *Buffer)
+int DrvUtil_Video_WriteLFB(tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t Length, void *Buffer)
{
Uint8 *dest;
- ENTER("iMode pFBInfo xOffset xLength pBuffer",
+ ENTER("pFBInfo xOffset xLength pBuffer",
Mode, FBInfo, Offset, Length, Buffer);
- switch( Mode )
+ switch( FBInfo->BufferFormat )
{
case VIDEO_BUFFMT_TEXT:
{
* \note For AcessOS Version 1\r
* \r
* Video drivers extend the common driver interface api_drv_common.h\r
- * and must support _at least_ the IOCtl numbers defined in this file\r
- * to be compatable with Acess.\r
+ * and must support the IOCtl numbers defined in this file to be\r
+ * compatable with Acess (drivers may implement more IOCtls above\r
+ * DRV_IOCTL_USERMIN).\r
* \r
* \section IOCtls\r
* As said, a compatable driver must implement these calls correctly,\r
* framebuffer.\r
* \r
* \section Mode Support\r
- * All video drivers must support at least one text mode (Mode #0)\r
- * For each graphics mode the driver exposes, there must be a corresponding\r
- * text mode with the same resolution, this mode will be used when the\r
- * user switches to a text Virtual Terminal while in graphics mode.\r
+ * All video drivers must support text output for every resolution (hardware\r
+ * accelerated or software), and at least the _BLIT and _FILL 2D operations\r
+ * (these may be implemented specifically for text mode).\r
*/\r
#ifndef _API_DRV_VIDEO_H\r
#define _API_DRV_VIDEO_H\r
*/\r
typedef struct sDrvUtil_Video_BufInfo\r
{\r
+ /**\r
+ * \name Framebuffer state\r
+ * \{\r
+ */\r
/**\r
* \brief Framebuffer virtual address\r
*/\r
/**\r
* \brief Bit depth of the framebuffer\r
*/\r
- int Depth;\r
+ short Depth;\r
+ /*\r
+ * \}\r
+ */\r
+ \r
+ /**\r
+ * \brief Buffer write format\r
+ */\r
+ short BufferFormat;\r
\r
/**\r
* \name Software cursor controls\r
* \brief Cursor bitmap\r
*/\r
tVideo_IOCtl_Bitmap *CursorBitmap;\r
+ /*\r
+ * \}\r
+ */\r
\r
/**\r
* \brief Buffer to store the area under the cursor\r
*/\r
void *CursorSaveBuf;\r
- /*\r
- * \}\r
- */\r
} tDrvUtil_Video_BufInfo;\r
\r
/**\r
\r
/**\r
* \brief Perform write operations to a LFB\r
- * \param Mode Buffer mode (see eTplVideo_BufFormats)\r
* \param FBInfo Framebuffer descriptor, see type for details\r
* \param Offset Offset provided by VFS call\r
* \param Length Length provided by VFS call\r
* Handles all write modes in software, using the VT font calls for rendering.\r
* \note Calls the cursor clear and redraw if the cursor area is touched\r
*/\r
-extern int DrvUtil_Video_WriteLFB(int Mode, tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t Length, void *Src);\r
+extern int DrvUtil_Video_WriteLFB(tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t Length, void *Src);\r
\r
/**\r
* \name Software cursor rendering\r
}\r
};\r
int giBGA_CurrentMode = -1;\r
- int giBGA_BufferFormat = 0;\r
tVideo_IOCtl_Pos gBGA_CursorPos = {-1,-1};\r
Uint *gBGA_Framebuffer;\r
const tBGA_Mode *gpBGA_CurrentMode;\r
\r
// Map Framebuffer to hardware address\r
gBGA_Framebuffer = (void *) MM_MapHWPages(base, 768); // 768 pages (3Mb)\r
- MM_DumpTables(0, -1);\r
\r
// Install Device\r
if( DevFS_AddDevice( &gBGA_DriverStruct ) == -1 )\r
Uint64 BGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)\r
{\r
if( giBGA_CurrentMode == -1 ) BGA_int_UpdateMode(0);\r
- return DrvUtil_Video_WriteLFB(giBGA_BufferFormat, &gBGA_DrvUtil_BufInfo, Offset, Length, Buffer);\r
+ return DrvUtil_Video_WriteLFB(&gBGA_DrvUtil_BufInfo, Offset, Length, Buffer);\r
}\r
\r
const char *csaBGA_IOCtls[] = {DRV_IOCTLNAMES, DRV_VIDEO_IOCTLNAMES, NULL};\r
break;\r
\r
case VIDEO_IOCTL_SETBUFFORMAT:\r
- ret = giBGA_BufferFormat;\r
+ ret = gBGA_DrvUtil_BufInfo.BufferFormat;\r
if(Data)\r
- giBGA_BufferFormat = *(int*)Data;\r
+ gBGA_DrvUtil_BufInfo.BufferFormat = *(int*)Data;\r
break;\r
\r
case VIDEO_IOCTL_SETCURSOR:\r