#define DEBUG 0
#include <acess.h>
#include <fs_devfs.h>
-#include <tpl_drv_video.h>
+#include <api_drv_video.h>
#include <modules.h>
// === CONSTANTS ===
// === PROTOTYPES ===
int VGA_Install(char **Arguments);
-Uint64 VGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
+Uint64 VGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer);
int VGA_IOCtl(tVFS_Node *Node, int Id, void *Data);
Uint8 VGA_int_GetColourNibble(Uint16 col);
-Uint16 VGA_int_GetWord(tVT_Char *Char);
+Uint16 VGA_int_GetWord(const tVT_Char *Char);
void VGA_int_SetCursor(Sint16 x, Sint16 y);
// --- 2D Acceleration Functions --
void VGA_2D_Fill(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colour);
// === GLOBALS ===
MODULE_DEFINE(0, 0x000A, x86_VGAText, VGA_Install, NULL, NULL);
+tVFS_NodeType gVGA_NodeType = {
+ //.Read = VGA_Read,
+ .Write = VGA_Write,
+ .IOCtl = VGA_IOCtl
+ };
tDevFS_Driver gVGA_DevInfo = {
NULL, "x86_VGAText",
{
.NumACLs = 0,
.Size = VGA_WIDTH*VGA_HEIGHT*sizeof(tVT_Char),
- //.Read = VGA_Read,
- .Write = VGA_Write,
- .IOCtl = VGA_IOCtl
+ .Type = &gVGA_NodeType
}
};
Uint16 *gVGA_Framebuffer = (void*)( KERNEL_BASE|0xB8000 );
}
/**
- * \fn Uint64 VGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
* \brief Writes a string of bytes to the VGA controller
*/
-Uint64 VGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
+Uint64 VGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer)
{
if( giVGA_BufferFormat == VIDEO_BUFFMT_TEXT )
{
int num = Length / sizeof(tVT_Char);
int ofs = Offset / sizeof(tVT_Char);
int i = 0;
- tVT_Char *chars = Buffer;
+ const tVT_Char *chars = Buffer;
Uint16 word;
//ENTER("pNode XOffset XLength pBuffer", Node, Offset, Length, Buffer);
* \fn Uint16 VGA_int_GetWord(tVT_Char *Char)
* \brief Convers a character structure to a VGA character word
*/
-Uint16 VGA_int_GetWord(tVT_Char *Char)
+Uint16 VGA_int_GetWord(const tVT_Char *Char)
{
Uint16 ret;
Uint16 col;