From dc694af672944f4a82ae51e9157d8ab2391c12a4 Mon Sep 17 00:00:00 2001 From: tinaq Date: Fri, 9 Dec 2016 14:27:27 -0500 Subject: [PATCH] Reduced size of chunk_size and removed conditions as code_size is always zero --- src/citra_qt/debugger/disassembler.cpp | 34 ++++++-------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 1ee6bbd6a..27ee7b29e 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -98,35 +98,15 @@ const BreakPoints& DisassemblerModel::GetBreakPoints() const { void DisassemblerModel::ParseFromAddress(unsigned int address) { // NOTE: A too large value causes lagging when scrolling the disassembly - const unsigned int chunk_size = 1000 * 500; + const unsigned int chunk_size = 1000 * 100; - // If we haven't loaded anything yet, initialize base address to the parameter address - if (code_size == 0) - base_address = address; + base_address = address; + + unsigned int num_rows = (base_address + chunk_size - code_size - address) / 4; - // If the new area is already loaded, just continue - if (base_address + code_size > address + chunk_size && base_address <= address) - return; - - // Insert rows before currently loaded data - if (base_address > address) { - unsigned int num_rows = (address - base_address) / 4; - - beginInsertRows(QModelIndex(), 0, num_rows); - code_size += num_rows; - base_address = address; - - endInsertRows(); - } - - // Insert rows after currently loaded data - if (base_address + code_size < address + chunk_size) { - unsigned int num_rows = (base_address + chunk_size - code_size - address) / 4; - - beginInsertRows(QModelIndex(), 0, num_rows); - code_size += num_rows; - endInsertRows(); - } + beginInsertRows(QModelIndex(), 0, num_rows); + code_size += num_rows; + endInsertRows(); SetNextInstruction(address); }