turok4627

This commit is contained in:
Aaron Robinson 2004-01-22 05:52:31 +00:00
parent 55ef8a8869
commit 1beb8aed45
15 changed files with 239 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# Microsoft Developer Studio Project File - Name="Cxbx" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# Microsoft Developer Studio Generated Build File, Format Version 60000
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101

BIN
Cxbx.opt

Binary file not shown.

View File

@ -65,6 +65,7 @@ typedef DWORD X_D3DBLEND;
typedef DWORD X_D3DCMPFUNC;
typedef DWORD X_D3DFILLMODE;
typedef DWORD X_D3DPRIMITIVETYPE;
typedef DWORD X_D3DTEXTURESTAGESTATETYPE;
// NOTE: HACK: These enumerations are not equivalent when > 7!
typedef D3DRESOURCETYPE X_D3DRESOURCETYPE;
@ -1046,6 +1047,16 @@ VOID WINAPI EmuIDirect3DDevice8_SetTextureState_BorderColor
DWORD Value
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetTextureState_BumpEnv
// ******************************************************************
VOID WINAPI EmuIDirect3DDevice8_SetTextureState_BumpEnv
(
DWORD Stage,
X_D3DTEXTURESTAGESTATETYPE Type,
DWORD Value
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetRenderState_NormalizeNormals
// ******************************************************************

View File

@ -515,6 +515,7 @@ VOID WINAPI EmuXRegisterThreadNotifyRoutine
);
// s+
/* not necessary?
// ******************************************************************
// * func: EmuXCalculateSignatureBegin
// ******************************************************************
@ -550,6 +551,7 @@ DWORD WINAPI EmuXCalculateSignatureEnd
HANDLE hCalcSig,
PXCALCSIG_SIGNATURE pSignature
);
*/
// +s
#endif

View File

@ -205,7 +205,9 @@ enum XRefDataBaseOffset
XREF_DSBUFFERSETDOPPLERFACTOR,
XREF_DSBUFFERSETI3DL2SOURCE,
// XAPI
/* not necessary?
XREF_XAPIXCALCULATESIGNATUREBEGINEX
*/
// +s
};

View File

@ -4796,6 +4796,55 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_SetTextureState_BorderColor
return;
}
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetTextureState_BumpEnv
// ******************************************************************
VOID WINAPI XTL::EmuIDirect3DDevice8_SetTextureState_BumpEnv
(
DWORD Stage,
X_D3DTEXTURESTAGESTATETYPE Type,
DWORD Value
)
{
EmuSwapFS(); // Win2k/XP FS
// debug trace
#ifdef _DEBUG_TRACE
{
printf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetTextureState_BumpEnv\n"
"(\n"
" Stage : 0x%.08X\n"
" Type : 0x%.08X\n"
" Value : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Stage, Type, Value);
}
#endif
switch(Type)
{
case 22: // X_D3DTSS_BUMPENVMAT00
g_pD3DDevice8->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT00, Value);
break;
case 23: // X_D3DTSS_BUMPENVMAT01
g_pD3DDevice8->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT01, Value);
break;
case 24: // X_D3DTSS_BUMPENVMAT11
g_pD3DDevice8->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT11, Value);
break;
case 25: // X_D3DTSS_BUMPENVMAT10
g_pD3DDevice8->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT10, Value);
break;
case 26: // X_D3DTSS_BUMPENVLSCALE
g_pD3DDevice8->SetTextureStageState(Stage, D3DTSS_BUMPENVLSCALE, Value);
break;
}
EmuSwapFS(); // XBox FS
return;
}
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetRenderState_NormalizeNormals
// ******************************************************************

View File

@ -848,6 +848,13 @@ HRESULT WINAPI XTL::EmuDirectSoundCreateBuffer
pDSBufferDesc->guid3DAlgorithm = DS3DALG_DEFAULT;
}
// sanity check
if(pDSBufferDesc->lpwfxFormat->nBlockAlign != (pDSBufferDesc->lpwfxFormat->nChannels*pDSBufferDesc->lpwfxFormat->wBitsPerSample)/8)
{
pDSBufferDesc->lpwfxFormat->nBlockAlign = (2*pDSBufferDesc->lpwfxFormat->wBitsPerSample)/8;
pDSBufferDesc->lpwfxFormat->nAvgBytesPerSec = pDSBufferDesc->lpwfxFormat->nSamplesPerSec * pDSBufferDesc->lpwfxFormat->nBlockAlign;
}
// TODO: Garbage Collection
*ppBuffer = new X_CDirectSoundBuffer();

