From 933a7be90635d4ec49dbf0a557140eb361f01a6d Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Sun, 21 Aug 2016 00:53:25 +0100 Subject: [PATCH] Include many of the changes from Blueshogun's Cxbx branch --- import/OpenXDK/include/xboxkrnl/hal.h | 10 +- import/OpenXDK/include/xboxkrnl/kernel.h | 26 +- import/OpenXDK/include/xboxkrnl/xbox.h | 6 +- import/OpenXDK/include/xboxkrnl/xboxkrnl.h | 30 +++ src/CxbxKrnl/EmuD3D8.cpp | 75 +++++- src/CxbxKrnl/EmuD3D8.h | 10 + src/CxbxKrnl/EmuD3D8/Convert.cpp | 4 + src/CxbxKrnl/EmuKrnl.cpp | 95 +++++++ src/CxbxKrnl/HLEDataBase.cpp | 9 + src/CxbxKrnl/HLEDataBase.h | 2 + src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl | 60 +++++ src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl | 25 +- src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl | 218 ++++++++++++++-- src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl | 244 +++++++++++++++++- src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl | 38 ++- src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl | 31 +++ src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.h | 42 +++ src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl | 241 +++++++++++++++++ src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl | 2 +- src/CxbxKrnl/KernelThunk.cpp | 28 +- 20 files changed, 1130 insertions(+), 66 deletions(-) create mode 100644 src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.h create mode 100644 src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl diff --git a/import/OpenXDK/include/xboxkrnl/hal.h b/import/OpenXDK/include/xboxkrnl/hal.h index 09fe1aaf2..e2324b1a9 100644 --- a/import/OpenXDK/include/xboxkrnl/hal.h +++ b/import/OpenXDK/include/xboxkrnl/hal.h @@ -27,7 +27,15 @@ XBSYSAPI VOID *HalDiskCachePartitionCount; XBSYSAPI VOID *HalDiskModelNumber; XBSYSAPI VOID *HalDiskSerialNumber; XBSYSAPI VOID *HalEnableSystemInterrupt; -XBSYSAPI VOID *HalGetInterruptVector; + +// ****************************************************************** +// * HalGetInterruptVector +// ****************************************************************** +XBSYSAPI EXPORTNUM(44) ULONG NTAPI HalGetInterruptVector +( + IN ULONG InterruptLevel, + OUT CHAR* Irql +); // ****************************************************************** // * HalReadSMBusValue diff --git a/import/OpenXDK/include/xboxkrnl/kernel.h b/import/OpenXDK/include/xboxkrnl/kernel.h index 0b7e23c04..8628433ff 100644 --- a/import/OpenXDK/include/xboxkrnl/kernel.h +++ b/import/OpenXDK/include/xboxkrnl/kernel.h @@ -26,7 +26,14 @@ XBSYSAPI EXPORTNUM(95) VOID NTAPI KeBugCheck XBSYSAPI VOID *KeBugCheckEx; XBSYSAPI VOID *KeCancelTimer; -XBSYSAPI VOID *KeConnectInterrupt; + +// ****************************************************************** +// * KeConnectInterrupt +// ****************************************************************** +XBSYSAPI EXPORTNUM(98) LONG NTAPI KeConnectInterrupt +( + IN PKINTERRUPT InterruptObject +); // ****************************************************************** // * KeDelayExecutionThread @@ -61,7 +68,22 @@ XBSYSAPI EXPORTNUM(107) VOID NTAPI KeInitializeDpc ); XBSYSAPI VOID *KeInitializeEvent; -XBSYSAPI VOID *KeInitializeInterrupt; + +// ****************************************************************** +// * KeInitializeInterrupt +// ****************************************************************** +XBSYSAPI EXPORTNUM(109) VOID NTAPI KeInitializeInterrupt +( + OUT PKINTERRUPT Interrupt, + IN PKSERVICE_ROUTINE ServiceRoutine, + IN PVOID ServiceContext, + IN ULONG Vector, + IN KIRQL Irql, + IN KINTERRUPT_MODE InterruptMode, + IN BOOLEAN ShareVector +); + + XBSYSAPI VOID *KeInitializeMutant; XBSYSAPI VOID *KeInitializeQueue; XBSYSAPI VOID *KeInitializeSemaphore; diff --git a/import/OpenXDK/include/xboxkrnl/xbox.h b/import/OpenXDK/include/xboxkrnl/xbox.h index 6e3638452..f06afd784 100644 --- a/import/OpenXDK/include/xboxkrnl/xbox.h +++ b/import/OpenXDK/include/xboxkrnl/xbox.h @@ -49,7 +49,11 @@ XBSYSAPI EXPORTNUM(4) VOID NTAPI AvSetSavedDataAddress IN PVOID Address ); -XBSYSAPI VOID *FscGetCacheSize; +// ****************************************************************** +// * FscGetCacheSize +// ****************************************************************** +XBSYSAPI EXPORTNUM(35) DWORD NTAPI FscGetCacheSize(); + XBSYSAPI VOID *FscInvalidateIdleBlocks; // ****************************************************************** diff --git a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h index 7b00c8287..b261a16b7 100644 --- a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h +++ b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h @@ -723,6 +723,36 @@ typedef enum _KOBJECTS } KOBJECTS, *PKOBJECTS; +// ****************************************************************** +// * KINTERRUPR +// ****************************************************************** +typedef struct _KINTERRUPT +{ + unsigned char UnknownA[0x0C]; + unsigned char KIRQL; + unsigned char PaddingA[0x03]; + unsigned char UnknownB[0x08]; + unsigned char ISR[0x58]; +} +KINTERRUPT, *PKINTERRUPT; + +// ****************************************************************** +// * PKSERVICE_ROUTINE +// ****************************************************************** +typedef void* PKSERVICE_ROUTINE; + +typedef CHAR KIRQL; + +// ****************************************************************** +// * KINTERRUPT_MODE +// ****************************************************************** +typedef enum _KINTERRUPT_MODE +{ + LevelSensitive, + Latched, +} +KINTERRUPT_MODE; + // ****************************************************************** // * RTL_CRITICAL_SECTION // ****************************************************************** diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/CxbxKrnl/EmuD3D8.cpp index 6192f9b30..e303edfce 100644 --- a/src/CxbxKrnl/EmuD3D8.cpp +++ b/src/CxbxKrnl/EmuD3D8.cpp @@ -4743,7 +4743,8 @@ HRESULT WINAPI XTL::EmuIDirect3DResource8_Register dwBPP = 4; } else if(X_Format == 0x11 /* D3DFMT_LIN_R5G6B5 */ || X_Format == 0x30 /* D3DFMT_LIN_D16 */ - || X_Format == 0x1D /* X_D3DFMT_LIN_A4R4G4B4 */ || X_Format == 0x10 /* X_D3DFMT_LIN_A1R5G5B5 */) + || X_Format == 0x1D /* X_D3DFMT_LIN_A4R4G4B4 */ || X_Format == 0x10 /* X_D3DFMT_LIN_A1R5G5B5 */ + || X_Format == 0x1C /* X_D3DFMT_LIN_X1R5G5B5 */ ) { // Linear 16 Bit dwWidth = (pPixelContainer->Size & X_D3DSIZE_WIDTH_MASK) + 1; @@ -5801,11 +5802,17 @@ DWORD WINAPI XTL::EmuIDirect3DBaseTexture8_GetLevelCount ");\n", GetCurrentThreadId(), pThis); - EmuVerifyResourceIsRegistered(pThis); + DWORD dwRet = 0; - IDirect3DBaseTexture8 *pBaseTexture8 = pThis->EmuBaseTexture8; + if( pThis ) + { + EmuVerifyResourceIsRegistered(pThis); - DWORD dwRet = pBaseTexture8->GetLevelCount(); + IDirect3DBaseTexture8 *pBaseTexture8 = pThis->EmuBaseTexture8; + + if( pBaseTexture8 ) + dwRet = pBaseTexture8->GetLevelCount(); + } EmuSwapFS(); // XBox FS @@ -5946,8 +5953,8 @@ HRESULT WINAPI XTL::EmuIDirect3DTexture8_GetSurfaceLevel EmuVerifyResourceIsRegistered(pThis); -// if(pThis) -// { + if(pThis) + { // if highest bit is set, this is actually a raw memory pointer (for YUY2 simulation) if(IsSpecialResource(pThis->Data) && (pThis->Data & X_D3DRESOURCE_DATA_FLAG_YUVSURF)) { @@ -5984,7 +5991,7 @@ HRESULT WINAPI XTL::EmuIDirect3DTexture8_GetSurfaceLevel DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DTexture8_GetSurfaceLevel := 0x%.08X\n", GetCurrentThreadId(), (*ppSurfaceLevel)->EmuSurface8); } } -// } + } EmuSwapFS(); // XBox FS @@ -7639,11 +7646,22 @@ BYTE* WINAPI XTL::EmuIDirect3DVertexBuffer8_Lock2 ");\n", GetCurrentThreadId(), ppVertexBuffer, Flags); - IDirect3DVertexBuffer8 *pVertexBuffer8 = ppVertexBuffer->EmuVertexBuffer8; + IDirect3DVertexBuffer8 *pVertexBuffer8 = 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 = S_OK; + + if( ppVertexBuffer->EmuVertexBuffer8 ) + { + pVertexBuffer8 = ppVertexBuffer->EmuVertexBuffer8; + hRet = pVertexBuffer8->Lock(0, 0, &pbData, EmuXB2PC_D3DLock(Flags)); // Fixed flags check, Battlestar Galactica now displays graphics correctly + + if( FAILED( hRet ) ) + EmuWarning( "Lock vertex buffer failed!" ); + } + else + EmuWarning( "ppVertexBuffer->EmuVertexBuffer8 == NULL!" ); EmuSwapFS(); // XBox FS @@ -10589,5 +10607,44 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_GetBackMaterial(D3DMATERIAL8* pMaterial) EmuSwapFS(); // Xbox FS + return S_OK; +} + +// ****************************************************************** +// * func: EmuD3D::LazySetPointParams +// ****************************************************************** +void WINAPI XTL::EmuD3D_LazySetPointParams( void* Device ) +{ + EmuSwapFS(); // Win2k/XP FS + + DbgPrintf("EmuD3D8 (0x%X): EmuD3D_LazySetPointParams\n" + "(\n" + " Device : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), Device); + + // Don't emulate this! Just look at the stack trace and go from there! + __asm int 3; + + EmuSwapFS(); // XBox FS +} + +// ****************************************************************** +// * func: EmuIDirect3DDevice8_GetMaterial +// ****************************************************************** +HRESULT WINAPI XTL::EmuIDirect3DDevice8_GetMaterial(D3DMATERIAL8* pMaterial) +{ + EmuSwapFS(); // Win2k/XP FS + + DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_GetMaterial\n" + "(\n" + " pMaterial : 0x%.08X\n" + ");\n", GetCurrentThreadId(), pMaterial); + + if( pMaterial ) + g_pD3DDevice8->GetMaterial( pMaterial ); + + EmuSwapFS(); // Xbox FS + return S_OK; } \ No newline at end of file diff --git a/src/CxbxKrnl/EmuD3D8.h b/src/CxbxKrnl/EmuD3D8.h index 98ea84f2c..795393081 100644 --- a/src/CxbxKrnl/EmuD3D8.h +++ b/src/CxbxKrnl/EmuD3D8.h @@ -1961,4 +1961,14 @@ HRESULT WINAPI EmuIDirect3DDevice8_GetScissors // ****************************************************************** HRESULT WINAPI EmuIDirect3DDevice8_GetBackMaterial(D3DMATERIAL8* pMaterial); +// ****************************************************************** +// * func: EmuD3D::LazySetPointParams +// ****************************************************************** +void WINAPI EmuD3D_LazySetPointParams( void* Device ); + +// ****************************************************************** +// * func: EmuIDirect3DDevice8_GetMaterial +// ****************************************************************** +HRESULT WINAPI EmuIDirect3DDevice8_GetMaterial(D3DMATERIAL8* pMaterial); + #endif diff --git a/src/CxbxKrnl/EmuD3D8/Convert.cpp b/src/CxbxKrnl/EmuD3D8/Convert.cpp index 8e69412db..d056a99cb 100644 --- a/src/CxbxKrnl/EmuD3D8/Convert.cpp +++ b/src/CxbxKrnl/EmuD3D8/Convert.cpp @@ -73,11 +73,13 @@ BOOL XTL::EmuXBFormatIsLinear(X_D3DFORMAT Format) case 0x12: // X_D3DFMT_LIN_A8R8G8B8 case 0x16: // X_D3DFMT_LIN_R8B8 case 0x17: // X_D3DFMT_LIN_G8B8 + case 0x1C: // X_D3DFMT_LIN_X1R5G5B5 case 0x1D: // X_D3DFMT_LIN_A4R4G4B4 case 0x1E: // X_D3DFMT_LIN_X8R8G8B8 case 0x2E: // X_D3DFMT_LIN_D24S8 case 0x30: // X_D3DFMT_LIN_D16 case 0x3F: // X_D3DFMT_LIN_A8B8G8R8 + case 0x41: // X_D3DFMT_LIN_R8G8B8A8 return TRUE; } @@ -107,6 +109,7 @@ XTL::D3DFORMAT XTL::EmuXB2PC_D3DFormat(X_D3DFORMAT Format) } case 0x03: // Swizzled (X_D3DFMT_X1R5G5B5) + case 0x1C: // Linear (X_D3DFMT_LIN_X1R5G5B5) return D3DFMT_X1R5G5B5; case 0x1A: // Swizzled (X_D3DFMT_A8L8) @@ -136,6 +139,7 @@ XTL::D3DFORMAT XTL::EmuXB2PC_D3DFormat(X_D3DFORMAT Format) case 0x06: // Swizzled (X_D3DFMT_A8R8G8B8) return D3DFMT_A8R8G8B8; + case 0x41: // Linear (X_D3DFMT_LIN_R8G8B8A8) case 0x3C: // Swizzled (X_D3DFMT_R8G8B8A8) { EmuWarning("X_D3DFMT_R8G8B8A8 -> D3DFMT_A8R8G8B8"); diff --git a/src/CxbxKrnl/EmuKrnl.cpp b/src/CxbxKrnl/EmuKrnl.cpp index 0374a3ff8..4963a253a 100644 --- a/src/CxbxKrnl/EmuKrnl.cpp +++ b/src/CxbxKrnl/EmuKrnl.cpp @@ -1701,6 +1701,22 @@ XBSYSAPI EXPORTNUM(29) xboxkrnl::NTSTATUS NTAPI xboxkrnl::ExSaveNonVolatileSetti return STATUS_SUCCESS; } +// ****************************************************************** +// * 0x0023 - FscGetCacheSize +// ****************************************************************** +XBSYSAPI EXPORTNUM(35) xboxkrnl::DWORD NTAPI xboxkrnl::FscGetCacheSize() +{ + EmuSwapFS(); // Win2k/XP FS + + DbgPrintf("EmuKrnl (0x%X): FscGetCacheSize()", GetCurrentThreadId()); + + EmuWarning("FscGetCacheSize returning default 64kb"); + + EmuSwapFS(); // Xbox FS + + return 64*1024; +} + // ****************************************************************** // * 0x0025 - FscSetCacheSize // ****************************************************************** @@ -1721,6 +1737,33 @@ XBSYSAPI EXPORTNUM(37) xboxkrnl::LONG NTAPI xboxkrnl::FscSetCacheSize(ULONG uCac return 0; } +// ****************************************************************** +// * HalGetInterruptVector +// ****************************************************************** +XBSYSAPI EXPORTNUM(44) xboxkrnl::ULONG NTAPI xboxkrnl::HalGetInterruptVector +( + IN ULONG InterruptLevel, + OUT CHAR* Irql +) +{ + EmuSwapFS(); // Win2k/XP FS + + DbgPrintf("EmuKrnl (0x%X): HalGetInterruptVector\n" + "(\n" + " InterruptLevel : 0x%.08X\n" + " Irql : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), InterruptLevel, Irql); + + // I'm only adding this for Virtua Cop 3 (Chihiro). Xbox games need not emulate this. + + EmuWarning( "HalGetInterruptVector(): If this is NOT a Chihiro game, tell blueshogun!" ); + + EmuSwapFS(); // Xbox FS + + return 1; +} + // ****************************************************************** // * 0x002D - HalReadSMBusValue // ****************************************************************** @@ -1977,6 +2020,27 @@ XBSYSAPI EXPORTNUM(95) VOID NTAPI xboxkrnl::KeBugCheck EmuSwapFS(); // Xbox FS } +// ****************************************************************** +// * KeConnectInterrupt +// ****************************************************************** +XBSYSAPI EXPORTNUM(98) xboxkrnl::LONG NTAPI xboxkrnl::KeConnectInterrupt +( + IN PKINTERRUPT InterruptObject +) +{ + EmuSwapFS(); // Win2k/XP FS + + DbgPrintf("EmuKrnl (0x%X): KeConnectInterrupt\n" + "(\n" + " InterruptObject : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), InterruptObject); + + EmuSwapFS(); // Xbox FS + + return 0; +} + // ****************************************************************** // * 0x0063 - KeDelayExecutionThread // ****************************************************************** @@ -2035,6 +2099,37 @@ XBSYSAPI EXPORTNUM(107) VOID NTAPI xboxkrnl::KeInitializeDpc return; } +// ****************************************************************** +// * 0x006D - KeInitializeInterrupt +// ****************************************************************** +XBSYSAPI EXPORTNUM(109) VOID NTAPI xboxkrnl::KeInitializeInterrupt +( + OUT PKINTERRUPT Interrupt, + IN PKSERVICE_ROUTINE ServiceRoutine, + IN PVOID ServiceContext, + IN ULONG Vector, + IN KIRQL Irql, + IN KINTERRUPT_MODE InterruptMode, + IN BOOLEAN ShareVector +) +{ + EmuSwapFS(); // Win2k/XP FS + + DbgPrintf("EmuKrnl (0x%X): KeInitializeInterrupt\n" + "(\n" + " Interrupt : 0x%.08X\n" + " ServiceRoutine : 0x%.08X\n" + " ServiceContext : 0x%.08X\n" + " Vector : 0x%.08X\n" + " Irql : 0x%.08X\n" + " InterruptMode : 0x%.08X\n" + " ShareVector : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), Interrupt, ServiceRoutine, ServiceContext, Vector, Irql, InterruptMode, ShareVector); + + EmuSwapFS(); // Xbox FS +} + // ****************************************************************** // * 0x0071 - KeInitializeTimerEx // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase.cpp b/src/CxbxKrnl/HLEDataBase.cpp index 51f2954b8..2eb7716c7 100644 --- a/src/CxbxKrnl/HLEDataBase.cpp +++ b/src/CxbxKrnl/HLEDataBase.cpp @@ -82,6 +82,7 @@ extern "C" const char *szHLELastCompileTime = __TIMESTAMP__; #include "HLEDataBase/XOnline.1.0.4361.inl" #include "HLEDataBase/XOnline.1.0.4627.inl" #include "HLEDataBase/XOnline.1.0.5233.inl" +#include "HLEDataBase/XOnline.1.0.5558.inl" #include "HLEDataBase/XOnline.1.0.5849.inl" #include "HLEDataBase/XactEng.1.0.4627.inl" @@ -363,6 +364,13 @@ HLEData HLEDataBase[] = 1, 0, 5233, XOnline_1_0_5233, XOnline_1_0_5233_SIZE + }, + // XOnline(s) Version 1.0.5558 + { + "XONLINES", + 1, 0, 5558, + XOnline_1_0_5558, + XOnline_1_0_5558_SIZE }, // XOnline(s) Version 1.0.5849 { @@ -402,6 +410,7 @@ extern uint32 XRefDataBase[] = -1, // XREF_D3D_BLOCKONTIME -1, // XREF_D3D_SETFENCE -1, // XREF_D3D_MakeRequestedSpace + -1, // XREF_D3D_KickOff -1, // XREF_XNINIT -1, // XREF_FCLOSEDEVICE -1, // XREF_CLEARSTATEBLOCKFLAGS diff --git a/src/CxbxKrnl/HLEDataBase.h b/src/CxbxKrnl/HLEDataBase.h index 363c75c8e..45724497f 100644 --- a/src/CxbxKrnl/HLEDataBase.h +++ b/src/CxbxKrnl/HLEDataBase.h @@ -73,6 +73,7 @@ #include "HLEDataBase/XOnline.1.0.4361.h" #include "HLEDataBase/XOnline.1.0.4627.h" #include "HLEDataBase/XOnline.1.0.5233.h" +#include "HLEDataBase/XOnline.1.0.5558.h" #include "HLEDataBase/XOnline.1.0.5849.h" #include "HLEDataBase/XactEng.1.0.4627.h" @@ -135,6 +136,7 @@ enum XRefDataBaseOffset XREF_D3D_SETFENCE, XREF_D3D_KickOffAndWaitForIdle, XREF_D3D_MakeRequestedSpace, + XREF_D3D_KickOff, XREF_XNINIT, XREF_FCLOSEDEVICE, XREF_CLEARSTATEBLOCKFLAGS, diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl index 35deea8b5..ffb9d93b9 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl @@ -4469,6 +4469,48 @@ SOOVPA<9> D3D_BlockOnResource_1_0_3925 = } }; +// ****************************************************************** +// * D3DDevice_BeginStateBlock +// ****************************************************************** +SOOVPA<6> D3DDevice_BeginStateBlock_1_0_3925 = +{ + 0, // Large == 0 + 6, // Count == 6 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x00, 0xA1 }, + { 0x05, 0x83 }, + { 0x06, 0x48 }, + { 0x07, 0x0C }, + { 0x08, 0x20 }, + { 0x09, 0xE9 }, + } +}; + +// ****************************************************************** +// * D3DDevice_EndStateBlock +// ****************************************************************** +SOOVPA<6> D3DDevice_EndStateBlock_1_0_3925 = +{ + 0, // Large == 0 + 6, // Count == 6 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x00, 0xA1 }, + { 0x05, 0x83 }, + { 0x06, 0x60 }, + { 0x07, 0x0C }, + { 0x08, 0xDF }, + { 0x09, 0xE9 }, + } +}; + // ****************************************************************** // * D3D8_1_0_3925 // ****************************************************************** @@ -5937,6 +5979,24 @@ OOVPATable D3D8_1_0_3925[] = "D3D::BlockOnResource" #endif }, + // D3DDevice_BeginStateBlock + { + (OOVPA*)&D3DDevice_BeginStateBlock_1_0_3925, + XTL::EmuIDirect3DDevice8_BeginStateBlock, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_BeginStateBlock" + #endif + }, + // D3DDevice_EndStateBlock + { + (OOVPA*)&D3DDevice_EndStateBlock_1_0_3925, + XTL::EmuIDirect3DDevice8_EndStateBlock, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_EndStateBlock" + #endif + }, }; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl index 7afd61af6..434112567 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl @@ -1933,6 +1933,27 @@ SOOVPA<13> IDirect3DDevice8_SetRenderState_CullModeB_1_0_4134 = } }; +// ****************************************************************** +// * D3DDevice_DeleteVertexShader +// ****************************************************************** +SOOVPA<6> X_D3DDevice_DeleteVertexShader_1_0_4134 = +{ + 0, // Large == 0 + 6, // Count == 6 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x02, 0x24 }, + { 0x06, 0xFF }, + { 0x0A, 0x08 }, + { 0x0E, 0x44 }, + { 0x16, 0xC2 }, + { 0x17, 0x04 }, + } +}; + // ****************************************************************** // * IDirect3DDevice8_SetScreenSpaceOffset // ****************************************************************** @@ -3600,9 +3621,9 @@ OOVPATable D3D8_1_0_4134[] = "EmuIDirect3DDevice8_SetRenderState_CullModeB" #endif }, - // D3DDevice_DeleteVertexShader (* unchanged since 3925 *) + // D3DDevice_DeleteVertexShader (* unchanged since 4134 *) { - (OOVPA*)&X_D3DDevice_DeleteVertexShader_1_0_3925, + (OOVPA*)&X_D3DDevice_DeleteVertexShader_1_0_4134, XTL::EmuIDirect3DDevice8_DeleteVertexShader, diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl index 0b4dd8d88..67a95f3b7 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl @@ -428,6 +428,39 @@ SOOVPA<11> IDirect3DDevice8_Swap_1_0_4432 = } }; +// ****************************************************************** +// * IDirect3DDevice8_Swap +// ****************************************************************** +SOOVPA<11> IDirect3DDevice8_Swap_1_0_4531 = +{ + 0, // Large == 0 + 11, // Count == 11 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_Swap+0x10 : mov ebx, 5 + { 0x10, 0xBB }, // (Offset,Value)-Pair #1 + { 0x11, 0x05 }, // (Offset,Value)-Pair #2 + + // IDirect3DDevice8_Swap+0x1D : test bl, 3 + { 0x1D, 0xF6 }, // (Offset,Value)-Pair #3 + { 0x1E, 0xC3 }, // (Offset,Value)-Pair #4 + { 0x1F, 0x03 }, // (Offset,Value)-Pair #5 + + // IDirect3DDevice8_Swap+0x46 : inc dword ptr [esi+0x2AD8] + { 0x46, 0xFF }, // (Offset,Value)-Pair #6 + { 0x47, 0x86 }, // (Offset,Value)-Pair #7 + { 0x48, 0xD8 }, // (Offset,Value)-Pair #8 + { 0x49, 0x2A }, // (Offset,Value)-Pair #9 + + // IDirect3DDevice8_Swap+0xAE : retn 4 + { 0xB9, 0xC2 }, // (Offset,Value)-Pair #10 + { 0xBA, 0x04 }, // (Offset,Value)-Pair #11 + } +}; + // ****************************************************************** // * IDirect3DDevice8_UpdateOverlay // ****************************************************************** @@ -551,31 +584,46 @@ SOOVPA<9> IDirect3DDevice8_BackFillMode_1_0_4531 = }; // ****************************************************************** -// * IDirect3DDevice8_EndPush +// * D3DDevice_BeginPush // ****************************************************************** -// TODO: Add... -SOOVPA<12> IDirect3DDevice8_EndPush_1_0_4531 = +SOOVPA<6> D3DDevice_BeginPush_1_0_4432 = { 0, // Large == 0 - 12, // Count == 10 + 6, // Count == 6 -1, // Xref Not Saved - 1, // Xref Is Used + 0, // Xref Not Used { - { 0x06, XREF_D3DDEVICE }, // 1 + { 0x09, 0x8B }, + { 0x0A, 0xCE }, + { 0x10, 0x8B }, + { 0x11, 0x44 }, + { 0x17, 0xE8 }, + { 0x1D, 0xC2 }, + } +}; - { 0x00, 0x8B }, // 2 - { 0x01, 0x44 }, // 3 - { 0x02, 0x24 }, // 4 - { 0x03, 0x04 }, // 5 - { 0x04, 0x8B }, // 6 - { 0x05, 0x0D }, // 7 - { 0x0A, 0x89 }, // 8 - { 0x0B, 0x01 }, // 9 - { 0x0C, 0xC2 }, // 10 - { 0x0D, 0x04 }, // 11 - { 0x0E, 0x00 }, // 12 +// ****************************************************************** +// * D3DDevice_EndPush +// ****************************************************************** +SOOVPA<8> D3DDevice_EndPush_1_0_4432 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x00, 0x8B }, + { 0x02, 0x24 }, + { 0x04, 0x8B }, + { 0x0A, 0x89 }, + { 0x0B, 0x01 }, + { 0x0C, 0xC2 }, + { 0x0D, 0x04 }, + { 0x0E, 0x00 }, } }; @@ -802,6 +850,73 @@ SOOVPA<11> IDirect3DVertexBuffer8_Lock_1_0_4531 = } }; +// ****************************************************************** +// * D3DDevice_GetProjectionViewportMatrix +// ****************************************************************** +SOOVPA<7> D3DDevice_GetProjectionViewportMatrix_1_0_4432 = +{ + 0, // Large == 0 + 7, // Count == 7 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x02, 0x35 }, + { 0x07, 0x57 }, + { 0x0A, 0x24 }, + { 0x0E, 0x70 }, + { 0x12, 0xB9 }, + { 0x16, 0x00 }, + { 0x1A, 0x5E }, + } +}; + +// ****************************************************************** +// * D3DDevice_SetVertexShaderInput +// ****************************************************************** +SOOVPA<8> D3DDevice_SetVertexShaderInput_1_0_4432 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x1E, 0x83 }, + { 0x3E, 0x10 }, + { 0x5E, 0x00 }, + { 0x7E, 0x24 }, + { 0x9E, 0x89 }, + { 0xBE, 0x81 }, + { 0xDE, 0xC6 }, + { 0xFE, 0x89 }, + } +}; + +// ****************************************************************** +// * D3DDevice_SetModelView +// ****************************************************************** +SOOVPA<7> D3DDevice_SetModelView_1_0_4432 = +{ + 0, // Large == 0 + 7, // Count == 7 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x15, 0x25 }, + { 0x2F, 0x81 }, + { 0x43, 0x43 }, + { 0x5A, 0x04 }, + { 0x72, 0x8D }, + { 0x88, 0x00 }, + { 0x9F, 0x75 }, + } +}; + // ****************************************************************** // * D3D8_1_0_4432 // ****************************************************************** @@ -1356,6 +1471,16 @@ OOVPATable D3D8_1_0_4432[] = #ifdef _DEBUG_TRACE "EmuIDirect3DDevice8_Swap" #endif + }, + // IDirect3DDevice8::Swap + { + (OOVPA*)&IDirect3DDevice8_Swap_1_0_4531, + + XTL::EmuIDirect3DDevice8_Swap, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_Swap (4531)" + #endif }, // IDirect3DDevice8::UpdateOverlay { @@ -1855,6 +1980,65 @@ OOVPATable D3D8_1_0_4432[] = "EmuLock2DSurface" #endif }, + // IDirect3DBaseTexture8::GetLevelCount (* unchanged since 4361 *) + { + (OOVPA*)&IDirect3DBaseTexture8_GetLevelCount_1_0_4361, + + XTL::EmuIDirect3DBaseTexture8_GetLevelCount, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DBaseTexture8_GetLevelCount" + #endif + }, + // IDirect3DDevice8_GetProjectionViewportMatrix + { + (OOVPA*)&D3DDevice_GetProjectionViewportMatrix_1_0_4432, + + XTL::EmuIDirect3DDevice8_GetProjectionViewportMatrix, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_GetProjectionViewportMatrix" + #endif + }, + // D3DDevice_SetVertexShaderInputDirect + { + (OOVPA*)&D3DDevice_SetVertexShaderInput_1_0_4432, + + XTL::EmuIDirect3DDevice8_SetVertexShaderInput, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetVertexShaderInput" + #endif + }, + // D3DDevice_SetModelView + { + (OOVPA*)&D3DDevice_SetModelView_1_0_4432, + XTL::EmuIDirect3DDevice8_SetModelView, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetModelView" + #endif + }, + // IDirect3DDevice8::BeginPush + { + (OOVPA*)&D3DDevice_BeginPush_1_0_4432, + + XTL::EmuIDirect3DDevice8_BeginPush, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_BeginPush" + #endif + }, + // IDirect3DDevice8::EndPush + { + (OOVPA*)&D3DDevice_EndPush_1_0_4432, + + XTL::EmuIDirect3DDevice8_EndPush, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_EndPush" + #endif + }, }; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl index 6d437a642..54379ef36 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl @@ -3425,6 +3425,26 @@ SOOVPA<13> D3D_CDevice_KickOff_1_0_4627 = } }; +// ****************************************************************** +// * D3DDevice_KickPushBuffer +// ****************************************************************** +SOOVPA<4> D3DDevice_KickPushBuffer_1_0_4627 = +{ + 0, // Large == 0 + 4, // Count == 4 + + -1, // Xref Not Saved + 1, // Xref Not Used + + { + { 0x07, XREF_D3D_KickOff }, + + { 0x00, 0x8B }, + { 0x01, 0x0D }, + { 0x06, 0xE9 }, + } +}; + // ****************************************************************** // * IDirect3DDevice8::GetTexture2 // ****************************************************************** @@ -4109,6 +4129,142 @@ SOOVPA<7> D3DDevice_GetPersistedSurface2_1_0_4627 = } }; +// ****************************************************************** +// * D3DDevice_SetModelView +// ****************************************************************** +SOOVPA<7> D3DDevice_SetModelView_1_0_4627 = +{ + 0, // Large == 0 + 7, // Count == 7 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x15, 0xFF }, + { 0x2D, 0x81 }, + { 0x43, 0x3B }, + { 0x5A, 0xC1 }, + { 0x71, 0x53 }, + { 0x8A, 0x8B }, + { 0x9F, 0x30 }, + } +}; + +// ****************************************************************** +// * D3D::LazySetPointParams +// ****************************************************************** +SOOVPA<7> D3D_LazySetPointParams_1_0_4627 = +{ + 0, // Large == 0 + 7, // Count == 7 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x00, 0x83 }, + { 0x01, 0xEC }, + { 0x02, 0x14 }, + { 0x4E, 0xE0 }, + { 0x73, 0xF6 }, + { 0x74, 0xC4 }, + { 0x75, 0x41 }, + } +}; + +// ****************************************************************** +// * D3DDevice_SetDepthClipPlanes +// ****************************************************************** +SOOVPA<7> D3DDevice_SetDepthClipPlanes_1_0_4627 = +{ + 0, // Large == 0 + 7, // Count == 7 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x12, 0x24 }, + { 0x26, 0x8B }, + { 0x3A, 0x0C }, + { 0x4E, 0x17 }, + { 0x62, 0x86 }, + { 0x76, 0x05 }, + { 0x8A, 0x00 }, + } +}; + +// ****************************************************************** +// * D3DDevice_GetMaterial +// ****************************************************************** +SOOVPA<8> D3DDevice_GetMaterial_1_0_4627 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x05, 0x56 }, + { 0x06, 0x57 }, + { 0x0A, 0x0C }, + { 0x0D, 0xB0 }, + { 0x0E, 0x0A }, + { 0x12, 0x11 }, + { 0x16, 0xF3 }, + { 0x1A, 0xC2 }, + } +}; + +// ****************************************************************** +// * D3DDevice_GetBackMaterial +// ****************************************************************** +SOOVPA<8> D3DDevice_GetBackMaterial_1_0_4627 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x05, 0x56 }, + { 0x06, 0x57 }, + { 0x0A, 0x0C }, + { 0x0D, 0xF4 }, + { 0x0E, 0x0A }, + { 0x12, 0x11 }, + { 0x16, 0xF3 }, + { 0x1A, 0xC2 }, + } +}; + +// ****************************************************************** +// * D3DDevice_SetBackMaterial +// ****************************************************************** +SOOVPA<9> D3DDevice_SetBackMaterial_1_0_4627 = +{ + 0, // Large == 0 + 9, // Count == 9 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x04, 0x08 }, + { 0x0C, 0x81 }, + { 0x0E, 0xF4 }, + { 0x10, 0x00 }, + { 0x16, 0x00 }, + { 0x1F, 0x81 }, + { 0x22, 0x10 }, + { 0x2C, 0x5E }, + { 0x2E, 0x04 }, + } +}; + // ****************************************************************** // * D3D8_1_0_4627 // ****************************************************************** @@ -4133,16 +4289,6 @@ OOVPATable D3D8_1_0_4627[] = #ifdef _DEBUG_TRACE "EmuIDirect3D8_CreateDevice" #endif - }, - // IDirect3D8::CreateDevice - { - (OOVPA*)&IDirect3D8_CreateDevice_1_0_5028, - - XTL::EmuIDirect3D8_CreateDevice, - - #ifdef _DEBUG_TRACE - "EmuIDirect3D8_CreateDevice_5028" - #endif }, // IDirect3D8::CheckDeviceFormat (* unchanged since 4361 *) { @@ -6114,6 +6260,84 @@ OOVPATable D3D8_1_0_4627[] = "EmuIDirect3DDevice8_GetPersistedSurface2 ***" #endif }, + // D3DDevice_SetModelView + { + (OOVPA*)&D3DDevice_SetModelView_1_0_4627, + XTL::EmuIDirect3DDevice8_SetModelView, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetModelView" + #endif + }, + // D3D_LazySetPointParams_1_0_4627 + { + (OOVPA*)&D3D_LazySetPointParams_1_0_4627, + XTL::EmuD3D_LazySetPointParams, + + #ifdef _DEBUG_TRACE + "D3D::LazySetPointParams (XRef)" + #endif + }, + // D3DDevice_SetDepthClipPlanes + { + (OOVPA*)&D3DDevice_SetDepthClipPlanes_1_0_4627, + XTL::EmuIDirect3DDevice8_SetDepthClipPlanes, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetDepthClipPlanes" + #endif + }, + // IDirect3DDevice8::GetMaterial + { + (OOVPA*)&D3DDevice_GetMaterial_1_0_4627, + + XTL::EmuIDirect3DDevice8_GetMaterial, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_GetMaterial" + #endif + }, + // IDirect3DDevice8::KickPushBuffer + { + (OOVPA*)&D3DDevice_KickPushBuffer_1_0_4627, + + XTL::EmuD3DDevice_KickOff, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_KickPushBuffer" + #endif + }, + // IDirect3DDevice8::GetBackMaterial + { + (OOVPA*)&D3DDevice_GetBackMaterial_1_0_4627, + + XTL::EmuIDirect3DDevice8_GetBackMaterial, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_GetBackMaterial" + #endif + }, + // IDirect3DDevice8::SetBackMaterial + { + (OOVPA*)&D3DDevice_SetBackMaterial_1_0_4627, + + XTL::EmuIDirect3DDevice8_SetBackMaterial, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetBackMaterial" + #endif + }, + // IDirect3DCubeTexture8::LockRect + // TODO: This needs to be verified on 4361, not just 4242! + /*{ + (OOVPA*)&IDirect3DCubeTexture8_LockRect_1_0_3925, + + XTL::EmuIDirect3DCubeTexture8_LockRect, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DCubeTexture8_LockRect_4242" + #endif + },*/ }; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl index a70a78d38..b14bffe2c 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl @@ -2882,15 +2882,6 @@ OOVPATable D3D8_1_0_5849[] = "EmuIDirect3DDevice8_SetRenderState_LogicOp" #endif }, - // D3DDevice::SetDepthClipPlanes - { - (OOVPA*)&D3DDevice_SetDepthClipPlanes_1_0_5849, - XTL::EmuIDirect3DDevice8_SetDepthClipPlanes, - - #ifdef _DEBUG_TRACE - "EmuIDirect3DDevice8_SetDepthClipPlanes" - #endif - }, // D3DDevice_SetRenderState_MultiSampleMask { (OOVPA*)&D3DDevice_SetRenderState_MultiSampleMask_1_0_5849, @@ -3355,6 +3346,35 @@ OOVPATable D3D8_1_0_5849[] = "EmuIDirect3DDevice8_SetRenderTargetFast" #endif }, + // IDirect3D8::GetAdapterModeCount (* unchanged since 4361 *) + { + (OOVPA*)&IDirect3D8_GetAdapterModeCount_1_0_4361, + + XTL::EmuIDirect3D8_GetAdapterModeCount, + + #ifdef _DEBUG_TRACE + "EmuIDirect3D8_GetAdapterModeCount" + #endif + }, + // IDirect3D8::EnumAdapterModes (* unchanged since 4361 *) + { + (OOVPA*)&IDirect3D8_EnumAdapterModes_1_0_4361, + + XTL::EmuIDirect3D8_EnumAdapterModes, + + #ifdef _DEBUG_TRACE + "EmuIDirect3D8_EnumAdapterModes" + #endif + }, + // D3DDevice_SetDepthClipPlanes + { + (OOVPA*)&D3DDevice_SetDepthClipPlanes_1_0_5849, + XTL::EmuIDirect3DDevice8_SetDepthClipPlanes, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetDepthClipPlanes" + #endif + }, }; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl index 294f6b85f..7aabb8c70 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl @@ -4824,6 +4824,27 @@ SOOVPA<9> IDirectSoundBuffer_SetNotificationPositions_1_0_3936 = } }; +// ****************************************************************** +// * CDirectSoundStream::Pause +// ****************************************************************** +SOOVPA<6> CDirectSoundStream_Pause_1_0_3936 = +{ + 0, // Large == 0 + 6, // Count == 6 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x01, 0x44 }, + { 0x04, 0xFF }, + { 0x07, 0x08 }, + { 0x0A, 0x24 }, + { 0x10, 0xC2 }, + { 0x11, 0x08 }, + } +}; + // ****************************************************************** // * DirectSoundCreate_1_0_3936 // ****************************************************************** @@ -6152,6 +6173,16 @@ OOVPATable DSound_1_0_3936[] = "EmuIDirectSoundBuffer_SetNotificationPositions" #endif }, + // CDirectSoundStream::Pause + { + (OOVPA*)&CDirectSoundStream_Pause_1_0_3936, + + XTL::EmuCDirectSoundStream_Pause, + + #ifdef _DEBUG_TRACE + "CDirectSoundStream_Pause" + #endif + }, }; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.h b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.h new file mode 100644 index 000000000..2bf1a5a7a --- /dev/null +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.h @@ -0,0 +1,42 @@ +// ****************************************************************** +// * +// * .,-::::: .,:: .::::::::. .,:: .: +// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; +// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' +// * $$$ Y$$$P $$""""Y$$ Y$$$P +// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, +// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, +// * +// * Cxbx->Win32->CxbxKrnl->XOnline.1.0.5558.h +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef XONLINE_1_0_5558_H +#define XONLINE_1_0_5558_H + +#include "OOVPA.h" + +extern OOVPATable XOnline_1_0_5558[]; +extern uint32 XOnline_1_0_5558_SIZE; + +#endif diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl new file mode 100644 index 000000000..5b649a20b --- /dev/null +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl @@ -0,0 +1,241 @@ +// ****************************************************************** +// * +// * .,-::::: .,:: .::::::::. .,:: .: +// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; +// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' +// * $$$ Y$$$P $$""""Y$$ Y$$$P +// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, +// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, +// * +// * Cxbx->Win32->CxbxKrnl->XOnline.1.0.5558.inl +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** + +#if 0 +// ****************************************************************** +// * XNetStartup +// ****************************************************************** +SOOVPA<8> XNetStartup_1_0_5344 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x01, 0xC0 }, + { 0x04, 0x50 }, + { 0x07, 0x24 }, + { 0x0A, 0x68 }, + { 0x0F, 0xE8 }, + { 0x14, 0xC2 }, + { 0x15, 0x04 }, + { 0x16, 0x00 }, + } +}; + +// ****************************************************************** +// * XNetGetEthernetLinkStatus +// ****************************************************************** +SOOVPA<8> XNetGetEthernetLinkStatus_1_0_5344 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x08, 0x33 }, + { 0x10, 0x8A }, + { 0x19, 0x00 }, + { 0x22, 0x56 }, + { 0x2B, 0xFF }, + { 0x34, 0xF0 }, + { 0x3D, 0x24 }, + { 0x46, 0x5B }, + } +}; + +// ****************************************************************** +// * CXo::XOnlineLogon +// ****************************************************************** +SOOVPA<8> CXo_XOnlineLogon_1_0_5344 = +{ + 0, // Large == 0 + 8, // Count == 8 + + XREF_CXo_XOnlineLogon, // Xref Is Saved + 0, // Xref Not Used + + { + { 0x21, 0xA8 }, + { 0x3E, 0x80 }, + { 0x5E, 0x00 }, + { 0x7E, 0x04 }, + { 0xA2, 0x85 }, + { 0xBE, 0xEC }, + { 0xDE, 0xF9 }, + { 0xFE, 0x33 }, + } +}; + +// ****************************************************************** +// * XOnlineLogon +// ****************************************************************** +SOOVPA<8> XOnlineLogon_1_0_5344 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 1, // Xref Is Used + + { + { 0x0B, XREF_CXo_XOnlineLogon }, + + { 0x00, 0x55 }, + { 0x01, 0x8B }, + { 0x02, 0xEC }, + { 0x03, 0x5D }, + { 0x04, 0x8B }, + { 0x05, 0x0D }, + { 0x0A, 0xE9 }, + } +}; +#endif + +// ****************************************************************** +// * WSAStartup +// ****************************************************************** +SOOVPA<7> WSAStartup_1_0_5558 = +{ + 0, // Large == 0 + 7, // Count == 7 + + -1, // Xref Not Saved + 0, // Xref Not Used + + { + { 0x02, 0x24 }, + { 0x06, 0x24 }, + { 0x0A, 0x6A }, + { 0x0E, 0x68 }, + { 0x13, 0xE8 }, + { 0x18, 0xC2 }, + { 0x1A, 0x00 }, + } +}; + +// ****************************************************************** +// * XOnline_1_0_5558 +// ****************************************************************** +// * TODO: Verify all of these +// ****************************************************************** +OOVPATable XOnline_1_0_5558[] = +{ + // XNetStartup + { + (OOVPA*)&XNetStartup_1_0_5344, + + XTL::EmuXNetStartup, + + #ifdef _DEBUG_TRACE + "EmuXNetStartup (5344)" + #endif + }, + // WSAStartup + { + (OOVPA*)&WSAStartup_1_0_5558, + + XTL::EmuWSAStartup, + + #ifdef _DEBUG_TRACE + "EmuWSAStartup" + #endif + }, + // XnInit (XREF) (* unchanged since 4627 *) + { + (OOVPA*)&XnInit_1_0_4627, 0, + + #ifdef _DEBUG_TRACE + "XnInit (XRef)" + #endif + }, + // socket + /*{ + (OOVPA*)&socket_1_0_4361, + + MFPtoFP(XTL::EmuThis::Emusocket), + + #ifdef _DEBUG_TRACE + "Emusocket" + #endif + },*/ + // bind (* unchanged since 4361 *) + { + (OOVPA*)&bind_1_0_4361, + + MFPtoFP(&XTL::EmuThis::Emubind), + + #ifdef _DEBUG_TRACE + "Emubind" + #endif + }, + // listen + /*{ + (OOVPA*)&listen_1_0_4361, + + MFPtoFP(XTL::EmuThis::Emulisten), + + #ifdef _DEBUG_TRACE + "Emulisten" + #endif + },*/ + // ioctlsocket (* unchanged since 4361 *) + { + (OOVPA*)&ioctlsocket_1_0_4361, + + MFPtoFP(&XTL::EmuThis::Emuioctlsocket), + + #ifdef _DEBUG_TRACE + "Emuioctlsocket" + #endif + }, + // XNetGetEthernetLinkStatus + { + (OOVPA*)&XNetGetEthernetLinkStatus_1_0_5344, + XTL::EmuXNetGetEthernetLinkStatus, + + #ifdef _DEBUG_TRACE + "EmuXNetGetEthernetLinkStatus (5344)" + #endif + }, +}; + +// ****************************************************************** +// * XOnline_1_0_5558_SIZE +// ****************************************************************** +uint32 XOnline_1_0_5558_SIZE = sizeof(XOnline_1_0_5558); diff --git a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl index 9c066117c..d40c1775b 100644 --- a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl +++ b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl @@ -210,7 +210,7 @@ SOOVPA<11> XID_fCloseDevice_1_0_4361 = { 0x92, 0x86 }, // (Offset,Value)-Pair #8 { 0x93, 0xA7 }, // (Offset,Value)-Pair #9 - // XID_fCloseDevice+0x91 : leave; retn + // XID_fCloseDevice+0x9F : leave; retn { 0x9F, 0xC9 }, // (Offset,Value)-Pair #10 { 0xA0, 0xC3 }, // (Offset,Value)-Pair #11 } diff --git a/src/CxbxKrnl/KernelThunk.cpp b/src/CxbxKrnl/KernelThunk.cpp index 0066db669..cf08500fb 100644 --- a/src/CxbxKrnl/KernelThunk.cpp +++ b/src/CxbxKrnl/KernelThunk.cpp @@ -87,13 +87,13 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] = (uint32)PANIC(0x001B), // 0x001B (27) ExRaiseStatus (uint32)PANIC(0x001C), // 0x001C (28) ExReleaseReadWriteLock (uint32)&xboxkrnl::ExSaveNonVolatileSetting, // 0x001D (29) - (uint32)PANIC(0x001E), // 0x001E (30) ExSemaphoreObjectType - (uint32)PANIC(0x001F), // 0x001F (31) ExTimerObjectType - (uint32)PANIC(0x0020), // 0x0020 (32) ExfInterlockedInsertHeadList - (uint32)PANIC(0x0021), // 0x0021 (33) ExfInterlockedInsertTailList - (uint32)PANIC(0x0022), // 0x0022 (34) ExfInterlockedRemoveHeadList - (uint32)PANIC(0x0023), // 0x0023 (35) FscGetCacheSize - (uint32)PANIC(0x0024), // 0x0024 (36) FscInvalidateIdleBlocks + (uint32)PANIC(0x001E), // 0x001E (30) + (uint32)PANIC(0x001F), // 0x001F (31) + (uint32)PANIC(0x0020), // 0x0020 (32) + (uint32)PANIC(0x0021), // 0x0021 (33) + (uint32)PANIC(0x0022), // 0x0022 (34) + (uint32)&xboxkrnl::FscGetCacheSize, // 0x0023 (35) + (uint32)PANIC(0x0024), // 0x0024 (36) (uint32)&xboxkrnl::FscSetCacheSize, // 0x0025 (37) (uint32)PANIC(0x0026), // 0x0026 (38) HalClearSoftwareInterrupt (uint32)PANIC(0x0027), // 0x0027 (39) HalDisableSystemInterrupt @@ -101,7 +101,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] = (uint32)PANIC(0x0029), // 0x0029 (41) HalDiskModelNumber (uint32)PANIC(0x002A), // 0x002A (42) HalDiskSerialNumber (uint32)PANIC(0x002B), // 0x002B (43) HalEnableSystemInterrupt - (uint32)PANIC(0x002C), // 0x002C (44) HalGetInterruptVector + (uint32)&xboxkrnl::HalGetInterruptVector, // 0x002C (44) (uint32)&xboxkrnl::HalReadSMBusValue, // 0x002D (45) (uint32)PANIC(0x002E), // 0x002E (46) HalReadWritePCISpace (uint32)&xboxkrnl::HalRegisterShutdownNotification, // 0x002F (47) HalRegisterShutdownNotification @@ -155,7 +155,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] = (uint32)&xboxkrnl::KeBugCheck, // 0x005F (95) (uint32)PANIC(0x0060), // 0x0060 (96) KeBugCheckEx (uint32)PANIC(0x0061), // 0x0061 (97) KeCancelTimer - (uint32)PANIC(0x0062), // 0x0062 (98) KeConnectInterrupt + (uint32)&xboxkrnl::KeConnectInterrupt, // 0x0062 (98) (uint32)&xboxkrnl::KeDelayExecutionThread, // 0x0063 (99) (uint32)PANIC(0x0064), // 0x0064 (100) KeDisconnectInterrupt (uint32)PANIC(0x0065), // 0x0065 (101) KeEnterCriticalRegion @@ -165,11 +165,11 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] = (uint32)PANIC(0x0069), // 0x0069 (105) KeInitializeApc (uint32)PANIC(0x006A), // 0x006A (106) KeInitializeDeviceQueue (uint32)&xboxkrnl::KeInitializeDpc, // 0x006B (107) - (uint32)PANIC(0x006C), // 0x006C (108) KeInitializeEvent - (uint32)PANIC(0x006D), // 0x006D (109) KeInitializeInterrupt - (uint32)PANIC(0x006E), // 0x006E (110) KeInitializeMutant - (uint32)PANIC(0x006F), // 0x006F (111) KeInitializeQueue - (uint32)PANIC(0x0070), // 0x0070 (112) KeInitializeSemaphore + (uint32)PANIC(0x006C), // 0x006C (108) + (uint32)&xboxkrnl::KeInitializeInterrupt, // 0x006D (109) + (uint32)PANIC(0x006E), // 0x006E (110) + (uint32)PANIC(0x006F), // 0x006F (111) + (uint32)PANIC(0x0070), // 0x0070 (112) (uint32)&xboxkrnl::KeInitializeTimerEx, // 0x0071 (113) (uint32)PANIC(0x0072), // 0x0072 (114) KeInsertByKeyDeviceQueue (uint32)PANIC(0x0073), // 0x0073 (115) KeInsertDeviceQueue