openMSX
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
openmsx::Renderer Class Referenceabstract

Abstract base class for Renderers. More...

#include <Renderer.hh>

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

Public Member Functions

virtual ~Renderer ()=default
 
virtual PostProcessorgetPostProcessor () const =0
 See VDP::getPostProcessor. More...
 
virtual void reInit ()=0
 Reinitialise 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 (int color, EmuTime::param time)=0
 Informs the renderer of a VDP foreground color change. More...
 
virtual void updateBackgroundColor (int color, EmuTime::param time)=0
 Informs the renderer of a VDP background color change. More...
 
virtual void updateBlinkForegroundColor (int color, EmuTime::param time)=0
 Informs the renderer of a VDP blink foreground color change. More...
 
virtual void updateBlinkBackgroundColor (int 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 (int 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 (int addr, EmuTime::param time)=0
 Informs the renderer of a name table base address change. More...
 
virtual void updatePatternBase (int addr, EmuTime::param time)=0
 Informs the renderer of a pattern table base address change. More...
 
virtual void updateColorBase (int 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...
 
- Public Member Functions inherited from openmsx::VRAMObserver
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...
 

Static Public Attributes

static const uint16_t GRAPHIC7_SPRITE_PALETTE [16]
 Sprite palette in Graphic 7 mode. More...
 

Protected Member Functions

 Renderer ()=default
 
- Protected Member Functions inherited from openmsx::VRAMObserver
 ~VRAMObserver ()=default
 

Detailed Description

Abstract base class for Renderers.

A Renderer is a class that converts VDP state to visual information (for example, pixels on a screen).

The update methods are called exactly before the change occurs in the VDP, so that the renderer can update itself to the specified time using the old settings.

Definition at line 22 of file Renderer.hh.

Constructor & Destructor Documentation

◆ ~Renderer()

virtual openmsx::Renderer::~Renderer ( )
virtualdefault

◆ Renderer()

openmsx::Renderer::Renderer ( )
protecteddefault

Member Function Documentation

◆ frameEnd()

virtual void openmsx::Renderer::frameEnd ( EmuTime::param  time)
pure virtual

Signals the end of a frame.

Parameters
timeThe moment in emulated time the frame ends. Note: this is the same time stamp as the start of the next frame.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ frameStart()

virtual void openmsx::Renderer::frameStart ( EmuTime::param  time)
pure virtual

Signals the start of a new frame.

The Renderer can use this to get fixed-per-frame settings from the VDP, such as PAL/NTSC timing.

Parameters
timeThe moment in emulated time the frame starts.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ getPostProcessor()

virtual PostProcessor* openmsx::Renderer::getPostProcessor ( ) const
pure virtual

◆ reInit()

virtual void openmsx::Renderer::reInit ( )
pure virtual

Reinitialise Renderer state.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateBackgroundColor()

virtual void openmsx::Renderer::updateBackgroundColor ( int  color,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP background color change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateBlinkBackgroundColor()

virtual void openmsx::Renderer::updateBlinkBackgroundColor ( int  color,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP blink background color change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateBlinkForegroundColor()

virtual void openmsx::Renderer::updateBlinkForegroundColor ( int  color,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP blink foreground color change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateBlinkState()

virtual void openmsx::Renderer::updateBlinkState ( bool  enabled,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP blinking state change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateBorderMask()

virtual void openmsx::Renderer::updateBorderMask ( bool  masked,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateColorBase()

virtual void openmsx::Renderer::updateColorBase ( int  addr,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a color table base address change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateDisplayEnabled()

virtual void openmsx::Renderer::updateDisplayEnabled ( bool  enabled,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

Referenced by openmsx::VDPVRAM::updateDisplayEnabled().

◆ updateDisplayMode()

virtual void openmsx::Renderer::updateDisplayMode ( DisplayMode  mode,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP display mode change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

Referenced by openmsx::VDPVRAM::updateDisplayMode().

◆ updateForegroundColor()

virtual void openmsx::Renderer::updateForegroundColor ( int  color,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP foreground color change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateHorizontalAdjust()

virtual void openmsx::Renderer::updateHorizontalAdjust ( int  adjust,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateHorizontalScrollHigh()

virtual void openmsx::Renderer::updateHorizontalScrollHigh ( byte  scroll,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateHorizontalScrollLow()

virtual void openmsx::Renderer::updateHorizontalScrollLow ( byte  scroll,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateMultiPage()

virtual void openmsx::Renderer::updateMultiPage ( bool  multiPage,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateNameBase()

virtual void openmsx::Renderer::updateNameBase ( int  addr,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a name table base address change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updatePalette()

virtual void openmsx::Renderer::updatePalette ( int  index,
int  grb,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updatePatternBase()

virtual void openmsx::Renderer::updatePatternBase ( int  addr,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a pattern table base address change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateSpritesEnabled()

virtual void openmsx::Renderer::updateSpritesEnabled ( bool  enabled,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a VDP sprites enabled change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

Referenced by openmsx::VDPVRAM::updateSpritesEnabled().

◆ updateSuperimposing()

virtual void openmsx::Renderer::updateSuperimposing ( const RawFrame videoSource,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateTransparency()

virtual void openmsx::Renderer::updateTransparency ( bool  enabled,
EmuTime::param  time 
)
pure virtual

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

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

◆ updateVerticalScroll()

virtual void openmsx::Renderer::updateVerticalScroll ( int  scroll,
EmuTime::param  time 
)
pure virtual

Informs the renderer of a vertical scroll change.

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

Implemented in openmsx::PixelRenderer, and openmsx::DummyRenderer.

Member Data Documentation

◆ GRAPHIC7_SPRITE_PALETTE

const uint16_t openmsx::Renderer::GRAPHIC7_SPRITE_PALETTE
static
Initial value:
= {
0x000, 0x002, 0x030, 0x032, 0x300, 0x302, 0x330, 0x332,
0x472, 0x007, 0x070, 0x077, 0x700, 0x707, 0x770, 0x777
}

Sprite palette in Graphic 7 mode.

Each palette entry is a word in GRB format: bit 10..8 is green, bit 6..4 is red and bit 2..0 is blue.

Definition at line 184 of file Renderer.hh.

Referenced by openmsx::SDLRasterizer< Pixel >::setTransparency().


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