mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 06:39:14 +01:00
Packed the emu wiimote structs, removed swap16 and removed the speaker amp as the amp was distorting the audio.
This commit is contained in:
parent
021cdac24c
commit
0f615c754a
@ -107,14 +107,13 @@ void Wiimote::SpeakerData(wm_speaker_data* sd)
|
|||||||
|
|
||||||
// Speaker Pan
|
// Speaker Pan
|
||||||
unsigned int vol = (unsigned int)(m_options->settings[4]->GetValue() * 100);
|
unsigned int vol = (unsigned int)(m_options->settings[4]->GetValue() * 100);
|
||||||
float amp = 10.0f; // Boost the speaker volume relative to the rest of the game audio
|
|
||||||
|
|
||||||
if (m_reg_speaker.sample_rate)
|
if (m_reg_speaker.sample_rate)
|
||||||
{
|
{
|
||||||
unsigned int sample_rate = sample_rate_dividend / Common::swap16(m_reg_speaker.sample_rate);
|
unsigned int sample_rate = sample_rate_dividend / m_reg_speaker.sample_rate;
|
||||||
float speaker_volume_ratio = (float)m_reg_speaker.volume / volume_divisor;
|
float speaker_volume_ratio = (float)m_reg_speaker.volume / volume_divisor;
|
||||||
unsigned int left_volume = (unsigned int)((128 + vol) * speaker_volume_ratio * amp);
|
unsigned int left_volume = (unsigned int)((128 + vol) * speaker_volume_ratio);
|
||||||
unsigned int right_volume = (unsigned int)((128 - vol) * speaker_volume_ratio * amp);
|
unsigned int right_volume = (unsigned int)((128 - vol) * speaker_volume_ratio);
|
||||||
|
|
||||||
if (left_volume > 255)
|
if (left_volume > 255)
|
||||||
left_volume = 255;
|
left_volume = 255;
|
||||||
|
@ -24,10 +24,9 @@ namespace WiimoteReal
|
|||||||
{
|
{
|
||||||
class Wiimote;
|
class Wiimote;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace WiimoteEmu
|
namespace WiimoteEmu
|
||||||
{
|
{
|
||||||
|
#pragma pack(push,1)
|
||||||
struct ReportFeatures
|
struct ReportFeatures
|
||||||
{
|
{
|
||||||
u8 core, accel, ir, ext, size;
|
u8 core, accel, ir, ext, size;
|
||||||
@ -197,7 +196,6 @@ private:
|
|||||||
wiimote_key m_ext_key;
|
wiimote_key m_ext_key;
|
||||||
|
|
||||||
u8 m_eeprom[WIIMOTE_EEPROM_SIZE];
|
u8 m_eeprom[WIIMOTE_EEPROM_SIZE];
|
||||||
|
|
||||||
struct MotionPlusReg
|
struct MotionPlusReg
|
||||||
{
|
{
|
||||||
u8 unknown[0xF0];
|
u8 unknown[0xF0];
|
||||||
@ -233,6 +231,7 @@ private:
|
|||||||
u8 play;
|
u8 play;
|
||||||
u8 unk_9;
|
u8 unk_9;
|
||||||
} m_reg_speaker;
|
} m_reg_speaker;
|
||||||
|
#pragma pack(pop)
|
||||||
};
|
};
|
||||||
|
|
||||||
void Spy(Wiimote* wm_, const void* data_, size_t size_);
|
void Spy(Wiimote* wm_, const void* data_, size_t size_);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user