Lines Matching +full:1 +full:c
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>
9 \ 1. Redistributions of source code must retain the above copyright
51 1 constant menu_start \ Numerical prefix of first menu item
143 : arch-i386? ( -- BOOL ) \ Returns TRUE (-1) on i386, FALSE (0) otherwise.
151 dup -1 = if
160 dup -1 <> if
170 : +c! ( N C-ADDR/U K -- C-ADDR/U )
171 3 pick 3 pick ( n c-addr/u k -- n c-addr/u k n c-addr )
172 rot + c! ( n c-addr/u k n c-addr -- n c-addr/u )
173 rot drop ( n c-addr/u -- c-addr/u )
179 : namespace ( C-ADDR/U N -- ) also menu-namespace +c! evaluate previous ;
184 : init_textN ( N -- C-ADDR ) s" init_textN" 9 namespace ;
187 : kernel[x] ( N -- C-ADDR/U ) s" kernel[x]" 7 +c! ;
188 : menu_init[x] ( N -- C-ADDR/U ) s" menu_init[x]" 10 +c! ;
189 : menu_command[x] ( N -- C-ADDR/U ) s" menu_command[x]" 13 +c! ;
190 : menu_caption[x] ( N -- C-ADDR/U ) s" menu_caption[x]" 13 +c! ;
191 : ansi_caption[x] ( N -- C-ADDR/U ) s" ansi_caption[x]" 13 +c! ;
192 : menu_keycode[x] ( N -- C-ADDR/U ) s" menu_keycode[x]" 13 +c! ;
193 : toggled_text[x] ( N -- C-ADDR/U ) s" toggled_text[x]" 13 +c! ;
194 : toggled_ansi[x] ( N -- C-ADDR/U ) s" toggled_ansi[x]" 13 +c! ;
195 : menu_caption[x][y] ( N M -- C-ADDR/U ) s" menu_caption[x][y]" 16 +c! 13 +c! ;
196 : ansi_caption[x][y] ( N M -- C-ADDR/U ) s" ansi_caption[x][y]" 16 +c! 13 +c! ;
210 menurow dup @ 1+ swap ! ( increment menurow )
211 menuidx dup @ 1+ swap ! ( increment menuidx )
225 \ Move the cursor forward 1 column
226 dup menuX @ 1+ swap at-xy
240 \ to the stack (decimal ASCII for `1' is 49) as a "return value"
245 \ ACPI option is to be presented to the user, otherwise returns -1. Used
248 : acpimenuitem ( -- C-Addr/U | -1 )
266 menuidx dup @ 1+ swap ! ( increment menuidx )
267 -1
270 -1
274 : delim? ( C -- BOOL )
275 dup 32 = ( c -- c bool ) \ [sp] space
276 over 9 = or ( c bool -- c bool ) \ [ht] horizontal tab
277 over 10 = or ( c bool -- c bool ) \ [nl] newline
278 over 13 = or ( c bool -- c bool ) \ [cr] carriage return
279 over [char] , = or ( c bool -- c bool ) \ comma
280 swap drop ( c bool -- bool ) \ return boolean
293 s" kernels" getenv dup -1 = if
296 then ( -- c-addr/u )
300 s" kernel_state" evaluate @ 48 + s" kernel[N]" 7 +c! getenv
301 dup -1 <> if
302 s" kernel" getenv dup -1 = if
312 s" kernel" getenv dup -1 = if
316 then ( c-addr/u -- c-addr/u c-addr/u,-1 | 0 )
318 kerndefault 1+ 0 2swap strcat swap 1- c!
327 1+ dup [char] 8 >
338 over c@ delim? ( c-addr/u -- c-addr/u bool )
340 false ( c-addr/u -- c-addr/u bool )
343 1- swap 1+ swap ( c-addr/u -- c-addr'/u' )
345 ( c-addr/u -- c-addr'/u' )
348 2drop ( c-addr/u -- )
354 s" kernel" getenv dup -1 = if
356 then ( -- c-addr/u )
361 2dup ( c-addr/u -- c-addr/u c-addr/u )
363 over c@ delim? if
366 kernlen @ 1+ kernlen ! \ incrememnt
367 1- swap 1+ swap \ c-addr++ u--
370 2drop ( c-addr/u c-addr'/u' -- c-addr/u )
382 ( c-addr/u -- c-addr'/u' )
387 over kernlen @ ( c-addr/u -- c-addr/u c-addr/u2 )
399 kerncapbuf 0 s" @[1mK@[mernel: " [char] @ escc! strcat
403 s" @[34;1m"
411 2drop ( c-addr/u c-addr/u2 -- c-addr/u )
413 kernmenuidx @ 1+ dup kernmenuidx ! [char] 8 > if
414 2drop ( c-addr/u -- ) exit
417 kernlen @ - swap kernlen @ + swap ( c-addr/u -- c-addr'/u' )
427 [char] 0 s" (Y of Z)" ( x -- x y c-addr/u )
428 kernmenuidx @ -rot 7 +c! \ Replace 'Z' with number of kernels parsed
430 2 pick 1+ -rot 2 +c! \ Replace 'Y' with current ASCII num
432 2over menu_caption[x][y] getenv dup -1 <> if
433 2dup + 1- c@ [char] ) = if
444 2over ansi_caption[x][y] getenv dup -1 <> if
445 2dup + 1- c@ [char] ) = if
456 rot 1+ dup [char] 8 > if
471 s" loader_menu_title" getenv dup -1 = if
475 s" loader_menu_title_align" getenv dup -1 <> if
476 2dup s" left" compare-insensitive 0= if ( 1 )
477 2drop ( c-addr/u ) drop ( bool )
478 menuX @ menuY @ 1-
480 else ( 1 ) 2dup s" right" compare-insensitive 0= if ( 2 )
481 2drop ( c-addr/u ) drop ( bool )
482 menuX @ 42 + 4 - over - menuY @ 1-
484 else ( 2 ) 2drop ( c-addr/u ) then ( 1 ) then
489 menuX @ 19 + over 2 / - menuY @ 1-
491 swap 1- swap
502 s" menu_init" getenv dup -1 <> if
515 \ screen consisting of the first digit (ie. 1 for the tenth menu item)
527 s" menu_acpi" getenv -1 <> if
528 c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' )
546 s" menu_kernel" getenv -1 <> if
547 c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' )
555 dup kernmenuidx @ 1- > if
564 17 +c! 34 +c! 37 +c! evaluate
565 ( n y y n n c-addr/u -- n y )
570 17 +c! 34 +c! 37 +c! evaluate
571 ( n y y n n c-addr/u -- n y )
587 s" menu_options" getenv -1 <> if
588 c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' )
599 1- menuidx ! \ Initialize the starting index for the menu
602 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
607 s" menu_reboot" getenv -1 <> if
617 s" menu_optionstext" getenv dup -1 <> if
626 dup acpimenuitem ( n -- n n c-addr/u | n n -1 )
627 dup -1 <> if
628 13 +c! ( n n c-addr/u -- n c-addr/u )
631 swap drop ( n n -1 -- n -1 )
637 1 swap !
641 getenv dup -1 <> if
658 dup -1 <> if
660 getenv dup -1 <> if
661 printmenuitem ( c-addr/u -- n )
670 1+ dup 56 > \ add 1 to iterator, continue if less than 57
676 s" menu_reboot" getenv -1 <> if
698 s" Autoboot in N seconds. [Space] to pause" ( n -- n c-addr/u )
701 rot 48 + -rot ( n c-addr/u -- n' c-addr/u ) \ convert to ASCII
702 12 +c! ( n' c-addr/u -- c-addr/u ) \ replace 'N' above
705 type ( c-addr/u -- ) \ print message
708 spaces ( n c-addr/u -- n c-addr ) \ erase message
709 2drop ( n c-addr -- )
724 menu_timeout_enabled @ 1 = if
729 \ At least 1 second has elapsed since last loop
737 1- ( decrement counter: N -- N )
758 -1 = if
797 : menu-erase ( -- ) \ Erases menu and resets positioning variable to position 1.
801 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
802 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
803 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
804 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
805 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
806 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces
810 menu_start 1- menuidx !
824 dup init_textN c@ 0= if
828 \ loader_color?=1) is available since we would not have been
838 getenv dup -1 <> if
840 2 pick ( n c-addr/u -- n c-addr/u n )
841 init_textN ( n c-addr/u n -- n c-addr/u c-addr )
843 \ now we have the buffer c-addr on top
844 \ ( followed by c-addr/u of current caption )
847 2dup c! -rot \ store strlen at first byte
849 rot 1+ \ bring alt addr to top and increment
851 2dup c@ swap c! \ copy current character
852 1+ \ increment buffer addr
853 rot 1- \ bring buffer len to top and decrement
882 getenv dup -1 <> if
884 2 pick ( n c-addr/u -- n c-addr/u n ) \ key pressed
893 drop ( n -1 -- n ) \ getenv cruft
900 dup init_textN count ( n -- n c-addr/u )
903 2 pick ( n c-addr/u -- n c-addr/u n ) \ key pressed
923 dup cycle_stateN dup @ 1+ \ get value and increment
939 ( n addr k n k' -- n addr k c-addr/u )
945 getenv dup -1 = if
948 drop ( n addr k -1 -- n addr k ) \ getenv cruft
957 ( n addr 0 n 48 -- n addr 0 c-addr/u )
958 getenv dup -1 = if
971 \ c-addr/u - string value we intend to store to menu_caption[x]
977 4 pick ( n addr k c-addr/u -- n addr k c-addr/u n )
1002 s" loader_menu_frame" getenv dup -1 = if ( 1 )
1004 else ( 1 ) 2dup s" single" compare-insensitive 0= if ( 2 )
1010 ( 4 ) then ( 3 ) then ( 2 ) then ( 1 ) then
1012 42 13 menuX @ 3 - menuY @ 1- box \ Draw frame (w,h,x,y)
1021 1- menuidx ! \ Initialize the starting index for the menu
1025 s" loader_menu_y" getenv dup -1 = if
1035 s" loader_menu_x" getenv dup -1 = if
1059 s" menu_timeout_command" getenv -1 <> if ( Addr C -1 -- | Addr )
1064 1 menu_timeout_enabled ! ( enable automatic timeout )
1067 s" autoboot_delay" getenv dup -1 = if
1068 drop \ no custom duration (remove dup'd bunk -1)
1093 menu_timeout_enabled @ 1 = if
1095 s" loader_menu_timeout_x" getenv dup -1 = if
1107 s" loader_menu_timeout_y" getenv dup -1 = if
1127 dup -1 = if
1144 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
1154 1+
1160 getenv dup -1 <> if
1181 menuacpi @ 1+ over 2dup < -rot = or
1183 1-
1195 getenv dup -1 = if
1202 getenv dup -1 <> if
1217 1+ dup 56 > \ increment iterator
1231 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
1246 1+ dup 57 >
1253 0 over init_textN c! \ used by toggle_menuitem
1256 1+ dup 56 > \ increment, continue if less than 57
1318 0 init_text1 c!
1319 0 init_text2 c!
1320 0 init_text3 c!
1321 0 init_text4 c!
1322 0 init_text5 c!
1323 0 init_text6 c!
1324 0 init_text7 c!
1325 0 init_text8 c!