Zelda UCode: Found volume and sound type(streaming, sfx) in PBs. Tried to implement volume but the floating point games got on my nerves.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3634 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0905dbc833
commit
de83d1cda4
|
@ -36,8 +36,12 @@ struct ZeldaVoicePB
|
|||
u16 NeedsReset; // 0x04 | indicates if some values in PB need to be reset
|
||||
u16 ReachedEnd; // 0x05 | set to 1 when end reached
|
||||
u16 IsBlank; // 0x06 | 0 = normal sound, 1 = samples are always the same
|
||||
u16 Unk07; // 0x07 | unknown
|
||||
u16 Unk08[0x10]; // 0x08 | unknown // Buffer / something, see 036e/ZWW. there's a pattern here
|
||||
u16 Unk07; // 0x07 | unknown, in zelda always 0x0010
|
||||
u16 SoundType; // 0x08 | Sound type: so far in zww: 0x0d00 for music, 0x4861 for sfx
|
||||
u32 volumeRight; // 0x09 | Right Volume
|
||||
u16 Unk0B[2]; // 0x0B | unknown
|
||||
u32 volumeLeft; // 0x0D | Left Volume
|
||||
u16 Unk0F[0x8]; // 0x0F | unknown // Buffer / something, see 036e/ZWW. there's a pattern here
|
||||
u16 Unk18[0x10]; // 0x18 | unknown
|
||||
u16 Unk28; // 0x28 | unknown
|
||||
u16 Unk29; // 0x29 | unknown // multiplied by 0x2a @ 0d21/ZWW
|
||||
|
|
|
@ -303,6 +303,11 @@ void CUCode_Zelda::MixAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _RightBu
|
|||
case 0x0005: // AFC with extra low bitrate (32:5 compression). Not yet seen.
|
||||
WARN_LOG(DSPHLE, "5 byte AFC - does it work?");
|
||||
case 0x0009: // AFC with normal bitrate (32:9 compression).
|
||||
|
||||
// Use this to disable music (GREAT for testing)
|
||||
//if(PB.SoundType == 0x0d00)
|
||||
// break;
|
||||
|
||||
MixAddVoice_AFC(PB, m_TempBuffer, _Size);
|
||||
break;
|
||||
|
||||
|
@ -334,10 +339,10 @@ void CUCode_Zelda::MixAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _RightBu
|
|||
|
||||
if (left < -32768) left = -32768;
|
||||
if (left > 32767) left = 32767;
|
||||
_LeftBuffer[i] = left;
|
||||
_LeftBuffer[i] = left; //(s32)(((float)left * (float)PB.volumeLeft) / 1000.f);
|
||||
|
||||
if (right < -32768) right = -32768;
|
||||
if (right > 32767) right = 32767;
|
||||
_RightBuffer[i] = right;
|
||||
_RightBuffer[i] = right; //(s32)(((float)right * (float)PB.volumeRight) / 1000.0f);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue