1 \ Copyright (c) 2003 Scott Long <scottl@FreeBSD.org>
2 \ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com>
3 \ Copyright (c) 2006-2015 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 only forth definitions
36 \ Initialize logo placement to defaults
40 \ This function draws any number of beastie logos at (loader_logo_x,
41 \ loader_logo_y) if defined, else (46,4) (to the right of the menu). To choose
42 \ your beastie, set the variable `loader_logo' to the respective logo name.
44 \ NOTE: Each is defined as a logo function in /boot/logo-${loader_logo}.4th
45 \ NOTE: If `/boot/logo-${loader_logo}.4th' does not exist or does not define
46 \ a `logo' function, no beastie is drawn.
48 : draw-beastie ( -- ) \ at (loader_logo_x,loader_logo_y), else (46,4)
50 s" loader_logo_x" getenv dup -1 <> if
51 ?number 1 = if logoX ! then
53 s" loader_logo_y" getenv dup -1 <> if
54 ?number 1 = if logoY ! then
58 \ If `logo' is defined, execute it
59 s" logo" sfind ( -- xt|0 bool ) if
60 logoX @ logoY @ rot execute
62 \ Not defined; try-include desired logo file
63 drop ( xt = 0 ) \ cruft
64 s" loader_logo" getenv dup -1 = over 0= or if
65 dup 0= if 2drop else drop then \ getenv result unused
67 s" try-include /boot/logo-orb.4th"
69 s" try-include /boot/logo-orbbw.4th"
72 2drop ( c-addr/u -- ) \ getenv result unused
73 s" try-include /boot/logo-${loader_logo}.4th"
78 \ Execute `logo' if defined now
80 logoX @ logoY @ rot execute
85 also support-functions
87 : beastie-start ( -- ) \ starts the menu
88 s" beastie_disable" getenv dup -1 <> if
89 s" YES" compare-insensitive 0= if
95 exit \ to autoboot (default)
99 s" loader_delay" getenv -1 = if
100 s" include /boot/menu.rc" evaluate
103 ." Loading Menu (Ctrl-C to Abort)" cr
104 s" set delay_command='include /boot/menu.rc'" evaluate
105 s" set delay_showdots" evaluate
110 only forth definitions