Skip to content

Commit

Permalink
Added alpha blending
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumolari committed Jan 31, 2015
1 parent 6399e46 commit 41089f9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.cpp
Expand Up @@ -118,6 +118,17 @@ void update_graphics() {
bg1map[x + y32] = tile | (PAL_GRADIENT << 12);
}

// Enable alpha blending of background 1.
// My guess: BLEND_DST_BACKDROP is the 14th bit at 1, BLEND_SRC_BG1 is the
// 2nd bit at 1 and BLEND_ALPHA are bits 8th and 7th at 10.
// BLEND_DST_BACKDROP 0010000000000000
// BLEND_SRC_BG1 0000000000000010
// BLEND_ALPHA 0000000010000000
// -----------------------------------
// 0010000010000010
REG_BLDCNT = BLEND_ALPHA | BLEND_SRC_BG1 | BLEND_DST_BACKDROP;
REG_BLDALPHA = (4) + (16 << 8); // This is computed at compile time.

videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE);
}

Expand Down

0 comments on commit 41089f9

Please sign in to comment.