Figure 122 - The Keyinput Register; Figure 123 - The Keycnt Register - Nintendo GAME BOY ADVANCE Programming Manual

Hide thumbs Also See for GAME BOY ADVANCE:
Table of Contents

Advertisement

May 25, 2005
14 Key Input
14.1
Key Status
Game Boy Advance allows input with the L and R Buttons, as well as with the START and SELECT but-
tons, the +Control Pad, and A and B Buttons.
The status of each of these buttons can be checked by reading the individual bits of Register KEYINPUT.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
 Address
Register 
KEY
130h
INPUT
14.2
Key Interrupt Control
When an interrupt is performed for key input, this register enables a target key combination or condition for
the interrupt to be specified.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
 Address
Register
132h
KEYCNT
14.2.1
Interrupt Conditions
Specifies interrupt generation conditions when the interrupt enable request flag is true.
The conditions for buttons selected with the key interrupt specification flag can be selected as follows.
1. Logical Addition (OR) Operation
The conditions for interrupt request generation occur when there is input for any of the buttons speci-
fied as interrupts.
2. Logical Multiplication (AND) Operation
The conditions for interrupt request generation occur when there is simultaneous input for all of the
keys specified as interrupt keys.
Key Input Cautions
Key bounce (chattering) may occasionally occur when a user presses a button. In order to prevent a but-
ton's function from being called multiple times, we recommend that you program an interval (i.e., once per
frame) when reading a key.
© 1999-2005 NINTENDO
Figure 122 - The KEYINPUT Register 
L
R
Figure 123 - The KEYCNT Register 
L
R
Interrupt Request Enable Flag
0: Disable
1: Enable
Interrupt Condition Specification Flag
0: Logical Addition (OR)
1: Logical Multiplication (AND)
DW
B
UP
LFT
RT
ST
SL
N
Key Status
0: Input
1: No Input
B
DWN
UP
LFT
RT
ST
SL
Interrupt Specification Flag
0: Not Specified
1: Specified
133
 Attributes Initial Value
R/W
0000h
 A
Attributes Initial Value
R/W
0000h
 A
AGB-06-0001-002-B13
Released: May 27, 2005

Advertisement

Table of Contents
loading

Table of Contents