Commit Graph

913 Commits

Author SHA1 Message Date
ergo720 4c47d5a6d9 Store ClipCursor flag in EmuShared 2020-09-20 17:57:16 +02:00
ergo720 01382d7e1d Lock the mouse cursor to the rendering window when the user presses F3 key 2020-09-20 14:58:11 +02:00
ergo720 fa6387a545
Merge pull request #1955 from RadWolfie/fix-dsound-namespace
Fix Xbox DSound Namespace
2020-09-08 13:40:58 +02:00
RadWolfie e3b1cffd3a dsound: remove todo comment 2020-09-08 04:53:29 -05:00
RadWolfie 0b32d66e37 dsound: move HybridDirectSoundBuffer_SetMixBins to original location 2020-09-08 04:53:29 -05:00
RadWolfie 4cd89d77b8 dsound: remove extra parameter from HybridDirectSoundBuffer_SetMixBins 2020-09-08 04:53:29 -05:00
RadWolfie e6f875b7a7 dsound: updated to use without depend on windows' dsound header file for xbox usage 2020-09-08 04:53:29 -05:00
Anthony Miles 5272b1de12 Reduce aliasing in CopyRects 2020-09-02 23:29:47 +12:00
Anthony Miles fc655cdca5 CopyRects accounts for host resource scaling
Fixes Crash Tag Team Racing resolution scaling issue
2020-09-02 23:05:23 +12:00
Luke Usher ee6a61c364
d3d: apply aspect ratio correction to the backbuffer (#1956)
* d3d: apply aspect ratio correction to the backbuffer

* d3d: optimise aspect ratio correction + allow run-time aspect change (eg: dashboard)

* d3d: fix typo

* d3d: fix borders on aspect ratio change + apply aspect ratio correction to FMV

* d3d: fix indenting in SetAspectRatioScale

* d3d: add comment to explain clear
2020-09-02 04:45:04 -05:00
ergo720 b304e538c6
Introduce xbox namespace + deduplicate xbox types (#1942)
* Introduced new xbox namespace + moved inside it xbox pointer/address types

* Replaced xboxkrnl namespace with xbox namespace

* Moved kernel types from xboxkrnl.h to xbox_types.h

* Replaced XTL namespace with xbox namespace

* Fix a conflict with the VOID macro imported by Windows.h

* Fixed misalignment issues + renamed xtl_prefix
2020-08-24 13:29:48 -05:00
RadWolfie f9084d9b2e hotfix: fix dsound string patches typos 2020-08-23 12:55:49 -05:00
RadWolfie b10d242b80 fix pr 1945 normalize 2020-08-23 11:52:04 -05:00
Luke Usher ffe3b95323
Merge pull request #1946 from RadWolfie/line-ending-renormalize
Setup Force Source Files to LF Line Ending and Renormalize
2020-08-23 14:58:19 +01:00
Luke Usher 967f53ad6f
Merge pull request #1945 from LukeUsher/d3d-dont-create-invalid-buffers
d3d: don't attempt to create 0 sized vertex buffers
2020-08-23 14:49:39 +01:00
RadWolfie 3550fa4ed1 setup force source files to lf line ending and renormalize 2020-08-22 20:17:07 -05:00
Luke Usher d961d4e7e7 d3d: don't attempt to create 0 sized vertex buffers 2020-08-21 20:13:23 +01:00
PatrickvL cdb3b13756
Merge pull request #1943 from LukeUsher/fix-iocreatefile
krnl: IoCreateFile should return INVALID_HANDLE_VALUE on failure
2020-08-21 16:54:39 +02:00
Luke Usher dd36bce933 krnl: IoCreateFile should return INVALID_HANDLE_VALUE on failure 2020-08-21 15:05:01 +01:00
RadWolfie 8861b845d7 chrono: replace duration_cast to duration 2020-08-20 15:51:12 -05:00
RadWolfie e0f6d75cd0 chrono: use steady_clock than high_resolution_clock 2020-08-20 14:50:02 -05:00
ergo720 f46bcd6875 Use xboxkrnl namespace inside xboxkrnl header file 2020-08-18 17:02:19 +02:00
Luke Usher 2695d91496
Merge pull request #1913 from RadWolfie/improve-compiler-support
Improve SEH/VEH support for compilers
2020-08-18 14:55:08 +01:00
RadWolfie d51743a132
Merge pull request #1934 from LukeUsher/avoid-debug-overflow
kernel: avoid potential buffer overflow on DbgPrint
2020-08-17 12:12:10 -05:00
Luke Usher b0ebc8b332 kernel: avoid potential buffer overflow on DbgPrint 2020-08-17 17:21:10 +01:00
Luke Usher de92e5048b hle: Disable RaiseException patch, let the kernel handle it. 2020-08-15 20:43:16 +01:00
RadWolfie e1c53ac304 add verbose arg output for DSound's main class 2020-06-29 14:26:29 -05:00
RadWolfie c06817d8fa add verbose arg output for DSound's stream class 2020-06-29 14:26:24 -05:00
RadWolfie a6a95072a9 add verbose arg output for DSound's buffer class 2020-06-29 14:26:20 -05:00
ergo720 9e90a2df50 Show a popup when xbe sections are corrupted 2020-06-23 22:24:52 +02:00
RadWolfie 6de2d464c4 fix disabled code to sync with new change. 2020-06-20 04:44:50 -05:00
RadWolfie 4043ac1b01 rewording APIs for review remarks 2020-06-20 03:40:54 -05:00
RadWolfie 9f593237fe add voids whenever not using return values 2020-06-13 16:41:48 -05:00
RadWolfie ce3626eb9d replace CxbxShowError to CxbxPopupMsg prefix to include in log record 2020-06-11 12:54:31 -05:00
RadWolfie 77d469ddb5 suppress popups while in exclusive fullscreen mode 2020-06-11 12:38:28 -05:00
RadWolfie c0f2d60a3f fix compiler warning to use enum class instead of enum 2020-06-11 12:38:28 -05:00
RadWolfie dbae5dbb79 move popup message to logging file 2020-06-11 12:38:28 -05:00
RadWolfie 9bee8ea17b add testcase popup option 2020-06-11 12:38:27 -05:00
Luke Usher f1d09aff15
Merge pull request #1917 from Fisherman166/HalReadSMCTrayState
Rewrite HalReadSMCTrayState to match original kernel implementation.
2020-06-08 15:22:32 +01:00
RadWolfie a216c3d90e rename bOverrideException to bOverrideEmuException 2020-06-07 23:27:08 -05:00
RadWolfie b5358508d6 update Windows' SEH, fix overflow exception, and non-Windows platform support 2020-06-07 23:27:08 -05:00
RadWolfie 64f69f78ae add exception manager 2020-06-07 22:38:01 -05:00
PatrickvL d3544f7b5f
Merge pull request #1918 from Fisherman166/FsSetCacheSize
Update FscSetCacheSize to match original kernel
2020-06-07 18:51:45 +02:00
Fisherman166 a981607e51 Add g_ prefix to FscCacheEvent. 2020-06-07 09:40:55 -07:00
PatrickvL 0afcf04c06
Merge pull request #1915 from Fisherman166/KeReleaseSemaphore
Implement KeReleaseSemaphore
2020-06-07 08:10:40 +02:00
RadWolfie e166b97cd7 check for 3D audio to use mono channel by default instead of stereo 2020-06-07 00:45:05 -05:00
Fisherman166 326f645b8f Initialize FscCacheEvent at emulation start to match the real kernel implementation. 2020-06-06 16:09:01 -07:00
Fisherman166 6d8d692b7c Implement FscSetCacheSize matching original kernel implementation. 2020-06-06 13:34:40 -07:00
Fisherman166 857b8f933e Rewrite HalReadSMCTrayState to match original kernel implementation. Keeps the TRAY_OPEN hack for the time being. 2020-06-06 13:27:54 -07:00
RadWolfie 503ce9b825 fix applications using IDirectSoundBuffer_Lock incorrectly 2020-06-05 20:23:52 -05:00
Fisherman166 db1429a4b9 Implement KeReleaseSemaphore based on kernel reverse engineering. Needs KiWaitTest to be implemented to be fully functional. 2020-06-04 21:26:01 -07:00
Anthony Miles 201ab08043 Treat X_D3DSCM_NORESERVEDCONSTANTS as a flag 2020-06-03 00:10:34 +12:00
Fisherman166 49e68a1ecc Refactor ExReleaseReadWriteLock. 2020-05-28 09:10:51 -07:00
Fisherman166 b72be80b88 Refactor ExAcquireReadWriteLockShared to remove duplicate code. 2020-05-26 09:20:15 -07:00
Fisherman166 a679073ec6 Implement ExReleaseReadWriteLock. 2020-05-25 16:20:02 -07:00
Fisherman166 6f5a1f2c46 Implement ExAcquireReadWriteLockShared. 2020-05-25 16:20:01 -07:00
Fisherman166 a2e623180a Implement ExAcquireReadWriteLockExclusive. 2020-05-25 16:20:01 -07:00
RadWolfie ba8adc04f4 add todo comment 2020-05-15 04:01:06 -05:00
RadWolfie 9871b25fa8 move audio converter helper 2020-05-14 19:09:19 -05:00
RadWolfie 95e8642970 fix placeholder reference counter 2020-05-14 18:46:16 -05:00
RadWolfie 97abbd0a7c replace virtual functions to VMT comments 2020-05-14 18:43:44 -05:00
RadWolfie ada86a42b5 create gc for EmuDirectSoundBuffer destructor 2020-05-14 18:38:05 -05:00
RadWolfie fad467196a add test case comment 2020-05-14 17:13:37 -05:00
RadWolfie 0c5117dc06 reword union data for better readability 2020-05-14 17:13:37 -05:00
RadWolfie 06af046c13 also another fixup for pitch type 2020-05-14 17:13:37 -05:00
RadWolfie ce0e35b052 oops, volume is signed integer 2020-05-14 17:13:37 -05:00
RadWolfie 8b780f2d5c remove Xb_Volume member from host's structure 2020-05-14 17:13:37 -05:00
RadWolfie ee4856a06d add comments 2020-05-14 17:13:37 -05:00
RadWolfie 72401c44d4 use typedef function pointers for better readability and remove redundant 2020-05-14 17:13:37 -05:00
RadWolfie e91d1bf23c finally clean up redundant codes 2020-05-14 17:13:37 -05:00
RadWolfie 04dce78f53 forward xbox audio format to internal voice class 2020-05-14 17:13:37 -05:00
RadWolfie 18a22cd934 fix spacing 2020-05-14 17:13:37 -05:00
RadWolfie ab142abd69 forward headroom setter to voice 2020-05-14 17:13:37 -05:00
RadWolfie d7d1d781d8 implement hybrid buffer for partial internal exposure 2020-05-14 17:13:36 -05:00
RadWolfie dab7a608c2 oops 2020-05-14 17:13:36 -05:00
patrickvl 6d9dfb2dde Change zero input into a comment instead of LOG_TEST_CASE everyone into madness 2020-05-08 12:13:55 +02:00
patrickvl ba2d18d17f Prevent invalid g_Xbox_MultiSampleType values using a setter
This avoids zero-dectection later on
Some tooling functions to top it off.
2020-05-08 12:05:29 +02:00
Luke Usher fec845f6f8 Cleaner fix to the above 2020-05-08 10:00:46 +01:00
Luke Usher 85c0f608e2 Another minor fix 2020-05-08 09:52:54 +01:00
Luke Usher 23104c8280 Fix an issue where rendering broke when MultiSampleType = 0 2020-05-08 09:40:20 +01:00
Luke Usher e499d3ad07 fix an issue where offset was not used 2020-05-08 09:28:20 +01:00
Luke Usher b0bcc2fd9b Add LOG_TEST_CASE as per request 2020-05-08 09:04:58 +01:00
Luke Usher 543756d712 Amendments 2020-05-08 08:49:13 +01:00
Luke Usher 86bb8cad97 Implement support for Xbox MSAA, reducing 'jaggies'
Also fixes offset models in GTA3 and potentially others
2020-05-07 22:51:30 +01:00
PatrickvL 555f240319
Merge pull request #1888 from LukeUsher/cleanup-createdevice
Cleanup EmuCreateDeviceProxy & Clarify 'Automatic' option
2020-05-07 22:42:57 +02:00
Luke Usher e17d872356 Fix an issue where the 'Xbox CreateDevice did not call SetRenderTarget' test case would be incorrectly flagged if no depth stencil was provided 2020-05-07 20:51:45 +01:00
Luke Usher a32b10aa79 oops: fix typo 2020-05-07 13:54:47 +01:00
Luke Usher f98023bbb8 Cleanup EmuCreateDeviceProxy & Clarify 'Automatic' option 2020-05-07 13:45:39 +01:00
Anthony Miles ada56843ad Check for shader handles without shader functions 2020-05-04 22:22:13 +12:00
Anthony Miles 7370a29367 Tidy shader creation and handle property assignment 2020-05-04 21:42:59 +12:00
Anthony Miles 176dc9a38c Ensure shader has been created before setting it in SetVertexShader 2020-05-04 20:49:03 +12:00
patrickvl 79102c6ef8 Don't free what hasn't been allocated.
Don't activate declaration when a shader is merely created
Use X_VSH_MAX_ATTRIBUTES instead of 16
Rename SetCxbxVertexShader into RegisterCxbxVertexShader
2020-05-04 10:18:00 +02:00
patrickvl 9ab91550ae Rename SetCxbxVertexShaderHandleDeclaration into SetCxbxVertexDeclaration and give it just the Declaration.
Also fixed a compiler warning
2020-05-04 10:05:41 +02:00
Anthony Miles 1087b3e645 - Reset shader when shader slots are overwritten
- Keep track of the shader slot address
2020-05-04 18:55:51 +12:00
patrickvl e60d11959c Add a reminder to g_VertexShaderSource 2020-05-01 10:12:40 +02:00
patrickvl 7d53eaae73 Disabled patches on D3DDevice_GetVertexShaderDeclaration and D3DDevice_GetVertexShaderFunction (all they do is read data from their input arguments, which we don't alter anymore, so these two getters can just as well be left unpatched) 2020-04-30 15:44:24 +02:00
patrickvl 6a8534a22e Move D3DDevice_LoadVertexShaderProgram implementation to XbVertexShader.cpp 2020-04-30 15:34:22 +02:00
patrickvl 00e85b8af8 Move D3DDevice_CreateVertexShader implementation to XbVertexShader.cpp 2020-04-30 15:27:30 +02:00
patrickvl 932398547e Move SetCxbxVertexShader to XbVertexShader.cpp 2020-04-30 15:13:39 +02:00
patrickvl ab6bb98758 Move D3DDevice_DeleteVertexShader implementation to XbVertexShader.cpp 2020-04-30 14:53:10 +02:00
patrickvl 311e1037a6 Move D3DDevice_SelectVertexShader implementation to XbVertexShader.cpp 2020-04-30 14:49:10 +02:00
patrickvl ddc5d14c52 Move g_VertexShaderSource macro towards VertexShaderSource.cpp (in preparation for the next commit, that's going to use it) 2020-04-30 14:48:04 +02:00
patrickvl e94be42c40 Fix compile warning on not-supported LOG_TEST_CASE macro argument
Fix compile warning on implicit type cast
2020-04-30 14:39:02 +02:00
patrickvl 7bab062ff5 Move D3DDevice_SetVertexShaderConstant implementation to XbVertexShader.cpp 2020-04-30 14:36:59 +02:00
patrickvl 5a222185a3 Move D3DDevice_SetVertexShader implementation to XbVertexShader.cpp 2020-04-30 14:28:32 +02:00
patrickvl ea5f494a8e Move DEBUG_D3DRESULT macro towards XbD3D8Logging.h (in preparation for the next commit, that's going to use it) 2020-04-30 14:27:17 +02:00
patrickvl cc7e1a4069 Fix compile warning on not-supported LOG_TEST_CASE macro arguments 2020-04-30 14:21:13 +02:00
patrickvl 3db98e4e90 Move implementation of D3DDevice_LoadVertexShader towards XbVertexShader.cpp 2020-04-30 13:58:27 +02:00
patrickvl 848f4eeee3 Hide vertex slots behind GetCxbxVertexShaderSlotPtr (which also logs out of range test cases) 2020-04-29 19:08:15 +02:00
patrickvl c1b58dafb9 Remove everything related to no-longer-set HostFVF variable 2020-04-29 15:14:27 +02:00
Anthony Miles a2b5d2c466 Improve shader slot emulation 2020-04-27 11:18:16 +12:00
Anthony Miles eaa095e8a2 - Rename VertexShaderInfo to VertexDeclaration
- Move declaration related fields to CxbxVertexShader.Declaration
2020-04-26 22:01:22 +12:00
RadWolfie c27da955ab replace placeholder to working emulate_system variable set 2020-04-17 14:54:01 +02:00
RadWolfie d2f104f251 change KB/MB to KiB/MiB 2020-04-14 20:24:19 -05:00
RadWolfie 1a1019b85c replace hardcode 384 to blocks_reserved_t plus add comments 2020-04-14 20:24:19 -05:00
RadWolfie 897bc182f8 use enum class for XbeType to resolve warnings 2020-04-14 20:24:19 -05:00
RadWolfie 55f84cd67e move functions into their own locations 2020-04-14 20:24:19 -05:00
RadWolfie 2ead1e0fe0 move address ranges into AddressRanges header file 2020-04-14 20:24:18 -05:00
RadWolfie af3858c0d8 add todo comments 2020-04-14 20:24:18 -05:00
RadWolfie fb7398d7c9 Get maximum reserve memory ranges from host.
Plus more fixup to manage reliable memory design on loader launch and emulator.
2020-04-14 20:24:18 -05:00
RadWolfie 8a33562dc8 fix standalone persisted memory support 2020-04-14 20:24:18 -05:00
RadWolfie b20a970b1d fix shared memory reboot loss 2020-04-14 20:24:18 -05:00
RadWolfie 7fca148bc6 implement toggle loader project in GUI 2020-04-14 20:24:18 -05:00
RadWolfie 0f38209e4b use std map pairs instead of string for cli usage
Plus enable individual memory shared settings and lock data file path hash whenever in used.
2020-04-14 20:24:18 -05:00
ergo720 11c046e0aa Suppress warning 4200 (alternative method) 2020-04-14 20:24:18 -05:00
ergo720 446b7efc29 Fix memory manager crashing upon second reboot 2020-04-14 20:24:18 -05:00
ergo720 f1255cb89b Allow the memory manager to work again with the non-loader approach 2020-04-14 20:24:18 -05:00
ergo720 52f0d6f03b Updated memory functions to work with the loader 2020-04-14 20:24:18 -05:00
PatrickvL affc999d70 Loader : Use CxbxMessageBox (a wrapper for Windows' MessageBox API) wherever possible, to avoid repeating the TEXT("Cxbx-Reloaded") caption everywhere, and a different argument-order allowing default argument values and thus more compact code. 2020-04-14 20:24:17 -05:00
patrickvl f283dff3b6 Loader : Deduplicate code via new CreateSettings() 2020-04-14 20:24:17 -05:00
PatrickvL 254e666bfe Loader : Shared implementation for termining guiProcessID (and "2nd GUI" mode?!) 2020-04-14 20:24:17 -05:00
patrickvl 170b971a8e Loader : Deduplicate code via new CreateSettings() 2020-04-14 20:24:17 -05:00
patrickvl 890a5ffd2f Loader : Merge LaunchEmulation() into CxbxKrnlMain() 2020-04-14 20:24:17 -05:00
patrickvl 37f5a751a1 Loader : Moved HandleFirstLaunch() and LaunchEmulation() towards shared source file (CxbxKrnl.cpp), and call it from our DLL's Emulate() function. 2020-04-14 20:24:17 -05:00
PatrickvL bf115fe7ab Complete Emulation DLL project by adding all Cxbx source files (except GUI-related stuff). Entire solution builds again with this.
Next steps :
- Actually getting the emulation DLL to work
- Complete CxbxGUI project by adding all Cxbx GUI-related source files
2020-04-14 20:24:17 -05:00
PatrickvL 93c8514700 Loader : Initial drop of a separate *empty* GUI project (probably won't compile either) 2020-04-14 20:24:17 -05:00
patrickvl 420d689d82 Cleaned up of the loader project, added environment checks and documented it somewhat. 2020-04-14 20:24:16 -05:00
PatrickvL ca6423b484 Reviving my more-than-a-year-old Loader branch, by copying over various things (nothing functional yet) 2020-04-14 20:24:16 -05:00
RadWolfie 739e1928a2 change filter log output to always output 2020-04-13 03:28:58 -05:00
= 63563763dd vsh: reduce number of instructions required to handle bounds checking 2020-04-13 03:10:23 -05:00
= 8850b52d88 prevent missing polygons with AMD GPU 2020-04-13 03:10:23 -05:00
darkf eb2bc2dbc8 Use proper constant for XMP_STATUS_RELEASE_CXBXR 2020-04-07 15:32:31 -07:00
darkf 743b3cbdbb Remove unused extern "C" comments 2020-04-07 03:24:00 -07:00
darkf bcbdd4c4e0 EmuFile: Fix string being passed as %s formatter 2020-04-07 02:44:40 -07:00
darkf 3a5552e899 EmuKrnlEx: Fix std::atomic usage 2020-04-07 02:44:40 -07:00
darkf 95f6966a43 PVOID casts where necessary 2020-04-07 02:44:39 -07:00
darkf 21733cc594 EmuKrnlLogging: Work around EXCEPTION_DISPOSITION macros in MinGW 2020-04-07 02:44:39 -07:00
darkf 1309f25c7b Patches: Explicitly construct xbox_patch_t 2020-04-07 02:44:39 -07:00
darkf 4eff9b9dab Get D3D stuff mostly compiling on Clang 2020-04-07 02:44:39 -07:00
darkf c64cbfe482 EmuFS: Construct fs_instruction_t by name 2020-04-07 02:44:39 -07:00
darkf daab20a944 Cast to proper type in case 2020-04-07 02:44:39 -07:00
darkf c821ac0f02 XbPixelShader: Use empty local to avoid undefined behavior 2020-04-07 02:44:39 -07:00
darkf b2a5f304bf Use standard C++ enum forward declarations 2020-04-07 02:44:39 -07:00
darkf a3a1849e6a Use GNU alignment attributes in XbConvert 2020-04-07 02:44:39 -07:00
darkf b8be2efa97 Include missing headers 2020-04-07 02:44:39 -07:00
darkf fed6245e48 Fix erroneous macro definitions 2020-04-07 02:44:38 -07:00
darkf d20537fe5b Remove extern "C" linkage in Emu*, otherwise we get namespace collisions 2020-04-07 02:44:38 -07:00
RadWolfie 661774a8b7 another fixup for FlushEx and worker thread 2020-03-28 02:35:59 -05:00
RadWolfie 959bb22dfc add debug message for buffer/stream release functions 2020-03-28 01:50:46 -05:00
PatrickvL 1bc861ac52
Merge pull request #1852 from LukeUsher/clear_sw_interrupt_flag
kernel: Clear IRR register on software interrupt processing
2020-03-24 15:19:08 +01:00
Luke Usher 637e562080 kernel: Clear IRR register on software interrupt processing
Fixes a hang that can occur due to an infinite loop of interrupts under
certian conditions.
2020-03-24 14:05:53 +00:00
RadWolfie aca3c17440 replace printf and forward EmuLogEx with INIT str to EmuLogInit 2020-03-21 23:06:44 -05:00
RadWolfie da9e727330 fix missing calls to DSStream_Packet_Process 2020-03-13 23:49:49 -05:00
RadWolfie 178ec004c8 another flush async fix 2020-03-13 23:47:23 -05:00
RadWolfie 145e827d68 update SynchPlayback debug log more verbose 2020-03-13 13:33:38 -05:00
RadWolfie 0bf0e32df0 fix Discontinuity and GetStatus 2020-03-13 13:33:34 -05:00
RadWolfie 4a27006ce6 fix audio flush async worker 2020-03-13 13:33:25 -05:00
Luke Usher 951520ece1
Merge pull request #1835 from RadWolfie/fix-wfx-format-sanity
Fix Sanity and Organize wfxformat into Functions
2020-02-26 06:49:59 +00:00
RadWolfie b2d5b5c7e8 fix sanity and organize wfxformat into functions 2020-02-20 23:12:54 -06:00
Anthony Miles 605c31af46 Remove GetViewportOffsetAndScale patches 2020-02-16 19:47:56 +13:00
Anthony Miles f48b9478ac D3DDevice_GetVertexShaderType 2020-02-16 19:46:29 +13:00
Anthony Miles d056bbf308 Remove D3DDevice_GetVertexShaderSize patch 2020-02-16 19:41:48 +13:00
Anthony Miles 0c6a13e975 Create VSHCACHE logging code for the shader cache 2020-02-08 19:50:26 +13:00
Anthony Miles 553ff18dff Reduce log spam. The vertex declaration is already logged 2020-02-08 19:50:26 +13:00
Anthony Miles 2506c9d395 Move shader setting logic into a method 2020-02-08 19:50:25 +13:00
Anthony Miles c8de83922a VertexShaderSource manages creation and caching of vertex shaders
Shaders are compiled asynchronously
2020-02-08 19:50:25 +13:00
Luke Usher 38b03b3fe3
Merge pull request #1821 from NZJenkins/vsh_split
Move D3D9-specific vertex shader code out of XbVertexShader
2020-02-07 09:01:09 +00:00
Luke Usher 339473e63b
Merge pull request #1827 from NZJenkins/fix_hlsl_vreg_init
Fix argument order in HLSL lerp call
2020-02-07 08:56:45 +00:00
Anthony Miles fd68ee4d1f - Fix argument order in HLSL lerp call
- Renaming for clarity
2020-02-07 19:50:59 +13:00
Anthony Miles 484f46db59 - drop some parameters from EmuCompileShader
- when the shader is empty, expect success with no compiled shader output
2020-02-04 20:51:32 +13:00
Anthony Miles 9cea5bfe9a Move D3D9-specific vertex shader code out of XbVertexShader 2020-02-04 20:51:32 +13:00
RadWolfie c6d9eac9f4 disable XAudioCreateAdpcmFormat patch 2020-02-02 11:21:01 -06:00
RadWolfie 9780a63644 minor fixes for DirectSound plugin 2020-02-02 11:21:01 -06:00
RadWolfie 187c53eaf9 add LOGRENDER_MEMBER_ARRAY_TYPE feature to logging file 2020-01-27 22:20:15 -06:00
RadWolfie a513cea260 fix audio log crash from titles below 4039 build 2020-01-27 22:14:30 -06:00
RadWolfie 51ffcb5015 add WAVEFORMATEXTENSIBLE struct to logging file 2020-01-27 22:14:04 -06:00
RadWolfie 1197152b5a fix audio stream flush functions 2020-01-24 17:23:08 -06:00
RadWolfie a31f5f7e34 fix Gauntlet Dark Legacy intro videos by sleep longer 2020-01-22 12:20:06 -06:00
RadWolfie 6aae3548e6 improve stream's packets process 2020-01-22 12:20:06 -06:00
RadWolfie 8fb60f6806 put dsstream's packet functions into its own file 2020-01-22 12:13:13 -06:00
RadWolfie 54421832e5 fix audio stream's packet larger than host buffer size 2020-01-22 12:13:13 -06:00
Luke Usher f2ae91785c psh: skip FixOverusedRegisters on all LRP instructions 2020-01-16 22:24:20 +00:00
Luke Usher b64fcff530 Fix hang in WWE Raw 2 after previous PR 2020-01-16 20:57:23 +00:00
Luke Usher 3b06181c0c
Merge pull request #1811 from PatrickvL/avoid_lrp_error
Prevent error X5765 on pixel shader LPR opcode
2020-01-16 09:15:05 +00:00
RadWolfie a375faba51 fix audio frequency by set only given frequency value instead of from host function 2020-01-11 02:04:39 -06:00
RadWolfie 7199f44cbb extend HLE DSOUND relative log modules 2020-01-08 18:30:26 -06:00
RadWolfie a57156fe4e split classes into their own files 2020-01-08 18:30:26 -06:00
RadWolfie b581073f07 remove duplicate log reports 2020-01-08 18:30:26 -06:00
Luke Usher e937bc13d9 Fix a crash when converting certain, large vertex shaders
This allows DOA3 to play again after it was broken by the HLSL work.

The cause of the crash was a Stack Overflow when compiling the shader,
caused by allocating a large object on the stack.

Instead, this commit allocates the XboxVertexShaderDecoder on the heap
instead, which thanks to the unique_ptr smart pointer, automatically
gets freed when it goes out of scope.
2020-01-01 22:29:28 +00:00
PatrickvL cb4d27728c This moves construction of lookup strings outside call-locations towards a central LookupTrampolines() function, reducing the overhead of calling a trampoline down to a minimum. 2019-12-31 12:04:06 +01:00
patrickvl 36569f0d2e This prevents "error X5765: Dest register for LRP cannot be the same as first or third source register" in WWE RAW2.
A little background information :

When compiling pixel shaders, to facilitate later optimizations, FixOverusedRegisters() inserts MOV opcodes reading from constant, vertex color or texture registers, and writing to a free R register slot.

In this case, this transformed :

````
lrp r0, c0,r2,c1
````

into

````
mov r0, c0
lrp r0, r0,r2,c1
````

Not only introduces this a completely useless additional MOV (to R0, which is overwritten by the next LRP opcode), but it also results in LRP reading from R0, which is the same register it's writing to, which seems to be forbidden.

This fix prevents that from happening, by not-inserting a MOV when this situation would arise.

It's possible there exist more such scenario's, but let's tackle them when they are reported.

As for the other change in this commit : Instead of repeating a nearly identical while-loop three times, this loop is now wrapped in a for-loop, that handles all three versions (for PARAM_C, PARAM_V and PARAM_T type registers).
2019-12-26 14:56:28 +01:00
RadWolfie 8fd6253ad1
Merge pull request #1809 from PatrickvL/d3d-visibility-test_pvl
Implement BeginVisibilityTest, EndVisibilityTest and GetVisibilityTestResult
2019-12-25 12:13:24 -06:00
patrickvl a21cb8f0fd Clearer LOG_TEST_CASE message 2019-12-25 17:11:37 +01:00
PatrickvL e79a4e4131
Merge pull request #1808 from RadWolfie/sync-xbsymboldatabase
Update to Latest XbSymbolDatabase API Change
2019-12-25 16:37:11 +01:00
RadWolfie 5a5c3b67a5 update to latest XbSymbolDatabase API change 2019-12-25 09:08:41 -06:00
PatrickvL 0d43bc19aa Continue with Voxel9's work, and extend it with support for multiple indexed occlusion queries 2019-12-25 16:02:23 +01:00
Voxel9 fd2a0506af Add an explanation for the GetData while loop in GetVisibilityTestResult 2019-12-23 20:10:45 +00:00
Voxel9 1727b7e22b Add D3D query nullptr check for GetVisibilityTestResult 2019-12-23 18:52:48 +00:00
Voxel9 566136c195 Add checks for EndVisibilityTest 2019-12-23 18:44:19 +00:00
Voxel9 d45101a7f5 Check whether CreateQuery succeeds before accessing output 2019-12-22 23:37:02 +00:00
Voxel9 81b1e87594 Move, assign and prefix global query variable appropriately 2019-12-22 22:30:54 +00:00
Voxel9 f1db14b053 Implement BeginVisibilityTest, EndVisibilityTest and GetVisibilityTestResult 2019-12-22 20:00:36 +00:00
patrickvl f97a642bc9 Fixed XDK Fog sample over-saturation by literally saturating all COLOR-semantic outputs (oD0, oD1, oB0 and oB1)!
Also updated the ARL bias, applied the frexp intrinsic to our LOGP function and updated LIT according to 6e3a387c01/src/Shader/ShaderCore.cpp (L1168)
2019-12-22 16:15:35 +01:00
Luke Usher f23c9adae1 Fix vertex state shader compilation in Spy vs Spy^ 2019-12-19 19:34:46 +00:00
PatrickvL 56af31aede Remove unneeded HostDeclarationSize 2019-12-19 18:16:36 +01:00
PatrickvL 270462d22c Replaced Parameter.Active with ParamCount 2019-12-19 17:12:52 +01:00
patrickvl f9410dace0 Added Register out-of-range LOG_TEST_CASE's
Named consistently CXBX specific vertex shader constants
2019-12-19 00:50:43 +01:00
patrickvl 1f83a28a01 Trigger test case popup (instead of just log) when vertex shader can't be compiled (which gives us valuable feedback for now).
Removed obsolete hostTemporaryRegisterCount variable
2019-12-18 22:56:28 +01:00
patrickvl f3d8120c6f Revert unrelated changes
Made RegVIsPresentInDeclaration a class XboxVertexDeclarationConverter protected data member.
2019-12-18 22:45:46 +01:00
patrickvl d28b4836fd Halve the selection of input attrbibute or constant, using lerp.
For this, made sure that the crossover value (as set in SetOverrideFlags) is either 0 or 1.

Also replaced the v0..v15 defines by actual variables. Instead, manually unrolled the initialization code via a concatenating define.
2019-12-18 21:45:44 +01:00
patrickvl 499297993c Remove IsMAC and replace it in HLSL generation with it's underlying condition 2019-12-18 20:12:25 +01:00
PatrickvL 9634329033 Avoid regex_replace by cutting up HLSL template into two raw strings. 2019-12-18 20:12:25 +01:00
Anthony Miles 016f8361b5 Remove dummy shader fallback 2019-12-18 20:12:25 +01:00
Anthony Miles 13df253853 regex_replace first occurrence only 2019-12-18 20:12:25 +01:00
Anthony Miles 949aecd862 Set optimization level 0 2019-12-18 20:12:24 +01:00
PatrickvL adc065b0bc Revert "TMP mechassault hack"
This reverts commit d616e94c117d3e1f0e8ce35bfc97d9f845d3c5b7.
2019-12-18 20:12:24 +01:00
PatrickvL 325e663c9f Further cleanup 2019-12-18 20:12:24 +01:00
PatrickvL ac36e6a0d4 Avoid using uninitialized class members 2019-12-18 20:12:24 +01:00
PatrickvL ebbb8e961f Moved a few functions to a better suitable location, and marked a few class functions 'static' 2019-12-18 20:12:24 +01:00
PatrickvL 18a27a64de Refactor vertex shader decoding types and functions into a class 2019-12-18 20:12:23 +01:00
patrickvl eeced5f0a9 Removed one unnecessary intermediate vertex shader decoding layer 2019-12-18 20:12:23 +01:00
patrickvl 5fe0a16cc6 Renamed vertex shader hlsl file, and prepared it for future extensions to behave closer to specifications (nothing changed for now) 2019-12-18 20:12:23 +01:00
patrickvl cc594ca8d7 Further simplifications in vertex shader decoding to intermediate instructions 2019-12-18 20:12:22 +01:00
Anthony Miles 9ee7bb451f Fix logp z component 2019-12-18 20:12:22 +01:00
Anthony Miles f9e5f51815 Fix dph src1.w double-add 2019-12-18 20:12:22 +01:00
Anthony Miles 1cebf018e2 Use int instead of uint for compatibility with optimizer level 0 2019-12-18 20:12:21 +01:00
Anthony Miles f8b1e35482 fix pInstruction typo 2019-12-18 20:12:21 +01:00
Anthony Miles ab1061634d TMP mechassault hack 2019-12-18 20:12:21 +01:00
Anthony Miles 0aa0dce8fb Hack to make sure pre-transformed and regular geometry go into the same coordinate space 2019-12-18 20:12:20 +01:00
PatrickvL ec2032bf0d Made sure that intermediate vertex shader instructions are never empty
Move A0_X indexing boolean from per-parameter to per-instruction, where it belongs.
2019-12-18 20:12:20 +01:00
PatrickvL ff1412b3d9 Use an HLSL accessor function for reading constant registers, allowing Xbox-native negative indices and out-of-bounds handling. This makes the generated HLSL look closed to the original Xbox vertex shader assembly. 2019-12-18 20:12:20 +01:00
PatrickvL d74e5947ee Refactor vertex shader microcode conversion to intermediate isntructions, fixing pairing bugs like ignore MAC R1 writes 2019-12-18 20:12:20 +01:00
PatrickvL 50a51657b0 Force A0's X mask during decoding (in VshAddInstructionMAC_ARL) instead of HLSL conversion (in OutputHlsl)
Also applied Unix EOL style (again)
2019-12-18 20:12:20 +01:00
Anthony Miles 619b276d81 Generate more accurate viewport values, so we can reverse transforms in the vertex shader more generally 2019-12-18 20:12:19 +01:00
Anthony Miles 5d2ef854fb Remove popups about register usage, now that HLSL is used 2019-12-18 20:12:19 +01:00
Anthony Miles b9db301791 Add LOG_TEST_CASE for writes to constants 2019-12-18 20:12:19 +01:00
Anthony Miles 136083d72a SetVertexData4f support 2019-12-18 20:12:19 +01:00
patrickvl ba5d25e2ed Only disassemble HLSL under debug log level
Fix arl by forcing .x mask on a0 parameter
2019-12-18 20:12:19 +01:00
patrickvl b330198fe6 Reorder vertex shader code 2019-12-18 20:12:19 +01:00
patrickvl 1365d2e7e1 Vertex shader HLSL : More commenting, reordering, renaming and fixing 2019-12-18 20:12:18 +01:00