diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2013-03-30 14:38:14 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2013-03-30 14:38:14 +0100 |
| commit | a813f9e13c697bc866ad7f0402dfbfeb3e4c0fee (patch) | |
| tree | 5da75a2a05d1311fa77db046a0173fdea29adadf /Source/Core | |
| parent | e3b0a2c9bf3a73016d641788687aad8b49e04d97 (diff) | |
Support loading polyphase resampling coeffs from User and Sys in HLE
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp index ef7f2b61ca..b21e2f66f4 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp @@ -55,13 +55,30 @@ void CUCode_AX::LoadResamplingCoefficients() { m_coeffs_available = false; - std::string filename = File::GetUserPath(D_GCUSER_IDX) + "dsp_coef.bin"; - if (!File::Exists(filename)) - return; + std::string filenames[] = { + File::GetUserPath(D_GCUSER_IDX) + "dsp_coef.bin", + File::GetSysDirectory() + "/GC/dsp_coef.bin" + }; + + size_t fidx; + std::string filename; + for (fidx = 0; fidx < sizeof (filenames) / sizeof (filenames[0]); ++fidx) + { + filename = filenames[fidx]; + if (!File::Exists(filename)) + continue; + + if (File::GetSize(filename) != 0x1000) + continue; - if (File::GetSize(filename) != 0x1000) + break; + } + + if (fidx >= sizeof (filenames) / sizeof (filenames[0])) return; + WARN_LOG(DSPHLE, "Loading polyphase resampling coeffs from %s", filename.c_str()); + FILE* fp = fopen(filename.c_str(), "rb"); fread(m_coeffs, 1, 0x1000, fp); fclose(fp); |
