N64: Added a function to get the audio rate from the core.

This commit is contained in:
pjgat09 2013-05-01 21:28:15 +00:00
parent 0d556dc9e9
commit 533baf9ef3
3 changed files with 9 additions and 0 deletions

View File

@ -214,6 +214,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void ReadAudioBuffer(short[] dest);
ReadAudioBuffer AudReadAudioBuffer;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int GetAudioRate();
GetAudioRate AudGetAudioRate;
// This has the same calling pattern for all the plugins
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@ -288,6 +291,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64
AudPluginStartup = (PluginStartup)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "PluginStartup"), typeof(PluginStartup));
AudGetBufferSize = (GetBufferSize)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "GetBufferSize"), typeof(GetBufferSize));
AudReadAudioBuffer = (ReadAudioBuffer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "ReadAudioBuffer"), typeof(ReadAudioBuffer));
AudGetAudioRate = (GetAudioRate)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "GetAudioRate"), typeof(GetAudioRate));
RspPluginStartup = (PluginStartup)Marshal.GetDelegateForFunctionPointer(GetProcAddress(RspDll, "PluginStartup"), typeof(PluginStartup));

View File

@ -745,4 +745,9 @@ EXPORT void CALL ReadAudioBuffer(short* dest)
EXPORT int CALL GetBufferSize()
{
return buffer_pos/2;
}
EXPORT int CALL GetAudioRate()
{
return GameFreq;
}