Alchemy
Loading...
Searching...
No Matches

palbuf.h File Reference

Palette fades, the battle effect palette buffers and the colour channel curves. More...

Go to the source code of this file.

Data Structures

struct  PaletteFade
 A colour buffer for all 512 palette colours: the source palette, the shown and target colour channels, their steps, and two pages of packed colours. More...
struct  BattleEffectBuffers
 The colour buffer (heap block 32) that fades the BG and OBJ palettes: the source palette, the shown and target colour channels, their per-frame steps, and two pages of packed RGB555 colours queued each frame. More...

Enumerations

enum  PaletteTransform {
  PALETTE_TRANSFORM_FROM_SOURCE = 0x8000 , PALETTE_TRANSFORM_PLAIN = 0x10000 , PALETTE_TRANSFORM_GREY = 0x10001 , PALETTE_TRANSFORM_SEPIA = 0x10002 ,
  PALETTE_TRANSFORM_WARM = 0x10003 , PALETTE_TRANSFORM_MUTED = 0x10004 , PALETTE_TRANSFORM_PALE = 0x10005 , PALETTE_TRANSFORM_RED = 0x10006 ,
  PALETTE_TRANSFORM_WARM2 = 0x10007 , PALETTE_TRANSFORM_FLAGS = 0x100000 , PALETTE_TRANSFORM_TINT = 0x200000 , PALETTE_TRANSFORM_BLEND = 0x400000 ,
  PALETTE_TRANSFORM_SPLIT = 0x800000
}
 A colour buffer's build mode: below 0x8000 one RGB555 colour for all. More...

Functions

 STATIC_ASSERT (sizeof(struct PaletteFade)==0x3004)
 STATIC_ASSERT (offsetof(struct PaletteFade, current)==0x400)
 STATIC_ASSERT (offsetof(struct PaletteFade, target)==0x1000)
 STATIC_ASSERT (offsetof(struct PaletteFade, delta)==0x1c00)
 STATIC_ASSERT (offsetof(struct PaletteFade, packed)==0x2800)
 STATIC_ASSERT (offsetof(struct PaletteFade, page)==0x3000)
 STATIC_ASSERT (sizeof(struct BattleEffectBuffers)==0x2a04)
 STATIC_ASSERT (offsetof(struct BattleEffectBuffers, current)==0x380)
 STATIC_ASSERT (offsetof(struct BattleEffectBuffers, target)==0xe00)
 STATIC_ASSERT (offsetof(struct BattleEffectBuffers, delta)==0x1880)
 STATIC_ASSERT (offsetof(struct BattleEffectBuffers, packed)==0x2300)
 STATIC_ASSERT (offsetof(struct BattleEffectBuffers, page)==0x2a00)

Variables

u16 gPalette_ChannelCurve [32]
 Maps a channel (0..31) to a component (0..31 << 10).
u16 gPalette_ChannelCurveLight [32]
 A brighter curve.
u16 gPalette_ChannelCurveContrast [32]
 A high-contrast curve (25 and above are full).

Detailed Description

Palette fades, the battle effect palette buffers and the colour channel curves.

Definition in file palbuf.h.

Enumeration Type Documentation

◆ PaletteTransform

A colour buffer's build mode: below 0x8000 one RGB555 colour for all.

Enumerator
PALETTE_TRANSFORM_FROM_SOURCE 

The backdrop colour (palette RAM's first colour) for all.

PALETTE_TRANSFORM_PLAIN 

each colour unchanged

PALETTE_TRANSFORM_GREY 

grey of brightness (2R + 4G + B) / 7

PALETTE_TRANSFORM_SEPIA 
PALETTE_TRANSFORM_WARM 
PALETTE_TRANSFORM_MUTED 
PALETTE_TRANSFORM_PALE 
PALETTE_TRANSFORM_RED 
PALETTE_TRANSFORM_WARM2 

half R + 6, two thirds G + 4, B - 6

PALETTE_TRANSFORM_FLAGS 

From here the TINT, BLEND and SPLIT bits are tested, TINT and BLEND carrying an RGB555 colour in the low 15 bits; any other value is the address of a ready buffer to copy.

PALETTE_TRANSFORM_TINT 

The brightness (2R + 4G + B) times the colour carried.

PALETTE_TRANSFORM_BLEND 

The brightness R + G + B shared out in the proportions of the colour carried.

PALETTE_TRANSFORM_SPLIT 

each colour unchanged

Definition at line 69 of file palbuf.h.

Function Documentation

◆ STATIC_ASSERT() [1/12]

STATIC_ASSERT ( sizeof(struct PaletteFade) = =0x3004)

◆ STATIC_ASSERT() [2/12]

STATIC_ASSERT ( offsetof(struct PaletteFade, current) = =0x400)

◆ STATIC_ASSERT() [3/12]

STATIC_ASSERT ( offsetof(struct PaletteFade, target) = =0x1000)

◆ STATIC_ASSERT() [4/12]

STATIC_ASSERT ( offsetof(struct PaletteFade, delta) = =0x1c00)

◆ STATIC_ASSERT() [5/12]

STATIC_ASSERT ( offsetof(struct PaletteFade, packed) = =0x2800)

◆ STATIC_ASSERT() [6/12]

STATIC_ASSERT ( offsetof(struct PaletteFade, page) = =0x3000)

◆ STATIC_ASSERT() [7/12]

STATIC_ASSERT ( sizeof(struct BattleEffectBuffers) = =0x2a04)

◆ STATIC_ASSERT() [8/12]

STATIC_ASSERT ( offsetof(struct BattleEffectBuffers, current) = =0x380)

◆ STATIC_ASSERT() [9/12]

STATIC_ASSERT ( offsetof(struct BattleEffectBuffers, target) = =0xe00)

◆ STATIC_ASSERT() [10/12]

STATIC_ASSERT ( offsetof(struct BattleEffectBuffers, delta) = =0x1880)

◆ STATIC_ASSERT() [11/12]

STATIC_ASSERT ( offsetof(struct BattleEffectBuffers, packed) = =0x2300)

◆ STATIC_ASSERT() [12/12]

STATIC_ASSERT ( offsetof(struct BattleEffectBuffers, page) = =0x2a00)

Variable Documentation

◆ gPalette_ChannelCurve

u16 gPalette_ChannelCurve[32]
extern

Maps a channel (0..31) to a component (0..31 << 10).

Definition at line 1089 of file intro.c.

Referenced by Palette_Transform(), and STATIC_ASSERT().

◆ gPalette_ChannelCurveLight

u16 gPalette_ChannelCurveLight[32]
extern

A brighter curve.

Definition at line 1097 of file intro.c.

Referenced by Palette_Transform(), and STATIC_ASSERT().

◆ gPalette_ChannelCurveContrast

u16 gPalette_ChannelCurveContrast[32]
extern

A high-contrast curve (25 and above are full).

Definition at line 1105 of file intro.c.

Referenced by Palette_Transform(), and STATIC_ASSERT().