Hey all!
I'm trying to make a new program, which first installs a GetKeyHook. If you press Y=, the equation editor, I wanna run prgmU, but this doesn't seems to work. When I run this code for the first time, all is ok. But when I press a key which is NOT Y=, it freezes. Why? Any ideas?
Code:
EDIT: I figured out that I need to ldir more bytes, so I changed ld bc, $0019 to ld bc, 100. That doesn't freeze, but prgmU don't run when I press Y=
I'm trying to make a new program, which first installs a GetKeyHook. If you press Y=, the equation editor, I wanna run prgmU, but this doesn't seems to work. When I run this code for the first time, all is ok. But when I press a key which is NOT Y=, it freezes. Why? Any ideas?
Code:
.nolist
#include "ti83plus.inc"
.list
.org UserMem-2
.db $BB,$6D
start:
ld hl, $9DA9
ld de, $8000
ld bc, $0019
ldir
ld hl, $8000
ld a, 1
bcall(_SetGetKeyHook)
ret
.db $83
bit 2, (iy+1)
ret z
cp kYequ
jr nz, disableHook
ld hl, varname
bcall(_Mov9toOP1)
bcall(_ChkFindSym)
jr c, disableHook
ld hl,$0055
ld (saveSScreen),hl
ld (OP1+1),hl
ld hl,saveSScreen+4
ex de,hl
ld c,(hl)
inc hl
ld b,(hl)
inc hl
ld (saveSScreen+2),bc
ldir
ld a,5
ld (OP1),a
bcall(_ChkFindSym)
jr c,$+5
bcall(_DelVarArc)
ld a,5
ld hl,saveSScreen
bcall(_ExecuteNewPrgm)
ld a, 0
ret
disableHook:
cp kGraph
ret nz
bcall(_ClrRawKeyHook)
ld a, 0
ret
varname:
.db ProgObj, "U", 0, 0
EDIT: I figured out that I need to ldir more bytes, so I changed ld bc, $0019 to ld bc, 100. That doesn't freeze, but prgmU don't run when I press Y=