From db03fe9e1eec4c6e67490b1bcddbc1ffa2c92177 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sun, 5 Oct 2003 22:21:20 +0000 Subject: [PATCH] halo being fixed --- Doc/Todo.txt | 2 ++ Source/Win32/CxbxKrnl/Emu.cpp | 6 +++--- Source/Win32/CxbxKrnl/EmuD3D8Conv.cpp | 3 --- Source/Win32/CxbxKrnl/EmuKrnl.cpp | 6 +++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Doc/Todo.txt b/Doc/Todo.txt index 5ba431660..87b2d6e5a 100644 --- a/Doc/Todo.txt +++ b/Doc/Todo.txt @@ -1,5 +1,7 @@ Cxbx Todo (* denotes high priority, + denotes medium priority) + * Stella has a memory leak in the game's list screen.. + * SetPushBufferSize -> 0x184CC0 (Halo)..too small to detect? * DirectSoundUseFullHRTF -> 0x192D8C (Halo)..too small to detect? diff --git a/Source/Win32/CxbxKrnl/Emu.cpp b/Source/Win32/CxbxKrnl/Emu.cpp index 62f2fc852..cc0b5ba4b 100644 --- a/Source/Win32/CxbxKrnl/Emu.cpp +++ b/Source/Win32/CxbxKrnl/Emu.cpp @@ -612,15 +612,15 @@ extern int EmuException(LPEXCEPTION_POINTERS e) { if(e->ContextRecord->Eip == 0x3394C) { - if(e->ContextRecord->Eax == 0x803BD800 && e->ContextRecord->Ecx == 0x803BD800) + if(e->ContextRecord->Ecx == 0x803BD800) { - uint32 fix = g_HaloHack[1] + (0x803BD800 - 0x803A6000); + uint32 fix = g_HaloHack[1] + (e->ContextRecord->Eax - 0x803A6000); e->ContextRecord->Eax = e->ContextRecord->Ecx = fix; *(uint32*)e->ContextRecord->Esp = fix; - ((XTL::X_D3DResource*)fix)->Data = g_HaloHack[1] + (0x803BD9A0 - 0x803A6000); + ((XTL::X_D3DResource*)fix)->Data = g_HaloHack[1] + (((XTL::X_D3DResource*)fix)->Data - 0x803A6000); return EXCEPTION_CONTINUE_EXECUTION; } diff --git a/Source/Win32/CxbxKrnl/EmuD3D8Conv.cpp b/Source/Win32/CxbxKrnl/EmuD3D8Conv.cpp index 305f6e223..1f62c2b90 100644 --- a/Source/Win32/CxbxKrnl/EmuD3D8Conv.cpp +++ b/Source/Win32/CxbxKrnl/EmuD3D8Conv.cpp @@ -212,9 +212,6 @@ UINT XTL::EmuFixupVerticesA BYTE *pOrigVertexData = 0; BYTE *pHackVertexData = 0; - if(ppNewVertexStreamZeroData != 0) - *ppNewVertexStreamZeroData = pVertexStreamZeroData; - if(pVertexStreamZeroData == 0) { g_pD3DDevice8->GetStreamSource(0, &pOrigVertexBuffer8, &uiStride); diff --git a/Source/Win32/CxbxKrnl/EmuKrnl.cpp b/Source/Win32/CxbxKrnl/EmuKrnl.cpp index 0565770f9..8b5764fd5 100644 --- a/Source/Win32/CxbxKrnl/EmuKrnl.cpp +++ b/Source/Win32/CxbxKrnl/EmuKrnl.cpp @@ -1197,7 +1197,7 @@ XBSYSAPI EXPORTNUM(190) NTSTATUS NTAPI xboxkrnl::NtCreateFile #ifdef _DEBUG_TRACE if(FAILED(ret)) - printf("EmuKrnl (0x%X): NtCreateFile Failed! (0x%.08X)", GetCurrentThreadId(), ret); + printf("EmuKrnl (0x%X): NtCreateFile Failed! (0x%.08X)\n", GetCurrentThreadId(), ret); else printf("EmuKrnl (0x%X): NtCreateFile = 0x%.08X\n", GetCurrentThreadId(), *FileHandle); #endif @@ -2080,11 +2080,13 @@ XBSYSAPI EXPORTNUM(277) VOID NTAPI xboxkrnl::RtlEnterCriticalSection // debug trace #ifdef _DEBUG_TRACE { + /** sorta pointless printf("EmuKrnl (0x%X): RtlEnterCriticalSection\n" "(\n" " CriticalSection : 0x%.08X\n" ");\n", GetCurrentThreadId(), CriticalSection); + //*/ } #endif @@ -2175,11 +2177,13 @@ XBSYSAPI EXPORTNUM(294) VOID NTAPI xboxkrnl::RtlLeaveCriticalSection // debug trace #ifdef _DEBUG_TRACE { + /* sorta pointless printf("EmuKrnl (0x%X): RtlLeaveCriticalSection\n" "(\n" " CriticalSection : 0x%.08X\n" ");\n", GetCurrentThreadId(), CriticalSection); + **/ } #endif