Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions source/Cosmos.System2_Plugs/System/ConsoleImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Text;
using Cosmos.System;
using IL2CPU.API;
using IL2CPU.API.Attribs;

namespace Cosmos.System_Plugs.System
Expand Down Expand Up @@ -338,7 +337,7 @@ public static void Beep(int aFrequency, int aDuration)
/// Beep() is pure CIL
/// Default implementation beeps for 200 milliseconds at 800 hertz
/// In Cosmos, these are Cosmos.System.Duration.Default and Cosmos.System.Notes.Default respectively,
/// and are used when there are no params
/// and are used when there are no params
/// https://docs.microsoft.com/en-us/dotnet/api/system.console.beep?view=netcore-2.0
/// </summary>
public static void Beep()
Expand Down Expand Up @@ -421,11 +420,11 @@ public static ConsoleKeyInfo ReadKey(bool intercept)
}

//TODO: Plug HasFlag and use the next 3 lines instead of the 3 following lines

//bool xShift = key.Modifiers.HasFlag(ConsoleModifiers.Shift);
//bool xAlt = key.Modifiers.HasFlag(ConsoleModifiers.Alt);
//bool xControl = key.Modifiers.HasFlag(ConsoleModifiers.Control);

bool xShift = (key.Modifiers & ConsoleModifiers.Shift) == ConsoleModifiers.Shift;
bool xAlt = (key.Modifiers & ConsoleModifiers.Alt) == ConsoleModifiers.Alt;
bool xControl = (key.Modifiers & ConsoleModifiers.Control) == ConsoleModifiers.Control;
Expand Down Expand Up @@ -545,12 +544,22 @@ public static void SetBufferSize(int width, int height)
throw new NotImplementedException("Not implemented: SetBufferSize");
}

System.ConsolePal::System.ValueTuple`2[System.Int32,System.Int32] GetCursorPosition();
Comment thread
MishaTy marked this conversation as resolved.
Outdated

public static void SetCursorPosition(int left, int top)
{
set_CursorLeft(left);
set_CursorTop(top);
}

public static (int Left, int Top) GetCursorPosition()
{
int Left = get_CursorLeft();
int Top = get_CursorTop();

return (Left, Top);
}

//public static void SetError(TextWriter newError) {
// WriteLine("Not implemented: SetError");
//}
Expand Down