openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
video
PixelRenderer.hh
Go to the documentation of this file.
1
#ifndef PIXELRENDERER_HH
2
#define PIXELRENDERER_HH
3
4
#include "
Renderer.hh
"
5
#include "
Observer.hh
"
6
#include "
RenderSettings.hh
"
7
#include "
DisplayMode.hh
"
8
#include "
openmsx.hh
"
9
#include "
noncopyable.hh
"
10
#include <memory>
11
12
namespace
openmsx {
13
14
class
EventDistributor;
15
class
RealTime;
16
class
Display;
17
class
Rasterizer;
18
class
VDP
;
19
class
VDPVRAM
;
20
class
SpriteChecker
;
21
class
Setting;
22
26
class
PixelRenderer
:
public
Renderer
,
private
Observer
<Setting>,
27
private
noncopyable
28
{
29
public
:
30
PixelRenderer
(
VDP
& vdp,
Display
& display);
31
virtual
~PixelRenderer
();
32
33
// Renderer interface:
34
virtual
PostProcessor
*
getPostProcessor
()
const
;
35
virtual
void
reInit
();
36
virtual
void
frameStart
(
EmuTime::param
time);
37
virtual
void
frameEnd
(
EmuTime::param
time);
38
virtual
void
updateHorizontalScrollLow
(
byte
scroll,
EmuTime::param
time);
39
virtual
void
updateHorizontalScrollHigh
(
byte
scroll,
EmuTime::param
time);
40
virtual
void
updateBorderMask
(
bool
masked,
EmuTime::param
time);
41
virtual
void
updateMultiPage
(
bool
multiPage,
EmuTime::param
time);
42
virtual
void
updateTransparency
(
bool
enabled,
EmuTime::param
time);
43
virtual
void
updateSuperimposing
(
const
RawFrame
* videoSource,
EmuTime::param
time);
44
virtual
void
updateForegroundColor
(
int
color,
EmuTime::param
time);
45
virtual
void
updateBackgroundColor
(
int
color,
EmuTime::param
time);
46
virtual
void
updateBlinkForegroundColor
(
int
color,
EmuTime::param
time);
47
virtual
void
updateBlinkBackgroundColor
(
int
color,
EmuTime::param
time);
48
virtual
void
updateBlinkState
(
bool
enabled,
EmuTime::param
time);
49
virtual
void
updatePalette
(
int
index,
int
grb,
EmuTime::param
time);
50
virtual
void
updateVerticalScroll
(
int
scroll,
EmuTime::param
time);
51
virtual
void
updateHorizontalAdjust
(
int
adjust,
EmuTime::param
time);
52
virtual
void
updateDisplayEnabled
(
bool
enabled,
EmuTime::param
time);
53
virtual
void
updateDisplayMode
(
DisplayMode
mode,
EmuTime::param
time);
54
virtual
void
updateNameBase
(
int
addr,
EmuTime::param
time);
55
virtual
void
updatePatternBase
(
int
addr,
EmuTime::param
time);
56
virtual
void
updateColorBase
(
int
addr,
EmuTime::param
time);
57
virtual
void
updateSpritesEnabled
(
bool
enabled,
EmuTime::param
time);
58
virtual
void
updateVRAM
(
unsigned
offset
,
EmuTime::param
time);
59
virtual
void
updateWindow
(
bool
enabled,
EmuTime::param
time);
60
61
private
:
63
enum
DrawType { DRAW_BORDER, DRAW_DISPLAY };
64
65
// Observer<Setting> interface:
66
virtual
void
update(
const
Setting
& setting);
67
71
void
draw(
72
int
startX,
int
startY,
int
endX,
int
endY, DrawType drawType,
73
bool
atEnd);
74
82
void
subdivide(
83
int
startX,
int
startY,
int
endX,
int
endY,
84
int
clipL,
int
clipR, DrawType drawType );
85
86
inline
bool
checkSync(
int
offset,
EmuTime::param
time);
87
93
void
sync(
EmuTime::param
time,
bool
force =
false
);
94
101
void
renderUntil(
EmuTime::param
time);
102
105
VDP
& vdp;
106
109
VDPVRAM
& vram;
110
111
EventDistributor
& eventDistributor;
112
RealTime
& realTime;
113
RenderSettings
& renderSettings;
114
VideoSourceSetting
& videoSourceSetting;
115
118
SpriteChecker
& spriteChecker;
119
120
const
std::unique_ptr<Rasterizer> rasterizer;
121
122
double
finishFrameDuration;
123
int
frameSkipCounter;
124
128
int
nextX;
129
133
int
nextY;
134
135
// internal VDP counter, actually belongs in VDP
136
int
textModeCounter;
137
140
RenderSettings::Accuracy
accuracy;
141
146
bool
displayEnabled;
147
150
bool
renderFrame;
151
bool
prevRenderFrame;
152
};
153
154
}
// namespace openmsx
155
156
#endif
Generated on Sat May 18 2013 21:18:27 for openMSX by
1.8.1.2