2014-10-26 21:08:40 +05:30
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 11:08:14 +05:30
|
|
|
// Licensed under GPLv2 or any later version
|
2014-10-26 21:08:40 +05:30
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
2014-12-19 23:52:44 +05:30
|
|
|
#include "graphics_breakpoint_observer.h"
|
2014-10-26 21:08:40 +05:30
|
|
|
|
|
|
|
class QComboBox;
|
|
|
|
class QLabel;
|
|
|
|
class QSpinBox;
|
|
|
|
|
|
|
|
class CSpinBox;
|
|
|
|
|
|
|
|
class GraphicsFramebufferWidget : public BreakPointObserverDock {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
using Event = Pica::DebugContext::Event;
|
|
|
|
|
|
|
|
enum class Source {
|
2015-03-09 08:01:15 +05:30
|
|
|
PicaTarget = 0,
|
|
|
|
DepthBuffer = 1,
|
|
|
|
Custom = 2,
|
2014-10-26 21:08:40 +05:30
|
|
|
|
|
|
|
// TODO: Add GPU framebuffer sources!
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class Format {
|
|
|
|
RGBA8 = 0,
|
|
|
|
RGB8 = 1,
|
2015-02-26 09:14:55 +05:30
|
|
|
RGB5A1 = 2,
|
2014-10-26 21:08:40 +05:30
|
|
|
RGB565 = 3,
|
|
|
|
RGBA4 = 4,
|
2015-03-09 06:37:02 +05:30
|
|
|
D16 = 5,
|
|
|
|
D24 = 6,
|
|
|
|
D24S8 = 7
|
2014-10-26 21:08:40 +05:30
|
|
|
};
|
|
|
|
|
2015-03-09 06:37:02 +05:30
|
|
|
static u32 BytesPerPixel(Format format);
|
|
|
|
|
2014-10-26 21:08:40 +05:30
|
|
|
public:
|
|
|
|
GraphicsFramebufferWidget(std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent = nullptr);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void OnFramebufferSourceChanged(int new_value);
|
|
|
|
void OnFramebufferAddressChanged(qint64 new_value);
|
2015-01-11 02:05:26 +05:30
|
|
|
void OnFramebufferWidthChanged(int new_value);
|
|
|
|
void OnFramebufferHeightChanged(int new_value);
|
2014-10-26 21:08:40 +05:30
|
|
|
void OnFramebufferFormatChanged(int new_value);
|
|
|
|
void OnUpdate();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OnBreakPointHit(Pica::DebugContext::Event event, void* data) override;
|
|
|
|
void OnResumed() override;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void Update();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
QComboBox* framebuffer_source_list;
|
|
|
|
CSpinBox* framebuffer_address_control;
|
|
|
|
QSpinBox* framebuffer_width_control;
|
|
|
|
QSpinBox* framebuffer_height_control;
|
|
|
|
QComboBox* framebuffer_format_control;
|
|
|
|
|
|
|
|
QLabel* framebuffer_picture_label;
|
|
|
|
|
|
|
|
Source framebuffer_source;
|
|
|
|
unsigned framebuffer_address;
|
|
|
|
unsigned framebuffer_width;
|
|
|
|
unsigned framebuffer_height;
|
|
|
|
Format framebuffer_format;
|
|
|
|
};
|