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

Generic implementation of a pixel-based Renderer. More...

#include <PixelRenderer.hh>

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

Public Member Functions

 PixelRenderer (VDP &vdp, Display &display)
 
 ~PixelRenderer () override
 
PostProcessorgetPostProcessor () const override
 See VDP::getPostProcessor. More...
 
void reInit () override
 Reinitialize Renderer state. More...
 
void frameStart (EmuTime::param time) override
 Signals the start of a new frame. More...
 
void frameEnd (EmuTime::param time) override
 Signals the end of a frame. More...
 
void updateHorizontalScrollLow (byte scroll, EmuTime::param time) override
 Informs the renderer of a horizontal scroll change: the lower scroll value has changed. More...
 
void updateHorizontalScrollHigh (byte scroll, EmuTime::param time) override
 Informs the renderer of a horizontal scroll change: the higher scroll value has changed. More...
 
void updateBorderMask (bool masked, EmuTime::param time) override
 Informs the renderer of a horizontal scroll change: the border mask has been enabled/disabled. More...
 
void updateMultiPage (bool multiPage, EmuTime::param time) override
 Informs the renderer of a horizontal scroll change: the multi page setting has changed. More...
 
void updateTransparency (bool enabled, EmuTime::param time) override
 Informs the renderer of a VDP transparency enable/disable change. More...
 
void updateSuperimposing (const RawFrame *videoSource, EmuTime::param time) override
 Informs the renderer of a VDP superimposing change. More...
 
void updateForegroundColor (byte color, EmuTime::param time) override
 Informs the renderer of a VDP foreground color change. More...
 
void updateBackgroundColor (byte color, EmuTime::param time) override
 Informs the renderer of a VDP background color change. More...
 
void updateBlinkForegroundColor (byte color, EmuTime::param time) override
 Informs the renderer of a VDP blink foreground color change. More...
 
void updateBlinkBackgroundColor (byte color, EmuTime::param time) override
 Informs the renderer of a VDP blink background color change. More...
 
void updateBlinkState (bool enabled, EmuTime::param time) override
 Informs the renderer of a VDP blinking state change. More...
 
void updatePalette (unsigned index, int grb, EmuTime::param time) override
 Informs the renderer of a VDP palette change. More...
 
void updateVerticalScroll (int scroll, EmuTime::param time) override
 Informs the renderer of a vertical scroll change. More...
 
void updateHorizontalAdjust (int adjust, EmuTime::param time) override
 Informs the renderer of a horizontal adjust change. More...
 
void updateDisplayEnabled (bool enabled, EmuTime::param time) override
 Informs the renderer of a VDP display enabled change. More...
 
void updateDisplayMode (DisplayMode mode, EmuTime::param time) override
 Informs the renderer of a VDP display mode change. More...
 
void updateNameBase (unsigned addr, EmuTime::param time) override
 Informs the renderer of a name table base address change. More...
 
void updatePatternBase (unsigned addr, EmuTime::param time) override
 Informs the renderer of a pattern table base address change. More...
 
void updateColorBase (unsigned addr, EmuTime::param time) override
 Informs the renderer of a color table base address change. More...
 
void updateSpritesEnabled (bool enabled, EmuTime::param time) override
 Informs the renderer of a VDP sprites enabled change. More...
 
void updateVRAM (unsigned offset, EmuTime::param time) override
 Informs the observer of a change in VRAM contents. More...
 
void updateWindow (bool enabled, EmuTime::param time) override
 Informs the observer that the entire VRAM window will change. More...
 
- Public Member Functions inherited from openmsx::Renderer
virtual ~Renderer ()=default
 
virtual PostProcessorgetPostProcessor () const =0
 See VDP::getPostProcessor. More...
 
virtual void reInit ()=0
 Reinitialize Renderer state. More...
 
virtual void frameStart (EmuTime::param time)=0
 Signals the start of a new frame. More...
 
virtual void frameEnd (EmuTime::param time)=0
 Signals the end of a frame. More...
 
virtual void updateTransparency (bool enabled, EmuTime::param time)=0
 Informs the renderer of a VDP transparency enable/disable change. More...
 
virtual void updateSuperimposing (const RawFrame *videoSource, EmuTime::param time)=0
 Informs the renderer of a VDP superimposing change. More...
 
virtual void updateForegroundColor (byte color, EmuTime::param time)=0
 Informs the renderer of a VDP foreground color change. More...
 
virtual void updateBackgroundColor (byte color, EmuTime::param time)=0
 Informs the renderer of a VDP background color change. More...
 
virtual void updateBlinkForegroundColor (byte color, EmuTime::param time)=0
 Informs the renderer of a VDP blink foreground color change. More...
 
virtual void updateBlinkBackgroundColor (byte color, EmuTime::param time)=0
 Informs the renderer of a VDP blink background color change. More...
 
virtual void updateBlinkState (bool enabled, EmuTime::param time)=0
 Informs the renderer of a VDP blinking state change. More...
 
virtual void updatePalette (unsigned index, int grb, EmuTime::param time)=0
 Informs the renderer of a VDP palette change. More...
 
