mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
- moved EncodingTest on Text subdir - added ConsoleTest (not enabled by default) - removed ASCIIEncodingImpl (it was not needed) - Made plugs of Console better and added plugs for formatted versions - Removed code to test Hashtable, Hashtable it will be a separate PR
106 lines
2.3 KiB
C#
106 lines
2.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using Cosmos.Debug.Kernel;
|
|
|
|
namespace Cosmos.HAL
|
|
{
|
|
public class DebugTextScreen: TextScreenBase
|
|
{
|
|
private readonly Debugger mDebugger;
|
|
public DebugTextScreen()
|
|
{
|
|
mDebugger = new Debugger("HAL", "DebugTextScreen");
|
|
}
|
|
|
|
public override void Clear()
|
|
{
|
|
}
|
|
|
|
public override void SetColors(ConsoleColor aForeground, ConsoleColor aBackground)
|
|
{
|
|
}
|
|
|
|
public override byte GetColor()
|
|
{
|
|
return 0x0F;
|
|
}
|
|
|
|
public override ushort Cols
|
|
{
|
|
get
|
|
{
|
|
return 80;
|
|
}
|
|
}
|
|
|
|
public override ushort Rows
|
|
{
|
|
get
|
|
{
|
|
return 25;
|
|
}
|
|
}
|
|
|
|
private void SendChar(char[] aData)
|
|
{
|
|
var xBytes = new byte[aData.Length];
|
|
for (int i = 0; i < aData.Length; i++)
|
|
{
|
|
xBytes[i] = (byte)aData[i];
|
|
}
|
|
mDebugger.SendChannelCommand(129, 0, xBytes);
|
|
}
|
|
|
|
public override void SetCursorPos(int x, int y)
|
|
{
|
|
}
|
|
|
|
public override void ScrollUp()
|
|
{
|
|
}
|
|
|
|
private int mCurrentY = 1;
|
|
|
|
|
|
public override byte this[int x, int y]
|
|
{
|
|
get
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
set
|
|
{
|
|
if (y != mCurrentY)
|
|
{
|
|
SendChar(new[]
|
|
{
|
|
'\r',
|
|
'\n'
|
|
});
|
|
mCurrentY = y;
|
|
}
|
|
SendChar(new []{(char)value});
|
|
}
|
|
}
|
|
|
|
public override int GetCursorSize()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void SetCursorSize(int value)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override bool GetCursorVisible()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void SetCursorVisible(bool value)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|