From: George Wright Date: Sat, 7 Dec 2024 21:11:11 +0000 (-0800) Subject: hack in a quick physical memory inspector - prepend the memory address with 'p' X-Git-Url: http://git.gwright.org.uk/?a=commitdiff_plain;h=016d0ec353f27d9ec36f31ed36aea7259397444a;p=WindEmu.git hack in a quick physical memory inspector - prepend the memory address with 'p' --- diff --git a/WindQt/mainwindow.cpp b/WindQt/mainwindow.cpp index f016f4b..f6a8023 100644 --- a/WindQt/mainwindow.cpp +++ b/WindQt/mainwindow.cpp @@ -196,12 +196,21 @@ void MainWindow::on_memoryViewAddress_textEdited(const QString &) void MainWindow::updateMemory() { - uint32_t virtBase = ui->memoryViewAddress->text().toUInt(nullptr, 16) & ~0xFF; - auto physBaseOpt = emu->virtToPhys(virtBase); - auto physBase = physBaseOpt.value_or(0xFFFFFFFF); - bool ok = physBaseOpt.has_value(); - if (ok && (virtBase != physBase)) + uint32_t physBase; + uint32_t virtBase; +bool ok; + if (ui->memoryViewAddress->text().startsWith('p')) { + physBase = ui->memoryViewAddress->text().remove('p').toUInt(nullptr, 16) & ~0xFF; + virtBase = physBase; ui->physicalAddressLabel->setText(QStringLiteral("Physical: %1").arg(physBase, 8, 16, QLatin1Char('0'))); + } else { + uint32_t virtBase = ui->memoryViewAddress->text().toUInt(nullptr, 16) & ~0xFF; + auto physBaseOpt = emu->virtToPhys(virtBase); + physBase = physBaseOpt.value_or(0xFFFFFFFF); + ok = physBaseOpt.has_value(); + if (ok && (virtBase != physBase)) + ui->physicalAddressLabel->setText(QStringLiteral("Physical: %1").arg(physBase, 8, 16, QLatin1Char('0'))); + } uint8_t block[0x100]; if (ok) {