Turok (4627)

This commit is contained in:
Aaron Robinson 2003-12-03 02:30:59 +00:00
parent c139adde4d
commit 3e04a458c4
10 changed files with 150 additions and 55 deletions

BIN
Cxbx.opt

Binary file not shown.

View File

@ -597,6 +597,16 @@ VOID __fastcall EmuIDirect3DDevice8_SetVertexShaderConstant4
CONST PVOID pConstantData
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetVertexShaderConstantNotInline
// ******************************************************************
VOID __fastcall EmuIDirect3DDevice8_SetVertexShaderConstantNotInline
(
INT Register,
CONST PVOID pConstantData,
DWORD ConstantCount
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_CreatePixelShader
// ******************************************************************

View File

@ -310,15 +310,6 @@ SIZE_T WINAPI EmuRtlSizeHeap
IN PVOID lpMem
);
// ******************************************************************
// * func: XapiUnknownBad1
// ******************************************************************
// NOTE: This does some hard disk verification and other things
VOID WINAPI EmuXapiUnknownBad1
(
IN DWORD dwUnknown
);
// ******************************************************************
// * func: EmuQueryPerformanceCounter
// ******************************************************************

View File

@ -169,6 +169,7 @@ enum XRefDataBaseOffset
XREF_DSSTREAMSETROLLOFFFACTOR1A,
XREF_DSSTREAMSETROLLOFFFACTOR1B,
XREF_GET2DSURFACEDESCB,
XREF_COMMONSETRENDERTARGET,
XREF_COMMITDEFERREDSETTINGSA,
XREF_COMMITDEFERREDSETTINGSB
};

View File

@ -421,7 +421,7 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit
XTL::g_pRtlCreateHeap = (XTL::pfRtlCreateHeap)((uint32)pFunc + (uint32)XTL::g_pRtlCreateHeap + 0x37 + 0x04);
printf("EmuMain (0x%X): 0x%.08X -> EmuXapiProcessHeap\n", GetCurrentThreadId(), XTL::EmuXapiProcessHeap);
printf("EmuMain (0x%X): 0x%.08X -> RtlCreateHeap\n", GetCurrentThreadId(), XTL::g_pRtlCreateHeap);
printf("EmuMain (0x%X): 0x%.08X -> g_pRtlCreateHeap\n", GetCurrentThreadId(), XTL::g_pRtlCreateHeap);
}
}
}

View File

@ -1541,7 +1541,7 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetViewport
HRESULT hRet = g_pD3DDevice8->SetViewport(pViewport);
if(FAILED(hRet))
EmuCleanup("Unable to set viewport!");
EmuWarning("Unable to set viewport!");
EmuSwapFS(); // Xbox FS
@ -1910,6 +1910,36 @@ VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstant4
return;
}
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetVertexShaderConstantNotInline
// ******************************************************************
VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstantNotInline
(
INT Register,
CONST PVOID pConstantData,
DWORD ConstantCount
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
EmuSwapFS(); // Win2k/XP FS
printf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexShaderConstantNotInline\n"
"(\n"
" Register : 0x%.08X\n"
" pConstantData : 0x%.08X\n"
" ConstantCount : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Register, pConstantData, ConstantCount);
EmuSwapFS(); // XBox FS
}
#endif
XTL::EmuIDirect3DDevice8_SetVertexShaderConstant(Register - 96, pConstantData, ConstantCount);
return;
}
// ******************************************************************
// * func: EmuIDirect3DDevice8_CreatePixelShader
// ******************************************************************

View File

@ -211,35 +211,6 @@ SIZE_T WINAPI XTL::EmuRtlSizeHeap
return ret;
}
// ******************************************************************
// * func: XapiUnknownBad1
// ******************************************************************
// NOTE: This does some hard disk verification and other things
VOID WINAPI XTL::EmuXapiUnknownBad1
(
IN DWORD dwUnknown
)
{
EmuSwapFS(); // Win2k/XP FS
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
printf("EmuXapi (0x%X): EmuXapiUnknownBad1\n"
"(\n"
" dwUnknown : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwUnknown);
}
#endif
EmuSwapFS(); // XBox FS
return;
}
// ******************************************************************
// * func: EmuQueryPerformanceCounter
// ******************************************************************

View File

