graphics_framebuffer.h 1.8 KB

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