summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-10-12 13:05:36 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-10-12 13:05:36 -0400
commit2cf4efe15c50e84824bad8420b16009e6fa066c3 (patch)
tree116e2fb232f85208892d47360e044e6eccfb4c20
parent9b2c58dfd3021bb0c4eedb9df1cfe5ca23060c17 (diff)
Rename some palette labels.
Also add replace.sh
-rw-r--r--engine/battle/battle_transitions.asm8
-rw-r--r--engine/battle/ghost_marowak_anim.asm6
-rwxr-xr-xengine/gamefreak.asm8
-rwxr-xr-xengine/hall_of_fame.asm2
-rwxr-xr-xengine/overworld/healing_machine.asm6
-rwxr-xr-xengine/palettes.asm6
-rw-r--r--home.asm24
-rw-r--r--home/fade.asm18
-rw-r--r--replace.sh1
-rwxr-xr-xwram.asm6
10 files changed, 43 insertions, 42 deletions
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 2ff681dd..c5c4ffbe 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -196,9 +196,9 @@ BattleTransition_BlackScreen: ; 70ad3 (1c:4ad3)
ld [rBGP], a
ld [rOBP0], a
ld [rOBP1], a
- call Func_3021
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
; for non-dungeon trainer battles
@@ -362,7 +362,7 @@ BattleTransition_FlashScreen_: ; 70be8 (1c:4be8)
cp $1
jr z, .done
ld [rBGP], a
- call Func_3021
+ call UpdateGBCPal_BGP
ld c, $2
call DelayFrames
jr .loop
diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm
index 719fcf0a..67ed3247 100644
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -2,7 +2,7 @@ MarowakAnim: ; 7092b (1c:492b)
; animate the ghost being unveiled as a Marowak
ld a, $e4
ld [rOBP1], a
- call Func_3061
+ call UpdateGBCPal_OBP1
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
coord hl, 12, 0
@@ -28,7 +28,7 @@ MarowakAnim: ; 7092b (1c:492b)
sla a
sla a
ld [rOBP1], a
- call Func_3061
+ call UpdateGBCPal_OBP1
jr nz, .fadeOutGhostLoop
call ClearSprites
call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM
@@ -42,7 +42,7 @@ MarowakAnim: ; 7092b (1c:492b)
srl b
rra
ld [rOBP1], a
- call Func_3061
+ call UpdateGBCPal_OBP1
ld a, b
and a
jr nz, .fadeInMarowakLoop
diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm
index acbd5fc9..a5c0edef 100755
--- a/engine/gamefreak.asm
+++ b/engine/gamefreak.asm
@@ -3,8 +3,8 @@ LoadShootingStarGraphics: ; 70000 (1c:4000)
ld [rOBP0], a
ld a, $a4
ld [rOBP1], a ; $ff49
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld de, AnimationTileset2 ; $4757 ; star tile (top left quadrant)
ld hl, vChars1 + $200
lb bc, BANK(AnimationTileset2), $01
@@ -77,7 +77,7 @@ AnimateShootingStar: ; 7004a (1c:404a)
ld hl, rOBP0 ; $ff48
rrc [hl]
rrc [hl]
- call Func_3040
+ call UpdateGBCPal_OBP0
ld c, 10
call CheckForUserInterruption
ret c
@@ -223,7 +223,7 @@ MoveDownSmallStars: ; 70142 (1c:4142)
ld a, [rOBP1] ; $ff49
xor %10100000
ld [rOBP1], a ; $ff49
- call Func_3061
+ call UpdateGBCPal_OBP1
ld c, 3
call CheckForUserInterruption
ret c
diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm
index d8ca2d2b..cf7a3caa 100755
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -121,7 +121,7 @@ HoFShowMonOrPlayer: ; 702a2 (1c:42a2)
call RunPaletteCommand
ld a, %11100100
ld [rBGP], a
- call Func_3021
+ call UpdateGBCPal_BGP
ld c, $31 ; back pic
call HoFLoadMonPlayerPicTileIDs
ld d, $a0
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index 320cda73..daaf33b2 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -12,7 +12,7 @@ AnimateHealingMachine: ; 7048b (1c:448b)
push af
ld a, $e0
ld [rOBP1], a ; $ff49
- call Func_3061
+ call UpdateGBCPal_OBP1
ld hl, wOAMBuffer + $84
ld de, PokeCenterOAMData ; $44d7
call CopyHealingMachineOAM
@@ -54,7 +54,7 @@ AnimateHealingMachine: ; 7048b (1c:448b)
call DelayFrames
pop af
ld [rOBP1], a ; $ff49
- call Func_3061
+ call UpdateGBCPal_OBP1
pop hl
pop af
ld [hl], a
@@ -79,7 +79,7 @@ FlashSprite8Times: ; 70547 (1c:4547)
ld a, [rOBP1]
xor d
ld [rOBP1], a
- call Func_3061
+ call UpdateGBCPal_OBP1
ld c, 10
call DelayFrames
dec b
diff --git a/engine/palettes.asm b/engine/palettes.asm
index 2668236a..58efd103 100755
--- a/engine/palettes.asm
+++ b/engine/palettes.asm
@@ -849,17 +849,17 @@ Func_7240f:: ; 7240f (1c:640f)
and a
jr nz,.asm_72419
ld a,[rBGP]
- ld [wdef2],a
+ ld [wLastBGP],a
jr .asm_72428
.asm_72419
dec a
jr nz,.asm_72423
ld a,[rOBP0]
- ld [wdef3],a
+ ld [wLastOBP0],a
jr .asm_72428
.asm_72423
ld a,[rOBP1]
- ld [wdef4],a
+ ld [wLastOBP1],a
.asm_72428
ld b,a
and $3
diff --git a/home.asm b/home.asm
index c13c2073..2da17653 100644
--- a/home.asm
+++ b/home.asm
@@ -2324,7 +2324,7 @@ DisplayTextBoxID:: ; 3010 (0:3010)
homecall_sf DisplayTextBoxID_
ret
-Func_3021:: ; 3021 (0:3021)
+UpdateGBCPal_BGP:: ; 3021 (0:3021)
push af
ld a,[hGBC]
and a
@@ -2334,7 +2334,7 @@ Func_3021:: ; 3021 (0:3021)
push hl
ld a,[rBGP]
ld b,a
- ld a,[wdef2]
+ ld a,[wLastBGP]
cp b
jr z,.asm_303b
callba Func_72524 ; 1c:6524
@@ -2346,7 +2346,7 @@ Func_3021:: ; 3021 (0:3021)
pop af
ret
-Func_3040:: ; 3040 (0:3040)
+UpdateGBCPal_OBP0:: ; 3040 (0:3040)
push af
ld a,[hGBC]
and a
@@ -2356,7 +2356,7 @@ Func_3040:: ; 3040 (0:3040)
push hl
ld a,[rOBP0]
ld b,a
- ld a,[wdef3]
+ ld a,[wLastOBP0]
cp b
jr z,.asm_305c
ld b,BANK(Func_7256c) ; 1c:656c
@@ -2371,7 +2371,7 @@ Func_3040:: ; 3040 (0:3040)
pop af
ret
-Func_3061:: ; 3061 (0:3061)
+UpdateGBCPal_OBP1:: ; 3061 (0:3061)
push af
ld a,[hGBC]
and a
@@ -2381,7 +2381,7 @@ Func_3061:: ; 3061 (0:3061)
push hl
ld a,[rOBP1]
ld b,a
- ld a,[wdef4]
+ ld a,[wLastOBP1]
cp b
jr z,.asm_307d
ld b,BANK(Func_7256c)
@@ -4771,9 +4771,9 @@ GBPalNormal:: ; 3de0 (0:3de0)
ld [rBGP], a
ld a, %11010000 ; 3100
ld [rOBP0], a
- call Func_3021
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
GBPalWhiteOut:: ; 3df2 (0:3df2)
@@ -4782,9 +4782,9 @@ GBPalWhiteOut:: ; 3df2 (0:3df2)
ld [rBGP],a
ld [rOBP0],a
ld [rOBP1],a
- call Func_3021
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
diff --git a/home/fade.asm b/home/fade.asm
index 166ba9ee..2bdcbf01 100644
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -16,9 +16,9 @@ LoadGBPal:: ; 1e6f (0:1e6f)
ld [rOBP0], a
ld a, [hli]
ld [rOBP1], a
- call Func_3021
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
GBFadeInFromBlack:: ; 1e8f (0:1e8f)
@@ -37,9 +37,9 @@ GBFadeIncCommon: ; 1e9b (0:1e9b)
ld [rOBP0], a
ld a, [hli]
ld [rOBP1], a
- call Func_3021
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld c, 8
call DelayFrames
dec b
@@ -62,9 +62,9 @@ GBFadeDecCommon:
ld [rOBP0], a
ld a, [hld]
ld [rBGP], a
- call Func_3021
- call Func_3040
- call Func_3061
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld c, 8
call DelayFrames
dec b
diff --git a/replace.sh b/replace.sh
new file mode 100644
index 00000000..8de735f9
--- /dev/null
+++ b/replace.sh
@@ -0,0 +1 @@
+sed -i 's/\<wdef4\>/wLastOBP1/' $(git grep -l wdef4) \ No newline at end of file
diff --git a/wram.asm b/wram.asm
index 58f8cf2e..a2d651a2 100755
--- a/wram.asm
+++ b/wram.asm
@@ -3307,9 +3307,9 @@ wdeee:: ds 1
wdeef:: ds 1
wdef0:: ds 1
wdef1:: ds 1
-wdef2:: ds 1
-wdef3:: ds 1
-wdef4:: ds 1
+wLastBGP:: ds 1
+wLastOBP0:: ds 1
+wLastOBP1:: ds 1
wdef5:: ds 1
wdef6:: ds 1