Commit Graph

4275 Commits

Author SHA1 Message Date
RadWolfie d93990264f Add test case log for DS Stream Process function 2018-04-29 12:40:43 -05:00
RadWolfie 8ac0bb1371 Last fixup for mixbin
There are other identifiers of mixbin, except we're not focusing on
them.
2018-04-29 12:40:43 -05:00
RadWolfie 7627267c15 Preserve and correct some volume stuff
We don't want volume to constant increase over time. 😉
2018-04-29 12:40:43 -05:00
RadWolfie e5bd691615 Another fixup for XDSMIXBIN flags 2018-04-29 12:40:43 -05:00
RadWolfie edd526ff2f Add some support for SetMixBinVolumes_8
Plus include pre-set volume for if one of audio codec is disabled to
both Buffer and Stream class creations.
2018-04-29 12:40:43 -05:00
RadWolfie db2c8017d2 Move note to above function 2018-04-29 12:40:43 -05:00
RadWolfie d14ab3b0e6 Fix note for SetMixBinVolumes patch 2018-04-29 12:40:43 -05:00
RadWolfie 4a115afc26 Remove debug messages
No longer is necessary.
2018-04-29 12:40:43 -05:00
RadWolfie 11222a8538 Another minor fixup for Flush function
Plus ensure flags are reset inside Discontinuity function.
2018-04-29 12:40:43 -05:00
RadWolfie e7d38340ec Minor fix for hybrid pause function 2018-04-29 12:40:43 -05:00
RadWolfie 30e36f36de Revert PAUSENOACTIVATE since it broke audio for RF2
Originally, it might be correct in the first place. It may has to do
with given parameter of buffer class to be output.
2018-04-29 12:40:42 -05:00
RadWolfie 55661cd3d2 Include rtTimeStamp parameter support
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.
2018-04-29 12:40:42 -05:00
RadWolfie 5bd4faba8e Fix DSound Stream's SetFormat
TODO: might need callback and context passdown as well?
2018-04-29 12:40:42 -05:00
RadWolfie 03d2f50d93 Buffer also has PauseEx, add member for it 2018-04-29 12:40:42 -05:00
RadWolfie be82e8ef4a Replace DSB_FLAG_XXXX to DSE_FLAG_XXXX
Doesn't make sense to use DSB since we are using emulated flag to
trigger events of what xbox would do.
2018-04-29 12:40:42 -05:00
RadWolfie 12b4a12f2e Stub support to have Flush process data too.
Need to implement ASYNC support via separate thread worker. <-- is a
requirement.

Confirmed Flush will perform busy-state until audio is stop.
2018-04-29 12:40:42 -05:00
RadWolfie 156ea1d73a Fix GetStatus since both Buffer and Stream are diff
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™
2018-04-29 12:40:42 -05:00
RadWolfie c6635f5261 Fix GeneratePCMFormat for 2+ channels mask
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)
2018-04-29 12:40:42 -05:00
RadWolfie 98daf26e40 Don't trigger/set values during release process
Untested, yet in theory is correct.
2018-04-29 12:40:42 -05:00
RadWolfie cc781826c3 Fix audio buffer allocation
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.
2018-04-29 12:40:42 -05:00
RadWolfie d8246a0074 Remove SelectionT from DSound
Since region has been merged into one buffer usage. SelectionT no longer
a requirement to toggle between main and region buffers.
2018-04-29 12:40:42 -05:00
RadWolfie c5de8c2174 Introduce emulation of xbox audio managed memory
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.
2018-04-29 12:40:42 -05:00
RadWolfie 20cf54aba1 Redo swap since it got revert somehow. 2018-04-29 12:40:42 -05:00
RadWolfie f6c1992865 Fix GetCaps host's var to initialize correctly
Verified with Burnout title, no longer output failure.
2018-04-29 12:40:42 -05:00
RadWolfie 6611340c51 Little improvement
Might not be 100% accurate, however it had been called in these area
base on RE.
2018-04-29 12:40:42 -05:00
RadWolfie 9a8c7031b2 Add notes 2018-04-29 12:40:42 -05:00
RadWolfie f7f11b9b88 Fixed DSound Stream class
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.
2018-04-29 12:40:42 -05:00
RadWolfie 21a6042e7f Adjustment to PatrickvL's code 2018-04-29 12:40:42 -05:00
RadWolfie 753917509b Fix alloc size for lpwfxFormat
WAVE_FORMAT_PCM always ignore cbSize, we need to manually set to 0 in
order to prevent any crash later on.
2018-04-29 12:40:42 -05:00
RadWolfie b77ecf35e3 Swap Flush/Discontinuity
What to do with Flush's function?

Also, really need to reset internal states in Discontinuity function? As
in like what?
2018-04-29 12:40:42 -05:00
RadWolfie 87beb542f5 Add a note 2018-04-29 12:40:41 -05:00
RadWolfie f830b1e150 Update region changes
Is not 100% verified, however JSRF skating, jump, etc has return to
normal volume.
2018-04-29 12:40:41 -05:00
RadWolfie 32ff268837 Add notes 2018-04-29 12:40:41 -05:00
RadWolfie d6ee5fc4ed Fixup StopEx function
Still not 100% sure if is accurate or not, just closer to accurate.
2018-04-29 12:40:41 -05:00
RadWolfie bdc3fa4fd6 Emulate audio region a bit better 2018-04-29 12:40:41 -05:00
RadWolfie 1fde463e1e Combo changes
* 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.
2018-04-29 12:40:41 -05:00
RadWolfie 2343843098 Enable debug trace 2018-04-29 12:40:41 -05:00
Luke Usher 7e21e8bb80
Merge pull request #1104 from jackchentwkh/no_input_fix
Fix no input issue for certain titles.
2018-04-29 14:36:47 +01:00
jackchentwkh b6ce816017 Add emulated dwPacketNumber for DirectInput, this fixed no input issue for direct input users. 2018-04-29 21:28:53 +08:00
PatrickvL 54fe4be69d
Merge pull request #1105 from jackchentwkh/add_pushbuffer_fixup
Add fixup for pushbuffer.
2018-04-29 13:42:06 +02:00
jackchentwkh 2766018022 using code from Dxbx to apply fixup data to pushbuffer. 2018-04-29 19:22:09 +08:00
jackchentwkh 1fdca128bd dwPacketNumber must be updated to trigger the xbe to process the new input state 2018-04-29 19:01:36 +08:00
jackchentwkh 8053bbee28 only create handle for port 0 2018-04-29 19:00:51 +08:00
PatrickvL 9a9ee37092
Merge pull request #1093 from PatrickvL/overlay_sync
D3D : Present overlay only when last present was more than 1 frame ago
2018-04-29 00:58:47 +02:00
PatrickvL 51e4dfcaac
Merge pull request #1102 from ergo720/pool_manager
Pool manager
2018-04-29 00:57:20 +02:00
PatrickvL 827f5666e9
Merge pull request #1094 from jarupxx/WIP_LTCG_Patch
Implement D3D8LTCG specific functions
2018-04-29 00:54:23 +02:00
ergo720 8483f896ed Bug fixes and added logging to PoolManager 2018-04-28 22:05:10 +02:00
ergo720 c3630ebf83 Fix compilation errors 2018-04-28 22:05:09 +02:00
ergo720 dcede85bca Small updates to VMManager 2018-04-28 22:05:09 +02:00
ergo720 b7b3d4b326 Fix latent bug in xbe image memory reservation 2018-04-28 22:05:08 +02:00