PAlib: Special Effects

Main Page | Modules | File List | Globals | Search for

# Special Effects

## Defines

#define | PA_EnableBgMosaic(screen, bg) _REG16(REG_BGCNT(screen, bg)) |= (1 << 6)
| Enable the mosaic effect for a given background
#define | PA_DisableBgMosaic(screen, bg) _REG16(REG_BGCNT(screen, bg)) &= ~(1 << 6)
| Disable the mosaic effect for a given background
#define | PA_SetBgMosaicXY(screen, h_size, v_size) {REG_MOSAIC(screen) &= 255; REG_MOSAIC(screen) |= ((h_size) + ((v_size) << 4));}
| Set the Mosaic parameters for the backgrounds
#define | PA_SetSpriteMosaicXY(screen, h_size, v_size) {REG_MOSAIC(screen) &= (255 << 8); REG_MOSAIC(screen) |= (((h_size) << 8) + ((v_size) << 12));}
| Set the Mosaic parameters for the sprites
#define | PA_EnableSpecialFx(screen, EffectType, FirstTarget, SecondTarget) REG_BLDCNT(screen) = ((FirstTarget) + ((SecondTarget) << 8) + ((EffectType) << 6))
| Enable Special Effects and set whether backgrounds and sprites will use them or not. This also sets the type of Effect
#define | PA_DisableSpecialFx(screen) REG_BLDCNT(screen) = 0
| Disable Special Effects
#define | PA_SetSFXAlpha(screen, Coeff1, Coeff2) REG_BLDALPHA(screen) = (Coeff1) + ((Coeff2) << 8)
| Set the special effect parameters for Alpha-Blending

## Detailed Description

Set the sprite special effects (alpha-blending, luminosity, mosaic effects...)

## Define Documentation

#define PA_DisableBgMosaic | ( | screen,
|  | bg |  | ) | _REG16(REG_BGCNT(screen, bg)) &= ~(1 << 6)

Disable the mosaic effect for a given background

Parameters:

  | screen | Background screen (0 or 1)
  | bg | Background number

#define PA_DisableSpecialFx | ( | screen |  | ) | REG_BLDCNT(screen) = 0

Disable Special Effects

Parameters:

  | screen | Screen...

#define PA_EnableBgMosaic | ( | screen,
|  | bg |  | ) | _REG16(REG_BGCNT(screen, bg)) |= (1 << 6)

Enable the mosaic effect for a given background

Parameters:

  | screen | Background screen (0 or 1)
  | bg | Background number

#define PA_EnableSpecialFx | ( | screen,
|  | EffectType,
|  | FirstTarget,
|  | SecondTarget |  | ) | REG_BLDCNT(screen) = ((FirstTarget) + ((SecondTarget) << 8) + ((EffectType) << 6))

Enable Special Effects and set whether backgrounds and sprites will use them or not. This also sets the type of Effect

Parameters:

  | screen | Screen...
  | EffectType | Effect Type. 0 for non, 1 for alpha-blending, 2 for brightness increase, and 3 for brightness decrease. You can use the macros SFX_NONE, SFX_ALPHA, SFX_BRIGHTINC, SFX_BRIGHTDEC
  | FirstTarget | Backgrounds and sprites for which to activate the effect. Use the following macro : SFX_BG0 | SFX_BG1 | SFX_BG2 | SFX_BG3 | SFX_OBJ | SFX_BD (no idea what that is !)
  | SecondTarget | Backgrounds and sprites to be seen behind the alpha-blending. Use the following macro : SFX_BG0 | SFX_BG1 | SFX_BG2 | SFX_BG3 | SFX_OBJ | SFX_BD (no idea what that is !)

#define PA_SetBgMosaicXY | ( | screen,
|  | h_size,
|  | v_size |  | ) | {REG_MOSAIC(screen) &= 255; REG_MOSAIC(screen) |= ((h_size) + ((v_size) << 4));}

Set the Mosaic parameters for the backgrounds

Parameters:

  | screen | Screen...
  | h_size | Horizontal size of the mosaic (1 for 1 pixel, 2 for 2 pixels, etc...)
  | v_size | Vertical size of the mosaic (1 for 1 pixel, 2 for 2 pixels, etc...)

#define PA_SetSFXAlpha | ( | screen,
|  | Coeff1,
|  | Coeff2 |  | ) | REG_BLDALPHA(screen) = (Coeff1) + ((Coeff2) << 8)

Set the special effect parameters for Alpha-Blending

Parameters:

  | screen | Screen...
  | Coeff1 | Coefficient for the first layer, from 0 to 31. Apparently, it's better to set between 0 and 16
  | Coeff2 | Coefficient for the second layer, from 0 to 31. Apparently, it's better to set between 0 and 16

#define PA_SetSpriteMosaicXY | ( | screen,
|  | h_size,
|  | v_size |  | ) | {REG_MOSAIC(screen) &= (255 << 8); REG_MOSAIC(screen) |= (((h_size) << 8) + ((v_size) << 12));}

Set the Mosaic parameters for the sprites

Parameters:

  | screen | Screen...
  | h_size | Horizontal size of the mosaic (1 for 1 pixel, 2 for 2 pixels, etc...)
  | v_size | Vertical size of the mosaic (1 for 1 pixel, 2 for 2 pixels, etc...)