Turok Evolution shows graphics :]

This commit is contained in:
Aaron Robinson 2003-07-10 00:52:48 +00:00
parent c5d37ce5de
commit 961c752e87
16 changed files with 499 additions and 43 deletions

View File

@ -1,5 +1,12 @@
cxbx website: http://www.caustik.com/xbox/
version: 0.7.7 (07/??/03)
--------------------------------
- Stella and a few other homebrew games are now playable :]
This means you can play all your atari games on Cxbx, which
is a great novelty.
version: 0.7.6 (07/07/03)
--------------------------------

View File

@ -21,4 +21,6 @@ inside of the buffer allocated by Data. This could work, as
long as Xbox Games do not access the resource Data after the
initial Register function is called.
I am currently using the first idea until we run into trouble.
The currently used method is to tuck the pointer away inside
of the Lock member, and hijack any functions that attempt to
access the Lock member variable.

View File

@ -702,6 +702,15 @@ VOID __fastcall EmuIDirect3DDevice8_SetVertexShaderConstant1
CONST PVOID pConstantData
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetVertexShaderConstant4
// ******************************************************************
VOID __fastcall EmuIDirect3DDevice8_SetVertexShaderConstant4
(
INT Register,
CONST PVOID pConstantData
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_CreatePixelShader
// ******************************************************************

View File

@ -78,6 +78,19 @@ struct X_DSBUFFERDESC
DWORD dwInputMixBin;
};
// ******************************************************************
// * X_DSSTREAMDESC
// ******************************************************************
struct X_DSSTREAMDESC
{
DWORD dwFlags;
DWORD dwMaxAttachedPackets;
LPWAVEFORMATEX lpwfxFormat;
PVOID lpfnCallback; // TODO: Correct Parameter
LPVOID lpvContext;
PVOID lpMixBins; // TODO: Correct Parameter
};
// ******************************************************************
// * func: EmuDirectSoundCreate
// ******************************************************************
@ -97,6 +110,15 @@ HRESULT WINAPI EmuDirectSoundCreateBuffer
X_CDirectSoundBuffer **ppBuffer
);
// ******************************************************************
// * func: EmuDirectSoundCreateStream
// ******************************************************************
HRESULT WINAPI EmuDirectSoundCreateStream
(
X_DSSTREAMDESC *pdssd,
PVOID **ppStream
);
// ******************************************************************
// * func: EmuIDirectSound8_Release
// ******************************************************************

View File

@ -600,6 +600,17 @@ typedef NTSTATUS (NTAPI *FPTR_NtAllocateVirtualMemory)
IN ULONG Protect
);
// ******************************************************************
// * NtFreeVirtualMemory
// ******************************************************************
typedef NTSTATUS (NTAPI *FPTR_NtFreeVirtualMemory)
(
IN HANDLE ProcessHandle,
IN PVOID *BaseAddress,
IN OUT PULONG RegionSize,
IN ULONG FreeType
);
// ******************************************************************
// * RtlInitializeCriticalSection
// ******************************************************************
@ -624,6 +635,16 @@ typedef VOID (NTAPI *FPTR_RtlLeaveCriticalSection)
IN PRTL_CRITICAL_SECTION CriticalSection
);
// ******************************************************************
// * NtWaitForSingleObject
// ******************************************************************
typedef NTSTATUS (NTAPI *FPTR_NtWaitForSingleObject)
(
IN HANDLE ObjectHandle,
IN BOOLEAN Alertable,
IN PLARGE_INTEGER TimeOut
);
// ******************************************************************
// * NtCreateEvent
// ******************************************************************
@ -802,10 +823,12 @@ extern FPTR_RtlNtStatusToDosError RtlNtStatusToDosError;
extern FPTR_RtlInitializeCriticalSection RtlInitializeCriticalSection;
extern FPTR_RtlEnterCriticalSection RtlEnterCriticalSection;
extern FPTR_RtlLeaveCriticalSection RtlLeaveCriticalSection;
extern FPTR_NtWaitForSingleObject NtWaitForSingleObject;
extern FPTR_RtlCreateHeap RtlCreateHeap;
extern FPTR_RtlAllocateHeap RtlAllocateHeap;
extern FPTR_RtlFreeHeap RtlFreeHeap;
extern FPTR_NtAllocateVirtualMemory NtAllocateVirtualMemory;
extern FPTR_NtFreeVirtualMemory NtFreeVirtualMemory;
extern FPTR_NtClose NtClose;
extern FPTR_NtDelayExecution NtDelayExecution;
extern FPTR_NtDuplicateObject NtDuplicateObject;

