1 \ Copyright (c) 2003 Scott Long <scottl@freebsd.org>
2 \ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com>
3 \ Copyright (c) 2006-2013 Devin Teske <dteske@FreeBSD.org>
6 \ Redistribution and use in source and binary forms, with or without
7 \ modification, are permitted provided that the following conditions
9 \ 1. Redistributions of source code must retain the above copyright
10 \ notice, this list of conditions and the following disclaimer.
11 \ 2. Redistributions in binary form must reproduce the above copyright
12 \ notice, this list of conditions and the following disclaimer in the
13 \ documentation and/or other materials provided with the distribution.
15 \ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 \ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 \ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 \ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 \ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 \ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 \ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 \ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 \ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 \ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 marker task-beastie.4th
31 include /boot/delay.4th
36 \ Initialize logo placement to defaults
40 : beastie-logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns)
42 2dup at-xy ."
\e[31m, ," 1+
43 2dup at-xy ." /( )`" 1+
44 2dup at-xy ." \ \___ / |" 1+
45 2dup at-xy ." /-
\e[37m_
\e[31m `-/ '" 1+
46 2dup at-xy ." (
\e[37m/\/ \
\e[31m \ /\" 1+
47 2dup at-xy ."
\e[37m/ / |
\e[31m ` \" 1+
48 2dup at-xy ."
\e[34mO O
\e[37m)
\e[31m/ |" 1+
49 2dup at-xy ."
\e[37m`-^--'
\e[31m`< '" 1+
50 2dup at-xy ." (_.) _ ) /" 1+
51 2dup at-xy ." `.___/` /" 1+
52 2dup at-xy ." `-----' /" 1+
53 2dup at-xy ."
\e[33m<----.
\e[31m __ / __ \" 1+
54 2dup at-xy ."
\e[33m<----|====
\e[31mO)))
\e[33m==
\e[31m) \) /
\e[33m====|" 1+
55 2dup at-xy ."
\e[33m<----'
\e[31m `--' `.__,' \" 1+
57 2dup at-xy ." \ / /\" 1+
58 2dup at-xy ."
\e[36m______
\e[31m( (_ / \______/" 1+
59 2dup at-xy ."
\e[36m,' ,-----' |" 1+
60 at-xy ." `--{__________)
\e[37m"
62 \ Put the cursor back at the bottom
66 : beastiebw-logo ( x y -- ) \ B/W BSD mascot (19 rows x 34 columns)
69 2dup at-xy ." /( )`" 1+
70 2dup at-xy ." \ \___ / |" 1+
71 2dup at-xy ." /- _ `-/ '" 1+
72 2dup at-xy ." (/\/ \ \ /\" 1+
73 2dup at-xy ." / / | ` \" 1+
74 2dup at-xy ." O O ) / |" 1+
75 2dup at-xy ." `-^--'`< '" 1+
76 2dup at-xy ." (_.) _ ) /" 1+
77 2dup at-xy ." `.___/` /" 1+
78 2dup at-xy ." `-----' /" 1+
79 2dup at-xy ." <----. __ / __ \" 1+
80 2dup at-xy ." <----|====O)))==) \) /====|" 1+
81 2dup at-xy ." <----' `--' `.__,' \" 1+
83 2dup at-xy ." \ / /\" 1+
84 2dup at-xy ." ______( (_ / \______/" 1+
85 2dup at-xy ." ,' ,-----' |" 1+
86 at-xy ." `--{__________)"
88 \ Put the cursor back at the bottom
92 : fbsdbw-logo ( x y -- ) \ "FreeBSD" logo in B/W (13 rows x 21 columns)
94 \ We used to use the beastie himself as our default... until the
95 \ eventual complaint derided his reign of the advanced boot-menu.
97 \ This is the replacement of beastie to satiate the haters of our
98 \ beloved helper-daemon (ready to track down and spear bugs with
99 \ his trident and sporty sneakers; see above).
101 \ Since we merely just changed the default and not the default-
102 \ location, below is an adjustment to the passed-in coordinates,
103 \ forever influenced by the proper location of beastie himself
104 \ kept as the default loader_logo_x/loader_logo_y values.
108 2dup at-xy ." ______" 1+
109 2dup at-xy ." | ____| __ ___ ___ " 1+
110 2dup at-xy ." | |__ | '__/ _ \/ _ \" 1+
111 2dup at-xy ." | __|| | | __/ __/" 1+
112 2dup at-xy ." | | | | | | |" 1+
113 2dup at-xy ." |_| |_| \___|\___|" 1+
114 2dup at-xy ." ____ _____ _____" 1+
115 2dup at-xy ." | _ \ / ____| __ \" 1+
116 2dup at-xy ." | |_) | (___ | | | |" 1+
117 2dup at-xy ." | _ < \___ \| | | |" 1+
118 2dup at-xy ." | |_) |____) | |__| |" 1+
119 2dup at-xy ." | | | |" 1+
120 at-xy ." |____/|_____/|_____/"
122 \ Put the cursor back at the bottom
126 : tribute-art ( x y -- ) \ see tribute[bw]-logo
128 \ Disable the brand art (we're going to use that space)
129 s" set loader_brand=none" evaluate
131 \ Blank out the frame of the menu and move the title to left
132 s" set loader_menu_title=" evaluate
133 s" set loader_menu_frame=none" evaluate
135 \ Move the menu to the center of the screen
136 s" set loader_menu_x=26" evaluate
137 s" set loader_menu_y=12" evaluate
138 s" set loader_menu_timeout_x=21" evaluate
139 s" set loader_menu_timeout_y=24" evaluate
141 2 - swap 39 - swap \ top-left (see `fbsdbw-logo' comments above)
143 2dup at-xy 11 spaces ." ,d b." 1+
144 2dup at-xy ." ,d88] [88b." 1+
145 2dup at-xy ." ,d888P" 34 emit ." ,d88b. " 34 emit ." Y888b." 1+
146 2dup at-xy ." , <888P" 34 emit ." ,dP" 34 emit ." ,db." 34 emit
147 ." Yb. " 34 emit ." Y888> ," 1+
148 2dup at-xy ." <88b.~ ,d888 " 34 emit ." YP" 34 emit
150 2dup at-xy ." ," 34 emit ." Y888888P" 34 emit ." ,db.,db." 34 emit
151 ." Y888888P" 34 emit ." ," 1+
152 2dup at-xy ." <88b." 34 emit ." YP" 34 emit ." _ " 34 emit
153 ." YP" 34 emit 34 emit ." YP" 34 emit ." _ " 34 emit
154 ." YP" 34 emit ." ,d88>" 1+
155 2dup at-xy ." " 34 emit ." Y88b.,dP Yb.,d88P" 34 emit 1+
156 at-xy ." " 34 emit ." YP" 34 emit ." " 34 emit
160 : tribute-text ( x y -- ) \ see tribute[bw]-logo
162 swap 2 - swap \ beastie adjustment (see `fbsdbw-logo' comments above)
164 2dup at-xy ." CEO Workstation" 1+
166 2dup at-xy ." Nakatomi Socrates FreeBSD 9.2" 1+
167 2dup at-xy ." Z-Level Central Core" 1+
169 at-xy ." Preliminary Clearance Approved."
172 : tribute-logo ( x y -- ) \ color Socrates tribute (16 rows x 32 columns)
174 \ Produce the tribute art in bright green
175 2dup at-xy ."
\e[32;1m" 2dup tribute-art ."
\e[37m"
177 \ Produce the tribute text in regular green
178 2dup at-xy ."
\e[32m" 2dup tribute-text ."
\e[37m"
180 \ Distinguish the ``Free'' in tribute-text
181 2 + swap 16 + swap at-xy ." Free"
183 \ Put the cursor back at the bottom
187 : tributebw-logo ( x y -- ) \ Socrates tribute (16 rows x 32 columns)
189 \ Produce the tribute art and text
190 2dup tribute-art tribute-text
192 \ Put the cursor back at the bottom
196 : orb-logo ( x y -- ) \ color Orb mascot (15 rows x 30 columns)
198 3 + \ beastie adjustment (see `fbsdbw-logo' comments above)
200 2dup at-xy ."
\e[31m```
\e[31;1m`
\e[31m" 1+
201 2dup at-xy ." s` `.....---...
\e[31;1m....--.``` -/
\e[31m" 1+
202 2dup at-xy ." +o .--`
\e[31;1m/y:` +.
\e[31m" 1+
203 2dup at-xy ." yo`:.
\e[31;1m:o `+-
\e[31m" 1+
204 2dup at-xy ." y/
\e[31;1m-/` -o/
\e[31m" 1+
205 2dup at-xy ." .-
\e[31;1m::/sy+:.
\e[31m" 1+
206 2dup at-xy ." /
\e[31;1m`-- /
\e[31m" 1+
207 2dup at-xy ." `:
\e[31;1m:`
\e[31m" 1+
208 2dup at-xy ." `:
\e[31;1m:`
\e[31m" 1+
209 2dup at-xy ." /
\e[31;1m/
\e[31m" 1+
210 2dup at-xy ." .-
\e[31;1m-.
\e[31m" 1+
211 2dup at-xy ." --
\e[31;1m-.
\e[31m" 1+
212 2dup at-xy ." `:`
\e[31;1m`:`" 1+
213 2dup at-xy ."
\e[31;1m.-- `--." 1+
214 at-xy ." .---.....----.
\e[37m"
216 \ Put the cursor back at the bottom
220 : orbbw-logo ( x y -- ) \ B/W Orb mascot (15 rows x 32 columns)
222 3 + \ beastie adjustment (see `fbsdbw-logo' comments above)
224 2dup at-xy ." ``` `" 1+
225 2dup at-xy ." s` `.....---.......--.``` -/" 1+
226 2dup at-xy ." +o .--` /y:` +." 1+
227 2dup at-xy ." yo`:. :o `+-" 1+
228 2dup at-xy ." y/ -/` -o/" 1+
229 2dup at-xy ." .- ::/sy+:." 1+
230 2dup at-xy ." / `-- /" 1+
231 2dup at-xy ." `: :`" 1+
232 2dup at-xy ." `: :`" 1+
233 2dup at-xy ." / /" 1+
234 2dup at-xy ." .- -." 1+
235 2dup at-xy ." -- -." 1+
236 2dup at-xy ." `:` `:`" 1+
237 2dup at-xy ." .-- `--." 1+
238 at-xy ." .---.....----."
240 \ Put the cursor back at the bottom
244 \ This function draws any number of beastie logos at (loader_logo_x,
245 \ loader_logo_y) if defined, else (46,4) (to the right of the menu). To choose
246 \ your beastie, set the variable `loader_logo' to the respective logo name.
248 \ Currently available:
251 \ beastie Color ``Helper Daemon'' mascot (19 rows x 34 columns)
252 \ beastiebw B/W ``Helper Daemon'' mascot (19 rows x 34 columns)
253 \ fbsdbw "FreeBSD" logo in B/W (13 rows x 21 columns)
254 \ orb Color ``Orb'' mascot (15 rows x 30 columns) (2nd default)
255 \ orbbw B/W ``Orb'' mascot (15 rows x 32 columns)
256 \ tribute Color ``Tribute'' (must fit 19 rows x 34 columns) (default)
257 \ tributebw B/W ``Tribute'' (must fit 19 rows x 34 columns)
259 \ NOTE: Setting `loader_logo' to an undefined value (such as "none") will
260 \ prevent beastie from being drawn.
262 : draw-beastie ( -- ) \ at (loader_logo_x,loader_logo_y), else (46,4)
264 s" loader_logo_x" getenv dup -1 <> if
265 ?number 1 = if logoX ! then
269 s" loader_logo_y" getenv dup -1 <> if
270 ?number 1 = if logoY ! then
275 s" loader_logo" getenv dup -1 = if
285 2dup s" beastie" compare-insensitive 0= if
286 logoX @ logoY @ beastie-logo
289 2dup s" beastiebw" compare-insensitive 0= if
290 logoX @ logoY @ beastiebw-logo
293 2dup s" fbsdbw" compare-insensitive 0= if
294 logoX @ logoY @ fbsdbw-logo
297 2dup s" orb" compare-insensitive 0= if
298 logoX @ logoY @ orb-logo
301 2dup s" orbbw" compare-insensitive 0= if
302 logoX @ logoY @ orbbw-logo
305 2dup s" tribute" compare-insensitive 0= if
307 s" tribute-logo" sfind if
314 2dup s" tributebw" compare-insensitive 0= if
316 s" tributebw-logo" sfind if
327 : clear-beastie ( -- ) \ clears beastie from the screen
329 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
330 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
331 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
332 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
333 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
334 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
335 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
336 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
337 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
338 2dup at-xy 34 spaces 2drop
340 \ Put the cursor back at the bottom
344 : beastie-start ( -- ) \ starts the menu
345 s" beastie_disable" getenv
347 s" YES" compare-insensitive 0= if
354 s" loader_delay" getenv
356 s" include /boot/menu.rc" evaluate
359 ." Loading Menu (Ctrl-C to Abort)" cr
360 s" set delay_command='include /boot/menu.rc'" evaluate
361 s" set delay_showdots" evaluate