[TI-ASM] The in's and out's of key input
Moderator: MaxCoderz Staff
[TI-ASM] The in's and out's of key input
Can someone explain in depth how to use the 2 following instructions:
in
out
thnx in advance
in
out
thnx in advance
Last edited by crzyrbl on Thu 07 Jun, 2007 5:24 am, edited 1 time in total.
You read a list of Ports and what they do from a website such as WikiTI.
You know your hexadecimal output routine is broken when it displays the character 'G'.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
What Asm in 28 days doesn't tell though is that sometimes multiple keypresses 'mess up' and leave result differing from what you'd expect. Single keypresses should always work fine though, and you won't have much trouble if you only check the arrows for multi presses.
If you write a little program displays all groups then you should be able to figure out which keys you can 'safely' press together.
(you might want to use the key scanning routines that I have been going on about, use the one with INI - it's cool )
edit: you can have real trouble when there are more than 3 being pressed, I don't know whether many games even need that because you only have 2 thumbs but take it into consideration when you're thinking about funky combo's and 'special moves' etc.
If you write a little program displays all groups then you should be able to figure out which keys you can 'safely' press together.
(you might want to use the key scanning routines that I have been going on about, use the one with INI - it's cool )
edit: you can have real trouble when there are more than 3 being pressed, I don't know whether many games even need that because you only have 2 thumbs but take it into consideration when you're thinking about funky combo's and 'special moves' etc.
Ah, I see, I have to use the BIT instruction then...hmm, I think I got it now . Are there problems with detecting 3 buttons? For example two directionals and 2nd or something around there?
Last edited by crzyrbl on Fri 08 Jun, 2007 10:34 pm, edited 1 time in total.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
Im not sure about that one, you'd have to try in on HW since the emulators might not be 100% accurate.
You don't HAVE to use bit operations, but that's probably safer. If possible, use a shift operation and catch the carry, it's faster. If you only have to test some middle bit and throw the rest away then you could use logic AND.
You don't HAVE to use bit operations, but that's probably safer. If possible, use a shift operation and catch the carry, it's faster. If you only have to test some middle bit and throw the rest away then you could use logic AND.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
The effect that King Harold is talking about is caused by the grid setup of the keyboard. If 3 or more buttons are being pressed its possible to get bad reads from the key port. Basic rule of thumb is this: If a particular bit is reset in more than one group, then those groups will return the same value, which will be all those groups AND together.
The idea is the plus signs are actually being pressed, where as the asterisk is a false press. Typically this problem doesn't occur, its not easy to hold the combination that this can occur in. For gaming, coders usually stick to only certain groups.
To answer your question Arrows, 2nd, mode, alpha & F1 will all be okay to use together in any key combination.
Code: Select all
| |
-0000+0+0
00000000
-0000+0*0
To answer your question Arrows, 2nd, mode, alpha & F1 will all be okay to use together in any key combination.