package tinyvm.rcx; /** * RCX sound routines. */ public class Sound { private Sound() { } /** * Play a system sound. * * * * * * * * *
aCodeResulting Sound
0short beep
1double beep
2descending arpeggio
3ascending arpeggio
4long, low beep
5quick ascending arpeggio
*/ public static void systemSound (boolean aQueued, int aCode) { Native.callRom ((short) 0x299a, (short) (aQueued ? 0x4004 : 0x4003), (short) aCode); } /** * Beeps once. * @param aQueued Whether the sound is queued. */ public static void beep() { systemSound (true, 0); } /** * Beeps twice. * @param aQueued Whether the sound is queued. */ public static void twoBeeps() { systemSound (true, 1); } /** * Beeps twice. * @param aQueued Whether the sound is queued. */ public static void beepSequence() { systemSound (true, 2); } /** * Low buzz. * @param aQueued Whether the sound is queued. */ public static void buzz() { systemSound (true, 4); } /** * Plays a tone, given its frequency and duration. */ public static void playTone (int aFrequency, int aDuration) { Native.callRom ((short) 0x327c, (short) 0x1773, (short) aFrequency, (short) aDuration); } }