openMSX
Public Types | Public Member Functions | List of all members
openmsx::V9990SDLRasterizer Class Referencefinal

Rasterizer using SDL. More...

#include <V9990SDLRasterizer.hh>

Inheritance diagram for openmsx::V9990SDLRasterizer:
Inheritance graph
[legend]
Collaboration diagram for openmsx::V9990SDLRasterizer:
Collaboration graph
[legend]

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
 
V9990SDLRasterizeroperator= (const V9990SDLRasterizer &)=delete
 
V9990SDLRasterizeroperator= (V9990SDLRasterizer &&)=delete
 
 ~V9990SDLRasterizer () override
 
PostProcessorgetPostProcessor () 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
 

Detailed Description

Rasterizer using SDL.

Definition at line 27 of file V9990SDLRasterizer.hh.

Member Typedef Documentation

◆ Pixel

Definition at line 31 of file V9990SDLRasterizer.hh.

Constructor & Destructor Documentation

◆ V9990SDLRasterizer() [1/3]

openmsx::V9990SDLRasterizer::V9990SDLRasterizer ( V9990 vdp,
Display display,
OutputSurface screen,
std::unique_ptr< PostProcessor postProcessor 
)

◆ V9990SDLRasterizer() [2/3]

openmsx::V9990SDLRasterizer::V9990SDLRasterizer ( const V9990SDLRasterizer )
delete

◆ V9990SDLRasterizer() [3/3]

openmsx::V9990SDLRasterizer::V9990SDLRasterizer ( V9990SDLRasterizer &&  )
delete

◆ ~V9990SDLRasterizer()

openmsx::V9990SDLRasterizer::~V9990SDLRasterizer ( )
override

Member Function Documentation

◆ drawBorder()

void openmsx::V9990SDLRasterizer::drawBorder ( int  fromX,
int  fromY,
int  limitX,
int  limitY 
)
overridevirtual

Render a rectangle of border pixels on the host screen.

The units are absolute lines (Y) and V9990 UC ticks (X).

Parameters
fromXX coordinate of render start (inclusive).
fromYY coordinate of render start (inclusive).
limitXX coordinate of render end (exclusive).
limitYY 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().

◆ drawBxMode()

void openmsx::V9990SDLRasterizer::drawBxMode ( int  fromX,
int  fromY,
int  displayX,
int  displayY,
int  displayYA,
int  displayWidth,
int  displayHeight,
bool  drawSprites 
)

◆ drawDisplay()

void openmsx::V9990SDLRasterizer::drawDisplay ( int  fromX,
int  fromY,
int  toX,
int  toY,
int  displayX,
int  displayY,
int  displayYA,
int  displayYB 
)
overridevirtual

Render a rectangle of display pixels on the host screen.

Parameters
fromXX coordinate of render start in V9990 UC ticks.
fromYY coordinate of render start in absolute lines.
toXX coordinate of render stop in V9990 UC ticks (exclusive).
toYY coordinate of render stop in absolute lines (exclusive).
displayXdisplay coordinate of render start: [0..640).
displayYdisplay coordinate of render start: [0..480).
displayYAsimilar to displayY but specific for plane A
displayYBsimilar 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().

◆ drawP1Mode()

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().

◆ drawP2Mode()

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().

◆ frameEnd()

void openmsx::V9990SDLRasterizer::frameEnd ( EmuTime::param  time)
overridevirtual

◆ frameStart()

void openmsx::V9990SDLRasterizer::frameStart ( )
overridevirtual

◆ getPostProcessor()

PostProcessor * openmsx::V9990SDLRasterizer::getPostProcessor ( ) const
overridevirtual

See V9990::getPostProcessor().

Implements openmsx::V9990Rasterizer.

Definition at line 49 of file V9990SDLRasterizer.cc.

◆ isActive()

bool openmsx::V9990SDLRasterizer::isActive ( )
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().

◆ isRecording()

bool openmsx::V9990SDLRasterizer::isRecording ( ) const
overridevirtual

Is video recording active?

Implements openmsx::V9990Rasterizer.

Definition at line 344 of file V9990SDLRasterizer.cc.

◆ operator=() [1/2]

V9990SDLRasterizer & openmsx::V9990SDLRasterizer::operator= ( const V9990SDLRasterizer )
delete

◆ operator=() [2/2]

V9990SDLRasterizer & openmsx::V9990SDLRasterizer::operator= ( V9990SDLRasterizer &&  )
delete

◆ preCalcPalettes()

void openmsx::V9990SDLRasterizer::preCalcPalettes ( )

◆ reset()

void openmsx::V9990SDLRasterizer::reset ( )
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().

◆ resetPalette()

void openmsx::V9990SDLRasterizer::resetPalette ( )

◆ setColorMode()

void openmsx::V9990SDLRasterizer::setColorMode ( V9990ColorMode  colorMode)
overridevirtual

The color mode determines how the V9990 VRAM data gets converted to pixel colors.

Parameters
colorModeThe new color mode.

Implements openmsx::V9990Rasterizer.

Definition at line 102 of file V9990SDLRasterizer.cc.

References openmsx::V9990BitmapConverter::setColorMode().

Referenced by reset().

◆ setDisplayMode()

void openmsx::V9990SDLRasterizer::setDisplayMode ( V9990DisplayMode  displayMode)
overridevirtual

The display mode determines the screens geometry and how V9990 pixels are mapped to pixels on screen.

Parameters
displayModeThe new display mode.

Implements openmsx::V9990Rasterizer.

Definition at line 96 of file V9990SDLRasterizer.cc.

References openmsx::V9990BitmapConverter::setColorMode().

Referenced by reset().

◆ setPalette()

void openmsx::V9990SDLRasterizer::setPalette ( int  index,
byte  r,
byte  g,
byte  b,
bool  ys 
)
overridevirtual

Set RGB values for a palette entry.

Parameters
indexIndex in palette
rRed component intensity (5 bits)
gGreen component intensity (5 bits)
bBlue component intensity (5 bits)
ysIs this entry transparent

Implements openmsx::V9990Rasterizer.

Definition at line 318 of file V9990SDLRasterizer.cc.

References g, and openmsx::OutputSurface::getKeyColor().

Referenced by resetPalette().

◆ setSuperimpose()

void openmsx::V9990SDLRasterizer::setSuperimpose ( bool  enabled)
overridevirtual

Is superimpose enabled?

Implements openmsx::V9990Rasterizer.

Definition at line 339 of file V9990SDLRasterizer.cc.

References resetPalette().

◆ update()

void openmsx::V9990SDLRasterizer::update ( const Setting setting)
overridevirtualnoexcept

Implements openmsx::Observer< Setting >.

Definition at line 349 of file V9990SDLRasterizer.cc.

References setting.


The documentation for this class was generated from the following files: