Fun Stuff

This commit is contained in:
Aaron Robinson 2003-06-10 08:18:43 +00:00
parent 51ec37bab2
commit b98fc210be
11 changed files with 167 additions and 14 deletions

View File

@ -254,6 +254,10 @@ SOURCE=.\Include\Win32\CxbxKrnl\XG.1.0.4361.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\XG.1.0.4627.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\xntdll.h
# End Source File
# End Group
@ -376,6 +380,10 @@ SOURCE=.\Source\Win32\XBVideo.cpp
SOURCE=.\Source\Win32\CxbxKrnl\XG.1.0.4361.inl
# End Source File
# Begin Source File
SOURCE=.\Source\Win32\CxbxKrnl\XG.1.0.4627.inl
# End Source File
# End Group
# End Target
# End Project

View File

@ -57,7 +57,7 @@ extern "C" CXBXKRNL_API void NTAPI EmuCleanThread();
// ******************************************************************
// * func: EmuCleanup
// ******************************************************************
extern "C" CXBXKRNL_API void NTAPI EmuCleanup(const char *szErrorMessage);
extern "C" CXBXKRNL_API void NTAPI EmuCleanup(const char *szErrorMessage, ...);
// ******************************************************************
// * func: EmuPanic

View File

@ -43,6 +43,7 @@
#include "D3D8.1.0.4361.h"
#include "D3D8.1.0.4627.h"
#include "XG.1.0.4361.h"
#include "XG.1.0.4627.h"
// ******************************************************************
// * HLEDataBase

View File

@ -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->XG.1.0.4627.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 <caustik@caustik.com>
// *
// * All rights reserved
// *
// ******************************************************************
#ifndef XG_1_0_4627_H
#define XG_1_0_4627_H
#include "OOVPA.h"
extern OOVPATable XG_1_0_4627[];
extern uint32 XG_1_0_4627_SIZE;
#endif

View File

@ -60,7 +60,7 @@ inline D3DFORMAT EmuXB2PC_D3DFormat(X_D3DFORMAT Format)
else if(Format == 0x2C)
return D3DFMT_D16;
EmuCleanup("EmuXB2PC_D3DFormat: Unknown Format");
EmuCleanup("EmuXB2PC_D3DFormat: Unknown Format (%d)", Format);
return Format;
}

View File

@ -364,7 +364,7 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit
{
EmuSwapFS(); // XBox FS
_asm int 3
// _asm int 3
Entry();
@ -387,20 +387,31 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit
// ******************************************************************
// * func: EmuCleanup
// ******************************************************************
extern "C" CXBXKRNL_API void NTAPI EmuCleanup(const char *szErrorMessage)
extern "C" CXBXKRNL_API void NTAPI EmuCleanup(const char *szErrorMessage, ...)
{
// ******************************************************************
// * Print out ErrorMessage (if exists)
// ******************************************************************
if(szErrorMessage != NULL)
{
char buffer[255];
char szBuffer1[255];
char szBuffer2[255];
sprintf(buffer, "Emu (0x%X): Recieved Fatal Message!\n\n%s\n", GetCurrentThreadId(), szErrorMessage);
va_list argp;
printf("%s", buffer);
sprintf(szBuffer1, "Emu (0x%X): Recieved Fatal Message -> \n\n", GetCurrentThreadId());
MessageBox(NULL, buffer, "CxbxKrnl", MB_OK | MB_ICONEXCLAMATION);
va_start(argp, szErrorMessage);
vsprintf(szBuffer2, szErrorMessage, argp);
va_end(argp);
strcat(szBuffer1, szBuffer2);
printf("%s", szBuffer1);
MessageBox(NULL, szBuffer1, "CxbxKrnl", MB_OK | MB_ICONEXCLAMATION);
}
printf("CxbxKrnl: Terminating Process\n");

View File

@ -1017,7 +1017,7 @@ HRESULT WINAPI xd3d8::EmuIDirect3DSurface8_GetDesc
if(SurfaceDesc.MultiSampleType == D3DMULTISAMPLE_NONE)
pDesc->MultiSampleType = (xd3d8::D3DMULTISAMPLE_TYPE)0x0011;
else
EmuCleanup("EmuIDirect3DSurface8_GetDesc Unknown Multisample format!");
EmuCleanup("EmuIDirect3DSurface8_GetDesc Unknown Multisample format! (%d)", SurfaceDesc.MultiSampleType);
pDesc->Width = SurfaceDesc.Width;
pDesc->Height = SurfaceDesc.Height;
@ -1066,7 +1066,7 @@ HRESULT WINAPI xd3d8::EmuIDirect3DSurface8_LockRect
NewFlags |= D3DLOCK_READONLY;
if(Flags & !(0x80 | 0x40))
EmuCleanup("EmuIDirect3DSurface8_LockRect: Unknown Flags!");
EmuCleanup("EmuIDirect3DSurface8_LockRect: Unknown Flags! (0x%.08X)", Flags);
// This is lame, but we have no choice (afaik)
((IDirect3DSurface8*)pThis)->UnlockRect();
@ -1253,7 +1253,7 @@ VOID WINAPI xd3d8::EmuIDirect3DDevice8_SetRenderState_CullMode
Value = D3DCULL_CCW;
break;
default:
EmuCleanup("EmuIDirect3DDevice8_SetRenderState_CullMode: Unknown Cullmode");
EmuCleanup("EmuIDirect3DDevice8_SetRenderState_CullMode: Unknown Cullmode (%d)", Value);
}
g_pD3D8Device->SetRenderState(D3DRS_CULLMODE, Value);

View File

@ -211,7 +211,7 @@ XBSYSAPI EXPORTNUM(24) NTSTATUS NTAPI xboxkrnl::ExQueryNonVolatileSetting
break;
default:
printf("EmuKrnl (0x%X): ExQueryNonVolatileSetting unknown ValueIndex : %.08X\n", ValueIndex);
printf("ExQueryNonVolatileSetting unknown ValueIndex (%d)\n", ValueIndex);
break;
}

