Expanded tabs and trimmed EOL whitespace.
This commit is contained in:
parent
df389d51f4
commit
199136e926
|
@ -24,7 +24,7 @@ XBSYSAPI VOID *ExAcquireReadWriteLockShared;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(14) PVOID NTAPI ExAllocatePool
|
XBSYSAPI EXPORTNUM(14) PVOID NTAPI ExAllocatePool
|
||||||
(
|
(
|
||||||
IN ULONG NumberOfBytes
|
IN ULONG NumberOfBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -36,8 +36,8 @@ XBSYSAPI EXPORTNUM(14) PVOID NTAPI ExAllocatePool
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(15) PVOID NTAPI ExAllocatePoolWithTag
|
XBSYSAPI EXPORTNUM(15) PVOID NTAPI ExAllocatePoolWithTag
|
||||||
(
|
(
|
||||||
IN SIZE_T NumberOfBytes,
|
IN SIZE_T NumberOfBytes,
|
||||||
IN ULONG Tag
|
IN ULONG Tag
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *ExEventObjectType;
|
XBSYSAPI VOID *ExEventObjectType;
|
||||||
|
@ -66,11 +66,11 @@ XBSYSAPI VOID *ExQueryPoolBlockSize;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(24) NTSTATUS NTAPI ExQueryNonVolatileSetting
|
XBSYSAPI EXPORTNUM(24) NTSTATUS NTAPI ExQueryNonVolatileSetting
|
||||||
(
|
(
|
||||||
IN DWORD ValueIndex,
|
IN DWORD ValueIndex,
|
||||||
OUT DWORD *Type,
|
OUT DWORD *Type,
|
||||||
OUT PUCHAR Value,
|
OUT PUCHAR Value,
|
||||||
IN SIZE_T ValueLength,
|
IN SIZE_T ValueLength,
|
||||||
OUT PSIZE_T ResultLength OPTIONAL
|
OUT PSIZE_T ResultLength OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *ExReadWriteRefurbInfo;
|
XBSYSAPI VOID *ExReadWriteRefurbInfo;
|
||||||
|
|
|
@ -59,7 +59,7 @@ XBSYSAPI VOID *HalRequestSoftwareInterrupt;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(49) VOID DECLSPEC_NORETURN HalReturnToFirmware
|
XBSYSAPI EXPORTNUM(49) VOID DECLSPEC_NORETURN HalReturnToFirmware
|
||||||
(
|
(
|
||||||
RETURN_FIRMWARE Routine
|
RETURN_FIRMWARE Routine
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -24,7 +24,7 @@ XBSYSAPI VOID *MmGlobalData;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(165) PVOID NTAPI MmAllocateContiguousMemory
|
XBSYSAPI EXPORTNUM(165) PVOID NTAPI MmAllocateContiguousMemory
|
||||||
(
|
(
|
||||||
IN ULONG NumberOfBytes
|
IN ULONG NumberOfBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -32,11 +32,11 @@ XBSYSAPI EXPORTNUM(165) PVOID NTAPI MmAllocateContiguousMemory
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(166) PVOID NTAPI MmAllocateContiguousMemoryEx
|
XBSYSAPI EXPORTNUM(166) PVOID NTAPI MmAllocateContiguousMemoryEx
|
||||||
(
|
(
|
||||||
IN ULONG NumberOfBytes,
|
IN ULONG NumberOfBytes,
|
||||||
IN PHYSICAL_ADDRESS LowestAcceptableAddress,
|
IN PHYSICAL_ADDRESS LowestAcceptableAddress,
|
||||||
IN PHYSICAL_ADDRESS HighestAcceptableAddress,
|
IN PHYSICAL_ADDRESS HighestAcceptableAddress,
|
||||||
IN ULONG Alignment OPTIONAL,
|
IN ULONG Alignment OPTIONAL,
|
||||||
IN ULONG ProtectionType
|
IN ULONG ProtectionType
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -57,7 +57,7 @@ XBSYSAPI VOID *MmDeleteKernelStack;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(171) VOID NTAPI MmFreeContiguousMemory
|
XBSYSAPI EXPORTNUM(171) VOID NTAPI MmFreeContiguousMemory
|
||||||
(
|
(
|
||||||
IN PVOID BaseAddress
|
IN PVOID BaseAddress
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -83,7 +83,7 @@ XBSYSAPI VOID *MmIsAddressValid;
|
||||||
XBSYSAPI EXPORTNUM(175) PHYSICAL_ADDRESS NTAPI MmLockUnlockBufferPages
|
XBSYSAPI EXPORTNUM(175) PHYSICAL_ADDRESS NTAPI MmLockUnlockBufferPages
|
||||||
(
|
(
|
||||||
IN PHYSICAL_ADDRESS BaseAddress,
|
IN PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN ULONG NumberOfBytes,
|
IN ULONG NumberOfBytes,
|
||||||
IN ULONG Protect
|
IN ULONG Protect
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ XBSYSAPI EXPORTNUM(186) NTSTATUS NTAPI NtClearEvent
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(187) NTSTATUS NTAPI NtClose
|
XBSYSAPI EXPORTNUM(187) NTSTATUS NTAPI NtClose
|
||||||
(
|
(
|
||||||
IN HANDLE Handle
|
IN HANDLE Handle
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *NtCreateDirectoryObject;
|
XBSYSAPI VOID *NtCreateDirectoryObject;
|
||||||
|
@ -70,15 +70,15 @@ XBSYSAPI EXPORTNUM(189) NTSTATUS NTAPI NtCreateEvent
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(190) NTSTATUS NTAPI NtCreateFile
|
XBSYSAPI EXPORTNUM(190) NTSTATUS NTAPI NtCreateFile
|
||||||
(
|
(
|
||||||
OUT PHANDLE FileHandle,
|
OUT PHANDLE FileHandle,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
||||||
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
||||||
IN ULONG FileAttributes,
|
IN ULONG FileAttributes,
|
||||||
IN ULONG ShareAccess,
|
IN ULONG ShareAccess,
|
||||||
IN ULONG CreateDisposition,
|
IN ULONG CreateDisposition,
|
||||||
IN ULONG CreateOptions
|
IN ULONG CreateOptions
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *NtCreateIoCompletion;
|
XBSYSAPI VOID *NtCreateIoCompletion;
|
||||||
|
@ -221,14 +221,14 @@ XBSYSAPI EXPORTNUM(218) NTSTATUS NTAPI NtQueryVolumeInformationFile
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(219) NTSTATUS NTAPI NtReadFile
|
XBSYSAPI EXPORTNUM(219) NTSTATUS NTAPI NtReadFile
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
IN HANDLE Event OPTIONAL,
|
IN HANDLE Event OPTIONAL,
|
||||||
IN PVOID ApcRoutine OPTIONAL,
|
IN PVOID ApcRoutine OPTIONAL,
|
||||||
IN PVOID ApcContext,
|
IN PVOID ApcContext,
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
OUT PVOID Buffer,
|
OUT PVOID Buffer,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN PLARGE_INTEGER ByteOffset OPTIONAL
|
IN PLARGE_INTEGER ByteOffset OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *NtReadFileScatter;
|
XBSYSAPI VOID *NtReadFileScatter;
|
||||||
|
@ -272,11 +272,11 @@ XBSYSAPI EXPORTNUM(225) NTSTATUS NTAPI NtSetEvent
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(226) NTSTATUS NTAPI NtSetInformationFile
|
XBSYSAPI EXPORTNUM(226) NTSTATUS NTAPI NtSetInformationFile
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
IN PVOID FileInformation,
|
IN PVOID FileInformation,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG FileInformationClass
|
IN ULONG FileInformationClass
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *NtSetIoCompletion;
|
XBSYSAPI VOID *NtSetIoCompletion;
|
||||||
|
@ -314,9 +314,9 @@ XBSYSAPI EXPORTNUM(232) VOID NTAPI NtUserIoApcDispatcher
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(233) NTSTATUS NTAPI NtWaitForSingleObject
|
XBSYSAPI EXPORTNUM(233) NTSTATUS NTAPI NtWaitForSingleObject
|
||||||
(
|
(
|
||||||
IN HANDLE Handle,
|
IN HANDLE Handle,
|
||||||
IN BOOLEAN Alertable,
|
IN BOOLEAN Alertable,
|
||||||
IN PVOID Timeout
|
IN PVOID Timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -352,14 +352,14 @@ XBSYSAPI EXPORTNUM(235) NTSTATUS NTAPI NtWaitForMultipleObjectsEx
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(236) NTSTATUS NTAPI NtWriteFile
|
XBSYSAPI EXPORTNUM(236) NTSTATUS NTAPI NtWriteFile
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
IN PVOID Event,
|
IN PVOID Event,
|
||||||
IN PVOID ApcRoutine,
|
IN PVOID ApcRoutine,
|
||||||
IN PVOID ApcContext,
|
IN PVOID ApcContext,
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
IN PVOID Buffer,
|
IN PVOID Buffer,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN PLARGE_INTEGER ByteOffset
|
IN PLARGE_INTEGER ByteOffset
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *NtWriteFileGather;
|
XBSYSAPI VOID *NtWriteFileGather;
|
||||||
|
|
|
@ -39,10 +39,10 @@ XBSYSAPI VOID *RtlAppendUnicodeToString;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(264) VOID NTAPI RtlAssert
|
XBSYSAPI EXPORTNUM(264) VOID NTAPI RtlAssert
|
||||||
(
|
(
|
||||||
PVOID FailedAssertion,
|
PVOID FailedAssertion,
|
||||||
PVOID FileName,
|
PVOID FileName,
|
||||||
ULONG LineNumber,
|
ULONG LineNumber,
|
||||||
PCHAR Message
|
PCHAR Message
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *RtlCaptureContext;
|
XBSYSAPI VOID *RtlCaptureContext;
|
||||||
|
@ -76,8 +76,8 @@ XBSYSAPI VOID *RtlCompareUnicodeString;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(272) VOID NTAPI RtlCopyString
|
XBSYSAPI EXPORTNUM(272) VOID NTAPI RtlCopyString
|
||||||
(
|
(
|
||||||
IN OUT PVOID Destination, // TODO: should be STRING
|
IN OUT PVOID Destination, // TODO: should be STRING
|
||||||
IN PVOID Source OPTIONAL // TODO: should be STRING
|
IN PVOID Source OPTIONAL // TODO: should be STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *RtlCopyUnicodeString;
|
XBSYSAPI VOID *RtlCopyUnicodeString;
|
||||||
|
@ -171,7 +171,7 @@ XBSYSAPI VOID *RtlMultiByteToUnicodeSize;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(301) ULONG NTAPI RtlNtStatusToDosError
|
XBSYSAPI EXPORTNUM(301) ULONG NTAPI RtlNtStatusToDosError
|
||||||
(
|
(
|
||||||
IN NTSTATUS Status
|
IN NTSTATUS Status
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *RtlRaiseException;
|
XBSYSAPI VOID *RtlRaiseException;
|
||||||
|
|
|
@ -22,10 +22,10 @@ XBSYSAPI EXPORTNUM(1) PVOID NTAPI AvGetSavedDataAddress();
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(2) VOID NTAPI AvSendTVEncoderOption
|
XBSYSAPI EXPORTNUM(2) VOID NTAPI AvSendTVEncoderOption
|
||||||
(
|
(
|
||||||
IN PVOID RegisterBase,
|
IN PVOID RegisterBase,
|
||||||
IN ULONG Option,
|
IN ULONG Option,
|
||||||
IN ULONG Param,
|
IN ULONG Param,
|
||||||
OUT ULONG *Result
|
OUT ULONG *Result
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -33,12 +33,12 @@ XBSYSAPI EXPORTNUM(2) VOID NTAPI AvSendTVEncoderOption
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(4) ULONG NTAPI AvSetDisplayMode
|
XBSYSAPI EXPORTNUM(4) ULONG NTAPI AvSetDisplayMode
|
||||||
(
|
(
|
||||||
IN PVOID RegisterBase,
|
IN PVOID RegisterBase,
|
||||||
IN ULONG Step,
|
IN ULONG Step,
|
||||||
IN ULONG Mode,
|
IN ULONG Mode,
|
||||||
IN ULONG Format,
|
IN ULONG Format,
|
||||||
IN ULONG Pitch,
|
IN ULONG Pitch,
|
||||||
IN ULONG FrameBuffer
|
IN ULONG FrameBuffer
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -46,7 +46,7 @@ XBSYSAPI EXPORTNUM(4) ULONG NTAPI AvSetDisplayMode
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(4) VOID NTAPI AvSetSavedDataAddress
|
XBSYSAPI EXPORTNUM(4) VOID NTAPI AvSetSavedDataAddress
|
||||||
(
|
(
|
||||||
IN PVOID Address
|
IN PVOID Address
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *FscGetCacheSize;
|
XBSYSAPI VOID *FscGetCacheSize;
|
||||||
|
@ -65,7 +65,7 @@ XBSYSAPI VOID *KdDebuggerNotPresent;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(160) UCHAR NTAPI KfRaiseIrql
|
XBSYSAPI EXPORTNUM(160) UCHAR NTAPI KfRaiseIrql
|
||||||
(
|
(
|
||||||
IN UCHAR NewIrql
|
IN UCHAR NewIrql
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -73,7 +73,7 @@ XBSYSAPI EXPORTNUM(160) UCHAR NTAPI KfRaiseIrql
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(161) UCHAR NTAPI KfLowerIrql
|
XBSYSAPI EXPORTNUM(161) UCHAR NTAPI KfLowerIrql
|
||||||
(
|
(
|
||||||
IN UCHAR NewIrql
|
IN UCHAR NewIrql
|
||||||
);
|
);
|
||||||
|
|
||||||
XBSYSAPI VOID *KiBugCheckData;
|
XBSYSAPI VOID *KiBugCheckData;
|
||||||
|
|
|
@ -84,7 +84,7 @@ CXBXKRNL_API void EmuShared::Init()
|
||||||
);
|
);
|
||||||
|
|
||||||
if(hMapObject == NULL)
|
if(hMapObject == NULL)
|
||||||
CxbxKrnlCleanup("Could not map shared memory!");
|
CxbxKrnlCleanup("Could not map shared memory!");
|
||||||
|
|
||||||
if(GetLastError() == ERROR_ALREADY_EXISTS)
|
if(GetLastError() == ERROR_ALREADY_EXISTS)
|
||||||
init = false;
|
init = false;
|
||||||
|
@ -104,7 +104,7 @@ CXBXKRNL_API void EmuShared::Init()
|
||||||
);
|
);
|
||||||
|
|
||||||
if(g_EmuShared == NULL)
|
if(g_EmuShared == NULL)
|
||||||
CxbxKrnlCleanup("Could not map view of shared memory!");
|
CxbxKrnlCleanup("Could not map view of shared memory!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -55,9 +55,9 @@ void Mutex::Lock()
|
||||||
#if (_MSC_VER < 1300) // We are not using VC++.NET
|
#if (_MSC_VER < 1300) // We are not using VC++.NET
|
||||||
while(InterlockedCompareExchange((LPVOID*)&m_MutexLock, (LPVOID)1, (LPVOID)0))
|
while(InterlockedCompareExchange((LPVOID*)&m_MutexLock, (LPVOID)1, (LPVOID)0))
|
||||||
#else
|
#else
|
||||||
while(InterlockedCompareExchange((LPLONG)&m_MutexLock, (LONG)1, (LONG)0))
|
while(InterlockedCompareExchange((LPLONG)&m_MutexLock, (LONG)1, (LONG)0))
|
||||||
#endif
|
#endif
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
|
|
||||||
// Are we the the new owner?
|
// Are we the the new owner?
|
||||||
if (!m_OwnerProcess)
|
if (!m_OwnerProcess)
|
||||||
|
@ -105,7 +105,7 @@ void Mutex::Unlock()
|
||||||
#if (_MSC_VER < 1300) // We are not using VC++.NET
|
#if (_MSC_VER < 1300) // We are not using VC++.NET
|
||||||
while(InterlockedCompareExchange((LPVOID*)&m_MutexLock, (LPVOID)1, (LPVOID)0))
|
while(InterlockedCompareExchange((LPVOID*)&m_MutexLock, (LPVOID)1, (LPVOID)0))
|
||||||
#else
|
#else
|
||||||
while (InterlockedCompareExchange((LPLONG)&m_MutexLock, (LONG)1, (LONG)0))
|
while (InterlockedCompareExchange((LPLONG)&m_MutexLock, (LONG)1, (LONG)0))
|
||||||
#endif
|
#endif
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ class Xbe : public Error
|
||||||
m_Header;
|
m_Header;
|
||||||
|
|
||||||
// Xbe header extra byte (used to preserve unknown data)
|
// Xbe header extra byte (used to preserve unknown data)
|
||||||
char *m_HeaderEx;
|
char *m_HeaderEx;
|
||||||
|
|
||||||
// Xbe certificate
|
// Xbe certificate
|
||||||
#include "AlignPrefix1.h"
|
#include "AlignPrefix1.h"
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
bool Error::ClearError()
|
bool Error::ClearError()
|
||||||
{
|
{
|
||||||
if(m_bFatal)
|
if(m_bFatal)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
delete[] m_szError;
|
delete[] m_szError;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ static BOOL g_bHasChanges = FALSE;
|
||||||
VOID ShowControllerConfig(HWND hwnd)
|
VOID ShowControllerConfig(HWND hwnd)
|
||||||
{
|
{
|
||||||
/*! reset changes flag */
|
/*! reset changes flag */
|
||||||
g_bHasChanges = FALSE;
|
g_bHasChanges = FALSE;
|
||||||
|
|
||||||
/*! retrieve controller configuration */
|
/*! retrieve controller configuration */
|
||||||
g_EmuShared->GetXBController(&g_XBController);
|
g_EmuShared->GetXBController(&g_XBController);
|
||||||
|
@ -90,8 +90,8 @@ INT_PTR CALLBACK DlgControllerConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam,
|
||||||
case IDYES:
|
case IDYES:
|
||||||
PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_ACCEPT, 0);
|
PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_ACCEPT, 0);
|
||||||
break;
|
break;
|
||||||
case IDNO:
|
case IDNO:
|
||||||
PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0);
|
PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -99,7 +99,7 @@ INT_PTR CALLBACK DlgControllerConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam,
|
||||||
|
|
||||||
PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0);
|
PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
{
|
{
|
||||||
|
@ -273,7 +273,7 @@ VOID ConfigureInput(HWND hWndDlg, HWND hWndButton, XBCtrlObject object)
|
||||||
|
|
||||||
bConfigDone = false;
|
bConfigDone = false;
|
||||||
|
|
||||||
g_bHasChanges = TRUE;
|
g_bHasChanges = TRUE;
|
||||||
|
|
||||||
/*! disable all buttons */
|
/*! disable all buttons */
|
||||||
EnableButtonWindows(hWndDlg, hWndButton, FALSE);
|
EnableButtonWindows(hWndDlg, hWndButton, FALSE);
|
||||||
|
|
|
@ -154,8 +154,8 @@ INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR
|
||||||
case IDYES:
|
case IDYES:
|
||||||
PostMessage(hWndDlg, WM_COMMAND, IDC_VC_ACCEPT, 0);
|
PostMessage(hWndDlg, WM_COMMAND, IDC_VC_ACCEPT, 0);
|
||||||
break;
|
break;
|
||||||
case IDNO:
|
case IDNO:
|
||||||
PostMessage(hWndDlg, WM_COMMAND, IDC_VC_CANCEL, 0);
|
PostMessage(hWndDlg, WM_COMMAND, IDC_VC_CANCEL, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -120,7 +120,7 @@ cleanup:;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
|
if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
|
||||||
{
|
{
|
||||||
|
@ -165,16 +165,16 @@ LRESULT CALLBACK Wnd::WndProcForward(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
LRESULT CALLBACK Wnd::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK Wnd::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
{
|
{
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
break;
|
break;
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,8 @@ WndAbout::~WndAbout()
|
||||||
// window message processing procedure
|
// window message processing procedure
|
||||||
LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
{
|
{
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
// resize window so that client area := 400x300
|
// resize window so that client area := 400x300
|
||||||
|
@ -92,7 +92,7 @@ LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72);
|
int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72);
|
||||||
|
|
||||||
m_hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_ROMAN, "Verdana");
|
m_hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_ROMAN, "Verdana");
|
||||||
|
|
||||||
m_BackBmp = CreateCompatibleBitmap(hDC, 400, 300);
|
m_BackBmp = CreateCompatibleBitmap(hDC, 400, 300);
|
||||||
|
|
||||||
|
@ -166,21 +166,21 @@ LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
SendMessage(hwnd, WM_CLOSE, 0, 0);
|
SendMessage(hwnd, WM_CLOSE, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
EnableWindow(m_parent, TRUE);
|
EnableWindow(m_parent, TRUE);
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
DeleteObject(m_hFont);
|
DeleteObject(m_hFont);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -64,7 +64,7 @@ class WndAbout : public Wnd
|
||||||
HDC m_BackDC;
|
HDC m_BackDC;
|
||||||
HBITMAP m_OrigBmp;
|
HBITMAP m_OrigBmp;
|
||||||
HBITMAP m_BackBmp;
|
HBITMAP m_BackBmp;
|
||||||
HFONT m_hFont;
|
HFONT m_hFont;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -52,8 +52,8 @@ WndMain::WndMain(HINSTANCE x_hInstance) : Wnd(x_hInstance), m_bCreated(false), m
|
||||||
m_w = 640;
|
m_w = 640;
|
||||||
m_h = 480;
|
m_h = 480;
|
||||||
|
|
||||||
m_ExeFilename = (char*)calloc(1, 260);
|
m_ExeFilename = (char*)calloc(1, 260);
|
||||||
m_XbeFilename = (char*)calloc(1, 260);
|
m_XbeFilename = (char*)calloc(1, 260);
|
||||||
|
|
||||||
m_CxbxDebugFilename = (char*)calloc(1, 260);
|
m_CxbxDebugFilename = (char*)calloc(1, 260);
|
||||||
m_KrnlDebugFilename = (char*)calloc(1, 260);
|
m_KrnlDebugFilename = (char*)calloc(1, 260);
|
||||||
|
@ -214,8 +214,8 @@ WndMain::~WndMain()
|
||||||
// window message processing procedure
|
// window message processing procedure
|
||||||
LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
{
|
{
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
// initialize menu
|
// initialize menu
|
||||||
|
@ -240,7 +240,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize back buffer
|
// initialize back buffer
|
||||||
{
|
{
|
||||||
HDC hDC = GetDC(hwnd);
|
HDC hDC = GetDC(hwnd);
|
||||||
|
|
||||||
m_BackBmp = CreateCompatibleBitmap(hDC, 640, 480);
|
m_BackBmp = CreateCompatibleBitmap(hDC, 640, 480);
|
||||||
|
@ -358,29 +358,29 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
HDC hDC = GetDC(hwnd);
|
HDC hDC = GetDC(hwnd);
|
||||||
|
|
||||||
// draw splash / logo / status
|
// draw splash / logo / status
|
||||||
{
|
{
|
||||||
static const int nLogoBmpW = 100, nLogoBmpH = 17;
|
static const int nLogoBmpW = 100, nLogoBmpH = 17;
|
||||||
|
|
||||||
BitBlt(hDC, 0, 0, 640, 480, m_BackDC, 0, 0, SRCCOPY);
|
BitBlt(hDC, 0, 0, 640, 480, m_BackDC, 0, 0, SRCCOPY);
|
||||||
// BitBlt(hDC, 0, 10, 320, 160, m_BackDC, 0, 0, SRCCOPY);
|
// BitBlt(hDC, 0, 10, 320, 160, m_BackDC, 0, 0, SRCCOPY);
|
||||||
BitBlt(hDC, 640-nLogoBmpW-4, 480-nLogoBmpH-4, nLogoBmpW, nLogoBmpH, m_LogoDC, 0, 0, SRCCOPY);
|
BitBlt(hDC, 640-nLogoBmpW-4, 480-nLogoBmpH-4, nLogoBmpW, nLogoBmpH, m_LogoDC, 0, 0, SRCCOPY);
|
||||||
|
|
||||||
int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72);
|
int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72);
|
||||||
|
|
||||||
HFONT hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_ROMAN, "Verdana");
|
HFONT hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_ROMAN, "Verdana");
|
||||||
|
|
||||||
HGDIOBJ tmpObj = SelectObject(hDC, hFont);
|
HGDIOBJ tmpObj = SelectObject(hDC, hFont);
|
||||||
|
|
||||||
SetBkColor(hDC, RGB(0,0,0));
|
SetBkColor(hDC, RGB(0,0,0));
|
||||||
|
|
||||||
SetTextColor(hDC, RGB(255,255,255));
|
SetTextColor(hDC, RGB(255,255,255));
|
||||||
|
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
|
|
||||||
if(m_Xbe != 0 && m_Xbe->GetError() == 0)
|
if(m_Xbe != 0 && m_Xbe->GetError() == 0)
|
||||||
sprintf(buffer, "%s Loaded!", m_Xbe->m_szAsciiTitle);
|
sprintf(buffer, "%s Loaded!", m_Xbe->m_szAsciiTitle);
|
||||||
else
|
else
|
||||||
sprintf(buffer, "%s", "Disclaimer: Cxbx has no affiliation with Microsoft");
|
sprintf(buffer, "%s", "Disclaimer: Cxbx has no affiliation with Microsoft");
|
||||||
|
|
||||||
RECT rect = {0, 480-15-5, 640-100-4-69, 480-5};
|
RECT rect = {0, 480-15-5, 640-100-4-69, 480-5};
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
SelectObject(hDC, tmpObj);
|
SelectObject(hDC, tmpObj);
|
||||||
|
|
||||||
DeleteObject(hFont);
|
DeleteObject(hFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hDC != NULL)
|
if(hDC != NULL)
|
||||||
ReleaseDC(hwnd, hDC);
|
ReleaseDC(hwnd, hDC);
|
||||||
|
@ -468,20 +468,20 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
case ID_FILE_CLOSE_XBE:
|
case ID_FILE_CLOSE_XBE:
|
||||||
CloseXbe();
|
CloseXbe();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_FILE_SAVEXBEFILE:
|
case ID_FILE_SAVEXBEFILE:
|
||||||
{
|
{
|
||||||
if(m_XbeFilename[0] == '\0')
|
if(m_XbeFilename[0] == '\0')
|
||||||
SaveXbeAs();
|
SaveXbeAs();
|
||||||
else
|
else
|
||||||
SaveXbe(m_XbeFilename);
|
SaveXbe(m_XbeFilename);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_FILE_SAVEXBEFILEAS:
|
case ID_FILE_SAVEXBEFILEAS:
|
||||||
SaveXbeAs();
|
SaveXbeAs();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_FILE_IMPORTFROMEXE:
|
case ID_FILE_IMPORTFROMEXE:
|
||||||
{
|
{
|
||||||
|
@ -585,43 +585,43 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
SendMessage(hwnd, WM_CLOSE, 0, 0);
|
SendMessage(hwnd, WM_CLOSE, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_EDIT_LOGOBITMAP_EXPORT:
|
case ID_EDIT_LOGOBITMAP_EXPORT:
|
||||||
{
|
{
|
||||||
OPENFILENAME ofn = {0};
|
OPENFILENAME ofn = {0};
|
||||||
|
|
||||||
char filename[260] = "logo.bmp";
|
char filename[260] = "logo.bmp";
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Bitmap Image Files (*.bmp)\0*.bmp\0";
|
ofn.lpstrFilter = "Bitmap Image Files (*.bmp)\0*.bmp\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "bmp";
|
ofn.lpstrDefExt = "bmp";
|
||||||
ofn.lpstrTitle = "Export Logo Bitmap";
|
ofn.lpstrTitle = "Export Logo Bitmap";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetSaveFileName(&ofn) == TRUE)
|
if(GetSaveFileName(&ofn) == TRUE)
|
||||||
{
|
{
|
||||||
// ask permission to overwrite if file already exists
|
// ask permission to overwrite if file already exists
|
||||||
if(_access(ofn.lpstrFile, 0) != -1)
|
if(_access(ofn.lpstrFile, 0) != -1)
|
||||||
{
|
{
|
||||||
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// export logo bitmap
|
// export logo bitmap
|
||||||
{
|
{
|
||||||
uint08 i_gray[100*17];
|
uint08 i_gray[100*17];
|
||||||
|
|
||||||
m_Xbe->ExportLogoBitmap(i_gray);
|
m_Xbe->ExportLogoBitmap(i_gray);
|
||||||
|
|
||||||
if(m_Xbe->GetError() == 0)
|
if(m_Xbe->GetError() == 0)
|
||||||
{
|
{
|
||||||
FILE *LogoBitmap = fopen(ofn.lpstrFile, "wb");
|
FILE *LogoBitmap = fopen(ofn.lpstrFile, "wb");
|
||||||
|
|
||||||
// write bitmap header
|
// write bitmap header
|
||||||
{
|
{
|
||||||
|
@ -676,11 +676,11 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
fwrite(&pad, 2, 1, LogoBitmap);
|
fwrite(&pad, 2, 1, LogoBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(LogoBitmap);
|
fclose(LogoBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_Xbe->GetError() != 0)
|
if(m_Xbe->GetError() != 0)
|
||||||
MessageBox(m_hwnd, m_Xbe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
MessageBox(m_hwnd, m_Xbe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
|
@ -690,40 +690,40 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
MessageBox(m_hwnd, buffer, "Cxbx", MB_ICONINFORMATION | MB_OK);
|
MessageBox(m_hwnd, buffer, "Cxbx", MB_ICONINFORMATION | MB_OK);
|
||||||
|
|
||||||
printf("WndMain: %s\n", buffer);
|
printf("WndMain: %s\n", buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_EDIT_LOGOBITMAP_IMPORT:
|
case ID_EDIT_LOGOBITMAP_IMPORT:
|
||||||
{
|
{
|
||||||
OPENFILENAME ofn = {0};
|
OPENFILENAME ofn = {0};
|
||||||
|
|
||||||
char filename[260] = "*.bmp";
|
char filename[260] = "*.bmp";
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Bitmap Image Files (*.bmp)\0*.bmp\0";
|
ofn.lpstrFilter = "Bitmap Image Files (*.bmp)\0*.bmp\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "bmp";
|
ofn.lpstrDefExt = "bmp";
|
||||||
ofn.lpstrTitle = "Import Logo Bitmap";
|
ofn.lpstrTitle = "Import Logo Bitmap";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetOpenFileName(&ofn) == TRUE)
|
if(GetOpenFileName(&ofn) == TRUE)
|
||||||
{
|
{
|
||||||
// import logo bitmap
|
// import logo bitmap
|
||||||
{
|
{
|
||||||
uint08 i_gray[100*17];
|
uint08 i_gray[100*17];
|
||||||
|
|
||||||
// read bitmap file
|
// read bitmap file
|
||||||
{
|
{
|
||||||
FILE *logo = fopen(ofn.lpstrFile, "rb");
|
FILE *logo = fopen(ofn.lpstrFile, "rb");
|
||||||
|
|
||||||
char *bmp_err = 0;
|
char *bmp_err = 0;
|
||||||
|
|
||||||
|
@ -771,11 +771,11 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Xbe->ImportLogoBitmap(i_gray);
|
m_Xbe->ImportLogoBitmap(i_gray);
|
||||||
|
|
||||||
if(m_Xbe->GetError() != 0)
|
if(m_Xbe->GetError() != 0)
|
||||||
{
|
{
|
||||||
MessageBox(m_hwnd, m_Xbe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
MessageBox(m_hwnd, m_Xbe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
||||||
|
|
||||||
if(m_Xbe->IsFatal())
|
if(m_Xbe->IsFatal())
|
||||||
CloseXbe();
|
CloseXbe();
|
||||||
|
@ -796,11 +796,11 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
printf("WndMain: %s\n", buffer);
|
printf("WndMain: %s\n", buffer);
|
||||||
|
|
||||||
MessageBox(m_hwnd, buffer, "Cxbx", MB_ICONINFORMATION | MB_OK);
|
MessageBox(m_hwnd, buffer, "Cxbx", MB_ICONINFORMATION | MB_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_EDIT_PATCH_ALLOW64MB:
|
case ID_EDIT_PATCH_ALLOW64MB:
|
||||||
{
|
{
|
||||||
|
@ -858,28 +858,28 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
OPENFILENAME ofn = {0};
|
OPENFILENAME ofn = {0};
|
||||||
|
|
||||||
char filename[260] = "Xbe.txt";
|
char filename[260] = "Xbe.txt";
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
|
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "txt";
|
ofn.lpstrDefExt = "txt";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetSaveFileName(&ofn) == TRUE)
|
if(GetSaveFileName(&ofn) == TRUE)
|
||||||
{
|
{
|
||||||
// ask permission to overwrite if file exists
|
// ask permission to overwrite if file exists
|
||||||
if(_access(ofn.lpstrFile, 0) != -1)
|
if(_access(ofn.lpstrFile, 0) != -1)
|
||||||
{
|
{
|
||||||
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dump xbe information to file
|
// dump xbe information to file
|
||||||
{
|
{
|
||||||
|
@ -973,21 +973,21 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
OPENFILENAME ofn = {0};
|
OPENFILENAME ofn = {0};
|
||||||
|
|
||||||
char filename[260] = "KrnlDebug.txt";
|
char filename[260] = "KrnlDebug.txt";
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
|
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "txt";
|
ofn.lpstrDefExt = "txt";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetSaveFileName(&ofn) != FALSE)
|
if(GetSaveFileName(&ofn) != FALSE)
|
||||||
{
|
{
|
||||||
MessageBox(m_hwnd, "This will not take effect until emulation is (re)started.\n", "Cxbx", MB_OK);
|
MessageBox(m_hwnd, "This will not take effect until emulation is (re)started.\n", "Cxbx", MB_OK);
|
||||||
|
|
||||||
|
@ -1006,7 +1006,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE:
|
case ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE:
|
||||||
{
|
{
|
||||||
if(m_CxbxDebug == DM_NONE || m_CxbxDebug == DM_FILE)
|
if(m_CxbxDebug == DM_NONE || m_CxbxDebug == DM_FILE)
|
||||||
m_CxbxDebug = DM_CONSOLE;
|
m_CxbxDebug = DM_CONSOLE;
|
||||||
else
|
else
|
||||||
|
@ -1015,8 +1015,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
RefreshMenus();
|
RefreshMenus();
|
||||||
|
|
||||||
UpdateDebugConsoles();
|
UpdateDebugConsoles();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_EMULATION_DEBUGOUTPUTGUI_FILE:
|
case ID_EMULATION_DEBUGOUTPUTGUI_FILE:
|
||||||
{
|
{
|
||||||
|
@ -1032,21 +1032,21 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
OPENFILENAME ofn = {0};
|
OPENFILENAME ofn = {0};
|
||||||
|
|
||||||
char filename[260] = "CxbxDebug.txt";
|
char filename[260] = "CxbxDebug.txt";
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
|
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "txt";
|
ofn.lpstrDefExt = "txt";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetSaveFileName(&ofn) != FALSE)
|
if(GetSaveFileName(&ofn) != FALSE)
|
||||||
{
|
{
|
||||||
strncpy(m_CxbxDebugFilename, ofn.lpstrFile, 259);
|
strncpy(m_CxbxDebugFilename, ofn.lpstrFile, 259);
|
||||||
|
|
||||||
|
@ -1143,7 +1143,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
DeleteObject(m_BackBmp);
|
DeleteObject(m_BackBmp);
|
||||||
|
|
||||||
ReleaseDC(hwnd, hDC);
|
ReleaseDC(hwnd, hDC);
|
||||||
|
|
||||||
delete m_Xbe;
|
delete m_Xbe;
|
||||||
|
|
||||||
|
@ -1154,8 +1154,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1243,16 +1243,16 @@ void WndMain::RefreshMenus()
|
||||||
|
|
||||||
// file menu
|
// file menu
|
||||||
{
|
{
|
||||||
HMENU file_menu = GetSubMenu(menu, 0);
|
HMENU file_menu = GetSubMenu(menu, 0);
|
||||||
|
|
||||||
// enable/disable close .xbe file
|
// enable/disable close .xbe file
|
||||||
EnableMenuItem(file_menu, ID_FILE_CLOSE_XBE, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
EnableMenuItem(file_menu, ID_FILE_CLOSE_XBE, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
||||||
|
|
||||||
// enable/disable save .xbe file
|
// enable/disable save .xbe file
|
||||||
EnableMenuItem(file_menu, ID_FILE_SAVEXBEFILE, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
EnableMenuItem(file_menu, ID_FILE_SAVEXBEFILE, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
||||||
|
|
||||||
// enable/disable save .xbe file as
|
// enable/disable save .xbe file as
|
||||||
EnableMenuItem(file_menu, ID_FILE_SAVEXBEFILEAS, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
EnableMenuItem(file_menu, ID_FILE_SAVEXBEFILEAS, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
||||||
|
|
||||||
// enable/disable export to .exe
|
// enable/disable export to .exe
|
||||||
EnableMenuItem(file_menu, ID_FILE_EXPORTTOEXE, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
EnableMenuItem(file_menu, ID_FILE_EXPORTTOEXE, MF_BYCOMMAND | (m_Xbe == 0) ? MF_GRAYED : MF_ENABLED);
|
||||||
|
@ -1356,7 +1356,7 @@ void WndMain::RefreshMenus()
|
||||||
HMENU sett_menu = GetSubMenu(menu, 3);
|
HMENU sett_menu = GetSubMenu(menu, 3);
|
||||||
HMENU auto_menu = GetSubMenu(sett_menu, 4);
|
HMENU auto_menu = GetSubMenu(sett_menu, 4);
|
||||||
|
|
||||||
// check appropriate choice
|
// check appropriate choice
|
||||||
if(m_AutoConvertToExe == AUTO_CONVERT_WINDOWS_TEMP)
|
if(m_AutoConvertToExe == AUTO_CONVERT_WINDOWS_TEMP)
|
||||||
{
|
{
|
||||||
CheckMenuItem(auto_menu, ID_SETTINGS_GENWT, MF_BYCOMMAND | MF_CHECKED);
|
CheckMenuItem(auto_menu, ID_SETTINGS_GENWT, MF_BYCOMMAND | MF_CHECKED);
|
||||||
|
@ -1618,18 +1618,18 @@ void WndMain::CloseXbe()
|
||||||
void WndMain::SaveXbe(const char *x_filename)
|
void WndMain::SaveXbe(const char *x_filename)
|
||||||
{
|
{
|
||||||
// ask permission to overwrite if the file already exists
|
// ask permission to overwrite if the file already exists
|
||||||
if(_access(x_filename, 0) != -1)
|
if(_access(x_filename, 0) != -1)
|
||||||
{
|
{
|
||||||
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// export xbe file
|
// export xbe file
|
||||||
{
|
{
|
||||||
m_Xbe->Export(x_filename);
|
m_Xbe->Export(x_filename);
|
||||||
|
|
||||||
if(m_Xbe->GetError() != 0)
|
if(m_Xbe->GetError() != 0)
|
||||||
MessageBox(m_hwnd, m_Xbe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
MessageBox(m_hwnd, m_Xbe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
|
@ -1641,8 +1641,8 @@ void WndMain::SaveXbe(const char *x_filename)
|
||||||
MessageBox(m_hwnd, buffer, "Cxbx", MB_ICONINFORMATION | MB_OK);
|
MessageBox(m_hwnd, buffer, "Cxbx", MB_ICONINFORMATION | MB_OK);
|
||||||
|
|
||||||
m_bXbeChanged = false;
|
m_bXbeChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// save xbe as
|
// save xbe as
|
||||||
|
@ -1650,24 +1650,24 @@ void WndMain::SaveXbeAs()
|
||||||
{
|
{
|
||||||
OPENFILENAME ofn = {0};
|
OPENFILENAME ofn = {0};
|
||||||
|
|
||||||
char filename[260] = "default.xbe";
|
char filename[260] = "default.xbe";
|
||||||
|
|
||||||
SuggestFilename(m_XbeFilename, filename, ".xbe");
|
SuggestFilename(m_XbeFilename, filename, ".xbe");
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Xbox Executables (*.xbe)\0*.xbe\0";
|
ofn.lpstrFilter = "Xbox Executables (*.xbe)\0*.xbe\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "xbe";
|
ofn.lpstrDefExt = "xbe";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetSaveFileName(&ofn) == TRUE)
|
if(GetSaveFileName(&ofn) == TRUE)
|
||||||
SaveXbe(ofn.lpstrFile);
|
SaveXbe(ofn.lpstrFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// import an exe file
|
// import an exe file
|
||||||
|
@ -1758,7 +1758,7 @@ void WndMain::ImportExe(const char *x_filename)
|
||||||
// convert to exe file
|
// convert to exe file
|
||||||
bool WndMain::ConvertToExe(const char *x_filename, bool x_bVerifyIfExists, HWND hwndParent)
|
bool WndMain::ConvertToExe(const char *x_filename, bool x_bVerifyIfExists, HWND hwndParent)
|
||||||
{
|
{
|
||||||
char filename[260] = "default.exe";
|
char filename[260] = "default.exe";
|
||||||
|
|
||||||
if(x_filename == NULL)
|
if(x_filename == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1767,18 +1767,18 @@ bool WndMain::ConvertToExe(const char *x_filename, bool x_bVerifyIfExists, HWND
|
||||||
SuggestFilename(m_XbeFilename, filename, ".exe");
|
SuggestFilename(m_XbeFilename, filename, ".exe");
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
ofn.hwndOwner = m_hwnd;
|
ofn.hwndOwner = m_hwnd;
|
||||||
ofn.lpstrFilter = "Windows Executables (*.exe)\0*.exe\0";
|
ofn.lpstrFilter = "Windows Executables (*.exe)\0*.exe\0";
|
||||||
ofn.lpstrFile = filename;
|
ofn.lpstrFile = filename;
|
||||||
ofn.nMaxFile = 260;
|
ofn.nMaxFile = 260;
|
||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = NULL;
|
ofn.lpstrFileTitle = NULL;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = NULL;
|
ofn.lpstrInitialDir = NULL;
|
||||||
ofn.lpstrDefExt = "exe";
|
ofn.lpstrDefExt = "exe";
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if(GetSaveFileName(&ofn) == FALSE)
|
if(GetSaveFileName(&ofn) == FALSE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
strcpy(filename, ofn.lpstrFile);
|
strcpy(filename, ofn.lpstrFile);
|
||||||
|
@ -1789,24 +1789,24 @@ bool WndMain::ConvertToExe(const char *x_filename, bool x_bVerifyIfExists, HWND
|
||||||
}
|
}
|
||||||
|
|
||||||
// ask permission to overwrite if this file already exists
|
// ask permission to overwrite if this file already exists
|
||||||
if(x_bVerifyIfExists)
|
if(x_bVerifyIfExists)
|
||||||
{
|
{
|
||||||
if(_access(filename, 0) != -1)
|
if(_access(filename, 0) != -1)
|
||||||
{
|
{
|
||||||
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert file
|
// convert file
|
||||||
{
|
{
|
||||||
EmuExe i_EmuExe(m_Xbe, m_KrnlDebug, m_KrnlDebugFilename, hwndParent);
|
EmuExe i_EmuExe(m_Xbe, m_KrnlDebug, m_KrnlDebugFilename, hwndParent);
|
||||||
|
|
||||||
i_EmuExe.Export(filename);
|
i_EmuExe.Export(filename);
|
||||||
|
|
||||||
if(i_EmuExe.GetError() != 0)
|
if(i_EmuExe.GetError() != 0)
|
||||||
{
|
{
|
||||||
MessageBox(m_hwnd, i_EmuExe.GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
MessageBox(m_hwnd, i_EmuExe.GetError(), "Cxbx", MB_ICONSTOP | MB_OK);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1817,7 +1817,7 @@ bool WndMain::ConvertToExe(const char *x_filename, bool x_bVerifyIfExists, HWND
|
||||||
|
|
||||||
m_bExeChanged = false;
|
m_bExeChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ extern int EmuException(LPEXCEPTION_POINTERS e)
|
||||||
//if(e->ContextRecord->Ecx == 0x00000200 || e->ContextRecord->Ecx == 0x00000100)
|
//if(e->ContextRecord->Ecx == 0x00000200 || e->ContextRecord->Ecx == 0x00000100)
|
||||||
//{
|
//{
|
||||||
// Battlestar Galactica WBINVD skip
|
// Battlestar Galactica WBINVD skip
|
||||||
e->ContextRecord->Eip += 2;
|
e->ContextRecord->Eip += 2;
|
||||||
|
|
||||||
DbgPrintf("EmuMain (0x%X): Battlestar Galactica Hack 1 was applied!\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain (0x%X): Battlestar Galactica Hack 1 was applied!\n", GetCurrentThreadId());
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ VOID XTL::EmuD3DInit(Xbe::Header *XbeHeader, uint32 XbeHeaderSize)
|
||||||
g_pD3D8->GetDeviceCaps(g_XBVideo.GetDisplayAdapter(), DevType, &g_D3DCaps);
|
g_pD3D8->GetDeviceCaps(g_XBVideo.GetDisplayAdapter(), DevType, &g_D3DCaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetFocus(g_hEmuWindow);
|
SetFocus(g_hEmuWindow);
|
||||||
|
|
||||||
// create default device
|
// create default device
|
||||||
{
|
{
|
||||||
|
@ -363,7 +363,7 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid)
|
||||||
|
|
||||||
DbgPrintf("EmuD3D8 (0x%X): Message-Pump thread is running.\n", GetCurrentThreadId());
|
DbgPrintf("EmuD3D8 (0x%X): Message-Pump thread is running.\n", GetCurrentThreadId());
|
||||||
|
|
||||||
SetFocus(g_hEmuWindow);
|
SetFocus(g_hEmuWindow);
|
||||||
|
|
||||||
DbgConsole *dbgConsole = new DbgConsole();
|
DbgConsole *dbgConsole = new DbgConsole();
|
||||||
|
|
||||||
|
@ -1688,7 +1688,7 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_BeginStateBig()
|
||||||
|
|
||||||
//ULONG ret = g_pD3DDevice8->BeginStateBlock();
|
//ULONG ret = g_pD3DDevice8->BeginStateBlock();
|
||||||
|
|
||||||
CxbxKrnlCleanup("BeginStateBig is not implemented");
|
CxbxKrnlCleanup("BeginStateBig is not implemented");
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
|
@ -2724,11 +2724,11 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetPixelShader
|
||||||
|
|
||||||
if(dwHandle == 0)
|
if(dwHandle == 0)
|
||||||
{
|
{
|
||||||
// simplest possible pixel shader, simply output the texture input
|
// simplest possible pixel shader, simply output the texture input
|
||||||
static const char szDiffusePixelShader[] =
|
static const char szDiffusePixelShader[] =
|
||||||
"ps.1.0\n"
|
"ps.1.0\n"
|
||||||
"tex t0\n"
|
"tex t0\n"
|
||||||
"mov r0, t0\n";
|
"mov r0, t0\n";
|
||||||
|
|
||||||
LPD3DXBUFFER pShader = 0;
|
LPD3DXBUFFER pShader = 0;
|
||||||
LPD3DXBUFFER pErrors = 0;
|
LPD3DXBUFFER pErrors = 0;
|
||||||
|
@ -3452,9 +3452,9 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_GetDisplayMode
|
||||||
// TODO: Make this configurable in the future?
|
// TODO: Make this configurable in the future?
|
||||||
pMode->Flags = 0x000000A1; // D3DPRESENTFLAG_FIELD | D3DPRESENTFLAG_INTERLACED | D3DPRESENTFLAG_LOCKABLE_BACKBUFFER
|
pMode->Flags = 0x000000A1; // D3DPRESENTFLAG_FIELD | D3DPRESENTFLAG_INTERLACED | D3DPRESENTFLAG_LOCKABLE_BACKBUFFER
|
||||||
|
|
||||||
// TODO: Retrieve from current CreateDevice settings?
|
// TODO: Retrieve from current CreateDevice settings?
|
||||||
pMode->Width = 640;
|
pMode->Width = 640;
|
||||||
pMode->Height = 457; // Battlestar Galactica PAL Version
|
pMode->Height = 457; // Battlestar Galactica PAL Version
|
||||||
}
|
}
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
@ -4122,7 +4122,7 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register
|
||||||
|
|
||||||
X_D3DFORMAT X_Format = (X_D3DFORMAT)((pPixelContainer->Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT);
|
X_D3DFORMAT X_Format = (X_D3DFORMAT)((pPixelContainer->Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT);
|
||||||
D3DFORMAT Format = EmuXB2PC_D3DFormat(X_Format);
|
D3DFORMAT Format = EmuXB2PC_D3DFormat(X_Format);
|
||||||
D3DFORMAT CacheFormat;
|
D3DFORMAT CacheFormat;
|
||||||
// TODO: check for dimensions
|
// TODO: check for dimensions
|
||||||
|
|
||||||
// TODO: HACK: Temporary?
|
// TODO: HACK: Temporary?
|
||||||
|
@ -4301,15 +4301,15 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register
|
||||||
dwMipMapLevels = 3;
|
dwMipMapLevels = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK
|
// HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK
|
||||||
// Since most modern graphics cards does not support
|
// Since most modern graphics cards does not support
|
||||||
// palette based textures we need to expand it to
|
// palette based textures we need to expand it to
|
||||||
// ARGB texture format
|
// ARGB texture format
|
||||||
if (Format == D3DFMT_P8) //Palette
|
if (Format == D3DFMT_P8) //Palette
|
||||||
{
|
{
|
||||||
CacheFormat = Format; // Save this for later
|
CacheFormat = Format; // Save this for later
|
||||||
Format = D3DFMT_A8R8G8B8; // ARGB
|
Format = D3DFMT_A8R8G8B8; // ARGB
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bCubemap)
|
if(bCubemap)
|
||||||
{
|
{
|
||||||
|
@ -4409,69 +4409,69 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (CacheFormat == D3DFMT_P8) //Palette
|
if (CacheFormat == D3DFMT_P8) //Palette
|
||||||
{
|
{
|
||||||
EmuWarning("Unsupported texture format D3DFMT_P8,\nexpanding to D3DFMT_A8R8G8B8");
|
EmuWarning("Unsupported texture format D3DFMT_P8,\nexpanding to D3DFMT_A8R8G8B8");
|
||||||
|
|
||||||
//
|
//
|
||||||
// create texture resource
|
// create texture resource
|
||||||
//
|
//
|
||||||
BYTE *pPixelData = (BYTE*)LockedRect.pBits;
|
BYTE *pPixelData = (BYTE*)LockedRect.pBits;
|
||||||
DWORD dwDataSize = dwMipWidth*dwMipHeight*4;
|
DWORD dwDataSize = dwMipWidth*dwMipHeight*4;
|
||||||
DWORD dwPaletteSize = 256*4; // Note: This is not allways true, it can be 256- 128- 64- or 32*4
|
DWORD dwPaletteSize = 256*4; // Note: This is not allways true, it can be 256- 128- 64- or 32*4
|
||||||
|
|
||||||
BYTE* pTextureCache = (BYTE*)CxbxMalloc(dwDataSize);
|
BYTE* pTextureCache = (BYTE*)CxbxMalloc(dwDataSize);
|
||||||
BYTE* pExpandedTexture = (BYTE*)CxbxMalloc(dwDataSize);
|
BYTE* pExpandedTexture = (BYTE*)CxbxMalloc(dwDataSize);
|
||||||
BYTE* pTexturePalette = (BYTE*)CxbxMalloc(256*4);
|
BYTE* pTexturePalette = (BYTE*)CxbxMalloc(256*4);
|
||||||
|
|
||||||
// First we need to unswizzle the texture data
|
// First we need to unswizzle the texture data
|
||||||
XTL::EmuXGUnswizzleRect
|
XTL::EmuXGUnswizzleRect
|
||||||
(
|
(
|
||||||
pSrc + dwMipOffs, dwMipWidth, dwMipHeight, dwDepth, LockedRect.pBits,
|
pSrc + dwMipOffs, dwMipWidth, dwMipHeight, dwDepth, LockedRect.pBits,
|
||||||
LockedRect.Pitch, iRect, iPoint, dwBPP
|
LockedRect.Pitch, iRect, iPoint, dwBPP
|
||||||
);
|
);
|
||||||
|
|
||||||
// Copy the unswizzled data to a temporary buffer
|
// Copy the unswizzled data to a temporary buffer
|
||||||
memcpy(pTextureCache, pPixelData, dwDataSize);
|
memcpy(pTextureCache, pPixelData, dwDataSize);
|
||||||
|
|
||||||
// Copy the currently selected palette's data to the buffer
|
// Copy the currently selected palette's data to the buffer
|
||||||
memcpy(pTexturePalette, pCurrentPalette, dwPaletteSize);
|
memcpy(pTexturePalette, pCurrentPalette, dwPaletteSize);
|
||||||
|
|
||||||
unsigned int w = 0;
|
unsigned int w = 0;
|
||||||
unsigned int c = 0;
|
unsigned int c = 0;
|
||||||
unsigned char p = 0;
|
unsigned char p = 0;
|
||||||
for (unsigned int y = 0;y < dwDataSize/4;y++)
|
for (unsigned int y = 0;y < dwDataSize/4;y++)
|
||||||
{
|
{
|
||||||
if(c == dwMipWidth)
|
if(c == dwMipWidth)
|
||||||
{
|
{
|
||||||
w += dwMipWidth*3;
|
w += dwMipWidth*3;
|
||||||
c = 0;
|
c = 0;
|
||||||
}
|
}
|
||||||
p = (unsigned char)pTextureCache[w];
|
p = (unsigned char)pTextureCache[w];
|
||||||
pExpandedTexture[y*4+0] = pTexturePalette[p*4+0];
|
pExpandedTexture[y*4+0] = pTexturePalette[p*4+0];
|
||||||
pExpandedTexture[y*4+1] = pTexturePalette[p*4+1];
|
pExpandedTexture[y*4+1] = pTexturePalette[p*4+1];
|
||||||
pExpandedTexture[y*4+2] = pTexturePalette[p*4+2];
|
pExpandedTexture[y*4+2] = pTexturePalette[p*4+2];
|
||||||
pExpandedTexture[y*4+3] = pTexturePalette[p*4+3];
|
pExpandedTexture[y*4+3] = pTexturePalette[p*4+3];
|
||||||
w++;
|
w++;
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the expanded texture back to the buffer
|
// Copy the expanded texture back to the buffer
|
||||||
memcpy(pPixelData, pExpandedTexture, dwDataSize);
|
memcpy(pPixelData, pExpandedTexture, dwDataSize);
|
||||||
|
|
||||||
// Flush unused data buffers
|
// Flush unused data buffers
|
||||||
CxbxFree(pTexturePalette);
|
CxbxFree(pTexturePalette);
|
||||||
CxbxFree(pExpandedTexture);
|
CxbxFree(pExpandedTexture);
|
||||||
CxbxFree(pTextureCache);
|
CxbxFree(pTextureCache);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XTL::EmuXGUnswizzleRect
|
XTL::EmuXGUnswizzleRect
|
||||||
(
|
(
|
||||||
pSrc + dwMipOffs, dwMipWidth, dwMipHeight, dwDepth, LockedRect.pBits,
|
pSrc + dwMipOffs, dwMipWidth, dwMipHeight, dwDepth, LockedRect.pBits,
|
||||||
LockedRect.Pitch, iRect, iPoint, dwBPP
|
LockedRect.Pitch, iRect, iPoint, dwBPP
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(bCompressed)
|
else if(bCompressed)
|
||||||
|
@ -4568,7 +4568,7 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case X_D3DCOMMON_TYPE_PALETTE:
|
case X_D3DCOMMON_TYPE_PALETTE:
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuIDirect3DResource8_Register :-> Palette...\n");
|
DbgPrintf("EmuIDirect3DResource8_Register :-> Palette...\n");
|
||||||
|
|
||||||
|
@ -4586,7 +4586,7 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register
|
||||||
pPalette->Lock = X_D3DRESOURCE_LOCK_FLAG_NOSIZE;
|
pPalette->Lock = X_D3DRESOURCE_LOCK_FLAG_NOSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCurrentPalette = pBase;
|
pCurrentPalette = pBase;
|
||||||
|
|
||||||
pResource->Data = (ULONG)pBase;
|
pResource->Data = (ULONG)pBase;
|
||||||
}
|
}
|
||||||
|
@ -6706,7 +6706,7 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetTransform
|
||||||
g_bSkipPush = FALSE;
|
g_bSkipPush = FALSE;
|
||||||
printf("SkipPush OFF\n");
|
printf("SkipPush OFF\n");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
State = EmuXB2PC_D3DTS(State);
|
State = EmuXB2PC_D3DTS(State);
|
||||||
|
|
||||||
|
@ -6802,7 +6802,7 @@ BYTE* WINAPI XTL::EmuIDirect3DVertexBuffer8_Lock2
|
||||||
|
|
||||||
BYTE *pbData = NULL;
|
BYTE *pbData = NULL;
|
||||||
|
|
||||||
HRESULT hRet = pVertexBuffer8->Lock(0, 0, &pbData, EmuXB2PC_D3DLock(Flags)); // Fixed flags check, Battlestar Galactica now displays graphics correctly
|
HRESULT hRet = pVertexBuffer8->Lock(0, 0, &pbData, EmuXB2PC_D3DLock(Flags)); // Fixed flags check, Battlestar Galactica now displays graphics correctly
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
|
@ -6907,13 +6907,13 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetVertexShader
|
||||||
g_CurrentVertexShader = Handle;
|
g_CurrentVertexShader = Handle;
|
||||||
|
|
||||||
/* What have you been trying to do here?
|
/* What have you been trying to do here?
|
||||||
XTL::D3DXVECTOR4 vOffset;
|
XTL::D3DXVECTOR4 vOffset;
|
||||||
XTL::D3DXVECTOR4 vScale;
|
XTL::D3DXVECTOR4 vScale;
|
||||||
|
|
||||||
EmuSwapFS();
|
EmuSwapFS();
|
||||||
EmuIDirect3DDevice8_GetViewportOffsetAndScale(&vOffset, &vScale);
|
EmuIDirect3DDevice8_GetViewportOffsetAndScale(&vOffset, &vScale);
|
||||||
EmuSwapFS();
|
EmuSwapFS();
|
||||||
*/
|
*/
|
||||||
if(g_VertexShaderConstantMode != X_VSCM_NONERESERVED)
|
if(g_VertexShaderConstantMode != X_VSCM_NONERESERVED)
|
||||||
{
|
{
|
||||||
//g_pD3DDevice8->SetVertexShaderConstant( 58, &vScale, 1 );
|
//g_pD3DDevice8->SetVertexShaderConstant( 58, &vScale, 1 );
|
||||||
|
@ -7299,7 +7299,7 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_DrawIndexedVertices
|
||||||
|
|
||||||
VertPatch.Restore();
|
VertPatch.Restore();
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
@ -8118,7 +8118,7 @@ PVOID WINAPI XTL::EmuIDirect3D8_AllocContiguousMemory
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), dwSize,dwAllocAttributes);
|
GetCurrentThreadId(), dwSize,dwAllocAttributes);
|
||||||
|
|
||||||
//
|
//
|
||||||
// NOTE: Kludgey (but necessary) solution:
|
// NOTE: Kludgey (but necessary) solution:
|
||||||
//
|
//
|
||||||
// Since this memory must be aligned on a page boundary, we must allocate an extra page
|
// Since this memory must be aligned on a page boundary, we must allocate an extra page
|
||||||
|
@ -8166,7 +8166,7 @@ HRESULT WINAPI XTL::EmuIDirect3DTexture8_GetLevelDesc
|
||||||
|
|
||||||
EmuSwapFS(); // Xbox FS
|
EmuSwapFS(); // Xbox FS
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -8174,11 +8174,11 @@ HRESULT WINAPI XTL::EmuIDirect3DTexture8_GetLevelDesc
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirect3D8_CheckDeviceMultiSampleType
|
HRESULT WINAPI XTL::EmuIDirect3D8_CheckDeviceMultiSampleType
|
||||||
(
|
(
|
||||||
UINT Adapter,
|
UINT Adapter,
|
||||||
D3DDEVTYPE DeviceType,
|
D3DDEVTYPE DeviceType,
|
||||||
D3DFORMAT SurfaceFormat,
|
D3DFORMAT SurfaceFormat,
|
||||||
BOOL Windowed,
|
BOOL Windowed,
|
||||||
D3DMULTISAMPLE_TYPE MultiSampleType
|
D3DMULTISAMPLE_TYPE MultiSampleType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -8187,22 +8187,22 @@ HRESULT WINAPI XTL::EmuIDirect3D8_CheckDeviceMultiSampleType
|
||||||
"(\n"
|
"(\n"
|
||||||
" Adapter : 0x%.08X\n"
|
" Adapter : 0x%.08X\n"
|
||||||
" DeviceType : 0x%.08X\n"
|
" DeviceType : 0x%.08X\n"
|
||||||
" SurfaceFormat : 0x%.08X\n"
|
" SurfaceFormat : 0x%.08X\n"
|
||||||
" Windowed : 0x%.08X\n"
|
" Windowed : 0x%.08X\n"
|
||||||
" MultiSampleType : 0x%.08X\n"
|
" MultiSampleType : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType);
|
GetCurrentThreadId(), Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType);
|
||||||
|
|
||||||
if(Adapter != D3DADAPTER_DEFAULT)
|
if(Adapter != D3DADAPTER_DEFAULT)
|
||||||
{
|
{
|
||||||
EmuWarning("Adapter is not D3DADAPTER_DEFAULT, correcting!");
|
EmuWarning("Adapter is not D3DADAPTER_DEFAULT, correcting!");
|
||||||
Adapter = D3DADAPTER_DEFAULT;
|
Adapter = D3DADAPTER_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DeviceType == D3DDEVTYPE_FORCE_DWORD)
|
if(DeviceType == D3DDEVTYPE_FORCE_DWORD)
|
||||||
EmuWarning("DeviceType == D3DDEVTYPE_FORCE_DWORD");
|
EmuWarning("DeviceType == D3DDEVTYPE_FORCE_DWORD");
|
||||||
|
|
||||||
// Convert SurfaceFormat (Xbox->PC)
|
// Convert SurfaceFormat (Xbox->PC)
|
||||||
D3DFORMAT PCSurfaceFormat = EmuXB2PC_D3DFormat(SurfaceFormat);
|
D3DFORMAT PCSurfaceFormat = EmuXB2PC_D3DFormat(SurfaceFormat);
|
||||||
|
|
||||||
// TODO: HACK: Devices that don't support this should somehow emulate it!
|
// TODO: HACK: Devices that don't support this should somehow emulate it!
|
||||||
|
@ -8222,28 +8222,28 @@ HRESULT WINAPI XTL::EmuIDirect3D8_CheckDeviceMultiSampleType
|
||||||
PCSurfaceFormat = D3DFMT_X8R8G8B8;
|
PCSurfaceFormat = D3DFMT_X8R8G8B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Windowed != FALSE)
|
if(Windowed != FALSE)
|
||||||
Windowed = FALSE;
|
Windowed = FALSE;
|
||||||
|
|
||||||
// TODO: Convert from Xbox to PC!!
|
// TODO: Convert from Xbox to PC!!
|
||||||
if(MultiSampleType == 0x0011)
|
if(MultiSampleType == 0x0011)
|
||||||
MultiSampleType = D3DMULTISAMPLE_NONE;
|
MultiSampleType = D3DMULTISAMPLE_NONE;
|
||||||
else
|
else
|
||||||
CxbxKrnlCleanup("EmuIDirect3D8_CheckDeviceMultiSampleType Unknown MultiSampleType! (%d)", MultiSampleType);
|
CxbxKrnlCleanup("EmuIDirect3D8_CheckDeviceMultiSampleType Unknown MultiSampleType! (%d)", MultiSampleType);
|
||||||
|
|
||||||
// Now call the real CheckDeviceMultiSampleType with the corrected parameters.
|
// Now call the real CheckDeviceMultiSampleType with the corrected parameters.
|
||||||
HRESULT hRet = g_pD3D8->CheckDeviceMultiSampleType
|
HRESULT hRet = g_pD3D8->CheckDeviceMultiSampleType
|
||||||
(
|
(
|
||||||
Adapter,
|
Adapter,
|
||||||
DeviceType,
|
DeviceType,
|
||||||
SurfaceFormat,
|
SurfaceFormat,
|
||||||
Windowed,
|
Windowed,
|
||||||
MultiSampleType
|
MultiSampleType
|
||||||
);
|
);
|
||||||
|
|
||||||
EmuSwapFS(); // Xbox FS
|
EmuSwapFS(); // Xbox FS
|
||||||
|
|
||||||
return hRet;
|
return hRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -8251,9 +8251,9 @@ HRESULT WINAPI XTL::EmuIDirect3D8_CheckDeviceMultiSampleType
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirect3D8_GetDeviceCaps
|
HRESULT WINAPI XTL::EmuIDirect3D8_GetDeviceCaps
|
||||||
(
|
(
|
||||||
UINT Adapter,
|
UINT Adapter,
|
||||||
D3DDEVTYPE DeviceType,
|
D3DDEVTYPE DeviceType,
|
||||||
D3DCAPS8 *pCaps
|
D3DCAPS8 *pCaps
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -8261,8 +8261,8 @@ HRESULT WINAPI XTL::EmuIDirect3D8_GetDeviceCaps
|
||||||
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3D8_GetDeviceCaps\n"
|
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3D8_GetDeviceCaps\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" Adapter : 0x%.08X\n"
|
" Adapter : 0x%.08X\n"
|
||||||
" DeviceType : 0x%.08X\n"
|
" DeviceType : 0x%.08X\n"
|
||||||
" pCaps : 0x%.08X\n"
|
" pCaps : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), Adapter, DeviceType, pCaps);
|
GetCurrentThreadId(), Adapter, DeviceType, pCaps);
|
||||||
|
|
||||||
|
@ -8278,8 +8278,8 @@ HRESULT WINAPI XTL::EmuIDirect3D8_GetDeviceCaps
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirect3D8_SetPushBufferSize
|
HRESULT WINAPI XTL::EmuIDirect3D8_SetPushBufferSize
|
||||||
(
|
(
|
||||||
DWORD PushBufferSize,
|
DWORD PushBufferSize,
|
||||||
DWORD KickOffSize
|
DWORD KickOffSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -8287,11 +8287,11 @@ HRESULT WINAPI XTL::EmuIDirect3D8_SetPushBufferSize
|
||||||
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3D8_SetPushBufferSize\n"
|
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3D8_SetPushBufferSize\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" PushBufferSize : 0x%.08X\n"
|
" PushBufferSize : 0x%.08X\n"
|
||||||
" KickOffSize : 0x%.08X\n"
|
" KickOffSize : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), PushBufferSize, KickOffSize);
|
GetCurrentThreadId(), PushBufferSize, KickOffSize);
|
||||||
|
|
||||||
HRESULT hRet = D3D_OK;
|
HRESULT hRet = D3D_OK;
|
||||||
|
|
||||||
// This is a Xbox extension, meaning there is no pc counterpart.
|
// This is a Xbox extension, meaning there is no pc counterpart.
|
||||||
|
|
||||||
|
@ -8309,8 +8309,8 @@ DWORD WINAPI XTL::EmuIDirect3DDevice8_InsertFence()
|
||||||
|
|
||||||
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_InsertFence()\n", GetCurrentThreadId());
|
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_InsertFence()\n", GetCurrentThreadId());
|
||||||
|
|
||||||
// TODO: Actually implement this
|
// TODO: Actually implement this
|
||||||
DWORD dwRet = 0x8000BEEF;
|
DWORD dwRet = 0x8000BEEF;
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
|
@ -8322,7 +8322,7 @@ DWORD WINAPI XTL::EmuIDirect3DDevice8_InsertFence()
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI XTL::EmuIDirect3DDevice8_BlockOnFence
|
VOID WINAPI XTL::EmuIDirect3DDevice8_BlockOnFence
|
||||||
(
|
(
|
||||||
DWORD Fence
|
DWORD Fence
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -8333,7 +8333,7 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_BlockOnFence
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), Fence);
|
GetCurrentThreadId(), Fence);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
}
|
}
|
||||||
|
@ -8343,18 +8343,18 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_BlockOnFence
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI XTL::EmuIDirect3DResource8_BlockUntilNotBusy
|
VOID WINAPI XTL::EmuIDirect3DResource8_BlockUntilNotBusy
|
||||||
(
|
(
|
||||||
X_D3DResource *pThis
|
X_D3DResource *pThis
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
|
||||||
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DResource8_BlockUntilNotBusy\n"
|
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DResource8_BlockUntilNotBusy\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" pThis : 0x%.08X\n"
|
" pThis : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), pThis);
|
GetCurrentThreadId(), pThis);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
}
|
}
|
||||||
|
@ -8364,20 +8364,20 @@ VOID WINAPI XTL::EmuIDirect3DResource8_BlockUntilNotBusy
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI XTL::EmuIDirect3DVertexBuffer8_GetDesc
|
VOID WINAPI XTL::EmuIDirect3DVertexBuffer8_GetDesc
|
||||||
(
|
(
|
||||||
X_D3DVertexBuffer *pThis,
|
X_D3DVertexBuffer *pThis,
|
||||||
D3DVERTEXBUFFER_DESC *pDesc
|
D3DVERTEXBUFFER_DESC *pDesc
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
|
||||||
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DVertexBuffer8_GetDesc\n"
|
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DVertexBuffer8_GetDesc\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" pThis : 0x%.08X\n"
|
" pThis : 0x%.08X\n"
|
||||||
" pDesc : 0x%.08X\n"
|
" pDesc : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), pThis, pDesc);
|
GetCurrentThreadId(), pThis, pDesc);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
}
|
}
|
||||||
|
@ -8387,24 +8387,24 @@ VOID WINAPI XTL::EmuIDirect3DVertexBuffer8_GetDesc
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetScissors
|
HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetScissors
|
||||||
(
|
(
|
||||||
DWORD Count,
|
DWORD Count,
|
||||||
BOOL Exclusive,
|
BOOL Exclusive,
|
||||||
CONST D3DRECT *pRects
|
CONST D3DRECT *pRects
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
|
||||||
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetScissors\n"
|
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetScissors\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" Count : 0x%.08X\n"
|
" Count : 0x%.08X\n"
|
||||||
" Exclusive : 0x%.08X\n"
|
" Exclusive : 0x%.08X\n"
|
||||||
" pRects : 0x%.08X\n"
|
" pRects : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), Count, Exclusive, pRects);
|
GetCurrentThreadId(), Count, Exclusive, pRects);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1512,11 +1512,11 @@ HRESULT WINAPI EmuIDirect3DTexture8_GetLevelDesc
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirect3D8_CheckDeviceMultiSampleType
|
HRESULT WINAPI EmuIDirect3D8_CheckDeviceMultiSampleType
|
||||||
(
|
(
|
||||||
UINT Adapter,
|
UINT Adapter,
|
||||||
D3DDEVTYPE DeviceType,
|
D3DDEVTYPE DeviceType,
|
||||||
D3DFORMAT SurfaceFormat,
|
D3DFORMAT SurfaceFormat,
|
||||||
BOOL Windowed,
|
BOOL Windowed,
|
||||||
D3DMULTISAMPLE_TYPE MultiSampleType
|
D3DMULTISAMPLE_TYPE MultiSampleType
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1524,9 +1524,9 @@ HRESULT WINAPI EmuIDirect3D8_CheckDeviceMultiSampleType
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirect3D8_GetDeviceCaps
|
HRESULT WINAPI EmuIDirect3D8_GetDeviceCaps
|
||||||
(
|
(
|
||||||
UINT Adapter,
|
UINT Adapter,
|
||||||
D3DDEVTYPE DeviceType,
|
D3DDEVTYPE DeviceType,
|
||||||
D3DCAPS8 *pCaps
|
D3DCAPS8 *pCaps
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1534,8 +1534,8 @@ HRESULT WINAPI EmuIDirect3D8_GetDeviceCaps
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirect3D8_SetPushBufferSize
|
HRESULT WINAPI EmuIDirect3D8_SetPushBufferSize
|
||||||
(
|
(
|
||||||
DWORD PushBufferSize,
|
DWORD PushBufferSize,
|
||||||
DWORD KickOffSize
|
DWORD KickOffSize
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1548,7 +1548,7 @@ DWORD WINAPI EmuIDirect3DDevice8_InsertFence();
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI EmuIDirect3DDevice8_BlockOnFence
|
VOID WINAPI EmuIDirect3DDevice8_BlockOnFence
|
||||||
(
|
(
|
||||||
DWORD Fence
|
DWORD Fence
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1556,7 +1556,7 @@ VOID WINAPI EmuIDirect3DDevice8_BlockOnFence
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI EmuIDirect3DResource8_BlockUntilNotBusy
|
VOID WINAPI EmuIDirect3DResource8_BlockUntilNotBusy
|
||||||
(
|
(
|
||||||
X_D3DResource *pThis
|
X_D3DResource *pThis
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1564,8 +1564,8 @@ VOID WINAPI EmuIDirect3DResource8_BlockUntilNotBusy
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI EmuIDirect3DVertexBuffer8_GetDesc
|
VOID WINAPI EmuIDirect3DVertexBuffer8_GetDesc
|
||||||
(
|
(
|
||||||
X_D3DVertexBuffer *pThis,
|
X_D3DVertexBuffer *pThis,
|
||||||
D3DVERTEXBUFFER_DESC *pDesc
|
D3DVERTEXBUFFER_DESC *pDesc
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1573,9 +1573,9 @@ VOID WINAPI EmuIDirect3DVertexBuffer8_GetDesc
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirect3DDevice8_SetScissors
|
HRESULT WINAPI EmuIDirect3DDevice8_SetScissors
|
||||||
(
|
(
|
||||||
DWORD Count,
|
DWORD Count,
|
||||||
BOOL Exclusive,
|
BOOL Exclusive,
|
||||||
CONST D3DRECT *pRects
|
CONST D3DRECT *pRects
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -193,25 +193,25 @@ XTL::X_D3DFORMAT XTL::EmuPC2XB_D3DFormat(D3DFORMAT Format)
|
||||||
|
|
||||||
DWORD XTL::EmuXB2PC_D3DLock(DWORD Flags)
|
DWORD XTL::EmuXB2PC_D3DLock(DWORD Flags)
|
||||||
{
|
{
|
||||||
DWORD NewFlags = 0;
|
DWORD NewFlags = 0;
|
||||||
|
|
||||||
// Need to convert the flags, TODO: fix the xbox extensions
|
// Need to convert the flags, TODO: fix the xbox extensions
|
||||||
if(Flags & X_D3DLOCK_NOFLUSH)
|
if(Flags & X_D3DLOCK_NOFLUSH)
|
||||||
{
|
{
|
||||||
NewFlags ^= 0;
|
NewFlags ^= 0;
|
||||||
}
|
}
|
||||||
if(Flags & X_D3DLOCK_NOOVERWRITE)
|
if(Flags & X_D3DLOCK_NOOVERWRITE)
|
||||||
{
|
{
|
||||||
NewFlags ^= D3DLOCK_NOOVERWRITE;
|
NewFlags ^= D3DLOCK_NOOVERWRITE;
|
||||||
}
|
}
|
||||||
if(Flags & X_D3DLOCK_TILED)
|
if(Flags & X_D3DLOCK_TILED)
|
||||||
{
|
{
|
||||||
NewFlags ^= 0;
|
NewFlags ^= 0;
|
||||||
}
|
}
|
||||||
if(Flags & X_D3DLOCK_READONLY)
|
if(Flags & X_D3DLOCK_READONLY)
|
||||||
{
|
{
|
||||||
NewFlags ^= D3DLOCK_READONLY;
|
NewFlags ^= D3DLOCK_READONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewFlags;
|
return NewFlags;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,14 +55,14 @@ extern void EmuDInputPoll(PXINPUT_STATE Controller);
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * offsets into analog button array
|
// * offsets into analog button array
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
#define XINPUT_GAMEPAD_A 0
|
#define XINPUT_GAMEPAD_A 0
|
||||||
#define XINPUT_GAMEPAD_B 1
|
#define XINPUT_GAMEPAD_B 1
|
||||||
#define XINPUT_GAMEPAD_X 2
|
#define XINPUT_GAMEPAD_X 2
|
||||||
#define XINPUT_GAMEPAD_Y 3
|
#define XINPUT_GAMEPAD_Y 3
|
||||||
#define XINPUT_GAMEPAD_BLACK 4
|
#define XINPUT_GAMEPAD_BLACK 4
|
||||||
#define XINPUT_GAMEPAD_WHITE 5
|
#define XINPUT_GAMEPAD_WHITE 5
|
||||||
#define XINPUT_GAMEPAD_LEFT_TRIGGER 6
|
#define XINPUT_GAMEPAD_LEFT_TRIGGER 6
|
||||||
#define XINPUT_GAMEPAD_RIGHT_TRIGGER 7
|
#define XINPUT_GAMEPAD_RIGHT_TRIGGER 7
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * masks for digital buttons
|
// * masks for digital buttons
|
||||||
|
|
|
@ -1509,8 +1509,8 @@ HRESULT WINAPI XTL::EmuDirectSoundCreateStream
|
||||||
if(pDSBufferDesc->lpwfxFormat != NULL && pDSBufferDesc->lpwfxFormat->wFormatTag != WAVE_FORMAT_PCM)
|
if(pDSBufferDesc->lpwfxFormat != NULL && pDSBufferDesc->lpwfxFormat->wFormatTag != WAVE_FORMAT_PCM)
|
||||||
{
|
{
|
||||||
EmuWarning("Invalid WAVE_FORMAT!");
|
EmuWarning("Invalid WAVE_FORMAT!");
|
||||||
if(pDSBufferDesc->lpwfxFormat->wFormatTag == /*WAVE_FORMAT_XBOX_ADPCM*/0x0069)
|
if(pDSBufferDesc->lpwfxFormat->wFormatTag == /*WAVE_FORMAT_XBOX_ADPCM*/0x0069)
|
||||||
EmuWarning("WAVE_FORMAT_XBOX_ADPCM Unsupported!");
|
EmuWarning("WAVE_FORMAT_XBOX_ADPCM Unsupported!");
|
||||||
|
|
||||||
(*ppStream)->EmuDirectSoundBuffer8 = 0;
|
(*ppStream)->EmuDirectSoundBuffer8 = 0;
|
||||||
|
|
||||||
|
@ -2573,7 +2573,7 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetFormat
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
STDAPI_(void) EmuDirectSoundUseFullHRTF
|
STDAPI_(void) EmuDirectSoundUseFullHRTF
|
||||||
(
|
(
|
||||||
void
|
void
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2590,8 +2590,8 @@ STDAPI_(void) EmuDirectSoundUseFullHRTF
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetLFO
|
HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetLFO
|
||||||
(
|
(
|
||||||
LPDIRECTSOUNDBUFFER pThis,
|
LPDIRECTSOUNDBUFFER pThis,
|
||||||
LPCDSLFODESC pLFODesc
|
LPCDSLFODESC pLFODesc
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2603,7 +2603,7 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetLFO
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), pThis, pLFODesc);
|
GetCurrentThreadId(), pThis, pLFODesc);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
|
@ -2615,9 +2615,9 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetLFO
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI XTL::EmuXAudioCreateAdpcmFormat
|
VOID WINAPI XTL::EmuXAudioCreateAdpcmFormat
|
||||||
(
|
(
|
||||||
WORD nChannels,
|
WORD nChannels,
|
||||||
DWORD nSamplesPerSec,
|
DWORD nSamplesPerSec,
|
||||||
LPXBOXADPCMWAVEFORMAT pwfx
|
LPXBOXADPCMWAVEFORMAT pwfx
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2630,15 +2630,15 @@ VOID WINAPI XTL::EmuXAudioCreateAdpcmFormat
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), nChannels, nSamplesPerSec, pwfx);
|
GetCurrentThreadId(), nChannels, nSamplesPerSec, pwfx);
|
||||||
|
|
||||||
// Fill out the pwfx structure with the appropriate data
|
// Fill out the pwfx structure with the appropriate data
|
||||||
pwfx->wfx.wFormatTag = WAVE_FORMAT_XBOX_ADPCM;
|
pwfx->wfx.wFormatTag = WAVE_FORMAT_XBOX_ADPCM;
|
||||||
pwfx->wfx.nChannels = nChannels;
|
pwfx->wfx.nChannels = nChannels;
|
||||||
pwfx->wfx.nSamplesPerSec = nSamplesPerSec;
|
pwfx->wfx.nSamplesPerSec = nSamplesPerSec;
|
||||||
pwfx->wfx.nAvgBytesPerSec = (nSamplesPerSec*nChannels * 36)/64;
|
pwfx->wfx.nAvgBytesPerSec = (nSamplesPerSec*nChannels * 36)/64;
|
||||||
pwfx->wfx.nBlockAlign = nChannels * 36;
|
pwfx->wfx.nBlockAlign = nChannels * 36;
|
||||||
pwfx->wfx.wBitsPerSample = 4;
|
pwfx->wfx.wBitsPerSample = 4;
|
||||||
pwfx->wfx.cbSize = 2;
|
pwfx->wfx.cbSize = 2;
|
||||||
pwfx->wSamplesPerBlock = 64;
|
pwfx->wSamplesPerBlock = 64;
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
}
|
}
|
||||||
|
@ -2648,10 +2648,10 @@ VOID WINAPI XTL::EmuXAudioCreateAdpcmFormat
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetRolloffCurve
|
HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetRolloffCurve
|
||||||
(
|
(
|
||||||
LPDIRECTSOUNDBUFFER pThis,
|
LPDIRECTSOUNDBUFFER pThis,
|
||||||
const FLOAT *pflPoints,
|
const FLOAT *pflPoints,
|
||||||
DWORD dwPointCount,
|
DWORD dwPointCount,
|
||||||
DWORD dwApply
|
DWORD dwApply
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2661,15 +2661,15 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetRolloffCurve
|
||||||
" pThis : 0x%.08X\n"
|
" pThis : 0x%.08X\n"
|
||||||
" pflPoints : 0x%.08X\n"
|
" pflPoints : 0x%.08X\n"
|
||||||
" dwPointCount : 0x%.08X\n"
|
" dwPointCount : 0x%.08X\n"
|
||||||
" dwApply : 0x%.08X\n"
|
" dwApply : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), pThis, pflPoints, dwPointCount, dwApply);
|
GetCurrentThreadId(), pThis, pflPoints, dwPointCount, dwApply);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
return DS_OK;
|
return DS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -2677,8 +2677,8 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetRolloffCurve
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI XTL::EmuIDirectSoundStream_SetVolume
|
HRESULT WINAPI XTL::EmuIDirectSoundStream_SetVolume
|
||||||
(
|
(
|
||||||
LPDIRECTSOUNDSTREAM pStream,
|
LPDIRECTSOUNDSTREAM pStream,
|
||||||
LONG lVolume
|
LONG lVolume
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2690,9 +2690,9 @@ HRESULT WINAPI XTL::EmuIDirectSoundStream_SetVolume
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), pStream, lVolume);
|
GetCurrentThreadId(), pStream, lVolume);
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
return DS_OK;
|
return DS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,12 +94,12 @@ XMEDIAPACKET, *PXMEDIAPACKET, *LPXMEDIAPACKET;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef struct _DSLFODESC
|
typedef struct _DSLFODESC
|
||||||
{
|
{
|
||||||
DWORD dwLFO;
|
DWORD dwLFO;
|
||||||
DWORD dwDelay;
|
DWORD dwDelay;
|
||||||
DWORD dwDelta;
|
DWORD dwDelta;
|
||||||
LONG lPitchModulation;
|
LONG lPitchModulation;
|
||||||
LONG lFilterCutOffRange;
|
LONG lFilterCutOffRange;
|
||||||
LONG lAmplitudeModulation;
|
LONG lAmplitudeModulation;
|
||||||
}
|
}
|
||||||
DSLFODESC, *LPCDSLFODESC;
|
DSLFODESC, *LPCDSLFODESC;
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ HRESULT WINAPI EmuIDirectSound8_SetMixBinHeadroom
|
||||||
HRESULT WINAPI EmuIDirectSoundBuffer8_SetMixBins
|
HRESULT WINAPI EmuIDirectSoundBuffer8_SetMixBins
|
||||||
(
|
(
|
||||||
LPDIRECTSOUND8 pThis,
|
LPDIRECTSOUND8 pThis,
|
||||||
PVOID pMixBins // TODO: fill this out
|
PVOID pMixBins // TODO: fill this out
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -392,7 +392,7 @@ HRESULT WINAPI EmuIDirectSoundBuffer8_SetMixBins
|
||||||
HRESULT WINAPI EmuIDirectSoundBuffer8_SetMixBinVolumes
|
HRESULT WINAPI EmuIDirectSoundBuffer8_SetMixBinVolumes
|
||||||
(
|
(
|
||||||
LPDIRECTSOUND8 pThis,
|
LPDIRECTSOUND8 pThis,
|
||||||
PVOID pMixBins // TODO: fill this out
|
PVOID pMixBins // TODO: fill this out
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -975,7 +975,7 @@ HRESULT WINAPI EmuIDirectSoundBuffer8_SetFormat
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
STDAPI_(void) EmuDirectSoundUseFullHRTF
|
STDAPI_(void) EmuDirectSoundUseFullHRTF
|
||||||
(
|
(
|
||||||
void
|
void
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -983,8 +983,8 @@ STDAPI_(void) EmuDirectSoundUseFullHRTF
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirectSoundBuffer8_SetLFO
|
HRESULT WINAPI EmuIDirectSoundBuffer8_SetLFO
|
||||||
(
|
(
|
||||||
LPDIRECTSOUNDBUFFER pThis,
|
LPDIRECTSOUNDBUFFER pThis,
|
||||||
LPCDSLFODESC pLFODesc
|
LPCDSLFODESC pLFODesc
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -992,9 +992,9 @@ HRESULT WINAPI EmuIDirectSoundBuffer8_SetLFO
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
VOID WINAPI EmuXAudioCreateAdpcmFormat
|
VOID WINAPI EmuXAudioCreateAdpcmFormat
|
||||||
(
|
(
|
||||||
WORD nChannels,
|
WORD nChannels,
|
||||||
DWORD nSamplesPerSec,
|
DWORD nSamplesPerSec,
|
||||||
LPXBOXADPCMWAVEFORMAT pwfx
|
LPXBOXADPCMWAVEFORMAT pwfx
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1002,10 +1002,10 @@ VOID WINAPI EmuXAudioCreateAdpcmFormat
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirectSoundBuffer8_SetRolloffCurve
|
HRESULT WINAPI EmuIDirectSoundBuffer8_SetRolloffCurve
|
||||||
(
|
(
|
||||||
LPDIRECTSOUNDBUFFER pThis,
|
LPDIRECTSOUNDBUFFER pThis,
|
||||||
const FLOAT *pflPoints,
|
const FLOAT *pflPoints,
|
||||||
DWORD dwPointCount,
|
DWORD dwPointCount,
|
||||||
DWORD dwApply
|
DWORD dwApply
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -1013,8 +1013,8 @@ HRESULT WINAPI EmuIDirectSoundBuffer8_SetRolloffCurve
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
HRESULT WINAPI EmuIDirectSoundStream_SetVolume
|
HRESULT WINAPI EmuIDirectSoundStream_SetVolume
|
||||||
(
|
(
|
||||||
LPDIRECTSOUNDSTREAM pStream,
|
LPDIRECTSOUNDSTREAM pStream,
|
||||||
LONG lVolume
|
LONG lVolume
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -69,7 +69,7 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData)
|
||||||
|
|
||||||
// copy global TLS to the current thread
|
// copy global TLS to the current thread
|
||||||
{
|
{
|
||||||
uint32 dwCopySize = pTLS->dwDataEndAddr - pTLS->dwDataStartAddr;
|
uint32 dwCopySize = pTLS->dwDataEndAddr - pTLS->dwDataStartAddr;
|
||||||
uint32 dwZeroSize = pTLS->dwSizeofZeroFill;
|
uint32 dwZeroSize = pTLS->dwSizeofZeroFill;
|
||||||
|
|
||||||
pNewTLS = (uint08*)CxbxMalloc(dwCopySize + dwZeroSize + 0x100 /* + HACK: extra safety padding 0x100*/);
|
pNewTLS = (uint08*)CxbxMalloc(dwCopySize + dwZeroSize + 0x100 /* + HACK: extra safety padding 0x100*/);
|
||||||
|
@ -81,29 +81,29 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData)
|
||||||
// dump raw TLS data
|
// dump raw TLS data
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
if(pNewTLS == 0)
|
if(pNewTLS == 0)
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuFS (0x%X): TLS Non-Existant (OK)\n", GetCurrentThreadId());
|
DbgPrintf("EmuFS (0x%X): TLS Non-Existant (OK)\n", GetCurrentThreadId());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuFS (0x%X): TLS Data Dump...\n", GetCurrentThreadId());
|
DbgPrintf("EmuFS (0x%X): TLS Data Dump...\n", GetCurrentThreadId());
|
||||||
DbgPrintf("EmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), pNewTLS);
|
DbgPrintf("EmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), pNewTLS);
|
||||||
|
|
||||||
uint32 stop = pTLS->dwDataEndAddr - pTLS->dwDataStartAddr + pTLS->dwSizeofZeroFill;
|
uint32 stop = pTLS->dwDataEndAddr - pTLS->dwDataStartAddr + pTLS->dwSizeofZeroFill;
|
||||||
|
|
||||||
for(uint32 v=0;v<stop;v++)
|
for(uint32 v=0;v<stop;v++)
|
||||||
{
|
{
|
||||||
uint08 *bByte = (uint08*)pNewTLS + v;
|
uint08 *bByte = (uint08*)pNewTLS + v;
|
||||||
|
|
||||||
DbgPrintf("%.01X", (uint32)*bByte);
|
DbgPrintf("%.01X", (uint32)*bByte);
|
||||||
|
|
||||||
if((v+1) % 0x10 == 0 && v+1<stop)
|
if((v+1) % 0x10 == 0 && v+1<stop)
|
||||||
DbgPrintf("\nEmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), ((uint32)pNewTLS + v));
|
DbgPrintf("\nEmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), ((uint32)pNewTLS + v));
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrintf("\n");
|
DbgPrintf("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,25 +53,25 @@ CRITICAL_SECTION EmuHandle::HandleLock;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
bool EmuHandle::Initialize()
|
bool EmuHandle::Initialize()
|
||||||
{
|
{
|
||||||
size_t x;
|
size_t x;
|
||||||
|
|
||||||
// Initialize the critical section
|
// Initialize the critical section
|
||||||
InitializeCriticalSection(&HandleLock);
|
InitializeCriticalSection(&HandleLock);
|
||||||
|
|
||||||
// Mark all handles as free. We also set up the linked list of
|
// Mark all handles as free. We also set up the linked list of
|
||||||
// free handles here.
|
// free handles here.
|
||||||
for (x = 0; x < EMU_MAX_HANDLES; x++)
|
for (x = 0; x < EMU_MAX_HANDLES; x++)
|
||||||
{
|
{
|
||||||
Handles[x].m_Type = EMUHANDLE_TYPE_EMPTY;
|
Handles[x].m_Type = EMUHANDLE_TYPE_EMPTY;
|
||||||
Handles[x].m_NextFree = &Handles[x + 1];
|
Handles[x].m_NextFree = &Handles[x + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// The last entry should have a NULL next entry
|
// The last entry should have a NULL next entry
|
||||||
Handles[EMU_MAX_HANDLES - 1].m_NextFree = NULL;
|
Handles[EMU_MAX_HANDLES - 1].m_NextFree = NULL;
|
||||||
|
|
||||||
// Set up the head and tail pointers
|
// Set up the head and tail pointers
|
||||||
FirstFree = &Handles[0];
|
FirstFree = &Handles[0];
|
||||||
LastFree = &Handles[EMU_MAX_HANDLES];
|
LastFree = &Handles[EMU_MAX_HANDLES];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ bool EmuHandle::Initialize()
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
inline void EmuHandle::Lock(void)
|
inline void EmuHandle::Lock(void)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&HandleLock);
|
EnterCriticalSection(&HandleLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -91,7 +91,7 @@ inline void EmuHandle::Lock(void)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
inline void EmuHandle::Unlock(void)
|
inline void EmuHandle::Unlock(void)
|
||||||
{
|
{
|
||||||
LeaveCriticalSection(&HandleLock);
|
LeaveCriticalSection(&HandleLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -100,27 +100,27 @@ inline void EmuHandle::Unlock(void)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
EmuHandle volatile *EmuHandle::Allocate(void)
|
EmuHandle volatile *EmuHandle::Allocate(void)
|
||||||
{
|
{
|
||||||
volatile EmuHandle *Handle;
|
volatile EmuHandle *Handle;
|
||||||
|
|
||||||
// Lock the database
|
// Lock the database
|
||||||
Lock();
|
Lock();
|
||||||
|
|
||||||
// Get the first free entry
|
// Get the first free entry
|
||||||
Handle = FirstFree;
|
Handle = FirstFree;
|
||||||
|
|
||||||
// Remove it from the list
|
// Remove it from the list
|
||||||
FirstFree = Handle->m_NextFree;
|
FirstFree = Handle->m_NextFree;
|
||||||
|
|
||||||
// If it was the last handle, clear LastFree
|
// If it was the last handle, clear LastFree
|
||||||
if (!Handle->m_NextFree)
|
if (!Handle->m_NextFree)
|
||||||
LastFree = NULL;
|
LastFree = NULL;
|
||||||
|
|
||||||
// Initialize the handle's fields
|
// Initialize the handle's fields
|
||||||
Handle->m_Type = EMUHANDLE_TYPE_ALLOCATED;
|
Handle->m_Type = EMUHANDLE_TYPE_ALLOCATED;
|
||||||
Handle->m_Object = NULL;
|
Handle->m_Object = NULL;
|
||||||
|
|
||||||
// Unlock the database
|
// Unlock the database
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
return Handle;
|
return Handle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,43 +69,43 @@ class EmuHandle
|
||||||
volatile enum _EmuHandleType m_Type;
|
volatile enum _EmuHandleType m_Type;
|
||||||
|
|
||||||
// To keep the size 8 bytes, these 2 items are in a union
|
// To keep the size 8 bytes, these 2 items are in a union
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
// Pointer to actual object (when handle is valid)
|
// Pointer to actual object (when handle is valid)
|
||||||
volatile class EmuNtObject *m_Object;
|
volatile class EmuNtObject *m_Object;
|
||||||
|
|
||||||
// Pointer to next free handle
|
// Pointer to next free handle
|
||||||
volatile EmuHandle *m_NextFree;
|
volatile EmuHandle *m_NextFree;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Close this handle
|
// Close this handle
|
||||||
NtDll::NTSTATUS Close(void);
|
NtDll::NTSTATUS Close(void);
|
||||||
|
|
||||||
// Initialize the EmuHandle system
|
// Initialize the EmuHandle system
|
||||||
static bool Initialize();
|
static bool Initialize();
|
||||||
|
|
||||||
// Close all open handles
|
// Close all open handles
|
||||||
static void CloseAll(void);
|
static void CloseAll(void);
|
||||||
|
|
||||||
// Allocate an empty handle
|
// Allocate an empty handle
|
||||||
static volatile EmuHandle *Allocate(void);
|
static volatile EmuHandle *Allocate(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Array of EmuHandles in the system
|
// Array of EmuHandles in the system
|
||||||
static EmuHandle Handles[EMU_MAX_HANDLES];
|
static EmuHandle Handles[EMU_MAX_HANDLES];
|
||||||
|
|
||||||
// Pointer to first free handle in array, or NULL if none
|
// Pointer to first free handle in array, or NULL if none
|
||||||
volatile static EmuHandle *FirstFree;
|
volatile static EmuHandle *FirstFree;
|
||||||
|
|
||||||
// Pointer to last free handle in array, or NULL if none
|
// Pointer to last free handle in array, or NULL if none
|
||||||
volatile static EmuHandle *LastFree;
|
volatile static EmuHandle *LastFree;
|
||||||
|
|
||||||
// Lock on the handle system
|
// Lock on the handle system
|
||||||
static CRITICAL_SECTION HandleLock;
|
static CRITICAL_SECTION HandleLock;
|
||||||
|
|
||||||
// Quick functions to lock/unlock
|
// Quick functions to lock/unlock
|
||||||
inline static void Lock(void);
|
inline static void Lock(void);
|
||||||
inline static void Unlock(void);
|
inline static void Unlock(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -113,17 +113,17 @@ class EmuHandle
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef enum _EmuHandleType
|
typedef enum _EmuHandleType
|
||||||
{
|
{
|
||||||
// Unallocated handle
|
// Unallocated handle
|
||||||
EMUHANDLE_TYPE_EMPTY = 0,
|
EMUHANDLE_TYPE_EMPTY = 0,
|
||||||
|
|
||||||
// Allocated but so far unused handle
|
// Allocated but so far unused handle
|
||||||
EMUHANDLE_TYPE_ALLOCATED,
|
EMUHANDLE_TYPE_ALLOCATED,
|
||||||
|
|
||||||
// File handle with no really special features
|
// File handle with no really special features
|
||||||
EMUHANDLE_TYPE_FILE,
|
EMUHANDLE_TYPE_FILE,
|
||||||
|
|
||||||
// Fake file/directory/directory object/partition handle
|
// Fake file/directory/directory object/partition handle
|
||||||
EMUHANDLE_TYPE_OBJECT
|
EMUHANDLE_TYPE_OBJECT
|
||||||
}
|
}
|
||||||
EmuHandleType;
|
EmuHandleType;
|
||||||
|
|
||||||
|
@ -133,33 +133,33 @@ EmuHandleType;
|
||||||
class EmuNtObject
|
class EmuNtObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Decrements the reference count of this object (never override)
|
// Decrements the reference count of this object (never override)
|
||||||
void NtClose(void);
|
void NtClose(void);
|
||||||
|
|
||||||
// These functions mimic the Nt* calls
|
// These functions mimic the Nt* calls
|
||||||
|
|
||||||
// Increments the reference count of this object
|
// Increments the reference count of this object
|
||||||
// For file handles, a whole new EmuFile structure is returned.
|
// For file handles, a whole new EmuFile structure is returned.
|
||||||
// For other objects (the default implementation), "this" is returned.
|
// For other objects (the default implementation), "this" is returned.
|
||||||
virtual EmuNtObject *NtDuplicateObject(void);
|
virtual EmuNtObject *NtDuplicateObject(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Object name (Unicode, because we handle after-conversion strings)
|
// Object name (Unicode, because we handle after-conversion strings)
|
||||||
const WCHAR *Name;
|
const WCHAR *Name;
|
||||||
ULONG NameLength;
|
ULONG NameLength;
|
||||||
// Permanent status
|
// Permanent status
|
||||||
bool PermanentFlag;
|
bool PermanentFlag;
|
||||||
|
|
||||||
// Called by close() when the reference count reaches zero
|
// Called by close() when the reference count reaches zero
|
||||||
virtual void Free(void) = 0;
|
virtual void Free(void) = 0;
|
||||||
// Constructor
|
// Constructor
|
||||||
EmuNtObject(void);
|
EmuNtObject(void);
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~EmuNtObject() = 0;
|
virtual ~EmuNtObject() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Reference count
|
// Reference count
|
||||||
ULONG RefCount;
|
ULONG RefCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -168,13 +168,13 @@ class EmuNtObject
|
||||||
class EmuNtFile : public EmuNtObject
|
class EmuNtFile : public EmuNtObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// We need to override NtDuplicateObject in this case
|
// We need to override NtDuplicateObject in this case
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The Windows file handle
|
// The Windows file handle
|
||||||
HANDLE File;
|
HANDLE File;
|
||||||
// Pointer to the volume from which this came
|
// Pointer to the volume from which this came
|
||||||
//EmuNtVolume *Volume;
|
//EmuNtVolume *Volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -168,7 +168,7 @@ using namespace xboxkrnl;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(14) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePool
|
XBSYSAPI EXPORTNUM(14) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePool
|
||||||
(
|
(
|
||||||
IN ULONG NumberOfBytes
|
IN ULONG NumberOfBytes
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -194,20 +194,20 @@ XBSYSAPI EXPORTNUM(14) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePool
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(15) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePoolWithTag
|
XBSYSAPI EXPORTNUM(15) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePoolWithTag
|
||||||
(
|
(
|
||||||
IN SIZE_T NumberOfBytes,
|
IN SIZE_T NumberOfBytes,
|
||||||
IN ULONG Tag
|
IN ULONG Tag
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): ExAllocatePoolWithTag\n"
|
DbgPrintf("EmuKrnl (0x%X): ExAllocatePoolWithTag\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" NumberOfBytes : 0x%.08X\n"
|
" NumberOfBytes : 0x%.08X\n"
|
||||||
" Tag : 0x%.08X\n"
|
" Tag : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), NumberOfBytes, Tag);
|
GetCurrentThreadId(), NumberOfBytes, Tag);
|
||||||
|
|
||||||
// TODO: Actually implement this
|
// TODO: Actually implement this
|
||||||
PVOID pRet = CxbxMalloc(NumberOfBytes);
|
PVOID pRet = CxbxMalloc(NumberOfBytes);
|
||||||
|
|
||||||
EmuSwapFS(); // Xbox FS
|
EmuSwapFS(); // Xbox FS
|
||||||
|
@ -651,8 +651,8 @@ XBSYSAPI EXPORTNUM(149) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeSetTimer
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), Timer, DueTime, Dpc);
|
GetCurrentThreadId(), Timer, DueTime, Dpc);
|
||||||
|
|
||||||
// Call KeSetTimerEx
|
// Call KeSetTimerEx
|
||||||
KeSetTimerEx(Timer, DueTime, 0, Dpc);
|
KeSetTimerEx(Timer, DueTime, 0, Dpc);
|
||||||
|
|
||||||
EmuSwapFS(); // Xbox FS
|
EmuSwapFS(); // Xbox FS
|
||||||
|
|
||||||
|
@ -676,7 +676,7 @@ XBSYSAPI EXPORTNUM(150) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeSetTimerEx
|
||||||
"(\n"
|
"(\n"
|
||||||
" Timer : 0x%.08X\n"
|
" Timer : 0x%.08X\n"
|
||||||
" DueTime : 0x%I64X\n"
|
" DueTime : 0x%I64X\n"
|
||||||
" Period : 0x%.08X\n"
|
" Period : 0x%.08X\n"
|
||||||
" Dpc : 0x%.08X\n"
|
" Dpc : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), Timer, DueTime, Period, Dpc);
|
GetCurrentThreadId(), Timer, DueTime, Period, Dpc);
|
||||||
|
@ -711,7 +711,7 @@ LAUNCH_DATA_PAGE xLaunchDataPage =
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(160) xboxkrnl::UCHAR NTAPI xboxkrnl::KfRaiseIrql
|
XBSYSAPI EXPORTNUM(160) xboxkrnl::UCHAR NTAPI xboxkrnl::KfRaiseIrql
|
||||||
(
|
(
|
||||||
IN UCHAR NewIrql
|
IN UCHAR NewIrql
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -732,7 +732,7 @@ XBSYSAPI EXPORTNUM(160) xboxkrnl::UCHAR NTAPI xboxkrnl::KfRaiseIrql
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(161) xboxkrnl::UCHAR NTAPI xboxkrnl::KfLowerIrql
|
XBSYSAPI EXPORTNUM(161) xboxkrnl::UCHAR NTAPI xboxkrnl::KfLowerIrql
|
||||||
(
|
(
|
||||||
IN UCHAR NewIrql
|
IN UCHAR NewIrql
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -758,7 +758,7 @@ XBSYSAPI EXPORTNUM(164) xboxkrnl::PLAUNCH_DATA_PAGE xboxkrnl::LaunchDataPage = &
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(165) xboxkrnl::PVOID NTAPI xboxkrnl::MmAllocateContiguousMemory
|
XBSYSAPI EXPORTNUM(165) xboxkrnl::PVOID NTAPI xboxkrnl::MmAllocateContiguousMemory
|
||||||
(
|
(
|
||||||
IN ULONG NumberOfBytes
|
IN ULONG NumberOfBytes
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -801,11 +801,11 @@ XBSYSAPI EXPORTNUM(165) xboxkrnl::PVOID NTAPI xboxkrnl::MmAllocateContiguousMemo
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(166) xboxkrnl::PVOID NTAPI xboxkrnl::MmAllocateContiguousMemoryEx
|
XBSYSAPI EXPORTNUM(166) xboxkrnl::PVOID NTAPI xboxkrnl::MmAllocateContiguousMemoryEx
|
||||||
(
|
(
|
||||||
IN ULONG NumberOfBytes,
|
IN ULONG NumberOfBytes,
|
||||||
IN PHYSICAL_ADDRESS LowestAcceptableAddress,
|
IN PHYSICAL_ADDRESS LowestAcceptableAddress,
|
||||||
IN PHYSICAL_ADDRESS HighestAcceptableAddress,
|
IN PHYSICAL_ADDRESS HighestAcceptableAddress,
|
||||||
IN ULONG Alignment OPTIONAL,
|
IN ULONG Alignment OPTIONAL,
|
||||||
IN ULONG ProtectionType
|
IN ULONG ProtectionType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -884,7 +884,7 @@ XBSYSAPI EXPORTNUM(167) xboxkrnl::PVOID NTAPI xboxkrnl::MmAllocateSystemMemory
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(171) VOID NTAPI xboxkrnl::MmFreeContiguousMemory
|
XBSYSAPI EXPORTNUM(171) VOID NTAPI xboxkrnl::MmFreeContiguousMemory
|
||||||
(
|
(
|
||||||
IN PVOID BaseAddress
|
IN PVOID BaseAddress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -1268,46 +1268,46 @@ XBSYSAPI EXPORTNUM(190) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateFile
|
||||||
}
|
}
|
||||||
|
|
||||||
// D:\ should map to current directory
|
// D:\ should map to current directory
|
||||||
if( (szBuffer[0] == 'D' || szBuffer[0] == 'd') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
if( (szBuffer[0] == 'D' || szBuffer[0] == 'd') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
ObjectAttributes->RootDirectory = g_hCurDir;
|
ObjectAttributes->RootDirectory = g_hCurDir;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
||||||
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
||||||
DbgPrintf(" New:\"$XbePath\\%s\"\n", szBuffer);
|
DbgPrintf(" New:\"$XbePath\\%s\"\n", szBuffer);
|
||||||
}
|
}
|
||||||
else if( (szBuffer[0] == 'T' || szBuffer[0] == 't') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
else if( (szBuffer[0] == 'T' || szBuffer[0] == 't') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
ObjectAttributes->RootDirectory = g_hTDrive;
|
ObjectAttributes->RootDirectory = g_hTDrive;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
||||||
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
||||||
DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\T\\%s\"\n", szBuffer);
|
DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\T\\%s\"\n", szBuffer);
|
||||||
}
|
}
|
||||||
else if( (szBuffer[0] == 'U' || szBuffer[0] == 'u') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
else if( (szBuffer[0] == 'U' || szBuffer[0] == 'u') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
ObjectAttributes->RootDirectory = g_hUDrive;
|
ObjectAttributes->RootDirectory = g_hUDrive;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
||||||
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
||||||
DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\U\\%s\"\n", szBuffer);
|
DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\U\\%s\"\n", szBuffer);
|
||||||
}
|
}
|
||||||
else if( (szBuffer[0] == 'Z' || szBuffer[0] == 'z') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
else if( (szBuffer[0] == 'Z' || szBuffer[0] == 'z') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
ObjectAttributes->RootDirectory = g_hZDrive;
|
ObjectAttributes->RootDirectory = g_hZDrive;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
DbgPrintf("EmuKrnl (0x%X): NtCreateFile Corrected path...\n", GetCurrentThreadId());
|
||||||
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
DbgPrintf(" Org:\"%s\"\n", ObjectAttributes->ObjectName->Buffer);
|
||||||
DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\Z\\%s\"\n", szBuffer);
|
DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\Z\\%s\"\n", szBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// TODO: Wildcards are not allowed??
|
// TODO: Wildcards are not allowed??
|
||||||
|
@ -1689,7 +1689,7 @@ XBSYSAPI EXPORTNUM(210) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryFullAttributes
|
||||||
InitializeObjectAttributes(&NtObjAttr, &NtUnicodeString, ObjectAttributes->Attributes, ObjectAttributes->RootDirectory, NULL);
|
InitializeObjectAttributes(&NtObjAttr, &NtUnicodeString, ObjectAttributes->Attributes, ObjectAttributes->RootDirectory, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS ret = NtDll::NtQueryFullAttributesFile(&NtObjAttr, Attributes);
|
NTSTATUS ret = NtDll::NtQueryFullAttributesFile(&NtObjAttr, Attributes);
|
||||||
|
|
||||||
EmuSwapFS(); // Xbox FS
|
EmuSwapFS(); // Xbox FS
|
||||||
|
|
||||||
|
@ -1721,17 +1721,17 @@ XBSYSAPI EXPORTNUM(211) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryInformationFil
|
||||||
GetCurrentThreadId(), FileHandle, IoStatusBlock, FileInformation,
|
GetCurrentThreadId(), FileHandle, IoStatusBlock, FileInformation,
|
||||||
Length, FileInfo);
|
Length, FileInfo);
|
||||||
|
|
||||||
if(FileInfo != FilePositionInformation && FileInfo != FileNetworkOpenInformation)
|
if(FileInfo != FilePositionInformation && FileInfo != FileNetworkOpenInformation)
|
||||||
CxbxKrnlCleanup("Unknown FILE_INFORMATION_CLASS 0x%.08X", FileInfo);
|
CxbxKrnlCleanup("Unknown FILE_INFORMATION_CLASS 0x%.08X", FileInfo);
|
||||||
|
|
||||||
NTSTATUS ret = NtDll::NtQueryInformationFile
|
NTSTATUS ret = NtDll::NtQueryInformationFile
|
||||||
(
|
(
|
||||||
FileHandle,
|
FileHandle,
|
||||||
(NtDll::PIO_STATUS_BLOCK)IoStatusBlock,
|
(NtDll::PIO_STATUS_BLOCK)IoStatusBlock,
|
||||||
(NtDll::PFILE_FS_SIZE_INFORMATION)FileInformation,
|
(NtDll::PFILE_FS_SIZE_INFORMATION)FileInformation,
|
||||||
Length,
|
Length,
|
||||||
(NtDll::FILE_INFORMATION_CLASS)FileInfo
|
(NtDll::FILE_INFORMATION_CLASS)FileInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// DEBUGGING!
|
// DEBUGGING!
|
||||||
|
@ -1799,8 +1799,8 @@ XBSYSAPI EXPORTNUM(218) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVolumeInformat
|
||||||
(NtDll::FS_INFORMATION_CLASS)FileInformationClass
|
(NtDll::FS_INFORMATION_CLASS)FileInformationClass
|
||||||
);
|
);
|
||||||
|
|
||||||
// NOTE: TODO: Dynamically fill in, or allow configuration?
|
// NOTE: TODO: Dynamically fill in, or allow configuration?
|
||||||
if(FileInformationClass == FileFsSizeInformation)
|
if(FileInformationClass == FileFsSizeInformation)
|
||||||
{
|
{
|
||||||
FILE_FS_SIZE_INFORMATION *SizeInfo = (FILE_FS_SIZE_INFORMATION*)FileInformation;
|
FILE_FS_SIZE_INFORMATION *SizeInfo = (FILE_FS_SIZE_INFORMATION*)FileInformation;
|
||||||
|
|
||||||
|
@ -1820,14 +1820,14 @@ XBSYSAPI EXPORTNUM(218) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVolumeInformat
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(219) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReadFile
|
XBSYSAPI EXPORTNUM(219) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReadFile
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
IN HANDLE Event OPTIONAL,
|
IN HANDLE Event OPTIONAL,
|
||||||
IN PVOID ApcRoutine OPTIONAL,
|
IN PVOID ApcRoutine OPTIONAL,
|
||||||
IN PVOID ApcContext,
|
IN PVOID ApcContext,
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
OUT PVOID Buffer,
|
OUT PVOID Buffer,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN PLARGE_INTEGER ByteOffset OPTIONAL
|
IN PLARGE_INTEGER ByteOffset OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -1949,11 +1949,11 @@ XBSYSAPI EXPORTNUM(225) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSetEvent
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(226) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSetInformationFile
|
XBSYSAPI EXPORTNUM(226) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSetInformationFile
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
IN PVOID FileInformation,
|
IN PVOID FileInformation,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG FileInformationClass
|
IN ULONG FileInformationClass
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2031,15 +2031,15 @@ XBSYSAPI EXPORTNUM(232) VOID NTAPI xboxkrnl::NtUserIoApcDispatcher
|
||||||
dwEsi = (uint32)IoStatusBlock;
|
dwEsi = (uint32)IoStatusBlock;
|
||||||
|
|
||||||
if((IoStatusBlock->u1.Status & 0xC0000000) == 0xC0000000)
|
if((IoStatusBlock->u1.Status & 0xC0000000) == 0xC0000000)
|
||||||
{
|
{
|
||||||
dwEcx = 0;
|
dwEcx = 0;
|
||||||
dwEax = NtDll::RtlNtStatusToDosError(IoStatusBlock->u1.Status);
|
dwEax = NtDll::RtlNtStatusToDosError(IoStatusBlock->u1.Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dwEcx = (DWORD)IoStatusBlock->Information;
|
dwEcx = (DWORD)IoStatusBlock->Information;
|
||||||
dwEax = 0;
|
dwEax = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// ~XDK 3911??
|
// ~XDK 3911??
|
||||||
|
@ -2060,22 +2060,22 @@ XBSYSAPI EXPORTNUM(232) VOID NTAPI xboxkrnl::NtUserIoApcDispatcher
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
pushad
|
pushad
|
||||||
/*
|
/*
|
||||||
mov esi, IoStatusBlock
|
mov esi, IoStatusBlock
|
||||||
mov ecx, dwEcx
|
mov ecx, dwEcx
|
||||||
mov eax, dwEax
|
mov eax, dwEax
|
||||||
*/
|
*/
|
||||||
// TODO: Figure out if/why this works!? Matches prototype, but not xboxkrnl disassembly
|
// TODO: Figure out if/why this works!? Matches prototype, but not xboxkrnl disassembly
|
||||||
// Seems to be XDK/version dependand??
|
// Seems to be XDK/version dependand??
|
||||||
mov esi, dwEsi
|
mov esi, dwEsi
|
||||||
mov ecx, dwEcx
|
mov ecx, dwEcx
|
||||||
mov eax, dwEax
|
mov eax, dwEax
|
||||||
|
|
||||||
push esi
|
push esi
|
||||||
push ecx
|
push ecx
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
call ApcContext
|
call ApcContext
|
||||||
|
|
||||||
popad
|
popad
|
||||||
}
|
}
|
||||||
|
@ -2157,14 +2157,14 @@ XBSYSAPI EXPORTNUM(235) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWaitForMultipleObje
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(236) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWriteFile
|
XBSYSAPI EXPORTNUM(236) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWriteFile
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
IN PVOID Event,
|
IN PVOID Event,
|
||||||
IN PVOID ApcRoutine,
|
IN PVOID ApcRoutine,
|
||||||
IN PVOID ApcContext,
|
IN PVOID ApcContext,
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
IN PVOID Buffer,
|
IN PVOID Buffer,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN PLARGE_INTEGER ByteOffset
|
IN PLARGE_INTEGER ByteOffset
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2354,10 +2354,10 @@ XBSYSAPI EXPORTNUM(260) xboxkrnl::NTSTATUS NTAPI xboxkrnl::RtlAnsiStringToUnicod
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
XBSYSAPI EXPORTNUM(264) VOID NTAPI xboxkrnl::RtlAssert
|
XBSYSAPI EXPORTNUM(264) VOID NTAPI xboxkrnl::RtlAssert
|
||||||
(
|
(
|
||||||
PVOID FailedAssertion,
|
PVOID FailedAssertion,
|
||||||
PVOID FileName,
|
PVOID FileName,
|
||||||
ULONG LineNumber,
|
ULONG LineNumber,
|
||||||
PCHAR Message
|
PCHAR Message
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EmuSwapFS(); // Win2k/XP FS
|
EmuSwapFS(); // Win2k/XP FS
|
||||||
|
@ -2367,11 +2367,11 @@ XBSYSAPI EXPORTNUM(264) VOID NTAPI xboxkrnl::RtlAssert
|
||||||
" FailedAssertion : 0x%.08X\n"
|
" FailedAssertion : 0x%.08X\n"
|
||||||
" FileName : 0x%.08X\n"
|
" FileName : 0x%.08X\n"
|
||||||
" LineNumber : 0x%.08X\n"
|
" LineNumber : 0x%.08X\n"
|
||||||
" Message : 0x%.08X (\"%s\")\n"
|
" Message : 0x%.08X (\"%s\")\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), FailedAssertion, FileName, Message, Message);
|
GetCurrentThreadId(), FailedAssertion, FileName, Message, Message);
|
||||||
|
|
||||||
//TODO: Actually implement this.
|
//TODO: Actually implement this.
|
||||||
//NTSTATUS ret = NtDll::RtlAssert((NtDll::UNICODE_STRING*)DestinationString, (NtDll::STRING*)SourceString, AllocateDestinationString);
|
//NTSTATUS ret = NtDll::RtlAssert((NtDll::UNICODE_STRING*)DestinationString, (NtDll::STRING*)SourceString, AllocateDestinationString);
|
||||||
|
|
||||||
EmuSwapFS(); // Xbox FS
|
EmuSwapFS(); // Xbox FS
|
||||||
|
|
|
@ -95,7 +95,7 @@ uint16 EmuAllocateLDT(uint32 dwBaseAddr, uint32 dwLimit)
|
||||||
{
|
{
|
||||||
LeaveCriticalSection(&EmuLDTLock);
|
LeaveCriticalSection(&EmuLDTLock);
|
||||||
|
|
||||||
CxbxKrnlCleanup("Could not locate free LDT entry (too many threads?)");
|
CxbxKrnlCleanup("Could not locate free LDT entry (too many threads?)");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -108,19 +108,19 @@ uint16 EmuAllocateLDT(uint32 dwBaseAddr, uint32 dwLimit)
|
||||||
LDTEntry.BaseLow = (WORD)(dwBaseAddr & 0xFFFF);
|
LDTEntry.BaseLow = (WORD)(dwBaseAddr & 0xFFFF);
|
||||||
LDTEntry.HighWord.Bits.BaseMid = (dwBaseAddr >> 16) & 0xFF;
|
LDTEntry.HighWord.Bits.BaseMid = (dwBaseAddr >> 16) & 0xFF;
|
||||||
LDTEntry.HighWord.Bits.BaseHi = (dwBaseAddr >> 24) & 0xFF;
|
LDTEntry.HighWord.Bits.BaseHi = (dwBaseAddr >> 24) & 0xFF;
|
||||||
LDTEntry.HighWord.Bits.Type = 0x13; // RW data segment
|
LDTEntry.HighWord.Bits.Type = 0x13; // RW data segment
|
||||||
LDTEntry.HighWord.Bits.Dpl = 3; // user segment
|
LDTEntry.HighWord.Bits.Dpl = 3; // user segment
|
||||||
LDTEntry.HighWord.Bits.Pres = 1; // present
|
LDTEntry.HighWord.Bits.Pres = 1; // present
|
||||||
LDTEntry.HighWord.Bits.Sys = 0;
|
LDTEntry.HighWord.Bits.Sys = 0;
|
||||||
LDTEntry.HighWord.Bits.Reserved_0 = 0;
|
LDTEntry.HighWord.Bits.Reserved_0 = 0;
|
||||||
LDTEntry.HighWord.Bits.Default_Big = 1; // 386 segment
|
LDTEntry.HighWord.Bits.Default_Big = 1; // 386 segment
|
||||||
LDTEntry.HighWord.Bits.Granularity = (dwLimit >= 0x00100000) ? 1 : 0;
|
LDTEntry.HighWord.Bits.Granularity = (dwLimit >= 0x00100000) ? 1 : 0;
|
||||||
|
|
||||||
if(LDTEntry.HighWord.Bits.Granularity)
|
if(LDTEntry.HighWord.Bits.Granularity)
|
||||||
dwLimit >>= 12;
|
dwLimit >>= 12;
|
||||||
|
|
||||||
LDTEntry.LimitLow = (WORD)(dwLimit & 0xFFFF);
|
LDTEntry.LimitLow = (WORD)(dwLimit & 0xFFFF);
|
||||||
LDTEntry.HighWord.Bits.LimitHi = (dwLimit >> 16) & 0xF;
|
LDTEntry.HighWord.Bits.LimitHi = (dwLimit >> 16) & 0xF;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -131,7 +131,7 @@ uint16 EmuAllocateLDT(uint32 dwBaseAddr, uint32 dwLimit)
|
||||||
{
|
{
|
||||||
LeaveCriticalSection(&EmuLDTLock);
|
LeaveCriticalSection(&EmuLDTLock);
|
||||||
|
|
||||||
CxbxKrnlCleanup("Could not set LDT entries");
|
CxbxKrnlCleanup("Could not set LDT entries");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,9 +74,9 @@ typedef unsigned char UCHAR;
|
||||||
typedef unsigned char BYTE;
|
typedef unsigned char BYTE;
|
||||||
typedef unsigned char BOOLEAN;
|
typedef unsigned char BOOLEAN;
|
||||||
typedef unsigned short USHORT;
|
typedef unsigned short USHORT;
|
||||||
typedef unsigned short WORD;
|
typedef unsigned short WORD;
|
||||||
typedef unsigned long ULONG;
|
typedef unsigned long ULONG;
|
||||||
typedef unsigned long DWORD;
|
typedef unsigned long DWORD;
|
||||||
typedef unsigned long SIZE_T, *PSIZE_T;
|
typedef unsigned long SIZE_T, *PSIZE_T;
|
||||||
typedef unsigned long ACCESS_MASK;
|
typedef unsigned long ACCESS_MASK;
|
||||||
typedef unsigned long PHYSICAL_ADDRESS;
|
typedef unsigned long PHYSICAL_ADDRESS;
|
||||||
|
@ -237,7 +237,7 @@ RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
|
||||||
typedef struct _RTL_CRITICAL_SECTION
|
typedef struct _RTL_CRITICAL_SECTION
|
||||||
{
|
{
|
||||||
DWORD Unknown[4]; // 0x00
|
DWORD Unknown[4]; // 0x00
|
||||||
LONG LockCount; // 0x10
|
LONG LockCount; // 0x10
|
||||||
LONG RecursionCount; // 0x14
|
LONG RecursionCount; // 0x14
|
||||||
HANDLE OwningThread; // 0x18
|
HANDLE OwningThread; // 0x18
|
||||||
HANDLE LockSemaphore;
|
HANDLE LockSemaphore;
|
||||||
|
@ -364,9 +364,9 @@ OBJECT_WAIT_TYPE;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef enum _CREATE_FILE_TYPE
|
typedef enum _CREATE_FILE_TYPE
|
||||||
{
|
{
|
||||||
CreateFileTypeNone,
|
CreateFileTypeNone,
|
||||||
CreateFileTypeNamedPipe,
|
CreateFileTypeNamedPipe,
|
||||||
CreateFileTypeMailslot
|
CreateFileTypeMailslot
|
||||||
}
|
}
|
||||||
CREATE_FILE_TYPE;
|
CREATE_FILE_TYPE;
|
||||||
|
|
||||||
|
@ -375,10 +375,10 @@ CREATE_FILE_TYPE;
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef struct _FILE_FS_SIZE_INFORMATION
|
typedef struct _FILE_FS_SIZE_INFORMATION
|
||||||
{
|
{
|
||||||
LARGE_INTEGER TotalAllocationUnits;
|
LARGE_INTEGER TotalAllocationUnits;
|
||||||
LARGE_INTEGER AvailableAllocationUnits;
|
LARGE_INTEGER AvailableAllocationUnits;
|
||||||
ULONG SectorsPerAllocationUnit;
|
ULONG SectorsPerAllocationUnit;
|
||||||
ULONG BytesPerSector;
|
ULONG BytesPerSector;
|
||||||
}
|
}
|
||||||
FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
|
FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
|
||||||
|
|
||||||
|
@ -791,17 +791,17 @@ typedef NTSTATUS (NTAPI *FPTR_NtReleaseMutant)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtCreateFile)
|
typedef NTSTATUS (NTAPI *FPTR_NtCreateFile)
|
||||||
(
|
(
|
||||||
OUT PHANDLE FileHandle,
|
OUT PHANDLE FileHandle,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
||||||
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
||||||
IN ULONG FileAttributes,
|
IN ULONG FileAttributes,
|
||||||
IN ULONG ShareAccess,
|
IN ULONG ShareAccess,
|
||||||
IN ULONG CreateDisposition,
|
IN ULONG CreateDisposition,
|
||||||
IN ULONG CreateOptions,
|
IN ULONG CreateOptions,
|
||||||
IN PVOID EaBuffer OPTIONAL,
|
IN PVOID EaBuffer OPTIONAL,
|
||||||
IN ULONG EaLength
|
IN ULONG EaLength
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -838,14 +838,14 @@ typedef NTSTATUS (NTAPI *FPTR_NtOpenFile)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtReadFile)
|
typedef NTSTATUS (NTAPI *FPTR_NtReadFile)
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
IN HANDLE Event OPTIONAL,
|
IN HANDLE Event OPTIONAL,
|
||||||
IN PVOID ApcRoutine OPTIONAL,
|
IN PVOID ApcRoutine OPTIONAL,
|
||||||
IN PVOID ApcContext,
|
IN PVOID ApcContext,
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
OUT PVOID Buffer,
|
OUT PVOID Buffer,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN PLARGE_INTEGER ByteOffset OPTIONAL,
|
IN PLARGE_INTEGER ByteOffset OPTIONAL,
|
||||||
IN PULONG Key OPTIONAL
|
IN PULONG Key OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -854,14 +854,14 @@ typedef NTSTATUS (NTAPI *FPTR_NtReadFile)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtWriteFile)
|
typedef NTSTATUS (NTAPI *FPTR_NtWriteFile)
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
IN HANDLE Event OPTIONAL,
|
IN HANDLE Event OPTIONAL,
|
||||||
IN PVOID ApcRoutine OPTIONAL,
|
IN PVOID ApcRoutine OPTIONAL,
|
||||||
IN PVOID ApcContext,
|
IN PVOID ApcContext,
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
OUT PVOID Buffer,
|
OUT PVOID Buffer,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN PLARGE_INTEGER ByteOffset OPTIONAL,
|
IN PLARGE_INTEGER ByteOffset OPTIONAL,
|
||||||
IN PULONG Key OPTIONAL
|
IN PULONG Key OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -875,11 +875,11 @@ typedef VOID (NTAPI *FPTR_NtYieldExecution)();
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtSetInformationFile)
|
typedef NTSTATUS (NTAPI *FPTR_NtSetInformationFile)
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle, // TODO: correct paramters
|
IN HANDLE FileHandle, // TODO: correct paramters
|
||||||
OUT PVOID IoStatusBlock,
|
OUT PVOID IoStatusBlock,
|
||||||
IN PVOID FileInformation,
|
IN PVOID FileInformation,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG FileInformationClass
|
IN ULONG FileInformationClass
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -887,8 +887,8 @@ typedef NTSTATUS (NTAPI *FPTR_NtSetInformationFile)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtSuspendThread)
|
typedef NTSTATUS (NTAPI *FPTR_NtSuspendThread)
|
||||||
(
|
(
|
||||||
IN HANDLE ThreadHandle,
|
IN HANDLE ThreadHandle,
|
||||||
OUT PULONG PreviousSuspendCount OPTIONAL
|
OUT PULONG PreviousSuspendCount OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -896,8 +896,8 @@ typedef NTSTATUS (NTAPI *FPTR_NtSuspendThread)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtResumeThread)
|
typedef NTSTATUS (NTAPI *FPTR_NtResumeThread)
|
||||||
(
|
(
|
||||||
IN HANDLE ThreadHandle,
|
IN HANDLE ThreadHandle,
|
||||||
OUT PULONG SuspendCount OPTIONAL
|
OUT PULONG SuspendCount OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -905,8 +905,8 @@ typedef NTSTATUS (NTAPI *FPTR_NtResumeThread)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtSetEvent)
|
typedef NTSTATUS (NTAPI *FPTR_NtSetEvent)
|
||||||
(
|
(
|
||||||
IN HANDLE EventHandle,
|
IN HANDLE EventHandle,
|
||||||
OUT PLONG PreviousState OPTIONAL
|
OUT PLONG PreviousState OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -941,11 +941,11 @@ typedef NTSTATUS (NTAPI *FPTR_NtQueryFullAttributesFile)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_NtQueryInformationFile)
|
typedef NTSTATUS (NTAPI *FPTR_NtQueryInformationFile)
|
||||||
(
|
(
|
||||||
IN HANDLE FileHandle,
|
IN HANDLE FileHandle,
|
||||||
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
||||||
OUT PFILE_FS_SIZE_INFORMATION FileInformation,
|
OUT PFILE_FS_SIZE_INFORMATION FileInformation,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN FILE_INFORMATION_CLASS FileInfo
|
IN FILE_INFORMATION_CLASS FileInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -965,20 +965,20 @@ typedef NTSTATUS (NTAPI *FPTR_NtQueryVolumeInformationFile)
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
typedef NTSTATUS (NTAPI *FPTR_IoCreateFile)
|
typedef NTSTATUS (NTAPI *FPTR_IoCreateFile)
|
||||||
(
|
(
|
||||||
OUT PHANDLE FileHandle,
|
OUT PHANDLE FileHandle,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
||||||
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
||||||
IN ULONG FileAttributes,
|
IN ULONG FileAttributes,
|
||||||
IN ULONG ShareAccess,
|
IN ULONG ShareAccess,
|
||||||
IN ULONG Disposition,
|
IN ULONG Disposition,
|
||||||
IN ULONG CreateOptions,
|
IN ULONG CreateOptions,
|
||||||
IN PVOID EaBuffer OPTIONAL,
|
IN PVOID EaBuffer OPTIONAL,
|
||||||
IN ULONG EaLength,
|
IN ULONG EaLength,
|
||||||
IN CREATE_FILE_TYPE CreateFileType,
|
IN CREATE_FILE_TYPE CreateFileType,
|
||||||
IN PVOID ExtraCreateParameters OPTIONAL,
|
IN PVOID ExtraCreateParameters OPTIONAL,
|
||||||
IN ULONG Options
|
IN ULONG Options
|
||||||
);
|
);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -209,93 +209,93 @@ VOID WINAPI XTL::EmuXGUnswizzleRect
|
||||||
DWORD dwBPP
|
DWORD dwBPP
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DWORD dwOffsetU = 0, dwMaskU = 0;
|
DWORD dwOffsetU = 0, dwMaskU = 0;
|
||||||
DWORD dwOffsetV = 0, dwMaskV = 0;
|
DWORD dwOffsetV = 0, dwMaskV = 0;
|
||||||
DWORD dwOffsetW = 0, dwMaskW = 0;
|
DWORD dwOffsetW = 0, dwMaskW = 0;
|
||||||
|
|
||||||
DWORD i = 1;
|
DWORD i = 1;
|
||||||
DWORD j = 1;
|
DWORD j = 1;
|
||||||
|
|
||||||
// while( (i >= dwWidth) || (i >= dwHeight) || (i >= dwDepth) )
|
// while( (i >= dwWidth) || (i >= dwHeight) || (i >= dwDepth) )
|
||||||
while( (i <= dwWidth) || (i <= dwHeight) || (i <= dwDepth) )
|
while( (i <= dwWidth) || (i <= dwHeight) || (i <= dwDepth) )
|
||||||
{
|
{
|
||||||
if(i < dwWidth)
|
if(i < dwWidth)
|
||||||
{
|
{
|
||||||
dwMaskU |= j;
|
dwMaskU |= j;
|
||||||
j<<=1;
|
j<<=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i < dwHeight)
|
if(i < dwHeight)
|
||||||
{
|
{
|
||||||
dwMaskV |= j;
|
dwMaskV |= j;
|
||||||
j<<=1;
|
j<<=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i < dwDepth)
|
if(i < dwDepth)
|
||||||
{
|
{
|
||||||
dwMaskW |= j;
|
dwMaskW |= j;
|
||||||
j<<=1;
|
j<<=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
i<<=1;
|
i<<=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD dwSU = 0;
|
DWORD dwSU = 0;
|
||||||
DWORD dwSV = 0;
|
DWORD dwSV = 0;
|
||||||
DWORD dwSW = 0;
|
DWORD dwSW = 0;
|
||||||
DWORD dwMaskMax=0;
|
DWORD dwMaskMax=0;
|
||||||
|
|
||||||
// get the biggest mask
|
// get the biggest mask
|
||||||
if(dwMaskU > dwMaskV)
|
if(dwMaskU > dwMaskV)
|
||||||
dwMaskMax=dwMaskU;
|
dwMaskMax=dwMaskU;
|
||||||
else
|
else
|
||||||
dwMaskMax=dwMaskV;
|
dwMaskMax=dwMaskV;
|
||||||
if(dwMaskW > dwMaskMax)
|
if(dwMaskW > dwMaskMax)
|
||||||
dwMaskMax=dwMaskW;
|
dwMaskMax=dwMaskW;
|
||||||
|
|
||||||
for(i = 1; i <= dwMaskMax; i<<=1)
|
for(i = 1; i <= dwMaskMax; i<<=1)
|
||||||
{
|
{
|
||||||
if(i<=dwMaskU)
|
if(i<=dwMaskU)
|
||||||
{
|
{
|
||||||
if(dwMaskU & i) dwSU |= (dwOffsetU & i);
|
if(dwMaskU & i) dwSU |= (dwOffsetU & i);
|
||||||
else dwOffsetU<<=1;
|
else dwOffsetU<<=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i<=dwMaskV)
|
if(i<=dwMaskV)
|
||||||
{
|
{
|
||||||
if(dwMaskV & i) dwSV |= (dwOffsetV & i);
|
if(dwMaskV & i) dwSV |= (dwOffsetV & i);
|
||||||
else dwOffsetV<<=1;
|
else dwOffsetV<<=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i<=dwMaskW)
|
if(i<=dwMaskW)
|
||||||
{
|
{
|
||||||
if(dwMaskW & i) dwSW |= (dwOffsetW & i);
|
if(dwMaskW & i) dwSW |= (dwOffsetW & i);
|
||||||
else dwOffsetW<<=1;
|
else dwOffsetW<<=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD dwW = dwSW;
|
DWORD dwW = dwSW;
|
||||||
DWORD dwV = dwSV;
|
DWORD dwV = dwSV;
|
||||||
DWORD dwU = dwSU;
|
DWORD dwU = dwSU;
|
||||||
|
|
||||||
for(DWORD z=0; z<dwDepth; z++)
|
for(DWORD z=0; z<dwDepth; z++)
|
||||||
{
|
{
|
||||||
dwV = dwSV;
|
dwV = dwSV;
|
||||||
|
|
||||||
for(DWORD y=0; y<dwHeight; y++)
|
for(DWORD y=0; y<dwHeight; y++)
|
||||||
{
|
{
|
||||||
dwU = dwSU;
|
dwU = dwSU;
|
||||||
|
|
||||||
for (DWORD x=0; x<dwWidth; x++)
|
for (DWORD x=0; x<dwWidth; x++)
|
||||||
{
|
{
|
||||||
memcpy(pDstBuff, &((BYTE*)pSrcBuff)[(dwU|dwV|dwW)*dwBPP], dwBPP);
|
memcpy(pDstBuff, &((BYTE*)pSrcBuff)[(dwU|dwV|dwW)*dwBPP], dwBPP);
|
||||||
pDstBuff=(PVOID)(((DWORD)pDstBuff)+dwBPP);
|
pDstBuff=(PVOID)(((DWORD)pDstBuff)+dwBPP);
|
||||||
|
|
||||||
dwU = (dwU - dwMaskU) & dwMaskU;
|
dwU = (dwU - dwMaskU) & dwMaskU;
|
||||||
}
|
}
|
||||||
pDstBuff=(PVOID)(((DWORD)pDstBuff)+(dwPitch-dwWidth*dwBPP));
|
pDstBuff=(PVOID)(((DWORD)pDstBuff)+(dwPitch-dwWidth*dwBPP));
|
||||||
dwV = (dwV - dwMaskV) & dwMaskV;
|
dwV = (dwV - dwMaskV) & dwMaskV;
|
||||||
}
|
}
|
||||||
dwW = (dwW - dwMaskW) & dwMaskW;
|
dwW = (dwW - dwMaskW) & dwMaskW;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,26 +39,26 @@
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
class EmuThis
|
class EmuThis
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * func: Emusocket
|
// * func: Emusocket
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
SOCKET Emusocket(int af, int type, int protocol);
|
SOCKET Emusocket(int af, int type, int protocol);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * func: Emubind
|
// * func: Emubind
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
int Emubind(SOCKET s, const struct sockaddr FAR *name, int namelen);
|
int Emubind(SOCKET s, const struct sockaddr FAR *name, int namelen);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * func: Emulisten
|
// * func: Emulisten
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
int Emulisten(SOCKET s, int backlog);
|
int Emulisten(SOCKET s, int backlog);
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * func: Emuioctlsocket
|
// * func: Emuioctlsocket
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
int Emuioctlsocket(SOCKET s, long cmd, u_long FAR *argp);
|
int Emuioctlsocket(SOCKET s, long cmd, u_long FAR *argp);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -132,28 +132,28 @@ HANDLE WINAPI XTL::EmuFindFirstFileA
|
||||||
}
|
}
|
||||||
|
|
||||||
// D:\ should map to current directory
|
// D:\ should map to current directory
|
||||||
if( (szBuffer[0] == 'D' || szBuffer[0] == 'd') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
if( (szBuffer[0] == 'D' || szBuffer[0] == 'd') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
}
|
}
|
||||||
else if( (szBuffer[0] == 'T' || szBuffer[0] == 't') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
else if( (szBuffer[0] == 'T' || szBuffer[0] == 't') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
szRoot = g_strTDrive;
|
szRoot = g_strTDrive;
|
||||||
}
|
}
|
||||||
else if( (szBuffer[0] == 'U' || szBuffer[0] == 'u') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
else if( (szBuffer[0] == 'U' || szBuffer[0] == 'u') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
szRoot = g_strUDrive;
|
szRoot = g_strUDrive;
|
||||||
}
|
}
|
||||||
else if( (szBuffer[0] == 'Z' || szBuffer[0] == 'z') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
else if( (szBuffer[0] == 'Z' || szBuffer[0] == 'z') && szBuffer[1] == ':' && szBuffer[2] == '\\')
|
||||||
{
|
{
|
||||||
szBuffer += 3;
|
szBuffer += 3;
|
||||||
|
|
||||||
szRoot = g_strZDrive;
|
szRoot = g_strZDrive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("af1 : %s\n", szRoot);
|
//printf("af1 : %s\n", szRoot);
|
||||||
|
@ -852,7 +852,7 @@ DWORD WINAPI XTL::EmuXInputGetState
|
||||||
{
|
{
|
||||||
if(pph->pPollingParameters != NULL)
|
if(pph->pPollingParameters != NULL)
|
||||||
{
|
{
|
||||||
// 5849 XDK samples hang if this code is allowed to execute, TODO: figure out why.
|
// 5849 XDK samples hang if this code is allowed to execute, TODO: figure out why.
|
||||||
/*if(pph->pPollingParameters->fAutoPoll == FALSE)
|
/*if(pph->pPollingParameters->fAutoPoll == FALSE)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -1132,25 +1132,25 @@ VOID WINAPI XTL::EmuXapiInitProcess()
|
||||||
|
|
||||||
DbgPrintf("EmuXapi (0x%X): EmuXapiInitProcess();\n", GetCurrentThreadId());
|
DbgPrintf("EmuXapi (0x%X): EmuXapiInitProcess();\n", GetCurrentThreadId());
|
||||||
|
|
||||||
// call RtlCreateHeap
|
// call RtlCreateHeap
|
||||||
{
|
{
|
||||||
RTL_HEAP_PARAMETERS HeapParameters;
|
RTL_HEAP_PARAMETERS HeapParameters;
|
||||||
|
|
||||||
ZeroMemory(&HeapParameters, sizeof(HeapParameters));
|
ZeroMemory(&HeapParameters, sizeof(HeapParameters));
|
||||||
|
|
||||||
HeapParameters.Length = sizeof(HeapParameters);
|
HeapParameters.Length = sizeof(HeapParameters);
|
||||||
|
|
||||||
EmuSwapFS(); // XBox FS
|
EmuSwapFS(); // XBox FS
|
||||||
|
|
||||||
uint32 dwPeHeapReserve = CxbxKrnl_XbeHeader->dwPeHeapReserve;
|
uint32 dwPeHeapReserve = CxbxKrnl_XbeHeader->dwPeHeapReserve;
|
||||||
uint32 dwPeHeapCommit = CxbxKrnl_XbeHeader->dwPeHeapCommit;
|
uint32 dwPeHeapCommit = CxbxKrnl_XbeHeader->dwPeHeapCommit;
|
||||||
|
|
||||||
PVOID dwResult = 0;
|
PVOID dwResult = 0;
|
||||||
|
|
||||||
#define HEAP_GROWABLE 0x00000002
|
#define HEAP_GROWABLE 0x00000002
|
||||||
|
|
||||||
*XTL::EmuXapiProcessHeap = XTL::g_pRtlCreateHeap(HEAP_GROWABLE, 0, dwPeHeapReserve, dwPeHeapCommit, NULL, &HeapParameters);
|
*XTL::EmuXapiProcessHeap = XTL::g_pRtlCreateHeap(HEAP_GROWABLE, 0, dwPeHeapReserve, dwPeHeapCommit, NULL, &HeapParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,9 +49,9 @@ typedef unsigned char UCHAR;
|
||||||
typedef unsigned char BYTE;
|
typedef unsigned char BYTE;
|
||||||
typedef unsigned char BOOLEAN;
|
typedef unsigned char BOOLEAN;
|
||||||
typedef unsigned short USHORT;
|
typedef unsigned short USHORT;
|
||||||
typedef unsigned short WORD;
|
typedef unsigned short WORD;
|
||||||
typedef unsigned long ULONG;
|
typedef unsigned long ULONG;
|
||||||
typedef unsigned long DWORD;
|
typedef unsigned long DWORD;
|
||||||
typedef unsigned long SIZE_T, *PSIZE_T;
|
typedef unsigned long SIZE_T, *PSIZE_T;
|
||||||
typedef unsigned long ACCESS_MASK, *PACCESS_MASK;
|
typedef unsigned long ACCESS_MASK, *PACCESS_MASK;
|
||||||
typedef unsigned long PHYSICAL_ADDRESS;
|
typedef unsigned long PHYSICAL_ADDRESS;
|
||||||
|
|
|
@ -340,8 +340,8 @@ extern uint32 XRefDataBase[] =
|
||||||
-1, // XREF_DSBUFFERSETPLAYREGIONA (Buffer)
|
-1, // XREF_DSBUFFERSETPLAYREGIONA (Buffer)
|
||||||
-1, // XREF_DSBUFFERLOCKA (Buffer)
|
-1, // XREF_DSBUFFERLOCKA (Buffer)
|
||||||
-1, // XREF_DSBUFFERSETHEADROOMA (Buffer)
|
-1, // XREF_DSBUFFERSETHEADROOMA (Buffer)
|
||||||
-1, // XREF_DSBUFFERSETFREQUENCYA (Buffer)
|
-1, // XREF_DSBUFFERSETFREQUENCYA (Buffer)
|
||||||
-1, // XREF_DSBUFFERSETFREQUENCYB
|
-1, // XREF_DSBUFFERSETFREQUENCYB
|
||||||
-1, // XREF_DSSTREAMSETMAXDISTANCE1A (Stream)
|
-1, // XREF_DSSTREAMSETMAXDISTANCE1A (Stream)
|
||||||
-1, // XREF_DSSTREAMSETMAXDISTANCE1B
|
-1, // XREF_DSSTREAMSETMAXDISTANCE1B
|
||||||
-1, // XREF_DSSTREAMSETMAXDISTANCE1C
|
-1, // XREF_DSSTREAMSETMAXDISTANCE1C
|
||||||
|
@ -397,26 +397,26 @@ extern uint32 XRefDataBase[] =
|
||||||
-1, // XREF_DSBUFFERSETI3DL2SOURCE
|
-1, // XREF_DSBUFFERSETI3DL2SOURCE
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_SetFormat
|
-1, // XREF_DirectSound_CDirectSoundVoice_SetFormat
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetFormat
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetFormat
|
||||||
-1, // XREF_DirectSound_CFullHRTFSource_GetCenterVolume
|
-1, // XREF_DirectSound_CFullHRTFSource_GetCenterVolume
|
||||||
-1, // XREF_DirectSound_CHRTFSource_SetFullHRTF5Channel
|
-1, // XREF_DirectSound_CHRTFSource_SetFullHRTF5Channel
|
||||||
-1, // XREF_D3D_SetFence
|
-1, // XREF_D3D_SetFence
|
||||||
-1, // XREF_D3D_BlockOnResource
|
-1, // XREF_D3D_BlockOnResource
|
||||||
-1, // XREF_DirectSound_CMcpxVoiceClient_SetLFO
|
-1, // XREF_DirectSound_CMcpxVoiceClient_SetLFO
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_SetLFO
|
-1, // XREF_DirectSound_CDirectSoundVoice_SetLFO
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetLFO
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetLFO
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_SetVolume
|
-1, // XREF_DirectSound_CDirectSoundVoice_SetVolume
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetVolume
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetVolume
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetLoopRegion
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetLoopRegion
|
||||||
-1, // XREF_DirectSound_CMcpxBuffer_Play
|
-1, // XREF_DirectSound_CMcpxBuffer_Play
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_PlayEx
|
-1, // XREF_DirectSound_CDirectSoundBuffer_PlayEx
|
||||||
-1, // XREF_DirectSound_WaveFormat_CreateXboxAdpcmFormat
|
-1, // XREF_DirectSound_WaveFormat_CreateXboxAdpcmFormat
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_SetConeAngles
|
-1, // XREF_DirectSound_CDirectSoundVoice_SetConeAngles
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetConeAngles
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetConeAngles
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_CommitDeferredSettings
|
-1, // XREF_DirectSound_CDirectSoundVoice_CommitDeferredSettings
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_SetAllParameters
|
-1, // XREF_DirectSound_CDirectSoundVoice_SetAllParameters
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetAllParameters
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetAllParameters
|
||||||
-1, // XREF_DirectSound_CDirectSoundVoice_SetRolloffCurve
|
-1, // XREF_DirectSound_CDirectSoundVoice_SetRolloffCurve
|
||||||
-1, // XREF_DirectSound_CDirectSoundBuffer_SetRolloffCurve
|
-1, // XREF_DirectSound_CDirectSoundBuffer_SetRolloffCurve
|
||||||
/* not necessary?
|
/* not necessary?
|
||||||
-1, //XREF_XAPIXCALCULATESIGNATUREBEGINEX
|
-1, //XREF_XAPIXCALCULATESIGNATUREBEGINEX
|
||||||
//*/
|
//*/
|
||||||
|
|
|
@ -172,8 +172,8 @@ enum XRefDataBaseOffset
|
||||||
XREF_DSBUFFERSETPLAYREGIONA,
|
XREF_DSBUFFERSETPLAYREGIONA,
|
||||||
XREF_DSBUFFERLOCKA,
|
XREF_DSBUFFERLOCKA,
|
||||||
XREF_DSBUFFERSETHEADROOMA,
|
XREF_DSBUFFERSETHEADROOMA,
|
||||||
XREF_DSBUFFERSETFREQUENCYA,
|
XREF_DSBUFFERSETFREQUENCYA,
|
||||||
XREF_DSBUFFERSETFREQUENCYB,
|
XREF_DSBUFFERSETFREQUENCYB,
|
||||||
XREF_DSSTREAMSETMAXDISTANCE1A,
|
XREF_DSSTREAMSETMAXDISTANCE1A,
|
||||||
XREF_DSSTREAMSETMAXDISTANCE1B,
|
XREF_DSSTREAMSETMAXDISTANCE1B,
|
||||||
XREF_DSSTREAMSETMAXDISTANCE1C,
|
XREF_DSSTREAMSETMAXDISTANCE1C,
|
||||||
|
@ -230,26 +230,26 @@ enum XRefDataBaseOffset
|
||||||
XREF_DSBUFFERSETI3DL2SOURCE,
|
XREF_DSBUFFERSETI3DL2SOURCE,
|
||||||
XREF_DirectSound_CDirectSoundVoice_SetFormat,
|
XREF_DirectSound_CDirectSoundVoice_SetFormat,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetFormat,
|
XREF_DirectSound_CDirectSoundBuffer_SetFormat,
|
||||||
XREF_DirectSound_CFullHRTFSource_GetCenterVolume,
|
XREF_DirectSound_CFullHRTFSource_GetCenterVolume,
|
||||||
XREF_DirectSound_CHRTFSource_SetFullHRTF5Channel,
|
XREF_DirectSound_CHRTFSource_SetFullHRTF5Channel,
|
||||||
XREF_D3D_SetFence,
|
XREF_D3D_SetFence,
|
||||||
XREF_D3D_BlockOnResource,
|
XREF_D3D_BlockOnResource,
|
||||||
XREF_DirectSound_CMcpxVoiceClient_SetLFO,
|
XREF_DirectSound_CMcpxVoiceClient_SetLFO,
|
||||||
XREF_DirectSound_CDirectSoundVoice_SetLFO,
|
XREF_DirectSound_CDirectSoundVoice_SetLFO,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetLFO,
|
XREF_DirectSound_CDirectSoundBuffer_SetLFO,
|
||||||
XREF_DirectSound_CDirectSoundVoice_SetVolume,
|
XREF_DirectSound_CDirectSoundVoice_SetVolume,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetVolume,
|
XREF_DirectSound_CDirectSoundBuffer_SetVolume,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetLoopRegion,
|
XREF_DirectSound_CDirectSoundBuffer_SetLoopRegion,
|
||||||
XREF_DirectSound_CMcpxBuffer_Play,
|
XREF_DirectSound_CMcpxBuffer_Play,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_PlayEx,
|
XREF_DirectSound_CDirectSoundBuffer_PlayEx,
|
||||||
XREF_DirectSound_WaveFormat_CreateXboxAdpcmFormat,
|
XREF_DirectSound_WaveFormat_CreateXboxAdpcmFormat,
|
||||||
XREF_DirectSound_CDirectSoundVoice_SetConeAngles,
|
XREF_DirectSound_CDirectSoundVoice_SetConeAngles,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetConeAngles,
|
XREF_DirectSound_CDirectSoundBuffer_SetConeAngles,
|
||||||
XREF_DirectSound_CDirectSoundVoice_CommitDeferredSettings,
|
XREF_DirectSound_CDirectSoundVoice_CommitDeferredSettings,
|
||||||
XREF_DirectSound_CDirectSoundVoice_SetAllParameters,
|
XREF_DirectSound_CDirectSoundVoice_SetAllParameters,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetAllParameters,
|
XREF_DirectSound_CDirectSoundBuffer_SetAllParameters,
|
||||||
XREF_DirectSound_CDirectSoundVoice_SetRolloffCurve,
|
XREF_DirectSound_CDirectSoundVoice_SetRolloffCurve,
|
||||||
XREF_DirectSound_CDirectSoundBuffer_SetRolloffCurve,
|
XREF_DirectSound_CDirectSoundBuffer_SetRolloffCurve,
|
||||||
// XAPI
|
// XAPI
|
||||||
/* not necessary?
|
/* not necessary?
|
||||||
XREF_XAPIXCALCULATESIGNATUREBEGINEX
|
XREF_XAPIXCALCULATESIGNATUREBEGINEX
|
||||||
|
|
|
@ -49,10 +49,10 @@ OOVPATable D3D8_1_0_4034[] =
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// ********************** BEG WARNING UNTESTED!!! *******************
|
// ********************** BEG WARNING UNTESTED!!! *******************
|
||||||
|
|
||||||
|
|
||||||
// IDirect3DDevice8::GetDeviceCaps
|
// IDirect3DDevice8::GetDeviceCaps
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_GetDeviceCaps_1_0_3925,
|
(OOVPA*)&IDirect3DDevice8_GetDeviceCaps_1_0_3925,
|
||||||
|
|
||||||
|
@ -673,7 +673,7 @@ OOVPATable D3D8_1_0_4034[] =
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
|
|
||||||
// ********************** END WARNING UNTESTED!!! *******************
|
// ********************** END WARNING UNTESTED!!! *******************
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -305,10 +305,10 @@ OOVPATable D3D8_1_0_4134[] =
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// ********************** BEG WARNING UNTESTED!!! *******************
|
// ********************** BEG WARNING UNTESTED!!! *******************
|
||||||
|
|
||||||
|
|
||||||
// IDirect3DDevice8::GetDeviceCaps
|
// IDirect3DDevice8::GetDeviceCaps
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_GetDeviceCaps_1_0_3925,
|
(OOVPA*)&IDirect3DDevice8_GetDeviceCaps_1_0_3925,
|
||||||
|
|
||||||
|
@ -889,7 +889,7 @@ OOVPATable D3D8_1_0_4134[] =
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
|
|
||||||
// ********************** END WARNING UNTESTED!!! *******************
|
// ********************** END WARNING UNTESTED!!! *******************
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -1129,7 +1129,7 @@ SOOVPA<5> IDirect3DDevice8_InsertFence_1_0_5558 =
|
||||||
1, // Xref Is Used
|
1, // Xref Is Used
|
||||||
|
|
||||||
{
|
{
|
||||||
{ 0x03, XREF_D3D_SetFence },
|
{ 0x03, XREF_D3D_SetFence },
|
||||||
|
|
||||||
{ 0x00, 0x6A },
|
{ 0x00, 0x6A },
|
||||||
{ 0x01, 0x00 },
|
{ 0x01, 0x00 },
|
||||||
|
@ -1185,7 +1185,7 @@ SOOVPA<16> D3D_BlockOnResource_1_0_5558 =
|
||||||
{ 0x46, 0x8B }, // mov esi, [eax+8]
|
{ 0x46, 0x8B }, // mov esi, [eax+8]
|
||||||
{ 0x47, 0x70 },
|
{ 0x47, 0x70 },
|
||||||
{ 0x48, 0x08 },
|
{ 0x48, 0x08 },
|
||||||
{ 0x75, 0xC2 }, // retn 4
|
{ 0x75, 0xC2 }, // retn 4
|
||||||
{ 0x76, 0x04 },
|
{ 0x76, 0x04 },
|
||||||
{ 0x77, 0x00 },
|
{ 0x77, 0x00 },
|
||||||
|
|
||||||
|
@ -1204,7 +1204,7 @@ SOOVPA<2> IDirect3DResource8_BlockUntilNotBusy_1_0_5558 =
|
||||||
1, // Xref Is Used
|
1, // Xref Is Used
|
||||||
|
|
||||||
{
|
{
|
||||||
{ 0x01, XREF_D3D_BlockOnResource },
|
{ 0x01, XREF_D3D_BlockOnResource },
|
||||||
|
|
||||||
{ 0x00, 0xE9 },
|
{ 0x00, 0xE9 },
|
||||||
}
|
}
|
||||||
|
@ -1951,7 +1951,7 @@ OOVPATable D3D8_1_0_5558[] =
|
||||||
"EmuIDirect3DTexture8_GetSurfaceLevel2"
|
"EmuIDirect3DTexture8_GetSurfaceLevel2"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::GetRenderTarget2
|
// IDirect3DDevice8::GetRenderTarget2
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_GetRenderTarget2_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_GetRenderTarget2_1_0_5558,
|
||||||
|
|
||||||
|
@ -1961,17 +1961,17 @@ OOVPATable D3D8_1_0_5558[] =
|
||||||
"EmuIDirect3DDevice8_GetRenderTarget2"
|
"EmuIDirect3DDevice8_GetRenderTarget2"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3D8::CheckDeviceMultiSampleType
|
// IDirect3D8::CheckDeviceMultiSampleType
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3D8_CheckDeviceMultiSampleType_1_0_5558,
|
(OOVPA*)&IDirect3D8_CheckDeviceMultiSampleType_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3D8_CheckDeviceMultiSampleType,
|
XTL::EmuIDirect3D8_CheckDeviceMultiSampleType,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3D8_CheckDeviceMultiSampleType"
|
"EmuIDirect3D8_CheckDeviceMultiSampleType"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3D8::GetDeviceCaps
|
// IDirect3D8::GetDeviceCaps
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3D8_GetDeviceCaps_1_0_5558,
|
(OOVPA*)&IDirect3D8_GetDeviceCaps_1_0_5558,
|
||||||
|
|
||||||
|
@ -1981,15 +1981,15 @@ OOVPATable D3D8_1_0_5558[] =
|
||||||
"EmuIDirect3D8_GetDeviceCaps"
|
"EmuIDirect3D8_GetDeviceCaps"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3D8_SetPushBufferSize
|
// IDirect3D8_SetPushBufferSize
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3D8_SetPushBufferSize_1_0_5558,
|
(OOVPA*)&IDirect3D8_SetPushBufferSize_1_0_5558,
|
||||||
XTL::EmuIDirect3D8_SetPushBufferSize,
|
XTL::EmuIDirect3D8_SetPushBufferSize,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3D8_SetPushBufferSize"
|
"EmuIDirect3D8_SetPushBufferSize"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::DrawVertices
|
// IDirect3DDevice8::DrawVertices
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_DrawVertices_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_DrawVertices_1_0_5558,
|
||||||
|
@ -2000,62 +2000,62 @@ OOVPATable D3D8_1_0_5558[] =
|
||||||
"EmuIDirect3DDevice8_DrawVertices"
|
"EmuIDirect3DDevice8_DrawVertices"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// D3D::SetFence (XREF)
|
// D3D::SetFence (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&D3D_SetFence_1_0_5558,0,
|
(OOVPA*)&D3D_SetFence_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"D3D::SetFence (XREF)"
|
"D3D::SetFence (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::InsertFence
|
// IDirect3DDevice8::InsertFence
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_InsertFence_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_InsertFence_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_InsertFence,
|
XTL::EmuIDirect3DDevice8_InsertFence,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_InsertFence"
|
"EmuIDirect3DDevice8_InsertFence"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::BlockOnFence
|
// IDirect3DDevice8::BlockOnFence
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_BlockOnFence_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_BlockOnFence_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_BlockOnFence,
|
XTL::EmuIDirect3DDevice8_BlockOnFence,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_BlockOnFence"
|
"EmuIDirect3DDevice8_BlockOnFence"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// D3D::BlockOnResource (XREF)
|
// D3D::BlockOnResource (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&D3D_BlockOnResource_1_0_5558,0,
|
(OOVPA*)&D3D_BlockOnResource_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"D3D::BlockOnResource (XREF)"
|
"D3D::BlockOnResource (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DResource8::BlockUntilNotBusy
|
// IDirect3DResource8::BlockUntilNotBusy
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DResource8_BlockUntilNotBusy_1_0_5558,
|
(OOVPA*)&IDirect3DResource8_BlockUntilNotBusy_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3DResource8_BlockUntilNotBusy,
|
XTL::EmuIDirect3DResource8_BlockUntilNotBusy,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DResource8_BlockUntilNotBusy"
|
"EmuIDirect3DResource8_BlockUntilNotBusy"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DVertexBuffer8::GetDesc
|
// IDirect3DVertexBuffer8::GetDesc
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DVertexBuffer8_GetDesc_1_0_5558,
|
(OOVPA*)&IDirect3DVertexBuffer8_GetDesc_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3DVertexBuffer8_GetDesc,
|
XTL::EmuIDirect3DVertexBuffer8_GetDesc,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DVertexBuffer8_GetDesc"
|
"EmuIDirect3DVertexBuffer8_GetDesc"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::CopyRects
|
// IDirect3DDevice8::CopyRects
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_CopyRects_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_CopyRects_1_0_5558,
|
||||||
|
@ -2066,16 +2066,16 @@ OOVPATable D3D8_1_0_5558[] =
|
||||||
"EmuIDirect3DDevice8_CopyRects"
|
"EmuIDirect3DDevice8_CopyRects"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::SetScissors
|
// IDirect3DDevice8::SetScissors
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_SetScissors_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_SetScissors_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_SetScissors,
|
XTL::EmuIDirect3DDevice8_SetScissors,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_SetScissors"
|
"EmuIDirect3DDevice8_SetScissors"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::GetDepthStencilSurface2
|
// IDirect3DDevice8::GetDepthStencilSurface2
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_GetDepthStencilSurface2_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_GetDepthStencilSurface2_1_0_5558,
|
||||||
|
|
|
@ -1029,17 +1029,17 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DDevice8_Begin"
|
"EmuIDirect3DDevice8_Begin"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
/*// IDirect3DDevice8::BeginStateBig
|
/*// IDirect3DDevice8::BeginStateBig
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_BeginStateBig_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_BeginStateBig_1_0_5849,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_BeginStateBig,
|
XTL::EmuIDirect3DDevice8_BeginStateBig,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"IDirect3DDevice8_BeginStateBig"
|
"IDirect3DDevice8_BeginStateBig"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
},*/
|
},*/
|
||||||
// IDirect3DDevice8::GetTransform (* unchanged since 4361 *)
|
// IDirect3DDevice8::GetTransform (* unchanged since 4361 *)
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_GetTransform_1_0_4361,
|
(OOVPA*)&IDirect3DDevice8_GetTransform_1_0_4361,
|
||||||
|
@ -1130,7 +1130,7 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DSurface8_GetDesc"
|
"EmuIDirect3DSurface8_GetDesc"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DTexture8::LockRect
|
// IDirect3DTexture8::LockRect
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DTexture8_LockRect_1_0_5849,
|
(OOVPA*)&IDirect3DTexture8_LockRect_1_0_5849,
|
||||||
|
|
||||||
|
@ -1170,10 +1170,10 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DTexture8_GetSurfaceLevel2"
|
"EmuIDirect3DTexture8_GetSurfaceLevel2"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::SetLight//(OOVPA*)&IDirect3DDevice8_SetLight_1_0_5558,
|
// IDirect3DDevice8::SetLight//(OOVPA*)&IDirect3DDevice8_SetLight_1_0_5558,
|
||||||
{
|
{
|
||||||
|
|
||||||
(OOVPA*)&IDirect3DDevice8_SetLight_1_0_5558,
|
(OOVPA*)&IDirect3DDevice8_SetLight_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_SetLight,
|
XTL::EmuIDirect3DDevice8_SetLight,
|
||||||
|
|
||||||
|
@ -1181,27 +1181,27 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DDevice8_SetLight"
|
"EmuIDirect3DDevice8_SetLight"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::CreateVertexBuffer2
|
// IDirect3DDevice8::CreateVertexBuffer2
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_CreateVertexBuffer2_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_CreateVertexBuffer2_1_0_5849,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_CreateVertexBuffer2,
|
XTL::EmuIDirect3DDevice8_CreateVertexBuffer2,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_CreateVertexBuffer2"
|
"EmuIDirect3DDevice8_CreateVertexBuffer2"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DVertexBuffer8_Lock
|
// IDirect3DVertexBuffer8_Lock
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DVertexBuffer8_Lock_1_0_5849,
|
(OOVPA*)&IDirect3DVertexBuffer8_Lock_1_0_5849,
|
||||||
|
|
||||||
XTL::EmuIDirect3DVertexBuffer8_Lock,
|
XTL::EmuIDirect3DVertexBuffer8_Lock,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DVertexBuffer8_Lock"
|
"EmuIDirect3DVertexBuffer8_Lock"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DVertexBuffer8::Lock2
|
// IDirect3DVertexBuffer8::Lock2
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DVertexBuffer8_Lock2_1_0_5849,
|
(OOVPA*)&IDirect3DVertexBuffer8_Lock2_1_0_5849,
|
||||||
|
|
||||||
|
@ -1211,45 +1211,45 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DVertexBuffer8_Lock2"
|
"EmuIDirect3DVertexBuffer8_Lock2"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8_LightEnable
|
// IDirect3DDevice8_LightEnable
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_LightEnable_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_LightEnable_1_0_5849,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_LightEnable,
|
XTL::EmuIDirect3DDevice8_LightEnable,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_LightEnable"
|
"EmuIDirect3DDevice8_LightEnable"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8_DrawVertices
|
// IDirect3DDevice8_DrawVertices
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_DrawVertices_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_DrawVertices_1_0_5849,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_DrawVertices,
|
XTL::EmuIDirect3DDevice8_DrawVertices,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_DrawVertices"
|
"EmuIDirect3DDevice8_DrawVertices"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3D8_AllocContiguousMemory
|
// IDirect3D8_AllocContiguousMemory
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3D8_AllocContiguousMemory_1_0_5849,
|
(OOVPA*)&IDirect3D8_AllocContiguousMemory_1_0_5849,
|
||||||
XTL::EmuIDirect3D8_AllocContiguousMemory,
|
XTL::EmuIDirect3D8_AllocContiguousMemory,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3D8_AllocContiguousMemory"
|
"EmuIDirect3D8_AllocContiguousMemory"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DTexture8_GetLevelDesc
|
// IDirect3DTexture8_GetLevelDesc
|
||||||
{
|
{
|
||||||
(OOVPA*)&Get2DSurfaceDesc_1_0_5849,
|
(OOVPA*)&Get2DSurfaceDesc_1_0_5849,
|
||||||
XTL::EmuGet2DSurfaceDesc,
|
XTL::EmuGet2DSurfaceDesc,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DTexture8_GetLevelDesc"
|
"EmuIDirect3DTexture8_GetLevelDesc"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::CreateTexture2
|
// IDirect3DDevice8::CreateTexture2
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_CreateTexture2_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_CreateTexture2_1_0_5849,
|
||||||
|
|
||||||
|
@ -1259,7 +1259,7 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DDevice8_CreateTexture2"
|
"EmuIDirect3DDevice8_CreateTexture2"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// Lock2DSurface
|
// Lock2DSurface
|
||||||
{
|
{
|
||||||
(OOVPA*)&Lock2DSurface_1_0_3925,
|
(OOVPA*)&Lock2DSurface_1_0_3925,
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuLock2DSurface"
|
"EmuLock2DSurface"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::SetVertexShaderConstant4
|
// IDirect3DDevice8::SetVertexShaderConstant4
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_SetVertexShaderConstant4_1_0_4627,
|
(OOVPA*)&IDirect3DDevice8_SetVertexShaderConstant4_1_0_4627,
|
||||||
|
|
||||||
|
@ -1279,7 +1279,7 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DDevice8_SetVertexShaderConstant4"
|
"EmuIDirect3DDevice8_SetVertexShaderConstant4"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::SetVertexShaderConstant1
|
// IDirect3DDevice8::SetVertexShaderConstant1
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_SetVertexShaderConstant1_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_SetVertexShaderConstant1_1_0_5849,
|
||||||
|
|
||||||
|
@ -1289,7 +1289,7 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DDevice8_SetVertexShaderConstant1"
|
"EmuIDirect3DDevice8_SetVertexShaderConstant1"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::DrawVerticesUP
|
// IDirect3DDevice8::DrawVerticesUP
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_DrawVerticesUP_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_DrawVerticesUP_1_0_5849,
|
||||||
|
|
||||||
|
@ -1299,16 +1299,16 @@ OOVPATable D3D8_1_0_5849[] =
|
||||||
"EmuIDirect3DDevice8_DrawVerticesUP"
|
"EmuIDirect3DDevice8_DrawVerticesUP"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirect3DDevice8::SetRenderTarget
|
// IDirect3DDevice8::SetRenderTarget
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirect3DDevice8_SetRenderTarget_1_0_5849,
|
(OOVPA*)&IDirect3DDevice8_SetRenderTarget_1_0_5849,
|
||||||
|
|
||||||
XTL::EmuIDirect3DDevice8_SetRenderTarget,
|
XTL::EmuIDirect3DDevice8_SetRenderTarget,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirect3DDevice8_SetRenderTarget"
|
"EmuIDirect3DDevice8_SetRenderTarget"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -329,7 +329,7 @@ SOOVPA<10> CDirectSoundVoiceSettings_SetMixBins_1_0_4432 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
10, // Count == 10
|
10, // Count == 10
|
||||||
|
|
||||||
XREF_DSSETMIXBINSC, // XRef Is Saved
|
XREF_DSSETMIXBINSC, // XRef Is Saved
|
||||||
0, // XRef Not Used
|
0, // XRef Not Used
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -361,14 +361,14 @@ SOOVPA<17> CDirectSoundVoice_SetMixBins_1_0_4432 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
17, // Count == 17
|
17, // Count == 17
|
||||||
|
|
||||||
XREF_DSSETMIXBINSB, // XRef Is Saved
|
XREF_DSSETMIXBINSB, // XRef Is Saved
|
||||||
1, // XRef Is Used
|
1, // XRef Is Used
|
||||||
|
|
||||||
{
|
{
|
||||||
// CDirectSoundVoice_SetMixBins+0x0D : call [CDirectSoundVoiceSettings::SetMixBins]
|
// CDirectSoundVoice_SetMixBins+0x0D : call [CDirectSoundVoiceSettings::SetMixBins]
|
||||||
{ 0x0D, XREF_DSSETMIXBINSC }, // (Offset,Value)-Pair #1
|
{ 0x0D, XREF_DSSETMIXBINSC }, // (Offset,Value)-Pair #1
|
||||||
|
|
||||||
// CDirectSoundVoice_SetMixBins+0x01 : mov esi, [esp+8]
|
// CDirectSoundVoice_SetMixBins+0x01 : mov esi, [esp+8]
|
||||||
{ 0x01, 0x8B }, // (Offset,Value)-Pair #2
|
{ 0x01, 0x8B }, // (Offset,Value)-Pair #2
|
||||||
{ 0x02, 0x74 }, // (Offset,Value)-Pair #3
|
{ 0x02, 0x74 }, // (Offset,Value)-Pair #3
|
||||||
{ 0x03, 0x24 }, // (Offset,Value)-Pair #4
|
{ 0x03, 0x24 }, // (Offset,Value)-Pair #4
|
||||||
|
@ -404,14 +404,14 @@ SOOVPA<17> CDirectSoundBuffer_SetMixBins_1_0_4432 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
17, // Count == 17
|
17, // Count == 17
|
||||||
|
|
||||||
XREF_DSSETMIXBINSA, // XRef Is Saved
|
XREF_DSSETMIXBINSA, // XRef Is Saved
|
||||||
1, // XRef Not Used
|
1, // XRef Not Used
|
||||||
|
|
||||||
{
|
{
|
||||||
// CDirectSoundBuffer_SetMixBins+0x32 : call [CDirectSoundVoice::SetMixBins]
|
// CDirectSoundBuffer_SetMixBins+0x32 : call [CDirectSoundVoice::SetMixBins]
|
||||||
{ 0x32, XREF_DSSETMIXBINSB }, // (Offset,Value)-Pair #1
|
{ 0x32, XREF_DSSETMIXBINSB }, // (Offset,Value)-Pair #1
|
||||||
|
|
||||||
// CDirectSoundBuffer_SetMixBins+0x21 : mov eax, 0x80004005
|
// CDirectSoundBuffer_SetMixBins+0x21 : mov eax, 0x80004005
|
||||||
{ 0x21, 0xB8 }, // (Offset,Value)-Pair #2
|
{ 0x21, 0xB8 }, // (Offset,Value)-Pair #2
|
||||||
{ 0x22, 0x05 }, // (Offset,Value)-Pair #3
|
{ 0x22, 0x05 }, // (Offset,Value)-Pair #3
|
||||||
{ 0x23, 0x40 }, // (Offset,Value)-Pair #4
|
{ 0x23, 0x40 }, // (Offset,Value)-Pair #4
|
||||||
|
|
|
@ -282,7 +282,7 @@ SOOVPA<10> CDirectSoundVoiceSettings_SetMixBinVolumes_1_0_4627 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
10, // Count == 10
|
10, // Count == 10
|
||||||
|
|
||||||
XREF_DSSETMIXBINVOLUMESC, // XRef Is Saved
|
XREF_DSSETMIXBINVOLUMESC, // XRef Is Saved
|
||||||
0, // XRef Not Used
|
0, // XRef Not Used
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -314,14 +314,14 @@ SOOVPA<17> CDirectSoundVoice_SetMixBinVolumes_1_0_4627 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
17, // Count == 17
|
17, // Count == 17
|
||||||
|
|
||||||
XREF_DSSETMIXBINVOLUMESB, // XRef Is Saved
|
XREF_DSSETMIXBINVOLUMESB, // XRef Is Saved
|
||||||
1, // XRef Is Used
|
1, // XRef Is Used
|
||||||
|
|
||||||
{
|
{
|
||||||
// CDirectSoundVoice_SetMixBinVolumes+0x0D : call [CDirectSoundVoiceSettings::SetMixBinVolumes]
|
// CDirectSoundVoice_SetMixBinVolumes+0x0D : call [CDirectSoundVoiceSettings::SetMixBinVolumes]
|
||||||
{ 0x0D, XREF_DSSETMIXBINVOLUMESC }, // (Offset,Value)-Pair #1
|
{ 0x0D, XREF_DSSETMIXBINVOLUMESC }, // (Offset,Value)-Pair #1
|
||||||
|
|
||||||
// CDirectSoundVoice_SetMixBinVolumes+0x01 : mov esi, [esp+8]
|
// CDirectSoundVoice_SetMixBinVolumes+0x01 : mov esi, [esp+8]
|
||||||
{ 0x01, 0x8B }, // (Offset,Value)-Pair #2
|
{ 0x01, 0x8B }, // (Offset,Value)-Pair #2
|
||||||
{ 0x02, 0x74 }, // (Offset,Value)-Pair #3
|
{ 0x02, 0x74 }, // (Offset,Value)-Pair #3
|
||||||
{ 0x03, 0x24 }, // (Offset,Value)-Pair #4
|
{ 0x03, 0x24 }, // (Offset,Value)-Pair #4
|
||||||
|
@ -357,14 +357,14 @@ SOOVPA<17> CDirectSoundBuffer_SetMixBinVolumes_1_0_4627 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
17, // Count == 17
|
17, // Count == 17
|
||||||
|
|
||||||
XREF_DSSETMIXBINVOLUMESA, // XRef Is Saved
|
XREF_DSSETMIXBINVOLUMESA, // XRef Is Saved
|
||||||
1, // XRef Not Used
|
1, // XRef Not Used
|
||||||
|
|
||||||
{
|
{
|
||||||
// CDirectSoundBuffer_SetMixBinVolumes+0x32 : call [CDirectSoundVoice::SetMixBinVolumes]
|
// CDirectSoundBuffer_SetMixBinVolumes+0x32 : call [CDirectSoundVoice::SetMixBinVolumes]
|
||||||
{ 0x32, XREF_DSSETMIXBINVOLUMESB }, // (Offset,Value)-Pair #1
|
{ 0x32, XREF_DSSETMIXBINVOLUMESB }, // (Offset,Value)-Pair #1
|
||||||
|
|
||||||
// CDirectSoundBuffer_SetMixBinVolumes+0x21 : mov eax, 0x80004005
|
// CDirectSoundBuffer_SetMixBinVolumes+0x21 : mov eax, 0x80004005
|
||||||
{ 0x21, 0xB8 }, // (Offset,Value)-Pair #2
|
{ 0x21, 0xB8 }, // (Offset,Value)-Pair #2
|
||||||
{ 0x22, 0x05 }, // (Offset,Value)-Pair #3
|
{ 0x22, 0x05 }, // (Offset,Value)-Pair #3
|
||||||
{ 0x23, 0x40 }, // (Offset,Value)-Pair #4
|
{ 0x23, 0x40 }, // (Offset,Value)-Pair #4
|
||||||
|
@ -537,16 +537,16 @@ SOOVPA<11> CDirectSoundVoice_SetFrequency_1_0_4627 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
11, // Count == 11
|
11, // Count == 11
|
||||||
|
|
||||||
XREF_DSBUFFERSETFREQUENCYB, // XRef Is Saved
|
XREF_DSBUFFERSETFREQUENCYB, // XRef Is Saved
|
||||||
0, // XRef Not Used
|
0, // XRef Not Used
|
||||||
|
|
||||||
{
|
{
|
||||||
// CDirectSoundVoice_SetFrequency+0x0D : mov eax, [esi+0x10]
|
// CDirectSoundVoice_SetFrequency+0x0D : mov eax, [esi+0x10]
|
||||||
{ 0x0D, 0x8B }, // (Offset,Value)-Pair #1
|
{ 0x0D, 0x8B }, // (Offset,Value)-Pair #1
|
||||||
{ 0x0E, 0x46 }, // (Offset,Value)-Pair #2
|
{ 0x0E, 0x46 }, // (Offset,Value)-Pair #2
|
||||||
{ 0x0F, 0x10 }, // (Offset,Value)-Pair #3
|
{ 0x0F, 0x10 }, // (Offset,Value)-Pair #3
|
||||||
|
|
||||||
// CDirectSoundVoice_SetFrequency+0x10 : mov eax, [eax+0x10]
|
// CDirectSoundVoice_SetFrequency+0x10 : mov eax, [eax+0x10]
|
||||||
{ 0x10, 0x8B }, // (Offset,Value)-Pair #4
|
{ 0x10, 0x8B }, // (Offset,Value)-Pair #4
|
||||||
{ 0x11, 0x40 }, // (Offset,Value)-Pair #5
|
{ 0x11, 0x40 }, // (Offset,Value)-Pair #5
|
||||||
{ 0x12, 0x10 }, // (Offset,Value)-Pair #6
|
{ 0x12, 0x10 }, // (Offset,Value)-Pair #6
|
||||||
|
@ -570,14 +570,14 @@ SOOVPA<17> CDirectSoundBuffer_SetFrequency_1_0_4627 =
|
||||||
0, // Large == 0
|
0, // Large == 0
|
||||||
17, // Count == 17
|
17, // Count == 17
|
||||||
|
|
||||||
XREF_DSBUFFERSETFREQUENCYA, // XRef Is Saved
|
XREF_DSBUFFERSETFREQUENCYA, // XRef Is Saved
|
||||||
1, // XRef Is Used
|
1, // XRef Is Used
|
||||||
|
|
||||||
{
|
{
|
||||||
// CDirectSoundBuffer_SetFrequency+0x32 : call [CDirectSoundVoice::SetFrequency]
|
// CDirectSoundBuffer_SetFrequency+0x32 : call [CDirectSoundVoice::SetFrequency]
|
||||||
{ 0x32, XREF_DSBUFFERSETFREQUENCYB }, // (Offset,Value)-Pair #1
|
{ 0x32, XREF_DSBUFFERSETFREQUENCYB }, // (Offset,Value)-Pair #1
|
||||||
|
|
||||||
// CDirectSoundBuffer_SetFrequency+0x21 : mov eax, 0x80004005
|
// CDirectSoundBuffer_SetFrequency+0x21 : mov eax, 0x80004005
|
||||||
{ 0x21, 0xB8 }, // (Offset,Value)-Pair #2
|
{ 0x21, 0xB8 }, // (Offset,Value)-Pair #2
|
||||||
{ 0x22, 0x05 }, // (Offset,Value)-Pair #3
|
{ 0x22, 0x05 }, // (Offset,Value)-Pair #3
|
||||||
{ 0x23, 0x40 }, // (Offset,Value)-Pair #4
|
{ 0x23, 0x40 }, // (Offset,Value)-Pair #4
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ SOOVPA<9> CDirectSoundBuffer_Play_1_0_5558 =
|
||||||
0, // Xref Is Used
|
0, // Xref Is Used
|
||||||
|
|
||||||
{
|
{
|
||||||
//{ 0x35, XREF_DSOUNDPLAY },
|
//{ 0x35, XREF_DSOUNDPLAY },
|
||||||
|
|
||||||
{ 0x0C, 0x00 },
|
{ 0x0C, 0x00 },
|
||||||
{ 0x14, 0x74 },
|
{ 0x14, 0x74 },
|
||||||
|
@ -2350,36 +2350,36 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"EmuIDirectSoundBuffer8_Release"
|
"EmuIDirectSoundBuffer8_Release"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// DirectSound::CFullHRTFSource::GetCenterVolume (XREF)
|
// DirectSound::CFullHRTFSource::GetCenterVolume (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&DirectSound_CFullHRTFSource_GetCenterVolume_1_0_5558,
|
(OOVPA*)&DirectSound_CFullHRTFSource_GetCenterVolume_1_0_5558,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"DirectSound::CFullHRTFSource::GetCenterVolume (XREF)"
|
"DirectSound::CFullHRTFSource::GetCenterVolume (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// DirectSound::CHRTFSource::SetFullHRTF5Channel (XREF)
|
// DirectSound::CHRTFSource::SetFullHRTF5Channel (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&DirectSound_CHRTFSource_SetFullHRTF5Channel_1_0_5558,
|
(OOVPA*)&DirectSound_CHRTFSource_SetFullHRTF5Channel_1_0_5558,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"DirectSound::CHRTFSource::SetFullHRTF5Channel (XREF)"
|
"DirectSound::CHRTFSource::SetFullHRTF5Channel (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// DirectSoundUseFullHRTF
|
// DirectSoundUseFullHRTF
|
||||||
{
|
{
|
||||||
(OOVPA*)&DirectSoundUseFullHRTF_1_0_5558,
|
(OOVPA*)&DirectSoundUseFullHRTF_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuDirectSoundUseFullHRTF,
|
XTL::EmuDirectSoundUseFullHRTF,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"DirectSoundUseFullHRTF"
|
"DirectSoundUseFullHRTF"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// DirectSoundDoWork
|
// DirectSoundDoWork
|
||||||
{
|
{
|
||||||
(OOVPA*)&DirectSoundDoWork_1_0_5558,
|
(OOVPA*)&DirectSoundDoWork_1_0_5558,
|
||||||
|
@ -2434,66 +2434,66 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"IDirectSoundBuffer8_SetCurrentPosition"
|
"IDirectSoundBuffer8_SetCurrentPosition"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// DirectSound::CMcpxVoiceClient::SetLFO (XREF)
|
// DirectSound::CMcpxVoiceClient::SetLFO (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CMcpxVoiceClient_SetLFO_1_0_5558,0,
|
(OOVPA*)&CMcpxVoiceClient_SetLFO_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CMcpxVoiceClient::SetLFO (XREF)"
|
"CMcpxVoiceClient::SetLFO (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::SetLFO (XREF)
|
// CDirectSoundVoice::SetLFO (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_SetLFO_1_0_5558,0,
|
(OOVPA*)&CDirectSoundVoice_SetLFO_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundVoice::SetLFO (XREF)"
|
"CDirectSoundVoice::SetLFO (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundBuffer::SetLFO (XREF)
|
// CDirectSoundBuffer::SetLFO (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundBuffer_SetLFO_1_0_5558,0,
|
(OOVPA*)&CDirectSoundBuffer_SetLFO_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundBuffer::SetLFO (XREF)"
|
"CDirectSoundBuffer::SetLFO (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundBuffer8::SetLFO
|
// IDirectSoundBuffer8::SetLFO
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirectSoundBuffer8_SetLFO_1_0_5558,
|
(OOVPA*)&IDirectSoundBuffer8_SetLFO_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirectSoundBuffer8_SetLFO,
|
XTL::EmuIDirectSoundBuffer8_SetLFO,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"IDirectSoundBuffer8_SetLFO"
|
"IDirectSoundBuffer8_SetLFO"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::SetVolume (XREF)
|
// CDirectSoundVoice::SetVolume (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_SetVolume_1_0_5558,0,
|
(OOVPA*)&CDirectSoundVoice_SetVolume_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundVoice::SetVolume (XREF)"
|
"CDirectSoundVoice::SetVolume (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundBuffer::SetVolume (XREF)
|
// CDirectSoundBuffer::SetVolume (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundBuffer_SetVolume_1_0_5558,0,
|
(OOVPA*)&CDirectSoundBuffer_SetVolume_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundBuffer::SetVolume (XREF)"
|
"CDirectSoundBuffer::SetVolume (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundBuffer8::SetVolume
|
// IDirectSoundBuffer8::SetVolume
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirectSoundBuffer8_SetVolume_1_0_5558,
|
(OOVPA*)&IDirectSoundBuffer8_SetVolume_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirectSoundBuffer8_SetVolume,
|
XTL::EmuIDirectSoundBuffer8_SetVolume,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIIDirectSoundBuffer8_SetVolume"
|
"EmuIIDirectSoundBuffer8_SetVolume"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundStream_SetVolume (* unchanged since 4627 *)
|
// CDirectSoundStream_SetVolume (* unchanged since 4627 *)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundStream_SetVolume_1_0_4627,
|
(OOVPA*)&CDirectSoundStream_SetVolume_1_0_4627,
|
||||||
|
@ -2556,14 +2556,14 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"EmuIDirectSoundBuffer8_SetPlayRegion"
|
"EmuIDirectSoundBuffer8_SetPlayRegion"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundBuffer::SetLoopRegion (XREF)
|
// CDirectSoundBuffer::SetLoopRegion (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundBuffer_SetLoopRegion_1_0_5558,0,
|
(OOVPA*)&CDirectSoundBuffer_SetLoopRegion_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundBuffer::SetLoopRegion (XREF)"
|
"CDirectSoundBuffer::SetLoopRegion (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundBuffer8::SetLoopRegion
|
// IDirectSoundBuffer8::SetLoopRegion
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirectSoundBuffer8_SetLoopRegion_1_0_5558,
|
(OOVPA*)&IDirectSoundBuffer8_SetLoopRegion_1_0_5558,
|
||||||
|
@ -2582,24 +2582,24 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"CMcpxBuffer_Play (XREF)"
|
"CMcpxBuffer_Play (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundBuffer::Play (XREF)
|
// CDirectSoundBuffer::Play (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundBuffer_Play_1_0_5558,0,
|
(OOVPA*)&CDirectSoundBuffer_Play_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundBuffer::Play (XREF)"
|
"CDirectSoundBuffer::Play (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundBuffer_Play
|
// IDirectSoundBuffer_Play
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirectSoundBuffer8_Play_1_0_5558,
|
(OOVPA*)&IDirectSoundBuffer8_Play_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirectSoundBuffer8_Play,
|
XTL::EmuIDirectSoundBuffer8_Play,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirectSoundBuffer8_Play"
|
"EmuIDirectSoundBuffer8_Play"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CMcpxBuffer::GetStatus
|
// CMcpxBuffer::GetStatus
|
||||||
{
|
{
|
||||||
(OOVPA*)&CMcpxBuffer_GetStatus_1_0_5558, 0,
|
(OOVPA*)&CMcpxBuffer_GetStatus_1_0_5558, 0,
|
||||||
|
@ -2626,24 +2626,24 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"IDirectSoundBuffer8_GetStatus"
|
"IDirectSoundBuffer8_GetStatus"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// WaveFormat::CreateXboxAdpcmFormat (XREF)
|
// WaveFormat::CreateXboxAdpcmFormat (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&WaveFormat_CreateXboxAdpcmFormat_1_0_5558,0,
|
(OOVPA*)&WaveFormat_CreateXboxAdpcmFormat_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"WaveFormat::CreateXboxAdpcmFormat (XREF)"
|
"WaveFormat::CreateXboxAdpcmFormat (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// XAudioCreateAdpcmFormat
|
// XAudioCreateAdpcmFormat
|
||||||
{
|
{
|
||||||
(OOVPA*)&XAudioCreateAdpcmFormat_1_0_5558,
|
(OOVPA*)&XAudioCreateAdpcmFormat_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuXAudioCreateAdpcmFormat,
|
XTL::EmuXAudioCreateAdpcmFormat,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"XAudioCreateAdpcmFormat"
|
"XAudioCreateAdpcmFormat"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::SetFormat (XREF)
|
// CDirectSoundVoice::SetFormat (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_SetFormat_1_0_5558, 0,
|
(OOVPA*)&CDirectSoundVoice_SetFormat_1_0_5558, 0,
|
||||||
|
@ -2696,67 +2696,67 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"IDirectSoundBuffer8_SetConeAngles"
|
"IDirectSoundBuffer8_SetConeAngles"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::SetRolloffCurve (XREF)
|
// CDirectSoundVoice::SetRolloffCurve (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_SetRolloffCurve_1_0_5558,0,
|
(OOVPA*)&CDirectSoundVoice_SetRolloffCurve_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundVoice::SetRolloffCurve (XREF)"
|
"CDirectSoundVoice::SetRolloffCurve (XREF)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
},
|
},
|
||||||
// CDirectSoundBuffer::SetRolloffCurve (XREF)
|
// CDirectSoundBuffer::SetRolloffCurve (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundBuffer_SetRolloffCurve_1_0_5558,0,
|
(OOVPA*)&CDirectSoundBuffer_SetRolloffCurve_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundBuffer::SetRolloffCurve (XREF)"
|
"CDirectSoundBuffer::SetRolloffCurve (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundBuffer8::SetRolloffCurve
|
// IDirectSoundBuffer8::SetRolloffCurve
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirectSoundBuffer8_SetRolloffCurve_1_0_5558,
|
(OOVPA*)&IDirectSoundBuffer8_SetRolloffCurve_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirectSoundBuffer8_SetRolloffCurve,
|
XTL::EmuIDirectSoundBuffer8_SetRolloffCurve,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirectSoundBuffer8_SetRolloffCurve"
|
"EmuIDirectSoundBuffer8_SetRolloffCurve"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::CommitDeferredSettings (XREF)
|
// CDirectSoundVoice::CommitDeferredSettings (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_CommitDeferredSettings_1_0_5558,0,
|
(OOVPA*)&CDirectSoundVoice_CommitDeferredSettings_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundVoice::CommitDeferredSettings (XREF)"
|
"CDirectSoundVoice::CommitDeferredSettings (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::SetAllParameters (XREF)
|
// CDirectSoundVoice::SetAllParameters (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_SetAllParameters_1_0_5558,0,
|
(OOVPA*)&CDirectSoundVoice_SetAllParameters_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundVoice::SetAllParameters (XREF)"
|
"CDirectSoundVoice::SetAllParameters (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundBuffer::SetAllParameters (XREF)
|
// CDirectSoundBuffer::SetAllParameters (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundBuffer_SetAllParameters_1_0_5558,0,
|
(OOVPA*)&CDirectSoundBuffer_SetAllParameters_1_0_5558,0,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"CDirectSoundBuffer::SetAllParameters (XREF)"
|
"CDirectSoundBuffer::SetAllParameters (XREF)"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundBuffer8::SetAllParameters
|
// IDirectSoundBuffer8::SetAllParameters
|
||||||
{
|
{
|
||||||
(OOVPA*)&IDirectSoundBuffer8_SetAllParameters_1_0_5558,
|
(OOVPA*)&IDirectSoundBuffer8_SetAllParameters_1_0_5558,
|
||||||
|
|
||||||
XTL::EmuIDirectSound8_SetAllParameters, // Use that for now, EmuIDirectSoundBuffer8_SetAllParameters,
|
XTL::EmuIDirectSound8_SetAllParameters, // Use that for now, EmuIDirectSoundBuffer8_SetAllParameters,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"EmuIDirectSoundBuffer8_SetAllParameters"
|
"EmuIDirectSoundBuffer8_SetAllParameters"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// CDirectSoundVoice::SetPosition (XREF)
|
// CDirectSoundVoice::SetPosition (XREF)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundVoice_SetPosition_1_0_5558, 0,
|
(OOVPA*)&CDirectSoundVoice_SetPosition_1_0_5558, 0,
|
||||||
|
@ -2832,15 +2832,15 @@ OOVPATable DSound_1_0_5558[] =
|
||||||
"IDirectSoundBuffer8_SetDistanceFactor"
|
"IDirectSoundBuffer8_SetDistanceFactor"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// IDirectSoundStream_SetVolume (This is realy the Xref we are using)
|
// IDirectSoundStream_SetVolume (This is realy the Xref we are using)
|
||||||
{
|
{
|
||||||
(OOVPA*)&CDirectSoundStream_SetVolume_1_0_5558,
|
(OOVPA*)&CDirectSoundStream_SetVolume_1_0_5558,
|
||||||
XTL::EmuIDirectSoundStream_SetVolume,
|
XTL::EmuIDirectSoundStream_SetVolume,
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
"IDirectSoundStream_SetVolume"
|
"IDirectSoundStream_SetVolume"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// DirectSoundCreateBuffer
|
// DirectSoundCreateBuffer
|
||||||
{
|
{
|
||||||
(OOVPA*)&DirectSoundCreateBuffer_1_0_4627,
|
(OOVPA*)&DirectSoundCreateBuffer_1_0_4627,
|
||||||
|
|
|
@ -135,7 +135,7 @@ OOVPATable XG_1_0_5558[] =
|
||||||
"EmuXGSwizzleRect"
|
"EmuXGSwizzleRect"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// XGUnswizzleRect
|
// XGUnswizzleRect
|
||||||
{
|
{
|
||||||
(OOVPA*)&XGUnswizzleRect_1_0_5558,
|
(OOVPA*)&XGUnswizzleRect_1_0_5558,
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ OOVPATable XAPI_1_0_5849[] =
|
||||||
"EmuXInputGetState"
|
"EmuXInputGetState"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
// XGetDeviceChanges
|
// XGetDeviceChanges
|
||||||
{
|
{
|
||||||
(OOVPA*)&XGetDeviceChanges_1_0_5849,
|
(OOVPA*)&XGetDeviceChanges_1_0_5849,
|
||||||
|
|
||||||
|
|
|
@ -191,29 +191,29 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead
|
||||||
uint16 OrigBuildVersion = BuildVersion;
|
uint16 OrigBuildVersion = BuildVersion;
|
||||||
|
|
||||||
// Aliases - for testing purposes only
|
// Aliases - for testing purposes only
|
||||||
if(BuildVersion == 4721) { BuildVersion = 4627; }
|
if(BuildVersion == 4721) { BuildVersion = 4627; }
|
||||||
if(BuildVersion == 4928) { BuildVersion = 4627; }
|
if(BuildVersion == 4928) { BuildVersion = 4627; }
|
||||||
if(BuildVersion == 5344) { BuildVersion = 5558; }
|
if(BuildVersion == 5344) { BuildVersion = 5558; }
|
||||||
if(BuildVersion == 5455) { BuildVersion = 5558; }
|
if(BuildVersion == 5455) { BuildVersion = 5558; }
|
||||||
if(BuildVersion == 5659) { BuildVersion = 5558; }
|
if(BuildVersion == 5659) { BuildVersion = 5558; }
|
||||||
if(BuildVersion == 5788) { BuildVersion = 5558; }
|
if(BuildVersion == 5788) { BuildVersion = 5558; }
|
||||||
if(BuildVersion == 5028) { BuildVersion = 4627; }
|
if(BuildVersion == 5028) { BuildVersion = 4627; }
|
||||||
if(BuildVersion == 5933) { BuildVersion = 5849; } // These XDK versions are pretty mutch the same
|
if(BuildVersion == 5933) { BuildVersion = 5849; } // These XDK versions are pretty mutch the same
|
||||||
/*
|
/*
|
||||||
if(BuildVersion == 3944) { BuildVersion = 3925; }
|
if(BuildVersion == 3944) { BuildVersion = 3925; }
|
||||||
if(BuildVersion == 4039) { BuildVersion = 4034; }
|
if(BuildVersion == 4039) { BuildVersion = 4034; }
|
||||||
if(BuildVersion == 4242) { BuildVersion = 4432; }
|
if(BuildVersion == 4242) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 4531) { BuildVersion = 4432; }
|
if(BuildVersion == 4531) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 4721) { BuildVersion = 4432; }
|
if(BuildVersion == 4721) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 4831) { BuildVersion = 4432; }
|
if(BuildVersion == 4831) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 4928) { BuildVersion = 4432; }
|
if(BuildVersion == 4928) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 5028) { BuildVersion = 4432; }
|
if(BuildVersion == 5028) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 5120) { BuildVersion = 4432; }
|
if(BuildVersion == 5120) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 5233) { BuildVersion = 4432; }
|
if(BuildVersion == 5233) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 5344) { BuildVersion = 4432; }
|
if(BuildVersion == 5344) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 5455) { BuildVersion = 4432; }
|
if(BuildVersion == 5455) { BuildVersion = 4432; }
|
||||||
if(BuildVersion == 5933) { BuildVersion = 4432; }
|
if(BuildVersion == 5933) { BuildVersion = 4432; }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char szLibraryName[9] = {0};
|
char szLibraryName[9] = {0};
|
||||||
|
|
||||||
|
@ -277,13 +277,13 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead
|
||||||
{
|
{
|
||||||
if(OrigBuildVersion == 4928)
|
if(OrigBuildVersion == 4928)
|
||||||
{
|
{
|
||||||
pFunc = EmuLocateFunction((OOVPA*)&XapiInitProcess_1_0_4928, lower, upper);
|
pFunc = EmuLocateFunction((OOVPA*)&XapiInitProcess_1_0_4928, lower, upper);
|
||||||
ProcessHeapOffs = 0x44;
|
ProcessHeapOffs = 0x44;
|
||||||
RtlCreateHeapOffs = 0x3B;
|
RtlCreateHeapOffs = 0x3B;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pFunc = EmuLocateFunction((OOVPA*)&XapiInitProcess_1_0_4361, lower, upper);
|
pFunc = EmuLocateFunction((OOVPA*)&XapiInitProcess_1_0_4361, lower, upper);
|
||||||
ProcessHeapOffs = 0x3E;
|
ProcessHeapOffs = 0x3E;
|
||||||
RtlCreateHeapOffs = 0x37;
|
RtlCreateHeapOffs = 0x37;
|
||||||
}
|
}
|
||||||
|
@ -683,7 +683,7 @@ static void EmuInstallWrappers(OOVPATable *OovpaTable, uint32 OovpaTableSize, Xb
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EmuInstallWrapper(pFunc, OovpaTable[a].lpRedirect);
|
EmuInstallWrapper(pFunc, OovpaTable[a].lpRedirect);
|
||||||
funcExclude[fcount++] = (uint32)pFunc;
|
funcExclude[fcount++] = (uint32)pFunc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue