sound.h
Go to the documentation of this file.
1
10/*
11 * The contents of this file are subject to the Mozilla Public License
12 * Version 1.0 (the "License"); you may not use this file except in
13 * compliance with the License. You may obtain a copy of the License
14 * at http://www.mozilla.org/MPL/
15 *
16 * Software distributed under the License is distributed on an "AS IS"
17 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
18 * the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * The Original Code is legOS code, released October 17, 1999.
22 *
23 * The Initial Developer of the Original Code is Markus L. Noga.
24 * Portions created by Markus L. Noga are Copyright (C) 1999
25 * Markus L. Noga. All Rights Reserved.
26 *
27 * Contributor(s): Markus L. Noga <markus@noga.de>
28 */
29
30#ifndef __rom_sound_h__
31#define __rom_sound_h__
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
38//
39// Functions
40//
42
44
50extern inline void sound_system(unsigned nr)
51{
52 __asm__ __volatile__(
53 "push %0\n"
54 "mov.w #0x4003,r6\n"
55 "jsr @sound_system\n"
56 "adds #0x2,sp\n"
57 : // output
58 :"r"(nr) // input
59 :"r6", "cc", "memory" // clobbered
60 );
61}
62
64
66extern inline int sound_playing(void)
67{
68 unsigned rc;
69 __asm__ __volatile__(
70 "mov.w r7,r6\n"
71 "push r6\n"
72 "mov.w #0x700c,r6\n"
73 "jsr @sound_playing\n"
74 "adds #0x2,sp\n"
75 "mov.w @r7,%0\n"
76 :"=r"(rc) // output
77 : // input
78 :"r6", "cc", "memory" // clobbered
79 );
80
81 return rc;
82}
83
84#ifdef __cplusplus
85}
86#endif
87
88#endif // __rom_sound_h__
void sound_system(unsigned nr)
play one of the system sounds.
Definition sound.h:50
int sound_playing(void)
is a sound playing?
Definition sound.h:66

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS C++ by doxygen 1.9.8