View File

@ -72,6 +72,7 @@ namespace xg
#include "D3D8.1.0.4361.inl"
#include "D3D8.1.0.4627.inl"
#include "XG.1.0.4361.inl"
#include "XG.1.0.4627.inl"
// ******************************************************************
// * HLEDataBase
@ -141,6 +142,13 @@ HLEData HLEDataBase[] =
XG_1_0_4361,
XG_1_0_4361_SIZE
},
// XG Version 1.0.4627
{
"XGRAPHC",
1, 0, 4627,
XG_1_0_4627,
XG_1_0_4627_SIZE
},
};
// ******************************************************************

View File

@ -0,0 +1,55 @@
// ******************************************************************
// *
// * .,-::::: .,:: .::::::::. .,:: .:
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
// * $$$ Y$$$P $$""""Y$$ Y$$$P
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->CxbxKrnl->XG.1.0.4627.cpp
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2002-2003 Aaron Robinson <caustik@caustik.com>
// *
// * All rights reserved
// *
// ******************************************************************
// ******************************************************************
// * XG_1_0_4627
// ******************************************************************
OOVPATable XG_1_0_4627[] =
{
// XGIsSwizzledFormat (* unchanged since 4361 *)
{
(OOVPA*)&XGIsSwizzledFormat_1_0_4361,
xg::EmuXGIsSwizzledFormat,
#ifdef _DEBUG_TRACE
"XGIsSwizzledFormat"
#endif
},
};
// ******************************************************************
// * XG_1_0_4627_SIZE
// ******************************************************************
uint32 XG_1_0_4627_SIZE = sizeof(XG_1_0_4627);

View File

@ -32,6 +32,34 @@
// *
// ******************************************************************
// ******************************************************************
// * RtlFreeHeap
// ******************************************************************
SOOVPA<9> RtlFreeHeap_1_0_4627 =
{
0, // Large == 0
9, // Count == 9
{
// RtlFreeHeap+0x1F : test edi, edi
{ 0x1F, 0x85 }, // (Offset,Value)-Pair #1
{ 0x20, 0xFF }, // (Offset,Value)-Pair #2
// RtlFreeHeap+0x23 : mov al, 1
{ 0x23, 0xB0 }, // (Offset,Value)-Pair #3
{ 0x24, 0x01 }, // (Offset,Value)-Pair #4
// RtlFreeHeap+0x35 : mov eax, fs:[0x20]
{ 0x35, 0x64 }, // (Offset,Value)-Pair #5
{ 0x36, 0xA1 }, // (Offset,Value)-Pair #6
{ 0x37, 0x20 }, // (Offset,Value)-Pair #7
// RtlFreeHeap+0x49 : push 0x0B
{ 0x49, 0x6A }, // (Offset,Value)-Pair #8
{ 0x4A, 0x0B }, // (Offset,Value)-Pair #9
}
};
// ******************************************************************
// * XAPI_1_0_4627
// ******************************************************************
@ -57,9 +85,9 @@ OOVPATable XAPI_1_0_4627[] =
"RtlAllocateHeap"
#endif
},
// RtlFreeHeap (* unchanged since 1.0.4361 *) (* OR FARTHER, AND VERIFY THIS ONE *)
// RtlFreeHeap
{
(OOVPA*)&RtlFreeHeap_1_0_4361,
(OOVPA*)&RtlFreeHeap_1_0_4627,
xapi::EmuRtlFreeHeap,