diff --git a/src/Common/Logging.cpp b/src/Common/Logging.cpp index c732649c3..7ad3349f6 100644 --- a/src/Common/Logging.cpp +++ b/src/Common/Logging.cpp @@ -35,7 +35,5 @@ #include "Logging.h" // For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration -thread_local const DWORD _CurrentThreadId = GetCurrentThreadId(); - // TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html thread_local std::string _logPrefix; diff --git a/src/Common/Logging.h b/src/Common/Logging.h index bf60c1495..0da96f154 100644 --- a/src/Common/Logging.h +++ b/src/Common/Logging.h @@ -36,7 +36,15 @@ #pragma once -#include "Cxbx.h" +#include // For DWORD +#include // For std::stringstream +#include // For std::cout +#include // For std::setw +#include "Cxbx.h" // For g_bPrintfOn + +// +// __FILENAME__ +// // From http://stackoverflow.com/questions/31050113/how-to-extract-the-source-filename-without-path-and-suffix-at-compile-time constexpr const char* str_end(const char *str) { @@ -56,11 +64,6 @@ constexpr const char* file_name(const char* str) { #define __FILENAME__ file_name(__FILE__) -#include // for DWORD -#include // for std::stringstream -#include // For std::cout -#include // For std::setw - // // Hex output (type safe) // @@ -136,21 +139,16 @@ inline const char * _log_sanitize(BOOLEAN value) { return value ? "TRUE" : "FALS // // For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration -extern thread_local const DWORD _CurrentThreadId; - // TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html extern thread_local std::string _logPrefix; - #ifdef _DEBUG_TRACE #define LOG_FUNC_BEGIN \ do { if(g_bPrintfOn) { \ bool _had_arg = false; \ - if (_logPrefix.empty()) { \ - std::stringstream tmp; \ - tmp << __FILENAME__ << " (" << hex2((uint16_t)_CurrentThreadId) << "): "; \ - _logPrefix = tmp.str(); \ - }; \ + std::stringstream tmp; \ + tmp << __FILENAME__ << " (" << hex2((uint16_t)GetCurrentThreadId()) << "): "; \ + _logPrefix = tmp.str(); \ std::stringstream msg; \ msg << _logPrefix << __func__ << "("; @@ -188,7 +186,10 @@ extern thread_local std::string _logPrefix; #define LOG_FUNC_RESULT(r) #endif +// // Short hand defines : +// + // Log function without arguments #define LOG_FUNC() LOG_FUNC_BEGIN LOG_FUNC_END diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/CxbxKrnl/CxbxKrnl.cpp index 36dd02e3e..b5087f55d 100644 --- a/src/CxbxKrnl/CxbxKrnl.cpp +++ b/src/CxbxKrnl/CxbxKrnl.cpp @@ -467,7 +467,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit strcat(szBuffer, "\\Cxbx-Reloaded\\"); std::string basePath(szBuffer); - CxbxBasePath = basePath + "\\EmuDisk\\"; + CxbxBasePath = basePath + "EmuDisk\\"; // Determine XBE Path memset(szBuffer, 0, MAX_PATH); @@ -485,19 +485,19 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit std::string titleId(szBuffer); // Games may assume they are running from CdRom : - CxbxRegisterDeviceNativePath(DeviceCdrom0, xbeDirectory); + CxbxDefaultXbeDriveIndex = CxbxRegisterDeviceHostPath(DeviceCdrom0, xbeDirectory); // Partition 0 contains configuration data, and is accessed as a native file, instead as a folder : - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition0, CxbxBasePath + "Partition0", /*IsFile=*/true); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition0, CxbxBasePath + "Partition0", /*IsFile=*/true); // The first two partitions are for Data and Shell files, respectively : - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition1, CxbxBasePath + "Partition1"); - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition2, CxbxBasePath + "Partition2"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition1, CxbxBasePath + "Partition1"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition2, CxbxBasePath + "Partition2"); // The following partitions are for caching purposes - for now we allocate up to 7 (as xbmp needs that many) : - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition3, CxbxBasePath + "Partition3"); - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition4, CxbxBasePath + "Partition4"); - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition5, CxbxBasePath + "Partition5"); - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition6, CxbxBasePath + "Partition6"); - CxbxRegisterDeviceNativePath(DeviceHarddisk0Partition7, CxbxBasePath + "Partition7"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition3, CxbxBasePath + "Partition3"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition4, CxbxBasePath + "Partition4"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition5, CxbxBasePath + "Partition5"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition6, CxbxBasePath + "Partition6"); + CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition7, CxbxBasePath + "Partition7"); DbgPrintf("EmuMain : Creating default symbolic links.\n"); @@ -506,7 +506,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit { // Arrange that the Xbe path can reside outside the partitions, and put it to g_hCurDir : CxbxCreateSymbolicLink(DriveC, xbeDirectory); - EmuNtSymbolicLinkObject* xbePathSymbolicLinkObject = FindNtSymbolicLinkObjectByVolumeLetter(CxbxDefaultXbeVolumeLetter); + EmuNtSymbolicLinkObject* xbePathSymbolicLinkObject = FindNtSymbolicLinkObjectByDriveLetter(CxbxDefaultXbeDriveLetter); g_hCurDir = xbePathSymbolicLinkObject->RootDirectoryHandle; // Determine Xbox path to XBE and place it in XeImageFileName @@ -522,16 +522,20 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit xboxkrnl::XeImageFileName.MaximumLength = MAX_PATH; xboxkrnl::XeImageFileName.Buffer = (PCHAR)malloc(MAX_PATH); - sprintf(xboxkrnl::XeImageFileName.Buffer, "%c:\\%s", CxbxDefaultXbeVolumeLetter, fileName.c_str()); + sprintf(xboxkrnl::XeImageFileName.Buffer, "%c:\\%s", CxbxDefaultXbeDriveLetter, fileName.c_str()); xboxkrnl::XeImageFileName.Length = (USHORT)strlen(xboxkrnl::XeImageFileName.Buffer); DbgPrintf("EmuMain : XeImageFileName = %s\n", xboxkrnl::XeImageFileName.Buffer); + CxbxCreateSymbolicLink(DriveA, DeviceCdrom0); // CdRom could be read from A: CxbxCreateSymbolicLink(DriveD, DeviceCdrom0); // CdRom goes to D: CxbxCreateSymbolicLink(DriveE, DeviceHarddisk0Partition1); // Partition1 goes to E: (Data files, savegames, etc.) + //CxbxCreateSymbolicLink(DriveE, DeviceHarddisk0Partition1 + "\\DevKit"); // Partition1 goes to E: (Devkit) CxbxCreateSymbolicLink(DriveF, DeviceHarddisk0Partition2); // Partition2 goes to F: (Shell files, dashboard, etc.) - CxbxCreateSymbolicLink(DriveT, DeviceHarddisk0Partition1 + "\\TDATA\\" + titleId + "\\"); // Partition1\Title data goes to T: - CxbxCreateSymbolicLink(DriveU, DeviceHarddisk0Partition1 + "\\UDATA\\" + titleId + "\\"); // Partition1\User data goes to U: + CxbxCreateSymbolicLink(DriveS, DeviceHarddisk0Partition1 + "\\TDATA"); // Partition1\TDATA data goes to S: + CxbxCreateSymbolicLink(DriveT, DeviceHarddisk0Partition1 + "\\TDATA\\" + titleId); // Partition1 Title data goes to T: + CxbxCreateSymbolicLink(DriveU, DeviceHarddisk0Partition1 + "\\UDATA\\" + titleId); // Partition1 User data goes to U: + CxbxCreateSymbolicLink(DriveV, DeviceHarddisk0Partition1 + "\\UDATA"); // Partition1\UDATA data goes to V: CxbxCreateSymbolicLink(DriveX, DeviceHarddisk0Partition3); // Partition3 goes to X: CxbxCreateSymbolicLink(DriveY, DeviceHarddisk0Partition4); // Partition4 goes to Y: diff --git a/src/CxbxKrnl/EmuFile.cpp b/src/CxbxKrnl/EmuFile.cpp index c46ae1dbf..f6d9fffaa 100644 --- a/src/CxbxKrnl/EmuFile.cpp +++ b/src/CxbxKrnl/EmuFile.cpp @@ -54,10 +54,12 @@ const std::string DriveCdRom0 = DrivePrefix + "CdRom0:"; // CD-ROM device const std::string DriveMbfs = DrivePrefix + "mbfs:"; // media board's file system area device const std::string DriveMbcom = DrivePrefix + "mbcom:"; // media board's communication area device const std::string DriveMbrom = DrivePrefix + "mbrom:"; // media board's boot ROM device +const std::string DriveA = DrivePrefix + "A:"; // A: could be CDROM const std::string DriveC = DrivePrefix + "C:"; // C: is HDD0 const std::string DriveD = DrivePrefix + "D:"; // D: is DVD Player const std::string DriveE = DrivePrefix + "E:"; const std::string DriveF = DrivePrefix + "F:"; +const std::string DriveS = DrivePrefix + "S:"; const std::string DriveT = DrivePrefix + "T:"; // T: is Title persistent data region const std::string DriveU = DrivePrefix + "U:"; // U: is User persistent data region const std::string DriveV = DrivePrefix + "V:"; @@ -90,13 +92,15 @@ const std::string DeviceHarddisk0Partition17 = DeviceHarddisk0PartitionPrefix + const std::string DeviceHarddisk0Partition18 = DeviceHarddisk0PartitionPrefix + "18"; const std::string DeviceHarddisk0Partition19 = DeviceHarddisk0PartitionPrefix + "19"; const std::string DeviceHarddisk0Partition20 = DeviceHarddisk0PartitionPrefix + "20"; // 20 = Largest possible partition number -const char CxbxDefaultXbeVolumeLetter = 'C'; +const char CxbxDefaultXbeDriveLetter = 'C'; + +int CxbxDefaultXbeDriveIndex = -1; EmuNtSymbolicLinkObject* NtSymbolicLinkObjects[26]; struct XboxDevice { - std::string XboxFullPath; - std::string NativePath; - HANDLE NativeRootHandle; + std::string XboxDevicePath; + std::string HostDevicePath; + HANDLE HostRootHandle; }; std::vector Devices; @@ -188,12 +192,16 @@ void copy_string_to_PSTRING_to(std::string const & src, const xboxkrnl::PSTRING memcpy(dest->Buffer, src.c_str(), dest->Length); } -NTSTATUS _CxbxConvertFilePath(std::string RelativeXboxPath, std::wstring &RelativeNativePath, NtDll::HANDLE *RootDirectory, std::string aFileAPIName) +NTSTATUS _CxbxConvertFilePath( + std::string RelativeXboxPath, + OUT std::wstring &RelativeHostPath, + OUT NtDll::HANDLE *RootDirectory, + std::string aFileAPIName) { std::string OriginalPath = RelativeXboxPath; std::string RelativePath = RelativeXboxPath; std::string XboxFullPath; - std::string NativePath; + std::string HostPath; EmuNtSymbolicLinkObject* NtSymbolicLinkObject = NULL; // Always trim '\??\' off : @@ -207,14 +215,14 @@ NTSTATUS _CxbxConvertFilePath(std::string RelativeXboxPath, std::wstring &Relati if ((RelativePath.length() >= 2) && (RelativePath[1] == ':')) { // Look up the symbolic link information using the drive letter : - NtSymbolicLinkObject = FindNtSymbolicLinkObjectByVolumeLetter(RelativePath[0]); + NtSymbolicLinkObject = FindNtSymbolicLinkObjectByDriveLetter(RelativePath[0]); RelativePath.erase(0, 2); // Remove 'C:' // If the remaining path starts with a ':', remove it (to prevent errors) : if ((RelativePath.length() > 0) && (RelativePath[0] == ':')) RelativePath.erase(0, 1); // xbmp needs this, as it accesses 'e::\' } - else if (RelativePath.compare(0, 1, "$") == 0) + else if (RelativePath[0] == '$') { if (RelativePath.compare(0, 5, "$HOME") == 0) // "xbmp" needs this { @@ -225,35 +233,39 @@ NTSTATUS _CxbxConvertFilePath(std::string RelativeXboxPath, std::wstring &Relati CxbxKrnlCleanup(("Unsupported path macro : " + OriginalPath).c_str()); } // Check if the path starts with a relative path indicator : - else if (RelativePath.compare(0, 1, ".") == 0) // "4x4 Evo 2" needs this + else if (RelativePath[0] == '.') // "4x4 Evo 2" needs this { NtSymbolicLinkObject = FindNtSymbolicLinkObjectByRootHandle(g_hCurDir); RelativePath.erase(0, 1); // Remove the '.' } else { + // TODO : How should we handle accesses to the serial: (?semi-)volume? + if (RelativePath.compare(0, 7, "serial:") == 0) + return STATUS_UNRECOGNIZED_VOLUME; + // The path seems to be a device path, look it up : NtSymbolicLinkObject = FindNtSymbolicLinkObjectByDevice(RelativePath); // Fixup RelativePath path here - if ((NtSymbolicLinkObject != NULL)) - RelativePath.erase(0, NtSymbolicLinkObject->XboxFullPath.length()); // Remove '\Device\Harddisk0\Partition2' + if (NtSymbolicLinkObject != NULL) + RelativePath.erase(0, NtSymbolicLinkObject->XboxSymbolicLinkPath.length()); // Remove '\Device\Harddisk0\Partition2' // else TODO : Turok requests 'gamedata.dat' without a preceding path, we probably need 'CurrentDir'-functionality } - if ((NtSymbolicLinkObject != NULL)) + if (NtSymbolicLinkObject != NULL) { - NativePath = NtSymbolicLinkObject->NativePath; + HostPath = NtSymbolicLinkObject->HostSymbolicLinkPath; // If the remaining path starts with a '\', remove it (to prevent working in a native root) : if ((RelativePath.length() > 0) && (RelativePath[0] == '\\')) { RelativePath.erase(0, 1); - // And if needed, add it to the Native path instead : - if (NativePath.back() != '\\') - NativePath.append(1, '\\'); + // And if needed, add it to the host path instead : + if (HostPath.back() != '\\') + HostPath.append(1, '\\'); } - XboxFullPath = NtSymbolicLinkObject->XboxFullPath; + XboxFullPath = NtSymbolicLinkObject->XboxSymbolicLinkPath; *RootDirectory = NtSymbolicLinkObject->RootDirectoryHandle; } else @@ -270,7 +282,7 @@ NTSTATUS _CxbxConvertFilePath(std::string RelativeXboxPath, std::wstring &Relati RelativePath.erase(0, DeviceHarddisk0.length() + 1); // And set Root to the folder containing the partition-folders : *RootDirectory = CxbxBasePathHandle; - NativePath = CxbxBasePath; + HostPath = CxbxBasePath; } // Check for special case : Partition0 @@ -285,9 +297,9 @@ NTSTATUS _CxbxConvertFilePath(std::string RelativeXboxPath, std::wstring &Relati DbgPrintf("EmuKrnl : %s Corrected path...\n", aFileAPIName.c_str()); DbgPrintf(" Org:\"%s\"\n", OriginalPath.c_str()); - if (_strnicmp(NativePath.c_str(), CxbxBasePath.c_str(), CxbxBasePath.length()) == 0) + if (_strnicmp(HostPath.c_str(), CxbxBasePath.c_str(), CxbxBasePath.length()) == 0) { - DbgPrintf(" New:\"$CxbxPath\\EmuDisk\\%s\\%s\"\n", (NativePath.substr(CxbxBasePath.length(), std::string::npos)).c_str(), RelativePath.c_str()); + DbgPrintf(" New:\"$CxbxPath\\%s%s\"\n", (HostPath.substr(CxbxBasePath.length(), std::string::npos)).c_str(), RelativePath.c_str()); } else DbgPrintf(" New:\"$XbePath\\%s\"\n", RelativePath.c_str()); @@ -301,19 +313,19 @@ NTSTATUS _CxbxConvertFilePath(std::string RelativeXboxPath, std::wstring &Relati } // Convert the relative path to unicode - RelativeNativePath = string_to_wstring(RelativePath); + RelativeHostPath = string_to_wstring(RelativePath); return STATUS_SUCCESS; } NTSTATUS CxbxObjectAttributesToNT( xboxkrnl::POBJECT_ATTRIBUTES ObjectAttributes, - NativeObjectAttributes& nativeObjectAttributes, + OUT NativeObjectAttributes& nativeObjectAttributes, const std::string aFileAPIName) { NTSTATUS result = STATUS_SUCCESS; std::string RelativeXboxPath; - std::wstring RelativeNativePath; + std::wstring RelativeHostPath; NtDll::HANDLE RootDirectory; if (ObjectAttributes == NULL) @@ -327,46 +339,47 @@ NTSTATUS CxbxObjectAttributesToNT( nativeObjectAttributes.NtObjAttrPtr = &nativeObjectAttributes.NtObjAttr; RelativeXboxPath = PSTRING_to_string(ObjectAttributes->ObjectName); - result = _CxbxConvertFilePath(RelativeXboxPath, RelativeNativePath, &RootDirectory, aFileAPIName); + result = _CxbxConvertFilePath(RelativeXboxPath, /*OUT*/RelativeHostPath, /*OUT*/&RootDirectory, aFileAPIName); + if (!FAILED(result)) + { + // Copy relative path string to the unicode string + wcscpy_s(nativeObjectAttributes.wszObjectName, RelativeHostPath.c_str()); + NtDll::RtlInitUnicodeString(&nativeObjectAttributes.NtUnicodeString, nativeObjectAttributes.wszObjectName); - // Copy relative path string to the unicode string - wcscpy_s(nativeObjectAttributes.wszObjectName, RelativeNativePath.c_str()); - NtDll::RtlInitUnicodeString(&nativeObjectAttributes.NtUnicodeString, nativeObjectAttributes.wszObjectName); - - // Initialize the NT ObjectAttributes - InitializeObjectAttributes(&nativeObjectAttributes.NtObjAttr, &nativeObjectAttributes.NtUnicodeString, ObjectAttributes->Attributes, RootDirectory, NULL); + // Initialize the NT ObjectAttributes + InitializeObjectAttributes(&nativeObjectAttributes.NtObjAttr, &nativeObjectAttributes.NtUnicodeString, ObjectAttributes->Attributes, RootDirectory, NULL); + } return result; } -bool CxbxRegisterDeviceNativePath(std::string XboxFullPath, std::string NativePath, bool IsFile) +int CxbxRegisterDeviceHostPath(std::string XboxDevicePath, std::string HostDevicePath, bool IsFile) { - bool result; + int result = -1; if (IsFile) { - if (!PathFileExists(NativePath.c_str())) { - HANDLE hf = CreateFile(NativePath.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); + if (!PathFileExists(HostDevicePath.c_str())) { + HANDLE hf = CreateFile(HostDevicePath.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); SetFilePointer(hf, 512 * 1024, 0, FILE_BEGIN); SetEndOfFile(hf); CloseHandle(hf); } - return true; // Actually, this is the Config sectors partition (partition0) registered as a file + // Actually, this is the Config sectors partition (partition0) registered as a file } else { - int status = SHCreateDirectoryEx(NULL, NativePath.c_str(), NULL); - result = status == STATUS_SUCCESS || ERROR_ALREADY_EXISTS; - } + int status = SHCreateDirectoryEx(NULL, HostDevicePath.c_str(), NULL); + if (status == STATUS_SUCCESS || status == ERROR_ALREADY_EXISTS) + { + XboxDevice newDevice; - if (result) - { - XboxDevice newDevice; - - newDevice.XboxFullPath = XboxFullPath; - newDevice.NativePath = NativePath; - Devices.push_back(newDevice); + newDevice.XboxDevicePath = XboxDevicePath; + newDevice.HostDevicePath = HostDevicePath; + Devices.push_back(newDevice); + result = Devices.size() - 1; + } } return result; @@ -378,10 +391,9 @@ NTSTATUS CxbxCreateSymbolicLink(std::string SymbolicLinkName, std::string FullPa NTSTATUS result = 0; EmuNtSymbolicLinkObject* SymbolicLinkObject = FindNtSymbolicLinkObjectByName(SymbolicLinkName); - if ((SymbolicLinkObject != NULL)) { - // In that case, close it : + if (SymbolicLinkObject != NULL) + // In that case, close it (will also delete if reference count drops to zero) SymbolicLinkObject->NtClose(); - } // Now (re)create a symbolic link object, and initialize it with the new definition : SymbolicLinkObject = new EmuNtSymbolicLinkObject(); @@ -397,29 +409,27 @@ NTSTATUS CxbxCreateSymbolicLink(std::string SymbolicLinkName, std::string FullPa NTSTATUS EmuNtSymbolicLinkObject::Init(std::string aSymbolicLinkName, std::string aFullPath) { NTSTATUS result = STATUS_OBJECT_NAME_INVALID; - bool IsNativePath = false; int i = 0; - std::string ExtraPath; int DeviceIndex = 0; DriveLetter = SymbolicLinkToDriveLetter(aSymbolicLinkName); if (DriveLetter >= 'A' && DriveLetter <= 'Z') { result = STATUS_OBJECT_NAME_COLLISION; - if (FindNtSymbolicLinkObjectByVolumeLetter(DriveLetter) == NULL) + if (FindNtSymbolicLinkObjectByDriveLetter(DriveLetter) == NULL) { // Look up the partition in the list of pre-registered devices : result = STATUS_DEVICE_DOES_NOT_EXIST; // TODO : Is this the correct error? - // Make a distinction between Xbox paths (starting with '\Device'...) and Native paths : - IsNativePath = _strnicmp(aFullPath.c_str(), DevicePrefix.c_str(), DevicePrefix.length()) != 0; - if (IsNativePath) - DeviceIndex = 0; + // Make a distinction between Xbox paths (starting with '\Device'...) and host paths : + IsHostBasedPath = _strnicmp(aFullPath.c_str(), DevicePrefix.c_str(), DevicePrefix.length()) != 0; + if (IsHostBasedPath) + DeviceIndex = CxbxDefaultXbeDriveIndex; else { DeviceIndex = -1; for (size_t i = 0; i < Devices.size(); i++) { - if (_strnicmp(aFullPath.c_str(), Devices[i].XboxFullPath.c_str(), Devices[i].XboxFullPath.length()) == 0) + if (_strnicmp(aFullPath.c_str(), Devices[i].XboxDevicePath.c_str(), Devices[i].XboxDevicePath.length()) == 0) { DeviceIndex = i; break; @@ -431,33 +441,33 @@ NTSTATUS EmuNtSymbolicLinkObject::Init(std::string aSymbolicLinkName, std::strin { result = STATUS_SUCCESS; SymbolicLinkName = aSymbolicLinkName; - XboxFullPath = aFullPath; // TODO : What path do we remember in IsNativePath mode? - if (IsNativePath) + if (IsHostBasedPath) { - NativePath = ""; - ExtraPath = aFullPath; + XboxSymbolicLinkPath = ""; + HostSymbolicLinkPath = aFullPath; } else { - NativePath = Devices[DeviceIndex].NativePath; + XboxSymbolicLinkPath = aFullPath; + HostSymbolicLinkPath = Devices[DeviceIndex].HostDevicePath; // Handle the case where a sub folder of the partition is mounted (instead of it's root) : - ExtraPath = aFullPath.substr(Devices[DeviceIndex].XboxFullPath.length(), std::string::npos); + std::string ExtraPath = aFullPath.substr(Devices[DeviceIndex].XboxDevicePath.length(), std::string::npos); + + if (!ExtraPath.empty()) + HostSymbolicLinkPath = HostSymbolicLinkPath + ExtraPath; } - if (!ExtraPath.empty()) - NativePath = NativePath + ExtraPath; - - SHCreateDirectoryEx(NULL, NativePath.c_str(), NULL); - RootDirectoryHandle = CreateFile(NativePath.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + SHCreateDirectoryEx(NULL, HostSymbolicLinkPath.c_str(), NULL); + RootDirectoryHandle = CreateFile(HostSymbolicLinkPath.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); if (RootDirectoryHandle == INVALID_HANDLE_VALUE) { result = STATUS_DEVICE_DOES_NOT_EXIST; // TODO : Is this the correct error? - CxbxKrnlCleanup((std::string("Could not map ") + NativePath).c_str()); + CxbxKrnlCleanup((std::string("Could not map ") + HostSymbolicLinkPath).c_str()); } else { NtSymbolicLinkObjects[DriveLetter - 'A'] = this; - DbgPrintf("EmuMain : Linked \"%s\" to \"%s\" (residing at \"%s\")\n", aSymbolicLinkName.c_str(), aFullPath.c_str(), NativePath.c_str()); + DbgPrintf("EmuMain : Linked \"%s\" to \"%s\" (residing at \"%s\")\n", aSymbolicLinkName.c_str(), aFullPath.c_str(), HostSymbolicLinkPath.c_str()); } } } @@ -505,29 +515,29 @@ char SymbolicLinkToDriveLetter(std::string SymbolicLinkName) return NULL; } -EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByVolumeLetter(const char VolumeLetter) +EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByDriveLetter(const char DriveLetter) { - if (VolumeLetter >= 'A' && VolumeLetter <= 'Z') - return NtSymbolicLinkObjects[VolumeLetter - 'A']; + if (DriveLetter >= 'A' && DriveLetter <= 'Z') + return NtSymbolicLinkObjects[DriveLetter - 'A']; - if (VolumeLetter >= 'a' && VolumeLetter <= 'z') - return NtSymbolicLinkObjects[VolumeLetter - 'a']; + if (DriveLetter >= 'a' && DriveLetter <= 'z') + return NtSymbolicLinkObjects[DriveLetter - 'a']; return NULL; } EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByName(std::string SymbolicLinkName) { - return FindNtSymbolicLinkObjectByVolumeLetter(SymbolicLinkToDriveLetter(SymbolicLinkName)); + return FindNtSymbolicLinkObjectByDriveLetter(SymbolicLinkToDriveLetter(SymbolicLinkName)); } EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByDevice(std::string DeviceName) { - for (char VolumeLetter = 'A'; VolumeLetter <= 'Z'; VolumeLetter++) + for (char DriveLetter = 'A'; DriveLetter <= 'Z'; DriveLetter++) { - EmuNtSymbolicLinkObject* result = NtSymbolicLinkObjects[VolumeLetter - 'A']; - if ((result != NULL) && _strnicmp(DeviceName.c_str(), result->XboxFullPath.c_str(), result->XboxFullPath.length()) == 0) + EmuNtSymbolicLinkObject* result = NtSymbolicLinkObjects[DriveLetter - 'A']; + if ((result != NULL) && _strnicmp(DeviceName.c_str(), result->XboxSymbolicLinkPath.c_str(), result->XboxSymbolicLinkPath.length()) == 0) return result; } @@ -537,9 +547,9 @@ EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByDevice(std::string DeviceName EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByRootHandle(const HANDLE Handle) { - for (char VolumeLetter = 'A'; VolumeLetter <= 'Z'; VolumeLetter++) + for (char DriveLetter = 'A'; DriveLetter <= 'Z'; DriveLetter++) { - EmuNtSymbolicLinkObject* result = NtSymbolicLinkObjects[VolumeLetter - 'A']; + EmuNtSymbolicLinkObject* result = NtSymbolicLinkObjects[DriveLetter - 'A']; if ((result != NULL) && (Handle == result->RootDirectoryHandle)) return result; } @@ -564,7 +574,8 @@ NtDll::FILE_LINK_INFORMATION * _XboxToNTLinkInfo(xboxkrnl::FILE_LINK_INFORMATION std::string originalFileName(xboxLinkInfo->FileName, xboxLinkInfo->FileNameLength); std::wstring convertedFileName; NtDll::HANDLE RootDirectory; - _CxbxConvertFilePath(originalFileName, convertedFileName, &RootDirectory, "NtSetInformationFile"); + NTSTATUS res = _CxbxConvertFilePath(originalFileName, /*OUT*/convertedFileName, /*OUT*/&RootDirectory, "NtSetInformationFile"); + // TODO : handle if(FAILED(res)) // Build the native FILE_LINK_INFORMATION struct *Length = sizeof(NtDll::FILE_LINK_INFORMATION) + convertedFileName.size() * sizeof(wchar_t); @@ -584,7 +595,8 @@ NtDll::FILE_RENAME_INFORMATION * _XboxToNTRenameInfo(xboxkrnl::FILE_RENAME_INFOR std::string originalFileName(xboxRenameInfo->FileName.Buffer, xboxRenameInfo->FileName.Length); std::wstring convertedFileName; NtDll::HANDLE RootDirectory; - _CxbxConvertFilePath(originalFileName, convertedFileName, &RootDirectory, "NtSetInformationFile"); + NTSTATUS res = _CxbxConvertFilePath(originalFileName, /*OUT*/convertedFileName, /*OUT*/&RootDirectory, "NtSetInformationFile"); + // TODO : handle if(FAILED(res)) // Build the native FILE_RENAME_INFORMATION struct *Length = sizeof(NtDll::FILE_RENAME_INFORMATION) + convertedFileName.size() * sizeof(wchar_t); diff --git a/src/CxbxKrnl/EmuFile.h b/src/CxbxKrnl/EmuFile.h index 5403373c4..b6929c2ed 100644 --- a/src/CxbxKrnl/EmuFile.h +++ b/src/CxbxKrnl/EmuFile.h @@ -1,4 +1,3 @@ -// ****************************************************************** // * // * .,-::::: .,:: .::::::::. .,:: .: // * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; @@ -65,10 +64,12 @@ extern const std::string DriveCdRom0; extern const std::string DriveMbfs; extern const std::string DriveMbcom; extern const std::string DriveMbrom; +extern const std::string DriveA; extern const std::string DriveC; extern const std::string DriveD; extern const std::string DriveE; extern const std::string DriveF; +extern const std::string DriveS; extern const std::string DriveT; extern const std::string DriveU; extern const std::string DriveV; @@ -101,7 +102,8 @@ extern const std::string DeviceHarddisk0Partition17; extern const std::string DeviceHarddisk0Partition18; extern const std::string DeviceHarddisk0Partition19; extern const std::string DeviceHarddisk0Partition20; -extern const char CxbxDefaultXbeVolumeLetter; +extern const char CxbxDefaultXbeDriveLetter; +extern int CxbxDefaultXbeDriveIndex; extern std::string CxbxBasePath; extern HANDLE CxbxBasePathHandle; @@ -200,8 +202,9 @@ class EmuNtSymbolicLinkObject : public EmuNtObject { public: char DriveLetter; std::string SymbolicLinkName; - std::string XboxFullPath; - std::string NativePath; + bool IsHostBasedPath; + std::string XboxSymbolicLinkPath; + std::string HostSymbolicLinkPath; HANDLE RootDirectoryHandle; NTSTATUS Init(std::string aSymbolicLinkName, std::string aFullPath); ~EmuNtSymbolicLinkObject(); @@ -217,12 +220,12 @@ HANDLE EmuHandleToHandle(EmuHandle* emuHandle); CHAR* NtStatusToString(IN NTSTATUS Status); char SymbolicLinkToDriveLetter(std::string aSymbolicLinkName); -EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByVolumeLetter(const char VolumeLetter); +EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByDriveLetter(const char DriveLetter); EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByName(std::string SymbolicLinkName); EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByDevice(std::string DeviceName); EmuNtSymbolicLinkObject* FindNtSymbolicLinkObjectByRootHandle(HANDLE Handle); void CleanupSymbolicLinks(); -bool CxbxRegisterDeviceNativePath(std::string XboxFullPath, std::string NativePath, bool IsFile = false); +int CxbxRegisterDeviceHostPath(std::string XboxFullPath, std::string HostDevicePath, bool IsFile = false); HANDLE CxbxGetDeviceNativeRootHandle(std::string XboxFullPath); NTSTATUS CxbxCreateSymbolicLink(std::string SymbolicLinkName, std::string FullPath); bool CxbxMountUtilityDrive(bool formatClean); diff --git a/src/CxbxKrnl/EmuKrnlIo.cpp b/src/CxbxKrnl/EmuKrnlIo.cpp index 9816270ff..c2039291b 100644 --- a/src/CxbxKrnl/EmuKrnlIo.cpp +++ b/src/CxbxKrnl/EmuKrnlIo.cpp @@ -122,21 +122,22 @@ XBSYSAPI EXPORTNUM(66) xboxkrnl::NTSTATUS NTAPI xboxkrnl::IoCreateFile NativeObjectAttributes nativeObjectAttributes; - NTSTATUS ret = CxbxObjectAttributesToNT(ObjectAttributes, nativeObjectAttributes, "IoCreateFile"); /*var*/ + NTSTATUS ret = CxbxObjectAttributesToNT(ObjectAttributes, /*OUT*/nativeObjectAttributes, "IoCreateFile"); - // redirect to NtCreateFile - ret = NtDll::NtCreateFile( - FileHandle, - DesiredAccess | GENERIC_READ, - nativeObjectAttributes.NtObjAttrPtr, - NtDll::PIO_STATUS_BLOCK(IoStatusBlock), - NtDll::PLARGE_INTEGER(AllocationSize), - FileAttributes, - ShareAccess, - Disposition, - CreateOptions, - NULL, - 0); + if (!FAILED(ret)) + // redirect to NtCreateFile + ret = NtDll::NtCreateFile( + FileHandle, + DesiredAccess | GENERIC_READ, + nativeObjectAttributes.NtObjAttrPtr, + NtDll::PIO_STATUS_BLOCK(IoStatusBlock), + NtDll::PLARGE_INTEGER(AllocationSize), + FileAttributes, + ShareAccess, + Disposition, + CreateOptions, + NULL, + 0); if (FAILED(ret)) { diff --git a/src/CxbxKrnl/EmuKrnlLogging.cpp b/src/CxbxKrnl/EmuKrnlLogging.cpp index c0afcfe54..30a38ba62 100644 --- a/src/CxbxKrnl/EmuKrnlLogging.cpp +++ b/src/CxbxKrnl/EmuKrnlLogging.cpp @@ -62,9 +62,9 @@ std::ostream& operator<<(std::ostream& os, const PULONG& value) return os; } -// Macro for implementation of rendering any Enum-ToString : -#define LOGRENDER_ENUM(EnumType) LOGRENDER_HEADER(EnumType) \ -{ return os << "("#EnumType") " << EnumType##ToString(value) << " = " << hex4((int)value); } +// Macro for implementation of rendering any Type-ToString : +#define LOGRENDER_TYPE(Type) LOGRENDER_HEADER(Type) \ +{ return os << "("#Type") " << Type##ToString(value) << " = " << hex4((int)value); } // Macro's for Xbox Enum-ToString conversions : #define ENUM2STR_START(EnumType) const char * EnumType##ToString(const xboxkrnl::EnumType value) { switch (value) { @@ -72,15 +72,17 @@ std::ostream& operator<<(std::ostream& os, const PULONG& value) // ENUM2STR_CASE_DEF is needed for #define'd symbols #define ENUM2STR_CASE_DEF(a) case a: return #a; #define ENUM2STR_END(EnumType) default: return "Unknown_"#EnumType; } } -#define ENUM2STR_END_and_LOGRENDER(EnumType) ENUM2STR_END(EnumType) LOGRENDER_ENUM(EnumType) +#define ENUM2STR_END_and_LOGRENDER(EnumType) ENUM2STR_END(EnumType) LOGRENDER_TYPE(EnumType) -// Macro's for Xbo Flags-ToString conversions : +// Macro's for Xbox Flags-ToString conversions : #define FLAGS2STR_START(Type) std::string Type##ToString(const xboxkrnl::Type value) { std::string res; #define FLAG2STR(f) if (((uint32)value & f) == f) res = res + #f"|"; #define FLAGS2STR_END if (!res.empty()) res.pop_back(); return res; } -#define FLAGS2STR_END_and_LOGRENDER(Type) FLAGS2STR_END LOGRENDER_ENUM(Type) +#define FLAGS2STR_END_and_LOGRENDER(Type) FLAGS2STR_END LOGRENDER_TYPE(Type) -// Xbox Enum-ToString conversions : +// +// Xbox (Enum)Type-ToString conversions : +// ENUM2STR_START(BUS_DATA_TYPE) ENUM2STR_CASE(ConfigurationSpaceUndefined) @@ -318,7 +320,13 @@ ENUM2STR_END_and_LOGRENDER(WAIT_TYPE) #undef ENUM2STR_CASE #undef ENUM2STR_END #undef ENUM2STR_END_and_LOGRENDER -#undef LOGRENDER_ENUM + +#undef FLAGS2STR_START +#undef FLAG2STR +#undef FLAGS2STR_END +#undef FLAGS2STR_END_and_LOGRENDER + +#undef LOGRENDER_TYPE #define LOGRENDER_MEMBER(Member) << "\n ."#Member": " << value.Member @@ -340,7 +348,9 @@ LOGRENDER_HEADER(P##Type) \ \ LOGRENDER_HEADER(Type) \ +// // Render Xbox types : +// LOGRENDER_TYPE(FILETIME) { diff --git a/src/CxbxKrnl/EmuKrnlNt.cpp b/src/CxbxKrnl/EmuKrnlNt.cpp index 15c2f8374..8519c7a90 100644 --- a/src/CxbxKrnl/EmuKrnlNt.cpp +++ b/src/CxbxKrnl/EmuKrnlNt.cpp @@ -1000,22 +1000,27 @@ XBSYSAPI EXPORTNUM(215) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQuerySymbolicLinkOb // Retrieve the NtSymbolicLinkObject and populate the output arguments : ret = STATUS_SUCCESS; symbolicLinkObject = (EmuNtSymbolicLinkObject*)iEmuHandle->NtObject; - if (LinkTarget != NULL) - { - if (LinkTarget->Length > LinkTarget->MaximumLength) + + if (symbolicLinkObject->IsHostBasedPath) { + // TODO : What should we do with symbolic links + ret = STATUS_UNRECOGNIZED_VOLUME; + } else { + if (LinkTarget != NULL) { - ret = STATUS_BUFFER_TOO_SMALL; - LinkTarget->Length = LinkTarget->MaximumLength; + if (LinkTarget->Length > LinkTarget->MaximumLength) + { + ret = STATUS_BUFFER_TOO_SMALL; + LinkTarget->Length = LinkTarget->MaximumLength; + } + + copy_string_to_PSTRING_to(symbolicLinkObject->XboxSymbolicLinkPath, LinkTarget); } - copy_string_to_PSTRING_to(symbolicLinkObject->XboxFullPath, LinkTarget); + if (ReturnedLength != NULL) + { + *ReturnedLength = symbolicLinkObject->XboxSymbolicLinkPath.length(); // Return full length (even if buffer was too small) + } } - - if (ReturnedLength != NULL) - { - *ReturnedLength = symbolicLinkObject->XboxFullPath.length(); // Return full length (even if buffer was too small) - } - if (ret != STATUS_SUCCESS) EmuWarning("NtQuerySymbolicLinkObject failed! (%s)", NtStatusToString(ret)); diff --git a/src/CxbxKrnl/EmuXapi.cpp b/src/CxbxKrnl/EmuXapi.cpp index 110ca7408..279b70f0f 100644 --- a/src/CxbxKrnl/EmuXapi.cpp +++ b/src/CxbxKrnl/EmuXapi.cpp @@ -970,7 +970,7 @@ DWORD WINAPI XTL::EmuXLaunchNewImage if (!lpTitlePath) { char szDashboardPath[MAX_PATH]; EmuNtSymbolicLinkObject* symbolicLinkObject = FindNtSymbolicLinkObjectByDevice(DeviceHarddisk0Partition2); - sprintf(szDashboardPath, "%s\\xboxdash.xbe", symbolicLinkObject->NativePath.c_str()); + sprintf(szDashboardPath, "%s\\xboxdash.xbe", symbolicLinkObject->HostSymbolicLinkPath.c_str()); if (PathFileExists(szDashboardPath)) { MessageBox(CxbxKrnl_hEmuParent, "The title is rebooting to dashboard", "Cxbx-Reloaded", 0); @@ -988,8 +988,8 @@ DWORD WINAPI XTL::EmuXLaunchNewImage // Convert Xbox XBE Path to Windows Path char szXbePath[MAX_PATH]; - EmuNtSymbolicLinkObject* symbolicLink = FindNtSymbolicLinkObjectByVolumeLetter(lpTitlePath[0]); - snprintf(szXbePath, MAX_PATH, "%s%s", symbolicLink->NativePath.c_str(), &lpTitlePath[2]); + EmuNtSymbolicLinkObject* symbolicLink = FindNtSymbolicLinkObjectByDriveLetter(lpTitlePath[0]); + snprintf(szXbePath, MAX_PATH, "%s%s", symbolicLink->HostSymbolicLinkPath.c_str(), &lpTitlePath[2]); // Determine Working Directory char szWorkingDirectoy[MAX_PATH]; diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl index 0fa35365d..da20694f8 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.3925.inl @@ -2753,7 +2753,11 @@ OOVPA_END; // ****************************************************************** // * This is for the real D3D::KickOffAndWaitForIdle // ****************************************************************** -OOVPA_XREF(D3D_KickOffAndWaitForIdle_1_0_3925, 5, XREF_D3D_KickOffAndWaitForIdle, XRefZero) +OOVPA_XREF(D3D_KickOffAndWaitForIdle_1_0_3925, 5, + + XREF_D3D_KickOffAndWaitForIdle, + XRefZero) + { 0x05, 0x8B }, { 0x06, 0x48 }, { 0x07, 0x1C }, @@ -3011,7 +3015,11 @@ OOVPA_END; // ****************************************************************** // * D3D::SetFence // ****************************************************************** -OOVPA_XREF(D3D_SetFence_1_0_3925, 11, XREF_D3D_SETFENCE, XRefZero) +OOVPA_XREF(D3D_SetFence_1_0_3925, 11, + + XREF_D3D_SETFENCE, + XRefZero) + // D3D::SetFence+0x0F : mov edi, [esi+0x1C] { 0x0F, 0x8B }, { 0x10, 0x7E }, @@ -3195,10 +3203,10 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(D3D_SetCommonDebugRegisters_1_0_3925, 10) - { 0x07, 0x8B }, - { 0x08, 0x96 }, - { 0x09, 0x44 }, - { 0x0A, 0x2B }, + { 0x07, 0x8B }, + { 0x08, 0x96 }, + { 0x09, 0x44 }, + { 0x0A, 0x2B }, { 0x31, 0x81 }, { 0x32, 0xE2 }, { 0x33, 0xFF }, @@ -3224,29 +3232,37 @@ OOVPA_END; // ****************************************************************** // * D3D::BlockOnTime // ****************************************************************** -OOVPA_XREF(D3D_BlockOnTime_1_0_3925, 9, XREF_D3D_BLOCKONTIME, XRefZero) +OOVPA_XREF(D3D_BlockOnTime_1_0_3925, 9, + + XREF_D3D_BLOCKONTIME, + XRefZero) + // D3D::BlockOnFence+0x0A : push edi - { 0x0A, 0x57 }, - // D3D::BlockOnFence+0x4E : cmp eax, 0x8000 - { 0x4E, 0x3D }, - { 0x4F, 0x00 }, - { 0x50, 0x80 }, - { 0x51, 0x00 }, - // D3D::BlockOnFence+0x6E : mov ebp, 0x40100 - { 0x6E, 0xBD }, - { 0x6F, 0x00 }, - { 0x70, 0x01 }, - { 0x71, 0x04 } + { 0x0A, 0x57 }, + // D3D::BlockOnFence+0x4E : cmp eax, 0x8000 + { 0x4E, 0x3D }, + { 0x4F, 0x00 }, + { 0x50, 0x80 }, + { 0x51, 0x00 }, + // D3D::BlockOnFence+0x6E : mov ebp, 0x40100 + { 0x6E, 0xBD }, + { 0x6F, 0x00 }, + { 0x70, 0x01 }, + { 0x71, 0x04 } OOVPA_END; // ****************************************************************** // * D3D::BlockOnResource // ****************************************************************** -OOVPA_XREF(D3D_BlockOnResource_1_0_3925, 9, XREF_D3D_BlockOnResource, XRefZero) - { 0x34, 0x8B }, // mov edx, [ecx+0x1C] - { 0x35, 0x51 }, - { 0x36, 0x1C }, - { 0x41, 0xC2 }, // retn 4 +OOVPA_XREF(D3D_BlockOnResource_1_0_3925, 9, + + XREF_D3D_BlockOnResource, + XRefZero) + + { 0x34, 0x8B }, // mov edx, [ecx+0x1C] + { 0x35, 0x51 }, + { 0x36, 0x1C }, + { 0x41, 0xC2 }, // retn 4 { 0x42, 0x04 }, { 0x43, 0x00 }, { 0x7E, 0xC2 }, // retn 4 diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4034.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4034.inl index 85fdf9292..02e67b892 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4034.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4034.inl @@ -135,7 +135,11 @@ OOVPA_END; // ****************************************************************** // * IDirect3DDevice8_SetRenderState_CullMode // ****************************************************************** -OOVPA_XREF(IDirect3DDevice8_SetRenderState_CullMode_1_0_4034, 14, XREF_DXSRSCULLMODE, XRefZero) +OOVPA_XREF(IDirect3DDevice8_SetRenderState_CullMode_1_0_4034, 14, + + XREF_DXSRSCULLMODE, + XRefZero) + // IDirect3DDevice8_SetRenderState_CullMode+0x00 : push esi { 0x00, 0x56 }, // (Offset,Value)-Pair #1 diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl index 84c9d5534..640f9e09f 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4134.inl @@ -1460,7 +1460,11 @@ OOVPA_END; // ****************************************************************** // * IDirect3DDevice8_SetRenderState_CullModeB // ****************************************************************** -OOVPA_XREF(IDirect3DDevice8_SetRenderState_CullModeB_1_0_4134, 13, XREF_DXSRSCULLMODE, XRefZero) +OOVPA_XREF(IDirect3DDevice8_SetRenderState_CullModeB_1_0_4134, 13, + + XREF_DXSRSCULLMODE, + XRefZero) + // IDirect3DDevice8_SetRenderState_CullModeB+0x22 : mov dword ptr [eax], 0x40308 { 0x22, 0xC7 }, // (Offset,Value)-Pair #1 { 0x24, 0x08 }, // (Offset,Value)-Pair #2 @@ -1501,31 +1505,35 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(IDirect3DDevice8_SetScreenSpaceOffset_1_0_4134, 7) - { 0x06, 0x56 }, - { 0x07, 0xD8 }, - { 0x08, 0x44 }, - { 0x09, 0x24 }, - { 0x0A, 0x08 }, - { 0x2E, 0x8B }, - { 0x2F, 0x06 }, + { 0x06, 0x56 }, + { 0x07, 0xD8 }, + { 0x08, 0x44 }, + { 0x09, 0x24 }, + { 0x0A, 0x08 }, + { 0x2E, 0x8B }, + { 0x2F, 0x06 }, OOVPA_END; // ****************************************************************** // * D3D::SetFence // ****************************************************************** -OOVPA_XREF(D3D_SetFence_1_0_4134, 12, XREF_D3D_SETFENCE, XRefZero) - { 0x0D, 0x72 }, - { 0x0E, 0x0E }, - { 0x31, 0xBA }, - { 0x32, 0x90 }, - { 0x33, 0x1D }, - { 0x34, 0x04 }, - { 0x35, 0x00 }, - { 0x45, 0x83 }, - { 0x46, 0xE1 }, - { 0x47, 0x3F }, +OOVPA_XREF(D3D_SetFence_1_0_4134, 12, + + XREF_D3D_SETFENCE, + XRefZero) + + { 0x0D, 0x72 }, + { 0x0E, 0x0E }, + { 0x31, 0xBA }, + { 0x32, 0x90 }, + { 0x33, 0x1D }, + { 0x34, 0x04 }, + { 0x35, 0x00 }, + { 0x45, 0x83 }, + { 0x46, 0xE1 }, + { 0x47, 0x3F }, { 0xAA, 0xC2 }, - { 0xAB, 0x04 }, + { 0xAB, 0x04 }, OOVPA_END; // ****************************************************************** @@ -1662,22 +1670,22 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(D3D_CDevice_KickOff_1_0_4134, 12) - // D3D::CDevice::KickOff+0x0D : test al, 4 - { 0x0D, 0xA8 }, - { 0x0E, 0x04 }, - // D3D::CDevice::KickOff+0x11 : mov ecx, [ecx+0x35C] - { 0x11, 0x8B }, - { 0x12, 0x89 }, - { 0x13, 0x5C }, - { 0x14, 0x03 }, - { 0x15, 0x00 }, - { 0x16, 0x00 }, - // D3D::CDevice::KickOff+0x26 : sfence - { 0x26, 0x0F }, - { 0x27, 0xAE }, - { 0x28, 0xF8 }, - // D3D::CDevice::KickOff+0xE3 : retn - { 0xE3, 0xC3 } + // D3D::CDevice::KickOff+0x0D : test al, 4 + { 0x0D, 0xA8 }, + { 0x0E, 0x04 }, + // D3D::CDevice::KickOff+0x11 : mov ecx, [ecx+0x35C] + { 0x11, 0x8B }, + { 0x12, 0x89 }, + { 0x13, 0x5C }, + { 0x14, 0x03 }, + { 0x15, 0x00 }, + { 0x16, 0x00 }, + // D3D::CDevice::KickOff+0x26 : sfence + { 0x26, 0x0F }, + { 0x27, 0xAE }, + { 0x28, 0xF8 }, + // D3D::CDevice::KickOff+0xE3 : retn + { 0xE3, 0xC3 } OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl index 649d47eb5..4af04eeac 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4361.inl @@ -80,12 +80,12 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(IDirect3DDevice8_SetVerticalBlankCallback_1_0_4361, 6) - { 0x01, 0x44 }, - { 0x03, 0x04 }, - { 0x05, 0x0D }, - { 0x0C, 0x30 }, - { 0x0D, 0x24 }, - { 0x11, 0x04 }, + { 0x01, 0x44 }, + { 0x03, 0x04 }, + { 0x05, 0x0D }, + { 0x0C, 0x30 }, + { 0x0D, 0x24 }, + { 0x11, 0x04 }, OOVPA_END; // ****************************************************************** @@ -213,7 +213,11 @@ OOVPA_END; // ****************************************************************** // * IDirect3D_ClearStateBlockFlags // ****************************************************************** -OOVPA_XREF(IDirect3D_ClearStateBlockFlags_1_0_4361, 9, XREF_CLEARSTATEBLOCKFLAGS, XRefZero) +OOVPA_XREF(IDirect3D_ClearStateBlockFlags_1_0_4361, 9, + + XREF_CLEARSTATEBLOCKFLAGS, + XRefZero) + // IDirect3D_ClearStateBlockFlags+0x0A : movzx ecx, 0x82 { 0x0A, 0xB9 }, // (Offset,Value)-Pair #1 { 0x0B, 0x82 }, // (Offset,Value)-Pair #2 @@ -233,7 +237,11 @@ OOVPA_END; // ****************************************************************** // * IDirect3D_RecordStateBlock // ****************************************************************** -OOVPA_XREF(IDirect3D_RecordStateBlock_1_0_4361, 10, XREF_RECORDSTATEBLOCK, XRefZero) +OOVPA_XREF(IDirect3D_RecordStateBlock_1_0_4361, 10, + + XREF_RECORDSTATEBLOCK, + XRefZero) + // IDirect3D_RecordStateBlock+0x0F : mov eax, [edi+0x0390] { 0x0F, 0x8B }, // (Offset,Value)-Pair #1 { 0x10, 0x87 }, // (Offset,Value)-Pair #2 @@ -317,13 +325,13 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(D3DDevice_DeleteStateBlock_1_0_4361, 7) - { 0x11, 0x76 }, - { 0x24, 0x3B }, - { 0x37, 0xE8 }, - { 0x4A, 0x50 }, - { 0x5D, 0x74 }, - { 0x70, 0x06 }, - { 0x83, 0xEB }, + { 0x11, 0x76 }, + { 0x24, 0x3B }, + { 0x37, 0xE8 }, + { 0x4A, 0x50 }, + { 0x5D, 0x74 }, + { 0x70, 0x06 }, + { 0x83, 0xEB }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl index 631aac223..7056e7d97 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl @@ -437,14 +437,14 @@ OOVPA_END; OOVPA_NO_XREF(IDirect3DDevice8_BackFillMode_1_0_4531, 9) { 0x04, 0x56 }, - { 0x10, 0x8B }, - { 0x11, 0x06 }, - { 0x12, 0x3B }, - { 0x13, 0x46 }, - { 0x14, 0x04 }, - { 0x41, 0x83 }, - { 0x42, 0xC0 }, - { 0x43, 0x0C }, + { 0x10, 0x8B }, + { 0x11, 0x06 }, + { 0x12, 0x3B }, + { 0x13, 0x46 }, + { 0x14, 0x04 }, + { 0x41, 0x83 }, + { 0x42, 0xC0 }, + { 0x43, 0x0C }, OOVPA_END; // ****************************************************************** @@ -495,17 +495,17 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(IDirect3DDevice8_Release_1_0_4432, 11) - { 0x07, 0x8B }, - { 0x08, 0x87 }, - { 0x09, 0x40 }, - { 0x0A, 0x04 }, - { 0x0B, 0x00 }, - { 0x0C, 0x00 }, - { 0x1B, 0xB9 }, - { 0x1C, 0xC0 }, - { 0x1D, 0x0A }, - { 0x1E, 0x00 }, - { 0x1F, 0x00 } + { 0x07, 0x8B }, + { 0x08, 0x87 }, + { 0x09, 0x40 }, + { 0x0A, 0x04 }, + { 0x0B, 0x00 }, + { 0x0C, 0x00 }, + { 0x1B, 0xB9 }, + { 0x1C, 0xC0 }, + { 0x1D, 0x0A }, + { 0x1E, 0x00 }, + { 0x1F, 0x00 }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5233.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5233.inl index ba32ba637..e435a5cfa 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5233.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5233.inl @@ -1213,18 +1213,18 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(IDirect3DDevice8_Unknown1_1_0_5233, 9) - // IDirect3DDevice8_Unknown1+0x00 : xor eax, eax - { 0x00, 0x33 }, - { 0x01, 0xC0 }, - // IDirect3DDevice8_Unknown1+0x13 : call ds:AvSendTVEncoderOption - { 0x13, 0xFF }, - { 0x14, 0x15 }, - { 0x15, 0x08 }, - { 0x16, 0x94 }, - { 0x17, 0x19 }, - { 0x18, 0x00 }, - // IDirect3DDevice8_Unknown1+0x1E : retn - { 0x1E, 0xC3 }, + // IDirect3DDevice8_Unknown1+0x00 : xor eax, eax + { 0x00, 0x33 }, + { 0x01, 0xC0 }, + // IDirect3DDevice8_Unknown1+0x13 : call ds:AvSendTVEncoderOption + { 0x13, 0xFF }, + { 0x14, 0x15 }, + { 0x15, 0x08 }, + { 0x16, 0x94 }, + { 0x17, 0x19 }, + { 0x18, 0x00 }, + // IDirect3DDevice8_Unknown1+0x1E : retn + { 0x1E, 0xC3 }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5558.inl index d0d8444c8..f40cad29d 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5558.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5558.inl @@ -129,7 +129,8 @@ OOVPA_END; OOVPA_NO_XREF(IDirect3DDevice8_SetVertexShaderConstant1_1_0_5558, 11) // IDirect3DDevice8_SetVertexShaderConstant1+0x05 : add eax, 0x1C - /*{ 0x05, 0x83 }, // (Offset,Value)-Pair #1 + /* + { 0x05, 0x83 }, // (Offset,Value)-Pair #1 { 0x06, 0xC0 }, // (Offset,Value)-Pair #2 { 0x07, 0x1C }, // (Offset,Value)-Pair #3 @@ -148,22 +149,22 @@ OOVPA_NO_XREF(IDirect3DDevice8_SetVertexShaderConstant1_1_0_5558, 11) // IDirect3DDevice8_SetVertexShaderConstant1+0x47 : jmp +0xB7 { 0x47, 0xEB }, // (Offset,Value)-Pair #10 { 0x48, 0xB7 }, // (Offset,Value)-Pair #11 - */ + */ - // IDirect3DDevice8_SetVertexShaderConstant1+0x06 : add eax, 0x1C + // IDirect3DDevice8_SetVertexShaderConstant1+0x06 : add eax, 0x1C { 0x06, 0x83 }, // (Offset,Value)-Pair #1 { 0x07, 0xC0 }, // (Offset,Value)-Pair #2 { 0x08, 0x1C }, // (Offset,Value)-Pair #3 - { 0x16, 0xC7 }, - { 0x17, 0x40 }, - { 0x18, 0xE4 }, - { 0x19, 0xA4 }, - { 0x1A, 0x1E }, - { 0x1B, 0x04 }, - { 0x1C, 0x00 }, + { 0x16, 0xC7 }, + { 0x17, 0x40 }, + { 0x18, 0xE4 }, + { 0x19, 0xA4 }, + { 0x1A, 0x1E }, + { 0x1B, 0x04 }, + { 0x1C, 0x00 }, - // IDirect3DDevice8_SetVertexShaderConstant1+0x53 : retn + // IDirect3DDevice8_SetVertexShaderConstant1+0x53 : retn { 0x53, 0xC3 }, // (Offset,Value)-Pair #9 OOVPA_END; @@ -994,21 +995,21 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(D3D_MakeRequestedSpace_1_0_5558, 12) - // D3D::MakeRequestedSpace+0x08: test byte ptr [esi+8], 4 - { 0x08, 0xF6 }, - { 0x09, 0x46 }, - { 0x0A, 0x08 }, - { 0x0B, 0x04 }, - // D3D::MakeRequestedSpace+0x32: retn 8 - { 0x32, 0xC2 }, - { 0x33, 0x08 }, - // D3D::MakeRequestedSpace+0x57: add ebp, 0x4000 - { 0x57, 0x81 }, - { 0x58, 0xC5 }, - { 0x59, 0x00 }, - { 0x5A, 0x40 }, - { 0x5B, 0x00 }, - { 0x5C, 0x00 }, + // D3D::MakeRequestedSpace+0x08: test byte ptr [esi+8], 4 + { 0x08, 0xF6 }, + { 0x09, 0x46 }, + { 0x0A, 0x08 }, + { 0x0B, 0x04 }, + // D3D::MakeRequestedSpace+0x32: retn 8 + { 0x32, 0xC2 }, + { 0x33, 0x08 }, + // D3D::MakeRequestedSpace+0x57: add ebp, 0x4000 + { 0x57, 0x81 }, + { 0x58, 0xC5 }, + { 0x59, 0x00 }, + { 0x5A, 0x40 }, + { 0x5B, 0x00 }, + { 0x5C, 0x00 }, OOVPA_END; // ****************************************************************** @@ -1051,7 +1052,7 @@ OOVPA_NO_XREF(D3DTexture_LockRect_1_0_5558, 8) { 0x0D, 0x8B }, { 0x12, 0x8B }, { 0x17, 0x50 }, - { 0x1B, 0xE8 }, + { 0x1B, 0xE8 }, { 0x20, 0xC2 }, { 0x21, 0x14 }, OOVPA_END; diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl index 376ce28fc..5d756bbe7 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5849.inl @@ -672,18 +672,18 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(D3DDevice_SetTileNoWait_1_0_5849, 10) - // D3DDevice_SetTileNoWait+0x00: sub esp, 0x1C - { 0x00, 0x83 }, - { 0x01, 0xEC }, - { 0x02, 0x1C }, - // D3DDevice_SetTileNoWait+0x45: lea ebx, [ebx+ebp*8+0x1AC0] - { 0x45, 0x8D }, - { 0x46, 0x9C }, - { 0x47, 0xEB }, - { 0x48, 0xC0 }, - { 0x49, 0x1A }, - { 0x4A, 0x00 }, - { 0x4B, 0x00 }, + // D3DDevice_SetTileNoWait+0x00: sub esp, 0x1C + { 0x00, 0x83 }, + { 0x01, 0xEC }, + { 0x02, 0x1C }, + // D3DDevice_SetTileNoWait+0x45: lea ebx, [ebx+ebp*8+0x1AC0] + { 0x45, 0x8D }, + { 0x46, 0x9C }, + { 0x47, 0xEB }, + { 0x48, 0xC0 }, + { 0x49, 0x1A }, + { 0x4A, 0x00 }, + { 0x4B, 0x00 }, OOVPA_END; // ****************************************************************** @@ -1031,26 +1031,26 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(D3D_CDevice_KickOff_1_0_5849, 13) - // D3D::CDevice::KickOff+0x0A : mov edx, [ecx+0x35C] - { 0x0A, 0x8B }, - { 0x0B, 0x96 }, - { 0x0C, 0x70 }, - { 0x0D, 0x07 }, - { 0x0E, 0x00 }, - { 0x0F, 0x00 }, + // D3D::CDevice::KickOff+0x0A : mov edx, [ecx+0x35C] + { 0x0A, 0x8B }, + { 0x0B, 0x96 }, + { 0x0C, 0x70 }, + { 0x0D, 0x07 }, + { 0x0E, 0x00 }, + { 0x0F, 0x00 }, - // D3D::CDevice::KickOff+0x14 : test ch, 0x20 - { 0x14, 0xF6 }, - { 0x15, 0xC4 }, - { 0x16, 0x20 }, + // D3D::CDevice::KickOff+0x14 : test ch, 0x20 + { 0x14, 0xF6 }, + { 0x15, 0xC4 }, + { 0x16, 0x20 }, - // D3D::CDevice::KickOff+0x24 : sfence - { 0x24, 0x0F }, - { 0x25, 0xAE }, - { 0x26, 0xF8 }, + // D3D::CDevice::KickOff+0x24 : sfence + { 0x24, 0x0F }, + { 0x25, 0xAE }, + { 0x26, 0xF8 }, - // D3D::CDevice::KickOff+0xAF : retn - { 0xAF, 0xC3 } + // D3D::CDevice::KickOff+0xAF : retn + { 0xAF, 0xC3 } OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl index 5c1089313..d6d99ed79 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.3936.inl @@ -1088,11 +1088,11 @@ OOVPA_XREF(IDirectSoundBuffer8_Play_1_0_3936, 16, { 0x02, 0x24 }, // (Offset,Value)-Pair #3 { 0x03, 0x10 }, // (Offset,Value)-Pair #4 - // IDirectSoundBuffer8_Play+0x04 : mov eax, [esp+4+arg_0] - { 0x04, 0x8B }, // (Offset,Value)-Pair #5 - { 0x05, 0x44 }, // (Offset,Value)-Pair #6 - { 0x06, 0x24 }, // (Offset,Value)-Pair #7 - { 0x07, 0x08 }, // (Offset,Value)-Pair #8 + // IDirectSoundBuffer8_Play+0x04 : mov eax, [esp+4+arg_0] + { 0x04, 0x8B }, // (Offset,Value)-Pair #5 + { 0x05, 0x44 }, // (Offset,Value)-Pair #6 + { 0x06, 0x24 }, // (Offset,Value)-Pair #7 + { 0x07, 0x08 }, // (Offset,Value)-Pair #8 // IDirectSoundBuffer8_Play+0x12 : and eax, [0xFFFFFFE4] { 0x12, 0x83 }, // (Offset,Value)-Pair #9 @@ -3706,24 +3706,24 @@ OOVPA_END; // ****************************************************************** // * CMcpxVoiceClient::Commit3dSettings // ****************************************************************** -OOVPA_XREF(CMcpxVoiceClient_Commit3dSettings_1_0_3936, 10, // Small == 10 +OOVPA_XREF(CMcpxVoiceClient_Commit3dSettings_1_0_3936, 10, - XREF_CMcpxVoiceClient_Commit3dSettings, - XRefZero) + XREF_CMcpxVoiceClient_Commit3dSettings, + XRefZero) - // CMcpxVoiceClient::Commit3dSettings+0x17 : or [eax+0x80], ecx - { 0x17, 0x09 }, - { 0x18, 0x88 }, - { 0x19, 0x80 }, - { 0x1A, 0x00 }, - // CMcpxVoiceClient::Commit3dSettings+0x2B : add eax, 0x80 - { 0x2B, 0x05 }, - { 0x2C, 0x80 }, - { 0x2D, 0x00 }, - // CMcpxVoiceClient::Commit3dSettings+0x3D : cmpxchg [ecx], edx - { 0x3D, 0x0F }, - { 0x3E, 0xB1 }, - { 0x3F, 0x11 }, + // CMcpxVoiceClient::Commit3dSettings+0x17 : or [eax+0x80], ecx + { 0x17, 0x09 }, + { 0x18, 0x88 }, + { 0x19, 0x80 }, + { 0x1A, 0x00 }, + // CMcpxVoiceClient::Commit3dSettings+0x2B : add eax, 0x80 + { 0x2B, 0x05 }, + { 0x2C, 0x80 }, + { 0x2D, 0x00 }, + // CMcpxVoiceClient::Commit3dSettings+0x3D : cmpxchg [ecx], edx + { 0x3D, 0x0F }, + { 0x3E, 0xB1 }, + { 0x3F, 0x11 }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4361.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4361.inl index a46e142b0..4d00ccec5 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4361.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4361.inl @@ -733,25 +733,25 @@ OOVPA_END; // ****************************************************************** // * CMcpxBuffer::Stop2 // ****************************************************************** -OOVPA_XREF(CMcpxBuffer_Stop2_1_0_4361, 10, +OOVPA_XREF(CMcpxBuffer_Stop2_1_0_4361, 10, - XREF_CMcpxBuffer_Stop2, - XRefZero) + XREF_CMcpxBuffer_Stop2, + XRefZero) - // CMcpxBuffer_Stop2+0x03 : mov eax, [ebp+arg_0] - { 0x03, 0x8B }, - { 0x04, 0x45 }, - { 0x05, 0x08 }, - // CMcpxBuffer_Stop2+0x14 : mov eax, [esi] - { 0x14, 0x8B }, - { 0x15, 0x06 }, - // CMcpxBuffer_Stop2+0x25 : push [ebp+arg_8] - { 0x25, 0xFF }, - { 0x26, 0x75 }, - { 0x27, 0x10 }, - // CMcpxBuffer_Stop2+0x36 : retn 0xC - { 0x36, 0xC2 }, - { 0x37, 0x0C }, + // CMcpxBuffer_Stop2+0x03 : mov eax, [ebp+arg_0] + { 0x03, 0x8B }, + { 0x04, 0x45 }, + { 0x05, 0x08 }, + // CMcpxBuffer_Stop2+0x14 : mov eax, [esi] + { 0x14, 0x8B }, + { 0x15, 0x06 }, + // CMcpxBuffer_Stop2+0x25 : push [ebp+arg_8] + { 0x25, 0xFF }, + { 0x26, 0x75 }, + { 0x27, 0x10 }, + // CMcpxBuffer_Stop2+0x36 : retn 0xC + { 0x36, 0xC2 }, + { 0x37, 0x0C }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl index ffd7bb5bc..be53c0fc5 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl @@ -2023,13 +2023,13 @@ OOVPATable DSound_1_0_5558[] = { // IDirectSoundBuffer_SetMinDistance OOVPA_TABLE_PATCH(IDirectSoundBuffer_SetMinDistance_1_0_5558, XTL::EmuIDirectSoundBuffer8_SetMinDistance), // CDirectSoundVoice::SetRolloffFactor (XREF) (* unchanged since 4627 *) - /*{ THESE ARE NOT CORRECT + /* THESE ARE NOT CORRECT OOVPA_TABLE_XREF(CDirectSoundVoice_SetRolloffFactor_1_0_4627), // CDirectSoundBuffer::SetRolloffFactor (XREF) (* unchanged since 4627 *) OOVPA_TABLE_XREF(CDirectSoundBuffer_SetRolloffFactor_1_0_4627), // IDirectSoundBuffer_SetRolloffFactor (* unchanged since 4627 *) OOVPA_TABLE_PATCH(IDirectSoundBuffer_SetRolloffFactor_1_0_4627, XTL::EmuIDirectSoundBuffer8_SetRolloffFactor), - }*/ + */ // CDirectSoundVoice::SetDopplerFactor (XREF) OOVPA_TABLE_XREF(CDirectSoundVoice_SetDopplerFactor_1_0_5558), // CDirectSoundBuffer::SetDopplerFactor (XREF) @@ -2140,7 +2140,7 @@ OOVPATable DSound_1_0_5558[] = { // CDirectSoundVoice::CommitDeferredSettings (XREF) OOVPA_TABLE_XREF(CDirectSoundVoice_CommitDeferredSettings_1_0_5558), // CDirectSoundVoice::SetAllParameters (XREF) - /*{ + /* OOVPA_TABLE_XREF(CDirectSoundVoice_SetAllParameters_1_0_5558), // CDirectSoundBuffer::SetAllParameters (XREF) OOVPA_TABLE_XREF(CDirectSoundBuffer_SetAllParameters_1_0_5558), diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl index 74796d57a..35eadf7d3 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl @@ -233,13 +233,13 @@ OOVPA_XREF(DirectSound_CMcpxBuffer_Play2_1_0_5849, 7, XREF_DirectSound_CMcpxBuffer_Play2, XRefZero) - { 0x17, 0x43 }, - { 0x2D, 0xF6 }, - { 0x2E, 0xC3 }, - { 0x2F, 0x04 }, + { 0x17, 0x43 }, + { 0x2D, 0xF6 }, + { 0x2E, 0xC3 }, + { 0x2F, 0x04 }, { 0xAD, 0xC2 }, - { 0xAE, 0x04 }, - { 0xAF, 0x00 }, + { 0xAE, 0x04 }, + { 0xAF, 0x00 }, OOVPA_END; // ****************************************************************** @@ -1532,16 +1532,16 @@ OOVPA_END; // ****************************************************************** OOVPA_NO_XREF(DirectSound_CMemoryManager_PoolAlloc_1_0_5849, 10) - { 0x24, 0x83 }, - { 0x25, 0x7C }, - { 0x26, 0x24 }, - { 0x27, 0x10 }, - { 0x28, 0x00 }, - { 0x37, 0xF3 }, - { 0x38, 0xAB }, - { 0x44, 0xC2 }, - { 0x45, 0x0C }, - { 0x46, 0x00 }, + { 0x24, 0x83 }, + { 0x25, 0x7C }, + { 0x26, 0x24 }, + { 0x27, 0x10 }, + { 0x28, 0x00 }, + { 0x37, 0xF3 }, + { 0x38, 0xAB }, + { 0x44, 0xC2 }, + { 0x45, 0x0C }, + { 0x46, 0x00 }, OOVPA_END; // ****************************************************************** @@ -1577,9 +1577,9 @@ OOVPA_XREF(DirectSound_CDirectSoundStream_SetPitch_1_0_5849, 12, { 0x35, 0xE8 }, { 0x40, 0x68 }, { 0x4B, 0x8B }, - { 0x4F, 0xC2 }, - { 0x50, 0x08 }, - { 0x51, 0x00 }, + { 0x4F, 0xC2 }, + { 0x50, 0x08 }, + { 0x51, 0x00 }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/XNet.1.0.3911.inl b/src/CxbxKrnl/HLEDataBase/XNet.1.0.3911.inl index 8a71be728..7d9296637 100644 --- a/src/CxbxKrnl/HLEDataBase/XNet.1.0.3911.inl +++ b/src/CxbxKrnl/HLEDataBase/XNet.1.0.3911.inl @@ -87,7 +87,11 @@ OOVPA_END; // ****************************************************************** // * XnInit // ****************************************************************** -OOVPA_XREF(XnInit_1_0_3911, 11, XREF_XNINIT, XRefZero) +OOVPA_XREF(XnInit_1_0_3911, 11, + + XREF_XNINIT, + XRefZero) + // XnInit+0x31 : push 0x3554454E { 0x31, 0x68 }, // (Offset,Value)-Pair #1 { 0x32, 0x4E }, // (Offset,Value)-Pair #2 diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4361.inl b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4361.inl index 3d54cb40f..ea81b4dba 100644 --- a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4361.inl +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4361.inl @@ -88,7 +88,10 @@ OOVPA_END; // ****************************************************************** // * XnInit // ****************************************************************** -OOVPA_XREF(XnInit_1_0_4361, 10, XREF_XNINIT, XRefZero) +OOVPA_XREF(XnInit_1_0_4361, 10, + + XREF_XNINIT, + XRefZero) // XnInit+0x03 : sub esp, 0x0214 { 0x03, 0x81 }, // (Offset,Value)-Pair #1 diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4627.inl index 423f7dfcf..5118f2fc1 100644 --- a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.4627.inl @@ -35,7 +35,11 @@ // ****************************************************************** // * XnInit // ****************************************************************** -OOVPA_XREF(XnInit_1_0_4627, 12, XREF_XNINIT, XRefZero) +OOVPA_XREF(XnInit_1_0_4627, 12, + + XREF_XNINIT, + XRefZero) + // XnInit+0x03 : sub esp, 0x0218 { 0x03, 0x81 }, // (Offset,Value)-Pair #1 { 0x04, 0xEC }, // (Offset,Value)-Pair #2 @@ -50,9 +54,9 @@ OOVPA_XREF(XnInit_1_0_4627, 12, XREF_XNINIT, XRefZero) // XnInit+0x3C : push 0x4454454E { 0x3C, 0x68 }, // (Offset,Value)-Pair #8 { 0x3D, 0x4E }, // (Offset,Value)-Pair #9 - { 0x3E, 0x45 }, // (Offset,Value)-Pair #10 - { 0x3F, 0x54 }, // (Offset,Value)-Pair #11 - { 0x40, 0x44 }, // (Offset,Value)-Pair #12 + { 0x3E, 0x45 }, // (Offset,Value)-Pair #10 + { 0x3F, 0x54 }, // (Offset,Value)-Pair #11 + { 0x40, 0x44 }, // (Offset,Value)-Pair #12 OOVPA_END; // ****************************************************************** @@ -73,7 +77,11 @@ OOVPA_END; // ****************************************************************** // * XoUpdateLaunchNewImageInternal // ****************************************************************** -OOVPA_XREF(XoUpdateLaunchNewImageInternal_1_0_4627, 8, XREF_XoUpdateLaunchNewImageInternal, XRefZero) +OOVPA_XREF(XoUpdateLaunchNewImageInternal_1_0_4627, 8, + + XREF_XoUpdateLaunchNewImageInternal, + XRefZero) + { 0x1E, 0xDB }, { 0x3E, 0x1B }, { 0x5E, 0xF6 }, diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5233.inl b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5233.inl index 2d044dc78..81d20aef5 100644 --- a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5233.inl +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5233.inl @@ -65,7 +65,11 @@ OOVPA_END; // ****************************************************************** // * CXo::XOnlineLogon // ****************************************************************** -OOVPA_XREF(CXo_XOnlineLogon_1_0_5344, 8, XREF_CXo_XOnlineLogon, XRefZero) +OOVPA_XREF(CXo_XOnlineLogon_1_0_5344, 8, + + XREF_CXo_XOnlineLogon, + XRefZero) + { 0x21, 0xA8 }, { 0x3E, 0x80 }, { 0x5E, 0x00 }, diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl index 5b30c3cad..fd5100b27 100644 --- a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5558.inl @@ -66,7 +66,11 @@ OOVPA_END; // ****************************************************************** // * CXo::XOnlineLogon // ****************************************************************** -OOVPA_XREF(CXo_XOnlineLogon_1_0_5344, 8, XREF_CXo_XOnlineLogon, XRefZero) +OOVPA_XREF(CXo_XOnlineLogon_1_0_5344, 8, + + XREF_CXo_XOnlineLogon, + XRefZero) + { 0x21, 0xA8 }, { 0x3E, 0x80 }, { 0x5E, 0x00 }, diff --git a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5849.inl b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5849.inl index 5c9b9d7ba..e6c8f4fb5 100644 --- a/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5849.inl +++ b/src/CxbxKrnl/HLEDataBase/XOnline.1.0.5849.inl @@ -35,7 +35,11 @@ // ****************************************************************** // * XnInit // ****************************************************************** -OOVPA_XREF(XnInit_1_0_5849, 8, XREF_XNINIT, XRefZero) +OOVPA_XREF(XnInit_1_0_5849, 8, + + XREF_XNINIT, + XRefZero) + { 0x1E, 0x3B }, { 0x3E, 0x45 }, { 0x5E, 0x00 }, diff --git a/src/CxbxKrnl/HLEDataBase/XactEng.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/XactEng.1.0.4627.inl index d436d22af..c18c72005 100644 --- a/src/CxbxKrnl/HLEDataBase/XactEng.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/XactEng.1.0.4627.inl @@ -475,6 +475,7 @@ OOVPA_XREF(XACT_CEngine_GetNotification_1_0_4627, 8, XREF_XACT_CEngine_GetNotification, XRefZero) + { 0x11, 0x8D }, { 0x24, 0x5A }, { 0x37, 0xC0 }, @@ -508,7 +509,11 @@ OOVPA_END; // ****************************************************************** // * XACT::CEngine::UnRegisterWaveBank // ****************************************************************** -OOVPA_XREF(XACT_CEngine_UnRegisterWaveBank_1_0_4627, 8, XREF_XACT_CEngine_UnRegisterWaveBank, XRefZero) +OOVPA_XREF(XACT_CEngine_UnRegisterWaveBank_1_0_4627, 8, + + XREF_XACT_CEngine_UnRegisterWaveBank, + XRefZero) + { 0x07, 0x8B }, { 0x10, 0x58 }, { 0x19, 0x8B }, @@ -522,18 +527,22 @@ OOVPA_END; // ****************************************************************** // * XACT::CEngine::UnRegisterWaveBank // ****************************************************************** -OOVPA_XREF(XACT_CEngine_UnRegisterWaveBank_1_0_4928, 8, XREF_XACT_CEngine_UnRegisterWaveBank, XRefZero) - // XACT_CEngine_UnRegisterWaveBank+0x06 : lea eax, [ecx+0x58] - { 0x06, 0x8D }, - { 0x07, 0x41 }, - { 0x08, 0x58 }, - // XACT_CEngine_UnRegisterWaveBank+0x28 : lea edi, [ebx+0x4C] - { 0x28, 0x8D }, - { 0x29, 0x7B }, - { 0x2A, 0x4C }, - // XACT_CEngine_UnRegisterWaveBank+0xBF : retn 0x8 - { 0xBF, 0xC2 }, - { 0xC0, 0x08 }, +OOVPA_XREF(XACT_CEngine_UnRegisterWaveBank_1_0_4928, 8, + + XREF_XACT_CEngine_UnRegisterWaveBank, + XRefZero) + + // XACT_CEngine_UnRegisterWaveBank+0x06 : lea eax, [ecx+0x58] + { 0x06, 0x8D }, + { 0x07, 0x41 }, + { 0x08, 0x58 }, + // XACT_CEngine_UnRegisterWaveBank+0x28 : lea edi, [ebx+0x4C] + { 0x28, 0x8D }, + { 0x29, 0x7B }, + { 0x2A, 0x4C }, + // XACT_CEngine_UnRegisterWaveBank+0xBF : retn 0x8 + { 0xBF, 0xC2 }, + { 0xC0, 0x08 }, OOVPA_END; diff --git a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.3911.inl b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.3911.inl index 7e10098de..e8184305c 100644 --- a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.3911.inl +++ b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.3911.inl @@ -252,7 +252,7 @@ OOVPA_NO_XREF(CreateThread_1_0_3911, 8) // CreateThread+0x51 : retn 0x18 { 0x51, 0xC2 }, // (Offset,Value)-Pair #7 - { 0x52, 0x18 } // (Offset,Value)-Pair #8 + { 0x52, 0x18 }, // (Offset,Value)-Pair #8 OOVPA_END; // ****************************************************************** @@ -493,7 +493,11 @@ OOVPA_END; // ****************************************************************** // * XID_fCloseDevice // ****************************************************************** -OOVPA_XREF(XID_fCloseDevice_1_0_3911, 10, XREF_FCLOSEDEVICE, XRefZero) +OOVPA_XREF(XID_fCloseDevice_1_0_3911, 10, + + XREF_FCLOSEDEVICE, + XRefZero) + // XID_fCloseDevice+0x19 : jz +0x5C { 0x19, 0x74 }, // (Offset,Value)-Pair #1 { 0x1A, 0x5C }, // (Offset,Value)-Pair #2 diff --git a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4034.inl b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4034.inl index 3efe90ce2..5e0d1a8fd 100644 --- a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4034.inl +++ b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4034.inl @@ -109,7 +109,7 @@ OOVPA_NO_XREF(CreateThread_1_0_4361, 8) // CreateThread+0x6B : retn 0x18 { 0x6B, 0xC2 }, // (Offset,Value)-Pair #7 - { 0x6C, 0x18 } // (Offset,Value)-Pair #8 + { 0x6C, 0x18 }, // (Offset,Value)-Pair #8 OOVPA_END; // ****************************************************************** @@ -133,7 +133,7 @@ OOVPA_NO_XREF(CloseHandle_1_0_4361, 10) // CloseHandle+0x1B : retn 4 { 0x1B, 0xC2 }, // (Offset,Value)-Pair #9 - { 0x1C, 0x04 } // (Offset,Value)-Pair #10 + { 0x1C, 0x04 }, // (Offset,Value)-Pair #10 OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl index f63bd437d..d267339aa 100644 --- a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl +++ b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4361.inl @@ -154,7 +154,11 @@ OOVPA_END; // ****************************************************************** // * XID_fCloseDevice // ****************************************************************** -OOVPA_XREF(XID_fCloseDevice_1_0_4361, 11, XREF_FCLOSEDEVICE, XRefZero) +OOVPA_XREF(XID_fCloseDevice_1_0_4361, 11, + + XREF_FCLOSEDEVICE, + XRefZero) + // XID_fCloseDevice+0x1B : mov eax, [esi+0x00A3] { 0x1B, 0x8B }, // (Offset,Value)-Pair #1 { 0x1C, 0x86 }, // (Offset,Value)-Pair #2 @@ -306,7 +310,7 @@ OOVPA_NO_XREF(CreateThread_1_0_4361, 8) // CreateThread+0x6B : retn 0x18 { 0x6B, 0xC2 }, // (Offset,Value)-Pair #7 - { 0x6C, 0x18 } // (Offset,Value)-Pair #8 + { 0x6C, 0x18 }, // (Offset,Value)-Pair #8 OOVPA_END; // ****************************************************************** @@ -330,7 +334,7 @@ OOVPA_NO_XREF(CloseHandle_1_0_4361, 10) // CloseHandle+0x1B : retn 4 { 0x1B, 0xC2 }, // (Offset,Value)-Pair #9 - { 0x1C, 0x04 } // (Offset,Value)-Pair #10 + { 0x1C, 0x04 }, // (Offset,Value)-Pair #10 OOVPA_END; // ****************************************************************** @@ -450,8 +454,8 @@ OOVPA_END; // ****************************************************************** // * XAPI_1_0_4361 // ****************************************************************** -OOVPATable XAPI_1_0_4361[] = -{ +OOVPATable XAPI_1_0_4361[] = { + // QueryPerformanceCounter OOVPA_TABLE_PATCH(QueryPerformanceCounter_1_0_4361, XTL::EmuQueryPerformanceCounter), // QueryPerformanceFrequency diff --git a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4627.inl index 0417c2901..453d2e61b 100644 --- a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.4627.inl @@ -142,7 +142,11 @@ OOVPA_END; // ****************************************************************** // * XID_fCloseDevice // ****************************************************************** -OOVPA_XREF(XID_fCloseDevice_1_0_4627, 7, XREF_FCLOSEDEVICE, XRefZero) +OOVPA_XREF(XID_fCloseDevice_1_0_4627, 7, + + XREF_FCLOSEDEVICE, + XRefZero) + { 0x13, 0x1E }, { 0x28, 0x75 }, { 0x3D, 0x01 }, @@ -155,7 +159,11 @@ OOVPA_END; // ****************************************************************** // * XID_fCloseDevice // ****************************************************************** -OOVPA_XREF(XID_fCloseDevice_1_0_4928, 11, XREF_FCLOSEDEVICE, XRefZero) +OOVPA_XREF(XID_fCloseDevice_1_0_4928, 11, + + XREF_FCLOSEDEVICE, + XRefZero) + { 0x13, 0x8B }, // (Offset,Value)-Pair #1 { 0x14, 0x86 }, // (Offset,Value)-Pair #2 { 0x15, 0xA3 }, // (Offset,Value)-Pair #3 @@ -601,7 +609,8 @@ OOVPA_END; // ****************************************************************** // * VirtualProtect // ****************************************************************** -OOVPA_XREF(VirtualProtect_1_0_4627, 7, 0/*XREF_VirtualProtect*/, XRefZero) +OOVPA_NO_XREF(VirtualProtect_1_0_4627, 7) // XREF_VirtualProtect + { 0x04, 0x8D }, { 0x0A, 0x24 }, { 0x10, 0x10 }, diff --git a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.5558.inl index 202ef336f..9cc0429df 100644 --- a/src/CxbxKrnl/HLEDataBase/Xapi.1.0.5558.inl +++ b/src/CxbxKrnl/HLEDataBase/Xapi.1.0.5558.inl @@ -294,7 +294,11 @@ OOVPA_END; // ****************************************************************** // * XID_fCloseDevice // ****************************************************************** -OOVPA_XREF(XID_fCloseDevice_1_0_5558, 7, XREF_FCLOSEDEVICE, XRefZero) +OOVPA_XREF(XID_fCloseDevice_1_0_5558, 7, + + XREF_FCLOSEDEVICE, + XRefZero) + { 0x11, 0x45 }, { 0x24, 0xFF }, { 0x37, 0x89 },