Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Apr 2015 01:48:13 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280975 - head/sys/boot/forth
Message-ID:  <201504020148.t321mDU1040875@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Thu Apr  2 01:48:12 2015
New Revision: 280975
URL: https://svnweb.freebsd.org/changeset/base/280975

Log:
  Eliminate literal escape sequences from *.4th
  
  Suggested by:	alfred
  MFC after:	3 days
  X-MFC-to:	stable/10

Modified:
  head/sys/boot/forth/brand-fbsd.4th
  head/sys/boot/forth/logo-beastie.4th
  head/sys/boot/forth/logo-beastiebw.4th
  head/sys/boot/forth/logo-fbsdbw.4th
  head/sys/boot/forth/logo-orb.4th
  head/sys/boot/forth/logo-orbbw.4th
  head/sys/boot/forth/menu.4th
  head/sys/boot/forth/screen.4th

Modified: head/sys/boot/forth/brand-fbsd.4th
==============================================================================
--- head/sys/boot/forth/brand-fbsd.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/brand-fbsd.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -26,13 +26,21 @@
 
 2 brandX ! 1 brandY ! \ Initialize brand placement defaults
 
+: brand+ ( x y c-addr/u -- x y' )
+	2swap 2dup at-xy 2swap \ position the cursor
+	type \ print to the screen
+	1+ \ increase y for next time we're called
+;
+
 : brand ( x y -- ) \ "FreeBSD" [wide] logo in B/W (7 rows x 42 columns)
 
-	2dup at-xy ."  ______               ____   _____ _____  " 1+
-	2dup at-xy ." |  ____|             |  _ \ / ____|  __ \ " 1+
-	2dup at-xy ." | |___ _ __ ___  ___ | |_) | (___ | |  | |" 1+
-	2dup at-xy ." |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |" 1+
-	2dup at-xy ." | |   | | |  __/  __/| |_) |____) | |__| |" 1+
-	2dup at-xy ." | |   | | |    |    ||     |      |      |" 1+
-	     at-xy ." |_|   |_|  \___|\___||____/|_____/|_____/ "
+	s"  ______               ____   _____ _____  " brand+
+	s" |  ____|             |  _ \ / ____|  __ \ " brand+
+	s" | |___ _ __ ___  ___ | |_) | (___ | |  | |" brand+
+	s" |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |" brand+
+	s" | |   | | |  __/  __/| |_) |____) | |__| |" brand+
+	s" | |   | | |    |    ||     |      |      |" brand+
+	s" |_|   |_|  \___|\___||____/|_____/|_____/ " brand+
+
+	2drop
 ;

Modified: head/sys/boot/forth/logo-beastie.4th
==============================================================================
--- head/sys/boot/forth/logo-beastie.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/logo-beastie.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -28,25 +28,34 @@
 
 46 logoX ! 4 logoY ! \ Initialize logo placement defaults
 
+: logo+ ( x y c-addr/u -- x y' )
+	2swap 2dup at-xy 2swap \ position the cursor
+	[char] @ escc! \ replace @ with Esc
+	type \ print to the screen
+	1+ \ increase y for next time we're called
+;
+
 : logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns)
 
-2dup at-xy ."               ,        ," 1+
-2dup at-xy ."              /(        )`" 1+
-2dup at-xy ."              \ \___   / |" 1+
-2dup at-xy ."              /- _  `-/  '" 1+
-2dup at-xy ."             (/\/ \ \   /\" 1+
-2dup at-xy ."             / /   | `    \" 1+
-2dup at-xy ."             O O   ) /    |" 1+
-2dup at-xy ."             `-^--'`<     '" 1+
-2dup at-xy ."            (_.)  _  )   /" 1+
-2dup at-xy ."             `.___/`    /" 1+
-2dup at-xy ."               `-----' /" 1+
-2dup at-xy ."  <----.     __ / __   \" 1+
-2dup at-xy ."  <----|====O)))==) \) /====|" 1+
-2dup at-xy ."  <----'    `--' `.__,' \" 1+
-2dup at-xy ."               |        |" 1+
-2dup at-xy ."                \       /       /\" 1+
-2dup at-xy ."           ______( (_  / \______/" 1+
-2dup at-xy ."         ,'  ,-----'   |" 1+
-     at-xy ."         `--{__________)"
+	s"               @[31m,        ,"                         logo+
+	s"              /(        )`"                             logo+
+	s"              \ \___   / |"                             logo+
+	s"              /- @[m_@[31m  `-/  '"                     logo+
+	s"             (@[m/\/ \@[31m \   /\"                     logo+
+	s"             @[m/ /   |@[31m `    \"                    logo+
+	s"             @[34mO O   @[m) @[31m/    |"               logo+
+	s"             @[m`-^--'@[31m`<     '"                    logo+
+	s"            (_.)  _  )   /"                             logo+
+	s"             `.___/`    /"                              logo+
+	s"               `-----' /"                               logo+
+	s"  @[33m<----.@[31m     __ / __   \"                     logo+
+	s"  @[33m<----|====@[31mO)))@[33m==@[31m) \) /@[33m====|" logo+
+	s"  @[33m<----'@[31m    `--' `.__,' \"                    logo+
+	s"               |        |"                              logo+
+	s"                \       /       /\"                     logo+
+	s"           @[36m______@[31m( (_  / \______/"            logo+
+	s"         @[36m,'  ,-----'   |"                          logo+
+	s"         `--{__________)@[m"                            logo+
+
+	2drop
 ;

Modified: head/sys/boot/forth/logo-beastiebw.4th
==============================================================================
--- head/sys/boot/forth/logo-beastiebw.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/logo-beastiebw.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -27,25 +27,33 @@
 
 46 logoX ! 4 logoY ! \ Initialize logo placement defaults
 
+: logo+ ( x y c-addr/u -- x y' )
+	2swap 2dup at-xy 2swap \ position the cursor
+	type \ print to the screen
+	1+ \ increase y for next time we're called
+;
+
 : logo ( x y -- ) \ B/W BSD mascot (19 rows x 34 columns)
 
-	2dup at-xy ."               ,        ," 1+
-	2dup at-xy ."              /(        )`" 1+
-	2dup at-xy ."              \ \___   / |" 1+
-	2dup at-xy ."              /- _  `-/  '" 1+
-	2dup at-xy ."             (/\/ \ \   /\" 1+
-	2dup at-xy ."             / /   | `    \" 1+
-	2dup at-xy ."             O O   ) /    |" 1+
-	2dup at-xy ."             `-^--'`<     '" 1+
-	2dup at-xy ."            (_.)  _  )   /" 1+
-	2dup at-xy ."             `.___/`    /" 1+
-	2dup at-xy ."               `-----' /" 1+
-	2dup at-xy ."  <----.     __ / __   \" 1+
-	2dup at-xy ."  <----|====O)))==) \) /====|" 1+
-	2dup at-xy ."  <----'    `--' `.__,' \" 1+
-	2dup at-xy ."               |        |" 1+
-	2dup at-xy ."                \       /       /\" 1+
-	2dup at-xy ."           ______( (_  / \______/" 1+
-	2dup at-xy ."         ,'  ,-----'   |" 1+
-	     at-xy ."         `--{__________)"
+	s"               ,        ,"          logo+
+	s"              /(        )`"         logo+
+	s"              \ \___   / |"         logo+
+	s"              /- _  `-/  '"         logo+
+	s"             (/\/ \ \   /\"         logo+
+	s"             / /   | `    \"        logo+
+	s"             O O   ) /    |"        logo+
+	s"             `-^--'`<     '"        logo+
+	s"            (_.)  _  )   /"         logo+
+	s"             `.___/`    /"          logo+
+	s"               `-----' /"           logo+
+	s"  <----.     __ / __   \"           logo+
+	s"  <----|====O)))==) \) /====|"      logo+
+	s"  <----'    `--' `.__,' \"          logo+
+	s"               |        |"          logo+
+	s"                \       /       /\" logo+
+	s"           ______( (_  / \______/"  logo+
+	s"         ,'  ,-----'   |"           logo+
+	s"         `--{__________)"           logo+
+
+	2drop
 ;

Modified: head/sys/boot/forth/logo-fbsdbw.4th
==============================================================================
--- head/sys/boot/forth/logo-fbsdbw.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/logo-fbsdbw.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -27,19 +27,27 @@
 
 52 logoX ! 9 logoY ! \ Initialize logo placement defaults
 
+: logo+ ( x y c-addr/u -- x y' )
+	2swap 2dup at-xy 2swap \ position the cursor
+	type \ print to the screen
+	1+ \ increase y for next time we're called
+;
+
 : logo ( x y -- ) \ "FreeBSD" logo in B/W (13 rows x 21 columns)
 
-	2dup at-xy ."  ______" 1+
-	2dup at-xy ." |  ____| __ ___  ___ " 1+
-	2dup at-xy ." | |__ | '__/ _ \/ _ \" 1+
-	2dup at-xy ." |  __|| | |  __/  __/" 1+
-	2dup at-xy ." | |   | | |    |    |" 1+
-	2dup at-xy ." |_|   |_|  \___|\___|" 1+
-	2dup at-xy ."  ____   _____ _____" 1+
-	2dup at-xy ." |  _ \ / ____|  __ \" 1+
-	2dup at-xy ." | |_) | (___ | |  | |" 1+
-	2dup at-xy ." |  _ < \___ \| |  | |" 1+
-	2dup at-xy ." | |_) |____) | |__| |" 1+
-	2dup at-xy ." |     |      |      |" 1+
-	     at-xy ." |____/|_____/|_____/"
+	s"  ______"               logo+
+	s" |  ____| __ ___  ___ " logo+
+	s" | |__ | '__/ _ \/ _ \" logo+
+	s" |  __|| | |  __/  __/" logo+
+	s" | |   | | |    |    |" logo+
+	s" |_|   |_|  \___|\___|" logo+
+	s"  ____   _____ _____"   logo+
+	s" |  _ \ / ____|  __ \"  logo+
+	s" | |_) | (___ | |  | |" logo+
+	s" |  _ < \___ \| |  | |" logo+
+	s" | |_) |____) | |__| |" logo+
+	s" |     |      |      |" logo+
+	s" |____/|_____/|_____/"  logo+
+
+	2drop
 ;

Modified: head/sys/boot/forth/logo-orb.4th
==============================================================================
--- head/sys/boot/forth/logo-orb.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/logo-orb.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -26,21 +26,30 @@
 
 46 logoX ! 7 logoY ! \ Initialize logo placement defaults
 
+: logo+ ( x y c-addr/u -- x y' )
+	2swap 2dup at-xy 2swap \ position the cursor
+	[char] @ escc! \ replace @ with Esc
+	type \ print to the screen
+	1+ \ increase y for next time we're called
+;
+
 : logo ( x y -- ) \ color Orb mascot (15 rows x 30 columns)
 
-	2dup at-xy ."  ```                        `" 1+
-	2dup at-xy ." s` `.....---.......--.```   -/" 1+
-	2dup at-xy ." +o   .--`         /y:`      +." 1+
-	2dup at-xy ."  yo`:.            :o      `+-" 1+
-	2dup at-xy ."   y/               -/`   -o/" 1+
-	2dup at-xy ."  .-                  ::/sy+:." 1+
-	2dup at-xy ."  /                     `--  /" 1+
-	2dup at-xy ." `:                          :`" 1+
-	2dup at-xy ." `:                          :`" 1+
-	2dup at-xy ."  /                          /" 1+
-	2dup at-xy ."  .-                        -." 1+
-	2dup at-xy ."   --                      -." 1+
-	2dup at-xy ."    `:`                  `:`" 1+
-	2dup at-xy ."      .--             `--." 1+
-	     at-xy ."         .---.....----."
+	s"  @[31m```                        @[31;1m`@[31m" logo+
+	s" s` `.....---...@[31;1m....--.```   -/@[31m"     logo+
+	s" +o   .--`         @[31;1m/y:`      +.@[31m"     logo+
+	s"  yo`:.            @[31;1m:o      `+-@[31m"      logo+
+	s"   y/               @[31;1m-/`   -o/@[31m"       logo+
+	s"  .-                  @[31;1m::/sy+:.@[31m"      logo+
+	s"  /                     @[31;1m`--  /@[31m"      logo+
+	s" `:                          @[31;1m:`@[31m"     logo+
+	s" `:                          @[31;1m:`@[31m"     logo+
+	s"  /                          @[31;1m/@[31m"      logo+
+	s"  .-                        @[31;1m-.@[31m"      logo+
+	s"   --                      @[31;1m-.@[31m"       logo+
+	s"    `:`                  @[31;1m`:`"             logo+
+	s"      @[31;1m.--             `--."               logo+
+	s"         .---.....----.@[m"                      logo+
+
+	2drop
 ;

Modified: head/sys/boot/forth/logo-orbbw.4th
==============================================================================
--- head/sys/boot/forth/logo-orbbw.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/logo-orbbw.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -26,21 +26,29 @@
 
 46 logoX ! 7 logoY ! \ Initialize logo placement defaults
 
+: logo+ ( x y c-addr/u -- x y' )
+	2swap 2dup at-xy 2swap \ position the cursor
+	type \ print to the screen
+	1+ \ increase y for next time we're called
+;
+
 : logo ( x y -- ) \ B/W Orb mascot (15 rows x 32 columns)
 
-	2dup at-xy ."  ```                        `" 1+
-	2dup at-xy ." s` `.....---.......--.```   -/" 1+
-	2dup at-xy ." +o   .--`         /y:`      +." 1+
-	2dup at-xy ."  yo`:.            :o      `+-" 1+
-	2dup at-xy ."   y/               -/`   -o/" 1+
-	2dup at-xy ."  .-                  ::/sy+:." 1+
-	2dup at-xy ."  /                     `--  /" 1+
-	2dup at-xy ." `:                          :`" 1+
-	2dup at-xy ." `:                          :`" 1+
-	2dup at-xy ."  /                          /" 1+
-	2dup at-xy ."  .-                        -." 1+
-	2dup at-xy ."   --                      -." 1+
-	2dup at-xy ."    `:`                  `:`" 1+
-	2dup at-xy ."      .--             `--." 1+
-	     at-xy ."         .---.....----."
+	s"  ```                        `"  logo+
+	s" s` `.....---.......--.```   -/" logo+
+	s" +o   .--`         /y:`      +." logo+
+	s"  yo`:.            :o      `+-"  logo+
+	s"   y/               -/`   -o/"   logo+
+	s"  .-                  ::/sy+:."  logo+
+	s"  /                     `--  /"  logo+
+	s" `:                          :`" logo+
+	s" `:                          :`" logo+
+	s"  /                          /"  logo+
+	s"  .-                        -."  logo+
+	s"   --                      -."   logo+
+	s"    `:`                  `:`"    logo+
+	s"      .--             `--."      logo+
+	s"         .---.....----."         logo+
+
+	2drop
 ;

Modified: head/sys/boot/forth/menu.4th
==============================================================================
--- head/sys/boot/forth/menu.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/menu.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -395,14 +395,15 @@ also menu-infrastructure definitions
 		setenv
 
 		\ Assign third to ansi_caption[x][y]
-		kerncapbuf 0 s" Kernel: " strcat
+		kerncapbuf 0 s" @[1mK@[37mernel: " [char] @ escc! strcat
 		kernmenuidx @ [char] 0 = if
-			s" default/"
+			s" default/@[32m"
 		else
-			s" "
-		then strcat
+			s" @[34;1m"
+		then
+		[char] @ escc! strcat
 		2over strcat
-		s" " strcat
+		s" @[37m" [char] @ escc! strcat
 		kernidx @ kernmenuidx @ ansi_caption[x][y]
 		setenv
 

Modified: head/sys/boot/forth/screen.4th
==============================================================================
--- head/sys/boot/forth/screen.4th	Thu Apr  2 01:46:17 2015	(r280974)
+++ head/sys/boot/forth/screen.4th	Thu Apr  2 01:48:12 2015	(r280975)
@@ -62,3 +62,13 @@ marker task-screen.4th
 
 \ Disable inverse foreground/background mode ( Esc-[27m )
 : -inv ( -- ) escc 27 .# [char] m emit ;
+
+\ Convert all occurrences of given character (c) in string (c-addr/u) to Esc
+: escc! ( c-addr/u c -- c-addr/u )
+	2 pick 2 pick
+	begin dup 0> while
+		over c@ 3 pick = if over 27 swap c! then
+		1- swap 1+ swap
+	repeat
+	2drop drop
+;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504020148.t321mDU1040875>