View File

@ -106,7 +106,9 @@ enum XRefDataBaseOffset
XREF_DSOUNDSTOP = 14,
XREF_DSOUNDSTOP2 = 15,
XREF_DSSETBUFFERDATA = 16,
XREF_DSSETBUFFERDATA2 = 17
XREF_DSSETBUFFERDATA2 = 17,
XREF_DSCREATESOUNDBUFFER = 18,
XREF_DSCREATESOUNDSTREAM = 19
};
#endif

View File

@ -475,29 +475,63 @@ SOOVPA<11> IDirect3DDevice8_SetVertexShaderConstant1_1_0_4627 =
0, // XRef Not Used
{
// IDirect3DDevice8_SetVertexShaderConstant+0x06 : add eax, 0x1C
// IDirect3DDevice8_SetVertexShaderConstant1+0x06 : add eax, 0x1C
{ 0x06, 0x83 }, // (Offset,Value)-Pair #1
{ 0x07, 0xC0 }, // (Offset,Value)-Pair #2
{ 0x08, 0x1C }, // (Offset,Value)-Pair #3
// IDirect3DDevice8_SetVertexShaderConstant+0x0F : jnb +0x43
// IDirect3DDevice8_SetVertexShaderConstant1+0x0F : jnb +0x43
{ 0x0F, 0x73 }, // (Offset,Value)-Pair #4
{ 0x10, 0x43 }, // (Offset,Value)-Pair #5
// IDirect3DDevice8_SetVertexShaderConstant+0x27 : shl ecx, 0x04
// IDirect3DDevice8_SetVertexShaderConstant1+0x27 : shl ecx, 0x04
{ 0x27, 0xC1 }, // (Offset,Value)-Pair #6
{ 0x28, 0xE1 }, // (Offset,Value)-Pair #7
{ 0x29, 0x04 }, // (Offset,Value)-Pair #8
// IDirect3DDevice8_SetVertexShaderConstant+0x53 : retn
// IDirect3DDevice8_SetVertexShaderConstant1+0x53 : retn
{ 0x53, 0xC3 }, // (Offset,Value)-Pair #9
// IDirect3DDevice8_SetVertexShaderConstant+0x5D : jmp +0xA2
// IDirect3DDevice8_SetVertexShaderConstant1+0x5D : jmp +0xA2
{ 0x5D, 0xEB }, // (Offset,Value)-Pair #10
{ 0x5E, 0xA2 }, // (Offset,Value)-Pair #11
}
};
// ******************************************************************
// * IDirect3DDevice8_SetVertexShaderConstant4
// ******************************************************************
SOOVPA<12> IDirect3DDevice8_SetVertexShaderConstant4_1_0_4627 =
{
0, // Large == 0
12, // Count == 12
-1, // XRef Not Saved
0, // XRef Not Used
{
// IDirect3DDevice8_SetVertexShaderConstant4+0x05 : add eax, 0x4C
{ 0x05, 0x83 }, // (Offset,Value)-Pair #1
{ 0x06, 0xC0 }, // (Offset,Value)-Pair #2
{ 0x07, 0x4C }, // (Offset,Value)-Pair #3
// IDirect3DDevice8_SetVertexShaderConstant4+0x34 : movq mm7, qword ptr [edx+0x38]
{ 0x34, 0x0F }, // (Offset,Value)-Pair #4
{ 0x35, 0x6F }, // (Offset,Value)-Pair #5
{ 0x36, 0x7A }, // (Offset,Value)-Pair #6
{ 0x37, 0x38 }, // (Offset,Value)-Pair #7
// IDirect3DDevice8_SetVertexShaderConstant4+0x42 : shl ecx, 0x04
{ 0x42, 0xC1 }, // (Offset,Value)-Pair #8
{ 0x43, 0xE1 }, // (Offset,Value)-Pair #9
{ 0x44, 0x04 }, // (Offset,Value)-Pair #10
// IDirect3DDevice8_SetVertexShaderConstant4+0x91 : emms
{ 0x91, 0x0F }, // (Offset,Value)-Pair #11
{ 0x92, 0x77 }, // (Offset,Value)-Pair #12
}
};
// ******************************************************************
// * IDirect3DDevice8_SetPixelShader
// ******************************************************************
@ -1356,6 +1390,16 @@ OOVPATable D3D8_1_0_4627[] =
"EmuIDirect3DDevice8_SetVertexShaderConstant1"
#endif
},
// IDirect3DDevice8::SetVertexShaderConstant4
{
(OOVPA*)&IDirect3DDevice8_SetVertexShaderConstant4_1_0_4627,
XTL::EmuIDirect3DDevice8_SetVertexShaderConstant4,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_SetVertexShaderConstant4"
#endif
},
// IDirect3DDevice8::CreatePixelShader (* unchanged since 4361 *)
{
(OOVPA*)&IDirect3DDevice8_CreatePixelShader_1_0_4361,

View File

@ -33,35 +33,182 @@
// ******************************************************************
// ******************************************************************
// * DirectSoundCreateBuffer
// * CDirectSound::CreateSoundBuffer
// ******************************************************************
SOOVPA<11> DirectSoundCreateBuffer_1_0_4627 =
SOOVPA<14> CDirectSound_CreateSoundBuffer_1_0_4627 =
{
0, // Large == 0
11, // Count == 11
14, // Count == 14
-1, // XRef Not Saved
XREF_DSCREATESOUNDBUFFER, // XRef Is Saved
0, // XRef Not Used
{
// CDirectSound_CreateSoundBuffer+0x23 : mov eax, 0x80004005
{ 0x23, 0xB8 }, // (Offset,Value)-Pair #1
{ 0x24, 0x05 }, // (Offset,Value)-Pair #2
{ 0x25, 0x40 }, // (Offset,Value)-Pair #3
{ 0x27, 0x80 }, // (Offset,Value)-Pair #4
// CDirectSound_CreateSoundBuffer+0x2A : push 0x24
{ 0x2A, 0x6A }, // (Offset,Value)-Pair #5
{ 0x2B, 0x24 }, // (Offset,Value)-Pair #6
// CDirectSound_CreateSoundBuffer+0x4A : add esi, 0x7FF8FFF2
{ 0x4A, 0x81 }, // (Offset,Value)-Pair #7
{ 0x4B, 0xE6 }, // (Offset,Value)-Pair #8
{ 0x4C, 0xF2 }, // (Offset,Value)-Pair #9
{ 0x4D, 0xFF }, // (Offset,Value)-Pair #10
{ 0x4E, 0xF8 }, // (Offset,Value)-Pair #11
{ 0x4F, 0x7F }, // (Offset,Value)-Pair #12
// CDirectSound_CreateSoundBuffer+0x99 : retn 0x10
{ 0x99, 0xC2 }, // (Offset,Value)-Pair #13
{ 0x9A, 0x10 }, // (Offset,Value)-Pair #14
}
};
// ******************************************************************
// * DirectSoundCreateBuffer
// ******************************************************************
SOOVPA<12> DirectSoundCreateBuffer_1_0_4627 =
{
0, // Large == 0
12, // Count == 12
-1, // XRef Not Saved
1, // XRef Is Used
{
// DirectSoundCreateBuffer+0x2F : call [CDirectSound::CreateSoundBuffer]
{ 0x2F, XREF_DSCREATESOUNDBUFFER }, // (Offset,Value)-Pair #1
// DirectSoundCreateBuffer+0x04 : and [ebp-0x04], 0
{ 0x04, 0x83 }, // (Offset,Value)-Pair #1
{ 0x05, 0x65 }, // (Offset,Value)-Pair #2
{ 0x06, 0xFC }, // (Offset,Value)-Pair #3
{ 0x04, 0x83 }, // (Offset,Value)-Pair #2
{ 0x05, 0x65 }, // (Offset,Value)-Pair #3
{ 0x06, 0xFC }, // (Offset,Value)-Pair #4
// DirectSoundCreateBuffer+0x08 : push ebx; push esi; push edi
{ 0x08, 0x53 }, // (Offset,Value)-Pair #4
{ 0x09, 0x56 }, // (Offset,Value)-Pair #5
{ 0x0A, 0x57 }, // (Offset,Value)-Pair #6
{ 0x08, 0x53 }, // (Offset,Value)-Pair #5
{ 0x09, 0x56 }, // (Offset,Value)-Pair #6
{ 0x0A, 0x57 }, // (Offset,Value)-Pair #7
// DirectSoundCreateBuffer+0x3C : call dword ptr [eax+8]
{ 0x3C, 0xFF }, // (Offset,Value)-Pair #7
{ 0x3D, 0x50 }, // (Offset,Value)-Pair #8
{ 0x3E, 0x08 }, // (Offset,Value)-Pair #9
{ 0x3C, 0xFF }, // (Offset,Value)-Pair #8
{ 0x3D, 0x50 }, // (Offset,Value)-Pair #9
{ 0x3E, 0x08 }, // (Offset,Value)-Pair #10
// DirectSoundCreateBuffer+0x54 : retn 0x08
{ 0x54, 0xC2 }, // (Offset,Value)-Pair #10
{ 0x55, 0x08 }, // (Offset,Value)-Pair #11
{ 0x54, 0xC2 }, // (Offset,Value)-Pair #11
{ 0x55, 0x08 }, // (Offset,Value)-Pair #12
}
};
// ******************************************************************
// * IDirectSound8_CreateSoundBuffer
// ******************************************************************
SOOVPA<12> IDirectSound8_CreateSoundBuffer_1_0_4627 =
{
0, // Large == 0
12, // Count == 12
-1, // XRef Not Saved
1, // XRef Is Used
{
// IDirectSound8_CreateSoundBuffer+0x1D : call [CDirectSound::CreateSoundBuffer]
{ 0x1D, XREF_DSCREATESOUNDBUFFER }, // (Offset,Value)-Pair #1
// IDirectSound8_CreateSoundBuffer+0x04 : mov eax, [esp+8]
{ 0x04, 0x8B }, // (Offset,Value)-Pair #2
{ 0x05, 0x44 }, // (Offset,Value)-Pair #3
{ 0x06, 0x24 }, // (Offset,Value)-Pair #4
{ 0x07, 0x08 }, // (Offset,Value)-Pair #5
// IDirectSound8_CreateSoundBuffer+0x12 : add eax, 0xFFFFFFF8
{ 0x12, 0x83 }, // (Offset,Value)-Pair #6
{ 0x13, 0xC0 }, // (Offset,Value)-Pair #7
{ 0x14, 0xF8 }, // (Offset,Value)-Pair #8
// IDirectSound8_CreateSoundBuffer+0x17 : sbb ecx, ecx
{ 0x17, 0x1B }, // (Offset,Value)-Pair #9
{ 0x18, 0xC9 }, // (Offset,Value)-Pair #10
// IDirectSound8_CreateSoundBuffer+0x21 : retn 0x10
{ 0x21, 0xC2 }, // (Offset,Value)-Pair #11
{ 0x22, 0x10 }, // (Offset,Value)-Pair #12
}
};
// ******************************************************************
// * CDirectSound::CreateSoundStream
// ******************************************************************
SOOVPA<14> CDirectSound_CreateSoundStream_1_0_4627 =
{
0, // Large == 0
14, // Count == 14
XREF_DSCREATESOUNDSTREAM, // XRef Is Saved
0, // XRef Not Used
{
// CDirectSound_CreateSoundStream+0x23 : mov eax, 0x80004005
{ 0x23, 0xB8 }, // (Offset,Value)-Pair #1
{ 0x24, 0x05 }, // (Offset,Value)-Pair #2
{ 0x25, 0x40 }, // (Offset,Value)-Pair #3
{ 0x27, 0x80 }, // (Offset,Value)-Pair #4
// CDirectSound_CreateSoundStream+0x2A : push 0x28
{ 0x2A, 0x6A }, // (Offset,Value)-Pair #5
{ 0x2B, 0x28 }, // (Offset,Value)-Pair #6
// CDirectSound_CreateSoundStream+0x4A : add esi, 0x7FF8FFF2
{ 0x4A, 0x81 }, // (Offset,Value)-Pair #7
{ 0x4B, 0xE6 }, // (Offset,Value)-Pair #8
{ 0x4C, 0xF2 }, // (Offset,Value)-Pair #9
{ 0x4D, 0xFF }, // (Offset,Value)-Pair #10
{ 0x4E, 0xF8 }, // (Offset,Value)-Pair #11
{ 0x4F, 0x7F }, // (Offset,Value)-Pair #12
// CDirectSound_CreateSoundStream+0x8E : retn 0x10
{ 0x8E, 0xC2 }, // (Offset,Value)-Pair #13
{ 0x8F, 0x10 }, // (Offset,Value)-Pair #14
}
};
// ******************************************************************
// * DirectSoundCreateStream
// ******************************************************************
SOOVPA<12> DirectSoundCreateStream_1_0_4627 =
{
0, // Large == 0
12, // Count == 12
-1, // XRef Not Saved
1, // XRef Is Used
{
// DirectSoundCreateStream+0x2F : call [CDirectSound::CreateSoundStream]
{ 0x2F, XREF_DSCREATESOUNDSTREAM }, // (Offset,Value)-Pair #1
// DirectSoundCreateStream+0x04 : and [ebp-0x04], 0
{ 0x04, 0x83 }, // (Offset,Value)-Pair #2
{ 0x05, 0x65 }, // (Offset,Value)-Pair #3
{ 0x06, 0xFC }, // (Offset,Value)-Pair #4
// DirectSoundCreateStream+0x08 : push ebx; push esi; push edi
{ 0x08, 0x53 }, // (Offset,Value)-Pair #5
{ 0x09, 0x56 }, // (Offset,Value)-Pair #6
{ 0x0A, 0x57 }, // (Offset,Value)-Pair #7
// DirectSoundCreateStream+0x3C : call dword ptr [eax+8]
{ 0x3C, 0xFF }, // (Offset,Value)-Pair #8
{ 0x3D, 0x50 }, // (Offset,Value)-Pair #9
{ 0x3E, 0x08 }, // (Offset,Value)-Pair #10
// DirectSoundCreateStream+0x54 : retn 0x08
{ 0x54, 0xC2 }, // (Offset,Value)-Pair #11
{ 0x55, 0x08 }, // (Offset,Value)-Pair #12
}
};
@ -418,6 +565,14 @@ OOVPATable DSound_1_0_4627[] =
"EmuDirectSoundCreate"
#endif
},
// CDirectSound_CreateSoundBuffer
{
(OOVPA*)&CDirectSound_CreateSoundBuffer_1_0_4627, 0,
#ifdef _DEBUG_TRACE
"CDirectSound::CreateSoundBuffer (XREF)"
#endif
},
// DirectSoundCreateBuffer
{
(OOVPA*)&DirectSoundCreateBuffer_1_0_4627,
@ -428,6 +583,34 @@ OOVPATable DSound_1_0_4627[] =
"EmuDirectSoundCreateBuffer"
#endif
},
// IDirectSound8::CreateSoundBuffer
{
(OOVPA*)&IDirectSound8_CreateSoundBuffer_1_0_4627,
XTL::EmuIDirectSound8_CreateSoundBuffer,
#ifdef _DEBUG_TRACE
"EmuIDirectSound8_CreateSoundBuffer"
#endif
},
// CDirectSound_CreateSoundStream
{
(OOVPA*)&CDirectSound_CreateSoundStream_1_0_4627, 0,
#ifdef _DEBUG_TRACE
"CDirectSound::CreateSoundStream (XREF)"
#endif
},
// DirectSoundCreateStream
{
(OOVPA*)&DirectSoundCreateStream_1_0_4627,
XTL::EmuDirectSoundCreateStream,
#ifdef _DEBUG_TRACE
"EmuDirectSoundCreateStream"
#endif
},
// CMcpxBuffer::SetBufferData (* unchanged since 4361 *)
{
(OOVPA*)&CMcpxBuffer_SetBufferData_1_0_4361, 0,

View File

@ -1469,6 +1469,36 @@ VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstant1
return;
}
// ******************************************************************
// * func: EmuIDirect3DDevice8_SetVertexShaderConstant4
// ******************************************************************
VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstant4
(
INT Register,
CONST PVOID pConstantData
)
{
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
EmuSwapFS(); // Win2k/XP FS
printf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexShaderConstant4\n"
"(\n"
" Register : 0x%.08X\n"
" pConstantData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Register, pConstantData);
EmuSwapFS(); // XBox FS
}
#endif
XTL::EmuIDirect3DDevice8_SetVertexShaderConstant(Register - 96, pConstantData, 4);
return;
}
// ******************************************************************
// * func: EmuIDirect3DDevice8_CreatePixelShader
// ******************************************************************
@ -2065,7 +2095,7 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register
case X_D3DCOMMON_TYPE_PUSHBUFFER:
{
printf("*Warning: X_D3DCOMMON_TYPE_PUSHBUFFER is not yet implemented");
printf("*Warning: X_D3DCOMMON_TYPE_PUSHBUFFER is not yet implemented\n");
X_D3DPushBuffer *pPushBuffer = (X_D3DPushBuffer*)pResource;
}

View File

@ -136,7 +136,7 @@ HRESULT WINAPI XTL::EmuDirectSoundCreateBuffer
DWORD dwAcceptableMask = 0x00000010 | 0x00000020 | 0x00000080 | 0x00000100 | 0x00002000 | 0x00040000 | 0x00080000;
if(pdsbd->dwFlags & (~dwAcceptableMask))
printf("*Warning* use of unsupported pdsbd->dwFlags mask(s) (0x%.08X)", pdsbd->dwFlags & (~dwAcceptableMask));
printf("*Warning* use of unsupported pdsbd->dwFlags mask(s) (0x%.08X)\n", pdsbd->dwFlags & (~dwAcceptableMask));
DSBufferDesc.dwSize = sizeof(DSBufferDesc);
DSBufferDesc.dwFlags = pdsbd->dwFlags & dwAcceptableMask;
@ -164,6 +164,36 @@ HRESULT WINAPI XTL::EmuDirectSoundCreateBuffer
return hRet;
}
// ******************************************************************
// * func: EmuDirectSoundCreateStream
// ******************************************************************
HRESULT WINAPI XTL::EmuDirectSoundCreateStream
(
X_DSSTREAMDESC *pdssd,
PVOID **ppStream
)
{
EmuSwapFS(); // Win2k/XP FS
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
printf("EmuDSound (0x%X): EmuDirectSoundCreateStream\n"
"(\n"
" pdssd : 0x%.08X\n"
" ppStream : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pdssd, ppStream);
}
#endif
EmuSwapFS(); // XBox FS
return DS_OK;
}
// ******************************************************************
// * func: EmuIDirectSound8_Release
// ******************************************************************