@ -280,6 +280,7 @@ extern uint32 XRefDataBase[] =
-1, // XREF_DSSTREAMSETROLLOFFFACTOR1A (Stream)
-1, // XREF_DSSTREAMSETROLLOFFFACTOR1B
-1, // XREF_GET2DSURFACEDESCB
-1, // XREF_COMMONSETRENDERTARGET
-1, // XREF_COMMITDEFERREDSETTINGSA
-1, // XREF_COMMITDEFERREDSETTINGSB
};

View File

@ -192,39 +192,76 @@ SOOVPA<9> IDirect3DDevice8_SetViewport_1_0_4627 =
};
// ******************************************************************
// * IDirect3DDevice8_SetRenderTarget
// * D3D_CommonSetRenderTarget
// ******************************************************************
SOOVPA<12> IDirect3DDevice8_SetRenderTarget_1_0_4627 =
SOOVPA<12> D3D_CommonSetRenderTarget_1_0_4627 =
{
0, // Large == 0
12, // Count == 11
12, // Count == 12
-1, // XRef Not Saved
XREF_COMMONSETRENDERTARGET, // XRef Not Saved
0, // XRef Not Used
{
// IDirect3DDevice8_SetRenderTarget+0x00 : sub esp, 0x20
// D3D_CommonSetRenderTarget+0x00 : sub esp, 0x20
{ 0x00, 0x83 }, // (Offset,Value)-Pair #1
{ 0x01, 0xEC }, // (Offset,Value)-Pair #2
{ 0x02, 0x20 }, // (Offset,Value)-Pair #3
// IDirect3DDevice8_SetRenderTarget+0x86 : jmp +0x06
// D3D_CommonSetRenderTarget+0x86 : jmp +0x06
{ 0x86, 0xEB }, // (Offset,Value)-Pair #4
{ 0x87, 0x06 }, // (Offset,Value)-Pair #5
// IDirect3DDevice8_SetRenderTarget+0x88 : and eax, 0x0FFF
// D3D_CommonSetRenderTarget+0x88 : and eax, 0x0FFF
{ 0x88, 0x25 }, // (Offset,Value)-Pair #6
{ 0x89, 0xFF }, // (Offset,Value)-Pair #7
{ 0x8A, 0x0F }, // (Offset,Value)-Pair #8
{ 0x8B, 0x00 }, // (Offset,Value)-Pair #9
// IDirect3DDevice8_SetRenderTarget+0xC6 : and ecx, 0x0F
// D3D_CommonSetRenderTarget+0xC6 : and ecx, 0x0F
{ 0xC6, 0x83 }, // (Offset,Value)-Pair #10
{ 0xC7, 0xE1 }, // (Offset,Value)-Pair #11
{ 0xC8, 0x0F }, // (Offset,Value)-Pair #12
}
};
// ******************************************************************
// * IDirect3DDevice8_SetRenderTarget
// ******************************************************************
SOOVPA<13> IDirect3DDevice8_SetRenderTarget_1_0_4627 =
{
0, // Large == 0
13, // Count == 13
-1, // XRef Not Saved
1, // XRef Is Used
{
// IDirect3DDevice8_SetRenderTarget+0x10 : call [D3D_CommonSetRenderTarget]
{ 0x10, XREF_COMMONSETRENDERTARGET }, // (Offset,Value)-Pair #1
// IDirect3DDevice8_SetRenderTarget+0x00 : mov eax, [esp+0x08]
{ 0x00, 0x8B }, // (Offset,Value)-Pair #2
{ 0x01, 0x44 }, // (Offset,Value)-Pair #3
{ 0x02, 0x24 }, // (Offset,Value)-Pair #4
{ 0x03, 0x08 }, // (Offset,Value)-Pair #5
// IDirect3DDevice8_SetRenderTarget+0x04 : mov ecx, [esp+0x04]
{ 0x04, 0x8B }, // (Offset,Value)-Pair #6
{ 0x05, 0x4C }, // (Offset,Value)-Pair #7
{ 0x06, 0x24 }, // (Offset,Value)-Pair #8
{ 0x07, 0x04 }, // (Offset,Value)-Pair #9
// IDirect3DDevice8_SetRenderTarget+0x0D : push eax; push ecx
{ 0x0D, 0x50 }, // (Offset,Value)-Pair #10
{ 0x0E, 0x51 }, // (Offset,Value)-Pair #11
// IDirect3DDevice8_SetRenderTarget+0x14 : retn 0x08
{ 0x14, 0xC2 }, // (Offset,Value)-Pair #12
{ 0x15, 0x08 }, // (Offset,Value)-Pair #13
}
};
// ******************************************************************
// * IDirect3DDevice8_SetShaderConstantMode
// ******************************************************************
@ -566,6 +603,42 @@ SOOVPA<12> IDirect3DDevice8_SetVertexShaderConstant4_1_0_4627 =
}
};
// ******************************************************************
// * IDirect3DDevice8_SetVertexShaderConstantNotInline
// ******************************************************************
SOOVPA<12> IDirect3DDevice8_SetVertexShaderConstantNotInline_1_0_4627 =
{
0, // Large == 0
12, // Count == 12
-1, // XRef Not Saved
0, // XRef Not Used
{
// IDirect3DDevice8_SetVertexShaderConstantNotInline+0x02 : test byte ptr ds:[abs], 0x10
{ 0x02, 0xF6 }, // (Offset,Value)-Pair #1
{ 0x07, 0x00 }, // (Offset,Value)-Pair #2
{ 0x08, 0x10 }, // (Offset,Value)-Pair #3
// IDirect3DDevice8_SetVertexShaderConstantNotInline+0x0E : jnz +0x15
{ 0x0E, 0x75 }, // (Offset,Value)-Pair #4
{ 0x0F, 0x15 }, // (Offset,Value)-Pair #5
// IDirect3DDevice8_SetVertexShaderConstantNotInline+0x42 : push esi; push edi; mov edi, eax
{ 0x10, 0x56 }, // (Offset,Value)-Pair #6
{ 0x11, 0x57 }, // (Offset,Value)-Pair #7
{ 0x12, 0x8B }, // (Offset,Value)-Pair #8
{ 0x13, 0xF8 }, // (Offset,Value)-Pair #9
// IDirect3DDevice8_SetVertexShaderConstantNotInline+0x21 : rep movsd
{ 0x21, 0xF3 }, // (Offset,Value)-Pair #10
{ 0x22, 0xA5 }, // (Offset,Value)-Pair #11
// IDirect3DDevice8_SetVertexShaderConstantNotInline+0x28 : call [abs]
{ 0x28, 0xE8 }, // (Offset,Value)-Pair #12
}
};
// ******************************************************************
// * IDirect3DDevice8_SetPixelShader
// ******************************************************************
@ -1527,6 +1600,14 @@ OOVPATable D3D8_1_0_4627[] =
"EmuIDirect3DDevice8_SetViewport"
#endif
},
// D3D_CommonSetRenderTarget
{
(OOVPA*)&D3D_CommonSetRenderTarget_1_0_4627, 0,
#ifdef _DEBUG_TRACE
"D3D_CommonSetRenderTarget"
#endif
},
// IDirect3DDevice8::SetRenderTarget
{
(OOVPA*)&IDirect3DDevice8_SetRenderTarget_1_0_4627,
@ -1627,6 +1708,16 @@ OOVPATable D3D8_1_0_4627[] =
"EmuIDirect3DDevice8_SetVertexShaderConstant4"
#endif
},
// IDirect3DDevice8::SetVertexShaderConstantNotInline
{
(OOVPA*)&IDirect3DDevice8_SetVertexShaderConstantNotInline_1_0_4627,
XTL::EmuIDirect3DDevice8_SetVertexShaderConstantNotInline,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_SetVertexShaderConstantNotInline"
#endif
},
// IDirect3DDevice8::CreatePixelShader (* unchanged since 4361 *)
{
(OOVPA*)&IDirect3DDevice8_CreatePixelShader_1_0_4361,

View File

@ -97,9 +97,9 @@ SOOVPA<11> RtlSizeHeap_1_0_4627 =
};
// ******************************************************************
// * XapiUnknownBad1
// * XMountUtilityDrive
// ******************************************************************
SOOVPA<8> XapiUnknownBad1_1_0_4627 =
SOOVPA<8> XMountUtilityDrive_1_0_4627 =
{
0, // Large == 0
8, // Count == 8
@ -171,14 +171,14 @@ OOVPATable XAPI_1_0_4627[] =
"EmuRtlSizeHeap"
#endif
},
// XapiUnknownBad1
// XMountUtilityDrive
{
(OOVPA*)&XapiUnknownBad1_1_0_4627,
(OOVPA*)&XMountUtilityDrive_1_0_4627,
XTL::EmuXapiUnknownBad1,
XTL::EmuXMountUtilityDrive,
#ifdef _DEBUG_TRACE
"EmuXapiUnknownBad1"
"EmuXMountUtilityDrive"
#endif
},
// XInitDevices (* unchanged since 1.0.3911 *)