From 10c02495a8e859e6932ea347a54534d46620c546 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Wed, 4 Feb 2004 10:05:13 +0000 Subject: [PATCH] some 4432 --- Cxbx.opt | Bin 68096 -> 67072 bytes Include/Win32/CxbxKrnl/EmuD3D8.h | 16 +++ Source/Win32/CxbxKrnl/EmuD3D8.cpp | 56 ++++++++ .../CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl | 2 +- .../CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl | 134 ++++++++++++++++++ 5 files changed, 207 insertions(+), 1 deletion(-) diff --git a/Cxbx.opt b/Cxbx.opt index 1c8d82ff85531b86bb876e7c63d93bb0b8298d3a..1bf3f8d13c446b08b6dfc025b7c835792ac77e10 100644 GIT binary patch delta 797 zcmZpe!qU*gG9iGmd}H8kCdRVKy3G1K|Nj5~AIZSL5Cz1OGni$-0?9y53P@lAR3I0~ z$pZ=OV3rX9X#wHCKwJqFtO7~AU~Xk?IXs>1_2wd$QU@tk8(04zJ5kq)lGLKS#2f{e z)PmH!l+?WB%*~9hhQgC4L~u^#h|rsy8lla~l3bCLI(epxAAVi`g*N4IiA+x3CdkU+ zT#-~USs_Pca_Tmf%@GZ27$+~x)tvmIZTjRnO)8T+TT~{WX;zwipox95a;wth1q(GM zziiT+yuVcqD5g0%V6OUP{e|q4=g)DSyt-KtD9<*zVS&=*$|mK__3e#3n-{RHWD?L~ zX=Gv&U|^_VWM+8byMk%+M79silV(&hN=&YrQNxB+5N0c*Scf_V`GiYJirc*RA zcG5kz&9e7um?tZ=C{E@91~ciwFzHhXTLmzcF^Ei_$mX^A$R`Iz#($dyzr1IhSim#s Q8ynLqrp@yAswlAn01EC$rvLx| delta 1212 zcmZqZVQHAcG9iGma%13aCdP`%y3G1K5ey6rkwEFQiVcVW=?7`tBtFFkR4oL zGo!1aFe^)PMN;Zy>xf8B4j`){yC^Sb@=O;${QCY2ZOY*iv5atvP|#Hf_w+M1QgCr~ z3U%iIS*Dj#T)@b{!QdQFl%JKFTq5L*p>DHt!$HQ$N9U?d)@#mKsq0+FC3`%e6t2v?)6-~$!F%uL+$7Rn}2YQ8qkcw%^V9Fc?7nwHZm~-!;s^E zJV(F**-8&no-FpGr4L;6=T%ouQTcyQznCJ5tt$-CvFnn%yz4Wd2&aKHazjsK1L_K pD`Bew+Rq>|c_N$F<|FSM7+ITu+~&=UAHFkA`ozW}!!dBK0|2mO`7Hnd diff --git a/Include/Win32/CxbxKrnl/EmuD3D8.h b/Include/Win32/CxbxKrnl/EmuD3D8.h index 0f166d13f..88d76d0ea 100644 --- a/Include/Win32/CxbxKrnl/EmuD3D8.h +++ b/Include/Win32/CxbxKrnl/EmuD3D8.h @@ -749,6 +749,14 @@ VOID WINAPI EmuIDirect3DDevice8_SetTextureState_TexCoordIndex DWORD Value ); +// ****************************************************************** +// * func: EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting +// ****************************************************************** +VOID WINAPI EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting +( + DWORD Value +); + // ****************************************************************** // * func: EmuIDirect3DDevice8_SetTextureState_BackFillMode // ****************************************************************** @@ -873,6 +881,14 @@ VOID WINAPI EmuIDirect3DDevice8_SetRenderState_CullMode DWORD Value ); +// ****************************************************************** +// * func: EmuIDirect3DDevice8_SetRenderState_StencilFail +// ****************************************************************** +VOID WINAPI EmuIDirect3DDevice8_SetRenderState_StencilFail +( + DWORD Value +); + // ****************************************************************** // * func: EmuIDirect3DDevice8_SetRenderState_ZEnable // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/EmuD3D8.cpp b/Source/Win32/CxbxKrnl/EmuD3D8.cpp index 8606750d8..61d4772d8 100644 --- a/Source/Win32/CxbxKrnl/EmuD3D8.cpp +++ b/Source/Win32/CxbxKrnl/EmuD3D8.cpp @@ -4868,6 +4868,34 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_SetTextureState_TexCoordIndex return; } +// ****************************************************************** +// * func: EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting +// ****************************************************************** +VOID WINAPI XTL::EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting +( + DWORD Value +) +{ + EmuSwapFS(); // Win2k/XP FS + + // debug trace + #ifdef _DEBUG_TRACE + { + printf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting\n" + "(\n" + " Value : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), Value); + } + #endif + + EmuWarning("TwoSidedLighting is not supported!"); + + EmuSwapFS(); // XBox FS + + return; +} + // ****************************************************************** // * func: EmuIDirect3DDevice8_SetTextureState_BackFillMode // ****************************************************************** @@ -5408,6 +5436,34 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_SetRenderState_CullMode return; } +// ****************************************************************** +// * func: EmuIDirect3DDevice8_SetRenderState_StencilFail +// ****************************************************************** +VOID WINAPI XTL::EmuIDirect3DDevice8_SetRenderState_StencilFail +( + DWORD Value +) +{ + EmuSwapFS(); // Win2k/XP FS + + // debug trace + #ifdef _DEBUG_TRACE + { + printf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetRenderState_StencilFail\n" + "(\n" + " Value : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), Value); + } + #endif + + g_pD3DDevice8->SetRenderState(D3DRS_STENCILFAIL, Value); + + EmuSwapFS(); // XBox FS + + return; +} + // ****************************************************************** // * func: EmuIDirect3DDevice8_SetRenderState_ZEnable // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl b/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl index 4773be5cf..1a9ceb0ca 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl +++ b/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl @@ -1103,7 +1103,7 @@ SOOVPA<13> IDirect3DDevice8_SetRenderState_ZEnable_1_0_4361 = { 0x1D, 0x74 }, // (Offset,Value)-Pair #5 { 0x1E, 0x20 }, // (Offset,Value)-Pair #6 - // IDirect3DDevice8_SetRenderState_ZEnable+0x31 : mov dword ptr [eax], 0x4030 + // IDirect3DDevice8_SetRenderState_ZEnable+0x31 : mov dword ptr [eax], 0x4030C { 0x31, 0xC7 }, // (Offset,Value)-Pair #7 { 0x32, 0x00 }, // (Offset,Value)-Pair #8 { 0x33, 0x0C }, // (Offset,Value)-Pair #9 diff --git a/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl b/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl index e97bbd804..127b8f24b 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl +++ b/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl @@ -202,6 +202,41 @@ SOOVPA<12> IDirect3DDevice8_SetTextureState_BumpEnv_1_0_4432 = } }; +// ****************************************************************** +// * IDirect3DDevice8_SetTextureState_TwoSidedLighting +// ****************************************************************** +SOOVPA<13> IDirect3DDevice8_SetTextureState_TwoSidedLighting_1_0_4432 = +{ + 0, // Large == 0 + 13, // Count == 13 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_SetTextureState_TwoSidedLighting+0x11 : or edx, 0x1000 + { 0x11, 0x81 }, // (Offset,Value)-Pair #1 + { 0x12, 0xCA }, // (Offset,Value)-Pair #2 + { 0x13, 0x00 }, // (Offset,Value)-Pair #3 + { 0x14, 0x10 }, // (Offset,Value)-Pair #4 + + // IDirect3DDevice8_SetTextureState_TwoSidedLighting+0x24 : cmp eax, [esi+4]; push edi + { 0x24, 0x3B }, // (Offset,Value)-Pair #5 + { 0x25, 0x46 }, // (Offset,Value)-Pair #6 + { 0x26, 0x04 }, // (Offset,Value)-Pair #7 + { 0x27, 0x57 }, // (Offset,Value)-Pair #8 + + // IDirect3DDevice8_SetTextureState_TwoSidedLighting+0x53 : add eax, 0x0C + { 0x53, 0x83 }, // (Offset,Value)-Pair #9 + { 0x54, 0xC0 }, // (Offset,Value)-Pair #10 + { 0x55, 0x0C }, // (Offset,Value)-Pair #11 + + // IDirect3DDevice8_SetTextureState_TwoSidedLighting+0x60 : retn 0x04 + { 0x60, 0xC2 }, // (Offset,Value)-Pair #12 + { 0x61, 0x04 }, // (Offset,Value)-Pair #13 + } +}; + // ****************************************************************** // * IDirect3DDevice8_SetTextureState_BackFillMode // ****************************************************************** @@ -302,6 +337,75 @@ SOOVPA<8> IDirect3DDevice8_SetRenderState_NormalizeNormals_1_0_4432 = } }; +// ****************************************************************** +// * IDirect3DDevice8_SetRenderState_ZEnable +// ****************************************************************** +SOOVPA<13> IDirect3DDevice8_SetRenderState_ZEnable_1_0_4432 = +{ + 0, // Large == 0 + 13, // Count == 13 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_SetRenderState_ZEnable+0x0C : jb +0x05 + { 0x0C, 0x72 }, // (Offset,Value)-Pair #1 + { 0x0D, 0x05 }, // (Offset,Value)-Pair #2 + + // IDirect3DDevice8_SetRenderState_ZEnable+0x1B : mov ecx, [esi+0x2074] + { 0x1B, 0x8B }, // (Offset,Value)-Pair #3 + { 0x1C, 0x8E }, // (Offset,Value)-Pair #4 + { 0x1D, 0x74 }, // (Offset,Value)-Pair #5 + { 0x1E, 0x20 }, // (Offset,Value)-Pair #6 + + // IDirect3DDevice8_SetRenderState_ZEnable+0x2E : mov dword ptr [eax], 0x4030C + { 0x2E, 0xC7 }, // (Offset,Value)-Pair #7 + { 0x2F, 0x00 }, // (Offset,Value)-Pair #8 + { 0x30, 0x0C }, // (Offset,Value)-Pair #9 + { 0x31, 0x03 }, // (Offset,Value)-Pair #10 + { 0x32, 0x04 }, // (Offset,Value)-Pair #11 + + // IDirect3DDevice8_SetRenderState_ZEnable+0x8C : retn 0x04 + { 0x8C, 0xC2 }, // (Offset,Value)-Pair #12 + { 0x8D, 0x04 }, // (Offset,Value)-Pair #13 + } +}; + +// ****************************************************************** +// * IDirect3DDevice8_SetRenderState_StencilFail +// ****************************************************************** +SOOVPA<12> IDirect3DDevice8_SetRenderState_StencilFail_1_0_4432 = +{ + 0, // Large == 0 + 12, // Count == 12 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_SetRenderState_StencilFail+0x0C : jb +0x05 + { 0x0C, 0x72 }, // (Offset,Value)-Pair #1 + { 0x0D, 0x05 }, // (Offset,Value)-Pair #2 + + // IDirect3DDevice8_SetRenderState_StencilFail+0x38 : cmp [abs], 0x1E00 + { 0x38, 0x81 }, // (Offset,Value)-Pair #3 + { 0x3E, 0x00 }, // (Offset,Value)-Pair #4 + { 0x3F, 0x1E }, // (Offset,Value)-Pair #5 + + // IDirect3DDevice8_SetRenderState_StencilFail+0x47 : mov dword ptr [eax], 0x41D84 + { 0x47, 0xC7 }, // (Offset,Value)-Pair #6 + { 0x48, 0x00 }, // (Offset,Value)-Pair #7 + { 0x49, 0x84 }, // (Offset,Value)-Pair #8 + { 0x4A, 0x1D }, // (Offset,Value)-Pair #9 + { 0x4B, 0x04 }, // (Offset,Value)-Pair #10 + + // IDirect3DDevice8_SetRenderState_StencilFail+0x6A : retn 0x04 + { 0x6A, 0xC2 }, // (Offset,Value)-Pair #11 + { 0x6B, 0x04 }, // (Offset,Value)-Pair #12 + } +}; + // ****************************************************************** // * IDirect3DDevice8_SetRenderState_ShadowFunc // ****************************************************************** @@ -481,6 +585,16 @@ OOVPATable D3D8_1_0_4432[] = "EmuIDirect3DDevice8_SetTextureState_BumpEnv" #endif }, + // IDirect3DDevice8::SetTextureState_TwoSidedLighting + { + (OOVPA*)&IDirect3DDevice8_SetTextureState_TwoSidedLighting_1_0_4432, + + XTL::EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetTextureState_TwoSidedLighting" + #endif + }, // IDirect3DDevice8::SetTextureState_BackFillMode { (OOVPA*)&IDirect3DDevice8_SetTextureState_BackFillMode_1_0_4432, @@ -601,6 +715,26 @@ OOVPATable D3D8_1_0_4432[] = "EmuIDirect3DDevice8_SetRenderState_StencilEnable" #endif }, + // IDirect3DDevice8::SetRenderState_StencilFail + { + (OOVPA*)&IDirect3DDevice8_SetRenderState_StencilFail_1_0_4432, + + XTL::EmuIDirect3DDevice8_SetRenderState_StencilFail, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetRenderState_StencilFail" + #endif + }, + // IDirect3DDevice8::SetRenderState_ZEnable + { + (OOVPA*)&IDirect3DDevice8_SetRenderState_ZEnable_1_0_4432, + + XTL::EmuIDirect3DDevice8_SetRenderState_ZEnable, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetRenderState_ZEnable" + #endif + }, // IDirect3DDevice8::SetRenderState_ShadowFunc { (OOVPA*)&IDirect3DDevice8_SetRenderState_ShadowFunc_1_0_4432,