openMSX
|
Rasterizer using SDL. More...
#include <V9990SDLRasterizer.hh>
Public Types | |
using | Pixel = uint32_t |
Public Member Functions | |
V9990SDLRasterizer (V9990 &vdp, Display &display, OutputSurface &screen, std::unique_ptr< PostProcessor > postProcessor) | |
V9990SDLRasterizer (const V9990SDLRasterizer &)=delete | |
V9990SDLRasterizer (V9990SDLRasterizer &&)=delete | |
V9990SDLRasterizer & | operator= (const V9990SDLRasterizer &)=delete |
V9990SDLRasterizer & | operator= (V9990SDLRasterizer &&)=delete |
~V9990SDLRasterizer () override | |
PostProcessor * | getPostProcessor () const override |
See V9990::getPostProcessor(). | |
bool | isActive () override |
Will the output of this Rasterizer be displayed? There is no point in producing a frame that will not be displayed. | |
void | reset () override |
Resynchronize with VDP - flush caches etc. | |
void | frameStart () override |
Indicates the start of a new frame. | |
void | frameEnd (EmuTime::param time) override |
Indicates the end of the current frame. | |
void | setDisplayMode (V9990DisplayMode displayMode) override |
The display mode determines the screens geometry and how V9990 pixels are mapped to pixels on screen. | |
void | setColorMode (V9990ColorMode colorMode) override |
The color mode determines how the V9990 VRAM data gets converted to pixel colors. | |
void | setPalette (int index, byte r, byte g, byte b, bool ys) override |
Set RGB values for a palette entry. | |
void | setSuperimpose (bool enabled) override |
Is superimpose enabled? | |
void | drawBorder (int fromX, int fromY, int limitX, int limitY) override |
Render a rectangle of border pixels on the host screen. | |
void | drawDisplay (int fromX, int fromY, int toX, int toY, int displayX, int displayY, int displayYA, int displayYB) override |
Render a rectangle of display pixels on the host screen. | |
bool | isRecording () const override |
Is video recording active? | |
void | preCalcPalettes () |
Fill the palettes. | |
void | resetPalette () |
void | drawP1Mode (int fromX, int fromY, int displayX, int displayY, int displayYA, int displayYB, int displayWidth, int displayHeight, bool drawSprites) |
void | drawP2Mode (int fromX, int fromY, int displayX, int displayY, int displayYA, int displayWidth, int displayHeight, bool drawSprites) |
void | drawBxMode (int fromX, int fromY, int displayX, int displayY, int displayYA, int displayWidth, int displayHeight, bool drawSprites) |
void | update (const Setting &setting) noexcept override |
Public Member Functions inherited from openmsx::V9990Rasterizer | |
virtual | ~V9990Rasterizer ()=default |
Rasterizer using SDL.
Definition at line 27 of file V9990SDLRasterizer.hh.
using openmsx::V9990SDLRasterizer::Pixel = uint32_t |
Definition at line 31 of file V9990SDLRasterizer.hh.
openmsx::V9990SDLRasterizer::V9990SDLRasterizer | ( | V9990 & | vdp, |
Display & | display, | ||
OutputSurface & | screen, | ||
std::unique_ptr< PostProcessor > | postProcessor | ||
) |
Definition at line 20 of file V9990SDLRasterizer.cc.
References openmsx::Subject< T >::attach(), openmsx::RenderSettings::getBrightnessSetting(), openmsx::RenderSettings::getColorMatrixSetting(), openmsx::RenderSettings::getContrastSetting(), openmsx::RenderSettings::getGammaSetting(), and preCalcPalettes().
|
delete |
|
delete |
|
override |
|
overridevirtual |
Render a rectangle of border pixels on the host screen.
The units are absolute lines (Y) and V9990 UC ticks (X).
fromX | X coordinate of render start (inclusive). |
fromY | Y coordinate of render start (inclusive). |
limitX | X coordinate of render end (exclusive). |
limitY | Y coordinate of render end (exclusive). |
Implements openmsx::V9990Rasterizer.
Definition at line 108 of file V9990SDLRasterizer.cc.
References ranges::fill(), openmsx::V9990::getBackDropColor(), openmsx::V9990::getLineWidth(), openmsx::V9990::isOverScan(), openmsx::V9990DisplayTiming::UC_TICKS_PER_LINE, openmsx::V9990::UCtoX(), and xrange().
void openmsx::V9990SDLRasterizer::drawBxMode | ( | int | fromX, |
int | fromY, | ||
int | displayX, | ||
int | displayY, | ||
int | displayYA, | ||
int | displayWidth, | ||
int | displayHeight, | ||
bool | drawSprites | ||
) |
Definition at line 233 of file V9990SDLRasterizer.cc.
References openmsx::V9990BitmapConverter::convertLine(), openmsx::V9990::getCursorYOffset(), openmsx::V9990::getEvenOdd(), openmsx::V9990::getLineWidth(), openmsx::V9990::getRollMask(), openmsx::V9990::getScrollAX(), openmsx::V9990::getScrollAY(), and openmsx::V9990::isEvenOddEnabled().
Referenced by drawDisplay().
|
overridevirtual |
Render a rectangle of display pixels on the host screen.
fromX | X coordinate of render start in V9990 UC ticks. |
fromY | Y coordinate of render start in absolute lines. |
toX | X coordinate of render stop in V9990 UC ticks (exclusive). |
toY | Y coordinate of render stop in absolute lines (exclusive). |
displayX | display coordinate of render start: [0..640). |
displayY | display coordinate of render start: [0..480). |
displayYA | similar to displayY but specific for plane A |
displayYB | similar to displayY but specific for plane B Note: Usually displayY, displayYA and displayYB will all be the same. Only in case the vertical scroll register is updated in the middle of a frame they can differ, see V9990PixelRenderer::updateScrollAYLow() |
Implements openmsx::V9990Rasterizer.
Definition at line 142 of file V9990SDLRasterizer.cc.
References drawBxMode(), drawP1Mode(), drawP2Mode(), openmsx::RenderSettings::getDisableSprites(), openmsx::P1, openmsx::P2, openmsx::V9990::spritesEnabled(), and openmsx::V9990::UCtoX().
void openmsx::V9990SDLRasterizer::drawP1Mode | ( | int | fromX, |
int | fromY, | ||
int | displayX, | ||
int | displayY, | ||
int | displayYA, | ||
int | displayYB, | ||
int | displayWidth, | ||
int | displayHeight, | ||
bool | drawSprites | ||
) |
Definition at line 202 of file V9990SDLRasterizer.cc.
References openmsx::V9990P1Converter::convertLine().
Referenced by drawDisplay().
void openmsx::V9990SDLRasterizer::drawP2Mode | ( | int | fromX, |
int | fromY, | ||
int | displayX, | ||
int | displayY, | ||
int | displayYA, | ||
int | displayWidth, | ||
int | displayHeight, | ||
bool | drawSprites | ||
) |
Definition at line 219 of file V9990SDLRasterizer.cc.
References openmsx::V9990P2Converter::convertLine().
Referenced by drawDisplay().
|
overridevirtual |
Indicates the end of the current frame.
Implements openmsx::V9990Rasterizer.
Definition at line 87 of file V9990SDLRasterizer.cc.
References openmsx::FrameSource::EVEN, openmsx::V9990::getEvenOdd(), openmsx::V9990::isInterlaced(), openmsx::FrameSource::NONINTERLACED, and openmsx::FrameSource::ODD.
|
overridevirtual |
Indicates the start of a new frame.
Implements openmsx::V9990Rasterizer.
Definition at line 68 of file V9990SDLRasterizer.cc.
References openmsx::V9990DisplayPeriod::blank, openmsx::V9990DisplayPeriod::border1, openmsx::V9990DisplayPeriod::display, openmsx::V9990::getHorizontalTiming(), and openmsx::V9990::getVerticalTiming().
|
overridevirtual |
See V9990::getPostProcessor().
Implements openmsx::V9990Rasterizer.
Definition at line 49 of file V9990SDLRasterizer.cc.
|
overridevirtual |
Will the output of this Rasterizer be displayed? There is no point in producing a frame that will not be displayed.
TODO: Is querying the next pipeline step the best way to solve this, or is it better to explicitly disable the first step in the pipeline?
Implements openmsx::V9990Rasterizer.
Definition at line 54 of file V9990SDLRasterizer.cc.
References openmsx::MSXDevice::getMotherBoard(), openmsx::MSXMotherBoard::isActive(), and openmsx::MSXMotherBoard::isFastForwarding().
|
overridevirtual |
Is video recording active?
Implements openmsx::V9990Rasterizer.
Definition at line 344 of file V9990SDLRasterizer.cc.
|
delete |
|
delete |
void openmsx::V9990SDLRasterizer::preCalcPalettes | ( | ) |
Fill the palettes.
Definition at line 271 of file V9990SDLRasterizer.cc.
References enumerate(), g, openmsx::RenderSettings::isColorMatrixIdentity(), openmsx::OutputSurface::mapRGB(), openmsx::OutputSurface::mapRGB255(), resetPalette(), openmsx::RenderSettings::transformComponent(), openmsx::RenderSettings::transformRGB(), and xrange().
Referenced by V9990SDLRasterizer().
|
overridevirtual |
Resynchronize with VDP - flush caches etc.
Implements openmsx::V9990Rasterizer.
Definition at line 61 of file V9990SDLRasterizer.cc.
References openmsx::V9990::getColorMode(), openmsx::V9990::getDisplayMode(), resetPalette(), setColorMode(), and setDisplayMode().
void openmsx::V9990SDLRasterizer::resetPalette | ( | ) |
Definition at line 327 of file V9990SDLRasterizer.cc.
References g, openmsx::OutputSurface::getKeyColor(), openmsx::V9990::getPalette(), openmsx::V9990::isSuperimposing(), setPalette(), and xrange().
Referenced by preCalcPalettes(), reset(), and setSuperimpose().
|
overridevirtual |
The color mode determines how the V9990 VRAM data gets converted to pixel colors.
colorMode | The new color mode. |
Implements openmsx::V9990Rasterizer.
Definition at line 102 of file V9990SDLRasterizer.cc.
References openmsx::V9990BitmapConverter::setColorMode().
Referenced by reset().
|
overridevirtual |
The display mode determines the screens geometry and how V9990 pixels are mapped to pixels on screen.
displayMode | The new display mode. |
Implements openmsx::V9990Rasterizer.
Definition at line 96 of file V9990SDLRasterizer.cc.
References openmsx::V9990BitmapConverter::setColorMode().
Referenced by reset().
|
overridevirtual |
Set RGB values for a palette entry.
index | Index in palette |
r | Red component intensity (5 bits) |
g | Green component intensity (5 bits) |
b | Blue component intensity (5 bits) |
ys | Is this entry transparent |
Implements openmsx::V9990Rasterizer.
Definition at line 318 of file V9990SDLRasterizer.cc.
References g, and openmsx::OutputSurface::getKeyColor().
Referenced by resetPalette().
|
overridevirtual |
Is superimpose enabled?
Implements openmsx::V9990Rasterizer.
Definition at line 339 of file V9990SDLRasterizer.cc.
References resetPalette().
|
overridevirtualnoexcept |
Implements openmsx::Observer< Setting >.
Definition at line 349 of file V9990SDLRasterizer.cc.
References setting.