AGB Programming Manual
Sound
©1999 - 2001 Nintendo of America Inc.
92
D.C.N. AGB-06-0001-002B4
SOUND2CNT_L [d05 - 00] Sound Length
With st signifying the sound length data, the length of the output sound is
determined by the following formula.
time
st
=
−
×
(
)
(sec)
64
1
256
15 14
13
12 11
10
09 08
07
06
05 04
03
02 01
00
SOUND2
CNT_H
06Ch
0000h
R/W
Attributes
Initial
Value
NR23
NR24
Frequency Data
Sound Length
0: Continuous
1: Counter
Initialization Flag
Address
Register
SOUND2CNT_H [d15] Initialization Flag
A setting of 1 causes Sound 2 to be restarted.
SOUND2CNT_H [d14] Sound Length
Continuous sound output with 0; with 1, sound output only for the time
specified in the sound length data of NR21.
When sound output ends, the Sound 2 ON flag of NR52 is reset.
SOUND2CNT_H [d10 - 00] Frequency Data
With fdat signifying the frequency data, the output frequency is determined
by the following formula.
f
fdat
Hz
=
×
×
−
4194304
4
2
2048
3
(
)
(
)
Thus, the frequency range that can be specified is 64 to 131.1 KHz.
[Sound 2 Usage Note]
1.
When a value is written to the envelope register, sound output
becomes unstable before the initialization flag is set. Therefore, set
initialization flag immediately after writing a value to the envelope
register.
2.
For sound 2, if you change the frequency when selecting a
consecutive operation mode (Reset sound length flag of NR24),
always set 0 for data of sound length (lower 6 bits of NR21) after
setting frequency data. If 0 is not set, sound may stop prematurely.