fixed underrun buffer in hle on linux

made wiimote compile on linux again


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2093 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-02-03 22:06:18 +00:00
parent d8f4785772
commit bde4241e9e
7 changed files with 21 additions and 35 deletions

View File

@ -70,7 +70,7 @@ dirs = [
'Source/Plugins/Plugin_PadSimpleEvnt/Src',
'Source/Plugins/Plugin_nJoy_SDL/Src',
'Source/Plugins/Plugin_nJoy_Testing/Src',
# 'Source/Plugins/Plugin_Wiimote/Src',
'Source/Plugins/Plugin_Wiimote/Src',
'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
]

View File

@ -32,10 +32,10 @@ void AOSound::SoundLoop()
device = ao_open_live(default_driver, &format, NULL /* no options */);
if (device == NULL) {
PanicAlert("DSP_HLE: Error opening AO device.\n");
ao_shutdown();
Stop();
return;
PanicAlert("DSP_HLE: Error opening AO device.\n");
ao_shutdown();
Stop();
return;
}
buf_size = format.bits/8 * format.channels * format.rate;
@ -57,11 +57,14 @@ void *soundThread(void *args) {
}
bool AOSound::Start() {
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
soundCriticalSection = new Common::CriticalSection(1);
thread = new Common::Thread(soundThread, (void *)this);
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
soundSyncEvent = new Common::Event();
soundSyncEvent->Init();
soundCriticalSection = new Common::CriticalSection(1);
thread = new Common::Thread(soundThread, (void *)this);
return true;
}

View File

@ -867,7 +867,7 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
DoExtensionConnectedDisconnected();
/* It doesn't seem to be needed but shouldn't it at least take 25 ms to
reconnect an extension after we disconnected another? */
if(g_EmulatorRunning) Sleep(25);
if(g_EmulatorRunning) sleep(25);
}
// Update status

View File

@ -16,9 +16,7 @@
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ŻŻŻŻŻŻŻŻŻŻ
#include <iostream> // System
#include "wiiuse.h" // Externals
@ -188,10 +186,10 @@ void handle_event(struct wiimote_t* wm)
frame->m_GaugeAccel[2]->SetValue(AccelZ);
frame->m_TextIR->SetLabel(wxString::Format(
"Cursor: %03u %03u\nDistance:%4.0f", wm->ir.x, wm->ir.y, wm->ir.z));
wxT("Cursor: %03u %03u\nDistance:%4.0f"), wm->ir.x, wm->ir.y, wm->ir.z));
frame->m_TextAccNeutralCurrent->SetLabel(wxString::Format(
"Current: %03u %03u %03u", AccelX, AccelY, AccelZ));
wxT("Current: %03u %03u %03u"), AccelX, AccelY, AccelZ));
if(frame->m_bRecording)
Console::Print("Wiiuse Recorded accel x, y, z: %03i %03i %03i\n", wm->accel.x, wm->accel.y, wm->accel.z);

View File

@ -16,9 +16,7 @@
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
#include "Common.h" // Common
#include "StringUtil.h"
#include "ConsoleWindow.h" // For Start, Print, GetHwnd
@ -298,7 +296,7 @@ extern "C" void Wiimote_Update()
GetUpdateRate();
if (g_UpdateWriteScreen > g_UpdateRate)
{
frame->m_TextUpdateRate->SetLabel(wxString::Format("Update rate: %03i times/s", g_UpdateRate));
frame->m_TextUpdateRate->SetLabel(wxString::Format(wxT("Update rate: %03i times/s"), g_UpdateRate));
g_UpdateWriteScreen = 0;
}
g_UpdateWriteScreen++;

View File

@ -18,25 +18,14 @@
#ifndef MAIN_H
#define MAIN_H
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ¯¯¯¯¯¯¯¯¯¯
#include <iostream> // System
////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Definitions
// ¯¯¯¯¯¯¯¯¯
#ifndef _WIN32
#define Sleep(x) usleep(x*1000)
#ifdef _WIN32
#define sleep(x) Sleep(x)
#else
#define sleep(x) usleep(x/1000)
#endif
////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Declarations
// ¯¯¯¯¯¯¯¯¯
void DoInitialize();
double GetDoubleTime();
int GetUpdateRate();
@ -98,4 +87,4 @@ struct SRecordingAll
////////////////////////////////
#endif // MAIN_H
#endif // MAIN_H

View File

@ -16,9 +16,7 @@
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ッッッッッッッッッッ
#include <iostream> // System
#include "pluginspecs_wiimote.h"
@ -412,7 +410,7 @@ void FlashLights(bool Connect)
{
if(Connect) wiiuse_rumble(WiiMoteReal::g_WiiMotesFromWiiUse[0], 1);
wiiuse_set_leds(WiiMoteReal::g_WiiMotesFromWiiUse[0], WIIMOTE_LED_1 | WIIMOTE_LED_2 | WIIMOTE_LED_3 | WIIMOTE_LED_4);
Sleep(100);
sleep(100);
if(Connect) wiiuse_rumble(WiiMoteReal::g_WiiMotesFromWiiUse[0], 0);
// End with light 1 or 4