New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve some LTCG specific patches #1670
Conversation
if (dwD3DDevice != xbnull) { | ||
g_XboxD3DDevice = *((DWORD**)dwD3DDevice); | ||
} | ||
g_XboxD3DDevice = (DWORD*)it->second; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we were deriving this incorrectly before: This approach matches what I see on the Xbox side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I don't think the fix from targeted XbSymbolDatabase did occur to find D3DDEVICE
symbol in LTCG applications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not a problem. Nowhere uses this variable at the moment anyway. It was used in the past before we had trampolines working.
I just noticed it was derived wrong by cxbxr and fixed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully soon we'll update the target XbSymbolDatabase to take advantage of existing symbols detecting properly.
EDIT: Of course we'll need to re-update the symbol name from D3DDEVICE
to D3D__PDEVICE
since there is such thing as D3D__DEVICE
symbol.
// This uses a custom calling convention passed unknown parameters | ||
// Test-case: Ninja Gaiden | ||
// This uses a custom calling with parameters passed in eax, ecx and the stack | ||
// Test-case: Ninja Gaiden, Halo 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing this prevents an issue where CreateDevice would corrupt the D3DDevice pointer on the Xbox side
// This uses a custom calling convention where parameter is passed in EBX and Stack | ||
// Test Case: Conker | ||
// ****************************************************************** | ||
VOID WINAPI XTL::EMUPATCH(D3DDevice_SetIndices_4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a crash in Conker caused by corrupted internal D3D index buffer state
// This uses a custom calling convention where parameter is passed in ECX, EAX and Stack | ||
// Test Case: Conker | ||
// ****************************************************************** | ||
VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices_4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Draw function that was detected, but not patched in Conker
LGTM, merging |
Slightly improves behavior of Conker and Halo 2, they still don't do anything worth mentioning, however.
But they run for a little bit longer before crashing now, so it's progress,