396 lines
13 KiB
C++
396 lines
13 KiB
C++
// ******************************************************************
|
|
// *
|
|
// * .,-::::: .,:: .::::::::. .,:: .:
|
|
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
|
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
|
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
|
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
|
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
|
// *
|
|
// * Cxbx->Win32->CxbxKrnl->D3D8.1.0.4627.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 <caustik@caustik.com>
|
|
// *
|
|
// * All rights reserved
|
|
// *
|
|
// ******************************************************************
|
|
|
|
// ******************************************************************
|
|
// * IDirect3D8_CreateDevice
|
|
// ******************************************************************
|
|
SOOVPA<8> IDirect3D8_CreateDevice_1_0_4627 =
|
|
{
|
|
0, // Large == 0
|
|
8, // Count == 8
|
|
|
|
{
|
|
// IDirect3D8_CreateDevice+0x07 : jnz +0x0A
|
|
{ 0x07, 0x75 }, // (Offset,Value)-Pair #1
|
|
{ 0x08, 0x0A }, // (Offset,Value)-Pair #2
|
|
|
|
// IDirect3D8_CreateDevice+0x80 : repe stosd
|
|
{ 0x80, 0xF3 }, // (Offset,Value)-Pair #3
|
|
{ 0x81, 0xAB }, // (Offset,Value)-Pair #4
|
|
|
|
// IDirect3D8_CreateDevice+0x83 : mov eax, esi
|
|
{ 0x83, 0x8B }, // (Offset,Value)-Pair #5
|
|
{ 0x84, 0xC6 }, // (Offset,Value)-Pair #6
|
|
|
|
// IDirect3D8_CreateDevice+0x90 : retn 0x18
|
|
{ 0x90, 0xC2 }, // (Offset,Value)-Pair #7
|
|
{ 0x91, 0x18 }, // (Offset,Value)-Pair #8
|
|
}
|
|
};
|
|
|
|
// ******************************************************************
|
|
// * IDirect3DDevice8_Clear
|
|
// ******************************************************************
|
|
LOOVPA<9> IDirect3DDevice8_Clear_1_0_4627 =
|
|
{
|
|
1, // Large == 1
|
|
9, // Count == 9
|
|
|
|
{
|
|
// IDirect3DDevice8_Clear+0x0000 : sub esp, 38h
|
|
{ 0x0000, 0x83 }, // (Offset,Value)-Pair #1
|
|
{ 0x0001, 0xEC }, // (Offset,Value)-Pair #2
|
|
{ 0x0002, 0x38 }, // (Offset,Value)-Pair #3
|
|
|
|
// IDirect3DDevice8_Clear+0x000B : mov ebx, [ebp+0x21B8]
|
|
{ 0x000B, 0x8B }, // (Offset,Value)-Pair #4
|
|
{ 0x000C, 0x9D }, // (Offset,Value)-Pair #5
|
|
{ 0x000D, 0xB8 }, // (Offset,Value)-Pair #6
|
|
{ 0x000E, 0x21 }, // (Offset,Value)-Pair #7
|
|
|
|
// IDirect3DDevice8_Clear+0x0399 : retn 0x18
|
|
{ 0x0399, 0xC2 }, // (Offset,Value)-Pair #8
|
|
{ 0x039A, 0x18 }, // (Offset,Value)-Pair #9
|
|
}
|
|
};
|
|
|
|
// ******************************************************************
|
|
// * IDirect3DDevice8_Swap
|
|
// ******************************************************************
|
|
SOOVPA<11> IDirect3DDevice8_Swap_1_0_4627 =
|
|
{
|
|
0, // Large == 0
|
|
11, // Count == 11
|
|
|
|
{
|
|
// IDirect3DDevice8_Swap+0x2A : mov ebx, 5
|
|
{ 0x2A, 0xBB }, // (Offset,Value)-Pair #1
|
|
{ 0x2B, 0x05 }, // (Offset,Value)-Pair #2
|
|
|
|
// IDirect3DDevice8_Swap+0x37 : test bl, 3
|
|
{ 0x37, 0xF6 }, // (Offset,Value)-Pair #3
|
|
{ 0x38, 0xC3 }, // (Offset,Value)-Pair #4
|
|
{ 0x39, 0x03 }, // (Offset,Value)-Pair #5
|
|
|
|
// IDirect3DDevice8_Swap+0x60 : inc dword ptr [esi+0x2C10]
|
|
{ 0x60, 0xFF }, // (Offset,Value)-Pair #6
|
|
{ 0x61, 0x86 }, // (Offset,Value)-Pair #7
|
|
{ 0x62, 0x10 }, // (Offset,Value)-Pair #8
|
|
{ 0x63, 0x2C }, // (Offset,Value)-Pair #9
|
|
|
|
// IDirect3DDevice8_Swap+0xD8 : retn 4
|
|
{ 0xD8, 0xC2 }, // (Offset,Value)-Pair #10
|
|
{ 0xD9, 0x04 }, // (Offset,Value)-Pair #11
|
|
}
|
|
};
|
|
|
|
// ******************************************************************
|
|
// * IDirect3DDevice8_CreateVertexBuffer2
|
|
// ******************************************************************
|
|
SOOVPA<13> IDirect3DDevice8_CreateVertexBuffer2_1_0_4627 =
|
|
{
|
|
0, // Large == 0
|
|
13, // Count == 13
|
|
|
|
{
|
|
// IDirect3DDevice8_CreateVertexBuffer2+0x03 : push 0x40
|
|
{ 0x03, 0x6A }, // (Offset,Value)-Pair #1
|
|
{ 0x04, 0x40 }, // (Offset,Value)-Pair #2
|
|
|
|
// IDirect3DDevice8_CreateVertexBuffer2+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_CreateVertexBuffer2+0x41 : mov dword ptr [esi], 0x01000001
|
|
{ 0x41, 0xC7 }, // (Offset,Value)-Pair #7
|
|
{ 0x42, 0x06 }, // (Offset,Value)-Pair #8
|
|
{ 0x43, 0x01 }, // (Offset,Value)-Pair #9
|
|
{ 0x44, 0x00 }, // (Offset,Value)-Pair #10
|
|
{ 0x46, 0x01 }, // (Offset,Value)-Pair #11
|
|
|
|
// IDirect3DDevice8_CreateVertexBuffer2+0x4A : retn 0x04
|
|
{ 0x4A, 0xC2 }, // (Offset,Value)-Pair #12
|
|
{ 0x4B, 0x04 }, // (Offset,Value)-Pair #13
|
|
}
|
|
};
|
|
|
|
|
|
// ******************************************************************
|
|
// * IDirect3DDevice8_SetRenderState_ZEnable
|
|
// ******************************************************************
|
|
SOOVPA<13> IDirect3DDevice8_SetRenderState_ZEnable_1_0_4627 =
|
|
{
|
|
0, // Large == 0
|
|
13, // Count == 13
|
|
|
|
{
|
|
// IDirect3DDevice8_SetRenderState_CullMode+0x0C : jb +0x05
|
|
{ 0x0C, 0x72 }, // (Offset,Value)-Pair #1
|
|
{ 0x0D, 0x05 }, // (Offset,Value)-Pair #2
|
|
|
|
// IDirect3DDevice8_SetRenderState_CullMode+0x1B : mov ecx, [esi+0x21B8h]
|
|
{ 0x1B, 0x8B }, // (Offset,Value)-Pair #3
|
|
{ 0x1C, 0x8E }, // (Offset,Value)-Pair #4
|
|
{ 0x1D, 0xB8 }, // (Offset,Value)-Pair #5
|
|
{ 0x1E, 0x21 }, // (Offset,Value)-Pair #6
|
|
|
|
// IDirect3DDevice8_SetRenderState_CullMode+0x2E : mov dword ptr [eax], 0x4030
|
|
{ 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_CullMode+0x8C : retn 0x04
|
|
{ 0x8C, 0xC2 }, // (Offset,Value)-Pair #12
|
|
{ 0x8D, 0x04 }, // (Offset,Value)-Pair #13
|
|
}
|
|
};
|
|
|
|
// ******************************************************************
|
|
// * IDirect3DVertexBuffer8_Lock2
|
|
// ******************************************************************
|
|
SOOVPA<11> IDirect3DVertexBuffer8_Lock2_1_0_4627 =
|
|
{
|
|
0, // Large == 0
|
|
11, // Count == 11
|
|
|
|
{
|
|
// IDirect3DVertexBuffer8_Lock+0x01 : mov bl, [esp+0x0C]
|
|
{ 0x01, 0x8A }, // (Offset,Value)-Pair #1
|
|
{ 0x02, 0x5C }, // (Offset,Value)-Pair #2
|
|
{ 0x03, 0x24 }, // (Offset,Value)-Pair #3
|
|
{ 0x04, 0x0C }, // (Offset,Value)-Pair #4
|
|
|
|
// IDirect3DVertexBuffer8_Lock+0x09 : jnz +0x24
|
|
{ 0x09, 0x75 }, // (Offset,Value)-Pair #5
|
|
{ 0x0A, 0x24 }, // (Offset,Value)-Pair #6
|
|
|
|
// IDirect3DVertexBuffer8_Lock+0x2F : test bl, 0xA0
|
|
{ 0x2F, 0xF6 }, // (Offset,Value)-Pair #7
|
|
{ 0x30, 0xC3 }, // (Offset,Value)-Pair #8
|
|
{ 0x31, 0xA0 }, // (Offset,Value)-Pair #9
|
|
|
|
// IDirect3DVertexBuffer8_Lock+0x48 : retn 0x08
|
|
{ 0x48, 0xC2 }, // (Offset,Value)-Pair #10
|
|
{ 0x49, 0x08 }, // (Offset,Value)-Pair #11
|
|
}
|
|
};
|
|
|
|
|
|
// ******************************************************************
|
|
// * IDirect3DDevice8_SetMaterial
|
|
// ******************************************************************
|
|
SOOVPA<12> IDirect3DDevice8_SetMaterial_1_0_4627 =
|
|
{
|
|
0, // Large == 0
|
|
12, // Count == 12
|
|
|
|
{
|
|
// IDirect3DDevice8_SetMaterial+0x0C : add edi, 0x0AB0
|
|
{ 0x0C, 0x81 }, // (Offset,Value)-Pair #1
|
|
{ 0x0D, 0xC7 }, // (Offset,Value)-Pair #2
|
|
{ 0x0E, 0xB0 }, // (Offset,Value)-Pair #3
|
|
{ 0x0F, 0x0A }, // (Offset,Value)-Pair #4
|
|
|
|
// IDirect3DDevice8_SetMaterial+0x12 : mov ecx, 0x11
|
|
{ 0x12, 0xB9 }, // (Offset,Value)-Pair #5
|
|
{ 0x13, 0x11 }, // (Offset,Value)-Pair #6
|
|
|
|
// IDirect3DDevice8_SetMaterial+0x1F : or ecx, 0x1000
|
|
{ 0x1F, 0x81 }, // (Offset,Value)-Pair #7
|
|
{ 0x20, 0xC9 }, // (Offset,Value)-Pair #8
|
|
{ 0x21, 0x00 }, // (Offset,Value)-Pair #9
|
|
{ 0x22, 0x10 }, // (Offset,Value)-Pair #10
|
|
|
|
// IDirect3DDevice8_SetMaterial+0x2D : retn 0x04
|
|
{ 0x2D, 0xC2 }, // (Offset,Value)-Pair #11
|
|
{ 0x2E, 0x04 }, // (Offset,Value)-Pair #12
|
|
}
|
|
};
|
|
|
|
// ******************************************************************
|
|
// * D3D8_1_0_4627
|
|
// ******************************************************************
|
|
OOVPATable D3D8_1_0_4627[] =
|
|
{
|
|
// IDirect3D8::CreateDevice
|
|
{
|
|
(OOVPA*)&IDirect3D8_CreateDevice_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3D8_CreateDevice,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3D8_CreateDevice"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::Clear
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_Clear_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_Clear,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_Clear"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::Swap
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_Swap_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_Swap,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_Swap"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::CreateVertexBuffer2
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_CreateVertexBuffer2_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_CreateVertexBuffer2,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_CreateVertexBuffer2"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetRenderState_CullMode (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetRenderState_CullMode_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetRenderState_CullMode,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetRenderState_CullMode"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetRenderState_ZEnable
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetRenderState_ZEnable_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetRenderState_ZEnable,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetRenderState_ZEnable"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetTransform (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetTransform_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetTransform,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetTransform"
|
|
#endif
|
|
},
|
|
// IDirect3DVertexBuffer8::Lock2
|
|
{
|
|
(OOVPA*)&IDirect3DVertexBuffer8_Lock2_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3DVertexBuffer8_Lock2,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DVertexBuffer8_Lock2"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetStreamSource (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetStreamSource_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetStreamSource,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetStreamSource"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetVertexShader (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetVertexShader_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetVertexShader,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetVertexShader"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::DrawVertices (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_DrawVertices_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_DrawVertices,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_DrawVertices"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetLight (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetLight_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetLight,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetLight"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::SetMaterial
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_SetMaterial_1_0_4627,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_SetMaterial,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_SetMaterial"
|
|
#endif
|
|
},
|
|
// IDirect3DDevice8::LightEnable (* unchanged since 4361 *)
|
|
{
|
|
(OOVPA*)&IDirect3DDevice8_LightEnable_1_0_4361,
|
|
|
|
xd3d8::EmuIDirect3DDevice8_LightEnable,
|
|
|
|
#ifdef _DEBUG_TRACE
|
|
"EmuIDirect3DDevice8_LightEnable"
|
|
#endif
|
|
},
|
|
};
|
|
|
|
// ******************************************************************
|
|
// * D3D8_1_0_4627_SIZE
|
|
// ******************************************************************
|
|
uint32 D3D8_1_0_4627_SIZE = sizeof(D3D8_1_0_4627);
|