diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-07-19 00:42:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-19 00:42:34 -0400 |
| commit | b2b2808d014fec0c8510ebbf6e91c850c7417925 (patch) | |
| tree | bcbdfd2db05523200399a523282ed07029635390 /Source | |
| parent | 48689705046a7488e605819768fe1032b0053051 (diff) | |
| parent | 43ab79ae23fbfd104890bd63dd7bdc4ff480a19c (diff) | |
Merge pull request #13812 from Dentomologist/memoryviewwidget_fix_updates_at_end_of_address_space
MemoryViewWidget: Fix updates at end of address space
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp index ef39421294..2cd85627b2 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp @@ -473,7 +473,7 @@ void MemoryViewWidget::Update() const int data_span = m_bytes_per_row / GetTypeSize(m_type); m_address_range.first = row_address; - m_address_range.second = row_address + m_table->rowCount() * m_bytes_per_row - 1; + m_address_range.second = row_address + m_table->rowCount() * m_bytes_per_row; for (int i = 0; i < m_table->rowCount(); i++, row_address += m_bytes_per_row) { @@ -611,9 +611,13 @@ void MemoryViewWidget::GetValues() // Grab memory values as QStrings Core::CPUThreadGuard guard(m_system); - for (u32 address = m_address_range.first; address <= m_address_range.second; - address += GetTypeSize(m_type)) + const u32 type_size = static_cast<u32>(GetTypeSize(m_type)); + const auto& [range_begin, range_end] = m_address_range; + const u32 address_count = (range_end - range_begin) / type_size; + + for (u32 i = 0; i < address_count; ++i) { + const u32 address = range_begin + i * type_size; m_values.insert(std::pair(address, ValueToString(guard, address, m_type))); if (m_dual_view) |