View File

@ -2634,7 +2634,7 @@ XBSYSAPI EXPORTNUM(308) xboxkrnl::NTSTATUS NTAPI xboxkrnl::RtlUnicodeStringToAns
}
// ******************************************************************
// * 0x0141 - XboxHardwareInfo
// * 0x0142 - XboxHardwareInfo
// ******************************************************************
XBSYSAPI EXPORTNUM(322) XBOX_HARDWARE_INFO xboxkrnl::XboxHardwareInfo =
{
@ -2642,6 +2642,17 @@ XBSYSAPI EXPORTNUM(322) XBOX_HARDWARE_INFO xboxkrnl::XboxHardwareInfo =
0,0,0,0
};
// ******************************************************************
// * 0x0143 - XboxHDKey
// ******************************************************************
XBSYSAPI EXPORTNUM(323) xboxkrnl::UCHAR xboxkrnl::XboxHDKey[16] =
{
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
// ******************************************************************
// * XboxSignatureKey
// ******************************************************************

View File

@ -960,6 +960,7 @@ VOID WINAPI XTL::EmuXRegisterThreadNotifyRoutine
EmuSwapFS(); // XBox FS
}
/* not necessary?
// ******************************************************************
// * func: EmuXCalculateSignatureBegin
// ******************************************************************
@ -1081,3 +1082,4 @@ DWORD WINAPI XTL::EmuXCalculateSignatureEnd
return ERROR_SUCCESS;
}
*/

View File

@ -314,7 +314,9 @@ extern uint32 XRefDataBase[] =
-1, // XREF_DSBUFFERSETVELOCITY
-1, // XREF_DSBUFFERSETDOPPLERFACTOR
-1, // XREF_DSBUFFERSETI3DL2SOURCE
/* not necessary?
-1, //XREF_XAPIXCALCULATESIGNATUREBEGINEX
*/
// +s
};

View File

