Random stuff, taken from my old Loader branch

This commit is contained in:
patrickvl 2019-02-01 13:20:31 +01:00 committed by RadWolfie
parent 208ce0e35c
commit 34072e9fd9
4 changed files with 11 additions and 6 deletions

View File

@ -27,6 +27,8 @@
#include <cstdint>
//#define FUNC_EXPORTS __pragma(comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__))
/*! xbaddr is the type of a physical address */
typedef uint32_t xbaddr;

View File

@ -126,7 +126,7 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin)
}
// Make sure EEPROM.bin is at least 256 bytes in size
SetFilePointer(hFileEEPROM, 256, nullptr, FILE_BEGIN);
SetFilePointer(hFileEEPROM, EEPROM_SIZE, nullptr, FILE_BEGIN);
SetEndOfFile(hFileEEPROM);
HANDLE hFileMappingEEPROM = CreateFileMapping(

View File

@ -48,7 +48,7 @@ HMODULE hActiveModule = NULL;
// ******************************************************************
// * func: EmuShared::EmuSharedInit
// ******************************************************************
void EmuShared::Init(DWORD guiProcessID)
bool EmuShared::Init(DWORD guiProcessID)
{
// ******************************************************************
// * Ensure initialization only occurs once
@ -59,7 +59,7 @@ void EmuShared::Init(DWORD guiProcessID)
// * Prevent multiple initializations
// ******************************************************************
if(hMapObject != NULL)
return;
return true;
// ******************************************************************
// * Create the shared memory "file"
@ -78,7 +78,7 @@ void EmuShared::Init(DWORD guiProcessID)
);
if(hMapObject == NULL)
CxbxKrnlCleanupEx(CXBXR_MODULE::INIT, "Could not map shared memory!");
return false; // CxbxKrnlCleanupEx(CXBXR_MODULE::INIT, "Could not map shared memory!");
if(GetLastError() == ERROR_ALREADY_EXISTS)
bRequireConstruction = false;
@ -98,7 +98,7 @@ void EmuShared::Init(DWORD guiProcessID)
);
if(g_EmuShared == nullptr)
CxbxKrnlCleanupEx(CXBXR_MODULE::INIT, "Could not map view of shared memory!");
return false; // CxbxKrnlCleanupEx(CXBXR_MODULE::INIT, "Could not map view of shared memory!");
}
// ******************************************************************
@ -109,6 +109,7 @@ void EmuShared::Init(DWORD guiProcessID)
}
g_EmuShared->m_RefCount++;
return true;
}
// ******************************************************************
@ -130,6 +131,8 @@ void EmuShared::Cleanup()
// ******************************************************************
EmuShared::EmuShared()
{
// m_bMultiXbe = false;
// m_LaunchDataPAddress = NULL;
m_bDebugging = false;
m_bEmulating_status = false;
m_bFirstLaunch = false;

View File

@ -63,7 +63,7 @@ class EmuShared : public Mutex
// ******************************************************************
// * Each process needs to call this to initialize shared memory
// ******************************************************************
static void Init(DWORD guiProcessID);
static bool Init(DWORD guiProcessID);
// ******************************************************************
// * Each process needs to call this to cleanup shared memory