DSPHLE/ZeldaUcode/AFC5 improvement (can be heard when you jump on/talk to ppl in Super Mario Sunshine)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4429 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marko Pusljar 2009-10-16 15:56:36 +00:00
parent 5834fa6710
commit c8fc5e8f37
1 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,7 @@ void CUCode_Zelda::AFCdecodebuffer(const s16 *coef, const char *src, signed shor
{ {
// In Pikmin, Dolphin's engine sound is using AFC type 5, even though such a sound is hard // In Pikmin, Dolphin's engine sound is using AFC type 5, even though such a sound is hard
// to compare, it seems like to sound exactly like a real GC // to compare, it seems like to sound exactly like a real GC
// In Super Mario Sunshine, you can get such a sound by talking to anyone // In Super Mario Sunshine, you can get such a sound by talking to/jumping on anyone
DEBUG_LOG(DSPHLE, "5 bytes AFC sample"); DEBUG_LOG(DSPHLE, "5 bytes AFC sample");
for (int i = 0; i < 16; i += 4) for (int i = 0; i < 16; i += 4)
{ {
@ -68,7 +68,10 @@ void CUCode_Zelda::AFCdecodebuffer(const s16 *coef, const char *src, signed shor
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
int sample = delta * nibbles[i] + ((long)hist * coef[idx * 2]) + ((long)hist2 * coef[idx * 2 + 1]); int sample = delta * nibbles[i] + ((long)hist * coef[idx * 2]) + ((long)hist2 * coef[idx * 2 + 1]);
sample >>= 11; if (type == 9)
sample >>= 11;
else
sample >>= 13;
if (sample > 32767) if (sample > 32767)
sample = 32767; sample = 32767;
if (sample < -32768) if (sample < -32768)