From 347d1e20b62cf18d24084f7dab0291ecc4282564 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 1 Nov 2019 18:43:22 -0400 Subject: [PATCH] Use constants in io_reg.s --- constants/gba_constants.inc | 23 +++++++++++++++++++++++ data/io_reg.s | 16 ++++++++-------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/constants/gba_constants.inc b/constants/gba_constants.inc index 9d59c8fcdd..3ff857ee8d 100644 --- a/constants/gba_constants.inc +++ b/constants/gba_constants.inc @@ -488,3 +488,26 @@ .set OAM_SIZE_8x32, OAM_SIZE_1 | OAM_V_RECTANGLE .set OAM_SIZE_16x32, OAM_SIZE_2 | OAM_V_RECTANGLE .set OAM_SIZE_32x64, OAM_SIZE_3 | OAM_V_RECTANGLE + +@ BLDCNT + + .set BLDCNT_TGT1_BG0, 1 << 0 + .set BLDCNT_TGT1_BG1, 1 << 1 + .set BLDCNT_TGT1_BG2, 1 << 2 + .set BLDCNT_TGT1_BG3, 1 << 3 + .set BLDCNT_TGT1_OBJ, 1 << 4 + .set BLDCNT_TGT1_BD, 1 << 5 + .set BLDCNT_TGT1_ALL, BLDCNT_TGT1_BG0 | BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD + + .set BLDCNT_EFFECT_NONE, 0 << 6 + .set BLDCNT_EFFECT_BLEND, 1 << 6 + .set BLDCNT_EFFECT_LIGHTEN, 2 << 6 + .set BLDCNT_EFFECT_DARKEN, 3 << 6 + + .set BLDCNT_TGT2_BG0, 1 << 8 + .set BLDCNT_TGT2_BG1, 1 << 9 + .set BLDCNT_TGT2_BG2, 1 << 10 + .set BLDCNT_TGT2_BG3, 1 << 11 + .set BLDCNT_TGT2_OBJ, 1 << 12 + .set BLDCNT_TGT2_BD, 1 << 13 + .set BLDCNT_TGT2_ALL, BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD diff --git a/data/io_reg.s b/data/io_reg.s index bbb93b4900..0941b4345b 100644 --- a/data/io_reg.s +++ b/data/io_reg.s @@ -25,13 +25,13 @@ gUnref_82EC784:: @ 82EC784 .4byte 0x08000400 gOverworldBackgroundLayerFlags:: @ 82EC7C4 - .2byte 0x0100 /* BLDCNT_TGT2_BG0 */ - .2byte 0x0200 /* BLDCNT_TGT2_BG1 */ - .2byte 0x0400 /* BLDCNT_TGT2_BG2 */ - .2byte 0x0800 /* BLDCNT_TGT2_BG3 */ + .2byte BLDCNT_TGT2_BG0 + .2byte BLDCNT_TGT2_BG1 + .2byte BLDCNT_TGT2_BG2 + .2byte BLDCNT_TGT2_BG3 gOrbEffectBackgroundLayerFlags:: @ 82EC7CC - .2byte 0x0001 /* BLDCNT_TGT1_BG0 */ - .2byte 0x0002 /* BLDCNT_TGT1_BG1 */ - .2byte 0x0004 /* BLDCNT_TGT1_BG2 */ - .2byte 0x0008 /* BLDCNT_TGT1_BG3 */ + .2byte BLDCNT_TGT1_BG0 + .2byte BLDCNT_TGT1_BG1 + .2byte BLDCNT_TGT1_BG2 + .2byte BLDCNT_TGT1_BG3