From 7ac49be6dff420bf88f55dcf2abd8ba0fc8563a5 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 30 Apr 2015 00:02:37 -0700 Subject: [PATCH] Qt: Memory view readability fixes --- src/platform/qt/MemoryModel.cpp | 4 ++-- src/platform/qt/MemoryView.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/qt/MemoryModel.cpp b/src/platform/qt/MemoryModel.cpp index fa7bd66d0..fe823de2b 100644 --- a/src/platform/qt/MemoryModel.cpp +++ b/src/platform/qt/MemoryModel.cpp @@ -49,7 +49,7 @@ MemoryModel::MemoryModel(QWidget* parent) setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - m_margins = QMargins(metrics.width("FFFFFF ") + 4, m_cellHeight + 1, metrics.width(" AAAAAAAAAAAAAAAA") + 3, 0); + m_margins = QMargins(metrics.width("0FFFFFF0 ") + 4, m_cellHeight + 1, metrics.width(" AAAAAAAAAAAAAAAA") + 3, 0); connect(verticalScrollBar(), &QSlider::sliderMoved, [this](int position) { m_top = position; @@ -93,7 +93,7 @@ void MemoryModel::paintEvent(QPaintEvent* event) { int height = (viewport()->size().height() - m_cellHeight) / m_cellHeight; for (int y = 0; y < height; ++y) { int yp = m_cellHeight * y + m_margins.top(); - QString data = QString("%0").arg(y + m_top + m_base / 16, 6, 16, c0).toUpper(); + QString data = QString("%0").arg((y + m_top) * 16 + m_base, 8, 16, c0).toUpper(); painter.drawText(QRectF(QPointF(0, yp), QSizeF(m_margins.left(), m_cellHeight)), Qt::AlignHCenter, data); for (int x = 0; x < 16; ++x) { uint8_t b = m_cpu->memory.load8(m_cpu, (y + m_top) * 16 + x + m_base, nullptr); diff --git a/src/platform/qt/MemoryView.cpp b/src/platform/qt/MemoryView.cpp index f76f30a12..62a899d7d 100644 --- a/src/platform/qt/MemoryView.cpp +++ b/src/platform/qt/MemoryView.cpp @@ -42,8 +42,8 @@ void MemoryView::setIndex(int index) { { "VRAM", BASE_VRAM, SIZE_VRAM }, { "OAM", BASE_OAM, SIZE_OAM }, { "ROM", BASE_CART0, SIZE_CART0 }, - { "ROM (WS1)", BASE_CART1, SIZE_CART1 }, - { "ROM (WS2)", BASE_CART2, SIZE_CART2 }, + { "ROM WS1", BASE_CART1, SIZE_CART1 }, + { "ROM WS2", BASE_CART2, SIZE_CART2 }, { "SRAM", BASE_CART_SRAM, SIZE_CART_SRAM }, }; const auto& info = indexInfo[index];