Post by Carl on Mar 26, 2013 19:06:59 GMT
I have made a Menu that can easily be navigated with the Fignition.
Simply Use the Up / Down switches and press space to select.
When you press space the program checks Pos location then acts upon the result.
?pos is checked by checkUp and checkDown to make sure the cursor stays in the zone, if it exceeds it will stay put and not mess things up.
select reads Pos and looks up what you want to do.
dokey reads the pad waiting for up down or space.
cursor displays '>'
nocursor puts a space in place of '>'
You can alter all parameters and the text to suit your needs.
( simple FIGmenu)
128 var Pos
000 var ?pos
: select
Pos @ 128 = if 1 23 at ." you picked 1" then
Pos @ 178 = if 1 23 at ." you picked 2" then
Pos @ 228 = if 1 23 at ." you picked 3" then
Pos @ 278 = if 1 23 at ." you picked 4" then
Pos @ 328 = if 1 23 at ." you picked 5" then
Pos @ 378 = if 1 23 at ." Quit selected BYE!" quit then ;
( put what you like to happen in this part i.e. say xx load xx)
[2]
( the menu)
: screen cls
22 1 do 1 i at 160 emit 23 i at 160 emit loop
24 1 do i 1 at 160 emit i 22 at 160 emit loop ;
: options
7 2 at ." Simple Menu"
4 5 at ." 1)Opt one"
4 7 at ." 2)Opt two"
4 9 at ." 3)Opt three"
4 11 at ." 4)Opt four"
4 13 at ." 5)Opt five"
4 15 at ." 6)Quit" ; ( put your options here)
[3]
( move cursor)
: cursor 62 vram Pos @ + ic! ;
: nocursor 32 vram Pos @ + ic! ;
: down Pos @ 50 + Pos ! ;
: up Pos @ 50 - Pos ! ;
: checkDown ( gone too far? )
?pos @ 379 > if nocursor 378 Pos ! cursor then ;
: checkUp ( gone too far)
?pos @ 127 < if nocusor 128 Pos ! cursor then ;
: dokey ( move the cursor with U/D select with space)
inkey
dup 10 = if nocusor down cursor then
dup 11 = if nocursor up cursor then
32 = if select then ;
( run)
: init
128 ?pos !
128 Pos !
screen options cursor
begin
Pos @ ?pos !
checkDown
checkUp
dokey
Pos @ 500 = until ;