From 44bf760861710e8c62376e49e667ef2e21d05dbc Mon Sep 17 00:00:00 2001 From: starfrost013 Date: Mon, 28 Apr 2025 02:04:49 +0100 Subject: [PATCH] add vram viewer window --- src/qt/qt_gpudebug_vram.cpp | 53 +++++++++++++++++++++++++++++++++++++ src/qt/qt_gpudebug_vram.hpp | 26 ++++++++++++++++-- src/qt/qt_gpudebug_vram.ui | 32 +++++++--------------- src/qt/qt_mainwindow.cpp | 12 +++++++++ src/qt/qt_mainwindow.hpp | 1 + 5 files changed, 100 insertions(+), 24 deletions(-) diff --git a/src/qt/qt_gpudebug_vram.cpp b/src/qt/qt_gpudebug_vram.cpp index 8b1378917..000f41263 100644 --- a/src/qt/qt_gpudebug_vram.cpp +++ b/src/qt/qt_gpudebug_vram.cpp @@ -1 +1,54 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * GPU Debugging Tools - VRAM Viewer implementation + * + * + * + * Authors: starfrost + * + * Copyright 2025 starfrost + */ +/* C++ includes */ +#include +#include + + +/* Qt includes*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ui_qt_gpudebug_vram.h" + +/* 86Box core includes */ +extern "C" +{ + +} + +GPUDebugVRAMDialog::GPUDebugVRAMDialog(QWidget *parent) + : QDialog(parent) + , ui(new Ui::GPUDebugVRAMDialog) +{ + ui->setupUi(this); +} + +GPUDebugVRAMDialog::~GPUDebugVRAMDialog() +{ + +} \ No newline at end of file diff --git a/src/qt/qt_gpudebug_vram.hpp b/src/qt/qt_gpudebug_vram.hpp index 975583f7f..18b2e8c96 100644 --- a/src/qt/qt_gpudebug_vram.hpp +++ b/src/qt/qt_gpudebug_vram.hpp @@ -1,3 +1,21 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * GPU Debugging Tools - VRAM Viewer headers + * + * + * + * Authors: starfrost + * + * Copyright 2025 starfrost + */ + + #pragma once #include @@ -7,12 +25,16 @@ namespace Ui class GPUDebugVRAMDialog; } -class Ui::GPUDebugVRAMDialog : public QDialog +class GPUDebugVRAMDialog : public QDialog { + Q_OBJECT + public: - void Init(); + explicit GPUDebugVRAMDialog(QWidget *parent = nullptr); + ~GPUDebugVRAMDialog(); protected: private: + Ui::GPUDebugVRAMDialog* ui; }; \ No newline at end of file diff --git a/src/qt/qt_gpudebug_vram.ui b/src/qt/qt_gpudebug_vram.ui index 0f6c9931f..be2bd4a20 100644 --- a/src/qt/qt_gpudebug_vram.ui +++ b/src/qt/qt_gpudebug_vram.ui @@ -1,8 +1,7 @@ - GPUDebugVRAMDialog - + 0 @@ -30,27 +29,16 @@ - Dialog + VRAM Viewer - - - - false - - - 0 - - - true - - - - - - - Sectors: - - + + + + VRAM Viewer + + + + diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 1fb9b3fb5..dc0b923b4 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -23,6 +23,7 @@ #include #include "qt_mainwindow.hpp" +#include "qt_gpudebug_vram.hpp" #include "ui_qt_mainwindow.h" #include "qt_specifydimensions.h" @@ -100,6 +101,8 @@ extern bool cpu_thread_running; #include "qt_mediamenu.hpp" #include "qt_util.hpp" +#include "qt_gpudebug_vram.hpp" + #if defined __unix__ && !defined __HAIKU__ # ifndef Q_OS_MACOS # include "evdev_keyboard.hpp" @@ -2267,3 +2270,12 @@ void MainWindow::on_actionACPI_Shutdown_triggered() { acpi_pwrbut_pressed = 1; } + +void MainWindow::on_actionDebug_GPUDebug_VRAM_triggered() +{ + GPUDebugVRAMDialog debugVramDialog(this); + debugVramDialog.setWindowFlag(Qt::CustomizeWindowHint, true); + debugVramDialog.setWindowFlag(Qt::WindowTitleHint, true); + debugVramDialog.setWindowFlag(Qt::WindowSystemMenuHint, false); + debugVramDialog.exec(); +} \ No newline at end of file diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 5811ac36a..1798c8a75 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -125,6 +125,7 @@ private slots: void on_actionPreferences_triggered(); void on_actionEnable_Discord_integration_triggered(bool checked); void on_actionRenderer_options_triggered(); + void on_actionDebug_GPUDebug_VRAM_triggered(); void refreshMediaMenu(); void showMessage_(int flags, const QString &header, const QString &message, bool richText, std::atomic_bool* done = nullptr);