SaturnRingLibrary 0.6
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::VDP2 Class Reference

Detailed Description

VDP2 control.

#include <srl_vdp2.hpp>

Classes

class  NBG0
 NBG0 interface. More...
 
class  NBG1
 NBG1 interface. More...
 
class  NBG2
 NBG2 interface. More...
 
class  NBG3
 NBG3 interface. More...
 
class  RBG0
 RBG0 interface. More...
 
class  ScrollScreen
 Functionality available to all Scroll Screen interfaces. More...
 
class  SpriteLayer
 Interface to control VDP2 settings for the Sprite Layer (data from VDP1 framebuffer), such as Display priority and VDP2 color calculation) More...
 
class  VRAM
 Manages VDP2 VRAM allocation. More...
 

Public Types

enum class  ColorCalcMode : uint16_t { UseColorRatiosTop = 0x000 , UseColorRatios2nd = 0x200 , UseColorAddition = 0x100 }
 Used to Select behavior of VDP2 Half Transparent Color Calculation. More...
 
enum class  ColorCondition : uint16_t { PriorityLessThan = CC_pr_CN , PriorityEquals = CC_PR_CN , PriorityGreaterThan = CC_PR_cn }
 Sprite Color Calculation Conditions (See SpriteLayer::SetColorCondition() for details) More...
 
enum class  Priority : uint16_t {
  Layer0 = 0 , Layer1 = 1 , Layer2 = 2 , Layer3 = 3 ,
  Layer4 = 4 , Layer5 = 5 , Layer6 = 6 , Layer7 = 7
}
 VDP2 scroll priorities (Higher layers draw on top of lower layers)
 
enum class  RotationMode { OneAxis , TwoAxis , ThreeAxis }
 setting for RBG0,1 rotation constraints More...
 
enum class  SpriteBank : int16_t {
  Bank0 = scnSPR0 , Bank1 = scnSPR1 , Bank2 = scnSPR2 , Bank3 = scnSPR3 ,
  Bank4 = scnSPR4 , Bank5 = scnSPR5 , Bank6 = scnSPR6 , Bank7 = scnSPR7
}
 Used to reference the Sprite color calculation ratio and priority registers. More...
 
enum class  VramBank : uint16_t { A0 = 0 , A1 = 1 , B0 = 2 , B1 = 3 }
 used to specify the 4 VRAM banks that are available for VDP2 allocation
 

Static Public Member Functions

static void ClearVRAM ()
 Clear all VDP2 VRAM allocations and reset all Scroll Screen VRAM References, as well as all CRAM allocations associated with VDP2 Scroll Screens.
 
static void Initialize (const Types::HighColor &backColor)
 Initialize VDP2.
 
static void SetBackColor (const Types::HighColor &color)
 Set the back color.
 
static void SetColorCalcMode (VDP2::ColorCalcMode Mode=VDP2::ColorCalcMode::UseColorRatiosTop)
 Sets VDP2 Half Transparent Color Calculation Mode (only one mode can be used at once)
 
static void SetPrintPaletteColor (const uint16_t index, const Types::HighColor &color)
 Set color for print.
 

Static Public Attributes

static uint16_t ActiveScrolls = NBG0ON | NBG3ON
 Bitfield recording all Currently enabled Scroll Screens.
 
static uint16_t ColorCalcScrolls = NBG0ON | NBG3ON | SPRON
 Bitfield recording all Scroll Screens with VDP2 Color Calculation enabled.
 

Member Enumeration Documentation

◆ ColorCalcMode

enum class SRL::VDP2::ColorCalcMode : uint16_t
strong

Used to Select behavior of VDP2 Half Transparent Color Calculation.

Enumerator
UseColorRatiosTop 

Blend colors by the ratio specified in Higher priority Pixels.

UseColorRatios2nd 

Blend colors by the ratio specified in Lower priority Pixels.

UseColorAddition 

Use additive color blending instead of ratios.

◆ ColorCondition

enum class SRL::VDP2::ColorCondition : uint16_t
strong

Sprite Color Calculation Conditions (See SpriteLayer::SetColorCondition() for details)

Enumerator
PriorityLessThan 

Perform color calculation only if priority is less than TestValue.

PriorityEquals 

Perform color calculation only if priority is equal to TestValue.

PriorityGreaterThan 

Perform color calculation only if priority is greater than TestValue.

◆ RotationMode

enum class SRL::VDP2::RotationMode
strong

setting for RBG0,1 rotation constraints

Note
more axis require more VRAM resources
Enumerator
OneAxis 

2d rotation with only roll and zoom

Note
No additional VRAM requirements
TwoAxis 

3d rotation with pitch and yaw, but no roll (modified per line)

Note
Requires 0x2000-0x18000 bytes in arbitrary VRAM Bank (No cycles)
ThreeAxis 

Full 3d rotation with pitch, yaw and roll (modified per pixel)

Note
Requires 0x2000-0x18000 bytes in Reserved VRAM bank (8 cycles)

◆ SpriteBank

enum class SRL::VDP2::SpriteBank : int16_t
strong

Used to reference the Sprite color calculation ratio and priority registers.

Note
Can refer to Color Calculation banks or Priority Banks depending on use

Member Function Documentation

◆ ClearVRAM()

static void SRL::VDP2::ClearVRAM ( )
inlinestatic

Clear all VDP2 VRAM allocations and reset all Scroll Screen VRAM References, as well as all CRAM allocations associated with VDP2 Scroll Screens.

Note
, When Loading a new set Data and Configurations for Scroll Screens with auto allocation, Call this first to ensure old data is freed

◆ Initialize()

static void SRL::VDP2::Initialize ( const Types::HighColor & backColor)
inlinestatic

Initialize VDP2.

Parameters
backColorstarting back color

◆ SetBackColor()

static void SRL::VDP2::SetBackColor ( const Types::HighColor & color)
inlinestatic

Set the back color.

Parameters
colorColor to use

◆ SetColorCalcMode()

static void SRL::VDP2::SetColorCalcMode ( VDP2::ColorCalcMode Mode = VDP2::ColorCalcMode::UseColorRatiosTop)
inlinestatic

Sets VDP2 Half Transparent Color Calculation Mode (only one mode can be used at once)

Parameters
ModeThe VDP2 color calculation mode to use

◆ SetPrintPaletteColor()

static void SRL::VDP2::SetPrintPaletteColor ( const uint16_t index,
const Types::HighColor & color )
inlinestatic

Set color for print.

Parameters
indexColor index
colorColor to set