summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/battle_setup.s4
-rw-r--r--asm/dodrio_berry_picking.s4
-rw-r--r--asm/event_data.s6
-rw-r--r--asm/evolution_scene.s4
-rw-r--r--asm/hall_of_fame.s4
-rw-r--r--asm/main_menu.s418
-rw-r--r--asm/mon_markings.s2
-rw-r--r--asm/option_menu.s8
-rw-r--r--asm/trade.s6
-rw-r--r--berry_fix/payload/include/global.h2
-rw-r--r--data/data.s45
-rw-r--r--data/main_menu/unk_8234648.pal19
-rw-r--r--data/main_menu/unk_8234668.pal19
-rw-r--r--data/specials.inc4
-rw-r--r--data/strings.s6
-rw-r--r--include/constants/flags.h2
-rw-r--r--include/constants/global.h2
-rw-r--r--include/constants/songs.h2
-rw-r--r--include/event_data.h2
-rw-r--r--include/help_system.h6
-rw-r--r--include/main_menu.h2
-rw-r--r--include/strings.h6
-rw-r--r--include/text_window_graphics.h2
-rw-r--r--ld_script.txt2
-rw-r--r--src/berry_fix_program.c2
-rw-r--r--src/daycare.c6
-rw-r--r--src/help_system.c6
-rw-r--r--src/help_system_812B1E0.c8
-rw-r--r--src/link.c4
-rw-r--r--src/main.c4
-rw-r--r--src/main_menu.c386
-rw-r--r--src/menews_jisan.c2
-rw-r--r--src/mevent.c2
-rw-r--r--src/mystery_gift_menu.c2
-rw-r--r--src/new_game.c2
-rw-r--r--src/quest_log.c4
-rw-r--r--src/seagallop.c4
-rw-r--r--src/text_window_graphics.c2
-rw-r--r--src/title_screen.c6
-rw-r--r--sym_common.txt2
40 files changed, 367 insertions, 652 deletions
diff --git a/asm/battle_setup.s b/asm/battle_setup.s
index c5b4510b7..5a9797056 100644
--- a/asm/battle_setup.s
+++ b/asm/battle_setup.s
@@ -28,7 +28,7 @@ _0807F644:
bl FldEffPoison_IsActive
cmp r0, 0
bne _0807F686
- bl sub_812B478
+ bl HelpSystem_Disable
ldrb r0, [r4, 0x2]
bl BT_StartOnField
ldrh r0, [r4]
@@ -41,7 +41,7 @@ _0807F65E:
lsrs r0, 24
cmp r0, 0x1
bne _0807F686
- bl sub_812B484
+ bl HelpSystem_Enable
bl CleanupOverworldWindowsAndTilemaps
ldr r0, _0807F68C @ =sub_800FD9C
bl SetMainCallback2
diff --git a/asm/dodrio_berry_picking.s b/asm/dodrio_berry_picking.s
index 32b47791b..c9dd68e4b 100644
--- a/asm/dodrio_berry_picking.s
+++ b/asm/dodrio_berry_picking.s
@@ -8327,7 +8327,7 @@ sub_81546EC: @ 81546EC
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r1, [r0]
movs r2, 0x90
lsls r2, 1
@@ -8335,7 +8335,7 @@ sub_81546EC: @ 81546EC
movs r3, 0x1
bl LoadBgTiles
adds r0, r4, 0
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r0, [r0, 0x4]
movs r1, 0xA0
movs r2, 0x20
diff --git a/asm/event_data.s b/asm/event_data.s
index 4c7c7c828..f4aa51496 100644
--- a/asm/event_data.s
+++ b/asm/event_data.s
@@ -248,8 +248,8 @@ sub_806E2AC: @ 806E2AC
_0806E2B8: .4byte 0x00000839
thumb_func_end sub_806E2AC
- thumb_func_start sub_806E2BC
-sub_806E2BC: @ 806E2BC
+ thumb_func_start Flag_0x839_IsSet
+Flag_0x839_IsSet: @ 806E2BC
push {lr}
ldr r0, _0806E2CC @ =0x00000839
bl FlagGet
@@ -259,7 +259,7 @@ sub_806E2BC: @ 806E2BC
bx r1
.align 2, 0
_0806E2CC: .4byte 0x00000839
- thumb_func_end sub_806E2BC
+ thumb_func_end Flag_0x839_IsSet
thumb_func_start sub_806E2D0
sub_806E2D0: @ 806E2D0
diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s
index 1ffe9b0db..d8651a24c 100644
--- a/asm/evolution_scene.s
+++ b/asm/evolution_scene.s
@@ -388,7 +388,7 @@ EvolutionScene: @ 80CDDF4
ldr r0, _080CE0E0 @ =sub_80D0050
bl SetVBlankCallback
bl m4aMPlayAllStop
- bl sub_812B478
+ bl HelpSystem_Disable
ldr r0, _080CE0E4 @ =sub_80CE710
bl SetMainCallback2
add sp, 0x24
@@ -1852,7 +1852,7 @@ _080CEDB8:
beq _080CEDC6
b _080CF528
_080CEDC6:
- bl sub_812B484
+ bl HelpSystem_Enable
ldr r1, _080CEE20 @ =gTasks
mov r2, r8
adds r0, r2, r7
diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s
index 75475b667..ce675d88e 100644
--- a/asm/hall_of_fame.s
+++ b/asm/hall_of_fame.s
@@ -56,7 +56,7 @@ _080F1E04:
.4byte _080F1E88
.4byte _080F1EC4
_080F1E18:
- ldr r1, _080F1E40 @ =gUnknown_3005ECC
+ ldr r1, _080F1E40 @ =gHelpSystemEnabled
movs r0, 0
strb r0, [r1]
movs r0, 0
@@ -74,7 +74,7 @@ _080F1E18:
strb r1, [r0]
b _080F1EF0
.align 2, 0
-_080F1E40: .4byte gUnknown_3005ECC
+_080F1E40: .4byte gHelpSystemEnabled
_080F1E44: .4byte gUnknown_203AB3C
_080F1E48: .4byte 0x00002008
_080F1E4C: .4byte gMain
diff --git a/asm/main_menu.s b/asm/main_menu.s
deleted file mode 100644
index 664da29ee..000000000
--- a/asm/main_menu.s
+++ /dev/null
@@ -1,418 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start sub_800CED4
-sub_800CED4: @ 800CED4
- push {r4-r6,lr}
- sub sp, 0x2C
- ldr r6, _0800CF30 @ =gUnknown_823468B
- str r6, [sp]
- movs r5, 0x1
- negs r5, r5
- str r5, [sp, 0x4]
- ldr r0, _0800CF34 @ =gText_Time
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0x2
- movs r2, 0x2
- movs r3, 0x22
- bl AddTextPrinterParameterized3
- ldr r4, _0800CF38 @ =gSaveBlock2Ptr
- ldr r0, [r4]
- ldrh r1, [r0, 0xE]
- add r0, sp, 0xC
- movs r2, 0
- movs r3, 0x3
- bl ConvertIntToDecimalStringN
- movs r1, 0xF0
- strb r1, [r0]
- adds r0, 0x1
- ldr r1, [r4]
- ldrb r1, [r1, 0x10]
- movs r2, 0x2
- movs r3, 0x2
- bl ConvertIntToDecimalStringN
- str r6, [sp]
- str r5, [sp, 0x4]
- add r0, sp, 0xC
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0x2
- movs r2, 0x3E
- movs r3, 0x22
- bl AddTextPrinterParameterized3
- add sp, 0x2C
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_0800CF30: .4byte gUnknown_823468B
-_0800CF34: .4byte gText_Time
-_0800CF38: .4byte gSaveBlock2Ptr
- thumb_func_end sub_800CED4
-
- thumb_func_start sub_800CF3C
-sub_800CF3C: @ 800CF3C
- push {r4-r6,lr}
- sub sp, 0x2C
- ldr r0, _0800CF60 @ =0x00000829
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- bne _0800CFAE
- bl IsNationalPokedexEnabled
- cmp r0, 0
- beq _0800CF64
- movs r0, 0x1
- bl GetNationalPokedexCount
- b _0800CF6A
- .align 2, 0
-_0800CF60: .4byte 0x00000829
-_0800CF64:
- movs r0, 0x1
- bl GetKantoPokedexCount
-_0800CF6A:
- lsls r0, 16
- lsrs r6, r0, 16
- ldr r5, _0800CFB8 @ =gUnknown_823468B
- str r5, [sp]
- movs r4, 0x1
- negs r4, r4
- str r4, [sp, 0x4]
- ldr r0, _0800CFBC @ =gText_Pokedex
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0x2
- movs r2, 0x2
- movs r3, 0x32
- bl AddTextPrinterParameterized3
- add r0, sp, 0xC
- adds r1, r6, 0
- movs r2, 0
- movs r3, 0x3
- bl ConvertIntToDecimalStringN
- ldr r1, _0800CFC0 @ =gUnknown_841B6EB
- bl StringAppend
- str r5, [sp]
- str r4, [sp, 0x4]
- add r0, sp, 0xC
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0x2
- movs r2, 0x3E
- movs r3, 0x32
- bl AddTextPrinterParameterized3
-_0800CFAE:
- add sp, 0x2C
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_0800CFB8: .4byte gUnknown_823468B
-_0800CFBC: .4byte gText_Pokedex
-_0800CFC0: .4byte gUnknown_841B6EB
- thumb_func_end sub_800CF3C
-
- thumb_func_start sub_800CFC4
-sub_800CFC4: @ 800CFC4
- push {r4-r6,lr}
- sub sp, 0x2C
- movs r6, 0
- movs r4, 0x82
- lsls r4, 4
-_0800CFCE:
- lsls r0, r4, 16
- lsrs r0, 16
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _0800CFE2
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
-_0800CFE2:
- adds r4, 0x1
- ldr r0, _0800D034 @ =0x00000827
- cmp r4, r0
- bls _0800CFCE
- ldr r5, _0800D038 @ =gUnknown_823468B
- str r5, [sp]
- movs r4, 0x1
- negs r4, r4
- str r4, [sp, 0x4]
- ldr r0, _0800D03C @ =gUnknown_841B6EC
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0x2
- movs r2, 0x2
- movs r3, 0x42
- bl AddTextPrinterParameterized3
- add r0, sp, 0xC
- adds r1, r6, 0
- movs r2, 0x2
- movs r3, 0x1
- bl ConvertIntToDecimalStringN
- ldr r1, _0800D040 @ =gUnknown_841B6F3
- bl StringAppend
- str r5, [sp]
- str r4, [sp, 0x4]
- add r0, sp, 0xC
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0x2
- movs r2, 0x3E
- movs r3, 0x42
- bl AddTextPrinterParameterized3
- add sp, 0x2C
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_0800D034: .4byte 0x00000827
-_0800D038: .4byte gUnknown_823468B
-_0800D03C: .4byte gUnknown_841B6EC
-_0800D040: .4byte gUnknown_841B6F3
- thumb_func_end sub_800CFC4
-
- thumb_func_start sub_800D044
-sub_800D044: @ 800D044
- push {r4,r5,lr}
- adds r4, r0, 0
- lsls r4, 24
- lsrs r4, 24
- ldr r5, _0800D088 @ =gSaveBlock2Ptr
- ldr r0, [r5]
- ldrb r0, [r0, 0x14]
- lsrs r0, 3
- bl sub_8069788
- ldr r1, [r0]
- movs r2, 0x90
- lsls r2, 1
- ldr r3, _0800D08C @ =0x000001b1
- adds r0, r4, 0
- bl LoadBgTiles
- ldr r0, [r5]
- ldrb r0, [r0, 0x14]
- lsrs r0, 3
- bl sub_8069788
- ldr r0, [r0, 0x4]
- movs r1, 0x20
- movs r2, 0x20
- bl LoadPalette
- ldr r0, _0800D090 @ =gUnknown_8234638
- bl sub_800D1E8
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0800D088: .4byte gSaveBlock2Ptr
-_0800D08C: .4byte 0x000001b1
-_0800D090: .4byte gUnknown_8234638
- thumb_func_end sub_800D044
-
- thumb_func_start sub_800D094
-sub_800D094: @ 800D094
- push {lr}
- ldr r1, _0800D0AC @ =0x000001b1
- movs r0, 0
- movs r2, 0x20
- bl TextWindow_SetStdFrame0_WithPal
- ldr r0, _0800D0B0 @ =gUnknown_8234638
- bl sub_800D1E8
- pop {r0}
- bx r0
- .align 2, 0
-_0800D0AC: .4byte 0x000001b1
-_0800D0B0: .4byte gUnknown_8234638
- thumb_func_end sub_800D094
-
- thumb_func_start sub_800D0B4
-sub_800D0B4: @ 800D0B4
- push {r4-r6,lr}
- mov r6, r8
- push {r6}
- sub sp, 0xC
- adds r5, r0, 0
- ldrb r0, [r5]
- ldr r1, _0800D1D8 @ =0x000001b1
- ldrb r2, [r5, 0x1]
- subs r2, 0x1
- lsls r2, 24
- lsrs r2, 24
- ldrb r3, [r5, 0x2]
- subs r3, 0x1
- lsls r3, 24
- lsrs r3, 24
- movs r6, 0x1
- str r6, [sp]
- str r6, [sp, 0x4]
- movs r4, 0x2
- mov r8, r4
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- movs r1, 0xD9
- lsls r1, 1
- ldrb r2, [r5, 0x1]
- ldrb r3, [r5, 0x2]
- subs r3, 0x1
- lsls r3, 24
- lsrs r3, 24
- ldrb r4, [r5, 0x3]
- str r4, [sp]
- ldrb r4, [r5, 0x4]
- str r4, [sp, 0x4]
- mov r4, r8
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- ldr r1, _0800D1DC @ =0x000001b3
- ldrb r2, [r5, 0x3]
- ldrb r3, [r5, 0x1]
- adds r2, r3
- lsls r2, 24
- lsrs r2, 24
- ldrb r3, [r5, 0x2]
- subs r3, 0x1
- lsls r3, 24
- lsrs r3, 24
- str r6, [sp]
- str r6, [sp, 0x4]
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- movs r1, 0xDA
- lsls r1, 1
- ldrb r2, [r5, 0x1]
- subs r2, 0x1
- lsls r2, 24
- lsrs r2, 24
- ldrb r3, [r5, 0x2]
- str r6, [sp]
- ldrb r4, [r5, 0x4]
- str r4, [sp, 0x4]
- mov r4, r8
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- movs r1, 0xDB
- lsls r1, 1
- ldrb r2, [r5, 0x3]
- ldrb r3, [r5, 0x1]
- adds r2, r3
- lsls r2, 24
- lsrs r2, 24
- ldrb r3, [r5, 0x2]
- str r6, [sp]
- ldrb r4, [r5, 0x4]
- str r4, [sp, 0x4]
- mov r4, r8
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- ldr r1, _0800D1E0 @ =0x000001b7
- ldrb r2, [r5, 0x1]
- subs r2, 0x1
- lsls r2, 24
- lsrs r2, 24
- ldrb r3, [r5, 0x4]
- ldrb r4, [r5, 0x2]
- adds r3, r4
- lsls r3, 24
- lsrs r3, 24
- str r6, [sp]
- str r6, [sp, 0x4]
- mov r4, r8
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- movs r1, 0xDC
- lsls r1, 1
- ldrb r2, [r5, 0x1]
- ldrb r3, [r5, 0x4]
- ldrb r4, [r5, 0x2]
- adds r3, r4
- lsls r3, 24
- lsrs r3, 24
- ldrb r4, [r5, 0x3]
- str r4, [sp]
- str r6, [sp, 0x4]
- mov r4, r8
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- ldr r1, _0800D1E4 @ =0x000001b9
- ldrb r2, [r5, 0x3]
- ldrb r3, [r5, 0x1]
- adds r2, r3
- lsls r2, 24
- lsrs r2, 24
- ldrb r3, [r5, 0x4]
- ldrb r4, [r5, 0x2]
- adds r3, r4
- lsls r3, 24
- lsrs r3, 24
- str r6, [sp]
- str r6, [sp, 0x4]
- mov r4, r8
- str r4, [sp, 0x8]
- bl FillBgTilemapBufferRect
- ldrb r0, [r5]
- bl CopyBgTilemapBufferToVram
- add sp, 0xC
- pop {r3}
- mov r8, r3
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_0800D1D8: .4byte 0x000001b1
-_0800D1DC: .4byte 0x000001b3
-_0800D1E0: .4byte 0x000001b7
-_0800D1E4: .4byte 0x000001b9
- thumb_func_end sub_800D0B4
-
- thumb_func_start sub_800D1E8
-sub_800D1E8: @ 800D1E8
- push {r4-r6,lr}
- sub sp, 0xC
- adds r6, r0, 0
- ldrb r0, [r6]
- ldrb r1, [r6, 0x1]
- subs r2, r1, 0x1
- lsls r2, 24
- lsrs r2, 24
- ldrb r4, [r6, 0x2]
- subs r3, r4, 0x1
- lsls r3, 24
- lsrs r3, 24
- ldrb r5, [r6, 0x3]
- adds r1, r5
- adds r1, 0x1
- lsls r1, 24
- lsrs r1, 24
- str r1, [sp]
- ldrb r1, [r6, 0x4]
- adds r4, r1
- adds r4, 0x1
- lsls r4, 24
- lsrs r4, 24
- str r4, [sp, 0x4]
- movs r1, 0x2
- str r1, [sp, 0x8]
- movs r1, 0
- bl FillBgTilemapBufferRect
- ldrb r0, [r6]
- bl CopyBgTilemapBufferToVram
- add sp, 0xC
- pop {r4-r6}
- pop {r0}
- bx r0
- thumb_func_end sub_800D1E8
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/mon_markings.s b/asm/mon_markings.s
index 568129eff..5408a70be 100644
--- a/asm/mon_markings.s
+++ b/asm/mon_markings.s
@@ -22,7 +22,7 @@ sub_80BE478: @ 80BE478
ldr r0, [r0]
ldrb r0, [r0, 0x14]
lsrs r0, 3
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r3, _080BE4B4 @ =gUnknown_20399C0
ldr r2, [r3]
ldr r1, [r0]
diff --git a/asm/option_menu.s b/asm/option_menu.s
index bf626caba..bb370f0ba 100644
--- a/asm/option_menu.s
+++ b/asm/option_menu.s
@@ -459,7 +459,7 @@ _0808870C:
b _08088768
_08088716:
ldrb r0, [r0, 0xA]
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r1, [r0]
movs r2, 0x90
lsls r2, 1
@@ -470,7 +470,7 @@ _08088716:
b _0808876C
_0808872E:
ldrb r0, [r0, 0xA]
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r0, [r0, 0x4]
movs r1, 0x20
b _0808874C
@@ -590,7 +590,7 @@ _08088824:
ldr r4, _08088854 @ =gUnknown_2039620
ldr r0, [r4]
ldrb r0, [r0, 0xA]
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r1, [r0]
movs r2, 0x90
lsls r2, 1
@@ -600,7 +600,7 @@ _08088824:
bl LoadBgTiles
ldr r0, [r4]
ldrb r0, [r0, 0xA]
- bl sub_8069788
+ bl GetUserFrameGraphicsInfo
ldr r0, [r0, 0x4]
movs r1, 0x20
movs r2, 0x20
diff --git a/asm/trade.s b/asm/trade.s
index 0c1c168cc..8e6131f9d 100644
--- a/asm/trade.s
+++ b/asm/trade.s
@@ -11140,7 +11140,7 @@ _0805230A:
ldr r0, _08052328 @ =CB2_ReturnToField
bl SetMainCallback2
bl sub_8053AE4
- bl sub_812B484
+ bl HelpSystem_Enable
_08052318:
movs r0, 0
_0805231A:
@@ -13365,7 +13365,7 @@ _08053766:
ldr r0, _08053784 @ =CB2_ReturnToField
bl SetMainCallback2
bl sub_8053AE4
- bl sub_812B484
+ bl HelpSystem_Enable
_08053774:
movs r0, 0
_08053776:
@@ -14854,7 +14854,7 @@ sub_8054440: @ 8054440
movs r2, 0
movs r3, 0x10
bl BeginNormalPaletteFade
- bl sub_812B478
+ bl HelpSystem_Disable
add sp, 0x4
pop {r0}
bx r0
diff --git a/berry_fix/payload/include/global.h b/berry_fix/payload/include/global.h
index c218b5f4e..911c4cd8f 100644
--- a/berry_fix/payload/include/global.h
+++ b/berry_fix/payload/include/global.h
@@ -115,7 +115,7 @@ enum
enum
{
- OPTIONS_BUTTON_MODE_NORMAL,
+ OPTIONS_BUTTON_MODE_HELP,
OPTIONS_BUTTON_MODE_LR,
OPTIONS_BUTTON_MODE_L_EQUALS_A
};
diff --git a/data/data.s b/data/data.s
index 1757ea056..0883c65d7 100644
--- a/data/data.s
+++ b/data/data.s
@@ -6,51 +6,6 @@
.section .rodata
- .align 2, 0
-gUnknown_8234614::
- .string "$"
-
-gUnknown_8234615::
- .string "\n$"
-
- .align 2, 0
-gUnknown_8234618:: @ 8234618
- .byte 0x00, 0x03, 0x01, 0x18, 0x02, 0x0f
- .2byte 0x0001
-
-gUnknown_8234620:: @ 8234620
- .byte 0x00, 0x03, 0x01, 0x18, 0x0a, 0x0f
- .2byte 0x0001
- .byte 0x00, 0x03, 0x0d, 0x18, 0x02, 0x0f
- .2byte 0x00f1
- .byte 0x00, 0x03, 0x11, 0x18, 0x02, 0x0f
- .2byte 0x0121
-
-gUnknown_8234638:: @ 8234638
- .byte 0x00, 0x03, 0x0f, 0x18, 0x04, 0x0f
- .2byte 0x0001
- .byte 0xff, 0x00, 0x00, 0x00, 0x00, 0x00
- .2byte 0x0000
-
-gUnknown_8234648:: @ 8234648
- .incbin "baserom.gba", 0x234648, 0x20
-
-gUnknown_8234668:: @ 8234668
- .incbin "baserom.gba", 0x234668, 0x20
-
-gUnknown_8234688:: @ 8234688
- .incbin "baserom.gba", 0x234688, 0x3
-
-gUnknown_823468B:: @ 823468B
- .incbin "baserom.gba", 0x23468B, 0x3
-
- .align 2
-gUnknown_8234690:: @ 8234690
- .incbin "baserom.gba", 0x234690, 0x4
-
-gUnknown_8234694:: @ 8234694
- .incbin "baserom.gba", 0x234694, 0x4
-
.align 2
gUnknown_8234698:: @ 8234698
.incbin "baserom.gba", 0x234698, 0x20
diff --git a/data/main_menu/unk_8234648.pal b/data/main_menu/unk_8234648.pal
new file mode 100644
index 000000000..7aca54c52
--- /dev/null
+++ b/data/main_menu/unk_8234648.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+139 148 255
+255 255 255
+49 57 82
+90 98 115
+8 8 16
+148 156 172
+205 222 238
+180 180 189
+189 205 222
+32 32 49
+123 131 139
+49 82 123
+41 123 197
+57 139 213
+90 164 230
+139 197 246
diff --git a/data/main_menu/unk_8234668.pal b/data/main_menu/unk_8234668.pal
new file mode 100644
index 000000000..022f0051f
--- /dev/null
+++ b/data/main_menu/unk_8234668.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+255 255 255
+255 255 255
+98 98 98
+213 213 205
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+255 255 255
+98 98 98
+213 213 205
+0 0 0
+0 0 0
+0 0 0
diff --git a/data/specials.inc b/data/specials.inc
index 5e9a3aeae..6111e4836 100644
--- a/data/specials.inc
+++ b/data/specials.inc
@@ -417,8 +417,8 @@ gSpecials:: @ 815FD60
def_special sub_814B504
def_special sub_80CC8CC
def_special sub_80CC948
- def_special sub_812B478
- def_special sub_812B484
+ def_special HelpSystem_Disable
+ def_special HelpSystem_Enable
def_special sub_810B82C
def_special CheckHasAtLeastOneBerry
def_special sub_815F094
diff --git a/data/strings.s b/data/strings.s
index eccd54800..e43a37050 100644
--- a/data/strings.s
+++ b/data/strings.s
@@ -3049,13 +3049,13 @@ gText_Colon:: @ 0x841B6E1
gText_Pokedex:: @ 841B6E3
.string "POKéDEX$"
-gUnknown_841B6EB:: @ 841B6EB
+gTextJPDummy_Hiki:: @ 841B6EB
.string "$"
-gUnknown_841B6EC:: @ 841B6EC
+gText_Badges:: @ 841B6EC
.string "BADGES$"
-gUnknown_841B6F3:: @ 841B6F3
+gTextJPDummy_Ko:: @ 841B6F3
.string "$"
gUnknown_841B6F4:: @ 0x841B6F4
diff --git a/include/constants/flags.h b/include/constants/flags.h
index 7f4655d4e..b13be9d9a 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -1377,7 +1377,7 @@
#define TRAINERS_FLAG_NO 0x356
#define CODE_FLAGS (FLAG_TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860
-// TODO: Find what these are
+// TODO: These three are badge flags
#define FLAG_UNK820 0x820
#define FLAG_UNK824 0x824
#define FLAG_UNK826 0x826
diff --git a/include/constants/global.h b/include/constants/global.h
index 3cac8d473..d7508c940 100644
--- a/include/constants/global.h
+++ b/include/constants/global.h
@@ -45,7 +45,7 @@ enum
enum
{
- OPTIONS_BUTTON_MODE_NORMAL,
+ OPTIONS_BUTTON_MODE_HELP,
OPTIONS_BUTTON_MODE_LR,
OPTIONS_BUTTON_MODE_L_EQUALS_A
};
diff --git a/include/constants/songs.h b/include/constants/songs.h
index 193a57756..3c0e72757 100644
--- a/include/constants/songs.h
+++ b/include/constants/songs.h
@@ -254,7 +254,7 @@
#define SE_SHIP_HORN 249
#define SE_HELP_OPEN 250
#define SE_HELP_CLOSE 251
-#define SE_HELP_PAGE 252
+#define SE_HELP_ERR 252
#define MUS_ME_ASA 256
#define MUS_FANFA1 257
diff --git a/include/event_data.h b/include/event_data.h
index 036b0a325..7c62ac92b 100644
--- a/include/event_data.h
+++ b/include/event_data.h
@@ -32,7 +32,7 @@ u8 FlagSet(u16 id);
u8 FlagClear(u16 id);
bool8 FlagGet(u16 id);
u16 * GetVarPointer(u16 id);
-bool32 sub_806E2BC(void);
+bool32 Flag_0x839_IsSet(void);
void sub_806E6FC(void);
void sub_806E2D0(void);
void sub_806E370(void);
diff --git a/include/help_system.h b/include/help_system.h
index 3ba0cf475..f28c168f7 100644
--- a/include/help_system.h
+++ b/include/help_system.h
@@ -25,7 +25,7 @@ struct HelpSystemListMenu
extern struct HelpSystemListMenu gHelpSystemListMenu;
extern struct ListMenuItem gHelpSystemListMenuItems[];
-extern bool8 gUnknown_3005ECC;
+extern bool8 gHelpSystemEnabled;
extern u8 gUnknown_203F175;
// help_system_812B1E0
@@ -33,8 +33,8 @@ void sub_812B1E0(u8);
void HelpSystem_SetSomeVariable2(u8);
bool8 sub_812B40C(void);
bool8 sub_812B45C(void);
-void sub_812B478(void);
-void sub_812B484(void);
+void HelpSystem_Disable(void);
+void HelpSystem_Enable(void);
void sub_812B4B8(void);
bool8 sub_812BB9C(struct HelpSystemListMenu * a0, struct ListMenuItem * a1);
bool8 sub_812BC54(struct HelpSystemListMenu * a0, struct ListMenuItem * a1);
diff --git a/include/main_menu.h b/include/main_menu.h
index 2a0cd81d5..d8c2a5ab1 100644
--- a/include/main_menu.h
+++ b/include/main_menu.h
@@ -1,6 +1,6 @@
#ifndef GUARD_MAIN_MENU_H
#define GUARD_MAIN_MENU_H
-void sub_800C300(void);
+void CB2_InitMainMenu(void);
#endif //GUARD_MAIN_MENU_H
diff --git a/include/strings.h b/include/strings.h
index 5a746fb6a..e7d40281d 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -357,9 +357,9 @@ extern const u8 gText_Player[];
extern const u8 gText_Time[];
extern const u8 gText_Colon[];
extern const u8 gText_Pokedex[];
-extern const u8 gUnknown_841B6EB[];
-extern const u8 gUnknown_841B6EC[];
-extern const u8 gUnknown_841B6F3[];
+extern const u8 gTextJPDummy_Hiki[];
+extern const u8 gText_Badges[];
+extern const u8 gTextJPDummy_Ko[];
extern const u8 gUnknown_841B6F4[];
// mystery_gift_menu
diff --git a/include/text_window_graphics.h b/include/text_window_graphics.h
index 17e919705..e2b351de9 100644
--- a/include/text_window_graphics.h
+++ b/include/text_window_graphics.h
@@ -14,6 +14,6 @@ extern const u16 gUnknown_8471DEC[][16];
extern const struct TextWindowGraphics gUserFrames[];
-const struct TextWindowGraphics * sub_8069788(u8 idx);
+const struct TextWindowGraphics * GetUserFrameGraphicsInfo(u8 idx);
#endif //GUARD_TEXT_WINDOW_GRAPHICS_H
diff --git a/ld_script.txt b/ld_script.txt
index 35c85e935..c9de54716 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -63,7 +63,6 @@ SECTIONS {
src/link.o(.text);
src/multiboot.o(.text);
src/main_menu.o(.text);
- asm/main_menu.o(.text);
src/battle_controllers.o(.text);
src/decompress.o(.text);
asm/battle_1.o(.text);
@@ -381,6 +380,7 @@ SECTIONS {
src/bg_regs.o(.rodata);
src/string_util.o(.rodata);
src/link.o(.rodata);
+ src/main_menu.o(.rodata);
data/data.o(.rodata);
src/battle_util.o(.rodata);
src/battle_script_commands.o(.rodata);
diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c
index f224bbc47..7c7c452f3 100644
--- a/src/berry_fix_program.c
+++ b/src/berry_fix_program.c
@@ -95,7 +95,7 @@ void mb_berry_fix_serve(void) // noreturn
ResetSpriteData();
ResetTasks();
ScanlineEffect_Stop();
- gUnknown_3005ECC = 0;
+ gHelpSystemEnabled = 0;
taskId = CreateTask(mb_berry_fix_task, 0);
gTasks[taskId].data[0] = 0;
SetMainCallback2(mb_berry_fix_maincb);
diff --git a/src/daycare.c b/src/daycare.c
index c082b4298..1690953ee 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -1795,7 +1795,7 @@ void EggHatch(void)
ScriptContext2_Enable();
CreateTask(Task_EggHatch, 10);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
- sub_812B478();
+ HelpSystem_Disable();
}
static void Task_EggHatch(u8 taskID)
@@ -1901,7 +1901,7 @@ static void EggHatchSetMonNickname(void)
SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3);
FreeMonSpritesGfx();
Free(sEggHatchData);
- sub_812B484();
+ HelpSystem_Enable();
SetMainCallback2(CB2_ReturnToField);
}
@@ -2024,7 +2024,7 @@ static void CB2_EggHatch_1(void)
UnsetBgTilemapBuffer(1);
Free(sEggHatchData);
SetMainCallback2(CB2_ReturnToField);
- sub_812B484();
+ HelpSystem_Enable();
}
break;
}
diff --git a/src/help_system.c b/src/help_system.c
index 2d96ae9d6..7859961db 100644
--- a/src/help_system.c
+++ b/src/help_system.c
@@ -49,15 +49,15 @@ u8 RunHelpSystemCallback(void)
{
case 0:
sInHelpSystem = 0;
- if (gSaveBlock2Ptr->optionsButtonMode != OPTIONS_BUTTON_MODE_NORMAL)
+ if (gSaveBlock2Ptr->optionsButtonMode != OPTIONS_BUTTON_MODE_HELP)
return 0;
if (JOY_NEW(R_BUTTON) && gUnknown_203F175 == 1)
return 0;
if (JOY_NEW(L_BUTTON | R_BUTTON))
{
- if (!sub_812B45C() || !gUnknown_3005ECC)
+ if (!sub_812B45C() || !gHelpSystemEnabled)
{
- PlaySE(SE_HELP_PAGE);
+ PlaySE(SE_HELP_ERR);
return 0;
}
m4aMPlayStop(&gMPlayInfo_SE1);
diff --git a/src/help_system_812B1E0.c b/src/help_system_812B1E0.c
index 024cfcf09..6fd069f1c 100644
--- a/src/help_system_812B1E0.c
+++ b/src/help_system_812B1E0.c
@@ -1005,16 +1005,16 @@ bool8 sub_812B45C(void)
return TRUE;
}
-void sub_812B478(void)
+void HelpSystem_Disable(void)
{
- gUnknown_3005ECC = 0;
+ gHelpSystemEnabled = 0;
}
-void sub_812B484(void)
+void HelpSystem_Enable(void)
{
if (gUnknown_203ADFA != 2 && gUnknown_203ADFA != 3)
{
- gUnknown_3005ECC = 1;
+ gHelpSystemEnabled = 1;
sub_812B4B8();
}
}
diff --git a/src/link.c b/src/link.c
index 9d67c984e..c51ec80af 100644
--- a/src/link.c
+++ b/src/link.c
@@ -1577,7 +1577,7 @@ static void CB2_PrintErrorMessage(void)
{
if (JOY_NEW(A_BUTTON))
{
- sub_812B484();
+ HelpSystem_Enable();
PlaySE(SE_PIN);
gWirelessCommType = 0;
sLinkErrorBuffer.unk_06 = 0;
@@ -1588,7 +1588,7 @@ static void CB2_PrintErrorMessage(void)
{
if (JOY_NEW(A_BUTTON))
{
- sub_812B484();
+ HelpSystem_Enable();
rfu_REQ_stopMode();
rfu_waitREQComplete();
DoSoftReset();
diff --git a/src/main.c b/src/main.c
index 0d4e2ee1e..eb1625473 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,7 +104,7 @@ static IntrFunc * const sTimerIntrFunc = gIntrTable + 0x7;
EWRAM_DATA u8 gDecompressionBuffer[0x4000] = {0};
EWRAM_DATA u16 gTrainerId = 0;
-extern bool8 gUnknown_3005ECC;
+extern bool8 gHelpSystemEnabled;
extern bool8 gWirelessCommType;
extern bool8 gUnknown_3005E88;
@@ -138,7 +138,7 @@ void AgbMain()
SetDefaultFontsPointer();
gSoftResetDisabled = FALSE;
- gUnknown_3005ECC = FALSE;
+ gHelpSystemEnabled = FALSE;
sub_80F50F4();
diff --git a/src/main_menu.c b/src/main_menu.c
index 7be99ce2c..a4db5b1f5 100644
--- a/src/main_menu.c
+++ b/src/main_menu.c
@@ -19,43 +19,104 @@
#include "sound.h"
#include "title_screen.h"
#include "help_system.h"
+#include "string_util.h"
+#include "pokedex.h"
+#include "text_window.h"
+#include "text_window_graphics.h"
#include "constants/songs.h"
-bool32 sub_800C318(u8 a0);
-void sub_800C4D0(u8 taskId);
-void sub_800C634(u8 taskId, const u8 *str);
-void sub_800C688(u8 taskId);
-void sub_800C704(u8 taskId);
-void sub_800C780(u8 taskId);
-void sub_800C7A0(u8 taskId);
-void sub_800C9CC(u8 taskId);
-void sub_800CA28(u8 taskId);
-void sub_800CA54(u8 taskId);
-void sub_800CA94(u8 taskId);
-void sub_800CB90(u8 taskId);
-void sub_800CC68(u8 taskId);
-void sub_800CC94(u8 menuType, u8 cursorPos);
-bool8 sub_800CCF8(u8 taskId);
-void sub_800CDF8(const u8 *str);
-void sub_800CE58(void);
-void sub_800CE70(void);
-void sub_800CED4(void);
-void sub_800CF3C(void);
-void sub_800CFC4(void);
-void sub_800D044(u8 a0);
-void sub_800D094(u8 a0);
-void sub_800D0B4(const struct WindowTemplate * template);
-void sub_800D1E8(const struct WindowTemplate * template);
-
-extern const struct WindowTemplate gUnknown_8234618[];
-extern const u16 gUnknown_8234648[];
-extern const u16 gUnknown_8234668[];
-extern const u8 gUnknown_8234688[];
-extern const u8 gUnknown_823468B[];
-extern const struct BgTemplate gUnknown_8234690[1];
-extern const u8 gUnknown_8234694[];
-
-void sub_800C2D4(void)
+static bool32 MainMenuGpuInit(u8 a0);
+static void Task_SetWin0BldRegsAndCheckSaveFile(u8 taskId);
+static void PrintSaveErrorStatus(u8 taskId, const u8 *str);
+static void Task_SaveErrorStatus_RunPrinterThenWaitButton(u8 taskId);
+static void Task_SetWin0BldRegsNoSaveFileCheck(u8 taskId);
+static void Task_WaitFadeAndPrintMainMenuText(u8 taskId);
+static void Task_PrintMainMenuText(u8 taskId);
+static void Task_WaitDma3AndFadeIn(u8 taskId);
+static void Task_UpdateVisualSelection(u8 taskId);
+static void Task_HandleMenuInput(u8 taskId);
+static void Task_ExecuteMainMenuSelection(u8 taskId);
+static void Task_MysteryGiftError(u8 taskId);
+static void Task_ReturnToTileScreen(u8 taskId);
+static void MoveWindowByMenuTypeAndCursorPos(u8 menuType, u8 cursorPos);
+static bool8 HandleMenuInput(u8 taskId);
+static void PrintMessageOnWindow4(const u8 *str);
+static void PrintContinueStats(void);
+static void PrintPlayerName(void);
+static void PrintPlayTime(void);
+static void PrintDexCount(void);
+static void PrintBadgeCount(void);
+static void LoadUserFrameToBg(u8 bgId);
+static void SetStdFrame0OnBg(u8 bgId);
+static void DrawBubbleBorder(const struct WindowTemplate * template);
+static void DestroyWindowBubbleFrame(const struct WindowTemplate * template);
+
+static const u8 sString_Dummy[] = _("");
+static const u8 sString_Newline[] = _("\n");
+
+static const struct WindowTemplate sWindowTemplate[] = {
+ {
+ .bg = 0,
+ .tilemapLeft = 3,
+ .tilemapTop = 1,
+ .width = 24,
+ .height = 2,
+ .paletteNum = 15,
+ .baseBlock = 0x001
+ }, {
+ .bg = 0,
+ .tilemapLeft = 3,
+ .tilemapTop = 1,
+ .width = 24,
+ .height = 10,
+ .paletteNum = 15,
+ .baseBlock = 0x001
+ }, {
+ .bg = 0,
+ .tilemapLeft = 3,
+ .tilemapTop = 13,
+ .width = 24,
+ .height = 2,
+ .paletteNum = 15,
+ .baseBlock = 0x0f1
+ }, {
+ .bg = 0,
+ .tilemapLeft = 3,
+ .tilemapTop = 17,
+ .width = 24,
+ .height = 2,
+ .paletteNum = 15,
+ .baseBlock = 0x121
+ }, {
+ .bg = 0,
+ .tilemapLeft = 3,
+ .tilemapTop = 15,
+ .width = 24,
+ .height = 4,
+ .paletteNum = 15,
+ .baseBlock = 0x001
+ }, DUMMY_WIN_TEMPLATE
+};
+
+static const u16 sBgPal00[] = INCBIN_U16("data/main_menu/unk_8234648.gbapal");
+static const u16 sBgPal15[] = INCBIN_U16("data/main_menu/unk_8234668.gbapal");
+
+static const u8 sTextColor1[] = { 10, 11, 12 };
+
+static const u8 sTextColor2[] = { 10, 1, 12 };
+
+static const struct BgTemplate sBgTemplate[] = {
+ {
+ .bg = 0,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 30,
+ .priority = 0
+ }
+};
+
+static const u8 gUnknown_8234694[] = { 0, 1, 2 };
+
+static void CB2_MainMenu(void)
{
RunTasks();
AnimateSprites();
@@ -63,24 +124,24 @@ void sub_800C2D4(void)
UpdatePaletteFade();
}
-void sub_800C2EC(void)
+static void VBlankCB_MainMenu(void)
{
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
}
-void sub_800C300(void)
+void CB2_InitMainMenu(void)
{
- sub_800C318(1);
+ MainMenuGpuInit(1);
}
-void sub_800C30C(void)
+static void CB2_InitMainMenu_2(void)
{
- sub_800C318(1);
+ MainMenuGpuInit(1);
}
-bool32 sub_800C318(u8 a0)
+static bool32 MainMenuGpuInit(u8 a0)
{
u8 taskId;
@@ -104,17 +165,17 @@ bool32 sub_800C318(u8 a0)
FreeAllSpritePalettes();
ResetPaletteFade();
ResetBgsAndClearDma3BusyFlags(FALSE);
- InitBgsFromTemplates(0, gUnknown_8234690, NELEMS(gUnknown_8234690));
+ InitBgsFromTemplates(0, sBgTemplate, NELEMS(sBgTemplate));
ChangeBgX(0, 0, 0);
ChangeBgY(0, 0, 0);
ChangeBgX(1, 0, 0);
ChangeBgY(1, 0, 0);
ChangeBgX(2, 0, 0);
ChangeBgY(2, 0, 0);
- InitWindows(gUnknown_8234618);
+ InitWindows(sWindowTemplate);
DeactivateAllTextPrinters();
- LoadPalette(gUnknown_8234648, 0x00, 0x20);
- LoadPalette(gUnknown_8234668, 0xF0, 0x20);
+ LoadPalette(sBgPal00, 0x00, 0x20);
+ LoadPalette(sBgPal15, 0xF0, 0x20);
SetGpuReg(REG_OFFSET_WIN0H, 0);
SetGpuReg(REG_OFFSET_WIN0V, 0);
SetGpuReg(REG_OFFSET_WININ, 0);
@@ -122,15 +183,15 @@ bool32 sub_800C318(u8 a0)
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
- SetMainCallback2(sub_800C2D4);
+ SetMainCallback2(CB2_MainMenu);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON);
- taskId = CreateTask(sub_800C4D0, 0);
+ taskId = CreateTask(Task_SetWin0BldRegsAndCheckSaveFile, 0);
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[8] = a0;
return FALSE;
}
-void sub_800C4D0(u8 taskId)
+static void Task_SetWin0BldRegsAndCheckSaveFile(u8 taskId)
{
if (!gPaletteFade.active)
{
@@ -144,8 +205,8 @@ void sub_800C4D0(u8 taskId)
switch (gSaveFileStatus)
{
case 1:
- sub_800D044(0);
- if (sub_806E2BC() == TRUE)
+ LoadUserFrameToBg(0);
+ if (Flag_0x839_IsSet() == TRUE)
{
gTasks[taskId].data[0] = 2;
}
@@ -153,18 +214,18 @@ void sub_800C4D0(u8 taskId)
{
gTasks[taskId].data[0] = 1;
}
- gTasks[taskId].func = sub_800C704;
+ gTasks[taskId].func = Task_SetWin0BldRegsNoSaveFileCheck;
break;
case 2:
- sub_800D094(0);
+ SetStdFrame0OnBg(0);
gTasks[taskId].data[0] = 0;
- sub_800C634(taskId, gText_SaveFileHasBeenDeleted);
+ PrintSaveErrorStatus(taskId, gText_SaveFileHasBeenDeleted);
break;
case 0xFF:
- sub_800D094(0);
+ SetStdFrame0OnBg(0);
gTasks[taskId].data[0] = 1;
- sub_800C634(taskId, gText_SaveFileCorruptedPrevWillBeLoaded);
- if (sub_806E2BC() == TRUE)
+ PrintSaveErrorStatus(taskId, gText_SaveFileCorruptedPrevWillBeLoaded);
+ if (Flag_0x839_IsSet() == TRUE)
{
gTasks[taskId].data[0] = 2;
}
@@ -175,29 +236,29 @@ void sub_800C4D0(u8 taskId)
break;
case 0:
default:
- sub_800D044(0);
+ LoadUserFrameToBg(0);
gTasks[taskId].data[0] = 0;
- gTasks[taskId].func = sub_800C704;
+ gTasks[taskId].func = Task_SetWin0BldRegsNoSaveFileCheck;
break;
case 4:
- sub_800D094(0);
+ SetStdFrame0OnBg(0);
gTasks[taskId].data[0] = 0;
- sub_800C634(taskId, gText_1MSubCircuitBoardNotInstalled);
+ PrintSaveErrorStatus(taskId, gText_1MSubCircuitBoardNotInstalled);
break;
}
}
}
-void sub_800C634(u8 taskId, const u8 *str)
+static void PrintSaveErrorStatus(u8 taskId, const u8 *str)
{
- sub_800CDF8(str);
- gTasks[taskId].func = sub_800C688;
+ PrintMessageOnWindow4(str);
+ gTasks[taskId].func = Task_SaveErrorStatus_RunPrinterThenWaitButton;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0xFFFF);
ShowBg(0);
- SetVBlankCallback(sub_800C2EC);
+ SetVBlankCallback(VBlankCB_MainMenu);
}
-void sub_800C688(u8 taskId)
+static void Task_SaveErrorStatus_RunPrinterThenWaitButton(u8 taskId)
{
if (!gPaletteFade.active)
{
@@ -205,17 +266,17 @@ void sub_800C688(u8 taskId)
if (!IsTextPrinterActive(4) && JOY_NEW(A_BUTTON))
{
ClearWindowTilemap(4);
- sub_800D1E8(&gUnknown_8234618[4]);
- sub_800D044(0);
+ DestroyWindowBubbleFrame(&sWindowTemplate[4]);
+ LoadUserFrameToBg(0);
if (gTasks[taskId].data[0] == 0)
- gTasks[taskId].func = sub_800C704;
+ gTasks[taskId].func = Task_SetWin0BldRegsNoSaveFileCheck;
else
- gTasks[taskId].func = sub_800C7A0;
+ gTasks[taskId].func = Task_PrintMainMenuText;
}
}
}
-void sub_800C704(u8 taskId)
+static void Task_SetWin0BldRegsNoSaveFileCheck(u8 taskId)
{
if (!gPaletteFade.active)
{
@@ -229,21 +290,21 @@ void sub_800C704(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0));
SetGpuReg(REG_OFFSET_BLDY, 7);
if (gTasks[taskId].data[0] == 0)
- gTasks[taskId].func = sub_800CA94;
+ gTasks[taskId].func = Task_ExecuteMainMenuSelection;
else
- gTasks[taskId].func = sub_800C780;
+ gTasks[taskId].func = Task_WaitFadeAndPrintMainMenuText;
}
}
-void sub_800C780(u8 taskId)
+static void Task_WaitFadeAndPrintMainMenuText(u8 taskId)
{
if (!gPaletteFade.active)
{
- sub_800C7A0(taskId);
+ Task_PrintMainMenuText(taskId);
}
}
-void sub_800C7A0(u8 taskId)
+static void Task_PrintMainMenuText(u8 taskId)
{
u16 pal;
SetGpuReg(REG_OFFSET_WIN0H, 0);
@@ -265,19 +326,19 @@ void sub_800C7A0(u8 taskId)
case 0:
default:
FillWindowPixelBuffer(0, PIXEL_FILL(10));
- AddTextPrinterParameterized3(0, 2, 2, 2, gUnknown_8234688, -1, gText_NewGame);
- sub_800D0B4(&gUnknown_8234618[0]);
+ AddTextPrinterParameterized3(0, 2, 2, 2, sTextColor1, -1, gText_NewGame);
+ DrawBubbleBorder(&sWindowTemplate[0]);
PutWindowTilemap(0);
CopyWindowToVram(0, 3);
break;
case 1:
FillWindowPixelBuffer(1, PIXEL_FILL(10));
FillWindowPixelBuffer(2, PIXEL_FILL(10));
- AddTextPrinterParameterized3(1, 2, 2, 2, gUnknown_8234688, -1, gText_Continue);
- AddTextPrinterParameterized3(2, 2, 2, 2, gUnknown_8234688, -1, gText_NewGame);
- sub_800CE58();
- sub_800D0B4(&gUnknown_8234618[1]);
- sub_800D0B4(&gUnknown_8234618[2]);
+ AddTextPrinterParameterized3(1, 2, 2, 2, sTextColor1, -1, gText_Continue);
+ AddTextPrinterParameterized3(2, 2, 2, 2, sTextColor1, -1, gText_NewGame);
+ PrintContinueStats();
+ DrawBubbleBorder(&sWindowTemplate[1]);
+ DrawBubbleBorder(&sWindowTemplate[2]);
PutWindowTilemap(1);
PutWindowTilemap(2);
CopyWindowToVram(1, 2);
@@ -287,14 +348,14 @@ void sub_800C7A0(u8 taskId)
FillWindowPixelBuffer(1, PIXEL_FILL(10));
FillWindowPixelBuffer(2, PIXEL_FILL(10));
FillWindowPixelBuffer(3, PIXEL_FILL(10));
- AddTextPrinterParameterized3(1, 2, 2, 2, gUnknown_8234688, -1, gText_Continue);
- AddTextPrinterParameterized3(2, 2, 2, 2, gUnknown_8234688, -1, gText_NewGame);
+ AddTextPrinterParameterized3(1, 2, 2, 2, sTextColor1, -1, gText_Continue);
+ AddTextPrinterParameterized3(2, 2, 2, 2, sTextColor1, -1, gText_NewGame);
gTasks[taskId].data[10] = 1;
- AddTextPrinterParameterized3(3, 2, 2, 2, gUnknown_8234688, -1, gText_MysteryGift);
- sub_800CE58();
- sub_800D0B4(&gUnknown_8234618[1]);
- sub_800D0B4(&gUnknown_8234618[2]);
- sub_800D0B4(&gUnknown_8234618[3]);
+ AddTextPrinterParameterized3(3, 2, 2, 2, sTextColor1, -1, gText_MysteryGift);
+ PrintContinueStats();
+ DrawBubbleBorder(&sWindowTemplate[1]);
+ DrawBubbleBorder(&sWindowTemplate[2]);
+ DrawBubbleBorder(&sWindowTemplate[3]);
PutWindowTilemap(1);
PutWindowTilemap(2);
PutWindowTilemap(3);
@@ -303,35 +364,35 @@ void sub_800C7A0(u8 taskId)
CopyWindowToVram(3, 3);
break;
}
- gTasks[taskId].func = sub_800C9CC;
+ gTasks[taskId].func = Task_WaitDma3AndFadeIn;
}
-void sub_800C9CC(u8 taskId)
+static void Task_WaitDma3AndFadeIn(u8 taskId)
{
if (CheckForSpaceForDma3Request(-1) != -1)
{
- gTasks[taskId].func = sub_800CA28;
+ gTasks[taskId].func = Task_UpdateVisualSelection;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0xFFFF);
ShowBg(0);
- SetVBlankCallback(sub_800C2EC);
+ SetVBlankCallback(VBlankCB_MainMenu);
}
}
-void sub_800CA28(u8 taskId)
+static void Task_UpdateVisualSelection(u8 taskId)
{
- sub_800CC94(gTasks[taskId].data[0], gTasks[taskId].data[1]);
- gTasks[taskId].func = sub_800CA54;
+ MoveWindowByMenuTypeAndCursorPos(gTasks[taskId].data[0], gTasks[taskId].data[1]);
+ gTasks[taskId].func = Task_HandleMenuInput;
}
-void sub_800CA54(u8 taskId)
+static void Task_HandleMenuInput(u8 taskId)
{
- if (!gPaletteFade.active && sub_800CCF8(taskId))
+ if (!gPaletteFade.active && HandleMenuInput(taskId))
{
- gTasks[taskId].func = sub_800CA28;
+ gTasks[taskId].func = Task_UpdateVisualSelection;
}
}
-void sub_800CA94(u8 taskId)
+static void Task_ExecuteMainMenuSelection(u8 taskId)
{
s32 r0;
if (!gPaletteFade.active)
@@ -367,8 +428,8 @@ void sub_800CA94(u8 taskId)
case 2:
if (!IsWirelessAdapterConnected())
{
- sub_800D094(0);
- gTasks[taskId].func = sub_800CB90;
+ SetStdFrame0OnBg(0);
+ gTasks[taskId].func = Task_MysteryGiftError;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
return;
}
@@ -398,7 +459,7 @@ void sub_800CA94(u8 taskId)
break;
case 2:
SetMainCallback2(c2_mystery_gift);
- sub_812B478();
+ HelpSystem_Disable();
FreeAllWindowBuffers();
DestroyTask(taskId);
break;
@@ -406,16 +467,16 @@ void sub_800CA94(u8 taskId)
}
}
-void sub_800CB90(u8 taskId)
+static void Task_MysteryGiftError(u8 taskId)
{
switch (gTasks[taskId].data[9])
{
case 0:
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
if (gTasks[taskId].data[10] == 1)
- sub_800CDF8(gText_WirelessAdapterIsNotConnected);
+ PrintMessageOnWindow4(gText_WirelessAdapterIsNotConnected);
else
- sub_800CDF8(gText_MysteryGiftCantBeUsedWhileWirelessAdapterIsAttached);
+ PrintMessageOnWindow4(gText_MysteryGiftCantBeUsedWhileWirelessAdapterIsAttached);
gTasks[taskId].data[9]++;
break;
case 1:
@@ -432,13 +493,13 @@ void sub_800CB90(u8 taskId)
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
- gTasks[taskId].func = sub_800CC68;
+ gTasks[taskId].func = Task_ReturnToTileScreen;
}
break;
}
}
-void sub_800CC68(u8 taskId)
+static void Task_ReturnToTileScreen(u8 taskId)
{
if (!gPaletteFade.active)
{
@@ -447,7 +508,7 @@ void sub_800CC68(u8 taskId)
}
}
-void sub_800CC94(u8 menuType, u8 cursorPos)
+static void MoveWindowByMenuTypeAndCursorPos(u8 menuType, u8 cursorPos)
{
u16 win0v1, win0v2;
SetGpuReg(REG_OFFSET_WIN0H, 0x12DE);
@@ -481,14 +542,14 @@ void sub_800CC94(u8 menuType, u8 cursorPos)
SetGpuReg(REG_OFFSET_WIN0V, (win0v1 + (2 << 8)) | (win0v2 - 2));
}
-bool8 sub_800CCF8(u8 taskId)
+static bool8 HandleMenuInput(u8 taskId)
{
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
IsWirelessAdapterConnected(); // called for its side effects only
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
- gTasks[taskId].func = sub_800CA94;
+ gTasks[taskId].func = Task_ExecuteMainMenuSelection;
}
else if (JOY_NEW(B_BUTTON))
{
@@ -496,7 +557,7 @@ bool8 sub_800CCF8(u8 taskId)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
SetGpuReg(REG_OFFSET_WIN0H, 0xF0);
SetGpuReg(REG_OFFSET_WIN0V, 0xA0);
- gTasks[taskId].func = sub_800CC68;
+ gTasks[taskId].func = Task_ReturnToTileScreen;
}
else if (JOY_NEW(DPAD_UP) && gTasks[taskId].data[1] > 0)
{
@@ -512,34 +573,113 @@ bool8 sub_800CCF8(u8 taskId)
return FALSE;
}
-void sub_800CDF8(const u8 *str)
+static void PrintMessageOnWindow4(const u8 *str)
{
FillWindowPixelBuffer(4, PIXEL_FILL(10));
- sub_800D0B4(&gUnknown_8234618[4]);
- AddTextPrinterParameterized3(4, 2, 0, 2, gUnknown_8234688, 2, str);
+ DrawBubbleBorder(&sWindowTemplate[4]);
+ AddTextPrinterParameterized3(4, 2, 0, 2, sTextColor1, 2, str);
PutWindowTilemap(4);
CopyWindowToVram(4, 2);
SetGpuReg(REG_OFFSET_WIN0H, 0x13DD);
SetGpuReg(REG_OFFSET_WIN0V, 0x739D);
}
-void sub_800CE58(void)
+static void PrintContinueStats(void)
{
- sub_800CE70();
- sub_800CF3C();
- sub_800CED4();
- sub_800CFC4();
+ PrintPlayerName();
+ PrintDexCount();
+ PrintPlayTime();
+ PrintBadgeCount();
}
-void sub_800CE70(void)
+static void PrintPlayerName(void)
{
s32 i;
u8 name[OT_NAME_LENGTH + 1];
u8 *ptr;
- AddTextPrinterParameterized3(1, 2, 2, 18, gUnknown_823468B, -1, gText_Player);
+ AddTextPrinterParameterized3(1, 2, 2, 18, sTextColor2, -1, gText_Player);
ptr = name;
for (i = 0; i < OT_NAME_LENGTH; i++)
*ptr++ = gSaveBlock2Ptr->playerName[i];
*ptr = EOS;
- AddTextPrinterParameterized3(1, 2, 62, 18, gUnknown_823468B, -1, name);
+ AddTextPrinterParameterized3(1, 2, 62, 18, sTextColor2, -1, name);
+}
+
+static void PrintPlayTime(void)
+{
+ u8 strbuf[30];
+ u8 *ptr;
+
+ AddTextPrinterParameterized3(1, 2, 2, 34, sTextColor2, -1, gText_Time);
+ ptr = ConvertIntToDecimalStringN(strbuf, gSaveBlock2Ptr->playTimeHours, STR_CONV_MODE_LEFT_ALIGN, 3);
+ *ptr++ = CHAR_COLON;
+ ConvertIntToDecimalStringN(ptr, gSaveBlock2Ptr->playTimeMinutes, STR_CONV_MODE_LEADING_ZEROS, 2);
+ AddTextPrinterParameterized3(1, 2, 62, 34, sTextColor2, -1, strbuf);
+}
+
+static void PrintDexCount(void)
+{
+ u8 strbuf[30];
+ u8 *ptr;
+ u16 dexcount;
+ if (FlagGet(FLAG_0x829) == TRUE)
+ {
+ if (IsNationalPokedexEnabled())
+ dexcount = GetNationalPokedexCount(FLAG_GET_CAUGHT);
+ else
+ dexcount = GetKantoPokedexCount(FLAG_GET_CAUGHT);
+ AddTextPrinterParameterized3(1, 2, 2, 50, sTextColor2, -1, gText_Pokedex);
+ ptr = ConvertIntToDecimalStringN(strbuf, dexcount, STR_CONV_MODE_LEFT_ALIGN, 3);
+ StringAppend(ptr, gTextJPDummy_Hiki);
+ AddTextPrinterParameterized3(1, 2, 62, 50, sTextColor2, -1, strbuf);
+ }
+}
+
+static void PrintBadgeCount(void)
+{
+ u8 strbuf[30];
+ u8 *ptr;
+ u32 flagId;
+ u8 nbadges = 0;
+ for (flagId = FLAG_UNK820; flagId < FLAG_UNK820 + 8; flagId++)
+ {
+ if (FlagGet(flagId))
+ nbadges++;
+ }
+ AddTextPrinterParameterized3(1, 2, 2, 66, sTextColor2, -1, gText_Badges);
+ ptr = ConvertIntToDecimalStringN(strbuf, nbadges, STR_CONV_MODE_LEADING_ZEROS, 1);
+ StringAppend(ptr, gTextJPDummy_Ko);
+ AddTextPrinterParameterized3(1, 2, 62, 66, sTextColor2, -1, strbuf);
+}
+
+static void LoadUserFrameToBg(u8 bgId)
+{
+ LoadBgTiles(bgId, GetUserFrameGraphicsInfo(gSaveBlock2Ptr->optionsWindowFrameType)->tiles, 0x120, 0x1B1);
+ LoadPalette(GetUserFrameGraphicsInfo(gSaveBlock2Ptr->optionsWindowFrameType)->palette, 0x20, 0x20);
+ DestroyWindowBubbleFrame(&sWindowTemplate[4]);
+}
+
+static void SetStdFrame0OnBg(u8 bgId)
+{
+ TextWindow_SetStdFrame0_WithPal(0, 0x1B1, 0x20);
+ DestroyWindowBubbleFrame(&sWindowTemplate[4]);
+}
+
+static void DrawBubbleBorder(const struct WindowTemplate * windowTemplate)
+{
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B1, windowTemplate->tilemapLeft - 1, windowTemplate->tilemapTop - 1, 1, 1, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B2, windowTemplate->tilemapLeft, windowTemplate->tilemapTop - 1, windowTemplate->width, windowTemplate->height, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B3, windowTemplate->tilemapLeft + windowTemplate->width, windowTemplate->tilemapTop - 1, 1, 1, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B4, windowTemplate->tilemapLeft - 1, windowTemplate->tilemapTop, 1, windowTemplate->height, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B6, windowTemplate->tilemapLeft + windowTemplate->width, windowTemplate->tilemapTop, 1, windowTemplate->height, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B7, windowTemplate->tilemapLeft - 1, windowTemplate->tilemapTop + windowTemplate->height, 1, 1, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B8, windowTemplate->tilemapLeft, windowTemplate->tilemapTop + windowTemplate->height, windowTemplate->width, 1, 2);
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x1B9, windowTemplate->tilemapLeft + windowTemplate->width, windowTemplate->tilemapTop + windowTemplate->height, 1, 1, 2);
+ CopyBgTilemapBufferToVram(windowTemplate->bg);
+}
+
+static void DestroyWindowBubbleFrame(const struct WindowTemplate * windowTemplate)
+{
+ FillBgTilemapBufferRect(windowTemplate->bg, 0x000, windowTemplate->tilemapLeft - 1, windowTemplate->tilemapTop - 1, windowTemplate->tilemapLeft + windowTemplate->width + 1, windowTemplate->tilemapTop + windowTemplate->height + 1, 2);
+ CopyBgTilemapBufferToVram(windowTemplate->bg);
}
diff --git a/src/menews_jisan.c b/src/menews_jisan.c
index 0d406e66a..2f6172bbc 100644
--- a/src/menews_jisan.c
+++ b/src/menews_jisan.c
@@ -59,7 +59,7 @@ u16 sub_8146CE8(void)
struct MysteryEventStruct *r4 = sub_8143D94();
u16 r5;
- if (!sub_806E2BC() || !ValidateReceivedWonderNews())
+ if (!Flag_0x839_IsSet() || !ValidateReceivedWonderNews())
return 0;
r5 = sub_8146E0C(r4);
diff --git a/src/mevent.c b/src/mevent.c
index af2006e14..a7115d2d4 100644
--- a/src/mevent.c
+++ b/src/mevent.c
@@ -475,7 +475,7 @@ void sub_8143910(u8 taskId)
data->state = 0;
break;
case 26:
- sub_812B484();
+ HelpSystem_Enable();
Free(data->t10);
DestroyTask(taskId);
SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen);
diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c
index 39efed6eb..9c050810e 100644
--- a/src/mystery_gift_menu.c
+++ b/src/mystery_gift_menu.c
@@ -1680,7 +1680,7 @@ void task00_mystery_gift(u8 taskId)
break;
case 37:
CloseLink();
- sub_812B484();
+ HelpSystem_Enable();
Free(data->buffer);
DestroyTask(taskId);
SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen);
diff --git a/src/new_game.c b/src/new_game.c
index 58deac9b9..efeea13cc 100644
--- a/src/new_game.c
+++ b/src/new_game.c
@@ -66,7 +66,7 @@ static void SetDefaultOptions(void)
gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT;
gSaveBlock2Ptr->optionsBattleSceneOff = FALSE;
gSaveBlock2Ptr->regionMapZoom = FALSE;
- gSaveBlock2Ptr->optionsButtonMode = OPTIONS_BUTTON_MODE_NORMAL;
+ gSaveBlock2Ptr->optionsButtonMode = OPTIONS_BUTTON_MODE_HELP;
}
static void ClearPokedexFlags(void)
diff --git a/src/quest_log.c b/src/quest_log.c
index f98357b32..71cab91a1 100644
--- a/src/quest_log.c
+++ b/src/quest_log.c
@@ -854,7 +854,7 @@ void TrySetUpQuestLogScenes_ElseContinueFromSave(u8 taskId)
if (sNumScenes != 0)
{
- gUnknown_3005ECC = FALSE;
+ gHelpSystemEnabled = FALSE;
sub_8110F90(taskId);
DestroyTask(taskId);
}
@@ -1603,7 +1603,7 @@ void sub_81120AC(u8 taskId)
gTextFlags.autoScroll = FALSE;
gUnknown_2036E28 = 0;
sub_8082740(0);
- gUnknown_3005ECC = 1;
+ gHelpSystemEnabled = 1;
DestroyTask(taskId);
break;
}
diff --git a/src/seagallop.c b/src/seagallop.c
index 5374f7bac..006a356e4 100644
--- a/src/seagallop.c
+++ b/src/seagallop.c
@@ -179,7 +179,7 @@ static const struct SpriteTemplate sWakeSpriteTemplate = {
void ScrSpecial_SeaGallopFerry(void)
{
SetVBlankCallback(NULL);
- sub_812B478();
+ HelpSystem_Disable();
SetMainCallback2(CB2_SetUpSeaGallopScene);
}
@@ -306,7 +306,7 @@ static void Task_SeaGallop_2(u8 taskId)
if (sub_8055FC4() && !gPaletteFade.active)
{
Task_SeaGallop_3();
- sub_812B484();
+ HelpSystem_Enable();
DestroyTask(taskId);
}
}
diff --git a/src/text_window_graphics.c b/src/text_window_graphics.c
index e16037a34..0fb8b38f8 100644
--- a/src/text_window_graphics.c
+++ b/src/text_window_graphics.c
@@ -51,7 +51,7 @@ const struct TextWindowGraphics gUserFrames[] = {
{gUnknown_84717CC, gUnknown_8471A2C}
}; // NELEMS = 10
-const struct TextWindowGraphics * sub_8069788(u8 idx)
+const struct TextWindowGraphics * GetUserFrameGraphicsInfo(u8 idx)
{
if (idx >= 20) // if (idx >= NELEMS(gUserFrames))
return &gUserFrames[0];
diff --git a/src/title_screen.c b/src/title_screen.c
index f4086b2ff..26770b633 100644
--- a/src/title_screen.c
+++ b/src/title_screen.c
@@ -513,7 +513,7 @@ static void SetTitleScreenScene_Run(s16 * data)
CreateTask(Task_FlameOrLeafSpawner, 5);
SetGpuRegsForTitleScreenRun();
data[6] = CreateSlashSprite();
- sub_812B484();
+ HelpSystem_Enable();
data[1]++;
// fallthrough
case 1:
@@ -583,7 +583,7 @@ static void SetTitleScreenScene_Restart(s16 * data)
}
break;
case 4:
- sub_812B478();
+ HelpSystem_Disable();
DestroyTask(FindTaskIdByFunc(Task_TitleScreenMain));
SetMainCallback2(sub_80EC864);
break;
@@ -626,7 +626,7 @@ static void SetTitleScreenScene_Cry(s16 * data)
Sav2_ClearSetDefault();
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
InitHeap(gHeap, HEAP_SIZE);
- SetMainCallback2(sub_800C300);
+ SetMainCallback2(CB2_InitMainMenu);
DestroyTask(FindTaskIdByFunc(Task_TitleScreenMain));
}
break;
diff --git a/sym_common.txt b/sym_common.txt
index b251a32ba..7a2f5099b 100644
--- a/sym_common.txt
+++ b/sym_common.txt
@@ -221,7 +221,7 @@ gUnknown_3005E98: @ 3005E98
.align 4
.include "fame_checker.o"
-gUnknown_3005ECC: @ 3005ECC
+gHelpSystemEnabled: @ 3005ECC
.space 0x4
.include "mevent.o"