summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2018-01-01 14:47:16 +0100
committerxCrystal <rgr.crystal@gmail.com>2018-01-01 20:09:53 +0100
commit6e12a515031027ab0412ef37a3f6e3b24adfc736 (patch)
tree9f3aa7cc86bb588f530749fa3e39bccef6695ce7
parent8c3905c4cdb4f24810473da51d52cc3e16062173 (diff)
Use more palette(s) constants
-rw-r--r--constants/hardware_constants.asm4
-rw-r--r--engine/battle_anims/bg_effects.asm8
-rwxr-xr-xengine/crystal_intro.asm8
-rwxr-xr-xengine/debug.asm8
-rw-r--r--engine/events/poisonstep_pals.asm2
-rw-r--r--engine/pokedex.asm2
-rw-r--r--mobile/mobile_22_2.asm2
-rwxr-xr-xmobile/mobile_45_sprite_engine.asm2
-rwxr-xr-xmobile/mobile_5b.asm2
-rwxr-xr-xmobile/mobile_5c.asm6
-rw-r--r--mobile/mobile_5e.asm14
-rw-r--r--mobile/mobile_5f.asm6
-rw-r--r--tilesets/animations.asm10
13 files changed, 37 insertions, 37 deletions
diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm
index 7e7681acf..a75ffbdf3 100644
--- a/constants/hardware_constants.asm
+++ b/constants/hardware_constants.asm
@@ -50,7 +50,7 @@ OAM_X_FLIP EQU 5
OAM_Y_FLIP EQU 6
OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
-; BP Map attribute flags
+; BG Map attribute flags
PALETTE_MASK EQU %111
VRAM_BANK_1 EQU 1 << OAM_TILE_BANK ; $08
OBP_NUM EQU 1 << OAM_OBP_NUM ; $10
@@ -60,7 +60,7 @@ BEHIND_BG EQU 1 << OAM_PRIORITY ; $80
; Other useful constants
LCDC_DEFAULT EQU %11100011
-LY_VBLANK EQU 144
+LY_VBLANK EQU 144
; Hardware registers
rJOYP EQU $ff00 ; Joypad (R/W)
diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm
index ffdce532e..537757b14 100644
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -2588,8 +2588,8 @@ BGEffects_LoadBGPal0_OBPal1: ; c8e52 (32:4e52)
ld b, a
ld c, $1
call CopyPals
- ld hl, OBPals + 8
- ld de, UnknOBPals + 8
+ ld hl, OBPals palette 1
+ ld de, UnknOBPals palette 1
pop af
ld b, a
ld c, $1
@@ -2610,8 +2610,8 @@ BGEffects_LoadBGPal1_OBPal0: ; c8e7f (32:4e7f)
ld a, h
push bc
push af
- ld hl, BGPals + 8
- ld de, UnknBGPals + 8
+ ld hl, BGPals palette 1
+ ld de, UnknBGPals palette 1
ld b, a
ld c, $1
call CopyPals
diff --git a/engine/crystal_intro.asm b/engine/crystal_intro.asm
index 1c2a39ef2..449a5bf82 100755
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -1532,7 +1532,7 @@ Intro_Scene24_ApplyPaletteFade: ; e5172 (39:5172)
ld b, 8 ; number of BG pals
.loop1
push hl
- ld c, 8 ; number of bytes per pal
+ ld c, 1 palettes
.loop2
ld a, [hli]
ld [de], a
@@ -1735,7 +1735,7 @@ Intro_Scene20_AppearUnown: ; e5348 (39:5348)
adc d
ld d, a
- ld bc, 8
+ ld bc, 1 palettes
call CopyBytes
pop bc
@@ -1747,7 +1747,7 @@ Intro_Scene20_AppearUnown: ; e5348 (39:5348)
adc d
ld d, a
- ld bc, 8
+ ld bc, 1 palettes
call CopyBytes
pop af
@@ -1950,7 +1950,7 @@ Intro_ClearBGPals: ; e54a3 (39:54a3)
ld [rSVBK], a
ld hl, BGPals
- ld bc, 16 * 8
+ ld bc, 16 palettes
xor a
call ByteFill
diff --git a/engine/debug.asm b/engine/debug.asm
index fda0d3e60..dee9b035d 100755
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -1202,10 +1202,10 @@ Function82236: ; 82236
ld [rSVBK], a
ld hl, BGPals
ld a, [wcf64]
- ld bc, 8
+ ld bc, 1 palettes
call AddNTimes
ld de, wc608
- ld bc, 8
+ ld bc, 1 palettes
call CopyBytes
pop af
ld [rSVBK], a
@@ -1232,12 +1232,12 @@ Function822a3: ; 822a3
ld [rSVBK], a
ld hl, BGPals
ld a, [wcf64]
- ld bc, 8
+ ld bc, 1 palettes
call AddNTimes
ld e, l
ld d, h
ld hl, wc608
- ld bc, 8
+ ld bc, 1 palettes
call CopyBytes
hlcoord 1, 0
ld de, wc608
diff --git a/engine/events/poisonstep_pals.asm b/engine/events/poisonstep_pals.asm
index 088be8848..9562ecb67 100644
--- a/engine/events/poisonstep_pals.asm
+++ b/engine/events/poisonstep_pals.asm
@@ -29,7 +29,7 @@ LoadPoisonBGPals: ; cbcdd
ld a, $5
ld [rSVBK], a
ld hl, BGPals
- ld c, $20
+ ld c, 4 palettes
.loop
; RGB 28, 21, 31
ld a, LOW(palred 28 + palgreen 21 + palblue 31)
diff --git a/engine/pokedex.asm b/engine/pokedex.asm
index 0297cf840..aa540e9c6 100644
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -2351,7 +2351,7 @@ Pokedex_BlackOutBG: ; 41401 (10:5401)
ld a, $5
ld [rSVBK], a
ld hl, UnknBGPals
- ld bc, $40
+ ld bc, 8 palettes
xor a
call ByteFill
pop af
diff --git a/mobile/mobile_22_2.asm b/mobile/mobile_22_2.asm
index 824643632..a1394bf44 100644
--- a/mobile/mobile_22_2.asm
+++ b/mobile/mobile_22_2.asm
@@ -621,7 +621,7 @@ Function8b6bb: ; 8b6bb
ld [rSVBK], a
ld hl, Palette_8b6d5
ld de, UnknBGPals
- ld bc, $0018
+ ld bc, 3 palettes
call CopyBytes
pop af
ld [rSVBK], a
diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm
index a9335ba3d..4b1baa2fa 100755
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -658,7 +658,7 @@ Function11636e: ; 11636e
ld [rSVBK], a
ld hl, BGPals
ld de, UnknBGPals
- ld bc, $0040
+ ld bc, 8 palettes
call CopyBytes
pop af
ld [rSVBK], a
diff --git a/mobile/mobile_5b.asm b/mobile/mobile_5b.asm
index 5d2e3277b..acedea5b1 100755
--- a/mobile/mobile_5b.asm
+++ b/mobile/mobile_5b.asm
@@ -243,7 +243,7 @@ Function16c943: ; 16c943
ld a, $5
ld [rSVBK], a
ld a, $ff
- ld bc, $0008
+ ld bc, 1 palettes
ld hl, UnknBGPals
call ByteFill
pop af
diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm
index 18ae114cc..e6effc33a 100755
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -717,7 +717,7 @@ Function171ccd: ; 171ccd (5c:5ccd)
ld [rSVBK], a
ld hl, Palette_171d71
ld de, UnknBGPals
- ld bc, $40
+ ld bc, 8 palettes
call CopyBytes
ld hl, EngineBuffer5
ld a, $ff
@@ -885,11 +885,11 @@ Function172eb9:
ld [rSVBK], a
ld hl, Palette_172edf
ld de, UnknBGPals
- ld bc, $40
+ ld bc, 8 palettes
call CopyBytes
ld hl, Palette_172edf
ld de, BGPals
- ld bc, $40
+ ld bc, 8 palettes
call CopyBytes
call SetPalettes
pop af
diff --git a/mobile/mobile_5e.asm b/mobile/mobile_5e.asm
index 78a9e5211..ea54b9f98 100644
--- a/mobile/mobile_5e.asm
+++ b/mobile/mobile_5e.asm
@@ -765,22 +765,22 @@ Function17abcf: ; 17abcf (5e:6bcf)
ld hl, Palette_17ac55
ld de, UnknBGPals ; $d000
- ld bc, $30
+ ld bc, 6 palettes
call CopyBytes
ld hl, Palette_17ac95
ld de, UnknOBPals
- ld bc, $40
+ ld bc, 8 palettes
call CopyBytes
ld hl, GFX_17afa5 + $510
- ld de, UnknOBPals + 2 * 4
- ld bc, $10
+ ld de, UnknOBPals palette 1
+ ld bc, 2 palettes
call CopyBytes
- ld hl, MapObjectPals + 8
- ld de, UnknOBPals + 6 * 4
- ld bc, $8
+ ld hl, MapObjectPals palette 1
+ ld de, UnknOBPals palette 3
+ ld bc, 1 palettes
ld a, BANK(MapObjectPals)
call FarCopyBytes
diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm
index 0228c8030..1e6ed4a02 100644
--- a/mobile/mobile_5f.asm
+++ b/mobile/mobile_5f.asm
@@ -49,7 +49,7 @@ Function17c000: ; 17c000
ld hl, HaveWantPals
ld de, UnknBGPals
- ld bc, $80
+ ld bc, 16 palettes
call CopyBytes
pop af
@@ -1964,8 +1964,8 @@ Function17dcaf:
ld a, $5
ld [rSVBK], a
ld hl, UnknBGPals
- ld de, $8
- ld c, $8
+ ld de, 1 palettes
+ ld c, 8
.asm_17dcbb
push hl
ld a, $ff
diff --git a/tilesets/animations.asm b/tilesets/animations.asm
index 5f77b0e08..56741fd1e 100644
--- a/tilesets/animations.asm
+++ b/tilesets/animations.asm
@@ -954,7 +954,7 @@ TileAnimationPalette: ; fc6d7
jr z, .color2
.color1
- ld hl, UnknBGPals + $1a ; pal 3 color 1
+ ld hl, UnknBGPals + palette 3 + 2
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -962,7 +962,7 @@ TileAnimationPalette: ; fc6d7
jr .end
.color0
- ld hl, UnknBGPals + $18 ; pal 3 color 0
+ ld hl, UnknBGPals + palette 3
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -970,7 +970,7 @@ TileAnimationPalette: ; fc6d7
jr .end
.color2
- ld hl, UnknBGPals + $1c ; pal 3 color 2
+ ld hl, UnknBGPals + palette 3 + 4
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -1007,11 +1007,11 @@ FlickeringCaveEntrancePalette: ; fc71e
ld a, [hVBlankCounter]
and %00000010
jr nz, .bit1set
- ld hl, UnknBGPals + $20 ; pal 4 color 0
+ ld hl, UnknBGPals + palette 4
jr .okay
.bit1set
- ld hl, UnknBGPals + $22 ; pal 4 color 2
+ ld hl, UnknBGPals + palette 4 + 2
.okay
ld a, [hli]