The cursor is disabled when displaying the VGA under JSVM.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-12-05 22:13:51 +01:00
parent 2c728fc1f1
commit aae0ed3092
1 changed files with 18 additions and 1 deletions

View File

@ -33,6 +33,8 @@
#include "vgaterminal.h" #include "vgaterminal.h"
#include "scheduler.h" #include "scheduler.h"
using namespace Maxsi;
namespace Sortix namespace Sortix
{ {
namespace SerialTerminal namespace SerialTerminal
@ -41,7 +43,7 @@ namespace Sortix
{ {
// Set the cursor to (0,0) and clear the screen. // Set the cursor to (0,0) and clear the screen.
const char InitMessage[] = "\e[37m\e[40m\e[2J\e[H"; const char InitMessage[] = "\e[37m\e[40m\e[2J\e[H";
UART::Write(InitMessage, Maxsi::String::Length(InitMessage)); UART::Write(InitMessage, String::Length(InitMessage));
} }
bool isEsc; bool isEsc;
@ -50,12 +52,15 @@ namespace Sortix
const bool ECHO_TO_VGA = true; const bool ECHO_TO_VGA = true;
bool cursordisabled;
void Init() void Init()
{ {
Reset(); Reset();
isEsc = isEscDepress = false; isEsc = isEscDepress = false;
sigpending = -1; sigpending = -1;
cursordisabled = false;
} }
void OnTick() void OnTick()
@ -121,12 +126,24 @@ namespace Sortix
void OnVGAModified() void OnVGAModified()
{ {
if ( !cursordisabled )
{
const char* msg = "\e[l";
UART::Write(msg, String::Length(msg));
cursordisabled = true;
}
UART::RenderVGA((const uint16_t*) 0xB8000); UART::RenderVGA((const uint16_t*) 0xB8000);
} }
size_t Print(void* /*user*/, const char* string, size_t stringlen) size_t Print(void* /*user*/, const char* string, size_t stringlen)
{ {
if ( ECHO_TO_VGA ) { VGATerminal::Print(NULL, string, stringlen); } if ( ECHO_TO_VGA ) { VGATerminal::Print(NULL, string, stringlen); }
if ( cursordisabled )
{
const char* msg = "\e[h";
UART::Write(msg, String::Length(msg));
cursordisabled = false;
}
UART::Write(string, stringlen); UART::Write(string, stringlen);
return stringlen; return stringlen;
} }