summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiegoisawesome <Diegoisawesome@users.noreply.github.com>2018-02-12 22:36:55 -0600
committerGitHub <noreply@github.com>2018-02-12 22:36:55 -0600
commitbb8c53f8988be6cad8f270c46f24e0f6f1e862cc (patch)
treedca7115e05ed132733c1e5ea0b4a3322a2d41e9a
parent398e775d906ff4f1e5aaad3d8a9eee530c7b122d (diff)
parentaaea65c37bb6dbe04de602492f6e175cabc87f22 (diff)
Merge pull request #208 from KDSKardabox/master
Decompile birch_pc.c
-rw-r--r--asm/battle_frontier_1.s8
-rw-r--r--asm/birch_pc.s234
-rw-r--r--asm/easy_chat.s4
-rw-r--r--asm/main_menu.s4
-rw-r--r--asm/pokedex.s24
-rw-r--r--asm/smokescreen.s214
-rw-r--r--asm/start_menu.s2
-rw-r--r--asm/trainer_card.s4
-rw-r--r--data/battle_frontier_1.s42
-rw-r--r--data/text/pokedex_rating.inc42
-rw-r--r--include/data2.h4
-rw-r--r--include/pokedex.h4
-rw-r--r--include/strings.h22
-rw-r--r--ld_script.txt4
-rw-r--r--src/birch_pc.c93
-rw-r--r--src/menu.c28
-rw-r--r--src/smokescreen.c71
-rw-r--r--src/tv.c4
18 files changed, 275 insertions, 533 deletions
diff --git a/asm/battle_frontier_1.s b/asm/battle_frontier_1.s
index 60ac46859..6ea5ba051 100644
--- a/asm/battle_frontier_1.s
+++ b/asm/battle_frontier_1.s
@@ -15923,11 +15923,11 @@ sub_8197080: @ 8197080
b _0819715C
_081970A2:
movs r0, 0
- bl sub_80C0844
+ bl GetHoennPokedexCount
lsls r0, 16
lsrs r4, r0, 16
movs r0, 0x1
- bl sub_80C0844
+ bl GetHoennPokedexCount
lsls r0, 16
lsrs r6, r0, 16
ldr r0, =gStringVar1
@@ -15977,11 +15977,11 @@ _081970A2:
strb r6, [r5]
adds r5, 0x1
movs r0, 0
- bl pokedex_count
+ bl GetNationalPokedexCount
lsls r0, 16
lsrs r4, r0, 16
movs r0, 0x1
- bl pokedex_count
+ bl GetNationalPokedexCount
lsls r0, 16
lsrs r6, r0, 16
mov r0, r10
diff --git a/asm/birch_pc.s b/asm/birch_pc.s
deleted file mode 100644
index 6665d9beb..000000000
--- a/asm/birch_pc.s
+++ /dev/null
@@ -1,234 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start ScriptGetPokedexInfo
-ScriptGetPokedexInfo: @ 8137A4C
- push {lr}
- ldr r0, =gSpecialVar_0x8004
- ldrh r0, [r0]
- cmp r0, 0
- bne _08137A70
- movs r0, 0
- bl sub_80C0844
- ldr r1, =gSpecialVar_0x8005
- strh r0, [r1]
- movs r0, 0x1
- bl sub_80C0844
- b _08137A80
- .pool
-_08137A70:
- movs r0, 0
- bl pokedex_count
- ldr r1, =gSpecialVar_0x8005
- strh r0, [r1]
- movs r0, 0x1
- bl pokedex_count
-_08137A80:
- ldr r1, =gSpecialVar_0x8006
- strh r0, [r1]
- bl IsNationalPokedexEnabled
- lsls r0, 16
- lsrs r0, 16
- pop {r1}
- bx r1
- .pool
- thumb_func_end ScriptGetPokedexInfo
-
- thumb_func_start GetPokedexRatingText
-GetPokedexRatingText: @ 8137A98
- push {lr}
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x9
- bhi _08137AA4
- b _08137BFC
-_08137AA4:
- cmp r0, 0x13
- bhi _08137AB0
- ldr r0, =gUnknown_082A5DAB
- b _08137C06
- .pool
-_08137AB0:
- cmp r0, 0x1D
- bhi _08137ABC
- ldr r0, =gUnknown_082A5DF1
- b _08137C06
- .pool
-_08137ABC:
- cmp r0, 0x27
- bhi _08137AC8
- ldr r0, =gUnknown_082A5E34
- b _08137C06
- .pool
-_08137AC8:
- cmp r0, 0x31
- bhi _08137AD4
- ldr r0, =gUnknown_082A5E83
- b _08137C06
- .pool
-_08137AD4:
- cmp r0, 0x3B
- bhi _08137AE0
- ldr r0, =gUnknown_082A5EB9
- b _08137C06
- .pool
-_08137AE0:
- cmp r0, 0x45
- bhi _08137AEC
- ldr r0, =gUnknown_082A5EF4
- b _08137C06
- .pool
-_08137AEC:
- cmp r0, 0x4F
- bhi _08137AF8
- ldr r0, =gUnknown_082A5F39
- b _08137C06
- .pool
-_08137AF8:
- cmp r0, 0x59
- bhi _08137B04
- ldr r0, =gUnknown_082A5F82
- b _08137C06
- .pool
-_08137B04:
- cmp r0, 0x63
- bhi _08137B10
- ldr r0, =gUnknown_082A5FB9
- b _08137C06
- .pool
-_08137B10:
- cmp r0, 0x6D
- bhi _08137B1C
- ldr r0, =gUnknown_082A6018
- b _08137C06
- .pool
-_08137B1C:
- cmp r0, 0x77
- bhi _08137B28
- ldr r0, =gUnknown_082A6061
- b _08137C06
- .pool
-_08137B28:
- cmp r0, 0x81
- bhi _08137B34
- ldr r0, =gUnknown_082A609C
- b _08137C06
- .pool
-_08137B34:
- cmp r0, 0x8B
- bhi _08137B40
- ldr r0, =gUnknown_082A60D5
- b _08137C06
- .pool
-_08137B40:
- cmp r0, 0x95
- bhi _08137B4C
- ldr r0, =gUnknown_082A6124
- b _08137C06
- .pool
-_08137B4C:
- cmp r0, 0x9F
- bhi _08137B58
- ldr r0, =gUnknown_082A616F
- b _08137C06
- .pool
-_08137B58:
- cmp r0, 0xA9
- bhi _08137B64
- ldr r0, =gUnknown_082A61D6
- b _08137C06
- .pool
-_08137B64:
- cmp r0, 0xB3
- bhi _08137B70
- ldr r0, =gUnknown_082A623A
- b _08137C06
- .pool
-_08137B70:
- cmp r0, 0xBD
- bhi _08137B7C
- ldr r0, =gUnknown_082A6287
- b _08137C06
- .pool
-_08137B7C:
- cmp r0, 0xC7
- bls _08137BEA
- cmp r0, 0xC8
- bne _08137BB8
- ldr r0, =0x00000199
- bl SpeciesToNationalPokedexNum
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x1
- bl GetSetPokedexFlag
- lsls r0, 24
- cmp r0, 0
- bne _08137BEA
- movs r0, 0xCD
- lsls r0, 1
- bl SpeciesToNationalPokedexNum
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x1
- bl GetSetPokedexFlag
- lsls r0, 24
- cmp r0, 0
- bne _08137BEA
- b _08137C04
- .pool
-_08137BB8:
- cmp r0, 0xC9
- bne _08137BF8
- ldr r0, =0x00000199
- bl SpeciesToNationalPokedexNum
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x1
- bl GetSetPokedexFlag
- lsls r0, 24
- cmp r0, 0
- beq _08137C04
- movs r0, 0xCD
- lsls r0, 1
- bl SpeciesToNationalPokedexNum
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x1
- bl GetSetPokedexFlag
- lsls r0, 24
- cmp r0, 0
- beq _08137C04
-_08137BEA:
- ldr r0, =gUnknown_082A62C9
- b _08137C06
- .pool
-_08137BF8:
- cmp r0, 0xCA
- beq _08137C04
-_08137BFC:
- ldr r0, =gUnknown_082A5D6C
- b _08137C06
- .pool
-_08137C04:
- ldr r0, =gUnknown_082A6312
-_08137C06:
- pop {r1}
- bx r1
- .pool
- thumb_func_end GetPokedexRatingText
-
- thumb_func_start ShowPokedexRatingMessage
-ShowPokedexRatingMessage: @ 8137C10
- push {lr}
- ldr r0, =gSpecialVar_0x8004
- ldrh r0, [r0]
- bl GetPokedexRatingText
- bl ShowFieldMessage
- pop {r0}
- bx r0
- .pool
- thumb_func_end ShowPokedexRatingMessage
diff --git a/asm/easy_chat.s b/asm/easy_chat.s
index db2ffac14..0cbe1f1ae 100644
--- a/asm/easy_chat.s
+++ b/asm/easy_chat.s
@@ -9252,7 +9252,7 @@ start_menu_is_selected_item_valid: @ 811EA6C
cmp r0, 0
bne _0811EA84
movs r0, 0
- bl pokedex_count
+ bl GetNationalPokedexCount
lsls r0, 16
lsrs r0, 16
b _0811EA9A
@@ -10369,7 +10369,7 @@ sub_811F2D4: @ 811F2D4
movs r5, 0
strh r5, [r0]
movs r0, 0
- bl pokedex_count
+ bl GetNationalPokedexCount
lsls r0, 16
cmp r0, 0
beq _0811F2FC
diff --git a/asm/main_menu.s b/asm/main_menu.s
index 48d1411c5..d5a69d503 100644
--- a/asm/main_menu.s
+++ b/asm/main_menu.s
@@ -4654,12 +4654,12 @@ fmt_pokedex: @ 8031F7C
cmp r0, 0
beq _08031FA4
movs r0, 0x1
- bl pokedex_count
+ bl GetNationalPokedexCount
b _08031FAA
.pool
_08031FA4:
movs r0, 0x1
- bl sub_80C0844
+ bl GetHoennPokedexCount
_08031FAA:
lsls r0, 16
lsrs r7, r0, 16
diff --git a/asm/pokedex.s b/asm/pokedex.s
index cb40f0eda..d28b54651 100644
--- a/asm/pokedex.s
+++ b/asm/pokedex.s
@@ -443,24 +443,24 @@ _080BB65E:
cmp r0, 0
bne _080BB6D0
movs r0, 0
- bl sub_80C0844
+ bl GetHoennPokedexCount
ldr r1, [r4]
ldr r2, =0x0000061a
adds r1, r2
strh r0, [r1]
movs r0, 0x1
- bl sub_80C0844
+ bl GetHoennPokedexCount
b _080BB6E4
.pool
_080BB6D0:
movs r0, 0
- bl pokedex_count
+ bl GetNationalPokedexCount
ldr r1, [r4]
ldr r2, =0x0000061a
adds r1, r2
strh r0, [r1]
movs r0, 0x1
- bl pokedex_count
+ bl GetNationalPokedexCount
_080BB6E4:
ldr r1, [r4]
ldr r3, =0x0000061c
@@ -5058,7 +5058,7 @@ _080BDF4C:
movs r1, 0x1
bl StartSpriteAnim
movs r0, 0
- bl sub_80C0844
+ bl GetHoennPokedexCount
lsls r0, 16
lsrs r6, r0, 16
movs r0, 0
@@ -5283,7 +5283,7 @@ _080BE198:
lsrs r1, 24
bl StartSpriteAnim
movs r0, 0x1
- bl sub_80C0844
+ bl GetHoennPokedexCount
lsls r0, 16
lsrs r6, r0, 16
movs r0, 0
@@ -9597,8 +9597,8 @@ _080C07E8:
.pool
thumb_func_end GetSetPokedexFlag
- thumb_func_start pokedex_count
-pokedex_count: @ 80C07F4
+ thumb_func_start GetNationalPokedexCount
+GetNationalPokedexCount: @ 80C07F4
push {r4-r7,lr}
lsls r0, 24
lsrs r6, r0, 24
@@ -9641,10 +9641,10 @@ _080C0832:
pop {r4-r7}
pop {r1}
bx r1
- thumb_func_end pokedex_count
+ thumb_func_end GetNationalPokedexCount
- thumb_func_start sub_80C0844
-sub_80C0844: @ 80C0844
+ thumb_func_start GetHoennPokedexCount
+GetHoennPokedexCount: @ 80C0844
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
@@ -9691,7 +9691,7 @@ _080C088C:
pop {r4-r6}
pop {r1}
bx r1
- thumb_func_end sub_80C0844
+ thumb_func_end GetHoennPokedexCount
thumb_func_start sub_80C089C
sub_80C089C: @ 80C089C
diff --git a/asm/smokescreen.s b/asm/smokescreen.s
deleted file mode 100644
index 464e25c40..000000000
--- a/asm/smokescreen.s
+++ /dev/null
@@ -1,214 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start sub_807521C
-sub_807521C: @ 807521C
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- lsls r0, 16
- lsrs r6, r0, 16
- lsls r1, 16
- lsrs r7, r1, 16
- lsls r2, 24
- lsrs r4, r2, 24
- ldr r5, =gUnknown_0831C620
- ldrh r0, [r5, 0x6]
- bl GetSpriteTileStartByTag
- lsls r0, 16
- ldr r1, =0xffff0000
- cmp r0, r1
- bne _0807524E
- adds r0, r5, 0
- bl LoadCompressedObjectPicUsingHeap
- ldr r0, =gUnknown_0831C628
- bl LoadCompressedObjectPaletteUsingHeap
-_0807524E:
- ldr r0, =sub_8075370
- bl CreateInvisibleSpriteWithCallback
- mov r8, r0
- mov r0, r8
- lsls r0, 24
- lsrs r0, 24
- mov r8, r0
- lsls r5, r0, 4
- add r5, r8
- lsls r5, 2
- ldr r0, =gSprites
- adds r5, r0
- strh r4, [r5, 0x30]
- ldr r0, =gUnknown_0831C688
- mov r9, r0
- lsls r6, 16
- asrs r0, r6, 16
- mov r10, r0
- ldr r0, =0xfff00000
- adds r6, r0
- asrs r6, 16
- lsls r4, r7, 16
- asrs r7, r4, 16
- adds r4, r0
- asrs r4, 16
- mov r0, r9
- adds r1, r6, 0
- adds r2, r4, 0
- movs r3, 0x2
- bl CreateSprite
- lsls r0, 24
- lsrs r0, 24
- lsls r1, r0, 4
- adds r1, r0
- lsls r1, 2
- ldr r0, =gSprites
- adds r1, r0
- mov r0, r8
- strh r0, [r1, 0x2E]
- ldrh r0, [r5, 0x2E]
- adds r0, 0x1
- strh r0, [r5, 0x2E]
- adds r0, r1, 0
- bl AnimateSprite
- mov r0, r9
- mov r1, r10
- adds r2, r4, 0
- movs r3, 0x2
- bl CreateSprite
- lsls r0, 24
- lsrs r0, 24
- lsls r4, r0, 4
- adds r4, r0
- lsls r4, 2
- ldr r0, =gSprites
- adds r4, r0
- mov r0, r8
- strh r0, [r4, 0x2E]
- ldrh r0, [r5, 0x2E]
- adds r0, 0x1
- strh r0, [r5, 0x2E]
- adds r0, r4, 0
- movs r1, 0x1
- bl StartSpriteAnim
- adds r0, r4, 0
- bl AnimateSprite
- mov r0, r9
- adds r1, r6, 0
- adds r2, r7, 0
- movs r3, 0x2
- bl CreateSprite
- lsls r0, 24
- lsrs r0, 24
- lsls r4, r0, 4
- adds r4, r0
- lsls r4, 2
- ldr r0, =gSprites
- adds r4, r0
- mov r0, r8
- strh r0, [r4, 0x2E]
- ldrh r0, [r5, 0x2E]
- adds r0, 0x1
- strh r0, [r5, 0x2E]
- adds r0, r4, 0
- movs r1, 0x2
- bl StartSpriteAnim
- adds r0, r4, 0
- bl AnimateSprite
- mov r0, r9
- mov r1, r10
- adds r2, r7, 0
- movs r3, 0x2
- bl CreateSprite
- lsls r0, 24
- lsrs r0, 24
- lsls r4, r0, 4
- adds r4, r0
- lsls r4, 2
- ldr r0, =gSprites
- adds r4, r0
- mov r0, r8
- strh r0, [r4, 0x2E]
- ldrh r0, [r5, 0x2E]
- adds r0, 0x1
- strh r0, [r5, 0x2E]
- adds r0, r4, 0
- movs r1, 0x3
- bl StartSpriteAnim
- adds r0, r4, 0
- bl AnimateSprite
- mov r0, r8
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_807521C
-
- thumb_func_start sub_8075370
-sub_8075370: @ 8075370
- push {r4,lr}
- adds r4, r0, 0
- movs r1, 0x2E
- ldrsh r0, [r4, r1]
- cmp r0, 0
- bne _080753A8
- ldr r0, =gUnknown_0831C620
- ldrh r0, [r0, 0x6]
- bl FreeSpriteTilesByTag
- ldr r0, =gUnknown_0831C628
- ldrh r0, [r0, 0x4]
- bl FreeSpritePaletteByTag
- movs r1, 0x30
- ldrsh r0, [r4, r1]
- cmp r0, 0
- bne _080753A4
- adds r0, r4, 0
- bl DestroySprite
- b _080753A8
- .pool
-_080753A4:
- ldr r0, =SpriteCallbackDummy
- str r0, [r4, 0x1C]
-_080753A8:
- pop {r4}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8075370
-
- thumb_func_start sub_80753B4
-sub_80753B4: @ 80753B4
- push {lr}
- adds r3, r0, 0
- adds r0, 0x3F
- ldrb r1, [r0]
- movs r0, 0x10
- ands r0, r1
- cmp r0, 0
- beq _080753DE
- ldr r2, =gSprites
- movs r0, 0x2E
- ldrsh r1, [r3, r0]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r2
- ldrh r1, [r0, 0x2E]
- subs r1, 0x1
- strh r1, [r0, 0x2E]
- adds r0, r3, 0
- bl DestroySprite
-_080753DE:
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_80753B4
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/start_menu.s b/asm/start_menu.s
index 23ac3710a..a57bbddc3 100644
--- a/asm/start_menu.s
+++ b/asm/start_menu.s
@@ -418,7 +418,7 @@ _0809FAFE:
cmp r1, r0
bne _0809FB34
movs r0, 0
- bl pokedex_count
+ bl GetNationalPokedexCount
lsls r0, 16
cmp r0, 0
beq _0809FBA0
diff --git a/asm/trainer_card.s b/asm/trainer_card.s
index d7c96054d..a56dbd157 100644
--- a/asm/trainer_card.s
+++ b/asm/trainer_card.s
@@ -1925,11 +1925,11 @@ sub_80C376C: @ 80C376C
cmp r0, 0
bne _080C377E
movs r0, 0x1
- bl sub_80C0844
+ bl GetHoennPokedexCount
b _080C3784
_080C377E:
movs r0, 0x1
- bl pokedex_count
+ bl GetNationalPokedexCount
_080C3784:
lsls r0, 16
lsrs r0, 16
diff --git a/data/battle_frontier_1.s b/data/battle_frontier_1.s
index 34e8df6d2..e2eb99505 100644
--- a/data/battle_frontier_1.s
+++ b/data/battle_frontier_1.s
@@ -1872,24 +1872,24 @@ gUnknown_0860F010:: @ 860F010
.2byte FLAG_BADGE08_GET
gUnknown_0860F020:: @ 860F020
- .4byte gUnknown_082A5D6C
- .4byte gUnknown_082A5DAB
- .4byte gUnknown_082A5DF1
- .4byte gUnknown_082A5E34
- .4byte gUnknown_082A5E83
- .4byte gUnknown_082A5EB9
- .4byte gUnknown_082A5EF4
- .4byte gUnknown_082A5F39
- .4byte gUnknown_082A5F82
- .4byte gUnknown_082A5FB9
- .4byte gUnknown_082A6018
- .4byte gUnknown_082A6061
- .4byte gUnknown_082A609C
- .4byte gUnknown_082A60D5
- .4byte gUnknown_082A6124
- .4byte gUnknown_082A616F
- .4byte gUnknown_082A61D6
- .4byte gUnknown_082A623A
- .4byte gUnknown_082A6287
- .4byte gUnknown_082A62C9
- .4byte gUnknown_082A6312
+ .4byte gBirchDexRatingText_LessThan10
+ .4byte gBirchDexRatingText_LessThan20
+ .4byte gBirchDexRatingText_LessThan30
+ .4byte gBirchDexRatingText_LessThan40
+ .4byte gBirchDexRatingText_LessThan50
+ .4byte gBirchDexRatingText_LessThan60
+ .4byte gBirchDexRatingText_LessThan70
+ .4byte gBirchDexRatingText_LessThan80
+ .4byte gBirchDexRatingText_LessThan90
+ .4byte gBirchDexRatingText_LessThan100
+ .4byte gBirchDexRatingText_LessThan110
+ .4byte gBirchDexRatingText_LessThan120
+ .4byte gBirchDexRatingText_LessThan130
+ .4byte gBirchDexRatingText_LessThan140
+ .4byte gBirchDexRatingText_LessThan150
+ .4byte gBirchDexRatingText_LessThan160
+ .4byte gBirchDexRatingText_LessThan170
+ .4byte gBirchDexRatingText_LessThan180
+ .4byte gBirchDexRatingText_LessThan190
+ .4byte gBirchDexRatingText_LessThan200
+ .4byte gBirchDexRatingText_DexCompleted
diff --git a/data/text/pokedex_rating.inc b/data/text/pokedex_rating.inc
index 735488b37..666c90867 100644
--- a/data/text/pokedex_rating.inc
+++ b/data/text/pokedex_rating.inc
@@ -12,99 +12,99 @@ gUnknown_082A5D2C:: @ 82A5D2C
.string "So, you’ve seen {STR_VAR_1} POKéMON,\n"
.string "and you’ve caught {STR_VAR_2} POKéMON…$"
-gUnknown_082A5D6C:: @ 82A5D6C
+gBirchDexRatingText_LessThan10:: @ 82A5D6C
.string "Go into grassy areas more and look\n"
.string "for POKéMON more carefully.$"
-gUnknown_082A5DAB:: @ 82A5DAB
+gBirchDexRatingText_LessThan20:: @ 82A5DAB
.string "I guess you’re getting the hang\n"
.string "of it. But, it gets harder from here.$"
-gUnknown_082A5DF1:: @ 82A5DF1
+gBirchDexRatingText_LessThan30:: @ 82A5DF1
.string "Some POKéMON only appear in\n"
.string "certain areas.\l"
.string "You must be persistent.$"
-gUnknown_082A5E34:: @ 82A5E34
+gBirchDexRatingText_LessThan40:: @ 82A5E34
.string "Well, it could use more quantity,\n"
.string "but this is looking more like\l"
.string "a POKéDEX now.$"
-gUnknown_082A5E83:: @ 82A5E83
+gBirchDexRatingText_LessThan50:: @ 82A5E83
.string "This is coming along pretty good.\n"
.string "Keep up the effort.$"
-gUnknown_082A5EB9:: @ 82A5EB9
+gBirchDexRatingText_LessThan60:: @ 82A5EB9
.string "Are you using any RODS?\n"
.string "There are many POKéMON in the sea.$"
-gUnknown_082A5EF4:: @ 82A5EF4
+gBirchDexRatingText_LessThan70:: @ 82A5EF4
.string "Instead of just catching POKéMON,\n"
.string "how about making them evolve, too?$"
-gUnknown_082A5F39:: @ 82A5F39
+gBirchDexRatingText_LessThan80:: @ 82A5F39
.string "This is going to be a fantastic\n"
.string "POKéDEX.\l"
.string "That’s the feeling I’m getting.$"
-gUnknown_082A5F82:: @ 82A5F82
+gBirchDexRatingText_LessThan90:: @ 82A5F82
.string "You’ve collected this many…\n"
.string "Your talent is remarkable!$"
-gUnknown_082A5FB9:: @ 82A5FB9
+gBirchDexRatingText_LessThan100:: @ 82A5FB9
.string "Have you visited the SAFARI ZONE?\p"
.string "I hear there are some POKéMON that\n"
.string "can only be caught there.$"
-gUnknown_082A6018:: @ 82A6018
+gBirchDexRatingText_LessThan110:: @ 82A6018
.string "You’ve finally reached\n"
.string "the 100-kind mark.\p"
.string "This is an impressive POKéDEX!$"
-gUnknown_082A6061:: @ 82A6061
+gBirchDexRatingText_LessThan120:: @ 82A6061
.string "There might be POKéMON that can be\n"
.string "found using ROCK SMASH.$"
-gUnknown_082A609C:: @ 82A609C
+gBirchDexRatingText_LessThan130:: @ 82A609C
.string "You should get some more POKéMON\n"
.string "by trading with others.$"
-gUnknown_082A60D5:: @ 82A60D5
+gBirchDexRatingText_LessThan140:: @ 82A60D5
.string "I’ve heard of POKéMON that evolve\n"
.string "when they come to fully love their\l"
.string "TRAINERS.$"
-gUnknown_082A6124:: @ 82A6124
+gBirchDexRatingText_LessThan150:: @ 82A6124
.string "I had no idea that there were so\n"
.string "many POKéMON species in the HOENN\l"
.string "region.$"
-gUnknown_082A616F:: @ 82A616F
+gBirchDexRatingText_LessThan160:: @ 82A616F
.string "On occasion, some POKéMON appear\n"
.string "in large numbers like outbreaks.\p"
.string "Don’t miss opportunities like\n"
.string "those.$"
-gUnknown_082A61D6:: @ 82A61D6
+gBirchDexRatingText_LessThan170:: @ 82A61D6
.string "One can get a very good idea about\n"
.string "the POKéMON of the HOENN region\l"
.string "by looking through your POKéDEX.$"
-gUnknown_082A623A:: @ 82A623A
+gBirchDexRatingText_LessThan180:: @ 82A623A
.string "I would say you already qualify as\n"
.string "a POKéMON PROFESSOR, and a good\l"
.string "one, too!$"
-gUnknown_082A6287:: @ 82A6287
+gBirchDexRatingText_LessThan190:: @ 82A6287
.string "With a POKéDEX this complete,\n"
.string "you’re a real professional at this!$"
-gUnknown_082A62C9:: @ 82A62C9
+gBirchDexRatingText_LessThan200:: @ 82A62C9
.string "You’re very close to completing\n"
.string "this POKéDEX.\l"
.string "I can feel it in my bones!$"
-gUnknown_082A6312:: @ 82A6312
+gBirchDexRatingText_DexCompleted:: @ 82A6312
.string "Congratulations!\n"
.string "Your POKéDEX is complete!$"
diff --git a/include/data2.h b/include/data2.h
index be0f33ab8..df71f6e88 100644
--- a/include/data2.h
+++ b/include/data2.h
@@ -16,5 +16,9 @@ extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1];
extern const u8 gMoveNames[][13];
extern const u8 gAbilityNames[][13];
extern const u8 gTypeNames[][7];
+extern struct CompressedSpriteSheet gUnknown_0831C620;
+extern struct CompressedSpritePalette gUnknown_0831C628;
+extern const struct SpriteTemplate gUnknown_0831C688;
+
#endif // GUARD_DATA2_H
diff --git a/include/pokedex.h b/include/pokedex.h
index 236feac45..d3cb670c8 100644
--- a/include/pokedex.h
+++ b/include/pokedex.h
@@ -17,7 +17,7 @@ enum
};
s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
-u16 pokedex_count(u8);
-u16 sub_80C0844(u8);
+u16 GetNationalPokedexCount(u8);
+u16 GetHoennPokedexCount(u8);
#endif // GUARD_POKEDEX_H
diff --git a/include/strings.h b/include/strings.h
index f79743244..69fd1bba3 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -278,4 +278,26 @@ extern const u8 gText_DepositedVar2Var1s[];
extern const u8 gText_NoRoomForItems[];
extern const u8 gText_ThreeDashes[];
+extern const u8 gBirchDexRatingText_LessThan10[];
+extern const u8 gBirchDexRatingText_LessThan20[];
+extern const u8 gBirchDexRatingText_LessThan30[];
+extern const u8 gBirchDexRatingText_LessThan40[];
+extern const u8 gBirchDexRatingText_LessThan50[];
+extern const u8 gBirchDexRatingText_LessThan60[];
+extern const u8 gBirchDexRatingText_LessThan70[];
+extern const u8 gBirchDexRatingText_LessThan80[];
+extern const u8 gBirchDexRatingText_LessThan90[];
+extern const u8 gBirchDexRatingText_LessThan100[];
+extern const u8 gBirchDexRatingText_LessThan110[];
+extern const u8 gBirchDexRatingText_LessThan120[];
+extern const u8 gBirchDexRatingText_LessThan130[];
+extern const u8 gBirchDexRatingText_LessThan140[];
+extern const u8 gBirchDexRatingText_LessThan150[];
+extern const u8 gBirchDexRatingText_LessThan160[];
+extern const u8 gBirchDexRatingText_LessThan170[];
+extern const u8 gBirchDexRatingText_LessThan180[];
+extern const u8 gBirchDexRatingText_LessThan190[];
+extern const u8 gBirchDexRatingText_LessThan200[];
+extern const u8 gBirchDexRatingText_DexCompleted[];
+
#endif //GUARD_STRINGS_H
diff --git a/ld_script.txt b/ld_script.txt
index 86e0d58d3..838c468ad 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -79,7 +79,7 @@ SECTIONS {
src/daycare.o(.text);
src/egg_hatch.o(.text);
src/battle_interface.o(.text);
- asm/smokescreen.o(.text);
+ src/smokescreen.o(.text);
src/pokeball.o(.text);
src/load_save.o(.text);
asm/trade.o(.text);
@@ -183,7 +183,7 @@ SECTIONS {
asm/fldeff_flash.o(.text);
asm/post_battle_event_funcs.o(.text);
src/time_events.o(.text);
- asm/birch_pc.o(.text);
+ src/birch_pc.o(.text);
src/hof_pc.o(.text);
asm/field_specials.o(.text);
asm/battle_records.o(.text);
diff --git a/src/birch_pc.c b/src/birch_pc.c
new file mode 100644
index 000000000..0f44824f7
--- /dev/null
+++ b/src/birch_pc.c
@@ -0,0 +1,93 @@
+#include "global.h"
+#include "event_data.h"
+#include "field_message_box.h"
+#include "pokedex.h"
+#include "constants/species.h"
+#include "strings.h"
+
+extern u16 gSpecialVar_0x8004;
+extern u16 gSpecialVar_0x8005;
+extern u16 gSpecialVar_0x8006;
+
+bool16 ScriptGetPokedexInfo(void)
+{
+ if (gSpecialVar_0x8004 == 0) // is national dex not present?
+ {
+ gSpecialVar_0x8005 = GetHoennPokedexCount(0);
+ gSpecialVar_0x8006 = GetHoennPokedexCount(1);
+ }
+ else
+ {
+ gSpecialVar_0x8005 = GetNationalPokedexCount(0);
+ gSpecialVar_0x8006 = GetNationalPokedexCount(1);
+ }
+
+ return IsNationalPokedexEnabled();
+}
+
+// This shows your Hoenn Pokedex rating and not your National Dex.
+const u8 *GetPokedexRatingText(u16 count)
+{
+ if (count < 10)
+ return gBirchDexRatingText_LessThan10;
+ if (count < 20)
+ return gBirchDexRatingText_LessThan20;
+ if (count < 30)
+ return gBirchDexRatingText_LessThan30;
+ if (count < 40)
+ return gBirchDexRatingText_LessThan40;
+ if (count < 50)
+ return gBirchDexRatingText_LessThan50;
+ if (count < 60)
+ return gBirchDexRatingText_LessThan60;
+ if (count < 70)
+ return gBirchDexRatingText_LessThan70;
+ if (count < 80)
+ return gBirchDexRatingText_LessThan80;
+ if (count < 90)
+ return gBirchDexRatingText_LessThan90;
+ if (count < 100)
+ return gBirchDexRatingText_LessThan100;
+ if (count < 110)
+ return gBirchDexRatingText_LessThan110;
+ if (count < 120)
+ return gBirchDexRatingText_LessThan120;
+ if (count < 130)
+ return gBirchDexRatingText_LessThan130;
+ if (count < 140)
+ return gBirchDexRatingText_LessThan140;
+ if (count < 150)
+ return gBirchDexRatingText_LessThan150;
+ if (count < 160)
+ return gBirchDexRatingText_LessThan160;
+ if (count < 170)
+ return gBirchDexRatingText_LessThan170;
+ if (count < 180)
+ return gBirchDexRatingText_LessThan180;
+ if (count < 190)
+ return gBirchDexRatingText_LessThan190;
+ if (count < 200)
+ return gBirchDexRatingText_LessThan200;
+ if (count == 200)
+ {
+ if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1)
+ || GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // Jirachi or Deoxys is not counted towards the dex completion. If either of these flags are enabled, it means the actual count is less than 200.
+ return gBirchDexRatingText_LessThan200;
+ return gBirchDexRatingText_DexCompleted;
+ }
+ if (count == 201)
+ {
+ if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1)
+ && GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // If both of these flags are enabled, it means the actual count is less than 200.
+ return gBirchDexRatingText_LessThan200;
+ return gBirchDexRatingText_DexCompleted;
+ }
+ if (count == 202)
+ return gBirchDexRatingText_DexCompleted; // Hoenn dex is considered complete, even though the hoenn dex count is 210.
+ return gBirchDexRatingText_LessThan10;
+}
+
+void ShowPokedexRatingMessage(void)
+{
+ ShowFieldMessage(GetPokedexRatingText(gSpecialVar_0x8004));
+}
diff --git a/src/menu.c b/src/menu.c
index d06f950d3..b20ab5164 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -63,7 +63,7 @@ static EWRAM_DATA void *gUnknown_0203CDAC[0x20] = {NULL};
const u16 gUnknown_0860F074[] = INCBIN_U16("graphics/interface/860F074.gbapal");
static const u8 gUnknown_0860F094[] = { 8, 4, 1 };
-static const struct WindowTemplate gUnknown_0860F098[] =
+static const struct WindowTemplate gUnknown_0860F098[] =
{
{ 0x00, 0x02, 0x0F, 0x1B, 0x04, 0x0F, 0x194 },
DUMMY_WIN_TEMPLATE
@@ -76,7 +76,7 @@ static const struct WindowTemplate gUnknown_0860F0A8 =
const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal");
const u8 gUnknown_0860F0D0[] = { 15, 1, 2 };
-const struct SomeUnkStruct_60F0D4 gUnknown_0860F0D4[] =
+const struct SomeUnkStruct_60F0D4 gUnknown_0860F0D4[] =
{
{ 12, 12, 0x00 },
{ 32, 12, 0x20 },
@@ -151,7 +151,7 @@ u16 sub_8197224(void)
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor)
{
struct TextSubPrinter printer;
-
+
printer.current_text_offset = str;
printer.windowId = windowId;
printer.fontId = fontId;
@@ -165,9 +165,9 @@ u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed,
printer.fgColor = fgColor;
printer.bgColor = bgColor;
printer.shadowColor = shadowColor;
-
+
gTextFlags.flag_1 = 0;
- return AddTextPrinter(&printer, speed, callback);
+ return AddTextPrinter(&printer, speed, callback);
}
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress)
@@ -234,7 +234,7 @@ void sub_819746C(u8 windowId, bool8 copyToVram)
void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
{
int i;
-
+
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 0,
tilemapLeft - 1,
@@ -256,7 +256,7 @@ void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height
1,
1,
STD_WINDOW_PALETTE_NUM);
-
+
for (i = tilemapTop; i < tilemapTop + height; i++)
{
FillBgTilemapBufferRect(bg,
@@ -274,7 +274,7 @@ void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height
1,
STD_WINDOW_PALETTE_NUM);
}
-
+
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 6,
tilemapLeft - 1,
@@ -1941,7 +1941,7 @@ void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 spee
printer.fgColor = color[1];
printer.bgColor = color[0];
printer.shadowColor = color[2];
-
+
AddTextPrinter(&printer, speed, NULL);
}
@@ -1962,7 +1962,7 @@ void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 left, u8 top, u8 le
printer.fgColor = color[1];
printer.bgColor = color[0];
printer.shadowColor = color[2];
-
+
AddTextPrinter(&printer, speed, NULL);
}
@@ -2373,14 +2373,14 @@ void sub_819A344(u8 a0, u8 *a1, u8 a2)
s32 flagCount;
u8 *endOfString;
u8 *string = a1;
-
+
*(string++) = EXT_CTRL_CODE_BEGIN;
*(string++) = EXT_CTRL_CODE_COLOR;
*(string++) = a2;
*(string++) = EXT_CTRL_CODE_BEGIN;
*(string++) = EXT_CTRL_CODE_SHADOW;
*(string++) = a2 + 1;
-
+
switch (a0)
{
case 0:
@@ -2388,9 +2388,9 @@ void sub_819A344(u8 a0, u8 *a1, u8 a2)
break;
case 1:
if (IsNationalPokedexEnabled())
- string = ConvertIntToDecimalStringN(string, pokedex_count(1), 0, 3);
+ string = ConvertIntToDecimalStringN(string, GetNationalPokedexCount(1), 0, 3);
else
- string = ConvertIntToDecimalStringN(string, sub_80C0844(1), 0, 3);
+ string = ConvertIntToDecimalStringN(string, GetHoennPokedexCount(1), 0, 3);
*string = EOS;
break;
case 2:
diff --git a/src/smokescreen.c b/src/smokescreen.c
new file mode 100644
index 000000000..9b37cd234
--- /dev/null
+++ b/src/smokescreen.c
@@ -0,0 +1,71 @@
+#include "global.h"
+#include "data2.h"
+#include "decompress.h"
+#include "sprite.h"
+#include "util.h"
+
+static void sub_8075370(struct Sprite *);
+
+u8 sub_807521C(s16 x, s16 y, u8 a3)
+{
+ u8 mainSpriteId;
+ u8 spriteId1, spriteId2, spriteId3, spriteId4;
+ struct Sprite *mainSprite;
+
+ if (GetSpriteTileStartByTag(gUnknown_0831C620.tag) == 0xFFFF)
+ {
+ LoadCompressedObjectPicUsingHeap(&gUnknown_0831C620);
+ LoadCompressedObjectPaletteUsingHeap(&gUnknown_0831C628);
+ }
+
+ mainSpriteId = CreateInvisibleSpriteWithCallback(sub_8075370);
+ mainSprite = &gSprites[mainSpriteId];
+ mainSprite->data[1] = a3;
+
+ spriteId1 = CreateSprite(&gUnknown_0831C688, x - 16, y - 16, 2);
+ gSprites[spriteId1].data[0] = mainSpriteId;
+ mainSprite->data[0]++;
+ AnimateSprite(&gSprites[spriteId1]);
+
+ spriteId2 = CreateSprite(&gUnknown_0831C688, x, y - 16, 2);
+ gSprites[spriteId2].data[0] = mainSpriteId;
+ mainSprite->data[0]++;
+ StartSpriteAnim(&gSprites[spriteId2], 1);
+ AnimateSprite(&gSprites[spriteId2]);
+
+ spriteId3 = CreateSprite(&gUnknown_0831C688, x - 16, y, 2);
+ gSprites[spriteId3].data[0] = mainSpriteId;
+ mainSprite->data[0]++;
+ StartSpriteAnim(&gSprites[spriteId3], 2);
+ AnimateSprite(&gSprites[spriteId3]);
+
+ spriteId4 = CreateSprite(&gUnknown_0831C688, x, y, 2);
+ gSprites[spriteId4].data[0] = mainSpriteId;
+ mainSprite->data[0]++;
+ StartSpriteAnim(&gSprites[spriteId4], 3);
+ AnimateSprite(&gSprites[spriteId4]);
+
+ return mainSpriteId;
+}
+
+static void sub_8075370(struct Sprite *sprite)
+{
+ if (!sprite->data[0])
+ {
+ FreeSpriteTilesByTag(gUnknown_0831C620.tag);
+ FreeSpritePaletteByTag(gUnknown_0831C628.tag);
+ if (!sprite->data[1])
+ DestroySprite(sprite);
+ else
+ sprite->callback = SpriteCallbackDummy;
+ }
+}
+
+void sub_80753B4(struct Sprite *sprite)
+{
+ if (sprite->animEnded)
+ {
+ gSprites[sprite->data[0]].data[0]--;
+ DestroySprite(sprite);
+ }
+}
diff --git a/src/tv.c b/src/tv.c
index fbe39fde0..b0dbc0dbc 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -1957,11 +1957,11 @@ void sub_80EDB44(void)
show->rivalTrainer.badgeCount = nBadges;
if (IsNationalPokedexEnabled())
{
- show->rivalTrainer.dexCount = pokedex_count(0x01);
+ show->rivalTrainer.dexCount = GetNationalPokedexCount(0x01);
}
else
{
- show->rivalTrainer.dexCount = sub_80C0844(0x01);
+ show->rivalTrainer.dexCount = GetHoennPokedexCount(0x01);
}
show->rivalTrainer.location = gMapHeader.regionMapSectionId;
show->rivalTrainer.mapDataId = gMapHeader.mapDataId;