OXYGENHUB
◆ main openmsx / src / video / v9990 / V9990Rasterizer.hh
3.5 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef V9990RASTERIZER_HH
2
#define V9990RASTERIZER_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
/** If this seems awfully familiar, take a look at Rasterizer.hh
15
  * It's virtually the same class, but for a different video processor.
16
  */
17
class V9990Rasterizer
18
{
19
public:
20
	virtual ~V9990Rasterizer() = default;
21
22
	/** See V9990::getPostProcessor(). */
23
	[[nodiscard]] virtual PostProcessor* getPostProcessor() const = 0;
24
25
	/** Will the output of this Rasterizer be displayed?
26
	  * There is no point in producing a frame that will not be displayed.
27
	  * TODO: Is querying the next pipeline step the best way to solve this,
28
	  *       or is it better to explicitly disable the first step in the pipeline?
29
	  */
30
	[[nodiscard]] virtual bool isActive() = 0;
31
32
	/** Resynchronize with VDP - flush caches etc.
33
	  */
34
	virtual void reset() = 0;
35
36
	/** Indicates the start of a new frame.
37
	  */
38
	virtual void frameStart() = 0;
39
40
	/** Indicates the end of the current frame.
41
	  */
42
	virtual void frameEnd(EmuTime time) = 0;
43
44
	/** The display mode determines the screens geometry and how V9990
45
	  * pixels are mapped to pixels on screen.
46
	  * @param displayMode  The new display mode.
47
	  */
48
	virtual void setDisplayMode(enum V9990DisplayMode displayMode) = 0;
49
50
	/** The color mode determines how the V9990 VRAM data gets converted
51
	  * to pixel colors.
52
	  * @param colorMode  The new color mode.
53
	  */
54
	virtual void setColorMode(enum V9990ColorMode colorMode) = 0;
55
56
	/** Set RGB values for a palette entry
57
	  * @param index  Index in palette
58
	  * @param r      Red component intensity (5 bits)
59
	  * @param g      Green component intensity (5 bits)
60
	  * @param b      Blue component intensity (5 bits)
61
	  * @param ys     Is this entry transparent
62
	  */
63
	virtual void setPalette(int index, uint8_t r, uint8_t g, uint8_t b, bool ys) = 0;
64
65
	/** Is superimpose enabled? */
66
	virtual void setSuperimpose(bool enabled) = 0;
67
68
	/** Render a rectangle of border pixels on the host screen.
69
	  * The units are absolute lines (Y) and V9990 UC ticks (X).
70
	  * @param fromX   X coordinate of render start (inclusive).
71
	  * @param fromY   Y coordinate of render start (inclusive).
72
	  * @param limitX  X coordinate of render end (exclusive).
73
	  * @param limitY  Y coordinate of render end (exclusive).
74
	  */
75
	virtual void drawBorder(
76
		int fromX, int fromY,
77
		int limitX, int limitY) = 0;
78
79
	/** Render a rectangle of display pixels on the host screen.
80
	  * @param fromX     X coordinate of render start in V9990 UC ticks.
81
	  * @param fromY     Y coordinate of render start in absolute lines.
82
	  * @param toX       X coordinate of render stop in V9990 UC ticks (exclusive).
83
	  * @param toY       Y coordinate of render stop in absolute lines (exclusive).
84
	  * @param displayX  display coordinate of render start: [0..640).
85
	  * @param displayY  display coordinate of render start: [0..480).
86
	  * @param displayYA similar to displayY but specific for plane A
87
	  * @param displayYB similar to displayY but specific for plane B
88
	  * Note: Usually displayY, displayYA and displayYB will all be the
89
	  *       same. Only in case the vertical scroll register is updated
90
	  *       in the middle of a frame they can differ, see
91
	  *       V9990PixelRenderer::updateScrollAYLow()
92
	  */
93
	virtual void drawDisplay(
94
		int fromX, int fromY, int toX, int toY,
95
		int displayX, int displayY, int displayYA, int displayYB) = 0;
96
97
	/** Is video recording active?
98
	  */
99
	[[nodiscard]] virtual bool isRecording() const = 0;
100
};
101
102
} // namespace openmsx
103
104
#endif