@ -1165,6 +1165,40 @@ SOOVPA<10> IDirect3DDevice8_SetTextureState_TexCoordIndex_1_0_4627 =
}
};
// ******************************************************************
// * IDirect3DDevice8_SetTextureState_BumpEnv
// ******************************************************************
SOOVPA<12> IDirect3DDevice8_SetTextureState_BumpEnv_1_0_4627 =
{
0, // Large == 0
12, // Count == 12
-1, // XRef Not Saved
0, // XRef Not Used
{
// IDirect3DDevice8_SetTextureState_BumpEnv+0x18 : jnz +0x03
{ 0x18, 0x75 }, // (Offset,Value)-Pair #1
{ 0x19, 0x03 }, // (Offset,Value)-Pair #2
// IDirect3DDevice8_SetTextureState_BumpEnv+0x1D : test bl, 3
{ 0x1D, 0xF6 }, // (Offset,Value)-Pair #3
{ 0x1E, 0xC3 }, // (Offset,Value)-Pair #4
{ 0x1F, 0x03 }, // (Offset,Value)-Pair #5
// IDirect3DDevice8_SetTextureState_BumpEnv+0x32 : mov ecx, [esp+0x14]
{ 0x32, 0x8B }, // (Offset,Value)-Pair #6
{ 0x33, 0x4C }, // (Offset,Value)-Pair #7
{ 0x34, 0x24 }, // (Offset,Value)-Pair #8
{ 0x35, 0x18 }, // (Offset,Value)-Pair #9
// IDirect3DDevice8_SetTextureState_BumpEnv+0x50 : shl esi, 5
{ 0x50, 0xC1 }, // (Offset,Value)-Pair #10
{ 0x51, 0xE6 }, // (Offset,Value)-Pair #11
{ 0x52, 0x05 }, // (Offset,Value)-Pair #12
}
};
// ******************************************************************
// * IDirect3DDevice8_SetTextureState_BorderColor
// ******************************************************************
@ -2114,6 +2148,16 @@ OOVPATable D3D8_1_0_4627[] =
"EmuIDirect3DDevice8_SetTextureState_TexCoordIndex"
#endif
},
// IDirect3DDevice8::SetTextureState_BumpEnv
{
(OOVPA*)&IDirect3DDevice8_SetTextureState_BumpEnv_1_0_4627,
XTL::EmuIDirect3DDevice8_SetTextureState_BumpEnv,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_SetTextureState_BumpEnv"
#endif
},
// IDirect3DDevice8::SetTextureState_BorderColor
{
(OOVPA*)&IDirect3DDevice8_SetTextureState_BorderColor_1_0_4627,

View File

@ -479,6 +479,37 @@ SOOVPA<12> IDirectSoundBuffer8_SetMixBinVolumes_1_0_4627 =
}
};
// ******************************************************************
// * CDirectSound::SetPositionA
// ******************************************************************
SOOVPA<11> CDirectSound_SetPositionA_1_0_4627 =
{
0, // Large == 0
11, // Count == 11
XREF_DSSETPOSITIONA, // XRef Is Saved
0, // XRef Not Used
{
// CDirectSound_SetPositionA+0x2B : mov ecx, [ebp+0x08]
{ 0x2B, 0x8B }, // (Offset,Value)-Pair #1
{ 0x2C, 0x4D }, // (Offset,Value)-Pair #2
{ 0x2D, 0x08 }, // (Offset,Value)-Pair #3
// CDirectSound_SetPositionA+0x3F : mov [edx+0x3C], edi
{ 0x3F, 0x89 }, // (Offset,Value)-Pair #4
{ 0x40, 0x7A }, // (Offset,Value)-Pair #5
{ 0x41, 0x3C }, // (Offset,Value)-Pair #6
// CDirectSound_SetPositionA+0x4C : or word ptr [eax+0xA4], 0x01FF
{ 0x4C, 0x66 }, // (Offset,Value)-Pair #7
{ 0x4D, 0x81 }, // (Offset,Value)-Pair #8
{ 0x4E, 0x88 }, // (Offset,Value)-Pair #9
{ 0x4F, 0xA4 }, // (Offset,Value)-Pair #10
{ 0x53, 0xFF }, // (Offset,Value)-Pair #11
}
};
// ******************************************************************
// * DirectSoundCreateBuffer
// ******************************************************************
@ -765,6 +796,39 @@ SOOVPA<11> CDirectSoundStream_SetVolume_1_0_4361 =
}
};
// ******************************************************************
// * IDirectSoundBuffer8_LockA
// ******************************************************************
SOOVPA<13> IDirectSoundBuffer8_LockA_1_0_4627 =
{
0, // Large == 0
13,// Count == 10
XREF_DSBUFFERLOCKA, // XRef Is Saved
0, // XRef Not Used
{
// IDirectSoundBuffer8_LockA+0x37 : test [ebp+0x24], 1
{ 0x37, 0xF6 }, // (Offset,Value)-Pair #1
{ 0x38, 0x45 }, // (Offset,Value)-Pair #2
{ 0x39, 0x24 }, // (Offset,Value)-Pair #3
{ 0x3A, 0x01 }, // (Offset,Value)-Pair #4
// IDirectSoundBuffer8_LockA+0x5C : mov eax, [eax+0xBC]
{ 0x5C, 0x8B }, // (Offset,Value)-Pair #5
{ 0x5D, 0x80 }, // (Offset,Value)-Pair #6
{ 0x5E, 0xBC }, // (Offset,Value)-Pair #7
{ 0x5F, 0x00 }, // (Offset,Value)-Pair #8
// IDirectSoundBuffer8_LockA+0xA4 : jnb +0x11; mov esi, [esi+0x1C]
{ 0xA2, 0x73 }, // (Offset,Value)-Pair #9
{ 0xA3, 0x11 }, // (Offset,Value)-Pair #10
{ 0xA4, 0x8B }, // (Offset,Value)-Pair #11
{ 0xA5, 0x76 }, // (Offset,Value)-Pair #12
{ 0xA6, 0x1C }, // (Offset,Value)-Pair #13
}
};
// ******************************************************************
// * CMcpxBuffer_GetStatus
// ******************************************************************
@ -2287,6 +2351,24 @@ OOVPATable DSound_1_0_4627[] =
"EmuIDirectSoundBuffer8_SetMixBinVolumes"
#endif
},
// CDirectSound::SetPositionA (XREF)
{
(OOVPA*)&CDirectSound_SetPositionA_1_0_4627, 0,
#ifdef _DEBUG_TRACE
"CDirectSound_SetPositionA (XRef)"
#endif
},
// IDirectSound8::SetPosition
{
(OOVPA*)&IDirectSound8_SetPosition_1_0_3936,
XTL::EmuIDirectSound8_SetPosition,
#ifdef _DEBUG_TRACE
"EmuIDirectSound8_SetPosition"
#endif
},
// DirectSoundCreateBuffer
{
(OOVPA*)&DirectSoundCreateBuffer_1_0_4627,
@ -2361,6 +2443,24 @@ OOVPATable DSound_1_0_4627[] =
"EmuCDirectSoundStream_SetVolume"
#endif
},
// IDirectSoundBuffer8::LockA (XREF)
{
(OOVPA*)&IDirectSoundBuffer8_LockA_1_0_4627, 0,
#ifdef _DEBUG_TRACE
"IDirectSoundBuffer8_LockA (XRef)"
#endif
},
// IDirectSoundBuffer8::Lock
{
(OOVPA*)&IDirectSoundBuffer8_Lock_1_0_3936,
XTL::EmuIDirectSoundBuffer8_Lock,
#ifdef _DEBUG_TRACE
"EmuIDirectSoundBuffer8_Lock"
#endif
},
// CDirectSound_CreateSoundStream (* unchanged since 4361 *)
{
(OOVPA*)&CDirectSound_CreateSoundStream_1_0_4361, 0,

View File

@ -390,7 +390,7 @@ SOOVPA<11> XRegisterThreadNotifyRoutine_1_0_3911 =
{ 0x47, 0x08 }, // (Offset,Value)-Pair #11
}
};
/* not necessary?
// ******************************************************************
// * XCalculateSignatureBegin
// ******************************************************************
@ -422,6 +422,7 @@ SOOVPA<10> XCalculateSignatureBegin_1_0_3911 =
{ 0x3C, 0x04 }, // (Offset,Value)-Pair #10
}
};
*/
// ******************************************************************
// * XGetDeviceChanges

