shithub: pokecrystal

Download patch

ref: 2eeb78d1bcecf09b2a48035dc24c19a726c41819
parent: 12396874cf3220cbf3788d86ded266f234eeda1b
author: pikalaxalt <[email protected]>
date: Mon May 16 11:46:13 EDT 2016

Evolution addresses

--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -21,7 +21,7 @@
 	pop de
 	pop hl
 
-	ld a, [Buffer4]
+	ld a, [wEvolutionCanceled]
 	and a
 	ret z
 
@@ -30,7 +30,7 @@
 ; 4e607
 
 .EvolutionAnimation: ; 4e607
-	ld a, $e4
+	ld a, %11100100
 	ld [rOBP0], a
 
 	ld de, MUSIC_NONE
@@ -48,12 +48,12 @@
 	call WaitBGMap
 	xor a
 	ld [hBGMapMode], a
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	ld [PlayerHPPal], a
 
 	ld c, $0
 	call .GetSGBLayout
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 	call .PlaceFrontpic
@@ -60,17 +60,17 @@
 
 	ld de, VTiles2
 	ld hl, VTiles2 tile $31
-	ld bc, $31
+	ld bc, 7 * 7
 	call Request2bpp
 
-	ld a, $31
-	ld [wd1ec], a
+	ld a, 7 * 7
+	ld [wEvolutionPicOffset], a
 	call .ReplaceFrontpic
-	ld a, [Buffer2]
+	ld a, [wEvolutionNewSpecies]
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 	call .LoadFrontpic
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 
@@ -79,7 +79,7 @@
 	call .check_statused
 	jr c, .skip_cry
 
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	call PlayCry
 
 .skip_cry
@@ -95,13 +95,12 @@
 	jr c, .cancel_evo
 
 	ld a, -7 * 7
-	ld [wd1ec], a
-
+	ld [wEvolutionPicOffset], a
 	call .ReplaceFrontpic
 	xor a
-	ld [Buffer4], a
+	ld [wEvolutionCanceled], a
 
-	ld a, [Buffer2]
+	ld a, [wEvolutionNewSpecies]
 	ld [PlayerHPPal], a
 
 	ld c, $0
@@ -136,9 +135,9 @@
 
 .cancel_evo
 	ld a, $1
-	ld [Buffer4], a
+	ld [wEvolutionCanceled], a
 
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	ld [PlayerHPPal], a
 
 	ld c, $0
@@ -200,10 +199,10 @@
 
 .Flash: ; 4e741
 	ld a, -7 * 7 ; new stage
-	ld [wd1ec], a
+	ld [wEvolutionPicOffset], a
 	call .ReplaceFrontpic
 	ld a, 7 * 7 ; previous stage
-	ld [wd1ec], a
+	ld [wEvolutionPicOffset], a
 	call .ReplaceFrontpic
 	dec b
 	jr nz, .Flash
@@ -220,7 +219,7 @@
 .loop1
 	push bc
 .loop2
-	ld a, [wd1ec]
+	ld a, [wEvolutionPicOffset]
 	add [hl]
 	ld [hli], a
 	dec c
@@ -269,7 +268,7 @@
 ; 4e7a6
 
 .PlayEvolvedSFX: ; 4e7a6
-	ld a, [Buffer4]
+	ld a, [wEvolutionCanceled]
 	and a
 	ret nz
 	ld de, SFX_EVOLVED
--- a/engine/evolve.asm
+++ b/engine/evolve.asm
@@ -29,7 +29,7 @@
 	cp $ff
 	jp z, .ReturnToMap
 
-	ld [Buffer1], a
+	ld [wEvolutionOldSpecies], a
 
 	push hl
 	ld a, [CurPartyMon]
@@ -41,7 +41,7 @@
 	and a
 	jp z, EvolveAfterBattle_MasterLoop
 
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	dec a
 	ld b, 0
 	ld c, a
@@ -204,7 +204,7 @@
 	push hl
 
 	ld a, [hl]
-	ld [Buffer2], a
+	ld [wEvolutionNewSpecies], a
 	ld a, [CurPartyMon]
 	ld hl, PartyMonNicknames
 	call GetNick
@@ -240,7 +240,7 @@
 	ld a, [hl]
 	ld [CurSpecies], a
 	ld [TempMonSpecies], a
-	ld [Buffer2], a
+	ld [wEvolutionNewSpecies], a
 	ld [wd265], a
 	call GetPokemonName
 
@@ -530,7 +530,7 @@
 	ld a, [CurPartyLevel]
 	cp b
 	jp c, .done
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	and a
 	jr z, .CheckMove
 	ld a, [wd002]
@@ -563,7 +563,7 @@
 	ld h, d
 	ld l, e
 	call ShiftMoves
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	and a
 	jr z, .ShiftedMove
 	push de
@@ -580,7 +580,7 @@
 .LearnMove:
 	ld a, [hl]
 	ld [de], a
-	ld a, [Buffer1]
+	ld a, [wEvolutionOldSpecies]
 	and a
 	jr z, .NextMove
 	push hl
--- a/wram.asm
+++ b/wram.asm
@@ -2037,14 +2037,17 @@
 	ds wCurHPAnimMaxHP - @
 
 MagikarpLength::
+wEvolutionOldSpecies::
 Buffer1:: ; d1ea
 	ds 1
 MovementType::
+wEvolutionNewSpecies::
 Buffer2:: ; d1eb
 	ds 1
-
+wEvolutionPicOffset::
 Buffer3::
 wd1ec:: ds 1
+wEvolutionCanceled::
 Buffer4::
 wd1ed:: ds 1
 Buffer5::