From d6fc9026ed77dde27da8a978d554ceb1e1d45ff8 Mon Sep 17 00:00:00 2001 From: disinvite Date: Wed, 26 Jun 2024 22:33:26 -0400 Subject: [PATCH] Match format function better, add dead code function --- LEGO1/mxdirectx/mxdirectxinfo.cpp | 45 +++++++++++++++++++++++-------- LEGO1/mxdirectx/mxdirectxinfo.h | 5 ++-- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/LEGO1/mxdirectx/mxdirectxinfo.cpp b/LEGO1/mxdirectx/mxdirectxinfo.cpp index 72d442f1..dded6e04 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.cpp +++ b/LEGO1/mxdirectx/mxdirectxinfo.cpp @@ -679,21 +679,44 @@ int MxDeviceEnumerate::FormatDeviceName(char* p_buffer, const MxDriver* p_ddInfo int number = 0; assert(p_ddInfo && p_d3dInfo); - for (list::const_iterator it = m_list.begin(); it != m_list.end(); it++) { + for (list::const_iterator it = m_list.begin(); it != m_list.end(); it++, number++) { if (&(*it) == p_ddInfo) { - sprintf( - p_buffer, - "%d 0x%x 0x%x 0x%x 0x%x", - number, - ((DWORD*) (p_d3dInfo->m_guid))[0], - ((DWORD*) (p_d3dInfo->m_guid))[1], - ((DWORD*) (p_d3dInfo->m_guid))[2], - ((DWORD*) (p_d3dInfo->m_guid))[3] - ); + GUID4 guid; + memcpy(&guid, p_d3dInfo->m_guid, sizeof(GUID4)); + + sprintf(p_buffer, "%d 0x%x 0x%x 0x%x 0x%x", number, guid.m_data1, guid.m_data2, guid.m_data3, guid.m_data4); return 0; } - number++; } + + return -1; +} + +// FUNCTION: BETA10 0x1011cc65 +int MxDeviceEnumerate::BETA_1011cc65(int p_idx, char* p_buffer) +{ + if (p_idx < 0 || !IsInitialized()) { + return -1; + } + + int i = 0; + int j = 0; + + for (list::iterator it = m_list.begin(); it != m_list.end(); it++, i++) { + MxDriver& driver = *it; + for (list::iterator it2 = driver.m_devices.begin(); it2 != driver.m_devices.end(); it2++) { + + if (j == p_idx) { + GUID4 guid; + memcpy(&guid, &((Direct3DDeviceInfo&) *it2).m_guid, sizeof(GUID4)); + sprintf(p_buffer, "%d 0x%x 0x%x 0x%x 0x%x", i, guid.m_data1, guid.m_data2, guid.m_data3, guid.m_data4); + return 0; + } + + j++; + } + } + return -1; } diff --git a/LEGO1/mxdirectx/mxdirectxinfo.h b/LEGO1/mxdirectx/mxdirectxinfo.h index 36211928..1a6061dc 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.h +++ b/LEGO1/mxdirectx/mxdirectxinfo.h @@ -159,10 +159,10 @@ struct MxDriver { // TEMPLATE: BETA10 0x1011f6f0 // List::~List -// Compiler-generated copy ctor +// Compiler-generated copy ctor for MxDriver // SYNTHETIC: CONFIG 0x401990 // SYNTHETIC: LEGO1 0x1009c290 -// MxDriver::MxDriver +// ??0MxDriver@@QAE@ABU0@@Z // TEMPLATE: CONFIG 0x401b00 // TEMPLATE: LEGO1 0x1009c400 @@ -207,6 +207,7 @@ class MxDeviceEnumerate { int ProcessDeviceBytes(int p_deviceNum, GUID& p_guid); int GetDevice(int p_deviceNum, MxDriver*& p_driver, Direct3DDeviceInfo*& p_device); int FormatDeviceName(char* p_buffer, const MxDriver* p_ddInfo, const Direct3DDeviceInfo* p_d3dInfo) const; + int BETA_1011cc65(int p_idx, char* p_buffer); int FUN_1009d0d0(); int FUN_1009d210();