Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: Sorunome on December 23, 2014, 01:21:37 pm
-
Is there a bcall for the TIOS menu? Would it be possible to get it to use custom tokens?
Or do i have to re-write the menu like Omnicalc does it?
-
What do you mean? You mean a bcall to draw a TIOS-style menu? Or are you trying to add an entry to an existing TI OS menu?
-
A bcall to an TIOS-style menu. KermM pointed me to this now http://wikiti.brandonw.net/index.php?title=83Plus:OS:Dialog_context
-
Ah ok, i was gonna point you to one of Kerm's threads over at Cemetech anyway (http://www.cemetech.net/forum/viewtopic.php?t=10701) :P In particular, BrandonW's ddemo.
-
Um yeah I like can't get it working properly....
Menu:
res indicrun,(iy+indicflags)
res apptextsave,(iy+appflags)
ld hl,rawKeyHookPtr
ld de,appBackUpScreen
ld bc,4
ldir
ld a,(flags+34h)
ld (de),a
ld hl,cmdShadow
ld de,appBackUpScreen+5
ld bc,128
ldir
ld hl,structStart
ld de,ramCode
ld bc,structEnd-structStart
ldir
ld hl,dialogCallback
in a,(6)
bcall(_DialogInit)
bcall(_runIndicOff)
bcall(_StartDialog)
; bcall(_CursorOff)
; bcall(_ClrLCDFull)
res appCurWord,(iy+appFlags)
ld hl,appBackUpScreen+5
ld de,cmdShadow
ld bc,128
ldir
ld a,kQuit ; homescreen
ld (cxCurApp),a
ld hl,appBackUpScreen
ld de,rawKeyHookPtr
ld bc,4
ldir
ld a,(hl)
ld (flags+34h),a
xor a
bcall(_GetDialogNumOP1)
ld a,9
bcall(_DispOP1a)
xor a
ret
dialogCallback:
xor a
ret
structStart:
.db 1
.db 1
.db 1
.dw sOptions-structStart
.db 5
.db 1
.db 1
.dw sItem1-structStart
.db 5
.db 1
.db 2
.dw sItem2-structStart
.db 0
sOptions:
.db 7,"VECTORS"
sItem1:
.db 4,"abs("
sItem2:
.db 5,"norm("
structEnd:
When exiting it like exits back into the stat menu (where it was before it got called) but I want it to exit to the homescreen and I can't find any way of getting which option was pushed
-
Do you think you could share the code that loads the hook?
-
is this enough?
_keyHook_statKey:
ld a,(menucurrent)
cp mStat
jr z,{+1@}
cp mPrgmStat
jp z,{+1@}
ld a,kStat
jp ReturnNZ
@:
call Menu
jp ReturnZ
T´hat gets called if the stat key is pressed, no changing of registers.
-
What about changing the final "xor a"s to "ld a,kQuit"?
Menu:
res indicRun,(iy+indicFlags)
res appTextSave,(iy+appFlags)
ld hl,rawKeyHookPtr
ld de,appBackUpScreen
ld bc,4
ldir
ld a,(flags+34h)
ld (de),a
ld hl,cmdShadow
ld de,appBackUpScreen+5
ld bc,128
ldir
ld hl,structStart
ld de,ramCode
ld bc,structEnd-structStart
ldir
ld hl,dialogCallback
in a,(6)
bcall(_DialogInit)
bcall(_RunIndicOff)
bcall(_StartDialog)
; bcall(_CursorOff)
; bcall(_ClrLCDFull)
res appCurWord,(iy+appFlags)
ld hl,appBackUpScreen+5
ld de,cmdShadow
ld bc,128
ldir
ld hl,cmdShadow
ld de,textShadow
ld bc,128
ldir
ld a,kQuit ; homescreen
ld (cxCurApp),a
ld hl,appBackUpScreen
ld de,rawKeyHookPtr
ld bc,4
ldir
ld a,(hl)
ld (flags+34h),a
xor a
bcall(_GetDialogNumOP1)
ld a,9
bcall(_DispOP1A)
ld a,kQuit
ret
dialogCallback:
ld a,kQuit
ret