include "settings.inc" ;Specific settings for this application NOLIST include "ti83plus.inc" LIST include "equates.inc" ;Equates and macros to be used GLOBALS ON ;Menu variables Var numOptions,1 ; 1; number of menu options Var curMenu,2 ; 2; pointer to current menu Var prevMenu,2 ; 2; pointer to previous menu, or 0 if none EXTERN PutSApp,INewLine,IGetKey,ExitApp DisplayMenu: ;(curMenu) : pointer to menu structure ;(prevMenu): pointer to code for previous menu, or 0 for none B_CALL ClrLCDFull B_CALL HomeUp ld hl,(curMenu) call PutSApp call INewLine ld a,(hl) ld (numOptions),a ld b,a inc hl $$: call PutSApp call INewLine inc hl inc hl djnz $B $$: call IGetKey cp kQuit jr z,ExitApp cp kClear jr z,switchToPrevMenu cp k1 jp m,$B cp k9+1 jp p,$B sub k1-1 ld b,a ld a,(numOptions) cp b jr c,$B ld d,b ld hl,(curMenu) ld bc,4000h xor a cpir $$: cpir inc hl inc hl dec d jr nz,$B dec hl ld d,(hl) dec hl ld e,(hl) ex de,hl jp (hl) switchToPrevMenu: ld hl,(prevMenu) ld a,h or l jr z,ExitApp jp (hl)