View File

@ -52,7 +52,7 @@ namespace xboxkrnl
// ******************************************************************
// * data: EmuAutoSleepRate
// ******************************************************************
uint32 EmuAutoSleepRate = 1000;
uint32 EmuAutoSleepRate = -1;
// ******************************************************************
// * func: EmuInitFS

View File

@ -397,8 +397,6 @@ XBSYSAPI EXPORTNUM(67) NTSTATUS xboxkrnl::IoCreateSymbolicLink
}
#endif
EmuCleanup("IoCreateSymbolicLink not implemented");
// TODO: Actually um...implement this function
NTSTATUS ret = STATUS_OBJECT_NAME_COLLISION;
@ -407,6 +405,37 @@ XBSYSAPI EXPORTNUM(67) NTSTATUS xboxkrnl::IoCreateSymbolicLink
return ret;
}
// ******************************************************************
// * 0x0045 - IoDeleteSymbolicLink
// ******************************************************************
XBSYSAPI EXPORTNUM(69) NTSTATUS xboxkrnl::IoDeleteSymbolicLink
(
IN PSTRING SymbolicLinkName
)
{
EmuSwapFS(); // Win2k/XP FS
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
printf("EmuKrnl (0x%X): IoDeleteSymbolicLink\n"
"(\n"
" SymbolicLinkName : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), SymbolicLinkName, SymbolicLinkName->Buffer);
}
#endif
// TODO: Actually um...implement this function
NTSTATUS ret = STATUS_OBJECT_NAME_NOT_FOUND;
EmuSwapFS(); // Xbox FS
return ret;
}
// ******************************************************************
// * 0x0063 - KeDelayExecutionThread
// ******************************************************************
@ -693,7 +722,7 @@ XBSYSAPI EXPORTNUM(171) VOID NTAPI xboxkrnl::MmFreeContiguousMemory
}
#endif
delete BaseAddress;
delete[] BaseAddress;
EmuSwapFS(); // Xbox FS
@ -1070,6 +1099,40 @@ XBSYSAPI EXPORTNUM(197) NTSTATUS NTAPI xboxkrnl::NtDuplicateObject
return ret;
}
// ******************************************************************
// * 0x00C7 - NtFreeVirtualMemory
// ******************************************************************
XBSYSAPI EXPORTNUM(199) NTSTATUS NTAPI xboxkrnl::NtFreeVirtualMemory
(
IN OUT PVOID *BaseAddress,
IN OUT PULONG FreeSize,
IN ULONG FreeType
)
{
EmuSwapFS(); // Win2k/XP FS
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
printf("EmuKrnl (0x%X): NtFreeVirtualMemory\n"
"(\n"
" BaseAddress : 0x%.08X\n"
" FreeSize : 0x%.08X\n"
" FreeType : 0x%.08X\n"
");\n",
GetCurrentThreadId(), BaseAddress, FreeSize, FreeType);
}
#endif
NTSTATUS ret = NtDll::NtFreeVirtualMemory(GetCurrentProcess(), BaseAddress, FreeSize, FreeType);
EmuSwapFS(); // Xbox FS
return ret;
}
// ******************************************************************
// * 0x00CA - NtOpenFile
// ******************************************************************
@ -1263,7 +1326,7 @@ XBSYSAPI EXPORTNUM(211) NTSTATUS NTAPI xboxkrnl::NtQueryInformationFile
(
IN HANDLE FileHandle,
OUT PIO_STATUS_BLOCK IoStatusBlock,
OUT PFILE_FS_SIZE_INFORMATION FileInformation,
OUT PVOID FileInformation,
IN ULONG Length,
IN FILE_INFORMATION_CLASS FileInfo
)
@ -1444,6 +1507,42 @@ XBSYSAPI EXPORTNUM(226) NTSTATUS NTAPI xboxkrnl::NtSetInformationFile
return ret;
}
// ******************************************************************
// * 0x00EA - NtWaitForSingleObjectEx
// ******************************************************************
XBSYSAPI EXPORTNUM(234) NTSTATUS NTAPI xboxkrnl::NtWaitForSingleObjectEx
(
IN HANDLE Handle,
IN DWORD WaitMode,
IN BOOLEAN Alertable,
IN PLARGE_INTEGER Timeout
)
{
EmuSwapFS(); // Win2k/XP FS
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
printf("EmuKrnl (0x%X): NtWaitForSingleObjectEx\n"
"(\n"
" Handle : 0x%.08X\n"
" WaitMode : 0x%.08X\n"
" Alertable : 0x%.08X\n"
" Timeout : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Handle, WaitMode, Alertable, Timeout);
}
#endif
NTSTATUS ret = NtDll::NtWaitForSingleObject(Handle, Alertable, (NtDll::PLARGE_INTEGER)Timeout);
EmuSwapFS(); // Xbox FS
return ret;
}
// ******************************************************************
// * 0x00DA - NtWriteFile
// ******************************************************************

