Commit Graph

2045 Commits

Author SHA1 Message Date
jarupxx 8bc426be7b Added SetPitch (4134-5849)
The following functions support 4134 to 5849
 - CDirectSoundVoice_SetPitch
 - CDirectSoundBuffer_SetPitch
 - IDirectSoundBuffer_SetPitch
 - CDirectSoundStream_SetPitch
2017-10-18 20:46:42 +01:00
jarupxx cdcf5f2a06 Fixed CDirectSoundBuffer_SetVolume 4134 2017-10-18 20:46:41 +01:00
jarupxx df9a1ab6ac Oops. CDirectSoundVoice_SetPitch come back 2017-10-18 20:46:41 +01:00
jarupxx 07c96f0004 Added DSound 4039 HLE Database
Following PATCH are available
 - CDirectSoundStream_SetVolume
 - CDirectSound_CommitDeferredSettings
 - DirectSoundDoWork
 - IDirectSoundBuffer_SetBufferData
 - IDirectSoundBuffer_SetFrequency
 - IDirectSoundBuffer_SetHeadroom
 - IDirectSoundBuffer_SetLoopRegion
 - IDirectSoundBuffer_SetPitch
 - IDirectSoundBuffer_SetVolume
 - IDirectSoundBuffer_Stop
 - IDirectSound_SetDistanceFactor
 - IDirectSound_SetDopplerFactor
 - IDirectSound_SetRolloffFactor
2017-10-18 20:46:41 +01:00
RadWolfie f84327814d Introduce DSound 4039 HLE Database
- Added DirectSoundCreate
- Added DirectSoundCreateBuffer
- Added CDirectSound_CreateSoundBuffer
- Noted CDirectSound_CreateSoundBuffer OOVPA version 3936 has false
detection for 4039.
2017-10-18 20:46:40 +01:00
RadWolfie 22ca5b38d4 Implement Workaround Fix for missing DSound Library
The workaround will fix DSound 4039 build. It will also fix any other
missing DSound library section as well. In HLEDB v2, the scan method
will check for DSOUND header section. If it doesn't have it, then DSound
DB will be skip.
2017-10-18 20:46:40 +01:00
RadWolfie 5f38195dfd Removed SetFormat
SetFormat method function can be only used on primary buffer class base on DirectSound's documentation.
2017-10-18 20:46:39 +01:00
RadWolfie ac8a827d9c Carry Original Values Over 2017-10-18 20:46:39 +01:00
RadWolfie 569dc59010 Fixed Gauntlet Dark Legacy title
Moving SetFormat OOVPAs to 4242 version.
2017-10-18 20:46:39 +01:00
RadWolfie 4ed100ec83 Fixed Smashing Drive title
Since v1 is overriding build version, lets lower DirectSoundCreateBuffer
OOVPA to last known detected version.
2017-10-18 20:46:38 +01:00
RadWolfie 10c686c65d Append to Previous Commit 2017-10-18 20:46:38 +01:00
RadWolfie fd28748b0f Improve Detection
- Add missing CDirectSound_GetCaps detection for 4361 xdk titles and
later.
- Changed CDirectSound_SynchPlayback patch to xref for 5558.
2017-10-18 20:46:38 +01:00
RadWolfie 0891a74ac2 Couple fixes to comments and a TODO task.
- Removing 8 from DirectSound8's comments for DSound.1.0.5233.inl
- Added a TODO message for 2 different OOVPA signature for same
functionality.
2017-10-18 20:46:37 +01:00
RadWolfie 3a18fe1cb1 Removing Duplicate Patch Function 2017-10-18 20:46:37 +01:00
RadWolfie 022b61b97d Adding IDirectSoundBuffer_Unlock in HLEDB v1 Section 2017-10-18 20:46:37 +01:00
RadWolfie 443e0987ed Implement IDirectSoundBuffer Unlock OOVPA
Verified Unlock does exist in xbe file and is in used. Even though xbox
doesn't handle it directly. It will allow fix audio issue especially
Turok Evolution's XADPCM backgrounc music. Yet is not fully fixed...

On side note... Xbox dashboard is calling Unlock function?!?!
2017-10-18 20:46:37 +01:00
jarupxx b68e9bb90b Move a comment in Rollback support signature section 2017-10-18 20:46:37 +01:00
jarupxx 2a5009d5a2 Fixed XREF name
Plus fixed IDirectSoundBuffer_SetHeadroom 4134 OOVPA
2017-10-18 20:46:36 +01:00
jarupxx 9f33a1f4b7 Improved DSound OOVPA
Also
- Merged alias DSound OOVPA
- Renamed IDirectSoundBuffer_StopEx v5233 to IDirectSoundStream_FlushEx
2017-10-18 20:46:36 +01:00
jarupxx 16639a0500 Improved similar DSound OOVPA 2017-10-18 20:46:36 +01:00
RadWolfie e921d48299 Fix False Positive for XRefs
Since EmuLocateFunction force to add into XRefDataBase array table. It
will only add inside EmuRegisterSymbol function while
EmuLocateFunctionV2 does not.

This method changed numberous false positive to a lot fewer false
positive depending on OOVPA using rollback sig or not.
2017-10-18 20:46:36 +01:00
RadWolfie 525b1ea7af Add Missing OOVPA Patch
Also include rollback alias.
2017-10-18 20:46:35 +01:00
RadWolfie 4107f52e92 Typo Correction
Plus add rollback message header.
2017-10-18 20:46:35 +01:00
RadWolfie 05392878f4 2 New DSound OOVPA v3936
Add 2 New OOVPA 3936 for...
- CDirectSoundBuffer_SetConeOrientation
- CDirectSoundBuffer_SetConeOutsideVolume
Moved 2 4134 to 3936 compatible
- IDirectSoundBuffer_SetConeOrientation
- IDirectSoundBuffer_SetConeOutsideVolume

