gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Fade to white

#21714 - alek - Thu Jun 03, 2004 5:35 pm

Hi,
I have two backgrounds (BG0, BG1) in mode 0 that I wish to fade to white
this is what I have got so far

Code:

#define REG_BLDMOD        (*(u16*)0x4000050)
#define REG_COLEY         (*(u16*)0x4000054)
#define BACK_DROP 0x2000
#define FADE_TO_WHITE 0x80
#define TARGET_BG0 0x0
#define TARGET_BG1 0x2

REG_BLDMOD = BACK_DROP | FADE_TO_WHITE;
...
while(1){
    ...
    if(trans_level <16)
        trans_level++;
    REG_COLEY = trans_level;
...
}


I have also tried putting
Code:

REG_BLDMOD = BACK_DROP | FADE_TO_WHITE | TARGET_BG1;

and the same thing but with BG0.

Nothing happends. What am I doing wrong?

#21715 - poslundc - Thu Jun 03, 2004 6:07 pm

You need to specify your backgrounds as source layers, not target layers.

See the Cowbite Virtual Hardware Spec under the Effects Registers section.

Dan.

#21716 - alek - Thu Jun 03, 2004 6:11 pm

ok, thanx it works now