Cosmos/source2/Kernel/System/Cosmos.System/Console.cs
kudzu_cp fab8f20e0f
2010-08-15 08:57:35 +00:00

74 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.System {
public class Console {
protected int mX = 0;
public int X {
get { return mX; }
set {
mX = value;
UpdateCursor();
}
}
protected int mY = 0;
public int Y {
get { return mY; }
set {
mY = value;
UpdateCursor();
}
}
public int Cols {
get { return mText.Cols; }
}
public int Rows {
get { return mText.Rows; }
}
protected Hardware.TextScreen mText = Hardware.Global.TextScreen;
public void Clear() {
mText.Clear();
mX = 0;
mY = 0;
UpdateCursor();
}
protected void UpdateCursor() {
mText.SetCursorPos(mX, mY);
}
public void NewLine() {
mY++;
mX = 0;
if (mY == mText.Rows) {
mText.ScrollUp();
mY = mText.Rows - 1;
mX = 0;
}
UpdateCursor();
}
public void WriteChar(char aChar) {
mText[mX, mY] = aChar;
mX++;
if (mX == mText.Cols) {
NewLine();
}
UpdateCursor();
}
public void WriteLine(string aText) {
}
public void Write(string aText) {
}
}
}