ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
Vdu Class Referencefinal

#include <vdu.h>

Public Types

enum  Bpp : unsigned char { Bpp16 =0, Bpp24 =1, Bpp32 =2 }
 

Public Member Functions

 Vdu (Crtc *crtc=nullptr, GateArray *gatearray=nullptr, Z80 *z80=nullptr)
 
void init (bool full=false, Crtc *crtc=0, GateArray *gatearray=0, Z80 *z80=0)
 
void access_video_memory (int repeat_count)
 
void draw16bpp_border ()
 Border=true, 16 bpp. More...
 
void draw16bpp_nullborder ()
 Border=false, 16 bpp. More...
 
void draw16bpp_mode0 ()
 Mode 0, 16 bpp. More...
 
void draw16bpp_mode1 ()
 Mode 1, 16 bpp. More...
 
void draw16bpp_mode2 ()
 Mode 2, 16 bpp. More...
 
void draw24bpp_border ()
 Border=true, 24 bpp. More...
 
void draw24bpp_nullborder ()
 Border=false, 24 bpp. More...
 
void draw24bpp_mode0 ()
 Mode 0, 24 bpp. More...
 
void draw24bpp_mode1 ()
 Mode 1, 24 bpp. More...
 
void draw24bpp_mode2 ()
 Mode 2, 24 bpp. More...
 
void draw32bpp_border ()
 Border=true, 32 bpp. More...
 
void draw32bpp_nullborder ()
 Border=false, 32 bpp. More...
 
void draw32bpp_mode0 ()
 Mode 0, 32 bpp. More...
 
void draw32bpp_mode1 ()
 Mode 1, 32 bpp. More...
 
void draw32bpp_mode2 ()
 Mode 2, 32 bpp. More...
 
void draw16bppx2_border ()
 Border=true, 16 bpp. More...
 
void draw16bppx2_nullborder ()
 Border=false, 16 bpp. More...
 
void draw16bppx2_mode0 ()
 Mode 0, 16 bpp. More...
 
void draw16bppx2_mode1 ()
 Mode 1, 16 bpp. More...
 
void draw16bppx2_mode2 ()
 Mode 2, 16 bpp. More...
 
void draw24bppx2_border ()
 Border=true, 24 bpp. More...
 
void draw24bppx2_nullborder ()
 Border=false, 24 bpp. More...
 
void draw24bppx2_mode0 ()
 Mode 0, 24 bpp. More...
 
void draw24bppx2_mode1 ()
 Mode 1, 24 bpp. More...
 
void draw24bppx2_mode2 ()
 Mode 2, 24 bpp. More...
 
void draw32bppx2_border ()
 Border=true, 32 bpp. More...
 
void draw32bppx2_nullborder ()
 Border=false, 32 bpp. More...
 
void draw32bppx2_mode0 ()
 Mode 0, 32 bpp. More...
 
void draw32bppx2_mode1 ()
 Mode 1, 32 bpp. More...
 
void draw32bppx2_mode2 ()
 Mode 2, 32 bpp. More...
 
uint hswActive () const
 
uint hswCount () const
 
uint vswCount () const
 
uint hDelay () const
 
uint vDelay () const
 
uint scanline () const
 
uint scanlineMin () const
 
bool frameCompleted () const
 
uint charCount () const
 
uint hCount () const
 
uint hStart () const
 
uint hWidth () const
 
uint vCount () const
 
uint vStart () const
 
uint vHeight () const
 
void setBpp (Bpp bpp)
 
void setBorder (bool border=true)
 
void setLineDoubling (bool doubling=true)
 
void setHswActive (uint value)
 
void setHswCount (uint value)
 
void setVswCount (uint value)
 
void setHDelay (uint value)
 
void setVDelay (uint value)
 
void setScanline (uint value)
 
void setScanlineMin (uint value)
 
void setFrameCompleted (bool value)
 
void setCharCount (uint value)
 
void setHCount (uint value)
 
void setHStart (uint value)
 
void setHWidth (uint value)
 
void setVCount (uint value)
 
void setVStart (uint value)
 
void setVHeight (uint value)
 
void setScrBase (uint *value)
 
void setScrEnd (uint *value)
 
void setScrLineOffset (uint value)
 
void setScrOffset (uint value)
 
void setScrLine (uint value)
 
