* no reason to re-set value twice from SetBufferData
* passdown the length, not offset
* use counter instead of count
* if size is the same replace "out of memory" to "ok" result, and ignore
DSP image function.
This is the corrections, however doesn't cover every faults few titles
has atm.
!Major breakthrough!
Titles improved:
* The Simpsons: Road Rage (now has music and voiceover audible)
* Ghost Recon: Thunder Island (No longer output distort noises ingame.
100% sure the rest of sequels will work correctly.)
This commit covers:
* FlushEx (DSound Stream only)
* PauseEx (DSound Buffer & Stream)
DSoundStream class should no longer cause audio problems this time for
any titles except for mixbin stuff.
Stream class has its own flags which is 100% different than Buffer
class.
However, it needs more implement support for Flush(Ex) in order to
prevent titles to loop base on Stream class' status output.
Coming Soon™
Confirmed my theory on 4 channels given with attempted 6 channel masks
cause invalid arg on DirectSound buffer creation.
Affected title:
* Ghost Recon 2 (Only happen after 3 or 4 FMVs)
Use prediction if do have enough buffer purpose before allow allocate.
This fixed Mafia title for loading "running man" mission.
Plus add log info for SetEvent failure.
At least emulate xbox audio buffer limitation accurately.
TODO: Need to find max values for Free2DBuffers and Free3DBuffers from
GetCaps function. Then emulating HLE will become more accurate.
Improved title:
* Burnout (Both menu and in-game are now audible.)
Other titles does not appear affected by this change for now.
EmuFlags was not set to 0 and GeneratePCMFormat function must be called
after DSoundBufferSetDefault.
Fixed title:
* Battlestar Galactica
Pretty sure it will fix other titles' crashes.
* instead of calling malloc everytime, let's merge into class instead.
* Check size at play function (temporary, need to apply overall)
* Minimize duplicate code into simplier reuse inline functions.
* What else?
TODO: Need to update StopEx function.