brand.4th revision 222417
1222417Sjulian\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
2222417Sjulian\ All rights reserved.
3222417Sjulian\ 
4222417Sjulian\ Redistribution and use in source and binary forms, with or without
5222417Sjulian\ modification, are permitted provided that the following conditions
6222417Sjulian\ are met:
7222417Sjulian\ 1. Redistributions of source code must retain the above copyright
8222417Sjulian\    notice, this list of conditions and the following disclaimer.
9222417Sjulian\ 2. Redistributions in binary form must reproduce the above copyright
10222417Sjulian\    notice, this list of conditions and the following disclaimer in the
11222417Sjulian\    documentation and/or other materials provided with the distribution.
12222417Sjulian\ 
13222417Sjulian\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14222417Sjulian\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15222417Sjulian\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16222417Sjulian\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17222417Sjulian\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18222417Sjulian\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19222417Sjulian\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20222417Sjulian\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21222417Sjulian\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22222417Sjulian\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23222417Sjulian\ SUCH DAMAGE.
24222417Sjulian\ 
25222417Sjulian\ $FreeBSD: head/sys/boot/forth/brand.4th 222417 2011-05-28 08:50:38Z julian $
26222417Sjulian
27222417Sjulianmarker task-brand.4th
28222417Sjulian
29222417Sjulianvariable brandX
30222417Sjulianvariable brandY
31222417Sjulian
32222417Sjulian\ Initialize logo placement
33222417Sjulian2 brandX !
34222417Sjulian1 brandY !
35222417Sjulian
36222417Sjulian: fbsd-logo ( x y -- ) \ "FreeBSD" [wide] logo in B/W (7 rows x 42 columns)
37222417Sjulian
38222417Sjulian	2dup at-xy ."  ______               ____   _____ _____  " 1+
39222417Sjulian	2dup at-xy ." |  ____|             |  _ \ / ____|  __ \ " 1+
40222417Sjulian	2dup at-xy ." | |___ _ __ ___  ___ | |_) | (___ | |  | |" 1+
41222417Sjulian	2dup at-xy ." |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |" 1+
42222417Sjulian	2dup at-xy ." | |   | | |  __/  __/| |_) |____) | |__| |" 1+
43222417Sjulian	2dup at-xy ." | |   | | |    |    ||     |      |      |" 1+
44222417Sjulian	     at-xy ." |_|   |_|  \___|\___||____/|_____/|_____/ "
45222417Sjulian
46222417Sjulian	\ Put the cursor back at the bottom
47222417Sjulian	0 25 at-xy
48222417Sjulian;
49222417Sjulian
50222417Sjulian\ This function draws any number of company logos at (loader_brand_x,
51222417Sjulian\ loader_brand_y) if defined, or (2,1) (top-left) if not defined. To choose
52222417Sjulian\ your logo, set the variable `loader_brand' to the respective logo name.
53222417Sjulian\ 
54222417Sjulian\ Currently available:
55222417Sjulian\
56222417Sjulian\ 	NAME        DESCRIPTION
57222417Sjulian\ 	fbsd        FreeBSD logo
58222417Sjulian\ 
59222417Sjulian\ NOTE: Setting `loader_brand' to an undefined value (such as "none") will
60222417Sjulian\       prevent any brand from being drawn.
61222417Sjulian\ 
62222417Sjulian: draw-brand ( -- )
63222417Sjulian
64222417Sjulian	s" loader_brand_x" getenv dup -1 <> if
65222417Sjulian		?number 1 = if
66222417Sjulian			brandX !
67222417Sjulian		then
68222417Sjulian	else
69222417Sjulian		drop
70222417Sjulian	then
71222417Sjulian
72222417Sjulian 	s" loader_brand_y" getenv dup -1 <> if
73222417Sjulian 		?number 1 = if
74222417Sjulian			brandY !
75222417Sjulian		then
76222417Sjulian 	else
77222417Sjulian		drop
78222417Sjulian	then
79222417Sjulian
80222417Sjulian	s" loader_brand" getenv dup -1 = if
81222417Sjulian		brandX @ brandY @ fbsd-logo
82222417Sjulian		drop exit
83222417Sjulian	then
84222417Sjulian
85222417Sjulian	2dup s" fbsd" compare-insensitive 0= if
86222417Sjulian		brandX @ brandY @ fbsd-logo
87222417Sjulian		2drop exit
88222417Sjulian	then
89222417Sjulian
90222417Sjulian	2drop
91222417Sjulian;
92