void setCpcRamBase (tUBYTE *value)
 
void setScale (uchar scale)
 
void doubling ()
 

Public Attributes

~Vdu() ROLAND_DEFAULT typedef void(Vdu typedef void(Vdu::* BorderHandler )()
 

Private Attributes

CrtcmCrtc
 
GateArraymGateArray
 
Z80mZ80
 
Bpp mBpp
 
tREGPAIR addr
 
bool mFrameCompleted
 
bool mBorder
 
bool mLineDoubling
 
uint mHswActive
 
uint mHswCount
 
uint mVswCount
 
uint mHDelay
 
uint mVDelay
 
uint mScanline
 
uint mScanlineMin
 
uint mCharCount
 
uint mHCount
 
uint mHStart
 
uint mHWidth
 
uint mVCount
 
uint mVStart
 
uint mVHeight
 
uintmScrBase
 
uintmScrEnd
 
uint mScrWidth
 
uint mScrHeight
 
uint mScrBpp
 
uint mScrLineOffset
 
uint mScrOffset
 
uint mScrLine
 
uchar mScale
 
tUBYTEmCpcRamBase
 
tUBYTE mode0_table [512]
 
tUBYTE mode1_table [1024]
 
ModeHandler mModeHandler [3][4]
 
BorderHandler mBorderHandler [4]
 
BorderHandler mNullBorderHandler [4]
 
ModeHandler mCurModeHandler
 
BorderHandler mCurBorderHandler
 

Detailed Description

Author
Fred Klaus

Member Enumeration Documentation

enum Bpp : unsigned char
Enumerator
Bpp16 
Bpp24 
Bpp32 

Constructor & Destructor Documentation

Vdu ( Crtc crtc = nullptr,
GateArray gatearray = nullptr,
Z80 z80 = nullptr 
)

Member Function Documentation

void access_video_memory ( int  repeat_count)
Todo:
what the hell is CPC_SCR_HEIGHT ????
Todo:
mZ80->int_pending = 1;// queue interrupt
Todo:
mZ80->int_pending = 1; // queue interrupt

References Crtc::addFlags(), Crtc::addr(), Vdu::addr, Crtc::charCount(), CPC_SCR_HEIGHT, Vdu::doubling(), Crtc::flags(), Crtc::HDT, Crtc::HorizontalDisplayed, Crtc::HorizontalSyncPosition, Crtc::HorizontalTotal, Crtc::HS, Crtc::hsw(), Crtc::hswActive(), Crtc::hswCount(), Crtc::hswVdu(), Crtc::HT, Crtc::incVswCount(), GateArray::intDelay(), Crtc::lastHDisp(), Crtc::lineCount(), Crtc::maxRaster(), Vdu::mBpp, Vdu::mCharCount, Vdu::mCrtc, Vdu::mCurBorderHandler, Vdu::mCurModeHandler, Vdu::mFrameCompleted, Vdu::mGateArray, Vdu::mHCount, Vdu::mHDelay, Vdu::mHStart, Vdu::mHswActive, Vdu::mHswCount, Vdu::mHWidth, Vdu::mModeHandler, Crtc::MR, Vdu::mScale, Vdu::mScanline, Vdu::mScanlineMin, Vdu::mScrBase, Vdu::mScrEnd, Vdu::mScrLine, Vdu::mScrLineOffset, Vdu::mScrOffset, Vdu::mVCount, Vdu::mVDelay, Vdu::mVHeight, Vdu::mVStart, Vdu::mVswCount, Vdu::mZ80, Crtc::rasterCount(), Crtc::read(), Crtc::removeFlags(), Crtc::requestedAddr(), GateArray::requestedMode(), Crtc::setAddr(), Crtc::setCharCount(), Crtc::setHswActive(), Crtc::setHswCount(), GateArray::setIntDelay(), Z80::setIntPending(), Crtc::setLastHDisp(), Crtc::setLineCount(), GateArray::setMode(), Crtc::setRasterCount(), Crtc::setSkew(), GateArray::setSlCount(), Crtc::setVswCount(), Crtc::setVtAdjustCount(), Crtc::skew(), GateArray::slCount(), Z80::stop(), Crtc::VDT, Crtc::VerticalDisplayed, Crtc::VerticalSyncPosition, Crtc::VerticalTotal, Crtc::VS, Crtc::VSf, Crtc::vsw(), Crtc::vswCount(), Crtc::VT, Crtc::vtAdjust(), and Crtc::vtAdjustCount().

Referenced by Cpc::waitstates().

uint charCount ( ) const
inline

References Vdu::mCharCount.

void doubling ( )
inline
void draw16bpp_border ( )

Border=true, 16 bpp.

References Vdu::mGateArray, Vdu::mScrBase, Vdu::mScrOffset, and GateArray::palette().

Referenced by Vdu::init().

void draw16bpp_mode0 ( )
void draw16bpp_mode1 ( )
void draw16bpp_mode2 ( )
void draw16bpp_nullborder ( )

Border=false, 16 bpp.

Todo:
nullborder should clipped from the Screen

References Vdu::mScrOffset.

Referenced by Vdu::init().

void draw16bppx2_border ( )

Border=true, 16 bpp.

References Vdu::mGateArray, Vdu::mScrBase, Vdu::mScrOffset, and GateArray::palette().

Referenced by Vdu::init(), and Vdu::setBorder().

void draw16bppx2_mode0 ( )
void draw16bppx2_mode1 ( )
void draw16bppx2_mode2 ( )
void draw16bppx2_nullborder ( )

Border=false, 16 bpp.

Todo:
nullborder should clipped from the Screen

References Vdu::mScrOffset.

Referenced by Vdu::init(), and Vdu::setBorder().

void draw24bpp_border ( )

Border=true, 24 bpp.

References Vdu::mGateArray, Vdu::mScrBase, Vdu::mScrOffset, and GateArray::palette().

Referenced by Vdu::init().

void draw24bpp_mode0 ( )
void draw24bpp_mode1 ( )
void draw24bpp_mode2 ( )
void draw24bpp_nullborder ( )

Border=false, 24 bpp.

Todo:
nullborder should clipped from the Screen

References Vdu::mScrOffset.

Referenced by Vdu::init().

void draw24bppx2_border ( )

Border=true, 24 bpp.

References Vdu::mGateArray, Vdu::mScrBase, Vdu::mScrOffset, and GateArray::palette().

Referenced by Vdu::init(), and Vdu::setBorder().

void draw24bppx2_mode0 ( )
void draw24bppx2_mode1 ( )
void draw24bppx2_mode2 ( )
void draw24bppx2_nullborder ( )

Border=false, 24 bpp.

Todo:
nullborder should clipped from the Screen

References Vdu::mScrOffset.

Referenced by Vdu::init(), and Vdu::setBorder().

void draw32bpp_border ( )

Border=true, 32 bpp.

References Vdu::mGateArray, Vdu::mScrBase, Vdu::mScrOffset, and GateArray::palette().

Referenced by Vdu::init().

void draw32bpp_mode0 ( )
void draw32bpp_mode1 ( )
void draw32bpp_mode2 ( )
void draw32bpp_nullborder ( )

Border=false, 32 bpp.

Todo:
nullborder should clipped from the Screen

References Vdu::mScrOffset.

Referenced by Vdu::init().

void draw32bppx2_border ( )

Border=true, 32 bpp.

References Vdu::mGateArray, Vdu::mScrBase, Vdu::mScrOffset, and GateArray::palette().

Referenced by Vdu::init(), and Vdu::setBorder().

void draw32bppx2_mode0 ( )
void draw32bppx2_mode1 ( )
void draw32bppx2_mode2 ( )
void draw32bppx2_nullborder ( )

Border=false, 32 bpp.

Todo:
nullborder should clipped from the Screen

References Vdu::mScrOffset.

Referenced by Vdu::init(), and Vdu::setBorder().

bool frameCompleted ( ) const
inline

References Vdu::mFrameCompleted.

uint hCount ( ) const
inline

References Vdu::mHCount.

uint hDelay ( ) const
inline

References Vdu::mHDelay.

uint hStart ( ) const
inline

References Vdu::mHStart.

uint hswActive ( ) const
inline

References Vdu::mHswActive.

uint hswCount ( ) const
inline

References Vdu::mHswCount.

uint hWidth ( ) const
inline

References Vdu::mHWidth.

void init ( bool  full = false,
Crtc crtc = 0,
GateArray gatearray = 0,
Z80 z80 = 0 
)
uint scanline ( ) const
inline

References Vdu::mScanline.

uint scanlineMin ( ) const
inline

References Vdu::mScanlineMin.

void setBorder ( bool  border = true)
void setBpp ( Bpp  bpp)

References Vdu::init(), and Vdu::mBpp.

Referenced by VideoStd::init(), VideoGL::init(), and Vdu::vHeight().

void setCharCount ( uint  value)
inline

References Vdu::mCharCount.

void setCpcRamBase ( tUBYTE value)
inline
void setFrameCompleted ( bool  value)
inline

References Vdu::mFrameCompleted.

void setHCount ( uint  value)
inline

References Vdu::mHCount.

void setHDelay ( uint  value)
inline

References Vdu::mHDelay.

void setHStart ( uint  value)
inline

References Vdu::mHStart.

void setHswActive ( uint  value)
inline

References Vdu::mHswActive.

void setHswCount ( uint  value)
inline

References Vdu::mHswCount.

void setHWidth ( uint  value)
inline

References Vdu::mHWidth.

void setLineDoubling ( bool  doubling = true)
void setScale ( uchar  scale)

References Vdu::init(), and Vdu::mScale.

Referenced by Vdu::setCpcRamBase().

void setScanline ( uint  value)
inline

References Vdu::mScanline.

void setScanlineMin ( uint  value)
inline

References Vdu::mScanlineMin.

void setScrBase ( uint value)
inline

References Vdu::mScrBase.

Referenced by VideoStd::init(), and VideoGL::init().

void setScrEnd ( uint value)
inline

References Vdu::mScrEnd.

Referenced by VideoStd::init(), and VideoGL::init().

void setScrLine ( uint  value)
inline

References Vdu::mScrLine.

void setScrLineOffset ( uint  value)
inline

References Vdu::mScrLineOffset.

Referenced by VideoStd::init(), and VideoGL::init().

void setScrOffset ( uint  value)
inline

References Vdu::mScrOffset.

void setVCount ( uint  value)
inline

References Vdu::mVCount.

void setVDelay ( uint  value)
inline

References Vdu::mVDelay.

void setVHeight ( uint  value)
inline

References Vdu::mVHeight.

void setVStart ( uint  value)
inline

References Vdu::mVStart.

void setVswCount ( uint  value)
inline

References Vdu::mVswCount.

uint vCount ( ) const
inline

References Vdu::mVCount.

uint vDelay ( ) const
inline

References Vdu::mVDelay.

uint vHeight ( ) const
inline
uint vStart ( ) const
inline

References Vdu::mVStart.

uint vswCount ( ) const
inline

References Vdu::mVswCount.

Member Data Documentation

tREGPAIR addr
private
~Vdu () ROLAND_DEFAULT typedef void (Vdu typedef void(Vdu::* BorderHandler) ()

Pointer on function to handle drawing one line for different CPC-Modes (0-2) and bits per Pixel (16,24,32) Pointer on function to handle drawing the border for different bits per Pixel (16,24,32)

bool mBorder
private

Referenced by Vdu::init(), Vdu::setBorder(), and Vdu::Vdu().

BorderHandler mBorderHandler[4]
private

Referenced by Vdu::init(), and Vdu::setBorder().

Bpp mBpp
private
uint mCharCount
private
tUBYTE* mCpcRamBase
private
Crtc* mCrtc
private
BorderHandler mCurBorderHandler
private
ModeHandler mCurModeHandler
private
bool mFrameCompleted
private
GateArray* mGateArray
private
uint mHCount
private
uint mHDelay
private
uint mHStart
private
uint mHswActive
private
uint mHswCount
private
uint mHWidth
private
bool mLineDoubling
private
ModeHandler mModeHandler[3][4]
private
BorderHandler mNullBorderHandler[4]
private
tUBYTE mode0_table[512]
private
tUBYTE mode1_table[1024]
private
uchar mScale
private
uint mScanline
private
uint mScanlineMin
private
uint* mScrBase
private
uint mScrBpp
private
uint* mScrEnd
private
uint mScrHeight
private
uint mScrLine
private
uint mScrLineOffset
private
uint mScrOffset
private
uint mScrWidth
private
uint mVCount
private
uint mVDelay
private
uint mVHeight
private
uint mVStart
private
uint mVswCount
private
Z80* mZ80
private

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