diff options
Diffstat (limited to 'sys/boot/forth/brand.4th')
-rw-r--r-- | sys/boot/forth/brand.4th | 92 |
1 files changed, 32 insertions, 60 deletions
diff --git a/sys/boot/forth/brand.4th b/sys/boot/forth/brand.4th index 28d3c5c..39a9bfa 100644 --- a/sys/boot/forth/brand.4th +++ b/sys/boot/forth/brand.4th @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske <dteske@FreeBSD.org> +\ Copyright (c) 2006-2015 Devin Teske <dteske@FreeBSD.org> \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -29,74 +29,46 @@ marker task-brand.4th variable brandX variable brandY -\ Initialize logo placement +\ Initialize brand placement to defaults 2 brandX ! 1 brandY ! -: fbsd-logo ( 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 ." |_| |_| \___|\___||____/|_____/|_____/ " - - \ Put the cursor back at the bottom - 0 25 at-xy -; - -\ This function draws any number of company logos at (loader_brand_x, -\ loader_brand_y) if defined, or (2,1) (top-left) if not defined. To choose -\ your logo, set the variable `loader_brand' to the respective logo name. +\ This function draws any number of company brands at (loader_brand_x, +\ loader_brand_y) if defined, or (2,1) (top-left). To choose your brand, set +\ the variable `loader_brand' to the respective brand name. \ -\ Currently available: -\ -\ NAME DESCRIPTION -\ fbsd FreeBSD logo +\ NOTE: Each is defined as a brand function in /boot/brand-${loader_brand}.4th +\ NOTE: If `/boot/brand-${loader_brand}.4th' does not exist or does not define +\ a `brand' function, no brand is drawn. \ -\ NOTE: Setting `loader_brand' to the value of an existing function -\ (such as "mycustom-brand") will cause that symbol to be executed. -\ NOTE: Setting `loader_brand' to an undefined value (such as "none") will -\ prevent any brand from being drawn. -\ -: draw-brand ( -- ) +: draw-brand ( -- ) \ at (loader_brand_x,loader_brand_y), else (2,1) s" loader_brand_x" getenv dup -1 <> if - ?number 1 = if - brandX ! - then - else - drop - then - + ?number 1 = if brandX ! then + else drop then s" loader_brand_y" getenv dup -1 <> if - ?number 1 = if - brandY ! - then - else - drop - then + ?number 1 = if brandY ! then + else drop then - s" loader_brand" getenv dup -1 = if - brandX @ brandY @ fbsd-logo - drop exit - then + \ If `brand' is defined, execute it + s" brand" sfind ( -- xt|0 bool ) if + brandX @ brandY @ rot execute + else + \ Not defined; try-include desired brand file + drop ( xt = 0 ) \ cruft + s" loader_brand" getenv dup -1 = over 0= or if + dup 0= if 2drop else drop then \ getenv result unused + s" try-include /boot/brand-fbsd.4th" + else + 2drop ( c-addr/u -- ) \ getenv result unused + s" try-include /boot/brand-${loader_brand}.4th" + then + evaluate + 1 spaces - 2dup s" fbsd" compare-insensitive 0= if - brandX @ brandY @ fbsd-logo - 2drop exit + \ Execute `brand' if defined now + s" brand" sfind if + brandX @ brandY @ rot execute + else drop then then - - \ if it refers to a raw symbol then run that function - sfind if - brandX @ brandY @ - 2 roll - execute - else - drop - then - - 2drop ; |