semi-transparent delete window
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 16 Mar 2021 03:24:14 +0000 (05:24 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 16 Mar 2021 03:24:14 +0000 (05:24 +0200)
src/gbaregs.h
src/main.c

index a85b814..e54e801 100644 (file)
@@ -225,6 +225,24 @@ along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #define BGCNT_SZ_TX_512X512            BGCNT_SZ(3)
 #define BGCNT_SZ_RS_1024X1024  BGCNT_SZ(3)
 
+/* REG_BLDCNT bits */
+#define BLDCNT_A_BG0           0x0001
+#define BLDCNT_A_BG1           0x0002
+#define BLDCNT_A_BG2           0x0004
+#define BLDCNT_A_BG3           0x0008
+#define BLDCNT_A_OBJ           0x0010
+#define BLDCNT_A_BACKDROP      0x0020
+#define BLDCNT_B_BG0           0x0100
+#define BLDCNT_B_BG1           0x0200
+#define BLDCNT_B_BG2           0x0400
+#define BLDCNT_B_BG3           0x0800
+#define BLDCNT_B_OBJ           0x1000
+#define BLDCNT_B_BACKDROP      0x2000
+
+#define BLDCNT_ALPHA           0x0040
+#define BLDCNT_BRIGHTEN                0x0080
+#define BLDCNT_DARKEN          0x00c0
+
 /* REG_IF bits */
 #define IF_VBLANK              0x0001
 #define IF_HBLANK              0x0002
index af2f6d3..7dc1a99 100644 (file)
@@ -117,6 +117,8 @@ int main(void)
        dma_copy16(3, fbptr[1], bgimg_pixels, 240 * 160 / 2, 0);
 
        init_sprites();
+       REG_BLDCNT = BLDCNT_ALPHA | BLDCNT_B_BG2;
+       REG_BLDALPHA = 0x040c;
 
        xgl_init();
        xgl_viewport(0, 0, 240, VP_HEIGHT);
@@ -231,7 +233,8 @@ static void show_msgbox(int en)
 
        if(en) {
                for(i=0; i<3; i++) {
-                       set_sprite(oam, SIDX_DEL0 + i, SNAM_DEL0 + i * 8, 42 + i * 64, 42, 0, SPR_SZ64);
+                       set_sprite(oam, SIDX_DEL0 + i, SNAM_DEL0 + i * 8, 42 + i * 64, 50, 0,
+                                       SPR_SZ64 | SPR_BLEND);
                }
        } else {
                for(i=0; i<3; i++) {