mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-02 10:15:45 +00:00
Implementing a logger UI
This commit is contained in:
@@ -1,29 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CPU</class>
|
||||
<widget class="QWidget" name="CPU">
|
||||
<class>CPUView</class>
|
||||
<widget class="QWidget" name="CPUView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>584</width>
|
||||
<height>407</height>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>CPU</string>
|
||||
<string>CPU's Debugger</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QTextBrowser" name="logger">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>160</y>
|
||||
<width>67</width>
|
||||
<height>17</height>
|
||||
<x>0</x>
|
||||
<y>25</y>
|
||||
<width>200</width>
|
||||
<height>375</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="loggerLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CPU</string>
|
||||
<string>Instructions History</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
// Created by anonymus-raccoon on 2/14/20.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include "DebugCpu.hpp"
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
CPUDebug::CPUDebug(ComSquare::CPU::CPU &basicCPU, SNES &snes)
|
||||
: CPU::CPU(basicCPU), _snes(snes)
|
||||
: CPU::CPU(basicCPU), Ui::CPUView(), _snes(snes)
|
||||
{
|
||||
this->_ui.setupUi(&this->_widget);
|
||||
this->setupUi(&this->_widget);
|
||||
this->_widget.show();
|
||||
}
|
||||
|
||||
@@ -21,8 +20,7 @@ namespace ComSquare::Debugger
|
||||
return 0;
|
||||
}
|
||||
|
||||
// this->_renderer.drawScreen();
|
||||
// this->_renderer.getEvents();
|
||||
this->logger->append("Update");
|
||||
if (this->_isPaused)
|
||||
return 0xFF;
|
||||
return CPU::update();
|
||||
|
||||
@@ -14,12 +14,10 @@
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
//! @brief A custom CPU with a window that show it's registers and the disassembly.
|
||||
class CPUDebug : public CPU::CPU {
|
||||
class CPUDebug : public CPU::CPU, Ui::CPUView {
|
||||
private:
|
||||
//! @brief A widget that contain the whole UI.
|
||||
QWidget _widget;
|
||||
//! @brief The ui that reside inside the window.
|
||||
Ui::CPU _ui;
|
||||
//! @brief If this is set to true, the execution of the CPU will be paused.
|
||||
bool _isPaused = true;
|
||||
//! @brief A reference to the snes (to disable the debugger).
|
||||
|
||||
Reference in New Issue
Block a user