]> localhost Git - WindEmu.git/commitdiff
hack in a quick physical memory inspector - prepend the memory address with 'p'
authorGeorge Wright <gw@gwright.org.uk>
Sat, 7 Dec 2024 21:11:11 +0000 (13:11 -0800)
committerGeorge Wright <gw@gwright.org.uk>
Sat, 7 Dec 2024 21:11:11 +0000 (13:11 -0800)
WindQt/mainwindow.cpp

index f016f4b8b45b72cabdadfdbdf8ebc2f9353d76c2..f6a802345114d4d0a8ccfa86413931fe747994f9 100644 (file)
@@ -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) {