D3DDevice_PersistDisplay
D3DDevice_GetPersistedSurface is a wrapper around
AvGetSavedDataAddress() and does not need to be patched.
D3DDevice_PersistDisplay needs to be patched for now, as it depends on
CMiniport::IsFlipPending, which only works with LLE NV2A at this moment
in time.
This fixed an issue in Crash Bandicoot: The Wrath of Cortex in which the
splash screen was corrupt (new issue to this branch)
Currently, this function does no hashing/dirty flags/any checks for
modification, so titles that modify textures on the fly will not display
correctly.
This will be addressed in a later commit.
This prevents the need for all the calls to this function throughout the
codebase, and also means that resources are only converted to their host
counterparts when this is actually required by Cxbx-Reloaded, rather
than anytime the resource is used.
- This prevents unwanted side effects when all we want to do is increment the Xbox reference count.
Cleanup around Set/Get RenderTarget
- This still isn't quite right, but a little bettter than what we had
- Turns out this as been wrong ever since we unpatched D3DDevice_CreateDevice!
- This restored textures in the 4361+ XDK samples
Move Host Resource lookup into a function to reduce code duplication.
- The new function (GetHostResource) is now used internally by all the other GetXXXResource functions.
- This fixes an issue where the XOnlineDash would crash when re-using resource data.
Fix a nullptr dereference in D3DResource_Release
Stop trashing resource data pointers within D3DResource_Register
- The xbox function now works unpatched and takes care of this before function executes.
Rename IsYuvSurface to IsYuvSurfaceOrTexture, apply the same changes to D3DTexture_LockRect as D3DSurface_LockRect (allows Silent Hill 2 to progress very slightly further)
Decouple host resources from the Resource->Lock field, I may have missed a few things, but now host resources no longer get lost if Xbox code or an unpatched function changes -> Lock!
For now, the actual (non-stub) implementations are still forwarding to Windows.
Still, this move centralizes the work to be done, and decouples it from our kernel implementation.