00001 00010 /* 00011 * The contents of this file are subject to the Mozilla Public License 00012 * Version 1.0 (the "License"); you may not use this file except in 00013 * compliance with the License. You may obtain a copy of the License 00014 * at http://www.mozilla.org/MPL/ 00015 * 00016 * Software distributed under the License is distributed on an "AS IS" 00017 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00018 * the License for the specific language governing rights and 00019 * limitations under the License. 00020 * 00021 * The Original Code is legOS code, released October 17, 1999. 00022 * 00023 * The Initial Developer of the Original Code is Markus L. Noga. 00024 * Portions created by Markus L. Noga are Copyright (C) 1999 00025 * Markus L. Noga. All Rights Reserved. 00026 * 00027 * Contributor(s): Markus L. Noga <markus@noga.de> 00028 */ 00029 00030 #ifndef __rom_sound_h__ 00031 #define __rom_sound_h__ 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00038 // 00039 // Functions 00040 // 00042 00044 00050 extern inline void sound_system(unsigned nr) 00051 { 00052 __asm__ __volatile__( 00053 "push %0\n" 00054 "mov.w #0x4003,r6\n" 00055 "jsr @sound_system\n" 00056 "adds #0x2,sp\n" 00057 : // output 00058 :"r"(nr) // input 00059 :"r6", "cc", "memory" // clobbered 00060 ); 00061 } 00062 00064 00066 extern inline int sound_playing(void) 00067 { 00068 unsigned rc; 00069 __asm__ __volatile__( 00070 "mov.w r7,r6\n" 00071 "push r6\n" 00072 "mov.w #0x700c,r6\n" 00073 "jsr @sound_playing\n" 00074 "adds #0x2,sp\n" 00075 "mov.w @r7,%0\n" 00076 :"=r"(rc) // output 00077 : // input 00078 :"r6", "cc", "memory" // clobbered 00079 ); 00080 00081 return rc; 00082 } 00083 00084 #ifdef __cplusplus 00085 } 00086 #endif 00087 00088 #endif // __rom_sound_h__
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |