};
// === GLOBALS ===
-MODULE_DEFINE(0, VERSION, VTerm, VT_Install, NULL, DEFAULT_INPUT, FALLBACK_OUTPUT, NULL);
+MODULE_DEFINE(0, VERSION, VTerm, VT_Install, NULL, DEFAULT_INPUT, NULL);
tDevFS_Driver gVT_DrvInfo = {
NULL, "VTerm",
{
if(!gsVT_OutputDevice) gsVT_OutputDevice = (char*)DEFAULT_OUTPUT;
else if( Module_EnsureLoaded( gsVT_OutputDevice ) ) gsVT_OutputDevice = (char*)DEFAULT_OUTPUT;
if( Module_EnsureLoaded( gsVT_OutputDevice ) ) gsVT_OutputDevice = (char*)FALLBACK_OUTPUT;
+ if( Module_EnsureLoaded( gsVT_OutputDevice ) ) {
+ Log_Error("VTerm", "Fallback video '%s' is not avaliable, giving up", FALLBACK_OUTPUT);
+ return MODULE_ERR_MISC;
+ }
if(!gsVT_InputDevice) gsVT_InputDevice = (char*)DEFAULT_INPUT;
else if( Module_EnsureLoaded( gsVT_InputDevice ) ) gsVT_InputDevice = (char*)DEFAULT_INPUT;
Log_Log("VTerm", "Using '%s' as output", gsVT_OutputDevice);
Log_Log("VTerm", "Using '%s' as input", gsVT_InputDevice);
+ VT_InitOutput();
+ VT_InitInput();
+
// Create Nodes
for( i = 0; i < NUM_VTS; i++ )
{
// Add to DevFS
DevFS_AddDevice( &gVT_DrvInfo );
- VT_InitOutput();
- VT_InitInput();
-
// Set kernel output to VT0
Debug_SetKTerminal("/Devices/VTerm/0");
VFS_IOCtl( giVT_OutputDevHandle, VIDEO_IOCTL_GETSETMODE, &tmp );
// Resize text terminals if needed
- if( giVT_RealWidth != mode.width || giVT_RealHeight != mode.height )
+ if( gVT_Terminals[0].Text && (giVT_RealWidth != mode.width || giVT_RealHeight != mode.height) )
{
int newBufSize = (giVT_RealWidth/giVT_CharWidth)
*(giVT_RealHeight/giVT_CharHeight)
gpVT_CurTerm = &gVT_Terminals[ID];
// Update cursor
- if( gpVT_CurTerm->Mode == TERM_MODE_TEXT && !(gpVT_CurTerm->Flags & VT_FLAG_HIDECSR) )
+ if( gpVT_CurTerm->Text && gpVT_CurTerm->Mode == TERM_MODE_TEXT && !(gpVT_CurTerm->Flags & VT_FLAG_HIDECSR) )
{
tVideo_IOCtl_Pos pos;
int offset = (gpVT_CurTerm->Flags & VT_FLAG_ALTBUF) ? gpVT_CurTerm->AltWritePos : gpVT_CurTerm->WritePos - gpVT_CurTerm->ViewPos;
*/
void VT_int_ChangeMode(tVTerm *Term, int NewMode, int NewWidth, int NewHeight)
{
-
// TODO: Increase RealWidth/RealHeight when this happens
if(NewWidth > giVT_RealWidth) NewWidth = giVT_RealWidth;
if(NewHeight > giVT_RealHeight) NewHeight = giVT_RealHeight;
Term->Mode = NewMode;
-
+
if(NewWidth != Term->Width || NewHeight != Term->Height)
{
int oldW = Term->Width;
}
free(oldFB);
}
+
+ // Debug
+ switch(NewMode)
+ {
+ case TERM_MODE_TEXT:
+ Log_Log("VTerm", "Set VT %p to text mode (%ix%i)",
+ Term, Term->TextWidth, Term->TextHeight);
+ break;
+ case TERM_MODE_FB:
+ Log_Log("VTerm", "Set VT %p to framebuffer mode (%ix%i)",
+ Term, Term->Width, Term->Height);
+ break;
+ //case TERM_MODE_2DACCEL:
+ //case TERM_MODE_3DACCEL:
+ // return;
+ }
}
-
- // Debug
- switch(NewMode)
- {
- case TERM_MODE_TEXT:
- Log_Log("VTerm", "Set VT %p to text mode (%ix%i)",
- Term, Term->TextWidth, Term->TextHeight);
- break;
- case TERM_MODE_FB:
- Log_Log("VTerm", "Set VT %p to framebuffer mode (%ix%i)",
- Term, Term->Width, Term->Height);
- break;
- //case TERM_MODE_2DACCEL:
- //case TERM_MODE_3DACCEL:
- // return;
- }
}