svn commit: r258269 - head/sys/boot/forth

Devin Teske dteske at FreeBSD.org
Sun Nov 17 18:07:11 UTC 2013


Author: dteske
Date: Sun Nov 17 18:07:10 2013
New Revision: 258269
URL: http://svnweb.freebsd.org/changeset/base/258269

Log:
  Refactor draw-beastie function.
  
  Discussed on:	-hackers

Modified:
  head/sys/boot/forth/beastie.4th

Modified: head/sys/boot/forth/beastie.4th
==============================================================================
--- head/sys/boot/forth/beastie.4th	Sun Nov 17 18:03:03 2013	(r258268)
+++ head/sys/boot/forth/beastie.4th	Sun Nov 17 18:07:10 2013	(r258269)
@@ -202,56 +202,26 @@ variable logoY
 		drop
 	then
 
-	s" loader_logo" getenv dup -1 = if
-		logoX @ logoY @
-		loader_color? if
-			orb-logo
-		else
-			orbbw-logo
-		then
-		drop exit
-	then
-
-	2dup s" beastie" compare-insensitive 0= if
-		logoX @ logoY @ beastie-logo
-		2drop exit
-	then
-	2dup s" beastiebw" compare-insensitive 0= if
-		logoX @ logoY @ beastiebw-logo
-		2drop exit
-	then
-	2dup s" fbsdbw" compare-insensitive 0= if
-		logoX @ logoY @ fbsdbw-logo
-		2drop exit
-	then
-	2dup s" orb" compare-insensitive 0= if
-		logoX @ logoY @ orb-logo
-		2drop exit
-	then
-	2dup s" orbbw" compare-insensitive 0= if
-		logoX @ logoY @ orbbw-logo
-		2drop exit
-	then
-	2dup s" tribute" compare-insensitive 0= if
-		logoX @ logoY @
-		s" tribute-logo" sfind if
-			execute
-		else
-			drop orb-logo
-		then
-		2drop exit
+	s" loader_logo" getenv dup -1 <> if
+		dup 5 + allocate if ENOMEM throw then
+		0 2swap strcat s" -logo" strcat
+		over -rot ( a-addr/u -- a-addr a-addr/u )
+		sfind     ( a-addr a-addr/u -- a-addr xt bool )
+		rot       ( a-addr xt bool -- xt bool a-addr )
+		free      ( xt bool a-addr -- xt bool ior )
+		if EFREE throw then
+	else
+		0 ( cruft -- cruft bool ) \ load the default below
 	then
-	2dup s" tributebw" compare-insensitive 0= if
-		logoX @ logoY @
-		s" tributebw-logo" sfind if
-			execute
+	0= if
+		drop ( cruft -- )
+		loader_color? if
+			['] orb-logo
 		else
-			drop orbbw-logo
+			['] orbbw-logo
 		then
-		2drop exit
 	then
-
-	2drop
+	logoX @ logoY @ rot execute
 ;
 
 : clear-beastie ( -- ) \ clears beastie from the screen


More information about the svn-src-head mailing list