virtual void updateVerticalScroll (int scroll, EmuTime::param time)=0
 Informs the renderer of a vertical scroll change. More...
 
virtual void updateHorizontalScrollLow (byte scroll, EmuTime::param time)=0
 Informs the renderer of a horizontal scroll change: the lower scroll value has changed. More...
 
virtual void updateHorizontalScrollHigh (byte scroll, EmuTime::param time)=0
 Informs the renderer of a horizontal scroll change: the higher scroll value has changed. More...
 
virtual void updateBorderMask (bool masked, EmuTime::param time)=0
 Informs the renderer of a horizontal scroll change: the border mask has been enabled/disabled. More...
 
virtual void updateMultiPage (bool multiPage, EmuTime::param time)=0
 Informs the renderer of a horizontal scroll change: the multi page setting has changed. More...
 
virtual void updateHorizontalAdjust (int adjust, EmuTime::param time)=0
 Informs the renderer of a horizontal adjust change. More...
 
virtual void updateDisplayEnabled (bool enabled, EmuTime::param time)=0
 Informs the renderer of a VDP display enabled change. More...
 
virtual void updateDisplayMode (DisplayMode mode, EmuTime::param time)=0
 Informs the renderer of a VDP display mode change. More...
 
virtual void updateNameBase (unsigned addr, EmuTime::param time)=0
 Informs the renderer of a name table base address change. More...
 
virtual void updatePatternBase (unsigned addr, EmuTime::param time)=0
 Informs the renderer of a pattern table base address change. More...
 
virtual void updateColorBase (unsigned addr, EmuTime::param time)=0
 Informs the renderer of a color table base address change. More...
 
virtual void updateSpritesEnabled (bool enabled, EmuTime::param time)=0
 Informs the renderer of a VDP sprites enabled change. More...
 
virtual void updateVRAM (unsigned offset, EmuTime::param time)=0
 Informs the observer of a change in VRAM contents. More...
 
virtual void updateWindow (bool enabled, EmuTime::param time)=0
 Informs the observer that the entire VRAM window will change. More...
 

Additional Inherited Members

- Static Public Attributes inherited from openmsx::Renderer
static constexpr std::array< uint16_t, 16 > GRAPHIC7_SPRITE_PALETTE
 Sprite palette in Graphic 7 mode. More...
 
- Protected Member Functions inherited from openmsx::Renderer
 Renderer ()=default
 
- Protected Member Functions inherited from openmsx::VRAMObserver
 ~VRAMObserver ()=default
 

Detailed Description

Generic implementation of a pixel-based Renderer.

Uses a Rasterizer to plot actual pixels for a specific video system.

Definition at line 29 of file PixelRenderer.hh.

Constructor & Destructor Documentation

◆ PixelRenderer()

openmsx::PixelRenderer::PixelRenderer ( VDP vdp,
Display display 
)

◆ ~PixelRenderer()

openmsx::PixelRenderer::~PixelRenderer ( )
override

Member Function Documentation

◆ frameEnd()

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

◆ frameStart()

void openmsx::PixelRenderer::frameStart ( EmuTime::param  time)
overridevirtual

◆ getPostProcessor()

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

See VDP::getPostProcessor.

Implements openmsx::Renderer.

Definition at line 142 of file PixelRenderer.cc.

◆ reInit()

void openmsx::PixelRenderer::reInit ( )
overridevirtual

Reinitialize Renderer state.

Implements openmsx::Renderer.

Definition at line 147 of file PixelRenderer.cc.

References openmsx::VDP::isDisplayEnabled().

Referenced by PixelRenderer().

◆ updateBackgroundColor()

