From 2ec990034b7f39adc54f83fe68c8ca8fe7b38a8f Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Tue, 19 Aug 2003 03:58:13 +0000 Subject: [PATCH] 3925 halo etc --- CxbxKrnl.dsp | 8 + Include/Cxbx.h | 2 +- Include/Win32/CxbxKrnl/DSound.1.0.3936.h | 42 ++++++ Include/Win32/CxbxKrnl/EmuD3D8.h | 25 ++++ Source/Win32/CxbxKrnl/D3D8.1.0.3925.inl | 174 ++++++++++++++++++++++ Source/Win32/CxbxKrnl/D3D8.1.0.4361.inl | 39 +---- Source/Win32/CxbxKrnl/DSound.1.0.3936.inl | 86 +++++++++++ Source/Win32/CxbxKrnl/EmuD3D8.cpp | 86 +++++++++++ Source/Win32/CxbxKrnl/EmuKrnl.cpp | 30 ++++ Source/Win32/CxbxKrnl/HLEDataBase.cpp | 8 + Source/Win32/CxbxKrnl/KernelThunk.cpp | 2 +- Source/Win32/CxbxKrnl/Xapi.1.0.3911.inl | 87 +++++++++++ Source/Win32/CxbxKrnl/Xapi.1.0.4034.inl | 39 +---- Source/Win32/CxbxKrnl/Xapi.1.0.4134.inl | 40 +---- Source/Win32/CxbxKrnl/Xapi.1.0.4361.inl | 4 +- Source/Win32/CxbxKrnl/Xapi.1.0.4627.inl | 4 +- 16 files changed, 560 insertions(+), 116 deletions(-) create mode 100644 Include/Win32/CxbxKrnl/DSound.1.0.3936.h create mode 100644 Source/Win32/CxbxKrnl/DSound.1.0.3936.inl diff --git a/CxbxKrnl.dsp b/CxbxKrnl.dsp index de615a09a..a53c59967 100644 --- a/CxbxKrnl.dsp +++ b/CxbxKrnl.dsp @@ -166,6 +166,10 @@ SOURCE=.\Include\Win32\CxbxKrnl\D3D8.1.0.4627.h # End Source File # Begin Source File +SOURCE=.\Include\Win32\CxbxKrnl\DSound.1.0.3936.h +# End Source File +# Begin Source File + SOURCE=.\Include\Win32\CxbxKrnl\DSound.1.0.4361.h # End Source File # Begin Source File @@ -318,6 +322,10 @@ SOURCE=.\Source\Win32\CxbxKrnl\D3D8.1.0.4627.inl # End Source File # Begin Source File +SOURCE=.\Source\Win32\CxbxKrnl\DSound.1.0.3936.inl +# End Source File +# Begin Source File + SOURCE=.\Source\Win32\CxbxKrnl\DSound.1.0.4361.inl # End Source File # Begin Source File diff --git a/Include/Cxbx.h b/Include/Cxbx.h index 47634125f..c3b4dc99f 100644 --- a/Include/Cxbx.h +++ b/Include/Cxbx.h @@ -61,7 +61,7 @@ typedef signed long sint32; // ****************************************************************** // * Define this to trace intercepted function calls // ****************************************************************** -//#define _DEBUG_TRACE +#define _DEBUG_TRACE #define _DEBUG_WARNINGS // ****************************************************************** diff --git a/Include/Win32/CxbxKrnl/DSound.1.0.3936.h b/Include/Win32/CxbxKrnl/DSound.1.0.3936.h new file mode 100644 index 000000000..bd01eede1 --- /dev/null +++ b/Include/Win32/CxbxKrnl/DSound.1.0.3936.h @@ -0,0 +1,42 @@ +// ****************************************************************** +// * +// * .,-::::: .,:: .::::::::. .,:: .: +// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; +// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' +// * $$$ Y$$$P $$""""Y$$ Y$$$P +// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, +// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, +// * +// * Cxbx->Win32->CxbxKrnl->DSound.1.0.3936.h +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef DSOUND_1_0_3936_H +#define DSOUND_1_0_3936_H + +#include "OOVPA.h" + +extern OOVPATable DSOUND_1_0_3936[]; +extern uint32 DSOUND_1_0_3936_SIZE; + +#endif diff --git a/Include/Win32/CxbxKrnl/EmuD3D8.h b/Include/Win32/CxbxKrnl/EmuD3D8.h index f9a2a053a..d1cc4bee0 100644 --- a/Include/Win32/CxbxKrnl/EmuD3D8.h +++ b/Include/Win32/CxbxKrnl/EmuD3D8.h @@ -1010,6 +1010,31 @@ HRESULT WINAPI EmuIDirect3DTexture8_GetSurfaceLevel X_D3DSurface **ppSurfaceLevel ); +// ****************************************************************** +// * func: EmuIDirect3DVolumeTexture8_LockBox +// ****************************************************************** +HRESULT WINAPI EmuIDirect3DVolumeTexture8_LockBox +( + X_D3DVolumeTexture *pThis, + UINT Level, + D3DLOCKED_BOX *pLockedVolume, + CONST D3DBOX *pBox, + DWORD Flags +); + +// ****************************************************************** +// * func: EmuIDirect3DCubeTexture8_LockRect +// ****************************************************************** +HRESULT WINAPI EmuIDirect3DCubeTexture8_LockRect +( + X_D3DCubeTexture *pThis, + D3DCUBEMAP_FACES FaceType, + UINT Level, + D3DLOCKED_RECT *pLockedBox, + CONST RECT *pRect, + DWORD Flags +); + // ****************************************************************** // * func: EmuIDirect3DDevice8_CreateVertexBuffer // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/D3D8.1.0.3925.inl b/Source/Win32/CxbxKrnl/D3D8.1.0.3925.inl index dde49f19e..cc2a22d1a 100644 --- a/Source/Win32/CxbxKrnl/D3D8.1.0.3925.inl +++ b/Source/Win32/CxbxKrnl/D3D8.1.0.3925.inl @@ -588,6 +588,74 @@ SOOVPA<10> IDirect3DDevice8_GetDepthStencilSurface_1_0_3925 = } }; +// ****************************************************************** +// * IDirect3DDevice8_CreateVertexBuffer +// ****************************************************************** +SOOVPA<13> IDirect3DDevice8_CreateVertexBuffer_1_0_3925 = +{ + 0, // Large == 0 + 13, // Count == 13 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_CreateVertexBuffer+0x03 : push 0x40 + { 0x03, 0x6A }, // (Offset,Value)-Pair #1 + { 0x04, 0x40 }, // (Offset,Value)-Pair #2 + + // IDirect3DDevice8_CreateVertexBuffer+0x10 : mov eax, [esp+8] + { 0x10, 0x8B }, // (Offset,Value)-Pair #3 + { 0x11, 0x44 }, // (Offset,Value)-Pair #4 + { 0x12, 0x24 }, // (Offset,Value)-Pair #5 + { 0x13, 0x08 }, // (Offset,Value)-Pair #6 + + // IDirect3DDevice8_CreateVertexBuffer+0x48 : mov dword ptr [esi], 0x01000001 + { 0x48, 0xC7 }, // (Offset,Value)-Pair #7 + { 0x49, 0x06 }, // (Offset,Value)-Pair #8 + { 0x4A, 0x01 }, // (Offset,Value)-Pair #9 + { 0x4B, 0x00 }, // (Offset,Value)-Pair #10 + { 0x4D, 0x01 }, // (Offset,Value)-Pair #11 + + // IDirect3DDevice8_CreateVertexBuffer+0x53 : retn 0x14 + { 0x53, 0xC2 }, // (Offset,Value)-Pair #12 + { 0x54, 0x14 }, // (Offset,Value)-Pair #13 + } +}; + +// ****************************************************************** +// * IDirect3DVertexBuffer8_Lock +// ****************************************************************** +SOOVPA<11> IDirect3DVertexBuffer8_Lock_1_0_3925 = +{ + 0, // Large == 0 + 11, // Count == 11 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DVertexBuffer8_Lock+0x01 : mov bl, [esp+0x18] + { 0x01, 0x8A }, // (Offset,Value)-Pair #1 + { 0x02, 0x5C }, // (Offset,Value)-Pair #2 + { 0x03, 0x24 }, // (Offset,Value)-Pair #3 + { 0x04, 0x18 }, // (Offset,Value)-Pair #4 + + // IDirect3DVertexBuffer8_Lock+0x09 : jnz +0x24 + { 0x09, 0x75 }, // (Offset,Value)-Pair #5 + { 0x0A, 0x1E }, // (Offset,Value)-Pair #6 + + // IDirect3DVertexBuffer8_Lock+0x29 : test bl, 0xA0 + { 0x29, 0xF6 }, // (Offset,Value)-Pair #7 + { 0x2A, 0xC3 }, // (Offset,Value)-Pair #8 + { 0x2B, 0xA0 }, // (Offset,Value)-Pair #9 + + // IDirect3DVertexBuffer8_Lock+0x4A : retn 0x14 + { 0x4A, 0xC2 }, // (Offset,Value)-Pair #10 + { 0x4B, 0x14 }, // (Offset,Value)-Pair #11 + } +}; + // ****************************************************************** // * IDirect3DResource8_Release // ****************************************************************** @@ -733,6 +801,72 @@ SOOVPA<17> IDirect3DTexture8_LockRect_1_0_3925 = } }; +// ****************************************************************** +// * IDirect3DVolumeTexture8_LockBox +// ****************************************************************** +SOOVPA<11> IDirect3DVolumeTexture8_LockBox_1_0_3925 = +{ + 0, // Large == 0 + 11, // Count == 11 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DVolumeTexture8_LockBox+0x08 : test bl, 0x20 + { 0x08, 0xF6 }, // (Offset,Value)-Pair #1 + { 0x09, 0xC3 }, // (Offset,Value)-Pair #2 + { 0x0A, 0x20 }, // (Offset,Value)-Pair #3 + + // IDirect3DVolumeTexture8_LockBox+0x40 : test bl, 0x40 + { 0x40, 0xF6 }, // (Offset,Value)-Pair #4 + { 0x41, 0xC3 }, // (Offset,Value)-Pair #5 + { 0x42, 0x40 }, // (Offset,Value)-Pair #6 + + // IDirect3DVolumeTexture8_LockBox+0x83 : lea ecx, [eax+edx] + { 0x83, 0x8D }, // (Offset,Value)-Pair #7 + { 0x84, 0x0C }, // (Offset,Value)-Pair #8 + { 0x85, 0x10 }, // (Offset,Value)-Pair #9 + + // IDirect3DVolumeTexture8_LockBox+0x99 : retn 0x14 + { 0x99, 0xC2 }, // (Offset,Value)-Pair #10 + { 0x9A, 0x14 }, // (Offset,Value)-Pair #11 + } +}; + +// ****************************************************************** +// * IDirect3DCubeTexture8_LockRect +// ****************************************************************** +SOOVPA<11> IDirect3DCubeTexture8_LockRect_1_0_3925 = +{ + 0, // Large == 0 + 11, // Count == 11 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DCubeTexture8_LockRect+0x06 : test bl, 0x20 + { 0x06, 0xF6 }, // (Offset,Value)-Pair #1 + { 0x07, 0xC3 }, // (Offset,Value)-Pair #2 + { 0x08, 0x20 }, // (Offset,Value)-Pair #3 + + // IDirect3DCubeTexture8_LockRect+0x3F : test bl, 0x40 + { 0x3F, 0xF6 }, // (Offset,Value)-Pair #4 + { 0x40, 0xC3 }, // (Offset,Value)-Pair #5 + { 0x41, 0x40 }, // (Offset,Value)-Pair #6 + + // IDirect3DCubeTexture8_LockRect+0x71 : shr edx, 0x03 + { 0x71, 0xC1 }, // (Offset,Value)-Pair #7 + { 0x72, 0xEA }, // (Offset,Value)-Pair #8 + { 0x73, 0x03 }, // (Offset,Value)-Pair #9 + + // IDirect3DCubeTexture8_LockRect+0x98 : retn 0x18 + { 0x98, 0xC2 }, // (Offset,Value)-Pair #10 + { 0x99, 0x18 }, // (Offset,Value)-Pair #11 + } +}; + // ****************************************************************** // * D3D8_1_0_3925 // ****************************************************************** @@ -898,6 +1032,26 @@ OOVPATable D3D8_1_0_3925[] = "EmuIDirect3DDevice8_GetDepthStencilSurface" #endif }, + // IDirect3DDevice8::CreateVertexBuffer + { + (OOVPA*)&IDirect3DDevice8_CreateVertexBuffer_1_0_3925, + + XTL::EmuIDirect3DDevice8_CreateVertexBuffer, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_CreateVertexBuffer" + #endif + }, + // IDirect3DVertexBuffer8::Lock + { + (OOVPA*)&IDirect3DVertexBuffer8_Lock_1_0_3925, + + XTL::EmuIDirect3DVertexBuffer8_Lock, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DVertexBuffer8_Lock" + #endif + }, // IDirect3DResource8::Release { (OOVPA*)&IDirect3DResource8_Release_1_0_3925, @@ -938,6 +1092,26 @@ OOVPATable D3D8_1_0_3925[] = "EmuIDirect3DTexture8_LockRect" #endif }, + // IDirect3DVolumeTexture8::LockBox + { + (OOVPA*)&IDirect3DVolumeTexture8_LockBox_1_0_3925, + + XTL::EmuIDirect3DVolumeTexture8_LockBox, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DVolumeTexture8_LockBox" + #endif + }, + // IDirect3DCubeTexture8::LockRect + { + (OOVPA*)&IDirect3DCubeTexture8_LockRect_1_0_3925, + + XTL::EmuIDirect3DCubeTexture8_LockRect, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DCubeTexture8_LockRect" + #endif + }, }; // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/D3D8.1.0.4361.inl b/Source/Win32/CxbxKrnl/D3D8.1.0.4361.inl index 12aebaf0c..c73c1a578 100644 --- a/Source/Win32/CxbxKrnl/D3D8.1.0.4361.inl +++ b/Source/Win32/CxbxKrnl/D3D8.1.0.4361.inl @@ -822,41 +822,6 @@ SOOVPA<11> IDirect3DDevice8_Swap_1_0_4361 = } }; -// ****************************************************************** -// * IDirect3DDevice8_CreateVertexBuffer -// ****************************************************************** -SOOVPA<13> IDirect3DDevice8_CreateVertexBuffer_1_0_4361 = -{ - 0, // Large == 0 - 13, // Count == 13 - - -1, // XRef Not Saved - 0, // XRef Not Used - - { - // IDirect3DDevice8_CreateVertexBuffer+0x03 : push 0x40 - { 0x03, 0x6A }, // (Offset,Value)-Pair #1 - { 0x04, 0x40 }, // (Offset,Value)-Pair #2 - - // IDirect3DDevice8_CreateVertexBuffer+0x10 : mov eax, [esp+8] - { 0x10, 0x8B }, // (Offset,Value)-Pair #3 - { 0x11, 0x44 }, // (Offset,Value)-Pair #4 - { 0x12, 0x24 }, // (Offset,Value)-Pair #5 - { 0x13, 0x08 }, // (Offset,Value)-Pair #6 - - // IDirect3DDevice8_CreateVertexBuffer+0x48 : mov dword ptr [esi], 0x01000001 - { 0x48, 0xC7 }, // (Offset,Value)-Pair #7 - { 0x49, 0x06 }, // (Offset,Value)-Pair #8 - { 0x4A, 0x01 }, // (Offset,Value)-Pair #9 - { 0x4B, 0x00 }, // (Offset,Value)-Pair #10 - { 0x4D, 0x01 }, // (Offset,Value)-Pair #11 - - // IDirect3DDevice8_CreateVertexBuffer+0x53 : retn 0x14 - { 0x53, 0xC2 }, // (Offset,Value)-Pair #12 - { 0x54, 0x14 }, // (Offset,Value)-Pair #13 - } -}; - // ****************************************************************** // * IDirect3DDevice8_EnableOverlay // ****************************************************************** @@ -2187,9 +2152,9 @@ OOVPATable D3D8_1_0_4361[] = "EmuIDirect3DDevice8_Swap" #endif }, - // IDirect3DDevice8::CreateVertexBuffer + // IDirect3DDevice8::CreateVertexBuffer (* unchanged since 3925 *) { - (OOVPA*)&IDirect3DDevice8_CreateVertexBuffer_1_0_4361, + (OOVPA*)&IDirect3DDevice8_CreateVertexBuffer_1_0_3925, XTL::EmuIDirect3DDevice8_CreateVertexBuffer, diff --git a/Source/Win32/CxbxKrnl/DSound.1.0.3936.inl b/Source/Win32/CxbxKrnl/DSound.1.0.3936.inl new file mode 100644 index 000000000..fbbe78f96 --- /dev/null +++ b/Source/Win32/CxbxKrnl/DSound.1.0.3936.inl @@ -0,0 +1,86 @@ +// ****************************************************************** +// * +// * .,-::::: .,:: .::::::::. .,:: .: +// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; +// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' +// * $$$ Y$$$P $$""""Y$$ Y$$$P +// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, +// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, +// * +// * Cxbx->Win32->CxbxKrnl->DSound.1.0.3936.cpp +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** + +// ****************************************************************** +// * DirectSoundCreate +// ****************************************************************** +SOOVPA<9> DirectSoundCreate_1_0_3936 = +{ + 0, // Large == 0 + 9, // Count == 9 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // DirectSoundCreate+0x23 : add eax, 8 + { 0x23, 0x83 }, // (Offset,Value)-Pair #1 + { 0x24, 0xC0 }, // (Offset,Value)-Pair #2 + { 0x25, 0x08 }, // (Offset,Value)-Pair #3 + + // DirectSoundCreate+0x34 : push 0x1C + { 0x34, 0x6A }, // (Offset,Value)-Pair #4 + { 0x35, 0x1C }, // (Offset,Value)-Pair #5 + + // DirectSoundCreate+0x75 : sbb eax, eax + { 0x75, 0x1B }, // (Offset,Value)-Pair #6 + { 0x76, 0xC0 }, // (Offset,Value)-Pair #7 + + // DirectSoundCreate+0x9B : retn 0x0C + { 0x9B, 0xC2 }, // (Offset,Value)-Pair #8 + { 0x9C, 0x0C }, // (Offset,Value)-Pair #9 + } +}; + +// ****************************************************************** +// * DirectSoundCreate_1_0_3936 +// ****************************************************************** +OOVPATable DSound_1_0_3936[] = +{ + // DirectSoundCreate + { + (OOVPA*)&DirectSoundCreate_1_0_3936, + + XTL::EmuDirectSoundCreate, + + #ifdef _DEBUG_TRACE + "EmuDirectSoundCreate" + #endif + }, +}; + +// ****************************************************************** +// * DSound_1_0_3936_SIZE +// ****************************************************************** +uint32 DSound_1_0_3936_SIZE = sizeof(DSound_1_0_3936); diff --git a/Source/Win32/CxbxKrnl/EmuD3D8.cpp b/Source/Win32/CxbxKrnl/EmuD3D8.cpp index 9f259b1b9..d2b6cdbb8 100644 --- a/Source/Win32/CxbxKrnl/EmuD3D8.cpp +++ b/Source/Win32/CxbxKrnl/EmuD3D8.cpp @@ -3135,6 +3135,92 @@ HRESULT WINAPI XTL::EmuIDirect3DTexture8_GetSurfaceLevel return hRet; } +// ****************************************************************** +// * func: EmuIDirect3DVolumeTexture8_LockBox +// ****************************************************************** +HRESULT WINAPI XTL::EmuIDirect3DVolumeTexture8_LockBox +( + X_D3DVolumeTexture *pThis, + UINT Level, + D3DLOCKED_BOX *pLockedVolume, + CONST D3DBOX *pBox, + DWORD Flags +) +{ + EmuSwapFS(); // Win2k/XP FS + + // ****************************************************************** + // * debug trace + // ****************************************************************** + #ifdef _DEBUG_TRACE + { + printf("EmuD3D8 (0x%X): EmuIDirect3DVolumeTexture8_LockBox\n" + "(\n" + " pThis : 0x%.08X\n" + " Level : 0x%.08X\n" + " pLockedVolume : 0x%.08X\n" + " pBox : 0x%.08X\n" + " Flags : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), pThis, Level, pLockedVolume, pBox, Flags); + } + #endif + + EmuVerifyResourceIsRegistered(pThis); + + IDirect3DVolumeTexture8 *pVolumeTexture8 = pThis->EmuVolumeTexture8; + + HRESULT hRet = pVolumeTexture8->LockBox(Level, pLockedVolume, pBox, Flags); + + EmuSwapFS(); // XBox FS + + return hRet; +} + +// ****************************************************************** +// * func: EmuIDirect3DCubeTexture8_LockRect +// ****************************************************************** +HRESULT WINAPI XTL::EmuIDirect3DCubeTexture8_LockRect +( + X_D3DCubeTexture *pThis, + D3DCUBEMAP_FACES FaceType, + UINT Level, + D3DLOCKED_RECT *pLockedBox, + CONST RECT *pRect, + DWORD Flags +) +{ + EmuSwapFS(); // Win2k/XP FS + + // ****************************************************************** + // * debug trace + // ****************************************************************** + #ifdef _DEBUG_TRACE + { + printf("EmuD3D8 (0x%X): EmuIDirect3DCubeTexture8_LockRect\n" + "(\n" + " pThis : 0x%.08X\n" + " FaceType : 0x%.08X\n" + " Level : 0x%.08X\n" + " pLockedBox : 0x%.08X\n" + " pRect : 0x%.08X\n" + " Flags : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), pThis, FaceType, Level, pLockedBox, pRect, Flags); + } + #endif + + EmuVerifyResourceIsRegistered(pThis); + + IDirect3DCubeTexture8 *pCubeTexture8 = pThis->EmuCubeTexture8; + + HRESULT hRet = pCubeTexture8->LockRect(FaceType, Level, pLockedBox, pRect, Flags); + + EmuSwapFS(); // XBox FS + + return hRet; +} + // ****************************************************************** // * func: EmuIDirect3DDevice8_Release // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/EmuKrnl.cpp b/Source/Win32/CxbxKrnl/EmuKrnl.cpp index cae1820d6..b30a54362 100644 --- a/Source/Win32/CxbxKrnl/EmuKrnl.cpp +++ b/Source/Win32/CxbxKrnl/EmuKrnl.cpp @@ -145,6 +145,36 @@ callComplete: using namespace xboxkrnl; +// ****************************************************************** +// * 0x000E ExAllocatePool +// ****************************************************************** +XBSYSAPI EXPORTNUM(14) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePool +( + IN ULONG NumberOfBytes +) +{ + EmuSwapFS(); // Win2k/XP FS + + // ****************************************************************** + // * debug trace + // ****************************************************************** + #ifdef _DEBUG_TRACE + { + printf("EmuKrnl (0x%X): ExAllocatePool\n" + "(\n" + " NumberOfBytes : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), NumberOfBytes); + } + #endif + + PVOID pRet = malloc(NumberOfBytes); + + EmuSwapFS(); // Xbox FS + + return pRet; +} + // ****************************************************************** // * 0x0018 ExQueryNonVolatileSetting // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/HLEDataBase.cpp b/Source/Win32/CxbxKrnl/HLEDataBase.cpp index 3d280c0c5..91da2ef8a 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase.cpp +++ b/Source/Win32/CxbxKrnl/HLEDataBase.cpp @@ -59,6 +59,7 @@ namespace XTL #include "D3D8.1.0.4134.inl" #include "D3D8.1.0.4361.inl" #include "D3D8.1.0.4627.inl" +#include "DSound.1.0.3936.inl" #include "DSound.1.0.4361.inl" #include "DSound.1.0.4627.inl" #include "XG.1.0.4361.inl" @@ -140,6 +141,13 @@ HLEData HLEDataBase[] = D3D8_1_0_4627, D3D8_1_0_4627_SIZE }, + // DSound Version 1.0.3936 + { + "DSOUND", + 1, 0, 3936, + DSound_1_0_3936, + DSound_1_0_3936_SIZE + }, // DSound Version 1.0.4361 { "DSOUND", diff --git a/Source/Win32/CxbxKrnl/KernelThunk.cpp b/Source/Win32/CxbxKrnl/KernelThunk.cpp index 93cbc2b01..5b841fa72 100644 --- a/Source/Win32/CxbxKrnl/KernelThunk.cpp +++ b/Source/Win32/CxbxKrnl/KernelThunk.cpp @@ -79,7 +79,7 @@ extern "C" CXBXKRNL_API uint32 KernelThunkTable[367] = (uint32)PANIC(0x000B), // 0x000B (11) (uint32)PANIC(0x000C), // 0x000C (12) (uint32)PANIC(0x000D), // 0x000D (13) - (uint32)PANIC(0x000E), // 0x000E (14) + (uint32)&xboxkrnl::ExAllocatePool, // 0x000E (14) (uint32)PANIC(0x000F), // 0x000F (15) (uint32)PANIC(0x0010), // 0x0010 (16) (uint32)PANIC(0x0011), // 0x0011 (17) diff --git a/Source/Win32/CxbxKrnl/Xapi.1.0.3911.inl b/Source/Win32/CxbxKrnl/Xapi.1.0.3911.inl index 29a35eb05..3a7d13e46 100644 --- a/Source/Win32/CxbxKrnl/Xapi.1.0.3911.inl +++ b/Source/Win32/CxbxKrnl/Xapi.1.0.3911.inl @@ -32,6 +32,41 @@ // * // ****************************************************************** +// ****************************************************************** +// * XInitDevices +// ****************************************************************** +// * NOTE: We are actually intercepting USBD_Init, because +// * XInitDevices Simply redirects to that function +// ****************************************************************** +SOOVPA<10> XInitDevices_1_0_3911 = +{ + 0, // Large == 0 + 10, // Count == 10 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // XInitDevices+0x03 : push 0xB4 + { 0x03, 0x68 }, // (Offset,Value)-Pair #1 + { 0x04, 0xB4 }, // (Offset,Value)-Pair #2 + + // XInitDevices+0x10 : jmp +0x13 + { 0x10, 0x74 }, // (Offset,Value)-Pair #3 + { 0x11, 0x13 }, // (Offset,Value)-Pair #4 + + // XInitDevices+0x5B : movzx eax, byte ptr [esi+0xA1] + { 0x5B, 0x0F }, // (Offset,Value)-Pair #5 + { 0x5C, 0xB6 }, // (Offset,Value)-Pair #6 + { 0x5D, 0x86 }, // (Offset,Value)-Pair #7 + { 0x5E, 0xA1 }, // (Offset,Value)-Pair #8 + + // XInitDevices+0x8B : retn 8 + { 0x8B, 0xC2 }, // (Offset,Value)-Pair #9 + { 0x8C, 0x08 }, // (Offset,Value)-Pair #10 + } +}; + // ****************************************************************** // * CreateThread // ****************************************************************** @@ -60,6 +95,38 @@ SOOVPA<8> CreateThread_1_0_3911 = } }; +// ****************************************************************** +// * SetThreadPriority +// ****************************************************************** +SOOVPA<10> SetThreadPriority_1_0_3911 = +{ + 0, // Large == 0 + 10, // Count == 10 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // SetThreadPriority+0x0D : push [ebp+0x08] + { 0x0D, 0xFF }, // (Offset,Value)-Pair #1 + { 0x0E, 0x75 }, // (Offset,Value)-Pair #2 + { 0x0F, 0x08 }, // (Offset,Value)-Pair #3 + + // SetThreadPriority+0x18 : jl +0x2C + { 0x18, 0x7C }, // (Offset,Value)-Pair #4 + { 0x19, 0x2C }, // (Offset,Value)-Pair #5 + + // SetThreadPriority+0x22 : push 0x10 + { 0x22, 0x6A }, // (Offset,Value)-Pair #6 + { 0x23, 0x10 }, // (Offset,Value)-Pair #7 + + // SetThreadPriority+0x26 : cmp eax, 0xFFFFFFF1 + { 0x26, 0x83 }, // (Offset,Value)-Pair #8 + { 0x27, 0xF8 }, // (Offset,Value)-Pair #9 + { 0x28, 0xF1 }, // (Offset,Value)-Pair #10 + } +}; + // ****************************************************************** // * XapiInitProcess // ****************************************************************** @@ -127,6 +194,16 @@ SOOVPA<11> XapiBootDash_1_0_3911 = // ****************************************************************** OOVPATable XAPI_1_0_3911[] = { + // XInitDevices + { + (OOVPA*)&XInitDevices_1_0_3911, + + XTL::EmuXInitDevices, + + #ifdef _DEBUG_TRACE + "EmuXInitDevices" + #endif + }, /* Too High Level // CreateThread { @@ -139,6 +216,16 @@ OOVPATable XAPI_1_0_3911[] = #endif }, */ + // SetThreadPriority + { + (OOVPA*)&SetThreadPriority_1_0_3911, + + XTL::EmuSetThreadPriority, + + #ifdef _DEBUG_TRACE + "EmuSetThreadPriority" + #endif + }, //* Too High Level // XapiInitProcess { diff --git a/Source/Win32/CxbxKrnl/Xapi.1.0.4034.inl b/Source/Win32/CxbxKrnl/Xapi.1.0.4034.inl index e684a7a13..89882d7ff 100644 --- a/Source/Win32/CxbxKrnl/Xapi.1.0.4034.inl +++ b/Source/Win32/CxbxKrnl/Xapi.1.0.4034.inl @@ -32,41 +32,6 @@ // * // ****************************************************************** -// ****************************************************************** -// * XInitDevices -// ****************************************************************** -// * NOTE: We are actually intercepting USBD_Init, because -// * XInitDevices Simply redirects to that function -// ****************************************************************** -SOOVPA<10> XInitDevices_1_0_4034 = -{ - 0, // Large == 0 - 10, // Count == 10 - - -1, // XRef Not Saved - 0, // XRef Not Used - - { - // XInitDevices+0x03 : push 0xB4 - { 0x03, 0x68 }, // (Offset,Value)-Pair #1 - { 0x04, 0xB4 }, // (Offset,Value)-Pair #2 - - // XInitDevices+0x10 : jmp +0x13 - { 0x10, 0x74 }, // (Offset,Value)-Pair #3 - { 0x11, 0x13 }, // (Offset,Value)-Pair #4 - - // XInitDevices+0x5B : movzx eax, byte ptr [esi+0xA1] - { 0x5B, 0x0F }, // (Offset,Value)-Pair #5 - { 0x5C, 0xB6 }, // (Offset,Value)-Pair #6 - { 0x5D, 0x86 }, // (Offset,Value)-Pair #7 - { 0x5E, 0xA1 }, // (Offset,Value)-Pair #8 - - // XInitDevices+0x8B : retn 8 - { 0x8B, 0xC2 }, // (Offset,Value)-Pair #9 - { 0x8C, 0x08 }, // (Offset,Value)-Pair #10 - } -}; - // ****************************************************************** // * XGetDevices // ****************************************************************** @@ -274,9 +239,9 @@ SOOVPA<7> XapiInitProcess_1_0_4361 = // ****************************************************************** OOVPATable XAPI_1_0_4034[] = { - // XInitDevices + // XInitDevices (* unchanged since 3911 *) { - (OOVPA*)&XInitDevices_1_0_4034, + (OOVPA*)&XInitDevices_1_0_3911, XTL::EmuXInitDevices, diff --git a/Source/Win32/CxbxKrnl/Xapi.1.0.4134.inl b/Source/Win32/CxbxKrnl/Xapi.1.0.4134.inl index 81f10dd31..9c27e1f44 100644 --- a/Source/Win32/CxbxKrnl/Xapi.1.0.4134.inl +++ b/Source/Win32/CxbxKrnl/Xapi.1.0.4134.inl @@ -32,38 +32,6 @@ // * // ****************************************************************** -// ****************************************************************** -// * SetThreadPriority -// ****************************************************************** -SOOVPA<10> SetThreadPriority_1_0_4134 = -{ - 0, // Large == 0 - 10, // Count == 10 - - -1, // XRef Not Saved - 0, // XRef Not Used - - { - // SetThreadPriority+0x0D : push [ebp+0x08] - { 0x0D, 0xFF }, // (Offset,Value)-Pair #1 - { 0x0E, 0x75 }, // (Offset,Value)-Pair #2 - { 0x0F, 0x08 }, // (Offset,Value)-Pair #3 - - // SetThreadPriority+0x18 : jl +0x2C - { 0x18, 0x7C }, // (Offset,Value)-Pair #4 - { 0x19, 0x2C }, // (Offset,Value)-Pair #5 - - // SetThreadPriority+0x22 : push 0x10 - { 0x22, 0x6A }, // (Offset,Value)-Pair #6 - { 0x23, 0x10 }, // (Offset,Value)-Pair #7 - - // SetThreadPriority+0x26 : cmp eax, 0xFFFFFFF1 - { 0x26, 0x83 }, // (Offset,Value)-Pair #8 - { 0x27, 0xF8 }, // (Offset,Value)-Pair #9 - { 0x28, 0xF1 }, // (Offset,Value)-Pair #10 - } -}; - // ****************************************************************** // * GetExitCodeThread // ****************************************************************** @@ -280,9 +248,9 @@ SOOVPA<10> XMountUtilityDrive_1_0_4134 = // ****************************************************************** OOVPATable XAPI_1_0_4134[] = { - // XInitDevices (* unchanged since 4034 *) + // XInitDevices (* unchanged since 3911 *) { - (OOVPA*)&XInitDevices_1_0_4034, + (OOVPA*)&XInitDevices_1_0_3911, XTL::EmuXInitDevices, @@ -302,9 +270,9 @@ OOVPATable XAPI_1_0_4134[] = #endif }, //*/ - // SetThreadPriority + // SetThreadPriority (* unchanged since 3911 *) { - (OOVPA*)&SetThreadPriority_1_0_4134, + (OOVPA*)&SetThreadPriority_1_0_3911, XTL::EmuSetThreadPriority, diff --git a/Source/Win32/CxbxKrnl/Xapi.1.0.4361.inl b/Source/Win32/CxbxKrnl/Xapi.1.0.4361.inl index cb16eadd1..e2764c559 100644 --- a/Source/Win32/CxbxKrnl/Xapi.1.0.4361.inl +++ b/Source/Win32/CxbxKrnl/Xapi.1.0.4361.inl @@ -666,9 +666,9 @@ OOVPATable XAPI_1_0_4361[] = "EmuQueryPerformanceFrequency" #endif }, - // XInitDevices (* unchanged since 1.0.4034 *) + // XInitDevices (* unchanged since 1.0.3911 *) { - (OOVPA*)&XInitDevices_1_0_4034, + (OOVPA*)&XInitDevices_1_0_3911, XTL::EmuXInitDevices, diff --git a/Source/Win32/CxbxKrnl/Xapi.1.0.4627.inl b/Source/Win32/CxbxKrnl/Xapi.1.0.4627.inl index 17ec8df5a..4c0c8cad2 100644 --- a/Source/Win32/CxbxKrnl/Xapi.1.0.4627.inl +++ b/Source/Win32/CxbxKrnl/Xapi.1.0.4627.inl @@ -181,9 +181,9 @@ OOVPATable XAPI_1_0_4627[] = "EmuXapiUnknownBad1" #endif }, - // XInitDevices (* unchanged since 1.0.4034 *) + // XInitDevices (* unchanged since 1.0.3911 *) { - (OOVPA*)&XInitDevices_1_0_4034, + (OOVPA*)&XInitDevices_1_0_3911, XTL::EmuXInitDevices,