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 <array>
7#include <cstdint>
8
9namespace openmsx {
10
11class PostProcessor;
12class DisplayMode;
13class RawFrame;
14
23class Renderer : public VRAMObserver
24{
25public:
26 virtual ~Renderer() = default;
27
29 [[nodiscard]] virtual PostProcessor* getPostProcessor() const = 0;
30
33 virtual void reInit() = 0;
34
40 virtual void frameStart(EmuTime::param time) = 0;
41
46 virtual void frameEnd(EmuTime::param time) = 0;
47
52 virtual void updateTransparency(bool enabled, EmuTime::param time) = 0;
53
58 virtual void updateSuperimposing(const RawFrame* videoSource,
59 EmuTime::param time) = 0;
60
65 virtual void updateForegroundColor(byte color, EmuTime::param time) = 0;
66
71 virtual void updateBackgroundColor(byte color, EmuTime::param time) = 0;
72
77 virtual void updateBlinkForegroundColor(byte color, EmuTime::param time) = 0;
78
83 virtual void updateBlinkBackgroundColor(byte color, EmuTime::param time) = 0;
84
89 virtual void updateBlinkState(bool enabled, EmuTime::param time) = 0;
90
98 virtual void updatePalette(unsigned index, int grb, EmuTime::param time) = 0;
99
104 virtual void updateVerticalScroll(int scroll, EmuTime::param time) = 0;
105
111 virtual void updateHorizontalScrollLow(byte scroll, EmuTime::param time) = 0;
112
118 virtual void updateHorizontalScrollHigh(byte scroll, EmuTime::param time) = 0;
119
125 virtual void updateBorderMask(bool masked, EmuTime::param time) = 0;
126
132 virtual void updateMultiPage(bool multiPage, EmuTime::param time) = 0;
133
141 virtual void updateHorizontalAdjust(int adjust, EmuTime::param time) = 0;
142
149 virtual void updateDisplayEnabled(bool enabled, EmuTime::param time) = 0;
150
155 virtual void updateDisplayMode(DisplayMode mode, EmuTime::param time) = 0;
156
161 virtual void updateNameBase(unsigned addr, EmuTime::param time) = 0;
162
167 virtual void updatePatternBase(unsigned addr, EmuTime::param time) = 0;
168
173 virtual void updateColorBase(unsigned addr, EmuTime::param time) = 0;
174
179 virtual void updateSpritesEnabled(bool enabled, EmuTime::param time) = 0;
180
186 static constexpr std::array<uint16_t, 16> GRAPHIC7_SPRITE_PALETTE = {
187 0x000, 0x002, 0x030, 0x032, 0x300, 0x302, 0x330, 0x332,
188 0x472, 0x007, 0x070, 0x077, 0x700, 0x707, 0x770, 0x777,
189 };
190
191protected:
192 Renderer() = default;
193};
194
195} // namespace openmsx
196
197#endif
Represents a VDP display mode.
A post processor builds the frame that is displayed from the MSX frame, while applying effects such a...
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition RawFrame.hh:16
Abstract base class for Renderers.
Definition Renderer.hh:24
virtual void updateBlinkBackgroundColor(byte color, EmuTime::param time)=0
Informs the renderer of a VDP blink background color change.
virtual void updateBlinkForegroundColor(byte color, EmuTime::param time)=0
Informs the renderer of a VDP blink foreground color change.
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 updateTransparency(bool enabled, EmuTime::param time)=0
Informs the renderer of a VDP transparency enable/disable change.
virtual void updateColorBase(unsigned addr, EmuTime::param time)=0
Informs the renderer of a color table base address change.
virtual void updateBackgroundColor(byte color, EmuTime::param time)=0
Informs the renderer of a VDP background color change.
virtual void updateNameBase(unsigned addr, EmuTime::param time)=0
Informs the renderer of a name table base address 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
static constexpr std::array< uint16_t, 16 > GRAPHIC7_SPRITE_PALETTE
Sprite palette in Graphic 7 mode.
Definition Renderer.hh:186
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 updateForegroundColor(byte color, EmuTime::param time)=0
Informs the renderer of a VDP foreground color change.
Renderer()=default
virtual PostProcessor * getPostProcessor() const =0
See VDP::getPostProcessor.
virtual void frameStart(EmuTime::param time)=0
Signals the start of a new frame.
virtual void updatePalette(unsigned index, int grb, EmuTime::param time)=0
Informs the renderer of a VDP palette change.
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 updatePatternBase(unsigned addr, EmuTime::param time)=0
Informs the renderer of a pattern table base address 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.
Interface that can be registered at VRAMWindow, to be called when the contents of the VRAM inside tha...
This file implemented 3 utility functions:
Definition Autofire.cc:11