diff options
author | dteske <dteske@FreeBSD.org> | 2015-04-02 01:48:12 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2015-04-02 01:48:12 +0000 |
commit | 5336373e3777aad3edd230be3d6d7112ebb93c49 (patch) | |
tree | e08aea7d72781de3971ff65c2d7c5e9aa6ddb957 /sys/boot/forth | |
parent | d64a11d9ba55447d3deed5ec4e589a139b6a7c87 (diff) | |
download | FreeBSD-src-5336373e3777aad3edd230be3d6d7112ebb93c49.zip FreeBSD-src-5336373e3777aad3edd230be3d6d7112ebb93c49.tar.gz |
Eliminate literal escape sequences from *.4th
Suggested by: alfred
MFC after: 3 days
X-MFC-to: stable/10
Diffstat (limited to 'sys/boot/forth')
-rw-r--r-- | sys/boot/forth/brand-fbsd.4th | 22 | ||||
-rw-r--r-- | sys/boot/forth/logo-beastie.4th | 47 | ||||
-rw-r--r-- | sys/boot/forth/logo-beastiebw.4th | 46 | ||||
-rw-r--r-- | sys/boot/forth/logo-fbsdbw.4th | 34 | ||||
-rw-r--r-- | sys/boot/forth/logo-orb.4th | 39 | ||||
-rw-r--r-- | sys/boot/forth/logo-orbbw.4th | 38 | ||||
-rw-r--r-- | sys/boot/forth/menu.4th | 11 | ||||
-rw-r--r-- | sys/boot/forth/screen.4th | 10 |
8 files changed, 154 insertions, 93 deletions
diff --git a/sys/boot/forth/brand-fbsd.4th b/sys/boot/forth/brand-fbsd.4th index f06d47e..9cd017f 100644 --- a/sys/boot/forth/brand-fbsd.4th +++ b/sys/boot/forth/brand-fbsd.4th @@ -26,13 +26,21 @@ 2 brandX ! 1 brandY ! \ Initialize brand placement defaults +: brand+ ( x y c-addr/u -- x y' ) + 2swap 2dup at-xy 2swap \ position the cursor + type \ print to the screen + 1+ \ increase y for next time we're called +; + : brand ( 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 ." |_| |_| \___|\___||____/|_____/|_____/ " + s" ______ ____ _____ _____ " brand+ + s" | ____| | _ \ / ____| __ \ " brand+ + s" | |___ _ __ ___ ___ | |_) | (___ | | | |" brand+ + s" | ___| '__/ _ \/ _ \| _ < \___ \| | | |" brand+ + s" | | | | | __/ __/| |_) |____) | |__| |" brand+ + s" | | | | | | || | | |" brand+ + s" |_| |_| \___|\___||____/|_____/|_____/ " brand+ + + 2drop ; diff --git a/sys/boot/forth/logo-beastie.4th b/sys/boot/forth/logo-beastie.4th index 73601e9..671eb5e 100644 --- a/sys/boot/forth/logo-beastie.4th +++ b/sys/boot/forth/logo-beastie.4th @@ -28,25 +28,34 @@ 46 logoX ! 4 logoY ! \ Initialize logo placement defaults +: logo+ ( x y c-addr/u -- x y' ) + 2swap 2dup at-xy 2swap \ position the cursor + [char] @ escc! \ replace @ with Esc + type \ print to the screen + 1+ \ increase y for next time we're called +; + : logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns) -2dup at-xy ." [31m, ," 1+ -2dup at-xy ." /( )`" 1+ -2dup at-xy ." \ \___ / |" 1+ -2dup at-xy ." /- [37m_[31m `-/ '" 1+ -2dup at-xy ." ([37m/\/ \[31m \ /\" 1+ -2dup at-xy ." [37m/ / |[31m ` \" 1+ -2dup at-xy ." [34mO O [37m) [31m/ |" 1+ -2dup at-xy ." [37m`-^--'[31m`< '" 1+ -2dup at-xy ." (_.) _ ) /" 1+ -2dup at-xy ." `.___/` /" 1+ -2dup at-xy ." `-----' /" 1+ -2dup at-xy ." [33m<----.[31m __ / __ \" 1+ -2dup at-xy ." [33m<----|====[31mO)))[33m==[31m) \) /[33m====|" 1+ -2dup at-xy ." [33m<----'[31m `--' `.__,' \" 1+ -2dup at-xy ." | |" 1+ -2dup at-xy ." \ / /\" 1+ -2dup at-xy ." [36m______[31m( (_ / \______/" 1+ -2dup at-xy ." [36m,' ,-----' |" 1+ - at-xy ." `--{__________)[37m" + s" @[31m, ," logo+ + s" /( )`" logo+ + s" \ \___ / |" logo+ + s" /- @[m_@[31m `-/ '" logo+ + s" (@[m/\/ \@[31m \ /\" logo+ + s" @[m/ / |@[31m ` \" logo+ + s" @[34mO O @[m) @[31m/ |" logo+ + s" @[m`-^--'@[31m`< '" logo+ + s" (_.) _ ) /" logo+ + s" `.___/` /" logo+ + s" `-----' /" logo+ + s" @[33m<----.@[31m __ / __ \" logo+ + s" @[33m<----|====@[31mO)))@[33m==@[31m) \) /@[33m====|" logo+ + s" @[33m<----'@[31m `--' `.__,' \" logo+ + s" | |" logo+ + s" \ / /\" logo+ + s" @[36m______@[31m( (_ / \______/" logo+ + s" @[36m,' ,-----' |" logo+ + s" `--{__________)@[m" logo+ + + 2drop ; diff --git a/sys/boot/forth/logo-beastiebw.4th b/sys/boot/forth/logo-beastiebw.4th index 63e6130..197099c 100644 --- a/sys/boot/forth/logo-beastiebw.4th +++ b/sys/boot/forth/logo-beastiebw.4th @@ -27,25 +27,33 @@ 46 logoX ! 4 logoY ! \ Initialize logo placement defaults +: logo+ ( x y c-addr/u -- x y' ) + 2swap 2dup at-xy 2swap \ position the cursor + type \ print to the screen + 1+ \ increase y for next time we're called +; + : logo ( x y -- ) \ B/W BSD mascot (19 rows x 34 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+ - 2dup at-xy ." O O ) / |" 1+ - 2dup at-xy ." `-^--'`< '" 1+ - 2dup at-xy ." (_.) _ ) /" 1+ - 2dup at-xy ." `.___/` /" 1+ - 2dup at-xy ." `-----' /" 1+ - 2dup at-xy ." <----. __ / __ \" 1+ - 2dup at-xy ." <----|====O)))==) \) /====|" 1+ - 2dup at-xy ." <----' `--' `.__,' \" 1+ - 2dup at-xy ." | |" 1+ - 2dup at-xy ." \ / /\" 1+ - 2dup at-xy ." ______( (_ / \______/" 1+ - 2dup at-xy ." ,' ,-----' |" 1+ - at-xy ." `--{__________)" + s" , ," logo+ + s" /( )`" logo+ + s" \ \___ / |" logo+ + s" /- _ `-/ '" logo+ + s" (/\/ \ \ /\" logo+ + s" / / | ` \" logo+ + s" O O ) / |" logo+ + s" `-^--'`< '" logo+ + s" (_.) _ ) /" logo+ + s" `.___/` /" logo+ + s" `-----' /" logo+ + s" <----. __ / __ \" logo+ + s" <----|====O)))==) \) /====|" logo+ + s" <----' `--' `.__,' \" logo+ + s" | |" logo+ + s" \ / /\" logo+ + s" ______( (_ / \______/" logo+ + s" ,' ,-----' |" logo+ + s" `--{__________)" logo+ + + 2drop ; diff --git a/sys/boot/forth/logo-fbsdbw.4th b/sys/boot/forth/logo-fbsdbw.4th index 29dffc1..d4a532b 100644 --- a/sys/boot/forth/logo-fbsdbw.4th +++ b/sys/boot/forth/logo-fbsdbw.4th @@ -27,19 +27,27 @@ 52 logoX ! 9 logoY ! \ Initialize logo placement defaults +: logo+ ( x y c-addr/u -- x y' ) + 2swap 2dup at-xy 2swap \ position the cursor + type \ print to the screen + 1+ \ increase y for next time we're called +; + : logo ( x y -- ) \ "FreeBSD" logo in B/W (13 rows x 21 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+ - 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 ." |____/|_____/|_____/" + s" ______" logo+ + s" | ____| __ ___ ___ " logo+ + s" | |__ | '__/ _ \/ _ \" logo+ + s" | __|| | | __/ __/" logo+ + s" | | | | | | |" logo+ + s" |_| |_| \___|\___|" logo+ + s" ____ _____ _____" logo+ + s" | _ \ / ____| __ \" logo+ + s" | |_) | (___ | | | |" logo+ + s" | _ < \___ \| | | |" logo+ + s" | |_) |____) | |__| |" logo+ + s" | | | |" logo+ + s" |____/|_____/|_____/" logo+ + + 2drop ; diff --git a/sys/boot/forth/logo-orb.4th b/sys/boot/forth/logo-orb.4th index 74a89b7..c2a504d 100644 --- a/sys/boot/forth/logo-orb.4th +++ b/sys/boot/forth/logo-orb.4th @@ -26,21 +26,30 @@ 46 logoX ! 7 logoY ! \ Initialize logo placement defaults +: logo+ ( x y c-addr/u -- x y' ) + 2swap 2dup at-xy 2swap \ position the cursor + [char] @ escc! \ replace @ with Esc + type \ print to the screen + 1+ \ increase y for next time we're called +; + : logo ( x y -- ) \ color Orb mascot (15 rows x 30 columns) - 2dup at-xy ." [31m``` [31;1m`[31m" 1+ - 2dup at-xy ." s` `.....---...[31;1m....--.``` -/[31m" 1+ - 2dup at-xy ." +o .--` [31;1m/y:` +.[31m" 1+ - 2dup at-xy ." yo`:. [31;1m:o `+-[31m" 1+ - 2dup at-xy ." y/ [31;1m-/` -o/[31m" 1+ - 2dup at-xy ." .- [31;1m::/sy+:.[31m" 1+ - 2dup at-xy ." / [31;1m`-- /[31m" 1+ - 2dup at-xy ." `: [31;1m:`[31m" 1+ - 2dup at-xy ." `: [31;1m:`[31m" 1+ - 2dup at-xy ." / [31;1m/[31m" 1+ - 2dup at-xy ." .- [31;1m-.[31m" 1+ - 2dup at-xy ." -- [31;1m-.[31m" 1+ - 2dup at-xy ." `:` [31;1m`:`" 1+ - 2dup at-xy ." [31;1m.-- `--." 1+ - at-xy ." .---.....----.[37m" + s" @[31m``` @[31;1m`@[31m" logo+ + s" s` `.....---...@[31;1m....--.``` -/@[31m" logo+ + s" +o .--` @[31;1m/y:` +.@[31m" logo+ + s" yo`:. @[31;1m:o `+-@[31m" logo+ + s" y/ @[31;1m-/` -o/@[31m" logo+ + s" .- @[31;1m::/sy+:.@[31m" logo+ + s" / @[31;1m`-- /@[31m" logo+ + s" `: @[31;1m:`@[31m" logo+ + s" `: @[31;1m:`@[31m" logo+ + s" / @[31;1m/@[31m" logo+ + s" .- @[31;1m-.@[31m" logo+ + s" -- @[31;1m-.@[31m" logo+ + s" `:` @[31;1m`:`" logo+ + s" @[31;1m.-- `--." logo+ + s" .---.....----.@[m" logo+ + + 2drop ; diff --git a/sys/boot/forth/logo-orbbw.4th b/sys/boot/forth/logo-orbbw.4th index 9b613e6..11dc11c 100644 --- a/sys/boot/forth/logo-orbbw.4th +++ b/sys/boot/forth/logo-orbbw.4th @@ -26,21 +26,29 @@ 46 logoX ! 7 logoY ! \ Initialize logo placement defaults +: logo+ ( x y c-addr/u -- x y' ) + 2swap 2dup at-xy 2swap \ position the cursor + type \ print to the screen + 1+ \ increase y for next time we're called +; + : logo ( x y -- ) \ B/W Orb mascot (15 rows x 32 columns) - 2dup at-xy ." ``` `" 1+ - 2dup at-xy ." s` `.....---.......--.``` -/" 1+ - 2dup at-xy ." +o .--` /y:` +." 1+ - 2dup at-xy ." yo`:. :o `+-" 1+ - 2dup at-xy ." y/ -/` -o/" 1+ - 2dup at-xy ." .- ::/sy+:." 1+ - 2dup at-xy ." / `-- /" 1+ - 2dup at-xy ." `: :`" 1+ - 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 ." .---.....----." + s" ``` `" logo+ + s" s` `.....---.......--.``` -/" logo+ + s" +o .--` /y:` +." logo+ + s" yo`:. :o `+-" logo+ + s" y/ -/` -o/" logo+ + s" .- ::/sy+:." logo+ + s" / `-- /" logo+ + s" `: :`" logo+ + s" `: :`" logo+ + s" / /" logo+ + s" .- -." logo+ + s" -- -." logo+ + s" `:` `:`" logo+ + s" .-- `--." logo+ + s" .---.....----." logo+ + + 2drop ; diff --git a/sys/boot/forth/menu.4th b/sys/boot/forth/menu.4th index 4eab6ab..4d8aaee 100644 --- a/sys/boot/forth/menu.4th +++ b/sys/boot/forth/menu.4th @@ -395,14 +395,15 @@ also menu-infrastructure definitions setenv \ Assign third to ansi_caption[x][y] - kerncapbuf 0 s" [1mK[37mernel: " strcat + kerncapbuf 0 s" @[1mK@[37mernel: " [char] @ escc! strcat kernmenuidx @ [char] 0 = if - s" default/[32m" + s" default/@[32m" else - s" [34;1m" - then strcat + s" @[34;1m" + then + [char] @ escc! strcat 2over strcat - s" [37m" strcat + s" @[37m" [char] @ escc! strcat kernidx @ kernmenuidx @ ansi_caption[x][y] setenv diff --git a/sys/boot/forth/screen.4th b/sys/boot/forth/screen.4th index 1e0b7bf..e0af82b 100644 --- a/sys/boot/forth/screen.4th +++ b/sys/boot/forth/screen.4th @@ -62,3 +62,13 @@ marker task-screen.4th \ Disable inverse foreground/background mode ( Esc-[27m ) : -inv ( -- ) escc 27 .# [char] m emit ; + +\ Convert all occurrences of given character (c) in string (c-addr/u) to Esc +: escc! ( c-addr/u c -- c-addr/u ) + 2 pick 2 pick + begin dup 0> while + over c@ 3 pick = if over 27 swap c! then + 1- swap 1+ swap + repeat + 2drop drop +; |