graphics_framebuffer.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <QDockWidget>
  6. #include "graphics_breakpoint_observer.h"
  7. class QComboBox;
  8. class QLabel;
  9. class QSpinBox;
  10. class CSpinBox;
  11. class GraphicsFramebufferWidget : public BreakPointObserverDock {
  12. Q_OBJECT
  13. using Event = Pica::DebugContext::Event;
  14. enum class Source {
  15. PicaTarget = 0,
  16. DepthBuffer = 1,
  17. Custom = 2,
  18. // TODO: Add GPU framebuffer sources!
  19. };
  20. enum class Format {
  21. RGBA8 = 0,
  22. RGB8 = 1,
  23. RGB5A1 = 2,
  24. RGB565 = 3,
  25. RGBA4 = 4,
  26. D16 = 5,
  27. D24 = 6,
  28. D24X8 = 7,
  29. X24S8 = 8,
  30. Unknown = 9
  31. };
  32. static u32 BytesPerPixel(Format format);
  33. public:
  34. GraphicsFramebufferWidget(std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent = nullptr);
  35. public slots:
  36. void OnFramebufferSourceChanged(int new_value);
  37. void OnFramebufferAddressChanged(qint64 new_value);
  38. void OnFramebufferWidthChanged(int new_value);
  39. void OnFramebufferHeightChanged(int new_value);
  40. void OnFramebufferFormatChanged(int new_value);
  41. void OnUpdate();
  42. private slots:
  43. void OnBreakPointHit(Pica::DebugContext::Event event, void* data) override;
  44. void OnResumed() override;
  45. signals:
  46. void Update();
  47. private:
  48. QComboBox* framebuffer_source_list;
  49. CSpinBox* framebuffer_address_control;
  50. QSpinBox* framebuffer_width_control;
  51. QSpinBox* framebuffer_height_control;
  52. QComboBox* framebuffer_format_control;
  53. QLabel* framebuffer_picture_label;
  54. Source framebuffer_source;
  55. unsigned framebuffer_address;
  56. unsigned framebuffer_width;
  57. unsigned framebuffer_height;
  58. Format framebuffer_format;
  59. };