shithub: pokecrystal

Download patch

ref: eb75c58023eca2bf9123851f779b9cd9465104a5
parent: 122e24362449d61d3f8c798c199d93a5c62c6b46
author: yenatch <[email protected]>
date: Mon May 27 19:28:21 EDT 2013

heavy ball

--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -563,30 +563,48 @@
 ; ec38
 
 
-INCBIN "baserom.gbc", $ec38, $ec50 - $ec38
+GetPokedexEntryBank: ; ec38
+	push hl
+	push de
+	ld a, [EnemyMonSpecies]
+	rlca
+	rlca
+	and 3
+	ld hl, .PokedexEntryBanks
+	ld d, 0
+	ld e, a
+	add hl, de
+	ld a, [hl]
+	pop de
+	pop hl
+	ret
 
+.PokedexEntryBanks
+	db BANK(PokedexEntries1)
+	db BANK(PokedexEntries2)
+	db BANK(PokedexEntries3)
+	db BANK(PokedexEntries4)
+; ec50
 
 Function_0xec50: ; ec50
 	ld a, [EnemyMonSpecies]
-	ld hl, $4378
+	ld hl, PokedexDataPointerTable
 	dec a
 	ld e, a
-	ld d, $0
+	ld d, 0
 	add hl, de
 	add hl, de
-	ld a, $11
+	ld a, BANK(PokedexDataPointerTable)
 	call GetFarHalfword
 
-.asm_ec61
-	call $6c38
-
+.SkipText
+	call GetPokedexEntryBank
 	call GetFarByte
-
 	inc hl
-	cp $50
-	jr nz, .asm_ec61
-	call $6c38
+	cp "@"
+	jr nz, .SkipText
 
+	call GetPokedexEntryBank
 	push bc
 	inc hl
 	inc hl
@@ -604,16 +622,17 @@
 	rr c
 	srl b
 	rr c
-	call $6c99
+	call .asm_ec99
 
 	srl b
 	rr c
-	call $6c99
+	call .asm_ec99
 
 	ld a, h
 	pop bc
 	jr .asm_eca4
 
+.asm_ec99
 	push bc
 	ld a, b
 	cpl
@@ -631,13 +650,11 @@
 	cp $4
 	jr c, .asm_ecbc
 
-	ld hl, $6cc4
-
+	ld hl, .table_ecc4
 .asm_ecac
 	ld a, c
 	cp [hl]
 	jr c, .asm_ecb4
-
 	inc hl
 	inc hl
 	jr .asm_ecac
@@ -653,15 +670,18 @@
 
 .asm_ecbc
 	ld a, b
-	sub $14
+	sub 20
 	ld b, a
 	ret nc
 	ld b, $1
 	ret
-; ecc4
 
-
-INCBIN "baserom.gbc", $ecc4, $eccc - $ecc4
+.table_ecc4
+	db 8, 0
+	db 12, 20
+	db 16, 30
+	db 255, 40
+; eccc
 
 
 Function_0xeccc: ; eccc
--- a/main.asm
+++ b/main.asm
@@ -20645,7 +20645,7 @@
 
 ;                       Pokedex entries I
 ;                            001-064
-
+PokedexEntries1:
 INCLUDE "stats/pokedex/entries_1.asm"
 
 
@@ -20925,7 +20925,7 @@
 
 ;                       Pokedex entries II
 ;                            065-128
-
+PokedexEntries2:
 INCLUDE "stats/pokedex/entries_2.asm"
 
 
@@ -21031,7 +21031,7 @@
 
                       ; Pokedex entries III
                             ; 129-192
-							
+PokedexEntries3:
 INCLUDE "stats/pokedex/entries_3.asm"
 
 
@@ -21039,7 +21039,7 @@
 
 ;                       Pokedex entries IV
                             ; 193-251
-							
+PokedexEntries4:
 INCLUDE "stats/pokedex/entries_4.asm"