About to rearrange a ton of files

This commit is contained in:
Aaron Robinson 2003-03-27 05:56:08 +00:00
parent de8bf0dee7
commit f2bb835ff0
4 changed files with 89 additions and 1 deletions

View File

@ -1,5 +1,7 @@
Cxbx Todo: Cxbx Todo:
Multimonitor support (of course!) Direct3D9::EnumAdapterModes iteration
Everything that is initialized within the context of the converted Everything that is initialized within the context of the converted
Exe and CxbxKrnl should be cleaned up at some point before final Exe and CxbxKrnl should be cleaned up at some point before final
process termination. process termination.

View File

@ -46,4 +46,16 @@ extern VOID EmuXPollController();
// ****************************************************************** // ******************************************************************
VOID EmuXInitDInput(); VOID EmuXInitDInput();
// ******************************************************************
// * offsets into analog button array
// ******************************************************************
#define XINPUT_GAMEPAD_A 0
#define XINPUT_GAMEPAD_B 1
#define XINPUT_GAMEPAD_X 2
#define XINPUT_GAMEPAD_Y 3
#define XINPUT_GAMEPAD_BLACK 4
#define XINPUT_GAMEPAD_WHITE 5
#define XINPUT_GAMEPAD_LEFT_TRIGGER 6
#define XINPUT_GAMEPAD_RIGHT_TRIGGER 7
#endif #endif

View File

@ -47,11 +47,85 @@ namespace xntdll
using namespace win32; using namespace win32;
// ******************************************************************
// * globals
// ******************************************************************
static HANDLE g_hMapObject = NULL;
// ****************************************************************** // ******************************************************************
// * statics // * statics
// ****************************************************************** // ******************************************************************
static void EmuXInstallWrappers(OOVPATable *OovpaTable, uint32 OovpaTableSize, void (*Entry)(), Xbe::Header *XbeHeader); static void EmuXInstallWrappers(OOVPATable *OovpaTable, uint32 OovpaTableSize, void (*Entry)(), Xbe::Header *XbeHeader);
// ******************************************************************
// * shared memory
// ******************************************************************
struct EmuXShared
{
uint32 dwRandomData;
}
*g_EmuXShared;
// ******************************************************************
// * func: DllMain
// ******************************************************************
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
// ******************************************************************
// * Initialize shared memory
// ******************************************************************
if(fdwReason == DLL_PROCESS_ATTACH)
{
bool init = false;
g_hMapObject = CreateFileMapping
(
INVALID_HANDLE_VALUE, // Paging file
NULL, // default security attributes
PAGE_READWRITE, // read/write access
0, // size: high 32 bits
sizeof(EmuXShared), // size: low 32 bits
"EmuXShared" // name of map object
);
if(g_hMapObject == NULL)
return FALSE;
if(GetLastError() != ERROR_ALREADY_EXISTS)
init = true;
g_EmuXShared = (EmuXShared*)MapViewOfFile
(
g_hMapObject, // object to map view of
FILE_MAP_WRITE, // read/write access
0, // high offset: map from
0, // low offset: beginning
0 // default: map entire file
);
if(g_EmuXShared == NULL)
return FALSE;
if(init)
{
// initialization of shared data
g_EmuXShared->dwRandomData = 0;
}
}
// ******************************************************************
// * Release shared memory
// ******************************************************************
if(fdwReason == DLL_PROCESS_DETACH)
{
UnmapViewOfFile(g_EmuXShared);
CloseHandle(g_hMapObject);
}
return TRUE;
}
// ****************************************************************** // ******************************************************************
// * func: EmuXInit // * func: EmuXInit
// ****************************************************************** // ******************************************************************

View File

@ -296,7 +296,7 @@ HRESULT WINAPI xboxkrnl::EmuXIDirect3D8_CreateDevice
pPresentationParameters->Windowed = TRUE; pPresentationParameters->Windowed = TRUE;
// TODO: More intelligently set this only when the game wants it // TODO: More intelligently set this only when the game wants it
pPresentationParameters->SwapEffect = D3DSWAPEFFECT_COPY_VSYNC; //pPresentationParameters->SwapEffect = D3DSWAPEFFECT_COPY_VSYNC;
hFocusWindow = g_EmuXWindow; hFocusWindow = g_EmuXWindow;