diff options
| author | John Peterson <jpeterson57@gmail.com> | 2008-11-14 11:47:17 +0000 |
|---|---|---|
| committer | John Peterson <jpeterson57@gmail.com> | 2008-11-14 11:47:17 +0000 |
| commit | 2976f3f1e3171c19193fbadea6192c40f6dfa9d4 (patch) | |
| tree | aa498316e966fb1ac47fac2a40c353f489eeafd7 /Source/Core | |
| parent | 09e168beac4f2c96eceff46336e2b2327152d984 (diff) | |
Fixed Wii AX sound, for real this time
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1169 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Src/DynamicLibrary.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/DSP.cpp | 27 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/PluginManager.cpp | 2 |
3 files changed, 24 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/DynamicLibrary.cpp b/Source/Core/Common/Src/DynamicLibrary.cpp index 07b30cdba7..286bb103c1 100644 --- a/Source/Core/Common/Src/DynamicLibrary.cpp +++ b/Source/Core/Common/Src/DynamicLibrary.cpp @@ -59,7 +59,7 @@ std::string GetLastErrorAsString() bool DynamicLibrary::Load(const char* filename)
{
if (!filename || strlen(filename) == 0)
- { + {
LOG(MASTER_LOG, "Missing filename of dynamic library to load");
return false;
}
@@ -85,7 +85,7 @@ bool DynamicLibrary::Load(const char* filename) LOG(MASTER_LOG, "Error loading DLL %s: %s", filename, dlerror());
#else
printf("Error loading DLL %s: %s", filename, dlerror());
- #endif + #endif
return false;
}
#endif
diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 35e01eac32..9c695fce5c 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -166,7 +166,7 @@ struct ARDMA // STATE_TO_SAVE
-u8 *g_ARAM = NULL;
+u8 *g_ARAM = NULL, *g_MEM2 = NULL;
DSPState g_dspState;
AudioDMA g_audioDMA;
ARDMA g_arDMA;
@@ -206,6 +206,7 @@ void Init() {
// On the Wii, ARAM is simply mapped to EXRAM.
g_ARAM = Memory::GetPointer(0x00000000);
+ g_MEM2 = Memory::GetPointer(0x10000000);
}
else
{
@@ -615,7 +616,9 @@ void Update_ARAM_DMA() // =============================================================
// This is how it works: The game has written sound to RAM, the DSP will read it with
// this function. SamplePos in the plugin is double the value given here because it
-// works on a nibble level.
+// works on a nibble level. In Wii addresses can eather be for MEM1 or MEM2, when it wants
+// to read from MEM2 it adds 0x2000000 (in nibble terms) to get up to the MEM2 hardware
+// address. But in our case we use a second pointer and adjust the value down to 0x00...
// -------------------
u8 ReadARAM(u32 _iAddress)
{
@@ -624,9 +627,21 @@ u8 ReadARAM(u32 _iAddress) // _dbg_assert_(DSPINTERFACE,(_iAddress) < ARAM_SIZE);
if(Core::GetStartupParameter().bWii)
{
+ //LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x 0x%08x 0x%08x", WII_MASK, _iAddress, (_iAddress & WII_MASK));
+
+ // Does this make any sense?
if(_iAddress > WII_MASK)
- _iAddress = (_iAddress & WII_MASK);
- return g_ARAM[_iAddress];
+ {
+ if(_iAddress > WII_MASK)
+ _iAddress = (_iAddress & WII_MASK);
+ return g_MEM2[_iAddress];
+ }
+ else
+ {
+ if(_iAddress > WII_MASK)
+ _iAddress = (_iAddress & WII_MASK);
+ return g_ARAM[_iAddress];
+ }
}
else
return g_ARAM[_iAddress & ARAM_MASK];
@@ -636,7 +651,7 @@ u8* GetARAMPtr() {
return g_ARAM;
}
-// ===================
+
void WriteARAM(u8 _iValue, u32 _iAddress)
@@ -650,4 +665,4 @@ void WriteARAM(u8 _iValue, u32 _iAddress) }
} // end of namespace DSP
-
+// ===================
diff --git a/Source/Core/DolphinWX/Src/PluginManager.cpp b/Source/Core/DolphinWX/Src/PluginManager.cpp index 39ee6a97cd..ed81d54ce4 100644 --- a/Source/Core/DolphinWX/Src/PluginManager.cpp +++ b/Source/Core/DolphinWX/Src/PluginManager.cpp @@ -112,7 +112,7 @@ void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename) if (Common::CPlugin::Load(_rFilename))
{
Common::CPlugin::Debug((HWND)_Parent);
- Common::CPlugin::Release();
+ //Common::CPlugin::Release(); // this is only if the wx dialog is called with ShowModal()
}
}
|
