Special Effect Functions

Description. More...

Functions


Detailed Description

Description.

The Special Effect Functions can be used to perform alphablending between backgrounds<>backgrounds and backgrounds<>objects as well as increasing and decreasing the brightness in hardware. The special effect attributes are shadowed to avoid screen tearing and changes must be transmitted to hardware during vertical blank.

Since the special effect attributes are shadowed internally, you can not use these functions to perform special effect processing on per scanline basis.

Note:
Alphablending between objects is not possible. For detailed information about special effect processing, I recommend to consult GBATek.

Function Documentation

void hel_FxInit ( void   ) 

Initialize Special-Effects-System.

The hel_FxInit initializes the Special-Effects-System and must be called before executing any other function from it, otherwise the program behaviour is undefined.

void hel_FxQuit ( void   ) 

Uninitialize Special-Effects-System.

The hel_FxQuit uninitializes the Special-Effects-System.

void hel_FxSetAlphaLevel ( u32  SourceIntensity,
u32  TargetIntensity 
)

Set alpha-blending intensity.

The hel_FxSetAlphaLevel function sets the alpha-blending intensity for the source and target pixels. The effect mode must be set to FX_MODE_ALPHABLEND.

Parameters:
[in] SourceIntensity Source blending intensity, must between 0..16
[in] TargetIntensity Target blending intensity, must between 0..16

void hel_FxSetBrightnessLevel ( u32  Intensity  ) 

Set brightness.

The hel_FxSetBrightnessLevel function sets the brightness, if the effect mode has been set to FX_MODE_LIGHTEN or FX_MODE_DARKEN.

Parameters:
[in] Intensity Brightness intensity. Must between 0..16

void hel_FxSetMode ( u32  SourceLayer,
u32  TargetLayer,
u32  FxMode 
)

Set Special Effect Mode.

This function sets the effect mode and which layers are affected from special effect processing.

Parameters:
[in] SourceLayer A combination of one or more source-layers used for special effect processing. You can use the FX_LAYER_SELECT macro to include or exclude layers,
[in] TargetLayer A combination of one or more target-layers used for special effect processing. You can use the FX_LAYER_SELECT macro to include or exclude layers,
[in] FxMode The effect-mode to use when blending between layers. This can be one of the following values:
  • FX_MODE_OFF
  • FX_MODE_ALPHABLEND
  • FX_MODE_LIGHTEN
  • FX_MODE_DARKEN

To select one or more layers, the following macro can be used. Setting the parameter(s) to 1 means the corresponding layer should be enabled for special effects whereas 0 disables it.

FX_LAYER_SELECT(BG0,BG1,BG2,BG3,OBJ,BD)

Here is an example to alpha-blend background 0 against background 2:

    hel_FxSetMode
        (
            FX_LAYER_SELECT(1, 0, 0, 0, 0, 0),
            FX_LAYER_SELECT(0, 0, 1, 0, 0, 0),
            FX_MODE_ALPHABLEND
        );

void hel_FxTransmit ( void   ) 

Transmit effect attributes to hardware.

The hel_FxTransmit function must be called during vertical blank to transmit the special effect changes to hardware.


Generated on Mon Apr 9 16:39:00 2007 for HEL Library by  doxygen 1.5.1