A86: menu


[Prev][Next][Index][Thread]

A86: menu




I am trying to write a program that accesses TI-OS's menu routines. 
Idealy the program would still be running while the menu is being 
displayed. I wrote a short program using some rom addresses someone 
posted, but it doesn't work. Any suggestions? Help would be greatly 
appreaciated.

--Retupmoc7

Here is the program:

#include ti-86.h

  .org $D748

  LD hl,Menu1
  CALL $49c8
  JP $49e8

Menu1:
  .db $09 ; $09 = new menu, $08 = submenu
  .db $03 ; number of menu items
  .dw Item1 ; pointers to entries
  .dw Item2
  .dw Item3

Item1:
  .db $05 ; this item is a sub-menu
  .dw Menu2 ; pointer to menu
  .db "Menu2",0 ; appears in menu

Item2:
  .db $06 ; nothing

Item3:
  .db $01 ; execute assembly
  .dw $0000 ; dummy pointer
  .db $C3 ; JP
  .dw Hello ; pointer to code
  .db "Hello",0 ; appears in menu

Menu2:
  .db $08 ; $09 = new menu, $08 = submenu
  .db $01 ; number of menu items
  .dw Item4 ; pointer to sub-menu

Item4:
  .db $01 ; execute assembly
  .dw $0000 ; dummy pointer
  .db $C3 ; JP
  .dw Hi ; pointer to code
  .db "Hi",0 ; appears in menu

Hello:
  CALL sys_clrlcdfull
  LD HL,$0000
  LD (CURROW),HL
  LD HL,STR0
  CALL SYS_PUTS
  CALL sys_waitkey
  RET

Hi:
  LD HL,$0101
  LD (CURROW),HL
  LD HL,STR1
  CALL SYS_PUTS
  CALL sys_waitkey
  RET

; DATA

STR0:
  .db "Hello",0

STR1:
  .db "Hi",0

sys_waitkey:
  EI
sys_waitkey_loop:
  HALT
  CALL sys_getk
  OR A
  JR Z,sys_waitkey_loop
  RET

  .end

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: