Commit Graph

2287 Commits

Author SHA1 Message Date
Luke Usher e88268b95f Fix a bug where the index buffer was being re-copied every call 2017-04-28 22:56:34 +01:00
Luke Usher 5169141d4d Remove unused EmuPatch field of the OOVPA 2017-04-28 22:41:18 +01:00
Luke Usher 7b60aa1020 More Index Buffer work 2017-04-28 22:34:13 +01:00
Luke Usher 7939ca665d Port CxbxRemoveIndexBuffer
More work is still required.

CreateDevice really needs to be unpatched, there's no avoiding this now!
2017-04-28 22:33:40 +01:00
Luke Usher a8997b4b41 Ported DxbxUpdateActiveIndexBuffer
Also allow SetIndices to work unpatched
This is more accurate than what Cxbx previously did.

NOTE: This fixes GamePad/Cartoon XDK samples and breaks many titles.

There is still work to-do:

* Get CreateDevice to run unpatched
* Patch D3D_CleanPrivateData
* Port DxbxRemoveIndexBuffer

There could be more things too, but this is where I'm up-to so far
2017-04-28 22:33:31 +01:00
Luke Usher 60c7c9ca22 Merge pull request #394 from LukeUsher/AvGetSavedDataAddress
Implement AvGetSavedDataAddress & AvSetSavedDataAddress
2017-04-24 07:12:48 +01:00
Luke Usher 0742b7d206 Merge pull request #395 from LukeUsher/master
Revert "Temporarily disable vertex buffer caching."
2017-04-24 06:50:18 +01:00
Luke Usher ae1a6de393 Revert "Temporarily disable vertex buffer caching."
This reverts commit d5b67a8f7b.

The speed impact, although almost non-existent for myself was
significant enough to hinder other users, and even other devs. We need
to figure out how to fix this properly.
2017-04-24 06:47:58 +01:00
Luke Usher 5aa711f66f Merge pull request #392 from PatrickvL/master
Preparations for removal of CreatePalette
2017-04-23 21:36:08 +01:00
Luke Usher e974f1d04b Implement AvGetSavedDataAddress & AvSetSavedDataAddress
The existing implementation was overkill, as all these functions do on
Xbox is get/set a single pointer value. The actual surface creation is
handled by D3D in D3DDevice_PersistDisplay.
2017-04-23 21:33:30 +01:00
PatrickvL 1a1c2be357 revert 2017-04-22 23:53:18 +01:00
PatrickvL b255427067 Merge remote-tracking branch 'refs/remotes/Cxbx-Reloaded/master' 2017-04-22 23:35:53 +01:00
PatrickvL 4b0e84ade3 amend 2017-04-22 23:34:40 +01:00
PatrickvL dcccb1920e SetPalette now supports all 4 stages. Also constantified TEXTURE_STAGES 2017-04-22 23:33:30 +01:00
Luke Usher 797894c1ac Merge pull request #393 from LukeUsher/master
Temporarily disable vertex buffer caching.
2017-04-22 18:28:56 +01:00
PatrickvL 0d47476dcc SetPalette now supports all 4 stages. Also constantified TEXTURE_STAGES 2017-04-22 18:27:19 +01:00
Luke Usher d5b67a8f7b Temporarily disable vertex buffer caching.
This could have a speed impact but it not that noticable currently, and it significantly improves rendering of the dashboard and potentially others
2017-04-22 18:25:26 +01:00
PatrickvL e9dff8cfcb Introduced GetDataFromXboxResource 2017-04-22 17:59:47 +01:00
PatrickvL d79cbe3e2b Renamed some pThis into pXboxResource 2017-04-22 17:30:30 +01:00
PatrickvL 906c989bc6 Applied GetXboxResourceType 2017-04-22 17:29:22 +01:00
PatrickvL ee9b9ba53f Merge remote-tracking branch 'refs/remotes/Cxbx-Reloaded/master' 2017-04-22 17:27:11 +01:00
PatrickvL a9cb7a7ac8 Introduced GetXboxResourceType 2017-04-22 17:25:52 +01:00
PatrickvL 95e417d671 Merge remote-tracking branch 'refs/remotes/Cxbx-Reloaded/master' 2017-04-22 16:05:39 +01:00
Luke Usher 1a9b20ad08 Merge pull request #390 from LukeUsher/patrickvl-improvements
Patrickvl improvements
2017-04-22 00:04:35 +01:00
PatrickvL cd3d8795b2 Disabled D3DVertexBuffer_GetDesc patch
Added X_D3DVERTEXBUFFER_DESC and X_D3DINDEXBUFFER_DESC
Small cleanup
2017-04-21 23:49:08 +01:00
PatrickvL b88a837397 Introduced GetHost* helper functions 2017-04-21 23:43:12 +01:00
PatrickvL cdc1048ec3 Added g_ prefix to two global variables 2017-04-21 23:33:16 +01:00
PatrickvL f3a41a1596 Change EmuD3DActiveTexture into X_D3DPixelContainer's 2017-04-21 23:30:19 +01:00
PatrickvL de02c0146e Prefer X_D3DCOMMON_TYPE_TEXTURE over reading EmuResource8 2017-04-21 23:28:03 +01:00
PatrickvL f615a900af Use 0, NULL and nullptr correctly 2017-04-21 23:27:22 +01:00
PatrickvL ced5963a3a VertexShader handles no longer (ab)use the high-bit.
Instead, VshHandleIsVertexShader checks if the handle is a high-enough
memory address (lower addresses are FVF's).
2017-04-21 23:24:12 +01:00
PatrickvL a035124fea VshHandleIsValidShader must use VshHandleGetVertexShader too 2017-04-21 23:21:32 +01:00
PatrickvL 1eb79878ac Renamed p(b)Data variables into p(b)NativeData where applicable
Also corrected D3DVertexBuffer_Lock2 ppVertexBuffer name into
pVertexBuffer
2017-04-21 23:17:57 +01:00
PatrickvL 30494a71d3 D3DVertexBuffer_Lock : Corrected ppVertexBuffer name into pVertexBuffer 2017-04-21 23:17:38 +01:00
PatrickvL 08045a905b Fixed typo SetIndcies > SetIndices 2017-04-21 23:14:40 +01:00
PatrickvL b633489295 EmuVerifyResourceIsRegistered skips resources with unknown size or without data earlier 2017-04-21 23:14:17 +01:00
Luke Usher 97a665cdd6 Merge commit '4d0b4d539e71cd2dfb93b08039d3c011576bc6d5' into patrickvl-improvements 2017-04-21 23:09:52 +01:00
PatrickvL dfaf3b8480 Additional VertexPatcher::Restore cleanup 2017-04-21 23:05:28 +01:00
PatrickvL 59891a7801 Use pPatchDesc->hVertexShader instead of g_CurrentVertexShader 2017-04-21 23:02:46 +01:00
PatrickvL f4495c6ea4 Check actual pointer instead of making indirect assumptions 2017-04-21 22:58:05 +01:00
PatrickvL 5033060cea Backported Dxbx VertexShader conversion improvements 2017-04-21 22:44:47 +01:00
PatrickvL e978649dcf Corrected use of NULL, 0 and nullptr
Also some whitespace removal/insertion, indentation updates and
additional comments
2017-04-21 22:44:42 +01:00
PatrickvL b66460d900 Remove Halo hack 2017-04-21 22:40:46 +01:00
PatrickvL af26fd52b3 Remove HACK: Unreal Championship 2017-04-21 22:40:33 +01:00
PatrickvL 1e547ebef5 D3DDevice_DrawIndexedVertices porting from Dxbx
D3DDevice_DrawIndexedVertices is responsible for the gamepad (which is
currently very glitchy). This code doesn't fix that, so it's probably
caused in either CxbxUpdateActiveIndexBuffer or VertPatch.Apply
2017-04-21 22:35:16 +01:00
PatrickvL f9e9e3e887 Various improvements
In EmuFlushIVB:
* Simpler determination of uiStride
* Convert g_IVBTable to g_pIVBVertexBuffer to avoid overwrites
* Detect overflow of pIVBVertexBuffer
In D3DDevice_SetVertexData4f :
* Detect overflow of g_IVBTblOffs
In VshConvertToken_STREAMDATA_REG :
* X_D3DVSDT_FLOAT2H converts to D3DVSDT_FLOAT4 (and corresponding size)
since VertexPatcher::PatchStream relies on that
2017-04-21 22:28:20 +01:00
Luke Usher af56741140 Merge pull request #389 from LukeUsher/fix-hle-cache-renderstate
Fix HLE Cache
2017-04-21 22:19:04 +01:00
Luke Usher 398bd7208a Only clear .ini files rather than the entire folder contents 2017-04-21 12:08:21 +01:00
Luke Usher e160e8ea8a Fix the resource file 2017-04-21 10:03:09 +01:00
Luke Usher 9fc55e631e Add a menu option to clear the cache. 2017-04-21 09:57:57 +01:00