2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2009-01-11 13:37:13 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
#include "Globals.h" // Local
|
2009-01-17 21:42:43 +00:00
|
|
|
|
2008-12-14 23:52:01 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2009-01-29 00:57:55 +00:00
|
|
|
#include "ConfigDlg.h"
|
2009-07-02 19:00:27 +00:00
|
|
|
DSPConfigDialogHLE* m_ConfigFrame = NULL;
|
2008-12-14 23:52:01 +00:00
|
|
|
#endif
|
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
#include "ChunkFile.h"
|
2009-03-26 09:29:14 +00:00
|
|
|
#include "HLEMixer.h"
|
2008-12-08 05:25:12 +00:00
|
|
|
#include "DSPHandler.h"
|
|
|
|
#include "Config.h"
|
2009-02-14 01:07:20 +00:00
|
|
|
#include "Setup.h"
|
|
|
|
#include "StringUtil.h"
|
2009-07-12 21:58:32 +00:00
|
|
|
#include "LogManager.h"
|
2009-01-17 14:28:09 +00:00
|
|
|
|
2009-03-26 09:29:14 +00:00
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
// Declarations and definitions
|
2009-03-18 17:17:58 +00:00
|
|
|
PLUGIN_GLOBALS* globals = NULL;
|
2008-12-08 05:25:12 +00:00
|
|
|
DSPInitialize g_dspInitialize;
|
|
|
|
u8* g_pMemory;
|
|
|
|
extern std::vector<std::string> sMailLog, sMailTime;
|
|
|
|
|
2009-12-23 15:34:14 +00:00
|
|
|
bool g_InitMixer = false;
|
2009-01-29 00:57:55 +00:00
|
|
|
SoundStream *soundStream = NULL;
|
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
// Mailbox utility
|
2008-12-08 05:25:12 +00:00
|
|
|
struct DSPState
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
u32 CPUMailbox;
|
|
|
|
u32 DSPMailbox;
|
|
|
|
|
2009-08-12 01:15:57 +00:00
|
|
|
void Reset() {
|
2009-01-29 01:53:07 +00:00
|
|
|
CPUMailbox = 0x00000000;
|
|
|
|
DSPMailbox = 0x00000000;
|
|
|
|
}
|
2009-08-12 01:15:57 +00:00
|
|
|
|
|
|
|
DSPState()
|
|
|
|
{
|
|
|
|
Reset();
|
|
|
|
}
|
2008-12-08 05:25:12 +00:00
|
|
|
};
|
|
|
|
DSPState g_dspState;
|
|
|
|
|
2009-07-02 19:00:27 +00:00
|
|
|
// Standard crap to make wxWidgets happy
|
|
|
|
#ifdef _WIN32
|
|
|
|
HINSTANCE g_hInstance;
|
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2008-12-08 05:25:12 +00:00
|
|
|
class wxDLLApp : public wxApp
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
bool OnInit()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2008-12-08 05:25:12 +00:00
|
|
|
};
|
2010-06-05 01:38:22 +00:00
|
|
|
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
2008-12-08 05:25:12 +00:00
|
|
|
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
2008-12-14 23:52:01 +00:00
|
|
|
#endif
|
2009-01-17 14:28:09 +00:00
|
|
|
|
2009-07-02 19:00:27 +00:00
|
|
|
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
|
|
|
DWORD dwReason, // reason called
|
|
|
|
LPVOID lpvReserved) // reserved
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
switch (dwReason)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 00:57:55 +00:00
|
|
|
case DLL_PROCESS_ATTACH:
|
2009-01-29 01:53:07 +00:00
|
|
|
{
|
2009-07-02 19:00:27 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2009-01-29 01:53:07 +00:00
|
|
|
wxSetInstance((HINSTANCE)hinstDLL);
|
2010-02-22 04:59:57 +00:00
|
|
|
wxInitialize();
|
2009-07-02 19:00:27 +00:00
|
|
|
#endif
|
2009-01-29 01:53:07 +00:00
|
|
|
}
|
2010-06-05 01:38:22 +00:00
|
|
|
break;
|
2009-01-29 00:57:55 +00:00
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
2009-07-02 19:00:27 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2010-02-22 04:59:57 +00:00
|
|
|
wxUninitialize();
|
2009-07-02 19:00:27 +00:00
|
|
|
#endif
|
2009-01-29 01:53:07 +00:00
|
|
|
break;
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2009-01-29 01:53:07 +00:00
|
|
|
g_hInstance = hinstDLL;
|
2009-07-02 19:00:27 +00:00
|
|
|
return TRUE;
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-07-02 19:00:27 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
|
|
|
wxWindow* GetParentedWxWindow(HWND Parent)
|
|
|
|
{
|
|
|
|
#ifdef _WIN32
|
|
|
|
wxSetInstance((HINSTANCE)g_hInstance);
|
|
|
|
#endif
|
|
|
|
wxWindow *win = new wxWindow();
|
|
|
|
#ifdef _WIN32
|
|
|
|
win->SetHWND((WXHWND)Parent);
|
|
|
|
win->AdoptAttributesFromHWND();
|
|
|
|
#endif
|
|
|
|
return win;
|
|
|
|
}
|
|
|
|
#endif
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
void DllDebugger(HWND _hParent, bool Show)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GetDllInfo(PLUGIN_INFO* _PluginInfo)
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
_PluginInfo->Version = 0x0100;
|
|
|
|
_PluginInfo->Type = PLUGIN_TYPE_DSP;
|
2009-01-15 06:48:15 +00:00
|
|
|
#ifdef DEBUGFAST
|
2010-06-05 01:38:22 +00:00
|
|
|
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (DebugFast)");
|
|
|
|
#elif defined _DEBUG
|
|
|
|
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (Debug)");
|
2008-12-08 05:25:12 +00:00
|
|
|
#else
|
2010-06-05 01:38:22 +00:00
|
|
|
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin");
|
2008-12-08 05:25:12 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2009-03-18 17:17:58 +00:00
|
|
|
|
|
|
|
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
|
|
|
{
|
2010-04-05 13:05:47 +00:00
|
|
|
globals = _pPluginGlobals;
|
2010-06-05 01:38:22 +00:00
|
|
|
LogManager::SetInstance((LogManager*)globals->logManager);
|
2009-01-08 12:12:15 +00:00
|
|
|
}
|
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
void DllConfig(HWND _hParent)
|
|
|
|
{
|
2009-01-17 21:42:43 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2009-09-13 08:54:46 +00:00
|
|
|
// Load config settings
|
|
|
|
g_Config.Load();
|
|
|
|
|
2010-02-25 06:12:35 +00:00
|
|
|
wxWindow *frame = GetParentedWxWindow(_hParent);
|
|
|
|
m_ConfigFrame = new DSPConfigDialogHLE(frame);
|
2009-07-13 13:37:52 +00:00
|
|
|
|
2010-02-25 06:12:35 +00:00
|
|
|
// add backends
|
|
|
|
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
|
|
|
|
|
|
|
|
for (std::vector<std::string>::const_iterator iter = backends.begin();
|
|
|
|
iter != backends.end(); ++iter)
|
|
|
|
{
|
|
|
|
m_ConfigFrame->AddBackend((*iter).c_str());
|
|
|
|
}
|
2009-02-14 01:07:20 +00:00
|
|
|
|
2010-02-25 06:12:35 +00:00
|
|
|
// Only allow one open at a time
|
2010-03-05 07:03:44 +00:00
|
|
|
#ifdef _WIN32
|
2010-02-25 06:12:35 +00:00
|
|
|
frame->Disable();
|
|
|
|
m_ConfigFrame->ShowModal();
|
|
|
|
frame->Enable();
|
2010-03-05 07:03:44 +00:00
|
|
|
#else
|
|
|
|
m_ConfigFrame->ShowModal();
|
|
|
|
#endif
|
2009-07-02 19:00:27 +00:00
|
|
|
|
2010-02-14 16:44:16 +00:00
|
|
|
#ifdef _WIN32
|
2010-02-25 17:50:08 +00:00
|
|
|
frame->SetFocus();
|
2010-02-25 06:12:35 +00:00
|
|
|
frame->SetHWND(NULL);
|
2010-02-14 16:44:16 +00:00
|
|
|
#endif
|
2010-02-25 17:50:08 +00:00
|
|
|
|
|
|
|
m_ConfigFrame->Destroy();
|
|
|
|
m_ConfigFrame = NULL;
|
2010-02-25 06:12:35 +00:00
|
|
|
frame->Destroy();
|
2008-12-08 05:25:12 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2009-03-26 09:29:14 +00:00
|
|
|
|
2009-01-15 06:48:15 +00:00
|
|
|
void Initialize(void *init)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-12-23 15:34:14 +00:00
|
|
|
g_InitMixer = false;
|
2009-01-29 01:53:07 +00:00
|
|
|
g_dspInitialize = *(DSPInitialize*)init;
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-02-20 22:04:52 +00:00
|
|
|
g_Config.Load();
|
2009-01-29 01:53:07 +00:00
|
|
|
g_pMemory = g_dspInitialize.pGetMemoryPointer(0);
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-08-12 01:15:57 +00:00
|
|
|
g_dspState.Reset();
|
|
|
|
|
2009-01-29 01:53:07 +00:00
|
|
|
CDSPHandler::CreateInstance();
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2010-06-05 03:09:44 +00:00
|
|
|
void DSP_StopSoundStream()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-02-20 22:04:52 +00:00
|
|
|
void Shutdown()
|
|
|
|
{
|
2009-03-27 14:26:44 +00:00
|
|
|
AudioCommon::ShutdownSoundStream();
|
2009-02-20 22:04:52 +00:00
|
|
|
|
|
|
|
// Delete the UCodes
|
2009-01-29 01:53:07 +00:00
|
|
|
CDSPHandler::Destroy();
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2009-02-14 01:07:20 +00:00
|
|
|
void DoState(unsigned char **ptr, int mode)
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
PointerWrap p(ptr, mode);
|
2009-12-23 15:34:14 +00:00
|
|
|
p.Do(g_InitMixer);
|
2009-06-20 10:24:49 +00:00
|
|
|
CDSPHandler::GetInstance().GetUCode()->DoState(p);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-01-17 14:28:09 +00:00
|
|
|
|
Now you can switch between Emulated and Real WiiMotes, connect more Real Wiimotes and even pair them up (if you have MS BT Stack) during gameplay!
All you gotta do is Pause the emulation! That's useful for when your batteries run out during gameplay, for example...
But if you change the WiiMote source (between Emulated, Real or Inactive) you must disconnect and reconnect (Menu Tools -> Connect WiiMote) the WiiMotes affected by the change...
Thanks to jack.fr0st who did all the emulation state notification work!
Now every plugin has a way to know the current emulation state (paused, stopped or playing)
@ayuanx: I thought about doing a PostMessage(g_WiimoteInitialize.hWnd, WM_USER, WIIMOTE_DISCONNECT, current_number); so that the user gets asked to reconnect that WiiMote, trying to avoid having to disconnect and reconnect, but it didn't work because shooting that message only asks to reconnect, doesn't do a disconnect... Do you have any ideas on how to accomplish that?
Also, if anyone could check if Issue 1916 is finally fixed... Or at least when is the cursor being hidden or not...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4789 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-06 19:26:52 +00:00
|
|
|
void EmuStateChange(PLUGIN_EMUSTATE newState)
|
|
|
|
{
|
2010-01-13 14:18:13 +00:00
|
|
|
DSP_ClearAudioBuffer((newState == PLUGIN_EMUSTATE_PLAY) ? false : true);
|
Now you can switch between Emulated and Real WiiMotes, connect more Real Wiimotes and even pair them up (if you have MS BT Stack) during gameplay!
All you gotta do is Pause the emulation! That's useful for when your batteries run out during gameplay, for example...
But if you change the WiiMote source (between Emulated, Real or Inactive) you must disconnect and reconnect (Menu Tools -> Connect WiiMote) the WiiMotes affected by the change...
Thanks to jack.fr0st who did all the emulation state notification work!
Now every plugin has a way to know the current emulation state (paused, stopped or playing)
@ayuanx: I thought about doing a PostMessage(g_WiimoteInitialize.hWnd, WM_USER, WIIMOTE_DISCONNECT, current_number); so that the user gets asked to reconnect that WiiMote, trying to avoid having to disconnect and reconnect, but it didn't work because shooting that message only asks to reconnect, doesn't do a disconnect... Do you have any ideas on how to accomplish that?
Also, if anyone could check if Issue 1916 is finally fixed... Or at least when is the cursor being hidden or not...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4789 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-06 19:26:52 +00:00
|
|
|
}
|
2009-02-14 01:07:20 +00:00
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
// Mailbox fuctions
|
2008-12-08 05:25:12 +00:00
|
|
|
unsigned short DSP_ReadMailboxHigh(bool _CPUMailbox)
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
if (_CPUMailbox)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
return (g_dspState.CPUMailbox >> 16) & 0xFFFF;
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
else
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
return CDSPHandler::GetInstance().AccessMailHandler().ReadDSPMailboxHigh();
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned short DSP_ReadMailboxLow(bool _CPUMailbox)
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
if (_CPUMailbox)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
return g_dspState.CPUMailbox & 0xFFFF;
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
else
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
return CDSPHandler::GetInstance().AccessMailHandler().ReadDSPMailboxLow();
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSP_WriteMailboxHigh(bool _CPUMailbox, unsigned short _Value)
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
if (_CPUMailbox)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
g_dspState.CPUMailbox = (g_dspState.CPUMailbox & 0xFFFF) | (_Value << 16);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
else
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
PanicAlert("CPU can't write %08x to DSP mailbox", _Value);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSP_WriteMailboxLow(bool _CPUMailbox, unsigned short _Value)
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
if (_CPUMailbox)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
g_dspState.CPUMailbox = (g_dspState.CPUMailbox & 0xFFFF0000) | _Value;
|
2009-11-27 15:07:52 +00:00
|
|
|
CDSPHandler::GetInstance().SendMailToDSP(g_dspState.CPUMailbox);
|
|
|
|
// Mail sent so clear MSB to show that it is progressed
|
|
|
|
g_dspState.CPUMailbox &= 0x7FFFFFFF;
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
else
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
PanicAlert("CPU can't write %08x to DSP mailbox", _Value);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-14 01:07:20 +00:00
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-01-17 14:28:09 +00:00
|
|
|
// Other DSP fuctions
|
2008-12-08 05:25:12 +00:00
|
|
|
unsigned short DSP_WriteControlRegister(unsigned short _Value)
|
|
|
|
{
|
2009-12-23 15:34:14 +00:00
|
|
|
UDSPControl Temp(_Value);
|
|
|
|
if (!g_InitMixer)
|
|
|
|
{
|
|
|
|
if (!Temp.DSPHalt && Temp.DSPInit)
|
|
|
|
{
|
2009-12-25 11:59:04 +00:00
|
|
|
unsigned int AISampleRate, DACSampleRate;
|
|
|
|
g_dspInitialize.pGetSampleRate(AISampleRate, DACSampleRate);
|
2010-06-05 01:38:22 +00:00
|
|
|
soundStream = AudioCommon::InitSoundStream(new HLEMixer(AISampleRate, DACSampleRate));
|
2009-12-23 15:34:14 +00:00
|
|
|
if(!soundStream) PanicAlert("Error starting up sound stream");
|
|
|
|
// Mixer is initialized
|
|
|
|
g_InitMixer = true;
|
|
|
|
}
|
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
return CDSPHandler::GetInstance().WriteControlRegister(_Value);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned short DSP_ReadControlRegister()
|
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
return CDSPHandler::GetInstance().ReadControlRegister();
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DSP_Update(int cycles)
|
|
|
|
{
|
2009-04-08 18:36:53 +00:00
|
|
|
// This is called OFTEN - better not do anything expensive!
|
2010-04-07 15:04:45 +00:00
|
|
|
// ~1/6th as many cycles as the period PPC-side.
|
|
|
|
CDSPHandler::GetInstance().Update(cycles / 6);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2010-02-28 18:21:22 +00:00
|
|
|
// The reason that we don't disable this entire
|
|
|
|
// function when Other Audio is disabled is that then we can't turn it back on
|
|
|
|
// again once the game has started.
|
2009-12-25 11:59:04 +00:00
|
|
|
void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-12-23 15:34:14 +00:00
|
|
|
if (!soundStream)
|
2009-02-20 22:04:52 +00:00
|
|
|
return;
|
|
|
|
|
2009-03-27 15:33:35 +00:00
|
|
|
CMixer* pMixer = soundStream->GetMixer();
|
2009-12-23 15:34:14 +00:00
|
|
|
|
2009-12-22 07:26:30 +00:00
|
|
|
if (pMixer && address)
|
2009-02-14 01:07:20 +00:00
|
|
|
{
|
2009-12-22 07:26:30 +00:00
|
|
|
short* samples = (short*)Memory_Get_Pointer(address);
|
2009-12-25 11:59:04 +00:00
|
|
|
// Internal sample rate is always 32khz
|
|
|
|
pMixer->PushSamples(samples, num_samples);
|
2009-12-23 15:34:14 +00:00
|
|
|
|
|
|
|
// FIXME: Write the audio to a file
|
|
|
|
//if (log_ai)
|
|
|
|
// g_wave_writer.AddStereoSamples(samples, 8);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2009-12-23 15:34:14 +00:00
|
|
|
soundStream->Update();
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-03-23 20:55:32 +00:00
|
|
|
|
2010-01-13 14:18:13 +00:00
|
|
|
void DSP_ClearAudioBuffer(bool mute)
|
2009-11-07 20:01:39 +00:00
|
|
|
{
|
2009-11-07 23:51:12 +00:00
|
|
|
if (soundStream)
|
2010-01-13 14:18:13 +00:00
|
|
|
soundStream->Clear(mute);
|
2009-11-07 20:01:39 +00:00
|
|
|
}
|