openMSX
|
Rasterizer using a frame buffer approach: it writes pixels to a single rectangular pixel buffer. More...
#include <SDLRasterizer.hh>
Public Types | |
using | Pixel = uint32_t |
Public Member Functions | |
SDLRasterizer (VDP &vdp, Display &display, OutputSurface &screen, std::unique_ptr< PostProcessor > postProcessor) | |
SDLRasterizer (const SDLRasterizer &)=delete | |
SDLRasterizer (SDLRasterizer &&)=delete | |
SDLRasterizer & | operator= (const SDLRasterizer &)=delete |
SDLRasterizer & | operator= (SDLRasterizer &&)=delete |
~SDLRasterizer () override | |
PostProcessor * | getPostProcessor () const override |
See VDP::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: all cached states are flushed. | |
void | frameStart (EmuTime::param time) override |
Indicates the start of a new frame. | |
void | frameEnd () override |
Indicates the end of the current frame. | |
void | setDisplayMode (DisplayMode mode) override |
Precalc several values that depend on the display mode. | |
void | setPalette (unsigned index, int grb) override |
Change an entry in the palette. | |
void | setBackgroundColor (byte index) override |
Changes the background color. | |
void | setHorizontalAdjust (int adjust) override |
void | setHorizontalScrollLow (byte scroll) override |
void | setBorderMask (bool masked) override |
void | setTransparency (bool enabled) override |
void | setSuperimposeVideoFrame (const RawFrame *videoSource) override |
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 displayX, int displayY, int displayWidth, int displayHeight) override |
Render a rectangle of display pixels on the host screen. | |
void | drawSprites (int fromX, int fromY, int displayX, int displayY, int displayWidth, int displayHeight) override |
Render a rectangle of sprite pixels on the host screen. | |
bool | isRecording () const override |
Is video recording active? | |
Public Member Functions inherited from openmsx::Rasterizer | |
virtual | ~Rasterizer ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from openmsx::Rasterizer | |
Rasterizer ()=default | |
Rasterizer using a frame buffer approach: it writes pixels to a single rectangular pixel buffer.
Definition at line 28 of file SDLRasterizer.hh.
using openmsx::SDLRasterizer::Pixel = uint32_t |
Definition at line 32 of file SDLRasterizer.hh.
openmsx::SDLRasterizer::SDLRasterizer | ( | VDP & | vdp, |
Display & | display, | ||
OutputSurface & | screen, | ||
std::unique_ptr< PostProcessor > | postProcessor | ||
) |
Definition at line 91 of file SDLRasterizer.cc.
References openmsx::Subject< T >::attach(), openmsx::RenderSettings::getBrightnessSetting(), openmsx::RenderSettings::getColorMatrixSetting(), openmsx::RenderSettings::getContrastSetting(), openmsx::RenderSettings::getGammaSetting(), openmsx::VDP::isMSX1VDP(), and xrange().
|
delete |
|
delete |
|
override |
|
overridevirtual |
Render a rectangle of border pixels on the host screen.
The units are absolute lines (Y) and VDP clock 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::Rasterizer.
Definition at line 399 of file SDLRasterizer.cc.
References openmsx::VDP::getDisplayMode(), openmsx::DisplayMode::getLineWidth(), openmsx::VDP::TICKS_PER_LINE, and xrange().
|
overridevirtual |
Render a rectangle of display pixels on the host screen.
fromX | X coordinate of render start in VDP ticks. |
fromY | Y coordinate of render start in absolute lines. |
displayX | display coordinate of render start: [0..512). |
displayY | display coordinate of render start: [0..256). |
displayWidth | rectangle width in pixels (512 per line). |
displayHeight | rectangle height in lines. |
Implements openmsx::Rasterizer.
Definition at line 436 of file SDLRasterizer.cc.
References openmsx::CharacterConverter::convertLine(), ranges::copy(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getEvenOddMask(), openmsx::VDP::getHorizontalScrollHigh(), openmsx::VDP::getLeftBackground(), openmsx::DisplayMode::getLineWidth(), openmsx::VRAMWindow::getMask(), openmsx::DisplayMode::isBitmapMode(), openmsx::VDP::isMSX1VDP(), openmsx::VDP::isMultiPageScrolling(), openmsx::DisplayMode::isPlanar(), openmsx::DisplayMode::isTextMode(), openmsx::VDPVRAM::nameTable, subspan(), and xrange().
|
overridevirtual |
Render a rectangle of sprite pixels on the host screen.
Although the parameters are very similar to drawDisplay, the displayX and displayWidth use range [0..256) instead of [0..512) because VDP sprite coordinates work that way.
fromX | X coordinate of render start in VDP ticks. |
fromY | Y coordinate of render start in absolute lines. |
displayX | display coordinate of render start: [0..256). |
displayY | display coordinate of render start: [0..256). |
displayWidth | rectangle width in pixels (256 per line). |
displayHeight | rectangle height in lines. |
Implements openmsx::Rasterizer.
Definition at line 565 of file SDLRasterizer.cc.
References openmsx::SpriteConverter::drawMode1(), openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getLeftSprites(), openmsx::DisplayMode::getLineWidth(), openmsx::DisplayMode::getSpriteMode(), openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, and openmsx::VDP::isMSX1VDP().
|
overridevirtual |
Indicates the end of the current frame.
The rasterizer can perform image post processing.
Implements openmsx::Rasterizer.
Definition at line 182 of file SDLRasterizer.cc.
|
overridevirtual |
Indicates the start of a new frame.
The rasterizer can fetch per-frame settings from the VDP.
Implements openmsx::Rasterizer.
Definition at line 166 of file SDLRasterizer.cc.
References openmsx::FrameSource::EVEN, openmsx::VDP::getEvenOdd(), openmsx::VDP::isInterlaced(), openmsx::VDP::isPalTiming(), openmsx::FrameSource::NONINTERLACED, and openmsx::FrameSource::ODD.
|
overridevirtual |
Implements openmsx::Rasterizer.
Definition at line 128 of file SDLRasterizer.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::Rasterizer.
Definition at line 133 of file SDLRasterizer.cc.
References openmsx::MSXDevice::getMotherBoard(), openmsx::MSXMotherBoard::isActive(), and openmsx::MSXMotherBoard::isFastForwarding().
|
overridevirtual |
Is video recording active?
Implements openmsx::Rasterizer.
Definition at line 621 of file SDLRasterizer.cc.
|
delete |
|
delete |
|
overridevirtual |
Resynchronize with VDP: all cached states are flushed.
Implements openmsx::Rasterizer.
Definition at line 140 of file SDLRasterizer.cc.
References openmsx::VDP::getDisplayMode(), openmsx::VDP::getTransparency(), setDisplayMode(), and openmsx::SpriteConverter::setTransparency().
|
overridevirtual |
Changes the background color.
index | Palette index of the new background color. |
Implements openmsx::Rasterizer.
Definition at line 214 of file SDLRasterizer.cc.
References openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getTransparency(), openmsx::DisplayMode::GRAPHIC7, and openmsx::VDP::isSuperimposing().
|
overridevirtual |
Implements openmsx::Rasterizer.
Definition at line 230 of file SDLRasterizer.cc.
|
overridevirtual |
Precalc several values that depend on the display mode.
mode | The new display mode. |
Implements openmsx::Rasterizer.
Definition at line 186 of file SDLRasterizer.cc.
References openmsx::VDP::getBackgroundColor(), openmsx::DisplayMode::getByte(), openmsx::VDP::getTransparency(), openmsx::DisplayMode::GRAPHIC7, openmsx::DisplayMode::isBitmapMode(), openmsx::VDP::isSuperimposing(), openmsx::CharacterConverter::setDisplayMode(), openmsx::BitmapConverter::setDisplayMode(), openmsx::SpriteConverter::setDisplayMode(), and openmsx::SpriteConverter::setPalette().
Referenced by reset().
|
overridevirtual |
Implements openmsx::Rasterizer.
Definition at line 222 of file SDLRasterizer.cc.
|
overridevirtual |
Implements openmsx::Rasterizer.
Definition at line 226 of file SDLRasterizer.cc.
|
overridevirtual |
Change an entry in the palette.
index | The index [0..15] in the palette that changes. |
grb | The new definition for the changed palette index: bit 10..8 is green, bit 6..4 is red and bit 2..0 is blue; all other bits are zero. |
Implements openmsx::Rasterizer.
Definition at line 201 of file SDLRasterizer.cc.
References openmsx::VDP::getBackgroundColor(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getTransparency(), openmsx::VDP::isSuperimposing(), and openmsx::BitmapConverter::palette16Changed().
|
overridevirtual |
Implements openmsx::Rasterizer.
Definition at line 159 of file SDLRasterizer.cc.
References openmsx::VDP::getBackgroundColor(), openmsx::VDP::getDisplayMode(), and openmsx::VDP::getTransparency().
|
overridevirtual |
Implements openmsx::Rasterizer.
Definition at line 234 of file SDLRasterizer.cc.
References openmsx::VDP::getBackgroundColor(), openmsx::VDP::getDisplayMode(), openmsx::VDP::isSuperimposing(), and openmsx::SpriteConverter::setTransparency().