summaryrefslogtreecommitdiffstats
path: root/sys/boot/forth/menu.4th
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-11-06 19:26:36 +0000
committerdteske <dteske@FreeBSD.org>2012-11-06 19:26:36 +0000
commit76b008123e94513a6df71a4377ffffcc6a62567f (patch)
tree60586d2ed15f7b544fd7bcefab8f26e751869b7f /sys/boot/forth/menu.4th
parent451c63e7275b9146f36d3e3e350d226eb8ccdc8e (diff)
downloadFreeBSD-src-76b008123e94513a6df71a4377ffffcc6a62567f.zip
FreeBSD-src-76b008123e94513a6df71a4377ffffcc6a62567f.tar.gz
Add ontop of my existing boot loader Forth code, including support for
submenus. See menusets.4th(8) for additional details including examples. Discussed on arch and recommended for inclusion at the devsummit. This change does not alter the appearance or user experience, only enhances possibilities. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor)
Diffstat (limited to 'sys/boot/forth/menu.4th')
-rw-r--r--sys/boot/forth/menu.4th21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/boot/forth/menu.4th b/sys/boot/forth/menu.4th
index f39131d..7d3de94 100644
--- a/sys/boot/forth/menu.4th
+++ b/sys/boot/forth/menu.4th
@@ -493,6 +493,10 @@ create init_text8 255 allot
\ Initialize "Reboot" menu state variable (prevents double-entry)
false menurebootadded !
+ menu_start
+ 1- menuidx ! \ Initialize the starting index for the menu
+ 0 menurow ! \ Initialize the starting position for the menu
+
49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
begin
\ If the "Options:" separator, print it.
@@ -841,6 +845,8 @@ create init_text8 255 allot
exit ( pedantic; never reached )
then
+ dup menureboot @ = if 0 reboot then
+
\ Evaluate the decimal ASCII value against known menu item
\ key associations and act accordingly
@@ -932,8 +938,7 @@ create init_text8 255 allot
\ continue if less than 57
until
drop \ loop iterator
-
- menureboot @ = if 0 reboot then
+ drop \ key pressed
again \ Non-operational key was pressed; repeat
;
@@ -1005,6 +1010,18 @@ create init_text8 255 allot
-rot 2dup 12 + c! rot \ replace 'N'
evaluate
+ s" 0 toggle_stateN !" \ used by toggle_menuitem
+ -rot 2dup 14 + c! rot \ replace 'N'
+ evaluate
+
+ s" 0 cycle_stateN !" \ used by cycle_menuitem
+ -rot 2dup 13 + c! rot \ replace 'N'
+ evaluate
+
+ s" 0 init_textN c!" \ used by toggle_menuitem
+ -rot 2dup 11 + c! rot \ replace 'N'
+ evaluate
+
1+ dup 56 > \ increment, continue if less than 57
until
drop \ iterator
OpenPOWER on IntegriCloud