Interface to control VDP2 settings for the Sprite Layer (data from VDP1 framebuffer), such as Display priority and VDP2 color calculation)
#include <srl_vdp2.hpp>
Static Public Member Functions | |
static void | ColorCalcOFF () |
Turns VDP2 Color Calculation Off for Sprite Layer. | |
static void | ColorCalcON () |
Turns VDP2 Color Calculation on for Sprite Layer. | |
static void | SetColorCondition (VDP2::ColorCondition Condition, SRL::VDP2::Priority TestValue) |
Set conditions under which VDP2 color calculation is performed on sprites based on their priority. | |
static void | SetOpacity (Types::Fxp opacity, VDP2::SpriteBank bank=VDP2::SpriteBank::Bank0) |
Set the opacities that sprites can select from in CC regesters. | |
static void | SetPriority (SRL::VDP2::Priority pr, VDP2::SpriteBank bank=VDP2::SpriteBank::Bank0) |
Set the priority Layers That sprites can select from in PR registers. | |
|
inlinestatic |
Set conditions under which VDP2 color calculation is performed on sprites based on their priority.
Sets up the condition that allows only select sprites to recieve Half Transparent color calculation with VDP2 layers. To make a sprite fully opaque, selectively turn color calculation off for it by assigning it to use a Priority Bank containing a priority layer that does not satisfy the Color Condition. The default VDP2 initialization uses ColorCondition::PriorityEquals Priority::Layer4, with SpriteBank0 set to Layer3 and SpriteBank1 set to Layer4. With this config RGB sprites recieve no color calculation, while Palette sprites only recieve color calculation when select priority from bank1
Condition | The type of condition that VDP2 Color Calculation will follow |
TestValue | The Layer that a sprite's priority will be tested against in the condition |
|
inlinestatic |
Set the opacities that sprites can select from in CC regesters.
This Function takes the opacity specified as a fixed point value and converts it to one of the 32 color calculation ratios that the system can use (value is floored to the nearest ratio). It then sets the ratio in the specified sprite cc register (cc register 0 if not specified)
opacity | Fxp decimal value between 0.0 and 1.0 representing pixel opacity of the cc register |
bank | (optional) which of the 8 CC registers to Set the opacity in (defaults to 0) |
|
inlinestatic |
Set the priority Layers That sprites can select from in PR registers.
This function sets one of the 8 priority registers that a Palette sprite can reference (default bank0)
pr | enum VDP2::Priority Layer |
bank | (optional) enum VDP2::SpriteBank designating which priority bank to write to |