[TI-ASM] GetCSC hoook
Moderator: MaxCoderz Staff
[TI-ASM] GetCSC hoook
I'm trying to make the GetCSC hook record a keypress if a keypress is detected, but exit if no keypress is detected. It may seem easy, but I think it's a bit harder than it seems. Once in A=$1b mode, a ld a,b and then or a can easily determine whether there was a keypress. However, such code makes the cursor flash repeatedly (it sort of becomes grayscale-esque). Any suggestions?
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
this page says: "Return with NZ set"
which does not make any sense to me, NZ means that the Z flag is NOT set, so NZ is never set.
I'd try returning Z and see what happens..
which does not make any sense to me, NZ means that the Z flag is NOT set, so NZ is never set.
I'd try returning Z and see what happens..
Code: Select all
GetCSCHook:
.db $83
cp $1b
ret nz
di
exx
ld a,(Counter-$9d95+AppBackUpScreen)
or a
jp m,SetNormalKey-$9d95+AppBackUpScreen
dec a
ld (Counter-$9d95+AppBackUpScreen),a
ld h,0
ld l,a
ld de,OrderOfKeys-$9d95+AppBackUpScreen
add hl,de
ld a,(hl)
or a
exx
ei
ret
SetNormalKey:
ld a,b
or a
jr z,NoKeyPressed
exx
ei
ret
NoKeyPressed:
xor a
exx
ei
ret
Counter:
.db 10
OrderOfKeys:
.db sk5,sk3,sk5,sk6,sk2,sk9,sk5,sk4,sk1,skDecPnt,sk3
EndGetCSCHook:
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
This is why:
Code: Select all
ld hl,AppBackUpScreen
in a,(6)
bcall($4f7b)
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am