Move UDSPControl structure into DSP.h .

This commit is contained in:
magumagu 2014-03-27 15:51:57 -07:00
parent 9b8296d5ab
commit aac4206664
6 changed files with 34 additions and 61 deletions

View File

@ -12,31 +12,6 @@ class CMixer;
extern SoundStream *soundStream;
// UDSPControl
union UDSPControl
{
u16 Hex;
struct
{
u16 DSPReset : 1; // Write 1 to reset and waits for 0
u16 DSPAssertInt : 1;
u16 DSPHalt : 1;
u16 AI : 1;
u16 AI_mask : 1;
u16 ARAM : 1;
u16 ARAM_mask : 1;
u16 DSP : 1;
u16 DSP_mask : 1;
u16 ARAM_DMAState : 1; // DSPGetDMAStatus() uses this flag
u16 DSPInitCode : 1;
u16 DSPInit : 1; // DSPInit() writes to this flag
u16 pad : 4;
};
UDSPControl(u16 _Hex = 0) : Hex(_Hex) {}
};
namespace AudioCommon
{
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd);

View File

@ -76,34 +76,6 @@ union UARAMCount
};
};
// UDSPControl
#define DSP_CONTROL_MASK 0x0C07
union UDSPControl
{
u16 Hex;
struct
{
// DSP Control
u16 DSPReset : 1; // Write 1 to reset and waits for 0
u16 DSPAssertInt : 1;
u16 DSPHalt : 1;
// Interrupt for DMA to the AI/speakers
u16 AID : 1;
u16 AID_mask : 1;
// ARAM DMA interrupt
u16 ARAM : 1;
u16 ARAM_mask : 1;
// DSP DMA interrupt
u16 DSP : 1;
u16 DSP_mask : 1;
// Other ???
u16 DMAState : 1; // DSPGetDMAStatus() uses this flag. __ARWaitForDMA() uses it too...maybe it's just general DMA flag
u16 unk3 : 1;
u16 DSPInit : 1; // DSPInit() writes to this flag
u16 pad : 4;
};
};
// DSPState
struct DSPState
{
@ -394,7 +366,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
if (tmpControl.DSP) g_dspState.DSPControl.DSP = 0;
// unknown
g_dspState.DSPControl.unk3 = tmpControl.unk3;
g_dspState.DSPControl.DSPInitCode = tmpControl.DSPInitCode;
g_dspState.DSPControl.pad = tmpControl.pad;
if (g_dspState.DSPControl.pad != 0)
{

View File

@ -27,6 +27,35 @@ enum
ARAM_MASK = 0x00FFFFFF,
};
// UDSPControl
#define DSP_CONTROL_MASK 0x0C07
union UDSPControl
{
u16 Hex;
struct
{
// DSP Control
u16 DSPReset : 1; // Write 1 to reset and waits for 0
u16 DSPAssertInt : 1;
u16 DSPHalt : 1;
// Interrupt for DMA to the AI/speakers
u16 AID : 1;
u16 AID_mask : 1;
// ARAM DMA interrupt
u16 ARAM : 1;
u16 ARAM_mask : 1;
// DSP DMA interrupt
u16 DSP : 1;
u16 DSP_mask : 1;
// Other ???
u16 DMAState : 1; // DSPGetDMAStatus() uses this flag. __ARWaitForDMA() uses it too...maybe it's just general DMA flag
u16 DSPInitCode : 1; // Indicator that the DSP was initialized?
u16 DSPInit : 1; // DSPInit() writes to this flag
u16 pad : 4;
};
UDSPControl(u16 _Hex = 0) : Hex(_Hex) {}
};
void Init(bool hle);
void Shutdown();

View File

@ -274,7 +274,7 @@ void DSPHLE::InitMixer()
// Other DSP fuctions
u16 DSPHLE::DSP_WriteControlRegister(unsigned short _Value)
{
UDSPControl Temp(_Value);
DSP::UDSPControl Temp(_Value);
if (!m_InitMixer)
{
if (!Temp.DSPHalt)

View File

@ -8,6 +8,7 @@
#include "AudioCommon/SoundStream.h"
#include "Core/DSPEmulator.h"
#include "Core/HW/DSP.h"
#include "Core/HW/DSPHLE/MailHandler.h"
class IUCode;
@ -73,7 +74,7 @@ private:
IUCode* m_pUCode;
IUCode* m_lastUCode;
UDSPControl m_DSPControl;
DSP::UDSPControl m_DSPControl;
CMailHandler m_MailHandler;
bool m_bHalt;

View File

@ -192,13 +192,9 @@ void DSPLLE::InitMixer()
u16 DSPLLE::DSP_WriteControlRegister(u16 _uFlag)
{
UDSPControl Temp(_uFlag);
if (!m_InitMixer)
{
if (!Temp.DSPHalt)
{
InitMixer();
}
InitMixer();
}
DSPInterpreter::WriteCR(_uFlag);