mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 18:08:20 -07:00
redesign gpu visual debugging windows
This commit is contained in:
@@ -157,6 +157,10 @@ add_library(ui STATIC
|
||||
qt_gpudebug_vram.hpp
|
||||
qt_gpudebug_vram.ui
|
||||
|
||||
qt_gpudebug_visualnv.cpp
|
||||
qt_gpudebug_visualnv.hpp
|
||||
qt_gpudebug_visualnv.ui
|
||||
|
||||
qt_harddrive_common.cpp
|
||||
qt_harddrive_common.hpp
|
||||
qt_models_common.cpp
|
||||
|
||||
54
src/qt/qt_gpudebug_visualnv.cpp
Normal file
54
src/qt/qt_gpudebug_visualnv.cpp
Normal file
@@ -0,0 +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 <cstdbool>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
/* Qt includes*/
|
||||
#include <QDebug>
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
#include <QFormLayout>
|
||||
#include <QSpinBox>
|
||||
#include <QCheckBox>
|
||||
#include <QFrame>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <qt_gpudebug_visualnv.hpp>
|
||||
#include "ui_qt_gpudebug_visualnv.h"
|
||||
|
||||
/* 86Box core includes */
|
||||
extern "C"
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VisualNVDialog::VisualNVDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::VisualNVDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
VisualNVDialog::~VisualNVDialog()
|
||||
{
|
||||
|
||||
}
|
||||
40
src/qt/qt_gpudebug_visualnv.hpp
Normal file
40
src/qt/qt_gpudebug_visualnv.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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 <QDialog>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class VisualNVDialog;
|
||||
}
|
||||
|
||||
class VisualNVDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit VisualNVDialog(QWidget *parent = nullptr);
|
||||
~VisualNVDialog();
|
||||
protected:
|
||||
private:
|
||||
Ui::VisualNVDialog* ui;
|
||||
|
||||
|
||||
};
|
||||
154
src/qt/qt_gpudebug_visualnv.ui
Normal file
154
src/qt/qt_gpudebug_visualnv.ui
Normal file
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>VisualNVDialog</class>
|
||||
<widget class="QDialog" name="VisualNVialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>350</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>350</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>350</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Nvidia GPU Realtime Debugger</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>201</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>PFIFO State</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>0</y>
|
||||
<width>361</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>PGRAPH State</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<width>571</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>VRAM Control</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>30</y>
|
||||
<width>104</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>151</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>VRAM Visual Aperture Start</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>420</x>
|
||||
<y>30</y>
|
||||
<width>91</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>FB Start Address:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>30</y>
|
||||
<width>49</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-weight:700;">PLACEHOLDER 9000</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>60</y>
|
||||
<width>104</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>151</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Pixel Depth</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -32,16 +32,6 @@
|
||||
<string>VRAM Viewer</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>VRAM</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
@@ -52,6 +42,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>VRAM</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "qt_mainwindow.hpp"
|
||||
#include "qt_gpudebug_vram.hpp"
|
||||
#include "qt_gpudebug_visualnv.hpp"
|
||||
#include "ui_qt_mainwindow.h"
|
||||
|
||||
#include "qt_specifydimensions.h"
|
||||
@@ -2326,4 +2327,14 @@ void MainWindow::on_actionDebug_GPUDebug_VRAM_triggered()
|
||||
debugVramDialog.setWindowFlag(Qt::WindowTitleHint, true);
|
||||
debugVramDialog.setWindowFlag(Qt::WindowSystemMenuHint, false);
|
||||
debugVramDialog.exec();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionDebug_GPUDebug_VisualNv_triggered()
|
||||
{
|
||||
VisualNVDialog visualNvDialog(this);
|
||||
visualNvDialog.setWindowFlag(Qt::CustomizeWindowHint, true);
|
||||
visualNvDialog.setWindowFlag(Qt::WindowTitleHint, true);
|
||||
visualNvDialog.setWindowFlag(Qt::WindowSystemMenuHint, false);
|
||||
visualNvDialog.exec();
|
||||
}
|
||||
@@ -128,7 +128,8 @@ private slots:
|
||||
void on_actionEnable_Discord_integration_triggered(bool checked);
|
||||
void on_actionRenderer_options_triggered();
|
||||
void on_actionDebug_GPUDebug_VRAM_triggered();
|
||||
|
||||
void on_actionDebug_GPUDebug_VisualNv_triggered();
|
||||
|
||||
void refreshMediaMenu();
|
||||
void showMessage_(int flags, const QString &header, const QString &message, bool richText, std::atomic_bool* done = nullptr);
|
||||
void getTitle_(wchar_t *title);
|
||||
|
||||
@@ -914,7 +914,7 @@
|
||||
</action>
|
||||
<action name="actionDebug_GPUDebug_VisualNv">
|
||||
<property name="text">
|
||||
<string>GPU Debug - NV3 Visual Debugger</string>
|
||||
<string>GPU Realtime Debugger (NVIDIA ONLY)</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -134,9 +134,8 @@ void nv3_render_blit_screen2screen(nv3_grobj_t grobj)
|
||||
if ((grobj.grobj_0 >> NV3_PGRAPH_CONTEXT_SWITCH_DST_BUFFER2_ENABLED) & 0x01) dst_buffer = 2;
|
||||
if ((grobj.grobj_0 >> NV3_PGRAPH_CONTEXT_SWITCH_DST_BUFFER3_ENABLED) & 0x01) dst_buffer = 3;
|
||||
|
||||
|
||||
nv3_coord_16_t old_position = nv3->pgraph.blit.point_in;
|
||||
nv3_coord_16_t new_position = nv3->pgraph.blit.point_out;
|
||||
nv3_coord_16_t in_position = nv3->pgraph.blit.point_in;
|
||||
nv3_coord_16_t out_position = nv3->pgraph.blit.point_out;
|
||||
|
||||
/* Coordinates for copying an entire line at a time */
|
||||
uint32_t buf_position = 0, vram_position = 0, size_x = nv3->pgraph.blit.size.x;
|
||||
@@ -159,10 +158,10 @@ void nv3_render_blit_screen2screen(nv3_grobj_t grobj)
|
||||
{
|
||||
buf_position = (nv3->pgraph.blit.size.x * y);
|
||||
/* shouldn't matter in non-wtf mode */
|
||||
vram_position = nv3_render_get_vram_address_for_buffer(old_position, dst_buffer);
|
||||
vram_position = nv3_render_get_vram_address_for_buffer(in_position, src_buffer);
|
||||
|
||||
memcpy(&nv3_s2sb_line_buffer[buf_position], &nv3->nvbase.svga.vram[vram_position], size_x);
|
||||
old_position.y++;
|
||||
in_position.y++;
|
||||
/* 32bit buffer */
|
||||
}
|
||||
|
||||
@@ -170,9 +169,9 @@ void nv3_render_blit_screen2screen(nv3_grobj_t grobj)
|
||||
for (int32_t y = 0; y < nv3->pgraph.blit.size.y; y++)
|
||||
{
|
||||
buf_position = (nv3->pgraph.blit.size.x * y);
|
||||
vram_position = nv3_render_get_vram_address_for_buffer(new_position, src_buffer);
|
||||
vram_position = nv3_render_get_vram_address_for_buffer(out_position, dst_buffer);
|
||||
|
||||
memcpy(&nv3->nvbase.svga.vram[vram_position], &nv3_s2sb_line_buffer[buf_position], size_x);
|
||||
new_position.y++;
|
||||
out_position.y++;
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ mda_standalone_init(UNUSED(const device_t *info))
|
||||
|
||||
mda->vram = malloc(0x1000);
|
||||
|
||||
switch(device_get_config_int("font")) {
|
||||
switch (device_get_config_int("font")) {
|
||||
case 0:
|
||||
loadfont(FONT_IBM_MDA_437_PATH, 0);
|
||||
break;
|
||||
@@ -375,7 +375,7 @@ mda_speed_changed(void *priv)
|
||||
}
|
||||
|
||||
static const device_config_t mda_config[] = {
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
{
|
||||
.name = "rgb_type",
|
||||
.description = "Display type",
|
||||
@@ -411,7 +411,7 @@ static const device_config_t mda_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
const device_t mda_device = {
|
||||
|
||||
Reference in New Issue
Block a user