1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus - Audio_1.2.h *
3 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4 * Copyright (C) 2007-2008 Richard42 Ebenblues *
5 * Copyright (C) 2002 Zilmar *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
21 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
23 /**********************************************************************************
27 Setting the approprate bits in the MI_INTR_REG and calling CheckInterrupts which
28 are both passed to the DLL in InitiateAudio will generate an Interrupt from with in
31 **********************************************************************************/
32 #ifndef _AUDIO_H_INCLUDED__
33 #define _AUDIO_H_INCLUDED__
35 #if defined(__cplusplus)
39 /* Note: BOOL, BYTE, WORD, DWORD, TRUE, FALSE are defined in windows.h */
41 #define PLUGIN_TYPE_AUDIO 3
43 #define EXPORT __declspec(dllexport)
50 #ifndef __PLUGIN_INFO__
51 #define __PLUGIN_INFO__
52 /***** Structures *****/
54 WORD Version; /* Should be set to 0x0101 */
55 WORD Type; /* Set to PLUGIN_TYPE_AUDIO */
56 char Name[100]; /* Name of the DLL */
58 /* If DLL supports memory these memory options then set them to TRUE or FALSE
59 if it does not support it */
60 BOOL NormalMemory; /* a normal BYTE array */
61 BOOL MemoryBswaped; /* a normal BYTE array where the memory has been pre
62 bswap on a dword (32 bits) boundry */
64 #endif //__PLUGIN_INFO__
70 BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
71 // bswap on a dword (32 bits) boundry
72 // eg. the first 8 bytes are stored like this:
74 BYTE * HEADER; // This is the rom header (first 40h bytes of the rom
75 // This will be in the same memory format as the rest of the memory.
82 DWORD * AI_DRAM_ADDR_REG;
84 DWORD * AI_CONTROL_REG;
85 DWORD * AI_STATUS_REG;
86 DWORD * AI_DACRATE_REG;
87 DWORD * AI_BITRATE_REG;
89 void (*CheckInterrupts)( void );
92 /******************************************************************
93 Function: AiDacrateChanged
94 Purpose: This function is called to notify the dll that the
95 AiDacrate registers value has been changed.
96 input: The System type:
101 *******************************************************************/
102 EXPORT void CALL AiDacrateChanged (int SystemType);
104 /******************************************************************
105 Function: AiLenChanged
106 Purpose: This function is called to notify the dll that the
107 AiLen registers value has been changed.
110 *******************************************************************/
111 EXPORT void CALL AiLenChanged (void);
113 /******************************************************************
114 Function: AiReadLength
115 Purpose: This function is called to allow the dll to return the
116 value that AI_LEN_REG should equal
118 output: The amount of bytes still left to play.
119 *******************************************************************/
120 EXPORT DWORD CALL AiReadLength (void);
122 /******************************************************************
124 Purpose: This function is called to allow the dll to update
125 things on a regular basis (check how long to sound to
126 go, copy more stuff to the buffer, anyhting you like).
127 The function is designed to go in to the message loop
128 of the main window ... but can be placed anywhere you
130 input: if Wait is set to true, then this function should wait
131 till there is a messgae in the its message queue.
133 *******************************************************************/
134 EXPORT void CALL AiUpdate (BOOL Wait);
136 /******************************************************************
138 Purpose: This function is called when the emulator is closing
139 down allowing the dll to de-initialise.
142 *******************************************************************/
143 EXPORT void CALL CloseDLL (void);
145 /******************************************************************
147 Purpose: This function is optional function that is provided
148 to give further information about the DLL.
149 input: a handle to the window that calls this function
151 *******************************************************************/
152 EXPORT void CALL DllAbout ( HWND hParent );
154 /******************************************************************
156 Purpose: This function is optional function that is provided
157 to allow the user to configure the dll
158 input: a handle to the window that calls this function
160 *******************************************************************/
161 EXPORT void CALL DllConfig ( HWND hParent );
163 /******************************************************************
165 Purpose: This function is optional function that is provided
166 to allow the user to test the dll
167 input: a handle to the window that calls this function
169 *******************************************************************/
170 EXPORT void CALL DllTest ( HWND hParent );
172 /******************************************************************
174 Purpose: This function allows the emulator to gather information
175 about the dll by filling in the PluginInfo structure.
176 input: a pointer to a PLUGIN_INFO stucture that needs to be
177 filled by the function. (see def above)
179 *******************************************************************/
180 EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo );
182 /******************************************************************
183 Function: InitiateSound
184 Purpose: This function is called when the DLL is started to give
185 information from the emulator that the n64 audio
187 Input: Audio_Info is passed to this function which is defined
189 Output: TRUE on success
190 FALSE on failure to initialise
192 ** note on interrupts **:
193 To generate an interrupt set the appropriate bit in MI_INTR_REG
194 and then call the function CheckInterrupts to tell the emulator
195 that there is a waiting interrupt.
196 *******************************************************************/
197 EXPORT BOOL CALL InitiateAudio (AUDIO_INFO Audio_Info);
199 /******************************************************************
200 Function: ProcessAList
201 Purpose: This function is called when there is a Alist to be
202 processed. The Dll will have to work out all the info
203 about the AList itself.
206 *******************************************************************/
207 EXPORT void CALL ProcessAList(void);
209 /******************************************************************
211 Purpose: This function is called when a rom is closed.
214 *******************************************************************/
215 EXPORT void CALL RomClosed (void);
217 /******************************************************************
219 Purpose: This function is called when plugin should pause or
220 re-enable sound. Audio should be enabled by default.
221 input: TRUE when audio should be paused.
222 FALSE when audio sould continue playing.
223 output: TRUE when audio is paused.
224 FALSE when audio plays.
225 *******************************************************************/
226 EXPORT BOOL CALL PauseAudio (BOOL Pause);
228 /******************************************************************
229 NOTE: THIS HAS BEEN ADDED FOR MUPEN64PLUS AND IS NOT PART OF THE
231 Function: SetConfigDir
232 Purpose: To pass the location where config files should be read/
234 input: path to config directory
236 *******************************************************************/
237 EXPORT void CALL SetConfigDir( char *configDir );
239 /******************************************************************
240 NOTE: THIS HAS BEEN ADDED FOR MUPEN64PLUS AND IS NOT PART OF THE
243 Purpose: To increase the audio volume
246 *******************************************************************/
247 EXPORT void CALL VolumeUp(void);
249 /******************************************************************
250 NOTE: THIS HAS BEEN ADDED FOR MUPEN64PLUS AND IS NOT PART OF THE
253 Purpose: To decrease the audio volume
256 *******************************************************************/
257 EXPORT void CALL VolumeDown(void);
259 /******************************************************************
260 NOTE: THIS HAS BEEN ADDED FOR MUPEN64PLUS AND IS NOT PART OF THE
263 Purpose: Toggles between muted and not muted
266 *******************************************************************/
267 EXPORT void CALL VolumeMute(void);
269 /******************************************************************
270 NOTE: THIS HAS BEEN ADDED FOR MUPEN64PLUS AND IS NOT PART OF THE
273 Purpose: Return the current volume level
275 output: string containing volume level state (percentage or mute)
276 *******************************************************************/
277 EXPORT const char * CALL VolumeGetString(void);
280 #if defined(__cplusplus)