From 0df636ca393d42a032736de0dba48410990c6b2d Mon Sep 17 00:00:00 2001 From: hrydgard Date: Fri, 28 Jan 2011 19:55:21 +0000 Subject: [PATCH] a little more cleanup. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6949 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Common.vcproj | 4 -- Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp | 56 +++++++++-------------- Source/Core/Core/Src/HW/DSPHLE/DSPHLE.h | 10 ++-- Source/PluginSpecs/PluginSpecs.h | 6 --- 4 files changed, 25 insertions(+), 51 deletions(-) diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj index 934ac966c0..378c7dfb3f 100644 --- a/Source/Core/Common/Common.vcproj +++ b/Source/Core/Common/Common.vcproj @@ -487,10 +487,6 @@ RelativePath="..\..\PluginSpecs\PluginSpecs.h" > - - diff --git a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp index 08c38e5082..ae00a919d9 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp @@ -80,10 +80,12 @@ void DSPHLE::Shutdown() AudioCommon::ShutdownSoundStream(); } -void DSPHLE::Update(int cycles) +void DSPHLE::DSP_Update(int cycles) { + // This is called OFTEN - better not do anything expensive! + // ~1/6th as many cycles as the period PPC-side. if (m_pUCode != NULL) - m_pUCode->Update(cycles); + m_pUCode->Update(cycles / 6); } void DSPHLE::SendMailToDSP(u32 _uMail) @@ -191,32 +193,8 @@ void DSPHLE::DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short _Value) } } -u16 DSPHLE::WriteControlRegister(u16 _Value) -{ - UDSPControl Temp(_Value); - if (Temp.DSPReset) - { - SetUCode(UCODE_ROM); - Temp.DSPReset = 0; - } - if (Temp.DSPInit == 0) - { - // copy 128 byte from ARAM 0x000000 to IMEM - SetUCode(UCODE_INIT_AUDIO_SYSTEM); - Temp.DSPInitCode = 0; - } - - m_DSPControl.Hex = Temp.Hex; - return m_DSPControl.Hex; -} - -u16 DSPHLE::ReadControlRegister() -{ - return m_DSPControl.Hex; -} - // Other DSP fuctions -unsigned short DSPHLE::DSP_WriteControlRegister(unsigned short _Value) +u16 DSPHLE::DSP_WriteControlRegister(unsigned short _Value) { UDSPControl Temp(_Value); if (!m_InitMixer) @@ -238,20 +216,28 @@ unsigned short DSPHLE::DSP_WriteControlRegister(unsigned short _Value) m_InitMixer = true; } } - return WriteControlRegister(_Value); + + if (Temp.DSPReset) + { + SetUCode(UCODE_ROM); + Temp.DSPReset = 0; + } + if (Temp.DSPInit == 0) + { + // copy 128 byte from ARAM 0x000000 to IMEM + SetUCode(UCODE_INIT_AUDIO_SYSTEM); + Temp.DSPInitCode = 0; + } + + m_DSPControl.Hex = Temp.Hex; + return m_DSPControl.Hex; } u16 DSPHLE::DSP_ReadControlRegister() { - return ReadControlRegister(); + return m_DSPControl.Hex; } -void DSPHLE::DSP_Update(int cycles) -{ - // This is called OFTEN - better not do anything expensive! - // ~1/6th as many cycles as the period PPC-side. - Update(cycles / 6); -} // 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 diff --git a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.h b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.h index 449eb22881..5c9056f46a 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.h +++ b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.h @@ -56,18 +56,16 @@ public: virtual void DSP_StopSoundStream(); virtual void DSP_ClearAudioBuffer(bool mute); + CMailHandler& AccessMailHandler() { return m_MailHandler; } + // Formerly DSPHandler - void Update(int cycles); - u16 WriteControlRegister(u16 _Value); - u16 ReadControlRegister(); - void SendMailToDSP(u32 _uMail); IUCode *GetUCode(); void SetUCode(u32 _crc); void SwapUCode(u32 _crc); - CMailHandler& AccessMailHandler() { return m_MailHandler; } - private: + void SendMailToDSP(u32 _uMail); + // Declarations and definitions void *m_hWnd; bool m_bWii; diff --git a/Source/PluginSpecs/PluginSpecs.h b/Source/PluginSpecs/PluginSpecs.h index ae0e67f1ec..ce30fa4268 100644 --- a/Source/PluginSpecs/PluginSpecs.h +++ b/Source/PluginSpecs/PluginSpecs.h @@ -56,12 +56,6 @@ enum PLUGIN_COMM // Plugin types enum PLUGIN_TYPE { PLUGIN_TYPE_VIDEO = 1, - PLUGIN_TYPE_DVD, - PLUGIN_TYPE_PAD_REMOVED, - PLUGIN_TYPE_AUDIO, - PLUGIN_TYPE_COMPILER, - PLUGIN_TYPE_DSP, - PLUGIN_TYPE_WIIMOTE_REMOVED, }; #define STATE_MODE_READ 1