openMSX
Renderer.hh
Go to the documentation of this file.
1 #ifndef RENDERER_HH
2 #define RENDERER_HH
3 
4 #include "VRAMObserver.hh"
5 #include "openmsx.hh"
6 #include <cstdint>
7 
8 namespace openmsx {
9 
10 class PostProcessor;
11 class DisplayMode;
12 class RawFrame;
13 
22 class Renderer : public VRAMObserver
23 {
24 public:
25  virtual ~Renderer() = default;
26 
28  [[nodiscard]] virtual PostProcessor* getPostProcessor() const = 0;
29 
32  virtual void reInit() = 0;
33 
39  virtual void frameStart(EmuTime::param time) = 0;
40 
45  virtual void frameEnd(EmuTime::param time) = 0;
46 
51  virtual void updateTransparency(bool enabled, EmuTime::param time) = 0;
52 
57  virtual void updateSuperimposing(const RawFrame* videoSource,
58  EmuTime::param time) = 0;
59 
64  virtual void updateForegroundColor(int color, EmuTime::param time) = 0;
65 
70  virtual void updateBackgroundColor(int color, EmuTime::param time) = 0;
71 
76  virtual void updateBlinkForegroundColor(int color, EmuTime::param time) = 0;
77 
82  virtual void updateBlinkBackgroundColor(int color, EmuTime::param time) = 0;
83 
88  virtual void updateBlinkState(bool enabled, EmuTime::param time) = 0;
89 
97  virtual void updatePalette(int index, int grb, EmuTime::param time) = 0;
98 
103  virtual void updateVerticalScroll(int scroll, EmuTime::param time) = 0;
104 
110  virtual void updateHorizontalScrollLow(byte scroll, EmuTime::param time) = 0;
111 
117  virtual void updateHorizontalScrollHigh(byte scroll, EmuTime::param time) = 0;
118 
124  virtual void updateBorderMask(bool masked, EmuTime::param time) = 0;
125 
131  virtual void updateMultiPage(bool multiPage, EmuTime::param time) = 0;
132 
140  virtual void updateHorizontalAdjust(int adjust, EmuTime::param time) = 0;
141 
148  virtual void updateDisplayEnabled(bool enabled, EmuTime::param time) = 0;
149 
154  virtual void updateDisplayMode(DisplayMode mode, EmuTime::param time) = 0;
155 
160  virtual void updateNameBase(int addr, EmuTime::param time) = 0;
161 
166  virtual void updatePatternBase(int addr, EmuTime::param time) = 0;
167 
172  virtual void updateColorBase(int addr, EmuTime::param time) = 0;
173 
178  virtual void updateSpritesEnabled(bool enabled, EmuTime::param time) = 0;
179 
185  static constexpr uint16_t GRAPHIC7_SPRITE_PALETTE[16] = {
186  0x000, 0x002, 0x030, 0x032, 0x300, 0x302, 0x330, 0x332,
187  0x472, 0x007, 0x070, 0x077, 0x700, 0x707, 0x770, 0x777,
188  };
189 
190 protected:
191  Renderer() = default;
192 };
193 
194 } // namespace openmsx
195 
196 #endif
Represents a VDP display mode.
Definition: DisplayMode.hh:16
Abstract base class for post processors.
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:14
Abstract base class for Renderers.
Definition: Renderer.hh:23
virtual PostProcessor * getPostProcessor() const =0
See VDP::getPostProcessor.
virtual void updateBorderMask(bool masked, EmuTime::param time)=0
Informs the renderer of a horizontal scroll change: the border mask has been enabled/disabled.
virtual void updateSuperimposing(const RawFrame *videoSource, EmuTime::param time)=0
Informs the renderer of a VDP superimposing change.
virtual void reInit()=0
Reinitialize Renderer state.
virtual void updateDisplayMode(DisplayMode mode, EmuTime::param time)=0
Informs the renderer of a VDP display mode change.
virtual void updateColorBase(int addr, EmuTime::param time)=0
Informs the renderer of a color table base address change.
virtual void updateTransparency(bool enabled, EmuTime::param time)=0
Informs the renderer of a VDP transparency enable/disable change.
virtual void updateForegroundColor(int color, EmuTime::param time)=0
Informs the renderer of a VDP foreground color change.
virtual void updateMultiPage(bool multiPage, EmuTime::param time)=0
Informs the renderer of a horizontal scroll change: the multi page setting has changed.
virtual ~Renderer()=default
virtual void updatePatternBase(int addr, EmuTime::param time)=0
Informs the renderer of a pattern table base address change.
virtual void frameEnd(EmuTime::param time)=0
Signals the end of a frame.
virtual void updateSpritesEnabled(bool enabled, EmuTime::param time)=0
Informs the renderer of a VDP sprites enabled change.
virtual void updateBlinkState(bool enabled, EmuTime::param time)=0
Informs the renderer of a VDP blinking state change.
virtual void updateBackgroundColor(int color, EmuTime::param time)=0
Informs the renderer of a VDP background color change.
Renderer()=default
virtual void frameStart(EmuTime::param time)=0
Signals the start of a new frame.
virtual void updateVerticalScroll(int scroll, EmuTime::param time)=0
Informs the renderer of a vertical scroll change.
virtual void updateHorizontalScrollLow(byte scroll, EmuTime::param time)=0
Informs the renderer of a horizontal scroll change: the lower scroll value has changed.
virtual void updateBlinkBackgroundColor(int color, EmuTime::param time)=0
Informs the renderer of a VDP blink background color change.
virtual void updatePalette(int index, int grb, EmuTime::param time)=0
Informs the renderer of a VDP palette change.
virtual void updateHorizontalScrollHigh(byte scroll, EmuTime::param time)=0
Informs the renderer of a horizontal scroll change: the higher scroll value has changed.
virtual void updateDisplayEnabled(bool enabled, EmuTime::param time)=0
Informs the renderer of a VDP display enabled change.
virtual void updateHorizontalAdjust(int adjust, EmuTime::param time)=0
Informs the renderer of a horizontal adjust change.
static constexpr uint16_t GRAPHIC7_SPRITE_PALETTE[16]
Sprite palette in Graphic 7 mode.
Definition: Renderer.hh:185
virtual void updateNameBase(int addr, EmuTime::param time)=0
Informs the renderer of a name table base address change.
virtual void updateBlinkForegroundColor(int color, EmuTime::param time)=0
Informs the renderer of a VDP blink foreground color change.
Interface that can be registered at VRAMWindow, to be called when the contents of the VRAM inside tha...
Definition: VRAMObserver.hh:11
This file implemented 3 utility functions:
Definition: Autofire.cc:9