Browse Source

Added Clrscr, Goto.

Steve Thielemann 3 years ago
parent
commit
911ac6b77c
1 changed files with 13 additions and 8 deletions
  1. 13 8
      door/door.go

+ 13 - 8
door/door.go

@@ -12,14 +12,15 @@ import (
 	"time"
 )
 
-const CRNL = "\r\n"         // BBS Line Ending
-var Reset string = Color(0) // ANSI Color Reset
-var Unicode bool            // Unicode support detected
-var CP437 bool              // CP437 support detected
-var Full_CP437 bool         // Full CP437 support detected (handles control codes properly)
-var Height int              // Screen height detected
-var Width int               // Screen width detected
-var Inactivity int64 = 120  // Inactivity timeout
+const CRNL = "\r\n"            // BBS Line Ending
+const Clrscr = "\x1b[2J\x1b[H" // Clear screen, home cursor
+var Reset string = Color(0)    // ANSI Color Reset
+var Unicode bool               // Unicode support detected
+var CP437 bool                 // CP437 support detected
+var Full_CP437 bool            // Full CP437 support detected (handles control codes properly)
+var Height int                 // Screen height detected
+var Width int                  // Screen width detected
+var Inactivity int64 = 120     // Inactivity timeout
 
 /*
 door32.sys:
@@ -206,3 +207,7 @@ func (d *Door) Write(output string) {
 		fmt.Printf("Write fail: %d != %d\n", len(buffer), n)
 	}
 }
+
+func Goto(x int, y int) string {
+	return fmt.Sprintf("\x1b[%d;%dH", y, x)
+}