diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-01-22 19:40:17 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-01-22 19:40:17 -0500 |
commit | a73c532738d055bb3d28a46b59f7fc87d2c998d4 (patch) | |
tree | e3566de414a399ef0711fad034a9c96d9ea9b864 | |
parent | f81add782affc2ca3b196e0beb98e9c89d0f09ff (diff) |
tile+color macros in gfx.asm
-rw-r--r-- | constants/gfx_constants.asm | 1 | ||||
-rw-r--r-- | engine/color.asm | 8 | ||||
-rw-r--r-- | engine/tileset_anims.asm | 8 | ||||
-rw-r--r-- | home/palettes.asm | 2 | ||||
-rw-r--r-- | macros.asm | 5 | ||||
-rw-r--r-- | macros/gfx.asm (renamed from macros/color.asm) | 4 | ||||
-rwxr-xr-x | mobile/mobile_5b.asm | 4 |
7 files changed, 17 insertions, 15 deletions
diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 864a4bd50..bfa2140e7 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -3,6 +3,7 @@ LEN_1BPP_TILE EQU 1 * TILE_WIDTH ; bytes LEN_2BPP_TILE EQU 2 * TILE_WIDTH ; bytes NUM_PAL_COLORS EQU 4 +PAL_COLOR_SIZE EQU 2 PALRGB_WHITE EQUS "palred 31 + palgreen 31 + palblue 31" ; $7fff diff --git a/engine/color.asm b/engine/color.asm index 0cce49655..b9c0419f8 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -337,11 +337,11 @@ ApplyHPBarPals: ret .Enemy: - ld de, wBGPals2 palette PAL_BATTLE_BG_ENEMY_HP + 2 + ld de, wBGPals2 palette PAL_BATTLE_BG_ENEMY_HP color 1 jr .okay .Player: - ld de, wBGPals2 palette PAL_BATTLE_BG_PLAYER_HP + 2 + ld de, wBGPals2 palette PAL_BATTLE_BG_PLAYER_HP color 1 .okay ld l, c @@ -521,7 +521,7 @@ LoadPalette_White_Col1_Col2_Black: ld [de], a inc de - ld c, 2 * 2 + ld c, 2 * PAL_COLOR_SIZE .loop ld a, [hli] ld [de], a @@ -1308,7 +1308,7 @@ rept 4 inc hl endr .morn_day - ld de, wBGPals1 palette PAL_BG_ROOF + 2 + ld de, wBGPals1 palette PAL_BG_ROOF color 1 ld bc, 4 ld a, BANK(wBGPals1) call FarCopyWRAM diff --git a/engine/tileset_anims.asm b/engine/tileset_anims.asm index 62e84a401..4e4698d5e 100644 --- a/engine/tileset_anims.asm +++ b/engine/tileset_anims.asm @@ -952,7 +952,7 @@ TileAnimationPalette: ; fc6d7 jr z, .color2 .color1 - ld hl, wBGPals1 palette PAL_BG_WATER + 2 + ld hl, wBGPals1 palette PAL_BG_WATER color 1 ld a, [hli] ld [rBGPD], a ld a, [hli] @@ -960,7 +960,7 @@ TileAnimationPalette: ; fc6d7 jr .end .color0 - ld hl, wBGPals1 palette PAL_BG_WATER + ld hl, wBGPals1 palette PAL_BG_WATER color 0 ld a, [hli] ld [rBGPD], a ld a, [hli] @@ -968,7 +968,7 @@ TileAnimationPalette: ; fc6d7 jr .end .color2 - ld hl, wBGPals1 palette PAL_BG_WATER + 4 + ld hl, wBGPals1 palette PAL_BG_WATER color 2 ld a, [hli] ld [rBGPD], a ld a, [hli] @@ -1009,7 +1009,7 @@ FlickeringCaveEntrancePalette: ; fc71e jr .okay .bit1set - ld hl, wBGPals1 palette PAL_BG_YELLOW + 2 + ld hl, wBGPals1 palette PAL_BG_YELLOW color 1 .okay ld a, [hli] diff --git a/home/palettes.asm b/home/palettes.asm index 9f10da118..e47b73e99 100644 --- a/home/palettes.asm +++ b/home/palettes.asm @@ -280,7 +280,7 @@ CopyPals:: ; d50 jr nz, .loop ; de += 8 (next pal) - ld a, NUM_PAL_COLORS * 2 + ld a, NUM_PAL_COLORS * PAL_COLOR_SIZE add e jr nc, .ok inc d diff --git a/macros.asm b/macros.asm index 7036b6419..76cbe790d 100644 --- a/macros.asm +++ b/macros.asm @@ -3,8 +3,8 @@ INCLUDE "macros/predef.asm" INCLUDE "macros/rst.asm" INCLUDE "macros/data.asm" INCLUDE "macros/code.asm" +INCLUDE "macros/gfx.asm" INCLUDE "macros/coords.asm" -INCLUDE "macros/color.asm" INCLUDE "macros/scripts/audio.asm" INCLUDE "macros/scripts/maps.asm" @@ -17,6 +17,3 @@ INCLUDE "macros/scripts/trade_anims.asm" INCLUDE "macros/scripts/gfx_anims.asm" percent EQUS "* $ff / 100" - -tiles EQUS "* LEN_2BPP_TILE" -tile EQUS "+ LEN_2BPP_TILE *" diff --git a/macros/color.asm b/macros/gfx.asm index 5ebaae218..d9b1c46b0 100644 --- a/macros/color.asm +++ b/macros/gfx.asm @@ -13,3 +13,7 @@ palblue EQUS "(1 << 10) *" palettes EQUS "* 8" palette EQUS "+ 8 *" +color EQUS "+ 2 *" + +tiles EQUS "* LEN_2BPP_TILE" +tile EQUS "+ LEN_2BPP_TILE *" diff --git a/mobile/mobile_5b.asm b/mobile/mobile_5b.asm index bb005b564..4c72661a5 100755 --- a/mobile/mobile_5b.asm +++ b/mobile/mobile_5b.asm @@ -681,8 +681,8 @@ Function16cbd1: ; 16cbd1 ld bc, 2 ld hl, Unknown_16cfa3 call AddNTimes - ld de, wBGPals1 + 1 palettes + 4 - ld bc, 2 + ld de, wBGPals1 palette 1 color 2 + ld bc, PAL_COLOR_SIZE ld a, $5 call FarCopyWRAM farcall ApplyPals |