openMSX
V9990Renderer.hh
Go to the documentation of this file.
1 #ifndef V9990RENDERER_HH
2 #define V9990RENDERER_HH
3 
4 #include "V9990ModeEnum.hh"
5 #include "EmuTime.hh"
6 #include "openmsx.hh"
7 
8 namespace openmsx {
9 
10 class PostProcessor;
11 
12 /** Abstract base class for V9990 renderers.
13  * A V9990Renderer is a class that covnerts the V9990 state into
14  * visual information (e.g. pixels on a screen).
15  *
16  * @see Renderer.cc
17  */
19 {
20 public:
21  virtual ~V9990Renderer() = default;
22 
23  /** See V9990::getPostProcessor. */
24  virtual PostProcessor* getPostProcessor() const = 0;
25 
26  /** Re-initialise the V9990Renderer's state.
27  * @param time The moment in emulated time this reset occurs.
28  */
29  virtual void reset(EmuTime::param time) = 0;
30 
31  /** Signal the start of a new frame.
32  * The V9990Renderer can use this to get fixed-per-frame
33  * settings from the V9990 VDP. Typical settings include:
34  * - PAL/NTSC timing
35  * - MCLK/XTAL selection
36  * @param time The moment in emulated time the frame starts.
37  */
38  virtual void frameStart(EmuTime::param time) = 0;
39 
40  /** Signal the end of the current frame.
41  * @param time The moment in emulated time the frame ends.
42  */
43  virtual void frameEnd(EmuTime::param time) = 0;
44 
45  /** Render until the given point in emulated time
46  * @param time The moment in emulated time the frame ends.
47  */
48  virtual void renderUntil(EmuTime::param time) = 0;
49 
50  /** Informs the renderer of a VDP display enabled change.
51  * Both the regular border start/end and forced blanking by clearing
52  * the display enable bit are considered display enabled changes.
53  * @param enabled The new display enabled state.
54  * @param time The moment in emulated time this change occurs.
55  */
56  virtual void updateDisplayEnabled(bool enabled, EmuTime::param time) = 0;
57 
58  /** Set screen mode. */
59  virtual void setDisplayMode(V9990DisplayMode mode,
60  EmuTime::param time) = 0;
61 
62  /** Set color mode. */
63  virtual void setColorMode(V9990ColorMode mode,
64  EmuTime::param time) = 0;
65 
66  /** Set a palette entry. */
67  virtual void updatePalette(int index, byte r, byte g, byte b, bool ys,
68  EmuTime::param time) = 0;
69 
70  /** Change superimpose status. */
71  virtual void updateSuperimposing(bool enabled, EmuTime::param time) = 0;
72 
73  /** Set background color. */
74  virtual void updateBackgroundColor(int index, EmuTime::param time) = 0;
75 
76  /** Set scroll register. */
77  virtual void updateScrollAX(EmuTime::param time) = 0;
78  virtual void updateScrollBX(EmuTime::param time) = 0;
79  virtual void updateScrollAYLow(EmuTime::param time) = 0;
80  virtual void updateScrollBYLow(EmuTime::param time) = 0;
81 
82 protected:
83  V9990Renderer() = default;
84 };
85 
86 } // namespace openmsx
87 
88 #endif
virtual void renderUntil(EmuTime::param time)=0
Render until the given point in emulated time.
bool getEnum() const noexcept
Definition: EnumSetting.hh:96
virtual void updateDisplayEnabled(bool enabled, EmuTime::param time)=0
Informs the renderer of a VDP display enabled change.
Abstract base class for V9990 renderers.
virtual void updateSuperimposing(bool enabled, EmuTime::param time)=0
Change superimpose status.
virtual ~V9990Renderer()=default
virtual void frameStart(EmuTime::param time)=0
Signal the start of a new frame.
virtual void frameEnd(EmuTime::param time)=0
Signal the end of the current frame.
virtual PostProcessor * getPostProcessor() const =0
See V9990::getPostProcessor.
virtual void updateScrollBYLow(EmuTime::param time)=0
virtual void setDisplayMode(V9990DisplayMode mode, EmuTime::param time)=0
Set screen mode.
virtual void reset(EmuTime::param time)=0
Re-initialise the V9990Renderer's state.
virtual void updateScrollAYLow(EmuTime::param time)=0
virtual void setColorMode(V9990ColorMode mode, EmuTime::param time)=0
Set color mode.
virtual void updateBackgroundColor(int index, EmuTime::param time)=0
Set background color.
virtual void updateScrollAX(EmuTime::param time)=0
Set scroll register.
virtual void updatePalette(int index, byte r, byte g, byte b, bool ys, EmuTime::param time)=0
Set a palette entry.
virtual void updateScrollBX(EmuTime::param time)=0