Tested against Blood Wake and Simpson - Road Rage titles. However Halo
Combat Evolved do return false positive for 2 new signatures (I think).
2017-10-18 20:46:35 +01:00
RadWolfie ee4cc619f8 Improve and Detect Duplicate
For on-going verification to verify any signatures are duplicate or not.
Works as intended base on several titles outputing duplicate messages.
2017-10-18 20:46:35 +01:00
RadWolfie b8e32f2ede Whoops
Forgot to add this addition to able compile HLEDB v2 build.
2017-10-18 20:46:35 +01:00
RadWolfie 625ebe9c78 Append to Previous Commit 2017-10-18 20:46:34 +01:00
RadWolfie 16a3a99baa First Draft of DSound DB Merge
Not tested with all titles, some may will regress anyway.

Plus removed extra "extern"s since they are not necessary in .cpp file.
2017-10-18 20:46:34 +01:00
RadWolfie f780398df3 PatrickvL's HLEDB v2 structure 2017-10-18 20:46:34 +01:00
RadWolfie 9e18bee934 DSound HLEDB Cleanup
Cleaning cluster aliases, re-naming to correct function names, and found
certain signature do match lower XDK version.
2017-10-18 20:46:34 +01:00
Luke Usher 04e14338d0 Abort with an error if any preload section fails to load 2017-10-18 16:41:33 +01:00
Luke Usher 58939f8297 XeUnloadsection should return STATUS_SUCCESS on success 2017-10-18 16:41:13 +01:00
Luke Usher 1613b5d9a6 Create a .bin file for each partition, which is used for direct HDD partition header access
Dashupdate.xbe progresses further with this, now it attempts to format the partitions but fails due to incomplete implementation of DeviceIoControlFile (Specifically IOCTL_DISK_GET_DRIVE_GEOMETRY and IOCTL_DISK_GET_PARTITION_INFO
2017-10-17 23:17:18 +01:00
Luke Usher f4573d097a Fix an issue caused by DesiredAccess not being correctly set when FILE_SYNCHRONOUS is used in CreateOptions 2017-10-17 23:14:13 +01:00
Luke Usher d2514874de Attempt to prevent Share Violation errors 2017-10-17 23:13:21 +01:00
Luke Usher 0fb6a72ffd Fix a compiler warning in Xbe.cpp 2017-10-17 23:12:57 +01:00
Luke Usher 4b35db183c Xbe Loading Improvements
- Rather than copying the entire Xbe into the xbox address space, we
copy only the header
- Only sections marked as 'preload' are loaded at boot time
- All other sections are loaded/unloaded on demand by the running title,
via calls to XLoadSecton/XUnloadSection
- Fixed an off-by-one error in Xbe section name parsing
- Fix an incorrect assumption that section names are always
8 characters null-terminated. They are 9 characters, null padded
2017-10-17 17:25:03 +01:00
ergo720 aedf8df158 Slight improvements 2017-10-11 21:27:31 +02:00
ergo720 5a13c67b54 Fix for issue #746 2017-10-11 20:14:37 +02:00
ergo720 90f885e9bb Slight improvements 2017-10-10 19:22:15 +02:00
ergo720 fe7ef86561 Crash detection implementation 2017-10-10 14:47:30 +02:00
Luke Usher 6a798ad55e Merge pull request #761 from LukeUsher/jsrf
Reinstate JSRF Hack
2017-10-08 19:01:32 +01:00
Luke Usher 68a7f8ab07 Reinstate JSRF hack
This is implemented a little differently than before, it no longer disabled an entire function but instead initialises the X_DEVICETYPE_GAMEPAD structure a little differently.
2017-10-08 18:57:36 +01:00
Luke Usher 5b412d4020 Don't report symbol names if the Xbe crashed outside of the xbox memory space 2017-10-08 18:54:16 +01:00
PatrickvL 94a2ddae66 Merge pull request #760 from LukeUsher/xbe-fix
Fix an issue where Cxbx-Reloaded would crash outright rather than show an error when an XBE failes to load
2017-10-08 13:20:51 +02:00
Luke Usher cc55f79063 Fix an issue where Cxbx-Reloaded would crash outright rather than show an error when an XBE failes to load 2017-10-08 12:08:29 +01:00
ergo720 5abdf9ca01 Alternative implementation to fix issue #730 2017-10-08 02:03:55 +02:00
Luke Usher f710970b0b Fix an issue where titles not making use of Input APIs would crash 2017-10-07 17:40:25 +01:00
Luke Usher c6e2cfdd03 FIx Input in Far Cry Instincts 2017-10-05 20:57:04 +01:00
Luke Usher c9b36b250c Fix an issue where GetTypeInformation was not being registered for 4432 and 5788 2017-10-05 20:15:54 +01:00
Luke Usher f4291b2ed2 Split SetupXboxDeviceTypes into a function and add better logging.
This could help to identify problems from Debug logs.
2017-10-05 09:13:08 +01:00
Luke Usher 05661be44b Fix some compiler warnings and feedback: DeviceTypes should have been xbaddr 2017-10-04 15:11:58 +02:00
Luke Usher 55b0fb8483 Finish XGetDevices and XGetDeviceChanges implementations
JSRF hack removed!
2017-10-04 15:11:58 +02:00
Luke Usher 2b06bb5a59 Derive Gamepad Structure from XAPI functions 2017-10-04 15:11:58 +02:00
Luke Usher 3db0931518 Add OOVPA for GetTypeInformation 2017-10-04 15:11:58 +02:00
Luke Usher c609654f35 Merge pull request #745 from LukeUsher/KeEvent-api
Implement KeEvent Api's for non-windows event structures.
2017-09-21 20:54:01 +01:00
Luke Usher 5a78f70f1f Merge pull request #742 from PatrickvL/work
Logging improvements
2017-09-21 20:53:39 +01:00
Luke Usher 18a64386cd Implement KeEvent Api's for non-windows event structures. 2017-09-21 20:49:35 +01:00
Luke Usher 7067db44dc Re-enable SurfaceDesc patches
This fixes black screens/missing textures in XMarbles
These *shouldn't* be required, but until Patrick's texture branch is merged,we need them anyway
2017-09-20 20:55:26 +01:00
PatrickvL c6290f1796 Logging enhancements and corrections 2017-09-20 17:07:01 +01:00
PatrickvL 6eaafaf241 Fix a few code analysis warnings 2017-09-20 16:50:10 +01:00
PatrickvL 28477f0a80 Rename EEPROM into pEEPROM 2017-09-20 16:40:21 +01:00
Luke Usher efa51fb91b The unpatching of CreateDevice allows these patches to be removed with no negative effects. 2017-09-20 14:14:33 +01:00
Luke Usher 761143945c Merge pull request #738 from LukeUsher/fixing-jsrf
Fix JSRF Regression after NV2A merge
2017-09-20 10:33:15 +01:00
Luke Usher 96925bc97d Oops: Device_End is a required patch for HLE as it processes draw comments 2017-09-20 10:05:59 +01:00
Luke Usher d06fc6d669 Prevent NV2A VBlank Thread creation when in HLE Mode.
VBlank callbacks were effectively being called twice, oops!
2017-09-20 10:05:12 +01:00
Luke Usher 66502da40f Merge pull request #736 from PatrickvL/PixelPorting
Ported Dxbx Pixel Shader conversion (Currently disabled)
2017-09-19 14:05:37 +01:00
Luke Usher a4fa55519d Implement INC/DEC opcodes 2017-09-19 13:30:07 +02:00
Luke Usher e16468c83d Disable another patch that is not required now (D3DDevice_End()) 2017-09-19 13:30:07 +02:00
Luke Usher 56caba8feb Remove some patches that are no longer required with D3D_CreateDevice unpatched 2017-09-19 13:30:07 +02:00
Luke Usher 64025e0096 Mark contiguous memory region as executable.
No benefit right now, but this is essential if we want to load/run a real kernel
2017-09-19 13:30:07 +02:00
Luke Usher ab5138a3b9 Fix an issue with SUB and CMP opcodes where the carry flag would not be calculated correctly 2017-09-19 13:30:07 +02:00
Luke Usher 1cd9cafb78 EmuX86: Implement SUB opcode 2017-09-19 13:30:07 +02:00
Luke Usher 5f60dddd8f Allow CxbxPopupMessage to be called with Non-const strings 2017-09-19 13:30:07 +02:00
Luke Usher 7283193101 Allow CxbxPopupMessage to be called with non-const strings 2017-09-19 13:30:07 +02:00
Luke Usher 1e677f30c1 Use a higher precision clock for more accurate VBlank timing 2017-09-19 13:30:07 +02:00
Luke Usher dea313b234 More NV2A Work 2017-09-19 13:30:07 +02:00
Luke Usher a3c6c17c24 Line ending consistency 2017-09-19 13:30:07 +02:00
Luke Usher d573332431 More PGRAPH 2017-09-19 13:30:07 +02:00
Luke Usher c9cc6eced0 More NV2A porting from XQEMU
Current Status:
Official XDK titles deadlock while calling BlockOnTime.
NXDK titles are generating render commands and appear to be working, although we do not actually implement pgraph yet, so we get a blank screen.
2017-09-19 13:30:07 +02:00
Luke Usher abdaf89602 Move interrupt processing thread to CxbxKrnl rather than specific to EmuNV2A 2017-09-19 13:30:07 +02:00
Luke Usher 9fccb952b2 EmuNV2A: Fix a crash caused by a double lock. 2017-09-19 13:30:07 +02:00
Luke Usher ce1ecf1371 More NV2A work 2017-09-19 13:30:07 +02:00
Luke Usher 4465f2a33a More porting from XQEMU + Fixed a major Cxbx-Unique NV2A BUG
DEVICE_READ/WRITE_32_REG:
Registers were being written to the completely wrong addresses!
2017-09-19 13:30:07 +02:00
Luke Usher 10f783470c Remove TEST dialog: Not required 2017-09-19 13:30:07 +02:00
Luke Usher a1048d0042 Working towards making Interrupt support more generic/less NV2A specific 2017-09-19 13:30:07 +02:00
Luke Usher 147b293c8c Oops: Interrupt Service Routine was being called with the wrong calling convention. 2017-09-19 13:30:07 +02:00
Luke Usher e36a607009 NV2A Interrupts now fire in an Xbox thread!
The interrupt service routine runs, sets up the DPC call, but then the global kernel DPC handler crashes when accessing the KPCR.
This DPC code is marked as experimental, so it needs work.
2017-09-19 13:30:07 +02:00
Luke Usher 6814e2afeb Make sure HLE Vblank doesn't get triggered when LLE is enabled
Make GetNextVBlankTime available to EmuNV2A
2017-09-19 13:30:07 +02:00
Luke Usher 03ce1333a4 More porting from XQEMU.
LLE execution now gets stuck on D3D_BlockOnTime.

Could be lack of interrupts.
2017-09-19 13:30:07 +02:00
Luke Usher fb74bb8e9c Disable CreateDevice/KickPushBuffer patches
Allows NV2A LLE to take over this part of bootup.

NOTE: This needs testing extensively before merging is possible.
2017-09-19 13:30:07 +02:00
Luke Usher 338b627b2b Porting NV2A From QEMU
No PGRAPH emulation yet, but this is enough to get past Direct3D_CreateDevice init.
2017-09-19 13:30:07 +02:00
PatrickvL 7cbdd7b430 Allow merging this code by NOT switching over to new pixel shader code yet (it requires more work before this can be enabled). 2017-09-19 09:33:32 +02:00
PatrickvL 09872bf16d First attempt to use Dxbx pixel shader code. Will probably crash. It'd better to base this on Luke's work to get D3D_CreateDevice running unpatched. That way, many patches (including PixelShader related ones) can be disabled, allowing much easier emulation. 2017-09-19 09:33:31 +02:00
PatrickvL 6d131d5fc0 Finished translation of functional part of Dxbx Pixel Shader conversion code.
(Albeit PSH_XBOX_SHADER::DecodedToString is still incomplete).
2017-09-19 09:33:31 +02:00
PatrickvL 2149e4a4a5 Nearly finished back-porting Dxbx pixel shader conversion code.
With this change, Cxbx-Reloaded is linking again.
Two functions need to be completed (PSH_XBOX_SHADER::DecodedToString and ConvertConstantsToNative), after which testing can commence!
2017-09-19 09:33:31 +02:00
PatrickvL 19b7a5da33 Corrected all other pixel-shader comments which got damaged by a global find&replace 2017-09-19 09:33:31 +02:00
PatrickvL 92f4581d3c Fix global find&replace errors 2017-09-19 09:33:31 +02:00
PatrickvL 5cbf7b61fd Another batch of translation (about 40% to go) 2017-09-19 09:33:30 +02:00
PatrickvL 901d16785e Half-way translating pixel shader conversion code from Dxbx (Delphi) to Cxbx-Reloaded (C++) 2017-09-19 09:33:30 +02:00
PatrickvL a325f6aa87 Back porting of more Dxbx PixelShader conversion types.
Also moved most of the types from PixelShader.h to PixelShader.cpp
2017-09-19 09:33:30 +02:00
PatrickvL 1f966bc7eb More back porting of Dxbx pixel-shader related type definitions and comments 2017-09-19 09:33:30 +02:00
PatrickvL 8ff5c497e7 Started back-porting Dxbx pixel shaders 2017-09-19 09:33:30 +02:00
PatrickvL afe83b60d2 Fixed XPR0 logo assumptions, allowing Amped logo to be read correctly 2017-09-13 16:49:32 +01:00
PatrickvL 144545c2fe Also load logo bitmaps from DDS resources. 2017-09-13 15:26:54 +01:00
PatrickvL ace5132f33 Removed g_pSupportsP8 in favor of g_pSupportsTextureFormat[X_D3DFMT_P8]
Also renamed g_bSupportsYUY2 into g_bSupportsYUY2Overlay
2017-09-13 15:26:54 +01:00
PatrickvL 1ac4a87f21 Compare supported textures formats with FourCC types
Also, index supported textures with Xbox D3D format, as host formats would require a huge array.
2017-09-13 15:26:54 +01:00
PatrickvL fd861043ac Dump FourCC codes 2017-09-13 15:26:54 +01:00
PatrickvL f197b1308f Build up a table of CheckDeviceFormat results 2017-09-13 15:26:54 +01:00
PatrickvL c2d21642d3 Cleanup of Certificate usage 2017-09-13 15:26:54 +01:00
PatrickvL f3b6d70621 Added P8 to ARGB conversion (TODO : pass along TexturePalette)
Also rename dst_rgb > dst_argb
2017-09-11 17:54:31 +02:00
PatrickvL 9a46490fe9 Added DXT5 to ARGB conversion
Also cleanup in DXT1 and DXT3 to ARGB conversion
2017-09-11 17:54:31 +02:00
PatrickvL 0347c9f1e0 Fix incorrect optimization 2017-09-11 17:54:31 +02:00
PatrickvL 128f27c8a3 ConvertD3DTextureToARGB cleanup 2017-09-11 17:54:31 +02:00
PatrickvL 4cdfb50f2e Added DXT3 to ARGB conversion
Also optimized DXT1 to ARGB conversion
2017-09-11 17:54:31 +02:00
PatrickvL 2261039e18 Cherry-picked new color conversion code
Logo's are read with new code
Kept old code in use for textures
2017-09-11 17:54:31 +02:00
Luke Usher 815cc399a1 Cleanup after previous commit 2017-09-08 10:04:10 -05:00
Luke Usher 835ee8d017 Fix remaining issues with HalReturnToFirmware
This allows XLaunchNewImage to be completely unpatched
This has been tested and working with various titles:

update.xbe no longer crashes, but instead correctly relaunches the
games main xbe

Dashupdate.xbe now correctly reboots to dashboard
2017-09-08 10:04:10 -05:00
Luke Usher e9873dd24c Fix an issue where EEPROM.BIN is generated with an invalid AV region. 2017-09-08 10:04:10 -05:00
PatrickvL 1a7eabec5a Xbe title fallback 2017-09-08 15:54:52 +01:00
PatrickvL e62a54bf6a Threading : Use InitXboxThread for CxbxKrnlInterruptThread too 2017-09-05 18:26:44 -05:00
PatrickvL f955721cbb Dump certificate information (title, region)
also dump library versions and remove useless ThreadID logging in
EmuMain messages
2017-09-05 18:25:05 -05:00
PatrickvL 1217ba36fe Made pCertificate a global variable 2017-09-05 18:25:05 -05:00
PatrickvL 0c4d516f23 Make F6 stop emulation for real
by detecting F6 presses in EmuMsgProc too.
Also small cleanup on my previous UI work.
2017-09-05 09:08:57 +01:00
PatrickvL 9ff03f2259 UI improvements
Fixed drag-and-drop
F5 now loads the most recently used Xbe if none is loaded yet
Extracted OpenMRU() into a separate function
Simplified OpenXbe()
Compare m_Xbe to nullptr instead of 0
Less usage of m_hwndChild
2017-09-04 19:59:08 +01:00
jarupxx 5e45213bfe Removes // (Offset,Value)-Pair # text 2017-09-04 13:42:14 +02:00
Luke Usher bbb497e2a4 DSOUND 5233 additions: This prevents a crash in XOnline Dash 2017-09-03 20:45:58 +01:00
Luke Usher ddc2e073be Return no connection on PhyGetLinkStatus.
This prevents network titles from hanging indefinitely when probing for a connection.
This function will be replaced with a real implementation later.
2017-09-03 20:45:58 +01:00
Luke Usher c325d454ba Created HLEDatabase for XactEng 5849 2017-09-03 20:45:04 +01:00
Luca D'Amico 393bd48018 Fix for issue #674 (Show loaded XBE logo in user interface) (#708)
* Some progress regarding issue #674

* More progress regarding issue #674

* More progress regarding issue #674

* Renamed ExportGameLogoBitmap and applied proposed fixes (thx PatrickvL)

* More and more progress regarding issue #674 (need review)

* Applied proposed fixes to Xbe.cpp and Xbe.h

* Many fixes regarding issue #674 (need review)

* Working ReadS3TCFormatIntoBitmap!

* Game logo is now rendered correctly! (need review and cleanup)

* fix and cleanup (issue  #674)
2017-09-02 22:34:53 +02:00
Luke Usher b4c45cfccb Disable XOnline patches and partially implement NVNet emulation. (#703)
Network connection does not work yet but it satisfies titles enough to stop them crashing.
Tetris Worlds gets to (very broken) gameplay with this
All titles that use Xbox Live, or even System Link are likely to see some improvements.
2017-09-01 12:25:51 +01:00
PatrickvL 7bd59bb5b3 Threading fixes (#696)
* Turned g_bEmuException into a thread_local variable (this fixes issue #135)

* Added DirectSoundUseFullHRTF to XTL namespace

This is a requirement for functions to be patched!
(Spotted this by chance while looking at the exports of our Cxbx.exe
using CFF Explorer VIII)

* README updates

* Fixed opaque textures by updating D3DTSS_COLOROP default to D3DTOP_SELECTARG1 (instead of D3DTOP_DISABLE)

* EmuGenerateFS : Still initialize when TLS data copy isn't needed

* Introduced InitXboxThread for consistent Xbox thread initialization

* Rename EmuInitFS into PatchFSOpcodes

* Threading fixes

Keep EmuUpdateTickCount on Xbox core, EmuThreadDpcHandler requires Xbox
thread setup too, removed commented PCSTProxy thread creation.

* Renamed PatchFSOpcodes back to EmuInitFS by Luke's request

* Make EmuUpdateTickCount avoid Xbox1 core for lowest possible latency

Also explained why EmuThreadDpcHandler runs on the Xbox core

* Restore D3DTSS_COLOROP from D3DTOP_SELECTARG1 back to D3DTOP_MODULATE
2017-09-01 12:19:47 +01:00
Luke Usher ed2edd3373 Disable some XApi patches that are not actually required
Fixes the recent ZSNES.regression.
2017-09-01 12:18:28 +01:00
jarupxx 1b26bc3b88 Unpatched GetOverlappedResult 2017-09-01 12:18:13 +01:00
ergo720 52afb76239 Update EmuXapi.cpp 2017-08-31 22:05:51 +01:00
ergo720 0e0d41081a Update EmuXapi.cpp 2017-08-31 22:05:51 +01:00
ergo720 927f7673d3 Update EmuXapi.cpp 2017-08-31 22:05:51 +01:00
ergo720 d4a9b8523d Potential fix for issue #688 2017-08-31 22:05:51 +01:00
Darren Anderson 3b1b8ee384 Fixed OOVPA for timeSetEvent (XDK 5849). 2017-08-31 22:03:13 +01:00
Luke Usher 8afba701fd Fix a typo 2017-08-31 06:12:15 +01:00
Luke Usher fef9738f51 EmuX86: IO improvements + hacky implementation of Timer IO port 2017-08-31 06:12:15 +01:00
Luke Usher 34df6d2865 EmuKrnl: Implement (partial) interrupt support. 2017-08-31 06:12:15 +01:00
Luke Usher 05c2d9287e EmuKrnlRtl: Prevent RtlAssert from causing emulation to abort. 2017-08-31 06:12:15 +01:00
Luke Usher 4a20543afa EmuX86: Implement CMP 2017-08-31 06:12:15 +01:00
Luke Usher 047126a21e EmuX86: Implement IN Opcode
Note that this always returns 0 currently, because EmuX86_IOReadXX are not implemented yet!
2017-08-31 06:12:15 +01:00
Luke Usher 934945d048 Fix DPC bugs: Wrong calling convention was used 2017-08-31 06:12:15 +01:00
jarupxx e4be8e8765 All D3D REGISTER_OOVPA to reviewed
also registered missing OOVPA for each version.

In XDK 4034, 4134, 4432, 5028, 5233, Functions for which valid test cases are not found are provisional registered.
2017-08-30 22:46:04 +01:00
jarupxx 33182af147 All XGRAPHC REGISTER_OOVPA to reviewed
also registered missing OOVPA for each version.

Provisional registration in XDK 4432, 5028
- XFONT_OpenBitmapFontFromMemory 4432
- XGWriteSurfaceOrTextureToXPR 5028
- XGCompressRect 5028
2017-08-30 22:28:00 +01:00
jarupxx eddea78768 All Xapi REGISTER_OOVPA to reviewed
also registered missing OOVPA for each version.

Provisional registration in XDK 4034, 5028, 5233
- SignalObjectAndWait 4034
- XMountMURootA for 5028, 5233
- timeSetEvent for 5233
- timeKillEvent for 5028, 5233
2017-08-30 22:27:22 +01:00
jarupxx 00c833ed96 All XNet, XOnline REGISTER_OOVPA to reviewed
also registered missing OOVPA for each version.
2017-08-29 19:31:45 -05:00
jarupxx 19f0bbe7aa Registered NTSC-J demo version in JSRF Hack 2017-08-29 08:46:34 +01:00
Darren Anderson 13cda24388 Fixed indentation. 2017-08-27 18:44:02 +02:00
Darren Anderson 41df25f510 Fixed issue where copying objects in EmuShared caused an access violated exception when printing out the current configuration in the Kernel debug log. 2017-08-27 18:44:02 +02:00
jackchentwkh cbe2a0588b add breaks per PVS suggestion. 2017-08-21 10:38:55 +08:00
Luca D'Amico 177cfaebff added end of config log line 2017-08-19 22:56:48 +02:00
Luca D'Amico 48f6c1107a Log all configuration settings during start of emulation (FIX issue #668) 2017-08-19 22:56:48 +02:00
Luca D'Amico 223e20d152 Removed unused Error.cpp file and now empty Core directory (#672) 2017-08-17 20:19:40 +01:00
PatrickvL bf5719e1c4 Merge pull request #598 from Luca1991/master
Removed unused OpenXDK files (from \Common\ and \Core\) + FPS Counter
2017-08-13 21:48:11 +02:00
Luca D'Amico ef3757703d Removed a global variable 2017-08-11 14:54:16 +02:00
Luca D'Amico 4a889c808d another small fix to the FPS Counter (for the 2nd time) 2017-08-11 14:39:14 +02:00
Luca D'Amico 718740ce69 just another very small fix to the FPS Counter 2017-08-11 14:34:35 +02:00
Luca D'Amico 7123a5d648 More FPS Counter fixes 2017-08-11 14:29:51 +02:00
Luca D'Amico 5e4560668b FPS/MSpF Counter Fixes 2017-08-10 17:38:59 +02:00
PatrickvL 921cff199c Merge pull request #616 from jarupxx/Remove_Lib_D3DX8
Remove scanning D3DX8 library HACK
2017-08-10 17:11:52 +02:00
Luca D'Amico fb91c0aecc updated from upstream 2017-08-10 12:37:53 +02:00
Luca D'Amico ff2876f440 Fixed some issues before fixing the FPS counter 2017-08-10 12:29:11 +02:00
Luca D'Amico ddbe7f2f9c FPS/MSF counters implemented - Fixed issue #574 2017-08-08 11:37:34 +02:00
ergo720 6a14cb25ca Spacing...
Just corrected some spacing...
2017-08-07 19:42:16 +00:00
ergo720 0e44e40762 Fix for issue #620 2017-08-07 21:26:57 +00:00
RadWolfie c5088fd7a0 Fix CreateSoundBuffer Issue
So far only Phantasy Star Online Episode I & II has this issue. Given
nAvgBytesPerSec value was below the requirement. Workaround has been
apply to resolve it.
2017-08-05 09:41:11 -05:00
RadWolfie 16b76ace01 Fix DSBuffer Lock Issue
Somehow SetBufferData has given dwBufferBytes with the value of zero to
Cxbx.
2017-08-05 09:38:07 -05:00
jarupxx 9fa9fe2cef Remove scanning D3DX8 library HACK.
Also verified D3D_CreateDeviceX. SOURCE: Sega GT 2002
2017-08-05 18:56:32 +09:00
Luca D'Amico 61813c1e7a Removed unused OpenXDK source files 2017-08-04 17:25:39 +02:00
Luke Usher f5e9e7770d Fix some incorrect initial render/texture states 2017-08-04 11:04:25 +02:00
PatrickvL 82de4aff00 QueryAllocationSize correction fixes Cartoon sample?!? 2017-08-04 11:04:25 +02:00
RadWolfie f9bfd0463c Fix Newline For RETURN_RESULT_CHECK 2017-08-04 08:58:28 +02:00
RadWolfie fc90875106 Straight To The Point
Allow audio buffer to write directly in DS buffer instead of holding it.

* Fixed no audio from Project Gotham Racing title.
* Constantine does not make audio loop?!

Does not affect other titles so far.
2017-08-04 08:58:28 +02:00
RadWolfie 58ce4aede0 Minor Fix
* Fixed typo comment for pause flags.
* Added 2 DSBCAPS to DirectSoundStream as "known default".
* Fixed Constantine and Splinter Cell Pandora Tomorrow (online.xbe)
titles for getting DSERR_CONTROLUNAVAIL result.
2017-08-04 08:58:28 +02:00
RadWolfie d40786402a Add DSS's SetFrequency Support Between 5233 and 5849 Titles
* Fix Constantine from crash often. Does not resolve known audio loop
issue.
* OOPVA signature match back to last known 5233 signature.
2017-08-04 08:58:28 +02:00
PatrickvL bbc2e676ef Fixed opaque textures by updating D3DTSS_COLOROP default to D3DTOP_SELECTARG1 (instead of D3DTOP_DISABLE) 2017-08-02 15:31:39 +02:00
ergo720 01d62b9174 Fix debug flags when incorrect reg path 2017-08-02 13:25:28 +00:00
ergo720 dbf11b4782 Variables renaming 2017-08-02 08:20:44 +00:00
ergo720 20a0ad455f Drag and Drop implementation 2017-08-02 01:55:35 +00:00
PatrickvL c5e4016c17 Merge pull request #548 from ergo720/master
Fix for registry folder keys
2017-08-02 00:46:49 +02:00
Luca D'Amico b7f976c77a Removed duplicate Xbe.cpp file 2017-08-01 22:30:34 +02:00
Luke Usher a1385cd412 Improvements (#572)
* Implement FileFsVolumeInformation in NtQueryVolumeInformationFile

* Replace empty VertexShaders with a dummy shader

* CxbxUpdateActiveIndexBuffer: Only log in Debug builds

* KeWaitForMultipleObjects: Log the object handles that we are waiting for

* NtQueryVolumeInformationFile: Replace *.* wildcard with *

This fixes the dashboard's memory management functionality.
Windows seems  to exclude folders with *.* when the Xbox expects them to be present.

* Fix bad commit
2017-08-01 20:54:01 +01:00
Luke Usher 07c1761d22 Fix dashboard memory management and other minor tweaks (#571)
* Implement FileFsVolumeInformation in NtQueryVolumeInformationFile
* Replace empty VertexShaders with a dummy shader
* CxbxUpdateActiveIndexBuffer: Only log in Debug builds
* KeWaitForMultipleObjects: Log the object handles that we are waiting for
* NtQueryVolumeInformationFile: Replace *.* wildcard with *

This fixes the dashboard's memory management functionality.
Windows seems  to exclude folders with *.* when the Xbox expects them to be present.
2017-08-01 19:31:41 +01:00
Luke Usher aaafcb4f77 Replace empty VertexShaders with a dummy shader 2017-07-31 23:36:25 +02:00
Luke Usher c4f2a548f2 Implement FileFsVolumeInformation in NtQueryVolumeInformationFile 2017-07-31 23:36:25 +02:00
PatrickvL a92a5d811f Merge pull request #562 from LukeUsher/more-tweaks-and-fixe
More tweaks and fixes
2017-07-31 13:42:18 +02:00
PatrickvL c859f0d375 Merge pull request #557 from LukeUsher/lle
NV2A Work
2017-07-31 10:17:29 +02:00
RadWolfie 2b91e31abc Missing Patch To Improve Colin McRae Rally 2005
Add missing both SetNotificationPositions patches with existing OOVPA signature from 4627 HLE
database.

ref #535 - This fixed and made Colin McRae Rally 2005 go a bit further,
yet still crash after 2 black intro screens.
2017-07-31 10:15:53 +02:00
Luke Usher 202193fa2b Merge remote-tracking branch 'upstream/master' into lle 2017-07-30 21:51:50 +01:00
Melissa Goad 413fbfcc05 NV2A fixes (#555)
* Fix a bunch of break-less switch cases

* Fix an egregious mistake, also copy a lil bit of code from PatrickVl's branch in preparation for something GREAT :D

* Ooops

* Ooops
2017-07-30 11:53:10 +01:00
Melissa Goad fc575e5794 Fix a bunch of break-less switch cases (#554) 2017-07-30 10:13:47 +01:00
Luke Usher fdd58b72b2 Minor Change: g_SymbolAddresses is now an ordered map.
In real terms, this doesn't really make any difference, however, when analysing HLE Cache files, the functions are in alphabetical order and easier to follow.
2017-07-30 08:27:23 +01:00
ergo720 d65bfa985e Merge branch 'master' into master 2017-07-29 20:28:27 +00:00
ergo720 76a5deb44a Fix incorrect debug folder registry key 2017-07-29 20:46:28 +00:00
Luke Usher a39f95053e Set default render/texture states for all supported types.
This data was taken from a table accessed by CreateDevice in the XDK.
2017-07-29 20:09:57 +01:00
Luke Usher a5252ec5e7 The 4361 version of SetRenderState_PSTextureModes actually existed back in 4134 2017-07-29 19:25:06 +01:00
Luke Usher 05f885778c Fix most incorrect Direct3D return types.
Testing so far doesn't seem to have made any difference to execution at all, but this had potential to cause issues, it's good to get it right!
2017-07-28 22:23:24 +01:00
ergo720 d44c393065 Revert commit fix for the issue #515 (#542) 2017-07-28 20:59:50 +01:00
ergo720 e9577833b7 Revert commit fix for the issue #515 2017-07-28 19:38:27 +00:00
PatrickvL e10971609a Merge pull request #540 from ergo720/master
Fix issue #515
2017-07-28 17:35:25 +02:00
ergo720 908356ec4f Better fix for the issue #515 2017-07-28 14:05:52 +00:00
ergo720 b867599fdd Fix for the issue #515 2017-07-28 12:50:42 +00:00
PatrickvL 2cef285bc1 Dsound hle fix (#539)
* Turned g_bEmuException into a thread_local variable (this fixes issue #135)

* Added DirectSoundUseFullHRTF to XTL namespace

This is a requirement for functions to be patched!
(Spotted this by chance while looking at the exports of our Cxbx.exe
using CFF Explorer VIII)
2017-07-28 13:12:22 +01:00
PatrickvL 57fd8f5c7a Turned g_bEmuException into a thread_local variable (this fixes issue #135) (#538) 2017-07-28 11:10:17 +01:00
PatrickvL aa0c67187d DSound logging improvements (#537)
* Marked OUT arguments as such
* DSound: Replaced all function logging via DbgPrintf calls with LOG macro's
* DSound: Added LOG_UNIMPLEMENTED_DSOUND where appropriate
* DSound: Added missing LOG_FUNC
* DSound: indented some function headers
* DSound: Small refactoring of AddRef/Release, and added a few TODO's.
* DSound: Intenting and last few fixes
2017-07-28 10:07:52 +01:00
Luke Usher 5e73acde07 Backup and restore original FillMode rather than overwrite with SOLID when Wireframe mode is disabled.
I haven't noticed any changes relating to this, but it was possible that a title could set D3DRS_FILLMODE to Wireframe and get overwritten by Cxbx-Reloaded.
Now we keep the original value
2017-07-28 08:24:30 +01:00
PatrickvL a8033fee8b Fixed duplicate use of XBEIMAGE_MEDIA_TYPE_DVD_5_RW (9 was intended) (#534) 2017-07-27 14:50:31 +01:00
Luke Usher 3ee227bf74 Merge pull request #529 from LukeUsher/various-tweaks-and-fixes
Various Bug Fixes and Improvements
2017-07-26 22:18:05 +01:00
Luke Usher ce96ef0083 Restore an intentional Sleep(); 2017-07-26 22:15:34 +01:00
Luke Usher 68cd19547e Fix a regression in ZSNES 2017-07-26 22:14:02 +01:00
Luke Usher aed96f115e Fix an issue with CMcpxBuffer::Play being undetected after commit #4f019d9440 2017-07-26 21:40:29 +01:00
Luke Usher eb7b7e5ece Replace some Sleep() with SwitchToThread
This prevents Windows giving up the Cxbx processes timeslice, allowing other xbox threads to run.

This fixes the audio stuttering in JSRF!
2017-07-23 18:13:20 +01:00
RadWolfie b222d82376 Update XADPCM.h
Removed author since it is not part of author's work.
2017-07-23 06:17:27 -05:00
Luke Usher b46d4ce6a8 Merge branch 'HLE-Audio-Improvement' into various-tweaks-and-fixes 2017-07-23 08:59:06 +01:00
RadWolfie 85ff52e502 Disable Legacy Audio Hack Option
Currently legacy audio hack option is not implemented, so it's disabled
before merge into master repo. Plus force all unimplemented functions to
output once, not repeatly.
2017-07-22 21:43:02 -05:00
RadWolfie 3da46a9a15 Implement Specific Codec Audible
* NEW: PCM, XBOX_ADPCM, and unknown codec audible are functional.
* FIXED: Preserve volume whenever buffer is resize.

This will allow all dev and testers to test and report which codec is
not outputing audible properly.
2017-07-22 21:43:02 -05:00
RadWolfie b82954ef09 Oops...
Forgot to re-append hRet result test.
2017-07-22 21:43:02 -05:00
RadWolfie d052a19690 Implement Initialize Audio Settings
First attempt to obtain audio settings configured by user request. At
the moment, selecting audio adapter device is functional. More to come
later on...
2017-07-22 21:43:02 -05:00
RadWolfie 4dad779758 Audio Settings Stub
First initialization audio settings support.
2017-07-22 21:43:02 -05:00
RadWolfie 7c7799be99 Serveral Fixes base on RETURN_RESULT_CHECK macro
* Missing control frequency flag to control base on Smashing Drive
title.
* SetVolume return invalid arg due to setting MIN volume is -10,000.
Changed mockup into between -10,000 and -6,400 as silence.
* SetFormat has been tweaked a bit as workaround for now. It needs to
create new buffer for secondary buffer usage.

Known Issue:
SetConeOrientation continue to return DSERR_INVALIDPARAM flag in Turok
Evolution for some reason. All args look right and is fine to me...
2017-07-22 21:39:27 -05:00
RadWolfie db3c23066d Introduce RETURN_RESULT_CHECK for DSound
Performing this method shall reduce hidden failures.
2017-07-22 21:39:27 -05:00
RadWolfie a3872923a7 Play Should Be Using Play Flags
Oops... And fix a trigger for X_DSBPLAY_FROMSTART to be check "if"
properly.

This fix no audio from Psyvariar 2 - Extend Edition gameplay. 🎉
👍
2017-07-22 21:39:27 -05:00
RadWolfie 836376c0a1 Minor Improvement
- Added check if DirectSound3DBuffer8 is null due to dummy WAVEFORMATEX
causing issue for DSBCAPS_3D flag.
- Another code standard fix.
- Forward SetConeOutsideVolume to hybrid function to reduce duplicate
code.
2017-07-22 21:39:26 -05:00
RadWolfie c3121b740a Minor Fix
Also need check if it is not null before check flag. Miami Vice crashed
just for this issue.
2017-07-22 21:39:26 -05:00
RadWolfie a762ead109 Minor Coding Standard 2017-07-22 21:39:26 -05:00
RadWolfie ee39f4f16d More SynchPlayback Stub
And use lock's offset given by title for another accuracy.
2017-07-22 21:39:26 -05:00
RadWolfie 607c71eba3 Reduce Buffers Unlock Duplicate 2017-07-22 21:39:26 -05:00
RadWolfie 2e88311aa4 Various Fixes Again
- Renaming variable type to uppercase to keep code sanity.
- Re-add debug message from SynchPlayback.
- Corrected flag check for to play or not to play audio buffer.
- Verified dwFlags is the same as windows for lock buffer.
2017-07-22 21:39:26 -05:00
RadWolfie fc936cfc9c Reviewed Coding Correction 2017-07-22 21:39:26 -05:00
RadWolfie 9a834a9f52 Implement SynchPlayback Support
- Moved play caller into HybridDirectSound to perform same task.
- Added DSB_FLAG_SYNCHPLAYBACK_CONTROL flag for control.
2017-07-22 21:39:26 -05:00
RadWolfie 7c7fa2f795 One More...Correction...
Just one tiny correction even though it has no affect to execution.
2017-07-22 21:39:26 -05:00
RadWolfie b7fd5ad4c0 Add Comments
Adding comments before implement support for simple SynchPlayback
control.
2017-07-22 21:39:26 -05:00
RadWolfie 1ffb2ddb23 Various Fixes
- Renamed dwFlags parameter to correct name which is dwEmuFlags
- Fixed wrong variable pass down in ResizeIDirectSoundBuffer's parameter
(oops)
2017-07-22 21:39:26 -05:00
RadWolfie 1a90cc95bc Another Improvment
Preserve dwOffset from locked pointer, this should prevent audio
disortion from other titles and more accurately.
2017-07-22 21:39:26 -05:00
RadWolfie 12b7ac5c4a Fix Coding Standard 2017-07-22 21:39:26 -05:00
RadWolfie 6acc0483d4 Rename DSoundBufferUnlockXboxAdpcm
Changed DSoundBufferUnlockXboxAdpcm to DSoundBufferXboxAdpcmDecoder
since it is performing a decode in locked memory and new buffer.
2017-07-22 21:39:26 -05:00
RadWolfie 41b9a32d7b Audio Improvment
Only does small improvement to audio.

- Rayman Arena's first intro, xbox audio, no longer make any rare
popping noise.
- Xbox Dashboard background sound is improved big time.
- Turok Evolution background music in-game and credits are improved
except there is still noise in-between.
2017-07-22 21:39:26 -05:00
RadWolfie 7f70076676 Renaming 2017-07-22 21:39:25 -05:00
RadWolfie 85f6dc1ad7 Various Changes
- Changed all DirectSound usage to use v8 since it does have more
methods. This allow few more support to audio.
- Implement Support for 3DListener
-
2017-07-22 21:39:25 -05:00
RadWolfie dbd39115e6 Prevent Deadlock in Multithreading
- Moved return value since using actual function cause crashes for
multiple titles.
- Changed 0 to nullptr since cache audio classes are using by xbox.
2017-07-22 21:39:25 -05:00
RadWolfie 14172824b1 Fixed Various Issue
- Corrected File linkage for EmuDSoundInline.hpp (Thanks PatrickvL)
- Check if is not a null variable in release referred by PatrickvL
- Add missing passdown to ResizeIDirectSoundBuffer function (oops)
- Add another test case for SYNCHPLAYBACK

Should compile this time.

Known regress issue:
JSRF report dirty disc - Wait until DirectSound audio control is
implement, then it will go away.
2017-07-22 21:39:25 -05:00
RadWolfie 28cdfafb4c Improve and Fix Release Control
Improvised release management.
2017-07-22 21:39:25 -05:00
RadWolfie 39f828187c Format Document Automatic
Used Visual Studio's format document feature to format it accurately.
- Append semicolon for all FUNC_EXPORTS to prevent indent wrong
position.
- Moved asterisk to the left for all pointers in function's parameters.
2017-07-22 21:39:25 -05:00
RadWolfie 7be9240a16 Enforce Coding Guideline
All this is done by hand with regex search built-in.

- Replaced all tabs to whitespaces
- Any single check process internal are included with brackets
- Corrected any misalign whitespaces
2017-07-22 21:37:40 -05:00
RadWolfie 740fcd7ffb Maintenance Multiple Callers Doing Same Purpose
- Moved all duplicate functionality in inline header (hpp) file.
- Several fixes
- Removed all 3DListener since it is only possible in primary buffer.
Future commit will restore it into primary buffer creation.
- Force output whatever is not implemented for DSound library section in
release build. It will help me know which title is calling it and at
least make it a priority.
2017-07-22 21:37:40 -05:00
RadWolfie 91fff43ff4 Missing define and fixed wrong function 2017-07-22 21:37:40 -05:00