Audio system update - HLE plugin submitted, homebrew has sound, and also Mario movies!! (this was very unexpected). This also acts as a frame limiter. Might provide an option to turn it off in the future.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@227 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-16 21:58:07 +00:00
parent dcd5ffeb7a
commit aa3fee8c60
57 changed files with 4438 additions and 104 deletions
+22 -10
View File
@@ -53,14 +53,14 @@ union AICR
AICR(u32 _hex) { hex = _hex;}
struct
{
unsigned PSTAT : 1; // sample counter/playback enable
unsigned AFR : 1; // 0=32khz 1=48khz
unsigned AIINTMSK : 1; // 0=interrupt masked 1=interrupt enabled
unsigned AIINT : 1; // audio interrupt status
unsigned AIINTVLD : 1; // This bit controls whether AIINT is affected by the AIIT register
// matching AISLRCNT. Once set, AIINT will hold
unsigned SCRESET : 1; // write to reset counter
unsigned DSPFR : 1; // DSP Frequency (0=32khz 1=48khz)
unsigned PSTAT : 1; // sample counter/playback enable
unsigned AFR : 1; // 0=32khz 1=48khz
unsigned AIINTMSK : 1; // 0=interrupt masked 1=interrupt enabled
unsigned AIINT : 1; // audio interrupt status
unsigned AIINTVLD : 1; // This bit controls whether AIINT is affected by the AIIT register
// matching AISLRCNT. Once set, AIINT will hold
unsigned SCRESET : 1; // write to reset counter
unsigned DSPFR : 1; // DSP Frequency (0=32khz 1=48khz)
unsigned :25;
};
u32 hex;
@@ -96,6 +96,7 @@ void ReadStreamBlock(short* _pPCM);
static u64 g_LastCPUTime = 0;
static int g_SampleRate = 32000;
static int g_DSPSampleRate = 32000;
static u64 g_CPUCyclesPerSample = 0xFFFFFFFFFFFULL;
void Init()
@@ -116,6 +117,7 @@ void Read32(u32& _rReturnValue, const u32 _Address)
case AI_CONTROL_REGISTER: //0x6C00
LOG(AUDIO_INTERFACE, "AudioInterface(R) 0x%08x", _Address);
_rReturnValue = g_AudioRegister.m_Control.hex;
return;
// Sample Rate (AIGetDSPSampleRate)
@@ -164,7 +166,10 @@ void Write32(const u32 _Value, const u32 _Address)
g_AudioRegister.m_Control.AFR = tmpAICtrl.AFR;
}
g_SampleRate = g_AudioRegister.m_Control.AFR ? 48000 : 32000;
g_SampleRate = tmpAICtrl.AFR ? 32000 : 48000;
g_DSPSampleRate = tmpAICtrl.DSPFR ? 32000 : 48000;
// PanicAlert("Sample rate %i %i", g_Aui, g_SampleRate);
g_CPUCyclesPerSample = SystemTimers::GetTicksPerSecond() / g_SampleRate;
// Streaming counter
@@ -195,6 +200,8 @@ void Write32(const u32 _Value, const u32 _Address)
g_LastCPUTime = CoreTiming::GetTicks();
}
g_AudioRegister.m_Control = tmpAICtrl;
UpdateInterrupts();
}
break;
@@ -316,11 +323,16 @@ void IncreaseSampleCount(const u32 _iAmount)
}
}
u32 GetRate()
u32 GetAISampleRate()
{
return g_SampleRate;
}
u32 GetDSPSampleRate()
{
return g_DSPSampleRate;
}
void Update()
{
// update timer
+2 -1
View File
@@ -42,7 +42,8 @@ void HWCALL Read32(u32& _uReturnValue, const u32 _iAddress);
void HWCALL Write32(const u32 _iValue, const u32 _iAddress);
// Get the Audio Rate (48000 or 32000)
u32 GetRate();
u32 GetAISampleRate();
u32 GetDSPSampleRate();
} // end of namespace AudioInterface
+11 -8
View File
@@ -179,11 +179,6 @@ void WriteARAM(u8 _iValue, u32 _iAddress);
bool Update_DSP_ReadRegister();
void Update_DSP_WriteRegister();
int GetDSPSampleRate()
{
return 32000; // TODO - can also be 48000
}
void Init()
{
g_ARAM = (u8 *)AllocateMemoryPages(ARAM_SIZE);
@@ -414,7 +409,7 @@ void Write16(const u16 _Value, const u32 _Address)
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
GenerateDSPInterrupt(DSP::INT_AID);
LOG(DSP, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks);
LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks);
}
break;
}
@@ -432,8 +427,12 @@ void Write16(const u16 _Value, const u32 _Address)
void UpdateAudioDMA()
{
if (g_audioDMA.AudioDMAControl.Enabled && g_audioDMA.BlocksLeft) {
// TODO : Read audio at g_audioDMA.ReadAddress in RAM and push onto an external audio fifo in the emulator,
// to be mixed with the disc streaming output. If that audio queue fills up, we have to delay the emulator.
// Read audio at g_audioDMA.ReadAddress in RAM and push onto an external audio fifo in the emulator,
// to be mixed with the disc streaming output. If that audio queue fills up, we delay the emulator.
// TO RESTORE OLD BEHAVIOUR, COMMENT OUT THIS LINE
PluginDSP::DSP_SendAIBuffer(g_audioDMA.ReadAddress, AudioInterface::GetDSPSampleRate());
g_audioDMA.ReadAddress += 32;
g_audioDMA.BlocksLeft--;
if (!g_audioDMA.BlocksLeft) {
@@ -444,6 +443,10 @@ void UpdateAudioDMA()
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
GenerateDSPInterrupt(DSP::INT_AID);
}
} else {
// Send silence. Yeah, it's a bit of a waste to sample rate convert silence.
// or hm. Maybe we shouldn't do this :)
// PluginDSP::DSP_SendAIBuffer(0, AudioInterface::GetDSPSampleRate());
}
}
-1
View File
@@ -50,7 +50,6 @@ u8 ReadARAM(const u32 _uAddress);
u8* GetARAMPtr();
void UpdateAudioDMA();
int GetDSPSampleRate();
}// end of namespace DSP
+3 -4
View File
@@ -92,15 +92,14 @@ void AICallback(u64 userdata, int cyclesLate)
void DSPCallback(u64 userdata, int cyclesLate)
{
// Poke the DSP, make it do stuff. This should eventually be replaced with dsp->RunCycles(1000) or whatever,
// ~1/6th as many cycles as the period PPC-side.
PluginDSP::DSP_Update();
PluginDSP::DSP_Update(DSP_PERIOD / 6);
CoreTiming::ScheduleEvent(DSP_PERIOD-cyclesLate, &DSPCallback, "DSPCallback");
}
void AudioFifoCallback(u64 userdata, int cyclesLate)
{
int period = CPU_CORE_CLOCK / (DSP::GetDSPSampleRate() * 4 / 32);
int period = CPU_CORE_CLOCK / (AudioInterface::GetDSPSampleRate() * 4 / 32);
DSP::UpdateAudioDMA(); // Push audio to speakers.
CoreTiming::ScheduleEvent(period - cyclesLate, &AudioFifoCallback, "AudioFifoCallback");
@@ -140,7 +139,7 @@ void DecrementerSet()
u32 decValue = PowerPC::ppcState.spr[SPR_DEC];
fakeDec = decValue*TIMER_RATIO;
CoreTiming::RemoveEvent(DecrementerCallback);
CoreTiming::ScheduleEvent(decValue*TIMER_RATIO, DecrementerCallback, "DecCallback");
CoreTiming::ScheduleEvent(decValue * TIMER_RATIO, DecrementerCallback, "DecCallback");
}
void AdvanceCallback(int cyclesExecuted)
+6 -6
View File
@@ -31,8 +31,8 @@ typedef void (__cdecl* TDSP_WriteMailBox)(BOOL _CPUMailbox, unsigned short);
typedef unsigned short (__cdecl* TDSP_ReadMailBox)(BOOL _CPUMailbox);
typedef unsigned short (__cdecl* TDSP_ReadControlRegister)();
typedef unsigned short (__cdecl* TDSP_WriteControlRegister)(unsigned short);
typedef void (__cdecl* TDSP_Update)();
typedef void (__cdecl* TDSP_SendAIBuffer)(unsigned int _Address, unsigned int _Size);
typedef void (__cdecl* TDSP_Update)(int cycles);
typedef void (__cdecl* TDSP_SendAIBuffer)(unsigned int address, int sample_rate);
//! Function Pointer
TGetDllInfo g_GetDllInfo = 0;
@@ -217,16 +217,16 @@ unsigned short DSP_ReadControlRegister()
// __________________________________________________________________________________________________
//
void DSP_Update()
void DSP_Update(int cycles)
{
g_DSP_Update();
g_DSP_Update(cycles);
}
// __________________________________________________________________________________________________
//
void DSP_SendAIBuffer(unsigned int _Address, unsigned int _Size)
void DSP_SendAIBuffer(unsigned int address, int sample_rate)
{
g_DSP_SendAIBuffer(_Address, _Size);
g_DSP_SendAIBuffer(address, sample_rate);
}
}
+2 -2
View File
@@ -42,8 +42,8 @@ void DSP_WriteMailboxHigh(bool _CPUMailbox, unsigned short _Value);
void DSP_WriteMailboxLow(bool _CPUMailbox, unsigned short _Value);
unsigned short DSP_WriteControlRegister(unsigned short _Flags);
unsigned short DSP_ReadControlRegister();
void DSP_Update();
void DSP_SendAIBuffer(unsigned int _Address, unsigned int _Size);
void DSP_Update(int cycles);
void DSP_SendAIBuffer(unsigned int address, int sample_rate);
} // end of namespace PluginDSP
+2 -1
View File
@@ -353,7 +353,8 @@ namespace Jit64
const u8* DoJit(u32 emaddress, JitBlock &b)
{
_assert_msg_(DYNA_REC, emaddress != 0, "ERROR - Trying to compile at 0. LR=%08x",LR);
if (emaddress == 0)
PanicAlert("ERROR : Trying to compile at 0. LR=%08x", LR);
u32 size;
js.isLastInstruction = false;
@@ -87,12 +87,14 @@ namespace Jit64
if (inst.LK)
AND(32, M(&CR), Imm32(~(0xFF000000)));
#endif
//if (destination == js.compilerPC)
//{
if (destination == js.compilerPC)
{
//PanicAlert("Idle loop detected at %08x", destination);
// CALL(ProtectFunction(&CoreTiming::Idle, 0));
// JMP(Asm::testExceptions, true);
//}
// make idle loops go faster
js.downcountAmount += 8;
}
WriteExit(destination, 0);
}
else {
@@ -99,9 +99,6 @@ u32 PPCAnalyst::EvaluateBranchTarget(UGeckoInstruction instr, u32 pc)
u32 PPCAnalyst::AnalyzeFunction(u32 startAddr, SFunction &func)
{
//if (startAddr <0x80000008 || startAddr>0x80000000+Memory::RAM_MASK)
// return 0;
func.name = StringFromFormat("zzz_%08x ??", startAddr);
func.calls.clear();
func.callers.clear();
@@ -262,9 +262,8 @@ inline void decodebytesARGB8pass1(u32 *dst, u16 *src, int numpixels)
for (int x = 0; x < numpixels; x++)
{
int val = Common::swap16(src[x]);
int a=val&0xFF;
val>>=8;
int a = val & 0xFF;
val >>= 8;
*dst++ = (a<<16) | (val<<24);
}
}
@@ -274,9 +273,8 @@ inline void decodebytesARGB8pass2(u32 *dst, u16 *src, int numpixels)
for (int x = 0; x < numpixels; x++)
{
int val = Common::swap16(src[x]);
int a=val&0xFF;
val>>=8;
int a = val & 0xFF;
val >>= 8;
*dst++ |= (val<<8) | (a<<0);
}
}
@@ -419,9 +417,9 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texf
for (int x = 0; x < width; x += 4)
{
for (int iy = 0; iy < 4; iy++, src += 8)
decodebytesARGB8pass1((u32*)dst+(y+iy)*width+x, (u16*)src, 4);
decodebytesARGB8pass1((u32*)dst + (y+iy)*width + x, (u16*)src, 4);
for (int iy = 0; iy < 4; iy++, src += 8)
decodebytesARGB8pass2((u32*)dst+(y+iy)*width+x, (u16*)src, 4);
decodebytesARGB8pass2((u32*)dst + (y+iy)*width + x, (u16*)src, 4);
}
}
return PC_TEX_FMT_BGRA32;
+37 -20
View File
@@ -3,16 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcproj", "{F0B874CB-4476-4199-9315-8343D05AE684}"
ProjectSection(ProjectDependencies) = postProject
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcproj", "{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
ProjectSection(ProjectDependencies) = postProject
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_PadSimple", "Plugins\Plugin_PadSimple\Plugin_PadSimple.vcproj", "{9A183B48-ECC2-4121-876A-9B3793686073}"
@@ -33,24 +33,24 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiscIO", "Core\DiscIO\DiscI
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoOGL", "Plugins\Plugin_VideoOGL\Plugin_VideoOGL.vcproj", "{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
ProjectSection(ProjectDependencies) = postProject
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Core\Common\Common.vcproj", "{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
ProjectSection(ProjectDependencies) = postProject
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxBase28", "..\Externals\wxWidgets\build\msw\wx_base.vcproj", "{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}"
@@ -59,11 +59,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxCore28", "..\Externals\wx
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DebuggerWX", "Core\DebuggerWX\DebuggerWX.vcproj", "{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}"
ProjectSection(ProjectDependencies) = postProject
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_DSP_NULL", "Plugins\Plugin_DSP_NULL\Plugin_DSP_NULL.vcproj", "{9AC65CBE-7854-4A86-AA10-D73FF9E5D61F}"
@@ -80,9 +80,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_PadDX9", "Plugins\Pl
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_nJoy_SDL", "Plugins\Plugin_nJoy_SDL\Plugin_nJoy_SDL.vcproj", "{521498BE-6089-4780-8223-E67C22F4E068}"
ProjectSection(ProjectDependencies) = postProject
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_DSP_HLE", "Plugins\Plugin_DSP_HLE\Plugin_DSP_HLE.vcproj", "{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}"
ProjectSection(ProjectDependencies) = postProject
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Global
@@ -299,6 +304,18 @@ Global
{521498BE-6089-4780-8223-E67C22F4E068}.Release|Win32.Build.0 = Release|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.Release|x64.ActiveCfg = Release|x64
{521498BE-6089-4780-8223-E67C22F4E068}.Release|x64.Build.0 = Release|x64
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|Win32.ActiveCfg = Debug|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|Win32.Build.0 = Debug|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|x64.ActiveCfg = Debug|x64
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|x64.Build.0 = Debug|x64
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.DebugFast|Win32.Build.0 = DebugFast|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.DebugFast|x64.ActiveCfg = DebugFast|x64
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.DebugFast|x64.Build.0 = DebugFast|x64
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Release|Win32.ActiveCfg = Release|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Release|Win32.Build.0 = Release|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Release|x64.ActiveCfg = Release|x64
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+4 -4
View File
@@ -151,18 +151,18 @@ EXPORT unsigned short CALL DSP_ReadControlRegister(void);
// __________________________________________________________________________________________________
// Function: DSP_Update
// Purpose: This function is called from time to time from the core.
// input: flag (DSP_FLAG_RESET, DSP_FLAG_ASSERT_INT, ...)
// input: cycles - run this number of DSP clock cycles.
// output: TRUE if the flag is set, else FALSE
//
EXPORT void CALL DSP_Update(void);
EXPORT void CALL DSP_Update(int cycles);
// __________________________________________________________________________________________________
// Function: DSP_SendAIBuffer
// Purpose: This function sends the current AI Buffer to the DSP plugin
// input: _Address : Memory-Address
// input: _Size : Size of the Buffer
// input: _Size : Size of the Buffer (always 32)
//
EXPORT void CALL DSP_SendAIBuffer(unsigned int _Address, unsigned int _Size);
EXPORT void CALL DSP_SendAIBuffer(unsigned int address, int sample_rate);
#undef CALL
#if defined(__cplusplus)
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,34 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#include "resource.h"
#include "AboutDlg.h"
LRESULT
CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CenterWindow(GetParent());
return(TRUE);
}
LRESULT
CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return(0);
}
@@ -0,0 +1,41 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#pragma once
class CAboutDlg
: public CDialogImpl<CAboutDlg>
{
public:
enum { IDD = IDD_ABOUT };
BEGIN_MSG_MAP(CAboutDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
};
@@ -0,0 +1,75 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#include "Common.h"
#include "IniFile.h"
#include "Config.h"
CConfig g_Config;
CConfig::CConfig()
{
Load();
}
void CConfig::LoadDefaults()
{
m_EnableHLEAudio = true;
m_EnableDTKMusic = true;
m_Interpolation = true;
m_DumpSampleMinLength = true;
m_DumpSamples = false;
m_AntiGap = false;
}
void CConfig::Load()
{
// first load defaults
LoadDefaults();
IniFile file;
file.Load("DSP.ini");
file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true);
file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
file.Get("Config", "Interpolation", &m_Interpolation, true);
file.Get("Config", "DumpSamples", &m_DumpSamples, false);
file.Get("Config", "DumpSampleMinLength", &m_DumpSampleMinLength, true);
#ifdef _WIN32
file.Get("Config", "DumpSamplePath", &m_szSamplePath, "C:\\");
#else
file.Get("Config", "DumpSamplePath", &m_szSamplePath, "/dev/null/");
#endif
file.Get("Config", "AntiGap", &m_AntiGap, false);
}
void CConfig::Save()
{
IniFile file;
file.Load("DSP.ini");
file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio);
file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
file.Set("Config", "Interpolation", m_Interpolation);
file.Set("Config", "DumpSamples", m_DumpSamples);
file.Set("Config", "DumpSampleMinLength", m_DumpSampleMinLength);
#ifdef _WIN32
file.Set("Config", "DumpSamplePath", m_szSamplePath);
#else
file.Set("Config", "DumpSamplePath", m_szSamplePath);
#endif
file.Set("Config", "AntiGap", m_AntiGap);
file.Save("DSP.ini");
}
@@ -0,0 +1,46 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#ifndef _CONFIG_H
#define _CONFIG_H
#include <string>
struct CConfig
{
bool m_AntiGap;
bool m_EnableHLEAudio;
bool m_EnableDTKMusic;
bool m_Interpolation;
bool m_DumpSamples;
std::string m_szSamplePath;
int m_SampleRate;
bool m_DumpSampleMinLength;
CConfig();
void LoadDefaults();
void Load();
void Save();
};
extern CConfig g_Config;
#endif
@@ -0,0 +1,70 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#include "resource.h"
#include "Config.h"
#include "ConfigDlg.h"
LRESULT
CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
g_Config.Load();
//CenterWindow(this->GetParent());
CenterWindow(GetParent());
m_buttonEnableHLEAudio = GetDlgItem(IDC_ENABLE_HLE_AUDIO);
m_buttonEnableDTKMusic = GetDlgItem(IDC_ENABLE_DTK_MUSIC);
m_buttonAntiGap = GetDlgItem(IDC_ANTIGAP);
m_buttonDumpSamples = GetDlgItem(IDC_DUMPSAMPLES);
m_editDumpSamplePath = GetDlgItem(IDC_SAMPLEDUMPPATH);
m_comboSampleRate = GetDlgItem(IDC_SAMPLERATE);
m_buttonEnableHLEAudio.SetCheck(g_Config.m_EnableHLEAudio ? BST_CHECKED : BST_UNCHECKED);
m_buttonEnableDTKMusic.SetCheck(g_Config.m_EnableDTKMusic ? BST_CHECKED : BST_UNCHECKED);
m_buttonAntiGap.SetCheck(g_Config.m_AntiGap ? BST_CHECKED : BST_UNCHECKED);
m_buttonDumpSamples.SetCheck(g_Config.m_DumpSamples ? BST_CHECKED : BST_UNCHECKED);
m_editDumpSamplePath.SetWindowText(g_Config.m_szSamplePath.c_str());
m_comboSampleRate.AddString("44100");
m_comboSampleRate.AddString("48000");
m_comboSampleRate.SetCurSel(g_Config.m_SampleRate == 44100 ? 0 : 1);
return(TRUE);
}
LRESULT
CConfigDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (wID == IDOK)
{
g_Config.m_EnableHLEAudio = (m_buttonEnableHLEAudio.GetCheck() == BST_CHECKED) ? true : false;
g_Config.m_EnableDTKMusic = (m_buttonEnableDTKMusic.GetCheck() == BST_CHECKED) ? true : false;
g_Config.m_DumpSamples = (m_buttonDumpSamples.GetCheck() == BST_CHECKED) ? true : false;
g_Config.m_AntiGap = (m_buttonAntiGap.GetCheck() == BST_CHECKED) ? true : false;
char temp[MAX_PATH];
m_editDumpSamplePath.GetWindowText(temp, MAX_PATH);
g_Config.m_szSamplePath = temp;
g_Config.m_SampleRate = (m_comboSampleRate.GetCurSel() == 0 ? 44100 : 48000);
g_Config.Save();
}
EndDialog(wID);
g_Config.Save();
return(0);
}
@@ -0,0 +1,49 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#pragma once
class CConfigDlg
: public CDialogImpl<CConfigDlg>
{
public:
enum { IDD = IDD_SETTINGS };
BEGIN_MSG_MAP(CConfigDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
private:
CButton m_buttonEnableHLEAudio;
CButton m_buttonEnableDTKMusic;
CButton m_buttonDumpSamples;
CButton m_buttonAntiGap;
CEdit m_editDumpSamplePath;
CComboBox m_comboSampleRate;
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
};

Some files were not shown because too many files have changed in this diff Show More