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