void openmsx::PixelRenderer::updateBackgroundColor ( byte  color,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP background color change.

Parameters
colorThe new background color.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 300 of file PixelRenderer.cc.

◆ updateBlinkBackgroundColor()

void openmsx::PixelRenderer::updateBlinkBackgroundColor ( byte  color,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP blink background color change.

Parameters
colorThe new blink background color.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 313 of file PixelRenderer.cc.

◆ updateBlinkForegroundColor()

void openmsx::PixelRenderer::updateBlinkForegroundColor ( byte  color,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP blink foreground color change.

Parameters
colorThe new blink foreground color.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 307 of file PixelRenderer.cc.

◆ updateBlinkState()

void openmsx::PixelRenderer::updateBlinkState ( bool  enabled,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP blinking state change.

Parameters
enabledThe new blink state.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 319 of file PixelRenderer.cc.

◆ updateBorderMask()

void openmsx::PixelRenderer::updateBorderMask ( bool  masked,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a horizontal scroll change: the border mask has been enabled/disabled.

Parameters
maskedtrue iff enabled.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 267 of file PixelRenderer.cc.

◆ updateColorBase()

void openmsx::PixelRenderer::updateColorBase ( unsigned  addr,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a color table base address change.

Parameters
addrThe new base address.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 391 of file PixelRenderer.cc.

◆ updateDisplayEnabled()

void openmsx::PixelRenderer::updateDisplayEnabled ( bool  enabled,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP display enabled change.

Both the regular border start/end and forced blanking by clearing the display enable bit are considered display enabled changes.

Parameters
enabledThe new display enabled state.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 159 of file PixelRenderer.cc.

◆ updateDisplayMode()

void openmsx::PixelRenderer::updateDisplayMode ( DisplayMode  mode,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP display mode change.

Parameters
modeThe new display mode.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 364 of file PixelRenderer.cc.

References openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::DisplayMode::GRAPHIC5, and openmsx::DisplayMode::GRAPHIC7.

◆ updateForegroundColor()

void openmsx::PixelRenderer::updateForegroundColor ( byte  color,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP foreground color change.

Parameters
colorThe new foreground color.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 294 of file PixelRenderer.cc.

◆ updateHorizontalAdjust()

void openmsx::PixelRenderer::updateHorizontalAdjust ( int  adjust,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a horizontal adjust change.

Note that there is no similar method for vertical adjust updates, because vertical adjust is calculated at start of frame and then fixed.

Parameters
adjustThe new adjust value.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 357 of file PixelRenderer.cc.

◆ updateHorizontalScrollHigh()

void openmsx::PixelRenderer::updateHorizontalScrollHigh ( byte  scroll,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a horizontal scroll change: the higher scroll value has changed.

Parameters
scrollThe new scroll value.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 261 of file PixelRenderer.cc.

◆ updateHorizontalScrollLow()

void openmsx::PixelRenderer::updateHorizontalScrollLow ( byte  scroll,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a horizontal scroll change: the lower scroll value has changed.

Parameters
scrollThe new scroll value.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 254 of file PixelRenderer.cc.

◆ updateMultiPage()

void openmsx::PixelRenderer::updateMultiPage ( bool  multiPage,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a horizontal scroll change: the multi page setting has changed.

Parameters
multiPageThe new multi page flag.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 274 of file PixelRenderer.cc.

◆ updateNameBase()

void openmsx::PixelRenderer::updateNameBase ( unsigned  addr,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a name table base address change.

Parameters
addrThe new base address.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 379 of file PixelRenderer.cc.

◆ updatePalette()

void openmsx::PixelRenderer::updatePalette ( unsigned  index,
int  grb,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP palette change.

Parameters
indexThe index [0..15] in the palette that changes.
grbThe 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.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 329 of file PixelRenderer.cc.

References openmsx::VDP::getBackgroundColor(), openmsx::DisplayMode::getBase(), openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::DisplayMode::GRAPHIC5, and openmsx::DisplayMode::GRAPHIC7.

◆ updatePatternBase()

void openmsx::PixelRenderer::updatePatternBase ( unsigned  addr,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a pattern table base address change.

Parameters
addrThe new base address.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 385 of file PixelRenderer.cc.

◆ updateSpritesEnabled()

void openmsx::PixelRenderer::updateSpritesEnabled ( bool  enabled,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP sprites enabled change.

Parameters
enabledThe new sprites enabled state.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 397 of file PixelRenderer.cc.

◆ updateSuperimposing()

void openmsx::PixelRenderer::updateSuperimposing ( const RawFrame videoSource,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP superimposing change.

Parameters
videoSourceVideo that should be superimposed, nullptr if none.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 287 of file PixelRenderer.cc.

◆ updateTransparency()

void openmsx::PixelRenderer::updateTransparency ( bool  enabled,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a VDP transparency enable/disable change.

Parameters
enabledThe new transparency state.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 280 of file PixelRenderer.cc.

◆ updateVerticalScroll()

void openmsx::PixelRenderer::updateVerticalScroll ( int  scroll,
EmuTime::param  time 
)
overridevirtual

Informs the renderer of a vertical scroll change.

Parameters
scrollThe new scroll value.
timeThe moment in emulated time this change occurs.

Implements openmsx::Renderer.

Definition at line 351 of file PixelRenderer.cc.

◆ updateVRAM()

void openmsx::PixelRenderer::updateVRAM ( unsigned  offset,
EmuTime::param  time 
)
overridevirtual

Informs the observer of a change in VRAM contents.

This update is sent just before the change, so the subcomponent can update itself to the given time based on the old contents.

Parameters
offsetOffset of byte that will change, relative to window base address.
timeThe moment in emulated time this change occurs.

Implements openmsx::VRAMObserver.

Definition at line 511 of file PixelRenderer.cc.

◆ updateWindow()

void openmsx::PixelRenderer::updateWindow ( bool  enabled,
EmuTime::param  time 
)
overridevirtual

Informs the observer that the entire VRAM window will change.

This update is sent just before the change, so the subcomponent can update itself to the given time based on the old contents. This happens if the base/index masks are changed, or if the window becomes disabled. TODO: Separate enable/disable from window move?

Parameters
enabledWill the window be enabled after the change? If the observer keeps a cache which is based on VRAM contents, it is only necessary to flush the cache if the new window is enabled, because no reads are allowed from disabled windows.
timeThe moment in emulated time this change occurs.

Implements openmsx::VRAMObserver.

Definition at line 522 of file PixelRenderer.cc.


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