Eliminate literal escape sequences from *.4th

Suggested by:	alfred
MFC after:	3 days
X-MFC-to:	stable/10
This commit is contained in:
Devin Teske 2015-04-02 01:48:12 +00:00
parent 011ac1b05a
commit 914ff88ad6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280975
8 changed files with 154 additions and 93 deletions

View File

@ -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
;

View File

@ -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 ." , ," 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" @[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
;

View File

@ -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
;

View File

@ -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
;

View File

@ -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 ." ``` `" 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" @[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
;

View File

@ -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
;

View File

@ -395,14 +395,15 @@ also menu-infrastructure definitions
setenv
\ Assign third to ansi_caption[x][y]
kerncapbuf 0 s" Kernel: " strcat
kerncapbuf 0 s" @[1mK@[37mernel: " [char] @ escc! strcat
kernmenuidx @ [char] 0 = if
s" default/"
s" default/@[32m"
else
s" "
then strcat
s" @[34;1m"
then
[char] @ escc! strcat
2over strcat
s" " strcat
s" @[37m" [char] @ escc! strcat
kernidx @ kernmenuidx @ ansi_caption[x][y]
setenv

View File

@ -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
;