View File

@ -127,6 +127,7 @@ SOOVPA<8> XMountUtilityDrive_1_0_4627 =
};
// s+
/* not necessary?
// ******************************************************************
// * XCalculateSignatureBeginEx
// ******************************************************************
@ -245,6 +246,7 @@ SOOVPA<8> XCalculateSignatureEnd_1_0_4627 =
{ 0x39, 0xEC },
}
};
*/
// +s
// ******************************************************************
@ -395,6 +397,7 @@ OOVPATable XAPI_1_0_4627[] =
#endif
},
// +s
/* not necessary?
// XCalculateSignatureBeginEx
{
(OOVPA*)&XCalculateSignatureBeginEx_1_0_4627,
@ -435,6 +438,7 @@ OOVPATable XAPI_1_0_4627[] =
"EmuXCalculateSignatureEnd"
#endif
},
*/
// s+
};

View File

@ -380,7 +380,7 @@ extern "C" CXBXKRNL_API uint32 KernelThunkTable[367] =
(uint32)PANIC(0x0140), // 0x0140 (320)
(uint32)PANIC(0x0141), // 0x0141 (321)
(uint32)&xboxkrnl::XboxHardwareInfo, // 0x0142 (322)
(uint32)PANIC(0x0143), // 0x0143 (323)
(uint32)&xboxkrnl::XboxHDKey, // 0x0143 (323)
(uint32)PANIC(0x0144), // 0x0144 (324)
(uint32)&xboxkrnl::XboxSignatureKey, // 0x0145 (325)
(uint32)PANIC(0x0146), // 0x0146 (326)