View File

@ -60,7 +60,9 @@ NtDll::FPTR_RtlLeaveCriticalSection NtDll::RtlLeaveCriticalSection =
NtDll::FPTR_RtlCreateHeap NtDll::RtlCreateHeap = (NtDll::FPTR_RtlCreateHeap)GetProcAddress(hNtDll, "RtlCreateHeap");
NtDll::FPTR_RtlAllocateHeap NtDll::RtlAllocateHeap = (NtDll::FPTR_RtlAllocateHeap)GetProcAddress(hNtDll, "RtlAllocateHeap");
NtDll::FPTR_RtlFreeHeap NtDll::RtlFreeHeap = (NtDll::FPTR_RtlFreeHeap)GetProcAddress(hNtDll, "RtlFreeHeap");
NtDll::FPTR_NtWaitForSingleObject NtDll::NtWaitForSingleObject = (NtDll::FPTR_NtWaitForSingleObject)GetProcAddress(hNtDll, "NtWaitForSingleObject");
NtDll::FPTR_NtAllocateVirtualMemory NtDll::NtAllocateVirtualMemory = (NtDll::FPTR_NtAllocateVirtualMemory)GetProcAddress(hNtDll, "NtAllocateVirtualMemory");
NtDll::FPTR_NtFreeVirtualMemory NtDll::NtFreeVirtualMemory = (NtDll::FPTR_NtFreeVirtualMemory)GetProcAddress(hNtDll, "NtFreeVirtualMemory");
NtDll::FPTR_NtClose NtDll::NtClose = (NtDll::FPTR_NtClose)GetProcAddress(hNtDll, "NtClose");
NtDll::FPTR_NtDelayExecution NtDll::NtDelayExecution = (NtDll::FPTR_NtDelayExecution)GetProcAddress(hNtDll, "NtDelayExecution");
NtDll::FPTR_NtDuplicateObject NtDll::NtDuplicateObject = (NtDll::FPTR_NtDuplicateObject)GetProcAddress(hNtDll, "NtDuplicateObject");

