Merge pull request #1040 from LukeUsher/various-experiments

This seems to fix the .bik hang
This commit is contained in:
Luke Usher 2018-04-07 01:24:54 +01:00 committed by GitHub
commit ccb9ae1309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 17 deletions

View File

@ -3972,6 +3972,10 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap)
DEBUG_D3DRESULT(hRet, "g_pD3DDevice8->Present");
hRet = g_pD3DDevice8->BeginScene();
UpdateFPSCounter();
if (Flags == CXBX_SWAP_PRESENT_FORWARD) // Only do this when forwarded from Present
{
if (!g_UncapFramerate) {
// If the last frame completed faster than the Xbox VBlank period, wait for it
// TODO: Read the frame rate target from the Xbox display mode
@ -3986,10 +3990,6 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap)
frameStartTime = std::chrono::high_resolution_clock::now();
}
UpdateFPSCounter();
if (Flags == CXBX_SWAP_PRESENT_FORWARD) // Only do this when forwarded from Present
{
// Put primitives per frame in the title
/*{
char szString[64];

View File

@ -144,8 +144,7 @@ static BOOL TryEnterHostCriticalSection(xboxkrnl::PRTL_CRITICAL_SECTION xbox_cri
DWORD WINAPI RtlAnsiStringToUnicodeSize(const xboxkrnl::STRING *str)
{
DWORD ret = mbstowcs(nullptr, str->Buffer, str->Length);
return ret + sizeof(WCHAR); // + for the terminating null character
return (str->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR);
}
// ******************************************************************

View File

@ -954,7 +954,7 @@ DWORD WINAPI XTL::EMUPATCH(QueueUserAPC)
DWORD dwData
)
{
FUNC_EXPORTS
//FUNC_EXPORTS
LOG_FUNC_BEGIN
LOG_FUNC_ARG_TYPE(PVOID, pfnAPC)