summaryrefslogtreecommitdiffstats
path: root/sys/boot/forth/screen.4th
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-05-30 09:29:24 +0000
committerscottl <scottl@FreeBSD.org>2003-05-30 09:29:24 +0000
commit0c3c12a82d69a5456b37ed1885f2a3ebeaf477fd (patch)
treee6e15fac7a0d25267e94b5adb69e9da1b78292dc /sys/boot/forth/screen.4th
parent141789cf1813b5354097d8aed513fd8b5d245486 (diff)
downloadFreeBSD-src-0c3c12a82d69a5456b37ed1885f2a3ebeaf477fd.zip
FreeBSD-src-0c3c12a82d69a5456b37ed1885f2a3ebeaf477fd.tar.gz
Add a new bootloader menu. Pull in screen.4th and frames.4th from the
examples directory to support it. This is installed only on i386 for now. It will be enabled in a later commit. Approved by: re
Diffstat (limited to 'sys/boot/forth/screen.4th')
-rw-r--r--sys/boot/forth/screen.4th36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/boot/forth/screen.4th b/sys/boot/forth/screen.4th
new file mode 100644
index 0000000..3ea79e4
--- /dev/null
+++ b/sys/boot/forth/screen.4th
@@ -0,0 +1,36 @@
+\ Screen manipulation related words.
+\ $FreeBSD$
+
+marker task-screen.4th
+
+: escc ( -- ) \ emit Esc-[
+ 91 27 emit emit
+;
+
+: ho ( -- ) \ Home cursor
+ escc 72 emit \ Esc-[H
+;
+
+: cld ( -- ) \ Clear from current position to end of display
+ escc 74 emit \ Esc-[J
+;
+
+: clear ( -- ) \ clear screen
+ ho cld
+;
+
+: at-xy ( x y -- ) \ move cursor to x rows, y cols (1-based coords)
+ escc .# 59 emit .# 72 emit \ Esc-[%d;%dH
+;
+
+: fg ( x -- ) \ Set foreground color
+ escc 3 .# .# 109 emit \ Esc-[3%dm
+;
+
+: bg ( x -- ) \ Set background color
+ escc 4 .# .# 109 emit \ Esc-[4%dm
+;
+
+: me ( -- ) \ Mode end (clear attributes)
+ escc 109 emit
+;
OpenPOWER on IntegriCloud