View File

@ -189,6 +189,8 @@ extern uint32 XRefDataBase[] =
-1, // XREF_DSOUNDSTOP2
-1, // XREF_DSSETBUFFERDATA
-1, // XREF_DSSETBUFFERDATA2
-1, // XREF_DSCREATESOUNDBUFFER
-1, // XREF_DSCREATESOUNDSTREAM
};
// ******************************************************************

View File

@ -134,7 +134,7 @@ extern "C" CXBXKRNL_API uint32 KernelThunkTable[367] =
(uint32)&xboxkrnl::IoCreateFile, // 0x0042 (66)
(uint32)&xboxkrnl::IoCreateSymbolicLink, // 0x0043 (67)
(uint32)PANIC(0x0044), // 0x0044 (68)
(uint32)PANIC(0x0045), // 0x0045 (69)
(uint32)&xboxkrnl::IoDeleteSymbolicLink, // 0x0045 (69)
(uint32)PANIC(0x0046), // 0x0046 (70)
(uint32)PANIC(0x0047), // 0x0047 (71)
(uint32)PANIC(0x0048), // 0x0048 (72)
@ -264,7 +264,7 @@ extern "C" CXBXKRNL_API uint32 KernelThunkTable[367] =
(uint32)PANIC(0x00C4), // 0x00C4 (196)
(uint32)&xboxkrnl::NtDuplicateObject, // 0x00C5 (197)
(uint32)PANIC(0x00C6), // 0x00C6 (198)
(uint32)PANIC(0x00C7), // 0x00C7 (199)
(uint32)&xboxkrnl::NtFreeVirtualMemory, // 0x00C7 (199)
(uint32)PANIC(0x00C8), // 0x00C8 (200)
(uint32)PANIC(0x00C9), // 0x00C9 (201)
(uint32)&xboxkrnl::NtOpenFile, // 0x00CA (202)
@ -299,7 +299,7 @@ extern "C" CXBXKRNL_API uint32 KernelThunkTable[367] =
(uint32)PANIC(0x00E7), // 0x00E7 (231)
(uint32)PANIC(0x00E8), // 0x00E8 (232)
(uint32)PANIC(0x00E9), // 0x00E9 (233)
(uint32)PANIC(0x00EA), // 0x00EA (234)
(uint32)&xboxkrnl::NtWaitForSingleObjectEx, // 0x00EA (234)
(uint32)PANIC(0x00EB), // 0x00EB (235)
(uint32)&xboxkrnl::NtWriteFile, // 0x00EC (236)
(uint32)PANIC(0x00ED), // 0x00ED (237)

View File

@ -98,6 +98,7 @@ SOOVPA<8> XapiUnknownBad1_1_0_4627 =
// ******************************************************************
OOVPATable XAPI_1_0_4627[] =
{
/*
// RtlCreateHeap (* unchanged since 1.0.4361 *) (* OR FARTHER *)
{
(OOVPA*)&RtlCreateHeap_1_0_4361,
@ -127,7 +128,7 @@ OOVPATable XAPI_1_0_4627[] =
#ifdef _DEBUG_TRACE
"EmuRtlFreeHeap"
#endif
},
},*/
// XapiUnknownBad1
{
(OOVPA*)&XapiUnknownBad1_1_0_4627,